- #131 名册卡片加「分组」按钮(details+radio,显示当前分组,选中即改) - #132 修复「从已有人里加入名册」无反应 - #133 生日只显示月和日(阳历 MM-DD / 农历中文名),PersonQuery::birthdaysOf 取代 birthdayOf - #134 地址结构化为 国家/省/市/区+详细:regions 表(3429 行全国区划)+ Region.php + ?r=regions 级联接口 + 表单 .addr-grid + 老地址回填(Schema v16) - #135 千人名册性能:.person content-visibility:auto + 名册页 ob_gzhandler (实测 服务端 1.15s/3.8MB → 0.17s/87KB;客户端导航→load 1.35s → 0.37s) - #136 拖动排序改 Pointer Events(Chrome 下 HTML5 DnD 在 DOM 变动时断) - #137 个人详情页底部「删除人员」 - #138 编辑资料页加「返回名册」 - #139 所有日期选择换 Semi Design DatePicker(渐进增强:原生四字段保 POST 契约, 懒加载 vendor semi UMD,值回写原字段;工作经历 type=month 一并升级;宣纸主题对齐) 验证:e2e 785/0、batch9 37/0、upgrade 126/0、picker 28/0、mobile 688/0、interact 97/0、 batch_e 91/0、import 21/0、douban 22/0、drag 5/0、semi-integrate 28/0、semi-probe 17/0、 geom 5/5;部署后线上自检 16/16(含 4 个 semi 资源 200 + regions 路由)。
3 lines
3.3 MiB
Plaintext
3 lines
3.3 MiB
Plaintext
/*! For license information please see semi-ui.min.js.LICENSE.txt */
|
||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.SemiUI=t(require("react"),require("react-dom")):e.SemiUI=t(e.React,e.ReactDOM)}(self,((__WEBPACK_EXTERNAL_MODULE_neV8__,__WEBPACK_EXTERNAL_MODULE_sw63__)=>(()=>{var __webpack_modules__={yBkX:(e,t,n)=>{"use strict";const r=n("43tb"),i=/^[\da-fA-F]+$/,s=/^\d+$/,o=new WeakMap;function a(e){e=e.Parser.acorn||e;let t=o.get(e);if(!t){const n=e.tokTypes,r=e.TokContext,i=e.TokenType,s=new r("<tag",!1),a=new r("</tag",!1),l=new r("<tag>...</tag>",!0,!0),c={tc_oTag:s,tc_cTag:a,tc_expr:l},d={jsxName:new i("jsxName"),jsxText:new i("jsxText",{beforeExpr:!0}),jsxTagStart:new i("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new i("jsxTagEnd")};d.jsxTagStart.updateContext=function(){this.context.push(l),this.context.push(s),this.exprAllowed=!1},d.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===s&&e===n.slash||t===a?(this.context.pop(),this.exprAllowed=this.curContext()===l):this.exprAllowed=!0},t={tokContexts:c,tokTypes:d},o.set(e,t)}return t}function l(e){return e?"JSXIdentifier"===e.type?e.name:"JSXNamespacedName"===e.type?e.namespace.name+":"+e.name.name:"JSXMemberExpression"===e.type?l(e.object)+"."+l(e.property):void 0:e}e.exports=function(e){return e=e||{},function(t){return function(e,t){const o=t.acorn||n("88MF"),c=a(o),d=o.tokTypes,h=c.tokTypes,u=o.tokContexts,p=c.tokContexts.tc_oTag,f=c.tokContexts.tc_cTag,m=c.tokContexts.tc_expr,g=o.isNewLine,y=o.isIdentifierStart,v=o.isIdentifierChar;return class extends t{static get acornJsx(){return c}jsx_readToken(){let e="",t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let n=this.input.charCodeAt(this.pos);switch(n){case 60:case 123:return this.pos===this.start?60===n&&this.exprAllowed?(++this.pos,this.finishToken(h.jsxTagStart)):this.getTokenFromCode(n):(e+=this.input.slice(t,this.pos),this.finishToken(h.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(62===n?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:g(n)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t,n=this.input.charCodeAt(this.pos);return++this.pos,13===n&&10===this.input.charCodeAt(this.pos)?(++this.pos,t=e?"\n":"\r\n"):t=String.fromCharCode(n),this.options.locations&&(++this.curLine,this.lineStart=this.pos),t}jsx_readString(e){let t="",n=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let r=this.input.charCodeAt(this.pos);if(r===e)break;38===r?(t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos):g(r)?(t+=this.input.slice(n,this.pos),t+=this.jsx_readNewLine(!1),n=this.pos):++this.pos}return t+=this.input.slice(n,this.pos++),this.finishToken(d.string,t)}jsx_readEntity(){let e,t="",n=0,o=this.input[this.pos];"&"!==o&&this.raise(this.pos,"Entity must start with an ampersand");let a=++this.pos;for(;this.pos<this.input.length&&n++<10;){if(o=this.input[this.pos++],";"===o){"#"===t[0]?"x"===t[1]?(t=t.substr(2),i.test(t)&&(e=String.fromCharCode(parseInt(t,16)))):(t=t.substr(1),s.test(t)&&(e=String.fromCharCode(parseInt(t,10)))):e=r[t];break}t+=o}return e||(this.pos=a,"&")}jsx_readWord(){let e,t=this.pos;do{e=this.input.charCodeAt(++this.pos)}while(v(e)||45===e);return this.finishToken(h.jsxName,this.input.slice(t,this.pos))}jsx_parseIdentifier(){let e=this.startNode();return this.type===h.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsx_parseNamespacedName(){let t=this.start,n=this.startLoc,r=this.jsx_parseIdentifier();if(!e.allowNamespaces||!this.eat(d.colon))return r;var i=this.startNodeAt(t,n);return i.namespace=r,i.name=this.jsx_parseIdentifier(),this.finishNode(i,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===h.jsxTagEnd)return"";let t=this.start,n=this.startLoc,r=this.jsx_parseNamespacedName();for(this.type!==d.dot||"JSXNamespacedName"!==r.type||e.allowNamespacedObjects||this.unexpected();this.eat(d.dot);){let e=this.startNodeAt(t,n);e.object=r,e.property=this.jsx_parseIdentifier(),r=this.finishNode(e,"JSXMemberExpression")}return r}jsx_parseAttributeValue(){switch(this.type){case d.braceL:let e=this.jsx_parseExpressionContainer();return"JSXEmptyExpression"===e.expression.type&&this.raise(e.start,"JSX attributes must only be assigned a non-empty expression"),e;case h.jsxTagStart:case d.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let e=this.startNode();return this.next(),e.expression=this.type===d.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(d.braceR),this.finishNode(e,"JSXExpressionContainer")}jsx_parseAttribute(){let e=this.startNode();return this.eat(d.braceL)?(this.expect(d.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(d.braceR),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(d.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,"JSXAttribute"))}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t);n.attributes=[];let r=this.jsx_parseElementName();for(r&&(n.name=r);this.type!==d.slash&&this.type!==h.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(d.slash),this.expect(h.jsxTagEnd),this.finishNode(n,r?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(e,t){let n=this.startNodeAt(e,t),r=this.jsx_parseElementName();return r&&(n.name=r),this.expect(h.jsxTagEnd),this.finishNode(n,r?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(e,t){let n=this.startNodeAt(e,t),r=[],i=this.jsx_parseOpeningElementAt(e,t),s=null;if(!i.selfClosing){e:for(;;)switch(this.type){case h.jsxTagStart:if(e=this.start,t=this.startLoc,this.next(),this.eat(d.slash)){s=this.jsx_parseClosingElementAt(e,t);break e}r.push(this.jsx_parseElementAt(e,t));break;case h.jsxText:r.push(this.parseExprAtom());break;case d.braceL:r.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}l(s.name)!==l(i.name)&&this.raise(s.start,"Expected corresponding JSX closing tag for <"+l(i.name)+">")}let o=i.name?"Element":"Fragment";return n["opening"+o]=i,n["closing"+o]=s,n.children=r,this.type===d.relational&&"<"===this.value&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(n,"JSX"+o)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type="JSXText",e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}parseExprAtom(e){return this.type===h.jsxText?this.jsx_parseText():this.type===h.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(e)}readToken(e){let t=this.curContext();if(t===m)return this.jsx_readToken();if(t===p||t===f){if(y(e))return this.jsx_readWord();if(62==e)return++this.pos,this.finishToken(h.jsxTagEnd);if((34===e||39===e)&&t==p)return this.jsx_readString(e)}return 60===e&&this.exprAllowed&&33!==this.input.charCodeAt(this.pos+1)?(++this.pos,this.finishToken(h.jsxTagStart)):super.readToken(e)}updateContext(e){if(this.type==d.braceL){var t=this.curContext();t==p?this.context.push(u.b_expr):t==m?this.context.push(u.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else{if(this.type!==d.slash||e!==h.jsxTagStart)return super.updateContext(e);this.context.length-=2,this.context.push(f),this.exprAllowed=!1}}}}({allowNamespaces:!1!==e.allowNamespaces,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}},Object.defineProperty(e.exports,"tokTypes",{get:function(){return a(n("88MF")).tokTypes},configurable:!0,enumerable:!0})},"43tb":e=>{e.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},"9Tt7":e=>{var t=.1,n="function"==typeof Float32Array;function r(e,t){return 1-3*t+3*e}function i(e,t){return 3*t-6*e}function s(e){return 3*e}function o(e,t,n){return((r(t,n)*e+i(t,n))*e+s(t))*e}function a(e,t,n){return 3*r(t,n)*e*e+2*i(t,n)*e+s(t)}function l(e){return e}e.exports=function(e,r,i,s){if(!(0<=e&&e<=1&&0<=i&&i<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===r&&i===s)return l;for(var c=n?new Float32Array(11):new Array(11),d=0;d<11;++d)c[d]=o(d*t,e,i);function h(n){for(var r=0,s=1;10!==s&&c[s]<=n;++s)r+=t;--s;var l=r+(n-c[s])/(c[s+1]-c[s])*t,d=a(l,e,i);return d>=.001?function(e,t,n,r){for(var i=0;i<4;++i){var s=a(t,n,r);if(0===s)return t;t-=(o(t,n,r)-e)/s}return t}(n,l,e,i):0===d?l:function(e,t,n,r,i){var s,a,l=0;do{(s=o(a=t+(n-t)/2,r,i)-e)>0?n=a:t=a}while(Math.abs(s)>1e-7&&++l<10);return a}(n,r,r+t,e,i)}return function(e){return 0===e?0:1===e?1:o(h(e),r,s)}}},"7O4Y":(e,t,n)=>{"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function i(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(i&&(i+=" "),i+=t);return i}n.r(t),n.d(t,{clsx:()=>i,default:()=>s});const s=i},"HDX/":e=>{"use strict";const t=(e,{target:t=document.body}={})=>{const n=document.createElement("textarea"),r=document.activeElement;n.value=e,n.setAttribute("readonly",""),n.style.contain="strict",n.style.position="absolute",n.style.left="-9999px",n.style.fontSize="12pt";const i=document.getSelection();let s=!1;i.rangeCount>0&&(s=i.getRangeAt(0)),t.append(n),n.select(),n.selectionStart=0,n.selectionEnd=e.length;let o=!1;try{o=document.execCommand("copy")}catch(e){}return n.remove(),s&&(i.removeAllRanges(),i.addRange(s)),r&&r.focus(),o};e.exports=t,e.exports.default=t},pnws:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=e<0?"-":"",r=Math.abs(e).toString();for(;r.length<t;)r="0"+r;return n+r},e.exports=t.default},"t+Lu":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},e.exports=t.default},"/urY":(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)({},e)};var i=r(n("t+Lu"));e.exports=t.default},"H/a7":(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n("OboX")).default;t.default=i,e.exports=t.default},"7BF+":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultOptions=function(){return n},t.setDefaultOptions=function(e){n=e};var n={}},hw2v:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n("ww8C")),s=r(n("vnVX")),o=r(n("cQI/")),a=r(n("xV2z")),l=r(n("DKl7")),c=r(n("pnws")),d=r(n("+yel")),h="midnight",u="noon",p="morning",f="afternoon",m="evening",g="night";function y(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;if(0===s)return n+String(i);var o=t||"";return n+String(i)+o+(0,c.default)(s,2)}function v(e,t){return e%60==0?(e>0?"-":"+")+(0,c.default)(Math.abs(e)/60,2):b(e,t)}function b(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e);return r+(0,c.default)(Math.floor(i/60),2)+n+(0,c.default)(i%60,2)}var w={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return d.default.y(e,t)},Y:function(e,t,n,r){var i=(0,l.default)(e,r),s=i>0?i:1-i;if("YY"===t){var o=s%100;return(0,c.default)(o,2)}return"Yo"===t?n.ordinalNumber(s,{unit:"year"}):(0,c.default)(s,t.length)},R:function(e,t){var n=(0,o.default)(e);return(0,c.default)(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return(0,c.default)(n,t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return(0,c.default)(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return(0,c.default)(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return d.default.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return(0,c.default)(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var i=(0,a.default)(e,r);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):(0,c.default)(i,t.length)},I:function(e,t,n){var r=(0,s.default)(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):(0,c.default)(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):d.default.d(e,t)},D:function(e,t,n){var r=(0,i.default)(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):(0,c.default)(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return(0,c.default)(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return(0,c.default)(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return(0,c.default)(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,i=e.getUTCHours();switch(r=12===i?u:0===i?h:i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,i=e.getUTCHours();switch(r=i>=17?m:i>=12?f:i>=4?p:g,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return d.default.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):d.default.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):(0,c.default)(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):(0,c.default)(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):d.default.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):d.default.s(e,t)},S:function(e,t){return d.default.S(e,t)},X:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return v(i);case"XXXX":case"XX":return b(i);default:return b(i,":")}},x:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return v(i);case"xxxx":case"xx":return b(i);default:return b(i,":")}},O:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+y(i,":");default:return"GMT"+b(i,":")}},z:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+y(i,":");default:return"GMT"+b(i,":")}},t:function(e,t,n,r){var i=r._originalDate||e,s=Math.floor(i.getTime()/1e3);return(0,c.default)(s,t.length)},T:function(e,t,n,r){var i=(r._originalDate||e).getTime();return(0,c.default)(i,t.length)}};t.default=w,e.exports=t.default},"+yel":(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n("pnws")),s={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return(0,i.default)("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):(0,i.default)(n+1,2)},d:function(e,t){return(0,i.default)(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return(0,i.default)(e.getUTCHours()%12||12,t.length)},H:function(e,t){return(0,i.default)(e.getUTCHours(),t.length)},m:function(e,t){return(0,i.default)(e.getUTCMinutes(),t.length)},s:function(e,t){return(0,i.default)(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds(),s=Math.floor(r*Math.pow(10,n-3));return(0,i.default)(s,t.length)}};t.default=s,e.exports=t.default},PhxK:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},r=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},i={p:r,P:function(e,t){var i,s=e.match(/(P+)(p+)?/)||[],o=s[1],a=s[2];if(!a)return n(e,t);switch(o){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",n(o,t)).replace("{{time}}",r(a,t))}};t.default=i,e.exports=t.default},"l/Ck":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()},e.exports=t.default},ww8C:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,s.default)(1,arguments);var t=(0,i.default)(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),a=n-r;return Math.floor(a/o)+1};var i=r(n("qxgV")),s=r(n("8EaA")),o=864e5;e.exports=t.default},vnVX:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,a.default)(1,arguments);var t=(0,i.default)(e),n=(0,s.default)(t).getTime()-(0,o.default)(t).getTime();return Math.round(n/l)+1};var i=r(n("qxgV")),s=r(n("SwUm")),o=r(n("aBaL")),a=r(n("8EaA")),l=6048e5;e.exports=t.default},"cQI/":(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,s.default)(1,arguments);var t=(0,i.default)(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var a=(0,o.default)(r),l=new Date(0);l.setUTCFullYear(n,0,4),l.setUTCHours(0,0,0,0);var c=(0,o.default)(l);return t.getTime()>=a.getTime()?n+1:t.getTime()>=c.getTime()?n:n-1};var i=r(n("qxgV")),s=r(n("8EaA")),o=r(n("SwUm"));e.exports=t.default},xV2z:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,a.default)(1,arguments);var n=(0,i.default)(e),r=(0,s.default)(n,t).getTime()-(0,o.default)(n,t).getTime();return Math.round(r/l)+1};var i=r(n("qxgV")),s=r(n("ivxi")),o=r(n("ZfxR")),a=r(n("8EaA")),l=6048e5;e.exports=t.default},DKl7:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n,r,c,d,h,u,p,f;(0,s.default)(1,arguments);var m=(0,i.default)(e),g=m.getUTCFullYear(),y=(0,l.getDefaultOptions)(),v=(0,a.default)(null!==(n=null!==(r=null!==(c=null!==(d=null==t?void 0:t.firstWeekContainsDate)&&void 0!==d?d:null==t||null===(h=t.locale)||void 0===h||null===(u=h.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==c?c:y.firstWeekContainsDate)&&void 0!==r?r:null===(p=y.locale)||void 0===p||null===(f=p.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==n?n:1);if(!(v>=1&&v<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(g+1,0,v),b.setUTCHours(0,0,0,0);var w=(0,o.default)(b,t),x=new Date(0);x.setUTCFullYear(g,0,v),x.setUTCHours(0,0,0,0);var E=(0,o.default)(x,t);return m.getTime()>=w.getTime()?g+1:m.getTime()>=E.getTime()?g:g-1};var i=r(n("qxgV")),s=r(n("8EaA")),o=r(n("ivxi")),a=r(n("yuhP")),l=n("7BF+");e.exports=t.default},pJo6:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isProtectedDayOfYearToken=function(e){return-1!==n.indexOf(e)},t.isProtectedWeekYearToken=function(e){return-1!==r.indexOf(e)},t.throwProtectedError=function(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))};var n=["D","DD"],r=["YY","YYYY"]},"8EaA":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")},e.exports=t.default},SwUm:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,s.default)(1,arguments);var t=(0,i.default)(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t};var i=r(n("qxgV")),s=r(n("8EaA"));e.exports=t.default},aBaL:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,o.default)(1,arguments);var t=(0,i.default)(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),(0,s.default)(n)};var i=r(n("cQI/")),s=r(n("SwUm")),o=r(n("8EaA"));e.exports=t.default},ivxi:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n,r,l,c,d,h,u,p;(0,s.default)(1,arguments);var f=(0,a.getDefaultOptions)(),m=(0,o.default)(null!==(n=null!==(r=null!==(l=null!==(c=null==t?void 0:t.weekStartsOn)&&void 0!==c?c:null==t||null===(d=t.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==l?l:f.weekStartsOn)&&void 0!==r?r:null===(u=f.locale)||void 0===u||null===(p=u.options)||void 0===p?void 0:p.weekStartsOn)&&void 0!==n?n:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=(0,i.default)(e),y=g.getUTCDay(),v=(y<m?7:0)+y-m;return g.setUTCDate(g.getUTCDate()-v),g.setUTCHours(0,0,0,0),g};var i=r(n("qxgV")),s=r(n("8EaA")),o=r(n("yuhP")),a=n("7BF+");e.exports=t.default},ZfxR:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n,r,c,d,h,u,p,f;(0,s.default)(1,arguments);var m=(0,l.getDefaultOptions)(),g=(0,a.default)(null!==(n=null!==(r=null!==(c=null!==(d=null==t?void 0:t.firstWeekContainsDate)&&void 0!==d?d:null==t||null===(h=t.locale)||void 0===h||null===(u=h.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==c?c:m.firstWeekContainsDate)&&void 0!==r?r:null===(p=m.locale)||void 0===p||null===(f=p.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==n?n:1),y=(0,i.default)(e,t),v=new Date(0);return v.setUTCFullYear(y,0,g),v.setUTCHours(0,0,0,0),(0,o.default)(v,t)};var i=r(n("DKl7")),s=r(n("8EaA")),o=r(n("ivxi")),a=r(n("yuhP")),l=n("7BF+");e.exports=t.default},yuhP:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);if(isNaN(t))return t;return t<0?Math.ceil(t):Math.floor(t)},e.exports=t.default},nY5w:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,o.default)(2,arguments);var n=(0,s.default)(e).getTime(),r=(0,i.default)(t);return new Date(n+r)};var i=r(n("yuhP")),s=r(n("qxgV")),o=r(n("8EaA"));e.exports=t.default},RTm1:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r,w,x,E,C,S,_,k,O,T,P,I,M,R,A,N,D,L;(0,u.default)(2,arguments);var F=String(t),j=(0,p.getDefaultOptions)(),$=null!==(r=null!==(w=null==n?void 0:n.locale)&&void 0!==w?w:j.locale)&&void 0!==r?r:f.default,B=(0,h.default)(null!==(x=null!==(E=null!==(C=null!==(S=null==n?void 0:n.firstWeekContainsDate)&&void 0!==S?S:null==n||null===(_=n.locale)||void 0===_||null===(k=_.options)||void 0===k?void 0:k.firstWeekContainsDate)&&void 0!==C?C:j.firstWeekContainsDate)&&void 0!==E?E:null===(O=j.locale)||void 0===O||null===(T=O.options)||void 0===T?void 0:T.firstWeekContainsDate)&&void 0!==x?x:1);if(!(B>=1&&B<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var V=(0,h.default)(null!==(P=null!==(I=null!==(M=null!==(R=null==n?void 0:n.weekStartsOn)&&void 0!==R?R:null==n||null===(A=n.locale)||void 0===A||null===(N=A.options)||void 0===N?void 0:N.weekStartsOn)&&void 0!==M?M:j.weekStartsOn)&&void 0!==I?I:null===(D=j.locale)||void 0===D||null===(L=D.options)||void 0===L?void 0:L.weekStartsOn)&&void 0!==P?P:0);if(!(V>=0&&V<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!$.localize)throw new RangeError("locale must contain localize property");if(!$.formatLong)throw new RangeError("locale must contain formatLong property");var z=(0,o.default)(e);if(!(0,i.default)(z))throw new RangeError("Invalid time value");var H=(0,c.default)(z),U=(0,s.default)(z,H),K={firstWeekContainsDate:B,weekStartsOn:V,locale:$,_originalDate:z};return F.match(g).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,l.default[t])(e,$.formatLong):e})).join("").match(m).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return function(e){var t=e.match(y);if(!t)return e;return t[1].replace(v,"'")}(r);var s=a.default[i];if(s)return null!=n&&n.useAdditionalWeekYearTokens||!(0,d.isProtectedWeekYearToken)(r)||(0,d.throwProtectedError)(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!(0,d.isProtectedDayOfYearToken)(r)||(0,d.throwProtectedError)(r,t,String(e)),s(U,r,$.localize,K);if(i.match(b))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("")};var i=r(n("FsQw")),s=r(n("vcBr")),o=r(n("qxgV")),a=r(n("hw2v")),l=r(n("PhxK")),c=r(n("l/Ck")),d=n("pJo6"),h=r(n("yuhP")),u=r(n("8EaA")),p=n("7BF+"),f=r(n("H/a7")),m=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,g=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,y=/^'([^]*?)'?$/,v=/''/g,b=/[a-zA-Z]/;e.exports=t.default},qJ24:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,s.default)(1,arguments),e instanceof Date||"object"===(0,i.default)(e)&&"[object Date]"===Object.prototype.toString.call(e)};var i=r(n("gpnx")),s=r(n("8EaA"));e.exports=t.default},FsQw:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,o.default)(1,arguments),!(0,i.default)(e)&&"number"!=typeof e)return!1;var t=(0,s.default)(e);return!isNaN(Number(t))};var i=r(n("qJ24")),s=r(n("qxgV")),o=r(n("8EaA"));e.exports=t.default},"kQ/h":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}},e.exports=t.default},tImS:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=null!=n&&n.width?String(n.width):i;r=e.formattingValues[s]||e.formattingValues[i]}else{var o=e.defaultWidth,a=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[a]||e.values[o]}return r[e.argumentCallback?e.argumentCallback(t):t]}},e.exports=t.default},NgYr:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;var o,a=s[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,(function(e){return e.test(a)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(l,(function(e){return e.test(a)}));return o=e.valueCallback?e.valueCallback(c):c,{value:o=n.valueCallback?n.valueCallback(o):o,rest:t.slice(a.length)}}},e.exports=t.default},Wud5:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var i=r[0],s=t.match(e.parsePattern);if(!s)return null;var o=e.valueCallback?e.valueCallback(s[0]):s[0];return{value:o=n.valueCallback?n.valueCallback(o):o,rest:t.slice(i.length)}}},e.exports=t.default},sSg2:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},r=function(e,t,r){var i,s=n[e];return i="string"==typeof s?s:1===t?s.one:s.other.replace("{{count}}",t.toString()),null!=r&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};t.default=r,e.exports=t.default},OYyg:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n("kQ/h")),s={date:(0,i.default)({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:(0,i.default)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:(0,i.default)({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})};t.default=s,e.exports=t.default},XKxo:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},r=function(e,t,r,i){return n[e]};t.default=r,e.exports=t.default},e3Ae:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n("tImS")),s={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:(0,i.default)({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:(0,i.default)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:(0,i.default)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:(0,i.default)({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:(0,i.default)({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};t.default=s,e.exports=t.default},yclL:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n("NgYr")),s={ordinalNumber:(0,r(n("Wud5")).default)({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,i.default)({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:(0,i.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,i.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,i.default)({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:(0,i.default)({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};t.default=s,e.exports=t.default},OboX:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n("sSg2")),s=r(n("OYyg")),o=r(n("XKxo")),a=r(n("e3Ae")),l=r(n("yclL")),c={code:"en-US",formatDistance:i.default,formatLong:s.default,formatRelative:o.default,localize:a.default,match:l.default,options:{weekStartsOn:0,firstWeekContainsDate:1}};t.default=c,e.exports=t.default},vcBr:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,s.default)(2,arguments);var n=(0,o.default)(t);return(0,i.default)(e,-n)};var i=r(n("nY5w")),s=r(n("8EaA")),o=r(n("yuhP"));e.exports=t.default},qxgV:(e,t,n)=>{"use strict";var r=n("nw+9").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,s.default)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,i.default)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))};var i=r(n("gpnx")),s=r(n("8EaA"));e.exports=t.default},YNvz:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},o=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),s=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!s)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,d,h=arguments[0],u=1,p=arguments.length,f=!1;for("boolean"==typeof h&&(f=h,h=arguments[1]||{},u=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});u<p;++u)if(null!=(t=arguments[u]))for(n in t)r=l(h,n),h!==(i=l(t,n))&&(f&&i&&(o(i)||(c=s(i)))?(c?(c=!1,d=r&&s(r)?r:[]):d=r&&o(r)?r:{},a(h,{name:n,newValue:e(f,d,i)})):void 0!==i&&a(h,{name:n,newValue:i}));return h}},pt2U:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(s=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;0!=i--;){var o=s[i];if(("_owner"!==o||!t.$$typeof)&&!e(t[o],n[o]))return!1}return!0}return t!=t&&n!=n}},Wxh1:(e,t,n)=>{var r=n("c4IM");function i(e,t){var n,i=null;if(!e||"string"!=typeof e)return i;for(var s,o,a=r(e),l="function"==typeof t,c=0,d=a.length;c<d;c++)s=(n=a[c]).property,o=n.value,l?t(s,o,n):o&&(i||(i={}),i[s]=o);return i}e.exports=i,e.exports.default=i},c4IM:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,c="";function d(e){return e?e.replace(l,c):c}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var h=1,u=1;function p(e){var t=e.match(n);t&&(h+=t.length);var r=e.lastIndexOf("\n");u=~r?e.length-r:u+e.length}function f(){var e={line:h,column:u};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:h,column:u},this.source=l.source}m.prototype.content=e;var g=[];function y(t){var n=new Error(l.source+":"+h+":"+u+": "+t);if(n.reason=t,n.filename=l.source,n.line=h,n.column=u,n.source=e,!l.silent)throw n;g.push(n)}function v(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function b(){v(r)}function w(e){var t;for(e=e||[];t=x();)!1!==t&&e.push(t);return e}function x(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return y("End of comment missing");var r=e.slice(2,n-2);return u+=2,p(r),e=e.slice(n),u+=2,t({type:"comment",comment:r})}}function E(){var e=f(),n=v(i);if(n){if(x(),!v(s))return y("property missing ':'");var r=v(o),l=e({type:"declaration",property:d(n[0].replace(t,c)),value:r?d(r[0].replace(t,c)):c});return v(a),l}}return b(),function(){var e,t=[];for(w(t);e=E();)!1!==e&&(t.push(e),w(t));return t}()}},QF3D:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"DataView");e.exports=r},Tv3l:(e,t,n)=>{var r=n("2Fbm"),i=n("VPai"),s=n("+fUG"),o=n("QMz8"),a=n("mUsV");function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=s,l.prototype.has=o,l.prototype.set=a,e.exports=l},"+ooz":(e,t,n)=>{var r=n("8Zrg"),i=n("kwr2"),s=n("5VYK"),o=n("Coc+"),a=n("LzM7");function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=s,l.prototype.has=o,l.prototype.set=a,e.exports=l},qeCs:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"Map");e.exports=r},hyzI:(e,t,n)=>{var r=n("m5o6"),i=n("d0UJ"),s=n("eask"),o=n("9SKQ"),a=n("e63W");function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=s,l.prototype.has=o,l.prototype.set=a,e.exports=l},IS0S:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"Promise");e.exports=r},OBn4:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"Set");e.exports=r},"JBn+":(e,t,n)=>{var r=n("hyzI"),i=n("qjF7"),s=n("cEmw");function o(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}o.prototype.add=o.prototype.push=i,o.prototype.has=s,e.exports=o},HsnV:(e,t,n)=>{var r=n("+ooz"),i=n("RNlM"),s=n("E4ao"),o=n("BSqe"),a=n("L6um"),l=n("4/ik");function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=s,c.prototype.get=o,c.prototype.has=a,c.prototype.set=l,e.exports=c},Syyo:(e,t,n)=>{var r=n("IBsm").Symbol;e.exports=r},mGzy:(e,t,n)=>{var r=n("IBsm").Uint8Array;e.exports=r},"4+Vk":(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"WeakMap");e.exports=r},zaNA:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},LmOH:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},W0vE:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}},OfKG:(e,t,n)=>{var r=n("c7Qd");e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},"sCL+":e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},rmhs:(e,t,n)=>{var r=n("2ZvR"),i=n("bvyN"),s=n("wxYD"),o=n("3ajY"),a=n("pnw1"),l=n("Qd2C"),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=s(e),d=!n&&i(e),h=!n&&!d&&o(e),u=!n&&!d&&!h&&l(e),p=n||d||h||u,f=p?r(e.length,String):[],m=f.length;for(var g in e)!t&&!c.call(e,g)||p&&("length"==g||h&&("offset"==g||"parent"==g)||u&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,m))||f.push(g);return f}},H87J:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},"y/9h":e=>{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},myUI:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},"2wsP":(e,t,n)=>{var r=n("EI7Z")("length");e.exports=r},gEzS:e=>{e.exports=function(e){return e.split("")}},amiU:(e,t,n)=>{var r=n("wC3K"),i=n("pPzx");e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},c72w:(e,t,n)=>{var r=n("wC3K"),i=n("pPzx"),s=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var o=e[t];s.call(e,t)&&i(o,n)&&(void 0!==n||t in e)||r(e,t,n)}},"6QIk":(e,t,n)=>{var r=n("pPzx");e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},tPQG:(e,t,n)=>{var r=n("LtXa"),i=n("BlJA");e.exports=function(e,t){return e&&r(t,i(t),e)}},QrYh:(e,t,n)=>{var r=n("LtXa"),i=n("zH+d");e.exports=function(e,t){return e&&r(t,i(t),e)}},wC3K:(e,t,n)=>{var r=n("Pz+s");e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},kn3Q:(e,t,n)=>{var r=n("HsnV"),i=n("LmOH"),s=n("c72w"),o=n("tPQG"),a=n("QrYh"),l=n("Grae"),c=n("QT01"),d=n("AjPR"),h=n("BjSP"),u=n("tlBq"),p=n("zF5n"),f=n("kkM+"),m=n("3Qlq"),g=n("7No3"),y=n("sD1O"),v=n("wxYD"),b=n("3ajY"),w=n("NbvU"),x=n("tQYX"),E=n("/iLo"),C=n("BlJA"),S=n("zH+d"),_="[object Arguments]",k="[object Function]",O="[object Object]",T={};T[_]=T["[object Array]"]=T["[object ArrayBuffer]"]=T["[object DataView]"]=T["[object Boolean]"]=T["[object Date]"]=T["[object Float32Array]"]=T["[object Float64Array]"]=T["[object Int8Array]"]=T["[object Int16Array]"]=T["[object Int32Array]"]=T["[object Map]"]=T["[object Number]"]=T[O]=T["[object RegExp]"]=T["[object Set]"]=T["[object String]"]=T["[object Symbol]"]=T["[object Uint8Array]"]=T["[object Uint8ClampedArray]"]=T["[object Uint16Array]"]=T["[object Uint32Array]"]=!0,T["[object Error]"]=T[k]=T["[object WeakMap]"]=!1,e.exports=function e(t,n,P,I,M,R){var A,N=1&n,D=2&n,L=4&n;if(P&&(A=M?P(t,I,M,R):P(t)),void 0!==A)return A;if(!x(t))return t;var F=v(t);if(F){if(A=m(t),!N)return c(t,A)}else{var j=f(t),$=j==k||"[object GeneratorFunction]"==j;if(b(t))return l(t,N);if(j==O||j==_||$&&!M){if(A=D||$?{}:y(t),!N)return D?h(t,a(A,t)):d(t,o(A,t))}else{if(!T[j])return M?t:{};A=g(t,j,N)}}R||(R=new r);var B=R.get(t);if(B)return B;R.set(t,A),E(t)?t.forEach((function(r){A.add(e(r,n,P,r,t,R))})):w(t)&&t.forEach((function(r,i){A.set(i,e(r,n,P,i,t,R))}));var V=F?void 0:(L?D?p:u:D?S:C)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),s(A,i,e(r,n,P,i,t,R))})),A}},vGGS:(e,t,n)=>{var r=n("tQYX"),i=Object.create,s=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=s},"X+YX":(e,t,n)=>{var r=n("JBn+"),i=n("OfKG"),s=n("sCL+"),o=n("H87J"),a=n("SU8Q"),l=n("S0iI");e.exports=function(e,t,n,c){var d=-1,h=i,u=!0,p=e.length,f=[],m=t.length;if(!p)return f;n&&(t=o(t,a(n))),c?(h=s,u=!1):t.length>=200&&(h=l,u=!1,t=new r(t));e:for(;++d<p;){var g=e[d],y=null==n?g:n(g);if(g=c||0!==g?g:0,u&&y==y){for(var v=m;v--;)if(t[v]===y)continue e;f.push(g)}else h(t,y,c)||f.push(g)}return f}},Q4oW:(e,t,n)=>{var r=n("zKkv"),i=n("bz5b")(r);e.exports=i},JElN:(e,t,n)=>{var r=n("a88S");e.exports=function(e,t,n){for(var i=-1,s=e.length;++i<s;){var o=e[i],a=t(o);if(null!=a&&(void 0===l?a==a&&!r(a):n(a,l)))var l=a,c=o}return c}},sjzV:(e,t,n)=>{var r=n("Q4oW");e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},DuXo:e=>{e.exports=function(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}},YpBQ:(e,t,n)=>{var r=n("y/9h"),i=n("oCTG");e.exports=function e(t,n,s,o,a){var l=-1,c=t.length;for(s||(s=i),a||(a=[]);++l<c;){var d=t[l];n>0&&s(d)?n>1?e(d,n-1,s,o,a):r(a,d):o||(a[a.length]=d)}return a}},UdtX:(e,t,n)=>{var r=n("RFxK")();e.exports=r},zKkv:(e,t,n)=>{var r=n("UdtX"),i=n("BlJA");e.exports=function(e,t){return e&&r(e,t,i)}},w2Tz:(e,t,n)=>{var r=n("xoyU"),i=n("Ypsa");e.exports=function(e,t){for(var n=0,s=(t=r(t,e)).length;null!=e&&n<s;)e=e[i(t[n++])];return n&&n==s?e:void 0}},pIod:(e,t,n)=>{var r=n("y/9h"),i=n("wxYD");e.exports=function(e,t,n){var s=t(e);return i(e)?s:r(s,n(e))}},Dhk8:(e,t,n)=>{var r=n("Syyo"),i=n("KCLV"),s=n("kHoZ"),o=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):s(e)}},FaiA:e=>{e.exports=function(e,t){return e>t}},SJov:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},JYmt:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},c7Qd:(e,t,n)=>{var r=n("DuXo"),i=n("z9Jh"),s=n("n1QJ");e.exports=function(e,t,n){return t==t?s(e,t,n):r(e,i,n)}},A0wc:e=>{e.exports=function(e,t,n,r){for(var i=n-1,s=e.length;++i<s;)if(r(e[i],t))return i;return-1}},"/30y":(e,t,n)=>{var r=n("Dhk8"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},pPU8:(e,t,n)=>{var r=n("Dhk8"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Date]"==r(e)}},NYSw:(e,t,n)=>{var r=n("BqUW"),i=n("tLQN");e.exports=function e(t,n,s,o,a){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,s,o,e,a))}},BqUW:(e,t,n)=>{var r=n("HsnV"),i=n("ZZ+W"),s=n("R3gn"),o=n("yZHP"),a=n("kkM+"),l=n("wxYD"),c=n("3ajY"),d=n("Qd2C"),h="[object Arguments]",u="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,m,g,y){var v=l(e),b=l(t),w=v?u:a(e),x=b?u:a(t),E=(w=w==h?p:w)==p,C=(x=x==h?p:x)==p,S=w==x;if(S&&c(e)){if(!c(t))return!1;v=!0,E=!1}if(S&&!E)return y||(y=new r),v||d(e)?i(e,t,n,m,g,y):s(e,t,w,n,m,g,y);if(!(1&n)){var _=E&&f.call(e,"__wrapped__"),k=C&&f.call(t,"__wrapped__");if(_||k){var O=_?e.value():e,T=k?t.value():t;return y||(y=new r),g(O,T,n,m,y)}}return!!S&&(y||(y=new r),o(e,t,n,m,g,y))}},gEWz:(e,t,n)=>{var r=n("kkM+"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},ZjRn:(e,t,n)=>{var r=n("HsnV"),i=n("NYSw");e.exports=function(e,t,n,s){var o=n.length,a=o,l=!s;if(null==e)return!a;for(e=Object(e);o--;){var c=n[o];if(l&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++o<a;){var d=(c=n[o])[0],h=e[d],u=c[1];if(l&&c[2]){if(void 0===h&&!(d in e))return!1}else{var p=new r;if(s)var f=s(h,u,d,e,t,p);if(!(void 0===f?i(u,h,3,s,p):f))return!1}}return!0}},z9Jh:e=>{e.exports=function(e){return e!=e}},"5nKN":(e,t,n)=>{var r=n("2q8g"),i=n("9vbJ"),s=n("tQYX"),o=n("c18h"),a=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,d=l.toString,h=c.hasOwnProperty,u=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!s(e)||i(e))&&(r(e)?u:a).test(o(e))}},MDav:(e,t,n)=>{var r=n("Dhk8"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object RegExp]"==r(e)}},"6I2w":(e,t,n)=>{var r=n("kkM+"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},"7/jS":(e,t,n)=>{var r=n("Dhk8"),i=n("t0L4"),s=n("tLQN"),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return s(e)&&i(e.length)&&!!o[r(e)]}},S3pA:(e,t,n)=>{var r=n("7/we"),i=n("KAo/"),s=n("zWgn"),o=n("wxYD"),a=n("1EDM");e.exports=function(e){return"function"==typeof e?e:null==e?s:"object"==typeof e?o(e)?i(e[0],e[1]):r(e):a(e)}},"4uJK":(e,t,n)=>{var r=n("CbIe"),i=n("OtNC"),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))s.call(e,n)&&"constructor"!=n&&t.push(n);return t}},p2lg:(e,t,n)=>{var r=n("tQYX"),i=n("CbIe"),s=n("/UTG"),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return s(e);var t=i(e),n=[];for(var a in e)("constructor"!=a||!t&&o.call(e,a))&&n.push(a);return n}},bFjY:(e,t,n)=>{var r=n("Q4oW"),i=n("9y2L");e.exports=function(e,t){var n=-1,s=i(e)?Array(e.length):[];return r(e,(function(e,r,i){s[++n]=t(e,r,i)})),s}},"7/we":(e,t,n)=>{var r=n("ZjRn"),i=n("hMsr"),s=n("0Ss3");e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?s(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},"KAo/":(e,t,n)=>{var r=n("NYSw"),i=n("2srY"),s=n("NW/2"),o=n("i7nn"),a=n("+tCn"),l=n("0Ss3"),c=n("Ypsa");e.exports=function(e,t){return o(e)&&a(t)?l(c(e),t):function(n){var o=i(n,e);return void 0===o&&o===t?s(n,e):r(t,o,3)}}},MzY2:(e,t,n)=>{var r=n("HsnV"),i=n("amiU"),s=n("UdtX"),o=n("cb1R"),a=n("tQYX"),l=n("zH+d"),c=n("LL3N");e.exports=function e(t,n,d,h,u){t!==n&&s(n,(function(s,l){if(u||(u=new r),a(s))o(t,n,l,d,e,h,u);else{var p=h?h(c(t,l),s,l+"",t,n,u):void 0;void 0===p&&(p=s),i(t,l,p)}}),l)}},cb1R:(e,t,n)=>{var r=n("amiU"),i=n("Grae"),s=n("6Rtw"),o=n("QT01"),a=n("sD1O"),l=n("bvyN"),c=n("wxYD"),d=n("Ndl3"),h=n("3ajY"),u=n("2q8g"),p=n("tQYX"),f=n("Kkar"),m=n("Qd2C"),g=n("LL3N"),y=n("4ScB");e.exports=function(e,t,n,v,b,w,x){var E=g(e,n),C=g(t,n),S=x.get(C);if(S)r(e,n,S);else{var _=w?w(E,C,n+"",e,t,x):void 0,k=void 0===_;if(k){var O=c(C),T=!O&&h(C),P=!O&&!T&&m(C);_=C,O||T||P?c(E)?_=E:d(E)?_=o(E):T?(k=!1,_=i(C,!0)):P?(k=!1,_=s(C,!0)):_=[]:f(C)||l(C)?(_=E,l(E)?_=y(E):p(E)&&!u(E)||(_=a(C))):k=!1}k&&(x.set(C,_),b(_,C,v,w,x),x.delete(C)),r(e,n,_)}}},HRNz:(e,t,n)=>{var r=n("pnw1");e.exports=function(e,t){var n=e.length;if(n)return r(t+=t<0?n:0,n)?e[t]:void 0}},QwI6:(e,t,n)=>{var r=n("O1Sc"),i=n("NW/2");e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},O1Sc:(e,t,n)=>{var r=n("w2Tz"),i=n("y4bl"),s=n("xoyU");e.exports=function(e,t,n){for(var o=-1,a=t.length,l={};++o<a;){var c=t[o],d=r(e,c);n(d,c)&&i(l,s(c,e),d)}return l}},EI7Z:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},CEyS:(e,t,n)=>{var r=n("w2Tz");e.exports=function(e){return function(t){return r(t,e)}}},v5ZW:(e,t,n)=>{var r=n("H87J"),i=n("c7Qd"),s=n("A0wc"),o=n("SU8Q"),a=n("QT01"),l=Array.prototype.splice;e.exports=function(e,t,n,c){var d=c?s:i,h=-1,u=t.length,p=e;for(e===t&&(t=a(t)),n&&(p=r(e,o(n)));++h<u;)for(var f=0,m=t[h],g=n?n(m):m;(f=d(p,g,f,c))>-1;)p!==e&&l.call(p,f,1),l.call(e,f,1);return e}},R3TX:(e,t,n)=>{var r=n("zWgn"),i=n("UAs9"),s=n("7Pat");e.exports=function(e,t){return s(i(e,t,r),e+"")}},y4bl:(e,t,n)=>{var r=n("c72w"),i=n("xoyU"),s=n("pnw1"),o=n("tQYX"),a=n("Ypsa");e.exports=function(e,t,n,l){if(!o(e))return e;for(var c=-1,d=(t=i(t,e)).length,h=d-1,u=e;null!=u&&++c<d;){var p=a(t[c]),f=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(c!=h){var m=u[p];void 0===(f=l?l(m,p,u):void 0)&&(f=o(m)?m:s(t[c+1])?[]:{})}r(u,p,f),u=u[p]}return e}},"+7q0":(e,t,n)=>{var r=n("eN33"),i=n("Pz+s"),s=n("zWgn"),o=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:s;e.exports=o},"0Ocv":e=>{e.exports=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}},Inyi:(e,t,n)=>{var r=n("Q4oW");e.exports=function(e,t){var n;return r(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}},"2ZvR":e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},JcJ6:(e,t,n)=>{var r=n("Syyo"),i=n("H87J"),s=n("wxYD"),o=n("a88S"),a=r?r.prototype:void 0,l=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(s(t))return i(t,e)+"";if(o(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},I1fX:(e,t,n)=>{var r=n("6XIJ"),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},SU8Q:e=>{e.exports=function(e){return function(t){return e(t)}}},"s+R0":(e,t,n)=>{var r=n("JBn+"),i=n("OfKG"),s=n("sCL+"),o=n("S0iI"),a=n("9TP6"),l=n("XlL0");e.exports=function(e,t,n){var c=-1,d=i,h=e.length,u=!0,p=[],f=p;if(n)u=!1,d=s;else if(h>=200){var m=t?null:a(e);if(m)return l(m);u=!1,d=o,f=new r}else f=t?[]:p;e:for(;++c<h;){var g=e[c],y=t?t(g):g;if(g=n||0!==g?g:0,u&&y==y){for(var v=f.length;v--;)if(f[v]===y)continue e;t&&f.push(y),p.push(g)}else d(f,y,n)||(f!==p&&f.push(y),p.push(g))}return p}},a49g:(e,t,n)=>{var r=n("xoyU"),i=n("p1C/"),s=n("SiwR"),o=n("Ypsa");e.exports=function(e,t){return t=r(t,e),null==(e=s(e,t))||delete e[o(i(t))]}},SJvO:(e,t,n)=>{var r=n("H87J");e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},S0iI:e=>{e.exports=function(e,t){return e.has(t)}},D49j:(e,t,n)=>{var r=n("zWgn");e.exports=function(e){return"function"==typeof e?e:r}},xoyU:(e,t,n)=>{var r=n("wxYD"),i=n("i7nn"),s=n("SoOq"),o=n("dw5g");e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:s(o(e))}},rXFn:(e,t,n)=>{var r=n("0Ocv");e.exports=function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:r(e,t,n)}},EAGB:(e,t,n)=>{var r=n("mGzy");e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},Grae:(e,t,n)=>{e=n.nmd(e);var r=n("IBsm"),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,o=s&&s.exports===i?r.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}},lN3w:(e,t,n)=>{var r=n("EAGB");e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},Bstx:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},bVbG:(e,t,n)=>{var r=n("Syyo"),i=r?r.prototype:void 0,s=i?i.valueOf:void 0;e.exports=function(e){return s?Object(s.call(e)):{}}},"6Rtw":(e,t,n)=>{var r=n("EAGB");e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},QT01:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},LtXa:(e,t,n)=>{var r=n("c72w"),i=n("wC3K");e.exports=function(e,t,n,s){var o=!n;n||(n={});for(var a=-1,l=t.length;++a<l;){var c=t[a],d=s?s(n[c],e[c],c,n,e):void 0;void 0===d&&(d=e[c]),o?i(n,c,d):r(n,c,d)}return n}},AjPR:(e,t,n)=>{var r=n("LtXa"),i=n("70Le");e.exports=function(e,t){return r(e,i(e),t)}},BjSP:(e,t,n)=>{var r=n("LtXa"),i=n("Xidw");e.exports=function(e,t){return r(e,i(e),t)}},"3KBa":(e,t,n)=>{var r=n("IBsm")["__core-js_shared__"];e.exports=r},wpQC:(e,t,n)=>{var r=n("R3TX"),i=n("R5u7");e.exports=function(e){return r((function(t,n){var r=-1,s=n.length,o=s>1?n[s-1]:void 0,a=s>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(s--,o):void 0,a&&i(n[0],n[1],a)&&(o=s<3?void 0:o,s=1),t=Object(t);++r<s;){var l=n[r];l&&e(t,l,r,o)}return t}))}},bz5b:(e,t,n)=>{var r=n("9y2L");e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var s=n.length,o=t?s:-1,a=Object(n);(t?o--:++o<s)&&!1!==i(a[o],o,a););return n}}},RFxK:e=>{e.exports=function(e){return function(t,n,r){for(var i=-1,s=Object(t),o=r(t),a=o.length;a--;){var l=o[e?a:++i];if(!1===n(s[l],l,s))break}return t}}},"1aYn":(e,t,n)=>{var r=n("S3pA"),i=n("9y2L"),s=n("BlJA");e.exports=function(e){return function(t,n,o){var a=Object(t);if(!i(t)){var l=r(n,3);t=s(t),n=function(e){return l(a[e],e,a)}}var c=e(t,n,o);return c>-1?a[l?t[c]:c]:void 0}}},"9TP6":(e,t,n)=>{var r=n("OBn4"),i=n("nnm9"),s=n("XlL0"),o=r&&1/s(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=o},r9Vz:(e,t,n)=>{var r=n("Kkar");e.exports=function(e){return r(e)?void 0:e}},"Pz+s":(e,t,n)=>{var r=n("vxC8"),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},"ZZ+W":(e,t,n)=>{var r=n("JBn+"),i=n("myUI"),s=n("S0iI");e.exports=function(e,t,n,o,a,l){var c=1&n,d=e.length,h=t.length;if(d!=h&&!(c&&h>d))return!1;var u=l.get(e),p=l.get(t);if(u&&p)return u==t&&p==e;var f=-1,m=!0,g=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++f<d;){var y=e[f],v=t[f];if(o)var b=c?o(v,y,f,t,e,l):o(y,v,f,e,t,l);if(void 0!==b){if(b)continue;m=!1;break}if(g){if(!i(t,(function(e,t){if(!s(g,t)&&(y===e||a(y,e,n,o,l)))return g.push(t)}))){m=!1;break}}else if(y!==v&&!a(y,v,n,o,l)){m=!1;break}}return l.delete(e),l.delete(t),m}},R3gn:(e,t,n)=>{var r=n("Syyo"),i=n("mGzy"),s=n("pPzx"),o=n("ZZ+W"),a=n("aURW"),l=n("XlL0"),c=r?r.prototype:void 0,d=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,h,u){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!h(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return s(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=a;case"[object Set]":var f=1&r;if(p||(p=l),e.size!=t.size&&!f)return!1;var m=u.get(e);if(m)return m==t;r|=2,u.set(e,t);var g=o(p(e),p(t),r,c,h,u);return u.delete(e),g;case"[object Symbol]":if(d)return d.call(e)==d.call(t)}return!1}},yZHP:(e,t,n)=>{var r=n("tlBq"),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,s,o,a){var l=1&n,c=r(e),d=c.length;if(d!=r(t).length&&!l)return!1;for(var h=d;h--;){var u=c[h];if(!(l?u in t:i.call(t,u)))return!1}var p=a.get(e),f=a.get(t);if(p&&f)return p==t&&f==e;var m=!0;a.set(e,t),a.set(t,e);for(var g=l;++h<d;){var y=e[u=c[h]],v=t[u];if(s)var b=l?s(v,y,u,t,e,a):s(y,v,u,e,t,a);if(!(void 0===b?y===v||o(y,v,n,s,a):b)){m=!1;break}g||(g="constructor"==u)}if(m&&!g){var w=e.constructor,x=t.constructor;w==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof x&&x instanceof x||(m=!1)}return a.delete(e),a.delete(t),m}},cH1A:(e,t,n)=>{var r=n("1xil"),i=n("UAs9"),s=n("7Pat");e.exports=function(e){return s(i(e,void 0,r),e+"")}},e93E:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},tlBq:(e,t,n)=>{var r=n("pIod"),i=n("70Le"),s=n("BlJA");e.exports=function(e){return r(e,s,i)}},zF5n:(e,t,n)=>{var r=n("pIod"),i=n("Xidw"),s=n("zH+d");e.exports=function(e){return r(e,s,i)}},JNqh:(e,t,n)=>{var r=n("6UKJ");e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},hMsr:(e,t,n)=>{var r=n("+tCn"),i=n("BlJA");e.exports=function(e){for(var t=i(e),n=t.length;n--;){var s=t[n],o=e[s];t[n]=[s,o,r(o)]}return t}},vxC8:(e,t,n)=>{var r=n("5nKN"),i=n("4p/L");e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},"/wCD":(e,t,n)=>{var r=n("TAtK")(Object.getPrototypeOf,Object);e.exports=r},KCLV:(e,t,n)=>{var r=n("Syyo"),i=Object.prototype,s=i.hasOwnProperty,o=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=s.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=o.call(e);return r&&(t?e[a]=n:delete e[a]),i}},"70Le":(e,t,n)=>{var r=n("W0vE"),i=n("X4R2"),s=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,a=o?function(e){return null==e?[]:(e=Object(e),r(o(e),(function(t){return s.call(e,t)})))}:i;e.exports=a},Xidw:(e,t,n)=>{var r=n("y/9h"),i=n("/wCD"),s=n("70Le"),o=n("X4R2"),a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,s(e)),e=i(e);return t}:o;e.exports=a},"kkM+":(e,t,n)=>{var r=n("QF3D"),i=n("qeCs"),s=n("IS0S"),o=n("OBn4"),a=n("4+Vk"),l=n("Dhk8"),c=n("c18h"),d="[object Map]",h="[object Promise]",u="[object Set]",p="[object WeakMap]",f="[object DataView]",m=c(r),g=c(i),y=c(s),v=c(o),b=c(a),w=l;(r&&w(new r(new ArrayBuffer(1)))!=f||i&&w(new i)!=d||s&&w(s.resolve())!=h||o&&w(new o)!=u||a&&w(new a)!=p)&&(w=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case m:return f;case g:return d;case y:return h;case v:return u;case b:return p}return t}),e.exports=w},"4p/L":e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},"z+TE":(e,t,n)=>{var r=n("xoyU"),i=n("bvyN"),s=n("wxYD"),o=n("pnw1"),a=n("t0L4"),l=n("Ypsa");e.exports=function(e,t,n){for(var c=-1,d=(t=r(t,e)).length,h=!1;++c<d;){var u=l(t[c]);if(!(h=null!=e&&n(e,u)))break;e=e[u]}return h||++c!=d?h:!!(d=null==e?0:e.length)&&a(d)&&o(u,d)&&(s(e)||i(e))}},GZgP:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},"2Fbm":(e,t,n)=>{var r=n("5pfJ");e.exports=function(){this.__data__=r?r(null):{},this.size=0}},VPai:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},"+fUG":(e,t,n)=>{var r=n("5pfJ"),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},QMz8:(e,t,n)=>{var r=n("5pfJ"),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},mUsV:(e,t,n)=>{var r=n("5pfJ");e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},"3Qlq":e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},"7No3":(e,t,n)=>{var r=n("EAGB"),i=n("lN3w"),s=n("Bstx"),o=n("bVbG"),a=n("6Rtw");e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return s(e);case"[object Symbol]":return o(e)}}},sD1O:(e,t,n)=>{var r=n("vGGS"),i=n("/wCD"),s=n("CbIe");e.exports=function(e){return"function"!=typeof e.constructor||s(e)?{}:r(i(e))}},oCTG:(e,t,n)=>{var r=n("Syyo"),i=n("bvyN"),s=n("wxYD"),o=r?r.isConcatSpreadable:void 0;e.exports=function(e){return s(e)||i(e)||!!(o&&e&&e[o])}},pnw1:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},R5u7:(e,t,n)=>{var r=n("pPzx"),i=n("9y2L"),s=n("pnw1"),o=n("tQYX");e.exports=function(e,t,n){if(!o(n))return!1;var a=typeof t;return!!("number"==a?i(n)&&s(t,n.length):"string"==a&&t in n)&&r(n[t],e)}},i7nn:(e,t,n)=>{var r=n("wxYD"),i=n("a88S"),s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(o.test(e)||!s.test(e)||null!=t&&e in Object(t))}},"6UKJ":e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},"9vbJ":(e,t,n)=>{var r,i=n("3KBa"),s=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!s&&s in e}},CbIe:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},"+tCn":(e,t,n)=>{var r=n("tQYX");e.exports=function(e){return e==e&&!r(e)}},"8Zrg":e=>{e.exports=function(){this.__data__=[],this.size=0}},kwr2:(e,t,n)=>{var r=n("6QIk"),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},"5VYK":(e,t,n)=>{var r=n("6QIk");e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},"Coc+":(e,t,n)=>{var r=n("6QIk");e.exports=function(e){return r(this.__data__,e)>-1}},LzM7:(e,t,n)=>{var r=n("6QIk");e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},m5o6:(e,t,n)=>{var r=n("Tv3l"),i=n("+ooz"),s=n("qeCs");e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(s||i),string:new r}}},d0UJ:(e,t,n)=>{var r=n("JNqh");e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},eask:(e,t,n)=>{var r=n("JNqh");e.exports=function(e){return r(this,e).get(e)}},"9SKQ":(e,t,n)=>{var r=n("JNqh");e.exports=function(e){return r(this,e).has(e)}},e63W:(e,t,n)=>{var r=n("JNqh");e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},aURW:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},"0Ss3":e=>{e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},"0+aC":(e,t,n)=>{var r=n("pFSi");e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},"5pfJ":(e,t,n)=>{var r=n("vxC8")(Object,"create");e.exports=r},OtNC:(e,t,n)=>{var r=n("TAtK")(Object.keys,Object);e.exports=r},"/UTG":e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},T6vp:(e,t,n)=>{e=n.nmd(e);var r=n("e93E"),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,o=s&&s.exports===i&&r.process,a=function(){try{var e=s&&s.require&&s.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a},kHoZ:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},TAtK:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},UAs9:(e,t,n)=>{var r=n("zaNA"),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var s=arguments,o=-1,a=i(s.length-t,0),l=Array(a);++o<a;)l[o]=s[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=s[o];return c[t]=n(l),r(e,this,c)}}},SiwR:(e,t,n)=>{var r=n("w2Tz"),i=n("0Ocv");e.exports=function(e,t){return t.length<2?e:r(e,i(t,0,-1))}},IBsm:(e,t,n)=>{var r=n("e93E"),i="object"==typeof self&&self&&self.Object===Object&&self,s=r||i||Function("return this")();e.exports=s},LL3N:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},qjF7:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},cEmw:e=>{e.exports=function(e){return this.__data__.has(e)}},XlL0:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},"7Pat":(e,t,n)=>{var r=n("+7q0"),i=n("kG2z")(r);e.exports=i},kG2z:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),s=16-(i-r);if(r=i,s>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},RNlM:(e,t,n)=>{var r=n("+ooz");e.exports=function(){this.__data__=new r,this.size=0}},E4ao:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},BSqe:e=>{e.exports=function(e){return this.__data__.get(e)}},L6um:e=>{e.exports=function(e){return this.__data__.has(e)}},"4/ik":(e,t,n)=>{var r=n("+ooz"),i=n("qeCs"),s=n("hyzI");e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var o=n.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new s(o)}return n.set(e,t),this.size=n.size,this}},n1QJ:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},GVul:(e,t,n)=>{var r=n("2wsP"),i=n("GZgP"),s=n("QZ90");e.exports=function(e){return i(e)?s(e):r(e)}},f2p0:(e,t,n)=>{var r=n("gEzS"),i=n("GZgP"),s=n("Xm/D");e.exports=function(e){return i(e)?s(e):r(e)}},SoOq:(e,t,n)=>{var r=n("0+aC"),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/\\(\\)?/g,o=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(s,"$1"):n||e)})),t}));e.exports=o},Ypsa:(e,t,n)=>{var r=n("a88S");e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},c18h:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},"6XIJ":e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},QZ90:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",s="[^"+t+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")"+"?",c="[\\ufe0e\\ufe0f]?",d=c+l+("(?:\\u200d(?:"+[s,o,a].join("|")+")"+c+l+")*"),h="(?:"+[s+r+"?",r,o,a,n].join("|")+")",u=RegExp(i+"(?="+i+")|"+h+d,"g");e.exports=function(e){for(var t=u.lastIndex=0;u.test(e);)++t;return t}},"Xm/D":e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",s="[^"+t+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")"+"?",c="[\\ufe0e\\ufe0f]?",d=c+l+("(?:\\u200d(?:"+[s,o,a].join("|")+")"+c+l+")*"),h="(?:"+[s+r+"?",r,o,a,n].join("|")+")",u=RegExp(i+"(?="+i+")|"+h+d,"g");e.exports=function(e){return e.match(u)||[]}},whR3:(e,t,n)=>{var r=n("c72w"),i=n("LtXa"),s=n("wpQC"),o=n("9y2L"),a=n("CbIe"),l=n("BlJA"),c=Object.prototype.hasOwnProperty,d=s((function(e,t){if(a(t)||o(t))i(t,l(t),e);else for(var n in t)c.call(t,n)&&r(e,n,t[n])}));e.exports=d},zr3P:(e,t,n)=>{var r=n("kn3Q");e.exports=function(e){return r(e,4)}},c2re:(e,t,n)=>{var r=n("kn3Q");e.exports=function(e){return r(e,5)}},NdXQ:(e,t,n)=>{var r=n("kn3Q");e.exports=function(e,t){return r(e,5,t="function"==typeof t?t:void 0)}},eN33:e=>{e.exports=function(e){return function(){return e}}},RNvQ:(e,t,n)=>{var r=n("tQYX"),i=n("ENE1"),s=n("nvU9"),o=Math.max,a=Math.min;e.exports=function(e,t,n){var l,c,d,h,u,p,f=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=l,r=c;return l=c=void 0,f=t,h=e.apply(r,n)}function b(e){var n=e-p;return void 0===p||n>=t||n<0||g&&e-f>=d}function w(){var e=i();if(b(e))return x(e);u=setTimeout(w,function(e){var n=t-(e-p);return g?a(n,d-(e-f)):n}(e))}function x(e){return u=void 0,y&&l?v(e):(l=c=void 0,h)}function E(){var e=i(),n=b(e);if(l=arguments,c=this,p=e,n){if(void 0===u)return function(e){return f=e,u=setTimeout(w,t),m?v(e):h}(p);if(g)return clearTimeout(u),u=setTimeout(w,t),v(p)}return void 0===u&&(u=setTimeout(w,t)),h}return t=s(t)||0,r(n)&&(m=!!n.leading,d=(g="maxWait"in n)?o(s(n.maxWait)||0,t):d,y="trailing"in n?!!n.trailing:y),E.cancel=function(){void 0!==u&&clearTimeout(u),f=0,l=p=c=u=void 0},E.flush=function(){return void 0===u?h:x(i())},E}},lKOy:(e,t,n)=>{var r=n("X+YX"),i=n("YpBQ"),s=n("R3TX"),o=n("Ndl3"),a=s((function(e,t){return o(e)?r(e,i(t,1,o,!0)):[]}));e.exports=a},h4um:(e,t,n)=>{e.exports=n("9SCj")},pPzx:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},"+DnP":(e,t,n)=>{var r=n("W0vE"),i=n("sjzV"),s=n("S3pA"),o=n("wxYD");e.exports=function(e,t){return(o(e)?r:i)(e,s(t,3))}},"6R5o":(e,t,n)=>{var r=n("1aYn")(n("FllU"));e.exports=r},FllU:(e,t,n)=>{var r=n("DuXo"),i=n("S3pA"),s=n("m2YG"),o=Math.max;e.exports=function(e,t,n){var a=null==e?0:e.length;if(!a)return-1;var l=null==n?0:s(n);return l<0&&(l=o(a+l,0)),r(e,i(t,3),l)}},ehGJ:(e,t,n)=>{var r=n("DuXo"),i=n("S3pA"),s=n("m2YG"),o=Math.max,a=Math.min;e.exports=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var c=l-1;return void 0!==n&&(c=s(n),c=n<0?o(l+c,0):a(c,l-1)),r(e,i(t,3),c,!0)}},"1xil":(e,t,n)=>{var r=n("YpBQ");e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},cdI6:(e,t,n)=>{var r=n("YpBQ"),i=1/0;e.exports=function(e){return(null==e?0:e.length)?r(e,i):[]}},"9SCj":(e,t,n)=>{var r=n("LmOH"),i=n("Q4oW"),s=n("D49j"),o=n("wxYD");e.exports=function(e,t){return(o(e)?r:i)(e,s(t))}},"2srY":(e,t,n)=>{var r=n("w2Tz");e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},"1mr4":(e,t,n)=>{var r=n("SJov"),i=n("z+TE");e.exports=function(e,t){return null!=e&&i(e,t,r)}},"NW/2":(e,t,n)=>{var r=n("JYmt"),i=n("z+TE");e.exports=function(e,t){return null!=e&&i(e,t,r)}},zWgn:e=>{e.exports=function(e){return e}},qYhz:(e,t,n)=>{var r=n("c7Qd"),i=n("9y2L"),s=n("nDih"),o=n("m2YG"),a=n("0iyY"),l=Math.max;e.exports=function(e,t,n,c){e=i(e)?e:a(e),n=n&&!c?o(n):0;var d=e.length;return n<0&&(n=l(d+n,0)),s(e)?n<=d&&e.indexOf(t,n)>-1:!!d&&r(e,t,n)>-1}},bvyN:(e,t,n)=>{var r=n("/30y"),i=n("tLQN"),s=Object.prototype,o=s.hasOwnProperty,a=s.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&o.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},wxYD:e=>{var t=Array.isArray;e.exports=t},"9y2L":(e,t,n)=>{var r=n("2q8g"),i=n("t0L4");e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},Ndl3:(e,t,n)=>{var r=n("9y2L"),i=n("tLQN");e.exports=function(e){return i(e)&&r(e)}},p6M4:(e,t,n)=>{var r=n("Dhk8"),i=n("tLQN");e.exports=function(e){return!0===e||!1===e||i(e)&&"[object Boolean]"==r(e)}},"3ajY":(e,t,n)=>{e=n.nmd(e);var r=n("IBsm"),i=n("DjCF"),s=t&&!t.nodeType&&t,o=s&&e&&!e.nodeType&&e,a=o&&o.exports===s?r.Buffer:void 0,l=(a?a.isBuffer:void 0)||i;e.exports=l},"+f76":(e,t,n)=>{var r=n("pPU8"),i=n("SU8Q"),s=n("T6vp"),o=s&&s.isDate,a=o?i(o):r;e.exports=a},MwrP:(e,t,n)=>{var r=n("4uJK"),i=n("kkM+"),s=n("bvyN"),o=n("wxYD"),a=n("9y2L"),l=n("3ajY"),c=n("CbIe"),d=n("Qd2C"),h=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(a(e)&&(o(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||d(e)||s(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(h.call(e,n))return!1;return!0}},nnRT:(e,t,n)=>{var r=n("NYSw");e.exports=function(e,t){return r(e,t)}},"6OdC":(e,t,n)=>{var r=n("NYSw");e.exports=function(e,t,n){var i=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===i?r(e,t,void 0,n):!!i}},"2q8g":(e,t,n)=>{var r=n("Dhk8"),i=n("tQYX");e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},t0L4:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},NbvU:(e,t,n)=>{var r=n("gEWz"),i=n("SU8Q"),s=n("T6vp"),o=s&&s.isMap,a=o?i(o):r;e.exports=a},DlqW:(e,t,n)=>{var r=n("mGvo");e.exports=function(e){return r(e)&&e!=+e}},R7V3:e=>{e.exports=function(e){return null===e}},mGvo:(e,t,n)=>{var r=n("Dhk8"),i=n("tLQN");e.exports=function(e){return"number"==typeof e||i(e)&&"[object Number]"==r(e)}},tQYX:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},tLQN:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},Kkar:(e,t,n)=>{var r=n("Dhk8"),i=n("/wCD"),s=n("tLQN"),o=Function.prototype,a=Object.prototype,l=o.toString,c=a.hasOwnProperty,d=l.call(Object);e.exports=function(e){if(!s(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==d}},UBkg:(e,t,n)=>{var r=n("MDav"),i=n("SU8Q"),s=n("T6vp"),o=s&&s.isRegExp,a=o?i(o):r;e.exports=a},"/iLo":(e,t,n)=>{var r=n("6I2w"),i=n("SU8Q"),s=n("T6vp"),o=s&&s.isSet,a=o?i(o):r;e.exports=a},nDih:(e,t,n)=>{var r=n("Dhk8"),i=n("wxYD"),s=n("tLQN");e.exports=function(e){return"string"==typeof e||!i(e)&&s(e)&&"[object String]"==r(e)}},a88S:(e,t,n)=>{var r=n("Dhk8"),i=n("tLQN");e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},Qd2C:(e,t,n)=>{var r=n("7/jS"),i=n("SU8Q"),s=n("T6vp"),o=s&&s.isTypedArray,a=o?i(o):r;e.exports=a},CZlo:e=>{e.exports=function(e){return void 0===e}},BlJA:(e,t,n)=>{var r=n("rmhs"),i=n("4uJK"),s=n("9y2L");e.exports=function(e){return s(e)?r(e):i(e)}},"zH+d":(e,t,n)=>{var r=n("rmhs"),i=n("p2lg"),s=n("9y2L");e.exports=function(e){return s(e)?r(e,!0):i(e)}},"p1C/":e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},mbB6:(e,t,n)=>{var r=n("H87J"),i=n("S3pA"),s=n("bFjY"),o=n("wxYD");e.exports=function(e,t){return(o(e)?r:s)(e,i(t,3))}},"LPC+":(e,t,n)=>{var r=n("JElN"),i=n("FaiA"),s=n("zWgn");e.exports=function(e){return e&&e.length?r(e,s,i):void 0}},pFSi:(e,t,n)=>{var r=n("hyzI");function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},H8sf:(e,t,n)=>{var r=n("MzY2"),i=n("wpQC")((function(e,t,n){r(e,t,n)}));e.exports=i},nnm9:e=>{e.exports=function(){}},ENE1:(e,t,n)=>{var r=n("IBsm");e.exports=function(){return r.Date.now()}},Hz96:(e,t,n)=>{var r=n("HRNz"),i=n("m2YG");e.exports=function(e,t){return e&&e.length?r(e,i(t)):void 0}},uZih:(e,t,n)=>{var r=n("H87J"),i=n("kn3Q"),s=n("a49g"),o=n("xoyU"),a=n("LtXa"),l=n("r9Vz"),c=n("cH1A"),d=n("zF5n"),h=c((function(e,t){var n={};if(null==e)return n;var c=!1;t=r(t,(function(t){return t=o(t,e),c||(c=t.length>1),t})),a(e,d(e),n),c&&(n=i(n,7,l));for(var h=t.length;h--;)s(n,t[h]);return n}));e.exports=h},"//nZ":(e,t,n)=>{var r=n("QwI6"),i=n("cH1A")((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},"1EDM":(e,t,n)=>{var r=n("EI7Z"),i=n("CEyS"),s=n("i7nn"),o=n("Ypsa");e.exports=function(e){return s(e)?r(o(e)):i(e)}},jHPj:(e,t,n)=>{var r=n("R3TX")(n("DyR2"));e.exports=r},DyR2:(e,t,n)=>{var r=n("v5ZW");e.exports=function(e,t){return e&&e.length&&t&&t.length?r(e,t):e}},DL3M:(e,t,n)=>{var r=n("y4bl");e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},"7seP":(e,t,n)=>{var r=n("4uJK"),i=n("kkM+"),s=n("9y2L"),o=n("nDih"),a=n("GVul");e.exports=function(e){if(null==e)return 0;if(s(e))return o(e)?a(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},"+n+S":(e,t,n)=>{var r=n("0Ocv"),i=n("R5u7"),s=n("m2YG");e.exports=function(e,t,n){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&i(e,t,n)?(t=0,n=o):(t=null==t?0:s(t),n=void 0===n?o:s(n)),r(e,t,n)):[]}},oBkS:(e,t,n)=>{var r=n("myUI"),i=n("S3pA"),s=n("Inyi"),o=n("wxYD"),a=n("R5u7");e.exports=function(e,t,n){var l=o(e)?r:s;return n&&a(e,t,n)&&(t=void 0),l(e,i(t,3))}},ExWj:(e,t,n)=>{var r=n("JcJ6"),i=n("rXFn"),s=n("GZgP"),o=n("R5u7"),a=n("UBkg"),l=n("f2p0"),c=n("dw5g");e.exports=function(e,t,n){return n&&"number"!=typeof n&&o(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=c(e))&&("string"==typeof t||null!=t&&!a(t))&&!(t=r(t))&&s(e)?i(l(e),0,n):e.split(t,n):[]}},X4R2:e=>{e.exports=function(){return[]}},DjCF:e=>{e.exports=function(){return!1}},LF7v:e=>{e.exports=function(){return!0}},Bcqe:(e,t,n)=>{var r=n("RNvQ"),i=n("tQYX");e.exports=function(e,t,n){var s=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return i(n)&&(s="leading"in n?!!n.leading:s,o="trailing"in n?!!n.trailing:o),r(e,t,{leading:s,maxWait:t,trailing:o})}},"15pl":(e,t,n)=>{var r=n("2ZvR"),i=n("D49j"),s=n("m2YG"),o=4294967295,a=Math.min;e.exports=function(e,t){if((e=s(e))<1||e>9007199254740991)return[];var n=o,l=a(e,o);t=i(t),e-=o;for(var c=r(l,t);++n<e;)t(n);return c}},fWyh:(e,t,n)=>{var r=n("nvU9"),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},m2YG:(e,t,n)=>{var r=n("fWyh");e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},nvU9:(e,t,n)=>{var r=n("I1fX"),i=n("tQYX"),s=n("a88S"),o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(s(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):o.test(e)?NaN:+e}},ND9x:(e,t,n)=>{var r=n("H87J"),i=n("QT01"),s=n("wxYD"),o=n("a88S"),a=n("SoOq"),l=n("Ypsa"),c=n("dw5g");e.exports=function(e){return s(e)?r(e,l):o(e)?[e]:i(a(c(e)))}},"4ScB":(e,t,n)=>{var r=n("LtXa"),i=n("zH+d");e.exports=function(e){return r(e,i(e))}},dw5g:(e,t,n)=>{var r=n("JcJ6");e.exports=function(e){return null==e?"":r(e)}},jLkM:(e,t,n)=>{var r=n("s+R0");e.exports=function(e){return e&&e.length?r(e):[]}},eGeI:(e,t,n)=>{var r=n("a49g");e.exports=function(e,t){return null==e||r(e,t)}},"0iyY":(e,t,n)=>{var r=n("SJvO"),i=n("BlJA");e.exports=function(e){return null==e?[]:r(e,i(e))}},uUTq:(e,t,n)=>{var r=n("X+YX"),i=n("R3TX"),s=n("Ndl3"),o=i((function(e,t){return s(e)?r(e,t):[]}));e.exports=o},Nh1y:function(module,exports,__webpack_require__){var factory;"undefined"!=typeof document&&"undefined"!=typeof navigator&&(factory=function(){"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(e){return document.createElement(e)}function extendPrototype(e,t){var n,r,i=e.length;for(n=0;n<i;n+=1)for(var s in r=e[n].prototype)Object.prototype.hasOwnProperty.call(r,s)&&(t.prototype[s]=r[s])}function getDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)}function createProxyFunction(e){function t(){}return t.prototype=e,t}var audioControllerFactory=function(){function e(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return e.prototype={addAudio:function(e){this.audios.push(e)},pause:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].pause()},resume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].resume()},setRate:function(e){var t,n=this.audios.length;for(t=0;t<n;t+=1)this.audios[t].setRate(e)},createAudio:function(e){return this.audioFactory?this.audioFactory(e):window.Howl?new window.Howl({src:[e]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(e){this.audioFactory=e},setVolume:function(e){this._volume=e,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].volume(this._volume*(this._isMuted?0:1))}},function(){return new e}}(),createTypedArray=function(){function e(e,t){var n,r=0,i=[];switch(e){case"int16":case"uint8c":n=1;break;default:n=1.1}for(r=0;r<t;r+=1)i.push(n);return i}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,n){return"float32"===t?new Float32Array(n):"int16"===t?new Int16Array(n):"uint8c"===t?new Uint8ClampedArray(n):e(t,n)}:e}();function createSizedArray(e){return Array.apply(null,{length:e})}function _typeof$6(e){return _typeof$6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(e)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),_shouldRoundValues=!1,bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};function ProjectInterface$1(){return{}}!function(){var e,t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],n=t.length;for(e=0;e<n;e+=1)BMMath[t[e]]=Math[t[e]]}(),BMMath.random=Math.random,BMMath.abs=function(e){if("object"===_typeof$6(e)&&e.length){var t,n=createSizedArray(e.length),r=e.length;for(t=0;t<r;t+=1)n[t]=Math.abs(e[t]);return n}return Math.abs(e)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(e){_shouldRoundValues=!!e}function bmRnd(e){return _shouldRoundValues?Math.round(e):e}function styleDiv(e){e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.display="block",e.style.transformOrigin="0 0",e.style.webkitTransformOrigin="0 0",e.style.backfaceVisibility="visible",e.style.webkitBackfaceVisibility="visible",e.style.transformStyle="preserve-3d",e.style.webkitTransformStyle="preserve-3d",e.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(e,t,n,r){this.type=e,this.currentTime=t,this.totalTime=n,this.direction=r<0?-1:1}function BMCompleteEvent(e,t){this.type=e,this.direction=t<0?-1:1}function BMCompleteLoopEvent(e,t,n,r){this.type=e,this.currentLoop=n,this.totalLoops=t,this.direction=r<0?-1:1}function BMSegmentStartEvent(e,t,n){this.type=e,this.firstFrame=t,this.totalFrames=n}function BMDestroyEvent(e,t){this.type=e,this.target=t}function BMRenderFrameErrorEvent(e,t){this.type="renderFrameError",this.nativeError=e,this.currentTime=t}function BMConfigErrorEvent(e){this.type="configError",this.nativeError=e}function BMAnimationConfigErrorEvent(e,t){this.type=e,this.nativeError=t}var createElementID=(_count=0,function(){return idPrefix$1+"__lottie_element_"+(_count+=1)}),_count;function HSVtoRGB(e,t,n){var r,i,s,o,a,l,c,d;switch(l=n*(1-t),c=n*(1-(a=6*e-(o=Math.floor(6*e)))*t),d=n*(1-(1-a)*t),o%6){case 0:r=n,i=d,s=l;break;case 1:r=c,i=n,s=l;break;case 2:r=l,i=n,s=d;break;case 3:r=l,i=c,s=n;break;case 4:r=d,i=l,s=n;break;case 5:r=n,i=l,s=c}return[r,i,s]}function RGBtoHSV(e,t,n){var r,i=Math.max(e,t,n),s=Math.min(e,t,n),o=i-s,a=0===i?0:o/i,l=i/255;switch(i){case s:r=0;break;case e:r=t-n+o*(t<n?6:0),r/=6*o;break;case t:r=n-e+2*o,r/=6*o;break;case n:r=e-t+4*o,r/=6*o}return[r,a,l]}function addSaturationToRGB(e,t){var n=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return n[1]+=t,n[1]>1?n[1]=1:n[1]<=0&&(n[1]=0),HSVtoRGB(n[0],n[1],n[2])}function addBrightnessToRGB(e,t){var n=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return n[2]+=t,n[2]>1?n[2]=1:n[2]<0&&(n[2]=0),HSVtoRGB(n[0],n[1],n[2])}function addHueToRGB(e,t){var n=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return n[0]+=t/360,n[0]>1?n[0]-=1:n[0]<0&&(n[0]+=1),HSVtoRGB(n[0],n[1],n[2])}var rgbToHex=function(){var e,t,n=[];for(e=0;e<256;e+=1)t=e.toString(16),n[e]=1===t.length?"0"+t:t;return function(e,t,r){return e<0&&(e=0),t<0&&(t=0),r<0&&(r=0),"#"+n[e]+n[t]+n[r]}}(),setSubframeEnabled=function(e){subframeEnabled=!!e},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(e){expressionsPlugin=e},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(e){expressionsInterfaces=e},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(e){defaultCurveSegments=e},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(e){idPrefix$1=e},getIdPrefix=function(){return idPrefix$1};function createNS(e){return document.createElementNS(svgNS,e)}function _typeof$5(e){return _typeof$5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(e)}var dataManager=function(){var e,t,n=1,r=[],i={onmessage:function(){},postMessage:function(t){e({data:t})}},s={postMessage:function(e){i.onmessage({data:e})}};function o(){t||(t=function(t){if(window.Worker&&window.Blob&&getWebWorker()){var n=new Blob(["var _workerSelf = self; self.onmessage = ",t.toString()],{type:"text/javascript"}),r=URL.createObjectURL(n);return new Worker(r)}return e=t,i}((function(e){if(s.dataManager||(s.dataManager=function(){function e(i,s){var o,a,l,c,d,u,p=i.length;for(a=0;a<p;a+=1)if("ks"in(o=i[a])&&!o.completed){if(o.completed=!0,o.hasMask){var f=o.masksProperties;for(c=f.length,l=0;l<c;l+=1)if(f[l].pt.k.i)r(f[l].pt.k);else for(u=f[l].pt.k.length,d=0;d<u;d+=1)f[l].pt.k[d].s&&r(f[l].pt.k[d].s[0]),f[l].pt.k[d].e&&r(f[l].pt.k[d].e[0])}0===o.ty?(o.layers=t(o.refId,s),e(o.layers,s)):4===o.ty?n(o.shapes):5===o.ty&&h(o)}}function t(e,t){var n=function(e,t){for(var n=0,r=t.length;n<r;){if(t[n].id===e)return t[n];n+=1}return null}(e,t);return n?n.layers.__used?JSON.parse(JSON.stringify(n.layers)):(n.layers.__used=!0,n.layers):null}function n(e){var t,i,s;for(t=e.length-1;t>=0;t-=1)if("sh"===e[t].ty)if(e[t].ks.k.i)r(e[t].ks.k);else for(s=e[t].ks.k.length,i=0;i<s;i+=1)e[t].ks.k[i].s&&r(e[t].ks.k[i].s[0]),e[t].ks.k[i].e&&r(e[t].ks.k[i].e[0]);else"gr"===e[t].ty&&n(e[t].it)}function r(e){var t,n=e.i.length;for(t=0;t<n;t+=1)e.i[t][0]+=e.v[t][0],e.i[t][1]+=e.v[t][1],e.o[t][0]+=e.v[t][0],e.o[t][1]+=e.v[t][1]}function i(e,t){var n=t?t.split("."):[100,100,100];return e[0]>n[0]||!(n[0]>e[0])&&(e[1]>n[1]||!(n[1]>e[1])&&(e[2]>n[2]||!(n[2]>e[2])&&null))}var s,o=function(){var e=[4,4,14];function t(e){var t,n,r,i=e.length;for(t=0;t<i;t+=1)5===e[t].ty&&(r=void 0,r=(n=e[t]).t.d,n.t.d={k:[{s:r,t:0}]})}return function(n){if(i(e,n.v)&&(t(n.layers),n.assets)){var r,s=n.assets.length;for(r=0;r<s;r+=1)n.assets[r].layers&&t(n.assets[r].layers)}}}(),a=(s=[4,7,99],function(e){if(e.chars&&!i(s,e.v)){var t,r=e.chars.length;for(t=0;t<r;t+=1){var o=e.chars[t];o.data&&o.data.shapes&&(n(o.data.shapes),o.data.ip=0,o.data.op=99999,o.data.st=0,o.data.sr=1,o.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},e.chars[t].t||(o.data.shapes.push({ty:"no"}),o.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}),l=function(){var e=[5,7,15];function t(e){var t,n,r=e.length;for(t=0;t<r;t+=1)5===e[t].ty&&(n=void 0,"number"==typeof(n=e[t].t.p).a&&(n.a={a:0,k:n.a}),"number"==typeof n.p&&(n.p={a:0,k:n.p}),"number"==typeof n.r&&(n.r={a:0,k:n.r}))}return function(n){if(i(e,n.v)&&(t(n.layers),n.assets)){var r,s=n.assets.length;for(r=0;r<s;r+=1)n.assets[r].layers&&t(n.assets[r].layers)}}}(),c=function(){var e=[4,1,9];function t(e){var n,r,i,s=e.length;for(n=0;n<s;n+=1)if("gr"===e[n].ty)t(e[n].it);else if("fl"===e[n].ty||"st"===e[n].ty)if(e[n].c.k&&e[n].c.k[0].i)for(i=e[n].c.k.length,r=0;r<i;r+=1)e[n].c.k[r].s&&(e[n].c.k[r].s[0]/=255,e[n].c.k[r].s[1]/=255,e[n].c.k[r].s[2]/=255,e[n].c.k[r].s[3]/=255),e[n].c.k[r].e&&(e[n].c.k[r].e[0]/=255,e[n].c.k[r].e[1]/=255,e[n].c.k[r].e[2]/=255,e[n].c.k[r].e[3]/=255);else e[n].c.k[0]/=255,e[n].c.k[1]/=255,e[n].c.k[2]/=255,e[n].c.k[3]/=255}function n(e){var n,r=e.length;for(n=0;n<r;n+=1)4===e[n].ty&&t(e[n].shapes)}return function(t){if(i(e,t.v)&&(n(t.layers),t.assets)){var r,s=t.assets.length;for(r=0;r<s;r+=1)t.assets[r].layers&&n(t.assets[r].layers)}}}(),d=function(){var e=[4,4,18];function t(e){var n,r,i;for(n=e.length-1;n>=0;n-=1)if("sh"===e[n].ty)if(e[n].ks.k.i)e[n].ks.k.c=e[n].closed;else for(i=e[n].ks.k.length,r=0;r<i;r+=1)e[n].ks.k[r].s&&(e[n].ks.k[r].s[0].c=e[n].closed),e[n].ks.k[r].e&&(e[n].ks.k[r].e[0].c=e[n].closed);else"gr"===e[n].ty&&t(e[n].it)}function n(e){var n,r,i,s,o,a,l=e.length;for(r=0;r<l;r+=1){if((n=e[r]).hasMask){var c=n.masksProperties;for(s=c.length,i=0;i<s;i+=1)if(c[i].pt.k.i)c[i].pt.k.c=c[i].cl;else for(a=c[i].pt.k.length,o=0;o<a;o+=1)c[i].pt.k[o].s&&(c[i].pt.k[o].s[0].c=c[i].cl),c[i].pt.k[o].e&&(c[i].pt.k[o].e[0].c=c[i].cl)}4===n.ty&&t(n.shapes)}}return function(t){if(i(e,t.v)&&(n(t.layers),t.assets)){var r,s=t.assets.length;for(r=0;r<s;r+=1)t.assets[r].layers&&n(t.assets[r].layers)}}}();function h(e){0===e.t.a.length&&e.t.p}var u={completeData:function(n){n.__complete||(c(n),o(n),a(n),l(n),d(n),e(n.layers,n.assets),function(n,r){if(n){var i=0,s=n.length;for(i=0;i<s;i+=1)1===n[i].t&&(n[i].data.layers=t(n[i].data.refId,r),e(n[i].data.layers,r))}}(n.chars,n.assets),n.__complete=!0)}};return u.checkColors=c,u.checkChars=a,u.checkPathProperties=l,u.checkShapes=d,u.completeLayers=e,u}()),s.assetLoader||(s.assetLoader=function(){function e(e){var t=e.getResponseHeader("content-type");return t&&"json"===e.responseType&&-1!==t.indexOf("json")||e.response&&"object"===_typeof$5(e.response)?e.response:e.response&&"string"==typeof e.response?JSON.parse(e.response):e.responseText?JSON.parse(e.responseText):null}return{load:function(t,n,r,i){var s,o=new XMLHttpRequest;try{o.responseType="json"}catch(e){}o.onreadystatechange=function(){if(4===o.readyState)if(200===o.status)s=e(o),r(s);else try{s=e(o),r(s)}catch(e){i&&i(e)}};try{o.open(["G","E","T"].join(""),t,!0)}catch(e){o.open(["G","E","T"].join(""),n+"/"+t,!0)}o.send()}}}()),"loadAnimation"===e.data.type)s.assetLoader.load(e.data.path,e.data.fullPath,(function(t){s.dataManager.completeData(t),s.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){s.postMessage({id:e.data.id,status:"error"})}));else if("complete"===e.data.type){var t=e.data.animation;s.dataManager.completeData(t),s.postMessage({id:e.data.id,payload:t,status:"success"})}else"loadData"===e.data.type&&s.assetLoader.load(e.data.path,e.data.fullPath,(function(t){s.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){s.postMessage({id:e.data.id,status:"error"})}))})),t.onmessage=function(e){var t=e.data,n=t.id,i=r[n];r[n]=null,"success"===t.status?i.onComplete(t.payload):i.onError&&i.onError()})}function a(e,t){var i="processId_"+(n+=1);return r[i]={onComplete:e,onError:t},i}return{loadAnimation:function(e,n,r){o();var i=a(n,r);t.postMessage({type:"loadAnimation",path:e,fullPath:window.location.origin+window.location.pathname,id:i})},loadData:function(e,n,r){o();var i=a(n,r);t.postMessage({type:"loadData",path:e,fullPath:window.location.origin+window.location.pathname,id:i})},completeAnimation:function(e,n,r){o();var i=a(n,r);t.postMessage({type:"complete",animation:e,id:i})}}}(),ImagePreloader=function(){var e=function(){var e=createTag("canvas");e.width=1,e.height=1;var t=e.getContext("2d");return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),e}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function n(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(e,t,n){var r="";if(e.e)r=e.p;else if(t){var i=e.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),r=t+i}else r=n,r+=e.u?e.u:"",r+=e.p;return r}function i(e){var t=0,n=setInterval(function(){(e.getBBox().width||t>500)&&(this._imageLoaded(),clearInterval(n)),t+=1}.bind(this),50)}function s(e){var t={assetData:e},n=r(e,this.assetsPath,this.path);return dataManager.loadData(n,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function o(){this._imageLoaded=t.bind(this),this._footageLoaded=n.bind(this),this.testImageLoaded=i.bind(this),this.createFootageData=s.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return o.prototype={loadAssets:function(e,t){var n;this.imagesLoadedCb=t;var r=e.length;for(n=0;n<r;n+=1)e[n].layers||(e[n].t&&"seq"!==e[n].t?3===e[n].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(e[n]))):(this.totalImages+=1,this.images.push(this._createImageData(e[n]))))},setAssetsPath:function(e){this.assetsPath=e||""},setPath:function(e){this.path=e||""},loadedImages:function(){return this.totalImages===this.loadedAssets},loadedFootages:function(){return this.totalFootages===this.loadedFootagesCount},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getAsset:function(e){for(var t=0,n=this.images.length;t<n;){if(this.images[t].assetData===e)return this.images[t].img;t+=1}return null},createImgData:function(t){var n=r(t,this.assetsPath,this.path),i=createTag("img");i.crossOrigin="anonymous",i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){s.img=e,this._imageLoaded()}.bind(this),!1),i.src=n;var s={img:i,assetData:t};return s},createImageData:function(t){var n=r(t,this.assetsPath,this.path),i=createNS("image");isSafari?this.testImageLoaded(i):i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){s.img=e,this._imageLoaded()}.bind(this),!1),i.setAttributeNS("http://www.w3.org/1999/xlink","href",n),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i);var s={img:i,assetData:t};return s},imageLoaded:t,footageLoaded:n,setCacheType:function(e,t){"svg"===e?(this._elementHelper=t,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}},o}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(e,t){if(this._cbs[e])for(var n=this._cbs[e],r=0;r<n.length;r+=1)n[r](t)},addEventListener:function(e,t){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(t),function(){this.removeEventListener(e,t)}.bind(this)},removeEventListener:function(e,t){if(t){if(this._cbs[e]){for(var n=0,r=this._cbs[e].length;n<r;)this._cbs[e][n]===t&&(this._cbs[e].splice(n,1),n-=1,r-=1),n+=1;this._cbs[e].length||(this._cbs[e]=null)}}else this._cbs[e]=null}};var markerParser=function(){function e(e){for(var t,n=e.split("\r\n"),r={},i=0,s=0;s<n.length;s+=1)2===(t=n[s].split(":")).length&&(r[t[0]]=t[1].trim(),i+=1);if(0===i)throw new Error;return r}return function(t){for(var n=[],r=0;r<t.length;r+=1){var i=t[r],s={time:i.tm,duration:i.dr};try{s.payload=JSON.parse(t[r].cm)}catch(n){try{s.payload=e(t[r].cm)}catch(e){s.payload={name:t[r].cm}}}n.push(s)}return n}}(),ProjectInterface=function(){function e(e){this.compositions.push(e)}return function(){function t(e){for(var t=0,n=this.compositions.length;t<n;){if(this.compositions[t].data&&this.compositions[t].data.nm===e)return this.compositions[t].prepareFrame&&this.compositions[t].data.xt&&this.compositions[t].prepareFrame(this.currentFrame),this.compositions[t].compInterface;t+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),renderers={},registerRenderer=function(e,t){renderers[e]=t};function getRenderer(e){return renderers[e]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var e in renderers)if(renderers[e])return e;return""}function _typeof$4(e){return _typeof$4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$4(e)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(e){(e.wrapper||e.container)&&(this.wrapper=e.wrapper||e.container);var t="svg";e.animType?t=e.animType:e.renderer&&(t=e.renderer);var n=getRenderer(t);this.renderer=new n(this,e.rendererSettings),this.imagePreloader.setCacheType(t,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=t,""===e.loop||null===e.loop||void 0===e.loop||!0===e.loop?this.loop=!0:!1===e.loop?this.loop=!1:this.loop=parseInt(e.loop,10),this.autoplay=!("autoplay"in e)||e.autoplay,this.name=e.name?e.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(e,"autoloadSegments")||e.autoloadSegments,this.assetsPath=e.assetsPath,this.initialSegment=e.initialSegment,e.audioFactory&&this.audioController.setAudioFactory(e.audioFactory),e.animationData?this.setupAnimation(e.animationData):e.path&&(-1!==e.path.lastIndexOf("\\")?this.path=e.path.substr(0,e.path.lastIndexOf("\\")+1):this.path=e.path.substr(0,e.path.lastIndexOf("/")+1),this.fileName=e.path.substr(e.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(e.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(e){dataManager.completeAnimation(e,this.configAnimation)},AnimationItem.prototype.setData=function(e,t){t&&"object"!==_typeof$4(t)&&(t=JSON.parse(t));var n={wrapper:e,animationData:t},r=e.attributes;n.path=r.getNamedItem("data-animation-path")?r.getNamedItem("data-animation-path").value:r.getNamedItem("data-bm-path")?r.getNamedItem("data-bm-path").value:r.getNamedItem("bm-path")?r.getNamedItem("bm-path").value:"",n.animType=r.getNamedItem("data-anim-type")?r.getNamedItem("data-anim-type").value:r.getNamedItem("data-bm-type")?r.getNamedItem("data-bm-type").value:r.getNamedItem("bm-type")?r.getNamedItem("bm-type").value:r.getNamedItem("data-bm-renderer")?r.getNamedItem("data-bm-renderer").value:r.getNamedItem("bm-renderer")?r.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var i=r.getNamedItem("data-anim-loop")?r.getNamedItem("data-anim-loop").value:r.getNamedItem("data-bm-loop")?r.getNamedItem("data-bm-loop").value:r.getNamedItem("bm-loop")?r.getNamedItem("bm-loop").value:"";"false"===i?n.loop=!1:"true"===i?n.loop=!0:""!==i&&(n.loop=parseInt(i,10));var s=r.getNamedItem("data-anim-autoplay")?r.getNamedItem("data-anim-autoplay").value:r.getNamedItem("data-bm-autoplay")?r.getNamedItem("data-bm-autoplay").value:!r.getNamedItem("bm-autoplay")||r.getNamedItem("bm-autoplay").value;n.autoplay="false"!==s,n.name=r.getNamedItem("data-name")?r.getNamedItem("data-name").value:r.getNamedItem("data-bm-name")?r.getNamedItem("data-bm-name").value:r.getNamedItem("bm-name")?r.getNamedItem("bm-name").value:"","false"===(r.getNamedItem("data-anim-prerender")?r.getNamedItem("data-anim-prerender").value:r.getNamedItem("data-bm-prerender")?r.getNamedItem("data-bm-prerender").value:r.getNamedItem("bm-prerender")?r.getNamedItem("bm-prerender").value:"")&&(n.prerender=!1),n.path?this.setParams(n):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(e){e.op>this.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t,n,r=this.animationData.layers,i=r.length,s=e.layers,o=s.length;for(n=0;n<o;n+=1)for(t=0;t<i;){if(r[t].id===s[n].id){r[t]=s[n];break}t+=1}if((e.chars||e.fonts)&&(this.renderer.globalData.fontManager.addChars(e.chars),this.renderer.globalData.fontManager.addFonts(e.fonts,this.renderer.globalData.defs)),e.assets)for(i=e.assets.length,t=0;t<i;t+=1)this.animationData.assets.push(e.assets[t]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(e){this.animationData=e;var t=getExpressionsPlugin();t&&t.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var e=this.animationData.segments;if(!e||0===e.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var t=e.shift();this.timeCompleted=t.time*this.frameRate;var n=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(n,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(e){if(this.renderer)try{this.animationData=e,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(e),e.assets||(e.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(e.assets),this.markers=markerParser(e.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(e){this.triggerConfigError(e)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(e,t){var n="number"==typeof e?e:void 0,r="number"==typeof t?t:void 0;this.renderer.updateContainerSize(n,r)},AnimationItem.prototype.setSubframe=function(e){this.isSubframeEnabled=!!e},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},AnimationItem.prototype.play=function(e){e&&this.name!==e||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(e){e&&this.name!==e||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(e){e&&this.name!==e||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(e){for(var t,n=0;n<this.markers.length;n+=1)if((t=this.markers[n]).payload&&t.payload.name===e)return t;return null},AnimationItem.prototype.goToAndStop=function(e,t,n){if(!n||this.name===n){var r=Number(e);if(isNaN(r)){var i=this.getMarkerData(e);i&&this.goToAndStop(i.time,!0)}else t?this.setCurrentRawFrameValue(e):this.setCurrentRawFrameValue(e*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(e,t,n){if(!n||this.name===n){var r=Number(e);if(isNaN(r)){var i=this.getMarkerData(e);i&&(i.duration?this.playSegments([i.time,i.time+i.duration],!0):this.goToAndStop(i.time,!0))}else this.goToAndStop(r,t,n);this.play()}},AnimationItem.prototype.advanceTime=function(e){if(!0!==this.isPaused&&!1!==this.isLoaded){var t=this.currentRawFrame+e*this.frameModifier,n=!1;t>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(t):this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(n=!0,t=this.totalFrames-1):t<0?this.checkSegments(t%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(n=!0,t=0):(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(t),n&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]<e[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(e,t){var n=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<e?n=e:this.currentRawFrame+this.firstFrame>t&&(n=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,-1!==n&&this.goToAndStop(n,!0)},AnimationItem.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),"object"===_typeof$4(e[0])){var n,r=e.length;for(n=0;n<r;n+=1)this.segments.push(e[n])}else this.segments.push(e);this.segments.length&&t&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(e){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),e&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(e){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),e),!0)},AnimationItem.prototype.destroy=function(e){e&&this.name!==e||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(e){this.currentRawFrame=e,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(e){this.playSpeed=e,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(e){this.playDirection=e<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(e){this.loop=e},AnimationItem.prototype.setVolume=function(e,t){t&&this.name!==t||this.audioController.setVolume(e)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(e){e&&this.name!==e||this.audioController.mute()},AnimationItem.prototype.unmute=function(e){e&&this.name!==e||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(e){var t="";if(e.e)t=e.p;else if(this.assetsPath){var n=e.p;-1!==n.indexOf("images/")&&(n=n.split("/")[1]),t=this.assetsPath+n}else t=this.path,t+=e.u?e.u:"",t+=e.p;return t},AnimationItem.prototype.getAssetData=function(e){for(var t=0,n=this.assets.length;t<n;){if(e===this.assets[t].id)return this.assets[t];t+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(e){return e?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(e,t,n){try{this.renderer.getElementByPath(e).updateDocumentData(t,n)}catch(e){}},AnimationItem.prototype.trigger=function(e){if(this._cbs&&this._cbs[e])switch(e){case"enterFrame":this.triggerEvent(e,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(e,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(e,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(e,new BMCompleteEvent(e,this.frameMult));break;case"segmentStart":this.triggerEvent(e,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(e,new BMDestroyEvent(e,this));break;default:this.triggerEvent(e)}"enterFrame"===e&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===e&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult)),"complete"===e&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(e,this.frameMult)),"segmentStart"===e&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames)),"destroy"===e&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(e,this))},AnimationItem.prototype.triggerRenderFrameError=function(e){var t=new BMRenderFrameErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)},AnimationItem.prototype.triggerConfigError=function(e){var t=new BMConfigErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)};var animationManager=function(){var e={},t=[],n=0,r=0,i=0,s=!0,o=!1;function a(e){for(var n=0,i=e.target;n<r;)t[n].animation===i&&(t.splice(n,1),n-=1,r-=1,i.isPaused||d()),n+=1}function l(e,n){if(!e)return null;for(var i=0;i<r;){if(t[i].elem===e&&null!==t[i].elem)return t[i].animation;i+=1}var s=new AnimationItem;return h(s,e),s.setData(e,n),s}function c(){i+=1,f()}function d(){i-=1}function h(e,n){e.addEventListener("destroy",a),e.addEventListener("_active",c),e.addEventListener("_idle",d),t.push({elem:n,animation:e}),r+=1}function u(e){var a,l=e-n;for(a=0;a<r;a+=1)t[a].animation.advanceTime(l);n=e,i&&!o?window.requestAnimationFrame(u):s=!0}function p(e){n=e,window.requestAnimationFrame(u)}function f(){!o&&i&&s&&(window.requestAnimationFrame(p),s=!1)}return e.registerAnimation=l,e.loadAnimation=function(e){var t=new AnimationItem;return h(t,null),t.setParams(e),t},e.setSpeed=function(e,n){var i;for(i=0;i<r;i+=1)t[i].animation.setSpeed(e,n)},e.setDirection=function(e,n){var i;for(i=0;i<r;i+=1)t[i].animation.setDirection(e,n)},e.play=function(e){var n;for(n=0;n<r;n+=1)t[n].animation.play(e)},e.pause=function(e){var n;for(n=0;n<r;n+=1)t[n].animation.pause(e)},e.stop=function(e){var n;for(n=0;n<r;n+=1)t[n].animation.stop(e)},e.togglePause=function(e){var n;for(n=0;n<r;n+=1)t[n].animation.togglePause(e)},e.searchAnimations=function(e,t,n){var r,i=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),s=i.length;for(r=0;r<s;r+=1)n&&i[r].setAttribute("data-bm-type",n),l(i[r],e);if(t&&0===s){n||(n="svg");var o=document.getElementsByTagName("body")[0];o.innerText="";var a=createTag("div");a.style.width="100%",a.style.height="100%",a.setAttribute("data-bm-type",n),o.appendChild(a),l(a,e)}},e.resize=function(){var e;for(e=0;e<r;e+=1)t[e].animation.resize()},e.goToAndStop=function(e,n,i){var s;for(s=0;s<r;s+=1)t[s].animation.goToAndStop(e,n,i)},e.destroy=function(e){var n;for(n=r-1;n>=0;n-=1)t[n].animation.destroy(e)},e.freeze=function(){o=!0},e.unfreeze=function(){o=!1,f()},e.setVolume=function(e,n){var i;for(i=0;i<r;i+=1)t[i].animation.setVolume(e,n)},e.mute=function(e){var n;for(n=0;n<r;n+=1)t[n].animation.mute(e)},e.unmute=function(e){var n;for(n=0;n<r;n+=1)t[n].animation.unmute(e)},e.getRegisteredAnimations=function(){var e,n=t.length,r=[];for(e=0;e<n;e+=1)r.push(t[e].animation);return r},e}(),BezierFactory=function(){var e={getBezierEasing:function(e,n,r,i,s){var o=s||("bez_"+e+"_"+n+"_"+r+"_"+i).replace(/\./g,"p");if(t[o])return t[o];var a=new d([e,n,r,i]);return t[o]=a,a}},t={},n=11,r=1/(n-1),i="function"==typeof Float32Array;function s(e,t){return 1-3*t+3*e}function o(e,t){return 3*t-6*e}function a(e){return 3*e}function l(e,t,n){return((s(t,n)*e+o(t,n))*e+a(t))*e}function c(e,t,n){return 3*s(t,n)*e*e+2*o(t,n)*e+a(t)}function d(e){this._p=e,this._mSampleValues=i?new Float32Array(n):new Array(n),this._precomputed=!1,this.get=this.get.bind(this)}return d.prototype={get:function(e){var t=this._p[0],n=this._p[1],r=this._p[2],i=this._p[3];return this._precomputed||this._precompute(),t===n&&r===i?e:0===e?0:1===e?1:l(this._getTForX(e),n,i)},_precompute:function(){var e=this._p[0],t=this._p[1],n=this._p[2],r=this._p[3];this._precomputed=!0,e===t&&n===r||this._calcSampleValues()},_calcSampleValues:function(){for(var e=this._p[0],t=this._p[2],i=0;i<n;++i)this._mSampleValues[i]=l(i*r,e,t)},_getTForX:function(e){for(var t=this._p[0],i=this._p[2],s=this._mSampleValues,o=0,a=1,d=n-1;a!==d&&s[a]<=e;++a)o+=r;var h=o+(e-s[--a])/(s[a+1]-s[a])*r,u=c(h,t,i);return u>=.001?function(e,t,n,r){for(var i=0;i<4;++i){var s=c(t,n,r);if(0===s)return t;t-=(l(t,n,r)-e)/s}return t}(e,h,t,i):0===u?h:function(e,t,n,r,i){var s,o,a=0;do{(s=l(o=t+(n-t)/2,r,i)-e)>0?n=o:t=o}while(Math.abs(s)>1e-7&&++a<10);return o}(e,o,o+r,t,i)}},e}(),pooling={double:function(e){return e.concat(createSizedArray(e.length))}},poolFactory=function(e,t,n){var r=0,i=e,s=createSizedArray(i);return{newElement:function(){return r?s[r-=1]:t()},release:function(e){r===i&&(s=pooling.double(s),i*=2),n&&n(e),s[r]=e,r+=1}}},bezierLengthPool=poolFactory(8,(function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}})),segmentsLengthPool=poolFactory(8,(function(){return{lengths:[],totalLength:0}}),(function(e){var t,n=e.lengths.length;for(t=0;t<n;t+=1)bezierLengthPool.release(e.lengths[t]);e.lengths.length=0}));function bezFunction(){var e=Math;function t(e,t,n,r,i,s){var o=e*r+t*i+n*s-i*r-s*e-n*t;return o>-.001&&o<.001}var n=function(e,t,n,r){var i,s,o,a,l,c,d=getDefaultCurveSegments(),h=0,u=[],p=[],f=bezierLengthPool.newElement();for(o=n.length,i=0;i<d;i+=1){for(l=i/(d-1),c=0,s=0;s<o;s+=1)a=bmPow(1-l,3)*e[s]+3*bmPow(1-l,2)*l*n[s]+3*(1-l)*bmPow(l,2)*r[s]+bmPow(l,3)*t[s],u[s]=a,null!==p[s]&&(c+=bmPow(u[s]-p[s],2)),p[s]=u[s];c&&(h+=c=bmSqrt(c)),f.percents[i]=l,f.lengths[i]=h}return f.addedLength=h,f};function r(e){this.segmentLength=0,this.points=new Array(e)}function i(e,t){this.partialLength=e,this.point=t}var s,o=(s={},function(e,n,o,a){var l=(e[0]+"_"+e[1]+"_"+n[0]+"_"+n[1]+"_"+o[0]+"_"+o[1]+"_"+a[0]+"_"+a[1]).replace(/\./g,"p");if(!s[l]){var c,d,h,u,p,f,m,g=getDefaultCurveSegments(),y=0,v=null;2===e.length&&(e[0]!==n[0]||e[1]!==n[1])&&t(e[0],e[1],n[0],n[1],e[0]+o[0],e[1]+o[1])&&t(e[0],e[1],n[0],n[1],n[0]+a[0],n[1]+a[1])&&(g=2);var b=new r(g);for(h=o.length,c=0;c<g;c+=1){for(m=createSizedArray(h),p=c/(g-1),f=0,d=0;d<h;d+=1)u=bmPow(1-p,3)*e[d]+3*bmPow(1-p,2)*p*(e[d]+o[d])+3*(1-p)*bmPow(p,2)*(n[d]+a[d])+bmPow(p,3)*n[d],m[d]=u,null!==v&&(f+=bmPow(m[d]-v[d],2));y+=f=bmSqrt(f),b.points[c]=new i(f,m),v=m}b.segmentLength=y,s[l]=b}return s[l]});function a(e,t){var n=t.percents,r=t.lengths,i=n.length,s=bmFloor((i-1)*e),o=e*t.addedLength,a=0;if(s===i-1||0===s||o===r[s])return n[s];for(var l=r[s]>o?-1:1,c=!0;c;)if(r[s]<=o&&r[s+1]>o?(a=(o-r[s])/(r[s+1]-r[s]),c=!1):s+=l,s<0||s>=i-1){if(s===i-1)return n[s];c=!1}return n[s]+(n[s+1]-n[s])*a}var l=createTypedArray("float32",8);return{getSegmentsLength:function(e){var t,r=segmentsLengthPool.newElement(),i=e.c,s=e.v,o=e.o,a=e.i,l=e._length,c=r.lengths,d=0;for(t=0;t<l-1;t+=1)c[t]=n(s[t],s[t+1],o[t],a[t+1]),d+=c[t].addedLength;return i&&l&&(c[t]=n(s[t],s[0],o[t],a[0]),d+=c[t].addedLength),r.totalLength=d,r},getNewSegment:function(t,n,r,i,s,o,c){s<0?s=0:s>1&&(s=1);var d,h=a(s,c),u=a(o=o>1?1:o,c),p=t.length,f=1-h,m=1-u,g=f*f*f,y=h*f*f*3,v=h*h*f*3,b=h*h*h,w=f*f*m,x=h*f*m+f*h*m+f*f*u,E=h*h*m+f*h*u+h*f*u,C=h*h*u,S=f*m*m,_=h*m*m+f*u*m+f*m*u,k=h*u*m+f*u*u+h*m*u,O=h*u*u,T=m*m*m,P=u*m*m+m*u*m+m*m*u,I=u*u*m+m*u*u+u*m*u,M=u*u*u;for(d=0;d<p;d+=1)l[4*d]=e.round(1e3*(g*t[d]+y*r[d]+v*i[d]+b*n[d]))/1e3,l[4*d+1]=e.round(1e3*(w*t[d]+x*r[d]+E*i[d]+C*n[d]))/1e3,l[4*d+2]=e.round(1e3*(S*t[d]+_*r[d]+k*i[d]+O*n[d]))/1e3,l[4*d+3]=e.round(1e3*(T*t[d]+P*r[d]+I*i[d]+M*n[d]))/1e3;return l},getPointInSegment:function(t,n,r,i,s,o){var l=a(s,o),c=1-l;return[e.round(1e3*(c*c*c*t[0]+(l*c*c+c*l*c+c*c*l)*r[0]+(l*l*c+c*l*l+l*c*l)*i[0]+l*l*l*n[0]))/1e3,e.round(1e3*(c*c*c*t[1]+(l*c*c+c*l*c+c*c*l)*r[1]+(l*l*c+c*l*l+l*c*l)*i[1]+l*l*l*n[1]))/1e3]},buildBezierData:o,pointOnLine2D:t,pointOnLine3D:function(n,r,i,s,o,a,l,c,d){if(0===i&&0===a&&0===d)return t(n,r,s,o,l,c);var h,u=e.sqrt(e.pow(s-n,2)+e.pow(o-r,2)+e.pow(a-i,2)),p=e.sqrt(e.pow(l-n,2)+e.pow(c-r,2)+e.pow(d-i,2)),f=e.sqrt(e.pow(l-s,2)+e.pow(c-o,2)+e.pow(d-a,2));return(h=u>p?u>f?u-p-f:f-p-u:f>p?f-p-u:p-u-f)>-1e-4&&h<1e-4}}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(e,t){var n,r=this.offsetTime;"multidimensional"===this.propType&&(n=createTypedArray("float32",this.pv.length));for(var i,s,o,a,l,c,d,h,u,p=t.lastIndex,f=p,m=this.keyframes.length-1,g=!0;g;){if(i=this.keyframes[f],s=this.keyframes[f+1],f===m-1&&e>=s.t-r){i.h&&(i=s),p=0;break}if(s.t-r>e){p=f;break}f<m-1?f+=1:(p=0,g=!1)}o=this.keyframesMetadata[f]||{};var y,v=s.t-r,b=i.t-r;if(i.to){o.bezierData||(o.bezierData=bez.buildBezierData(i.s,s.s||i.e,i.to,i.ti));var w=o.bezierData;if(e>=v||e<b){var x=e>=v?w.points.length-1:0;for(l=w.points[x].point.length,a=0;a<l;a+=1)n[a]=w.points[x].point[a]}else{o.__fnct?u=o.__fnct:(u=BezierFactory.getBezierEasing(i.o.x,i.o.y,i.i.x,i.i.y,i.n).get,o.__fnct=u),c=u((e-b)/(v-b));var E,C=w.segmentLength*c,S=t.lastFrame<e&&t._lastKeyframeIndex===f?t._lastAddedLength:0;for(h=t.lastFrame<e&&t._lastKeyframeIndex===f?t._lastPoint:0,g=!0,d=w.points.length;g;){if(S+=w.points[h].partialLength,0===C||0===c||h===w.points.length-1){for(l=w.points[h].point.length,a=0;a<l;a+=1)n[a]=w.points[h].point[a];break}if(C>=S&&C<S+w.points[h+1].partialLength){for(E=(C-S)/w.points[h+1].partialLength,l=w.points[h].point.length,a=0;a<l;a+=1)n[a]=w.points[h].point[a]+(w.points[h+1].point[a]-w.points[h].point[a])*E;break}h<d-1?h+=1:g=!1}t._lastPoint=h,t._lastAddedLength=S-w.points[h].partialLength,t._lastKeyframeIndex=f}}else{var _,k,O,T,P;if(m=i.s.length,y=s.s||i.e,this.sh&&1!==i.h)e>=v?(n[0]=y[0],n[1]=y[1],n[2]=y[2]):e<=b?(n[0]=i.s[0],n[1]=i.s[1],n[2]=i.s[2]):quaternionToEuler(n,slerp(createQuaternion(i.s),createQuaternion(y),(e-b)/(v-b)));else for(f=0;f<m;f+=1)1!==i.h&&(e>=v?c=1:e<b?c=0:(i.o.x.constructor===Array?(o.__fnct||(o.__fnct=[]),o.__fnct[f]?u=o.__fnct[f]:(_=void 0===i.o.x[f]?i.o.x[0]:i.o.x[f],k=void 0===i.o.y[f]?i.o.y[0]:i.o.y[f],O=void 0===i.i.x[f]?i.i.x[0]:i.i.x[f],T=void 0===i.i.y[f]?i.i.y[0]:i.i.y[f],u=BezierFactory.getBezierEasing(_,k,O,T).get,o.__fnct[f]=u)):o.__fnct?u=o.__fnct:(_=i.o.x,k=i.o.y,O=i.i.x,T=i.i.y,u=BezierFactory.getBezierEasing(_,k,O,T).get,i.keyframeMetadata=u),c=u((e-b)/(v-b)))),y=s.s||i.e,P=1===i.h?i.s[f]:i.s[f]+(y[f]-i.s[f])*c,"multidimensional"===this.propType?n[f]=P:n=P}return t.lastIndex=p,n}function slerp(e,t,n){var r,i,s,o,a,l=[],c=e[0],d=e[1],h=e[2],u=e[3],p=t[0],f=t[1],m=t[2],g=t[3];return(i=c*p+d*f+h*m+u*g)<0&&(i=-i,p=-p,f=-f,m=-m,g=-g),1-i>1e-6?(r=Math.acos(i),s=Math.sin(r),o=Math.sin((1-n)*r)/s,a=Math.sin(n*r)/s):(o=1-n,a=n),l[0]=o*c+a*p,l[1]=o*d+a*f,l[2]=o*h+a*m,l[3]=o*u+a*g,l}function quaternionToEuler(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=Math.atan2(2*r*s-2*n*i,1-2*r*r-2*i*i),a=Math.asin(2*n*r+2*i*s),l=Math.atan2(2*n*s-2*r*i,1-2*n*n-2*i*i);e[0]=o/degToRads,e[1]=a/degToRads,e[2]=l/degToRads}function createQuaternion(e){var t=e[0]*degToRads,n=e[1]*degToRads,r=e[2]*degToRads,i=Math.cos(t/2),s=Math.cos(n/2),o=Math.cos(r/2),a=Math.sin(t/2),l=Math.sin(n/2),c=Math.sin(r/2);return[a*l*o+i*s*c,a*s*o+i*l*c,i*l*o-a*s*c,i*s*o-a*l*c]}function getValueAtCurrentTime(){var e=this.comp.renderedFrame-this.offsetTime,t=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(e===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=n&&e>=n||this._caching.lastFrame<t&&e<t))){this._caching.lastFrame>=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(e,this._caching);this.pv=r}return this._caching.lastFrame=e,this.pv}function setVValue(e){var t;if("unidimensional"===this.propType)t=e*this.mult,mathAbs(this.v-t)>1e-5&&(this.v=t,this._mdf=!0);else for(var n=0,r=this.v.length;n<r;)t=e[n]*this.mult,mathAbs(this.v[n]-t)>1e-5&&(this.v[n]=t,this._mdf=!0),n+=1}function processEffectsSequence(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e;this.lock=!0,this._mdf=this._isFirstFrame;var t=this.effectsSequence.length,n=this.kf?this.pv:this.data.k;for(e=0;e<t;e+=1)n=this.effectsSequence[e](n);this.setVValue(n),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function ValueProperty(e,t,n,r){this.propType="unidimensional",this.mult=n||1,this.data=t,this.v=n?t.k*n:t.k,this.pv=t.k,this._mdf=!1,this.elem=e,this.container=r,this.comp=e.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(e,t,n,r){var i;this.propType="multidimensional",this.mult=n||1,this.data=t,this._mdf=!1,this.elem=e,this.container=r,this.comp=e.comp,this.k=!1,this.kf=!1,this.frameId=-1;var s=t.k.length;for(this.v=createTypedArray("float32",s),this.pv=createTypedArray("float32",s),this.vel=createTypedArray("float32",s),i=0;i<s;i+=1)this.v[i]=t.k[i]*this.mult,this.pv[i]=t.k[i];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(e,t,n,r){this.propType="unidimensional",this.keyframes=t.k,this.keyframesMetadata=[],this.offsetTime=e.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=t,this.mult=n||1,this.elem=e,this.container=r,this.comp=e.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(e,t,n,r){var i;this.propType="multidimensional";var s,o,a,l,c=t.k.length;for(i=0;i<c-1;i+=1)t.k[i].to&&t.k[i].s&&t.k[i+1]&&t.k[i+1].s&&(s=t.k[i].s,o=t.k[i+1].s,a=t.k[i].to,l=t.k[i].ti,(2===s.length&&(s[0]!==o[0]||s[1]!==o[1])&&bez.pointOnLine2D(s[0],s[1],o[0],o[1],s[0]+a[0],s[1]+a[1])&&bez.pointOnLine2D(s[0],s[1],o[0],o[1],o[0]+l[0],o[1]+l[1])||3===s.length&&(s[0]!==o[0]||s[1]!==o[1]||s[2]!==o[2])&&bez.pointOnLine3D(s[0],s[1],s[2],o[0],o[1],o[2],s[0]+a[0],s[1]+a[1],s[2]+a[2])&&bez.pointOnLine3D(s[0],s[1],s[2],o[0],o[1],o[2],o[0]+l[0],o[1]+l[1],o[2]+l[2]))&&(t.k[i].to=null,t.k[i].ti=null),s[0]===o[0]&&s[1]===o[1]&&0===a[0]&&0===a[1]&&0===l[0]&&0===l[1]&&(2===s.length||s[2]===o[2]&&0===a[2]&&0===l[2])&&(t.k[i].to=null,t.k[i].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=t,this.keyframes=t.k,this.keyframesMetadata=[],this.offsetTime=e.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=n||1,this.elem=e,this.container=r,this.comp=e.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var d=t.k[0].s.length;for(this.v=createTypedArray("float32",d),this.pv=createTypedArray("float32",d),i=0;i<d;i+=1)this.v[i]=initFrame,this.pv[i]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",d)},this.addEffect=addEffect}var PropertyFactory={getProp:function(e,t,n,r,i){var s;if(t.sid&&(t=e.globalData.slotManager.getProp(t)),t.k.length)if("number"==typeof t.k[0])s=new MultiDimensionalProperty(e,t,r,i);else switch(n){case 0:s=new KeyframedValueProperty(e,t,r,i);break;case 1:s=new KeyframedMultidimensionalProperty(e,t,r,i)}else s=new ValueProperty(e,t,r,i);return s.effectsSequence.length&&i.addDynamicProperty(s),s}};function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&(this.dynamicProperties.push(e),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var e;this._mdf=!1;var t=this.dynamicProperties.length;for(e=0;e<t;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(e){this.container=e,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=poolFactory(8,(function(){return createTypedArray("float32",2)}));function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(e,t){this.c=e,this.setLength(t);for(var n=0;n<t;)this.v[n]=pointPool.newElement(),this.o[n]=pointPool.newElement(),this.i[n]=pointPool.newElement(),n+=1},ShapePath.prototype.setLength=function(e){for(;this._maxLength<e;)this.doubleArrayLength();this._length=e},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(e,t,n,r,i){var s;switch(this._length=Math.max(this._length,r+1),this._length>=this._maxLength&&this.doubleArrayLength(),n){case"v":s=this.v;break;case"i":s=this.i;break;case"o":s=this.o;break;default:s=[]}(!s[r]||s[r]&&!i)&&(s[r]=pointPool.newElement()),s[r][0]=e,s[r][1]=t},ShapePath.prototype.setTripleAt=function(e,t,n,r,i,s,o,a){this.setXYAt(e,t,"v",o,a),this.setXYAt(n,r,"o",o,a),this.setXYAt(i,s,"i",o,a)},ShapePath.prototype.reverse=function(){var e=new ShapePath;e.setPathData(this.c,this._length);var t=this.v,n=this.o,r=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],r[0][0],r[0][1],n[0][0],n[0][1],0,!1),i=1);var s,o=this._length-1,a=this._length;for(s=i;s<a;s+=1)e.setTripleAt(t[o][0],t[o][1],r[o][0],r[o][1],n[o][0],n[o][1],s,!1),o-=1;return e},ShapePath.prototype.length=function(){return this._length};var shapePool=(factory=poolFactory(4,(function(){return new ShapePath}),(function(e){var t,n=e._length;for(t=0;t<n;t+=1)pointPool.release(e.v[t]),pointPool.release(e.i[t]),pointPool.release(e.o[t]),e.v[t]=null,e.i[t]=null,e.o[t]=null;e._length=0,e.c=!1})),factory.clone=function(e){var t,n=factory.newElement(),r=void 0===e._length?e.v.length:e._length;for(n.setLength(r),n.c=e.c,t=0;t<r;t+=1)n.setTripleAt(e.v[t][0],e.v[t][1],e.o[t][0],e.o[t][1],e.i[t][0],e.i[t][1],t);return n},factory),factory;function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(e){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=e,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var e;for(e=0;e<this._length;e+=1)shapePool.release(this.shapes[e]);this._length=0};var shapeCollectionPool=(ob={newShapeCollection:function(){return _length?pool[_length-=1]:new ShapeCollection},release:function(e){var t,n=e._length;for(t=0;t<n;t+=1)shapePool.release(e.shapes[t]);e._length=0,_length===_maxLength&&(pool=pooling.double(pool),_maxLength*=2),pool[_length]=e,_length+=1}},_length=0,_maxLength=4,pool=createSizedArray(_maxLength),ob),ob,_length,_maxLength,pool,ShapePropertyFactory=function(){var e=-999999;function t(e,t,n){var r,i,s,o,a,l,c,d,h,u=n.lastIndex,p=this.keyframes;if(e<p[0].t-this.offsetTime)r=p[0].s[0],s=!0,u=0;else if(e>=p[p.length-1].t-this.offsetTime)r=p[p.length-1].s?p[p.length-1].s[0]:p[p.length-2].e[0],s=!0;else{for(var f,m,g,y=u,v=p.length-1,b=!0;b&&(f=p[y],!((m=p[y+1]).t-this.offsetTime>e));)y<v-1?y+=1:b=!1;if(g=this.keyframesMetadata[y]||{},u=y,!(s=1===f.h)){if(e>=m.t-this.offsetTime)d=1;else if(e<f.t-this.offsetTime)d=0;else{var w;g.__fnct?w=g.__fnct:(w=BezierFactory.getBezierEasing(f.o.x,f.o.y,f.i.x,f.i.y).get,g.__fnct=w),d=w((e-(f.t-this.offsetTime))/(m.t-this.offsetTime-(f.t-this.offsetTime)))}i=m.s?m.s[0]:f.e[0]}r=f.s[0]}for(l=t._length,c=r.i[0].length,n.lastIndex=u,o=0;o<l;o+=1)for(a=0;a<c;a+=1)h=s?r.i[o][a]:r.i[o][a]+(i.i[o][a]-r.i[o][a])*d,t.i[o][a]=h,h=s?r.o[o][a]:r.o[o][a]+(i.o[o][a]-r.o[o][a])*d,t.o[o][a]=h,h=s?r.v[o][a]:r.v[o][a]+(i.v[o][a]-r.v[o][a])*d,t.v[o][a]=h}function n(){var t=this.comp.renderedFrame-this.offsetTime,n=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==e&&(i<n&&t<n||i>r&&t>r)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}function r(){this.paths=this.localShapeCollection}function i(e){(function(e,t){if(e._length!==t._length||e.c!==t.c)return!1;var n,r=e._length;for(n=0;n<r;n+=1)if(e.v[n][0]!==t.v[n][0]||e.v[n][1]!==t.v[n][1]||e.o[n][0]!==t.o[n][0]||e.o[n][1]!==t.o[n][1]||e.i[n][0]!==t.i[n][0]||e.i[n][1]!==t.i[n][1])return!1;return!0})(this.v,e)||(this.v=shapePool.clone(e),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function s(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e,t;this.lock=!0,this._mdf=!1,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var n=this.effectsSequence.length;for(t=0;t<n;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function o(e,t,n){this.propType="shape",this.comp=e.comp,this.container=e,this.elem=e,this.data=t,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===n?t.pt.k:t.ks.k;this.v=shapePool.clone(i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=r,this.effectsSequence=[]}function a(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function l(t,i,s){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===s?i.pt.k:i.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var o=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,o),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=e,this.reset=r,this._caching={lastFrame:e,lastIndex:0},this.effectsSequence=[n.bind(this)]}o.prototype.interpolateShape=t,o.prototype.getValue=s,o.prototype.setVValue=i,o.prototype.addEffect=a,l.prototype.getValue=s,l.prototype.interpolateShape=t,l.prototype.setVValue=i,l.prototype.addEffect=a;var c=function(){var e=roundCorner;function t(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=t.d,this.elem=e,this.comp=e.comp,this.frameId=-1,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],n=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,o=this.v;o.v[0][0]=t,o.v[0][1]=n-i,o.v[1][0]=s?t+r:t-r,o.v[1][1]=n,o.v[2][0]=t,o.v[2][1]=n+i,o.v[3][0]=s?t-r:t+r,o.v[3][1]=n,o.i[0][0]=s?t-r*e:t+r*e,o.i[0][1]=n-i,o.i[1][0]=s?t+r:t-r,o.i[1][1]=n-i*e,o.i[2][0]=s?t+r*e:t-r*e,o.i[2][1]=n+i,o.i[3][0]=s?t-r:t+r,o.i[3][1]=n+i*e,o.o[0][0]=s?t+r*e:t-r*e,o.o[0][1]=n-i,o.o[1][0]=s?t+r:t-r,o.o[1][1]=n+i*e,o.o[2][0]=s?t-r*e:t+r*e,o.o[2][1]=n+i,o.o[3][0]=s?t-r:t+r,o.o[3][1]=n-i*e}},extendPrototype([DynamicPropertyContainer],t),t}(),d=function(){function e(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=e,this.comp=e.comp,this.data=t,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),1===t.sy?(this.ir=PropertyFactory.getProp(e,t.ir,0,0,this),this.is=PropertyFactory.getProp(e,t.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(e,t.pt,0,0,this),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,degToRads,this),this.or=PropertyFactory.getProp(e,t.or,0,0,this),this.os=PropertyFactory.getProp(e,t.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return e.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var e,t,n,r,i=2*Math.floor(this.pt.v),s=2*Math.PI/i,o=!0,a=this.or.v,l=this.ir.v,c=this.os.v,d=this.is.v,h=2*Math.PI*a/(2*i),u=2*Math.PI*l/(2*i),p=-Math.PI/2;p+=this.r.v;var f=3===this.data.d?-1:1;for(this.v._length=0,e=0;e<i;e+=1){n=o?c:d,r=o?h:u;var m=(t=o?a:l)*Math.cos(p),g=t*Math.sin(p),y=0===m&&0===g?0:g/Math.sqrt(m*m+g*g),v=0===m&&0===g?0:-m/Math.sqrt(m*m+g*g);m+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(m,g,m-y*r*n*f,g-v*r*n*f,m+y*r*n*f,g+v*r*n*f,e,!0),o=!o,p+=s*f}},convertPolygonToPath:function(){var e,t=Math.floor(this.pt.v),n=2*Math.PI/t,r=this.or.v,i=this.os.v,s=2*Math.PI*r/(4*t),o=.5*-Math.PI,a=3===this.data.d?-1:1;for(o+=this.r.v,this.v._length=0,e=0;e<t;e+=1){var l=r*Math.cos(o),c=r*Math.sin(o),d=0===l&&0===c?0:c/Math.sqrt(l*l+c*c),h=0===l&&0===c?0:-l/Math.sqrt(l*l+c*c);l+=+this.p.v[0],c+=+this.p.v[1],this.v.setTripleAt(l,c,l-d*s*i*a,c-h*s*i*a,l+d*s*i*a,c+h*s*i*a,e,!0),o+=n*a}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],e),e}(),h=function(){function e(e,t){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=e,this.comp=e.comp,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return e.prototype={convertRectToPath:function(){var e=this.p.v[0],t=this.p.v[1],n=this.s.v[0]/2,r=this.s.v[1]/2,i=bmMin(n,r,this.r.v),s=i*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(e+n,t-r+i,e+n,t-r+i,e+n,t-r+s,0,!0),this.v.setTripleAt(e+n,t+r-i,e+n,t+r-s,e+n,t+r-i,1,!0),0!==i?(this.v.setTripleAt(e+n-i,t+r,e+n-i,t+r,e+n-s,t+r,2,!0),this.v.setTripleAt(e-n+i,t+r,e-n+s,t+r,e-n+i,t+r,3,!0),this.v.setTripleAt(e-n,t+r-i,e-n,t+r-i,e-n,t+r-s,4,!0),this.v.setTripleAt(e-n,t-r+i,e-n,t-r+s,e-n,t-r+i,5,!0),this.v.setTripleAt(e-n+i,t-r,e-n+i,t-r,e-n+s,t-r,6,!0),this.v.setTripleAt(e+n-i,t-r,e+n-s,t-r,e+n-i,t-r,7,!0)):(this.v.setTripleAt(e-n,t+r,e-n+s,t+r,e-n,t+r,2),this.v.setTripleAt(e-n,t-r,e-n,t-r+s,e-n,t-r,3))):(this.v.setTripleAt(e+n,t-r+i,e+n,t-r+s,e+n,t-r+i,0,!0),0!==i?(this.v.setTripleAt(e+n-i,t-r,e+n-i,t-r,e+n-s,t-r,1,!0),this.v.setTripleAt(e-n+i,t-r,e-n+s,t-r,e-n+i,t-r,2,!0),this.v.setTripleAt(e-n,t-r+i,e-n,t-r+i,e-n,t-r+s,3,!0),this.v.setTripleAt(e-n,t+r-i,e-n,t+r-s,e-n,t+r-i,4,!0),this.v.setTripleAt(e-n+i,t+r,e-n+i,t+r,e-n+s,t+r,5,!0),this.v.setTripleAt(e+n-i,t+r,e+n-s,t+r,e+n-i,t+r,6,!0),this.v.setTripleAt(e+n,t+r-i,e+n,t+r-i,e+n,t+r-s,7,!0)):(this.v.setTripleAt(e-n,t-r,e-n+s,t-r,e-n,t-r,1,!0),this.v.setTripleAt(e-n,t+r,e-n,t+r-s,e-n,t+r,2,!0),this.v.setTripleAt(e+n,t+r,e+n-s,t+r,e+n,t+r,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:r},extendPrototype([DynamicPropertyContainer],e),e}(),u={getShapeProp:function(e,t,n){var r;return 3===n||4===n?r=(3===n?t.pt:t.ks).k.length?new l(e,t,n):new o(e,t,n):5===n?r=new h(e,t):6===n?r=new c(e,t):7===n&&(r=new d(e,t)),r.k&&e.addDynamicProperty(r),r},getConstructorFunction:function(){return o},getKeyframedConstructorFunction:function(){return l}};return u}(),Matrix=function(){var e=Math.cos,t=Math.sin,n=Math.tan,r=Math.round;function i(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function s(n){if(0===n)return this;var r=e(n),i=t(n);return this._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function o(n){if(0===n)return this;var r=e(n),i=t(n);return this._t(1,0,0,0,0,r,-i,0,0,i,r,0,0,0,0,1)}function a(n){if(0===n)return this;var r=e(n),i=t(n);return this._t(r,0,i,0,0,1,0,0,-i,0,r,0,0,0,0,1)}function l(n){if(0===n)return this;var r=e(n),i=t(n);return this._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function c(e,t){return this._t(1,t,e,1,0,0)}function d(e,t){return this.shear(n(e),n(t))}function h(r,i){var s=e(i),o=t(i);return this._t(s,o,0,0,-o,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(r),1,0,0,0,0,1,0,0,0,0,1)._t(s,-o,0,0,o,s,0,0,0,0,1,0,0,0,0,1)}function u(e,t,n){return n||0===n||(n=1),1===e&&1===t&&1===n?this:this._t(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1)}function p(e,t,n,r,i,s,o,a,l,c,d,h,u,p,f,m){return this.props[0]=e,this.props[1]=t,this.props[2]=n,this.props[3]=r,this.props[4]=i,this.props[5]=s,this.props[6]=o,this.props[7]=a,this.props[8]=l,this.props[9]=c,this.props[10]=d,this.props[11]=h,this.props[12]=u,this.props[13]=p,this.props[14]=f,this.props[15]=m,this}function f(e,t,n){return n=n||0,0!==e||0!==t||0!==n?this._t(1,0,0,0,0,1,0,0,0,0,1,0,e,t,n,1):this}function m(e,t,n,r,i,s,o,a,l,c,d,h,u,p,f,m){var g=this.props;if(1===e&&0===t&&0===n&&0===r&&0===i&&1===s&&0===o&&0===a&&0===l&&0===c&&1===d&&0===h)return g[12]=g[12]*e+g[15]*u,g[13]=g[13]*s+g[15]*p,g[14]=g[14]*d+g[15]*f,g[15]*=m,this._identityCalculated=!1,this;var y=g[0],v=g[1],b=g[2],w=g[3],x=g[4],E=g[5],C=g[6],S=g[7],_=g[8],k=g[9],O=g[10],T=g[11],P=g[12],I=g[13],M=g[14],R=g[15];return g[0]=y*e+v*i+b*l+w*u,g[1]=y*t+v*s+b*c+w*p,g[2]=y*n+v*o+b*d+w*f,g[3]=y*r+v*a+b*h+w*m,g[4]=x*e+E*i+C*l+S*u,g[5]=x*t+E*s+C*c+S*p,g[6]=x*n+E*o+C*d+S*f,g[7]=x*r+E*a+C*h+S*m,g[8]=_*e+k*i+O*l+T*u,g[9]=_*t+k*s+O*c+T*p,g[10]=_*n+k*o+O*d+T*f,g[11]=_*r+k*a+O*h+T*m,g[12]=P*e+I*i+M*l+R*u,g[13]=P*t+I*s+M*c+R*p,g[14]=P*n+I*o+M*d+R*f,g[15]=P*r+I*a+M*h+R*m,this._identityCalculated=!1,this}function g(e){var t=e.props;return this.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function y(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function v(e){for(var t=0;t<16;){if(e.props[t]!==this.props[t])return!1;t+=1}return!0}function b(e){var t;for(t=0;t<16;t+=1)e.props[t]=this.props[t];return e}function w(e){var t;for(t=0;t<16;t+=1)this.props[t]=e[t]}function x(e,t,n){return{x:e*this.props[0]+t*this.props[4]+n*this.props[8]+this.props[12],y:e*this.props[1]+t*this.props[5]+n*this.props[9]+this.props[13],z:e*this.props[2]+t*this.props[6]+n*this.props[10]+this.props[14]}}function E(e,t,n){return e*this.props[0]+t*this.props[4]+n*this.props[8]+this.props[12]}function C(e,t,n){return e*this.props[1]+t*this.props[5]+n*this.props[9]+this.props[13]}function S(e,t,n){return e*this.props[2]+t*this.props[6]+n*this.props[10]+this.props[14]}function _(){var e=this.props[0]*this.props[5]-this.props[1]*this.props[4],t=this.props[5]/e,n=-this.props[1]/e,r=-this.props[4]/e,i=this.props[0]/e,s=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/e,o=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/e,a=new Matrix;return a.props[0]=t,a.props[1]=n,a.props[4]=r,a.props[5]=i,a.props[12]=s,a.props[13]=o,a}function k(e){return this.getInverseMatrix().applyToPointArray(e[0],e[1],e[2]||0)}function O(e){var t,n=e.length,r=[];for(t=0;t<n;t+=1)r[t]=k(e[t]);return r}function T(e,t,n){var r=createTypedArray("float32",6);if(this.isIdentity())r[0]=e[0],r[1]=e[1],r[2]=t[0],r[3]=t[1],r[4]=n[0],r[5]=n[1];else{var i=this.props[0],s=this.props[1],o=this.props[4],a=this.props[5],l=this.props[12],c=this.props[13];r[0]=e[0]*i+e[1]*o+l,r[1]=e[0]*s+e[1]*a+c,r[2]=t[0]*i+t[1]*o+l,r[3]=t[0]*s+t[1]*a+c,r[4]=n[0]*i+n[1]*o+l,r[5]=n[0]*s+n[1]*a+c}return r}function P(e,t,n){return this.isIdentity()?[e,t,n]:[e*this.props[0]+t*this.props[4]+n*this.props[8]+this.props[12],e*this.props[1]+t*this.props[5]+n*this.props[9]+this.props[13],e*this.props[2]+t*this.props[6]+n*this.props[10]+this.props[14]]}function I(e,t){if(this.isIdentity())return e+","+t;var n=this.props;return Math.round(100*(e*n[0]+t*n[4]+n[12]))/100+","+Math.round(100*(e*n[1]+t*n[5]+n[13]))/100}function M(){for(var e=0,t=this.props,n="matrix3d(";e<16;)n+=r(1e4*t[e])/1e4,n+=15===e?")":",",e+=1;return n}function R(e){return e<1e-6&&e>0||e>-1e-6&&e<0?r(1e4*e)/1e4:e}function A(){var e=this.props;return"matrix("+R(e[0])+","+R(e[1])+","+R(e[4])+","+R(e[5])+","+R(e[12])+","+R(e[13])+")"}return function(){this.reset=i,this.rotate=s,this.rotateX=o,this.rotateY=a,this.rotateZ=l,this.skew=d,this.skewFromAxis=h,this.shear=c,this.scale=u,this.setTransform=p,this.translate=f,this.transform=m,this.multiply=g,this.applyToPoint=x,this.applyToX=E,this.applyToY=C,this.applyToZ=S,this.applyToPointArray=P,this.applyToTriplePoints=T,this.applyToPointStringified=I,this.toCSS=M,this.to2dCSS=A,this.clone=b,this.cloneFromProps=w,this.equals=v,this.inversePoints=O,this.inversePoint=k,this.getInverseMatrix=_,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(e){return _typeof$3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(e)}var lottie={},standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="";function setLocation(e){setLocationHref(e)}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(e){setSubframeEnabled(e)}function setPrefix(e){setIdPrefix(e)}function loadAnimation(e){return!0===standalone&&(e.animationData=JSON.parse(animationData)),animationManager.loadAnimation(e)}function setQuality(e){if("string"==typeof e)switch(e){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(e)&&e>1&&setDefaultCurveSegments(e);getDefaultCurveSegments()>=50?roundValues(!1):roundValues(!0)}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(e,t){"expressions"===e&&setExpressionsPlugin(t)}function getFactory(e){switch(e){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(e){for(var t=queryString.split("&"),n=0;n<t.length;n+=1){var r=t[n].split("=");if(decodeURIComponent(r[0])==e)return decodeURIComponent(r[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.13.0";var queryString="";if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src?myScript.src.replace(/^[^\?]+\??/,""):"",renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);try{"object"!==_typeof$3(exports)&&__webpack_require__.amdO}catch(e){}var ShapeModifiers=function(){var e={},t={};return e.registerModifier=function(e,n){t[e]||(t[e]=n)},e.getModifier=function(e,n,r){return new t[e](n,r)},e}();function ShapeModifier(){}function TrimModifier(){}function PuckerAndBloatModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(e){if(!this.closed){e.sh.container.addDynamicProperty(e.sh);var t={shape:e.sh,data:e,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(t),this.addShapeToModifier(t),this._isAnimated&&e.setAsAnimated()}},ShapeModifier.prototype.init=function(e,t){this.shapes=[],this.elem=e,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(e,t){this.s=PropertyFactory.getProp(e,t.s,0,.01,this),this.e=PropertyFactory.getProp(e,t.e,0,.01,this),this.o=PropertyFactory.getProp(e,t.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=t.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(e){e.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(e,t,n,r,i){var s=[];t<=1?s.push({s:e,e:t}):e>=1?s.push({s:e-1,e:t-1}):(s.push({s:e,e:1}),s.push({s:0,e:t-1}));var o,a,l=[],c=s.length;for(o=0;o<c;o+=1){var d,h;(a=s[o]).e*i<r||a.s*i>r+n||(d=a.s*i<=r?0:(a.s*i-r)/n,h=a.e*i>=r+n?1:(a.e*i-r)/n,l.push([d,h]))}return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(e){var t,n=e.length;for(t=0;t<n;t+=1)segmentsLengthPool.release(e[t]);return e.length=0,e},TrimModifier.prototype.processShapes=function(e){var t,n,r,i;if(this._mdf||e){var s=this.o.v%360/360;if(s<0&&(s+=1),(t=this.s.v>1?1+s:this.s.v<0?0+s:this.s.v+s)>(n=this.e.v>1?1+s:this.e.v<0?0+s:this.e.v+s)){var o=t;t=n,n=o}t=1e-4*Math.round(1e4*t),n=1e-4*Math.round(1e4*n),this.sValue=t,this.eValue=n}else t=this.sValue,n=this.eValue;var a,l,c,d,h,u=this.shapes.length,p=0;if(n===t)for(i=0;i<u;i+=1)this.shapes[i].localShapeCollection.releaseShapes(),this.shapes[i].shape._mdf=!0,this.shapes[i].shape.paths=this.shapes[i].localShapeCollection,this._mdf&&(this.shapes[i].pathsData.length=0);else if(1===n&&0===t||0===n&&1===t){if(this._mdf)for(i=0;i<u;i+=1)this.shapes[i].pathsData.length=0,this.shapes[i].shape._mdf=!0}else{var f,m,g=[];for(i=0;i<u;i+=1)if((f=this.shapes[i]).shape._mdf||this._mdf||e||2===this.m){if(l=(r=f.shape.paths)._length,h=0,!f.shape._mdf&&f.pathsData.length)h=f.totalShapeLength;else{for(c=this.releasePathsData(f.pathsData),a=0;a<l;a+=1)d=bez.getSegmentsLength(r.shapes[a]),c.push(d),h+=d.totalLength;f.totalShapeLength=h,f.pathsData=c}p+=h,f.shape._mdf=!0}else f.shape.paths=f.localShapeCollection;var y,v=t,b=n,w=0;for(i=u-1;i>=0;i-=1)if((f=this.shapes[i]).shape._mdf){for((m=f.localShapeCollection).releaseShapes(),2===this.m&&u>1?(y=this.calculateShapeEdges(t,n,f.totalShapeLength,w,p),w+=f.totalShapeLength):y=[[v,b]],l=y.length,a=0;a<l;a+=1){v=y[a][0],b=y[a][1],g.length=0,b<=1?g.push({s:f.totalShapeLength*v,e:f.totalShapeLength*b}):v>=1?g.push({s:f.totalShapeLength*(v-1),e:f.totalShapeLength*(b-1)}):(g.push({s:f.totalShapeLength*v,e:f.totalShapeLength}),g.push({s:0,e:f.totalShapeLength*(b-1)}));var x=this.addShapes(f,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(f.shape.paths.shapes[f.shape.paths._length-1].c){var E=x.pop();this.addPaths(x,m),x=this.addShapes(f,g[1],E)}else this.addPaths(x,m),x=this.addShapes(f,g[1]);this.addPaths(x,m)}}f.shape.paths=m}}},TrimModifier.prototype.addPaths=function(e,t){var n,r=e.length;for(n=0;n<r;n+=1)t.addShape(e[n])},TrimModifier.prototype.addSegment=function(e,t,n,r,i,s,o){i.setXYAt(t[0],t[1],"o",s),i.setXYAt(n[0],n[1],"i",s+1),o&&i.setXYAt(e[0],e[1],"v",s),i.setXYAt(r[0],r[1],"v",s+1)},TrimModifier.prototype.addSegmentFromArray=function(e,t,n,r){t.setXYAt(e[1],e[5],"o",n),t.setXYAt(e[2],e[6],"i",n+1),r&&t.setXYAt(e[0],e[4],"v",n),t.setXYAt(e[3],e[7],"v",n+1)},TrimModifier.prototype.addShapes=function(e,t,n){var r,i,s,o,a,l,c,d,h=e.pathsData,u=e.shape.paths.shapes,p=e.shape.paths._length,f=0,m=[],g=!0;for(n?(a=n._length,d=n._length):(n=shapePool.newElement(),a=0,d=0),m.push(n),r=0;r<p;r+=1){for(l=h[r].lengths,n.c=u[r].c,s=u[r].c?l.length:l.length+1,i=1;i<s;i+=1)if(f+(o=l[i-1]).addedLength<t.s)f+=o.addedLength,n.c=!1;else{if(f>t.e){n.c=!1;break}t.s<=f&&t.e>=f+o.addedLength?(this.addSegment(u[r].v[i-1],u[r].o[i-1],u[r].i[i],u[r].v[i],n,a,g),g=!1):(c=bez.getNewSegment(u[r].v[i-1],u[r].v[i],u[r].o[i-1],u[r].i[i],(t.s-f)/o.addedLength,(t.e-f)/o.addedLength,l[i-1]),this.addSegmentFromArray(c,n,a,g),g=!1,n.c=!1),f+=o.addedLength,a+=1}if(u[r].c&&l.length){if(o=l[i-1],f<=t.e){var y=l[i-1].addedLength;t.s<=f&&t.e>=f+y?(this.addSegment(u[r].v[i-1],u[r].o[i-1],u[r].i[0],u[r].v[0],n,a,g),g=!1):(c=bez.getNewSegment(u[r].v[i-1],u[r].v[0],u[r].o[i-1],u[r].i[0],(t.s-f)/y,(t.e-f)/y,l[i-1]),this.addSegmentFromArray(c,n,a,g),g=!1,n.c=!1)}else n.c=!1;f+=o.addedLength,a+=1}if(n._length&&(n.setXYAt(n.v[d][0],n.v[d][1],"i",d),n.setXYAt(n.v[n._length-1][0],n.v[n._length-1][1],"o",n._length-1)),f>t.e)break;r<p-1&&(n=shapePool.newElement(),g=!0,m.push(n),a=0)}return m},extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(e,t){var n=t/100,r=[0,0],i=e._length,s=0;for(s=0;s<i;s+=1)r[0]+=e.v[s][0],r[1]+=e.v[s][1];r[0]/=i,r[1]/=i;var o,a,l,c,d,h,u=shapePool.newElement();for(u.c=e.c,s=0;s<i;s+=1)o=e.v[s][0]+(r[0]-e.v[s][0])*n,a=e.v[s][1]+(r[1]-e.v[s][1])*n,l=e.o[s][0]+(r[0]-e.o[s][0])*-n,c=e.o[s][1]+(r[1]-e.o[s][1])*-n,d=e.i[s][0]+(r[0]-e.i[s][0])*-n,h=e.i[s][1]+(r[1]-e.i[s][1])*-n,u.setTripleAt(o,a,l,c,d,h,s);return u},PuckerAndBloatModifier.prototype.processShapes=function(e){var t,n,r,i,s,o,a=this.shapes.length,l=this.amount.v;if(0!==l)for(n=0;n<a;n+=1){if(o=(s=this.shapes[n]).localShapeCollection,s.shape._mdf||this._mdf||e)for(o.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,r=0;r<i;r+=1)o.addShape(this.processPath(t[r],l));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var TransformPropertyFactory=function(){var e=[0,0];function t(e,t,n){if(this.elem=e,this.frameId=-1,this.propType="transform",this.data=t,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(n||e),t.p&&t.p.s?(this.px=PropertyFactory.getProp(e,t.p.x,0,0,this),this.py=PropertyFactory.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=PropertyFactory.getProp(e,t.p.z,0,0,this))):this.p=PropertyFactory.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=PropertyFactory.getProp(e,t.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(e,t.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(e,t.rz,0,degToRads,this),t.or.k[0].ti){var r,i=t.or.k.length;for(r=0;r<i;r+=1)t.or.k[r].to=null,t.or.k[r].ti=null}this.or=PropertyFactory.getProp(e,t.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(e,t.r||{k:0},0,degToRads,this);t.sk&&(this.sk=PropertyFactory.getProp(e,t.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(e,t.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(e,t.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(e,t.s||{k:[100,100,100]},1,.01,this),t.o?this.o=PropertyFactory.getProp(e,t.o,0,.01,e):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return t.prototype={applyToMatrix:function(e){var t=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||t,this.a&&e.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&e.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&e.skewFromAxis(-this.sk.v,this.sa.v),this.r?e.rotate(-this.r.v):e.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?e.translate(this.px.v,this.py.v,-this.pz.v):e.translate(this.px.v,this.py.v,0):e.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var n;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var r,i;if(n=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(r=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/n,0),i=this.p.getValueAtTime(this.p.keyframes[0].t/n,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/n,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/n,0)):(r=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/n,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var s=this.px,o=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(r[0]=s.getValueAtTime((s.keyframes[0].t+.01)/n,0),r[1]=o.getValueAtTime((o.keyframes[0].t+.01)/n,0),i[0]=s.getValueAtTime(s.keyframes[0].t/n,0),i[1]=o.getValueAtTime(o.keyframes[0].t/n,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(r[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/n,0),r[1]=o.getValueAtTime(o.keyframes[o.keyframes.length-1].t/n,0),i[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/n,0),i[1]=o.getValueAtTime((o.keyframes[o.keyframes.length-1].t-.01)/n,0)):(r=[s.pv,o.pv],i[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/n,s.offsetTime),i[1]=o.getValueAtTime((o._caching.lastFrame+o.offsetTime-.01)/n,o.offsetTime))}else r=i=e;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],t),t.prototype.addDynamicProperty=function(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0},t.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(e,n,r){return new t(e,n,r)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function floatEqual(e,t){return 1e5*Math.abs(e-t)<=Math.min(Math.abs(e),Math.abs(t))}function floatZero(e){return Math.abs(e)<=1e-5}function lerp(e,t,n){return e*(1-n)+t*n}function lerpPoint(e,t,n){return[lerp(e[0],t[0],n),lerp(e[1],t[1],n)]}function quadRoots(e,t,n){if(0===e)return[];var r=t*t-4*e*n;if(r<0)return[];var i=-t/(2*e);if(0===r)return[i];var s=Math.sqrt(r)/(2*e);return[i-s,i+s]}function polynomialCoefficients(e,t,n,r){return[3*t-e-3*n+r,3*e-6*t+3*n,-3*e+3*t,e]}function singlePoint(e){return new PolynomialBezier(e,e,e,e,!1)}function PolynomialBezier(e,t,n,r,i){i&&pointEqual(e,t)&&(t=lerpPoint(e,r,1/3)),i&&pointEqual(n,r)&&(n=lerpPoint(e,r,2/3));var s=polynomialCoefficients(e[0],t[0],n[0],r[0]),o=polynomialCoefficients(e[1],t[1],n[1],r[1]);this.a=[s[0],o[0]],this.b=[s[1],o[1]],this.c=[s[2],o[2]],this.d=[s[3],o[3]],this.points=[e,t,n,r]}function extrema(e,t){var n=e.points[0][t],r=e.points[e.points.length-1][t];if(n>r){var i=r;r=n,n=i}for(var s=quadRoots(3*e.a[t],2*e.b[t],e.c[t]),o=0;o<s.length;o+=1)if(s[o]>0&&s[o]<1){var a=e.point(s[o])[t];a<n?n=a:a>r&&(r=a)}return{min:n,max:r}}function intersectData(e,t,n){var r=e.boundingBox();return{cx:r.cx,cy:r.cy,width:r.width,height:r.height,bez:e,t:(t+n)/2,t1:t,t2:n}}function splitData(e){var t=e.bez.split(.5);return[intersectData(t[0],e.t1,e.t),intersectData(t[1],e.t,e.t2)]}function boxIntersect(e,t){return 2*Math.abs(e.cx-t.cx)<e.width+t.width&&2*Math.abs(e.cy-t.cy)<e.height+t.height}function intersectsImpl(e,t,n,r,i,s){if(boxIntersect(e,t))if(n>=s||e.width<=r&&e.height<=r&&t.width<=r&&t.height<=r)i.push([e.t,t.t]);else{var o=splitData(e),a=splitData(t);intersectsImpl(o[0],a[0],n+1,r,i,s),intersectsImpl(o[0],a[1],n+1,r,i,s),intersectsImpl(o[1],a[0],n+1,r,i,s),intersectsImpl(o[1],a[1],n+1,r,i,s)}}function crossProduct(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function lineIntersection(e,t,n,r){var i=[e[0],e[1],1],s=[t[0],t[1],1],o=[n[0],n[1],1],a=[r[0],r[1],1],l=crossProduct(crossProduct(i,s),crossProduct(o,a));return floatZero(l[2])?null:[l[0]/l[2],l[1]/l[2]]}function polarOffset(e,t,n){return[e[0]+Math.cos(t)*n,e[1]-Math.sin(t)*n]}function pointDistance(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function pointEqual(e,t){return floatEqual(e[0],t[0])&&floatEqual(e[1],t[1])}function ZigZagModifier(){}function setPoint(e,t,n,r,i,s,o){var a=n-Math.PI/2,l=n+Math.PI/2,c=t[0]+Math.cos(n)*r*i,d=t[1]-Math.sin(n)*r*i;e.setTripleAt(c,d,c+Math.cos(a)*s,d-Math.sin(a)*s,c+Math.cos(l)*o,d-Math.sin(l)*o,e.length())}function getPerpendicularVector(e,t){var n=[t[0]-e[0],t[1]-e[1]],r=.5*-Math.PI;return[Math.cos(r)*n[0]-Math.sin(r)*n[1],Math.sin(r)*n[0]+Math.cos(r)*n[1]]}function getProjectingAngle(e,t){var n=0===t?e.length()-1:t-1,r=(t+1)%e.length(),i=getPerpendicularVector(e.v[n],e.v[r]);return Math.atan2(0,1)-Math.atan2(i[1],i[0])}function zigZagCorner(e,t,n,r,i,s,o){var a=getProjectingAngle(t,n),l=t.v[n%t._length],c=t.v[0===n?t._length-1:n-1],d=t.v[(n+1)%t._length],h=2===s?Math.sqrt(Math.pow(l[0]-c[0],2)+Math.pow(l[1]-c[1],2)):0,u=2===s?Math.sqrt(Math.pow(l[0]-d[0],2)+Math.pow(l[1]-d[1],2)):0;setPoint(e,t.v[n%t._length],a,o,r,u/(2*(i+1)),h/(2*(i+1)),s)}function zigZagSegment(e,t,n,r,i,s){for(var o=0;o<r;o+=1){var a=(o+1)/(r+1),l=2===i?Math.sqrt(Math.pow(t.points[3][0]-t.points[0][0],2)+Math.pow(t.points[3][1]-t.points[0][1],2)):0,c=t.normalAngle(a);setPoint(e,t.point(a),c,s,n,l/(2*(r+1)),l/(2*(r+1)),i),s=-s}return s}function linearOffset(e,t,n){var r=Math.atan2(t[0]-e[0],t[1]-e[1]);return[polarOffset(e,r,n),polarOffset(t,r,n)]}function offsetSegment(e,t){var n,r,i,s,o,a,l;n=(l=linearOffset(e.points[0],e.points[1],t))[0],r=l[1],i=(l=linearOffset(e.points[1],e.points[2],t))[0],s=l[1],o=(l=linearOffset(e.points[2],e.points[3],t))[0],a=l[1];var c=lineIntersection(n,r,i,s);null===c&&(c=r);var d=lineIntersection(o,a,i,s);return null===d&&(d=o),new PolynomialBezier(n,c,d,a)}function joinLines(e,t,n,r,i){var s=t.points[3],o=n.points[0];if(3===r)return s;if(pointEqual(s,o))return s;if(2===r){var a=-t.tangentAngle(1),l=-n.tangentAngle(0)+Math.PI,c=lineIntersection(s,polarOffset(s,a+Math.PI/2,100),o,polarOffset(o,a+Math.PI/2,100)),d=c?pointDistance(c,s):pointDistance(s,o)/2,h=polarOffset(s,a,2*d*roundCorner);return e.setXYAt(h[0],h[1],"o",e.length()-1),h=polarOffset(o,l,2*d*roundCorner),e.setTripleAt(o[0],o[1],o[0],o[1],h[0],h[1],e.length()),o}var u=lineIntersection(pointEqual(s,t.points[2])?t.points[0]:t.points[2],s,o,pointEqual(o,n.points[1])?n.points[3]:n.points[1]);return u&&pointDistance(u,s)<i?(e.setTripleAt(u[0],u[1],u[0],u[1],u[0],u[1],e.length()),u):s}function getIntersection(e,t){var n=e.intersections(t);return n.length&&floatEqual(n[0][0],1)&&n.shift(),n.length?n[0]:null}function pruneSegmentIntersection(e,t){var n=e.slice(),r=t.slice(),i=getIntersection(e[e.length-1],t[0]);return i&&(n[e.length-1]=e[e.length-1].split(i[0])[0],r[0]=t[0].split(i[1])[1]),e.length>1&&t.length>1&&(i=getIntersection(e[0],t[t.length-1]))?[[e[0].split(i[0])[0]],[t[t.length-1].split(i[1])[1]]]:[n,r]}function pruneIntersections(e){for(var t,n=1;n<e.length;n+=1)t=pruneSegmentIntersection(e[n-1],e[n]),e[n-1]=t[0],e[n]=t[1];return e.length>1&&(t=pruneSegmentIntersection(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function offsetSegmentSplit(e,t){var n,r,i,s,o=e.inflectionPoints();if(0===o.length)return[offsetSegment(e,t)];if(1===o.length||floatEqual(o[1],1))return n=(i=e.split(o[0]))[0],r=i[1],[offsetSegment(n,t),offsetSegment(r,t)];n=(i=e.split(o[0]))[0];var a=(o[1]-o[0])/(1-o[0]);return s=(i=i[1].split(a))[0],r=i[1],[offsetSegment(n,t),offsetSegment(s,t),offsetSegment(r,t)]}function OffsetPathModifier(){}function getFontProperties(e){for(var t=e.fStyle?e.fStyle.split(" "):[],n="normal",r="normal",i=t.length,s=0;s<i;s+=1)switch(t[s].toLowerCase()){case"italic":r="italic";break;case"bold":n="700";break;case"black":n="900";break;case"medium":n="500";break;case"regular":case"normal":n="400";break;case"light":case"thin":n="200"}return{style:r,weight:e.fWeight||n}}extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(e,t.c,0,null,this),this.o=PropertyFactory.getProp(e,t.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(e,t.tr,this),this.so=PropertyFactory.getProp(e,t.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(e,t.tr.eo,0,.01,this),this.data=t,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(e,t,n,r,i,s){var o=s?-1:1,a=r.s.v[0]+(1-r.s.v[0])*(1-i),l=r.s.v[1]+(1-r.s.v[1])*(1-i);e.translate(r.p.v[0]*o*i,r.p.v[1]*o*i,r.p.v[2]),t.translate(-r.a.v[0],-r.a.v[1],r.a.v[2]),t.rotate(-r.r.v*o*i),t.translate(r.a.v[0],r.a.v[1],r.a.v[2]),n.translate(-r.a.v[0],-r.a.v[1],r.a.v[2]),n.scale(s?1/a:a,s?1/l:l),n.translate(r.a.v[0],r.a.v[1],r.a.v[2])},RepeaterModifier.prototype.init=function(e,t,n,r){for(this.elem=e,this.arr=t,this.pos=n,this.elemsData=r,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t[n]);n>0;)n-=1,this._elements.unshift(t[n]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(e){var t,n=e.length;for(t=0;t<n;t+=1)e[t]._processed=!1,"gr"===e[t].ty&&this.resetElements(e[t].it)},RepeaterModifier.prototype.cloneElements=function(e){var t=JSON.parse(JSON.stringify(e));return this.resetElements(t),t},RepeaterModifier.prototype.changeGroupRender=function(e,t){var n,r=e.length;for(n=0;n<r;n+=1)e[n]._render=t,"gr"===e[n].ty&&this.changeGroupRender(e[n].it,t)},RepeaterModifier.prototype.processShapes=function(e){var t,n,r,i,s,o=!1;if(this._mdf||e){var a,l=Math.ceil(this.c.v);if(this._groups.length<l){for(;this._groups.length<l;){var c={it:this.cloneElements(this._elements),ty:"gr"};c.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,c),this._groups.splice(0,0,c),this._currentCopies+=1}this.elem.reloadShapes(),o=!0}for(s=0,r=0;r<=this._groups.length-1;r+=1){if(a=s<l,this._groups[r]._render=a,this.changeGroupRender(this._groups[r].it,a),!a){var d=this.elemsData[r].it,h=d[d.length-1];0!==h.transform.op.v?(h.transform.op._mdf=!0,h.transform.op.v=0):h.transform.op._mdf=!1}s+=1}this._currentCopies=l;var u=this.o.v,p=u%1,f=u>0?Math.floor(u):Math.ceil(u),m=this.pMatrix.props,g=this.rMatrix.props,y=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v,b,w=0;if(u>0){for(;w<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),w+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),w+=p)}else if(u<0){for(;w>f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),w-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),w-=p)}for(r=1===this.data.m?0:this._currentCopies-1,i=1===this.data.m?1:-1,s=this._currentCopies;s;){if(b=(n=(t=this.elemsData[r].it)[t.length-1].transform.mProps.v.props).length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),0!==w){for((0!==r&&1===i||r!==this._currentCopies-1&&-1===i)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),v=0;v<b;v+=1)n[v]=this.matrix.props[v];this.matrix.reset()}else for(this.matrix.reset(),v=0;v<b;v+=1)n[v]=this.matrix.props[v];w+=1,s-=1,r+=i}}else for(s=this._currentCopies,r=0,i=1;s;)n=(t=this.elemsData[r].it)[t.length-1].transform.mProps.v.props,t[t.length-1].transform.mProps._mdf=!1,t[t.length-1].transform.op._mdf=!1,s-=1,r+=i;return o},RepeaterModifier.prototype.addShape=function(){},extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(e,t.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(e,t){var n,r=shapePool.newElement();r.c=e.c;var i,s,o,a,l,c,d,h,u,p,f,m,g=e._length,y=0;for(n=0;n<g;n+=1)i=e.v[n],o=e.o[n],s=e.i[n],i[0]===o[0]&&i[1]===o[1]&&i[0]===s[0]&&i[1]===s[1]?0!==n&&n!==g-1||e.c?(a=0===n?e.v[g-1]:e.v[n-1],c=(l=Math.sqrt(Math.pow(i[0]-a[0],2)+Math.pow(i[1]-a[1],2)))?Math.min(l/2,t)/l:0,d=f=i[0]+(a[0]-i[0])*c,h=m=i[1]-(i[1]-a[1])*c,u=d-(d-i[0])*roundCorner,p=h-(h-i[1])*roundCorner,r.setTripleAt(d,h,u,p,f,m,y),y+=1,a=n===g-1?e.v[0]:e.v[n+1],c=(l=Math.sqrt(Math.pow(i[0]-a[0],2)+Math.pow(i[1]-a[1],2)))?Math.min(l/2,t)/l:0,d=u=i[0]+(a[0]-i[0])*c,h=p=i[1]+(a[1]-i[1])*c,f=d-(d-i[0])*roundCorner,m=h-(h-i[1])*roundCorner,r.setTripleAt(d,h,u,p,f,m,y),y+=1):(r.setTripleAt(i[0],i[1],o[0],o[1],s[0],s[1],y),y+=1):(r.setTripleAt(e.v[n][0],e.v[n][1],e.o[n][0],e.o[n][1],e.i[n][0],e.i[n][1],y),y+=1);return r},RoundCornersModifier.prototype.processShapes=function(e){var t,n,r,i,s,o,a=this.shapes.length,l=this.rd.v;if(0!==l)for(n=0;n<a;n+=1){if(o=(s=this.shapes[n]).localShapeCollection,s.shape._mdf||this._mdf||e)for(o.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,r=0;r<i;r+=1)o.addShape(this.processPath(t[r],l));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},PolynomialBezier.prototype.point=function(e){return[((this.a[0]*e+this.b[0])*e+this.c[0])*e+this.d[0],((this.a[1]*e+this.b[1])*e+this.c[1])*e+this.d[1]]},PolynomialBezier.prototype.derivative=function(e){return[(3*e*this.a[0]+2*this.b[0])*e+this.c[0],(3*e*this.a[1]+2*this.b[1])*e+this.c[1]]},PolynomialBezier.prototype.tangentAngle=function(e){var t=this.derivative(e);return Math.atan2(t[1],t[0])},PolynomialBezier.prototype.normalAngle=function(e){var t=this.derivative(e);return Math.atan2(t[0],t[1])},PolynomialBezier.prototype.inflectionPoints=function(){var e=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(floatZero(e))return[];var t=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/e,n=t*t-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/e;if(n<0)return[];var r=Math.sqrt(n);return floatZero(r)?r>0&&r<1?[t]:[]:[t-r,t+r].filter((function(e){return e>0&&e<1}))},PolynomialBezier.prototype.split=function(e){if(e<=0)return[singlePoint(this.points[0]),this];if(e>=1)return[this,singlePoint(this.points[this.points.length-1])];var t=lerpPoint(this.points[0],this.points[1],e),n=lerpPoint(this.points[1],this.points[2],e),r=lerpPoint(this.points[2],this.points[3],e),i=lerpPoint(t,n,e),s=lerpPoint(n,r,e),o=lerpPoint(i,s,e);return[new PolynomialBezier(this.points[0],t,i,o,!0),new PolynomialBezier(o,s,r,this.points[3],!0)]},PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}},PolynomialBezier.prototype.intersections=function(e,t,n){void 0===t&&(t=2),void 0===n&&(n=7);var r=[];return intersectsImpl(intersectData(this,0,1),intersectData(e,0,1),0,t,r,n),r},PolynomialBezier.shapeSegment=function(e,t){var n=(t+1)%e.length();return new PolynomialBezier(e.v[t],e.o[t],e.i[n],e.v[n],!0)},PolynomialBezier.shapeSegmentInverted=function(e,t){var n=(t+1)%e.length();return new PolynomialBezier(e.v[n],e.i[n],e.o[t],e.v[t],!0)},extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(e,t.s,0,null,this),this.frequency=PropertyFactory.getProp(e,t.r,0,null,this),this.pointsType=PropertyFactory.getProp(e,t.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},ZigZagModifier.prototype.processPath=function(e,t,n,r){var i=e._length,s=shapePool.newElement();if(s.c=e.c,e.c||(i-=1),0===i)return s;var o=-1,a=PolynomialBezier.shapeSegment(e,0);zigZagCorner(s,e,0,t,n,r,o);for(var l=0;l<i;l+=1)o=zigZagSegment(s,a,t,n,r,-o),a=l!==i-1||e.c?PolynomialBezier.shapeSegment(e,(l+1)%i):null,zigZagCorner(s,e,l+1,t,n,r,o);return s},ZigZagModifier.prototype.processShapes=function(e){var t,n,r,i,s,o,a=this.shapes.length,l=this.amplitude.v,c=Math.max(0,Math.round(this.frequency.v)),d=this.pointsType.v;if(0!==l)for(n=0;n<a;n+=1){if(o=(s=this.shapes[n]).localShapeCollection,s.shape._mdf||this._mdf||e)for(o.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,r=0;r<i;r+=1)o.addShape(this.processPath(t[r],l,c,d));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this.miterLimit=PropertyFactory.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=0!==this.amount.effectsSequence.length},OffsetPathModifier.prototype.processPath=function(e,t,n,r){var i=shapePool.newElement();i.c=e.c;var s,o,a,l=e.length();e.c||(l-=1);var c=[];for(s=0;s<l;s+=1)a=PolynomialBezier.shapeSegment(e,s),c.push(offsetSegmentSplit(a,t));if(!e.c)for(s=l-1;s>=0;s-=1)a=PolynomialBezier.shapeSegmentInverted(e,s),c.push(offsetSegmentSplit(a,t));c=pruneIntersections(c);var d=null,h=null;for(s=0;s<c.length;s+=1){var u=c[s];for(h&&(d=joinLines(i,h,u[0],n,r)),h=u[u.length-1],o=0;o<u.length;o+=1)a=u[o],d&&pointEqual(a.points[0],d)?i.setXYAt(a.points[1][0],a.points[1][1],"o",i.length()-1):i.setTripleAt(a.points[0][0],a.points[0][1],a.points[1][0],a.points[1][1],a.points[0][0],a.points[0][1],i.length()),i.setTripleAt(a.points[3][0],a.points[3][1],a.points[3][0],a.points[3][1],a.points[2][0],a.points[2][1],i.length()),d=a.points[3]}return c.length&&joinLines(i,h,c[0][0],n,r),i},OffsetPathModifier.prototype.processShapes=function(e){var t,n,r,i,s,o,a=this.shapes.length,l=this.amount.v,c=this.miterLimit.v,d=this.lineJoin;if(0!==l)for(n=0;n<a;n+=1){if(o=(s=this.shapes[n]).localShapeCollection,s.shape._mdf||this._mdf||e)for(o.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,r=0;r<i;r+=1)o.addShape(this.processPath(t[r],l,d,c));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var FontManager=function(){var e={w:0,size:0,shapes:[],data:{shapes:[]}},t=[];t=t.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var n=127988,r=127462,i=127487,s=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function o(e,t){var n=createTag("span");n.setAttribute("aria-hidden",!0),n.style.fontFamily=t;var r=createTag("span");r.innerText="giItT1WQy@!-/#",n.style.position="absolute",n.style.left="-10000px",n.style.top="-10000px",n.style.fontSize="300px",n.style.fontVariant="normal",n.style.fontStyle="normal",n.style.fontWeight="normal",n.style.letterSpacing="0",n.appendChild(r),document.body.appendChild(n);var i=r.offsetWidth;return r.style.fontFamily=function(e){var t,n=e.split(","),r=n.length,i=[];for(t=0;t<r;t+=1)"sans-serif"!==n[t]&&"monospace"!==n[t]&&i.push(n[t]);return i.join(",")}(e)+", "+t,{node:r,w:i,parent:n}}function a(e,t){var n,r=document.body&&t?"svg":"canvas",i=getFontProperties(e);if("svg"===r){var s=createNS("text");s.style.fontSize="100px",s.setAttribute("font-family",e.fFamily),s.setAttribute("font-style",i.style),s.setAttribute("font-weight",i.weight),s.textContent="1",e.fClass?(s.style.fontFamily="inherit",s.setAttribute("class",e.fClass)):s.style.fontFamily=e.fFamily,t.appendChild(s),n=s}else{var o=new OffscreenCanvas(500,500).getContext("2d");o.font=i.style+" "+i.weight+" 100px "+e.fFamily,n=o}return{measureText:function(e){return"svg"===r?(n.textContent=e,n.getComputedTextLength()):n.measureText(e).width}}}function l(e){var t=0,n=e.charCodeAt(0);if(n>=55296&&n<=56319){var r=e.charCodeAt(1);r>=56320&&r<=57343&&(t=1024*(n-55296)+r-56320+65536)}return t}function c(e){var t=l(e);return t>=r&&t<=i}var d=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};d.isModifier=function(e,t){var n=e.toString(16)+t.toString(16);return-1!==s.indexOf(n)},d.isZeroWidthJoiner=function(e){return 8205===e},d.isFlagEmoji=function(e){return c(e.substr(0,2))&&c(e.substr(2,2))},d.isRegionalCode=c,d.isCombinedCharacter=function(e){return-1!==t.indexOf(e)},d.isRegionalFlag=function(e,t){var r=l(e.substr(t,2));if(r!==n)return!1;var i=0;for(t+=2;i<5;){if((r=l(e.substr(t,2)))<917601||r>917626)return!1;i+=1,t+=2}return 917631===l(e.substr(t,2))},d.isVariationSelector=function(e){return 65039===e},d.BLACK_FLAG_CODE_POINT=n;var h={addChars:function(e){if(e){var t;this.chars||(this.chars=[]);var n,r,i=e.length,s=this.chars.length;for(t=0;t<i;t+=1){for(n=0,r=!1;n<s;)this.chars[n].style===e[t].style&&this.chars[n].fFamily===e[t].fFamily&&this.chars[n].ch===e[t].ch&&(r=!0),n+=1;r||(this.chars.push(e[t]),s+=1)}}},addFonts:function(e,t){if(e){if(this.chars)return this.isLoaded=!0,void(this.fonts=e.list);if(!document.body)return this.isLoaded=!0,e.list.forEach((function(e){e.helper=a(e),e.cache={}})),void(this.fonts=e.list);var n,r=e.list,i=r.length,s=i;for(n=0;n<i;n+=1){var l,c,d=!0;if(r[n].loaded=!1,r[n].monoCase=o(r[n].fFamily,"monospace"),r[n].sansCase=o(r[n].fFamily,"sans-serif"),r[n].fPath){if("p"===r[n].fOrigin||3===r[n].origin){if((l=document.querySelectorAll('style[f-forigin="p"][f-family="'+r[n].fFamily+'"], style[f-origin="3"][f-family="'+r[n].fFamily+'"]')).length>0&&(d=!1),d){var h=createTag("style");h.setAttribute("f-forigin",r[n].fOrigin),h.setAttribute("f-origin",r[n].origin),h.setAttribute("f-family",r[n].fFamily),h.type="text/css",h.innerText="@font-face {font-family: "+r[n].fFamily+"; font-style: normal; src: url('"+r[n].fPath+"');}",t.appendChild(h)}}else if("g"===r[n].fOrigin||1===r[n].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),c=0;c<l.length;c+=1)-1!==l[c].href.indexOf(r[n].fPath)&&(d=!1);if(d){var u=createTag("link");u.setAttribute("f-forigin",r[n].fOrigin),u.setAttribute("f-origin",r[n].origin),u.type="text/css",u.rel="stylesheet",u.href=r[n].fPath,document.body.appendChild(u)}}else if("t"===r[n].fOrigin||2===r[n].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),c=0;c<l.length;c+=1)r[n].fPath===l[c].src&&(d=!1);if(d){var p=createTag("link");p.setAttribute("f-forigin",r[n].fOrigin),p.setAttribute("f-origin",r[n].origin),p.setAttribute("rel","stylesheet"),p.setAttribute("href",r[n].fPath),t.appendChild(p)}}}else r[n].loaded=!0,s-=1;r[n].helper=a(r[n],t),r[n].cache={},this.fonts.push(r[n])}0===s?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,n,r){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===n&&this.chars[i].fFamily===r)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,n,r)),e},getFontByName:function(e){for(var t=0,n=this.fonts.length;t<n;){if(this.fonts[t].fName===e)return this.fonts[t];t+=1}return this.fonts[0]},measureText:function(e,t,n){var r=this.getFontByName(t),i=e;if(!r.cache[i]){var s=r.helper;if(" "===e){var o=s.measureText("|"+e+"|"),a=s.measureText("||");r.cache[i]=(o-a)/100}else r.cache[i]=s.measureText(e)/100}return r.cache[i]*n},checkLoadedFonts:function(){var e,t,n,r=this.fonts.length,i=r;for(e=0;e<r;e+=1)this.fonts[e].loaded?i-=1:"n"===this.fonts[e].fOrigin||0===this.fonts[e].origin?this.fonts[e].loaded=!0:(t=this.fonts[e].monoCase.node,n=this.fonts[e].monoCase.w,t.offsetWidth!==n?(i-=1,this.fonts[e].loaded=!0):(t=this.fonts[e].sansCase.node,n=this.fonts[e].sansCase.w,t.offsetWidth!==n&&(i-=1,this.fonts[e].loaded=!0)),this.fonts[e].loaded&&(this.fonts[e].sansCase.parent.parentNode.removeChild(this.fonts[e].sansCase.parent),this.fonts[e].monoCase.parent.parentNode.removeChild(this.fonts[e].monoCase.parent)));0!==i&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}};return d.prototype=h,d}();function SlotManager(e){this.animationData=e}function slotFactory(e){return new SlotManager(e)}function RenderableElement(){}SlotManager.prototype.getProp=function(e){return this.animationData.slots&&this.animationData.slots[e.sid]?Object.assign(e,this.animationData.slots[e.sid].p):e},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){-1===this.renderableComponents.indexOf(e)&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){-1!==this.renderableComponents.indexOf(e)&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e<t;e+=1)this.renderableComponents[e].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var getBlendMode=(blendModeEnums={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(e){return blendModeEnums[e]||""}),blendModeEnums;function SliderEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,0,0,n)}function AngleEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,0,0,n)}function ColorEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,1,0,n)}function PointEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,1,0,n)}function LayerIndexEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,0,0,n)}function MaskIndexEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,0,0,n)}function CheckboxEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,0,0,n)}function NoValueEffect(){this.p={}}function EffectsManager(e,t){var n,r=e.ef||[];this.effectElements=[];var i,s=r.length;for(n=0;n<s;n+=1)i=new GroupEffect(r[n],t),this.effectElements.push(i)}function GroupEffect(e,t){this.init(e,t)}function BaseElement(){}function FrameElement(){}function FootageElement(e,t,n){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.footageData=t.imageLoader.getAsset(this.assetData),this.initBaseData(e,t,n)}function AudioElement(e,t,n){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.initBaseData(e,t,n),this._isPlaying=!1,this._canPlay=!1;var r=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(r),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0},this.lv=PropertyFactory.getProp(this,e.au&&e.au.lv?e.au.lv:{k:[100]},1,.01,this)}function BaseRenderer(){}extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(e,t){var n;this.data=e,this.effectElements=[],this.initDynamicPropertyContainer(t);var r,i=this.data.ef.length,s=this.data.ef;for(n=0;n<i;n+=1){switch(r=null,s[n].ty){case 0:r=new SliderEffect(s[n],t,this);break;case 1:r=new AngleEffect(s[n],t,this);break;case 2:r=new ColorEffect(s[n],t,this);break;case 3:r=new PointEffect(s[n],t,this);break;case 4:case 7:r=new CheckboxEffect(s[n],t,this);break;case 10:r=new LayerIndexEffect(s[n],t,this);break;case 11:r=new MaskIndexEffect(s[n],t,this);break;case 5:r=new EffectsManager(s[n],t,this);break;default:r=new NoValueEffect(s[n],t,this)}r&&this.effectElements.push(r)}},BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var e=0,t=this.data.masksProperties.length;e<t;){if("n"!==this.data.masksProperties[e].mode&&!1!==this.data.masksProperties[e].cl)return!0;e+=1}return!1},initExpressions:function(){var e=getExpressionInterfaces();if(e){var t=e("layer"),n=e("effects"),r=e("shape"),i=e("text"),s=e("comp");this.layerInterface=t(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var o=n.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(o),0===this.data.ty||this.data.xt?this.compInterface=s(this):4===this.data.ty?(this.layerInterface.shapeInterface=r(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=i(this),this.layerInterface.text=this.layerInterface.textInterface)}},setBlendMode:function(){var e=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=e},initBaseData:function(e,t,n){this.globalData=t,this.comp=n,this.data=e,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(e,t){var n,r=this.dynamicProperties.length;for(n=0;n<r;n+=1)(t||this._isParent&&"transform"===this.dynamicProperties[n].propType)&&(this.dynamicProperties[n].getValue(),this.dynamicProperties[n]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&this.dynamicProperties.push(e)}},FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){var e=getExpressionInterfaces();if(e){var t=e("footage");this.layerInterface=t(this)}},FootageElement.prototype.getFootageData=function(){return this.footageData},AudioElement.prototype.prepareFrame=function(e){if(this.prepareRenderableFrame(e,!0),this.prepareProperties(e,!0),this.tm._placeholder)this._currentTime=e/this.data.sr;else{var t=this.tm.v;this._currentTime=t}this._volume=this.lv.v[0];var n=this._volume*this._volumeMultiplier;this._previousVolume!==n&&(this._previousVolume=n,this.audio.volume(n))},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(e){this.audio.rate(e)},AudioElement.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(e){var t,n,r=this.layers.length;for(this.completeLayers=!0,t=r-1;t>=0;t-=1)this.elements[t]||(n=this.layers[t]).ip-n.st<=e-this.layers[t].st&&n.op-n.st>e-this.layers[t].st&&this.buildItem(t),this.completeLayers=!!this.elements[t]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:default:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(e){return new AudioElement(e,this.globalData,this)},BaseRenderer.prototype.createFootage=function(e){return new FootageElement(e,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.buildItem(e);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(e){var t;this.completeLayers=!1;var n,r=e.length,i=this.layers.length;for(t=0;t<r;t+=1)for(n=0;n<i;){if(this.layers[n].id===e[t].id){this.layers[n]=e[t];break}n+=1}},BaseRenderer.prototype.setProjectInterface=function(e){this.globalData.projectInterface=e},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(e,t,n){for(var r=this.elements,i=this.layers,s=0,o=i.length;s<o;)i[s].ind==t&&(r[s]&&!0!==r[s]?(n.push(r[s]),r[s].setAsParent(),void 0!==i[s].parent?this.buildElementParenting(e,i[s].parent,n):e.setHierarchy(n)):(this.buildItem(s),this.addPendingElement(e))),s+=1},BaseRenderer.prototype.addPendingElement=function(e){this.pendingElements.push(e)},BaseRenderer.prototype.searchExtraCompositions=function(e){var t,n=e.length;for(t=0;t<n;t+=1)if(e[t].xt){var r=this.createComp(e[t]);r.initExpressions(),this.globalData.projectInterface.registerComposition(r)}},BaseRenderer.prototype.getElementById=function(e){var t,n=this.elements.length;for(t=0;t<n;t+=1)if(this.elements[t].data.ind===e)return this.elements[t];return null},BaseRenderer.prototype.getElementByPath=function(e){var t,n=e.shift();if("number"==typeof n)t=this.elements[n];else{var r,i=this.elements.length;for(r=0;r<i;r+=1)if(this.elements[r].data.nm===n){t=this.elements[r];break}}return 0===e.length?t:t.getElementByPath(e)},BaseRenderer.prototype.setupGlobalData=function(e,t){this.globalData.fontManager=new FontManager,this.globalData.slotManager=slotFactory(e),this.globalData.fontManager.addChars(e.chars),this.globalData.fontManager.addFonts(e.fonts,t),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=e.fr,this.globalData.nm=e.nm,this.globalData.compSize={w:e.w,h:e.h}};var effectTypes={TRANSFORM_EFFECT:"transformEFfect"};function TransformElement(){}function MaskElement(e,t,n){this.data=e,this.element=t,this.globalData=n,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var r,i,s=this.globalData.defs,o=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(o),this.solidPath="";var a,l,c,d,h,u,p=this.masksProperties,f=0,m=[],g=createElementID(),y="clipPath",v="clip-path";for(r=0;r<o;r+=1)if(("a"!==p[r].mode&&"n"!==p[r].mode||p[r].inv||100!==p[r].o.k||p[r].o.x)&&(y="mask",v="mask"),"s"!==p[r].mode&&"i"!==p[r].mode||0!==f?c=null:((c=createNS("rect")).setAttribute("fill","#ffffff"),c.setAttribute("width",this.element.comp.data.w||0),c.setAttribute("height",this.element.comp.data.h||0),m.push(c)),i=createNS("path"),"n"===p[r].mode)this.viewData[r]={op:PropertyFactory.getProp(this.element,p[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,p[r],3),elem:i,lastPath:""},s.appendChild(i);else{var b;if(f+=1,i.setAttribute("fill","s"===p[r].mode?"#000000":"#ffffff"),i.setAttribute("clip-rule","nonzero"),0!==p[r].x.k?(y="mask",v="mask",u=PropertyFactory.getProp(this.element,p[r].x,0,null,this.element),b=createElementID(),(d=createNS("filter")).setAttribute("id",b),(h=createNS("feMorphology")).setAttribute("operator","erode"),h.setAttribute("in","SourceGraphic"),h.setAttribute("radius","0"),d.appendChild(h),s.appendChild(d),i.setAttribute("stroke","s"===p[r].mode?"#000000":"#ffffff")):(h=null,u=null),this.storedData[r]={elem:i,x:u,expan:h,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"===p[r].mode){l=m.length;var w=createNS("g");for(a=0;a<l;a+=1)w.appendChild(m[a]);var x=createNS("mask");x.setAttribute("mask-type","alpha"),x.setAttribute("id",g+"_"+f),x.appendChild(i),s.appendChild(x),w.setAttribute("mask","url("+getLocationHref()+"#"+g+"_"+f+")"),m.length=0,m.push(w)}else m.push(i);p[r].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[r]={elem:i,lastPath:"",op:PropertyFactory.getProp(this.element,p[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,p[r],3),invRect:c},this.viewData[r].prop.k||this.drawPath(p[r],this.viewData[r].prop.v,this.viewData[r])}for(this.maskElement=createNS(y),o=m.length,r=0;r<o;r+=1)this.maskElement.appendChild(m[r]);f>0&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(v,"url("+getLocationHref()+"#"+g+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}TransformElement.prototype={initTransform:function(){var e=new Matrix;this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:e,localMat:e,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var e,t=this.finalTransform.mat,n=0,r=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;n<r;){if(this.hierarchy[n].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}n+=1}if(this.finalTransform._matMdf)for(e=this.finalTransform.mProp.v.props,t.cloneFromProps(e),n=0;n<r;n+=1)t.multiply(this.hierarchy[n].finalTransform.mProp.v)}this.localTransforms&&!this.finalTransform._matMdf||(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v)},renderLocalTransform:function(){if(this.localTransforms){var e=0,t=this.localTransforms.length;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;e<t;)this.localTransforms[e]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[e]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v,this.finalTransform._opMdf=!0),e+=1;if(this.finalTransform._localMatMdf){var n=this.finalTransform.localMat;for(this.localTransforms[0].matrix.clone(n),e=1;e<t;e+=1){var r=this.localTransforms[e].matrix;n.multiply(r)}n.multiply(this.finalTransform.mat)}if(this.finalTransform._opMdf){var i=this.finalTransform.localOpacity;for(e=0;e<t;e+=1)i*=.01*this.localTransforms[e].opacity;this.finalTransform.localOpacity=i}}},searchEffectTransforms:function(){if(this.renderableEffectsManager){var e=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);if(e.length){this.localTransforms=[],this.finalTransform.localMat=new Matrix;var t=0,n=e.length;for(t=0;t<n;t+=1)this.localTransforms.push(e[t])}}},globalToLocal:function(e){var t=[];t.push(this.finalTransform);for(var n,r=!0,i=this.comp;r;)i.finalTransform?(i.data.hasMask&&t.splice(0,0,i.finalTransform),i=i.comp):r=!1;var s,o=t.length;for(n=0;n<o;n+=1)s=t[n].mat.applyToPointArray(0,0,0),e=[e[0]-s[0],e[1]-s[1],0];return e},mHelper:new Matrix},MaskElement.prototype.getMaskProperty=function(e){return this.viewData[e].prop},MaskElement.prototype.renderFrame=function(e){var t,n=this.element.finalTransform.mat,r=this.masksProperties.length;for(t=0;t<r;t+=1)if((this.viewData[t].prop._mdf||e)&&this.drawPath(this.masksProperties[t],this.viewData[t].prop.v,this.viewData[t]),(this.viewData[t].op._mdf||e)&&this.viewData[t].elem.setAttribute("fill-opacity",this.viewData[t].op.v),"n"!==this.masksProperties[t].mode&&(this.viewData[t].invRect&&(this.element.finalTransform.mProp._mdf||e)&&this.viewData[t].invRect.setAttribute("transform",n.getInverseMatrix().to2dCSS()),this.storedData[t].x&&(this.storedData[t].x._mdf||e))){var i=this.storedData[t].expan;this.storedData[t].x.v<0?("erode"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="erode",this.storedData[t].elem.setAttribute("filter","url("+getLocationHref()+"#"+this.storedData[t].filterId+")")),i.setAttribute("radius",-this.storedData[t].x.v)):("dilate"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="dilate",this.storedData[t].elem.setAttribute("filter",null)),this.storedData[t].elem.setAttribute("stroke-width",2*this.storedData[t].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var e="M0,0 ";return e+=" h"+this.globalData.compSize.w,e+=" v"+this.globalData.compSize.h,e+=" h-"+this.globalData.compSize.w,e+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(e,t,n){var r,i,s=" M"+t.v[0][0]+","+t.v[0][1];for(i=t._length,r=1;r<i;r+=1)s+=" C"+t.o[r-1][0]+","+t.o[r-1][1]+" "+t.i[r][0]+","+t.i[r][1]+" "+t.v[r][0]+","+t.v[r][1];if(t.c&&i>1&&(s+=" C"+t.o[r-1][0]+","+t.o[r-1][1]+" "+t.i[0][0]+","+t.i[0][1]+" "+t.v[0][0]+","+t.v[0][1]),n.lastPath!==s){var o="";n.elem&&(t.c&&(o=e.inv?this.solidPath+s:s),n.elem.setAttribute("d",o)),n.lastPath=s}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var e={createFilter:function(e,t){var n=createNS("filter");return n.setAttribute("id",e),!0!==t&&(n.setAttribute("filterUnits","objectBoundingBox"),n.setAttribute("x","0%"),n.setAttribute("y","0%"),n.setAttribute("width","100%"),n.setAttribute("height","100%")),n},createAlphaToLuminanceFilter:function(){var e=createNS("feColorMatrix");return e.setAttribute("type","matrix"),e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),e}};return e}(),featureSupport=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!=typeof OffscreenCanvas};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(e){var t,n,r="SourceGraphic",i=e.data.ef?e.data.ef.length:0,s=createElementID(),o=filtersFactory.createFilter(s,!0),a=0;for(this.filters=[],t=0;t<i;t+=1){n=null;var l=e.data.ef[t].ty;registeredEffects$1[l]&&(n=new(0,registeredEffects$1[l].effect)(o,e.effectsManager.effectElements[t],e,idPrefix+a,r),r=idPrefix+a,registeredEffects$1[l].countsAsEffect&&(a+=1)),n&&this.filters.push(n)}a&&(e.globalData.defs.appendChild(o),e.layerElement.setAttribute("filter","url("+getLocationHref()+"#"+s+")")),this.filters.length&&e.addRenderableComponent(this)}function registerEffect$1(e,t,n){registeredEffects$1[e]={effect:t,countsAsEffect:n}}function SVGBaseElement(){}function HierarchyElement(){}function RenderableDOMElement(){}function IImageElement(e,t,n){this.assetData=t.getAssetData(e.refId),this.assetData&&this.assetData.sid&&(this.assetData=t.slotManager.getProp(this.assetData)),this.initElement(e,t,n),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ProcessedElement(e,t){this.elem=e,this.pos=t}function IShapeElement(){}SVGEffects.prototype.renderFrame=function(e){var t,n=this.filters.length;for(t=0;t<n;t+=1)this.filters[t].renderFrame(e)},SVGEffects.prototype.getEffects=function(e){var t,n=this.filters.length,r=[];for(t=0;t<n;t+=1)this.filters[t].type===e&&r.push(this.filters[t]);return r},SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var e=null;if(this.data.td){this.matteMasks={};var t=createNS("g");t.setAttribute("id",this.layerId),t.appendChild(this.layerElement),e=t,this.globalData.defs.appendChild(t)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),e=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var n=createNS("clipPath"),r=createNS("path");r.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var i=createElementID();if(n.setAttribute("id",i),n.appendChild(r),this.globalData.defs.appendChild(n),this.checkMasks()){var s=createNS("g");s.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")"),s.appendChild(this.layerElement),this.transformedElement=s,e?e.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._localMatMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.localOpacity)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this),this.searchEffectTransforms()},getMatte:function(e){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[e]){var t,n,r,i,s=this.layerId+"_"+e;if(1===e||3===e){var o=createNS("mask");o.setAttribute("id",s),o.setAttribute("mask-type",3===e?"luminance":"alpha"),(r=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),o.appendChild(r),this.globalData.defs.appendChild(o),featureSupport.maskType||1!==e||(o.setAttribute("mask-type","luminance"),t=createElementID(),n=filtersFactory.createFilter(t),this.globalData.defs.appendChild(n),n.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(i=createNS("g")).appendChild(r),o.appendChild(i),i.setAttribute("filter","url("+getLocationHref()+"#"+t+")"))}else if(2===e){var a=createNS("mask");a.setAttribute("id",s),a.setAttribute("mask-type","alpha");var l=createNS("g");a.appendChild(l),t=createElementID(),n=filtersFactory.createFilter(t);var c=createNS("feComponentTransfer");c.setAttribute("in","SourceGraphic"),n.appendChild(c);var d=createNS("feFuncA");d.setAttribute("type","table"),d.setAttribute("tableValues","1.0 0.0"),c.appendChild(d),this.globalData.defs.appendChild(n);var h=createNS("rect");h.setAttribute("width",this.comp.data.w),h.setAttribute("height",this.comp.data.h),h.setAttribute("x","0"),h.setAttribute("y","0"),h.setAttribute("fill","#ffffff"),h.setAttribute("opacity","0"),l.setAttribute("filter","url("+getLocationHref()+"#"+t+")"),l.appendChild(h),(r=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),l.appendChild(r),featureSupport.maskType||(a.setAttribute("mask-type","luminance"),n.appendChild(filtersFactory.createAlphaToLuminanceFilter()),i=createNS("g"),l.appendChild(h),i.appendChild(this.layerElement),l.appendChild(i)),this.globalData.defs.appendChild(a)}this.matteMasks[e]=s}return this.matteMasks[e]},setMatte:function(e){this.matteElement&&this.matteElement.setAttribute("mask","url("+getLocationHref()+"#"+e+")")}},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(e){this.hierarchy=e},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(e,t,n){this.initFrame(),this.initBaseData(e,t,n),this.initTransform(e,t,n),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},IShapeElement.prototype={addShapeToModifiers:function(e){var t,n=this.shapeModifiers.length;for(t=0;t<n;t+=1)this.shapeModifiers[t].addShape(e)},isShapeInAnimatedModifiers:function(e){for(var t=this.shapeModifiers.length;0<t;)if(this.shapeModifiers[0].isAnimatedWithShape(e))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var e,t=this.shapes.length;for(e=0;e<t;e+=1)this.shapes[e].sh.reset();for(e=(t=this.shapeModifiers.length)-1;e>=0&&!this.shapeModifiers[e].processShapes(this._isFirstFrame);e-=1);}},searchProcessedElement:function(e){for(var t=this.processedElements,n=0,r=t.length;n<r;){if(t[n].elem===e)return t[n].pos;n+=1}return 0},addProcessedElement:function(e,t){for(var n=this.processedElements,r=n.length;r;)if(n[r-=1].elem===e)return void(n[r].pos=t);n.push(new ProcessedElement(e,t))},prepareFrame:function(e){this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)}};var lineCapEnum={1:"butt",2:"round",3:"square"},lineJoinEnum={1:"miter",2:"round",3:"bevel"};function SVGShapeData(e,t,n){this.caches=[],this.styles=[],this.transformers=e,this.lStr="",this.sh=n,this.lvl=t,this._isAnimated=!!n.k;for(var r=0,i=e.length;r<i;){if(e[r].mProps.dynamicProperties.length){this._isAnimated=!0;break}r+=1}}function SVGStyleData(e,t){this.data=e,this.type=e.ty,this.d="",this.lvl=t,this._mdf=!1,this.closed=!0===e.hd,this.pElem=createNS("path"),this.msElem=null}function DashProperty(e,t,n,r){var i;this.elem=e,this.frameId=-1,this.dataProps=createSizedArray(t.length),this.renderer=n,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",t.length?t.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(r);var s,o=t.length||0;for(i=0;i<o;i+=1)s=PropertyFactory.getProp(e,t[i].v,0,0,this),this.k=s.k||this.k,this.dataProps[i]={n:t[i].n,p:s};this.k||this.getValue(!0),this._isAnimated=this.k}function SVGStrokeStyleData(e,t,n){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=n,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(e,t,n){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=n}function SVGNoStyleData(e,t,n){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.style=n}function GradientProperty(e,t,n){this.data=t,this.c=createTypedArray("uint8c",4*t.p);var r=t.k.k[0].s?t.k.k[0].s.length-4*t.p:t.k.k.length-4*t.p;this.o=createTypedArray("float32",r),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=r,this.initDynamicPropertyContainer(n),this.prop=PropertyFactory.getProp(e,t.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function SVGGradientFillStyleData(e,t,n){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.initGradientData(e,t,n)}function SVGGradientStrokeStyleData(e,t,n){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.initGradientData(e,t,n),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function SVGTransformData(e,t,n){this.transform={mProps:e,op:t,container:n},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},DashProperty.prototype.getValue=function(e){if((this.elem.globalData.frameId!==this.frameId||e)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||e,this._mdf)){var t=0,n=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),t=0;t<n;t+=1)"o"!==this.dataProps[t].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[t].p.v:this.dashArray[t]=this.dataProps[t].p.v:this.dashoffset[0]=this.dataProps[t].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),extendPrototype([DynamicPropertyContainer],SVGNoStyleData),GradientProperty.prototype.comparePoints=function(e,t){for(var n=0,r=this.o.length/2;n<r;){if(Math.abs(e[4*n]-e[4*t+2*n])>.01)return!1;n+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e<t;){if(!this.comparePoints(this.data.k.k[e].s,this.data.p))return!1;e+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(e){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||e){var t,n,r,i=4*this.data.p;for(t=0;t<i;t+=1)n=t%4==0?100:255,r=Math.round(this.prop.v[t]*n),this.c[t]!==r&&(this.c[t]=r,this._cmdf=!e);if(this.o.length)for(i=this.prop.v.length,t=4*this.data.p;t<i;t+=1)n=t%2==0?100:1,r=t%2==0?Math.round(100*this.prop.v[t]):this.prop.v[t],this.o[t-4*this.data.p]!==r&&(this.o[t-4*this.data.p]=r,this._omdf=!e);this._mdf=!e}},extendPrototype([DynamicPropertyContainer],GradientProperty),SVGGradientFillStyleData.prototype.initGradientData=function(e,t,n){this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.s=PropertyFactory.getProp(e,t.s,1,null,this),this.e=PropertyFactory.getProp(e,t.e,1,null,this),this.h=PropertyFactory.getProp(e,t.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(e,t.a||{k:0},0,degToRads,this),this.g=new GradientProperty(e,t.g,this),this.style=n,this.stops=[],this.setGradientData(n.pElem,t),this.setGradientOpacity(t,n),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(e,t){var n=createElementID(),r=createNS(1===t.t?"linearGradient":"radialGradient");r.setAttribute("id",n),r.setAttribute("spreadMethod","pad"),r.setAttribute("gradientUnits","userSpaceOnUse");var i,s,o,a=[];for(o=4*t.g.p,s=0;s<o;s+=4)i=createNS("stop"),r.appendChild(i),a.push(i);e.setAttribute("gf"===t.ty?"fill":"stroke","url("+getLocationHref()+"#"+n+")"),this.gf=r,this.cst=a},SVGGradientFillStyleData.prototype.setGradientOpacity=function(e,t){if(this.g._hasOpacity&&!this.g._collapsable){var n,r,i,s=createNS("mask"),o=createNS("path");s.appendChild(o);var a=createElementID(),l=createElementID();s.setAttribute("id",l);var c=createNS(1===e.t?"linearGradient":"radialGradient");c.setAttribute("id",a),c.setAttribute("spreadMethod","pad"),c.setAttribute("gradientUnits","userSpaceOnUse"),i=e.g.k.k[0].s?e.g.k.k[0].s.length:e.g.k.k.length;var d=this.stops;for(r=4*e.g.p;r<i;r+=2)(n=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),c.appendChild(n),d.push(n);o.setAttribute("gf"===e.ty?"fill":"stroke","url("+getLocationHref()+"#"+a+")"),"gs"===e.ty&&(o.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),o.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),1===e.lj&&o.setAttribute("stroke-miterlimit",e.ml)),this.of=c,this.ms=s,this.ost=d,this.maskId=l,t.msElem=o}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var buildShapeString=function(e,t,n,r){if(0===t)return"";var i,s=e.o,o=e.i,a=e.v,l=" M"+r.applyToPointStringified(a[0][0],a[0][1]);for(i=1;i<t;i+=1)l+=" C"+r.applyToPointStringified(s[i-1][0],s[i-1][1])+" "+r.applyToPointStringified(o[i][0],o[i][1])+" "+r.applyToPointStringified(a[i][0],a[i][1]);return n&&t&&(l+=" C"+r.applyToPointStringified(s[i-1][0],s[i-1][1])+" "+r.applyToPointStringified(o[0][0],o[0][1])+" "+r.applyToPointStringified(a[0][0],a[0][1]),l+="z"),l},SVGElementsRenderer=function(){var e=new Matrix,t=new Matrix;function n(e,t,n){(n||t.transform.op._mdf)&&t.transform.container.setAttribute("opacity",t.transform.op.v),(n||t.transform.mProps._mdf)&&t.transform.container.setAttribute("transform",t.transform.mProps.v.to2dCSS())}function r(){}function i(n,r,i){var s,o,a,l,c,d,h,u,p,f,m=r.styles.length,g=r.lvl;for(d=0;d<m;d+=1){if(l=r.sh._mdf||i,r.styles[d].lvl<g){for(u=t.reset(),p=g-r.styles[d].lvl,f=r.transformers.length-1;!l&&p>0;)l=r.transformers[f].mProps._mdf||l,p-=1,f-=1;if(l)for(p=g-r.styles[d].lvl,f=r.transformers.length-1;p>0;)u.multiply(r.transformers[f].mProps.v),p-=1,f-=1}else u=e;if(o=(h=r.sh.paths)._length,l){for(a="",s=0;s<o;s+=1)(c=h.shapes[s])&&c._length&&(a+=buildShapeString(c,c._length,c.c,u));r.caches[d]=a}else a=r.caches[d];r.styles[d].d+=!0===n.hd?"":a,r.styles[d]._mdf=l||r.styles[d]._mdf}}function s(e,t,n){var r=t.style;(t.c._mdf||n)&&r.pElem.setAttribute("fill","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||n)&&r.pElem.setAttribute("fill-opacity",t.o.v)}function o(e,t,n){a(e,t,n),l(0,t,n)}function a(e,t,n){var r,i,s,o,a,l=t.gf,c=t.g._hasOpacity,d=t.s.v,h=t.e.v;if(t.o._mdf||n){var u="gf"===e.ty?"fill-opacity":"stroke-opacity";t.style.pElem.setAttribute(u,t.o.v)}if(t.s._mdf||n){var p=1===e.t?"x1":"cx",f="x1"===p?"y1":"cy";l.setAttribute(p,d[0]),l.setAttribute(f,d[1]),c&&!t.g._collapsable&&(t.of.setAttribute(p,d[0]),t.of.setAttribute(f,d[1]))}if(t.g._cmdf||n){r=t.cst;var m=t.g.c;for(s=r.length,i=0;i<s;i+=1)(o=r[i]).setAttribute("offset",m[4*i]+"%"),o.setAttribute("stop-color","rgb("+m[4*i+1]+","+m[4*i+2]+","+m[4*i+3]+")")}if(c&&(t.g._omdf||n)){var g=t.g.o;for(s=(r=t.g._collapsable?t.cst:t.ost).length,i=0;i<s;i+=1)o=r[i],t.g._collapsable||o.setAttribute("offset",g[2*i]+"%"),o.setAttribute("stop-opacity",g[2*i+1])}if(1===e.t)(t.e._mdf||n)&&(l.setAttribute("x2",h[0]),l.setAttribute("y2",h[1]),c&&!t.g._collapsable&&(t.of.setAttribute("x2",h[0]),t.of.setAttribute("y2",h[1])));else if((t.s._mdf||t.e._mdf||n)&&(a=Math.sqrt(Math.pow(d[0]-h[0],2)+Math.pow(d[1]-h[1],2)),l.setAttribute("r",a),c&&!t.g._collapsable&&t.of.setAttribute("r",a)),t.s._mdf||t.e._mdf||t.h._mdf||t.a._mdf||n){a||(a=Math.sqrt(Math.pow(d[0]-h[0],2)+Math.pow(d[1]-h[1],2)));var y=Math.atan2(h[1]-d[1],h[0]-d[0]),v=t.h.v;v>=1?v=.99:v<=-1&&(v=-.99);var b=a*v,w=Math.cos(y+t.a.v)*b+d[0],x=Math.sin(y+t.a.v)*b+d[1];l.setAttribute("fx",w),l.setAttribute("fy",x),c&&!t.g._collapsable&&(t.of.setAttribute("fx",w),t.of.setAttribute("fy",x))}}function l(e,t,n){var r=t.style,i=t.d;i&&(i._mdf||n)&&i.dashStr&&(r.pElem.setAttribute("stroke-dasharray",i.dashStr),r.pElem.setAttribute("stroke-dashoffset",i.dashoffset[0])),t.c&&(t.c._mdf||n)&&r.pElem.setAttribute("stroke","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||n)&&r.pElem.setAttribute("stroke-opacity",t.o.v),(t.w._mdf||n)&&(r.pElem.setAttribute("stroke-width",t.w.v),r.msElem&&r.msElem.setAttribute("stroke-width",t.w.v))}return{createRenderFunction:function(e){switch(e.ty){case"fl":return s;case"gf":return a;case"gs":return o;case"st":return l;case"sh":case"el":case"rc":case"sr":return i;case"tr":return n;case"no":return r;default:return null}}}}();function SVGShapeElement(e,t,n){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,n),this.prevViewData=[]}function LetterProps(e,t,n,r,i,s){this.o=e,this.sw=t,this.sc=n,this.fc=r,this.m=i,this.p=s,this._mdf={o:!0,sw:!!t,sc:!!n,fc:!!r,m:!0,p:!0}}function TextProperty(e,t){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,t.d&&t.d.sid&&(t.d=e.globalData.slotManager.getProp(t.d)),this.data=t,this.elem=e,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var e,t,n,r,i=this.shapes.length,s=this.stylesList.length,o=[],a=!1;for(n=0;n<s;n+=1){for(r=this.stylesList[n],a=!1,o.length=0,e=0;e<i;e+=1)-1!==(t=this.shapes[e]).styles.indexOf(r)&&(o.push(t),a=t._isAnimated||a);o.length>1&&a&&this.setShapesAsAnimated(o)}},SVGShapeElement.prototype.setShapesAsAnimated=function(e){var t,n=e.length;for(t=0;t<n;t+=1)e[t].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(e,t){var n,r=new SVGStyleData(e,t),i=r.pElem;return"st"===e.ty?n=new SVGStrokeStyleData(this,e,r):"fl"===e.ty?n=new SVGFillStyleData(this,e,r):"gf"===e.ty||"gs"===e.ty?(n=new("gf"===e.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,e,r),this.globalData.defs.appendChild(n.gf),n.maskId&&(this.globalData.defs.appendChild(n.ms),this.globalData.defs.appendChild(n.of),i.setAttribute("mask","url("+getLocationHref()+"#"+n.maskId+")"))):"no"===e.ty&&(n=new SVGNoStyleData(this,e,r)),"st"!==e.ty&&"gs"!==e.ty||(i.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),i.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),i.setAttribute("fill-opacity","0"),1===e.lj&&i.setAttribute("stroke-miterlimit",e.ml)),2===e.r&&i.setAttribute("fill-rule","evenodd"),e.ln&&i.setAttribute("id",e.ln),e.cl&&i.setAttribute("class",e.cl),e.bm&&(i.style["mix-blend-mode"]=getBlendMode(e.bm)),this.stylesList.push(r),this.addToAnimatedContents(e,n),n},SVGShapeElement.prototype.createGroupElement=function(e){var t=new ShapeGroupData;return e.ln&&t.gr.setAttribute("id",e.ln),e.cl&&t.gr.setAttribute("class",e.cl),e.bm&&(t.gr.style["mix-blend-mode"]=getBlendMode(e.bm)),t},SVGShapeElement.prototype.createTransformElement=function(e,t){var n=TransformPropertyFactory.getTransformProperty(this,e,this),r=new SVGTransformData(n,n.o,t);return this.addToAnimatedContents(e,r),r},SVGShapeElement.prototype.createShapeElement=function(e,t,n){var r=4;"rc"===e.ty?r=5:"el"===e.ty?r=6:"sr"===e.ty&&(r=7);var i=new SVGShapeData(t,n,ShapePropertyFactory.getShapeProp(this,e,r,this));return this.shapes.push(i),this.addShapeToModifiers(i),this.addToAnimatedContents(e,i),i},SVGShapeElement.prototype.addToAnimatedContents=function(e,t){for(var n=0,r=this.animatedContents.length;n<r;){if(this.animatedContents[n].element===t)return;n+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(e),element:t,data:e})},SVGShapeElement.prototype.setElementStyles=function(e){var t,n=e.styles,r=this.stylesList.length;for(t=0;t<r;t+=1)-1!==n.indexOf(this.stylesList[t])||this.stylesList[t].closed||n.push(this.stylesList[t])},SVGShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(e,t,n,r,i,s,o){var a,l,c,d,h,u,p=[].concat(s),f=e.length-1,m=[],g=[];for(a=f;a>=0;a-=1){if((u=this.searchProcessedElement(e[a]))?t[a]=n[u-1]:e[a]._render=o,"fl"===e[a].ty||"st"===e[a].ty||"gf"===e[a].ty||"gs"===e[a].ty||"no"===e[a].ty)u?t[a].style.closed=e[a].hd:t[a]=this.createStyleElement(e[a],i),e[a]._render&&t[a].style.pElem.parentNode!==r&&r.appendChild(t[a].style.pElem),m.push(t[a].style);else if("gr"===e[a].ty){if(u)for(c=t[a].it.length,l=0;l<c;l+=1)t[a].prevViewData[l]=t[a].it[l];else t[a]=this.createGroupElement(e[a]);this.searchShapes(e[a].it,t[a].it,t[a].prevViewData,t[a].gr,i+1,p,o),e[a]._render&&t[a].gr.parentNode!==r&&r.appendChild(t[a].gr)}else"tr"===e[a].ty?(u||(t[a]=this.createTransformElement(e[a],r)),d=t[a].transform,p.push(d)):"sh"===e[a].ty||"rc"===e[a].ty||"el"===e[a].ty||"sr"===e[a].ty?(u||(t[a]=this.createShapeElement(e[a],p,i)),this.setElementStyles(t[a])):"tm"===e[a].ty||"rd"===e[a].ty||"ms"===e[a].ty||"pb"===e[a].ty||"zz"===e[a].ty||"op"===e[a].ty?(u?(h=t[a]).closed=!1:((h=ShapeModifiers.getModifier(e[a].ty)).init(this,e[a]),t[a]=h,this.shapeModifiers.push(h)),g.push(h)):"rp"===e[a].ty&&(u?(h=t[a]).closed=!0:(h=ShapeModifiers.getModifier(e[a].ty),t[a]=h,h.init(this,e,a,t),this.shapeModifiers.push(h),o=!1),g.push(h));this.addProcessedElement(e[a],a+1)}for(f=m.length,a=0;a<f;a+=1)m[a].closed=!0;for(f=g.length,a=0;a<f;a+=1)g[a].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var e;this.renderModifiers();var t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].reset();for(this.renderShape(),e=0;e<t;e+=1)(this.stylesList[e]._mdf||this._isFirstFrame)&&(this.stylesList[e].msElem&&(this.stylesList[e].msElem.setAttribute("d",this.stylesList[e].d),this.stylesList[e].d="M0 0"+this.stylesList[e].d),this.stylesList[e].pElem.setAttribute("d",this.stylesList[e].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var e,t,n=this.animatedContents.length;for(e=0;e<n;e+=1)t=this.animatedContents[e],(this._isFirstFrame||t.element._isAnimated)&&!0!==t.data&&t.fn(t.data,t.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},LetterProps.prototype.update=function(e,t,n,r,i,s){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var o=!1;return this.o!==e&&(this.o=e,this._mdf.o=!0,o=!0),this.sw!==t&&(this.sw=t,this._mdf.sw=!0,o=!0),this.sc!==n&&(this.sc=n,this._mdf.sc=!0,o=!0),this.fc!==r&&(this.fc=r,this._mdf.fc=!0,o=!0),this.m!==i&&(this.m=i,this._mdf.m=!0,o=!0),!s.length||this.p[0]===s[0]&&this.p[1]===s[1]&&this.p[4]===s[4]&&this.p[5]===s[5]&&this.p[12]===s[12]&&this.p[13]===s[13]||(this.p=s,this._mdf.p=!0,o=!0),o},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},TextProperty.prototype.setCurrentData=function(e){e.__complete||this.completeTextData(e),this.currentData=e,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(e){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||e){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,n=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var r;this.lock=!0,this._mdf=!1;var i=this.effectsSequence.length,s=e||this.data.d.k[this.keysIndex].s;for(r=0;r<i;r+=1)s=n!==this.keysIndex?this.effectsSequence[r](s,s.t):this.effectsSequence[r](this.currentData,s.t);t!==s&&this.setCurrentData(s),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var e=this.data.d.k,t=this.elem.comp.renderedFrame,n=0,r=e.length;n<=r-1&&!(n===r-1||e[n+1].t>t);)n+=1;return this.keysIndex!==n&&(this.keysIndex=n),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(e){for(var t,n,r=[],i=0,s=e.length,o=!1,a=!1,l="";i<s;)o=a,a=!1,t=e.charCodeAt(i),l=e.charAt(i),FontManager.isCombinedCharacter(t)?o=!0:t>=55296&&t<=56319?FontManager.isRegionalFlag(e,i)?l=e.substr(i,14):(n=e.charCodeAt(i+1))>=56320&&n<=57343&&(FontManager.isModifier(t,n)?(l=e.substr(i,2),o=!0):l=FontManager.isFlagEmoji(e.substr(i,4))?e.substr(i,4):e.substr(i,2)):t>56319?(n=e.charCodeAt(i+1),FontManager.isVariationSelector(t)&&(o=!0)):FontManager.isZeroWidthJoiner(t)&&(o=!0,a=!0),o?(r[r.length-1]+=l,o=!1):r.push(l),i+=l.length;return r},TextProperty.prototype.completeTextData=function(e){e.__complete=!0;var t,n,r,i,s,o,a,l=this.elem.globalData.fontManager,c=this.data,d=[],h=0,u=c.m.g,p=0,f=0,m=0,g=[],y=0,v=0,b=l.getFontByName(e.f),w=0,x=getFontProperties(b);e.fWeight=x.weight,e.fStyle=x.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),n=e.finalText.length,e.finalLineHeight=e.lh;var E,C=e.tr/1e3*e.finalSize;if(e.sz)for(var S,_,k=!0,O=e.sz[0],T=e.sz[1];k;){S=0,y=0,n=(_=this.buildFinalText(e.t)).length,C=e.tr/1e3*e.finalSize;var P=-1;for(t=0;t<n;t+=1)E=_[t].charCodeAt(0),r=!1," "===_[t]?P=t:13!==E&&3!==E||(y=0,r=!0,S+=e.finalLineHeight||1.2*e.finalSize),l.chars?(a=l.getCharData(_[t],b.fStyle,b.fFamily),w=r?0:a.w*e.finalSize/100):w=l.measureText(_[t],e.f,e.finalSize),y+w>O&&" "!==_[t]?(-1===P?n+=1:t=P,S+=e.finalLineHeight||1.2*e.finalSize,_.splice(t,P===t?1:0,"\r"),P=-1,y=0):(y+=w,y+=C);S+=b.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&T<S?(e.finalSize-=1,e.finalLineHeight=e.finalSize*e.lh/e.s):(e.finalText=_,n=e.finalText.length,k=!1)}y=-C,w=0;var I,M=0;for(t=0;t<n;t+=1)if(r=!1,13===(E=(I=e.finalText[t]).charCodeAt(0))||3===E?(M=0,g.push(y),v=y>v?y:v,y=-2*C,i="",r=!0,m+=1):i=I,l.chars?(a=l.getCharData(I,b.fStyle,l.getFontByName(e.f).fFamily),w=r?0:a.w*e.finalSize/100):w=l.measureText(i,e.f,e.finalSize)," "===I?M+=w+C:(y+=w+C+M,M=0),d.push({l:w,an:w,add:p,n:r,anIndexes:[],val:i,line:m,animatorJustifyOffset:0}),2==u){if(p+=w,""===i||" "===i||t===n-1){for(""!==i&&" "!==i||(p-=w);f<=t;)d[f].an=p,d[f].ind=h,d[f].extra=w,f+=1;h+=1,p=0}}else if(3==u){if(p+=w,""===i||t===n-1){for(""===i&&(p-=w);f<=t;)d[f].an=p,d[f].ind=h,d[f].extra=w,f+=1;p=0,h+=1}}else d[h].ind=h,d[h].extra=0,h+=1;if(e.l=d,v=y>v?y:v,g.push(y),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=v,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=g;var R,A,N,D,L=c.a;o=L.length;var F=[];for(s=0;s<o;s+=1){for((R=L[s]).a.sc&&(e.strokeColorAnim=!0),R.a.sw&&(e.strokeWidthAnim=!0),(R.a.fc||R.a.fh||R.a.fs||R.a.fb)&&(e.fillColorAnim=!0),D=0,N=R.s.b,t=0;t<n;t+=1)(A=d[t]).anIndexes[s]=D,(1==N&&""!==A.val||2==N&&""!==A.val&&" "!==A.val||3==N&&(A.n||" "==A.val||t==n-1)||4==N&&(A.n||t==n-1))&&(1===R.s.rn&&F.push(D),D+=1);c.a[s].s.totalChars=D;var j,$=-1;if(1===R.s.rn)for(t=0;t<n;t+=1)$!=(A=d[t]).anIndexes[s]&&($=A.anIndexes[s],j=F.splice(Math.floor(Math.random()*F.length),1)[0]),A.anIndexes[s]=j}e.yOffset=e.finalLineHeight||1.2*e.finalSize,e.ls=e.ls||0,e.ascent=b.ascent*e.finalSize/100},TextProperty.prototype.updateDocumentData=function(e,t){t=void 0===t?this.keysIndex:t;var n=this.copyData({},this.data.d.k[t].s);n=this.copyData(n,e),this.data.d.k[t].s=n,this.recalculate(t),this.setCurrentData(n),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(e){var t=this.data.d.k[e].s;t.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(t)},TextProperty.prototype.canResizeFont=function(e){this.canResize=e,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(e){this.minimumFontSize=Math.floor(e)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var e=Math.max,t=Math.min,n=Math.floor;function r(e,t){this._currentTextLength=-1,this.k=!1,this.data=t,this.elem=e,this.comp=e.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(e),this.s=PropertyFactory.getProp(e,t.s||{k:0},0,0,this),this.e="e"in t?PropertyFactory.getProp(e,t.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(e,t.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(e,t.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(e,t.ne||{k:0},0,0,this),this.sm=PropertyFactory.getProp(e,t.sm||{k:100},0,0,this),this.a=PropertyFactory.getProp(e,t.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return r.prototype={getMult:function(r){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var i=0,s=0,o=1,a=1;this.ne.v>0?i=this.ne.v/100:s=-this.ne.v/100,this.xe.v>0?o=1-this.xe.v/100:a=1+this.xe.v/100;var l=BezierFactory.getBezierEasing(i,s,o,a).get,c=0,d=this.finalS,h=this.finalE,u=this.data.sh;if(2===u)c=l(c=h===d?r>=h?1:0:e(0,t(.5/(h-d)+(r-d)/(h-d),1)));else if(3===u)c=l(c=h===d?r>=h?0:1:1-e(0,t(.5/(h-d)+(r-d)/(h-d),1)));else if(4===u)h===d?c=0:(c=e(0,t(.5/(h-d)+(r-d)/(h-d),1)))<.5?c*=2:c=1-2*(c-.5),c=l(c);else if(5===u){if(h===d)c=0;else{var p=h-d,f=-p/2+(r=t(e(0,r+.5-d),h-d)),m=p/2;c=Math.sqrt(1-f*f/(m*m))}c=l(c)}else 6===u?(h===d?c=0:(r=t(e(0,r+.5-d),h-d),c=(1+Math.cos(Math.PI+2*Math.PI*r/(h-d)))/2),c=l(c)):(r>=n(d)&&(c=e(0,t(r-d<0?t(h,1)-(d-r):h-r,1))),c=l(c));if(100!==this.sm.v){var g=.01*this.sm.v;0===g&&(g=1e-8);var y=.5-.5*g;c<y?c=0:(c=(c-y)/g)>1&&(c=1)}return c*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&2===this.data.r&&(this.e.v=this._currentTextLength);var t=2===this.data.r?1:100/this.data.totalChars,n=this.o.v/t,r=this.s.v/t+n,i=this.e.v/t+n;if(r>i){var s=r;r=i,i=s}this.finalS=r,this.finalE=i}},extendPrototype([DynamicPropertyContainer],r),{getTextSelectorProp:function(e,t,n){return new r(e,t,n)}}}();function TextAnimatorDataProperty(e,t,n){var r={propType:!1},i=PropertyFactory.getProp,s=t.a;this.a={r:s.r?i(e,s.r,0,degToRads,n):r,rx:s.rx?i(e,s.rx,0,degToRads,n):r,ry:s.ry?i(e,s.ry,0,degToRads,n):r,sk:s.sk?i(e,s.sk,0,degToRads,n):r,sa:s.sa?i(e,s.sa,0,degToRads,n):r,s:s.s?i(e,s.s,1,.01,n):r,a:s.a?i(e,s.a,1,0,n):r,o:s.o?i(e,s.o,0,.01,n):r,p:s.p?i(e,s.p,1,0,n):r,sw:s.sw?i(e,s.sw,0,0,n):r,sc:s.sc?i(e,s.sc,1,0,n):r,fc:s.fc?i(e,s.fc,1,0,n):r,fh:s.fh?i(e,s.fh,0,0,n):r,fs:s.fs?i(e,s.fs,0,.01,n):r,fb:s.fb?i(e,s.fb,0,.01,n):r,t:s.t?i(e,s.t,0,0,n):r},this.s=TextSelectorProp.getTextSelectorProp(e,t.s,n),this.s.t=t.s.t}function TextAnimatorProperty(e,t,n){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=n,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(n)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var e,t,n=this._textData.a.length,r=PropertyFactory.getProp;for(e=0;e<n;e+=1)t=this._textData.a[e],this._animatorsData[e]=new TextAnimatorDataProperty(this._elem,t,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:r(this._elem,this._textData.p.a,0,0,this),f:r(this._elem,this._textData.p.f,0,0,this),l:r(this._elem,this._textData.p.l,0,0,this),r:r(this._elem,this._textData.p.r,0,0,this),p:r(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=r(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(e,t){if(this.lettersChangedFlag=t,this._mdf||this._isFirstFrame||t||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var n,r,i,s,o,a,l,c,d,h,u,p,f,m,g,y,v,b,w,x=this._moreOptions.alignment.v,E=this._animatorsData,C=this._textData,S=this.mHelper,_=this._renderType,k=this.renderedLetters.length,O=e.l;if(this._hasMaskedPath){if(w=this._pathData.m,!this._pathData.n||this._pathData._mdf){var T,P=w.v;for(this._pathData.r.v&&(P=P.reverse()),o={tLength:0,segments:[]},s=P._length-1,y=0,i=0;i<s;i+=1)T=bez.buildBezierData(P.v[i],P.v[i+1],[P.o[i][0]-P.v[i][0],P.o[i][1]-P.v[i][1]],[P.i[i+1][0]-P.v[i+1][0],P.i[i+1][1]-P.v[i+1][1]]),o.tLength+=T.segmentLength,o.segments.push(T),y+=T.segmentLength;i=s,w.v.c&&(T=bez.buildBezierData(P.v[i],P.v[0],[P.o[i][0]-P.v[i][0],P.o[i][1]-P.v[i][1]],[P.i[0][0]-P.v[0][0],P.i[0][1]-P.v[0][1]]),o.tLength+=T.segmentLength,o.segments.push(T),y+=T.segmentLength),this._pathData.pi=o}if(o=this._pathData.pi,a=this._pathData.f.v,u=0,h=1,c=0,d=!0,m=o.segments,a<0&&w.v.c)for(o.tLength<Math.abs(a)&&(a=-Math.abs(a)%o.tLength),h=(f=m[u=m.length-1].points).length-1;a<0;)a+=f[h].partialLength,(h-=1)<0&&(h=(f=m[u-=1].points).length-1);p=(f=m[u].points)[h-1],g=(l=f[h]).partialLength}s=O.length,n=0,r=0;var I,M,R,A,N,D=1.2*e.finalSize*.714,L=!0;R=E.length;var F,j,$,B,V,z,H,U,K,W,G,q,X=-1,Y=a,Z=u,J=h,Q=-1,ee="",te=this.defaultPropsArray;if(2===e.j||1===e.j){var ne=0,re=0,ie=2===e.j?-.5:-1,se=0,oe=!0;for(i=0;i<s;i+=1)if(O[i].n){for(ne&&(ne+=re);se<i;)O[se].animatorJustifyOffset=ne,se+=1;ne=0,oe=!0}else{for(M=0;M<R;M+=1)(I=E[M].a).t.propType&&(oe&&2===e.j&&(re+=I.t.v*ie),(N=E[M].s.getMult(O[i].anIndexes[M],C.a[M].s.totalChars)).length?ne+=I.t.v*N[0]*ie:ne+=I.t.v*N*ie);oe=!1}for(ne&&(ne+=re);se<i;)O[se].animatorJustifyOffset=ne,se+=1}for(i=0;i<s;i+=1){if(S.reset(),B=1,O[i].n)n=0,r+=e.yOffset,r+=L?1:0,a=Y,L=!1,this._hasMaskedPath&&(h=J,p=(f=m[u=Z].points)[h-1],g=(l=f[h]).partialLength,c=0),ee="",G="",K="",q="",te=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Q!==O[i].line){switch(e.j){case 1:a+=y-e.lineWidths[O[i].line];break;case 2:a+=(y-e.lineWidths[O[i].line])/2}Q=O[i].line}X!==O[i].ind&&(O[X]&&(a+=O[X].extra),a+=O[i].an/2,X=O[i].ind),a+=x[0]*O[i].an*.005;var ae=0;for(M=0;M<R;M+=1)(I=E[M].a).p.propType&&((N=E[M].s.getMult(O[i].anIndexes[M],C.a[M].s.totalChars)).length?ae+=I.p.v[0]*N[0]:ae+=I.p.v[0]*N),I.a.propType&&((N=E[M].s.getMult(O[i].anIndexes[M],C.a[M].s.totalChars)).length?ae+=I.a.v[0]*N[0]:ae+=I.a.v[0]*N);for(d=!0,this._pathData.a.v&&(a=.5*O[0].an+(y-this._pathData.f.v-.5*O[0].an-.5*O[O.length-1].an)*X/(s-1),a+=this._pathData.f.v);d;)c+g>=a+ae||!f?(v=(a+ae-c)/l.partialLength,j=p.point[0]+(l.point[0]-p.point[0])*v,$=p.point[1]+(l.point[1]-p.point[1])*v,S.translate(-x[0]*O[i].an*.005,-x[1]*D*.01),d=!1):f&&(c+=l.partialLength,(h+=1)>=f.length&&(h=0,m[u+=1]?f=m[u].points:w.v.c?(h=0,f=m[u=0].points):(c-=l.partialLength,f=null)),f&&(p=l,g=(l=f[h]).partialLength));F=O[i].an/2-O[i].add,S.translate(-F,0,0)}else F=O[i].an/2-O[i].add,S.translate(-F,0,0),S.translate(-x[0]*O[i].an*.005,-x[1]*D*.01,0);for(M=0;M<R;M+=1)(I=E[M].a).t.propType&&(N=E[M].s.getMult(O[i].anIndexes[M],C.a[M].s.totalChars),0===n&&0===e.j||(this._hasMaskedPath?N.length?a+=I.t.v*N[0]:a+=I.t.v*N:N.length?n+=I.t.v*N[0]:n+=I.t.v*N));for(e.strokeWidthAnim&&(z=e.sw||0),e.strokeColorAnim&&(V=e.sc?[e.sc[0],e.sc[1],e.sc[2]]:[0,0,0]),e.fillColorAnim&&e.fc&&(H=[e.fc[0],e.fc[1],e.fc[2]]),M=0;M<R;M+=1)(I=E[M].a).a.propType&&((N=E[M].s.getMult(O[i].anIndexes[M],C.a[M].s.totalChars)).length?S.translate(-I.a.v[0]*N[0],-I.a.v[1]*N[1],I.a.v[2]*N[2]):S.translate(-I.a.v[0]*N,-I.a.v[1]*N,I.a.v[2]*N));for(M=0;M<R;M+=1)(I=E[M].a).s.propType&&((N=E[M].s.getMult(O[i].anIndexes[M],C.a[M].s.totalChars)).length?S.scale(1+(I.s.v[0]-1)*N[0],1+(I.s.v[1]-1)*N[1],1):S.scale(1+(I.s.v[0]-1)*N,1+(I.s.v[1]-1)*N,1));for(M=0;M<R;M+=1){if(I=E[M].a,N=E[M].s.getMult(O[i].anIndexes[M],C.a[M].s.totalChars),I.sk.propType&&(N.length?S.skewFromAxis(-I.sk.v*N[0],I.sa.v*N[1]):S.skewFromAxis(-I.sk.v*N,I.sa.v*N)),I.r.propType&&(N.length?S.rotateZ(-I.r.v*N[2]):S.rotateZ(-I.r.v*N)),I.ry.propType&&(N.length?S.rotateY(I.ry.v*N[1]):S.rotateY(I.ry.v*N)),I.rx.propType&&(N.length?S.rotateX(I.rx.v*N[0]):S.rotateX(I.rx.v*N)),I.o.propType&&(N.length?B+=(I.o.v*N[0]-B)*N[0]:B+=(I.o.v*N-B)*N),e.strokeWidthAnim&&I.sw.propType&&(N.length?z+=I.sw.v*N[0]:z+=I.sw.v*N),e.strokeColorAnim&&I.sc.propType)for(U=0;U<3;U+=1)N.length?V[U]+=(I.sc.v[U]-V[U])*N[0]:V[U]+=(I.sc.v[U]-V[U])*N;if(e.fillColorAnim&&e.fc){if(I.fc.propType)for(U=0;U<3;U+=1)N.length?H[U]+=(I.fc.v[U]-H[U])*N[0]:H[U]+=(I.fc.v[U]-H[U])*N;I.fh.propType&&(H=N.length?addHueToRGB(H,I.fh.v*N[0]):addHueToRGB(H,I.fh.v*N)),I.fs.propType&&(H=N.length?addSaturationToRGB(H,I.fs.v*N[0]):addSaturationToRGB(H,I.fs.v*N)),I.fb.propType&&(H=N.length?addBrightnessToRGB(H,I.fb.v*N[0]):addBrightnessToRGB(H,I.fb.v*N))}}for(M=0;M<R;M+=1)(I=E[M].a).p.propType&&(N=E[M].s.getMult(O[i].anIndexes[M],C.a[M].s.totalChars),this._hasMaskedPath?N.length?S.translate(0,I.p.v[1]*N[0],-I.p.v[2]*N[1]):S.translate(0,I.p.v[1]*N,-I.p.v[2]*N):N.length?S.translate(I.p.v[0]*N[0],I.p.v[1]*N[1],-I.p.v[2]*N[2]):S.translate(I.p.v[0]*N,I.p.v[1]*N,-I.p.v[2]*N));if(e.strokeWidthAnim&&(K=z<0?0:z),e.strokeColorAnim&&(W="rgb("+Math.round(255*V[0])+","+Math.round(255*V[1])+","+Math.round(255*V[2])+")"),e.fillColorAnim&&e.fc&&(G="rgb("+Math.round(255*H[0])+","+Math.round(255*H[1])+","+Math.round(255*H[2])+")"),this._hasMaskedPath){if(S.translate(0,-e.ls),S.translate(0,x[1]*D*.01+r,0),this._pathData.p.v){b=(l.point[1]-p.point[1])/(l.point[0]-p.point[0]);var le=180*Math.atan(b)/Math.PI;l.point[0]<p.point[0]&&(le+=180),S.rotate(-le*Math.PI/180)}S.translate(j,$,0),a-=x[0]*O[i].an*.005,O[i+1]&&X!==O[i+1].ind&&(a+=O[i].an/2,a+=.001*e.tr*e.finalSize)}else{switch(S.translate(n,r,0),e.ps&&S.translate(e.ps[0],e.ps[1]+e.ascent,0),e.j){case 1:S.translate(O[i].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[O[i].line]),0,0);break;case 2:S.translate(O[i].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[O[i].line])/2,0,0)}S.translate(0,-e.ls),S.translate(F,0,0),S.translate(x[0]*O[i].an*.005,x[1]*D*.01,0),n+=O[i].l+.001*e.tr*e.finalSize}"html"===_?ee=S.toCSS():"svg"===_?ee=S.to2dCSS():te=[S.props[0],S.props[1],S.props[2],S.props[3],S.props[4],S.props[5],S.props[6],S.props[7],S.props[8],S.props[9],S.props[10],S.props[11],S.props[12],S.props[13],S.props[14],S.props[15]],q=B}k<=i?(A=new LetterProps(q,K,W,G,ee,te),this.renderedLetters.push(A),k+=1,this.lettersChangedFlag=!0):(A=this.renderedLetters[i],this.lettersChangedFlag=A.update(q,K,W,G,ee,te)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),ITextElement.prototype.initElement=function(e,t,n){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(e,t,n),this.textProperty=new TextProperty(this,e.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(e.t,this.renderType,this),this.initTransform(e,t,n),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)},ITextElement.prototype.createPathShape=function(e,t){var n,r,i=t.length,s="";for(n=0;n<i;n+=1)"sh"===t[n].ty&&(r=t[n].ks.k,s+=buildShapeString(r,r.i.length,!0,e));return s},ITextElement.prototype.updateDocumentData=function(e,t){this.textProperty.updateDocumentData(e,t)},ITextElement.prototype.canResizeFont=function(e){this.textProperty.canResizeFont(e)},ITextElement.prototype.setMinimumFontSize=function(e){this.textProperty.setMinimumFontSize(e)},ITextElement.prototype.applyTextPropertiesToMatrix=function(e,t,n,r,i){switch(e.ps&&t.translate(e.ps[0],e.ps[1]+e.ascent,0),t.translate(0,-e.ls,0),e.j){case 1:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[n]),0,0);break;case 2:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[n])/2,0,0)}t.translate(r,i,0)},ITextElement.prototype.buildColor=function(e){return"rgb("+Math.round(255*e[0])+","+Math.round(255*e[1])+","+Math.round(255*e[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},ITextElement.prototype.validateText=function(){(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)};var emptyShapeData={shapes:[]};function SVGTextLottieElement(e,t,n){this.textSpans=[],this.renderType="svg",this.initElement(e,t,n)}function ISolidElement(e,t,n){this.initElement(e,t,n)}function NullElement(e,t,n){this.initFrame(),this.initBaseData(e,t,n),this.initFrame(),this.initTransform(e,t,n),this.initHierarchy()}function SVGRendererBase(){}function ICompElement(){}function SVGCompElement(e,t,n){this.layers=e.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,n),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function SVGRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var n="";if(t&&t.title){var r=createNS("title"),i=createElementID();r.setAttribute("id",i),r.textContent=t.title,this.svgElement.appendChild(r),n+=i}if(t&&t.description){var s=createNS("desc"),o=createElementID();s.setAttribute("id",o),s.textContent=t.description,this.svgElement.appendChild(s),n+=" "+o}n&&this.svgElement.setAttribute("aria-labelledby",n);var a=createNS("defs");this.svgElement.appendChild(a);var l=createNS("g");this.svgElement.appendChild(l),this.layerElement=l,this.renderConfig={preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",progressiveLoad:t&&t.progressiveLoad||!1,hideOnTransparent:!(t&&!1===t.hideOnTransparent),viewBoxOnly:t&&t.viewBoxOnly||!1,viewBoxSize:t&&t.viewBoxSize||!1,className:t&&t.className||"",id:t&&t.id||"",focusable:t&&t.focusable,filterSize:{width:t&&t.filterSize&&t.filterSize.width||"100%",height:t&&t.filterSize&&t.filterSize.height||"100%",x:t&&t.filterSize&&t.filterSize.x||"0%",y:t&&t.filterSize&&t.filterSize.y||"0%"},width:t&&t.width,height:t&&t.height,runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:a,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(e){for(var t=0,n=e.length,r=[],i="";t<n;)e[t]===String.fromCharCode(13)||e[t]===String.fromCharCode(3)?(r.push(i),i=""):i+=e[t],t+=1;return r.push(i),r},SVGTextLottieElement.prototype.buildShapeData=function(e,t){if(e.shapes&&e.shapes.length){var n=e.shapes[0];if(n.it){var r=n.it[n.it.length-1];r.s&&(r.s.k[0]=t,r.s.k[1]=t)}}return e},SVGTextLottieElement.prototype.buildNewText=function(){var e,t;this.addDynamicProperty(this);var n=this.textProperty.currentData;this.renderedLetters=createSizedArray(n?n.l.length:0),n.fc?this.layerElement.setAttribute("fill",this.buildColor(n.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),n.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(n.sc)),this.layerElement.setAttribute("stroke-width",n.sw)),this.layerElement.setAttribute("font-size",n.finalSize);var r=this.globalData.fontManager.getFontByName(n.f);if(r.fClass)this.layerElement.setAttribute("class",r.fClass);else{this.layerElement.setAttribute("font-family",r.fFamily);var i=n.fWeight,s=n.fStyle;this.layerElement.setAttribute("font-style",s),this.layerElement.setAttribute("font-weight",i)}this.layerElement.setAttribute("aria-label",n.t);var o,a=n.l||[],l=!!this.globalData.fontManager.chars;t=a.length;var c=this.mHelper,d=this.data.singleShape,h=0,u=0,p=!0,f=.001*n.tr*n.finalSize;if(!d||l||n.sz){var m,g=this.textSpans.length;for(e=0;e<t;e+=1){if(this.textSpans[e]||(this.textSpans[e]={span:null,childSpan:null,glyph:null}),!l||!d||0===e){if(o=g>e?this.textSpans[e].span:createNS(l?"g":"text"),g<=e){if(o.setAttribute("stroke-linecap","butt"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("stroke-miterlimit","4"),this.textSpans[e].span=o,l){var y=createNS("g");o.appendChild(y),this.textSpans[e].childSpan=y}this.textSpans[e].span=o,this.layerElement.appendChild(o)}o.style.display="inherit"}if(c.reset(),d&&(a[e].n&&(h=-f,u+=n.yOffset,u+=p?1:0,p=!1),this.applyTextPropertiesToMatrix(n,c,a[e].line,h,u),h+=a[e].l||0,h+=f),l){var v;if(1===(m=this.globalData.fontManager.getCharData(n.finalText[e],r.fStyle,this.globalData.fontManager.getFontByName(n.f).fFamily)).t)v=new SVGCompElement(m.data,this.globalData,this);else{var b=emptyShapeData;m.data&&m.data.shapes&&(b=this.buildShapeData(m.data,n.finalSize)),v=new SVGShapeElement(b,this.globalData,this)}if(this.textSpans[e].glyph){var w=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(w.layerElement),w.destroy()}this.textSpans[e].glyph=v,v._debug=!0,v.prepareFrame(0),v.renderFrame(),this.textSpans[e].childSpan.appendChild(v.layerElement),1===m.t&&this.textSpans[e].childSpan.setAttribute("transform","scale("+n.finalSize/100+","+n.finalSize/100+")")}else d&&o.setAttribute("transform","translate("+c.props[12]+","+c.props[13]+")"),o.textContent=a[e].val,o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}d&&o&&o.setAttribute("d","")}else{var x=this.textContainer,E="start";switch(n.j){case 1:E="end";break;case 2:E="middle";break;default:E="start"}x.setAttribute("text-anchor",E),x.setAttribute("letter-spacing",f);var C=this.buildTextContents(n.finalText);for(t=C.length,u=n.ps?n.ps[1]+n.ascent:0,e=0;e<t;e+=1)(o=this.textSpans[e].span||createNS("tspan")).textContent=C[e],o.setAttribute("x",0),o.setAttribute("y",u),o.style.display="inherit",x.appendChild(o),this.textSpans[e]||(this.textSpans[e]={span:null,glyph:null}),this.textSpans[e].span=o,u+=n.finalLineHeight;this.layerElement.appendChild(x)}for(;e<this.textSpans.length;)this.textSpans[e].span.style.display="none",e+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},SVGTextLottieElement.prototype.getValue=function(){var e,t,n=this.textSpans.length;for(this.renderedFrame=this.comp.renderedFrame,e=0;e<n;e+=1)(t=this.textSpans[e].glyph)&&(t.prepareFrame(this.comp.renderedFrame-this.data.st),t._mdf&&(this._mdf=!0))},SVGTextLottieElement.prototype.renderInnerContent=function(){if(this.validateText(),(!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var e,t;this._sizeChanged=!0;var n,r,i,s=this.textAnimator.renderedLetters,o=this.textProperty.currentData.l;for(t=o.length,e=0;e<t;e+=1)o[e].n||(n=s[e],r=this.textSpans[e].span,(i=this.textSpans[e].glyph)&&i.renderFrame(),n._mdf.m&&r.setAttribute("transform",n.m),n._mdf.o&&r.setAttribute("opacity",n.o),n._mdf.sw&&r.setAttribute("stroke-width",n.sw),n._mdf.sc&&r.setAttribute("stroke",n.sc),n._mdf.fc&&r.setAttribute("fill",n.fc))}},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var e=createNS("rect");e.setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.layerElement.appendChild(e)},NullElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),extendPrototype([BaseRenderer],SVGRendererBase),SVGRendererBase.prototype.createNull=function(e){return new NullElement(e,this.globalData,this)},SVGRendererBase.prototype.createShape=function(e){return new SVGShapeElement(e,this.globalData,this)},SVGRendererBase.prototype.createText=function(e){return new SVGTextLottieElement(e,this.globalData,this)},SVGRendererBase.prototype.createImage=function(e){return new IImageElement(e,this.globalData,this)},SVGRendererBase.prototype.createSolid=function(e){return new ISolidElement(e,this.globalData,this)},SVGRendererBase.prototype.configAnimation=function(e){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+e.w+" "+e.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",e.w),this.svgElement.setAttribute("height",e.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var t=this.globalData.defs;this.setupGlobalData(e,t),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=e;var n=createNS("clipPath"),r=createNS("rect");r.setAttribute("width",e.w),r.setAttribute("height",e.h),r.setAttribute("x",0),r.setAttribute("y",0);var i=createElementID();n.setAttribute("id",i),n.appendChild(r),this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")"),t.appendChild(n),this.layers=e.layers,this.elements=createSizedArray(e.layers.length)},SVGRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRendererBase.prototype.updateContainerSize=function(){},SVGRendererBase.prototype.findIndexByInd=function(e){var t=0,n=this.layers.length;for(t=0;t<n;t+=1)if(this.layers[t].ind===e)return t;return-1},SVGRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){t[e]=!0;var n=this.createItem(this.layers[e]);if(t[e]=n,getExpressionsPlugin()&&(0===this.layers[e].ty&&this.globalData.projectInterface.registerComposition(n),n.initExpressions()),this.appendElementInPos(n,e),this.layers[e].tt){var r="tp"in this.layers[e]?this.findIndexByInd(this.layers[e].tp):e-1;if(-1===r)return;if(this.elements[r]&&!0!==this.elements[r]){var i=t[r].getMatte(this.layers[e].tt);n.setMatte(i)}else this.buildItem(r),this.addPendingElement(n)}}},SVGRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var e=this.pendingElements.pop();if(e.checkParenting(),e.data.tt)for(var t=0,n=this.elements.length;t<n;){if(this.elements[t]===e){var r="tp"in e.data?this.findIndexByInd(e.data.tp):t-1,i=this.elements[r].getMatte(this.layers[t].tt);e.setMatte(i);break}t+=1}}},SVGRendererBase.prototype.renderFrame=function(e){if(this.renderedFrame!==e&&!this.destroyed){var t;null===e?e=this.renderedFrame:this.renderedFrame=e,this.globalData.frameNum=e,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=e,this.globalData._mdf=!1;var n=this.layers.length;for(this.completeLayers||this.checkLayers(e),t=n-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t<n;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(e,t){var n=e.getBaseElement();if(n){for(var r,i=0;i<t;)this.elements[i]&&!0!==this.elements[i]&&this.elements[i].getBaseElement()&&(r=this.elements[i].getBaseElement()),i+=1;r?this.layerElement.insertBefore(n,r):this.layerElement.appendChild(n)}},SVGRendererBase.prototype.hide=function(){this.layerElement.style.display="none"},SVGRendererBase.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(e,t,n){this.initFrame(),this.initBaseData(e,t,n),this.initTransform(e,t,n),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&t.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(e){if(this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=e/this.data.sr;else{var t=this.tm.v;t===this.data.op&&(t=this.data.op-1),this.renderedFrame=t}var n,r=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),n=r-1;n>=0;n-=1)(this.completeLayers||this.elements[n])&&(this.elements[n].prepareFrame(this.renderedFrame-this.layers[n].st),this.elements[n]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},ICompElement.prototype.setElements=function(e){this.elements=e},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([SVGRendererBase,ICompElement,SVGBaseElement],SVGCompElement),SVGCompElement.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},extendPrototype([SVGRendererBase],SVGRenderer),SVGRenderer.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},ShapeTransformManager.prototype={addTransformSequence:function(e){var t,n=e.length,r="_";for(t=0;t<n;t+=1)r+=e[t].transform.key+"_";var i=this.sequences[r];return i||(i={transforms:[].concat(e),finalTransform:new Matrix,_mdf:!1},this.sequences[r]=i,this.sequenceList.push(i)),i},processSequence:function(e,t){for(var n=0,r=e.transforms.length,i=t;n<r&&!t;){if(e.transforms[n].transform.mProps._mdf){i=!0;break}n+=1}if(i)for(e.finalTransform.reset(),n=r-1;n>=0;n-=1)e.finalTransform.multiply(e.transforms[n].transform.mProps.v);e._mdf=i},processSequences:function(e){var t,n=this.sequenceList.length;for(t=0;t<n;t+=1)this.processSequence(this.sequenceList[t],e)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}};var lumaLoader=function(){var e="__lottie_element_luma_buffer",t=null,n=null,r=null;function i(){var i,s,o;t||(i=createNS("svg"),s=createNS("filter"),o=createNS("feColorMatrix"),s.setAttribute("id",e),o.setAttribute("type","matrix"),o.setAttribute("color-interpolation-filters","sRGB"),o.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),s.appendChild(o),i.appendChild(s),i.setAttribute("id",e+"_svg"),featureSupport.svgLumaHidden&&(i.style.display="none"),r=i,document.body.appendChild(r),t=createTag("canvas"),(n=t.getContext("2d")).filter="url(#"+e+")",n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1))}return{load:i,get:function(r){return t||i(),t.width=r.width,t.height=r.height,n.filter="url(#"+e+")",t}}};function createCanvas(e,t){if(featureSupport.offscreenCanvas)return new OffscreenCanvas(e,t);var n=createTag("canvas");return n.width=e,n.height=t,n}var assetLoader={loadLumaCanvas:lumaLoader.load,getLumaCanvas:lumaLoader.get,createCanvas},registeredEffects={};function CVEffects(e){var t,n,r=e.data.ef?e.data.ef.length:0;for(this.filters=[],t=0;t<r;t+=1){n=null;var i=e.data.ef[t].ty;registeredEffects[i]&&(n=new(0,registeredEffects[i].effect)(e.effectsManager.effectElements[t],e)),n&&this.filters.push(n)}this.filters.length&&e.addRenderableComponent(this)}function registerEffect(e,t){registeredEffects[e]={effect:t}}function CVMaskElement(e,t){var n;this.data=e,this.element=t,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var r=this.masksProperties.length,i=!1;for(n=0;n<r;n+=1)"n"!==this.masksProperties[n].mode&&(i=!0),this.viewData[n]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[n],3);this.hasMasks=i,i&&this.element.addRenderableComponent(this)}function CVBaseElement(){}CVEffects.prototype.renderFrame=function(e){var t,n=this.filters.length;for(t=0;t<n;t+=1)this.filters[t].renderFrame(e)},CVEffects.prototype.getEffects=function(e){var t,n=this.filters.length,r=[];for(t=0;t<n;t+=1)this.filters[t].type===e&&r.push(this.filters[t]);return r},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var e,t,n,r,i=this.element.finalTransform.mat,s=this.element.canvasContext,o=this.masksProperties.length;for(s.beginPath(),e=0;e<o;e+=1)if("n"!==this.masksProperties[e].mode){var a;this.masksProperties[e].inv&&(s.moveTo(0,0),s.lineTo(this.element.globalData.compSize.w,0),s.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),s.lineTo(0,this.element.globalData.compSize.h),s.lineTo(0,0)),r=this.viewData[e].v,t=i.applyToPointArray(r.v[0][0],r.v[0][1],0),s.moveTo(t[0],t[1]);var l=r._length;for(a=1;a<l;a+=1)n=i.applyToTriplePoints(r.o[a-1],r.i[a],r.v[a]),s.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]);n=i.applyToTriplePoints(r.o[a-1],r.i[0],r.v[0]),s.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}this.element.globalData.renderer.save(!0),s.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null};var operationsMap={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};function CVShapeData(e,t,n,r){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i,s=4;"rc"===t.ty?s=5:"el"===t.ty?s=6:"sr"===t.ty&&(s=7),this.sh=ShapePropertyFactory.getShapeProp(e,t,s,e);var o,a=n.length;for(i=0;i<a;i+=1)n[i].closed||(o={transforms:r.addTransformSequence(n[i].transforms),trNodes:[]},this.styledShapes.push(o),n[i].elements.push(o))}function CVShapeElement(e,t,n){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(e,t,n)}function CVTextElement(e,t,n){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(e,t,n)}function CVImageElement(e,t,n){this.assetData=t.getAssetData(e.refId),this.img=t.imageLoader.getAsset(this.assetData),this.initElement(e,t,n)}function CVSolidElement(e,t,n){this.initElement(e,t,n)}function CanvasRendererBase(){}function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){var e;for(this.stack=[],this.cArrPos=0,this.cTr=new Matrix,e=0;e<15;e+=1){var t=new CanvasContext;this.stack[e]=t}this._length=15,this.nativeContext=null,this.transformMat=new Matrix,this.currentOpacity=1,this.currentFillStyle="",this.appliedFillStyle="",this.currentStrokeStyle="",this.appliedStrokeStyle="",this.currentLineWidth="",this.appliedLineWidth="",this.currentLineCap="",this.appliedLineCap="",this.currentLineJoin="",this.appliedLineJoin="",this.appliedMiterLimit="",this.currentMiterLimit=""}function CVCompElement(e,t,n){this.completeLayers=!1,this.layers=e.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(e,t,n),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function CanvasRenderer(e,t){this.animationItem=e,this.renderConfig={clearCanvas:!t||void 0===t.clearCanvas||t.clearCanvas,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",className:t&&t.className||"",id:t&&t.id||"",runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}function HBaseElement(){}function HSolidElement(e,t,n){this.initElement(e,t,n)}function HShapeElement(e,t,n){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(e,t,n),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(e,t,n){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(e,t,n)}function HCameraElement(e,t,n){this.initFrame(),this.initBaseData(e,t,n),this.initHierarchy();var r=PropertyFactory.getProp;if(this.pe=r(this,e.pe,0,0,this),e.ks.p.s?(this.px=r(this,e.ks.p.x,1,0,this),this.py=r(this,e.ks.p.y,1,0,this),this.pz=r(this,e.ks.p.z,1,0,this)):this.p=r(this,e.ks.p,1,0,this),e.ks.a&&(this.a=r(this,e.ks.a,1,0,this)),e.ks.or.k.length&&e.ks.or.k[0].to){var i,s=e.ks.or.k.length;for(i=0;i<s;i+=1)e.ks.or.k[i].to=null,e.ks.or.k[i].ti=null}this.or=r(this,e.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=r(this,e.ks.rx,0,degToRads,this),this.ry=r(this,e.ks.ry,0,degToRads,this),this.rz=r(this,e.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HImageElement(e,t,n){this.assetData=t.getAssetData(e.refId),this.initElement(e,t,n)}function HybridRendererBase(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:t&&t.className||"",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(t&&!1===t.hideOnTransparent),filterSize:{width:t&&t.filterSize&&t.filterSize.width||"400%",height:t&&t.filterSize&&t.filterSize.height||"400%",x:t&&t.filterSize&&t.filterSize.x||"-100%",y:t&&t.filterSize&&t.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function HCompElement(e,t,n){this.layers=e.layers,this.supports3d=!e.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,n),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function HybridRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:t&&t.className||"",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(t&&!1===t.hideOnTransparent),filterSize:{width:t&&t.filterSize&&t.filterSize.width||"400%",height:t&&t.filterSize&&t.filterSize.height||"400%",x:t&&t.filterSize&&t.filterSize.x||"-100%",y:t&&t.filterSize&&t.filterSize.y||"-100%"},runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){if(this.data.tt>=1){this.buffers=[];var e=this.globalData.canvasContext,t=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var n=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(n),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=getBlendMode(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0].getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext("2d");if(this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var n=assetLoader.getLumaCanvas(this.canvasContext.canvas);n.getContext("2d").drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(n,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(e){if(!this.hidden&&!this.data.hd&&(1!==this.data.td||e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var t=0===this.data.ty;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(e,t){var n={data:e,type:e.ty,preTransforms:this.transformsManager.addTransformSequence(t),transforms:[],elements:[],closed:!0===e.hd},r={};if("fl"===e.ty||"st"===e.ty?(r.c=PropertyFactory.getProp(this,e.c,1,255,this),r.c.k||(n.co="rgb("+bmFloor(r.c.v[0])+","+bmFloor(r.c.v[1])+","+bmFloor(r.c.v[2])+")")):"gf"!==e.ty&&"gs"!==e.ty||(r.s=PropertyFactory.getProp(this,e.s,1,null,this),r.e=PropertyFactory.getProp(this,e.e,1,null,this),r.h=PropertyFactory.getProp(this,e.h||{k:0},0,.01,this),r.a=PropertyFactory.getProp(this,e.a||{k:0},0,degToRads,this),r.g=new GradientProperty(this,e.g,this)),r.o=PropertyFactory.getProp(this,e.o,0,.01,this),"st"===e.ty||"gs"===e.ty){if(n.lc=lineCapEnum[e.lc||2],n.lj=lineJoinEnum[e.lj||2],1==e.lj&&(n.ml=e.ml),r.w=PropertyFactory.getProp(this,e.w,0,null,this),r.w.k||(n.wi=r.w.v),e.d){var i=new DashProperty(this,e.d,"canvas",this);r.d=i,r.d.k||(n.da=r.d.dashArray,n.do=r.d.dashoffset[0])}}else n.r=2===e.r?"evenodd":"nonzero";return this.stylesList.push(n),r.style=n,r},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(e){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,e.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,e,this)}}},CVShapeElement.prototype.createShapeElement=function(e){var t=new CVShapeData(this,e,this.stylesList,this.transformsManager);return this.shapes.push(t),this.addShapeToModifiers(t),t},CVShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(e){var t,n=this.stylesList.length;for(t=0;t<n;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.push(e)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var e,t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.pop()},CVShapeElement.prototype.closeStyles=function(e){var t,n=e.length;for(t=0;t<n;t+=1)e[t].closed=!0},CVShapeElement.prototype.searchShapes=function(e,t,n,r,i){var s,o,a,l,c,d,h=e.length-1,u=[],p=[],f=[].concat(i);for(s=h;s>=0;s-=1){if((l=this.searchProcessedElement(e[s]))?t[s]=n[l-1]:e[s]._shouldRender=r,"fl"===e[s].ty||"st"===e[s].ty||"gf"===e[s].ty||"gs"===e[s].ty)l?t[s].style.closed=!1:t[s]=this.createStyleElement(e[s],f),u.push(t[s].style);else if("gr"===e[s].ty){if(l)for(a=t[s].it.length,o=0;o<a;o+=1)t[s].prevViewData[o]=t[s].it[o];else t[s]=this.createGroupElement(e[s]);this.searchShapes(e[s].it,t[s].it,t[s].prevViewData,r,f)}else"tr"===e[s].ty?(l||(d=this.createTransformElement(e[s]),t[s]=d),f.push(t[s]),this.addTransformToStyleList(t[s])):"sh"===e[s].ty||"rc"===e[s].ty||"el"===e[s].ty||"sr"===e[s].ty?l||(t[s]=this.createShapeElement(e[s])):"tm"===e[s].ty||"rd"===e[s].ty||"pb"===e[s].ty||"zz"===e[s].ty||"op"===e[s].ty?(l?(c=t[s]).closed=!1:((c=ShapeModifiers.getModifier(e[s].ty)).init(this,e[s]),t[s]=c,this.shapeModifiers.push(c)),p.push(c)):"rp"===e[s].ty&&(l?(c=t[s]).closed=!0:(c=ShapeModifiers.getModifier(e[s].ty),t[s]=c,c.init(this,e,s,t),this.shapeModifiers.push(c),r=!1),p.push(c));this.addProcessedElement(e[s],s+1)}for(this.removeTransformFromStyleList(),this.closeStyles(u),h=p.length,s=0;s<h;s+=1)p[s].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(e,t){(e._opMdf||t.op._mdf||this._isFirstFrame)&&(t.opacity=e.opacity,t.opacity*=t.op.v,t._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var e,t,n,r,i,s,o,a,l,c=this.stylesList.length,d=this.globalData.renderer,h=this.globalData.canvasContext;for(e=0;e<c;e+=1)if(("st"!==(a=(l=this.stylesList[e]).type)&&"gs"!==a||0!==l.wi)&&l.data._shouldRender&&0!==l.coOp&&0!==this.globalData.currentGlobalAlpha){for(d.save(),s=l.elements,"st"===a||"gs"===a?(d.ctxStrokeStyle("st"===a?l.co:l.grd),d.ctxLineWidth(l.wi),d.ctxLineCap(l.lc),d.ctxLineJoin(l.lj),d.ctxMiterLimit(l.ml||0)):d.ctxFillStyle("fl"===a?l.co:l.grd),d.ctxOpacity(l.coOp),"st"!==a&&"gs"!==a&&h.beginPath(),d.ctxTransform(l.preTransforms.finalTransform.props),n=s.length,t=0;t<n;t+=1){for("st"!==a&&"gs"!==a||(h.beginPath(),l.da&&(h.setLineDash(l.da),h.lineDashOffset=l.do)),i=(o=s[t].trNodes).length,r=0;r<i;r+=1)"m"===o[r].t?h.moveTo(o[r].p[0],o[r].p[1]):"c"===o[r].t?h.bezierCurveTo(o[r].pts[0],o[r].pts[1],o[r].pts[2],o[r].pts[3],o[r].pts[4],o[r].pts[5]):h.closePath();"st"!==a&&"gs"!==a||(d.ctxStroke(),l.da&&h.setLineDash(this.dashResetter))}"st"!==a&&"gs"!==a&&this.globalData.renderer.ctxFill(l.r),d.restore()}},CVShapeElement.prototype.renderShape=function(e,t,n,r){var i,s;for(s=e,i=t.length-1;i>=0;i-=1)"tr"===t[i].ty?(s=n[i].transform,this.renderShapeTransform(e,s)):"sh"===t[i].ty||"el"===t[i].ty||"rc"===t[i].ty||"sr"===t[i].ty?this.renderPath(t[i],n[i]):"fl"===t[i].ty?this.renderFill(t[i],n[i],s):"st"===t[i].ty?this.renderStroke(t[i],n[i],s):"gf"===t[i].ty||"gs"===t[i].ty?this.renderGradientFill(t[i],n[i],s):"gr"===t[i].ty?this.renderShape(s,t[i].it,n[i].it):t[i].ty;r&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var n,r,i,s=e.trNodes,o=t.paths,a=o._length;s.length=0;var l=e.transforms.finalTransform;for(i=0;i<a;i+=1){var c=o.shapes[i];if(c&&c.v){for(r=c._length,n=1;n<r;n+=1)1===n&&s.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),s.push({t:"c",pts:l.applyToTriplePoints(c.o[n-1],c.i[n],c.v[n])});1===r&&s.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),c.c&&r&&(s.push({t:"c",pts:l.applyToTriplePoints(c.o[n-1],c.i[0],c.v[0])}),s.push({t:"z"}))}}e.trNodes=s}},CVShapeElement.prototype.renderPath=function(e,t){if(!0!==e.hd&&e._shouldRender){var n,r=t.styledShapes.length;for(n=0;n<r;n+=1)this.renderStyledShape(t.styledShapes[n],t.sh)}},CVShapeElement.prototype.renderFill=function(e,t,n){var r=t.style;(t.c._mdf||this._isFirstFrame)&&(r.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||n._opMdf||this._isFirstFrame)&&(r.coOp=t.o.v*n.opacity)},CVShapeElement.prototype.renderGradientFill=function(e,t,n){var r,i=t.style;if(!i.grd||t.g._mdf||t.s._mdf||t.e._mdf||1!==e.t&&(t.h._mdf||t.a._mdf)){var s,o=this.globalData.canvasContext,a=t.s.v,l=t.e.v;if(1===e.t)r=o.createLinearGradient(a[0],a[1],l[0],l[1]);else{var c=Math.sqrt(Math.pow(a[0]-l[0],2)+Math.pow(a[1]-l[1],2)),d=Math.atan2(l[1]-a[1],l[0]-a[0]),h=t.h.v;h>=1?h=.99:h<=-1&&(h=-.99);var u=c*h,p=Math.cos(d+t.a.v)*u+a[0],f=Math.sin(d+t.a.v)*u+a[1];r=o.createRadialGradient(p,f,0,a[0],a[1],c)}var m=e.g.p,g=t.g.c,y=1;for(s=0;s<m;s+=1)t.g._hasOpacity&&t.g._collapsable&&(y=t.g.o[2*s+1]),r.addColorStop(g[4*s]/100,"rgba("+g[4*s+1]+","+g[4*s+2]+","+g[4*s+3]+","+y+")");i.grd=r}i.coOp=t.o.v*n.opacity},CVShapeElement.prototype.renderStroke=function(e,t,n){var r=t.style,i=t.d;i&&(i._mdf||this._isFirstFrame)&&(r.da=i.dashArray,r.do=i.dashoffset[0]),(t.c._mdf||this._isFirstFrame)&&(r.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||n._opMdf||this._isFirstFrame)&&(r.coOp=t.o.v*n.opacity),(t.w._mdf||this._isFirstFrame)&&(r.wi=t.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=!1;e.fc?(t=!0,this.values.fill=this.buildColor(e.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=t;var n=!1;e.sc&&(n=!0,this.values.stroke=this.buildColor(e.sc),this.values.sWidth=e.sw);var r,i,s,o,a,l,c,d,h,u,p,f,m=this.globalData.fontManager.getFontByName(e.f),g=e.l,y=this.mHelper;this.stroke=n,this.values.fValue=e.finalSize+"px "+this.globalData.fontManager.getFontByName(e.f).fFamily,i=e.finalText.length;var v=this.data.singleShape,b=.001*e.tr*e.finalSize,w=0,x=0,E=!0,C=0;for(r=0;r<i;r+=1){o=(s=this.globalData.fontManager.getCharData(e.finalText[r],m.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily))&&s.data||{},y.reset(),v&&g[r].n&&(w=-b,x+=e.yOffset,x+=E?1:0,E=!1),h=(c=o.shapes?o.shapes[0].it:[]).length,y.scale(e.finalSize/100,e.finalSize/100),v&&this.applyTextPropertiesToMatrix(e,y,g[r].line,w,x),p=createSizedArray(h-1);var S=0;for(d=0;d<h;d+=1)if("sh"===c[d].ty){for(l=c[d].ks.k.i.length,u=c[d].ks.k,f=[],a=1;a<l;a+=1)1===a&&f.push(y.applyToX(u.v[0][0],u.v[0][1],0),y.applyToY(u.v[0][0],u.v[0][1],0)),f.push(y.applyToX(u.o[a-1][0],u.o[a-1][1],0),y.applyToY(u.o[a-1][0],u.o[a-1][1],0),y.applyToX(u.i[a][0],u.i[a][1],0),y.applyToY(u.i[a][0],u.i[a][1],0),y.applyToX(u.v[a][0],u.v[a][1],0),y.applyToY(u.v[a][0],u.v[a][1],0));f.push(y.applyToX(u.o[a-1][0],u.o[a-1][1],0),y.applyToY(u.o[a-1][0],u.o[a-1][1],0),y.applyToX(u.i[0][0],u.i[0][1],0),y.applyToY(u.i[0][0],u.i[0][1],0),y.applyToX(u.v[0][0],u.v[0][1],0),y.applyToY(u.v[0][0],u.v[0][1],0)),p[S]=f,S+=1}v&&(w+=g[r].l,w+=b),this.textSpans[C]?this.textSpans[C].elem=p:this.textSpans[C]={elem:p},C+=1}},CVTextElement.prototype.renderInnerContent=function(){var e,t,n,r,i,s;this.validateText(),this.canvasContext.font=this.values.fValue,this.globalData.renderer.ctxLineCap("butt"),this.globalData.renderer.ctxLineJoin("miter"),this.globalData.renderer.ctxMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var o,a=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;t=l.length;var c,d,h=null,u=null,p=null,f=this.globalData.renderer;for(e=0;e<t;e+=1)if(!l[e].n){if((o=a[e])&&(f.save(),f.ctxTransform(o.p),f.ctxOpacity(o.o)),this.fill){for(o&&o.fc?h!==o.fc&&(f.ctxFillStyle(o.fc),h=o.fc):h!==this.values.fill&&(h=this.values.fill,f.ctxFillStyle(this.values.fill)),r=(c=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),n=0;n<r;n+=1)for(s=(d=c[n]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),i=2;i<s;i+=6)this.globalData.canvasContext.bezierCurveTo(d[i],d[i+1],d[i+2],d[i+3],d[i+4],d[i+5]);this.globalData.canvasContext.closePath(),f.ctxFill()}if(this.stroke){for(o&&o.sw?p!==o.sw&&(p=o.sw,f.ctxLineWidth(o.sw)):p!==this.values.sWidth&&(p=this.values.sWidth,f.ctxLineWidth(this.values.sWidth)),o&&o.sc?u!==o.sc&&(u=o.sc,f.ctxStrokeStyle(o.sc)):u!==this.values.stroke&&(u=this.values.stroke,f.ctxStrokeStyle(this.values.stroke)),r=(c=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),n=0;n<r;n+=1)for(s=(d=c[n]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),i=2;i<s;i+=6)this.globalData.canvasContext.bezierCurveTo(d[i],d[i+1],d[i+2],d[i+3],d[i+4],d[i+5]);this.globalData.canvasContext.closePath(),f.ctxStroke()}o&&this.globalData.renderer.restore()}},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var e=createTag("canvas");e.width=this.assetData.w,e.height=this.assetData.h;var t,n,r=e.getContext("2d"),i=this.img.width,s=this.img.height,o=i/s,a=this.assetData.w/this.assetData.h,l=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;o>a&&"xMidYMid slice"===l||o<a&&"xMidYMid slice"!==l?t=(n=s)*a:n=(t=i)/a,r.drawImage(this.img,(i-t)/2,(s-n)/2,t,n,0,0,this.assetData.w,this.assetData.h),this.img=e}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){this.globalData.renderer.ctxFillStyle(this.data.sc),this.globalData.renderer.ctxFillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseRenderer],CanvasRendererBase),CanvasRendererBase.prototype.createShape=function(e){return new CVShapeElement(e,this.globalData,this)},CanvasRendererBase.prototype.createText=function(e){return new CVTextElement(e,this.globalData,this)},CanvasRendererBase.prototype.createImage=function(e){return new CVImageElement(e,this.globalData,this)},CanvasRendererBase.prototype.createSolid=function(e){return new CVSolidElement(e,this.globalData,this)},CanvasRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRendererBase.prototype.ctxTransform=function(e){1===e[0]&&0===e[1]&&0===e[4]&&1===e[5]&&0===e[12]&&0===e[13]||this.canvasContext.transform(e[0],e[1],e[4],e[5],e[12],e[13])},CanvasRendererBase.prototype.ctxOpacity=function(e){this.canvasContext.globalAlpha*=e<0?0:e},CanvasRendererBase.prototype.ctxFillStyle=function(e){this.canvasContext.fillStyle=e},CanvasRendererBase.prototype.ctxStrokeStyle=function(e){this.canvasContext.strokeStyle=e},CanvasRendererBase.prototype.ctxLineWidth=function(e){this.canvasContext.lineWidth=e},CanvasRendererBase.prototype.ctxLineCap=function(e){this.canvasContext.lineCap=e},CanvasRendererBase.prototype.ctxLineJoin=function(e){this.canvasContext.lineJoin=e},CanvasRendererBase.prototype.ctxMiterLimit=function(e){this.canvasContext.miterLimit=e},CanvasRendererBase.prototype.ctxFill=function(e){this.canvasContext.fill(e)},CanvasRendererBase.prototype.ctxFillRect=function(e,t,n,r){this.canvasContext.fillRect(e,t,n,r)},CanvasRendererBase.prototype.ctxStroke=function(){this.canvasContext.stroke()},CanvasRendererBase.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRendererBase.prototype.save=function(){this.canvasContext.save()},CanvasRendererBase.prototype.restore=function(e){this.renderConfig.clearCanvas?(e&&(this.globalData.blendMode="source-over"),this.contextData.restore(e)):this.canvasContext.restore()},CanvasRendererBase.prototype.configAnimation=function(e){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var t=this.animationItem.container.style;t.width="100%",t.height="100%";var n="0px 0px 0px";t.transformOrigin=n,t.mozTransformOrigin=n,t.webkitTransformOrigin=n,t["-webkit-transform"]=n,t.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.contextData.setContext(this.canvasContext),this.data=e,this.layers=e.layers,this.transformCanvas={w:e.w,h:e.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(e,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(e.layers.length),this.updateContainerSize()},CanvasRendererBase.prototype.updateContainerSize=function(e,t){var n,r,i,s;if(this.reset(),e?(n=e,r=t,this.canvasContext.canvas.width=n,this.canvasContext.canvas.height=r):(this.animationItem.wrapper&&this.animationItem.container?(n=this.animationItem.wrapper.offsetWidth,r=this.animationItem.wrapper.offsetHeight):(n=this.canvasContext.canvas.width,r=this.canvasContext.canvas.height),this.canvasContext.canvas.width=n*this.renderConfig.dpr,this.canvasContext.canvas.height=r*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var o=this.renderConfig.preserveAspectRatio.split(" "),a=o[1]||"meet",l=o[0]||"xMidYMid",c=l.substr(0,4),d=l.substr(4);i=n/r,(s=this.transformCanvas.w/this.transformCanvas.h)>i&&"meet"===a||s<i&&"slice"===a?(this.transformCanvas.sx=n/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=r/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=r/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===c&&(s<i&&"meet"===a||s>i&&"slice"===a)?(n-this.transformCanvas.w*(r/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===c&&(s<i&&"meet"===a||s>i&&"slice"===a)?(n-this.transformCanvas.w*(r/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===d&&(s>i&&"meet"===a||s<i&&"slice"===a)?(r-this.transformCanvas.h*(n/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===d&&(s>i&&"meet"===a||s<i&&"slice"===a)?(r-this.transformCanvas.h*(n/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=n/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=r/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRendererBase.prototype.destroy=function(){var e;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),e=(this.layers?this.layers.length:0)-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(e,t){if((this.renderedFrame!==e||!0!==this.renderConfig.clearCanvas||t)&&!this.destroyed&&-1!==e){var n;this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var r=this.layers.length;for(this.completeLayers||this.checkLayers(e),n=r-1;n>=0;n-=1)(this.completeLayers||this.elements[n])&&this.elements[n].prepareFrame(e-this.layers[n].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),n=r-1;n>=0;n-=1)(this.completeLayers||this.elements[n])&&this.elements[n].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){var n=this.createItem(this.layers[e],this,this.globalData);t[e]=n,n.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"},CVContextData.prototype.duplicate=function(){var e=2*this._length,t=0;for(t=this._length;t<e;t+=1)this.stack[t]=new CanvasContext;this._length=e},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.stack[this.cArrPos].opacity=1},CVContextData.prototype.restore=function(e){this.cArrPos-=1;var t,n=this.stack[this.cArrPos],r=n.transform,i=this.cTr.props;for(t=0;t<16;t+=1)i[t]=r[t];if(e){this.nativeContext.restore();var s=this.stack[this.cArrPos+1];this.appliedFillStyle=s.fillStyle,this.appliedStrokeStyle=s.strokeStyle,this.appliedLineWidth=s.lineWidth,this.appliedLineCap=s.lineCap,this.appliedLineJoin=s.lineJoin,this.appliedMiterLimit=s.miterLimit}this.nativeContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13]),(e||-1!==n.opacity&&this.currentOpacity!==n.opacity)&&(this.nativeContext.globalAlpha=n.opacity,this.currentOpacity=n.opacity),this.currentFillStyle=n.fillStyle,this.currentStrokeStyle=n.strokeStyle,this.currentLineWidth=n.lineWidth,this.currentLineCap=n.lineCap,this.currentLineJoin=n.lineJoin,this.currentMiterLimit=n.miterLimit},CVContextData.prototype.save=function(e){e&&this.nativeContext.save();var t=this.cTr.props;this._length<=this.cArrPos&&this.duplicate();var n,r=this.stack[this.cArrPos];for(n=0;n<16;n+=1)r.transform[n]=t[n];this.cArrPos+=1;var i=this.stack[this.cArrPos];i.opacity=r.opacity,i.fillStyle=r.fillStyle,i.strokeStyle=r.strokeStyle,i.lineWidth=r.lineWidth,i.lineCap=r.lineCap,i.lineJoin=r.lineJoin,i.miterLimit=r.miterLimit},CVContextData.prototype.setOpacity=function(e){this.stack[this.cArrPos].opacity=e},CVContextData.prototype.setContext=function(e){this.nativeContext=e},CVContextData.prototype.fillStyle=function(e){this.stack[this.cArrPos].fillStyle!==e&&(this.currentFillStyle=e,this.stack[this.cArrPos].fillStyle=e)},CVContextData.prototype.strokeStyle=function(e){this.stack[this.cArrPos].strokeStyle!==e&&(this.currentStrokeStyle=e,this.stack[this.cArrPos].strokeStyle=e)},CVContextData.prototype.lineWidth=function(e){this.stack[this.cArrPos].lineWidth!==e&&(this.currentLineWidth=e,this.stack[this.cArrPos].lineWidth=e)},CVContextData.prototype.lineCap=function(e){this.stack[this.cArrPos].lineCap!==e&&(this.currentLineCap=e,this.stack[this.cArrPos].lineCap=e)},CVContextData.prototype.lineJoin=function(e){this.stack[this.cArrPos].lineJoin!==e&&(this.currentLineJoin=e,this.stack[this.cArrPos].lineJoin=e)},CVContextData.prototype.miterLimit=function(e){this.stack[this.cArrPos].miterLimit!==e&&(this.currentMiterLimit=e,this.stack[this.cArrPos].miterLimit=e)},CVContextData.prototype.transform=function(e){this.transformMat.cloneFromProps(e);var t=this.cTr;this.transformMat.multiply(t),t.cloneFromProps(this.transformMat.props);var n=t.props;this.nativeContext.setTransform(n[0],n[1],n[4],n[5],n[12],n[13])},CVContextData.prototype.opacity=function(e){var t=this.stack[this.cArrPos].opacity;t*=e<0?0:e,this.stack[this.cArrPos].opacity!==t&&(this.currentOpacity!==e&&(this.nativeContext.globalAlpha=e,this.currentOpacity=e),this.stack[this.cArrPos].opacity=t)},CVContextData.prototype.fill=function(e){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fill(e)},CVContextData.prototype.fillRect=function(e,t,n,r){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fillRect(e,t,n,r)},CVContextData.prototype.stroke=function(){this.appliedStrokeStyle!==this.currentStrokeStyle&&(this.appliedStrokeStyle=this.currentStrokeStyle,this.nativeContext.strokeStyle=this.appliedStrokeStyle),this.appliedLineWidth!==this.currentLineWidth&&(this.appliedLineWidth=this.currentLineWidth,this.nativeContext.lineWidth=this.appliedLineWidth),this.appliedLineCap!==this.currentLineCap&&(this.appliedLineCap=this.currentLineCap,this.nativeContext.lineCap=this.appliedLineCap),this.appliedLineJoin!==this.currentLineJoin&&(this.appliedLineJoin=this.currentLineJoin,this.nativeContext.lineJoin=this.appliedLineJoin),this.appliedMiterLimit!==this.currentMiterLimit&&(this.appliedMiterLimit=this.currentMiterLimit,this.nativeContext.miterLimit=this.appliedMiterLimit),this.nativeContext.stroke()},extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var e,t=this.canvasContext;for(t.beginPath(),t.moveTo(0,0),t.lineTo(this.data.w,0),t.lineTo(this.data.w,this.data.h),t.lineTo(0,this.data.h),t.lineTo(0,0),t.clip(),e=this.layers.length-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},CVCompElement.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){var e=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var t=this.finalTransform.mat.toCSS();e.transform=t,e.webkitTransform=t}this.finalTransform._opMdf&&(e.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var e;this.data.hasMask?((e=createNS("rect")).setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((e=createTag("div")).style.width=this.data.sw+"px",e.style.height=this.data.sh+"px",e.style.backgroundColor=this.data.sc),this.layerElement.appendChild(e)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var e;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),e=this.svgElement;else{e=createNS("svg");var t=this.comp.data?this.comp.data:this.globalData.compSize;e.setAttribute("width",t.w),e.setAttribute("height",t.h),e.appendChild(this.shapesContainer),this.layerElement.appendChild(e)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=e},HShapeElement.prototype.getTransformedPoint=function(e,t){var n,r=e.length;for(n=0;n<r;n+=1)t=e[n].mProps.v.applyToPointArray(t[0],t[1],0);return t},HShapeElement.prototype.calculateShapeBoundingBox=function(e,t){var n,r,i,s,o,a=e.sh.v,l=e.transformers,c=a._length;if(!(c<=1)){for(n=0;n<c-1;n+=1)r=this.getTransformedPoint(l,a.v[n]),i=this.getTransformedPoint(l,a.o[n]),s=this.getTransformedPoint(l,a.i[n+1]),o=this.getTransformedPoint(l,a.v[n+1]),this.checkBounds(r,i,s,o,t);a.c&&(r=this.getTransformedPoint(l,a.v[n]),i=this.getTransformedPoint(l,a.o[n]),s=this.getTransformedPoint(l,a.i[0]),o=this.getTransformedPoint(l,a.v[0]),this.checkBounds(r,i,s,o,t))}},HShapeElement.prototype.checkBounds=function(e,t,n,r,i){this.getBoundsOfCurve(e,t,n,r);var s=this.shapeBoundingBox;i.x=bmMin(s.left,i.x),i.xMax=bmMax(s.right,i.xMax),i.y=bmMin(s.top,i.y),i.yMax=bmMax(s.bottom,i.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(e,t,n,r){for(var i,s,o,a,l,c,d,h=[[e[0],r[0]],[e[1],r[1]]],u=0;u<2;++u)s=6*e[u]-12*t[u]+6*n[u],i=-3*e[u]+9*t[u]-9*n[u]+3*r[u],o=3*t[u]-3*e[u],s|=0,o|=0,0==(i|=0)&&0===s||(0===i?(a=-o/s)>0&&a<1&&h[u].push(this.calculateF(a,e,t,n,r,u)):(l=s*s-4*o*i)>=0&&((c=(-s+bmSqrt(l))/(2*i))>0&&c<1&&h[u].push(this.calculateF(c,e,t,n,r,u)),(d=(-s-bmSqrt(l))/(2*i))>0&&d<1&&h[u].push(this.calculateF(d,e,t,n,r,u))));this.shapeBoundingBox.left=bmMin.apply(null,h[0]),this.shapeBoundingBox.top=bmMin.apply(null,h[1]),this.shapeBoundingBox.right=bmMax.apply(null,h[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,h[1])},HShapeElement.prototype.calculateF=function(e,t,n,r,i,s){return bmPow(1-e,3)*t[s]+3*bmPow(1-e,2)*e*n[s]+3*(1-e)*bmPow(e,2)*r[s]+bmPow(e,3)*i[s]},HShapeElement.prototype.calculateBoundingBox=function(e,t){var n,r=e.length;for(n=0;n<r;n+=1)e[n]&&e[n].sh?this.calculateShapeBoundingBox(e[n],t):e[n]&&e[n].it?this.calculateBoundingBox(e[n].it,t):e[n]&&e[n].style&&e[n].w&&this.expandStrokeBoundingBox(e[n].w,t)},HShapeElement.prototype.expandStrokeBoundingBox=function(e,t){var n=0;if(e.keyframes){for(var r=0;r<e.keyframes.length;r+=1){var i=e.keyframes[r].s;i>n&&(n=i)}n*=e.mult}else n=e.v*e.mult;t.x-=n,t.xMax+=n,t.y-=n,t.yMax+=n},HShapeElement.prototype.currentBoxContains=function(e){return this.currentBBox.x<=e.x&&this.currentBBox.y<=e.y&&this.currentBBox.width+this.currentBBox.x>=e.x+e.width&&this.currentBBox.height+this.currentBBox.y>=e.y+e.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var e=this.tempBoundingBox,t=999999;if(e.x=t,e.xMax=-t,e.y=t,e.yMax=-t,this.calculateBoundingBox(this.itemsData,e),e.width=e.xMax<e.x?0:e.xMax-e.x,e.height=e.yMax<e.y?0:e.yMax-e.y,this.currentBoxContains(e))return;var n=!1;if(this.currentBBox.w!==e.width&&(this.currentBBox.w=e.width,this.shapeCont.setAttribute("width",e.width),n=!0),this.currentBBox.h!==e.height&&(this.currentBBox.h=e.height,this.shapeCont.setAttribute("height",e.height),n=!0),n||this.currentBBox.x!==e.x||this.currentBBox.y!==e.y){this.currentBBox.w=e.width,this.currentBBox.h=e.height,this.currentBBox.x=e.x,this.currentBBox.y=e.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var r=this.shapeCont.style,i="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";r.transform=i,r.webkitTransform=i}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var e=createNS("g");this.maskedElement.appendChild(e),this.innerElem=e}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=this.innerElem.style,n=e.fc?this.buildColor(e.fc):"rgba(0,0,0,0)";t.fill=n,t.color=n,e.sc&&(t.stroke=this.buildColor(e.sc),t.strokeWidth=e.sw+"px");var r,i,s=this.globalData.fontManager.getFontByName(e.f);if(!this.globalData.fontManager.chars)if(t.fontSize=e.finalSize+"px",t.lineHeight=e.finalSize+"px",s.fClass)this.innerElem.className=s.fClass;else{t.fontFamily=s.fFamily;var o=e.fWeight,a=e.fStyle;t.fontStyle=a,t.fontWeight=o}var l,c,d,h=e.l;i=h.length;var u,p=this.mHelper,f="",m=0;for(r=0;r<i;r+=1){if(this.globalData.fontManager.chars?(this.textPaths[m]?l=this.textPaths[m]:((l=createNS("path")).setAttribute("stroke-linecap",lineCapEnum[1]),l.setAttribute("stroke-linejoin",lineJoinEnum[2]),l.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[m]?d=(c=this.textSpans[m]).children[0]:((c=createTag("div")).style.lineHeight=0,(d=createNS("svg")).appendChild(l),styleDiv(c)))):this.isMasked?l=this.textPaths[m]?this.textPaths[m]:createNS("text"):this.textSpans[m]?(c=this.textSpans[m],l=this.textPaths[m]):(styleDiv(c=createTag("span")),styleDiv(l=createTag("span")),c.appendChild(l)),this.globalData.fontManager.chars){var g,y=this.globalData.fontManager.getCharData(e.finalText[r],s.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily);if(g=y?y.data:null,p.reset(),g&&g.shapes&&g.shapes.length&&(u=g.shapes[0].it,p.scale(e.finalSize/100,e.finalSize/100),f=this.createPathShape(p,u),l.setAttribute("d",f)),this.isMasked)this.innerElem.appendChild(l);else{if(this.innerElem.appendChild(c),g&&g.shapes){document.body.appendChild(d);var v=d.getBBox();d.setAttribute("width",v.width+2),d.setAttribute("height",v.height+2),d.setAttribute("viewBox",v.x-1+" "+(v.y-1)+" "+(v.width+2)+" "+(v.height+2));var b=d.style,w="translate("+(v.x-1)+"px,"+(v.y-1)+"px)";b.transform=w,b.webkitTransform=w,h[r].yOffset=v.y-1}else d.setAttribute("width",1),d.setAttribute("height",1);c.appendChild(d)}}else if(l.textContent=h[r].val,l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(l);else{this.innerElem.appendChild(c);var x=l.style,E="translate3d(0,"+-e.finalSize/1.2+"px,0)";x.transform=E,x.webkitTransform=E}this.isMasked?this.textSpans[m]=l:this.textSpans[m]=c,this.textSpans[m].style.display="block",this.textPaths[m]=l,m+=1}for(;m<this.textSpans.length;)this.textSpans[m].style.display="none",m+=1},HTextElement.prototype.renderInnerContent=function(){var e;if(this.validateText(),this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),e=this.svgElement.style;var t="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";e.transform=t,e.webkitTransform=t}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var n,r,i,s,o,a=0,l=this.textAnimator.renderedLetters,c=this.textProperty.currentData.l;for(r=c.length,n=0;n<r;n+=1)c[n].n?a+=1:(s=this.textSpans[n],o=this.textPaths[n],i=l[a],a+=1,i._mdf.m&&(this.isMasked?s.setAttribute("transform",i.m):(s.style.webkitTransform=i.m,s.style.transform=i.m)),s.style.opacity=i.o,i.sw&&i._mdf.sw&&o.setAttribute("stroke-width",i.sw),i.sc&&i._mdf.sc&&o.setAttribute("stroke",i.sc),i.fc&&i._mdf.fc&&(o.setAttribute("fill",i.fc),o.style.color=i.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var d=this.innerElem.getBBox();if(this.currentBBox.w!==d.width&&(this.currentBBox.w=d.width,this.svgElement.setAttribute("width",d.width)),this.currentBBox.h!==d.height&&(this.currentBBox.h=d.height,this.svgElement.setAttribute("height",d.height)),this.currentBBox.w!==d.width+2||this.currentBBox.h!==d.height+2||this.currentBBox.x!==d.x-1||this.currentBBox.y!==d.y-1){this.currentBBox.w=d.width+2,this.currentBBox.h=d.height+2,this.currentBBox.x=d.x-1,this.currentBBox.y=d.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),e=this.svgElement.style;var h="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";e.transform=h,e.webkitTransform=h}}}},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var e,t,n,r,i=this.comp.threeDElements.length;for(e=0;e<i;e+=1)if("3d"===(t=this.comp.threeDElements[e]).type){n=t.perspectiveElem.style,r=t.container.style;var s=this.pe.v+"px",o="0px 0px 0px",a="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";n.perspective=s,n.webkitPerspective=s,r.transformOrigin=o,r.mozTransformOrigin=o,r.webkitTransformOrigin=o,n.transform=a,n.webkitTransform=a}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var e,t,n=this._isFirstFrame;if(this.hierarchy)for(t=this.hierarchy.length,e=0;e<t;e+=1)n=this.hierarchy[e].finalTransform.mProp._mdf||n;if(n||this.pe._mdf||this.p&&this.p._mdf||this.px&&(this.px._mdf||this.py._mdf||this.pz._mdf)||this.rx._mdf||this.ry._mdf||this.rz._mdf||this.or._mdf||this.a&&this.a._mdf){if(this.mat.reset(),this.hierarchy)for(e=t=this.hierarchy.length-1;e>=0;e-=1){var r=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-r.p.v[0],-r.p.v[1],r.p.v[2]),this.mat.rotateX(-r.or.v[0]).rotateY(-r.or.v[1]).rotateZ(r.or.v[2]),this.mat.rotateX(-r.rx.v).rotateY(-r.ry.v).rotateZ(r.rz.v),this.mat.scale(1/r.s.v[0],1/r.s.v[1],1/r.s.v[2]),this.mat.translate(r.a.v[0],r.a.v[1],r.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var i;i=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var s=Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2)+Math.pow(i[2],2)),o=[i[0]/s,i[1]/s,i[2]/s],a=Math.sqrt(o[2]*o[2]+o[0]*o[0]),l=Math.atan2(o[1],a),c=Math.atan2(o[0],-o[2]);this.mat.rotateY(c).rotateX(-l)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var d=!this._prevMat.equals(this.mat);if((d||this.pe._mdf)&&this.comp.threeDElements){var h,u,p;for(t=this.comp.threeDElements.length,e=0;e<t;e+=1)if("3d"===(h=this.comp.threeDElements[e]).type){if(d){var f=this.mat.toCSS();(p=h.container.style).transform=f,p.webkitTransform=f}this.pe._mdf&&((u=h.perspectiveElem.style).perspective=this.pe.v+"px",u.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData),t=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(t),t.crossOrigin="anonymous",t.src=e,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseRenderer],HybridRendererBase),HybridRendererBase.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},HybridRendererBase.prototype.appendElementInPos=function(e,t){var n=e.getBaseElement();if(n){var r=this.layers[t];if(r.ddd&&this.supports3d)this.addTo3dContainer(n,t);else if(this.threeDElements)this.addTo3dContainer(n,t);else{for(var i,s,o=0;o<t;)this.elements[o]&&!0!==this.elements[o]&&this.elements[o].getBaseElement&&(s=this.elements[o],i=(this.layers[o].ddd?this.getThreeDContainerByPos(o):s.getBaseElement())||i),o+=1;i?r.ddd&&this.supports3d||this.layerElement.insertBefore(n,i):r.ddd&&this.supports3d||this.layerElement.appendChild(n)}}},HybridRendererBase.prototype.createShape=function(e){return this.supports3d?new HShapeElement(e,this.globalData,this):new SVGShapeElement(e,this.globalData,this)},HybridRendererBase.prototype.createText=function(e){return this.supports3d?new HTextElement(e,this.globalData,this):new SVGTextLottieElement(e,this.globalData,this)},HybridRendererBase.prototype.createCamera=function(e){return this.camera=new HCameraElement(e,this.globalData,this),this.camera},HybridRendererBase.prototype.createImage=function(e){return this.supports3d?new HImageElement(e,this.globalData,this):new IImageElement(e,this.globalData,this)},HybridRendererBase.prototype.createSolid=function(e){return this.supports3d?new HSolidElement(e,this.globalData,this):new ISolidElement(e,this.globalData,this)},HybridRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,HybridRendererBase.prototype.getThreeDContainerByPos=function(e){for(var t=0,n=this.threeDElements.length;t<n;){if(this.threeDElements[t].startPos<=e&&this.threeDElements[t].endPos>=e)return this.threeDElements[t].perspectiveElem;t+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(e,t){var n,r,i=createTag("div");styleDiv(i);var s=createTag("div");if(styleDiv(s),"3d"===t){(n=i.style).width=this.globalData.compSize.w+"px",n.height=this.globalData.compSize.h+"px";var o="50% 50%";n.webkitTransformOrigin=o,n.mozTransformOrigin=o,n.transformOrigin=o;var a="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(r=s.style).transform=a,r.webkitTransform=a}i.appendChild(s);var l={container:s,perspectiveElem:i,startPos:e,endPos:e,type:t};return this.threeDElements.push(l),l},HybridRendererBase.prototype.build3dContainers=function(){var e,t,n=this.layers.length,r="";for(e=0;e<n;e+=1)this.layers[e].ddd&&3!==this.layers[e].ty?("3d"!==r&&(r="3d",t=this.createThreeDContainer(e,"3d")),t.endPos=Math.max(t.endPos,e)):("2d"!==r&&(r="2d",t=this.createThreeDContainer(e,"2d")),t.endPos=Math.max(t.endPos,e));for(e=(n=this.threeDElements.length)-1;e>=0;e-=1)this.resizerElem.appendChild(this.threeDElements[e].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(e,t){for(var n=0,r=this.threeDElements.length;n<r;){if(t<=this.threeDElements[n].endPos){for(var i,s=this.threeDElements[n].startPos;s<t;)this.elements[s]&&this.elements[s].getBaseElement&&(i=this.elements[s].getBaseElement()),s+=1;i?this.threeDElements[n].container.insertBefore(e,i):this.threeDElements[n].container.appendChild(e);break}n+=1}},HybridRendererBase.prototype.configAnimation=function(e){var t=createTag("div"),n=this.animationItem.wrapper,r=t.style;r.width=e.w+"px",r.height=e.h+"px",this.resizerElem=t,styleDiv(t),r.transformStyle="flat",r.mozTransformStyle="flat",r.webkitTransformStyle="flat",this.renderConfig.className&&t.setAttribute("class",this.renderConfig.className),n.appendChild(t),r.overflow="hidden";var i=createNS("svg");i.setAttribute("width","1"),i.setAttribute("height","1"),styleDiv(i),this.resizerElem.appendChild(i);var s=createNS("defs");i.appendChild(s),this.data=e,this.setupGlobalData(e,i),this.globalData.defs=s,this.layers=e.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRendererBase.prototype.updateContainerSize=function(){var e,t,n,r,i=this.animationItem.wrapper.offsetWidth,s=this.animationItem.wrapper.offsetHeight,o=i/s;this.globalData.compSize.w/this.globalData.compSize.h>o?(e=i/this.globalData.compSize.w,t=i/this.globalData.compSize.w,n=0,r=(s-this.globalData.compSize.h*(i/this.globalData.compSize.w))/2):(e=s/this.globalData.compSize.h,t=s/this.globalData.compSize.h,n=(i-this.globalData.compSize.w*(s/this.globalData.compSize.h))/2,r=0);var a=this.resizerElem.style;a.webkitTransform="matrix3d("+e+",0,0,0,0,"+t+",0,0,0,0,1,0,"+n+","+r+",0,1)",a.transform=a.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var e,t=this.globalData.compSize.w,n=this.globalData.compSize.h,r=this.threeDElements.length;for(e=0;e<r;e+=1){var i=this.threeDElements[e].perspectiveElem.style;i.webkitPerspective=Math.sqrt(Math.pow(t,2)+Math.pow(n,2))+"px",i.perspective=i.webkitPerspective}}},HybridRendererBase.prototype.searchExtraCompositions=function(e){var t,n=e.length,r=createTag("div");for(t=0;t<n;t+=1)if(e[t].xt){var i=this.createComp(e[t],r,this.globalData.comp,null);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},extendPrototype([HybridRendererBase,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(e,t){for(var n,r=0;r<t;)this.elements[r]&&this.elements[r].getBaseElement&&(n=this.elements[r].getBaseElement()),r+=1;n?this.layerElement.insertBefore(e,n):this.layerElement.appendChild(e)},HCompElement.prototype.createComp=function(e){return this.supports3d?new HCompElement(e,this.globalData,this):new SVGCompElement(e,this.globalData,this)},extendPrototype([HybridRendererBase],HybridRenderer),HybridRenderer.prototype.createComp=function(e){return this.supports3d?new HCompElement(e,this.globalData,this):new SVGCompElement(e,this.globalData,this)};var CompExpressionInterface=function(e){function t(t){for(var n=0,r=e.layers.length;n<r;){if(e.layers[n].nm===t||e.layers[n].ind===t)return e.elements[n].layerInterface;n+=1}return null}return Object.defineProperty(t,"_name",{value:e.data.nm}),t.layer=t,t.pixelAspect=1,t.height=e.data.h||e.globalData.compSize.h,t.width=e.data.w||e.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/e.globalData.frameRate,t.displayStartTime=0,t.numLayers=e.layers.length,t};function _typeof$2(e){return _typeof$2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$2(e)}function seedRandom(e,t){var n,r=this,i=256,s="random",o=t.pow(i,6),a=t.pow(2,52),l=2*a,c=i-1;function d(e){var t,n=e.length,r=this,s=0,o=r.i=r.j=0,a=r.S=[];for(n||(e=[n++]);s<i;)a[s]=s++;for(s=0;s<i;s++)a[s]=a[o=c&o+e[s%n]+(t=a[s])],a[o]=t;r.g=function(e){for(var t,n=0,s=r.i,o=r.j,a=r.S;e--;)t=a[s=c&s+1],n=n*i+a[c&(a[s]=a[o=c&o+t])+(a[o]=t)];return r.i=s,r.j=o,n}}function h(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function u(e,t){var n,r=[],i=_typeof$2(e);if(t&&"object"==i)for(n in e)try{r.push(u(e[n],t-1))}catch(e){}return r.length?r:"string"==i?e:e+"\0"}function p(e,t){for(var n,r=e+"",i=0;i<r.length;)t[c&i]=c&(n^=19*t[c&i])+r.charCodeAt(i++);return f(t)}function f(e){return String.fromCharCode.apply(0,e)}t["seed"+s]=function(c,m,g){var y=[],v=p(u((m=!0===m?{entropy:!0}:m||{}).entropy?[c,f(e)]:null===c?function(){try{if(n)return f(n.randomBytes(i));var t=new Uint8Array(i);return(r.crypto||r.msCrypto).getRandomValues(t),f(t)}catch(t){var s=r.navigator,o=s&&s.plugins;return[+new Date,r,o,r.screen,f(e)]}}():c,3),y),b=new d(y),w=function(){for(var e=b.g(6),t=o,n=0;e<a;)e=(e+n)*i,t*=i,n=b.g(1);for(;e>=l;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|b.g(4)},w.quick=function(){return b.g(4)/4294967296},w.double=w,p(f(b.S),e),(m.pass||g||function(e,n,r,i){return i&&(i.S&&h(i,b),e.state=function(){return h(b,{})}),r?(t[s]=e,n):e})(w,v,"global"in m?m.global:this==t,m.state)},p(t.random(),e)}function initialize$2(e){seedRandom([],e)}var propTypes={SHAPE:"shape"};function _typeof$1(e){return _typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$1(e)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null,_lottieGlobal={};function resetFrame(){_lottieGlobal={}}function $bm_isInstanceOfArray(e){return e.constructor===Array||e.constructor===Float32Array}function isNumerable(e,t){return"number"===e||t instanceof Number||"boolean"===e||"string"===e}function $bm_neg(e){var t=_typeof$1(e);if("number"===t||e instanceof Number||"boolean"===t)return-e;if($bm_isInstanceOfArray(e)){var n,r=e.length,i=[];for(n=0;n<r;n+=1)i[n]=-e[n];return i}return e.propType?e.v:-e}initialize$2(BMMath);var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(e,t){var n=_typeof$1(e),r=_typeof$1(t);if(isNumerable(n,e)&&isNumerable(r,t)||"string"===n||"string"===r)return e+t;if($bm_isInstanceOfArray(e)&&isNumerable(r,t))return(e=e.slice(0))[0]+=t,e;if(isNumerable(n,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e+t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var i=0,s=e.length,o=t.length,a=[];i<s||i<o;)("number"==typeof e[i]||e[i]instanceof Number)&&("number"==typeof t[i]||t[i]instanceof Number)?a[i]=e[i]+t[i]:a[i]=void 0===t[i]?e[i]:e[i]||t[i],i+=1;return a}return 0}var add=sum;function sub(e,t){var n=_typeof$1(e),r=_typeof$1(t);if(isNumerable(n,e)&&isNumerable(r,t))return"string"===n&&(e=parseInt(e,10)),"string"===r&&(t=parseInt(t,10)),e-t;if($bm_isInstanceOfArray(e)&&isNumerable(r,t))return(e=e.slice(0))[0]-=t,e;if(isNumerable(n,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e-t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var i=0,s=e.length,o=t.length,a=[];i<s||i<o;)("number"==typeof e[i]||e[i]instanceof Number)&&("number"==typeof t[i]||t[i]instanceof Number)?a[i]=e[i]-t[i]:a[i]=void 0===t[i]?e[i]:e[i]||t[i],i+=1;return a}return 0}function mul(e,t){var n,r,i,s=_typeof$1(e),o=_typeof$1(t);if(isNumerable(s,e)&&isNumerable(o,t))return e*t;if($bm_isInstanceOfArray(e)&&isNumerable(o,t)){for(i=e.length,n=createTypedArray("float32",i),r=0;r<i;r+=1)n[r]=e[r]*t;return n}if(isNumerable(s,e)&&$bm_isInstanceOfArray(t)){for(i=t.length,n=createTypedArray("float32",i),r=0;r<i;r+=1)n[r]=e*t[r];return n}return 0}function div(e,t){var n,r,i,s=_typeof$1(e),o=_typeof$1(t);if(isNumerable(s,e)&&isNumerable(o,t))return e/t;if($bm_isInstanceOfArray(e)&&isNumerable(o,t)){for(i=e.length,n=createTypedArray("float32",i),r=0;r<i;r+=1)n[r]=e[r]/t;return n}if(isNumerable(s,e)&&$bm_isInstanceOfArray(t)){for(i=t.length,n=createTypedArray("float32",i),r=0;r<i;r+=1)n[r]=e/t[r];return n}return 0}function mod(e,t){return"string"==typeof e&&(e=parseInt(e,10)),"string"==typeof t&&(t=parseInt(t,10)),e%t}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(e,t,n){if(t>n){var r=n;n=t,t=r}return Math.min(Math.max(e,t),n)}function radiansToDegrees(e){return e/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(e){return e*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(e,t){if("number"==typeof e||e instanceof Number)return t=t||0,Math.abs(e-t);var n;t||(t=helperLengthArray);var r=Math.min(e.length,t.length),i=0;for(n=0;n<r;n+=1)i+=Math.pow(t[n]-e[n],2);return Math.sqrt(i)}function normalize(e){return div(e,length(e))}function rgbToHsl(e){var t,n,r=e[0],i=e[1],s=e[2],o=Math.max(r,i,s),a=Math.min(r,i,s),l=(o+a)/2;if(o===a)t=0,n=0;else{var c=o-a;switch(n=l>.5?c/(2-o-a):c/(o+a),o){case r:t=(i-s)/c+(i<s?6:0);break;case i:t=(s-r)/c+2;break;case s:t=(r-i)/c+4}t/=6}return[t,n,l,e[3]]}function hue2rgb(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function hslToRgb(e){var t,n,r,i=e[0],s=e[1],o=e[2];if(0===s)t=o,r=o,n=o;else{var a=o<.5?o*(1+s):o+s-o*s,l=2*o-a;t=hue2rgb(l,a,i+1/3),n=hue2rgb(l,a,i),r=hue2rgb(l,a,i-1/3)}return[t,n,r,e[3]]}function linear(e,t,n,r,i){if(void 0!==r&&void 0!==i||(r=t,i=n,t=0,n=1),n<t){var s=n;n=t,t=s}if(e<=t)return r;if(e>=n)return i;var o,a=n===t?0:(e-t)/(n-t);if(!r.length)return r+(i-r)*a;var l=r.length,c=createTypedArray("float32",l);for(o=0;o<l;o+=1)c[o]=r[o]+(i[o]-r[o])*a;return c}function random(e,t){if(void 0===t&&(void 0===e?(e=0,t=1):(t=e,e=void 0)),t.length){var n,r=t.length;e||(e=createTypedArray("float32",r));var i=createTypedArray("float32",r),s=BMMath.random();for(n=0;n<r;n+=1)i[n]=e[n]+s*(t[n]-e[n]);return i}return void 0===e&&(e=0),e+BMMath.random()*(t-e)}function createPath(e,t,n,r){var i,s=e.length,o=shapePool.newElement();o.setPathData(!!r,s);var a,l,c=[0,0];for(i=0;i<s;i+=1)a=t&&t[i]?t[i]:c,l=n&&n[i]?n[i]:c,o.setTripleAt(e[i][0],e[i][1],l[0]+e[i][0],l[1]+e[i][1],a[0]+e[i][0],a[1]+e[i][1],i,!0);return o}function initiateExpression(elem,data,property){function noOp(e){return e}if(!elem.globalData.renderConfig.runExpressions)return noOp;var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty._name=elem.data.nm,thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(e,t){var n,r,i=this.pv.length?this.pv.length:1,s=createTypedArray("float32",i),o=Math.floor(5*time);for(n=0,r=0;n<o;){for(r=0;r<i;r+=1)s[r]+=-t+2*t*BMMath.random();n+=1}var a=5*time,l=a-Math.floor(a),c=createTypedArray("float32",i);if(i>1){for(r=0;r<i;r+=1)c[r]=this.pv[r]+s[r]+(-t+2*t*BMMath.random())*l;return c}return this.pv+s[0]+(-t+2*t*BMMath.random())*l}.bind(this);function loopInDuration(e,t){return loopIn(e,t,!0)}function loopOutDuration(e,t){return loopOut(e,t,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(e,t){var n=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],r=Math.atan2(n[0],Math.sqrt(n[1]*n[1]+n[2]*n[2]))/degToRads;return[-Math.atan2(n[1],n[2])/degToRads,r,0]}function easeOut(e,t,n,r,i){return applyEase(easeOutBez,e,t,n,r,i)}function easeIn(e,t,n,r,i){return applyEase(easeInBez,e,t,n,r,i)}function ease(e,t,n,r,i){return applyEase(easeInOutBez,e,t,n,r,i)}function applyEase(e,t,n,r,i,s){void 0===i?(i=n,s=r):t=(t-n)/(r-n),t>1?t=1:t<0&&(t=0);var o=e(t);if($bm_isInstanceOfArray(i)){var a,l=i.length,c=createTypedArray("float32",l);for(a=0;a<l;a+=1)c[a]=(s[a]-i[a])*o+i[a];return c}return(s-i)*o+i}function nearestKey(e){var t,n,r,i=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(n=-1,(e*=elem.comp.globalData.frameRate)<data.k[0].t)n=1,r=data.k[0].t;else{for(t=0;t<i-1;t+=1){if(e===data.k[t].t){n=t+1,r=data.k[t].t;break}if(e>data.k[t].t&&e<data.k[t+1].t){e-data.k[t].t>data.k[t+1].t-e?(n=t+2,r=data.k[t+1].t):(n=t+1,r=data.k[t].t);break}}-1===n&&(n=t+1,r=data.k[t].t)}else n=0,r=0;var s={};return s.index=n,s.time=r/elem.comp.globalData.frameRate,s}function key(e){var t,n,r;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+e);e-=1,t={time:data.k[e].t/elem.comp.globalData.frameRate,value:[]};var i=Object.prototype.hasOwnProperty.call(data.k[e],"s")?data.k[e].s:data.k[e-1].e;for(r=i.length,n=0;n<r;n+=1)t[n]=i[n],t.value[n]=i[n];return t}function framesToTime(e,t){return t||(t=elem.comp.globalData.frameRate),e/t}function timeToFrames(e,t){return e||0===e||(e=time),t||(t=elem.comp.globalData.frameRate),e*t}function seedRandom(e){BMMath.seedrandom(randSeed+e)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(e,t){return"string"==typeof value?void 0===t?value.substring(e):value.substring(e,t):""}function substr(e,t){return"string"==typeof value?void 0===t?value.substr(e):value.substr(e,t):""}function posterizeTime(e){time=0===e?0:Math.floor(time*e)/e,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(e){return value=e,this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),$bm_transform=transform,transform&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,_needsRandom&&seedRandom(randSeed+time),needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,scoped_bm_rt=scoped_bm_rt.propType===propTypes.SHAPE?scoped_bm_rt.v:scoped_bm_rt)}return executeExpression.__preventDeadCodeRemoval=[$bm_transform,anchorPoint,time,velocity,inPoint,outPoint,width,height,name,loop_in,loop_out,smooth,toComp,fromCompToSurface,toWorld,fromWorld,mask,position,rotation,scale,thisComp,numKeys,active,wiggle,loopInDuration,loopOutDuration,comp,lookAt,easeOut,easeIn,ease,nearestKey,key,text,textIndex,textTotal,selectorValue,framesToTime,timeToFrames,sourceRectAtTime,substring,substr,posterizeTime,index,globalData],executeExpression}return ob.initiateExpression=initiateExpression,ob.__preventDeadCodeRemoval=[window,document,XMLHttpRequest,fetch,frames,$bm_neg,add,$bm_sum,$bm_sub,$bm_mul,$bm_div,$bm_mod,clamp,radians_to_degrees,degreesToRadians,degrees_to_radians,normalize,rgbToHsl,hslToRgb,linear,random,createPath,_lottieGlobal],ob.resetFrame=resetFrame,ob}(),Expressions=function(){var e={initExpressions:function(e){var t=0,n=[];e.renderer.compInterface=CompExpressionInterface(e.renderer),e.renderer.globalData.projectInterface.registerComposition(e.renderer),e.renderer.globalData.pushExpression=function(){t+=1},e.renderer.globalData.popExpression=function(){0==(t-=1)&&function(){var e,t=n.length;for(e=0;e<t;e+=1)n[e].release();n.length=0}()},e.renderer.globalData.registerExpressionProperty=function(e){-1===n.indexOf(e)&&n.push(e)}}};return e.resetFrame=ExpressionManager.resetFrame,e}(),MaskManagerInterface=function(){function e(e,t){this._mask=e,this._data=t}return Object.defineProperty(e.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(e.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}}),function(t){var n,r=createSizedArray(t.viewData.length),i=t.viewData.length;for(n=0;n<i;n+=1)r[n]=new e(t.viewData[n],t.masksProperties[n]);return function(e){for(n=0;n<i;){if(t.masksProperties[n].nm===e)return r[n];n+=1}return null}}}(),ExpressionPropertyInterface=function(){var e={pv:0,v:0,mult:1},t={pv:[0,0,0],v:[0,0,0],mult:1};function n(e,t,n){Object.defineProperty(e,"velocity",{get:function(){return t.getVelocityAtTime(t.comp.currentFrame)}}),e.numKeys=t.keyframes?t.keyframes.length:0,e.key=function(r){if(!e.numKeys)return 0;var i="";i="s"in t.keyframes[r-1]?t.keyframes[r-1].s:"e"in t.keyframes[r-2]?t.keyframes[r-2].e:t.keyframes[r-2].s;var s="unidimensional"===n?new Number(i):Object.assign({},i);return s.time=t.keyframes[r-1].t/t.elem.comp.globalData.frameRate,s.value="unidimensional"===n?i[0]:i,s},e.valueAtTime=t.getValueAtTime,e.speedAtTime=t.getSpeedAtTime,e.velocityAtTime=t.getVelocityAtTime,e.propertyGroup=t.propertyGroup}function r(){return e}return function(i){return i?"unidimensional"===i.propType?function(t){t&&"pv"in t||(t=e);var r=1/t.mult,i=t.pv*r,s=new Number(i);return s.value=i,n(s,t,"unidimensional"),function(){return t.k&&t.getValue(),i=t.v*r,s.value!==i&&((s=new Number(i)).value=i,s[0]=i,n(s,t,"unidimensional")),s}}(i):function(e){e&&"pv"in e||(e=t);var r=1/e.mult,i=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",i),o=createTypedArray("float32",i);return s.value=o,n(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)o[t]=e.v[t]*r,s[t]=o[t];return s}}(i):r}}(),TransformExpressionInterface=function(e){function t(e){switch(e){case"scale":case"Scale":case"ADBE Scale":case 6:return t.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return t.rotation;case"ADBE Rotate X":return t.xRotation;case"ADBE Rotate Y":return t.yRotation;case"position":case"Position":case"ADBE Position":case 2:return t.position;case"ADBE Position_0":return t.xPosition;case"ADBE Position_1":return t.yPosition;case"ADBE Position_2":return t.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return t.anchorPoint;case"opacity":case"Opacity":case 11:return t.opacity;default:return null}}var n,r,i,s;return Object.defineProperty(t,"rotation",{get:ExpressionPropertyInterface(e.r||e.rz)}),Object.defineProperty(t,"zRotation",{get:ExpressionPropertyInterface(e.rz||e.r)}),Object.defineProperty(t,"xRotation",{get:ExpressionPropertyInterface(e.rx)}),Object.defineProperty(t,"yRotation",{get:ExpressionPropertyInterface(e.ry)}),Object.defineProperty(t,"scale",{get:ExpressionPropertyInterface(e.s)}),e.p?s=ExpressionPropertyInterface(e.p):(n=ExpressionPropertyInterface(e.px),r=ExpressionPropertyInterface(e.py),e.pz&&(i=ExpressionPropertyInterface(e.pz))),Object.defineProperty(t,"position",{get:function(){return e.p?s():[n(),r(),i?i():0]}}),Object.defineProperty(t,"xPosition",{get:ExpressionPropertyInterface(e.px)}),Object.defineProperty(t,"yPosition",{get:ExpressionPropertyInterface(e.py)}),Object.defineProperty(t,"zPosition",{get:ExpressionPropertyInterface(e.pz)}),Object.defineProperty(t,"anchorPoint",{get:ExpressionPropertyInterface(e.a)}),Object.defineProperty(t,"opacity",{get:ExpressionPropertyInterface(e.o)}),Object.defineProperty(t,"skew",{get:ExpressionPropertyInterface(e.sk)}),Object.defineProperty(t,"skewAxis",{get:ExpressionPropertyInterface(e.sa)}),Object.defineProperty(t,"orientation",{get:ExpressionPropertyInterface(e.or)}),t},LayerExpressionInterface=function(){function e(e){var t=new Matrix;return void 0!==e?this._elem.finalTransform.mProp.getValueAtTime(e).clone(t):this._elem.finalTransform.mProp.applyToMatrix(t),t}function t(e,t){var n=this.getMatrix(t);return n.props[12]=0,n.props[13]=0,n.props[14]=0,this.applyPoint(n,e)}function n(e,t){var n=this.getMatrix(t);return this.applyPoint(n,e)}function r(e,t){var n=this.getMatrix(t);return n.props[12]=0,n.props[13]=0,n.props[14]=0,this.invertPoint(n,e)}function i(e,t){var n=this.getMatrix(t);return this.invertPoint(n,e)}function s(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var n,r=this._elem.hierarchy.length;for(n=0;n<r;n+=1)this._elem.hierarchy[n].finalTransform.mProp.applyToMatrix(e)}return e.applyToPointArray(t[0],t[1],t[2]||0)}function o(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var n,r=this._elem.hierarchy.length;for(n=0;n<r;n+=1)this._elem.hierarchy[n].finalTransform.mProp.applyToMatrix(e)}return e.inversePoint(t)}function a(e){var t=new Matrix;if(t.reset(),this._elem.finalTransform.mProp.applyToMatrix(t),this._elem.hierarchy&&this._elem.hierarchy.length){var n,r=this._elem.hierarchy.length;for(n=0;n<r;n+=1)this._elem.hierarchy[n].finalTransform.mProp.applyToMatrix(t);return t.inversePoint(e)}return t.inversePoint(e)}function l(){return[1,1,1,1]}return function(c){var d;function h(e){switch(e){case"ADBE Root Vectors Group":case"Contents":case 2:return h.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return d;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return h.effect;case"ADBE Text Properties":return h.textInterface;default:return null}}h.getMatrix=e,h.invertPoint=o,h.applyPoint=s,h.toWorld=n,h.toWorldVec=t,h.fromWorld=i,h.fromWorldVec=r,h.toComp=n,h.fromComp=a,h.sampleImage=l,h.sourceRectAtTime=c.sourceRectAtTime.bind(c),h._elem=c;var u=getDescriptor(d=TransformExpressionInterface(c.finalTransform.mProp),"anchorPoint");return Object.defineProperties(h,{hasParent:{get:function(){return c.hierarchy.length}},parent:{get:function(){return c.hierarchy[0].layerInterface}},rotation:getDescriptor(d,"rotation"),scale:getDescriptor(d,"scale"),position:getDescriptor(d,"position"),opacity:getDescriptor(d,"opacity"),anchorPoint:u,anchor_point:u,transform:{get:function(){return d}},active:{get:function(){return c.isInRange}}}),h.startTime=c.data.st,h.index=c.data.ind,h.source=c.data.refId,h.height=0===c.data.ty?c.data.h:100,h.width=0===c.data.ty?c.data.w:100,h.inPoint=c.data.ip/c.comp.globalData.frameRate,h.outPoint=c.data.op/c.comp.globalData.frameRate,h._name=c.data.nm,h.registerMaskInterface=function(e){h.mask=new MaskManagerInterface(e,c)},h.registerEffectsInterface=function(e){h.effect=e},h}}(),propertyGroupFactory=function(e,t){return function(n){return(n=void 0===n?1:n)<=0?e:t(n-1)}},PropertyInterface=function(e,t){var n={_name:e};return function(e){return(e=void 0===e?1:e)<=0?n:t(e-1)}},EffectsExpressionInterface=function(){function e(n,r,i,s){function o(e){for(var t=n.ef,r=0,i=t.length;r<i;){if(e===t[r].nm||e===t[r].mn||e===t[r].ix)return 5===t[r].ty?c[r]:c[r]();r+=1}throw new Error}var a,l=propertyGroupFactory(o,i),c=[],d=n.ef.length;for(a=0;a<d;a+=1)5===n.ef[a].ty?c.push(e(n.ef[a],r.effectElements[a],r.effectElements[a].propertyGroup,s)):c.push(t(r.effectElements[a],n.ef[a].ty,s,l));return"ADBE Color Control"===n.mn&&Object.defineProperty(o,"color",{get:function(){return c[0]()}}),Object.defineProperties(o,{numProperties:{get:function(){return n.np}},_name:{value:n.nm},propertyGroup:{value:l}}),o.enabled=0!==n.en,o.active=o.enabled,o}function t(e,t,n,r){var i=ExpressionPropertyInterface(e.p);return e.p.setGroupProperty&&e.p.setGroupProperty(PropertyInterface("",r)),function(){return 10===t?n.comp.compInterface(e.p.v):i()}}return{createEffectsInterface:function(t,n){if(t.effectsManager){var r,i=[],s=t.data.ef,o=t.effectsManager.effectElements.length;for(r=0;r<o;r+=1)i.push(e(s[r],t.effectsManager.effectElements[r],n,t));var a=t.data.ef||[],l=function(e){for(r=0,o=a.length;r<o;){if(e===a[r].nm||e===a[r].mn||e===a[r].ix)return i[r];r+=1}return null};return Object.defineProperty(l,"numProperties",{get:function(){return a.length}}),l}return null}}}(),ShapePathInterface=function(e,t,n){var r=t.sh;function i(e){return"Shape"===e||"shape"===e||"Path"===e||"path"===e||"ADBE Vector Shape"===e||2===e?i.path:null}var s=propertyGroupFactory(i,n);return r.setGroupProperty(PropertyInterface("Path",s)),Object.defineProperties(i,{path:{get:function(){return r.k&&r.getValue(),r}},shape:{get:function(){return r.k&&r.getValue(),r}},_name:{value:e.nm},ix:{value:e.ix},propertyIndex:{value:e.ix},mn:{value:e.mn},propertyGroup:{value:n}}),i},ShapeExpressionInterface=function(){function e(e,o,u){var p,f=[],m=e?e.length:0;for(p=0;p<m;p+=1)"gr"===e[p].ty?f.push(t(e[p],o[p],u)):"fl"===e[p].ty?f.push(n(e[p],o[p],u)):"st"===e[p].ty?f.push(i(e[p],o[p],u)):"tm"===e[p].ty?f.push(s(e[p],o[p],u)):"tr"===e[p].ty||("el"===e[p].ty?f.push(a(e[p],o[p],u)):"sr"===e[p].ty?f.push(l(e[p],o[p],u)):"sh"===e[p].ty?f.push(ShapePathInterface(e[p],o[p],u)):"rc"===e[p].ty?f.push(c(e[p],o[p],u)):"rd"===e[p].ty?f.push(d(e[p],o[p],u)):"rp"===e[p].ty?f.push(h(e[p],o[p],u)):"gf"===e[p].ty?f.push(r(e[p],o[p],u)):f.push((e[p],o[p],function(){return null})));return f}function t(t,n,r){var i=function(e){switch(e){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,r);var s=function(t,n,r){var i,s=function(e){for(var t=0,n=i.length;t<n;){if(i[t]._name===e||i[t].mn===e||i[t].propertyIndex===e||i[t].ix===e||i[t].ind===e)return i[t];t+=1}return"number"==typeof e?i[e-1]:null};s.propertyGroup=propertyGroupFactory(s,r),i=e(t.it,n.it,s.propertyGroup),s.numProperties=i.length;var a=o(t.it[t.it.length-1],n.it[n.it.length-1],s.propertyGroup);return s.transform=a,s.propertyIndex=t.cix,s._name=t.nm,s}(t,n,i.propertyGroup),a=o(t.it[t.it.length-1],n.it[n.it.length-1],i.propertyGroup);return i.content=s,i.transform=a,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function n(e,t,n){function r(e){return"Color"===e||"color"===e?r.color:"Opacity"===e||"opacity"===e?r.opacity:null}return Object.defineProperties(r,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",n)),t.o.setGroupProperty(PropertyInterface("Opacity",n)),r}function r(e,t,n){function r(e){return"Start Point"===e||"start point"===e?r.startPoint:"End Point"===e||"end point"===e?r.endPoint:"Opacity"===e||"opacity"===e?r.opacity:null}return Object.defineProperties(r,{startPoint:{get:ExpressionPropertyInterface(t.s)},endPoint:{get:ExpressionPropertyInterface(t.e)},opacity:{get:ExpressionPropertyInterface(t.o)},type:{get:function(){return"a"}},_name:{value:e.nm},mn:{value:e.mn}}),t.s.setGroupProperty(PropertyInterface("Start Point",n)),t.e.setGroupProperty(PropertyInterface("End Point",n)),t.o.setGroupProperty(PropertyInterface("Opacity",n)),r}function i(e,t,n){var r,i=propertyGroupFactory(c,n),s=propertyGroupFactory(l,i);function o(n){Object.defineProperty(l,e.d[n].nm,{get:ExpressionPropertyInterface(t.d.dataProps[n].p)})}var a=e.d?e.d.length:0,l={};for(r=0;r<a;r+=1)o(r),t.d.dataProps[r].p.setGroupProperty(s);function c(e){return"Color"===e||"color"===e?c.color:"Opacity"===e||"opacity"===e?c.opacity:"Stroke Width"===e||"stroke width"===e?c.strokeWidth:null}return Object.defineProperties(c,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},strokeWidth:{get:ExpressionPropertyInterface(t.w)},dash:{get:function(){return l}},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",i)),t.o.setGroupProperty(PropertyInterface("Opacity",i)),t.w.setGroupProperty(PropertyInterface("Stroke Width",i)),c}function s(e,t,n){function r(t){return t===e.e.ix||"End"===t||"end"===t?r.end:t===e.s.ix?r.start:t===e.o.ix?r.offset:null}var i=propertyGroupFactory(r,n);return r.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",i)),t.e.setGroupProperty(PropertyInterface("End",i)),t.o.setGroupProperty(PropertyInterface("Offset",i)),r.propertyIndex=e.ix,r.propertyGroup=n,Object.defineProperties(r,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),r.mn=e.mn,r}function o(e,t,n){function r(t){return e.a.ix===t||"Anchor Point"===t?r.anchorPoint:e.o.ix===t||"Opacity"===t?r.opacity:e.p.ix===t||"Position"===t?r.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?r.rotation:e.s.ix===t||"Scale"===t?r.scale:e.sk&&e.sk.ix===t||"Skew"===t?r.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?r.skewAxis:null}var i=propertyGroupFactory(r,n);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",i)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",i)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",i)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",i)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",i)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",i)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",i))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",i)),Object.defineProperties(r,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),r.ty="tr",r.mn=e.mn,r.propertyGroup=n,r}function a(e,t,n){function r(t){return e.p.ix===t?r.position:e.s.ix===t?r.size:null}var i=propertyGroupFactory(r,n);r.propertyIndex=e.ix;var s="tm"===t.sh.ty?t.sh.prop:t.sh;return s.s.setGroupProperty(PropertyInterface("Size",i)),s.p.setGroupProperty(PropertyInterface("Position",i)),Object.defineProperties(r,{size:{get:ExpressionPropertyInterface(s.s)},position:{get:ExpressionPropertyInterface(s.p)},_name:{value:e.nm}}),r.mn=e.mn,r}function l(e,t,n){function r(t){return e.p.ix===t?r.position:e.r.ix===t?r.rotation:e.pt.ix===t?r.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?r.outerRadius:e.os.ix===t?r.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?r.innerRoundness:null:r.innerRadius}var i=propertyGroupFactory(r,n),s="tm"===t.sh.ty?t.sh.prop:t.sh;return r.propertyIndex=e.ix,s.or.setGroupProperty(PropertyInterface("Outer Radius",i)),s.os.setGroupProperty(PropertyInterface("Outer Roundness",i)),s.pt.setGroupProperty(PropertyInterface("Points",i)),s.p.setGroupProperty(PropertyInterface("Position",i)),s.r.setGroupProperty(PropertyInterface("Rotation",i)),e.ir&&(s.ir.setGroupProperty(PropertyInterface("Inner Radius",i)),s.is.setGroupProperty(PropertyInterface("Inner Roundness",i))),Object.defineProperties(r,{position:{get:ExpressionPropertyInterface(s.p)},rotation:{get:ExpressionPropertyInterface(s.r)},points:{get:ExpressionPropertyInterface(s.pt)},outerRadius:{get:ExpressionPropertyInterface(s.or)},outerRoundness:{get:ExpressionPropertyInterface(s.os)},innerRadius:{get:ExpressionPropertyInterface(s.ir)},innerRoundness:{get:ExpressionPropertyInterface(s.is)},_name:{value:e.nm}}),r.mn=e.mn,r}function c(e,t,n){function r(t){return e.p.ix===t?r.position:e.r.ix===t?r.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?r.size:null}var i=propertyGroupFactory(r,n),s="tm"===t.sh.ty?t.sh.prop:t.sh;return r.propertyIndex=e.ix,s.p.setGroupProperty(PropertyInterface("Position",i)),s.s.setGroupProperty(PropertyInterface("Size",i)),s.r.setGroupProperty(PropertyInterface("Rotation",i)),Object.defineProperties(r,{position:{get:ExpressionPropertyInterface(s.p)},roundness:{get:ExpressionPropertyInterface(s.r)},size:{get:ExpressionPropertyInterface(s.s)},_name:{value:e.nm}}),r.mn=e.mn,r}function d(e,t,n){function r(t){return e.r.ix===t||"Round Corners 1"===t?r.radius:null}var i=propertyGroupFactory(r,n),s=t;return r.propertyIndex=e.ix,s.rd.setGroupProperty(PropertyInterface("Radius",i)),Object.defineProperties(r,{radius:{get:ExpressionPropertyInterface(s.rd)},_name:{value:e.nm}}),r.mn=e.mn,r}function h(e,t,n){function r(t){return e.c.ix===t||"Copies"===t?r.copies:e.o.ix===t||"Offset"===t?r.offset:null}var i=propertyGroupFactory(r,n),s=t;return r.propertyIndex=e.ix,s.c.setGroupProperty(PropertyInterface("Copies",i)),s.o.setGroupProperty(PropertyInterface("Offset",i)),Object.defineProperties(r,{copies:{get:ExpressionPropertyInterface(s.c)},offset:{get:ExpressionPropertyInterface(s.o)},_name:{value:e.nm}}),r.mn=e.mn,r}return function(t,n,r){var i;function s(e){if("number"==typeof e)return 0===(e=void 0===e?1:e)?r:i[e-1];for(var t=0,n=i.length;t<n;){if(i[t]._name===e)return i[t];t+=1}return null}return s.propertyGroup=propertyGroupFactory(s,(function(){return r})),i=e(t,n,s.propertyGroup),s.numProperties=i.length,s._name="Contents",s}}(),TextExpressionInterface=function(e){var t;function n(e){return"ADBE Text Document"===e?n.sourceText:null}return Object.defineProperty(n,"sourceText",{get:function(){e.textProperty.getValue();var n=e.textProperty.currentData.t;return t&&n===t.value||((t=new String(n)).value=n||new String(n),Object.defineProperty(t,"style",{get:function(){return{fillColor:e.textProperty.currentData.fc}}})),t}}),n};function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var FootageInterface=(dataInterfaceFactory=function(e){function t(e){return"Outline"===e?t.outlineInterface():null}return t._name="Outline",t.outlineInterface=function(e){var t="",n=e.getFootageData();function r(e){if(n[e])return t=e,"object"===_typeof(n=n[e])?r:n;var i=e.indexOf(t);if(-1!==i){var s=parseInt(e.substr(i+t.length),10);return"object"===_typeof(n=n[s])?r:n}return""}return function(){return t="",n=e.getFootageData(),r}}(e),t},function(e){function t(e){return"Data"===e?t.dataInterface:null}return t._name="Data",t.dataInterface=dataInterfaceFactory(e),t}),dataInterfaceFactory,interfaces={layer:LayerExpressionInterface,effects:EffectsExpressionInterface,comp:CompExpressionInterface,shape:ShapeExpressionInterface,text:TextExpressionInterface,footage:FootageInterface};function getInterface(e){return interfaces[e]||null}var expressionHelpers={searchExpressions:function(e,t,n){t.x&&(n.k=!0,n.x=!0,n.initiateExpression=ExpressionManager.initiateExpression,n.effectsSequence.push(n.initiateExpression(e,t,n).bind(n)))},getSpeedAtTime:function(e){var t=this.getValueAtTime(e),n=this.getValueAtTime(e+-.01),r=0;if(t.length){var i;for(i=0;i<t.length;i+=1)r+=Math.pow(n[i]-t[i],2);r=100*Math.sqrt(r)}else r=0;return r},getVelocityAtTime:function(e){if(void 0!==this.vel)return this.vel;var t,n,r=-.001,i=this.getValueAtTime(e),s=this.getValueAtTime(e+r);if(i.length)for(t=createTypedArray("float32",i.length),n=0;n<i.length;n+=1)t[n]=(s[n]-i[n])/r;else t=(s-i)/r;return t},getValueAtTime:function(e){return e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<e?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(e,this._cachingAtTime),this._cachingAtTime.lastFrame=e),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(e){this.propertyGroup=e}};function addPropertyDecorator(){function e(e,t,n){if(!this.k||!this.keyframes)return this.pv;e=e?e.toLowerCase():"";var r,i,s,o,a,l=this.comp.renderedFrame,c=this.keyframes,d=c[c.length-1].t;if(l<=d)return this.pv;if(n?i=d-(r=t?Math.abs(d-this.elem.comp.globalData.frameRate*t):Math.max(0,d-this.elem.data.ip)):((!t||t>c.length-1)&&(t=c.length-1),r=d-(i=c[c.length-1-t].t)),"pingpong"===e){if(Math.floor((l-i)/r)%2!=0)return this.getValueAtTime((r-(l-i)%r+i)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var h=this.getValueAtTime(i/this.comp.globalData.frameRate,0),u=this.getValueAtTime(d/this.comp.globalData.frameRate,0),p=this.getValueAtTime(((l-i)%r+i)/this.comp.globalData.frameRate,0),f=Math.floor((l-i)/r);if(this.pv.length){for(o=(a=new Array(h.length)).length,s=0;s<o;s+=1)a[s]=(u[s]-h[s])*f+p[s];return a}return(u-h)*f+p}if("continue"===e){var m=this.getValueAtTime(d/this.comp.globalData.frameRate,0),g=this.getValueAtTime((d-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(o=(a=new Array(m.length)).length,s=0;s<o;s+=1)a[s]=m[s]+(m[s]-g[s])*((l-d)/this.comp.globalData.frameRate)/5e-4;return a}return m+(l-d)/.001*(m-g)}}return this.getValueAtTime(((l-i)%r+i)/this.comp.globalData.frameRate,0)}function t(e,t,n){if(!this.k)return this.pv;e=e?e.toLowerCase():"";var r,i,s,o,a,l=this.comp.renderedFrame,c=this.keyframes,d=c[0].t;if(l>=d)return this.pv;if(n?i=d+(r=t?Math.abs(this.elem.comp.globalData.frameRate*t):Math.max(0,this.elem.data.op-d)):((!t||t>c.length-1)&&(t=c.length-1),r=(i=c[t].t)-d),"pingpong"===e){if(Math.floor((d-l)/r)%2==0)return this.getValueAtTime(((d-l)%r+d)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var h=this.getValueAtTime(d/this.comp.globalData.frameRate,0),u=this.getValueAtTime(i/this.comp.globalData.frameRate,0),p=this.getValueAtTime((r-(d-l)%r+d)/this.comp.globalData.frameRate,0),f=Math.floor((d-l)/r)+1;if(this.pv.length){for(o=(a=new Array(h.length)).length,s=0;s<o;s+=1)a[s]=p[s]-(u[s]-h[s])*f;return a}return p-(u-h)*f}if("continue"===e){var m=this.getValueAtTime(d/this.comp.globalData.frameRate,0),g=this.getValueAtTime((d+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(o=(a=new Array(m.length)).length,s=0;s<o;s+=1)a[s]=m[s]+(m[s]-g[s])*(d-l)/.001;return a}return m+(m-g)*(d-l)/.001}}return this.getValueAtTime((r-((d-l)%r+d))/this.comp.globalData.frameRate,0)}function n(e,t){if(!this.k)return this.pv;if(e=.5*(e||.4),(t=Math.floor(t||5))<=1)return this.pv;var n,r,i=this.comp.renderedFrame/this.comp.globalData.frameRate,s=i-e,o=t>1?(i+e-s)/(t-1):1,a=0,l=0;for(n=this.pv.length?createTypedArray("float32",this.pv.length):0;a<t;){if(r=this.getValueAtTime(s+a*o),this.pv.length)for(l=0;l<this.pv.length;l+=1)n[l]+=r[l];else n+=r;a+=1}if(this.pv.length)for(l=0;l<this.pv.length;l+=1)n[l]/=t;else n/=t;return n}function r(e){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var t=this._transformCachingAtTime.v;if(t.cloneFromProps(this.pre.props),this.appliedTransformations<1){var n=this.a.getValueAtTime(e);t.translate(-n[0]*this.a.mult,-n[1]*this.a.mult,n[2]*this.a.mult)}if(this.appliedTransformations<2){var r=this.s.getValueAtTime(e);t.scale(r[0]*this.s.mult,r[1]*this.s.mult,r[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var i=this.sk.getValueAtTime(e),s=this.sa.getValueAtTime(e);t.skewFromAxis(-i*this.sk.mult,s*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var o=this.r.getValueAtTime(e);t.rotate(-o*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var a=this.rz.getValueAtTime(e),l=this.ry.getValueAtTime(e),c=this.rx.getValueAtTime(e),d=this.or.getValueAtTime(e);t.rotateZ(-a*this.rz.mult).rotateY(l*this.ry.mult).rotateX(c*this.rx.mult).rotateZ(-d[2]*this.or.mult).rotateY(d[1]*this.or.mult).rotateX(d[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var h=this.px.getValueAtTime(e),u=this.py.getValueAtTime(e);if(this.data.p.z){var p=this.pz.getValueAtTime(e);t.translate(h*this.px.mult,u*this.py.mult,-p*this.pz.mult)}else t.translate(h*this.px.mult,u*this.py.mult,0)}else{var f=this.p.getValueAtTime(e);t.translate(f[0]*this.p.mult,f[1]*this.p.mult,-f[2]*this.p.mult)}return t}function i(){return this.v.clone(new Matrix)}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(e,t,n){var o=s(e,t,n);return o.dynamicProperties.length?o.getValueAtTime=r.bind(o):o.getValueAtTime=i.bind(o),o.setGroupProperty=expressionHelpers.setGroupProperty,o};var o=PropertyFactory.getProp;PropertyFactory.getProp=function(r,i,s,a,l){var c=o(r,i,s,a,l);c.kf?c.getValueAtTime=expressionHelpers.getValueAtTime.bind(c):c.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(c),c.setGroupProperty=expressionHelpers.setGroupProperty,c.loopOut=e,c.loopIn=t,c.smooth=n,c.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(c),c.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(c),c.numKeys=1===i.a?i.k.length:0,c.propertyIndex=i.ix;var d=0;return 0!==s&&(d=createTypedArray("float32",1===i.a?i.k[0].s.length:i.k.length)),c._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:d},expressionHelpers.searchExpressions(r,i,c),c.k&&l.addDynamicProperty(c),c};var a=ShapePropertyFactory.getConstructorFunction(),l=ShapePropertyFactory.getKeyframedConstructorFunction();function c(){}c.prototype={vertices:function(e,t){this.k&&this.getValue();var n,r=this.v;void 0!==t&&(r=this.getValueAtTime(t,0));var i=r._length,s=r[e],o=r.v,a=createSizedArray(i);for(n=0;n<i;n+=1)a[n]="i"===e||"o"===e?[s[n][0]-o[n][0],s[n][1]-o[n][1]]:[s[n][0],s[n][1]];return a},points:function(e){return this.vertices("v",e)},inTangents:function(e){return this.vertices("i",e)},outTangents:function(e){return this.vertices("o",e)},isClosed:function(){return this.v.c},pointOnPath:function(e,t){var n=this.v;void 0!==t&&(n=this.getValueAtTime(t,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(n));for(var r,i=this._segmentsLength,s=i.lengths,o=i.totalLength*e,a=0,l=s.length,c=0;a<l;){if(c+s[a].addedLength>o){var d=a,h=n.c&&a===l-1?0:a+1,u=(o-c)/s[a].addedLength;r=bez.getPointInSegment(n.v[d],n.v[h],n.o[d],n.i[h],u,s[a]);break}c+=s[a].addedLength,a+=1}return r||(r=n.c?[n.v[0][0],n.v[0][1]]:[n.v[n._length-1][0],n.v[n._length-1][1]]),r},vectorOnPath:function(e,t,n){1==e?e=this.v.c:0==e&&(e=.999);var r=this.pointOnPath(e,t),i=this.pointOnPath(e+.001,t),s=i[0]-r[0],o=i[1]-r[1],a=Math.sqrt(Math.pow(s,2)+Math.pow(o,2));return 0===a?[0,0]:"tangent"===n?[s/a,o/a]:[-o/a,s/a]},tangentOnPath:function(e,t){return this.vectorOnPath(e,t,"tangent")},normalOnPath:function(e,t){return this.vectorOnPath(e,t,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([c],a),extendPrototype([c],l),l.prototype.getValueAtTime=function(e){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<e?this._caching.lastIndex:0,this._cachingAtTime.lastTime=e,this.interpolateShape(e,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},l.prototype.initiateExpression=ExpressionManager.initiateExpression;var d=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(e,t,n,r,i){var s=d(e,t,n,r,i);return s.propertyIndex=t.ix,s.lock=!1,3===n?expressionHelpers.searchExpressions(e,t.pt,s):4===n&&expressionHelpers.searchExpressions(e,t.ks,s),s.k&&e.addDynamicProperty(s),s}}function initialize$1(){addPropertyDecorator()}function addDecorator(){TextProperty.prototype.getExpressionValue=function(e,t){var n=this.calculateExpression(t);if(e.t!==n){var r={};return this.copyData(r,e),r.t=n.toString(),r.__complete=!1,r}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),t=this.searchExpressions();return this.kf=e||t,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function(e,t){var n,r,i=createNS("feMerge");for(i.setAttribute("result",e),r=0;r<t.length;r+=1)(n=createNS("feMergeNode")).setAttribute("in",t[r]),i.appendChild(n),i.appendChild(n);return i}};var linearFilterValue="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";function SVGTintFilter(e,t,n,r,i){this.filterManager=t;var s=createNS("feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","linearRGB"),s.setAttribute("values",linearFilterValue+" 1 0"),this.linearFilter=s,s.setAttribute("result",r+"_tint_1"),e.appendChild(s),(s=createNS("feColorMatrix")).setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),s.setAttribute("result",r+"_tint_2"),e.appendChild(s),this.matrixFilter=s;var o=this.createMergeNode(r,[i,r+"_tint_1",r+"_tint_2"]);e.appendChild(o)}function SVGFillFilter(e,t,n,r){this.filterManager=t;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),i.setAttribute("result",r),e.appendChild(i),this.matrixFilter=i}function SVGStrokeEffect(e,t,n){this.initialized=!1,this.filterManager=t,this.elem=n,this.paths=[]}function SVGTritoneFilter(e,t,n,r){this.filterManager=t;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","linearRGB"),i.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),e.appendChild(i);var s=createNS("feComponentTransfer");s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("result",r),this.matrixFilter=s;var o=createNS("feFuncR");o.setAttribute("type","table"),s.appendChild(o),this.feFuncR=o;var a=createNS("feFuncG");a.setAttribute("type","table"),s.appendChild(a),this.feFuncG=a;var l=createNS("feFuncB");l.setAttribute("type","table"),s.appendChild(l),this.feFuncB=l,e.appendChild(s)}function SVGProLevelsFilter(e,t,n,r){this.filterManager=t;var i=this.filterManager.effectElements,s=createNS("feComponentTransfer");(i[10].p.k||0!==i[10].p.v||i[11].p.k||1!==i[11].p.v||i[12].p.k||1!==i[12].p.v||i[13].p.k||0!==i[13].p.v||i[14].p.k||1!==i[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",s)),(i[17].p.k||0!==i[17].p.v||i[18].p.k||1!==i[18].p.v||i[19].p.k||1!==i[19].p.v||i[20].p.k||0!==i[20].p.v||i[21].p.k||1!==i[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",s)),(i[24].p.k||0!==i[24].p.v||i[25].p.k||1!==i[25].p.v||i[26].p.k||1!==i[26].p.v||i[27].p.k||0!==i[27].p.v||i[28].p.k||1!==i[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",s)),(i[31].p.k||0!==i[31].p.v||i[32].p.k||1!==i[32].p.v||i[33].p.k||1!==i[33].p.v||i[34].p.k||0!==i[34].p.v||i[35].p.k||1!==i[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",s)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(s.setAttribute("color-interpolation-filters","sRGB"),e.appendChild(s)),(i[3].p.k||0!==i[3].p.v||i[4].p.k||1!==i[4].p.v||i[5].p.k||1!==i[5].p.v||i[6].p.k||0!==i[6].p.v||i[7].p.k||1!==i[7].p.v)&&((s=createNS("feComponentTransfer")).setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("result",r),e.appendChild(s),this.feFuncRComposed=this.createFeFunc("feFuncR",s),this.feFuncGComposed=this.createFeFunc("feFuncG",s),this.feFuncBComposed=this.createFeFunc("feFuncB",s))}function SVGDropShadowEffect(e,t,n,r,i){var s=t.container.globalData.renderConfig.filterSize,o=t.data.fs||s;e.setAttribute("x",o.x||s.x),e.setAttribute("y",o.y||s.y),e.setAttribute("width",o.width||s.width),e.setAttribute("height",o.height||s.height),this.filterManager=t;var a=createNS("feGaussianBlur");a.setAttribute("in","SourceAlpha"),a.setAttribute("result",r+"_drop_shadow_1"),a.setAttribute("stdDeviation","0"),this.feGaussianBlur=a,e.appendChild(a);var l=createNS("feOffset");l.setAttribute("dx","25"),l.setAttribute("dy","0"),l.setAttribute("in",r+"_drop_shadow_1"),l.setAttribute("result",r+"_drop_shadow_2"),this.feOffset=l,e.appendChild(l);var c=createNS("feFlood");c.setAttribute("flood-color","#00ff00"),c.setAttribute("flood-opacity","1"),c.setAttribute("result",r+"_drop_shadow_3"),this.feFlood=c,e.appendChild(c);var d=createNS("feComposite");d.setAttribute("in",r+"_drop_shadow_3"),d.setAttribute("in2",r+"_drop_shadow_2"),d.setAttribute("operator","in"),d.setAttribute("result",r+"_drop_shadow_4"),e.appendChild(d);var h=this.createMergeNode(r,[r+"_drop_shadow_4",i]);e.appendChild(h)}extendPrototype([SVGComposableEffect],SVGTintFilter),SVGTintFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,n=this.filterManager.effectElements[1].p.v,r=this.filterManager.effectElements[2].p.v/100;this.linearFilter.setAttribute("values",linearFilterValue+" "+r+" 0"),this.matrixFilter.setAttribute("values",n[0]-t[0]+" 0 0 0 "+t[0]+" "+(n[1]-t[1])+" 0 0 0 "+t[1]+" "+(n[2]-t[2])+" 0 0 0 "+t[2]+" 0 0 0 1 0")}},SVGFillFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[2].p.v,n=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+t[0]+" 0 0 0 0 "+t[1]+" 0 0 0 0 "+t[2]+" 0 0 0 "+n+" 0")}},SVGStrokeEffect.prototype.initialize=function(){var e,t,n,r,i=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(r=this.elem.maskManager.masksProperties.length,n=0):r=1+(n=this.filterManager.effectElements[0].p.v-1),(t=createNS("g")).setAttribute("fill","none"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-dashoffset",1);n<r;n+=1)e=createNS("path"),t.appendChild(e),this.paths.push({p:e,m:n});if(3===this.filterManager.effectElements[10].p.v){var s=createNS("mask"),o=createElementID();s.setAttribute("id",o),s.setAttribute("mask-type","alpha"),s.appendChild(t),this.elem.globalData.defs.appendChild(s);var a=createNS("g");for(a.setAttribute("mask","url("+getLocationHref()+"#"+o+")");i[0];)a.appendChild(i[0]);this.elem.layerElement.appendChild(a),this.masker=s,t.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(i=this.elem.layerElement.children||this.elem.layerElement.childNodes;i.length;)this.elem.layerElement.removeChild(i[0]);this.elem.layerElement.appendChild(t),this.elem.layerElement.removeAttribute("mask"),t.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=t},SVGStrokeEffect.prototype.renderFrame=function(e){var t;this.initialized||this.initialize();var n,r,i=this.paths.length;for(t=0;t<i;t+=1)if(-1!==this.paths[t].m&&(n=this.elem.maskManager.viewData[this.paths[t].m],r=this.paths[t].p,(e||this.filterManager._mdf||n.prop._mdf)&&r.setAttribute("d",n.lastPath),e||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||n.prop._mdf)){var s;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var o=.01*Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),a=.01*Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),l=r.getTotalLength();s="0 0 0 "+l*o+" ";var c,d=l*(a-o),h=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01,u=Math.floor(d/h);for(c=0;c<u;c+=1)s+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01+" ";s+="0 "+10*l+" 0 0"}else s="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01;r.setAttribute("stroke-dasharray",s)}if((e||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(e||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(e||this.filterManager.effectElements[3].p._mdf)){var p=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(255*p[0])+","+bmFloor(255*p[1])+","+bmFloor(255*p[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,n=this.filterManager.effectElements[1].p.v,r=this.filterManager.effectElements[2].p.v,i=r[0]+" "+n[0]+" "+t[0],s=r[1]+" "+n[1]+" "+t[1],o=r[2]+" "+n[2]+" "+t[2];this.feFuncR.setAttribute("tableValues",i),this.feFuncG.setAttribute("tableValues",s),this.feFuncB.setAttribute("tableValues",o)}},SVGProLevelsFilter.prototype.createFeFunc=function(e,t){var n=createNS(e);return n.setAttribute("type","table"),t.appendChild(n),n},SVGProLevelsFilter.prototype.getTableValue=function(e,t,n,r,i){for(var s,o,a=0,l=Math.min(e,t),c=Math.max(e,t),d=Array.call(null,{length:256}),h=0,u=i-r,p=t-e;a<=256;)o=(s=a/256)<=l?p<0?i:r:s>=c?p<0?r:i:r+u*Math.pow((s-e)/p,1/n),d[h]=o,h+=1,a+=256/255;return d.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t,n=this.filterManager.effectElements;this.feFuncRComposed&&(e||n[3].p._mdf||n[4].p._mdf||n[5].p._mdf||n[6].p._mdf||n[7].p._mdf)&&(t=this.getTableValue(n[3].p.v,n[4].p.v,n[5].p.v,n[6].p.v,n[7].p.v),this.feFuncRComposed.setAttribute("tableValues",t),this.feFuncGComposed.setAttribute("tableValues",t),this.feFuncBComposed.setAttribute("tableValues",t)),this.feFuncR&&(e||n[10].p._mdf||n[11].p._mdf||n[12].p._mdf||n[13].p._mdf||n[14].p._mdf)&&(t=this.getTableValue(n[10].p.v,n[11].p.v,n[12].p.v,n[13].p.v,n[14].p.v),this.feFuncR.setAttribute("tableValues",t)),this.feFuncG&&(e||n[17].p._mdf||n[18].p._mdf||n[19].p._mdf||n[20].p._mdf||n[21].p._mdf)&&(t=this.getTableValue(n[17].p.v,n[18].p.v,n[19].p.v,n[20].p.v,n[21].p.v),this.feFuncG.setAttribute("tableValues",t)),this.feFuncB&&(e||n[24].p._mdf||n[25].p._mdf||n[26].p._mdf||n[27].p._mdf||n[28].p._mdf)&&(t=this.getTableValue(n[24].p.v,n[25].p.v,n[26].p.v,n[27].p.v,n[28].p.v),this.feFuncB.setAttribute("tableValues",t)),this.feFuncA&&(e||n[31].p._mdf||n[32].p._mdf||n[33].p._mdf||n[34].p._mdf||n[35].p._mdf)&&(t=this.getTableValue(n[31].p.v,n[32].p.v,n[33].p.v,n[34].p.v,n[35].p.v),this.feFuncA.setAttribute("tableValues",t))}},extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){if((e||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),e||this.filterManager.effectElements[0].p._mdf){var t=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*t[0]),Math.round(255*t[1]),Math.round(255*t[2])))}if((e||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),e||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var n=this.filterManager.effectElements[3].p.v,r=(this.filterManager.effectElements[2].p.v-90)*degToRads,i=n*Math.cos(r),s=n*Math.sin(r);this.feOffset.setAttribute("dx",i),this.feOffset.setAttribute("dy",s)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(e,t,n){this.initialized=!1,this.filterManager=t,this.filterElem=e,this.elem=n,n.matteElement=createNS("g"),n.matteElement.appendChild(n.layerElement),n.matteElement.appendChild(n.transformedElement),n.baseElement=n.matteElement}function SVGGaussianBlurEffect(e,t,n,r){e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width","300%"),e.setAttribute("height","300%"),this.filterManager=t;var i=createNS("feGaussianBlur");i.setAttribute("result",r),e.appendChild(i),this.feGaussianBlur=i}function TransformEffect(){}function SVGTransformEffect(e,t){this.init(t)}function CVTransformEffect(e){this.init(e)}return SVGMatte3Effect.prototype.findSymbol=function(e){for(var t=0,n=_svgMatteSymbols.length;t<n;){if(_svgMatteSymbols[t]===e)return _svgMatteSymbols[t];t+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(e,t){var n=e.layerElement.parentNode;if(n){for(var r,i=n.children,s=0,o=i.length;s<o&&i[s]!==e.layerElement;)s+=1;s<=o-2&&(r=i[s+1]);var a=createNS("use");a.setAttribute("href","#"+t),r?n.insertBefore(a,r):n.appendChild(a)}},SVGMatte3Effect.prototype.setElementAsMask=function(e,t){if(!this.findSymbol(t)){var n=createElementID(),r=createNS("mask");r.setAttribute("id",t.layerId),r.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(t);var i=e.globalData.defs;i.appendChild(r);var s=createNS("symbol");s.setAttribute("id",n),this.replaceInParent(t,n),s.appendChild(t.layerElement),i.appendChild(s);var o=createNS("use");o.setAttribute("href","#"+n),r.appendChild(o),t.data.hd=!1,t.show()}e.setMatte(t.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var e=this.filterManager.effectElements[0].p.v,t=this.elem.comp.elements,n=0,r=t.length;n<r;)t[n]&&t[n].data.ind===e&&this.setElementAsMask(this.elem,t[n]),n+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGGaussianBlurEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=.3*this.filterManager.effectElements[0].p.v,n=this.filterManager.effectElements[1].p.v,r=3==n?0:t,i=2==n?0:t;this.feGaussianBlur.setAttribute("stdDeviation",r+" "+i);var s=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",s)}},TransformEffect.prototype.init=function(e){this.effectsManager=e,this.type=effectTypes.TRANSFORM_EFFECT,this.matrix=new Matrix,this.opacity=-1,this._mdf=!1,this._opMdf=!1},TransformEffect.prototype.renderFrame=function(e){if(this._opMdf=!1,this._mdf=!1,e||this.effectsManager._mdf){var t=this.effectsManager.effectElements,n=t[0].p.v,r=t[1].p.v,i=1===t[2].p.v,s=t[3].p.v,o=i?s:t[4].p.v,a=t[5].p.v,l=t[6].p.v,c=t[7].p.v;this.matrix.reset(),this.matrix.translate(-n[0],-n[1],n[2]),this.matrix.scale(.01*o,.01*s,1),this.matrix.rotate(-c*degToRads),this.matrix.skewFromAxis(-a*degToRads,(l+90)*degToRads),this.matrix.translate(r[0],r[1],0),this._mdf=!0,this.opacity!==t[8].p.v&&(this.opacity=t[8].p.v,this._opMdf=!0)}},extendPrototype([TransformEffect],SVGTransformEffect),extendPrototype([TransformEffect],CVTransformEffect),registerRenderer("canvas",CanvasRenderer),registerRenderer("html",HybridRenderer),registerRenderer("svg",SVGRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier),setExpressionsPlugin(Expressions),setExpressionInterfaces(getInterface),initialize$1(),initialize(),registerEffect$1(20,SVGTintFilter,!0),registerEffect$1(21,SVGFillFilter,!0),registerEffect$1(22,SVGStrokeEffect,!1),registerEffect$1(23,SVGTritoneFilter,!0),registerEffect$1(24,SVGProLevelsFilter,!0),registerEffect$1(25,SVGDropShadowEffect,!0),registerEffect$1(28,SVGMatte3Effect,!1),registerEffect$1(29,SVGGaussianBlurEffect,!0),registerEffect$1(35,SVGTransformEffect,!1),registerEffect(35,CVTransformEffect),lottie},module.exports=factory())},pjuZ:()=>{!function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function s(e,t){return e=e.replace(/<S>/g,(function(){return n})).replace(/<BRACES>/g,(function(){return r})).replace(/<SPREAD>/g,(function(){return i})),RegExp(e,t)}i=s(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=s(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:s(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:s(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(o).join(""):""},a=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],s=!1;if("string"!=typeof i&&("tag"===i.type&&i.content[0]&&"tag"===i.content[0].type?"</"===i.content[0].content[0].content?n.length>0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():"/>"===i.content[i.content.length-1].content||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===i.type&&"{"===i.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===i.type&&"}"===i.content?n[n.length-1].openedBraces--:s=!0),(s||"string"==typeof i)&&n.length>0&&0===n[n.length-1].openedBraces){var l=o(i);r<t.length-1&&("string"==typeof t[r+1]||"plain-text"===t[r+1].type)&&(l+=o(t[r+1]),t.splice(r+1,1)),r>0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(l=o(t[r-1])+l,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",l,null,l)}i.content&&"string"!=typeof i.content&&a(i.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||a(e.tokens)}))}(Prism)},Vwau:()=>{!function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(Prism)},uvM7:()=>{!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var e="line-numbers",t=/\n(?!$)/g,n=Prism.plugins.lineNumbers={getLine:function(t,n){if("PRE"===t.tagName&&t.classList.contains(e)){var r=t.querySelector(".line-numbers-rows");if(r){var i=parseInt(t.getAttribute("data-start"),10)||1,s=i+(r.children.length-1);n<i&&(n=i),n>s&&(n=s);var o=n-i;return r.children[o]}}},resize:function(e){i([e])},assumeViewportIndependence:!0},r=void 0;window.addEventListener("resize",(function(){n.assumeViewportIndependence&&r===window.innerWidth||(r=window.innerWidth,i(Array.prototype.slice.call(document.querySelectorAll("pre.line-numbers"))))})),Prism.hooks.add("complete",(function(n){if(n.code){var r=n.element,s=r.parentNode;if(s&&/pre/i.test(s.nodeName)&&!r.querySelector(".line-numbers-rows")&&Prism.util.isActive(r,e)){r.classList.remove(e),s.classList.add(e);var o,a=n.code.match(t),l=a?a.length+1:1,c=new Array(l+1).join("<span></span>");(o=document.createElement("span")).setAttribute("aria-hidden","true"),o.className="line-numbers-rows",o.innerHTML=c,s.hasAttribute("data-start")&&(s.style.counterReset="linenumber "+(parseInt(s.getAttribute("data-start"),10)-1)),n.element.appendChild(o),i([s]),Prism.hooks.run("line-numbers",n)}}})),Prism.hooks.add("line-numbers",(function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}))}function i(e){if(0!=(e=e.filter((function(e){var t,n=(t=e,t?window.getComputedStyle?getComputedStyle(t):t.currentStyle||null:null)["white-space"];return"pre-wrap"===n||"pre-line"===n}))).length){var n=e.map((function(e){var n=e.querySelector("code"),r=e.querySelector(".line-numbers-rows");if(n&&r){var i=e.querySelector(".line-numbers-sizer"),s=n.textContent.split(t);i||((i=document.createElement("span")).className="line-numbers-sizer",n.appendChild(i)),i.innerHTML="0",i.style.display="block";var o=i.getBoundingClientRect().height;return i.innerHTML="",{element:e,lines:s,lineHeights:[],oneLinerHeight:o,sizer:i}}})).filter(Boolean);n.forEach((function(e){var t=e.sizer,n=e.lines,r=e.lineHeights,i=e.oneLinerHeight;r[n.length-1]=void 0,n.forEach((function(e,n){if(e&&e.length>1){var s=t.appendChild(document.createElement("span"));s.style.display="block",s.textContent=e}else r[n]=i}))})),n.forEach((function(e){for(var t=e.sizer,n=e.lineHeights,r=0,i=0;i<n.length;i++)void 0===n[i]&&(n[i]=t.children[r++].getBoundingClientRect().height)})),n.forEach((function(e){var t=e.sizer,n=e.element.querySelector(".line-numbers-rows");t.style.display="none",t.innerHTML="",e.lineHeights.forEach((function(e,t){n.children[t].style.height=e+"px"}))}))}}}()},n5u1:(e,t,n)=>{var r=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof s?new s(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,s;switch(n=n||{},i.util.type(t)){case"Object":if(s=i.util.objId(t),n[s])return n[s];for(var o in r={},n[s]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case"Array":return s=i.util.objId(t),n[s]?n[s]:(r=[],n[s]=r,t.forEach((function(t,i){r[i]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var s=(r=r||i.languages)[e],o={};for(var a in s)if(s.hasOwnProperty(a)){if(a==t)for(var l in n)n.hasOwnProperty(l)&&(o[l]=n[l]);n.hasOwnProperty(a)||(o[a]=s[a])}var c=r[e];return r[e]=o,i.languages.DFS(i.languages,(function(t,n){n===c&&t!=e&&(this[t]=o)})),o},DFS:function e(t,n,r,s){s=s||{};var o=i.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],r||a);var l=t[a],c=i.util.type(l);"Object"!==c||s[o(l)]?"Array"!==c||s[o(l)]||(s[o(l)]=!0,e(l,n,a,s)):(s[o(l)]=!0,e(l,n,null,s))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run("before-all-elements-highlight",r);for(var s,o=0;s=r.elements[o++];)i.highlightElement(s,!0===t,r.callback)},highlightElement:function(t,n,r){var s=i.util.getLanguage(t),o=i.languages[s];i.util.setLanguage(t,s);var a=t.parentElement;a&&"pre"===a.nodeName.toLowerCase()&&i.util.setLanguage(a,s);var l={element:t,language:s,grammar:o,code:t.textContent};function c(e){l.highlightedCode=e,i.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,i.hooks.run("after-highlight",l),i.hooks.run("complete",l),r&&r.call(l.element)}if(i.hooks.run("before-sanity-check",l),(a=l.element.parentElement)&&"pre"===a.nodeName.toLowerCase()&&!a.hasAttribute("tabindex")&&a.setAttribute("tabindex","0"),!l.code)return i.hooks.run("complete",l),void(r&&r.call(l.element));if(i.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var d=new Worker(i.filename);d.onmessage=function(e){c(e.data)},d.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else c(i.highlight(l.code,l.grammar,l.language));else c(i.util.encode(l.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run("after-tokenize",r),s.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new l;return c(i,i.head,e),a(e,i,t,i.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(n&&n.length)for(var r,s=0;r=n[s++];)r(t)}},Token:s};function s(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var s=i[1].length;i.index+=s,i[0]=i[0].slice(s)}return i}function a(e,t,n,r,l,h){for(var u in n)if(n.hasOwnProperty(u)&&n[u]){var p=n[u];p=Array.isArray(p)?p:[p];for(var f=0;f<p.length;++f){if(h&&h.cause==u+","+f)return;var m=p[f],g=m.inside,y=!!m.lookbehind,v=!!m.greedy,b=m.alias;if(v&&!m.pattern.global){var w=m.pattern.toString().match(/[imsuy]*$/)[0];m.pattern=RegExp(m.pattern.source,w+"g")}for(var x=m.pattern||m,E=r.next,C=l;E!==t.tail&&!(h&&C>=h.reach);C+=E.value.length,E=E.next){var S=E.value;if(t.length>e.length)return;if(!(S instanceof s)){var _,k=1;if(v){if(!(_=o(x,C,e,y))||_.index>=e.length)break;var O=_.index,T=_.index+_[0].length,P=C;for(P+=E.value.length;O>=P;)P+=(E=E.next).value.length;if(C=P-=E.value.length,E.value instanceof s)continue;for(var I=E;I!==t.tail&&(P<T||"string"==typeof I.value);I=I.next)k++,P+=I.value.length;k--,S=e.slice(C,P),_.index-=C}else if(!(_=o(x,0,S,y)))continue;O=_.index;var M=_[0],R=S.slice(0,O),A=S.slice(O+M.length),N=C+S.length;h&&N>h.reach&&(h.reach=N);var D=E.prev;if(R&&(D=c(t,D,R),C+=R.length),d(t,D,k),E=c(t,D,new s(u,g?i.tokenize(M,g):M,b,M)),A&&c(t,E,A),k>1){var L={cause:u+","+f,reach:N};a(e,t,n,E.prev,C,L),h&&L.reach>h.reach&&(h.reach=L.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function d(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}if(e.Prism=i,s.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var s={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(s.classes,o):s.classes.push(o)),i.hooks.run("wrap",s);var a="";for(var l in s.attributes)a+=" "+l+'="'+(s.attributes[l]||"").replace(/"/g,""")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'"'+a+">"+s.content+"</"+s.tag+">"},!e.document)return e.addEventListener?(i.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,s=n.code,o=n.immediateClose;e.postMessage(i.highlight(s,i.languages[r],r)),o&&e.close()}),!1),i):i;var h=i.util.currentScript();function u(){i.manual||i.highlightAll()}if(h&&(i.filename=h.src,h.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var p=document.readyState;"loading"===p||"interactive"===p&&h&&h.defer?document.addEventListener("DOMContentLoaded",u):window.requestAnimationFrame?window.requestAnimationFrame(u):window.setTimeout(u,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r),r.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:r.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};i["language-"+t]={pattern:/[\s\S]+/,inside:r.languages[t]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:i},r.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(e,t){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:r.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(r),r.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),r.languages.js=r.languages.javascript,function(){if(void 0!==r&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",i="loaded",s="pre[data-src]:not(["+t+'="'+i+'"]):not(['+t+'="'+n+'"])';r.hooks.add("before-highlightall",(function(e){e.selector+=", "+s})),r.hooks.add("before-sanity-check",(function(o){var a=o.element;if(a.matches(s)){o.code="",a.setAttribute(t,n);var l=a.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=a.getAttribute("data-src"),d=o.language;if("none"===d){var h=(/\.(\w+)$/.exec(c)||[,"none"])[1];d=e[h]||h}r.util.setLanguage(l,d),r.util.setLanguage(a,d);var u=r.plugins.autoloader;u&&u.loadLanguages(d),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n("✖ Error "+r.status+" while fetching file: "+r.statusText):n("✖ Error: File does not exist or is empty"))},r.send(null)}(c,(function(e){a.setAttribute(t,i);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(a.getAttribute("data-range"));if(n){var s=e.split(/\r\n?|\n/g),o=n[0],c=null==n[1]?s.length:n[1];o<0&&(o+=s.length),o=Math.max(0,Math.min(o-1,s.length)),c<0&&(c+=s.length),c=Math.max(0,Math.min(c,s.length)),e=s.slice(o,c).join("\n"),a.hasAttribute("data-start")||a.setAttribute("data-start",String(o+1))}l.textContent=e,r.highlightElement(l)}),(function(e){a.setAttribute(t,"failed"),l.textContent=e}))}})),r.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(s),i=0;t=n[i++];)r.highlightElement(t)}};var o=!1;r.fileHighlight=function(){o||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),o=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},emlf:(e,t,n)=>{"use strict";var r=n("YjNL");function i(){}function s(){}s.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,s,o){if(o!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:i};return n.PropTypes=n,n}},aWzz:(e,t,n)=>{e.exports=n("emlf")()},YjNL:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},dB0S:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return d.default}}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}r.default=e,n&&n.set(e,r);return r}(n("neV8")),i=u(n("aWzz")),s=u(n("sw63")),o=u(n("7O4Y")),a=n("I5Pb"),l=n("NPwy"),c=n("cCoX"),d=u(n("TPNd")),h=u(n("6iX0"));function u(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function m(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class g extends r.Component{static getDerivedStateFromProps(e,t){let{position:n}=e,{prevPropsPosition:r}=t;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,h.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:{...n}})}constructor(e){super(e),m(this,"onDragStart",((e,t)=>{(0,h.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,l.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})})),m(this,"onDrag",((e,t)=>{if(!this.state.dragging)return!1;(0,h.default)("Draggable: onDrag: %j",t);const n=(0,l.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;const[i,s]=(0,l.getBoundPosition)(this,r.x,r.y);r.x=i,r.y=s,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)})),m(this,"onDragStop",((e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,l.createDraggableData)(this,t)))return!1;(0,h.default)("Draggable: onDragStop: %j",t);const n={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)})),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:s.default.findDOMNode(this)}render(){const{axis:e,bounds:t,children:n,defaultPosition:i,defaultClassName:s,defaultClassNameDragging:c,defaultClassNameDragged:h,position:u,positionOffset:p,scale:m,...g}=this.props;let y={},v=null;const b=!Boolean(u)||this.state.dragging,w=u||i,x={x:(0,l.canDragX)(this)&&b?this.state.x:w.x,y:(0,l.canDragY)(this)&&b?this.state.y:w.y};this.state.isElementSVG?v=(0,a.createSVGTransform)(x,p):y=(0,a.createCSSTransform)(x,p);const E=(0,o.default)(n.props.className||"",s,{[c]:this.state.dragging,[h]:this.state.dragged});return r.createElement(d.default,f({},g,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),r.cloneElement(r.Children.only(n),{className:E,style:{...n.props.style,...y},transform:v}))}}t.default=g,m(g,"displayName","Draggable"),m(g,"propTypes",{...d.default.propTypes,axis:i.default.oneOf(["both","x","y","none"]),bounds:i.default.oneOfType([i.default.shape({left:i.default.number,right:i.default.number,top:i.default.number,bottom:i.default.number}),i.default.string,i.default.oneOf([!1])]),defaultClassName:i.default.string,defaultClassNameDragging:i.default.string,defaultClassNameDragged:i.default.string,defaultPosition:i.default.shape({x:i.default.number,y:i.default.number}),positionOffset:i.default.shape({x:i.default.oneOfType([i.default.number,i.default.string]),y:i.default.oneOfType([i.default.number,i.default.string])}),position:i.default.shape({x:i.default.number,y:i.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),m(g,"defaultProps",{...d.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})},TPNd:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}r.default=e,n&&n.set(e,r);return r}(n("neV8")),i=d(n("aWzz")),s=d(n("sw63")),o=n("I5Pb"),a=n("NPwy"),l=n("cCoX"),c=d(n("6iX0"));function d(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const p={start:"touchstart",move:"touchmove",stop:"touchend"},f={start:"mousedown",move:"mousemove",stop:"mouseup"};let m=f;class g extends r.Component{constructor(){super(...arguments),u(this,"dragging",!1),u(this,"lastX",NaN),u(this,"lastY",NaN),u(this,"touchIdentifier",null),u(this,"mounted",!1),u(this,"handleDragStart",(e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,o.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,o.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();const r=(0,o.getTouchIdentifier)(e);this.touchIdentifier=r;const i=(0,a.getControlPosition)(e,r,this);if(null==i)return;const{x:s,y:l}=i,d=(0,a.createCoreData)(this,s,l);(0,c.default)("DraggableCore: handleDragStart: %j",d),(0,c.default)("calling",this.props.onStart);!1!==this.props.onStart(e,d)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,o.addUserSelectStyles)(n),this.dragging=!0,this.lastX=s,this.lastY=l,(0,o.addEvent)(n,m.move,this.handleDrag),(0,o.addEvent)(n,m.stop,this.handleDragStop))})),u(this,"handleDrag",(e=>{const t=(0,a.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,a.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}const i=(0,a.createCoreData)(this,n,r);(0,c.default)("DraggableCore: handleDrag: %j",i);if(!1!==this.props.onDrag(e,i)&&!1!==this.mounted)this.lastX=n,this.lastY=r;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}})),u(this,"handleDragStop",(e=>{if(!this.dragging)return;const t=(0,a.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=(0,a.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}const i=(0,a.createCoreData)(this,n,r);if(!1===this.props.onStop(e,i)||!1===this.mounted)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,o.removeUserSelectStyles)(s.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,c.default)("DraggableCore: Removing handlers"),(0,o.removeEvent)(s.ownerDocument,m.move,this.handleDrag),(0,o.removeEvent)(s.ownerDocument,m.stop,this.handleDragStop))})),u(this,"onMouseDown",(e=>(m=f,this.handleDragStart(e)))),u(this,"onMouseUp",(e=>(m=f,this.handleDragStop(e)))),u(this,"onTouchStart",(e=>(m=p,this.handleDragStart(e)))),u(this,"onTouchEnd",(e=>(m=p,this.handleDragStop(e))))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,o.addEvent)(e,p.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,o.removeEvent)(t,f.move,this.handleDrag),(0,o.removeEvent)(t,p.move,this.handleDrag),(0,o.removeEvent)(t,f.stop,this.handleDragStop),(0,o.removeEvent)(t,p.stop,this.handleDragStop),(0,o.removeEvent)(e,p.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,o.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:s.default.findDOMNode(this)}render(){return r.cloneElement(r.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}t.default=g,u(g,"displayName","DraggableCore"),u(g,"propTypes",{allowAnyClick:i.default.bool,children:i.default.node.isRequired,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:i.default.arrayOf(i.default.number),handle:i.default.string,cancel:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number,className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),u(g,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},j6Rw:(e,t,n)=>{"use strict";const{default:r,DraggableCore:i}=n("dB0S");e.exports=r,e.exports.default=r,e.exports.DraggableCore=i},I5Pb:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addClassName=c,t.addEvent=function(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,i):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},t.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&c(e.body,"react-draggable-transparent-selection")},t.createCSSTransform=function(e,t){const n=l(e,t,"px");return{[(0,i.browserPrefixToKey)("transform",i.default)]:n}},t.createSVGTransform=function(e,t){return l(e,t,"")},t.getTouch=function(e,t){return e.targetTouches&&(0,r.findInArray)(e.targetTouches,(e=>t===e.identifier))||e.changedTouches&&(0,r.findInArray)(e.changedTouches,(e=>t===e.identifier))},t.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},t.getTranslation=l,t.innerHeight=function(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,r.int)(n.paddingTop),t-=(0,r.int)(n.paddingBottom),t},t.innerWidth=function(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,r.int)(n.paddingLeft),t-=(0,r.int)(n.paddingRight),t},t.matchesSelector=a,t.matchesSelectorAndParentsTo=function(e,t,n){let r=e;do{if(a(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},t.offsetXYFromParent=function(e,t,n){const r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-r.left)/n,s=(e.clientY+t.scrollTop-r.top)/n;return{x:i,y:s}},t.outerHeight=function(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,r.int)(n.borderTopWidth),t+=(0,r.int)(n.borderBottomWidth),t},t.outerWidth=function(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,r.int)(n.borderLeftWidth),t+=(0,r.int)(n.borderRightWidth),t},t.removeClassName=d,t.removeEvent=function(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},t.removeUserSelectStyles=function(e){if(!e)return;try{if(e.body&&d(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}};var r=n("cCoX"),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n("zN8s"));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}let o="";function a(e,t){return o||(o=(0,r.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(t){return(0,r.isFunction)(e[t])}))),!!(0,r.isFunction)(e[o])&&e[o](t)}function l(e,t,n){let{x:r,y:i}=e,s="translate(".concat(r).concat(n,",").concat(i).concat(n,")");if(t){const e="".concat("string"==typeof t.x?t.x:t.x+n),r="".concat("string"==typeof t.y?t.y:t.y+n);s="translate(".concat(e,", ").concat(r,")")+s}return s}function c(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function d(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}},zN8s:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.browserPrefixToKey=i,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=void 0,t.getPrefix=r;const n=["Moz","Webkit","O","ms"];function r(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";const r=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!r)return"";if(t in r)return"";for(let e=0;e<n.length;e++)if(i(t,n[e])in r)return n[e];return""}function i(e,t){return t?"".concat(t).concat(function(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}(e)):e}t.default=r()},"6iX0":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){0}},NPwy:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},t.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},t.createCoreData=function(e,t,n){const i=!(0,r.isNum)(e.lastX),o=s(e);return i?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}},t.createDraggableData=function(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}},t.getBoundPosition=function(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:o}=e.props;o="string"==typeof o?o:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(o);const a=s(e);if("string"==typeof o){const{ownerDocument:e}=a,t=e.defaultView;let n;if(n="parent"===o?a.parentNode:e.querySelector(o),!(n instanceof t.HTMLElement))throw new Error('Bounds selector "'+o+'" could not find an element.');const s=n,l=t.getComputedStyle(a),c=t.getComputedStyle(s);o={left:-a.offsetLeft+(0,r.int)(c.paddingLeft)+(0,r.int)(l.marginLeft),top:-a.offsetTop+(0,r.int)(c.paddingTop)+(0,r.int)(l.marginTop),right:(0,i.innerWidth)(s)-(0,i.outerWidth)(a)-a.offsetLeft+(0,r.int)(c.paddingRight)-(0,r.int)(l.marginRight),bottom:(0,i.innerHeight)(s)-(0,i.outerHeight)(a)-a.offsetTop+(0,r.int)(c.paddingBottom)-(0,r.int)(l.marginBottom)}}(0,r.isNum)(o.right)&&(t=Math.min(t,o.right));(0,r.isNum)(o.bottom)&&(n=Math.min(n,o.bottom));(0,r.isNum)(o.left)&&(t=Math.max(t,o.left));(0,r.isNum)(o.top)&&(n=Math.max(n,o.top));return[t,n]},t.getControlPosition=function(e,t,n){const r="number"==typeof t?(0,i.getTouch)(e,t):null;if("number"==typeof t&&!r)return null;const o=s(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,i.offsetXYFromParent)(r||e,a,n.props.scale)},t.snapToGrid=function(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]};var r=n("cCoX"),i=n("I5Pb");function s(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}},cCoX:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))},t.findInArray=function(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]},t.int=function(e){return parseInt(e,10)},t.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},t.isNum=function(e){return"number"==typeof e&&!isNaN(e)}},DIYL:(e,t,n)=>{"use strict";t.__esModule=!0,t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}r.default=e,n&&n.set(e,r);return r}(n("neV8")),i=n("j6Rw"),s=n("+cYm"),o=n("6rtJ"),a=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}var f=function(e){var t,n;function o(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).handleRefs={},t.lastHandleRect=null,t.slack=null,t}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,p(t,n);var l=o.prototype;return l.componentWillUnmount=function(){this.resetData()},l.resetData=function(){this.lastHandleRect=this.slack=null},l.runConstraints=function(e,t){var n=this.props,r=n.minConstraints,i=n.maxConstraints,s=n.lockAspectRatio;if(!r&&!i&&!s)return[e,t];if(s){var o=this.props.width/this.props.height,a=e-this.props.width,l=t-this.props.height;Math.abs(a)>Math.abs(l*o)?t=e/o:e=t*o}var c=e,d=t,h=this.slack||[0,0],u=h[0],p=h[1];return e+=u,t+=p,r&&(e=Math.max(r[0],e),t=Math.max(r[1],t)),i&&(e=Math.min(i[0],e),t=Math.min(i[1],t)),this.slack=[u+(c-e),p+(d-t)],[e,t]},l.resizeHandler=function(e,t){var n=this;return function(r,i){var s=i.node,o=i.deltaX,a=i.deltaY;"onResizeStart"===e&&n.resetData();var l=("both"===n.props.axis||"x"===n.props.axis)&&"n"!==t&&"s"!==t,c=("both"===n.props.axis||"y"===n.props.axis)&&"e"!==t&&"w"!==t;if(l||c){var d=t[0],h=t[t.length-1],u=s.getBoundingClientRect();if(null!=n.lastHandleRect){if("w"===h)o+=u.left-n.lastHandleRect.left;if("n"===d)a+=u.top-n.lastHandleRect.top}n.lastHandleRect=u,"w"===h&&(o=-o),"n"===d&&(a=-a);var p=n.props.width+(l?o/n.props.transformScale:0),f=n.props.height+(c?a/n.props.transformScale:0),m=n.runConstraints(p,f);p=m[0],f=m[1];var g=p!==n.props.width||f!==n.props.height,y="function"==typeof n.props[e]?n.props[e]:null;y&&!("onResize"===e&&!g)&&(null==r.persist||r.persist(),y(r,{node:s,size:{width:p,height:f},handle:t})),"onResizeStop"===e&&n.resetData()}}},l.renderResizeHandle=function(e,t){var n=this.props.handle;if(!n)return r.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+e,ref:t});if("function"==typeof n)return n(e,t);var i=h({ref:t},"string"==typeof n.type?{}:{handleAxis:e});return r.cloneElement(n,i)},l.render=function(){var e=this,t=this.props,n=t.children,o=t.className,l=t.draggableOpts,d=(t.width,t.height,t.handle,t.handleSize,t.lockAspectRatio,t.axis,t.minConstraints,t.maxConstraints,t.onResize,t.onResizeStop,t.onResizeStart,t.resizeHandles),u=(t.transformScale,function(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(t,a));return(0,s.cloneElement)(n,h(h({},u),{},{className:(o?o+" ":"")+"react-resizable",children:[].concat(n.props.children,d.map((function(t){var n,s=null!=(n=e.handleRefs[t])?n:e.handleRefs[t]=r.createRef();return r.createElement(i.DraggableCore,c({},l,{nodeRef:s,key:"resizableHandle-"+t,onStop:e.resizeHandler("onResizeStop",t),onStart:e.resizeHandler("onResizeStart",t),onDrag:e.resizeHandler("onResize",t)}),e.renderResizeHandle(t,s))})))}))},o}(r.Component);t.default=f,f.propTypes=o.resizableProps,f.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}},ngvS:(e,t,n)=>{"use strict";t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}r.default=e,n&&n.set(e,r);return r}(n("neV8")),i=l(n("aWzz")),s=l(n("DIYL")),o=n("6rtJ"),a=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function l(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var m=function(e){var t,n;function i(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).state={width:t.props.width,height:t.props.height,propsWidth:t.props.width,propsHeight:t.props.height},t.onResize=function(e,n){var r=n.size;t.props.onResize?(null==e.persist||e.persist(),t.setState(r,(function(){return t.props.onResize&&t.props.onResize(e,n)}))):t.setState(r)},t}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,f(t,n),i.getDerivedStateFromProps=function(e,t){return t.propsWidth!==e.width||t.propsHeight!==e.height?{width:e.width,height:e.height,propsWidth:e.width,propsHeight:e.height}:null},i.prototype.render=function(){var e=this.props,t=e.handle,n=e.handleSize,i=(e.onResize,e.onResizeStart),o=e.onResizeStop,l=e.draggableOpts,c=e.minConstraints,h=e.maxConstraints,p=e.lockAspectRatio,f=e.axis,m=(e.width,e.height,e.resizeHandles),g=e.style,y=e.transformScale,v=function(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,a);return r.createElement(s.default,{axis:f,draggableOpts:l,handle:t,handleSize:n,height:this.state.height,lockAspectRatio:p,maxConstraints:h,minConstraints:c,onResizeStart:i,onResize:this.onResize,onResizeStop:o,resizeHandles:m,transformScale:y,width:this.state.width},r.createElement("div",d({},v,{style:u(u({},g),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},i}(r.Component);t.default=m,m.propTypes=u(u({},o.resizableProps),{},{children:i.default.element})},"6rtJ":(e,t,n)=>{"use strict";t.__esModule=!0,t.resizableProps=void 0;var r,i=(r=n("aWzz"))&&r.__esModule?r:{default:r};n("j6Rw");var s={axis:i.default.oneOf(["both","x","y","none"]),className:i.default.string,children:i.default.element.isRequired,draggableOpts:i.default.shape({allowAnyClick:i.default.bool,cancel:i.default.string,children:i.default.node,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:i.default.node,grid:i.default.arrayOf(i.default.number),handle:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number}),height:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,s=t[0];return"both"===s.axis||"y"===s.axis?(r=i.default.number).isRequired.apply(r,t):i.default.number.apply(i.default,t)},handle:i.default.oneOfType([i.default.node,i.default.func]),handleSize:i.default.arrayOf(i.default.number),lockAspectRatio:i.default.bool,maxConstraints:i.default.arrayOf(i.default.number),minConstraints:i.default.arrayOf(i.default.number),onResizeStop:i.default.func,onResizeStart:i.default.func,onResize:i.default.func,resizeHandles:i.default.arrayOf(i.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:i.default.number,width:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,s=t[0];return"both"===s.axis||"x"===s.axis?(r=i.default.number).isRequired.apply(r,t):i.default.number.apply(i.default,t)}};t.resizableProps=s},"+cYm":(e,t,n)=>{"use strict";t.__esModule=!0,t.cloneElement=function(e,t){t.style&&e.props.style&&(t.style=o(o({},e.props.style),t.style));t.className&&e.props.className&&(t.className=e.props.className+" "+t.className);return i.default.cloneElement(e,t)};var r,i=(r=n("neV8"))&&r.__esModule?r:{default:r};function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},"7kvy":(e,t,n)=>{"use strict";e.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},e.exports.Resizable=n("DIYL").default,e.exports.ResizableBox=n("ngvS").default},"32oc":(e,t,n)=>{"use strict";var r=n("neV8"),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var s=Symbol.for;i=s("react.element"),t.Fragment=s("react.fragment")}var o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,s={},c=null,d=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:d,props:s,_owner:o.current}}t.jsx=c,t.jsxs=c},jg1C:(e,t,n)=>{"use strict";e.exports=n("32oc")},"l+W7":(e,t,n)=>{"use strict";var r=n("neV8");var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useState,o=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=s({inst:{value:n,getSnapshot:t}}),i=r[0].inst,d=r[1];return a((function(){i.value=n,i.getSnapshot=t,c(i)&&d({inst:i})}),[e,n,t]),o((function(){return c(i)&&d({inst:i}),e((function(){c(i)&&d({inst:i})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:d},sayl:(e,t,n)=>{"use strict";var r=n("neV8"),i=n("NrPD");var s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=i.useSyncExternalStore,a=r.useRef,l=r.useEffect,c=r.useMemo,d=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var h=a(null);if(null===h.current){var u={hasValue:!1,value:null};h.current=u}else u=h.current;h=c((function(){function e(e){if(!l){if(l=!0,o=e,e=r(e),void 0!==i&&u.hasValue){var t=u.value;if(i(t,e))return a=t}return a=e}if(t=a,s(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(o=e,t):(o=e,a=n)}var o,a,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,i]);var p=o(e,h[0],h[1]);return l((function(){u.hasValue=!0,u.value=p}),[p]),d(p),p}},NrPD:(e,t,n)=>{"use strict";e.exports=n("l+W7")},"NuT+":(e,t,n)=>{"use strict";e.exports=n("sayl")},FxGm:()=>{},"5QW3":()=>{},uEql:()=>{},"7VVg":()=>{},ccLa:()=>{},tISx:()=>{},XWjs:()=>{},ySxA:()=>{},TQlD:()=>{},tIsd:()=>{},NppW:()=>{},kEbM:()=>{},VCw7:()=>{},"6JrO":()=>{},x365:()=>{},Hoah:()=>{},Kvbp:()=>{},"+onK":()=>{},mMhg:()=>{},"wO3+":()=>{},"X/fO":()=>{},zWTJ:()=>{},sJoR:()=>{},ivmT:()=>{},zEHc:()=>{},Q1hM:()=>{},Sr6T:()=>{},J057:()=>{},e3UD:()=>{},mCLW:()=>{},"2mXR":()=>{},WMVM:()=>{},"5ztO":()=>{},C0y9:()=>{},E0iY:()=>{},ANZz:()=>{},Cml1:()=>{},Lmqm:()=>{},EAsp:()=>{},SBJh:()=>{},"C+lc":()=>{},qgWt:()=>{},jJk2:()=>{},hKJu:()=>{},ywzD:()=>{},waO6:()=>{},"5CK9":()=>{},bpxB:()=>{},"5Nuo":()=>{},GKo3:()=>{},zcIP:()=>{},"3zWe":()=>{},Vs0Q:()=>{},yqmi:()=>{},qnZ5:()=>{},TEru:()=>{},"1Mf8":()=>{},"9Id+":()=>{},YFjQ:()=>{},XJMB:()=>{},unlL:()=>{},bwAj:()=>{},pAwi:()=>{},hlZc:()=>{},Ak1P:()=>{},"u+/o":()=>{},NN0O:()=>{},DzbD:()=>{},lZky:()=>{},x6Mr:()=>{},iiC6:()=>{},"36if":()=>{},PolX:()=>{},EwKa:()=>{},"+Ta2":()=>{},HEBl:()=>{},rvDo:()=>{},YHYY:()=>{},"+XD0":()=>{},dFzp:()=>{},KrBO:()=>{},eoZp:()=>{},neV8:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE_neV8__},sw63:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE_sw63__},"nw+9":e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},gpnx:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},IpAo:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=o(e,s(n)))}return e}function s(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=o(t,n));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()},F2J1:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r,i,s,o){var a=new Date(0);return a.setUTCFullYear(e,t,n),a.setUTCHours(r,i,s,o),a},e.exports=t.default},iCyB:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r=function(e,t,n){if(n&&!n.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return r.formatToParts?function(e,t){for(var n=e.formatToParts(t),r=n.length-1;r>=0;--r)if("timeZoneName"===n[r].type)return n[r].value}(r,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):""}(r,t)},e.exports=t.default},"5/N4":(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r,s,u;if(!e)return 0;if(r=l.timezoneZ.exec(e))return 0;if(r=l.timezoneHH.exec(e))return d(u=parseInt(r[1],10))?-u*o:NaN;if(r=l.timezoneHHMM.exec(e)){u=parseInt(r[1],10);var p=parseInt(r[2],10);return d(u,p)?(s=Math.abs(u)*o+p*a,u>0?-s:s):NaN}if(function(e){if(h[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),h[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var f=n?t:function(e){return(0,i.default)(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),m=c(f,e),g=n?m:function(e,t,n){var r=e.getTime(),i=r-t,s=c(new Date(i),n);if(t===s)return t;i-=s-t;var o=c(new Date(i),n);if(s===o)return s;return Math.max(s,o)}(t,m,e);return-g}return NaN};var r=s(n("ttpx")),i=s(n("F2J1"));function s(e){return e&&e.__esModule?e:{default:e}}var o=36e5,a=6e4,l={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function c(e,t){var n=(0,r.default)(e,t),s=(0,i.default)(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),o=e.getTime(),a=o%1e3;return s-(o-=a>=0?a:1e3+a)}function d(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var h={};e.exports=t.default},fNZd:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;t.default=n,e.exports=t.default},ttpx:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var i=function(e){if(!r[e]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),n="06/25/2014, 00:00:00"===t||"06/25/2014 00:00:00"===t;r[e]=n?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return r[e]}(t);return i.formatToParts?function(e,t){try{for(var r=e.formatToParts(t),i=[],s=0;s<r.length;s++){var o=n[r[s].type];o>=0&&(i[o]=parseInt(r[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(i,e):function(e,t){var n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[r[3],r[1],r[2],r[4],r[5],r[6]]}(i,e)};var n={year:0,month:1,day:2,hour:3,minute:4,second:5};var r={};e.exports=t.default},PEyz:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n("iCyB")),i=s(n("5/N4"));function s(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=e?(0,i.default)(e,t,!0)/6e4:t.getTimezoneOffset();if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function a(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}function l(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e);return r+a(Math.floor(i/60),2)+n+a(Math.floor(i%60),2)}function c(e,t){return e%60==0?(e>0?"-":"+")+a(Math.abs(e)/60,2):l(e,t)}var d={X:function(e,t,n,r){var i=o(r.timeZone,r._originalDate||e);if(0===i)return"Z";switch(t){case"X":return c(i);case"XXXX":case"XX":return l(i);default:return l(i,":")}},x:function(e,t,n,r){var i=o(r.timeZone,r._originalDate||e);switch(t){case"x":return c(i);case"xxxx":case"xx":return l(i);default:return l(i,":")}},O:function(e,t,n,r){var i=o(r.timeZone,r._originalDate||e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;if(0===s)return n+String(i);var o=t||"";return n+String(i)+o+a(s,2)}(i,":");default:return"GMT"+l(i,":")}},z:function(e,t,n,i){var s=i._originalDate||e;switch(t){case"z":case"zz":case"zzz":return(0,r.default)("short",s,i);default:return(0,r.default)("long",s,i)}}};t.default=d,e.exports=t.default},KoRE:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var o=String(t),l=n||{},c=o.match(a);if(c){var d=(0,s.default)(e,l);o=c.reduce((function(e,t){if("'"===t[0])return e;var n=e.indexOf(t),r="'"===e[n-1],s=e.replace(t,"'"+i.default[t[0]](d,t,null,l)+"'");return r?s.substring(0,n-1)+s.substring(n+1):s}),o)}return(0,r.default)(e,o,l)};var r=o(n("RTm1")),i=o(n("PEyz")),s=o(n("+/ju"));function o(e){return e&&e.__esModule?e:{default:e}}var a=/([xXOz]+)|''|'(''|[^'])+('|$)/g;e.exports=t.default},bqgK:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,o){var a=(0,r.default)(o);return a.timeZone=t,(0,i.default)((0,s.default)(e,t),n,a)};var r=o(n("/urY")),i=o(n("KoRE")),s=o(n("RabM"));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},zV9H:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return-(0,i.default)(e,t)};var r,i=(r=n("5/N4"))&&r.__esModule?r:{default:r};e.exports=t.default},NyOe:(e,t,n)=>{"use strict";e.exports={format:n("KoRE"),formatInTimeZone:n("bqgK"),getTimezoneOffset:n("zV9H"),toDate:n("+/ju"),utcToZonedTime:n("RabM"),zonedTimeToUtc:n("VKaJ")}},"+/ju":(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=t||{},o=null==n.additionalDigits?d:(0,r.default)(n.additionalDigits);if(2!==o&&1!==o&&0!==o)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var a=function(e){var t,n={},r=h.dateTimePattern.exec(e);r?(n.date=r[1],t=r[3]):(r=h.datePattern.exec(e))?(n.date=r[1],t=r[2]):(n.date=null,t=e);if(t){var i=h.timeZone.exec(t);i?(n.time=t.replace(i[1],""),n.timeZone=i[1].trim()):n.time=t}return n}(e),p=function(e,t){var n,r=h.YYY[t],i=h.YYYYY[t];if(n=h.YYYY.exec(e)||i.exec(e)){var s=n[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(n=h.YY.exec(e)||r.exec(e)){var o=n[1];return{year:100*parseInt(o,10),restDateString:e.slice(o.length)}}return{year:null}}(a.date,o),f=p.year,b=function(e,t){if(null===t)return null;var n,r,i,s;if(0===e.length)return(r=new Date(0)).setUTCFullYear(t),r;if(n=h.MM.exec(e))return r=new Date(0),g(t,i=parseInt(n[1],10)-1)?(r.setUTCFullYear(t,i),r):new Date(NaN);if(n=h.DDD.exec(e)){r=new Date(0);var o=parseInt(n[1],10);return function(e,t){if(t<1)return!1;var n=m(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,o)?(r.setUTCFullYear(t,0,o),r):new Date(NaN)}if(n=h.MMDD.exec(e)){r=new Date(0),i=parseInt(n[1],10)-1;var a=parseInt(n[2],10);return g(t,i,a)?(r.setUTCFullYear(t,i,a),r):new Date(NaN)}if(n=h.Www.exec(e))return y(t,s=parseInt(n[1],10)-1)?u(t,s):new Date(NaN);if(n=h.WwwD.exec(e)){s=parseInt(n[1],10)-1;var l=parseInt(n[2],10)-1;return y(t,s,l)?u(t,s,l):new Date(NaN)}return null}(p.restDateString,f);if(isNaN(b))return new Date(NaN);if(b){var w,x=b.getTime(),E=0;if(a.time&&(E=function(e){var t,n,r;if(t=h.HH.exec(e))return v(n=parseFloat(t[1].replace(",",".")))?n%24*l:NaN;if(t=h.HHMM.exec(e))return v(n=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")))?n%24*l+r*c:NaN;if(t=h.HHMMSS.exec(e)){n=parseInt(t[1],10),r=parseInt(t[2],10);var i=parseFloat(t[3].replace(",","."));return v(n,r,i)?n%24*l+r*c+1e3*i:NaN}return null}(a.time),isNaN(E)))return new Date(NaN);if(a.timeZone||n.timeZone){if(w=(0,s.default)(a.timeZone||n.timeZone,new Date(x+E)),isNaN(w))return new Date(NaN)}else w=(0,i.default)(new Date(x+E)),w=(0,i.default)(new Date(x+E+w));return new Date(x+E+w)}return new Date(NaN)};var r=a(n("yuhP")),i=a(n("l/Ck")),s=a(n("5/N4")),o=a(n("fNZd"));function a(e){return e&&e.__esModule?e:{default:e}}var l=36e5,c=6e4,d=2,h={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:o.default};function u(e,t,n){t=t||0,n=n||0;var r=new Date(0);r.setUTCFullYear(e,0,4);var i=7*t+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+i),r}var p=[31,28,31,30,31,30,31,31,30,31,30,31],f=[31,29,31,30,31,30,31,31,30,31,30,31];function m(e){return e%400==0||e%4==0&&e%100!=0}function g(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var r=m(e);if(r&&n>f[t])return!1;if(!r&&n>p[t])return!1}return!0}function y(e,t,n){return!(t<0||t>52)&&(null==n||!(n<0||n>6))}function v(e,t,n){return(null==e||!(e<0||e>=25))&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}e.exports=t.default},RabM:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var s=(0,i.default)(e,n),o=(0,r.default)(t,s,!0),a=new Date(s.getTime()-o),l=new Date(0);return l.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),l.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),l};var r=s(n("5/N4")),i=s(n("+/ju"));function s(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},VKaJ:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if("string"==typeof e&&!e.match(s.default)){var l=(0,r.default)(n);return l.timeZone=t,(0,i.default)(e,l)}var c=(0,i.default)(e,n),d=(0,a.default)(c.getFullYear(),c.getMonth(),c.getDate(),c.getHours(),c.getMinutes(),c.getSeconds(),c.getMilliseconds()).getTime(),h=(0,o.default)(t,new Date(d));return new Date(d+h)};var r=l(n("/urY")),i=l(n("+/ju")),s=l(n("fNZd")),o=l(n("5/N4")),a=l(n("F2J1"));function l(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},"88MF":(e,t,n)=>{"use strict";n.r(t),n.d(t,{Node:()=>re,Parser:()=>B,Position:()=>N,SourceLocation:()=>D,TokContext:()=>oe,Token:()=>Pe,TokenType:()=>g,defaultOptions:()=>F,getLineInfo:()=>L,isIdentifierChar:()=>m,isIdentifierStart:()=>f,isNewLine:()=>_,keywordTypes:()=>w,lineBreak:()=>C,lineBreakG:()=>S,nonASCIIwhitespace:()=>k,parse:()=>De,parseExpressionAt:()=>Le,tokContexts:()=>ae,tokTypes:()=>E,tokenizer:()=>Fe,version:()=>Ne});var r={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},i="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",s={5:i,"5module":i+" export import",6:i+" const class extends export import super"},o=/^in(stanceof)?$/,a="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",l="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",c=new RegExp("["+a+"]"),d=new RegExp("["+a+l+"]");a=l=null;var h=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],u=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function p(e,t){for(var n=65536,r=0;r<t.length;r+=2){if((n+=t[r])>e)return!1;if((n+=t[r+1])>=e)return!0}}function f(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&c.test(String.fromCharCode(e)):!1!==t&&p(e,h)))}function m(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&d.test(String.fromCharCode(e)):!1!==t&&(p(e,h)||p(e,u)))))}var g=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function y(e,t){return new g(e,{beforeExpr:!0,binop:t})}var v={beforeExpr:!0},b={startsExpr:!0},w={};function x(e,t){return void 0===t&&(t={}),t.keyword=e,w[e]=new g(e,t)}var E={num:new g("num",b),regexp:new g("regexp",b),string:new g("string",b),name:new g("name",b),eof:new g("eof"),bracketL:new g("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new g("]"),braceL:new g("{",{beforeExpr:!0,startsExpr:!0}),braceR:new g("}"),parenL:new g("(",{beforeExpr:!0,startsExpr:!0}),parenR:new g(")"),comma:new g(",",v),semi:new g(";",v),colon:new g(":",v),dot:new g("."),question:new g("?",v),questionDot:new g("?."),arrow:new g("=>",v),template:new g("template"),invalidTemplate:new g("invalidTemplate"),ellipsis:new g("...",v),backQuote:new g("`",b),dollarBraceL:new g("${",{beforeExpr:!0,startsExpr:!0}),eq:new g("=",{beforeExpr:!0,isAssign:!0}),assign:new g("_=",{beforeExpr:!0,isAssign:!0}),incDec:new g("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new g("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:y("||",1),logicalAND:y("&&",2),bitwiseOR:y("|",3),bitwiseXOR:y("^",4),bitwiseAND:y("&",5),equality:y("==/!=/===/!==",6),relational:y("</>/<=/>=",7),bitShift:y("<</>>/>>>",8),plusMin:new g("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:y("%",10),star:y("*",10),slash:y("/",10),starstar:new g("**",{beforeExpr:!0}),coalesce:y("??",1),_break:x("break"),_case:x("case",v),_catch:x("catch"),_continue:x("continue"),_debugger:x("debugger"),_default:x("default",v),_do:x("do",{isLoop:!0,beforeExpr:!0}),_else:x("else",v),_finally:x("finally"),_for:x("for",{isLoop:!0}),_function:x("function",b),_if:x("if"),_return:x("return",v),_switch:x("switch"),_throw:x("throw",v),_try:x("try"),_var:x("var"),_const:x("const"),_while:x("while",{isLoop:!0}),_with:x("with"),_new:x("new",{beforeExpr:!0,startsExpr:!0}),_this:x("this",b),_super:x("super",b),_class:x("class",b),_extends:x("extends",v),_export:x("export"),_import:x("import",b),_null:x("null",b),_true:x("true",b),_false:x("false",b),_in:x("in",{beforeExpr:!0,binop:7}),_instanceof:x("instanceof",{beforeExpr:!0,binop:7}),_typeof:x("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:x("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:x("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},C=/\r\n?|\n|\u2028|\u2029/,S=new RegExp(C.source,"g");function _(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var k=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,O=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,T=Object.prototype,P=T.hasOwnProperty,I=T.toString;function M(e,t){return P.call(e,t)}var R=Array.isArray||function(e){return"[object Array]"===I.call(e)};function A(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var N=function(e,t){this.line=e,this.column=t};N.prototype.offset=function(e){return new N(this.line,this.column+e)};var D=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)};function L(e,t){for(var n=1,r=0;;){S.lastIndex=r;var i=S.exec(e);if(!(i&&i.index<t))return new N(n,t-r);++n,r=i.index+i[0].length}}var F={ecmaVersion:10,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function j(e){var t={};for(var n in F)t[n]=e&&M(e,n)?e[n]:F[n];if(t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),R(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return R(t.onComment)&&(t.onComment=function(e,t){return function(n,r,i,s,o,a){var l={type:n?"Block":"Line",value:r,start:i,end:s};e.locations&&(l.loc=new D(this,o,a)),e.ranges&&(l.range=[i,s]),t.push(l)}}(t,t.onComment)),t}function $(e,t){return 2|(e?4:0)|(t?8:0)}var B=function(e,t,n){this.options=e=j(e),this.sourceFile=e.sourceFile,this.keywords=A(s[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var i="";if(!0!==e.allowReserved){for(var o=e.ecmaVersion;!(i=r[o]);o--);"module"===e.sourceType&&(i+=" await")}this.reservedWords=A(i);var a=(i?i+" ":"")+r.strict;this.reservedWordsStrict=A(a),this.reservedWordsStrictBind=A(a+" "+r.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(C).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=E.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},V={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};B.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},V.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},V.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},V.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},V.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},V.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},V.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},B.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},B.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},B.parse=function(e,t){return new this(t,e).parse()},B.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},B.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(B.prototype,V);var z=B.prototype,H=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;function U(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}z.strictDirective=function(e){for(;;){O.lastIndex=e,e+=O.exec(this.input)[0].length;var t=H.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){O.lastIndex=e+t[0].length;var n=O.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return";"===i||"}"===i||C.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||"!"===i&&"="===this.input.charAt(r+1))}e+=t[0].length,O.lastIndex=e,e+=O.exec(this.input)[0].length,";"===this.input[e]&&e++}},z.eat=function(e){return this.type===e&&(this.next(),!0)},z.isContextual=function(e){return this.type===E.name&&this.value===e&&!this.containsEsc},z.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},z.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},z.canInsertSemicolon=function(){return this.type===E.eof||this.type===E.braceR||C.test(this.input.slice(this.lastTokEnd,this.start))},z.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},z.semicolon=function(){this.eat(E.semi)||this.insertSemicolon()||this.unexpected()},z.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},z.expect=function(e){this.eat(e)||this.unexpected()},z.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},z.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},z.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")},z.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},z.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var K=B.prototype;K.parseTopLevel=function(e){var t={};for(e.body||(e.body=[]);this.type!==E.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var s=i[r];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var W={kind:"loop"},G={kind:"switch"};K.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;O.lastIndex=this.pos;var t=O.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(91===r)return!0;if(e)return!1;if(123===r)return!0;if(f(r,!0)){for(var i=n+1;m(this.input.charCodeAt(i),!0);)++i;var s=this.input.slice(n,i);if(!o.test(s))return!0}return!1},K.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;O.lastIndex=this.pos;var e=O.exec(this.input),t=this.pos+e[0].length;return!(C.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!==this.input.length&&m(this.input.charAt(t+8)))},K.parseStatement=function(e,t,n){var r,i=this.type,s=this.startNode();switch(this.isLet(e)&&(i=E._var,r="let"),i){case E._break:case E._continue:return this.parseBreakContinueStatement(s,i.keyword);case E._debugger:return this.parseDebuggerStatement(s);case E._do:return this.parseDoStatement(s);case E._for:return this.parseForStatement(s);case E._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case E._class:return e&&this.unexpected(),this.parseClass(s,!0);case E._if:return this.parseIfStatement(s);case E._return:return this.parseReturnStatement(s);case E._switch:return this.parseSwitchStatement(s);case E._throw:return this.parseThrowStatement(s);case E._try:return this.parseTryStatement(s);case E._const:case E._var:return r=r||this.value,e&&"var"!==r&&this.unexpected(),this.parseVarStatement(s,r);case E._while:return this.parseWhileStatement(s);case E._with:return this.parseWithStatement(s);case E.braceL:return this.parseBlock(!0,s);case E.semi:return this.parseEmptyStatement(s);case E._export:case E._import:if(this.options.ecmaVersion>10&&i===E._import){O.lastIndex=this.pos;var o=O.exec(this.input),a=this.pos+o[0].length,l=this.input.charCodeAt(a);if(40===l||46===l)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===E._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var c=this.value,d=this.parseExpression();return i===E.name&&"Identifier"===d.type&&this.eat(E.colon)?this.parseLabeledStatement(s,c,d,e):this.parseExpressionStatement(s,d)}},K.parseBreakContinueStatement=function(e,t){var n="break"===t;this.next(),this.eat(E.semi)||this.insertSemicolon()?e.label=null:this.type!==E.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if(null==e.label||i.name===e.label.name){if(null!=i.kind&&(n||"loop"===i.kind))break;if(e.label&&n)break}}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,n?"BreakStatement":"ContinueStatement")},K.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},K.parseDoStatement=function(e){return this.next(),this.labels.push(W),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(E._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(E.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},K.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(W),this.enterScope(0),this.expect(E.parenL),this.type===E.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===E._var||this.type===E._const||n){var r=this.startNode(),i=n?"let":this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,"VariableDeclaration"),(this.type===E._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===r.declarations.length?(this.options.ecmaVersion>=9&&(this.type===E._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var s=new U,o=this.parseExpression(!0,s);return this.type===E._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===E._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(o,!1,s),this.checkLVal(o),this.parseForIn(e,o)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,o))},K.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,X|(n?0:Y),!1,t)},K.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(E._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},K.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(E.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},K.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(E.braceL),this.labels.push(G),this.enterScope(0);for(var n=!1;this.type!==E.braceR;)if(this.type===E._case||this.type===E._default){var r=this.type===E._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(E.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},K.parseThrowStatement=function(e){return this.next(),C.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var q=[];K.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===E._catch){var t=this.startNode();if(this.next(),this.eat(E.parenL)){t.param=this.parseBindingAtom();var n="Identifier"===t.param.type;this.enterScope(n?32:0),this.checkLVal(t.param,n?4:2),this.expect(E.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(E._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},K.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},K.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(W),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},K.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},K.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},K.parseLabeledStatement=function(e,t,n,r){for(var i=0,s=this.labels;i<s.length;i+=1){s[i].name===t&&this.raise(n.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===E._switch?"switch":null,a=this.labels.length-1;a>=0;a--){var l=this.labels[a];if(l.statementStart!==e.start)break;l.statementStart=this.start,l.kind=o}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?-1===r.indexOf("label")?r+"label":r:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},K.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},K.parseBlock=function(e,t,n){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(E.braceL),e&&this.enterScope(0);this.type!==E.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},K.parseFor=function(e,t){return e.init=t,this.expect(E.semi),e.test=this.type===E.semi?null:this.parseExpression(),this.expect(E.semi),e.update=this.type===E.parenR?null:this.parseExpression(),this.expect(E.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},K.parseForIn=function(e,t){var n=this.type===E._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!n||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(E.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")},K.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(E.eq)?r.init=this.parseMaybeAssign(t):"const"!==n||this.type===E._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===r.id.type||t&&(this.type===E._in||this.isContextual("of"))?r.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(E.comma))break}return e},K.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var X=1,Y=2;K.parseFunction=function(e,t,n,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===E.star&&t&Y&&this.unexpected(),e.generator=this.eat(E.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&X&&(e.id=4&t&&this.type!==E.name?null:this.parseIdent(),!e.id||t&Y||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope($(e.async,e.generator)),t&X||(e.id=this.type===E.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(e,t&X?"FunctionDeclaration":"FunctionExpression")},K.parseFunctionParams=function(e){this.expect(E.parenL),e.params=this.parseBindingList(E.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},K.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.startNode(),i=!1;for(r.body=[],this.expect(E.braceL);this.type!==E.braceR;){var s=this.parseClassElement(null!==e.superClass);s&&(r.body.push(s),"MethodDefinition"===s.type&&"constructor"===s.kind&&(i&&this.raise(s.start,"Duplicate constructor in the same class"),i=!0))}return this.strict=n,this.next(),e.body=this.finishNode(r,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},K.parseClassElement=function(e){var t=this;if(this.eat(E.semi))return null;var n=this.startNode(),r=function(e,r){void 0===r&&(r=!1);var i=t.start,s=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===E.parenL||r&&t.canInsertSemicolon())||(n.key&&t.unexpected(),n.computed=!1,n.key=t.startNodeAt(i,s),n.key.name=e,t.finishNode(n.key,"Identifier"),!1))};n.kind="method",n.static=r("static");var i=this.eat(E.star),s=!1;i||(this.options.ecmaVersion>=8&&r("async",!0)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(E.star)):r("get")?n.kind="get":r("set")&&(n.kind="set")),n.key||this.parsePropertyName(n);var o=n.key,a=!1;return n.computed||n.static||!("Identifier"===o.type&&"constructor"===o.name||"Literal"===o.type&&"constructor"===o.value)?n.static&&"Identifier"===o.type&&"prototype"===o.name&&this.raise(o.start,"Classes may not have a static property named prototype"):("method"!==n.kind&&this.raise(o.start,"Constructor can't have get/set modifier"),i&&this.raise(o.start,"Constructor can't be a generator"),s&&this.raise(o.start,"Constructor can't be an async method"),n.kind="constructor",a=e),this.parseClassMethod(n,i,s,a),"get"===n.kind&&0!==n.value.params.length&&this.raiseRecoverable(n.value.start,"getter should have no params"),"set"===n.kind&&1!==n.value.params.length&&this.raiseRecoverable(n.value.start,"setter should have exactly one param"),"set"===n.kind&&"RestElement"===n.value.params[0].type&&this.raiseRecoverable(n.value.params[0].start,"Setter cannot use rest params"),n},K.parseClassMethod=function(e,t,n,r){return e.value=this.parseMethod(t,n,r),this.finishNode(e,"MethodDefinition")},K.parseClassId=function(e,t){this.type===E.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},K.parseClassSuper=function(e){e.superClass=this.eat(E._extends)?this.parseExprSubscripts():null},K.parseExport=function(e,t){if(this.next(),this.eat(E.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==E.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(E._default)){var n;if(this.checkExport(t,"default",this.lastTokStart),this.type===E._function||(n=this.isAsyncFunction())){var r=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(r,4|X,!1,n)}else if(this.type===E._class){var i=this.startNode();e.declaration=this.parseClass(i,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==E.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,o=e.specifiers;s<o.length;s+=1){var a=o[s];this.checkUnreserved(a.local),this.checkLocalExport(a.local)}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},K.checkExport=function(e,t,n){e&&(M(e,t)&&this.raiseRecoverable(n,"Duplicate export '"+t+"'"),e[t]=!0)},K.checkPatternExport=function(e,t){var n=t.type;if("Identifier"===n)this.checkExport(e,t.name,t.start);else if("ObjectPattern"===n)for(var r=0,i=t.properties;r<i.length;r+=1){var s=i[r];this.checkPatternExport(e,s)}else if("ArrayPattern"===n)for(var o=0,a=t.elements;o<a.length;o+=1){var l=a[o];l&&this.checkPatternExport(e,l)}else"Property"===n?this.checkPatternExport(e,t.value):"AssignmentPattern"===n?this.checkPatternExport(e,t.left):"RestElement"===n?this.checkPatternExport(e,t.argument):"ParenthesizedExpression"===n&&this.checkPatternExport(e,t.expression)},K.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},K.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},K.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(E.braceL);!this.eat(E.braceR);){if(n)n=!1;else if(this.expect(E.comma),this.afterTrailingComma(E.braceR))break;var r=this.startNode();r.local=this.parseIdent(!0),r.exported=this.eatContextual("as")?this.parseIdent(!0):r.local,this.checkExport(e,r.exported.name,r.exported.start),t.push(this.finishNode(r,"ExportSpecifier"))}return t},K.parseImport=function(e){return this.next(),this.type===E.string?(e.specifiers=q,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===E.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},K.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===E.name){var n=this.startNode();if(n.local=this.parseIdent(),this.checkLVal(n.local,2),e.push(this.finishNode(n,"ImportDefaultSpecifier")),!this.eat(E.comma))return e}if(this.type===E.star){var r=this.startNode();return this.next(),this.expectContextual("as"),r.local=this.parseIdent(),this.checkLVal(r.local,2),e.push(this.finishNode(r,"ImportNamespaceSpecifier")),e}for(this.expect(E.braceL);!this.eat(E.braceR);){if(t)t=!1;else if(this.expect(E.comma),this.afterTrailingComma(E.braceR))break;var i=this.startNode();i.imported=this.parseIdent(!0),this.eatContextual("as")?i.local=this.parseIdent():(this.checkUnreserved(i.imported),i.local=i.imported),this.checkLVal(i.local,2),e.push(this.finishNode(i,"ImportSpecifier"))}return e},K.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},K.isDirectiveCandidate=function(e){return"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var Z=B.prototype;Z.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var s=i[r];this.toAssignable(s,t),"RestElement"!==s.type||"ArrayPattern"!==s.argument.type&&"ObjectPattern"!==s.argument.type||this.raise(s.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,n);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else n&&this.checkPatternErrors(n,!0);return e},Z.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var s=e[n-1];6===this.options.ecmaVersion&&t&&s&&"RestElement"===s.type&&"Identifier"!==s.argument.type&&this.unexpected(s.argument.start)}return e},Z.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},Z.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==E.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},Z.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case E.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(E.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case E.braceL:return this.parseObj(!0)}return this.parseIdent()},Z.parseBindingList=function(e,t,n){for(var r=[],i=!0;!this.eat(e);)if(i?i=!1:this.expect(E.comma),t&&this.type===E.comma)r.push(null);else{if(n&&this.afterTrailingComma(e))break;if(this.type===E.ellipsis){var s=this.parseRestBinding();this.parseBindingListItem(s),r.push(s),this.type===E.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}var o=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(o),r.push(o)}return r},Z.parseBindingListItem=function(e){return e},Z.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(E.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")},Z.checkLVal=function(e,t,n){switch(void 0===t&&(t=0),e.type){case"Identifier":2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(t?"Binding ":"Assigning to ")+e.name+" in strict mode"),n&&(M(n,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),n[e.name]=!0),0!==t&&5!==t&&this.declareName(e.name,t,e.start);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":t&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ObjectPattern":for(var r=0,i=e.properties;r<i.length;r+=1){var s=i[r];this.checkLVal(s,t,n)}break;case"Property":this.checkLVal(e.value,t,n);break;case"ArrayPattern":for(var o=0,a=e.elements;o<a.length;o+=1){var l=a[o];l&&this.checkLVal(l,t,n)}break;case"AssignmentPattern":this.checkLVal(e.left,t,n);break;case"RestElement":this.checkLVal(e.argument,t,n);break;case"ParenthesizedExpression":this.checkLVal(e.expression,t,n);break;default:this.raise(e.start,(t?"Binding":"Assigning to")+" rvalue")}};var J=B.prototype;J.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r,i=e.key;switch(i.type){case"Identifier":r=i.name;break;case"Literal":r=String(i.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===r&&"init"===s&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=i.start):this.raiseRecoverable(i.start,"Redefinition of __proto__ property")),t.proto=!0);else{var o=t[r="$"+r];if(o)("init"===s?this.strict&&o.init||o.get||o.set:o.init||o[s])&&this.raiseRecoverable(i.start,"Redefinition of property");else o=t[r]={init:!1,get:!1,set:!1};o[s]=!0}}},J.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===E.comma){var s=this.startNodeAt(n,r);for(s.expressions=[i];this.eat(E.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return i},J.parseMaybeAssign=function(e,t,n){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,s=-1;t?(i=t.parenthesizedAssign,s=t.trailingComma,t.parenthesizedAssign=t.trailingComma=-1):(t=new U,r=!0);var o=this.start,a=this.startLoc;this.type!==E.parenL&&this.type!==E.name||(this.potentialArrowAt=this.start);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,o,a)),this.type.isAssign){var c=this.startNodeAt(o,a);return c.operator=this.value,c.left=this.type===E.eq?this.toAssignable(l,!1,t):l,r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.left.start&&(t.shorthandAssign=-1),this.checkLVal(l),this.next(),c.right=this.parseMaybeAssign(e),this.finishNode(c,"AssignmentExpression")}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),s>-1&&(t.trailingComma=s),l},J.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(E.question)){var s=this.startNodeAt(n,r);return s.test=i,s.consequent=this.parseMaybeAssign(),this.expect(E.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return i},J.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)||i.start===n&&"ArrowFunctionExpression"===i.type?i:this.parseExprOp(i,n,r,-1,e)},J.parseExprOp=function(e,t,n,r,i){var s=this.type.binop;if(null!=s&&(!i||this.type!==E._in)&&s>r){var o=this.type===E.logicalOR||this.type===E.logicalAND,a=this.type===E.coalesce;a&&(s=E.logicalAND.binop);var l=this.value;this.next();var c=this.start,d=this.startLoc,h=this.parseExprOp(this.parseMaybeUnary(null,!1),c,d,s,i),u=this.buildBinary(t,n,e,h,l,o||a);return(o&&this.type===E.coalesce||a&&(this.type===E.logicalOR||this.type===E.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(u,t,n,r,i)}return e},J.buildBinary=function(e,t,n,r,i,s){var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,s?"LogicalExpression":"BinaryExpression")},J.parseMaybeUnary=function(e,t){var n,r=this.start,i=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))n=this.parseAwait(),t=!0;else if(this.type.prefix){var s=this.startNode(),o=this.type===E.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),o?this.checkLVal(s.argument):this.strict&&"delete"===s.operator&&"Identifier"===s.argument.type?this.raiseRecoverable(s.start,"Deleting local variable in strict mode"):t=!0,n=this.finishNode(s,o?"UpdateExpression":"UnaryExpression")}else{if(n=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var a=this.startNodeAt(r,i);a.operator=this.value,a.prefix=!1,a.argument=n,this.checkLVal(n),this.next(),n=this.finishNode(a,"UpdateExpression")}}return!t&&this.eat(E.starstar)?this.buildBinary(r,i,n,this.parseMaybeUnary(null,!1),"**",!1):n},J.parseExprSubscripts=function(e){var t=this.start,n=this.startLoc,r=this.parseExprAtom(e);if("ArrowFunctionExpression"===r.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return r;var i=this.parseSubscripts(r,t,n);return e&&"MemberExpression"===i.type&&(e.parenthesizedAssign>=i.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=i.start&&(e.parenthesizedBind=-1)),i},J.parseSubscripts=function(e,t,n,r){for(var i=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start==5&&this.potentialArrowAt===e.start,s=!1;;){var o=this.parseSubscript(e,t,n,r,i,s);if(o.optional&&(s=!0),o===e||"ArrowFunctionExpression"===o.type){if(s){var a=this.startNodeAt(t,n);a.expression=o,o=this.finishNode(a,"ChainExpression")}return o}e=o}},J.parseSubscript=function(e,t,n,r,i,s){var o=this.options.ecmaVersion>=11,a=o&&this.eat(E.questionDot);r&&a&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var l=this.eat(E.bracketL);if(l||a&&this.type!==E.parenL&&this.type!==E.backQuote||this.eat(E.dot)){var c=this.startNodeAt(t,n);c.object=e,c.property=l?this.parseExpression():this.parseIdent("never"!==this.options.allowReserved),c.computed=!!l,l&&this.expect(E.bracketR),o&&(c.optional=a),e=this.finishNode(c,"MemberExpression")}else if(!r&&this.eat(E.parenL)){var d=new U,h=this.yieldPos,u=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var f=this.parseExprList(E.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!a&&!this.canInsertSemicolon()&&this.eat(E.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=h,this.awaitPos=u,this.awaitIdentPos=p,this.parseArrowExpression(this.startNodeAt(t,n),f,!0);this.checkExpressionErrors(d,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=u||this.awaitPos,this.awaitIdentPos=p||this.awaitIdentPos;var m=this.startNodeAt(t,n);m.callee=e,m.arguments=f,o&&(m.optional=a),e=this.finishNode(m,"CallExpression")}else if(this.type===E.backQuote){(a||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var g=this.startNodeAt(t,n);g.tag=e,g.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(g,"TaggedTemplateExpression")}return e},J.parseExprAtom=function(e){this.type===E.slash&&this.readRegexp();var t,n=this.potentialArrowAt===this.start;switch(this.type){case E._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),t=this.startNode(),this.next(),this.type!==E.parenL||this.allowDirectSuper||this.raise(t.start,"super() call outside constructor of a subclass"),this.type!==E.dot&&this.type!==E.bracketL&&this.type!==E.parenL&&this.unexpected(),this.finishNode(t,"Super");case E._this:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case E.name:var r=this.start,i=this.startLoc,s=this.containsEsc,o=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&"async"===o.name&&!this.canInsertSemicolon()&&this.eat(E._function))return this.parseFunction(this.startNodeAt(r,i),0,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(E.arrow))return this.parseArrowExpression(this.startNodeAt(r,i),[o],!1);if(this.options.ecmaVersion>=8&&"async"===o.name&&this.type===E.name&&!s)return o=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(E.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,i),[o],!0)}return o;case E.regexp:var a=this.value;return(t=this.parseLiteral(a.value)).regex={pattern:a.pattern,flags:a.flags},t;case E.num:case E.string:return this.parseLiteral(this.value);case E._null:case E._true:case E._false:return(t=this.startNode()).value=this.type===E._null?null:this.type===E._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case E.parenL:var l=this.start,c=this.parseParenAndDistinguishExpression(n);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),c;case E.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(E.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case E.braceL:return this.parseObj(!1,e);case E._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case E._class:return this.parseClass(this.startNode(),!1);case E._new:return this.parseNew();case E.backQuote:return this.parseTemplate();case E._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},J.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case E.parenL:return this.parseDynamicImport(e);case E.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},J.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(E.parenR)){var t=this.start;this.eat(E.comma)&&this.eat(E.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},J.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},J.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},J.parseParenExpression=function(){this.expect(E.parenL);var e=this.parseExpression();return this.expect(E.parenR),e},J.parseParenAndDistinguishExpression=function(e){var t,n=this.start,r=this.startLoc,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,o=this.start,a=this.startLoc,l=[],c=!0,d=!1,h=new U,u=this.yieldPos,p=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==E.parenR;){if(c?c=!1:this.expect(E.comma),i&&this.afterTrailingComma(E.parenR,!0)){d=!0;break}if(this.type===E.ellipsis){s=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===E.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}l.push(this.parseMaybeAssign(!1,h,this.parseParenItem))}var f=this.start,m=this.startLoc;if(this.expect(E.parenR),e&&!this.canInsertSemicolon()&&this.eat(E.arrow))return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=u,this.awaitPos=p,this.parseParenArrowList(n,r,l);l.length&&!d||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(h,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=p||this.awaitPos,l.length>1?((t=this.startNodeAt(o,a)).expressions=l,this.finishNodeAt(t,"SequenceExpression",f,m)):t=l[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(n,r);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},J.parseParenItem=function(e){return e},J.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var Q=[];J.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(E.dot)){e.meta=t;var n=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"'new.target' can only be used in functions"),this.finishNode(e,"MetaProperty")}var r=this.start,i=this.startLoc,s=this.type===E._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,i,!0),s&&"ImportExpression"===e.callee.type&&this.raise(r,"Cannot use new with import()"),this.eat(E.parenL)?e.arguments=this.parseExprList(E.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Q,this.finishNode(e,"NewExpression")},J.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===E.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===E.backQuote,this.finishNode(n,"TemplateElement")},J.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===E.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(E.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(E.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},J.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===E.name||this.type===E.num||this.type===E.string||this.type===E.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===E.star)&&!C.test(this.input.slice(this.lastTokEnd,this.start))},J.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(E.braceR);){if(r)r=!1;else if(this.expect(E.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(E.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,i,t),n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},J.parseProperty=function(e,t){var n,r,i,s,o=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(E.ellipsis))return e?(o.argument=this.parseIdent(!1),this.type===E.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(o,"RestElement")):(this.type===E.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),o.argument=this.parseMaybeAssign(!1,t),this.type===E.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(o,"SpreadElement"));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(e||t)&&(i=this.start,s=this.startLoc),e||(n=this.eat(E.star)));var a=this.containsEsc;return this.parsePropertyName(o),!e&&!a&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(o)?(r=!0,n=this.options.ecmaVersion>=9&&this.eat(E.star),this.parsePropertyName(o,t)):r=!1,this.parsePropertyValue(o,e,n,r,i,s,t,a),this.finishNode(o,"Property")},J.parsePropertyValue=function(e,t,n,r,i,s,o,a){if((n||r)&&this.type===E.colon&&this.unexpected(),this.eat(E.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===E.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,r);else if(t||a||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===E.comma||this.type===E.braceR||this.type===E.eq)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=i),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,e.key):this.type===E.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(n||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var l="get"===e.kind?0:1;if(e.value.params.length!==l){var c=e.value.start;"get"===e.kind?this.raiseRecoverable(c,"getter should have no params"):this.raiseRecoverable(c,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},J.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(E.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(E.bracketR),e.key;e.computed=!1}return e.key=this.type===E.num||this.type===E.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},J.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},J.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|$(t,r.generator)|(n?128:0)),this.expect(E.parenL),r.params=this.parseBindingList(E.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(r,"FunctionExpression")},J.parseArrowExpression=function(e,t,n){var r=this.yieldPos,i=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|$(n,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=r,this.awaitPos=i,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},J.parseFunctionBody=function(e,t,n){var r=t&&this.type!==E.braceL,i=this.strict,s=!1;if(r)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);i&&!o||(s=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var a=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!i&&!s&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLVal(e.id,5),e.body=this.parseBlock(!1,void 0,s&&!i),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=a}this.exitScope()},J.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1){if("Identifier"!==n[t].type)return!1}return!0},J.checkParams=function(e,t){for(var n={},r=0,i=e.params;r<i.length;r+=1){var s=i[r];this.checkLVal(s,1,t?null:n)}},J.parseExprList=function(e,t,n,r){for(var i=[],s=!0;!this.eat(e);){if(s)s=!1;else if(this.expect(E.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===E.comma?o=null:this.type===E.ellipsis?(o=this.parseSpread(r),r&&this.type===E.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},J.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;(this.inGenerator&&"yield"===r&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===r&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,n).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(this.inAsync||"await"!==r||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"))},J.parseIdent=function(e,t){var n=this.startNode();return this.type===E.name?n.name=this.value:this.type.keyword?(n.name=this.type.keyword,"class"!==n.name&&"function"!==n.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(n,"Identifier"),e||(this.checkUnreserved(n),"await"!==n.name||this.awaitIdentPos||(this.awaitIdentPos=n.start)),n},J.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===E.semi||this.canInsertSemicolon()||this.type!==E.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(E.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},J.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!1),this.finishNode(e,"AwaitExpression")};var ee=B.prototype;ee.raise=function(e,t){var n=L(this.input,e);t+=" ("+n.line+":"+n.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},ee.raiseRecoverable=ee.raise,ee.curPosition=function(){if(this.options.locations)return new N(this.curLine,this.pos-this.lineStart)};var te=B.prototype,ne=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};te.enterScope=function(e){this.scopeStack.push(new ne(e))},te.exitScope=function(){this.scopeStack.pop()},te.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},te.declareName=function(e,t,n){var r=!1;if(2===t){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&1&i.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var s=this.currentScope();r=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var a=this.scopeStack[o];if(a.lexical.indexOf(e)>-1&&!(32&a.flags&&a.lexical[0]===e)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(e)>-1){r=!0;break}if(a.var.push(e),this.inModule&&1&a.flags&&delete this.undefinedExports[e],3&a.flags)break}r&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")},te.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},te.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},te.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},te.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags&&!(16&t.flags))return t}};var re=function(e,t,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new D(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},ie=B.prototype;function se(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}ie.startNode=function(){return new re(this,this.start,this.startLoc)},ie.startNodeAt=function(e,t){return new re(this,e,t)},ie.finishNode=function(e,t){return se.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},ie.finishNodeAt=function(e,t,n,r){return se.call(this,e,t,n,r)};var oe=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},ae={b_stat:new oe("{",!1),b_expr:new oe("{",!0),b_tmpl:new oe("${",!1),p_stat:new oe("(",!1),p_expr:new oe("(",!0),q_tmpl:new oe("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new oe("function",!1),f_expr:new oe("function",!0),f_expr_gen:new oe("function",!0,!1,null,!0),f_gen:new oe("function",!1,!1,null,!0)},le=B.prototype;le.initialContext=function(){return[ae.b_stat]},le.braceIsBlock=function(e){var t=this.curContext();return t===ae.f_expr||t===ae.f_stat||(e!==E.colon||t!==ae.b_stat&&t!==ae.b_expr?e===E._return||e===E.name&&this.exprAllowed?C.test(this.input.slice(this.lastTokEnd,this.start)):e===E._else||e===E.semi||e===E.eof||e===E.parenR||e===E.arrow||(e===E.braceL?t===ae.b_stat:e!==E._var&&e!==E._const&&e!==E.name&&!this.exprAllowed):!t.isExpr)},le.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},le.updateContext=function(e){var t,n=this.type;n.keyword&&e===E.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},E.parenR.updateContext=E.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===ae.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},E.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ae.b_stat:ae.b_expr),this.exprAllowed=!0},E.dollarBraceL.updateContext=function(){this.context.push(ae.b_tmpl),this.exprAllowed=!0},E.parenL.updateContext=function(e){var t=e===E._if||e===E._for||e===E._with||e===E._while;this.context.push(t?ae.p_stat:ae.p_expr),this.exprAllowed=!0},E.incDec.updateContext=function(){},E._function.updateContext=E._class.updateContext=function(e){!e.beforeExpr||e===E.semi||e===E._else||e===E._return&&C.test(this.input.slice(this.lastTokEnd,this.start))||(e===E.colon||e===E.braceL)&&this.curContext()===ae.b_stat?this.context.push(ae.f_stat):this.context.push(ae.f_expr),this.exprAllowed=!1},E.backQuote.updateContext=function(){this.curContext()===ae.q_tmpl?this.context.pop():this.context.push(ae.q_tmpl),this.exprAllowed=!1},E.star.updateContext=function(e){if(e===E._function){var t=this.context.length-1;this.context[t]===ae.f_expr?this.context[t]=ae.f_expr_gen:this.context[t]=ae.f_gen}this.exprAllowed=!0},E.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==E.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ce="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",de=ce+" Extended_Pictographic",he={9:ce,10:de,11:de},ue="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",pe="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",fe=pe+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",me={9:pe,10:fe,11:fe+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},ge={};function ye(e){var t=ge[e]={binary:A(he[e]+" "+ue),nonBinary:{General_Category:A(ue),Script:A(me[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}ye(9),ye(10),ye(11);var ve=B.prototype,be=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=ge[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function we(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function xe(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Ee(e){return e>=65&&e<=90||e>=97&&e<=122}function Ce(e){return Ee(e)||95===e}function Se(e){return Ce(e)||_e(e)}function _e(e){return e>=48&&e<=57}function ke(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Oe(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Te(e){return e>=48&&e<=55}be.prototype.reset=function(e,t,n){var r=-1!==n.indexOf("u");this.start=0|e,this.source=t+"",this.flags=n,this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchN=r&&this.parser.options.ecmaVersion>=9},be.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},be.prototype.at=function(e,t){void 0===t&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!t&&!this.switchU||i<=55295||i>=57344||e+1>=r)return i;var s=n.charCodeAt(e+1);return s>=56320&&s<=57343?(i<<10)+s-56613888:i},be.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i,s=n.charCodeAt(e);return!t&&!this.switchU||s<=55295||s>=57344||e+1>=r||(i=n.charCodeAt(e+1))<56320||i>57343?e+1:e+2},be.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},be.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},be.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},be.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},ve.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=0;r<n.length;r++){var i=n.charAt(r);-1===t.indexOf(i)&&this.raise(e.start,"Invalid regular expression flag"),n.indexOf(i,r+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}},ve.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},ve.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];-1===e.groupNames.indexOf(r)&&e.raise("Invalid named capture referenced")}},ve.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},ve.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},ve.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},ve.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},ve.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},ve.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ve.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return-1!==i&&i<r&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=n}return!1},ve.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},ve.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},ve.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1},ve.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},ve.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},ve.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ve.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!xe(t)&&(e.lastIntValue=t,e.advance(),!0)},ve.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;-1!==(n=e.current())&&!xe(n);)e.advance();return e.pos!==t},ve.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},ve.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},ve.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},ve.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=we(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=we(e.lastIntValue);return!0}return!1},ve.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),function(e){return f(e,!0)||36===e||95===e}(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)},ve.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),function(e){return m(e,!0)||36===e||95===e||8204===e||8205===e}(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)},ve.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},ve.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},ve.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},ve.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},ve.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ve.regexp_eatZero=function(e){return 48===e.current()&&!_e(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},ve.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},ve.regexp_eatControlLetter=function(e){var t=e.current();return!!Ee(t)&&(e.lastIntValue=t%32,e.advance(),!0)},ve.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var n,r=e.pos,i=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(i&&s>=55296&&s<=56319){var o=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=1024*(s-55296)+(a-56320)+65536,!0}e.pos=o,e.lastIntValue=s}return!0}if(i&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((n=e.lastIntValue)>=0&&n<=1114111))return!0;i&&e.raise("Invalid unicode escape"),e.pos=r}return!1},ve.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},ve.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},ve.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},ve.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return!1},ve.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){M(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")},ve.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},ve.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Ce(t=e.current());)e.lastStringValue+=we(t),e.advance();return""!==e.lastStringValue},ve.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Se(t=e.current());)e.lastStringValue+=we(t),e.advance();return""!==e.lastStringValue},ve.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ve.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},ve.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;!e.switchU||-1!==t&&-1!==n||e.raise("Invalid character class"),-1!==t&&-1!==n&&t>n&&e.raise("Range out of order in character class")}}},ve.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(99===n||Te(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return 93!==r&&(e.lastIntValue=r,e.advance(),!0)},ve.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},ve.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!_e(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},ve.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},ve.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;_e(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t},ve.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;ke(n=e.current());)e.lastIntValue=16*e.lastIntValue+Oe(n),e.advance();return e.pos!==t},ve.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*n+e.lastIntValue:e.lastIntValue=8*t+n}else e.lastIntValue=t;return!0}return!1},ve.regexp_eatOctalDigit=function(e){var t=e.current();return Te(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},ve.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!ke(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Oe(i),e.advance()}return!0};var Pe=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new D(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Ie=B.prototype;function Me(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}function Re(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}Ie.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Pe(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Ie.getToken=function(){return this.next(),new Pe(this)},"undefined"!=typeof Symbol&&(Ie[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===E.eof,value:t}}}}),Ie.curContext=function(){return this.context[this.context.length-1]},Ie.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(E.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Ie.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Ie.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Ie.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),n=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(-1===r&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations)for(S.lastIndex=n;(e=S.exec(this.input))&&e.index<this.pos;)++this.curLine,this.lineStart=e.index+e[0].length;this.options.onComment&&this.options.onComment(!0,this.input.slice(n+2,r),n,this.pos,t,this.curPosition())},Ie.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!_(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Ie.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&k.test(String.fromCharCode(e))))break e;++this.pos}}},Ie.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Ie.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(E.ellipsis)):(++this.pos,this.finishToken(E.dot))},Ie.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(E.assign,2):this.finishOp(E.slash,1)},Ie.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=42===e?E.star:E.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++n,r=E.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(E.assign,n+1):this.finishOp(r,n)},Ie.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(E.assign,3);return this.finishOp(124===e?E.logicalOR:E.logicalAND,2)}return 61===t?this.finishOp(E.assign,2):this.finishOp(124===e?E.bitwiseOR:E.bitwiseAND,1)},Ie.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(E.assign,2):this.finishOp(E.bitwiseXOR,1)},Ie.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!C.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(E.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(E.assign,2):this.finishOp(E.plusMin,1)},Ie.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(E.assign,n+1):this.finishOp(E.bitShift,n)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(n=2),this.finishOp(E.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Ie.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(E.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(E.arrow)):this.finishOp(61===e?E.eq:E.prefix,1)},Ie.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(E.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(E.assign,3);return this.finishOp(E.coalesce,2)}}return this.finishOp(E.question,1)},Ie.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(E.parenL);case 41:return++this.pos,this.finishToken(E.parenR);case 59:return++this.pos,this.finishToken(E.semi);case 44:return++this.pos,this.finishToken(E.comma);case 91:return++this.pos,this.finishToken(E.bracketL);case 93:return++this.pos,this.finishToken(E.bracketR);case 123:return++this.pos,this.finishToken(E.braceL);case 125:return++this.pos,this.finishToken(E.braceR);case 58:return++this.pos,this.finishToken(E.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(E.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(E.prefix,1)}this.raise(this.pos,"Unexpected character '"+Re(e)+"'")},Ie.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Ie.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(C.test(r)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===r)t=!0;else if("]"===r&&t)t=!1;else if("/"===r&&!t)break;e="\\"===r}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var s=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(s);var a=this.regexpState||(this.regexpState=new be(this));a.reset(n,i,o),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var l=null;try{l=new RegExp(i,o)}catch(e){}return this.finishToken(E.regexp,{pattern:i,flags:o,value:l})},Ie.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&void 0===t,i=n&&48===this.input.charCodeAt(this.pos),s=this.pos,o=0,a=0,l=0,c=null==t?1/0:t;l<c;++l,++this.pos){var d=this.input.charCodeAt(this.pos),h=void 0;if(r&&95===d)i&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===a&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===l&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),a=d;else{if((h=d>=97?d-97+10:d>=65?d-65+10:d>=48&&d<=57?d-48:1/0)>=e)break;a=d,o=o*e+h}}return r&&95===a&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||null!=t&&this.pos-s!==t?null:o},Ie.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return null==n&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(n=Me(this.input.slice(t,this.pos)),++this.pos):f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(E.num,n)},Ie.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var n=this.pos-t>=2&&48===this.input.charCodeAt(t);n&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&110===r){var i=Me(this.input.slice(t,this.pos));return++this.pos,f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(E.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),46!==r||n||(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),69!==r&&101!==r||n||(43!==(r=this.input.charCodeAt(++this.pos))&&45!==r||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s,o=(s=this.input.slice(t,this.pos),n?parseInt(s,8):parseFloat(s.replace(/_/g,"")));return this.finishToken(E.num,o)},Ie.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},Ie.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;92===r?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):(_(r,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(E.string,t)};var Ae={};Ie.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Ae)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Ie.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ae;this.raise(e,t)},Ie.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==E.template&&this.type!==E.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(E.template,e)):36===n?(this.pos+=2,this.finishToken(E.dollarBraceL)):(++this.pos,this.finishToken(E.backQuote));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(_(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Ie.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(E.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")},Ie.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Re(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(e){var n=this.pos-1;return this.invalidStringToken(n,"Invalid escape sequence in template string"),null}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),"0"===r&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return _(t)?"":String.fromCharCode(t)}},Ie.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.invalidStringToken(t,"Bad character escape sequence"),n},Ie.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(m(i,r))this.pos+=i<=65535?1:2;else{if(92!==i)break;this.containsEsc=!0,e+=this.input.slice(n,this.pos);var s=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var o=this.readCodePoint();(t?f:m)(o,r)||this.invalidStringToken(s,"Invalid Unicode escape"),e+=Re(o),n=this.pos}t=!1}return e+this.input.slice(n,this.pos)},Ie.readWord=function(){var e=this.readWord1(),t=E.name;return this.keywords.test(e)&&(t=w[e]),this.finishToken(t,e)};var Ne="7.4.1";function De(e,t){return B.parse(e,t)}function Le(e,t,n){return B.parseExpressionAt(e,t,n)}function Fe(e,t){return B.tokenizer(e,t)}B.acorn={Parser:B,version:Ne,defaultOptions:F,Position:N,SourceLocation:D,getLineInfo:L,Node:re,TokenType:g,tokTypes:E,keywordTypes:w,TokContext:oe,tokContexts:ae,isIdentifierChar:m,isIdentifierStart:f,Token:Pe,isNewLine:_,lineBreak:C,lineBreakG:S,nonASCIIwhitespace:k}}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&t&&e;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((t=>r[t]=()=>e[t]));return r.default=()=>e,__webpack_require__.d(n,r),n},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AIChatDialogue:()=>y0,AIChatInput:()=>Vue,Anchor:()=>Xn,Annotation:()=>Fpe,ArrayField:()=>MR,AudioPlayer:()=>GZ,AutoComplete:()=>Hr,Avatar:()=>Qr,AvatarGroup:()=>si,BackTop:()=>zi,Badge:()=>Xi,Banner:()=>ss,BaseComponent:()=>f,BaseFoundation:()=>c,Breadcrumb:()=>gs,Button:()=>vs,ButtonGroup:()=>Es,Calendar:()=>Oa,Card:()=>ll,CardGroup:()=>ul,Carousel:()=>Fl,Cascader:()=>uf,Chat:()=>OG,Checkbox:()=>ud,CheckboxGroup:()=>dd,CodeHighlight:()=>JK,Col:()=>rx,Collapse:()=>Sf,Collapsible:()=>vf,ColorPicker:()=>XA,ConfigConsumer:()=>Of,ConfigProvider:()=>Tf,Cropper:()=>kI,DatePicker:()=>bb,Descriptions:()=>Lb,Divider:()=>Bb,DragMove:()=>SZ,Dropdown:()=>Ww,DropdownDivider:()=>jw,DropdownItem:()=>Lw,DropdownMenu:()=>Rw,Empty:()=>Ub,Feedback:()=>HJ,FloatButton:()=>GJ,FloatButtonGroup:()=>XJ,Form:()=>CR,Highlight:()=>Nr,HotKeys:()=>DG,Icon:()=>Rx,IconButton:()=>ji,Image:()=>cA,ImagePreview:()=>pA,Input:()=>kr,InputGroup:()=>Bx,InputNumber:()=>pE,JsonViewer:()=>MZ,Layout:()=>bx,List:()=>Mx,LocaleConsumer:()=>Jt,LocaleProvider:()=>GI,Lottie:()=>cW,MCPConfigure:()=>_pe,MarkdownRender:()=>nW,Modal:()=>xw,Nav:()=>HE,NavItem:()=>RE,Notification:()=>cC,OverflowList:()=>CC,Pagination:()=>eS,PinCode:()=>JM,Popconfirm:()=>iS,Popover:()=>Cn,Progress:()=>gS,Radio:()=>VS,RadioGroup:()=>$S,Rating:()=>XS,Resizable:()=>rq,ResizeGroup:()=>yq,ResizeHandler:()=>pq,ResizeItem:()=>dq,Row:()=>Qw,ScrollItem:()=>Wv,ScrollList:()=>Yv,Select:()=>YC,SideSheet:()=>l_,Sidebar:()=>FCe,Skeleton:()=>Xa,Slider:()=>f_,Space:()=>il,Spin:()=>dr,SplitButtonGroup:()=>g_,SplitTagGroup:()=>gT,Step:()=>C_,Steps:()=>R_,SubNav:()=>AE,Switch:()=>F_,TabPane:()=>dT,Table:()=>qO,Tabs:()=>fT,Tag:()=>Zd,TagGroup:()=>DC,TagInput:()=>cf,TextArea:()=>Jx,TimePicker:()=>VT,Timeline:()=>OT,Toast:()=>rP,ToastFactory:()=>nP,Tooltip:()=>_t,Transfer:()=>WI,Tree:()=>_P,TreeSelect:()=>LP,Typography:()=>Un,Upload:()=>MI,UserGuide:()=>sJ,VideoPlayer:()=>LJ,chatCompletionToMessage:()=>zue,chatInputToChatCompletion:()=>Jue,chatInputToMessage:()=>Zue,getConfigureItem:()=>B0,responseToMessage:()=>Yue,semiGlobal:()=>te,streamingChatCompletionToMessage:()=>Kue,streamingResponseToMessage:()=>que,useFieldApi:()=>_R,useFieldState:()=>kR,useFormApi:()=>SR,useFormState:()=>NM,withField:()=>KM,withFormApi:()=>TR,withFormState:()=>OR});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{attentionMarkers:()=>E$,contentInitial:()=>g$,disable:()=>C$,document:()=>m$,flow:()=>v$,flowInitial:()=>y$,insideSpan:()=>x$,string:()=>b$,text:()=>w$});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{boolean:()=>YV,booleanish:()=>ZV,commaOrSpaceSeparated:()=>nz,commaSeparated:()=>tz,number:()=>QV,overloadedBoolean:()=>JV,spaceSeparated:()=>ez});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{a:()=>VK,code:()=>QK,h1:()=>DK,h2:()=>LK,h3:()=>FK,h4:()=>jK,h5:()=>$K,h6:()=>BK,img:()=>zK,p:()=>UK,table:()=>HK});__webpack_require__("KrBO");var r=__webpack_require__("nnm9"),i=__webpack_require__.n(r),s=__webpack_require__("2srY"),o=__webpack_require__.n(s);const a=function(e){if("development"===o()(process,"env.NODE_ENV")){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log(e,...n)}};class l{static get cssClasses(){return{}}static get strings(){return{}}static get numbers(){return{}}static get defaultAdapter(){return{getProp:i(),getProps:i(),getState:i(),getStates:i(),setState:i(),getContext:i(),getContexts:i(),getCache:i(),setCache:i(),getCaches:i(),stopPropagation:i(),persistEvent:i()}}constructor(e){this._adapter=Object.assign(Object.assign({},l.defaultAdapter),e)}getProp(e){return this._adapter.getProp(e)}getProps(){return this._adapter.getProps()}getState(e){return this._adapter.getState(e)}getStates(){return this._adapter.getStates()}setState(e,t){return this._adapter.setState(Object.assign({},e),t)}getContext(e){return this._adapter.getContext(e)}getContexts(){return this._adapter.getContexts()}getCaches(){return this._adapter.getCaches()}getCache(e){return this._adapter.getCache(e)}setCache(e,t){return e&&this._adapter.setCache(e,t)}stopPropagation(e){this._adapter.stopPropagation(e)}_isControlledComponent(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"value")in this.getProps()}_isInProps(e){return e in this.getProps()}init(e){}destroy(){}log(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];a(e,...n)}_persistEvent(e){this._adapter.persistEvent(e)}}const c=l;var d=__webpack_require__("neV8"),h=__webpack_require__.n(d);function u(e){return Object.keys(e).reduce(((t,n)=>("data-"===n.substr(0,5)&&(t[n]=e[n]),t)),{})}const{hasOwnProperty:p}=Object.prototype;class f extends d.Component{constructor(e){super(e),this.isControlled=e=>Boolean(e&&this.props&&"object"==typeof this.props&&p.call(this.props,e)),this.setStateAsync=e=>new Promise((t=>{this.setState(e,t)})),this.cache={},this.foundation=null}componentDidMount(){this.foundation&&"function"==typeof this.foundation.init&&this.foundation.init()}componentWillUnmount(){this.foundation&&"function"==typeof this.foundation.destroy&&this.foundation.destroy(),this.cache={}}get adapter(){return{getContext:e=>{if(this.context&&e)return this.context[e]},getContexts:()=>this.context,getProp:e=>this.props[e],getProps:()=>this.props,getState:e=>this.state[e],getStates:()=>this.state,setState:(e,t)=>this.setState(Object.assign({},e),t),getCache:e=>e&&this.cache[e],getCaches:()=>this.cache,setCache:(e,t)=>e&&(this.cache[e]=t),stopPropagation:e=>{try{e.stopPropagation(),e.nativeEvent&&e.nativeEvent.stopImmediatePropagation()}catch(e){}},persistEvent:e=>{e&&e.persist&&"function"==typeof e.persist&&e.persist()}}}log(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return a(e,...n)}getDataAttr(){return u(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props)}}f.propTypes={},f.defaultProps={};var m=__webpack_require__("Bcqe"),g=__webpack_require__.n(m),y=__webpack_require__("RNvQ"),v=__webpack_require__.n(y),b=__webpack_require__("IpAo"),w=__webpack_require__.n(b),x=__webpack_require__("aWzz"),E=__webpack_require__.n(x);const C="semi",S={PREFIX:`${C}-anchor`},_=["small","default"],k=["primary","tertiary","muted"],O="200px",T="750px",P=["top","topLeft","topRight","left","leftTop","leftBottom","right","rightTop","rightBottom","bottom","bottomLeft","bottomRight","leftTopOver","rightTopOver"];var I=__webpack_require__("wxYD"),M=__webpack_require__.n(I);function R(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function A(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function N(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return A(n.overflowY,t)||A(n.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function D(e,t,n,r,i,s,o,a){return s<e&&o>t||s>e&&o<t?0:s<=e&&a<=n||o>=t&&a>=n?s-e-r:o>t&&a<n||s<e&&a>n?o-t+i:0}var L=function(e,t){var n=window,r=t.scrollMode,i=t.block,s=t.inline,o=t.boundary,a=t.skipOverflowHiddenElements,l="function"==typeof o?o:function(e){return e!==o};if(!R(e))throw new TypeError("Invalid target");for(var c,d,h=document.scrollingElement||document.documentElement,u=[],p=e;R(p)&&l(p);){if((p=null==(d=(c=p).parentElement)?c.getRootNode().host||null:d)===h){u.push(p);break}null!=p&&p===document.body&&N(p)&&!N(document.documentElement)||null!=p&&N(p,a)&&u.push(p)}for(var f=n.visualViewport?n.visualViewport.width:innerWidth,m=n.visualViewport?n.visualViewport.height:innerHeight,g=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,v=e.getBoundingClientRect(),b=v.height,w=v.width,x=v.top,E=v.right,C=v.bottom,S=v.left,_="start"===i||"nearest"===i?x:"end"===i?C:x+b/2,k="center"===s?S+w/2:"end"===s?E:S,O=[],T=0;T<u.length;T++){var P=u[T],I=P.getBoundingClientRect(),M=I.height,A=I.width,L=I.top,F=I.right,j=I.bottom,$=I.left;if("if-needed"===r&&x>=0&&S>=0&&C<=m&&E<=f&&x>=L&&C<=j&&S>=$&&E<=F)return O;var B=getComputedStyle(P),V=parseInt(B.borderLeftWidth,10),z=parseInt(B.borderTopWidth,10),H=parseInt(B.borderRightWidth,10),U=parseInt(B.borderBottomWidth,10),K=0,W=0,G="offsetWidth"in P?P.offsetWidth-P.clientWidth-V-H:0,q="offsetHeight"in P?P.offsetHeight-P.clientHeight-z-U:0,X="offsetWidth"in P?0===P.offsetWidth?0:A/P.offsetWidth:0,Y="offsetHeight"in P?0===P.offsetHeight?0:M/P.offsetHeight:0;if(h===P)K="start"===i?_:"end"===i?_-m:"nearest"===i?D(y,y+m,m,z,U,y+_,y+_+b,b):_-m/2,W="start"===s?k:"center"===s?k-f/2:"end"===s?k-f:D(g,g+f,f,V,H,g+k,g+k+w,w),K=Math.max(0,K+y),W=Math.max(0,W+g);else{K="start"===i?_-L-z:"end"===i?_-j+U+q:"nearest"===i?D(L,j,M,z,U+q,_,_+b,b):_-(L+M/2)+q/2,W="start"===s?k-$-V:"center"===s?k-($+A/2)+G/2:"end"===s?k-F+H+G:D($,F,A,V,H+G,k,k+w,w);var Z=P.scrollLeft,J=P.scrollTop;_+=J-(K=Math.max(0,Math.min(J+K/Y,P.scrollHeight-M/Y+q))),k+=Z-(W=Math.max(0,Math.min(Z+W/X,P.scrollWidth-A/X+G)))}O.push({el:P,top:K,left:W})}return O};function F(e){return e===Object(e)&&0!==Object.keys(e).length}const j=function(e,t){var n=e.isConnected||e.ownerDocument.documentElement.contains(e);if(F(t)&&"function"==typeof t.behavior)return t.behavior(n?L(e,t):[]);if(n){var r=function(e){return!1===e?{block:"end",inline:"nearest"}:F(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var r=e.el,i=e.top,s=e.left;r.scroll&&n?r.scroll({top:i,left:s,behavior:t}):(r.scrollTop=i,r.scrollLeft=s)}))}(L(e,r),r.behavior)}},$=S.PREFIX;class B extends c{constructor(e){var t;super(Object.assign(Object.assign({},B.defaultAdapter),e)),t=this,this.init=()=>{},this.destroy=()=>{},this.addLink=e=>{this._adapter.addLink(e)},this.removeLink=e=>{this._adapter.removeLink(e)},this.setActiveLink=function(e,n){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i=t._adapter.getState("activeLink"),s=t._adapter.getProp("onChange");i!==e&&(t._adapter.setActiveLink(e,t._setActiveSlide),s&&r&&t._adapter.notifyChange(e,n))},this.setScrollHeight=()=>{const e=`.${$}-link-wrapper`,t=this._adapter.getAnchorNode(e);if(t){const e=`${t.scrollHeight}px`;this._adapter.setScrollHeight(e)}},this.updateScrollHeight=(e,t)=>{e.links.join("")!==t.links.join("")&&this.setScrollHeight()},this.setChildMap=()=>{const e=this._adapter.getProp("children"),t={};if(M()(e))for(const n of e)this._getLinkToMap(n,[],t);else this._getLinkToMap(e,[],t);this._adapter.setChildMap(t)},this.updateChildMap=(e,t)=>{e.links.join("")!==t.links.join("")&&this.setChildMap()},this.getLinksTop=()=>this._adapter.getLinksBoundingTop(),this.handleScroll=()=>{const{clickLink:e,links:t,activeLink:n}=this.getStates();if(e)return;const r=this.getLinksTop();let i=-1/0,s=-1;for(let e=0;e<r.length;e++)r[e]<0&&r[e]>i&&(i=r[e],s=e);const o=t[s];this.setActiveLink(o,n)},this.handleClick=function(e,n){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i=t._adapter.getContentNode(n),s=t._adapter.getState("activeLink");if(t.setActiveLink(n,s,r),i)try{t._adapter.setClickLinkWithCallBack(!0,n,t._scrollIntoView)}catch(e){}r&&t._adapter.notifyClick(e,n)},this.handleClickLink=()=>{this._adapter.setClickLink(!1)},this._getLinkToMap=(e,t,n)=>{const r=e&&e.props;if(r&&r.href){r.href in n||(n[r.href]=new Set);for(const e of t)n[e].add(r.href);if(r.children&&r.children.length){t.push(r.href);for(const e of r.children)this._getLinkToMap(e,t,n);t.pop()}}},this._scrollIntoView=e=>{const{scrollMotion:t,targetOffset:n}=this.getProps(),r=t?"smooth":"auto",i=this._adapter.canSmoothScroll();if(e){const t=this._adapter.getContentNode(e);t&&j(t,{behavior:e=>{const t=e.find((e=>{const{el:t}=e;return t.scrollHeight>t.clientHeight})),s=o()(t,"el"),a=o()(t,"top");if(s){const e=a-n;s.scroll&&i?s.scroll({top:e,behavior:r}):s.scrollTop=e}},block:"start"})}},this._setActiveSlide=()=>{const e=`.${S.PREFIX}-link-title-active`,t=this._adapter.getAnchorNode(e);if(t){const e=t.offsetTop;this._adapter.setSlideBarTop(e)}}}}var V=__webpack_require__("tQYX"),z=__webpack_require__.n(V);class H extends c{constructor(e){super(Object.assign({},e))}init(){}destroy(){}handleAddLink(){const e=this._adapter.getProp("href");this._adapter.addLink(e)}handleUpdateLink(e,t){e!==t&&(this._adapter.removeLink(t),this._adapter.addLink(e))}handleRemoveLink(){const e=this._adapter.getProp("href");this._adapter.removeLink(e)}}const U=h().createContext(null);var K=__webpack_require__("uZih"),W=__webpack_require__.n(K);const G={PREFIX:`${C}-typography`},q={WEIGHT:["light","regular","medium","semibold","bold","default"],TYPE:["primary","secondary","danger","warning","success","tertiary","quaternary"],SIZE:["normal","small","inherit"],SPACING:["normal","extended"],HEADING:[1,2,3,4,5,6],RULE:["text","numbers","bytes-decimal","bytes-binary","percentages","exponential"],TRUNCATE:["ceil","floor","round"]};__webpack_require__("rvDo");var X=__webpack_require__("DL3M"),Y=__webpack_require__.n(X),Z=__webpack_require__("NdXQ"),J=__webpack_require__.n(Z);function Q(e,t){e&&console.warn(`Warning: ${t}`)}function ee(e){try{return e instanceof HTMLElement}catch(t){return"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument}}const te=new class{constructor(){this.config={}}};var ne=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};function re(e,t){e&&"function"==typeof e.stopPropagation&&e.stopPropagation(),!t&&e.nativeEvent&&"function"==typeof e.nativeEvent.stopImmediatePropagation&&e.nativeEvent.stopImmediatePropagation()}function ie(e,t){return J()(e,(e=>{if("function"==typeof t)return t(e);if("function"==typeof e||h().isValidElement(e))return e;if("[object Error]"===Object.prototype.toString.call(e))return e;if(Array.isArray(e)&&0===e.length){const t=Object.keys(e);if(t.length){const n=[];t.forEach((t=>{Y()(n,t,e[t])}));try{Q("production"!==o()(process,"env.NODE_ENV"),"[Semi] You may use an out-of-bounds array. In some cases, your program may not behave as expected.\n The maximum length of an array is 4294967295.\n Please check whether the array subscript in your data exceeds the maximum value of the JS array subscript")}catch(e){}return n}}else;}))}const se=(e,t)=>{let{match:n,unmatch:r,callInInit:i=!0}=t;if("undefined"!=typeof window){const s=window.matchMedia(e);function o(e){e.matches?n&&n(e):r&&r(e)}return i&&o(s),Object.prototype.hasOwnProperty.call(s,"addEventListener")?(s.addEventListener("change",o),()=>s.removeEventListener("change",o)):(s.addListener(o),()=>s.removeListener(o))}return()=>{}},oe=e=>h().isValidElement(e)&&"Icon"===o()(e.type,"elementType");function ae(){return document?document.activeElement:null}function le(e){if(!ee(e))return[];const t=["input:not([disabled]):not([tabindex='-1'])","textarea:not([disabled]):not([tabindex='-1'])","button:not([disabled]):not([tabindex='-1'])","a[href]:not([tabindex='-1'])","select:not([disabled]):not([tabindex='-1'])","area[href]:not([tabindex='-1'])","iframe:not([tabindex='-1'])","object:not([tabindex='-1'])","*[tabindex]:not([tabindex='-1'])","*[contenteditable]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(t))}function ce(e,t){return ne(this,void 0,void 0,(function*(){return 0===t?void(yield e()):void(yield new Promise((n=>{setTimeout((()=>ne(this,void 0,void 0,(function*(){yield ce(e,t-1),n()}))),0)})))}))}function de(){return globalThis&&"[object Window]"===Object.prototype.toString.call(globalThis)?window.innerWidth-document.documentElement.clientWidth:0}function he(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=()=>{var t,n;return(null===(n=null===(t=null==te?void 0:te.config)||void 0===t?void 0:t.overrideDefaultProps)||void 0===n?void 0:n[e])||{}};return new Proxy(Object.assign({},t),{get(e,t,r){const i=n(),s=Reflect.getOwnPropertyDescriptor(e,t);return(!s||s.configurable||s.writable)&&((e,t)=>Object.prototype.hasOwnProperty.call(e,t))(i,t)?Reflect.get(i,t):Reflect.get(e,t,r)},set:(e,t,n,r)=>Reflect.set(e,t,n,r),ownKeys(e){if(!Reflect.isExtensible(e))return Reflect.ownKeys(e);const t=n();return Array.from(new Set([...Reflect.ownKeys(e),...Reflect.ownKeys(t)]))},getOwnPropertyDescriptor(e,t){const r=n(),i=Reflect.getOwnPropertyDescriptor(e,t);if(i&&!i.configurable)return i;if(!i&&!Reflect.isExtensible(e))return;const s=Reflect.getOwnPropertyDescriptor(r,t);return s?{configurable:!0,enumerable:s.enumerable,writable:!0,value:Reflect.get(r,t)}:i}})}var ue=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const pe=G.PREFIX;class fe extends d.PureComponent{render(){const e=this.props,{component:t,className:n,children:r,forwardRef:i}=e,s=ue(e,["component","className","children","forwardRef"]),o=t,a=w()(pe,n);return h().createElement(o,Object.assign({className:a,ref:i},W()(s,"tooltipRef")),r)}}fe.__SemiComponentName__="Typography",fe.defaultProps=he(fe.__SemiComponentName__,{component:"article",style:{},className:""}),fe.propTypes={component:E().string,style:E().object,className:E().string};const me=fe;var ge=__webpack_require__("2q8g"),ye=__webpack_require__.n(ge),ve=__webpack_require__("R7V3"),be=__webpack_require__.n(ve),we=__webpack_require__("nDih"),xe=__webpack_require__.n(we),Ee=__webpack_require__("H8sf"),Ce=__webpack_require__.n(Ee),Se=__webpack_require__("CZlo"),_e=__webpack_require__.n(Se),ke=__webpack_require__("nnRT"),Oe=__webpack_require__.n(ke),Te=__webpack_require__("MwrP"),Pe=__webpack_require__.n(Te),Ie=__webpack_require__("h4um"),Me=__webpack_require__.n(Ie);function Re(e){return null==e}class Ae{constructor(){this._eventMap=new Map}on(e,t){return e&&"function"==typeof t&&(this._eventMap.has(e)||this._eventMap.set(e,[]),this._eventMap.get(e).push(t)),this}once(e,t){var n=this;if(e&&"function"==typeof t){const r=function(){t(...arguments),n.off(e,r)};this.on(e,r)}}off(e,t){if(e)if("function"==typeof t){const n=this._eventMap.get(e);if(Array.isArray(n)&&n.length){let e=-1;for(;(e=n.findIndex((e=>e===t)))>-1;)n.splice(e,1)}}else Re(t)&&this._eventMap.delete(e);return this}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!this._eventMap.has(e))return!1;return[...this._eventMap.get(e)].forEach((e=>e(...n))),!0}}function Ne(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(const t of n)e.appendChild(t);return e}function De(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(e.children&&e.children.length){const t=e.children[0];for(const r of n)e.insertBefore(r,t)}else Ne(e,...n);return e}function Le(e){e.stopPropagation(),e.preventDefault()}function Fe(e,t){for(let n=0;n<e.length;n++)e[n]===t?(e[n].tabIndex=0,e[n].focus()):e[n].tabIndex=-1}const je={TOP:/top/i,RIGHT:/right/i,BOTTOM:/bottom/i,LEFT:/left/i},$e={left:0,top:0,height:0,width:0,scrollLeft:0,scrollTop:0};class Be extends c{constructor(e){var t;super(Object.assign({},e)),t=this,this.removePortal=()=>{this._adapter.removePortal()},this.setDisplayNone=(e,t)=>{this._adapter.setDisplayNone(e,t)},this.updateStateIfCursorOnTrigger=e=>{var t,n;if(null===(t=null==e?void 0:e.matches)||void 0===t?void 0:t.call(e,":hover")){const e=this._adapter.getEventName(),t=this.getState("triggerEventSet");null===(n=t[e.mouseEnter])||void 0===n||n.call(t)}},this.onResize=()=>{this.getState("visible")&&this.calcPosition()},this.delayShow=()=>{const e=this.getProp("mouseEnterDelay");this.clearDelayTimer(),e>0?this._timer=setTimeout((()=>{this.show(),this.clearDelayTimer()}),e):this.show()},this.show=()=>{if(this._initContainerPosition(),this._adapter.getAnimatingState())return;const e=this.getProp("content"),t=this.getProp("trigger"),n=this.getProp("clickTriggerToHide"),{visible:r,displayNone:i}=this.getStates();if(i&&this.setDisplayNone(!1),!r){if(this.clearDelayTimer(),this._adapter.on("portalInserted",(()=>{this.calcPosition()})),"hover"===t){const e=()=>{var n;const r=this._adapter.getTriggerDOM();t&&!(null===(n=null==r?void 0:r.matches)||void 0===n?void 0:n.call(r,":hover"))&&this.hide(),this._adapter.off("portalInserted",e)};this._adapter.on("portalInserted",e)}this._adapter.on("positionUpdated",(()=>{this._togglePortalVisible(!0)})),this._adapter.insertPortal(e,{left:-9999,top:-9999}),"custom"===t&&this._adapter.registerClickOutsideHandler((()=>{})),("click"===t||n||"contextMenu"===t)&&this._adapter.registerClickOutsideHandler(this.hide),this._bindScrollEvent(),this._bindResizeEvent()}},this.calcPosition=function(e,n,r){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];e=(Pe()(e)?t._adapter.getTriggerBounding():e)||Object.assign({},$e),r=(Pe()(r)?t._adapter.getPopupContainerRect():r)||Object.assign({},$e),n=(Pe()(n)?t._adapter.getWrapperBounding():n)||Object.assign({},$e);let s=t.calcPosStyle({triggerRect:e,wrapperRect:n,containerRect:r}),o=t.getProp("position");if(t.getProp("autoAdjustOverflow")){const{position:i,isHeightOverFlow:a,isWidthOverFlow:l}=t.adjustPosIfNeed(o,s,e,n,r);(o!==i||a||l)&&(o=i,s=t.calcPosStyle({triggerRect:e,wrapperRect:n,containerRect:r,position:o,spacing:null,isOverFlow:[a,l]}))}return i&&t._mounted&&t._adapter.setPosition(Object.assign(Object.assign({},s),{position:o})),s},this.delayHide=()=>{const e=this.getProp("mouseLeaveDelay");this.clearDelayTimer(),e>0?this._timer=setTimeout((()=>{this.hide(),this.clearDelayTimer()}),e):this.hide()},this.hide=()=>{this.clearDelayTimer(),this._togglePortalVisible(!1),this._adapter.off("portalInserted"),this._adapter.off("positionUpdated")},this.handleContainerKeydown=e=>{const{guardFocus:t,closeOnEsc:n}=this.getProps();switch(e&&e.key){case"Escape":n&&this._handleEscKeyDown(e);break;case"Tab":if(t){const t=this._adapter.getContainer(),n=this._adapter.getFocusableElements(t);n.length&&(e.shiftKey?this._handleContainerShiftTabKeyDown(n,e):this._handleContainerTabKeyDown(n,e))}}},this._timer=null}init(){const{wrapperId:e}=this.getProps();this._mounted=!0,this._bindEvent(),this._shouldShow(),e||this._adapter.setId()}destroy(){this._mounted=!1,this.unBindEvent()}_bindEvent(){const e=this.getProp("trigger"),{triggerEventSet:t,portalEventSet:n}=this._generateEvent(e);this._bindTriggerEvent(t),this._bindPortalEvent(n),this._bindResizeEvent()}unBindEvent(){this._adapter.unregisterClickOutsideHandler(),this.unBindResizeEvent(),this.unBindScrollEvent(),clearTimeout(this._timer)}_bindTriggerEvent(e){this._adapter.registerTriggerEvent(e)}_bindPortalEvent(e){this._adapter.registerPortalEvent(e)}_bindResizeEvent(){this._adapter.registerResizeHandler(this.onResize)}unBindResizeEvent(){this._adapter.unregisterResizeHandler(this.onResize)}_adjustPos(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>3?arguments[3]:void 0;switch(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"reverse"){case"reverse":default:return this._reversePos(e,t);case"expand":return this._expandPos(e,n);case"reduce":return this._reducePos(e)}}_reversePos(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){if(je.TOP.test(e))return e.replace("top","bottom").replace("Top","Bottom");if(je.BOTTOM.test(e))return e.replace("bottom","top").replace("Bottom","Top")}else{if(je.LEFT.test(e))return e.replace("left","right").replace("Left","Right");if(je.RIGHT.test(e))return e.replace("right","left").replace("Right","Left")}return e}_expandPos(){let e=arguments.length>1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").concat(e)}_reducePos(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=["Top","Bottom","Left","Right"].find((t=>e.endsWith(t)));return t?e.replace(t,""):e}clearDelayTimer(){this._timer&&(clearTimeout(this._timer),this._timer=null)}_generateEvent(e){const t=this._adapter.getEventName(),n={[t.keydown]:e=>{this._handleTriggerKeydown(e)}};let r={};switch(e){case"focus":n[t.focus]=()=>{!1!==this.getProp("condition")&&this.delayShow()},n[t.blur]=()=>{this.delayHide()},r=n;break;case"click":n[t.click]=()=>{!1!==this.getProp("condition")&&this.show()},r={};break;case"hover":n[t.mouseEnter]=()=>{this.setCache("isClickToHide",!1),!1!==this.getProp("condition")&&this.delayShow()},n[t.mouseLeave]=()=>{this.delayHide()},n[t.focus]=()=>{const{disableFocusListener:e}=this.getProps();!1!==this.getProp("condition")&&!e&&this.delayShow()},n[t.blur]=()=>{const{disableFocusListener:e}=this.getProps();!e&&this.delayHide()},r=Object.assign({},n),this.getProp("clickToHide")&&(r[t.click]=()=>{this.setCache("isClickToHide",!0),this.hide()},r[t.mouseEnter]=()=>{this.getCache("isClickToHide")||!1!==this.getProp("condition")&&this.delayShow()});break;case"custom":default:break;case"contextMenu":n[t.contextMenu]=e=>{!1!==this.getProp("condition")&&(e.preventDefault(),this.show())}}return{triggerEventSet:n,portalEventSet:r}}_shouldShow(){this.getProp("visible")&&this.show()}_togglePortalVisible(e){const t=this.getState("visible"),n=this.getState("isInsert");t===e&&n===e||this._adapter.togglePortalVisible(e,(()=>{e&&this._adapter.setInitialFocus(),this._adapter.notifyVisibleChange(e)}))}_roundPixel(e){return"number"==typeof e?Math.round(e):e}calcTransformOrigin(e,t,n,r){if(e&&t&&null!=n&&null!=r){if(this.getProp("transformFromCenter")){if(["topLeft","bottomLeft"].includes(e))return`${this._roundPixel(t.width/2)}px ${100*-r}%`;if(["topRight","bottomRight"].includes(e))return`calc(100% - ${this._roundPixel(t.width/2)}px) ${100*-r}%`;if(["leftTop","rightTop"].includes(e))return`${100*-n}% ${this._roundPixel(t.height/2)}px`;if(["leftBottom","rightBottom"].includes(e))return`${100*-n}% calc(100% - ${this._roundPixel(t.height/2)}px)`}return`${100*-n}% ${100*-r}%`}return null}calcPosStyle(e){var t;const{spacing:n,isOverFlow:r}=e,{innerWidth:i}=window,s=(Pe()(e.triggerRect)?e.triggerRect:this._adapter.getTriggerBounding())||Object.assign({},$e),a=(Pe()(e.containerRect)?e.containerRect:this._adapter.getPopupContainerRect())||Object.assign({},$e),l=(Pe()(e.wrapperRect)?e.wrapperRect:this._adapter.getWrapperBounding())||Object.assign({},$e),c=null!=e.position?e.position:this.getProp("position"),d=null!=n?n:this.getProp("spacing"),{arrowPointAtCenter:h,showArrow:u,arrowBounding:p}=this.getProps(),f=u&&h;let m=d,g=0;if("number"!=typeof d){const e=c.includes("top")||c.includes("bottom");m=e?d.y:d.x,g=e?d.x:d.y}const y=o()(p,"width",24),v=o()(p,"width",24),b=o()(p,"offsetY",0);let w,x,E=0,C=0;const S=s.left+s.width/2,_=s.top+s.height/2,k=6+y/2,O=6+v/2,T=l.height-a.height,P=l.width-a.width,I=T>0?T:0,M=P>0?P:0,R=r&&r[0],A=r&&r[1],N=S-a.left<a.right-S,D=_-a.top<a.bottom-_,L=l.width>i,F=Math.abs((null==l?void 0:l.width)-(null===(t=this._adapter.getContainer())||void 0===t?void 0:t.clientWidth))>1;switch(F&&(m=m*l.width/this._adapter.getContainer().clientWidth),c){case"top":w=A?N?a.left+l.width/2:a.right-l.width/2+M:S+g,x=R?a.top:s.top-m,E=-.5,C=R?0:-1;break;case"topLeft":w=A?L?a.left:a.right-l.width:f?S-k+g:s.left+g,x=R?a.top:s.top-m,C=R?0:-1;break;case"topRight":w=A?a.right+M:f?S+k+g:s.right+g,x=R?a.top:s.top-m,C=R?0:-1,E=-1;break;case"left":w=A?a.left:s.left-m,x=R?D?a.top+l.height/2:a.bottom-l.height/2+I:_+g,E=A?0:-1,C=-.5;break;case"leftTop":w=A?a.left:s.left-m,x=R?a.top:f?_-O+g:s.top+g,E=A?0:-1;break;case"leftBottom":w=A?a.left:s.left-m,x=R?a.bottom:f?_+O+g:s.bottom+g,E=A?0:-1,C=-1;break;case"bottom":w=A?N?a.left+l.width/2:a.right-l.width/2+M:S+g,x=R?a.bottom:s.top+s.height+m,E=-.5,C=R?-1:0;break;case"bottomLeft":w=A?L?a.left:a.right-l.width:f?S-k+g:s.left+g,x=R?a.bottom:s.top+s.height+m,C=R?-1:0;break;case"bottomRight":w=A?a.right+M:f?S+k+g:s.right+g,x=R?a.bottom:s.top+s.height+m,E=-1,C=R?-1:0;break;case"right":w=A?a.right:s.right+m,x=R?D?a.top+l.height/2:a.bottom-l.height/2+I:_+g,E=A?-1:0,C=-.5;break;case"rightTop":w=A?a.right:s.right+m,x=R?a.top:f?_-O+g:s.top+g,E=A?-1:0;break;case"rightBottom":w=A?a.right:s.right+m,x=R?a.bottom:f?_+O+g:s.bottom+g,E=A?-1:0,C=-1;break;case"leftTopOver":w=A?a.left:s.left-m,x=R?a.top:s.top-m;break;case"rightTopOver":w=A?a.right:s.right+m,x=R?a.top:s.top-m,E=-1;break;case"leftBottomOver":w=A?a.left:s.left-m,x=R?a.bottom:s.bottom+m,C=-1;break;case"rightBottomOver":w=A?a.right:s.right+m,x=R?a.bottom:s.bottom+m,E=-1,C=-1}const j=this.calcTransformOrigin(c,s,E,C),$=this._adapter.containerIsBody();if(w-=a.left,x-=a.top,F&&(w/=l.width/this._adapter.getContainer().clientWidth),F&&(x/=l.height/this._adapter.getContainer().clientHeight),$&&!this._adapter.containerIsRelativeOrAbsolute()){const e=this._adapter.getDocumentElementBounding();w+=a.left-e.left,x+=a.top-e.top}w=$?w:w+a.scrollLeft,x=$?x:x+a.scrollTop;const B=s.height;if(this.getProp("showArrow")&&!h&&B<=2*(v/2+b)){const e=B/2-(b+v/2);!c.includes("Top")&&!c.includes("Bottom")||c.includes("Over")||(x=c.includes("Top")?x+e:x-e)}let V,z;if(u){if(["top","bottom","left","right"].includes(c))if(h){if(("top"===c||"bottom"===c)&&l.width>0){const e=(S-w)/l.width+.5,t=(y/2+6)/l.width,n=1-t,r=Math.max(t,Math.min(n,e));Math.abs(r-.5)>.01&&(V=100*r+"%")}if(("left"===c||"right"===c)&&l.height>0){const e=(_-x)/l.height+.5,t=(v/2+6)/l.height,n=1-t,r=Math.max(t,Math.min(n,e));Math.abs(r-.5)>.01&&(z=100*r+"%")}}else{if(("top"===c||"bottom"===c)&&l.width>0){const e=6+y/2;V=N?e/l.width*100+"%":(l.width-e)/l.width*100+"%"}if(("left"===c||"right"===c)&&l.height>0){const e=6+v/2;z=D?e/l.height*100+"%":(l.height-e)/l.height*100+"%"}}}const H={left:this._roundPixel(w),top:this._roundPixel(x)};V&&(H["--semi-tooltip-arrow-offset-x"]=V),z&&(H["--semi-tooltip-arrow-offset-y"]=z);let U="";return null!=E&&(U+=`translateX(${100*E}%) `,Object.defineProperty(H,"translateX",{enumerable:!1,value:E})),null!=C&&(U+=`translateY(${100*C}%) `,Object.defineProperty(H,"translateY",{enumerable:!1,value:C})),null!=j&&(H.transformOrigin=j),U&&(H.transform=U),H}isLR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.includes("left")||e.includes("right")}isTB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.includes("top")||e.includes("bottom")}isReverse(e,t,n){return e<n&&t>n}isOverFlow(e,t,n){return e<n&&t<n}isHalfOverFlow(e,t,n){return e<n||t<n}isHalfAllEnough(e,t,n){return e>=n||t>=n}getReverse(e,t,n,r){return e&&r||n}adjustPosIfNeed(e,t,n,r,i){const{innerWidth:s,innerHeight:o}=window,{margin:a}=this.getProps(),l="number"==typeof a?a:a.marginLeft,c="number"==typeof a?a:a.marginTop,d="number"==typeof a?a:a.marginRight,h="number"==typeof a?a:a.marginBottom;let u=!1,p=!1;const f=this.getProp("spacing");let m=f,g=0;if("number"!=typeof f){const t=e.includes("top")||e.includes("bottom");m=t?f.y:f.x,g=t?f.x:f.y}if(r.width>0&&r.height>0){const t=n.left,a=n.right,f=n.top,y=n.bottom,v=s-t,b=o-f,w=s-a,x=o-y,E=r.width>n.width,C=r.height>n.height,S=f-c<r.height+m&&x-h>r.height+m,_=t-l<r.width+m&&w-d>r.width+m,k=x-h<r.height+m&&f-c>r.height+m,O=w-d<r.width+m&&t-l>r.width+m,T=(b-h<r.height+m&&r.height,y-c<r.height+m&&r.height,b<r.height+g&&y>r.height+g),P=y<r.height+g&&b>r.height+g,I=v<r.width+g&&a>r.width+g,M=a<r.width+g&&v>r.width+g,R=b<r.height+m&&y>r.height+m,A=y<r.height+m&&b>r.height+m,N=v<r.width&&a>r.width,D=a<r.width&&v>r.width,L=f-i.top,F=t-i.left,j=L+n.height,$=F+n.width,B=i.bottom-y,V=i.right-a,z=B+n.height,H=V+n.width,U=this.isReverse(L-c,B-h,r.height+m),K=this.isReverse(F-l,V-d,r.width+m),W=this.isReverse(B-h,L-c,r.height+m),G=this.isReverse(V-d,F-l,r.width+m),q=(this.isReverse(z-h,j-c,r.height+m),this.isReverse(j-c,z-h,r.height+m),this.isReverse(z,j,r.height+g)),X=this.isReverse(j,z,r.height+g),Y=this.isReverse(H,$,r.width+g),Z=this.isReverse($,H,r.width+g),J=n.height/2,Q=n.width/2,ee=this.isOverFlow(f-c,x-h,r.height+m),te=this.isOverFlow(t-l,w-d,r.width+m),ne=this.isOverFlow(y-c,b-h,r.height+m),re=this.isOverFlow(a-l,v-d,r.width+m),ie=this.isHalfOverFlow(y-J,b-J,(r.height+g)/2),se=this.isHalfOverFlow(a-Q,v-Q,(r.width+g)/2),oe=this.isHalfAllEnough(y-J,b-J,(r.height+g)/2),ae=this.isHalfAllEnough(a-Q,v-Q,(r.width+g)/2),le=this.isOverFlow(L-c,B-h,r.height+m),ce=this.isOverFlow(F-l,V-d,r.width+m),de=this.isOverFlow(j-c,z-h,r.height+m),he=this.isOverFlow($-l,H-d,r.width+m),ue=this.isHalfOverFlow(j-J,z-J,(r.height+g)/2),pe=this.isHalfOverFlow($-Q,H-Q,(r.width+g)/2),fe=this.isHalfAllEnough(j-J,z-J,(r.height+g)/2),me=this.isHalfAllEnough($-Q,H-Q,(r.width+g)/2),ge=this.getReverse(ee,le,S,U),ye=this.getReverse(te,ce,_,K),ve=this.getReverse(ee,le,k,W),be=this.getReverse(te,ce,O,G),we=this.getReverse(ne,de,T,q),xe=this.getReverse(ne,de,P,X),Ee=this.getReverse(re,he,I,Y),Ce=this.getReverse(re,he,M,Z),Se=ie&&ue,_e=se&&pe;switch(e){case"top":ge&&(e=this._adjustPos(e,!0)),_e&&(Ee||Ce)&&(e=this._adjustPos(e,!0,"expand",Ee?"Right":"Left"));break;case"topLeft":ge&&(e=this._adjustPos(e,!0)),Ee&&E&&(e=this._adjustPos(e)),p&&(ae||me)&&(e=this._adjustPos(e,!0,"reduce"));break;case"topRight":ge&&(e=this._adjustPos(e,!0)),Ce&&E&&(e=this._adjustPos(e)),p&&(ae||me)&&(e=this._adjustPos(e,!0,"reduce"));break;case"left":ye&&(e=this._adjustPos(e)),Se&&(we||xe)&&(e=this._adjustPos(e,!1,"expand",we?"Bottom":"Top"));break;case"leftTop":ye&&(e=this._adjustPos(e)),we&&C&&(e=this._adjustPos(e,!0)),u&&(oe||fe)&&(e=this._adjustPos(e,!1,"reduce"));break;case"leftBottom":ye&&(e=this._adjustPos(e)),xe&&C&&(e=this._adjustPos(e,!0)),u&&(oe||fe)&&(e=this._adjustPos(e,!1,"reduce"));break;case"bottom":ve&&(e=this._adjustPos(e,!0)),_e&&(Ee||Ce)&&(e=this._adjustPos(e,!0,"expand",Ee?"Right":"Left"));break;case"bottomLeft":ve&&(e=this._adjustPos(e,!0)),Ee&&E&&(e=this._adjustPos(e)),p&&(ae||me)&&(e=this._adjustPos(e,!0,"reduce"));break;case"bottomRight":ve&&(e=this._adjustPos(e,!0)),Ce&&E&&(e=this._adjustPos(e)),p&&(ae||me)&&(e=this._adjustPos(e,!0,"reduce"));break;case"right":be&&(e=this._adjustPos(e)),Se&&(we||xe)&&(e=this._adjustPos(e,!1,"expand",we?"Bottom":"Top"));break;case"rightTop":be&&(e=this._adjustPos(e)),we&&C&&(e=this._adjustPos(e,!0)),u&&(oe||fe)&&(e=this._adjustPos(e,!1,"reduce"));break;case"rightBottom":be&&(e=this._adjustPos(e)),xe&&C&&(e=this._adjustPos(e,!0)),u&&(oe||fe)&&(e=this._adjustPos(e,!1,"reduce"));break;case"leftTopOver":R&&(e=this._adjustPos(e,!0)),N&&(e=this._adjustPos(e));break;case"leftBottomOver":A&&(e=this._adjustPos(e,!0)),N&&(e=this._adjustPos(e));break;case"rightTopOver":R&&(e=this._adjustPos(e,!0)),D&&(e=this._adjustPos(e));break;case"rightBottomOver":A&&(e=this._adjustPos(e,!0)),D&&(e=this._adjustPos(e))}this.isTB(e)&&(u=ee&&le,p="top"===e||"bottom"===e?se&&pe||a<0||w<0:re&&he||a<0||w<0),this.isLR(e)&&(p=te&&ce,u="left"===e||"right"===e?ie&&ue||f<0||b<0:ne&&de||f<0||b<0)}return{position:e,isHeightOverFlow:u,isWidthOverFlow:p}}_bindScrollEvent(){this._adapter.registerScrollHandler((()=>this.calcPosition()))}unBindScrollEvent(){this._adapter.unregisterScrollHandler()}_initContainerPosition(){!this._adapter.getContainerPosition()&&this._adapter.containerIsBody()&&this._adapter.updateContainerPosition()}_handleTriggerKeydown(e){const{closeOnEsc:t,disableArrowKeyDown:n}=this.getProps(),r=this._adapter.getContainer(),i=this._adapter.getFocusableElements(r),s=i.length;switch(e&&e.key){case"Escape":Le(e),t&&this._handleEscKeyDown(e);break;case"ArrowUp":!n&&s&&this._handleTriggerArrowUpKeydown(i,e);break;case"ArrowDown":!n&&s&&this._handleTriggerArrowDownKeydown(i,e)}}focusTrigger(){const{trigger:e,returnFocusOnClose:t,preventScroll:n}=this.getProps();if(t&&"custom"!==e){const e=this._adapter.getTriggerNode();e&&"focus"in e&&e.focus({preventScroll:n})}}_handleEscKeyDown(e){const{trigger:t}=this.getProps();"custom"!==t&&(this.focusTrigger(),this.hide()),this._adapter.notifyEscKeydown(e)}_handleContainerTabKeyDown(e,t){const{preventScroll:n}=this.getProps(),r=this._adapter.getActiveElement();e[e.length-1]===r&&(e[0].focus({preventScroll:n}),t.preventDefault())}_handleContainerShiftTabKeyDown(e,t){const{preventScroll:n}=this.getProps(),r=this._adapter.getActiveElement();e[0]===r&&(e[e.length-1].focus({preventScroll:n}),t.preventDefault())}_handleTriggerArrowDownKeydown(e,t){const{preventScroll:n}=this.getProps();e[0].focus({preventScroll:n}),t.preventDefault()}_handleTriggerArrowUpKeydown(e,t){const{preventScroll:n}=this.getProps();e[e.length-1].focus({preventScroll:n}),t.preventDefault()}}const Ve={PREFIX:`${C}-tooltip`},ze={POSITION_SET:["top","topLeft","topRight","left","leftTop","leftBottom","right","rightTop","rightBottom","bottom","bottomLeft","bottomRight","leftTopOver","rightTopOver","leftBottomOver","rightBottomOver"],TRIGGER_SET:["hover","focus","click","custom","contextMenu"],STATUS_DISABLED:"disabled",STATUS_LOADING:"loading"},He={ARROW_BOUNDING:{offsetX:0,offsetY:2,width:24,height:7},DEFAULT_Z_INDEX:1060,MOUSE_ENTER_DELAY:50,MOUSE_LEAVE_DELAY:50,SPACING:8,MARGIN:0};function Ue(e){return`${e}-${(new Date).getTime()}-${Math.random()}`}function Ke(){var e,t;try{return null!==(t=null===(e=null===crypto||void 0===crypto?void 0:crypto.randomUUID)||void 0===e?void 0:e.call(crypto))&&void 0!==t?t:String(-99990013e3).replace(/[018]/g,(e=>(Number(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>Number(e)/4).toString(16)))}catch(e){return Ue("semi")}}function We(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{prefix:t="",length:n=7}=e,r="0123456789abcdefghijklmnopqrstuvwxyz";let i="";for(let e=0;e<n;e++){const e=Math.floor(36*Math.random());i+=r.charAt(e)}return t?`${t}-${i}`:i}__webpack_require__("PolX");var Ge=__webpack_require__("sw63");const qe=Object.assign({},Ge),Xe=qe.render,Ye=qe.unmountComponentAtNode,Ze=qe.findDOMNode,{version:Je}=Ge,Qe=Number((Je||"").split(".")[0]);let et=!1;function tt(e){var t;const n=null!==(t=qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)&&void 0!==t?t:qe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;n&&"object"==typeof n&&(n.usingClientEntryPoint=e)}let nt=!1;const rt="__semi_react_root__";function it(e,t){!function(){var e;et||Qe<18&&"function"==typeof(null===(e=te.config)||void 0===e?void 0:e.createRoot)&&(et=!0,console.warn(`[Semi UI] createRoot was injected but React version is ${Je} (< 18). This configuration is unusual and may cause unexpected behavior.`))}();const n=function(){var e;return"function"==typeof(null===(e=te.config)||void 0===e?void 0:e.createRoot)?te.config.createRoot:"function"==typeof qe.createRoot?qe.createRoot:void 0}();if(n){tt(!0);const r=t[rt]||n(t);tt(!1),r.render(e),t[rt]=r}else Xe?Xe(e,t):nt||(nt=!0,console.error("[Semi UI] createRoot is not available. If you are using React 19, please inject createRoot before using Semi components. For details, see: https://semi.design/zh-CN/ecosystem/react19\n[Semi UI] createRoot 不可用。如果您正在使用 React 19,请在使用 Semi 组件前注入 createRoot。详情请参阅:https://semi.design/zh-CN/ecosystem/react19"))}function st(e){e[rt]?(e[rt].unmount(),delete e[rt]):Ye&&Ye(e)}function ot(e){if(!e)return null;if(e instanceof Element)return e;if(Ze)try{const t=Ze(e);return t instanceof Element?t:null}catch(e){return null}return function(e){var t;try{const n=null!==(t=null==e?void 0:e._reactInternals)&&void 0!==t?t:null==e?void 0:e._reactInternalFiber;if(!n||"object"!=typeof n)return null;let r=n.child,i=0;const s=50;for(;r&&i<s;){if(i++,r.stateNode instanceof Element)return r.stateNode;if(r.child)r=r.child;else{for(;r&&!r.sibling;){if(r===n)return null;r=r.return}if(!r||r===n)break;r=r.sibling}}}catch(e){}return null}(e)}function at(e){var t,n,r;return e?Qe>=19?null!==(n=null===(t=e.props)||void 0===t?void 0:t.ref)&&void 0!==n?n:null:null!==(r=e.ref)&&void 0!==r?r:null:null}const lt=h().createContext({});__webpack_require__("FxGm");const ct=()=>document.body;class dt extends d.PureComponent{constructor(e,t){var n;super(e),n=this,this.initContainer=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var r,i;try{let t;if(!n.el||!(null===(r=n.state)||void 0===r?void 0:r.container)||!Array.from(n.state.container.childNodes).includes(n.el)){n.el||(n.el=document.createElement("div"));const r=(n.props.getPopupContainer||e.getPopupContainer||ct)();return r.appendChild(n.el),n.addStyle(n.props.style),n.addClass(n.props.prefixCls,e,n.props.className),t=r,t}}catch(e){if(!t)throw e}return null===(i=n.state)||void 0===i?void 0:i.container},this.addStyle=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n.el)for(const t of Object.keys(e))n.el.style[t]=e[t]},this.addClass=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.context;const{direction:r}=t;for(var i=arguments.length,s=new Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];const a=w()(e,...s,{[`${e}-rtl`]:"rtl"===r});n.el&&(n.el.className=a)},this.state={container:this.initContainer(t,!0)}}componentDidMount(){const e=this.initContainer(this.context);e!==this.state.container&&this.setState({container:e})}componentDidUpdate(e){const{didUpdate:t}=this.props;t&&t(e)}componentWillUnmount(){const{container:e}=this.state;e&&e.removeChild(this.el)}render(){const{state:e,props:t}=this;return e.container?(0,Ge.createPortal)(t.children,this.el):null}}dt.contextType=lt,dt.defaultProps={prefixCls:`${C}-portal`},dt.propTypes={children:E().node,prefixCls:E().string,getPopupContainer:E().func,className:E().string,didUpdate:E().func};const ht=dt;var ut=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const pt=e=>{const{className:t,style:n}=e,r=ut(e,["className","style"]);return h().createElement("svg",Object.assign({"aria-hidden":!0,className:t,style:n},r,{width:"24",height:"7",viewBox:"0 0 24 7",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"}),h().createElement("path",{d:"M24 0V1C20 1 18.5 2 16.5 4C14.5 6 14 7 12 7C10 7 9.5 6 7.5 4C5.5 2 4 1 0 1V0H24Z"}))};var ft=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const mt=e=>{const{className:t,style:n}=e,r=ft(e,["className","style"]);return h().createElement("svg",Object.assign({"aria-hidden":!0,className:t,style:n},r,{width:"7",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"}),h().createElement("path",{d:"M0 0L1 0C1 4, 2 5.5, 4 7.5S7,10 7,12S6 14.5, 4 16.5S1,20 1,24L0 24L0 0z"}))},gt=E().shape({offsetX:E().number,offsetY:E().number,width:E().number,height:E().number});class yt extends h().Component{constructor(e){super(e),this.handleAnimationStart=()=>{var e,t;null===(t=(e=this.props).onAnimationStart)||void 0===t||t.call(e)},this.handleAnimationEnd=()=>{this.setState({currentClassName:this.props.endClassName,extraStyle:{animationFillMode:this.props.fillMode},isAnimating:!1},(()=>{var e,t;null===(t=(e=this.props).onAnimationEnd)||void 0===t||t.call(e,!1)}))},this.state={currentClassName:this.props.startClassName,extraStyle:{animationFillMode:this.props.fillMode},isAnimating:!0}}componentDidMount(){var e,t,n,r;null===(t=(e=this.props).onAnimationStart)||void 0===t||t.call(e),this.props.motion||(null===(r=(n=this.props).onAnimationEnd)||void 0===r||r.call(n,!1),this.setState({isAnimating:!1}))}componentDidUpdate(e,t,n){const r=Object.keys(this.props).filter((t=>!Oe()(this.props[t],e[t])));r.includes("animationState"),(r.includes("startClassName")||r.includes("replayKey")||r.includes("motion"))&&this.setState({currentClassName:this.props.startClassName,extraStyle:{animationFillMode:this.props.fillMode},isAnimating:!0},(()=>{var e,t,n,r;null===(t=(e=this.props).onAnimationStart)||void 0===t||t.call(e),this.props.motion||(null===(r=(n=this.props).onAnimationEnd)||void 0===r||r.call(n,this.state.isAnimating),this.setState({isAnimating:!1}))}))}render(){var e;return this.props.motion?this.props.children({animationClassName:null!==(e=this.state.currentClassName)&&void 0!==e?e:"",animationStyle:this.state.extraStyle,animationEventsNeedBind:{onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},isAnimating:this.state.isAnimating}):this.props.children({animationClassName:"",animationStyle:{},animationEventsNeedBind:{},isAnimating:this.state.isAnimating})}}yt.defaultProps={motion:!0,replayKey:""};const vt=yt;var bt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const wt=Ve.PREFIX,xt=ze.POSITION_SET,Et=ze.TRIGGER_SET,Ct=["flex","block","table","flow-root","grid"],St=()=>document.body;class _t extends f{constructor(e){super(e),this.isAnimating=!1,this.cachedLatestTransitionState="enter",this.setContainerEl=e=>this.containerEl={current:e},this.disconnectPopupResizeObserver=()=>{var e;clearTimeout(this.popupResizeTimer),null===(e=this.popupResizeObserver)||void 0===e||e.disconnect(),this.popupResizeObserver=null},this.isSpecial=e=>{if(ee(e))return Boolean(e.disabled);if((0,d.isValidElement)(e)){if(o()(e,"props.disabled"))return ze.STATUS_DISABLED;const t=o()(e,"props.loading"),n=!(Pe()(e)||Pe()(e.type)||"Button"!==o()(e,"type.elementType")&&"IconButton"!==o()(e,"type.elementType"));if(t&&n)return ze.STATUS_LOADING}return!1},this.didLeave=()=>{this.disconnectPopupResizeObserver(),this.props.keepDOM?this.foundation.setDisplayNone(!0):this.foundation.removePortal(),this.foundation.unBindEvent()},this.renderIcon=()=>{const{placement:e}=this.state,{showArrow:t,prefixCls:n,style:r}=this.props;let i=null;const s=w()([`${n}-icon-arrow`]),a=o()(r,"backgroundColor"),l=(null==e?void 0:e.includes("left"))||(null==e?void 0:e.includes("right"))?h().createElement(mt,null):h().createElement(pt,null);return t&&(i=(0,d.isValidElement)(t)?t:h().cloneElement(l,{className:s,style:{color:a,fill:"currentColor"}})),i},this.handlePortalInnerClick=e=>{this.props.clickToHide&&this.foundation.hide(),this.props.stopPropagation&&re(e)},this.handlePortalMouseDown=e=>{this.props.stopPropagation&&re(e)},this.handlePortalFocus=e=>{this.props.stopPropagation&&re(e)},this.handlePortalBlur=e=>{this.props.stopPropagation&&re(e)},this.handlePortalInnerKeyDown=e=>{this.foundation.handleContainerKeydown(e)},this.renderContentNode=e=>{const t={initialFocusRef:this.initialFocusRef};return ye()(e)?e(t):e},this.renderPortal=()=>{const{containerStyle:e={},visible:t,portalEventSet:n,placement:r,displayNone:i,transitionState:s,id:a,isPositionUpdated:l}=this.state,{prefixCls:c,content:d,showArrow:u,style:p,motion:f,role:m,zIndex:g}=this.props,y=this.renderContentNode(d),{className:v}=this.props,b=this.context.direction,x=w()(v,{[`${c}-wrapper`]:!0,[`${c}-wrapper-show`]:t,[`${c}-with-arrow`]:Boolean(u),[`${c}-rtl`]:"rtl"===b}),E=this.renderIcon(),S=W()(e,f?["transformOrigin"]:void 0),_=o()(e,"transformOrigin"),k=o()(e,"--semi-tooltip-arrow-offset-x"),O=o()(e,"--semi-tooltip-arrow-offset-y"),T=Object.assign(Object.assign({},k?{"--semi-tooltip-arrow-offset-x":k}:{}),O?{"--semi-tooltip-arrow-offset-y":O}:{}),P=o()(p,"opacity",null),I=P||1,M=h().createElement(vt,{fillMode:"forwards",animationState:s,motion:f&&l,startClassName:"enter"===s?`${wt}-animation-show`:`${wt}-animation-hide`,onAnimationStart:()=>this.isAnimating=!0,onAnimationEnd:()=>{var e,t;"leave"===s&&(this.didLeave(),null===(t=(e=this.props).afterClose)||void 0===t||t.call(e)),this.isAnimating=!1}},(e=>{let{animationStyle:t,animationClassName:s,animationEventsNeedBind:o}=e;return h().createElement("div",Object.assign({className:w()(x,s),style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),i?{display:"none"}:{}),{transformOrigin:_}),p),T),P?{opacity:l?I:"0"}:{})},n,o,{role:m,"x-placement":r,id:a}),h().createElement("div",{className:`${wt}-content`},y),E)}));return h().createElement(ht,{getPopupContainer:this.props.getPopupContainer,style:{zIndex:g}},h().createElement("div",{tabIndex:-1,className:`${C}-portal-inner`,style:S,ref:this.setContainerEl,onClick:this.handlePortalInnerClick,onFocus:this.handlePortalFocus,onBlur:this.handlePortalBlur,onMouseDown:this.handlePortalMouseDown,onKeyDown:this.handlePortalInnerKeyDown},M))},this.wrapSpan=e=>{const{wrapperClassName:t}=this.props,n=o()(e,"props.style.display"),r=o()(e,"props.block"),i={};return"string"==typeof e||(i.display="inline-block"),(r||Ct.includes(n))&&(i.width="100%"),h().createElement("span",{className:t,style:i},e)},this.mergeEvents=(e,t)=>{const n={};return Me()(t,((t,r)=>{"function"==typeof t&&(n[r]=function(){t(...arguments),e&&"function"==typeof e[r]&&e[r](...arguments)})})),n},this.getPopupId=()=>this.state.id,this.state={visible:!1,transitionState:"",triggerEventSet:{},portalEventSet:{},containerStyle:{},isInsert:!1,placement:e.position||"top",transitionStyle:{},isPositionUpdated:!1,id:e.wrapperId,displayNone:!1},this.foundation=new Be(this.adapter),this.eventManager=new Ae,this.triggerEl=h().createRef(),this.containerEl=h().createRef(),this.initialFocusRef=h().createRef(),this.clickOutsideHandler=null,this.resizeHandler=null,this.isWrapped=!1,this.containerPosition=void 0}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{on:function(){return e.eventManager.on(...arguments)},off:function(){return e.eventManager.off(...arguments)},getAnimatingState:()=>this.isAnimating,insertPortal:(e,t)=>{var{position:n}=t,r=bt(t,["position"]);this.cachedLatestTransitionState="enter",this.disconnectPopupResizeObserver(),this.setState({isInsert:!0,transitionState:"enter",containerStyle:Object.assign(Object.assign({},this.state.containerStyle),r),isPositionUpdated:!1},(()=>{var e;const t=()=>{"enter"===this.cachedLatestTransitionState&&this.eventManager.emit("portalInserted")},n=null===(e=this.containerEl)||void 0===e?void 0:e.current;if(n&&"undefined"!=typeof ResizeObserver){let e=!1,r=n.offsetWidth,i=n.offsetHeight;const s=()=>{e||(e=!0,t())},o=new ResizeObserver((()=>{const t=n.offsetWidth,o=n.offsetHeight;if(t<=0||o<=0)return;const a=t!==r||o!==i;r=t,i=o,e?a&&"enter"===this.cachedLatestTransitionState&&(clearTimeout(this.popupResizeTimer),this.popupResizeTimer=setTimeout((()=>{"enter"===this.cachedLatestTransitionState&&this.foundation.calcPosition()}),0)):s()}));return this.popupResizeObserver=o,o.observe(n),r>0&&i>0&&s(),void setTimeout((()=>{e||s()}),50)}n&&n.offsetWidth>0&&n.offsetHeight>0?t():setTimeout(t,0)}))},removePortal:()=>{this.disconnectPopupResizeObserver(),this.setState({isInsert:!1,isPositionUpdated:!1})},getEventName:()=>({mouseEnter:"onMouseEnter",mouseLeave:"onMouseLeave",mouseOut:"onMouseOut",mouseOver:"onMouseOver",click:"onClick",focus:"onFocus",blur:"onBlur",keydown:"onKeyDown",contextMenu:"onContextMenu"}),registerTriggerEvent:e=>{this.setState({triggerEventSet:e})},registerPortalEvent:e=>{this.setState({portalEventSet:e})},getTriggerBounding:()=>{const e=this.adapter.getTriggerNode();return this.triggerEl.current=e,e&&e.getBoundingClientRect()},getPopupContainerRect:()=>{const e=this.getPopupContainer();let t=null;if(e&&ee(e)){const n=function(e){if(e&&"object"==typeof e)return"function"==typeof e.toJSON?e.toJSON():["left","top","right","bottom","width","height"].reduce(((t,n)=>(t[n]=e[n],t)),{})}(e.getBoundingClientRect());t=Object.assign(Object.assign({},n),{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop})}return t},containerIsBody:()=>this.getPopupContainer()===document.body,containerIsRelative:()=>{const e=this.getPopupContainer();return"relative"===window.getComputedStyle(e).getPropertyValue("position")},containerIsRelativeOrAbsolute:()=>["relative","absolute"].includes(this.containerPosition),getWrapperBounding:()=>{const e=this.containerEl&&this.containerEl.current;return e&&e.getBoundingClientRect()},getDocumentElementBounding:()=>document.documentElement.getBoundingClientRect(),setPosition:e=>{var{position:t}=e,n=bt(e,["position"]);this.setState({containerStyle:Object.assign(Object.assign({},this.state.containerStyle),n),placement:t,isPositionUpdated:!0},(()=>{this.eventManager.emit("positionUpdated")}))},setDisplayNone:(e,t)=>{this.setState({displayNone:e},t)},updatePlacementAttr:e=>{this.setState({placement:e})},togglePortalVisible:(e,t)=>{const n={};n.transitionState=e?"enter":"leave",n.visible=e,this.cachedLatestTransitionState=n.transitionState,this.mounted&&this.setState(n,(()=>{t()}))},registerClickOutsideHandler:e=>{this.clickOutsideHandler&&this.adapter.unregisterClickOutsideHandler(),this.clickOutsideHandler=t=>{var n;if(!this.mounted)return!1;let r=this.triggerEl&&this.triggerEl.current,i=this.containerEl&&this.containerEl.current;r=null!==(n=ot(r))&&void 0!==n?n:r;const s=t.target,o=t.composedPath&&t.composedPath()||[s],a=!!this.props.clickTriggerToHide&&(r&&r.contains(s)||o.includes(r));(r&&!r.contains(s)&&i&&!i.contains(s)&&!o.includes(i)&&!o.includes(r)||a)&&(this.props.onClickOutSide(t),e())},window.addEventListener("mousedown",this.clickOutsideHandler)},unregisterClickOutsideHandler:()=>{this.clickOutsideHandler&&(window.removeEventListener("mousedown",this.clickOutsideHandler),this.clickOutsideHandler=null)},registerResizeHandler:e=>{this.resizeHandler&&this.adapter.unregisterResizeHandler(),this.resizeHandler=g()((t=>{if(!this.mounted)return!1;e(t)}),10),window.addEventListener("resize",this.resizeHandler,!1)},unregisterResizeHandler:()=>{this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler,!1),this.resizeHandler=null)},notifyVisibleChange:e=>{this.props.onVisibleChange(e)},registerScrollHandler:e=>{this.scrollHandler&&this.adapter.unregisterScrollHandler(),this.scrollHandler=g()((t=>{if(!this.mounted)return!1;const n=this.adapter.getTriggerNode();if(t.target.contains(n)){const n={x:t.target.scrollLeft,y:t.target.scrollTop};e(n)}}),10),window.addEventListener("scroll",this.scrollHandler,!0)},unregisterScrollHandler:()=>{this.scrollHandler&&(window.removeEventListener("scroll",this.scrollHandler,!0),this.scrollHandler=null)},canMotion:()=>Boolean(this.props.motion),updateContainerPosition:()=>{const e=document.body.getAttribute("data-position");e?this.containerPosition=e:requestAnimationFrame((()=>{const e=this.getPopupContainer();if(e&&ee(e)){const t=window.getComputedStyle(e).getPropertyValue("position");document.body.setAttribute("data-position",t),this.containerPosition=t}}))},getContainerPosition:()=>this.containerPosition,getContainer:()=>this.containerEl&&this.containerEl.current,getTriggerNode:()=>{let e=this.triggerEl.current;if(!ee(e)){const t=ot(e);if(!t)return e&&Q(!0,"[Semi Tooltip] The trigger element's ref did not return a DOM node. Please ensure the trigger component forwards ref correctly."),null;e=t}return e},getFocusableElements:e=>le(e),getActiveElement:()=>ae(),setInitialFocus:()=>{const{preventScroll:e}=this.props,t=o()(this,"initialFocusRef.current");t&&"focus"in t&&t.focus({preventScroll:e})},notifyEscKeydown:e=>{this.props.onEscKeyDown(e)},setId:()=>{this.setState({id:We()})},getTriggerDOM:()=>this.triggerEl.current?ot(this.triggerEl.current):null})}componentDidMount(){this.mounted=!0,this.getPopupContainer=this.props.getPopupContainer||this.context.getPopupContainer||St,this.foundation.init(),ce((()=>{let e=this.triggerEl.current;!e||e instanceof HTMLElement||(e=ot(e)),this.foundation.updateStateIfCursorOnTrigger(e)}),1)}componentWillUnmount(){this.mounted=!1,this.disconnectPopupResizeObserver(),this.foundation.destroy()}focusTrigger(){this.foundation.focusTrigger()}rePosition(){return this.foundation.calcPosition()}componentDidUpdate(e,t){Q(this.props.mouseLeaveDelay<this.props.mouseEnterDelay,"[Semi Tooltip] 'mouseLeaveDelay' cannot be less than 'mouseEnterDelay', which may cause the dropdown layer to not be hidden."),e.visible!==this.props.visible&&(["hover","focus"].includes(this.props.trigger)?this.props.visible?this.foundation.delayShow():this.foundation.delayHide():this.props.visible?this.foundation.show():this.foundation.hide()),Oe()(e.rePosKey,this.props.rePosKey)||this.rePosition()}render(){const{isInsert:e,triggerEventSet:t,visible:n,id:r}=this.state,{wrapWhenSpecial:i,role:s,trigger:a}=this.props;let{children:l}=this.props;const c=Object.assign({},o()(l,"props.style")),u={};if(i){const e=this.isSpecial(l);e?(c.pointerEvents="none",e===ze.STATUS_DISABLED&&(u.cursor="not-allowed"),l=(0,d.cloneElement)(l,{style:c}),"custom"!==a&&(l=this.wrapSpan(l)),this.isWrapped=!0):(0,d.isValidElement)(l)||(l=this.wrapSpan(l),this.isWrapped=!0)}let p={};"dialog"===s?(p["aria-expanded"]=n?"true":"false",p["aria-haspopup"]="dialog",p["aria-controls"]=r):p["aria-describedby"]=r;const f=h().cloneElement(l,Object.assign(Object.assign(Object.assign(Object.assign({},p),l.props),this.mergeEvents(l.props,t)),{style:Object.assign(Object.assign({},o()(l,"props.style")),u),className:w()(o()(l,"props.className")),ref:e=>{const{tooltipRef:t}=l.props;this.triggerEl.current=t?t.current:e;const n=at(l);"function"==typeof n?n(e):n&&"object"==typeof n&&(n.current=e)},tabIndex:l.props.tabIndex||0,"data-popupid":r}));return h().createElement(h().Fragment,null,e?this.renderPortal():null,f)}}_t.contextType=lt,_t.propTypes={children:E().node,motion:E().bool,autoAdjustOverflow:E().bool,position:E().oneOf(xt),getPopupContainer:E().func,mouseEnterDelay:E().number,mouseLeaveDelay:E().number,trigger:E().oneOf(Et).isRequired,className:E().string,wrapperClassName:E().string,clickToHide:E().bool,clickTriggerToHide:E().bool,visible:E().bool,style:E().object,content:E().oneOfType([E().node,E().func]),prefixCls:E().string,onVisibleChange:E().func,onClickOutSide:E().func,spacing:E().oneOfType([E().number,E().object]),margin:E().oneOfType([E().number,E().object]),showArrow:E().oneOfType([E().bool,E().node]),zIndex:E().number,rePosKey:E().oneOfType([E().string,E().number]),arrowBounding:gt,transformFromCenter:E().bool,arrowPointAtCenter:E().bool,stopPropagation:E().bool,role:E().string,wrapWhenSpecial:E().bool,guardFocus:E().bool,returnFocusOnClose:E().bool,preventScroll:E().bool,keepDOM:E().bool,condition:E().bool},_t.__SemiComponentName__="Tooltip",_t.defaultProps=he(_t.__SemiComponentName__,{arrowBounding:He.ARROW_BOUNDING,autoAdjustOverflow:!0,arrowPointAtCenter:!0,trigger:"hover",transformFromCenter:!0,position:"top",prefixCls:wt,role:"tooltip",mouseEnterDelay:He.MOUSE_ENTER_DELAY,mouseLeaveDelay:He.MOUSE_LEAVE_DELAY,motion:!0,onVisibleChange:i(),onClickOutSide:i(),spacing:He.SPACING,margin:He.MARGIN,showArrow:!0,wrapWhenSpecial:!0,zIndex:He.DEFAULT_Z_INDEX,closeOnEsc:!1,guardFocus:!1,returnFocusOnClose:!1,onEscKeyDown:i(),disableFocusListener:!1,disableArrowKeyDown:!1,keepDOM:!1,condition:!0});var kt=__webpack_require__("HDX/"),Ot=__webpack_require__.n(kt);function Tt(){}const Pt=h().createContext(null);var It={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}};const Mt=function(e,t,n){var r,i=It[e];return r="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",String(t)),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r};function Rt(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const At={date:Rt({formats:{full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},defaultWidth:"full"}),time:Rt({formats:{full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},defaultWidth:"full"}),dateTime:Rt({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})};function Nt(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Dt(e){return Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dt(e)}function Lt(e){Nt(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===Dt(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function Ft(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}var jt={};function $t(){return jt}function Bt(e,t){var n,r,i,s,o,a,l,c;Nt(1,arguments);var d=$t(),h=Ft(null!==(n=null!==(r=null!==(i=null!==(s=null==t?void 0:t.weekStartsOn)&&void 0!==s?s:null==t||null===(o=t.locale)||void 0===o||null===(a=o.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==r?r:null===(l=d.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Lt(e),p=u.getUTCDay(),f=(p<h?7:0)+p-h;return u.setUTCDate(u.getUTCDate()-f),u.setUTCHours(0,0,0,0),u}function Vt(e,t,n){var r="eeee p";return function(e,t,n){Nt(2,arguments);var r=Bt(e,n),i=Bt(t,n);return r.getTime()===i.getTime()}(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}var zt={lastWeek:Vt,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:Vt,other:"PP p"};const Ht=function(e,t,n,r){var i=zt[e];return"function"==typeof i?i(t,n,r):i};function Ut(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=null!=n&&n.width?String(n.width):i;r=e.formattingValues[s]||e.formattingValues[i]}else{var o=e.defaultWidth,a=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[a]||e.values[o]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var Kt={ordinalNumber:function(e,t){var n=Number(e);switch(null==t?void 0:t.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},era:Ut({values:{narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},defaultWidth:"wide"}),quarter:Ut({values:{narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Ut({values:{narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},defaultWidth:"wide"}),day:Ut({values:{narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},defaultWidth:"wide"}),dayPeriod:Ut({values:{narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},defaultWidth:"wide",formattingValues:{narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},defaultFormattingWidth:"wide"})};const Wt=Kt;function Gt(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;var o,a=s[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,(function(e){return e.test(a)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(l,(function(e){return e.test(a)}));return o=e.valueCallback?e.valueCallback(c):c,{value:o=n.valueCallback?n.valueCallback(o):o,rest:t.slice(a.length)}}}function qt(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var i=r[0],s=t.match(e.parsePattern);if(!s)return null;var o=e.valueCallback?e.valueCallback(s[0]):s[0];return{value:o=n.valueCallback?n.valueCallback(o):o,rest:t.slice(i.length)}}}var Xt={ordinalNumber:qt({matchPattern:/^(第\s*)?\d+(日|时|分|秒)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:Gt({matchPatterns:{narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^(前)/i,/^(公元)/i]},defaultParseWidth:"any"}),quarter:Gt({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},defaultMatchWidth:"wide",parsePatterns:{any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Gt({matchPatterns:{narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},defaultParseWidth:"any"}),day:Gt({matchPatterns:{narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},defaultMatchWidth:"wide",parsePatterns:{any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},defaultParseWidth:"any"}),dayPeriod:Gt({matchPatterns:{any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},defaultParseWidth:"any"})};const Yt={code:"zh-CN",formatDistance:Mt,formatLong:At,formatRelative:Ht,localize:Wt,match:Xt,options:{weekStartsOn:1,firstWeekContainsDate:4}},Zt={code:"zh-CN",currency:"CNY",dateFnsLocale:Yt,Pagination:{pageSize:"每页条数:${pageSize}",total:"总页数:${total}",jumpTo:"跳至",page:"页"},Modal:{confirm:"确定",cancel:"取消"},Tabs:{more:"更多"},TimePicker:{placeholder:{time:"请选择时间",timeRange:"请选择时间范围"},begin:"开始时间",end:"结束时间",hour:"时",minute:"分",second:"秒",AM:"上午",PM:"下午"},DatePicker:{placeholder:{date:"请选择日期",dateTime:"请选择日期及时间",dateRange:["开始日期","结束日期"],dateTimeRange:["开始日期","结束日期"],monthRange:["开始月份","结束月份"]},presets:"快捷选择",footer:{confirm:"确定",cancel:"取消"},selectDate:"返回选择日期",selectTime:"选择时间",year:"年",month:"月",day:"日",monthText:"${year}年 ${month}",months:{1:"1月",2:"2月",3:"3月",4:"4月",5:"5月",6:"6月",7:"7月",8:"8月",9:"9月",10:"10月",11:"11月",12:"12月"},fullMonths:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},weeks:{Mon:"一",Tue:"二",Wed:"三",Thu:"四",Fri:"五",Sat:"六",Sun:"日"},localeFormatToken:{FORMAT_SWITCH_DATE:"yyyy-MM-dd"}},Navigation:{collapseText:"收起侧边栏",expandText:"展开侧边栏"},Popconfirm:{confirm:"确定",cancel:"取消"},Table:{emptyText:"暂无数据",pageText:"显示第 ${currentStart} 条-第 ${currentEnd} 条,共 ${total} 条",descend:"点击降序",ascend:"点击升序",cancelSort:"取消排序",confirmFilter:"确定",resetFilter:"重置"},Select:{emptyText:"暂无数据",createText:"创建"},Cascader:{emptyText:"暂无数据"},Tree:{emptyText:"暂无数据",searchPlaceholder:"搜索"},List:{emptyText:"暂无数据"},Calendar:{allDay:"全天",AM:"上午${time}时",PM:"下午${time}时",datestring:"日",remaining:"还有${remained}项"},Upload:{mainText:"点击上传文件或拖拽文件到这里",illegalTips:"不支持此类型文件",legalTips:"松手开始上传",retry:"重试",replace:"替换文件",clear:"清空",selectedFiles:"已选择文件",illegalSize:"文件尺寸不合法",fail:"上传失败",cropTitle:"裁切图片",cropOk:"确定",cropCancel:"取消"},TreeSelect:{searchPlaceholder:"搜索"},Typography:{copy:"复制",copied:"复制成功",expand:"展开",collapse:"收起"},Transfer:{emptyLeft:"暂无数据",emptySearch:"无搜索结果",emptyRight:"暂无内容,可从左侧勾选",placeholder:"搜索",clear:"清空",selectAll:"全选",clearSelectAll:"取消全选",total:"总个数:${total}",selected:"已选个数:${total}"},Form:{optional:"(可选)"},Image:{preview:"预览",loading:"加载中",loadError:"加载失败",prevTip:"上一张",nextTip:"下一张",zoomInTip:"放大",zoomOutTip:"缩小",rotateTip:"旋转",downloadTip:"下载",adaptiveTip:"适应页面",originTip:"原始尺寸"},Chat:{deleteConfirm:"确认删除该会话吗?",clearContext:"上下文已清除",copySuccess:"复制成功",stop:"停止",copy:"复制",copied:"复制成功",dropAreaText:"将文件放到这里"},UserGuide:{skip:"跳过",next:"下一步",prev:"上一步",finish:"完成"},InputNumber:{},JsonViewer:{search:"查找",replace:"替换",replaceAll:"全部替换"},VideoPlayer:{rateChange:"切换速率至 ${rate}",qualityChange:"切换清晰度至${quality}",routeChange:"切换线路至${route}",mirror:"镜像",cancelMirror:"取消镜像",loading:"加载中...",stall:"加载失败",noResource:"暂无资源",videoError:"视频加载错误"},AIChatDialogue:{delete:"删除",deleteConfirm:"确认要删除吗?",deleteContent:"删除后将无法恢复!",copySuccess:"复制成功",loading:"请稍候...",reasoning:{completed:"已思考完成",thinking:"正在思考中..."},annotationText:"篇资料"},Feedback:{submit:"提交",cancel:"取消"},AIChatInput:{template:"模板",configure:"配置",selected:"已选 ${count} 个"},Sidebar:{linkAddSuccess:"已添加链接",linkRemoveSuccess:"已移除链接",enterLinkAddress:"输入链接地址",validateFailInfo:"验证失败,请重新上传",uploadFailInfo:"上传失败,请重试",uploadImgInfo:"点击上传图片或者拖拽图片到这里",defaultMcpInfo:"预设 MCP,不可关闭",searchPlaceholder:"请输入",emptyCustomMcpInfo:"暂无自定义 MCP",newMcpAdd:"自定义 MCP",mcpConfigure:"MCP 配置",annotationTitle:"参考来源",activeMCPNumber:"已激活 MCP 数:",copySuccess:"复制成功"},AudioPlayer:{backward:"后退 ${skipDuration} 秒",forward:"前进 ${skipDuration} 秒",prev:"上一首",next:"下一首",loop:"循环播放",volume:"音量",mediaError:"音频加载失败"}};class Jt extends d.Component{renderChildren(e,t){const{componentName:n}=this.props;let r=e;(null==e?void 0:e.code)||(r=Zt);const i=o()(Zt,"dateFnsLocale"),s=o()(r,"dateFnsLocale",i),a=o()(r,"currency");return t(r[n],r.code,s,a)}render(){const{children:e}=this.props;return h().createElement(lt.Consumer,null,(t=>{let{locale:n}=t;return h().createElement(Pt.Consumer,null,(t=>this.renderChildren(n||t,e)))}))}}Jt.propTypes={componentName:E().string.isRequired,children:E().any},Jt.defaultProps={componentName:""};const Qt="semi";__webpack_require__("eoZp");var en=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const tn=h().forwardRef(((e,t)=>{const{svg:n,spin:r=!1,rotate:i,style:s,className:o,prefixCls:a=Qt,type:l,size:c="default",fill:d}=e,u=en(e,["svg","spin","rotate","style","className","prefixCls","type","size","fill"]),p=w()(`${a}-icon`,{[`${a}-icon-extra-small`]:"extra-small"===c,[`${a}-icon-small`]:"small"===c,[`${a}-icon-default`]:"default"===c,[`${a}-icon-large`]:"large"===c,[`${a}-icon-extra-large`]:"extra-large"===c,[`${a}-icon-spinning`]:!0===r,[`${a}-icon-${l}`]:Boolean(l)},o),f={};return Number.isSafeInteger(i)&&(f.transform=`rotate(${i}deg)`),Object.assign(f,s),h().createElement("span",Object.assign({role:"img",ref:t,"aria-label":l,className:p,style:f},u),d?h().cloneElement(n,{fill:d}):n)}));tn.elementType="Icon";const nn=(e,t)=>{const n=h().forwardRef(((n,r)=>h().createElement(tn,Object.assign({svg:h().createElement(e),type:t,ref:r},n))));return n.elementType="Icon",n},rn=tn;const sn=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.35 4.27c.68.47.86 1.4.38 2.08l-10 14.5a1.5 1.5 0 0 1-2.33.17l-6.5-7a1.5 1.5 0 0 1 2.2-2.04l5.23 5.63 8.94-12.96a1.5 1.5 0 0 1 2.08-.38Z",fill:"currentColor"}))}),"tick");const on=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M7 4c0-1.1.9-2 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-1V8c0-2-1-3-3-3H7V4Z",fill:"currentColor"}),d.createElement("path",{d:"M5 7a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2H5Z",fill:"currentColor"}))}),"copy"),an="Enter",ln="Escape",cn={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229};const dn=function(e){return o()(e,"key")===an},hn=G.PREFIX;class un extends h().PureComponent{constructor(e){super(e),this.copy=e=>{const{content:t,duration:n,onCopy:r}=this.props,i=Ot()(t);r&&r(e,t,i),this.setCopied(t,n)},this.setCopied=(e,t)=>{this.setState({copied:!0,item:e}),this._timeId=setTimeout((()=>{this.resetCopied()}),1e3*t)},this.resetCopied=()=>{this._timeId&&(clearTimeout(this._timeId),this._timeId=null,this.setState({copied:!1,item:""}))},this.renderSuccessTip=()=>{const{successTip:e}=this.props;return void 0!==e?e:h().createElement(Jt,{componentName:"Typography"},(e=>h().createElement("span",null,h().createElement(sn,null),e.copied)))},this.renderCopyIcon=()=>{const{icon:e}=this.props,t={role:"button",tabIndex:0,onClick:this.copy,onKeyPress:e=>dn(e)&&this.copy(e)},n=h().createElement("a",{className:`${hn}-action-copy-icon`},h().createElement(on,Object.assign({onClick:this.copy},t)));return h().isValidElement(e)?h().cloneElement(e,t):n},this.state={copied:!1,item:""}}componentWillUnmount(){this._timeId&&(clearTimeout(this._timeId),this._timeId=null)}render(){const{style:e,className:t,forwardRef:n,copyTip:r,render:i}=this.props,{copied:s}=this.state,o=w()(t,{[`${hn}-action-copy`]:!s,[`${hn}-action-copied`]:s});return i?i(s,this.copy,this.props):h().createElement(Jt,{componentName:"Typography"},(t=>h().createElement("span",{style:Object.assign({marginLeft:"4px"},e),className:o,ref:n},s?this.renderSuccessTip():h().createElement(_t,{content:void 0!==r?r:t.copy},this.renderCopyIcon()))))}}un.propTypes={content:E().string,onCopy:E().func,successTip:E().node,copyTip:E().node,duration:E().number,style:E().object,className:E().string,icon:E().node},un.defaultProps={content:"",onCopy:Tt,duration:3,style:{},className:""};const pn=un,fn={PREFIX:`${C}-popover`,ARROW:`${C}-popover-icon-arrow`},mn={POSITION_SET:["top","topLeft","topRight","left","leftTop","leftBottom","right","rightTop","rightBottom","bottom","bottomLeft","bottomRight","leftTopOver","rightTopOver"],TRIGGER_SET:["hover","focus","click","custom","contextMenu"],DEFAULT_ARROW_STYLE:{borderOpacity:"1",backgroundColor:"var(--semi-color-bg-3)",borderColor:"var(--semi-color-border)"}},gn={ARROW_BOUNDING:Object.assign(Object.assign({},He.ARROW_BOUNDING),{offsetY:6,offsetX:0,height:8}),SPACING:4,SPACING_WITH_ARROW:10,DEFAULT_Z_INDEX:1030};var yn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const vn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{position:t="",className:n,arrowStyle:r,popStyle:i}=e,s=yn(e,["position","className","arrowStyle","popStyle"]),a=0===t.indexOf("top")||0===t.indexOf("bottom"),l=w()(n,fn.ARROW),c=o()(r,"borderOpacity"),d=o()(r,"backgroundColor",o()(i,"backgroundColor")),u=o()(r,"borderColor",o()(i,"borderColor")),p=Object.assign(Object.assign({},s),{width:gn.ARROW_BOUNDING.width,height:gn.ARROW_BOUNDING.height,xmlns:"http://www.w3.org/2000/svg",className:l});return a?h().createElement("svg",Object.assign({},p),h().createElement("path",{d:"M0 0.5L0 1.5C4 1.5, 5.5 3, 7.5 5S10,8 12,8S14.5 7, 16.5 5S20,1.5 24,1.5L24 0.5L0 0.5z",style:{fill:u,opacity:c}}),h().createElement("path",{d:"M0 0L0 1C4 1, 5.5 2, 7.5 4S10,7 12,7S14.5 6, 16.5 4S20,1 24,1L24 0L0 0z",style:{fill:d}})):h().createElement("svg",Object.assign({},p),h().createElement("path",{d:"M0.5 0L1.5 0C1.5 4, 3 5.5, 5 7.5S8,10 8,12S7 14.5, 5 16.5S1.5,20 1.5,24L0.5 24L0.5 0z",style:{fill:u,opacity:c}}),h().createElement("path",{d:"M0 0L1 0C1 4, 2 5.5, 4 7.5S7,10 7,12S6 14.5, 4 16.5S1,20 1,24L0 24L0 0z",style:{fill:d}}))};__webpack_require__("zcIP");var bn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const wn=mn.POSITION_SET,xn=mn.TRIGGER_SET;class En extends h().PureComponent{constructor(e){super(e),this.focusTrigger=()=>{var e;null===(e=this.tooltipRef.current)||void 0===e||e.focusTrigger()},this.renderPopCard=e=>{let{initialFocusRef:t}=e;const{content:n,contentClassName:r,prefixCls:i}=this.props,{direction:s}=this.context,o=w()(i,r,{[`${i}-rtl`]:"rtl"===s}),a=this.renderContentNode({initialFocusRef:t,content:n});return h().createElement("div",{className:o},h().createElement("div",{className:`${i}-content`},a))},this.renderContentNode=e=>{const{initialFocusRef:t,content:n}=e,r={initialFocusRef:t};return ye()(n)?n(r):n},this.tooltipRef=h().createRef()}render(){const e=this.props,{children:t,prefixCls:n,showArrow:r,arrowStyle:i={},arrowBounding:s,position:o,style:a,trigger:l}=e,c=bn(e,["children","prefixCls","showArrow","arrowStyle","arrowBounding","position","style","trigger"]);let{spacing:d}=this.props;const u={position:o,className:"",popStyle:a,arrowStyle:i},p=!!r&&h().createElement(vn,Object.assign({},u));Re(d)&&(d=r?gn.SPACING_WITH_ARROW:gn.SPACING);const f="click"===l||"custom"===l?"dialog":"tooltip";return h().createElement(_t,Object.assign({guardFocus:!0,ref:this.tooltipRef},c,{trigger:l,position:o,style:a,content:this.renderPopCard,prefixCls:n,spacing:d,showArrow:p,arrowBounding:s,role:f}),t)}}En.contextType=lt,En.propTypes={children:E().node,content:E().oneOfType([E().node,E().func]),visible:E().bool,autoAdjustOverflow:E().bool,motion:E().bool,position:E().oneOf(wn),margin:E().oneOfType([E().number,E().object]),mouseEnterDelay:E().number,mouseLeaveDelay:E().number,trigger:E().oneOf(xn).isRequired,contentClassName:E().oneOfType([E().string,E().array]),onVisibleChange:E().func,onClickOutSide:E().func,style:E().object,spacing:E().oneOfType([E().number,E().object]),zIndex:E().number,showArrow:E().bool,arrowStyle:E().shape({borderColor:E().string,backgroundColor:E().string,borderOpacity:E().oneOfType([E().string,E().number])}),arrowPointAtCenter:E().bool,arrowBounding:E().object,prefixCls:E().string,guardFocus:E().bool,disableArrowKeyDown:E().bool,condition:E().bool},En.__SemiComponentName__="Popover",En.defaultProps=he(En.__SemiComponentName__,{arrowBounding:gn.ARROW_BOUNDING,showArrow:!1,autoAdjustOverflow:!0,zIndex:gn.DEFAULT_Z_INDEX,motion:!0,trigger:"hover",cancelText:"No",okText:"Yes",position:"bottom",prefixCls:fn.PREFIX,onClickOutSide:i(),onEscKeyDown:i(),closeOnEsc:!0,returnFocusOnClose:!0,guardFocus:!0,disableFocusListener:!0});const Cn=En;let Sn;function _n(e){if(!e)return 0;const t=e.match(/^\d*(\.\d*)?/);return t?Number(t[0]):0}const kn=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,a=arguments.length>7?arguments[7]:void 0;if(0===n.length)return"";Sn||(Sn=document.createElement("div"),Sn.setAttribute("aria-hidden","true"),document.body.appendChild(Sn));const l=window.getComputedStyle(e),c=function(e){return Array.prototype.slice.apply(e).map((t=>`${t}: ${e.getPropertyValue(t)};`)).join("")}(l),d=_n(l.lineHeight),h=Math.round(d*(t+1)+_n(l.paddingTop)+_n(l.paddingBottom));function u(){const e=Sn.scrollWidth<=Sn.offsetWidth,n=Sn.scrollHeight<h;return 1===t?e&&n:n}Sn.setAttribute("style",c),Sn.style.position="fixed",Sn.style.left="0","auto"===l.getPropertyValue("width")&&e.offsetWidth&&(Sn.style.width=`${e.offsetWidth}px`),Sn.style.height="auto",Sn.style.top="-999999px",Sn.style.zIndex="-1000",a&&(Sn.style.fontWeight="600"),Sn.style.textOverflow="clip",Sn.style.webkitLineClamp="none",Sn.innerHTML="";const p=document.createElement("span"),f=document.createTextNode(n);if(p.appendChild(f),s.length>0){const e=document.createTextNode(s);p.appendChild(e)}function m(e,t){const n=e.length;return t?"end"===o?e.slice(0,t)+i:e.slice(0,t)+i+e.slice(n-t,n):i}Sn.appendChild(p),Object.values(W()(r,"expand")).map((e=>e&&Sn.appendChild(e.cloneNode(!0))));let g=n;return u()||(Sn.innerHTML="",Sn.appendChild(p),Object.values(r).map((e=>e&&Sn.appendChild(e.cloneNode(!0)))),g=function e(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.length,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;const a=Math.floor((r+s)/2),l=m(n,a);if(t.textContent=l,r>=s-1&&s>0)for(let e=s;e>=r;e-=1){const r=m(n,e);if(t.textContent=r,u())return r}else if(0===s)return i;return u()?e(t,n,a,s,a):e(t,n,r,a,o)}(f,n,0,"middle"===o?Math.floor(n.length/2):n.length)),Sn.innerHTML="",g},On=h().createContext("normal");var Tn;!function(e){e.Width="width",e.Height="height",e.All="all"}(Tn||(Tn={}));class Pn extends f{constructor(e){var t;super(e),t=this,this.formerPropertyValue=new Map,this.getElement=()=>{try{const e=this.childNode||this;return ot(e)||(e instanceof Element?e:null)}catch(e){return null}},this.handleResizeEventTriggered=e=>{var t,n,r,i;if(this.props.observerProperty===Tn.All)null===(n=(t=this.props).onResize)||void 0===n||n.call(t,e);else{const t=[];for(const n of e)this.formerPropertyValue.has(n.target)?n.contentRect[this.props.observerProperty]!==this.formerPropertyValue.get(n.target)&&(this.formerPropertyValue.set(n.target,n.contentRect[this.props.observerProperty]),t.push(n)):(this.formerPropertyValue.set(n.target,n.contentRect[this.props.observerProperty]),t.push(n));t.length>0&&(null===(i=(r=this.props).onResize)||void 0===i||i.call(r,t))}},this.observeElement=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const n=t.getElement();t.observer||(t.observer=new ResizeObserver(t.handleResizeEventTriggered)),n&&n instanceof Element?(n!==t.element||e)&&(t.observer.disconnect(),t.element=n,t.observer.observe(n),t.props.observeParent&&n.parentNode&&n.parentNode.ownerDocument&&n.parentNode.ownerDocument.defaultView&&n.parentNode instanceof n.parentNode.ownerDocument.defaultView.HTMLElement&&(t._parentNode=n.parentNode,t.observer.observe(t._parentNode))):t.observer.disconnect()},this.mergeRef=(e,t)=>{this.childNode=t,"function"==typeof e?e(t):"object"==typeof e&&e&&"current"in e&&(e.current=t)},globalThis.ResizeObserver&&(this.observer=new ResizeObserver(this.handleResizeEventTriggered))}componentDidMount(){var e;null===(e=this.observeElement)||void 0===e||e.call(this)}componentDidUpdate(e){var t;null===(t=this.observeElement)||void 0===t||t.call(this,this.props.observeParent!==e.observeParent)}componentWillUnmount(){this.observer&&(this.observer.disconnect(),this.observer=null,this.element=null)}render(){const e=h().Children.only(this.props.children),t=at(e);return h().cloneElement(e,{ref:e=>this.mergeRef(t,e)})}}Pn.propTypes={onResize:E().func,observeParent:E().bool,observerProperty:E().string,delayTick:E().number},Pn.defaultProps={onResize:()=>{},observeParent:!1,observerProperty:"all",delayTick:0};var In=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))},Mn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Rn=G.PREFIX;class An extends d.Component{constructor(e){super(e),this.observerTakingEffect=!1,this.onResize=e=>In(this,void 0,void 0,(function*(){return this.rafId&&window.cancelAnimationFrame(this.rafId),new Promise((e=>{this.rafId=window.requestAnimationFrame((()=>In(this,void 0,void 0,(function*(){yield this.getEllipsisState(),e()}))))}))})),this.canUseCSSEllipsis=()=>{const{copyable:e}=this.props,{expandable:t,expandText:n,pos:r,suffix:i}=this.getEllipsisOpt();return!t&&_e()(n)&&!e&&"end"===r&&!i.length},this.shouldTruncated=e=>{if(!e||e<1)return!1;return e<=1?this.compareSingleRow():this.wrapperRef.current.scrollHeight>this.wrapperRef.current.offsetHeight},this.compareSingleRow=()=>{if(!document||!document.createRange)return!1;const e=this.wrapperRef.current,t=e.getBoundingClientRect().width,n=window.getComputedStyle(e),r=parseFloat(n.paddingLeft)||0,i=parseFloat(n.paddingRight)||0,s=parseFloat(n.borderLeftWidth)||0,o=parseFloat(n.borderRightWidth)||0,a=Math.max(0,t-r-i-s-o),l=Array.from(e.childNodes),c=document.createRange(),d=l.reduce(((e,t)=>{var n;return c.selectNodeContents(t),e+(null!==(n=c.getBoundingClientRect().width)&&void 0!==n?n:0)}),0);return c.detach(),d>a},this.showTooltip=()=>{var e,t;const{isOverflowed:n,isTruncated:r,expanded:i}=this.state,{showTooltip:s,expandable:o,expandText:a}=this.getEllipsisOpt(),l=this.canUseCSSEllipsis(),c=!i&&(l?n:r),d=!o&&_e()(a)&&c&&s;if(!d)return d;const h={type:"tooltip"};return"object"==typeof s?s.type&&"popover"===s.type.toLowerCase()?Ce()({opts:{showArrow:!0}},s,{opts:{className:w()({[`${Rn}-ellipsis-popover`]:!0,[null===(e=null==s?void 0:s.opts)||void 0===e?void 0:e.className]:Boolean(null===(t=null==s?void 0:s.opts)||void 0===t?void 0:t.className)})}}):Object.assign(Object.assign({},h),s):h},this.onHover=()=>{if(this.canUseCSSEllipsis()){const{rows:e,suffix:t,pos:n}=this.getEllipsisOpt(),r=this.shouldTruncated(e);this.setState({isOverflowed:r,isTruncated:!1})}else;},this.getEllipsisState=()=>In(this,void 0,void 0,(function*(){const{rows:e,suffix:t,pos:n,showTooltip:r}=this.getEllipsisOpt(),{children:i,strong:s}=this.props;if(!this.wrapperRef||!this.wrapperRef.current)return void(yield this.onResize());const{expanded:o}=this.state;if(this.canUseCSSEllipsis()){if(r){const t=this.shouldTruncated(e);return new Promise((e=>{this.setState({isOverflowed:t,isTruncated:!1},e)}))}return}if(be()(i))return new Promise((e=>{this.setState({isTruncated:!1,isOverflowed:!1},e)}));if(Q("children"in this.props&&"string"!=typeof i,"[Semi Typography] Only children with pure text could be used with ellipsis at this moment."),!e||e<0||o)return;const a={expand:this.expandRef.current,copy:this.copyRef&&this.copyRef.current},l=Array.isArray(i)?i.join(""):String(i),c=kn(this.wrapperRef.current,e,l,a,"...",t,n,s);return new Promise((e=>{this.setState({isOverflowed:!1,ellipsisContent:c,isTruncated:l!==c},e)}))})),this.toggleOverflow=e=>{const{onExpand:t,expandable:n,collapsible:r}=this.getEllipsisOpt(),{expanded:i}=this.state;t&&t(!i,e),(n&&!i||r&&i)&&this.setState({expanded:!i})},this.getEllipsisOpt=()=>{const{ellipsis:e}=this.props;if(!e)return{};return Object.assign({rows:1,expandable:!1,pos:"end",suffix:"",showTooltip:!1,collapsible:!1,expandText:e.expandable?this.expandStr:void 0,collapseText:e.collapsible?this.collapseStr:void 0},"object"==typeof e?e:null)},this.renderExpandable=()=>{const{expanded:e,isTruncated:t}=this.state;if(!t)return null;const{expandText:n,expandable:r,collapseText:i,collapsible:s}=this.getEllipsisOpt(),o=!r&&_e()(n),a=!s&&_e()(i);let l;return e||o?e&&!a&&(l=i):l=n,o&&a?null:h().createElement("a",{role:"button",tabIndex:0,className:`${Rn}-ellipsis-expand`,key:"expand",ref:this.expandRef,"aria-label":l,onClick:this.toggleOverflow,onKeyPress:e=>dn(e)&&this.toggleOverflow(e)},l)},this.getEllipsisStyle=()=>{const{ellipsis:e,component:t}=this.props;if(!e)return{ellipsisCls:"",ellipsisStyle:{}};const{rows:n}=this.getEllipsisOpt(),{expanded:r}=this.state,i=!r&&this.canUseCSSEllipsis();return{ellipsisCls:w()({[`${Rn}-ellipsis`]:!0,[`${Rn}-ellipsis-single-line`]:1===n,[`${Rn}-ellipsis-multiple-line`]:n>1,[`${Rn}-ellipsis-multiple-line-text`]:n>1&&"span"===t,[`${Rn}-ellipsis-overflow-ellipsis`]:1===n&&i,[`${Rn}-ellipsis-overflow-ellipsis-text`]:1===n&&i&&"span"===t}),ellipsisStyle:i&&n>1?{WebkitLineClamp:n}:{}}},this.renderEllipsisText=e=>{const{suffix:t}=e,{children:n}=this.props,{isTruncated:r,expanded:i,ellipsisContent:s}=this.state;return i||!r?h().createElement("span",{onMouseEnter:this.onHover},n,t&&t.length?t:null):h().createElement("span",{onMouseEnter:this.onHover},s,t)},this.state={editable:!1,copied:!1,isOverflowed:!1,ellipsisContent:e.children,expanded:!1,isTruncated:!1,prevChildren:null},this.wrapperRef=h().createRef(),this.expandRef=h().createRef(),this.copyRef=h().createRef()}componentDidMount(){this.props.ellipsis&&this.onResize().then((()=>ce((()=>this.observerTakingEffect=!0),1)))}static getDerivedStateFromProps(e,t){const{prevChildren:n}=t,r={};return r.prevChildren=e.children,e.ellipsis&&n!==e.children&&(r.isOverflowed=!1,r.ellipsisContent=e.children,r.expanded=!1,r.isTruncated=!0),r}componentDidUpdate(e){this.props.children!==e.children&&(this.forceUpdate(),this.props.ellipsis&&this.onResize())}componentWillUnmount(){this.rafId&&window.cancelAnimationFrame(this.rafId)}renderOperations(){return h().createElement(h().Fragment,null,this.renderExpandable(),this.renderCopy())}renderCopy(){var e;const{copyable:t,children:n}=this.props;if(!t)return null;const r=null!==(e=null==t?void 0:t.content)&&void 0!==e?e:n;let i,s=!1;Array.isArray(r)?(i="",r.forEach((e=>{"object"==typeof e&&(s=!0),i+=String(e)}))):("object"!=typeof r||(s=!0),i=String(r)),Q(s,"Content to be copied in Typography is a object, it will case a [object Object] mistake when copy to clipboard.");const o=Object.assign({content:i,duration:3},"object"==typeof t?t:null);return h().createElement(pn,Object.assign({},o,{forwardRef:this.copyRef}))}renderIcon(){const{icon:e,size:t}=this.props,n="inherit"===t?this.context:t;if(!e)return null;const r="small"===n?"small":"default";return h().createElement("span",{className:`${Rn}-icon`,"x-semi-prop":"icon"},oe(e)?h().cloneElement(e,{size:r}):e)}renderContent(){const e=this.props,{component:t,children:n,className:r,type:i,spacing:s,disabled:o,style:a,ellipsis:l,icon:c,size:d,link:u,heading:p,weight:f}=e,m=Mn(e,["component","children","className","type","spacing","disabled","style","ellipsis","icon","size","link","heading","weight"]),g=W()(m,["strong","editable","mark","copyable","underline","code","delete"]),y="inherit"===d?this.context:d,v=this.renderIcon(),b=this.getEllipsisOpt(),{ellipsisCls:x,ellipsisStyle:E}=this.getEllipsisStyle();let C=l?this.renderEllipsisText(b):n;const S=w()({[`${Rn}-link-text`]:u,[`${Rn}-link-underline`]:this.props.underline&&u});C=((e,t)=>{const{mark:n,code:r,underline:i,strong:s,link:o,disabled:a}=e;let l=t;const c=(e,t)=>{let n={};e&&("object"==typeof e&&(n=Object.assign({},e)),l=h().createElement(t,n,l))};return c(n,"mark"),c(r,"code"),c(i&&!o,"u"),c(s,"strong"),c(e.delete,"del"),c(o,a?"span":"a"),l})(this.props,h().createElement(h().Fragment,null,v,this.props.link?h().createElement("span",{className:S},C):C));const _=xe()(p)&&/^h[1-6]$/.test(p),k=w()(r,x,{[`${Rn}-${i}`]:i&&!u,[`${Rn}-${y}`]:y,[`${Rn}-link`]:u,[`${Rn}-disabled`]:o,[`${Rn}-${s}`]:s,[`${Rn}-${p}`]:_,[`${Rn}-${p}-weight-${f}`]:_&&f&&isNaN(Number(f))}),O=Object.assign(Object.assign({},isNaN(Number(f))?{}:{fontWeight:f}),a);return h().createElement(me,Object.assign({tooltipRef:this.wrapperRef,className:k,style:Object.assign(Object.assign({},O),E),component:t,forwardRef:this.wrapperRef},g),C,this.renderOperations())}renderTipWrapper(){const{children:e}=this.props,t=this.showTooltip(),n=this.renderContent();if(t){const{type:r,opts:i,renderTooltip:s}=t;return ye()(s)?s(e,n):"popover"===r.toLowerCase()?h().createElement(Cn,Object.assign({content:e,position:"top"},i),n):h().createElement(_t,Object.assign({content:e,position:"top"},i),n)}return n}render(){var e=this;const{size:t}=this.props,n="inherit"===t?this.context:t,r=h().createElement(On.Provider,{value:n},h().createElement(Jt,{componentName:"Typography"},(e=>(this.expandStr=e.expand,this.collapseStr=e.collapse,this.renderTipWrapper()))));return this.props.ellipsis?h().createElement(Pn,{onResize:function(){e.observerTakingEffect&&e.onResize(...arguments)},observeParent:!0,observerProperty:Tn.Width},r):r}}An.propTypes={children:E().node,copyable:E().oneOfType([E().shape({text:E().string,onCopy:E().func,successTip:E().node,copyTip:E().node}),E().bool]),delete:E().bool,disabled:E().bool,ellipsis:E().oneOfType([E().shape({rows:E().number,expandable:E().bool,expandText:E().string,onExpand:E().func,suffix:E().string,showTooltip:E().oneOfType([E().shape({type:E().string,opts:E().object}),E().bool]),collapsible:E().bool,collapseText:E().string,pos:E().oneOf(["end","middle"])}),E().bool]),mark:E().bool,underline:E().bool,link:E().oneOfType([E().object,E().bool]),spacing:E().oneOf(q.SPACING),strong:E().bool,size:E().oneOf(q.SIZE),type:E().oneOf(q.TYPE),style:E().object,className:E().string,icon:E().oneOfType([E().node,E().string]),heading:E().string,component:E().string},An.defaultProps={children:null,copyable:!1,delete:!1,disabled:!1,ellipsis:!1,icon:"",mark:!1,underline:!1,strong:!1,link:!1,type:"primary",spacing:"normal",size:"normal",style:{},className:""},An.contextType=On;class Nn extends d.PureComponent{render(){return h().createElement(An,Object.assign({component:"span"},this.props))}}Nn.propTypes={copyable:E().oneOfType([E().object,E().bool]),delete:E().bool,disabled:E().bool,icon:E().oneOfType([E().node,E().string]),ellipsis:E().oneOfType([E().object,E().bool]),mark:E().bool,underline:E().bool,link:E().oneOfType([E().object,E().bool]),strong:E().bool,type:E().oneOf(q.TYPE),size:E().oneOf(q.SIZE),style:E().object,className:E().string,code:E().bool,component:E().string,weight:E().number},Nn.defaultProps={copyable:!1,delete:!1,disabled:!1,icon:"",ellipsis:!1,mark:!1,underline:!1,strong:!1,link:!1,type:"primary",style:{},size:"normal",className:""};var Dn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class Ln extends d.PureComponent{render(){const e=this.props,{heading:t}=e,n=Dn(e,["heading"]),r=-1!==q.HEADING.indexOf(t)?`h${t}`:"h1";return h().createElement(An,Object.assign({component:r,heading:r},n))}}Ln.propTypes={copyable:E().oneOfType([E().object,E().bool]),delete:E().bool,disabled:E().bool,ellipsis:E().oneOfType([E().object,E().bool]),mark:E().bool,link:E().oneOfType([E().object,E().bool]),underline:E().bool,strong:E().bool,type:E().oneOf(q.TYPE),heading:E().oneOf(q.HEADING),style:E().object,className:E().string,component:E().string,weight:E().oneOfType([E().oneOf(q.WEIGHT),E().number])},Ln.defaultProps={copyable:!1,delete:!1,disabled:!1,ellipsis:!1,mark:!1,underline:!1,strong:!1,link:!1,type:"primary",heading:1,style:{},className:""};const Fn=G.PREFIX;class jn extends d.PureComponent{render(){const{className:e}=this.props,t=w()(e,`${Fn}-paragraph`);return h().createElement(An,Object.assign({component:"p"},this.props,{className:t}))}}jn.propTypes={copyable:E().oneOfType([E().object,E().bool]),delete:E().bool,disabled:E().bool,ellipsis:E().oneOfType([E().object,E().bool]),mark:E().bool,link:E().oneOfType([E().object,E().bool]),underline:E().bool,strong:E().bool,type:E().oneOf(q.TYPE),size:E().oneOf(q.SIZE),spacing:E().oneOf(q.SPACING),style:E().object,className:E().string,component:E().string},jn.defaultProps={copyable:!1,delete:!1,disabled:!1,ellipsis:!1,mark:!1,underline:!1,strong:!1,link:!1,type:"primary",size:"normal",spacing:"normal",style:{},className:""};class $n{constructor(e,t,n,r,i){this.ruleMethods={"bytes-decimal":e=>{let t=0;for(;e>=1e3;)e/=1e3,t++;return`${this.truncatePrecision(e)} ${["B","KB","MB","GB","TB","PB","EB","ZB","YB"][t]}`},"bytes-binary":e=>{let t=0;for(;e>=1024;)e/=1024,t++;return`${this.truncatePrecision(e)} ${["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"][t]}`},percentages:e=>`${this.truncatePrecision(100*e)}%`,exponential:e=>{const t=e.toExponential(this.precision+2).split("e");return`${this.truncatePrecision(Number(t[0]))}e${t[1]}`}},this.truncateMethods={ceil:Math.ceil,floor:Math.floor,round:Math.round},this.isDiyParser=void 0!==i,this.content=e,this.rule=t,this.precision=n,this.truncate=r,this.parser=i}format(){return this.isDiyParser?this.parser(this.content):"text"===this.rule?Bn(this.content).map((e=>Vn(e)?this.truncatePrecision(e):e)).join(""):"numbers"===this.rule?Bn(this.content).filter((e=>Vn(e))).map((e=>this.truncatePrecision(e))).join(","):Bn(this.content).map((e=>Vn(e)?this.ruleMethods[this.rule](Number(e)):e)).join("")}truncatePrecision(e){const t=this.truncateMethods[this.truncate](Number(e)*Math.pow(10,this.precision))/Math.pow(10,this.precision),n=t.toString().split(".");if(1===n.length)return t.toFixed(this.precision);const r=n[1].length;return r<this.precision?`${n[0]}.${n[1]}${"0".repeat(this.precision-r)}`:t.toString()}}function Bn(e){return e.match(/(-?[0-9]*\.?[0-9]+([eE]-?[0-9]+)?)|([^-\d\.]+)/g)||[]}function Vn(e){return!(isNaN(Number(e))||""===e.replace(/\s+/g,""))}class zn extends d.PureComponent{formatNodeDFS(e){return Array.isArray(e)||(e=[e]),1===(e=e.map((e=>"string"==typeof e||"number"==typeof e?new $n(String(e),this.props.rule,this.props.precision,this.props.truncate,this.props.parser).format():"function"==typeof e?this.formatNodeDFS(e()):"object"==typeof e&&"children"in e.props?Object.assign(Object.assign({},e),{props:Object.assign(Object.assign({},e.props),{children:this.formatNodeDFS(e.props.children)})}):e))).length?e[0]:e}render(){const e=Object.assign({},this.props);return delete e.rule,delete e.parser,e.children=this.formatNodeDFS(this.props.children),h().createElement(An,Object.assign({component:"span"},e))}}zn.propTypes={rule:E().oneOf(q.RULE),precision:E().number,truncate:E().oneOf(q.TRUNCATE),parser:E().func,copyable:E().oneOfType([E().object,E().bool]),delete:E().bool,disabled:E().bool,icon:E().oneOfType([E().node,E().string]),mark:E().bool,underline:E().bool,link:E().oneOfType([E().object,E().bool]),strong:E().bool,type:E().oneOf(q.TYPE),size:E().oneOf(q.SIZE),style:E().object,className:E().string,code:E().bool,component:E().string},zn.defaultProps={rule:"text",precision:0,truncate:"round",parser:void 0,copyable:!1,delete:!1,icon:"",mark:!1,underline:!1,strong:!1,link:!1,type:"primary",style:{},size:"normal",className:""};const Hn=me;Hn.Text=Nn,Hn.Title=Ln,Hn.Paragraph=jn,Hn.Numeral=zn;const Un=Hn,Kn=S.PREFIX;class Wn extends f{constructor(e){super(e),this.renderTitle=()=>{const{href:e,title:t,disabled:n=!1}=this.props,{activeLink:r,showTooltip:i,position:s,size:o}=this.context,a=r===e,l=w()(`${Kn}-link-tooltip`,{[`${Kn}-link-tooltip-small`]:"small"===o,[`${Kn}-link-tooltip-active`]:a,[`${Kn}-link-tooltip-disabled`]:n});if(i){const e=z()(i)?Object.assign({opts:{}},i):{opts:{}};return s&&(e.opts.position=s),h().createElement(Un.Text,{size:"default"===o?"normal":"small",ellipsis:{showTooltip:e},type:"tertiary",className:l},t)}return t},this.renderChildren=()=>{const{activeLink:e,childMap:t}=this.context,{href:n,children:r}=this.props;return this.context.autoCollapse?e===n||t[n]&&t[n].has(e)?h().createElement("div",{role:"list"},r):null:h().createElement("div",{role:"list"},r)},this.foundation=new H(this.adapter),this.handleClick=this.handleClick.bind(this)}get adapter(){return Object.assign(Object.assign({},super.adapter),{addLink:e=>{this.context.addLink(e)},removeLink:e=>{this.context.removeLink(e)}})}handleAddLink(){this.foundation.handleAddLink()}handleRemoveLink(){this.foundation.handleRemoveLink()}handleUpdateLink(e,t){this.foundation.handleUpdateLink(e,t)}handleClick(e){const{disabled:t,href:n}=this.props,{onClick:r}=this.context;!t&&r(e,n)}componentDidMount(){this.handleAddLink()}componentDidUpdate(e){const t=e.href,{href:n}=this.props;this.handleUpdateLink(n,t)}componentWillUnmount(){this.handleRemoveLink()}render(){const{href:e,className:t,style:n,disabled:r=!1,title:i,level:s,direction:o}=this.props,{activeLink:a,showTooltip:l}=this.context,c=a===e,d=w()(`${Kn}-link`,t),u=w()(`${Kn}-link-title`,{[`${Kn}-link-title-active`]:c,[`${Kn}-link-title-disabled`]:r}),p="rtl"===o?"paddingRight":"paddingLeft",f={"aria-disabled":r,style:{[p]:8*s}};return c&&(f["aria-details"]="active"),l||"string"!=typeof i||(f.title=i),h().createElement("div",{className:d,style:n,role:"listitem"},h().createElement("div",Object.assign({role:"link",tabIndex:0},f,{className:u,onClick:e=>this.handleClick(e),onKeyPress:e=>this.handleClick(e)}),this.renderTitle()),this.renderChildren())}}Wn.propTypes={href:E().string,title:E().oneOfType([E().string,E().node]),className:E().string,style:E().object},Wn.defaultProps={href:"#",title:"",className:""},Wn.contextType=U;__webpack_require__("7VVg");const Gn=S.PREFIX;class qn extends f{constructor(e){var t;super(e),t=this,this.addLink=e=>{this.foundation.addLink(e)},this.removeLink=e=>{this.foundation.removeLink(e)},this.handleScroll=()=>{this.foundation.handleScroll()},this.handleClick=(e,t)=>{this.foundation.handleClick(e,t)},this.handleClickLink=()=>{this.foundation.handleClickLink()},this.handleResize=e=>{const t=e[0];if(t){let e=!1;e=t.borderBoxSize?!(0===t.borderBoxSize[0].blockSize&&0===t.borderBoxSize[0].inlineSize):!(0===t.contentRect.height&&0===t.contentRect.width),e&&this.setScrollHeight()}},this.setChildMap=()=>{this.foundation.setChildMap()},this.setScrollHeight=()=>{this.foundation.setScrollHeight()},this.updateScrollHeight=(e,t)=>{this.foundation.updateScrollHeight(e,t)},this.updateChildMap=(e,t)=>{this.foundation.updateChildMap(e,t)},this.renderChildren=()=>{const e=function(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return h().Children.map(n,(n=>{if(h().isValidElement(n)){const i={direction:t.context.direction,level:r,children:[]},{children:s}=n.props;return s&&h().Children.count(s)>0&&(i.children=e(s,r+1)),h().cloneElement(n,i)}return null}))};return e(this.props.children)},this.state={activeLink:"",links:[],clickLink:!1,scrollHeight:"100%",slideBarTop:"0"},this.foundation=new B(this.adapter),this.childMap={},this.linkWrapperRef=h().createRef(),this.resizeObserver=null}get adapter(){return Object.assign(Object.assign({},super.adapter),{addLink:e=>{this.setState((t=>({links:[...t.links,e]})))},removeLink:e=>{this.setState((t=>{const n=t.links.slice(),r=n.indexOf(e);if(-1!==r)return n.splice(r,1),{links:n}}))},setChildMap:e=>{this.childMap=e},setScrollHeight:e=>{this.setState({scrollHeight:e})},setSlideBarTop:e=>{this.setState({slideBarTop:`${e}px`})},setClickLink:e=>{this.setState({clickLink:e})},setActiveLink:(e,t)=>{this.setState({activeLink:e},(()=>{t()}))},setClickLinkWithCallBack:(e,t,n)=>{this.setState({clickLink:e},(()=>{n(t)}))},getContainer:()=>{const{getContainer:e}=this.props,t=e();return t||window},getContainerBoundingTop:()=>{const e=this.adapter.getContainer();return"getBoundingClientRect"in e?e.getBoundingClientRect().top:0},getLinksBoundingTop:()=>{const{links:e}=this.state,{offsetTop:t}=this.props,n=this.adapter.getContainerBoundingTop(),r=e.map((e=>{let r=null;try{r=document.querySelector(e)}catch(e){}return r&&r.getBoundingClientRect().top-n-t||-1/0}));return r},getAnchorNode:e=>{const t=`#${this.anchorID} ${e}`;return document.querySelector(t)},getContentNode:e=>document.querySelector(e),notifyChange:(e,t)=>this.props.onChange(e,t),notifyClick:(e,t)=>this.props.onClick(e,t),canSmoothScroll:()=>"scrollBehavior"in document.body.style})}componentDidMount(){const{defaultAnchor:e=""}=this.props;this.anchorID=Ue("semi-anchor").replace(".",""),this.scrollContainer=this.adapter.getContainer(),this.handler=g()(this.handleScroll,100),this.clickHandler=v()(this.handleClickLink,100),this.scrollContainer.addEventListener("scroll",this.handler),this.scrollContainer.addEventListener("scroll",this.clickHandler),this.setScrollHeight(),this.setChildMap(),Boolean(e)&&this.foundation.handleClick(null,e,!1),this.linkWrapperRef.current&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.linkWrapperRef.current))}componentDidUpdate(e,t){this.updateScrollHeight(t,this.state),this.updateChildMap(t,this.state)}componentWillUnmount(){this.scrollContainer.removeEventListener("scroll",this.handler),this.scrollContainer.removeEventListener("scroll",this.clickHandler),this.resizeObserver&&this.resizeObserver.disconnect()}render(){const{size:e,railTheme:t,style:n,className:r,children:i,maxWidth:s,maxHeight:o,showTooltip:a,position:l,autoCollapse:c}=this.props,d=this.props["aria-label"],{activeLink:u,scrollHeight:p,slideBarTop:f}=this.state,m=w()(Gn,r,{[`${Gn}-size-${e}`]:e}),g=w()(`${Gn}-slide`,`${Gn}-slide-${t}`),y=w()(`${Gn}-slide-bar`,{[`${Gn}-slide-bar-${e}`]:e,[`${Gn}-slide-bar-${t}`]:t,[`${Gn}-slide-bar-active`]:u}),v=`${Gn}-link-wrapper`,b=Object.assign(Object.assign({},n),{maxWidth:s,maxHeight:o});return h().createElement(U.Provider,{value:{activeLink:u,showTooltip:a,position:l,childMap:this.childMap,autoCollapse:c,size:e,onClick:(e,t)=>this.handleClick(e,t),addLink:this.addLink,removeLink:this.removeLink}},h().createElement("div",Object.assign({role:"navigation","aria-label":d||"Side navigation",className:m,style:b,id:this.anchorID},this.getDataAttr(this.props)),h().createElement("div",{"aria-hidden":!0,className:g,style:{height:p}},h().createElement("span",{className:y,style:{top:f}})),h().createElement("div",{className:v,role:"list",ref:this.linkWrapperRef},this.renderChildren())))}}qn.contextType=lt,qn.Link=Wn,qn.PropTypes={size:E().oneOf(_),railTheme:E().oneOf(k),className:E().string,style:E().object,scrollMotion:E().bool,autoCollapse:E().bool,offsetTop:E().number,targetOffset:E().number,showTooltip:E().bool,position:E().oneOf(P),maxWidth:E().oneOfType([E().string,E().number]),maxHeight:E().oneOfType([E().string,E().number]),getContainer:E().func,onChange:E().func,onClick:E().func,defaultAnchor:E().string,"aria-label":E().string},qn.defaultProps={size:"default",railTheme:"primary",className:"",scrollMotion:!1,autoCollapse:!1,offsetTop:0,targetOffset:0,showTooltip:!1,maxWidth:O,maxHeight:T,getContainer:i(),onChange:i(),onClick:i(),defaultAnchor:""};const Xn=qn,Yn=["default","error","warning","success"],Zn={PREFIX:`${C}-autocomplete`,PREFIX_OPTION:`${C}-autocomplete-option`,PREFIX_GROUP:`${C}-autocomplete-group`},Jn={SIZE:["small","large","default"],POSITION:ze.POSITION_SET,OPTIONS:["children","value"],STATUS:Yn};var Qn=__webpack_require__("mGvo"),er=__webpack_require__.n(Qn);const tr=class extends c{constructor(e){super(Object.assign({},e)),this.isPanelOpen=!1}init(){this._setDropdownWidth();const{defaultOpen:e,data:t,defaultValue:n,value:r}=this.getProps();if(t&&t.length){const e=this._generateList(t);this._adapter.updateOptionList(e)}let i;e&&this.openDropdown(),void 0!==n&&(i=n),void 0!==r&&(i=r),void 0!==i&&this.handleValueChange(i)}destroy(){this._adapter.unregisterClickOutsideHandler()}_setDropdownWidth(){const{style:e,dropdownMatchSelectWidth:t}=this.getProps();let n;t&&(n=e&&er()(e.width)||e&&xe()(e.width)&&!e.width.includes("%")?e.width:this._adapter.getTriggerWidth(),this._adapter.setOptionWrapperWidth(n))}handleInputClick(e){const{options:t}=this.getStates(),{disabled:n}=this.getProps();n||(this.isPanelOpen?this.closeDropdown():this.openDropdown())}openDropdown(){this.isPanelOpen=!0,this._adapter.toggleListVisible(!0),this._setDropdownWidth(),this._adapter.registerClickOutsideHandler((e=>this.closeDropdown(e))),this._adapter.notifyDropdownVisibleChange(!0),this._modifyFocusIndexOnPanelOpen()}closeDropdown(e){this.isPanelOpen=!1,this._adapter.toggleListVisible(!1),this._adapter.unregisterClickOutsideHandler(),this._adapter.notifyDropdownVisibleChange(!1)}_generateList(e){const{renderItem:t}=this.getProps(),n=[];return e&&e.length&&e.forEach(((e,r)=>{const i=String((new Date).getTime())+r;let s={};xe()(e)||er()(e)?s={value:e,key:i,label:e,show:!0}:z()(e)&&!_e()(e.value)&&(s=Object.assign({show:!0},e)),t&&"function"==typeof t&&(s._renderedLabel=t(e)),n.push(s)})),n}handleSearch(e){this._adapter.updateInputValue(e),this._adapter.notifySearch(e),this._adapter.notifyChange(e),this._modifyFocusIndex(e),this.isPanelOpen||this.openDropdown()}handleSelect(e,t){const{renderSelectedItem:n}=this.getProps();let r="";n&&"function"==typeof n?(r=n(e),Q("string"!=typeof r,"Warning: [Semi AutoComplete] renderSelectedItem must return string, please check your function return")):r=e.value,this._isControlledComponent()?(this.closeDropdown(),this.notifySelect(e)):(this._adapter.updateInputValue(r),this.updateSelection(e),this.notifySelect(e),this.closeDropdown()),this._adapter.notifyChange(r),this._adapter.updateFocusIndex(t)}updateSelection(e){const t=new Map;e&&t.set(e.label,e),this._adapter.updateSelection(t)}notifySelect(e){this._backwardLabelInValue()?this._adapter.notifySelect(e):this._adapter.notifySelect(e.value)}_backwardLabelInValue(){const e=this.getProps();let{onSelectWithObject:t}=e;return t}handleDataChange(e){const t=this._generateList(e);this._adapter.updateOptionList(t),this._adapter.rePositionDropdown();let{inputValue:n}=this.getStates();this._modifyFocusIndex(n)}handleValueChange(e){let{data:t,defaultActiveFirstOption:n}=this.getProps(),r="";r=this._backwardLabelInValue()&&"[object Object]"===Object.prototype.toString.call(e)?e.value:e;let i=this._getRenderSelectedItem();const s=this._generateList(t);let o=s.length?s.filter((e=>i(e)===r)):[];const a=o.length,l=s.findIndex((e=>i(e)===r));let c="";if(a)o=o[0],c=i(o);else{const t=this._backwardLabelInValue()?e:{label:r,value:r};c=i(t)}this._adapter.updateInputValue(c),this.updateSelection(a?o:null),-1===l&&n?this._adapter.updateFocusIndex(0):this._adapter.updateFocusIndex(l)}_modifyFocusIndex(e){let{focusIndex:t}=this.getStates(),{data:n,defaultActiveFirstOption:r}=this.getProps(),i=-1;if(e){let t=this._getRenderSelectedItem();i=this._generateList(n).findIndex((n=>t(n)===e))}-1===i&&r?0!==t&&this._adapter.updateFocusIndex(0):i!==t&&this._adapter.updateFocusIndex(i)}_modifyFocusIndexOnPanelOpen(){let{inputValue:e}=this.getStates();this._modifyFocusIndex(e)}_getRenderSelectedItem(){let{renderSelectedItem:e}=this.getProps();return void 0===e&&(e=e=>null==e?void 0:e.value),e}handleClear(){this._adapter.notifyClear()}bindKeyBoardEvent(){this._keydownHandler=e=>{this._handleKeyDown(e)},this._adapter.registerKeyDown(this._keydownHandler)}_handleKeyDown(e){const t=e.keyCode,{visible:n}=this.getStates();switch(t){case cn.UP:e.preventDefault(),this._handleArrowKeyDown(-1);break;case cn.DOWN:e.preventDefault(),this._handleArrowKeyDown(1);break;case cn.ENTER:e.preventDefault(),this._handleEnterKeyDown();break;case cn.ESC:case cn.TAB:this.closeDropdown()}this._adapter.notifyKeyDown(e)}_getEnableFocusIndex(e){const{focusIndex:t,options:n}=this.getStates(),r=n.filter((e=>e.show)),i=r.length;let s=t+e;if(s<0&&(s=i-1),s>=i&&(s=0),e>0){let e=-1;for(let t=0;t<r.length;t++){if(!r[t].disabled&&(e=t),e>=s)break}s=e}else{let e=r.length;for(let t=i-1;t>=0;t--){if(!r[t].disabled&&(e=t),e<=s)break}s=e}this._adapter.updateFocusIndex(s),this._adapter.updateScrollTop(s)}_handleArrowKeyDown(e){const{visible:t}=this.getStates();t?this._getEnableFocusIndex(e):this.openDropdown()}_handleEnterKeyDown(){const{visible:e,options:t,focusIndex:n}=this.getStates();if(e)if(void 0!==n&&-1!==n&&0!==t.length){const e=t.filter((e=>e.show))[n];e&&this.handleSelect(e,n)}else this.closeDropdown();else this.openDropdown()}handleOptionMouseEnter(e){this._adapter.updateFocusIndex(e)}handleFocus(e){this.bindKeyBoardEvent(),this._adapter.notifyFocus(e)}handleBlur(e){this._persistEvent(e),this._adapter.notifyBlur(e)}},nr={PREFIX:`${C}-spin`};class rr extends c{static get spinDefaultAdapter(){return{getProp:()=>{},setLoading:e=>{}}}constructor(e){super(Object.assign(Object.assign({},rr.spinDefaultAdapter),e))}updateLoadingIfNeedDelay(){const{spinning:e,delay:t}=this._adapter.getProps(),{delay:n}=this._adapter.getStates();if(n){const n=this;this._timer=setTimeout((()=>{n._adapter.setState({loading:e,delay:0})}),t)}}destroy(){this._timer&&(clearTimeout(this._timer),this._timer=null)}}const ir=rr;var sr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const or=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:t,className:n,customIconCls:r}=e,i=sr(e,["id","className","customIconCls"]),s=o()(te,"config.overrideDefaultProps.Spin.indicator");if(s&&h().isValidElement(s))return h().cloneElement(s,{className:w()({[r]:r,[n]:n})});const[a,l]=(0,d.useState)((()=>Re(t)?"linearGradient-semi-spin":`linearGradient-${t}`));return(0,d.useEffect)((()=>{if(!Re(t))return void l(`linearGradient-${t}`);const e=We({prefix:"semi-spin-gradient"});l(`linearGradient-${e}`)}),[t]),h().createElement("svg",Object.assign({},i,{className:n,width:"48",height:"48",viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,"data-icon":"spin"}),h().createElement("defs",null,h().createElement("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:a},h().createElement("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),h().createElement("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),h().createElement("stop",{stopColor:"currentColor",offset:"100%"}))),h().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},h().createElement("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),h().createElement("path",{d:"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",stroke:`url(#${a})`,strokeWidth:"4",strokeLinecap:"round"})))};__webpack_require__("pAwi");var ar=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const lr=nr.PREFIX;class cr extends f{constructor(e){super(e),this.foundation=new ir(this.adapter),this.state={delay:e.delay,loading:!0}}static getDerivedStateFromProps(e){return e.delay?!1===e.spinning?{delay:0,loading:!1}:{delay:e.delay}:{loading:e.spinning}}get adapter(){return Object.assign(Object.assign({},super.adapter),{setLoading:e=>{this.setState({loading:e})}})}componentWillUnmount(){this.foundation.destroy()}renderSpin(){const{indicator:e,tip:t}=this.props,{loading:n}=this.state;return n?h().createElement("div",{className:`${lr}-wrapper`},e?h().createElement("div",{className:`${lr}-animate`,"x-semi-prop":"indicator"},e):h().createElement(or,null),t?h().createElement("div",{"x-semi-prop":"tip"},t):null):null}render(){this.foundation.updateLoadingIfNeedDelay();const e=this.props,{children:t,style:n,wrapperClassName:r,childStyle:i,size:s}=e,o=ar(e,["children","style","wrapperClassName","childStyle","size"]),{loading:a}=this.state,l=w()(lr,r,{[`${lr}-${s}`]:s,[`${lr}-block`]:t,[`${lr}-hidden`]:!a});return h().createElement("div",Object.assign({className:l,style:n},this.getDataAttr(o)),this.renderSpin(),h().createElement("div",{className:`${lr}-children`,style:i,"x-semi-prop":"children"},t))}}cr.propTypes={size:E().oneOf(["small","middle","large"]),spinning:E().bool,children:E().node,indicator:E().node,delay:E().number,tip:E().node,wrapperClassName:E().string,childStyle:E().object,style:E().object},cr.__SemiComponentName__="Spin",cr.defaultProps=he(cr.__SemiComponentName__,{size:"middle",spinning:!0,children:null,indicator:null,delay:0});const dr=cr,hr={PREFIX:`${C}-input`},ur={SIZE:["small","large","default"],DEFAULT_SIZE:"default",STATUS:["default","error","warning","success"],CLEARBTN_CLICKED_EVENT_FLAG:"__fromClearBtn",MODE:["password"]};function pr(e){const{value:t,maxLength:n,getValueLength:r}=e;if(ye()(r)){let e=0,i=t.length;for(;e<i;){const s=e+Math.floor((i-e)/2);r(t.slice(0,s+1))>n?i=s:e=s+1}return t.slice(0,e)}return t.slice(0,n)}class fr extends c{static get inputDefaultAdapter(){return{notifyChange:i(),setValue:i()}}constructor(e){super(Object.assign(Object.assign({},fr.inputDefaultAdapter),e)),this.compositionEnter=!1,this.getNextValue=e=>{const{maxLength:t,minLength:n,getValueLength:r}=this._adapter.getProps();return ye()(r)?t?this.handleVisibleMaxLength(e):(n&&this.handleVisibleMinLength(e),e):e},this.changeInput=(e,t)=>{this._isControlledComponent()||this._adapter.setValue(e),this._adapter.notifyChange(e,t)},this.handleCompositionStart=e=>{this.compositionEnter=!0,this._adapter.notifyCompositionStart(e)},this.handleCompositionEnd=e=>{const{composition:t}=this._adapter.getProps(),n=e.target.value;if(this.compositionEnter=!1,this._adapter.notifyCompositionEnd(e),t){const t=this.getNextValue(n);return void this.changeInput(t,e)}const{getValueLength:r,maxLength:i,minLength:s}=this.getProps();if(ye()(r)){if(i){const t=this.handleVisibleMaxLength(n);t!==n&&this.changeInput(t,e)}s&&this.handleVisibleMinLength(n)}},this.handleCompositionUpdate=e=>{this._adapter.notifyCompositionUpdate(e)}}destroy(){this._timer&&(clearTimeout(this._timer),this._timer=null)}setDisable(){}setValue(e){this._adapter.setValue(e)}handleChange(e,t){const{composition:n}=this._adapter.getProps();let r=e;n&&this.compositionEnter?this._adapter.setValue(r):(this.compositionEnter||(r=this.getNextValue(r)),this.changeInput(r,t))}handleVisibleMinLength(e){const{minLength:t,getValueLength:n}=this._adapter.getProps(),{minLength:r}=this._adapter.getStates();if(er()(t)&&t>=0&&ye()(n)&&xe()(e)){const i=n(e);if(i<t){const n=e.length+(t-i);n!==r&&this._adapter.setMinLength(n)}else r!==t&&this._adapter.setMinLength(t)}}handleVisibleMaxLength(e){const{maxLength:t,getValueLength:n}=this._adapter.getProps();if(er()(t)&&t>=0&&ye()(n)&&xe()(e)){if(n(e)>t){console.warn("[Semi Input] The input character is truncated because the input length exceeds the maximum length limit");return this.handleTruncateValue(e,t)}return e}return e}handleTruncateValue(e,t){const{getValueLength:n}=this._adapter.getProps();return pr({value:e,maxLength:t,getValueLength:n})}handleClear(e){let t=e;this._isControlledComponent("value")?this._adapter.setState({isFocus:!1}):this._adapter.setState({value:"",isFocus:!1}),t&&"object"==typeof t||(t={}),Y()(t,ur.CLEARBTN_CLICKED_EVENT_FLAG,!0),this._adapter.notifyChange("",t),this._adapter.notifyClear(t),t&&this.stopPropagation(t)}handleClick(e){const{disabled:t}=this._adapter.getProps(),{isFocus:n}=this._adapter.getStates();t||n||this._adapter.isEventTarget(e)&&(this._adapter.focusInput(),this._adapter.toggleFocusing(!0))}handleModeChange(e){"password"===e?this._adapter.setEyeClosed(!0):this._adapter.setEyeClosed(!1)}handleClickEye(e){const t=this._adapter.getState("eyeClosed");this._adapter.focusInput(),this._adapter.toggleFocusing(!0),this._adapter.setEyeClosed(!t)}handleInputType(e){const t=this._adapter.getProp("mode"),n=this._adapter.getState("eyeClosed");return"password"===t?n?"password":"text":e}handleMouseDown(e){e.preventDefault()}handleMouseUp(e){e.preventDefault()}handleBlur(e){const{value:t}=this.getStates();this._adapter.toggleFocusing(!1),this._adapter.notifyBlur(t,e)}handleFocus(e){const{value:t}=this.getStates();this._adapter.toggleFocusing(!0),this._adapter.notifyFocus(t,e)}handleInput(e){this._adapter.notifyInput(e)}handleKeyDown(e){this._adapter.notifyKeyDown(e)}handleKeyUp(e){this._adapter.notifyKeyUp(e)}handleKeyPress(e){this._adapter.notifyKeyPress(e),e.key===an&&this._adapter.notifyEnterPress(e)}isAllowClear(){const{value:e,isFocus:t,isHovering:n}=this._adapter.getStates(),{showClear:r,disabled:i,showClearIgnoreDisabled:s}=this._adapter.getProps();return e&&r&&(!i||s)&&(t||n)}handleClickPrefixOrSuffix(e){const{disabled:t}=this._adapter.getProps(),{isFocus:n}=this._adapter.getStates();t||n||(this._adapter.focusInput(),this._adapter.toggleFocusing(!0))}handlePreventMouseDown(e){e&&ye()(e.preventDefault)&&e.preventDefault()}handleModeEnterPress(e){["Enter"," "].includes(null==e?void 0:e.key)&&(this.handlePreventMouseDown(e),this.handleClickEye(e))}}const mr=fr;__webpack_require__("Cml1");const gr=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm5.04-6.14a1.5 1.5 0 0 1-2.13.04l-2.87-2.78L9.26 17A1.5 1.5 0 0 1 7.1 14.9l2.78-2.87L7 9.26A1.5 1.5 0 1 1 9.1 7.1l2.87 2.78L14.74 7A1.5 1.5 0 0 1 16.9 9.1l-2.78 2.87L17 14.74c.6.58.61 1.53.04 2.12Z",fill:"currentColor"}))}),"clear");const yr=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.7 3.7a1 1 0 0 0-1.4-1.4L17.3 5.26A11.59 11.59 0 0 0 12 4C5 4 1 10 1 12c0 1.18 1.38 3.73 3.94 5.64L2.3 20.3a1 1 0 1 0 1.42 1.42l18-18ZM7.84 14.77l1.46-1.47a3 3 0 0 1 4-4l1.47-1.46a5 5 0 0 0-6.93 6.93Z",fill:"currentColor"}),d.createElement("path",{d:"M12 20c-1.22 0-2.35-.18-3.38-.5l2.57-2.57a5 5 0 0 0 5.75-5.75l3.56-3.56C22.13 9.27 23 11.07 23 12c0 2-4 8-11 8Z",fill:"currentColor"}))}),"eye_closed_solid");const vr=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4C5 4 1 10 1 12s4 8 11 8 11-6 11-8-4-8-11-8Zm5 8a5 5 0 1 1-10 0 5 5 0 0 1 10 0Zm-5 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",fill:"currentColor"}))}),"eye_opened");var br=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const wr=hr.PREFIX,xr=ur.SIZE,Er=ur.STATUS,Cr=ur.MODE;class Sr extends f{constructor(e){super(e),this.handleClear=e=>{this.foundation.handleClear(e)},this.handleClick=e=>{this.foundation.handleClick(e)},this.handleMouseOver=e=>{this.setState({isHovering:!0})},this.handleMouseLeave=e=>{this.setState({isHovering:!1})},this.handleModeChange=e=>{this.foundation.handleModeChange(e)},this.handleClickEye=e=>{this.foundation.handleClickEye(e)},this.handleMouseDown=e=>{this.foundation.handleMouseDown(e)},this.handleMouseUp=e=>{this.foundation.handleMouseUp(e)},this.handleModeEnterPress=e=>{this.foundation.handleModeEnterPress(e)},this.handleClickPrefixOrSuffix=e=>{this.foundation.handleClickPrefixOrSuffix(e)},this.handlePreventMouseDown=e=>{this.foundation.handlePreventMouseDown(e)};const t="value"in e?e.value:e.defaultValue;this.state={value:t,cachedValue:e.value,disabled:!1,props:{},isFocus:!1,isHovering:!1,eyeClosed:"password"===e.mode,minLength:e.minLength},this.inputRef=h().createRef(),this.prefixRef=h().createRef(),this.suffixRef=h().createRef(),this.foundation=new mr(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setValue:e=>this.setState({value:e}),setEyeClosed:e=>this.setState({eyeClosed:e}),toggleFocusing:e=>{this.setState({isFocus:e})},focusInput:()=>{const{preventScroll:e}=this.props,t=this.inputRef&&this.inputRef.current;t&&t.focus({preventScroll:e})},toggleHovering:e=>this.setState({isHovering:e}),getIfFocusing:()=>this.state.isFocus,notifyChange:(e,t)=>this.props.onChange(e,t),notifyBlur:(e,t)=>this.props.onBlur(t),notifyFocus:(e,t)=>this.props.onFocus(t),notifyInput:e=>this.props.onInput(e),notifyKeyPress:e=>this.props.onKeyPress(e),notifyKeyDown:e=>this.props.onKeyDown(e),notifyKeyUp:e=>this.props.onKeyUp(e),notifyEnterPress:e=>this.props.onEnterPress(e),notifyClear:e=>this.props.onClear(e),notifyCompositionStart:e=>this.props.onCompositionStart(e),notifyCompositionEnd:e=>this.props.onCompositionEnd(e),notifyCompositionUpdate:e=>this.props.onCompositionUpdate(e),setMinLength:e=>this.setState({minLength:e}),isEventTarget:e=>e&&e.target===e.currentTarget})}static getDerivedStateFromProps(e,t){const n={};return e.value!==t.cachedValue&&(n.value=e.value,n.cachedValue=e.value),n}componentDidUpdate(e){const{mode:t}=this.props;e.mode!==t&&this.handleModeChange(t)}componentDidMount(){const{disabled:e,autoFocus:t,preventScroll:n}=this.props;e||!t&&!this.props.autofocus||this.inputRef.current.focus({preventScroll:n})}renderPrepend(){const{addonBefore:e}=this.props;if(e){const t=w()({[`${wr}-prepend`]:!0,[`${wr}-prepend-text`]:e&&xe()(e),[`${wr}-prepend-icon`]:oe(e)});return h().createElement("div",{className:t,"x-semi-prop":"addonBefore"},e)}return null}renderAppend(){const{addonAfter:e}=this.props;if(e){const t=w()({[`${wr}-append`]:!0,[`${wr}-append-text`]:e&&xe()(e),[`${wr}-append-icon`]:oe(e)});return h().createElement("div",{className:t,"x-semi-prop":"addonAfter"},e)}return null}renderClearBtn(){const e=w()(`${wr}-clearbtn`),{clearIcon:t}=this.props;return this.foundation.isAllowClear()?h().createElement("div",{className:e,onMouseDown:this.handleClear},t||h().createElement(gr,null)):null}renderModeBtn(){const{eyeClosed:e}=this.state,{mode:t,disabled:n}=this.props,r=w()(`${wr}-modebtn`),i=e?h().createElement(yr,null):h().createElement(vr,null),s=e?"Show password":"Hidden password";return"password"===t&&!n?h().createElement("div",{role:"button",tabIndex:0,"aria-label":s,className:r,onClick:this.handleClickEye,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onKeyPress:this.handleModeEnterPress},i):null}renderPrefix(){const{prefix:e,insetLabel:t,insetLabelId:n}=this.props,r=e||t;if(!r)return null;const i=w()({[`${wr}-prefix`]:!0,[`${wr}-inset-label`]:t,[`${wr}-prefix-text`]:r&&xe()(r),[`${wr}-prefix-icon`]:oe(r)});return h().createElement("div",{className:i,onMouseDown:this.handlePreventMouseDown,onClick:this.handleClickPrefixOrSuffix,id:n,"x-semi-prop":"prefix,insetLabel"},r)}renderSuffix(e){const{suffix:t,hideSuffix:n}=this.props;if(!t)return null;const r=w()({[`${wr}-suffix`]:!0,[`${wr}-suffix-text`]:t&&xe()(t),[`${wr}-suffix-icon`]:oe(t),[`${wr}-suffix-hidden`]:e&&Boolean(n)});return h().createElement("div",{className:r,onMouseDown:this.handlePreventMouseDown,onClick:this.handleClickPrefixOrSuffix,"x-semi-prop":"suffix"},t)}getInputRef(){const{forwardRef:e}=this.props;if(!_e()(e)){if("function"==typeof e)return t=>{e(t),this.inputRef={current:t}};if("[object Object]"===Object.prototype.toString.call(e))return this.inputRef=e,e}return this.inputRef}render(){const e=this.props,{addonAfter:t,addonBefore:n,autoFocus:r,clearIcon:i,className:s,disabled:o,defaultValue:a,placeholder:l,prefix:c,mode:d,insetLabel:u,insetLabelId:p,validateStatus:f,type:m,readonly:g,size:y,suffix:v,style:b,showClear:x,onEnterPress:E,onClear:C,hideSuffix:S,inputStyle:_,forwardRef:k,maxLength:O,getValueLength:T,preventScroll:P,borderless:I,showClearIgnoreDisabled:M,onlyBorder:R,composition:A}=e,N=br(e,["addonAfter","addonBefore","autoFocus","clearIcon","className","disabled","defaultValue","placeholder","prefix","mode","insetLabel","insetLabelId","validateStatus","type","readonly","size","suffix","style","showClear","onEnterPress","onClear","hideSuffix","inputStyle","forwardRef","maxLength","getValueLength","preventScroll","borderless","showClearIgnoreDisabled","onlyBorder","composition"]),{value:D,isFocus:L,minLength:F}=this.state,j=this.foundation.isAllowClear(),$=oe(v),B=this.getInputRef(),V=`${wr}-wrapper`,z=w()(V,s,{[`${wr}-wrapper__with-prefix`]:c||u,[`${wr}-wrapper__with-suffix`]:v,[`${wr}-wrapper__with-suffix-hidden`]:j&&Boolean(S),[`${wr}-wrapper__with-suffix-icon`]:$,[`${wr}-wrapper__with-append`]:n,[`${wr}-wrapper__with-prepend`]:t,[`${wr}-wrapper__with-append-only`]:n&&!t,[`${wr}-wrapper__with-prepend-only`]:!n&&t,[`${V}-readonly`]:g,[`${V}-disabled`]:o,[`${V}-warning`]:"warning"===f,[`${V}-error`]:"error"===f,[`${V}-focus`]:L,[`${V}-clearable`]:x,[`${V}-modebtn`]:"password"===d,[`${V}-hidden`]:"hidden"===m,[`${V}-${y}`]:y,[`${wr}-borderless`]:I,[`${wr}-only_border`]:null!=R}),H=w()(wr,{[`${wr}-${y}`]:y,[`${wr}-disabled`]:o,[`${wr}-sibling-clearbtn`]:this.foundation.isAllowClear(),[`${wr}-sibling-modebtn`]:"password"===d}),U=null==D?"":D,K=Object.assign(Object.assign({},N),{style:_,className:H,disabled:o,readOnly:g,type:this.foundation.handleInputType(m),placeholder:l,onInput:e=>this.foundation.handleInput(e),onChange:e=>this.foundation.handleChange(e.target.value,e),onFocus:e=>this.foundation.handleFocus(e),onBlur:e=>this.foundation.handleBlur(e),onKeyUp:e=>this.foundation.handleKeyUp(e),onKeyDown:e=>this.foundation.handleKeyDown(e),onKeyPress:e=>this.foundation.handleKeyPress(e),onCompositionStart:this.foundation.handleCompositionStart,onCompositionEnd:this.foundation.handleCompositionEnd,onCompositionUpdate:this.foundation.handleCompositionUpdate,value:U});ye()(T)||(K.maxLength=O),F&&(K.minLength=F),"error"===f&&(K["aria-invalid"]="true");let W=Object.assign({},b);return void 0!==R&&(W=Object.assign({borderWidth:R},b)),h().createElement("div",{className:z,style:W,onMouseEnter:e=>this.handleMouseOver(e),onMouseLeave:e=>this.handleMouseLeave(e),onClick:e=>this.handleClick(e)},this.renderPrepend(),this.renderPrefix(),h().createElement("input",Object.assign({},K,{ref:B})),this.renderClearBtn(),this.renderSuffix(j),this.renderModeBtn(),this.renderAppend())}}Sr.__SemiComponentName__="Input",Sr.propTypes={"aria-label":E().string,"aria-labelledby":E().string,"aria-invalid":E().bool,"aria-errormessage":E().string,"aria-describedby":E().string,"aria-required":E().bool,addonBefore:E().node,addonAfter:E().node,clearIcon:E().node,prefix:E().node,suffix:E().node,mode:E().oneOf(Cr),value:E().any,defaultValue:E().any,disabled:E().bool,readonly:E().bool,autoFocus:E().bool,type:E().string,showClear:E().bool,hideSuffix:E().bool,placeholder:E().any,size:E().oneOf(xr),className:E().string,style:E().object,validateStatus:E().oneOf(Er),onClear:E().func,onChange:E().func,onBlur:E().func,onFocus:E().func,onInput:E().func,onKeyDown:E().func,onKeyUp:E().func,onKeyPress:E().func,onEnterPress:E().func,onCompositionStart:E().func,onCompositionEnd:E().func,onCompositionUpdate:E().func,insetLabel:E().node,insetLabelId:E().string,inputStyle:E().object,getValueLength:E().func,preventScroll:E().bool,borderless:E().bool,composition:E().bool},Sr.defaultProps=he(Sr.__SemiComponentName__,{addonBefore:"",addonAfter:"",prefix:"",suffix:"",readonly:!1,type:"text",showClear:!1,hideSuffix:!1,placeholder:"",size:"default",className:"",onClear:i(),onChange:i(),onBlur:i(),onFocus:i(),onInput:i(),onKeyDown:i(),onKeyUp:i(),onKeyPress:i(),onEnterPress:i(),onCompositionStart:i(),onCompositionEnd:i(),onCompositionUpdate:i(),validateStatus:"default",borderless:!1,composition:!1});const _r=h().forwardRef(((e,t)=>h().createElement(Sr,Object.assign({},e,{forwardRef:t})))),kr=_r;var Or=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class Tr extends h().PureComponent{render(){const e=this.props,{triggerRender:t,componentName:n}=e,r=Or(e,["triggerRender","componentName"]);return t(Object.assign({},r))}}Tr.propTypes={triggerRender:E().func.isRequired,componentName:E().string,componentProps:E().object,value:E().any,inputValue:E().string,placeholder:E().oneOfType([E().string,E().array]),className:E().string,style:E().object};const Pr=Tr,Ir={PREFIX:`${C}-highlight`};class Mr extends c{constructor(e){super(Object.assign({},e)),this.findAll=e=>{let{autoEscape:t=!0,caseSensitive:n=!1,searchWords:r,sourceString:i}=e;xe()(r)&&(r=[r]);const s=this.findChunks({autoEscape:t,caseSensitive:n,searchWords:r,sourceString:i}),o=this.combineChunks({chunks:s});return this.fillInChunks({chunksToHighlight:o,totalLength:i?i.length:0})},this.findChunks=e=>{let{autoEscape:t,caseSensitive:n,searchWords:r,sourceString:i}=e;return r.map((e=>"string"==typeof e?{text:e}:e)).filter((e=>e.text)).reduce(((e,r)=>{let s=r.text;t&&(s=(e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"))(s));const o=new RegExp(s,n?"g":"gi");let a;for(;a=o.exec(i);){const t=a.index,n=o.lastIndex;n>t&&e.push({highlight:!0,start:t,end:n,className:r.className,style:r.style}),a.index===o.lastIndex&&o.lastIndex++}return e}),[])},this.combineChunks=e=>{let{chunks:t}=e;return t.sort(((e,t)=>e.start-t.start)).reduce(((e,t)=>{if(0===e.length)return[t];{const n=e.pop();if(t.start<=n.end){const r=Math.max(n.end,t.end);e.push({highlight:!0,start:n.start,end:r,className:n.className||t.className,style:Object.assign(Object.assign({},n.style),t.style)})}else e.push(n,t);return e}}),[])},this.fillInChunks=e=>{let{chunksToHighlight:t,totalLength:n}=e;const r=[],i=(e,t,n,i,s)=>{t-e>0&&r.push({start:e,end:t,highlight:n,className:i,style:s})};if(0===t.length)i(0,n,!1);else{let e=0;t.forEach((t=>{i(e,t.start,!1),i(t.start,t.end,!0,t.className,t.style),e=t.end})),i(e,n,!1)}return r}}}__webpack_require__("C0y9");const Rr=Ir.PREFIX;class Ar extends d.PureComponent{constructor(){super(...arguments),this.getHighLightTextHTML=e=>{let{sourceString:t="",searchWords:n=[],option:r={autoEscape:!0,caseSensitive:!1}}=e;const i=(new Mr).findAll(Object.assign({sourceString:t,searchWords:n},r)),s=r.highlightTag||"mark",o=r.highlightClassName||"",a=r.highlightStyle||{};return i.map(((e,n)=>{const{end:r,start:i,highlight:l,style:c,className:d}=e,u=t.substr(i,r-i);return l?h().createElement(s,{style:Object.assign(Object.assign({},a),c),className:`${o} ${d||""}`.trim(),key:u+n},u):u}))}}render(){const{searchWords:e,sourceString:t,component:n,highlightClassName:r,highlightStyle:i,caseSensitive:s,autoEscape:o}=this.props,a={highlightTag:n,highlightClassName:w()({[`${Rr}-tag`]:!0},r),highlightStyle:i,caseSensitive:s,autoEscape:o};return this.getHighLightTextHTML({sourceString:t,searchWords:e,option:a})}}Ar.propTypes={style:E().object,className:E().string,autoEscape:E().bool,caseSensitive:E().bool,sourceString:E().string,searchWords:E().arrayOf(E().string),highlightStyle:E().object,highlightClassName:E().string,component:E().string},Ar.defaultProps={component:"mark",autoEscape:!0,caseSensitive:!1,sourceString:""};const Nr=Ar;var Dr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class Lr extends d.PureComponent{onClick(e,t){var{value:n,label:r,children:i}=e,s=Dr(e,["value","label","children"]);const{props:o}=this;o.disabled||o.onSelect(Object.assign(Object.assign({},s),{value:n,label:r||i}),t)}renderOptionContent(e){let{children:t,inputValue:n,prefixCls:r}=e;return xe()(t)&&n?h().createElement(Nr,{searchWords:[n],sourceString:t,highlightClassName:`${r}-keyword`}):t}render(){const e=this.props,{children:t,disabled:n,value:r,selected:i,label:s,empty:o,emptyContent:a,onSelect:l,focused:c,showTick:d,className:u,style:p,onMouseEnter:f,prefixCls:m,renderOptionItem:g,inputValue:y}=e,v=Dr(e,["children","disabled","value","selected","label","empty","emptyContent","onSelect","focused","showTick","className","style","onMouseEnter","prefixCls","renderOptionItem","inputValue"]),b=w()(m,{[`${m}-disabled`]:n,[`${m}-selected`]:i,[`${m}-focused`]:c,[`${m}-empty`]:o,[u]:u}),x=w()([`${m}-icon`]);return o?null===a?null:h().createElement(Jt,{componentName:"Select"},(e=>h().createElement("div",{className:b,"x-semi-prop":"emptyContent"},a||e.emptyText))):"function"==typeof g?g(Object.assign({disabled:n,focused:c,selected:i,style:p,label:s,value:r,inputValue:y,onMouseEnter:e=>f(e),onClick:e=>this.onClick(Object.assign({value:r,label:s,children:t},v),e)},v)):h().createElement("div",{className:b,onClick:e=>{this.onClick(Object.assign({value:r,label:s,children:t},v),e)},onMouseEnter:e=>f&&f(e),role:"option","aria-selected":i?"true":"false","aria-disabled":n?"true":"false",style:p},d?h().createElement("div",{className:x},h().createElement(sn,null)):null,xe()(t)?h().createElement("div",{className:`${m}-text`},this.renderOptionContent({children:t,inputValue:y,prefixCls:m})):t)}}Lr.isSelectOption=!0,Lr.propTypes={children:E().node,disabled:E().bool,value:E().oneOfType([E().string,E().number]),selected:E().bool,label:E().node,empty:E().bool,emptyContent:E().node,onSelect:E().func,focused:E().bool,showTick:E().bool,className:E().string,style:E().object,onMouseEnter:E().func,prefixCls:E().string,renderOptionItem:E().func,inputValue:E().string},Lr.defaultProps={prefixCls:Zn.PREFIX_OPTION};const Fr=Lr;__webpack_require__("tISx");const jr=Zn.PREFIX,$r=Jn.SIZE,Br=Jn.POSITION,Vr=Jn.STATUS;class zr extends f{constructor(e){super(e),this.onSelect=(e,t,n)=>{this.foundation.handleSelect(e,t)},this.onSearch=e=>{this.foundation.handleSearch(e)},this.onBlur=e=>this.foundation.handleBlur(e),this.onFocus=e=>this.foundation.handleFocus(e),this.onInputClear=()=>this.foundation.handleClear(),this.handleInputClick=e=>this.foundation.handleInputClick(e),this.foundation=new tr(this.adapter);this.state={dropdownMinWidth:null,inputValue:"",options:[],visible:!1,focusIndex:e.defaultActiveFirstOption?0:-1,selection:new Map,rePosKey:1},this.triggerRef=h().createRef(),this.optionsRef=h().createRef(),this.optionContainerEl=h().createRef(),this.clickOutsideHandler=null,this.optionListId="",Q("triggerRender"in this.props&&"function"==typeof this.props.triggerRender,"[Semi AutoComplete]\n - If you are using the following props: 'suffix', 'prefix', 'showClear', 'validateStatus', and 'size',\n please notice that they will be removed in the next major version.\n Please use 'componentProps' to retrieve these props instead.\n - If you are using 'onBlur', 'onFocus', please try to avoid using them and look for changes in the future.")}get adapter(){const e={registerKeyDown:e=>{const t={onKeyDown:e};this.setState({keyboardEventSet:t})},unregisterKeyDown:e=>{this.setState({keyboardEventSet:{}})},updateFocusIndex:e=>{this.setState({focusIndex:e})},updateScrollTop:e=>{let t;t=`.${jr}-option-selected`,void 0!==e&&(t=`.${jr}-option:nth-child(${e+1})`);let n=document.querySelector(`#${jr}-${this.optionListId} ${t}`);if(Array.isArray(n)&&(n=n[0]),n){const e=n.parentNode;e.scrollTop=n.offsetTop-e.offsetTop-e.clientHeight/2+n.clientHeight/2}}};return Object.assign(Object.assign(Object.assign({},super.adapter),e),{getTriggerWidth:()=>{const e=this.triggerRef.current;return e&&e.getBoundingClientRect().width},setOptionWrapperWidth:e=>{this.setState({dropdownMinWidth:e})},updateInputValue:e=>{this.setState({inputValue:e})},toggleListVisible:e=>{this.setState({visible:e})},updateOptionList:e=>{this.setState({options:e})},updateSelection:e=>{this.setState({selection:e})},notifySearch:e=>{this.props.onSearch(e)},notifyChange:e=>{this.props.onChange(e)},notifySelect:e=>{this.props.onSelect(e)},notifyDropdownVisibleChange:e=>{this.props.onDropdownVisibleChange(e)},notifyClear:()=>{this.props.onClear()},notifyFocus:e=>{this.props.onFocus(e)},notifyBlur:e=>{this.props.onBlur(e)},notifyKeyDown:e=>{this.props.onKeyDown(e)},rePositionDropdown:()=>{let{rePosKey:e}=this.state;e+=1,this.setState({rePosKey:e})},registerClickOutsideHandler:e=>{const t=t=>{const n=this.triggerRef&&this.triggerRef.current,r=this.optionContainerEl&&this.optionContainerEl.current,i=t.target,s=t.composedPath&&t.composedPath()||[i];!r||r.contains(i)&&r.contains(i.parentNode)||!n||n.contains(i)||s.includes(n)||s.includes(r)||e(t)};this.clickOutsideHandler=t,document.addEventListener("mousedown",t,!1)},unregisterClickOutsideHandler:()=>{this.clickOutsideHandler&&document.removeEventListener("mousedown",this.clickOutsideHandler,!1)}})}componentDidMount(){this.foundation.init(),this.optionListId=We()}componentWillUnmount(){this.foundation.destroy()}componentDidUpdate(e,t){Oe()(this.props.data,e.data)||this.foundation.handleDataChange(this.props.data),this.props.value!==e.value&&this.foundation.handleValueChange(this.props.value)}renderInput(){const{size:e,prefix:t,insetLabel:n,insetLabelId:r,suffix:i,placeholder:s,style:o,className:a,showClear:l,disabled:c,triggerRender:d,validateStatus:u,autoFocus:p,value:f,id:m,clearIcon:g}=this.props,{inputValue:y,keyboardEventSet:v,selection:b}=this.state,x="function"==typeof d,E=Object.assign(Object.assign(Object.assign({style:o,className:x?w()(a):w()({[jr]:!0,[`${jr}-disabled`]:c},a),onClick:this.handleInputClick,ref:this.triggerRef,id:m},v),{tabIndex:-1}),this.getDataAttr(this.props)),C={disabled:c,placeholder:s,autoFocus:p,onChange:this.onSearch,onClear:this.onInputClear,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-describedby":this.props["aria-describedby"],"aria-required":this.props["aria-required"],suffix:i,prefix:t||n,insetLabelId:r,showClear:l,validateStatus:u,size:e,onBlur:this.onBlur,onFocus:this.onFocus,clearIcon:g};return h().createElement("div",Object.assign({},E),"function"==typeof d?h().createElement(Pr,Object.assign({},C,{inputValue:void 0!==f?f:y,value:Array.from(b.values()),triggerRender:d,componentName:"AutoComplete",componentProps:Object.assign({},this.props)})):h().createElement(kr,Object.assign({},C,{value:void 0!==f?f:y})))}renderLoading(){const e=`${jr}-loading-wrapper`;return h().createElement("div",{className:e},h().createElement(dr,null))}renderOption(e,t){var n;const{focusIndex:r}=this.state,i=t===r;return h().createElement(Fr,Object.assign({showTick:!1,onSelect:(e,n)=>this.onSelect(e,t,n),focused:i,onMouseEnter:()=>this.foundation.handleOptionMouseEnter(t),key:e.key||e.label+e.value+t},e),null!==(n=e._renderedLabel)&&void 0!==n?n:e.label)}renderOptionList(){const{maxHeight:e,dropdownStyle:t,dropdownClassName:n,loading:r,emptyContent:i}=this.props,{options:s,dropdownMinWidth:o}=this.state,a=w()({[`${jr}-option-list`]:!0},n);let l;l=0===s.length?i:s.filter((e=>e.show)).map(((e,t)=>this.renderOption(e,t)));const c=Object.assign({maxHeight:e,minWidth:o},t);return h().createElement("div",{ref:this.optionContainerEl,className:a,role:"listbox",style:c,id:`${jr}-${this.optionListId}`},r?this.renderLoading():l)}render(){const{position:e,motion:t,zIndex:n,mouseEnterDelay:r,mouseLeaveDelay:i,autoAdjustOverflow:s,stopPropagation:o,getPopupContainer:a}=this.props,{visible:l,rePosKey:c}=this.state,d=this.renderInput(),u=this.renderOptionList();return h().createElement(Cn,{mouseEnterDelay:r,mouseLeaveDelay:i,autoAdjustOverflow:s,trigger:"custom",motion:t,visible:l,content:u,position:e,ref:this.optionsRef,zIndex:n,stopPropagation:o,getPopupContainer:a,rePosKey:c},d)}}zr.propTypes={"aria-label":E().string,"aria-labelledby":E().string,"aria-invalid":E().bool,"aria-errormessage":E().string,"aria-describedby":E().string,"aria-required":E().bool,autoFocus:E().bool,autoAdjustOverflow:E().bool,className:E().string,clearIcon:E().node,children:E().node,data:E().array,defaultOpen:E().bool,defaultValue:E().oneOfType([E().string,E().number]),defaultActiveFirstOption:E().bool,disabled:E().bool,dropdownMatchSelectWidth:E().bool,dropdownClassName:E().string,dropdownStyle:E().object,emptyContent:E().node,id:E().string,insetLabel:E().node,insetLabelId:E().string,onSearch:E().func,onSelect:E().func,onClear:E().func,onBlur:E().func,onFocus:E().func,onChange:E().func,onKeyDown:E().func,position:E().oneOf(Br),placeholder:E().string,prefix:E().node,onChangeWithObject:E().bool,onSelectWithObject:E().bool,renderItem:E().func,renderSelectedItem:E().func,suffix:E().node,showClear:E().bool,size:E().oneOf($r),style:E().object,stopPropagation:E().oneOfType([E().bool,E().string]),maxHeight:E().oneOfType([E().string,E().number]),mouseEnterDelay:E().number,mouseLeaveDelay:E().number,motion:E().oneOfType([E().bool,E().func,E().object]),getPopupContainer:E().func,triggerRender:E().func,value:E().oneOfType([E().string,E().number]),validateStatus:E().oneOf(Vr),zIndex:E().number},zr.Option=Fr,zr.__SemiComponentName__="AutoComplete",zr.defaultProps=he(zr.__SemiComponentName__,{stopPropagation:!0,motion:!0,zIndex:gn.DEFAULT_Z_INDEX,position:"bottomLeft",data:[],showClear:!1,size:"default",onFocus:i(),onSearch:i(),onClear:i(),onBlur:i(),onSelect:i(),onChange:i(),onSelectWithObject:!1,onDropdownVisibleChange:i(),defaultActiveFirstOption:!1,dropdownMatchSelectWidth:!0,loading:!1,maxHeight:300,validateStatus:"default",autoFocus:!1,emptyContent:null,onKeyDown:i()});const Hr=zr,Ur={PREFIX:`${C}-avatar`},Kr={SHAPE:["circle","square"],SIZE:["extra-extra-small","extra-small","small","default","medium","large","extra-large"],COLOR:["grey","red","pink","purple","violet","indigo","blue","light-blue","cyan","teal","green","light-green","lime","yellow","amber","orange","white"],OVERLAP_FROM:["start","end"]};class Wr extends c{constructor(e){super(Object.assign({},e)),this.handleFocusVisible=e=>{const{target:t}=e;try{t.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch(e){Q(!0,"Warning: [Semi Avatar] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this._adapter.setFocusVisible(!1)},this.changeScale=()=>{const{gap:e}=this.getProps(),t=this._adapter.getAvatarNode(),n=null==t?void 0:t.firstChild,[r,i]=[(null==t?void 0:t.offsetWidth)||0,(null==n?void 0:n.offsetWidth)||0];if(0!==r&&0!==i&&2*e<r){const t=r-2*e>i?1:(r-2*e)/i;this._adapter.setScale(t)}}}init(){const{children:e}=this.getProps();"string"==typeof e&&this.changeScale()}destroy(){}handleImgLoadError(){const{onError:e}=this.getProps();!1!==(e?e():void 0)&&this._adapter.notifyImgState(!1)}handleEnter(e){this._adapter.notifyEnter(e)}handleLeave(e){this._adapter.notifyLeave(e)}}__webpack_require__("XWjs");const Gr=e=>{let{gradientStart:t,gradientEnd:n}=e;const r=We();return h().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"51",height:"52",viewBox:"0 0 51 52",fill:"none"},h().createElement("g",{filter:"url(#filter0_d_6_2)"},h().createElement("path",{d:"M40.4918 46.5592C44.6795 43.176 46.261 34.1333 47.5301 25.6141C49.5854 11.8168 39.6662 1 25.8097 1C11.2857 1 3 11.4279 3 25.3518C3 33.7866 6.29361 43.8947 10.4602 46.5592C12.5868 47.9192 12.5868 47.9051 25.8097 47.9192C38.3651 47.9282 38.5352 48.14 40.4918 46.5592Z",fill:`url(#${r})`})),h().createElement("defs",null,h().createElement("filter",{id:"filter0_d_6_2",x:"0.789215",y:"0.447304",width:"49.2216",height:"51.3549",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},h().createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),h().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),h().createElement("feOffset",{dy:"1.65809"}),h().createElement("feGaussianBlur",{stdDeviation:"1.10539"}),h().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0"}),h().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_6_2"}),h().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_6_2",result:"shape"})),h().createElement("linearGradient",{id:r,x1:"17.671",y1:"31.7392",x2:"17.671",y2:"47.9333",gradientUnits:"userSpaceOnUse"},h().createElement("stop",{stopColor:t}),h().createElement("stop",{offset:"1",stopColor:n}))))};var qr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Xr=Kr.SIZE,Yr=Kr.SHAPE,Zr=Kr.COLOR,Jr=Ur.PREFIX;class Qr extends f{constructor(e){super(e),this.handleFocusVisible=e=>{this.foundation.handleFocusVisible(e)},this.handleBlur=e=>{this.foundation.handleBlur()},this.getContent=()=>{const{children:e,onClick:t,imgAttr:n,src:r,srcSet:i,alt:s}=this.props,{isImgExist:o}=this.state;let a=e;const l=t!==Tt,c=r&&o,d={tabIndex:0,onKeyDown:this.handleKeyDown,onFocus:this.handleFocusVisible,onBlur:this.handleBlur};if(c){const e=l?`clickable Avatar: ${s}`:s,t=Object.assign(Object.assign({src:r,srcSet:i,onError:this.handleError},n),{className:w()({[`${Jr}-no-focus-visible`]:l})}),o=l?Object.assign(Object.assign({},t),d):t;a=h().createElement("img",Object.assign({alt:e},o))}else if("string"==typeof e){const t=null!=s?s:e,n={role:"img","aria-label":l?`clickable Avatar: ${t}`:t,className:w()(`${Jr}-label`,{[`${Jr}-no-focus-visible`]:l})},r=l?Object.assign(Object.assign({},n),d):n,i={transform:`scale(${this.state.scale})`};a=h().createElement("span",{className:`${Jr}-content`,style:i},h().createElement("span",Object.assign({},r,{"x-semi-prop":"children"}),e))}return a},this.renderBottomSlot=()=>{var e,t;if(!this.props.bottomSlot)return null;if(this.props.bottomSlot.render)return this.props.bottomSlot.render();const n=null!==(e=this.props.bottomSlot.render)&&void 0!==e?e:()=>{var e;const t={};return this.props.bottomSlot.bgColor&&(t.backgroundColor=this.props.bottomSlot.bgColor),this.props.bottomSlot.textColor&&(t.color=this.props.bottomSlot.textColor),h().createElement("span",{style:t,className:w()(`${Jr}-bottom_slot-shape_${this.props.bottomSlot.shape}`,`${Jr}-bottom_slot-shape_${this.props.bottomSlot.shape}-${this.props.size}`,null!==(e=this.props.bottomSlot.className)&&void 0!==e?e:"")},this.props.bottomSlot.text)};return h().createElement("div",{className:w()([`${Jr}-bottom_slot`]),style:null!==(t=this.props.bottomSlot.style)&&void 0!==t?t:{}},n())},this.renderTopSlot=()=>{var e,t,n,r;if(!this.props.topSlot)return null;if(this.props.topSlot.render)return this.props.topSlot.render();const i={};return this.props.topSlot.textColor&&(i.color=this.props.topSlot.textColor),h().createElement("div",{style:null!==(e=this.props.topSlot.style)&&void 0!==e?e:{},className:w()([`${Jr}-top_slot-wrapper`,null!==(t=this.props.topSlot.className)&&void 0!==t?t:"",{[`${Jr}-animated`]:this.props.contentMotion}])},h().createElement("div",{className:w()([`${Jr}-top_slot-bg`,`${Jr}-top_slot-bg-${this.props.size}`])},h().createElement("div",{className:w()([`${Jr}-top_slot-bg-svg`,`${Jr}-top_slot-bg-svg-${this.props.size}`])},h().createElement(Gr,{gradientStart:null!==(n=this.props.topSlot.gradientStart)&&void 0!==n?n:"var(--semi-color-primary)",gradientEnd:null!==(r=this.props.topSlot.gradientEnd)&&void 0!==r?r:"var(--semi-color-primary)"}))),h().createElement("div",{className:w()([`${Jr}-top_slot`])},h().createElement("div",{style:i,className:w()([`${Jr}-top_slot-content`,`${Jr}-top_slot-content-${this.props.size}`])},this.props.topSlot.text)))},this.state={isImgExist:!0,hoverContent:"",focusVisible:!1,scale:1},this.onEnter=this.onEnter.bind(this),this.onLeave=this.onLeave.bind(this),this.handleError=this.handleError.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.getContent=this.getContent.bind(this),this.avatarRef=h().createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyImgState:e=>{this.setState({isImgExist:e})},notifyEnter:e=>{const{hoverMask:t}=this.props,n=t;this.setState({hoverContent:n},(()=>{const{onMouseEnter:t}=this.props;t&&t(e)}))},notifyLeave:e=>{this.setState({hoverContent:""},(()=>{const{onMouseLeave:t}=this.props;t&&t(e)}))},setFocusVisible:e=>{this.setState({focusVisible:e})},setScale:e=>{this.setState({scale:e})},getAvatarNode:()=>{var e;return null===(e=this.avatarRef)||void 0===e?void 0:e.current}})}componentDidMount(){this.foundation=new Wr(this.adapter),this.foundation.init()}componentDidUpdate(e){if(this.props.src&&this.props.src!==e.src){const e=new Image(0,0);e.src=this.props.src,e.onload=()=>{this.setState({isImgExist:!0})},e.onerror=()=>{this.setState({isImgExist:!1})},e.onabort=()=>{this.setState({isImgExist:!1})}}"string"==typeof this.props.children&&this.props.children!==e.children&&this.foundation.changeScale()}componentWillUnmount(){this.foundation.destroy()}onEnter(e){this.foundation.handleEnter(e)}onLeave(e){this.foundation.handleLeave(e)}handleError(){this.foundation.handleImgLoadError()}handleKeyDown(e){const{onClick:t}=this.props;switch(e.key){case"Enter":t(e),Le(e);break;case"Escape":e.target.blur()}}render(){var e;const t=this.props,{shape:n,children:r,size:i,color:s,className:o,hoverMask:a,onClick:l,imgAttr:c,src:d,srcSet:u,style:p,alt:f,gap:m,bottomSlot:g,topSlot:y,border:v,contentMotion:b}=t,x=qr(t,["shape","children","size","color","className","hoverMask","onClick","imgAttr","src","srcSet","style","alt","gap","bottomSlot","topSlot","border","contentMotion"]),{isImgExist:E,hoverContent:C,focusVisible:S}=this.state;let _={};Kr.SIZE.includes(i)||(_={width:i,height:i}),_=Object.assign(Object.assign({},_),p);const k=g||y||v,O={onClick:l,onMouseEnter:this.onEnter,onMouseLeave:this.onLeave},T=d&&E,P=w()(Jr,{[`${Jr}-${n}`]:n,[`${Jr}-${i}`]:i,[`${Jr}-${s}`]:s&&!T,[`${Jr}-img`]:T,[`${Jr}-focus`]:S,[`${Jr}-animated`]:b},o),I=C?h().createElement("div",{className:`${Jr}-hover`,"x-semi-prop":"hoverContent"},C):null;let M=h().createElement("span",Object.assign({},x,{style:k?{}:_,className:P},k?{}:O,{role:"listitem",ref:this.avatarRef}),this.getContent(),I);if(v){const t={};"object"==typeof v&&(null==v?void 0:v.color)&&(t.borderColor=null==v?void 0:v.color),M=h().createElement("div",{style:Object.assign({position:"relative"},_)},M,h().createElement("span",{style:t,className:w()([`${Jr}-additionalBorder`,`${Jr}-additionalBorder-${i}`,{[`${Jr}-${n}`]:n}])}),"object"==typeof this.props.border&&this.props.border.motion&&h().createElement("span",{style:t,className:w()([`${Jr}-additionalBorder`,`${Jr}-additionalBorder-${i}`,{[`${Jr}-${n}`]:n,[`${Jr}-additionalBorder-animated`]:"object"==typeof this.props.border&&(null===(e=this.props.border)||void 0===e?void 0:e.motion)}])}))}return k?h().createElement("span",Object.assign({className:w()([`${Jr}-wrapper`]),style:_},O),M,y&&["extra-small","small","default","medium","large","extra-large"].includes(i)&&"circle"===n&&this.renderTopSlot(),g&&["extra-small","small","default","medium","large","extra-large"].includes(i)&&this.renderBottomSlot()):M}}Qr.__SemiComponentName__="Avatar",Qr.defaultProps=he(Qr.__SemiComponentName__,{size:"medium",color:"grey",shape:"circle",gap:3,onClick:Tt,onMouseEnter:Tt,onMouseLeave:Tt}),Qr.propTypes={children:E().node,color:E().oneOf(Zr),shape:E().oneOf(Yr),size:E().oneOf(Xr),hoverMask:E().node,className:E().string,style:E().object,gap:E().number,imgAttr:E().object,src:E().string,srcSet:E().string,alt:E().string,onError:E().func,onClick:E().func,onMouseEnter:E().func,onMouseLeave:E().func,bottomSlot:E().shape({render:E().func,shape:E().oneOf(["circle","square"]),text:E().node,bgColor:E().string,textColor:E().string,className:E().string,style:E().object}),topSlot:E().shape({render:E().func,gradientStart:E().string,gradientEnd:E().string,text:E().node,textColor:E().string,className:E().string,style:E().object}),border:E().oneOfType([E().shape({color:E().string,motion:E().bool}),E().bool]),contentMotion:E().bool},Qr.elementType="Avatar";var ei=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const ti=Kr.SIZE,ni=Kr.SHAPE,ri=Kr.OVERLAP_FROM,ii=Ur.PREFIX;class si extends d.PureComponent{getAllAvatars(){const{children:e}=this.props;return e?Array.isArray(e)?h().Children.toArray(e):[e]:[]}getMergeAvatars(e){const{maxCount:t}=this.props;let n=e;const r=e.length-t,i=e.slice(0,t),s=e.slice(t);if(r>0){const e=this.renderMoreAvatar(r,s);i.push(e),n=i}return n}renderMoreAvatar(e,t){const{renderMore:n}=this.props,r=w()(`${ii}-item-more`),i=null==t?void 0:t.reduce(((e,t)=>{const{children:n,alt:r}=t.props,i=null!=r?r:"string"==typeof n?n:"";return 0===i.length?e:e.length>0?`${e},${i}`:i}),""),s=` Number of remaining Avatars:${e},${i}`;let o=h().createElement(Qr,{className:r,key:"_+n",alt:s},`+${e}`);return ye()(n)&&(o=h().createElement(d.Fragment,{key:"_+n"},n(e,t))),o}render(){const e=this.props,{children:t,maxCount:n,overlapFrom:r,size:i,shape:s,renderMore:a}=e,l=ei(e,["children","maxCount","overlapFrom","size","shape","renderMore"]);let c;const d=w()({[`${ii}-group`]:!0});if(t){const e=this.getAllAvatars();c=(er()(n)?this.getMergeAvatars(e):e).map(((e,t)=>{const n=w()(o()(e.props,"className"),{[`${ii}-item-start-${t}`]:"start"===r,[`${ii}-item-end-${t}`]:"end"===r});return h().cloneElement(e,Object.assign(Object.assign({},l),{className:n,size:i,shape:s,key:t}))}))}return h().createElement("div",{className:d,role:"list"},c)}}si.defaultProps={size:"medium",shape:"circle",overlapFrom:"start"},si.propTypes={children:E().node,shape:E().oneOf(ni),size:E().oneOf(ti),maxCount:E().number,renderMore:E().func,overlapFrom:E().oneOf(ri)};const oi={PREFIX:`${C}-backtop`};var ai=__webpack_require__("9Tt7"),li=__webpack_require__.n(ai);function ci(e,t,n){return Math.min(Math.max(e,t),n)}function di(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5;const t=ci(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,1,10),n=ci(e,.1,2);return e=>0===e||1===e?e:-t*Math.pow(2,10*(e-1))*Math.sin((e-1-n/(2*Math.PI)*Math.asin(1/t))*(2*Math.PI)/n)}const hi=(()=>{const e=["Quad","Cubic","Quart","Quint","Sine","Expo","Circ","Back","Elastic"],t={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],di],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],(e,t)=>n=>1-di(e,t)(1-n)],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],(e,t)=>n=>n<.5?di(e,t)(2*n)/2:1-di(e,t)(-2*n+2)/2]},n={linear:[.25,.25,.75,.75]};for(const r of Object.keys(t))t[r].forEach(((t,i)=>{n["ease"+r+e[i]]=t}));return n})();function ui(e){if("function"==typeof e)return e;let t=(e=e&&"string"==typeof e?e.trim():"linear").split("(")[0];const n=function(e){const t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map((e=>parseFloat(e))):[]}(e);let r;return"cubic-bezier"===t||"cubicBezier"===t?li()(...n.length?n:hi.linear):((!t||"string"!=typeof t||"string"==typeof t&&null==hi[t])&&(t="linear"),r=hi[t],"function"==typeof r?r(...n):n.length?li()(...n):li()(...r))}class pi{constructor(){this._eventMap=new Map}on(e,t){return e&&"function"==typeof t&&(this._eventMap.has(e)||this._eventMap.set(e,[]),this._eventMap.get(e).push(t)),this}once(e,t){var n=this;if(e&&"function"==typeof t){const r=function(){t(...arguments),n.off(e,r)};this.on(e,r)}}off(e,t){if(e)if("function"==typeof t){const n=this._eventMap.get(e);if(Array.isArray(n)&&n.length){let e=-1;for(;(e=n.findIndex((e=>e===t)))>-1;)n.splice(e,1)}}else null==t&&this._eventMap.delete(e);return this}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!this._eventMap.has(e)&&(this._eventMap.get(e).forEach((e=>e(...n))),!0)}}function fi(e){return Boolean(e&&"object"==typeof e&&(e.duration>0||"string"==typeof e.easing||"function"==typeof e.easing))}function mi(e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]="number"==typeof e[n]?e[n]:e[n].val);return t}const gi=[0,0];function yi(e,t,n,r,i,s,o){const a=n+(-i*(t-r)+-s*n)*e,l=t+a*e;return Math.abs(a)<o&&Math.abs(l-r)<o?(gi[0]=r,gi[1]=0,gi):(gi[0]=l,gi[1]=a,gi)}const vi=Object.assign(Object.assign({},{tension:170,friction:26}),{precision:.01});function bi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(fi(t)){const e=ui(t.easing),n="number"==typeof t.duration&&t.duration>0?t.duration:1e3;t=Object.assign(Object.assign({},t),{easing:e,duration:n})}let n=Object.assign(Object.assign(Object.assign({},vi),t),{done:!1});if(e&&"object"==typeof e&&"val"in e){if(fi(e)){const n=ui(e.easing),r="number"==typeof e.duration&&e.duration>0?e.duration:parseInt(t.duration)||1e3;e=Object.assign(Object.assign({},e),{easing:n,duration:r})}n=Object.assign(Object.assign({},n),e)}else n=Object.assign(Object.assign({},n),{val:e});return n}const wi=()=>Date.now(),xi=1e3/60;class Ei extends pi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this._props=Object.assign({},e),this._config=Object.assign({},t),this.initStates()}_wrapConfig(e,t){t=t&&"object"==typeof t?t:this._config;const n={};for(const r of Object.keys(e))n[r]=bi(e[r],t);return n}initStates(e,t){e=e&&"object"==typeof e?e:this._props,t=t&&"object"==typeof t?t:this._config;const{from:n,to:r}=e;if(this._from={},n)for(const e of Object.keys(n))this._from[e]="object"==typeof n[e]&&n[e].val?n[e].val:n[e];this._to=this._wrapConfig(r,t),this._delay=parseInt(t.delay)||0;const i=this._from&&mi(this._from)||mi(this._to),s=function(e){const t={},n=e&&Object.keys(e)||[];for(const e of n)t[e]=0;return t}(i);this._currentStyle=Object.assign({},i),this._currentVelocity=Object.assign({},s),this._lastIdealStyle=Object.assign({},i),this._lastIdealVelocity=Object.assign({},s),this.resetPlayStates(),this._frameCount=0,this._prevTime=0}animate(){null==this._timer&&(this._timer=requestAnimationFrame((e=>{const t=wi();if(function(e,t,n,r,i){for(const s of Object.keys(t)){const o=t[s],a="number"==typeof o?o:o.val;if("object"!=typeof o||!o.done){if(fi(o)&&r&&i&&o.duration){if(o.duration+r<=i||a!==e[s])return!1}else if("number"==typeof n[s]&&0!==n[s])return!1;if(e[s]!==a)return!1}}return!0}(this._currentStyle,this._to,this._currentVelocity,this._startedTime||t,t)||this._ended||this._stopped)return!this._wasAnimating||this._ended||this._stopped||(this._timer=setTimeout((()=>{clearTimeout(this._timer),this._timer=null,this._ended=!0,this.emit("rest",this.getCurrentStates())}),xi)),void this.resetPlayStates();this._started||(this._started=!0,this.emit("start",this.getCurrentStates())),this._stopped=!1,this._paused=!1,this._wasAnimating=!0,0===this._startedTime&&(this._startedTime=t);const n=t,r=n-this._prevTime;this._prevTime=n,n-this._startedTime<this._delay&&(this._timer=null,this.animate());const i={},s={},o={},a={},l=this._to&&Object.keys(this._to)||[];for(const e of l){const t=this._to[e];this._accumulatedTime[e]="number"!=typeof this._accumulatedTime[e]?r:this._accumulatedTime[e]+r;const l=null!=this._from[e]&&"object"==typeof this._from[e]?this._from[e].val:this._from[e],c=t.val;if("number"==typeof t)o[e]=t,a[e]=0,i[e]=t,s[e]=0;else{let r=this._lastIdealStyle[e],d=this._lastIdealVelocity[e];if(fi(this._config)||fi(t)){const{easing:s,duration:a}=t;r=l+s((n-this._startedTime)/a)*(c-l),n>=this._startedTime+a&&(r=c,t.done=!0),i[e]=r,o[e]=r}else if(null!=c&&c===this._currentStyle[e])o[e]=c,a[e]=0,i[e]=c,s[e]=0;else{const n=(this._accumulatedTime[e]-Math.floor(this._accumulatedTime[e]/xi)*xi)/xi,l=Math.floor(this._accumulatedTime[e]/xi);for(let e=0;e<l;e++)[r,d]=yi(xi/1e3,r,d,t.val,t.tension,t.friction,t.precision);const[c,h]=yi(xi/1e3,r,d,t.val,t.tension,t.friction,t.precision);o[e]=r+(c-r)*n,a[e]=d+(h-d)*n,i[e]=r,s[e]=d,this._accumulatedTime[e]-=l*xi}}}this._timer=null,this._currentStyle=Object.assign({},o),this._currentVelocity=Object.assign({},a),this._lastIdealStyle=Object.assign({},i),this._lastIdealVelocity=Object.assign({},s),this._destroyed||(this.emit("frame",this.getCurrentStates()),this.animate())})))}start(){this._prevTime=wi(),this._startedTime=wi(),this.animate()}end(){this._ended||(this._ended=!0,this._currentStyle=this.getFinalStates(),this.emit("frame",this.getFinalStates()),this.emit("rest",this.getFinalStates())),this.destroy()}pause(){this._paused||(this._pausedTime=wi(),this._paused=!0,this.emit("pause",this.getCurrentStates()),this.destroy(),this._destroyed=!1)}resume(){if(this._started&&this._paused){const e=wi()-this._pausedTime;this._paused=!1,this._startedTime+=e,this._prevTime+=e,this._pausedTime=0,this.emit("resume",this.getCurrentStates()),this.animate()}}stop(){this.destroy(),this._stopped||(this._stopped=!0,this.emit("stop",this.getInitialStates()),this.initStates())}destroy(){cancelAnimationFrame(this._timer),clearTimeout(this._timer),this._timer=null,this._destroyed=!0}resetPlayStates(){this._started=!1,this._stopped=!1,this._ended=!1,this._paused=!1,this._destroyed=!1,this._timer=null,this._wasAnimating=!1,this._accumulatedTime={},this._startedTime=0,this._pausedTime=0}reset(){this.destroy(),this.initStates()}reverse(){this.destroy();const e=Object.assign({},this._props),[t,n]=[e.to,e.from];e.from=t,e.to=n,this._props=Object.assign({},e),this.initStates()}getCurrentStates(){return Object.assign({},this._currentStyle)}getInitialStates(){return Object.assign({},mi(this._props.from))}getFinalStates(){return Object.assign({},mi(this._props.to))}}class Ci extends c{constructor(e){super(Object.assign({},e)),this.scrollTo=(e,t,n)=>{const{duration:r}=this.getProps();this.animation=new Ei({from:{scrollTop:t},to:{scrollTop:n}},{duration:r,easing:"easeInOutCubic"}),this.animation.on("frame",(t=>{let{scrollTop:n}=t;this._adapter.targetScrollToTop(e,n)})),this.animation.start()},this.handleScroll=()=>{const{target:e,visibilityHeight:t}=this.getProps(),n=e();requestAnimationFrame((()=>{const e=this.getScroll(n);this._adapter.updateVisible(e>t)}))}}init(){const{target:e}=this.getProps(),t=e();t&&(t.addEventListener("scroll",this.handleScroll),this.handleScroll())}destroy(){const{target:e}=this.getProps(),t=e();t&&t.removeEventListener("scroll",this.handleScroll),this.animation&&this.animation.destroy()}getScroll(e){if(this._adapter.isWindowUndefined())return 0;return this._adapter.targetIsWindow(e)?e.pageYOffset:e.scrollTop}setScrollTop(e){const{target:t}=this.getProps(),n=t(),r=this.getScroll(n);this.scrollTo(n,r,e)}onClick(e){this.setScrollTop(0),this._adapter.notifyClick(e)}}__webpack_require__("ySxA");const Si={PREFIX:`${C}-button`},_i={sizes:["default","small","large"],iconPositions:["left","right"],htmlTypes:["button","reset","submit"],btnTypes:["primary","secondary","tertiary","warning","danger"],themes:["solid","borderless","light","outline"],DEFAULT_ICON_SIZE:"default",DEFAULT_ICON_POSITION:"left"};__webpack_require__("kEbM");var ki=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Oi=_i.sizes,{htmlTypes:Ti,btnTypes:Pi}=_i;class Ii extends d.PureComponent{render(){const e=this.props,{children:t,block:n,htmlType:r,loading:i,circle:s,className:o,style:a,disabled:l,size:c,theme:d,type:u,colorful:p,prefixCls:f,iconPosition:m}=e,g=ki(e,["children","block","htmlType","loading","circle","className","style","disabled","size","theme","type","colorful","prefixCls","iconPosition"]),y=Object.assign(Object.assign({disabled:l},W()(g,["x-semi-children-alias"])),{className:w()(f,{[`${f}-${u}`]:!l&&u,[`${f}-disabled`]:l,[`${f}-size-large`]:"large"===c,[`${f}-size-small`]:"small"===c,[`${f}-block`]:n,[`${f}-circle`]:s,[`${f}-${d}`]:d,[`${f}-${u}-disabled`]:l&&u,[`${f}-colorful`]:p},o),type:r,"aria-disabled":l}),v={};return o&&o.includes("-with-icon")||(v["x-semi-prop"]=this.props["x-semi-children-alias"]||"children"),h().createElement("button",Object.assign({},y,{onClick:this.props.onClick,onMouseDown:this.props.onMouseDown,style:a}),h().createElement("span",Object.assign({className:w()(`${f}-content`,this.props.contentClassName),onClick:e=>l&&e.stopPropagation()},v),t))}}function Mi(e,t){if("string"==typeof e)return new Array(t).fill(e);if(Array.isArray(e)){const n=e.length;let r=e;if(n<t){let i=0;for(r=[];i<t;)r.push(e[i%n]),i++;return r}return n>t&&(r=e.slice(0,t)),4===t?r.reverse():r}return 2===t?["rgba(166,71,255)","currentColor"]:["rgba(233,69,255)","rgba(166,71,255)","rgba(107,97,255)","rgba(46,140,255)"]}Ii.defaultProps={disabled:!1,size:"default",type:"primary",theme:"light",block:!1,htmlType:"button",onMouseDown:Tt,onClick:Tt,onMouseEnter:Tt,onMouseLeave:Tt,colorful:!1,prefixCls:Si.PREFIX},Ii.propTypes={children:E().node,disabled:E().bool,prefixCls:E().string,style:E().object,size:E().oneOf(Oi),type:E().oneOf(Pi),block:E().bool,onClick:E().func,onMouseDown:E().func,circle:E().bool,loading:E().bool,htmlType:E().oneOf(Ti),theme:E().oneOf(_i.themes),className:E().string,onMouseEnter:E().func,onMouseLeave:E().func,"aria-label":E().string,contentClassName:E().string};var Ri=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Ai=nn((function(e){const{fill:t}=e,n=Ri(e,["fill"]),r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{prefix:t="",length:n=7}=e,r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ";let i="";for(let e=0;e<n;e++){const e=Math.floor(62*Math.random());i+=r.charAt(e)}return t?`${t}-${i}`:i}({prefix:"semi-ai-loading"}),[i,s,o,a]=Mi(t,4);return d.createElement("svg",Object.assign({viewBox:"0 0 16 16",width:"1em",height:"1em",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,"aria-hidden":!0},n),d.createElement("path",{d:"M15.1112 7.99978C15.1112 4.07242 11.9275 0.888672 8.00009 0.888672C5.18219 0.888672 2.74711 2.52771 1.59619 4.90445",stroke:`url(#${r})`,strokeWidth:"1.77778",strokeLinecap:"round"}),d.createElement("defs",null,d.createElement("linearGradient",{id:r,x1:"16",y1:"8",x2:"2.68594",y2:"11.022",gradientUnits:"userSpaceOnUse"},d.createElement("stop",{stopColor:i}),d.createElement("stop",{offset:"0.3",stopColor:s}),d.createElement("stop",{offset:"0.6",stopColor:o}),d.createElement("stop",{offset:"1",stopColor:a,stopOpacity:"0"}))))}),"ai_loading"),Ni=Ai;__webpack_require__("VCw7");var Di=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Li=["extra-small","small","default","large","extra-large","custom"];class Fi extends d.PureComponent{render(){const e=this.props,{children:t,iconPosition:n,iconSize:r,iconStyle:i,style:s,icon:o,noHorizontalPadding:a,theme:l,className:c,prefixCls:d,loading:u}=e,p=Di(e,["children","iconPosition","iconSize","iconStyle","style","icon","noHorizontalPadding","theme","className","prefixCls","loading"]),f=Object.assign({},s),{colorful:m,type:g,disabled:y}=p;Array.isArray(a)?(a.includes("left")&&(f.paddingLeft=0),a.includes("right")&&(f.paddingRight=0)):!0===a?(f.paddingLeft=0,f.paddingRight=0):"string"==typeof a&&("left"===a&&(f.paddingLeft=0),"right"===a&&(f.paddingRight=0));let v=null,b=null;if(u&&!p.disabled)b=m&&["light","outline","borderless"].includes(l)||"solid"===l&&"tertiary"===g?h().createElement(Ni,{className:`${d}-content-loading-icon`}):h().createElement(or,null);else if(h().isValidElement(o))if(m){const e="solid"===l&&"tertiary"===g||"primary"===g&&["light","borderless"].includes(l),t="tertiary"===g&&["light","borderless","outline"].includes(l);if(e){let e;e=y?new Array(4).fill("var(--semi-color-disabled-text)"):["var(--semi-button-colorful-multiple-fill-0)","var(--semi-button-colorful-multiple-fill-1)","var(--semi-button-colorful-multiple-fill-2)","var(--semi-button-colorful-multiple-fill-3)"],b=h().cloneElement(o,{fill:e})}else if(t){let e;e=y?new Array(2).fill("var(--semi-color-disabled-text)"):["var(--semi-button-colorful-fill-primary)","var(--semi-button-colorful-fill-secondary)"],b=h().cloneElement(o,{fill:e})}else b=o}else b=o;const x=w()({[`${d}-content-left`]:"right"===n,[`${d}-content-right`]:"left"===n}),E=this.props["x-semi-children-alias"]||"children",C=null!=t?h().createElement("span",{className:x,"x-semi-prop":E},t):null;v="left"===n?h().createElement(h().Fragment,null,b,C):h().createElement(h().Fragment,null,C,b);const S=w()(c,`${d}-with-icon`,{[`${d}-with-icon-only`]:null==C||""===C,[`${d}-loading`]:u});return h().createElement(Ii,Object.assign({},p,{className:S,theme:l,style:f}),v)}}Fi.defaultProps={iconPosition:_i.DEFAULT_ICON_POSITION,prefixCls:Si.PREFIX,loading:!1,noHorizontalPadding:!1,onMouseEnter:i(),onMouseLeave:i()},Fi.elementType="IconButton",Fi.propTypes={iconStyle:E().object,style:E().object,loading:E().bool,prefixCls:E().string,icon:E().oneOfType([E().object,E().string,E().node]),iconSize:E().oneOf(Li),noHorizontalPadding:E().oneOfType([E().bool,E().string,E().array]),children:E().node,theme:E().string,iconPosition:E().oneOf(_i.iconPositions),className:E().string,onMouseEnter:E().func,onMouseLeave:E().func};const ji=Fi;const $i=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.64 16.44a1.5 1.5 0 0 1-2.12 0l-5.66-5.66-5.66 5.66a1.5 1.5 0 1 1-2.12-2.12L10.8 7.6a1.5 1.5 0 0 1 2.12 0l6.72 6.72a1.5 1.5 0 0 1 0 2.12Z",fill:"currentColor"}))}),"chevron_up");var Bi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Vi=oi.PREFIX;class zi extends f{constructor(e){super(e),this.state={visible:!1},this.foundation=new Ci(this.adapter)}componentDidMount(){var e;this.foundation.init(),this.handler=g()(this.handleClick,null!==(e=this.props.duration)&&void 0!==e?e:zi.defaultProps.duration)}componentWillUnmount(){this.foundation.destroy()}get adapter(){return Object.assign(Object.assign({},super.adapter),{updateVisible:e=>{this.setState({visible:e})},notifyClick:e=>{this.props.onClick&&this.props.onClick(e)},targetIsWindow:e=>e===window,isWindowUndefined:()=>void 0===window,targetScrollToTop:(e,t)=>{e===window?(document.body.scrollTop=t,document.documentElement.scrollTop=t):e.scrollTop=t}})}handleClick(e){this.foundation.onClick(e)}renderDefault(){return h().createElement(ji,{theme:"light",icon:h().createElement($i,null)})}render(){const e=this.props,{children:t,className:n,style:r,onClick:i,visibilityHeight:s,target:o}=e,a=Bi(e,["children","className","style","onClick","visibilityHeight","target"]),{visible:l}=this.state,c=w()(Vi,n),d=t||this.renderDefault(),u=l?h().createElement("div",Object.assign({},a,{className:c,style:r,onClick:e=>this.handler(e),"x-semi-prop":"children"}),d):null;return u}}zi.__SemiComponentName__="BackTop",zi.defaultProps=he(zi.__SemiComponentName__,{visibilityHeight:400,target:()=>window,duration:450}),zi.propTypes={target:E().func,visibilityHeight:E().number,duration:E().number,onClick:E().func,style:E().object,className:E().string};const Hi={PREFIX:`${C}-badge`},Ui=["success","primary","secondary","tertiary","warning","danger"],Ki=["solid","light","inverted"],Wi=["leftTop","leftBottom","rightTop","rightBottom"];__webpack_require__("TQlD");var Gi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const qi=Hi.PREFIX;class Xi extends d.PureComponent{render(){const{direction:e}=this.context,t="rtl"===e?"leftTop":"rightTop",n=this.props,{count:r,dot:i,type:s,countClassName:o,countStyle:a,theme:l,position:c=t,overflowCount:d,style:u,children:p,className:f}=n,m=Gi(n,["count","dot","type","countClassName","countStyle","theme","position","overflowCount","style","children","className"]),g=r&&!(er()(r)||xe()(r)),y=null!=r,v=w()(o,{[`${qi}-${s}`]:!g,[`${qi}-${l}`]:!g,[`${qi}-${c}`]:Boolean(c)&&Boolean(p),[`${qi}-block`]:!p,[`${qi}-dot`]:i,[`${qi}-count`]:!i&&!g&&y,[`${qi}-custom`]:g});let b;return b=er()(r)?d&&d<r?`${d}+`:`${r}`:r,h().createElement("span",Object.assign({className:w()(qi,f)},m),p,h().createElement("span",{className:v,style:u||a,"x-semi-prop":"count"},i?null:b))}}Xi.contextType=lt,Xi.propTypes={count:E().node,dot:E().bool,type:E().oneOf(Ui),theme:E().oneOf(Ki),position:E().oneOf(Wi),overflowCount:E().number,style:E().object,className:E().string,children:E().node,onClick:E().func,onMouseEnter:E().func,onMouseLeave:E().func,countClassName:E().string,countStyle:E().object},Xi.defaultProps={dot:!1,type:"primary",theme:"solid",className:"",onClick:()=>i(),onMouseEnter:()=>i(),onMouseLeave:()=>i()};const Yi={PREFIX:`${C}-banner`};class Zi extends c{constructor(e){super(Object.assign(Object.assign({},Zi.defaultAdapter),e))}removeBanner(e){this._adapter.notifyClose(e),this._adapter.setVisible()}}__webpack_require__("tIsd");const Ji=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M17.66 19.78a1.5 1.5 0 0 0 2.12-2.12L14.12 12l5.66-5.66a1.5 1.5 0 0 0-2.12-2.12L12 9.88 6.34 4.22a1.5 1.5 0 1 0-2.12 2.12L9.88 12l-5.66 5.66a1.5 1.5 0 0 0 2.12 2.12L12 14.12l5.66 5.66Z",fill:"currentColor"}))}),"close");const Qi=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m10.23 2.4-8.7 16.67A2 2 0 0 0 3.3 22h17.4a2 2 0 0 0 1.77-2.93L13.77 2.4a2 2 0 0 0-3.54 0ZM13.14 14a1.15 1.15 0 0 1-2.28 0l-.58-4.03a1.73 1.73 0 1 1 3.44 0l-.58 4.03Zm.36 4.49a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",fill:"currentColor"}))}),"alert_triangle");const es=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm5.88-13.18-6.2 7.6a1.5 1.5 0 0 1-2.37 0l-3.5-4a1.5 1.5 0 1 1 2.37-1.84l2.3 2.46L15.5 8a1.5 1.5 0 1 1 2.38 1.82Z",fill:"currentColor"}))}),"tick_circle");const ts=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm2-16a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-5 3.75c0-.41.34-.75.75-.75h2.75a1 1 0 0 1 1 1v5.5h.75a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5h.75v-5h-.75a.75.75 0 0 1-.75-.75Z",fill:"currentColor"}))}),"info_circle");const ns=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-9.5 5.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0ZM12 5a1.9 1.9 0 0 0-1.89 2l.3 5.5a1.59 1.59 0 0 0 3.17 0l.3-5.5c.07-1.09-.8-2-1.88-2Z",fill:"currentColor"}))}),"alert_circle"),rs=Yi.PREFIX,is=["info","success","danger","warning"];class ss extends f{constructor(e){super(e),this.remove=e=>{e&&e.stopPropagation(),this.foundation.removeBanner(e)},this.state={visible:!0},Q("target"in this.props,"[Semi Banner] 'target' has been deprecated, please write JSX directly instead.")}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVisible:()=>{this.setState({visible:!1})},notifyClose:e=>{const{onClose:t}=this.props;t(e)}})}componentDidMount(){this.foundation=new Zi(this.adapter),this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}renderCloser(){const{closeIcon:e}=this.props;if(null===e)return e;return h().createElement(ji,{className:`${rs}-close`,onClick:this.remove,icon:e||h().createElement(Ji,{"x-semi-prop":"closeIcon","aria-hidden":!0}),theme:"borderless",size:"small",type:"tertiary","aria-label":"Close"})}renderIcon(){const{type:e,icon:t}=this.props;let n={warning:h().createElement(Qi,{size:"large","aria-label":"warning"}),success:h().createElement(es,{size:"large","aria-label":"success"}),info:h().createElement(ts,{size:"large","aria-label":"info"}),danger:h().createElement(ns,{size:"large","aria-label":"danger"})}[e];const r=w()({[`${rs}-icon`]:!0});return void 0!==t&&(n=t),n?h().createElement("div",{className:r,"x-semi-prop":"icon"},n):null}render(){const{children:e,type:t,className:n,style:r,bordered:i,title:s,description:o,fullMode:a}=this.props,{visible:l}=this.state,c=w()(rs,n,{[`${rs}-${t}`]:t,[`${rs}-full`]:a,[`${rs}-in-container`]:!a,[`${rs}-bordered`]:!a&&i});return l?h().createElement("div",Object.assign({className:c,style:r,role:"alert"},this.getDataAttr(this.props)),h().createElement("div",{className:`${rs}-content-wrapper`},h().createElement("div",{className:`${rs}-content`},this.renderIcon(),h().createElement("div",{className:`${rs}-content-body`},s?h().createElement(Un.Title,{heading:5,className:`${rs}-title`,component:"div","x-semi-prop":"title"},s):null,o?h().createElement(Un.Paragraph,{className:`${rs}-description`,component:"div","x-semi-prop":"description"},o):null)),this.renderCloser()),e?h().createElement("div",{className:`${rs}-extra`,"x-semi-prop":"children"},e):null):null}}ss.propTypes={fullMode:E().bool,type:E().oneOf(is),title:E().node,description:E().node,icon:E().node,closeIcon:E().node,children:E().node,style:E().object,className:E().string,onClose:E().func,bordered:E().bool},ss.defaultProps={onClose:()=>{},type:"info",fullMode:!0};const as={PREFIX:`${C}-breadcrumb`};class ls extends c{constructor(e){super(Object.assign({},e))}handleClick(e,t){this._adapter.notifyClick(e,t)}handleExpand(e){this._adapter.expandCollapsed(e)}handleExpandEnterPress(e){dn(e)&&this.handleExpand(e)}genRoutes(e){return e.map((e=>{if("object"!=typeof e)return{name:e,_origin:{name:e}};let t={};return t._origin=e,Object.assign(Object.assign({},t),e)}))}}__webpack_require__("NppW");class cs extends c{constructor(e){super(Object.assign({},e))}handleClick(e,t){this._adapter.notifyClick(e,t),this._adapter.notifyParent(e,t)}}const ds=h().createContext({}),hs=as.PREFIX;class us extends f{get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{notifyClick:function(){e.props.onClick(...arguments)},notifyParent:function(){e.context.onClick(...arguments)}})}constructor(e){super(e),this.renderIcon=()=>{const e=this.props.icon,{compact:t}=this.context,n=t?"small":"default",r=`${hs}-item-icon`;return h().isValidElement(e)?h().cloneElement(e,{className:r,size:n}):e},this.getTooltipOpt=()=>{const{showTooltip:e}=this.context;if(!e)return{width:150,ellipsisPos:"end"};const t={width:150,ellipsisPos:"end",opts:{autoAdjustOverflow:!0,position:"top"}};return"object"==typeof e?Ce()(t,e):t},this.getItemInfo=()=>{let e={};const{route:t,children:n,href:r}=this.props,i=!_e()(r)&&!be()(r);return t?e=t:(e.name=n,i&&(e.href=r)),e},this.renderBreadItem=()=>{const{children:e}=this.props,{compact:t}=this.context,n=this.getTooltipOpt(),r=this.renderIcon();if(Boolean(e)&&"string"==typeof e){const{opts:i,ellipsisPos:s,width:o}=n;return h().createElement(d.Fragment,null,r,h().createElement("span",{className:`${hs}-item-title`},h().createElement(Un.Text,{ellipsis:{showTooltip:!!i&&{opts:i},pos:s},style:{maxWidth:o},size:t?"small":"normal"},e)))}return h().createElement(d.Fragment,null,r,e?h().createElement("span",{className:`${hs}-item-title ${hs}-item-title-inline`},e):null)},this.renderItem=()=>{const{href:e,active:t,noLink:n}=this.props,r=null!=e,i=w()({[`${hs}-item`]:!0,[`${hs}-item-active`]:t,[`${hs}-item-link`]:!n}),s=this.renderBreadItem(),o=t||!r?"span":"a",a=this.getItemInfo();return h().createElement(o,{className:i,onClick:e=>this.foundation.handleClick(a,e),href:e},s)},this.foundation=new cs(this.adapter)}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}render(){const{active:e,shouldRenderSeparator:t}=this.props,n=e?{"aria-current":"page"}:{},r=this.renderItem(),i=this.props.separator||h().createElement("span",{className:`${hs}-separator`},this.context.separator),s=w()({[`${hs}-item-wrap`]:!0});return h().createElement("span",Object.assign({className:s},n,this.getDataAttr(this.props)),r,t&&i)}}us.isBreadcrumbItem=!0,us.contextType=ds,us.propTypes={onClick:E().func,route:E().oneOfType([E().object,E().string]),name:E().string,children:E().node,active:E().bool,shouldRenderSeparator:E().bool,icon:E().node,separator:E().node,noLink:E().bool},us.defaultProps={onClick:Tt,shouldRenderSeparator:!0};const ps=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M7 12a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z",fill:"currentColor"}),d.createElement("path",{d:"M14.5 12a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z",fill:"currentColor"}),d.createElement("path",{d:"M19.5 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z",fill:"currentColor"}))}),"more"),fs=as.PREFIX;class ms extends f{constructor(e){super(e),this.handleCollapse=(e,t)=>{const{maxItemCount:n,renderMore:r,moreType:i}=this.props,s=ye()(r),o=e.slice(1,t-n+1),a=h().createElement("span",{className:`${fs}-collapse`,key:`more-${t}`},h().createElement("span",{className:`${fs}-item-wrap`},h().createElement("span",{role:"button",tabIndex:0,"aria-label":"Expand breadcrumb items",className:`${fs}-item ${fs}-item-more`,onClick:e=>this.foundation.handleExpand(e),onKeyPress:e=>this.foundation.handleExpandEnterPress(e)},s&&r(o),!s&&"default"===i&&h().createElement(ps,null),!s&&"popover"===i&&this.renderPopoverMore(o)),h().createElement("span",{className:`${fs}-separator`,"x-semi-prop":"separator"},this.props.separator)));return e.splice(1,t-n,a),e},this.renderRouteItems=(e,t,n)=>{const{renderItem:r,renderMore:i,maxItemCount:s}=this.props,o=e.length-s,a=ye()(i),l=e.map(((i,s)=>{const l=i._origin.key||`item-${i.name||i.path}-${s}`,c=s>0&&s<=o;return h().createElement(us,Object.assign({},i,{key:l,active:void 0!==this.props.activeIndex?this.props.activeIndex===s:s===e.length-1,route:i._origin,shouldRenderSeparator:s!==e.length-1&&!(t&&(a||n)&&c)}),r?r(i._origin):i.name)}));return l},this.renderList=()=>{const{routes:e,children:t,autoCollapse:n,maxItemCount:r,renderMore:i,moreType:s}=this.props,{isCollapsed:o}=this.state,a=e&&e.length>0,l=a?this.foundation.genRoutes(e):h().Children.toArray(t);let c;const d=l.length,u=d-r,p=l&&n&&d>r&&o,f=ye()(i),m="popover"===s;return c=a?this.renderRouteItems(l,p,m):l.map(((e,t)=>{const n=t>0&&t<=u;return e?(Q(e.type&&!e.type.isBreadcrumbItem,"[Semi Breadcrumb]: Only accepts Breadcrumb.Item as its children"),h().cloneElement(e,{key:`${t}-item`,active:void 0!==this.props.activeIndex?this.props.activeIndex===t:t===l.length-1,shouldRenderSeparator:t!==l.length-1&&!(p&&(f||m)&&n)})):e})),p?this.handleCollapse(c,l.length):c},this.onClick=(e,t)=>{this.foundation.handleClick(e,t)},this.foundation=new ls(this.adapter),this.state={isCollapsed:!0},this.onClick=this.onClick.bind(this)}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{notifyClick:function(){e.props.onClick(...arguments)},expandCollapsed:()=>this.setState({isCollapsed:!1})})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}renderPopoverMore(e){const{separator:t}=this.props,n=h().createElement(h().Fragment,null,e.map(((n,r)=>h().createElement(h().Fragment,{key:`restItem-${r}`},n,r!==e.length-1&&h().createElement("span",{className:`${fs}-restItem`},t)))));return h().createElement(Cn,{content:n,style:{padding:12},showArrow:!0},h().createElement(ps,null))}render(){const e=this.renderList(),{compact:t,className:n,style:r,separator:i,showTooltip:s}=this.props,o=w()(n,{[`${fs}-wrapper`]:!0,[`${fs}-wrapper-compact`]:t,[`${fs}-wrapper-loose`]:!t});return h().createElement(ds.Provider,{value:{onClick:this.onClick,showTooltip:s,compact:t,separator:i}},h().createElement("nav",Object.assign({"aria-label":this.props["aria-label"],className:o,style:r},this.getDataAttr(this.props)),e))}}ms.contextType=ds,ms.Item=us,ms.propTypes={activeIndex:E().number,routes:E().array,onClick:E().func,separator:E().node,compact:E().bool,children:E().node,style:E().object,renderItem:E().func,showTooltip:E().oneOfType([E().shape({width:E().oneOfType([E().string,E().number]),ellipsisPos:E().oneOf(["end","middle"]),opts:E().object}),E().bool]),className:E().string,autoCollapse:E().bool,maxItemCount:E().number,renderMore:E().func,moreType:E().oneOf(["default","popover"]),"aria-label":E().string},ms.defaultProps={routes:[],onClick:Tt,renderItem:void 0,separator:"/",compact:!0,showTooltip:{width:150,ellipsisPos:"end"},autoCollapse:!0,moreType:"default",maxItemCount:4,"aria-label":"Breadcrumb"};const gs=ms;class ys extends h().PureComponent{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}render(){const e=Object.assign({},this.props),t=Boolean(e.icon),n=Boolean(e.loading),r=Boolean(e.disabled);return t||n&&!r?h().createElement(ji,Object.assign({},e)):h().createElement(Ii,Object.assign({},e))}}ys.__SemiComponentName__="Button",ys.propTypes=Object.assign(Object.assign({},Ii.propTypes),ji.propTypes),ys.defaultProps=he(ys.__SemiComponentName__),ys.elementType="Button";const vs=ys;var bs=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const ws=Si.PREFIX,xs=_i.sizes;class Es extends f{getInnerWithLine(e){const t=[];return e.length>1?(e.slice(0,-1).forEach(((e,n)=>{const r="Button"===o()(e,"type.elementType"),i=o()(e,"props"),{type:s,theme:a,disabled:l}=null!=i?i:{};if(r&&"outline"!==a){const r=w()(`${ws}-group-line`,`${ws}-group-line-${null!=a?a:"light"}`,`${ws}-group-line-${null!=s?s:"primary"}`,{[`${ws}-group-line-disabled`]:l});t.push(e,h().createElement("span",{className:r,key:`line-${n}`}))}else t.push(e)})),t.push(e.slice(-1)),t):e}render(){const e=this.props,{children:t,disabled:n,size:r,type:i,className:s,style:o,"aria-label":a}=e,l=bs(e,["children","disabled","size","type","className","style","aria-label"]);let c,u=[];const p=w()(`${ws}-group`,s);return t&&(c=(Array.isArray(t)?t:[t]).map(((e,t)=>{var s;return(0,d.isValidElement)(e)?(0,d.cloneElement)(e,Object.assign(Object.assign(Object.assign({disabled:n,size:r,type:i},e.props),l),{key:null!==(s=e.key)&&void 0!==s?s:t})):e})),u=this.getInnerWithLine(c)),h().createElement("div",{className:p,style:o,role:"group","aria-label":a},u)}}function Cs(e){Nt(1,arguments);var t=Lt(e);return t.setHours(0,0,0,0),t}function Ss(e,t){Nt(2,arguments);var n=Cs(e),r=Cs(t);return n.getTime()===r.getTime()}function _s(e){return Nt(1,arguments),e instanceof Date||"object"===Dt(e)&&"[object Date]"===Object.prototype.toString.call(e)}function ks(e){if(Nt(1,arguments),!_s(e)&&"number"!=typeof e)return!1;var t=Lt(e);return!isNaN(Number(t))}function Os(e,t){Nt(2,arguments);var n=Lt(e).getTime(),r=Ft(t);return new Date(n+r)}function Ts(e,t){return Nt(2,arguments),Os(e,-Ft(t))}Es.propTypes={children:E().node,disabled:E().bool,type:E().string,size:E().oneOf(xs),theme:E().oneOf(_i.themes),"aria-label":E().string},Es.defaultProps={size:"default"};function Ps(e){Nt(1,arguments);var t=Lt(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function Is(e){Nt(1,arguments);var t=Lt(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=Ps(r),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var o=Ps(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}var Ms=6048e5;function Rs(e){Nt(1,arguments);var t=Lt(e),n=Ps(t).getTime()-function(e){Nt(1,arguments);var t=Is(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),Ps(n)}(t).getTime();return Math.round(n/Ms)+1}function As(e,t){var n,r,i,s,o,a,l,c;Nt(1,arguments);var d=Lt(e),h=d.getUTCFullYear(),u=$t(),p=Ft(null!==(n=null!==(r=null!==(i=null!==(s=null==t?void 0:t.firstWeekContainsDate)&&void 0!==s?s:null==t||null===(o=t.locale)||void 0===o||null===(a=o.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==i?i:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var f=new Date(0);f.setUTCFullYear(h+1,0,p),f.setUTCHours(0,0,0,0);var m=Bt(f,t),g=new Date(0);g.setUTCFullYear(h,0,p),g.setUTCHours(0,0,0,0);var y=Bt(g,t);return d.getTime()>=m.getTime()?h+1:d.getTime()>=y.getTime()?h:h-1}var Ns=6048e5;function Ds(e,t){Nt(1,arguments);var n=Lt(e),r=Bt(n,t).getTime()-function(e,t){var n,r,i,s,o,a,l,c;Nt(1,arguments);var d=$t(),h=Ft(null!==(n=null!==(r=null!==(i=null!==(s=null==t?void 0:t.firstWeekContainsDate)&&void 0!==s?s:null==t||null===(o=t.locale)||void 0===o||null===(a=o.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==i?i:d.firstWeekContainsDate)&&void 0!==r?r:null===(l=d.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),u=As(e,t),p=new Date(0);return p.setUTCFullYear(u,0,h),p.setUTCHours(0,0,0,0),Bt(p,t)}(n,t).getTime();return Math.round(r/Ns)+1}function Ls(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var Fs={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return Ls("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):Ls(n+1,2)},d:function(e,t){return Ls(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return Ls(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Ls(e.getUTCHours(),t.length)},m:function(e,t){return Ls(e.getUTCMinutes(),t.length)},s:function(e,t){return Ls(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return Ls(Math.floor(r*Math.pow(10,n-3)),t.length)}};const js=Fs;var $s="midnight",Bs="noon",Vs="morning",zs="afternoon",Hs="evening",Us="night",Ks={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return js.y(e,t)},Y:function(e,t,n,r){var i=As(e,r),s=i>0?i:1-i;return"YY"===t?Ls(s%100,2):"Yo"===t?n.ordinalNumber(s,{unit:"year"}):Ls(s,t.length)},R:function(e,t){return Ls(Is(e),t.length)},u:function(e,t){return Ls(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ls(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ls(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return js.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return Ls(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var i=Ds(e,r);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):Ls(i,t.length)},I:function(e,t,n){var r=Rs(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):Ls(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):js.d(e,t)},D:function(e,t,n){var r=function(e){Nt(1,arguments);var t=Lt(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=n-t.getTime();return Math.floor(r/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):Ls(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ls(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ls(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return Ls(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,i=e.getUTCHours();switch(r=12===i?Bs:0===i?$s:i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,i=e.getUTCHours();switch(r=i>=17?Hs:i>=12?zs:i>=4?Vs:Us,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return js.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):js.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):Ls(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):Ls(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):js.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):js.s(e,t)},S:function(e,t){return js.S(e,t)},X:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Gs(i);case"XXXX":case"XX":return qs(i);default:return qs(i,":")}},x:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return Gs(i);case"xxxx":case"xx":return qs(i);default:return qs(i,":")}},O:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ws(i,":");default:return"GMT"+qs(i,":")}},z:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ws(i,":");default:return"GMT"+qs(i,":")}},t:function(e,t,n,r){var i=r._originalDate||e;return Ls(Math.floor(i.getTime()/1e3),t.length)},T:function(e,t,n,r){return Ls((r._originalDate||e).getTime(),t.length)}};function Ws(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;if(0===s)return n+String(i);var o=t||"";return n+String(i)+o+Ls(s,2)}function Gs(e,t){return e%60==0?(e>0?"-":"+")+Ls(Math.abs(e)/60,2):qs(e,t)}function qs(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e);return r+Ls(Math.floor(i/60),2)+n+Ls(i%60,2)}const Xs=Ks;var Ys=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Zs=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Js={p:Zs,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],i=r[1],s=r[2];if(!s)return Ys(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Ys(i,t)).replace("{{time}}",Zs(s,t))}};const Qs=Js;function eo(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var to=["D","DD"],no=["YY","YYYY"];function ro(e){return-1!==to.indexOf(e)}function io(e){return-1!==no.indexOf(e)}function so(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var oo={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};const ao=function(e,t,n){var r,i=oo[e];return r="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};const lo={date:Rt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Rt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Rt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})};var co={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};const ho=function(e,t,n,r){return co[e]};var uo={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Ut({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Ut({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Ut({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Ut({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Ut({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};const po=uo;var fo={ordinalNumber:qt({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:Gt({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Gt({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Gt({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Gt({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Gt({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};const mo={code:"en-US",formatDistance:ao,formatLong:lo,formatRelative:ho,localize:po,match:fo,options:{weekStartsOn:0,firstWeekContainsDate:1}};var go=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yo=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vo=/^'([^]*?)'?$/,bo=/''/g,wo=/[a-zA-Z]/;function xo(e,t,n){var r,i,s,o,a,l,c,d,h,u,p,f,m,g,y,v,b,w;Nt(2,arguments);var x=String(t),E=$t(),C=null!==(r=null!==(i=null==n?void 0:n.locale)&&void 0!==i?i:E.locale)&&void 0!==r?r:mo,S=Ft(null!==(s=null!==(o=null!==(a=null!==(l=null==n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null==n||null===(c=n.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==a?a:E.firstWeekContainsDate)&&void 0!==o?o:null===(h=E.locale)||void 0===h||null===(u=h.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==s?s:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var _=Ft(null!==(p=null!==(f=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n||null===(y=n.locale)||void 0===y||null===(v=y.options)||void 0===v?void 0:v.weekStartsOn)&&void 0!==m?m:E.weekStartsOn)&&void 0!==f?f:null===(b=E.locale)||void 0===b||null===(w=b.options)||void 0===w?void 0:w.weekStartsOn)&&void 0!==p?p:0);if(!(_>=0&&_<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var k=Lt(e);if(!ks(k))throw new RangeError("Invalid time value");var O=Ts(k,eo(k)),T={firstWeekContainsDate:S,weekStartsOn:_,locale:C,_originalDate:k},P=x.match(yo).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,Qs[t])(e,C.formatLong):e})).join("").match(go).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return function(e){var t=e.match(vo);if(!t)return e;return t[1].replace(bo,"'")}(r);var s=Xs[i];if(s)return null!=n&&n.useAdditionalWeekYearTokens||!io(r)||so(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!ro(r)||so(r,t,String(e)),s(O,r,C.localize,T);if(i.match(wo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("");return P}function Eo(e,t){Nt(2,arguments);var n=Cs(e),r=Cs(t),i=n.getTime()-eo(n),s=r.getTime()-eo(r);return Math.round((i-s)/864e5)}function Co(e){Nt(1,arguments);var t=Lt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function So(e,t){var n,r,i,s,o,a,l,c;Nt(1,arguments);var d=$t(),h=Ft(null!==(n=null!==(r=null!==(i=null!==(s=null==t?void 0:t.weekStartsOn)&&void 0!==s?s:null==t||null===(o=t.locale)||void 0===o||null===(a=o.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==r?r:null===(l=d.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Lt(e),p=u.getDay(),f=(p<h?7:0)+p-h;return u.setDate(u.getDate()-f),u.setHours(0,0,0,0),u}var _o=6048e5;function ko(e){Nt(1,arguments);var t=Lt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function Oo(e,t){return Nt(1,arguments),function(e,t,n){Nt(2,arguments);var r=So(e,n),i=So(t,n),s=r.getTime()-eo(r),o=i.getTime()-eo(i);return Math.round((s-o)/_o)}(ko(e),Co(e),t)+1}function To(e,t){Nt(2,arguments);var n=Lt(e),r=Ft(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function Po(e,t){Nt(2,arguments);var n=Lt(e),r=Lt(t);return n.getTime()<r.getTime()}function Io(e,t){Nt(2,arguments);var n=Lt(e),r=Lt(t);return n.getTime()>r.getTime()}function Mo(e,t){Nt(2,arguments);var n=Lt(e),r=Lt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function Ro(e,t){var n,r,i,s,o,a,l,c;Nt(1,arguments);var d=$t(),h=Ft(null!==(n=null!==(r=null!==(i=null!==(s=null==t?void 0:t.weekStartsOn)&&void 0!==s?s:null==t||null===(o=t.locale)||void 0===o||null===(a=o.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==r?r:null===(l=d.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=function(e){return Nt(1,arguments),Lt(e).getDate()}(e);if(isNaN(u))return NaN;var p=function(e){return Nt(1,arguments),Lt(e).getDay()}(Co(e)),f=h-p;f<=0&&(f+=7);var m=u-f;return Math.ceil(m/7)+1}function Ao(e,t,n){Nt(2,arguments);var r=So(e,n),i=So(t,n);return r.getTime()===i.getTime()}function No(e){return Nt(1,arguments),Lt(e).getHours()}function Do(e,t){return Nt(2,arguments),Os(e,36e5*Ft(t))}function Lo(e){Nt(1,arguments);var t=Lt(e);return t.setHours(23,59,59,999),t}Math.pow(10,8);var Fo=6e4,jo=36e5;var $o={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},Bo="trunc";function Vo(e,t,n){Nt(2,arguments);var r=function(e,t){return Nt(2,arguments),Lt(e).getTime()-Lt(t).getTime()}(e,t)/jo;return function(e){return e?$o[e]:$o[Bo]}(null==n?void 0:n.roundingMethod)(r)}function zo(e,t){var n,r,i,s,o,a,l,c;Nt(1,arguments);var d=$t(),h=Ft(null!==(n=null!==(r=null!==(i=null!==(s=null==t?void 0:t.weekStartsOn)&&void 0!==s?s:null==t||null===(o=t.locale)||void 0===o||null===(a=o.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==r?r:null===(l=d.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Lt(e),p=u.getDay(),f=6+(p<h?-7:0)-(p-h);return u.setDate(u.getDate()+f),u.setHours(23,59,59,999),u}const Ho=function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s=Object.assign({},e);return s.date=t,n&&(s.start=n),r&&(s.end=r),s.allDay=i,s},Uo=(e,t,n)=>{const r=Lt(e),i=Lt(t),s=Lt(n);return r.getTime()<s.getTime()&&r.getTime()>=i.getTime()},Ko=(e,t)=>Po(new Date(e),new Date(t))?-1:1,Wo=e=>function(e){Nt(1,arguments);var t=Lt(e).getDay();return 0===t||6===t}(e),Go=()=>new Date,qo=e=>Math.round(1e3*e)/1e3,Xo=e=>(60*(60*No(e)+function(e){return Nt(1,arguments),Lt(e).getMinutes()}(e))+function(e){return Nt(1,arguments),Lt(e).getSeconds()}(e))/86400,Yo=e=>"allDay"in e&&e.allDay,Zo=e=>{const{start:t,end:n}=e;if(t||n)return t?e.end=Ss(t,Do(t,1))?Do(t,1):Lo(t):e.start=Ss(n,Do(n,-1))?Do(n,-1):Cs(n),e},Jo=e=>{const t=e.map((e=>e.topInd));return t.length?Math.max(...t)+1:1},Qo=(e,t,n,r,i,s)=>{const o=Go(),a=[];return[...Array(n).keys()].map((n=>{const l={},c=To(t,n);l.ind=n,l.date=c,l.dayString=xo(c,"d",{locale:i,weekStartsOn:s}),l.weekday=xo(c,"EEE",{locale:i,weekStartsOn:s}),l.isToday=Ss(c,o),l.isWeekend=Wo(c),"month"===r&&(l.isSameMonth=Mo(e,c),l.month=xo(c,"LLL",{locale:i})),a.push(l)})),a},ea=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"week",r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;const s=So(e,{weekStartsOn:i});return Qo(t||e,s,7,n,r,i)},ta=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const r=[],{start:i,end:s}=e;if(i&&s){const n=Eo(s,i);[...Array(n+1).keys()].map((n=>{r.push(Ho(e,To(i,n),null,null,t))}))}else{const o=i||s||n;r.push(Ho(e,Cs(o),null,null,t))}return r},na=(e,t,n,r)=>{const i=new Map;return e.forEach((e=>{let s;s=t in e?e[t]:Cs(r);const o=n?n(s).toString():s.toString();i.has(o)?i.get(o).push(e):i.set(o,[e])})),i},ra=(e,t,n)=>{const r=new Map;return[...e.keys()].map((i=>{const s=e.get(i),o=new Date(i);if(Uo(o,t,n))r.has(i)?r.set(i,[...r.get(i),...s]):r.set(i,s);else if(Po(n,o));else{const e=s.filter((e=>!e.end||!Po(e.end,t))),n=t.toString();r.has(n)?r.set(n,[...r.get(n),...e]):r.set(n,s)}})),r},ia=(e,t,n,r,i)=>{const s=Eo(r,n);return e.sort(((e,t)=>Ko(e.start,t.start))).forEach((e=>{const o=Object.assign({},e),{end:a}=e;let l;const c=Eo(t,n);let d=0;for(;Boolean(i[d])&&Boolean(i[d][c]);)d++;l=a?Uo(a,n,r)?Eo(a,t):Eo(r,t):0,o.leftPos=qo(Number(c)/s),o.width=Math.min(1-qo(Number(c)/s),qo(1*(l+1)/s)),o.topInd=d,[...Array(l+1).keys()].forEach((t=>{i[d]||(i[d]=[]),i[d][c+t]=t>0?e:o}))})),i};class sa extends c{constructor(e){super(Object.assign({},e))}init(){}destroy(){this.raf&&cancelAnimationFrame(this.raf)}initCurrTime(){const{showCurrTime:e,displayValue:t}=this.getProps();e&&Ss(t,Go())&&(this._adapter.updateShowCurrTime(),this.getCurrLocation())}notifyScrollHeight(e){this._adapter.updateScrollHeight(e)}closeCard(e,t){this._adapter.unregisterClickOutsideHandler(),this._adapter.notifyClose(e,t)}_getDate(){const{displayValue:e}=this.getProps();return e||Go()}showCard(e,t){this._adapter.unregisterClickOutsideHandler();const n=document.querySelector("body").clientWidth-e.target.getBoundingClientRect().right-110;this._adapter.openCard(t,n>0),this._adapter.registerClickOutsideHandler(t,(()=>{this.closeCard(null,t)}))}formatCbValue(e){const t=e.shift(),n=[t.getFullYear(),t.getMonth(),t.getDate(),...e];return new Date(...n)}getCurrLocation(){let e=null,t=Xo(Go());this._adapter.updateCurrPos(qo(t));const n=()=>{const r=Date.now();e||(e=r);r-e>3e4&&(t=Xo(Go()),this._adapter.updateCurrPos(qo(t)),e=r),this.raf=requestAnimationFrame(n)};this.raf=requestAnimationFrame(n)}getWeeklyData(e,t){const n={},{weekStartsOn:r}=this.getProps();return n.month=xo(e,"LLL",{locale:t,weekStartsOn:r}),n.week=ea(e,null,"week",t,r),this._adapter.setWeeklyData(n),n}getRangeData(e,t){const n={},{range:r,weekStartsOn:i}=this.getProps(),s=Eo(r[1],r[0]);n.month=xo(e,"LLL",{locale:t,weekStartsOn:i});const o=Cs(r[0]);return n.week=Qo(e,o,s,"week",t,i),this._adapter.setRangeData(n),n}getMonthlyData(e,t){const n=Co(e),r={},{weekStartsOn:i}=this.getProps(),s=Oo(e,{weekStartsOn:i});return[...Array(s).keys()].map((e=>{r[e]=ea(To(n,7*e),n,"month",t,i)})),this._adapter.setMonthlyData(r),r}_parseEvents(e){const t={allDay:[],day:[]};return e.map((e=>(e=>{const{start:t,end:n}=e;let r=[];if(Yo(e))return ta(e);if(t&&n)Po(t,n)||([e.start,e.end]=[e.end,e.start]),Ss(t,n)?r.push(Ho(e,Cs(t))):Math.abs(Vo(t,n))<24?(r.push(Ho(e,Cs(t),null,Lo(t))),r.push(Ho(e,Cs(n),Cs(n)))):r=r.concat(ta(e));else{const t=Zo(e);r.push(Ho(t,Cs(t.start)))}return r})(e))).forEach((e=>{e.forEach((e=>{e.allDay?t.allDay.push(e):t.day.push(e)}))})),t}getParseDailyEvents(e,t){t||(t=this._getDate());const n=this._parseEvents(e),{displayValue:r}=this.getProps(),i=Cs(t).toString();n.allDay=na(n.allDay,"date",Cs,r).get(i),n.day=na(n.day,"date",null,r).get(i),n.allDay||(n.allDay=[]),n.day||(n.day=[]),n.day=n.day.map((e=>(e=>{let t,n,{start:r,end:i,allDay:s,children:o}=e;if(Yo(e))t=0,n=0;else if(r&&i)Po(r,i)||([r,i]=[i,r]),t=Xo(r),n=Xo(i);else{const r=Zo(e);n=Xo(r.end),t=Xo(r.start)}return{startPos:qo(t),endPos:qo(n),children:o,allDay:Boolean(s)}})(e)));const s=n.day.reduce(((e,t)=>{const n=`${t.startPos}-${t.endPos}`;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),o={};return n.day=n.day.map((e=>{const t=`${e.startPos}-${e.endPos}`;let n=o[t];return o[t]=void 0===n?0:++n,e.left=0!==n?n/s[t].length*100+"%":0,e})),n}parseDailyEvents(){const{events:e,displayValue:t}=this.getProps(),n=this.getParseDailyEvents(e,t);this._adapter.setParsedEvents(n),this._adapter.cacheEventKeys(e.map((e=>e.key)))}_parseWeeklyEvents(e,t){const{weekStartsOn:n}=this.getProps();let r=[[]];const i=((e,t,n)=>ra(e,t,To(zo(t,{weekStartsOn:n}),1)))(e,t,n);return[...i.keys()].sort(((e,t)=>Ko(e,t))).forEach((e=>{const s=new Date(e),o=i.get(e).filter((e=>Ss(e.date,s)));r=((e,t,n,r,i)=>ia(e,t,n,To(zo(t,{weekStartsOn:i}),1),r))(o,s,t,r,n)})),r}_renderWeeklyAllDayEvent(e){const t=[];return e.forEach((e=>{const n=e.filter((e=>"leftPos"in e));t.push(...n)})),t}parseWeeklyAllDayEvents(e){const{week:t}=this._adapter.getWeeklyData(),n=t[0].date,r=this._parseWeeklyEvents(e,n);return this._renderWeeklyAllDayEvent(r)}getParsedWeeklyEvents(e){const t=this._parseEvents(e),{displayValue:n}=this.getProps(),r={};return r.allDay=na(t.allDay,"start",Cs,n),r.day=na(t.day,"date",null,n),r}parseWeeklyEvents(){const{events:e}=this.getProps(),t=this.getParsedWeeklyEvents(e);this._adapter.setParsedEvents(t),this._adapter.cacheEventKeys(e.map((e=>e.key)))}pushDayEventIntoWeekMap(e,t,n){t in n?n[t].push(e):n[t]=[e]}convertMapToArray(e,t){const n=[],r=new Map;for(const t of e.entries()){const[e,n]=t;r.set(e,n)}const i=this._parseWeeklyEvents(r,t);return n.push(...i),n}getParseMonthlyEvents(e){const t={},{displayValue:n,events:r,weekStartsOn:i}=this.getProps(),s=this._getDate(),o=Co(n),a=function(e){Nt(1,arguments);var t=Lt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}(n),l=[];return r.sort(((e,t)=>Po(e.start,t.start)?-1:Io(e.start,t.start)?1:0)).forEach((e=>{const t=ta(e,e.allDay,s);l.push(...t)})),l.filter((e=>Mo(e.date,n))),l.forEach((e=>{if(Mo(e.date,n)){const n=Ro(e.date,{weekStartsOn:i})-1;this.pushDayEventIntoWeekMap(e,n,t)}else if(Po(e.date,o))Ao(e.date,o,{weekStartsOn:i})&&this.pushDayEventIntoWeekMap(e,0,t);else if(Io(e.date,a)){if(Ao(e.date,a,{weekStartsOn:i})){const n=Ro(a,{weekStartsOn:i})-1;this.pushDayEventIntoWeekMap(e,n,t)}}else;})),Object.keys(t).forEach((e=>{const n=t[e];t[e]={};const r=So(n[0].date,{weekStartsOn:i}),s=na(n,"start",Cs),o=this.convertMapToArray(s,r);t[e].day=(e=>{const t={};return e.forEach(((e,n)=>{e.forEach(((e,r)=>{t[r]||(t[r]=[]),t[r][n]=e}))})),t})(o),t[e].display=this._renderDisplayEvents(o)})),t}parseMonthlyEvents(e){const{events:t}=this.getProps(),n=this.getParseMonthlyEvents(e);this._adapter.setParsedEvents(n),this._adapter.setItemLimit(e),this._adapter.cacheEventKeys(t.map((e=>e.key)))}_renderDisplayEvents(e){let t=e.slice();return t.length&&(t=this._renderWeeklyAllDayEvent(t)),t}_parseRangeEvents(e){let t=[[]];const[n,r]=this.getProp("range"),i=ra(e,n,r);return[...i.keys()].sort(((e,t)=>Ko(e,t))).forEach((e=>{const s=new Date(e),o=i.get(e).filter((e=>Ss(e.date,s)));t=ia(o,s,n,r,t)})),t}_renderRangeAllDayEvent(e){let t=[];return e.forEach((e=>{const n=e.filter((e=>"leftPos"in e));t=[...t,...n]})),t}parseRangeAllDayEvents(e){const t=this._parseRangeEvents(e);return this._renderRangeAllDayEvent(t)}getParsedRangeEvents(e){const t=this._parseEvents(e),[n]=this.getProp("range");return t.allDay=na(t.allDay,"start",Cs,n),t.day=na(t.day,"date",null,n),t}parseRangeEvents(){const{events:e}=this.getProps(),t=this.getParsedRangeEvents(e);this._adapter.setParsedEvents(t),this._adapter.cacheEventKeys(e.map((e=>e.key)))}checkWeekend(e){return Wo(e)}}const oa=`${C}-calendar`;__webpack_require__("6JrO");const aa=`${oa}-grid`;function la(e){return e<10?`0${e.toString()}`:e.toString()}class ca extends f{constructor(e){super(e),this.renderEvents=()=>{const{events:e,scrollHeight:t,minEventHeight:n}=this.props,r=e.map(((e,r)=>{const{startPos:i,endPos:s,children:o,key:a,left:l=0}=e,c=i*t,d=(s-i)*t,u={top:`${c}px`,height:`${Math.max(n,d)}px`,left:l};return h().createElement("li",{className:`${oa}-event-item ${oa}-event-day`,style:u,key:a||`${c}-${r}`},o)}));return r},this.renderCurrTime=()=>{const{currPos:e}=this.state,{scrollHeight:t}=this.props,n=e,r={top:e*t},i=h().createElement("div",{className:`${aa}-curr-circle`,style:r}),s=h().createElement("div",{className:`${aa}-curr-line`,style:r});return h().createElement(h().Fragment,{key:n},i,s)},this.handleClick=(e,t)=>{this.props.handleClick(e,t)},this.renderGrid=()=>{const e=!!this.props.showCurrTime&&this.state.showCurrTime,{displayValue:t,isWeekend:n,dateGridRender:r}=this.props,i=w()(`${aa}-skeleton`,{[`${oa}-weekend`]:n});return h().createElement("div",{className:`${aa}`,role:"presentation"},h().createElement("div",{role:"gridcell",className:`${aa}-content`},e?this.renderCurrTime():null,h().createElement("ul",{role:"row",className:i},[...Array(25).keys()].map((e=>{const n=w()({[`${aa}-skeleton-row-line`]:!0});return h().createElement(h().Fragment,{key:`${e}-daycol`},h().createElement("li",{"data-time":`${la(e)}:00:00`,className:n,onClick:n=>this.handleClick(n,[t,e,0,0])}),h().createElement("li",{"data-time":`${la(e)}:30:00`,onClick:n=>this.handleClick(n,[t,e,30,0])}))}))),r&&r(t.toString(),t),h().createElement("ul",{className:`${oa}-event-items`},this.renderEvents())))},this.state={currPos:0,showCurrTime:!1},this.foundation=new sa(this.adapter)}componentDidMount(){this.foundation.init(),this.foundation.initCurrTime()}componentWillUnmount(){this.foundation.destroy()}get adapter(){return Object.assign(Object.assign({},super.adapter),{updateCurrPos:e=>{this.setState({currPos:e})},updateShowCurrTime:()=>{this.setState({showCurrTime:!0})}})}render(){return this.renderGrid()}}ca.propTypes={events:E().array,displayValue:E().instanceOf(Date),showCurrTime:E().bool,scrollHeight:E().number,currPos:E().number,handleClick:E().func,mode:E().string,minEventHeight:E().number,isWeekend:E().bool,dateGridRender:E().func},ca.defaultProps={events:[],showCurrTime:!0,scrollHeight:0,currPos:0,mode:"dayCol",minEventHeight:Number.MIN_SAFE_INTEGER},ca.contextType=Pt;const da=`${oa}-time`;class ha extends d.PureComponent{formatTime(e){const{renderTimeDisplay:t}=this.props;if("function"==typeof t)return t(e);{const t=(e,t)=>e.replace("${time}",String(t));return h().createElement(Jt,{componentName:"Calendar",key:`locale-${e}`},(n=>{let r=e<12?t(n.AM,e):t(n.PM,e-12);return 12===e&&(r=t(n.PM,e)),r}))}}renderTime(){const{className:e}=this.props,t=w()(e,`${da}`),n=[...Array(24).keys()].map((e=>this.formatTime(e)));n.splice(0,1,"");const r=n.map(((e,t)=>h().createElement("li",{key:`time-${t}`,className:`${da}-item`},h().createElement("span",null,e))));return h().createElement("div",{className:t},h().createElement("ul",{className:`${da}-items`},r))}render(){return this.renderTime()}}ha.propTypes={className:E().string,renderTimeDisplay:E().func},ha.contextType=Pt;const ua=`${oa}-day`;class pa extends f{constructor(e){super(e),this.checkWeekend=e=>this.foundation.checkWeekend(e),this.renderAllDayEvents=e=>{if(this.props.allDayEventsRender)return this.props.allDayEventsRender(this.props.events);const t=e.map(((e,t)=>{const{children:n,key:r}=e;return h().createElement("li",{className:`${oa}-event-item ${oa}-event-allday`,key:r||`allDay-${t}`},n)}));return t},this.handleClick=(e,t)=>{const{onClick:n}=this.props,r=this.foundation.formatCbValue(t);n&&n(e,r)},this.renderAllDay=e=>{const t=`${oa}-all-day`,n=w()(`${t}-content`,{[`${oa}-weekend`]:this.isWeekend});return h().createElement(Jt,{componentName:"Calendar"},(r=>h().createElement("div",{className:`${t}`},h().createElement("ul",{className:`${oa}-tag ${t}-tag ${ua}-sticky-left`},h().createElement("span",null,r.allDay)),h().createElement("div",{role:"gridcell",className:n},h().createElement("ul",{className:`${oa}-event-items`},this.renderAllDayEvents(e))))))},this.foundation=new sa(this.adapter),this.state={scrollHeight:0,parsedEvents:{day:[],allDay:[]},cachedKeys:[]},this.dom=h().createRef(),this.scrollDom=h().createRef(),this.isWeekend=!1}get adapter(){return Object.assign(Object.assign({},super.adapter),{updateScrollHeight:e=>{this.setState({scrollHeight:e})},setParsedEvents:e=>{this.setState({parsedEvents:e})},cacheEventKeys:e=>{this.setState({cachedKeys:e})}})}componentDidMount(){this.foundation.init();const{scrollHeight:e}=this.scrollDom.current;this.dom.current.scrollTop=this.props.scrollTop,this.foundation.notifyScrollHeight(e),this.foundation.parseDailyEvents()}componentDidUpdate(e,t){const n=t.cachedKeys,r=this.props.events.map((e=>e.key));Oe()(n,r)&&Oe()(e.displayValue,this.props.displayValue)||this.foundation.parseDailyEvents()}componentWillUnmount(){this.foundation.destroy()}render(){const{dateGridRender:e,displayValue:t,showCurrTime:n,renderTimeDisplay:r,markWeekend:i,className:s,height:o,width:a,style:l,header:c,minEventHeight:d}=this.props,u=w()(ua,s),p=Object.assign({height:o,width:a},l),{parsedEvents:f,scrollHeight:m}=this.state;return this.isWeekend=i&&this.checkWeekend(t),h().createElement("div",Object.assign({className:u,style:p,ref:this.dom},this.getDataAttr(this.props)),h().createElement("div",{className:`${ua}-sticky-top`},c,this.renderAllDay(f.allDay)),h().createElement("div",{className:`${ua}-scroll-wrapper`},h().createElement("div",{className:`${ua}-scroll`,ref:this.scrollDom},h().createElement(ha,{className:`${ua}-sticky-left`,renderTimeDisplay:r}),h().createElement(ca,{events:f.day,displayValue:t,scrollHeight:m,handleClick:this.handleClick,showCurrTime:n,isWeekend:this.isWeekend,minEventHeight:d,dateGridRender:e}))))}}pa.propTypes={displayValue:E().instanceOf(Date),events:E().array,header:E().node,showCurrTime:E().bool,onClick:E().func,mode:E().string,renderTimeDisplay:E().func,markWeekend:E().bool,minEventHeight:E().number,scrollTop:E().number,width:E().oneOfType([E().number,E().string]),height:E().oneOfType([E().number,E().string]),style:E().object,className:E().string,dateGridRender:E().func,allDayEventsRender:E().func},pa.defaultProps={events:[],displayValue:new Date,mode:"day"},pa.contextType=Pt;const fa=e=>`${e<1?100*e:100}%`,ma=`${oa}-week`,ga=`${oa}-all-day`;class ya extends f{constructor(e){super(e),this.checkWeekend=e=>this.foundation.checkWeekend(e),this.handleClick=(e,t)=>{const{onClick:n}=this.props,r=this.foundation.formatCbValue(t);n&&n(e,r)},this.renderDayGrid=()=>{const{parsedEvents:e}=this.state,t=e.day,{week:n}=this.weeklyData,{markWeekend:r,dateGridRender:i,minEventHeight:s}=this.props;return n.map((e=>{const n=e.date.toString(),o=t.has(n)?t.get(n):[],a=this.foundation.getParseDailyEvents(o,e.date);return h().createElement(ca,{key:`${n}-weekday`,displayValue:e.date,scrollHeight:this.state.scrollHeight,handleClick:this.handleClick,events:a.day,showCurrTime:this.props.showCurrTime,isWeekend:r&&e.isWeekend,dateGridRender:i,minEventHeight:s})}))},this.renderHeader=e=>{const{markWeekend:t,displayValue:n,renderDateDisplay:r}=this.props,{month:i,week:s}=this.foundation.getWeeklyData(n,e);return h().createElement("div",{className:`${ma}-header`},h().createElement("ul",{className:`${oa}-tag ${ma}-tag ${ma}-sticky-left`},h().createElement("span",null,i)),h().createElement("div",{role:"gridcell",className:`${ma}-grid`},h().createElement("ul",{className:`${ma}-grid-row`},s.map((e=>{const{date:n,dayString:i,weekday:s,isToday:o}=e,a=w()({[`${oa}-today`]:o,[`${oa}-weekend`]:t&&e.isWeekend}),l=r?r(n):h().createElement(d.Fragment,null,h().createElement("span",{className:`${oa}-today-date`},i),h().createElement("span",null,s));return h().createElement("li",{key:`${n.toString()}-weekheader`,className:a},l)})))))},this.renderAllDayEvents=e=>{if(this.props.allDayEventsRender)return this.props.allDayEventsRender(this.props.events);const t=e.map(((e,t)=>{const{leftPos:n,width:r,topInd:i,children:s,key:o}=e,a=`${i}em`,l={left:fa(n),width:fa(r),top:a};return h().createElement("li",{className:`${oa}-event-item ${oa}-event-allday`,key:`allDay-${t}`,style:l},s)}));return t},this.renderAllDay=e=>{const{allDayEventsRender:t}=this.props,{allDay:n}=this.state.parsedEvents,r=this.foundation.parseWeeklyAllDayEvents(n),i=t?null:{height:`${Jo(r)}em`},{markWeekend:s}=this.props,{week:o}=this.weeklyData;return h().createElement("div",{className:`${ga}`,style:i},h().createElement("ul",{className:`${oa}-tag ${ga}-tag ${ma}-sticky-left`},h().createElement("span",null,e.allDay)),h().createElement("div",{role:"gridcell",className:`${oa}-content ${ga}-content`},h().createElement("ul",{className:`${ga}-skeleton`},Object.keys(o).map(((e,t)=>{const n=w()({[`${oa}-weekend`]:s&&o[e].isWeekend});return h().createElement("li",{key:`${e}-weekgrid`,className:n})}))),h().createElement("ul",{className:`${oa}-event-items`},this.renderAllDayEvents(r))))},this.state={scrollHeight:0,parsedEvents:{day:new Map,allDay:new Map},cachedKeys:[]},this.foundation=new sa(this.adapter),this.dom=h().createRef(),this.scrollDom=h().createRef(),this.handleClick=this.handleClick.bind(this),this.allDayRowHeight=1}get adapter(){return Object.assign(Object.assign({},super.adapter),{setWeeklyData:e=>{this.weeklyData=e},getWeeklyData:()=>this.weeklyData,updateScrollHeight:e=>{this.setState({scrollHeight:e})},setParsedEvents:e=>{this.setState({parsedEvents:e})},cacheEventKeys:e=>{this.setState({cachedKeys:e})}})}componentDidMount(){this.foundation.init();const{scrollHeight:e}=this.scrollDom.current;this.dom.current.scrollTop=this.props.scrollTop,this.foundation.notifyScrollHeight(e),this.foundation.parseWeeklyEvents()}componentDidUpdate(e,t){const n=t.cachedKeys,r=this.props.events.map((e=>e.key));Oe()(n,r)&&Oe()(e.displayValue,this.props.displayValue)||this.foundation.parseWeeklyEvents()}componentWillUnmount(){this.foundation.destroy()}render(){const{renderTimeDisplay:e,className:t,height:n,width:r,style:i,header:s}=this.props,o=w()(ma,t),a=Object.assign({height:n,width:r},i);return h().createElement(Jt,{componentName:"Calendar"},((t,n,r)=>h().createElement("div",Object.assign({className:o,style:a,ref:this.dom},this.getDataAttr(this.props)),h().createElement("div",{className:`${ma}-sticky-top`},s,this.renderHeader(r),this.renderAllDay(t)),h().createElement("div",{className:`${ma}-scroll-wrapper`},h().createElement("div",{className:`${ma}-scroll`,ref:this.scrollDom},h().createElement(ha,{className:`${ma}-sticky-left`,renderTimeDisplay:e}),this.renderDayGrid())))))}}ya.propTypes={displayValue:E().instanceOf(Date),header:E().node,events:E().array,mode:E().string,showCurrTime:E().bool,markWeekend:E().bool,scrollTop:E().number,renderTimeDisplay:E().func,renderDateDisplay:E().func,dateGridRender:E().func,allDayEventsRender:E().func,width:E().oneOfType([E().number,E().string]),height:E().oneOfType([E().number,E().string]),style:E().object,className:E().string},ya.defaultProps={displayValue:new Date,events:[],mode:"week"},ya.contextType=Pt;const va=e=>`${e<1?100*e:100}%`,ba=`${oa}-month`;class wa extends f{constructor(e){var t;super(e),t=this,this.calcItemLimit=()=>(this.contentCellHeight=this.cellDom.current.getBoundingClientRect().height,Math.max(0,Math.ceil((this.contentCellHeight-60)/24))),this.handleClick=(e,t)=>{const{onClick:n}=this.props,r=this.foundation.formatCbValue(t);n&&n(e,r)},this.showCard=(e,t)=>{this.foundation.showCard(e,t)},this.handleMoreClick=(e,t,n,r)=>{e.stopPropagation();const{onMoreClick:i}=this.props;this.showCard(e,t),i&&i(e,n,r)},this.renderHeader=e=>{const{markWeekend:t,displayValue:n}=this.props;return this.monthlyData=this.foundation.getMonthlyData(n,e),h().createElement("div",{className:`${ba}-header`,role:"presentation"},h().createElement("div",{role:"presentation",className:`${ba}-grid`},h().createElement("ul",{role:"row",className:`${ba}-grid-row`},this.monthlyData[0].map((e=>{const{weekday:n}=e,r=w()({[`${oa}-weekend`]:t&&e.isWeekend});return h().createElement("li",{role:"columnheader","aria-label":n,key:`${n}-monthheader`,className:r},h().createElement("span",null,n))})))))},this.renderEvents=e=>{const{itemLimit:t}=this.state;if(!e)return;const n=e.map(((e,n)=>{const{leftPos:r,width:i,topInd:s,key:o,children:a}=e,l={left:va(r),width:va(i),top:`${s}em`};return s<t?h().createElement("li",{className:`${oa}-event-item ${oa}-event-month`,key:o||`${n}-monthevent`,style:l},a):null}));return n},this.renderCollapsed=(e,t,n,r)=>{const{itemLimit:i,showCard:s}=this.state,{weekday:o,dayString:a,date:l}=t,c=l.toString(),d=e.filter((e=>Boolean(e))).length-i,u=`${ba}-event-card`,p=d>0,f=h().createElement(ji,{className:`${u}-close`,onClick:e=>this.closeCard(e,c),type:"tertiary",icon:h().createElement(Ji,null),theme:"borderless",size:"small"}),m=h().createElement("div",{className:`${u}-header-info`},h().createElement("div",{className:`${u}-header-info-weekday`},o),h().createElement("div",{className:`${u}-header-info-date`},a)),g=h().createElement("div",{className:u,ref:e=>this.optionContainerEl.set(c,e)},h().createElement("div",{className:`${u}-content`},h().createElement("div",{className:`${u}-header`},m,f),h().createElement("div",{className:`${u}-body`},h().createElement("ul",{className:`${u}-list`},e.map((e=>h().createElement("li",{key:e.key||`${e.start.toString()}-event`},e.children))))))),y=s&&s[c]?s[c][1]:"leftTopOver",v=h().createElement(Jt,{componentName:"Calendar"},(e=>h().createElement("div",{className:`${u}-wrapper`,style:{bottom:0},onClick:e=>this.handleMoreClick(e,c,l,d)},e.remaining.replace("${remained}",String(d)))));return h().createElement(Cn,{key:`${l.valueOf()}`,content:g,position:y,trigger:"custom",visible:s&&s[c]&&s[c][0],ref:e=>this.cardRef.set(c,e)},h().createElement("li",{key:l,className:n,onClick:e=>this.handleClick(e,[l])},this.formatDayString(l,r,a),p?v:null,this.renderCusDateGrid(l)))},this.formatDayString=(e,t,n)=>{const{renderDateDisplay:r}=this.props;return r?r(e):"1"===n?h().createElement(Jt,{componentName:"Calendar"},((e,r)=>h().createElement("span",{className:`${ba}-date`},t,h().createElement("span",{className:`${oa}-today-date`}," ",n),e.datestring))):h().createElement("span",{className:`${ba}-date`},h().createElement("span",{className:`${oa}-today-date`},n))},this.renderCusDateGrid=e=>{const{dateGridRender:t}=this.props;return t?t(e.toString(),e):null},this.renderWeekRow=function(e,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{markWeekend:i}=t.props,{itemLimit:s}=t.state,{display:o,day:a}=r;return h().createElement("div",{role:"presentation",className:`${ba}-weekrow`,ref:t.cellDom,key:`${e}-weekrow`},h().createElement("ul",{role:"row",className:`${ba}-skeleton`},n.map((e=>{const{date:n,dayString:r,isToday:o,isSameMonth:l,isWeekend:c,month:d,ind:u}=e,p=w()({[`${oa}-today`]:o,[`${oa}-weekend`]:i&&c,[`${ba}-same`]:l}),f=Boolean(a&&a[u]&&a[u].length>s),m=h().createElement("li",{role:"gridcell","aria-label":n.toLocaleDateString(),"aria-current":!!o&&"date",key:`${n}-weeksk`,className:p,onClick:e=>t.handleClick(e,[n])},t.formatDayString(n,d,r),t.renderCusDateGrid(n));return f?t.renderCollapsed(a[u],e,p,d):m}))),h().createElement("ul",{className:`${oa}-event-items`},o?t.renderEvents(o):null))},this.renderMonthGrid=()=>{const{parsedEvents:e}=this.state;return h().createElement("div",{role:"presentation",className:`${ba}-week`},h().createElement("ul",{role:"presentation",className:`${ba}-grid-col`},Object.keys(this.monthlyData).map((t=>this.renderWeekRow(t,this.monthlyData[t],e[t])))))},this.state={itemLimit:0,showCard:{},parsedEvents:{},cachedKeys:[]},this.cellDom=h().createRef(),this.foundation=new sa(this.adapter),this.handleClick=this.handleClick.bind(this),this.cardRef=new Map,this.optionContainerEl=new Map}get adapter(){return Object.assign(Object.assign({},super.adapter),{registerClickOutsideHandler:(e,t)=>{const n=n=>{const r=this.optionContainerEl&&this.optionContainerEl.get(e),i=n.target,s=n.composedPath&&n.composedPath()||[i];!r||r.contains(i)||s.includes(r)||t()};this.clickOutsideHandler=n,document.addEventListener("mousedown",n,!1)},unregisterClickOutsideHandler:()=>{document.removeEventListener("mousedown",this.clickOutsideHandler,!1)},setMonthlyData:e=>{this.monthlyData=e},getMonthlyData:()=>this.monthlyData,notifyClose:(e,t)=>{const n={};n[t]=[!1],this.setState((e=>({showCard:Object.assign(Object.assign({},e.showCard),n)}))),this.props.onClose&&this.props.onClose(e)},openCard:(e,t)=>{const n={},r=t?"leftTopOver":"rightTopOver";n[e]=[!0,r],this.setState((e=>({showCard:Object.assign({},n)})))},setParsedEvents:e=>{this.setState({parsedEvents:e})},setItemLimit:e=>{this.setState({itemLimit:e})},cacheEventKeys:e=>{this.setState({cachedKeys:e})}})}componentDidMount(){this.foundation.init();const e=this.calcItemLimit();this.foundation.parseMonthlyEvents(e)}componentWillUnmount(){this.foundation.destroy()}componentDidUpdate(e,t){const n=t.cachedKeys,r=this.props.events.map((e=>e.key));let i=!1,{itemLimit:s}=this.state;e.height!==this.props.height&&(s=this.calcItemLimit(),t.itemLimit!==s&&(i=!0)),Oe()(n,r)&&!i&&Oe()(e.displayValue,this.props.displayValue)||this.foundation.parseMonthlyEvents(s)}closeCard(e,t){this.foundation.closeCard(e,t)}render(){const{className:e,height:t,width:n,style:r,header:i}=this.props,s=w()(ba,e),o=Object.assign({height:t,width:n},r);return h().createElement(Jt,{componentName:"Calendar"},((e,t,n)=>h().createElement("div",Object.assign({role:"grid",className:s,key:this.state.itemLimit,style:o},this.getDataAttr(this.props)),h().createElement("div",{role:"presentation",className:`${ba}-sticky-top`},i,this.renderHeader(n)),h().createElement("div",{role:"presentation",className:`${ba}-grid-wrapper`},this.renderMonthGrid()))))}}wa.propTypes={displayValue:E().instanceOf(Date),header:E().node,events:E().array,mode:E().string,markWeekend:E().bool,width:E().oneOfType([E().number,E().string]),height:E().oneOfType([E().number,E().string]),style:E().object,className:E().string,dateGridRender:E().func,onClick:E().func,onClose:E().func,onMoreClick:E().func},wa.defaultProps={displayValue:new Date,events:[],mode:"month"},wa.contextType=Pt;const xa=e=>`${e<1?100*e:100}%`,Ea=`${oa}-week`,Ca=`${oa}-all-day`;class Sa extends f{constructor(e){super(e),this.handleClick=(e,t)=>{const{onClick:n}=this.props,r=this.foundation.formatCbValue(t);n&&n(e,r)},this.renderDayGrid=()=>{const{parsedEvents:e}=this.state,t=e.day,{week:n}=this.RangeData,{markWeekend:r,dateGridRender:i,minEventHeight:s}=this.props;return n.map((e=>{const n=e.date.toString(),o=t.has(n)?t.get(n):[],a=this.foundation.getParseDailyEvents(o,e.date);return h().createElement(ca,{key:`${n}-weekday`,displayValue:e.date,scrollHeight:this.state.scrollHeight,handleClick:this.handleClick,events:a.day,showCurrTime:this.props.showCurrTime,isWeekend:r&&e.isWeekend,dateGridRender:i,minEventHeight:s})}))},this.renderHeader=e=>{const{markWeekend:t,range:n,renderDateDisplay:r}=this.props,{month:i,week:s}=this.foundation.getRangeData(n[0],e);return h().createElement("div",{className:`${Ea}-header`},h().createElement("ul",{className:`${oa}-tag ${Ea}-tag ${Ea}-sticky-left`},h().createElement("span",null,i)),h().createElement("div",{role:"gridcell",className:`${Ea}-grid`},h().createElement("ul",{className:`${Ea}-grid-row`},s.map((e=>{const{date:n,dayString:i,weekday:s,isToday:o}=e,a=w()({[`${oa}-today`]:o,[`${oa}-weekend`]:t&&e.isWeekend}),l=r?r(n):h().createElement(d.Fragment,null,h().createElement("span",{className:`${oa}-today-date`},i),h().createElement("span",null,s));return h().createElement("li",{key:`${n.toString()}-weekheader`,className:a},l)})))))},this.renderAllDayEvents=e=>{if(this.props.allDayEventsRender)return this.props.allDayEventsRender(this.props.events);const t=e.map(((e,t)=>{const{leftPos:n,width:r,topInd:i,children:s}=e,o=`${i}em`,a={left:xa(n),width:xa(r),top:o};return h().createElement("li",{className:`${oa}-event-item ${oa}-event-allday`,key:`allDay-${t}`,style:a},s)}));return t},this.renderAllDay=e=>{const{allDayEventsRender:t}=this.props,{allDay:n}=this.state.parsedEvents,r=this.foundation.parseRangeAllDayEvents(n),i=t?null:{height:`${Jo(r)}em`},{markWeekend:s}=this.props,{week:o}=this.RangeData;return h().createElement("div",{className:`${Ca}`,style:i},h().createElement("ul",{className:`${oa}-tag ${Ca}-tag ${Ea}-sticky-left`},h().createElement("span",null,e.allDay)),h().createElement("div",{role:"gridcell",className:`${oa}-content ${Ca}-content`},h().createElement("ul",{className:`${Ca}-skeleton`},Object.keys(o).map(((e,t)=>{const n=w()({[`${oa}-weekend`]:s&&o[e].isWeekend});return h().createElement("li",{key:`${e}-weekgrid`,className:n})}))),h().createElement("ul",{className:`${oa}-event-items`},this.renderAllDayEvents(r))))},this.state={scrollHeight:0,parsedEvents:{day:new Map,allDay:new Map},cachedKeys:[]},this.foundation=new sa(this.adapter),this.dom=h().createRef(),this.scrollDom=h().createRef(),this.handleClick=this.handleClick.bind(this),this.allDayRowHeight=1}get adapter(){return Object.assign(Object.assign({},super.adapter),{setRangeData:e=>{this.RangeData=e},getRangeData:()=>this.RangeData,updateScrollHeight:e=>{this.setState({scrollHeight:e})},setParsedEvents:e=>{this.setState({parsedEvents:e})},cacheEventKeys:e=>{this.setState({cachedKeys:e})}})}componentDidMount(){this.foundation.init();const{scrollHeight:e}=this.scrollDom.current;this.dom.current.scrollTop=this.props.scrollTop,this.foundation.notifyScrollHeight(e),this.foundation.parseRangeEvents()}componentDidUpdate(e,t){const n=t.cachedKeys,r=this.props.events.map((e=>e.key));Oe()(n,r)&&Oe()(e.range,this.props.range)||this.foundation.parseRangeEvents()}componentWillUnmount(){this.foundation.destroy()}render(){const{renderTimeDisplay:e,className:t,height:n,width:r,style:i,header:s}=this.props,o=w()(Ea,t),a=Object.assign({height:n,width:r},i);return h().createElement(Jt,{componentName:"Calendar"},((t,n,r)=>h().createElement("div",Object.assign({className:o,style:a,ref:this.dom},this.getDataAttr(this.props)),h().createElement("div",{className:`${Ea}-sticky-top`},s,this.renderHeader(r),this.renderAllDay(t)),h().createElement("div",{className:`${Ea}-scroll-wrapper`},h().createElement("div",{className:`${Ea}-scroll`,ref:this.scrollDom},h().createElement(ha,{className:`${Ea}-sticky-left`,renderTimeDisplay:e}),this.renderDayGrid())))))}}Sa.propTypes={range:E().array,header:E().node,events:E().array,mode:E().string,showCurrTime:E().bool,markWeekend:E().bool,scrollTop:E().number,renderTimeDisplay:E().func,renderDateDisplay:E().func,dateGridRender:E().func,allDayEventsRender:E().func,width:E().oneOfType([E().number,E().string]),height:E().oneOfType([E().number,E().string]),style:E().object,className:E().string},Sa.defaultProps={events:[],mode:"range"},Sa.contextType=Pt;var _a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class ka extends f{render(){const e=this.props,{mode:t}=e,n=_a(e,["mode"]),r={month:h().createElement(wa,null),week:h().createElement(ya,null),day:h().createElement(pa,null),range:h().createElement(Sa,null)};return h().cloneElement(r[t],Object.assign({},n))}}ka.propTypes={displayValue:E().instanceOf(Date),header:E().node,events:E().arrayOf(E().shape({allDay:E().bool,start:E().instanceOf(Date),end:E().instanceOf(Date),key:E().string.isRequired,children:E().node})),mode:E().string,showCurrTime:E().bool,weekStartsOn:E().number,scrollTop:E().number,onClick:E().func,renderTimeDisplay:E().func,renderDateDisplay:E().func,markWeekend:E().bool,minEventHeight:E().number,width:E().oneOfType([E().number,E().string]),height:E().oneOfType([E().number,E().string]),style:E().object,className:E().string},ka.defaultProps={events:[],displayValue:new Date,showCurrTime:!0,mode:"week",markWeekend:!1,height:600,scrollTop:400,weekStartsOn:0};const Oa=ka,Ta={PREFIX:`${C}-card`},Pa=["hover","always"],Ia=["grid"];__webpack_require__("x365");var Ma=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Ra=Ta.PREFIX;class Aa extends d.PureComponent{render(){const e=this.props,{avatar:t,className:n,description:r,style:i,title:s}=e,o=Ma(e,["avatar","className","description","style","title"]),a=w()(`${Ra}-meta`,n),l=t&&h().createElement("div",{className:`${Ra}-meta-avatar`},t),c=s&&h().createElement("div",{className:`${Ra}-meta-wrapper-title`},s),d=r&&h().createElement("div",{className:`${Ra}-meta-wrapper-description`},r),u=s||r?h().createElement("div",{className:`${Ra}-meta-wrapper`},c,d):null;return h().createElement("div",Object.assign({},o,{className:a,style:i}),l,u)}}Aa.propTypes={avatar:E().node,className:E().string,description:E().node,style:E().object,title:E().node};const Na=Aa,Da={PREFIX:`${C}-skeleton`};__webpack_require__("XJMB");var La=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Fa=Kr.SIZE,ja=Kr.SHAPE,$a=e=>t=>n=>h().createElement(t,Object.assign({type:e},n));class Ba extends d.PureComponent{render(){const e=this.props,{prefixCls:t,className:n,type:r,size:i,shape:s}=e,o=La(e,["prefixCls","className","type","size","shape"]),a=w()(n,`${t}-${r}`,{[`${t}-${r}-${i}`]:"AVATAR"===r.toUpperCase()},{[`${t}-${r}-${s}`]:"AVATAR"===r.toUpperCase()});return h().createElement("div",Object.assign({className:a},o))}}Ba.propTypes={type:E().string,prefixCls:E().string,style:E().object,className:E().string,size:E().oneOf(Fa),shape:E().oneOf(ja)},Ba.defaultProps={prefixCls:Da.PREFIX,size:"medium",shape:"circle"};const Va=$a("avatar")(Ba),za=$a("image")(Ba),Ha=$a("title")(Ba),Ua=$a("button")(Ba);class Ka extends d.PureComponent{render(){const{prefixCls:e,className:t,style:n,rows:r}=this.props,i=w()(t,`${e}-paragraph`);return h().createElement("ul",{className:i,style:n},[...Array(r)].map(((e,t)=>h().createElement("li",{key:t}))))}}Ka.propTypes={rows:E().number,prefixCls:E().string,style:E().object,className:E().string},Ka.defaultProps={prefixCls:Da.PREFIX,rows:4};var Wa=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Ga=Da.PREFIX;class qa extends d.PureComponent{render(){const e=this.props,{placeholder:t,active:n,children:r,className:i,loading:s,style:o}=e,a=Wa(e,["placeholder","active","children","className","loading","style"]),l=w()(Ga,{[`${Ga}-active`]:Boolean(n)},i);let c;return c=s?h().createElement("div",Object.assign({className:l,style:o},a,{"x-semi-prop":"placeholder"}),t):r,c}}qa.Avatar=Va,qa.Title=Ha,qa.Button=Ua,qa.Paragraph=Ka,qa.Image=za,qa.defaultProps={loading:!0},qa.propTypes={active:E().bool,placeholder:E().node,style:E().object,className:E().string,loading:E().bool,children:E().node};const Xa=qa,Ya={PREFIX:`${C}-space`},Za=["start","end","center","baseline"],Ja="loose",Qa="medium",el="tight";__webpack_require__("bwAj");const tl=e=>{let t=[];return h().Children.forEach(e,(e=>{null!=e&&(Array.isArray(e)?t=t.concat(tl(e)):(0,d.isValidElement)(e)&&e.type&&"Symbol(react.fragment)"===e.type.toString()&&e.props?t=t.concat(tl(e.props.children)):t.push(e))})),t},nl=Ya.PREFIX;class rl extends d.PureComponent{render(){const{children:e=null,style:t,className:n,spacing:r,wrap:i,align:s,vertical:o}=this.props,a=(!i||!o)&&i,l=Object.assign({},t);let c="",d="";xe()(r)?(c=r,d=r):er()(r)?(l.rowGap=r,l.columnGap=r):M()(r)&&(xe()(r[0])?c=r[0]:er()(r[0])&&(l.columnGap=`${r[0]}px`),xe()(r[1])?d=r[1]:er()(r[1])&&(l.rowGap=`${r[1]}px`));const p=w()(nl,n,{[`${nl}-align-${s}`]:s,[`${nl}-vertical`]:o,[`${nl}-horizontal`]:!o,[`${nl}-wrap`]:a,[`${nl}-tight-horizontal`]:c===el,[`${nl}-tight-vertical`]:d===el,[`${nl}-medium-horizontal`]:c===Qa,[`${nl}-medium-vertical`]:d===Qa,[`${nl}-loose-horizontal`]:c===Ja,[`${nl}-loose-vertical`]:d===Ja}),f=tl(e),m=u(this.props);return h().createElement("div",Object.assign({},m,{className:p,style:l,"x-semi-prop":"children"}),f)}}rl.propTypes={wrap:E().bool,align:E().oneOf(Za),vertical:E().bool,spacing:E().oneOfType([E().string,E().number,E().array]),children:E().node,style:E().object,className:E().string},rl.defaultProps={vertical:!1,wrap:!1,spacing:"tight",align:"center"};const il=rl;var sl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const ol=Ta.PREFIX;class al extends d.PureComponent{constructor(){super(...arguments),this.renderHeader=()=>{const{title:e,headerExtraContent:t,header:n,headerLine:r,headerStyle:i}=this.props,s=w()(`${ol}-header`,{[`${ol}-header-bordered`]:Boolean(r)}),o=w()(`${ol}-header-wrapper`),a=w()(`${ol}-header-wrapper-title`,{[`${ol}-header-wrapper-spacing`]:Boolean(t)});return n||t||e?h().createElement("div",{style:i,className:s},n||h().createElement("div",{className:o},t&&h().createElement("div",{className:`${ol}-header-wrapper-extra`,"x-semi-prop":"headerExtraContent"},t),e&&h().createElement("div",{className:a},xe()(e)?h().createElement(Un.Title,{heading:6,ellipsis:{showTooltip:!0,rows:1},"x-semi-prop":"title"},e):e))):null},this.renderCover=()=>{const{cover:e}=this.props,t=w()(`${ol}-cover`);return e&&h().createElement("div",{className:t,"x-semi-prop":"cover"},e)},this.renderBody=()=>{const{bodyStyle:e,children:t,actions:n,loading:r}=this.props,i=w()(`${ol}-body`),s=w()(`${ol}-body-actions`),o=w()(`${ol}-body-actions-item`),a=h().createElement("div",null,h().createElement(Xa.Title,null),h().createElement("br",null),h().createElement(Xa.Paragraph,{rows:3}));return h().createElement("div",{style:e,className:i},t&&h().createElement(Xa,{placeholder:a,loading:r,active:!0},t),Array.isArray(n)&&h().createElement("div",{className:s},h().createElement(il,{spacing:12},n.map(((e,t)=>h().createElement("div",{key:t,className:o,"x-semi-prop":`actions.${t}`},e))))))},this.renderFooter=()=>{const{footer:e,footerLine:t,footerStyle:n}=this.props,r=w()(`${ol}-footer`,{[`${ol}-footer-bordered`]:t});return e&&h().createElement("div",{style:n,className:r,"x-semi-prop":"footer"},e)}}render(){const e=this.props,{bordered:t,shadows:n,style:r,className:i}=e,s=sl(e,["bordered","shadows","style","className"]),o=W()(s,["actions","bodyStyle","cover","headerExtraContent","footer","footerLine","footerStyle","header","headerLine","headerStyle","loading","title"]),a=w()(ol,i,{[`${ol}-bordered`]:t,[`${ol}-shadows`]:n,[`${ol}-shadows-${n}`]:n});return h().createElement("div",Object.assign({},o,{"aria-busy":this.props.loading,className:a,style:r}),this.renderHeader(),this.renderCover(),this.renderBody(),this.renderFooter())}}al.Meta=Na,al.propTypes={actions:E().array,bodyStyle:E().object,bordered:E().bool,children:E().node,className:E().string,cover:E().node,footer:E().node,footerLine:E().bool,footerStyle:E().object,header:E().node,headerExtraContent:E().node,headerLine:E().bool,headerStyle:E().object,loading:E().bool,shadows:E().oneOf(Pa),style:E().object,title:E().node,"aria-label":E().string},al.defaultProps={bordered:!0,footerLine:!1,headerLine:!0,loading:!1};const ll=al;var cl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const dl=Ta.PREFIX;class hl extends d.PureComponent{render(){const e=this.props,{children:t,className:n,spacing:r,style:i,type:s}=e,o=cl(e,["children","className","spacing","style","type"]),a="grid"===s,l=w()(`${dl}-group`,n,{[`${dl}-group-grid`]:a});return h().createElement(il,Object.assign({spacing:a?0:r,wrap:!0,className:l,style:i},o),t)}}hl.propTypes={children:E().node,className:E().string,spacing:E().oneOfType([E().number,E().array]),style:E().object,type:E().oneOf(Ia)},hl.defaultProps={spacing:16};const ul=hl,pl=`${C}-carousel`,fl=`${C}-carousel-indicator`,ml=`${C}-carousel-content`,gl=`${C}-carousel-arrow`,yl=0,vl=2e3,bl=300,wl=["slide","fade"],xl=["left","right"],El=["columnar","line","dot"],Cl=["dark","primary","light"],Sl=["left","center","right"],_l=["always","hover"],kl=["small","medium"],Ol=["click","hover"];const Tl=class extends c{constructor(e){super(Object.assign({},e)),this._interval=null,this._forcePlay=!1}setForcePlay(e){this._forcePlay=e}play(e){this._interval&&clearInterval(this._interval),this._interval=setInterval((()=>{this.next()}),e)}stop(){this._interval&&clearInterval(this._interval)}goTo(e){const{activeIndex:t}=this.getStates(),n=this.getValidIndex(e);this._adapter.setIsReverse(t>n),this.getIsControlledComponent()?this._notifyChange(n):(this._notifyChange(n),this.handleNewActiveIndex(n))}next(){this.stop();const{activeIndex:e}=this.getStates(),t=this.getValidIndex(e+1);this._adapter.setIsReverse(!1),this.getIsControlledComponent()?this._notifyChange(t):(this._notifyChange(t),this.handleNewActiveIndex(t)),this.handleAutoPlay()}prev(){this.stop();const{activeIndex:e}=this.getStates(),t=this.getValidIndex(e-1);this._adapter.setIsReverse(!0),this.getIsControlledComponent()?this._notifyChange(t):(this._notifyChange(t),this.handleNewActiveIndex(t)),this.handleAutoPlay()}destroy(){this._unregisterInterval()}_unregisterInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_notifyChange(e){const{activeIndex:t,isInit:n}=this.getStates();n&&this._adapter.setIsInit(!1),t!==e&&(this._adapter.setPreActiveIndex(t),this._adapter.notifyChange(e,t))}getValidIndex(e){const t=this._adapter.getChildren();return(e+t.length)%t.length}getSwitchingTime(){const{autoPlay:e,speed:t}=this.getProps();return"boolean"===typeof e?vl+t:z()(e)?o()(e,"interval",vl)+t:t}getIsControlledComponent(){return this._isInProps("activeIndex")}handleAutoPlay(){const{autoPlay:e}=this.getProps();this._adapter.getChildren().length>1&&(!0===e||z()(e)||this._forcePlay)&&this.play(this.getSwitchingTime())}handleKeyDown(e){"ArrowLeft"===e.key&&this.prev(),"ArrowRight"===e.key&&this.next()}onIndicatorChange(e){const{activeIndex:t}=this.getStates();this._adapter.setIsReverse(t>e),this._notifyChange(e),this.getIsControlledComponent()||this.handleNewActiveIndex(e)}handleNewActiveIndex(e){const{activeIndex:t}=this.getStates();t!==e&&this._adapter.setNewActiveIndex(e)}getDefaultActiveIndex(){let e;const t=this.getProps();return"activeIndex"in t?e=t.activeIndex:"defaultActiveIndex"in t&&(e=t.defaultActiveIndex),e}};var Pl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class Il extends h().PureComponent{constructor(){super(...arguments),this.onIndicatorChange=e=>{this.props.onIndicatorChange(e)},this.handleIndicatorClick=e=>{const{trigger:t}=this.props;"click"===t&&this.onIndicatorChange(e)},this.handleIndicatorHover=e=>{const{trigger:t}=this.props;"hover"===t&&this.onIndicatorChange(e)}}renderIndicatorContent(){const{total:e,theme:t,size:n,activeIndex:r}=this.props,i=[];for(let s=0;s<e;s++)i.push(h().createElement("span",{key:s,"data-index":s,className:w()([`${fl}-item`],{[`${fl}-item-active`]:s===r,[`${fl}-item-${t}`]:t,[`${fl}-item-${n}`]:n}),onClick:()=>this.handleIndicatorClick(s),onMouseEnter:()=>this.handleIndicatorHover(s)}));return i}render(){const e=this.props,{type:t,size:n,theme:r,style:i,className:s,position:o}=e,a=Pl(e,["type","size","theme","style","className","position"]),l=w()(s,{[fl]:!0,[`${fl}-${t}`]:t,[`${fl}-${o}`]:o}),c=this.renderIndicatorContent();return h().createElement("div",Object.assign({className:l,style:i},u(a)),c)}}Il.propTypes={activeKey:E().number,className:E().string,position:E().oneOf(Sl),size:E().oneOf(kl),style:E().object,theme:E().oneOf(Cl),total:E().number,onIndicatorChange:E().func,type:E().oneOf(El),trigger:E().oneOf(Ol)};const Ml=Il;const Rl=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.28 4.24a1.5 1.5 0 0 1 0 2.12l-5.66 5.66 5.66 5.65a1.5 1.5 0 1 1-2.12 2.13l-6.72-6.72a1.5 1.5 0 0 1 0-2.12l6.72-6.72a1.5 1.5 0 0 1 2.12 0Z",fill:"currentColor"}))}),"chevron_left");const Al=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.44 19.8a1.5 1.5 0 0 1 0-2.13l5.66-5.65-5.66-5.66a1.5 1.5 0 1 1 2.12-2.12l6.72 6.72a1.5 1.5 0 0 1 0 2.12L9.56 19.8a1.5 1.5 0 0 1-2.12 0Z",fill:"currentColor"}))}),"chevron_right");class Nl extends h().PureComponent{constructor(){super(...arguments),this.renderLeftIcon=()=>o()(this.props,"arrowProps.leftArrow.children",h().createElement(Rl,{"aria-label":"Previous index",size:"inherit"})),this.renderRightIcon=()=>o()(this.props,"arrowProps.rightArrow.children",h().createElement(Al,{"aria-label":"Next index",size:"inherit"}))}render(){const{type:e,theme:t,prev:n,next:r}=this.props,i=w()({[gl]:!0,[`${gl}-${t}`]:t,[`${gl}-hover`]:"hover"===e}),s=w()({[`${gl}-prev`]:!0,[`${gl}-${t}`]:t}),a=w()({[`${gl}-next`]:!0,[`${gl}-${t}`]:t});return h().createElement("div",{className:i},h().createElement("div",Object.assign({className:s,onClick:n},o()(this.props,"arrowProps.leftArrow.props"),{"x-semi-prop":"arrowProps.leftArrow.children"}),this.renderLeftIcon()),h().createElement("div",Object.assign({className:a,onClick:r},o()(this.props,"arrowProps.rightArrow.props"),{"x-semi-prop":"arrowProps.rightArrow.children"}),this.renderRightIcon()))}}const Dl=Nl;__webpack_require__("Hoah");class Ll extends f{constructor(e){super(e),this.play=()=>(this.foundation.setForcePlay(!0),this.foundation.handleAutoPlay()),this.stop=()=>(this.foundation.setForcePlay(!1),this.foundation.stop()),this.goTo=e=>this.foundation.goTo(e),this.prev=()=>this.foundation.prev(),this.next=()=>this.foundation.next(),this.handleAutoPlay=()=>{this.foundation.getIsControlledComponent()||this.foundation.handleAutoPlay()},this.handleMouseEnter=()=>{const{autoPlay:e}=this.props;(!0===e||"object"==typeof e&&e.hoverToPause)&&this.foundation.stop()},this.handleMouseLeave=()=>{const{autoPlay:e}=this.props;"object"==typeof e&&!e.hoverToPause||this.foundation.getIsControlledComponent()||this.foundation.handleAutoPlay()},this.onIndicatorChange=e=>this.foundation.onIndicatorChange(e),this.getChildren=()=>{const{children:e}=this.props;return d.Children.toArray(e).filter((e=>h().isValidElement(e)))},this.getValidIndex=e=>this.foundation.getValidIndex(e),this.renderChildren=()=>{const{speed:e,animation:t}=this.props,{activeIndex:n,preIndex:r,isInit:i}=this.state,s=this.getChildren();return h().createElement(h().Fragment,null,s.map(((s,o)=>{const a=o===n,l=o===this.getValidIndex(n-1),c=o===this.getValidIndex(n+1),d={transitionTimingFunction:"ease",transitionDuration:`${e}ms`,animationTimingFunction:"ease",animationDuration:`${e}ms`};return h().cloneElement(s,{style:Object.assign(Object.assign({},s.props.style),d),className:w()(s.props.className,{[`${ml}-item-prev`]:l,[`${ml}-item-next`]:c,[`${ml}-item-current`]:a,[`${ml}-item`]:!0,[`${ml}-item-active`]:a,[`${ml}-item-slide-in`]:"slide"===t&&!i&&a,[`${ml}-item-slide-out`]:"slide"===t&&!i&&o===r})})})))},this.renderIndicator=()=>{const{activeIndex:e}=this.state,{showIndicator:t,indicatorType:n,theme:r,indicatorPosition:i,indicatorSize:s,trigger:o}=this.props,a=w()({[fl]:!0}),l=this.getChildren();return t&&l.length>1?h().createElement("div",{className:a},h().createElement(Ml,{type:n,total:l.length,activeIndex:e,position:i,trigger:o,size:s,theme:r,onIndicatorChange:this.onIndicatorChange})):null},this.renderArrow=()=>{const{showArrow:e,arrowType:t,theme:n,arrowProps:r}=this.props,i=this.getChildren();return e&&i.length>1?h().createElement(Dl,{type:t,theme:n,prev:this.prev,next:this.next,arrowProps:r}):null},this.foundation=new Tl(this.adapter);const t=this.foundation.getDefaultActiveIndex();this.state={activeIndex:t,preIndex:t,isReverse:!1,isInit:!0}}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyChange:(e,t)=>{this.props.onChange(e,t)},setNewActiveIndex:e=>{this.setState({activeIndex:e})},setPreActiveIndex:e=>{this.setState({preIndex:e})},setIsReverse:e=>{this.setState({isReverse:e})},setIsInit:e=>{this.setState({isInit:e})},getChildren:()=>this.getChildren()})}static getDerivedStateFromProps(e,t){const n={};return Re(e.activeIndex)||e.activeIndex===t.activeIndex||(n.activeIndex=e.activeIndex),n}componentDidMount(){this.handleAutoPlay()}componentWillUnmount(){this.foundation.destroy()}render(){const{animation:e,className:t,style:n,slideDirection:r}=this.props,{isReverse:i}=this.state,s=w()(t,{[pl]:!0});return h().createElement("div",Object.assign({className:s,style:n,onMouseEnter:v()(this.handleMouseEnter,400),onMouseLeave:v()(this.handleMouseLeave,400)},this.getDataAttr(this.props)),h().createElement("div",{className:w()([`${ml}-${e}`],{[`${ml}`]:!0,[`${ml}-reverse`]:"left"===r?i:!i}),"x-semi-prop":"children"},this.renderChildren()),this.renderIndicator(),this.renderArrow())}}Ll.propTypes={activeIndex:E().number,animation:E().oneOf(wl),arrowProps:E().object,autoPlay:E().oneOfType([E().bool,E().object]),className:E().string,defaultActiveIndex:E().number,indicatorPosition:E().oneOf(Sl),indicatorSize:E().oneOf(kl),indicatorType:E().oneOf(El),theme:E().oneOf(Cl),onChange:E().func,arrowType:E().oneOf(_l),showArrow:E().bool,showIndicator:E().bool,slideDirection:E().oneOf(xl),speed:E().number,style:E().object,trigger:E().oneOf(Ol)},Ll.defaultProps={children:[],animation:"slide",autoPlay:!0,arrowType:"always",defaultActiveIndex:yl,indicatorPosition:"center",indicatorSize:"small",indicatorType:"dot",theme:"light",onChange:()=>{},showArrow:!0,showIndicator:!0,slideDirection:"left",speed:bl,trigger:"click"};const Fl=Ll;var jl=__webpack_require__("/iLo"),$l=__webpack_require__.n(jl),Bl=__webpack_require__("qYhz"),Vl=__webpack_require__.n(Bl),zl=__webpack_require__("whR3"),Hl=__webpack_require__.n(zl),Ul=__webpack_require__("lKOy"),Kl=__webpack_require__.n(Ul),Wl=__webpack_require__("//nZ"),Gl=__webpack_require__.n(Wl),ql=__webpack_require__("LPC+"),Xl=__webpack_require__.n(ql),Yl=__webpack_require__("jLkM"),Zl=__webpack_require__.n(Yl);const Jl={PREFIX:`${C}-tree`,PREFIX_OPTION:`${C}-tree-option`},Ql=[!1,"click","doubleClick"],ec="_SEMI_TREE_SPLIT_";function tc(e,t){return`${e}-${t}`}function nc(e){return!be()(e)&&!_e()(e)}function rc(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=[],s=Boolean(r),a=o()(n,"key","key"),l=o()(n,"children","children");if(_e()(e))return[];return function e(o){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o.map(((d,h)=>{const u=tc(c?c.pos:"0",h),p=d[a],f={};n&&Object.entries(W()(n,"children")).forEach((e=>{let[t,n]=e;const r=d[n];!_e()(r)&&(f[t]=r)}));const m=Object.assign(Object.assign(Object.assign({},Gl()(d,["key","label","value","icon","disabled","isLeaf"])),f),{parent:c,pos:u,children:null,data:d,_innerDataTag:!0,isEnd:[...c?c.isEnd:[],h===o.length-1]}),g="boolean"==typeof r;return(!s||!g&&r.has(p))&&i.push(m),t.has(p)&&(!s||!g&&r.has(p))?m.children=e(d[l]||[],m):m.children=[],m}))}(e),i}function ic(e,t){const n={},r={},i={},s={posEntities:n,keyEntities:r,valueEntities:i},a=o()(t,"value","value");return function(e,t,n){const r=o()(n,"key","key"),i=o()(n,"children","children"),s=(n,a,l)=>{const c=n?n[i]:e,d=n?tc(l.pos,a):"0";if(n){const e=o()(n,r,null),i={data:Object.assign({},n),ind:a,pos:d,key:null!==e?e:d,parentPos:l.node?l.pos:null,level:Number(l.level)+1};t(i)}c&&c.forEach(((e,t)=>{s(e,t,{node:n,pos:d,level:l?Number(l.level)+1:-1})}))};s(null)}(e,(e=>{const{pos:t,key:s,parentPos:l}=e,c=Object.assign({},e),d=o()(c,`data.${a}`,null);null!==d&&(i[d]=s),n[t]=c,r[s]=c,c.parent=n[l],c.parent&&(c.parent.children=c.parent.children||[],c.parent.children.push(c))}),t),s}function sc(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!nc(e))return[];if(!n&&Array.isArray(e)?e=e.length?[e[0]]:[]:Array.isArray(e)||(e=[e]),Pe()(t))return e;const r=[];return e.forEach((e=>{e in t?r.push(t[e]):e&&r.push(e)})),r}function oc(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=[],i=e=>{if(!e)return;const{children:n}=e;nc(n)&&n.forEach((e=>{r.push(e.key),i(t[e.key])}))};return e.forEach((e=>{n&&r.push(e),i(t[e])})),r}function ac(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=[];e.forEach((e=>{t[e]&&t[e].parent&&r.push(t[e].parent.key)}));const i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=[];return e&&e.forEach((e=>{const i=t[e];i&&i.children&&i.children.forEach((e=>{n.length&&n.includes(e.key)||r.push(e.key)}))})),r}(Zl()(r),t,n?[]:e);return i}function lc(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=[],i=e=>{e.parent&&(r.push(e.parent.key),i(e.parent))};return e.forEach((e=>{t[e]&&i(t[e]),n&&r.push(e)})),r}function cc(e,t){const n=Array.isArray(e)?e:[e],r=oc(n,t,!0),i=new Set([...r]);let s=new Set([]),o=[];const a=function(e,t){const n={};return e.forEach((e=>{if(!t[e])return;const{level:r}=t[e];n[r]?n[r].push(e):n[r]=[e]})),n}(n,t),l=e=>{const{key:n,parent:r,level:l}=e;if(!r||o.includes(n))return;const c=ac([n],t);o=[...o,...c];if(c.every((e=>i.has(e))))i.add(r.key),l-1 in a&&l?a[l-1].push(r.key):a[l-1]=[r.key];else{const e=lc([n],t,!1);s=new Set([...s,...e])}};for(;!Pe()(a);){const e=Xl()(Object.keys(a).map((e=>Number(e))));a[e].forEach((e=>l(t[e]))),delete a[e]}return{checkedKeys:i,halfCheckedKeys:s}}function dc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(Array.isArray(e)||(e=[e]),n){const n=lc(e,t,!0);return new Set(n)}return new Set(e)}function hc(e,t,n,r){const i=sc(e,r,n);return new Set(lc(i,t,!1))}function uc(e,t,n){let r="show";const i=[...e],s=[...t];if(1!==Math.abs(i.length-s.length))return{motionType:r,motionKeys:[]};let o=[];return i.length>s.length?(r="hide",o=Kl()(i,s)):o=Kl()(s,i),{motionType:1===o.length?r:"show",motionKeys:1===o.length?oc(o,n,!1):[]}}function pc(e,t,n,r){if(!n)return!0;let i=n,s=t;return"boolean"==typeof n&&(i=(e,t)=>{const n=e.toLowerCase();return null==t?void 0:t.toString().toLowerCase().includes(n)}),r&&(s=t[r]),i(e,s,t)}function fc(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;const i=[],s=new Set(e);return n?e.forEach((e=>{t[e]&&!nc(t[e].children)&&i.push(e),!t[e]&&r&&i.push(e)})):e.forEach((e=>{if(!t[e])return void(r&&i.push(e));const{parent:n}=t[e];n&&s.has(n.key)||i.push(e)})),i}function mc(e,t,n){const r=[],i=e=>{n[e].children&&n[e].children.forEach((e=>{const{key:n}=e;r.push(n),t.has(n)&&i(n)}))};return i(e),r}function gc(e,t,n,r){const i=oc([e],t,!0),s=t[e];n=new Set([...n,e]);const o=e=>{if(!e.parent)return;const{key:i}=e;if(ac([i],t).every((e=>n.has(e)))){const t=e.parent;n.add(t.key),o(t)}else{const e=lc([i],t,!1);r=new Set([...r,...e])}};return o(s),{checkedKeys:new Set([...n,...i]),halfCheckedKeys:r}}function yc(e,t,n,r){const i=oc([e],t,!0),s=t[e];i.forEach((e=>{n.has(e)&&n.delete(e),r.has(e)&&r.delete(e)}));const o=e=>{const i=e.parent;if(!i)return;if(!n.has(i.key)&&!r.has(i.key))return;const{key:s}=e,a=ac([s],t).some((e=>n.has(e)||r.has(e))),l=lc([s],t,!1);a?l.forEach((e=>{n.has(e)&&(n.delete(e),r.add(e))})):(n.has(i.key)&&n.delete(i.key),r.has(i.key)&&r.delete(i.key),o(i))};return s&&o(s),{checkedKeys:n,halfCheckedKeys:r}}function vc(e){const{showFilteredOnly:t,keyEntities:n,inputValue:r,treeData:i,filterTreeNode:s,filterProps:o,prevExpandedKeys:a,keyMaps:l}=e;let c=[];c=Object.values(n).filter((e=>pc(r,e.data,s,o))).map((e=>e.key));let d=lc(c,n,!1);if(a.length){const e=a.filter((e=>Boolean(n[e])));d=d.concat(e)}const h=oc(c,n,!0),u=new Set([...h,...d]);return{flattenNodes:rc(i,new Set(d),l,t&&u),filteredKeys:new Set(c),filteredExpandedKeys:new Set(d),filteredShownKeys:u}}function bc(e,t){const n=o()(t,"value","value"),r=o()(t,"key","key");return Array.isArray(e)?e.map((e=>o()(e,n,e[r]))):o()(e,n,e[r])}function wc(e,t,n){return t&&nc(e)?bc(e,n):e}function xc(e,t){return[...e].filter((e=>e in t))}function Ec(e,t){const n=o()(t,"disabled","disabled"),r=Object.keys(e).filter((t=>e[t].data[n])),{checkedKeys:i}=cc(r,e);return i}function Cc(e,t){const{clientY:n}=e,{top:r,bottom:i,height:s}=t.nodeInstance.getBoundingClientRect();return n<=r+.45*s?-1:n>=i-.45*s?1:0}function Sc(e,t){return oc([e],t,!0)}function _c(e,t){const n=e.split("-");return t+Number(n[n.length-1])}const kc={PREFIX:`${C}-cascader`,PREFIX_OPTION:`${C}-cascader-option`},Oc=["small","large","default"],Tc=["success","default","error","warning"],Pc="click",Ic="hover",Mc="leafOnly",Rc="autoMergeValue",Ac="none",Nc="trigger",Dc="related",Lc="unRelated",Fc="_SEMI_CASCADER_SPLIT_";function jc(e){return e.join(Fc)}function $c(e,t){const n={};return function(e,t,n){const r=o()(n,"value","value"),i=o()(n,"children","children"),s=(o,a,l)=>{const c=o?o[i]:e;let d=null;if(o){const e=o[r],i=l?`${l.key}${Fc}${e}`:`${e}`,s=l?function(e,t){return`${e}-${t}`}(l.pos,a):`${a}`,c=Object.assign({},o);n&&Object.entries(n).forEach((e=>{let[t,n]=e;const r=o[n];_e()(r)||(c[t]=r)})),d={data:c,ind:a,key:i,pos:s,level:l?l.level+1:0,parentKey:l?l.key:null,path:l?[...l.path,i]:[i],valuePath:l?[...l.valuePath,e]:[e]},t(d)}c&&c.forEach(((e,t)=>{s(e,t,d)}))};s(null)}(e,(e=>{const{key:t,parentKey:r}=e,i=Object.assign({},e);n[t]=i,i.parent=n[r],i.parent&&(i.parent.children=i.parent.children||[],i.parent.children.push(i))}),t),n}function Bc(e,t){const n=o()(t,"value","value");return Array.isArray(e)?e.map((e=>o()(e,n))):o()(e,n)}function Vc(e,t){let n;return n=t?Mc:e?Rc:Ac,n}class zc extends c{constructor(e){super(Object.assign({},e)),this.handleKeyDown=e=>{if(e.key===ln){this.getState("isOpen")&&this.close(e)}},this.updateSearching=e=>{this._adapter.updateStates({isSearching:!1})},this.handleTagRemoveByKey=e=>{var t,n;const{keyEntities:r}=this.getStates(),{disabled:i}=this.getProps();if(i)return;const s=null!==(t=r[e])&&void 0!==t?t:{};!(null===(n=null==s?void 0:s.data)||void 0===n?void 0:n.disable)&&this._handleMultipleSelect(s),this._adapter.rePositionDropdown()},this.handleTagRemoveInTrigger=e=>{const{treeData:t}=this.getStates(),{keyMaps:n}=this.getProps(),r=function(e,t,n){const r=o()(n,"value","value"),i=o()(n,"children","children"),s=e.split("-").map((e=>Number(e)));let a=t;const l=[];return s.forEach(((e,t)=>{var n;a=0===t?a[e]:null===(n=null==a?void 0:a[i])||void 0===n?void 0:n[e],l.push(null==a?void 0:a[r])})),jc(l)}(e,t,n);this.handleTagRemoveByKey(r)}}init(){const e=this.getProp("open")||this.getProp("defaultOpen");this.collectOptions(!0),this._adapter.updateLoadingKeyRefValue(new Set),this._adapter.updateLoadedKeyRefValue(new Set),e&&!this._isDisabled()&&this.open()}_setEmptyContentMinWidth(){const{style:e}=this.getProps();let t;t=e&&er()(e.width)||e&&xe()(e.width)&&!e.width.includes("%")?e.width:this._adapter.getTriggerWidth(),this._adapter.setEmptyContentMinWidth(t)}destroy(){this._adapter.unregisterClickOutsideHandler()}_isDisabled(){return this.getProp("disabled")}_isFilterable(){return Boolean(this.getProp("filterTreeNode"))}_notifyChange(e){const{onChangeWithObject:t,multiple:n}=this.getProps(),r=t?[]:"value";if(n){const t=[];e.forEach((e=>{const n=this.getItemPropPath(e,r);t.push(n)})),this._adapter.notifyChange(t)}else{const t=_e()(e)||!("key"in e)?[]:this.getItemPropPath(e.key,r);this._adapter.notifyChange(t)}}_isLeaf(e){return this.getProp("loadData")?Boolean(e.isLeaf):!e.children||!e.children.length}_clearInput(){this._adapter.updateInputValue("")}_notifyBlur(e){this._adapter.notifyBlur(e)}_notifyFocus(e){this._adapter.notifyFocus(e)}_isOptionDisabled(e,t){return lc([e],t,!0).some((e=>t[e].data.disabled))}getItemPropPath(e,t,n){const r=n||this.getState("keyEntities"),i=r[e];let s=[];if(i)if(i._notExist)s=i.path;else{const e=i.path;s=Array.isArray(t)?e.map((e=>r[e].data)):e.map((e=>r[e].data[t]))}else;return s}_getCacheValue(e){const{selectedKeys:t}=this.getStates(),n=Array.from(t)[0];let r;if(Pe()(e[n]))if(Vl()(n,"not-exist-")){const t=n.match(/not-exist-(\S*)/)[1];r=Pe()(e[t])?t:e[t].valuePath}else r=n;else r=e[n].valuePath;return r}collectOptions(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{treeData:t,value:n,defaultValue:r,keyMaps:i}=this.getProps(),s=$c(t,i);let o;this._adapter.rePositionDropdown(),e?o=r:Pe()(s)||(o=this._getCacheValue(s));const a=this._isControlledComponent()?_e()(n)?[]:n:o;var l;l=a,be()(l)||_e()(l)?this._adapter.updateStates({keyEntities:s}):this.updateSelectedKey(a,s),this.recalculateFilteredKeys(void 0,s)}_calcFilteredKeys(e,t){if(!e)return[];const{treeNodeFilterProp:n,filterTreeNode:r,filterLeafOnly:i,remote:s,keyMaps:a}=this.getProps(),l="label"!==n?n:o()(a,"label","label"),c=Object.values(null!=t?t:this.getState("keyEntities"));return s?c.filter((e=>!e._notExist)).filter((e=>r&&!i||this._isLeaf(e.data))).map((e=>e.key)):c.filter((n=>{const{key:i,_notExist:s,data:o}=n;if(s)return!1;const a=this.getItemPropPath(i,l,t);return function(e,t,n,r){if(!n)return!0;let i,s=n;return"boolean"==typeof n?(s=(e,t)=>{const n=e.toLowerCase();return t.toLowerCase().includes(n)},i=r.join("")):i=r.join(),s(e,i,t)}(e,o,r,a)})).filter((e=>r&&!i||this._isLeaf(e.data))).map((e=>e.key))}recalculateFilteredKeys(e,t){if(!this._isFilterable())return;const n=this.getState("isSearching");if(_e()(e)&&!n)return;const r=_e()(e)?this.getState("inputValue"):e,i=this._calcFilteredKeys(r,t),s={isSearching:Boolean(r),filteredKeys:new Set(i)};t&&(s.keyEntities=t),this._adapter.updateStates(s),this._adapter.rePositionDropdown()}handleValueChange(e){const{keyEntities:t}=this.getStates();this.updateSelectedKey(e,t)}_getClearSelectedKey(e){const t={},{searchPlaceholder:n,placeholder:r,multiple:i}=this.getProps();return t.selectedKeys=new Set([]),t.activeKeys=new Set([]),t.filteredKeys=new Set([]),e&&!i&&(t.inputPlaceHolder=n||r||"",t.inputValue=""),t}updateSelectedKey(e,t){const{changeOnSelect:n,onChangeWithObject:r,multiple:i}=this.getProps(),{activeKeys:s,loading:o,keyEntities:a,selectedKeys:l}=this.getStates(),c=this._adapter.getLoadingKeyRefValue(),d=this._isFilterable(),h=[...s].filter((e=>c.has(e))),u=(p=e,Array.isArray(p)?p:[p]);var p;const f=this.getProp("keyMaps"),m=r&&z()(u[0])?Bc(u,f):u,g=function(e){return(null==e?void 0:e.length)?Array.isArray(e[0])?e.map((e=>jc(e))):[jc(e)]:[]}(m);let y={};const v=g.length>0?g[0]:void 0,b=v?t[v]:void 0;if(b)if(n||this._isLeaf(b.data)){if(y.selectedKeys=new Set([v]),h.length||(y.activeKeys=new Set(b.path)),d&&!i){const e=this.renderDisplayText(v,t);y.inputPlaceHolder=e}}else Oe()(g,Array.from(l))&&(y=this._getClearSelectedKey(d));else if(e&&e.length){const e=m[m.length-1],n=`not-exist-${e}`,r={data:{label:e,value:e},key:n,path:m,_notExist:!0};if(y.selectedKeys=new Set([n]),d&&!i){const e=this._defaultRenderText(m);y.inputPlaceHolder=e}t[n]=r}else{if(o||(null==c?void 0:c.size))return y.keyEntities=Hl()(a,t),void this._adapter.updateStates(y);y=this._getClearSelectedKey(d)}y.keyEntities=t,this._adapter.updateStates(y)}open(){const e=this._isFilterable(),{multiple:t}=this.getProps();this._adapter.openMenu(),e&&(this._clearInput(),!t&&this.toggle2SearchInput(!0)),this._isControlledComponent()&&this.reCalcActiveKeys(),this._adapter.notifyDropdownVisibleChange(!0),this._adapter.registerClickOutsideHandler((e=>this.close(e))),this._setEmptyContentMinWidth()}reCalcActiveKeys(){const{selectedKeys:e,activeKeys:t,keyEntities:n}=this.getStates(),r=n[[...e][0]];if(!r)return;const i=new Set(r.path);Oe()(i,t)||this._adapter.updateStates({activeKeys:i})}close(e,t){const{multiple:n}=this.getProps();if(this._adapter.closeMenu(),this._adapter.notifyDropdownVisibleChange(!1),this._adapter.unregisterClickOutsideHandler(),this._isFilterable()){const{selectedKeys:e,isSearching:r}=this.getStates();let i="";t&&!n?i=this.renderDisplayText(t):e.size&&!n&&(i=this.renderDisplayText([...e][0])),this._adapter.updateStates({inputValue:i,isSearching:!1}),!n&&this.toggle2SearchInput(!1),!n&&this._adapter.updateFocusState(!1)}this._notifyBlur(e)}focus(){const{filterTreeNode:e}=this.getProps();e&&this._adapter.focusInput(),this._adapter.updateFocusState(!0)}blur(){const{filterTreeNode:e}=this.getProps();e&&this._adapter.blurInput(),this._adapter.updateFocusState(!1)}toggle2SearchInput(e){e?this._adapter.toggleInputShow(e,(()=>this.focus())):this._adapter.toggleInputShow(e,(()=>{}))}handleItemClick(e,t){this._isDisabled()||(this.handleSingleSelect(e,t),this._adapter.rePositionDropdown())}handleItemHover(e,t){this._isDisabled()||this.handleShowNextByHover(t)}handleShowNextByHover(e){const{keyEntities:t}=this.getStates(),{data:n,key:r}=e,i=this._isLeaf(n),s=t[r].path;this._adapter.updateStates({activeKeys:new Set(s)}),i||this.notifyIfLoadData(e)}onItemCheckboxClick(e){this._isDisabled()||(this._handleMultipleSelect(e),this._adapter.rePositionDropdown())}handleClick(e){const t=this._isDisabled(),n=this._isFilterable(),{isOpen:r}=this.getStates();t||(r?r&&!n&&this.close(e):(this.open(),this._notifyFocus(e)))}handleSelectionEnterPress(e){dn(e)&&this.handleClick(e)}toggleHoverState(e){this._adapter.toggleHovering(e)}_defaultRenderText(e,t){const n=this.getProp("separator");return t&&"function"==typeof t?t(e):e.join(n)}renderDisplayText(e,t){const n=this.getProp("displayRender"),r=this.getProp("displayProp"),i=this.getItemPropPath(e,r,t);return this._defaultRenderText(i,n)}handleNodeLoad(e){const{data:t,key:n}=e,r=new Set(this._adapter.getLoadingKeyRefValue()),i=new Set(this._adapter.getLoadedKeyRefValue()).add(n),s=new Set([...r]);s.delete(n),this._adapter.notifyOnLoad(i,t),this._adapter.updateLoadingKeyRefValue(s),this._adapter.updateLoadedKeyRefValue(i),this._adapter.updateStates({loadingKeys:s,loadedKeys:i})}notifyIfLoadData(e){const{data:t,key:n}=e;if(this._adapter.updateStates({loading:!1}),!t.isLeaf&&!t.children&&this.getProp("loadData")){const t=this._adapter.getLoadedKeyRefValue(),r=new Set(this._adapter.getLoadingKeyRefValue());if(t.has(n)||r.has(n))return;this._adapter.updateStates({loading:!0});const{keyEntities:i}=this.getStates(),s=this.getItemPropPath(n,[],i),o=r.add(n);this._adapter.updateLoadingKeyRefValue(o),this._adapter.updateStates({loadingKeys:o}),this._adapter.notifyLoadData(s,this.handleNodeLoad.bind(this,e))}}handleSingleSelect(e,t){const{changeOnSelect:n,filterLeafOnly:r,multiple:i,enableLeafClick:s,clickToSelect:o}=this.getProps(),{keyEntities:a,selectedKeys:l,isSearching:c}=this.getStates(),d=this._isFilterable(),{data:h,key:u}=t,p=this._isLeaf(h),f=a[u].path,m=[u],g=u!==[...l][0];if(!(p||n||c||i&&o))return this._adapter.updateStates({activeKeys:new Set(f)}),void this.notifyIfLoadData(t);if(i)this._adapter.updateStates({activeKeys:new Set(f)}),(o||p&&s)&&this.onItemCheckboxClick(t);else if(this._adapter.notifySelect(h.value),g){if(this._notifyChange(t),this.notifyIfLoadData(t),this._isControlledComponent())return this._adapter.updateStates({activeKeys:new Set(f)}),void(p&&this.close(e));this._adapter.updateStates({activeKeys:new Set(f),selectedKeys:new Set(m)});const n=this.renderDisplayText(u);d&&this._adapter.updateInputPlaceHolder(n),(p||!r&&c)&&this.close(e,u)}else this.close(e)}_handleMultipleSelect(e){const{checkRelation:t}=this.getProps();t===Dc?this._handleRelatedMultipleSelect(e):"unRelated"===t&&this._handleUnRelatedMultipleSelect(e),this._adapter.updateStates({inputValue:""})}_handleRelatedMultipleSelect(e){const{key:t}=e,{checkedKeys:n,keyEntities:r,resolvedCheckedKeys:i}=this.getStates(),{autoMergeValue:s,max:o,disableStrictly:a,leafOnly:l}=this.getProps(),c=n.has(t),d=a?this.calcCheckedStatus(!c,t):!c,{checkedKeys:h,halfCheckedKeys:u}=a?this.calcNonDisabledCheckedKeys(t,d):this.calcCheckedKeys(t,d),p=Vc(s,l),f=p===Ac,m=new Set(fc(h,r,p===Mc)),g=f?h:m;if(er()(o))if(f){if(n.size<h.size&&h.size>o){const e=[];return h.forEach((t=>{e.push(r[t])})),void this._adapter.notifyOnExceed(e)}}else if(i.size<m.size&&m.size>o){const e=[];return m.forEach((t=>{e.push(r[t])})),void this._adapter.notifyOnExceed(e)}this._isControlledComponent()||this._adapter.updateStates({checkedKeys:h,halfCheckedKeys:u,resolvedCheckedKeys:m}),this._notifyChange(g),d&&this._notifySelect(g)}_handleUnRelatedMultipleSelect(e){const{key:t}=e,{checkedKeys:n,keyEntities:r}=this.getStates(),{max:i}=this.getProps(),s=new Set(n);let o;if(n.has(t))s.delete(t),o=!1;else{if(er()(i)&&n.size>=i){const e=[];return n.forEach((t=>{e.push(r[t])})),void this._adapter.notifyOnExceed(e)}s.add(t),o=!0}this._isControlledComponent()||this._adapter.updateStates({checkedKeys:s}),this._notifyChange(s),o&&this._notifySelect(s)}calcNonDisabledCheckedKeys(e,t){const{keyEntities:n,disabledKeys:r}=this.getStates(),i=new Set(this.getState("checkedKeys")),s=fc(oc([e],n,!1),n,!0),o=s.some((e=>r.has(e)));if(!o)return this.calcCheckedKeys(e,t);const a=s.filter((e=>!r.has(e)));return cc(t?[...a,...i]:Kl()(fc([...i],n,!0),a),n)}calcCheckedStatus(e,t){if(!e)return e;const{checkedKeys:n,keyEntities:r,disabledKeys:i}=this.getStates(),s=fc(oc([t],r,!1),r,!0),o=s.some((e=>i.has(e)));if(!o)return e;const a=s.filter((e=>!i.has(e))),l=a.every((e=>n.has(e)));return!l}_notifySelect(e){const{keyEntities:t}=this.getStates(),n=[];e.forEach((e=>{var r,i;const s=null===(i=null===(r=t[e])||void 0===r?void 0:r.data)||void 0===i?void 0:i.value;void 0!==s&&n.push(s)}));const r=1===n.length?n[0]:n;this._adapter.notifySelect(r)}calcCheckedKeys(e,t){const{keyEntities:n}=this.getStates(),r=new Set(this.getState("checkedKeys")),i=new Set(this.getState("halfCheckedKeys"));return t?gc(e,n,r,i):yc(e,n,r,i)}handleInputChange(e){this._adapter.updateInputValue(e);const t=this._calcFilteredKeys(e);this._adapter.updateStates({isSearching:Boolean(e),filteredKeys:new Set(t)}),this._adapter.notifyOnSearch(e),this._adapter.rePositionDropdown()}handleClear(){const{isSearching:e}=this.getStates(),{searchPlaceholder:t,placeholder:n,multiple:r}=this.getProps(),i=this._isFilterable(),s=this._isControlledComponent(),o={};r?(o.isSearching=!1,this._adapter.updateInputValue(""),this._adapter.notifyOnSearch(""),o.checkedKeys=new Set([]),o.halfCheckedKeys=new Set([]),o.selectedKeys=new Set([]),o.activeKeys=new Set([]),o.resolvedCheckedKeys=new Set([]),this._adapter.notifyChange([])):i&&e?(o.isSearching=!1,this._adapter.updateInputValue(""),this._adapter.notifyOnSearch("")):(i&&(o.inputValue="",o.inputPlaceHolder=t||n||"",this._adapter.updateInputValue(""),this._adapter.notifyOnSearch("")),s||(o.selectedKeys=new Set([])),o.activeKeys=new Set([]),o.filteredKeys=new Set([]),this._adapter.notifyChange([])),this._adapter.updateStates(o),this._adapter.notifyClear(),this._adapter.rePositionDropdown()}handleClearEnterPress(e){dn(e)&&this.handleClear()}getRenderData(){const{keyEntities:e,isSearching:t}=this.getStates(),n=this._isFilterable();return t&&n?this.getFilteredData():Object.values(e).filter((e=>null===e.parentKey&&!e._notExist)).sort(((e,t)=>parseInt(e.ind,10)-parseInt(t.ind,10)))}getFilteredData(){const{treeNodeFilterProp:e,filterSorter:t,keyMaps:n}=this.getProps(),r="label"!==e?e:o()(n,"label","label"),{filteredKeys:i,keyEntities:s,inputValue:a}=this.getStates(),l=[];return[...i].forEach((e=>{const t=s[e];if(!t)return;const n=this.getItemPropPath(e,[]),i=n.map((e=>e[r])),o=this._isOptionDisabled(e,s);l.push({data:t.data,pathData:n,key:e,disabled:o,searchText:i})})),ye()(t)&&l.sort(((e,n)=>t(e.pathData,n.pathData,a))),l}handleListScroll(e,t){const{activeKeys:n,keyEntities:r}=this.getStates(),i=[...n][n.size-1],s=i?o()(r,[i,"data"],null):null;this._adapter.notifyListScroll(e,{panelIndex:t,activeNode:s})}}__webpack_require__("Kvbp");const Hc=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.08 7.6a1.5 1.5 0 0 1 2.12 0l5.66 5.65 5.66-5.65a1.5 1.5 0 1 1 2.12 2.12l-6.72 6.72a1.5 1.5 0 0 1-2.12 0L4.08 9.72a1.5 1.5 0 0 1 0-2.12Z",fill:"currentColor"}))}),"chevron_down");var Uc=__webpack_require__("p6M4"),Kc=__webpack_require__.n(Uc);const Wc={PREFIX:`${C}-checkbox`,INNER:`${C}-checkbox-inner`,TEXT:`${C}-checkbox-text`,INPUT:`${C}-checkbox-input`,CHECKED:`${C}-checkbox-checked`,DISABLED:`${C}-checkbox-disabled`,BUTTON:`${C}-checkbox-button`,WRAPPER:""},Gc={PREFIX:`${C}-checkboxGroup`,INNER:`${C}-checkboxGroup-inner`,TEXT:`${C}-checkboxGroup-text`,INPUT:`${C}-checkboxGroup-input`,CHECKED:`${C}-checkboxGroup-checked`,DISABLED:`${C}-checkboxGroup-disabled`},qc=["horizontal","vertical"],Xc="default",Yc="card",Zc="pureCard",Jc="vertical";const Qc=class extends c{constructor(e){super(Object.assign({},e)),this.clickState=!1,this.handleFocusVisible=e=>{const{target:t}=e;try{if(this.clickState)return void(this.clickState=!1);t.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch(e){Q(!0,"Warning: [Semi Checkbox] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this.clickState=!1,this._adapter.setFocusVisible(!1)}}init(){const{children:e,extra:t,extraId:n,addonId:r}=this.getProps();e&&!r&&this._adapter.setAddonId(),t&&!n&&this._adapter.setExtraId()}notifyChange(e,t){const n=this._adapter.generateEvent(e,t);this._adapter.notifyChange(n)}handleChange(e){if(this.getProp("disabled"))return;"click"===(null==e?void 0:e.type)&&(this.clickState=!0),this._adapter.focusCheckboxEntity();if(this._adapter.getIsInGroup()){return void(this._adapter.getGroupDisabled()||this.handleChangeInGroup(e))}const t=!this.getState("checked");this._isControlledComponent("checked")||this.setChecked(t),this.notifyChange(t,e)}handleChangeInGroup(e){const{value:t}=this.getProps(),n=!this._adapter.getGroupValue().includes(t),r=this._adapter.generateEvent(n,e);this._adapter.notifyChange(r),this._adapter.notifyGroupChange(r)}handleEnterPress(e){dn(e)&&this.handleChange(e)}setChecked(e){this._adapter.setNativeControlChecked(e)}destroy(){}},ed=h().createContext({});const td=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}),"checkbox_tick");const nd=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}),"checkbox_indeterminate");class rd extends d.PureComponent{blur(){this.inputEntity.blur()}focus(){const{preventScroll:e}=this.props;this.inputEntity.focus({preventScroll:e})}render(){const{indeterminate:e,checked:t,disabled:n,prefixCls:r,name:s,isPureCardType:o,addonId:a,extraId:l,focusInner:c,onInputFocus:d,onInputBlur:u}=this.props,p=r||Wc.PREFIX,f=w()({[`${p}-inner`]:!0,[`${p}-inner-checked`]:Boolean(t),[`${p}-inner-pureCardType`]:o},Wc.WRAPPER),m=w()({[`${p}-inner-display`]:!0,[`${p}-focus`]:c,[`${p}-focus-border`]:c&&!t}),g=t?h().createElement(td,null):e?h().createElement(nd,null):null,y={type:"checkbox","aria-label":this.props["aria-label"],"aria-disabled":n,"aria-checked":t,"aria-labelledby":a,"aria-describedby":l||this.props["aria-describedby"],"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-required":this.props["aria-required"],className:Wc.INPUT,onChange:i(),checked:t,disabled:n,onFocus:d,onBlur:u};return s&&(y.name=s),h().createElement("span",{className:f},h().createElement("input",Object.assign({},y,{ref:e=>{this.inputEntity=e}})),h().createElement("span",{className:m},g))}}rd.contextType=ed,rd.propTypes={"aria-describedby":E().string,"aria-errormessage":E().string,"aria-invalid":E().bool,"aria-labelledby":E().string,"aria-required":E().bool,checked:E().bool,disabled:E().bool,onChange:E().func,children:E().node,grouped:E().bool,value:E().any,isPureCardType:E().bool,addonId:E().string,extraId:E().string,focusInner:E().bool,onInputFocus:E().func,onInputBlur:E().func,preventScroll:E().bool},rd.defaultProps={onChange:i()};const id=rd;__webpack_require__("mMhg");class sd extends f{get adapter(){return Object.assign(Object.assign({},super.adapter),{setNativeControlChecked:e=>{this.setState({checked:e})},notifyChange:e=>{const{onChange:t}=this.props;t&&t(e)},generateEvent:(e,t)=>{const{props:n}=this;return{target:Object.assign(Object.assign({},n),{checked:e}),stopPropagation:()=>{t.stopPropagation()},preventDefault:()=>{t.preventDefault()},nativeEvent:{stopImmediatePropagation:()=>{t.nativeEvent&&"function"==typeof t.nativeEvent.stopImmediatePropagation&&t.nativeEvent.stopImmediatePropagation()}}}},getIsInGroup:()=>this.isInGroup(),getGroupValue:()=>this.context&&this.context.checkboxGroup.value||[],notifyGroupChange:e=>{this.context.checkboxGroup.onChange(e)},getGroupDisabled:()=>this.context&&this.context.checkboxGroup.disabled,setAddonId:()=>{this.setState({addonId:We({prefix:"addon"})})},setExtraId:()=>{this.setState({extraId:We({prefix:"extra"})})},setFocusVisible:e=>{this.setState({focusVisible:e})},focusCheckboxEntity:()=>{this.focus()}})}constructor(e){super(e),this.handleChange=e=>this.foundation.handleChange(e),this.handleEnterPress=e=>this.foundation.handleEnterPress(e),this.handleFocusVisible=e=>{this.foundation.handleFocusVisible(e)},this.handleBlur=e=>{this.foundation.handleBlur()};this.state={checked:e.checked||e.defaultChecked||!1,addonId:e.addonId,extraId:e.extraId,focusVisible:!1},this.checkboxEntity=null,this.foundation=new Qc(this.adapter)}componentDidUpdate(e){this.props.checked!==e.checked&&(_e()(this.props.checked)?this.foundation.setChecked(!1):Kc()(this.props.checked)&&this.foundation.setChecked(this.props.checked))}isInGroup(){return Boolean(this.context&&this.context.checkboxGroup&&"value"in this.props)}focus(){this.checkboxEntity&&this.checkboxEntity.focus()}blur(){this.checkboxEntity&&this.checkboxEntity.blur()}render(){const{disabled:e,style:t,prefixCls:n,className:r,indeterminate:i,children:s,onMouseEnter:o,onMouseLeave:a,extra:l,value:c,role:d,tabIndex:u,id:p,type:f}=this.props,{checked:m,addonId:g,extraId:y,focusVisible:v}=this.state,b={checked:m,disabled:e},x=this.isInGroup();if(x){if(this.context.checkboxGroup.value){const e=(this.context.checkboxGroup.value||[]).includes(c);b.checked=e}this.context.checkboxGroup.disabled&&(b.disabled=this.context.checkboxGroup.disabled||this.props.disabled);const{isCardType:e,isPureCardType:t}=this.context.checkboxGroup;b.isCardType=e,b.isPureCardType=t,b.name=this.context.checkboxGroup.name}else b.isPureCardType=f===Zc,b.isCardType=f===Yc||b.isPureCardType;const E=n||Wc.PREFIX,C=b.isCardType||b.isPureCardType,S=w()(E,{[`${E}-disabled`]:b.disabled,[`${E}-indeterminate`]:i,[`${E}-checked`]:b.checked,[`${E}-unChecked`]:!b.checked,[`${E}-cardType`]:b.isCardType,[`${E}-cardType_disabled`]:b.disabled&&b.isCardType,[`${E}-cardType_enable`]:!(b.disabled&&b.isCardType),[`${E}-cardType_checked`]:b.isCardType&&b.checked&&!b.disabled,[`${E}-cardType_checked_disabled`]:b.isCardType&&b.checked&&b.disabled,[r]:Boolean(r),[`${E}-focus`]:v&&C}),_=w()(`${E}-extra`,{[`${E}-cardType_extra_noChildren`]:b.isCardType&&!s}),k=(x&&this.context.checkboxGroup.name,this.props["x-semi-children-alias"]||"children");return h().createElement("span",Object.assign({role:d,tabIndex:u,style:t,className:S,id:p,onMouseEnter:o,onMouseLeave:a,onClick:this.handleChange,onKeyPress:this.handleEnterPress,"aria-labelledby":this.props["aria-labelledby"]},this.getDataAttr(this.props)),h().createElement(id,Object.assign({},this.props,b,{addonId:s&&g,extraId:l&&y,isPureCardType:b.isPureCardType,ref:e=>{this.checkboxEntity=e},focusInner:v&&!C,onInputFocus:this.handleFocusVisible,onInputBlur:this.handleBlur})),s||l?h().createElement("div",{className:`${E}-content`},s?h().createElement("span",{id:g,className:`${E}-addon`,"x-semi-prop":k},s):null,l?h().createElement("div",{id:y,className:_,"x-semi-prop":"extra"},l):null):null)}}sd.__SemiComponentName__="Checkbox",sd.contextType=ed,sd.propTypes={"aria-describedby":E().string,"aria-errormessage":E().string,"aria-invalid":E().bool,"aria-labelledby":E().string,"aria-required":E().bool,checked:E().bool,defaultChecked:E().bool,disabled:E().bool,indeterminate:E().bool,onChange:E().func,value:E().any,style:E().object,className:E().string,prefixCls:E().string,onMouseEnter:E().func,onMouseLeave:E().func,extra:E().node,index:E().number,"aria-label":E().string,tabIndex:E().number,preventScroll:E().bool,type:E().string},sd.defaultProps=he(sd.__SemiComponentName__,{defaultChecked:!1,indeterminate:!1,onChange:i(),onMouseEnter:i(),onMouseLeave:i(),type:"default"}),sd.elementType="Checkbox";const od=sd;class ad extends c{static get checkboxGroupDefaultAdapter(){return{}}constructor(e){super(Object.assign(Object.assign({},ad.checkboxGroupDefaultAdapter),e))}init(){const{defaultValue:e,value:t}=this.getProps();void 0===e||Array.isArray(e)||Q(!0,"Warning: [Semi CheckboxGroup] defaultValue should be an Array"),void 0===t||Array.isArray(t)||Q(!0,"Warning: [Semi CheckboxGroup] value should be an Array")}notifyChange(e){this._adapter.notifyChange(e)}handleChange(e){const t=this.getState("value");let n=[];Array.isArray(t)||(n=[t]),n=e.target.checked?[...t,e.target.value]:t.filter(((t,n)=>t!==e.target.value));"value"in this.getProps()||this._adapter.updateGroupValue(n),this.notifyChange(n)}getFormatName(){return this.getProp("name")||"default"}handlePropValueChange(e){Array.isArray(e)?this._adapter.updateGroupValue(e):(void 0===e&&this._adapter.updateGroupValue([]),Q(!0,"Warning: [Semi CheckboxGroup] value should be an Array"))}destroy(){}}const ld=ad;class cd extends f{get adapter(){return Object.assign(Object.assign({},super.adapter),{updateGroupValue:e=>{this.setState({value:e})},notifyChange:e=>{this.props.onChange&&this.props.onChange(e)}})}constructor(e){super(e),this.state={value:e.value||e.defaultValue},this.foundation=new ld(this.adapter),this.onChange=this.onChange.bind(this)}componentDidMount(){this.foundation.init()}componentDidUpdate(e){Oe()(e.value,this.props.value)||this.foundation.handlePropValueChange(this.props.value)}componentWillUnmount(){this.foundation.destroy()}onChange(e){this.foundation.handleChange(e)}render(){const{children:e,options:t,prefixCls:n,direction:r,className:i,id:s,style:o,type:a,disabled:l}=this.props,c=a===Zc,d=a===Yc||c,u=n||Gc.PREFIX,p=w()({[u]:!0,[`${u}-wrapper`]:!0,[`${u}-${r}`]:r,[`${u}-${r}-cardType`]:r&&d,[`${u}-${r}-pureCardType`]:r&&c},i),f=this.state.value.slice();let m;return t?m=(t||[]).map(((e,t)=>"string"==typeof e?h().createElement(od,{role:"listitem",key:t,disabled:this.props.disabled,value:e,prefixCls:n},e):h().createElement(od,{role:"listitem",key:t,disabled:e.disabled||this.props.disabled,value:e.value,prefixCls:n,extra:e.extra,className:e.className,style:e.style,onChange:e.onChange},e.label))):e&&(m=h().Children.toArray(e).map(((e,t)=>h().cloneElement(e,{key:t,role:"listitem"})))),h().createElement("div",Object.assign({id:s,role:"list","aria-label":this.props["aria-label"],className:p,style:o,"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"]},this.getDataAttr(this.props)),h().createElement(ed.Provider,{value:{checkboxGroup:{onChange:this.onChange,value:f,disabled:this.props.disabled,name:this.foundation.getFormatName(),isCardType:d,isPureCardType:c}}},m))}}cd.propTypes={"aria-describedby":E().string,"aria-errormessage":E().string,"aria-invalid":E().bool,"aria-labelledby":E().string,"aria-required":E().bool,defaultValue:E().array,disabled:E().bool,name:E().string,options:E().array,value:E().array,onChange:E().func,children:E().node,prefixCls:E().string,direction:E().oneOf(qc),className:E().string,type:E().oneOf([Xc,Yc,Zc]),style:E().object},cd.defaultProps={disabled:!1,onChange:()=>{},type:Xc,defaultValue:[],direction:Jc};const dd=cd;class hd extends od{}hd.Group=dd;const ud=hd;function pd(){return pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pd.apply(null,arguments)}function fd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function md(e,t){return md=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},md(e,t)}function gd(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,md(e,t)}var yd=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function vd(e,t){return e===t||!(!yd(e)||!yd(t))}function bd(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!vd(e[n],t[n]))return!1;return!0}const wd=function(e,t){var n;void 0===t&&(t=bd);var r,i=[],s=!1;return function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return s&&n===this&&t(o,i)||(r=e.apply(this,o),s=!0,n=this,i=o),r}};var xd="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function Ed(e){cancelAnimationFrame(e.id)}function Cd(e,t){var n=xd();var r={id:requestAnimationFrame((function i(){xd()-n>=t?e.call(null):r.id=requestAnimationFrame(i)}))};return r}var Sd=-1;function _d(e){if(void 0===e&&(e=!1),-1===Sd||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Sd=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Sd}var kd=null;function Od(e){if(void 0===e&&(e=!1),null===kd||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?kd="positive-descending":(t.scrollLeft=1,kd=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),kd}return kd}var Td=function(e,t){return e};function Pd(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,s=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,l=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,h=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=l(r.props,fd(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:fd(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=wd((function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})})),r._callOnScroll=void 0,r._callOnScroll=wd((function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})})),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,s=r.props,o=s.direction,a=s.itemSize,l=s.layout,d=r._getItemStyleCache(c&&a,c&&l,c&&o);if(d.hasOwnProperty(e))t=d[e];else{var h=n(r.props,e,r._instanceProps),u=i(r.props,e,r._instanceProps),p="horizontal"===o||"horizontal"===l,f="rtl"===o,m=p?h:0;d[e]=t={position:"absolute",left:f?void 0:m,right:f?m:void 0,top:p?0:h,height:p?"100%":u,width:p?u:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=wd((function(e,t,n){return{}})),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,s=t.scrollWidth;r.setState((function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,o=i;if("rtl"===t)switch(Od()){case"negative":o=-i;break;case"positive-descending":o=s-n-i}return o=Math.max(0,Math.min(o,s-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,s=t.scrollTop;r.setState((function(e){if(e.scrollOffset===s)return null;var t=Math.max(0,Math.min(s,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&Ed(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=Cd(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1,null)}))},r}gd(t,e),t.getDerivedStateFromProps=function(e,t){return Id(e,t),h(e),null};var u=t.prototype;return u.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},u.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var a=0;if(this._outerRef){var l=this._outerRef;a="vertical"===i?l.scrollWidth>l.clientWidth?_d():0:l.scrollHeight>l.clientHeight?_d():0}this.scrollTo(s(this.props,e,t,o,this._instanceProps,a))},u.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},u.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var s=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(Od()){case"negative":s.scrollLeft=-i;break;case"positive-ascending":s.scrollLeft=i;break;default:var o=s.clientWidth,a=s.scrollWidth;s.scrollLeft=a-o-i}else s.scrollLeft=i;else s.scrollTop=i}this._callPropsCallbacks()},u.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&Ed(this._resetIsScrollingTimeoutId)},u.render=function(){var e=this.props,t=e.children,n=e.className,i=e.direction,s=e.height,o=e.innerRef,a=e.innerElementType,l=e.innerTagName,c=e.itemCount,h=e.itemData,u=e.itemKey,p=void 0===u?Td:u,f=e.layout,m=e.outerElementType,g=e.outerTagName,y=e.style,v=e.useIsScrolling,b=e.width,w=this.state.isScrolling,x="horizontal"===i||"horizontal"===f,E=x?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),S=C[0],_=C[1],k=[];if(c>0)for(var O=S;O<=_;O++)k.push((0,d.createElement)(t,{data:h,key:p(O,h),index:O,isScrolling:v?w:void 0,style:this._getItemStyle(O)}));var T=r(this.props,this._instanceProps);return(0,d.createElement)(m||g||"div",{className:n,onScroll:E,ref:this._outerRefSetter,style:pd({position:"relative",height:s,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},y)},(0,d.createElement)(a||l||"div",{children:k,ref:o,style:{height:x?"100%":T,pointerEvents:w?"none":void 0,width:x?T:"100%"}}))},u._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var s=this.state,o=s.scrollDirection,a=s.scrollOffset,l=s.scrollUpdateWasRequested;this._callOnScroll(o,a,l)}},u._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,s=r.scrollDirection,l=r.scrollOffset;if(0===t)return[0,0,0,0];var c=o(this.props,l,this._instanceProps),d=a(this.props,c,l,this._instanceProps),h=i&&"backward"!==s?1:Math.max(1,n),u=i&&"forward"!==s?1:Math.max(1,n);return[Math.max(0,c-h),Math.max(0,Math.min(t-1,d+u)),c,d]},t}(d.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Id=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},Md=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,s=n.lastMeasuredIndex;if(t>s){var o=0;if(s>=0){var a=i[s];o=a.offset+a.size}for(var l=s+1;l<=t;l++){var c=r(l);i[l]={offset:o,size:c},o+=c}n.lastMeasuredIndex=t}return i[t]},Rd=function(e,t,n,r,i){for(;r<=n;){var s=r+Math.floor((n-r)/2),o=Md(e,s,t).offset;if(o===i)return s;o<i?r=s+1:o>i&&(n=s-1)}return r>0?r-1:0},Ad=function(e,t,n,r){for(var i=e.itemCount,s=1;n<i&&Md(e,n,t).offset<r;)n+=s,s*=2;return Rd(e,t,Math.min(n,i-1),Math.floor(n/2),r)},Nd=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,i=t.estimatedItemSize,s=t.lastMeasuredIndex,o=0;if(s>=n&&(s=n-1),s>=0){var a=r[s];o=a.offset+a.size}return o+(n-s-1)*i},Dd=Pd({getItemOffset:function(e,t,n){return Md(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:Nd,getOffsetForIndexAndAlignment:function(e,t,n,r,i,s){var o=e.direction,a=e.height,l=e.layout,c=e.width,d="horizontal"===o||"horizontal"===l?c:a,h=Md(e,t,i),u=Nd(e,i),p=Math.max(0,Math.min(u-d,h.offset)),f=Math.max(0,h.offset-d+h.size+s);switch("smart"===n&&(n=r>=f-d&&r<=p+d?"auto":"center"),n){case"start":return p;case"end":return f;case"center":return Math.round(f+(p-f)/2);default:return r>=f&&r<=p?r:r<f?f:p}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,i=t.lastMeasuredIndex;return(i>0?r[i].offset:0)>=n?Rd(e,t,i,0,n):Ad(e,t,Math.max(0,i),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var i=e.direction,s=e.height,o=e.itemCount,a=e.layout,l=e.width,c="horizontal"===i||"horizontal"===a?l:s,d=Md(e,t,r),h=n+c,u=d.offset+d.size,p=t;p<o-1&&u<h;)p++,u+=Md(e,p,r).size;return p},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}}),Ld=Pd({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r,i,s){var o=e.direction,a=e.height,l=e.itemCount,c=e.itemSize,d=e.layout,h=e.width,u="horizontal"===o||"horizontal"===d?h:a,p=Math.max(0,l*c-u),f=Math.min(p,t*c),m=Math.max(0,t*c-u+c+s);switch("smart"===n&&(n=r>=m-u&&r<=f+u?"auto":"center"),n){case"start":return f;case"end":return m;case"center":var g=Math.round(m+(f-m)/2);return g<Math.ceil(u/2)?0:g>p+Math.floor(u/2)?p:g;default:return r>=m&&r<=f?r:r<m?m:f}},getStartIndexForOffset:function(e,t){var n=e.itemCount,r=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getStopIndexForStartIndex:function(e,t,n){var r=e.direction,i=e.height,s=e.itemCount,o=e.itemSize,a=e.layout,l=e.width,c=t*o,d="horizontal"===r||"horizontal"===a?l:i,h=Math.ceil((d+n-c)/o);return Math.max(0,Math.min(s-1,t+h-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});const Fd=e=>{let{index:t,data:n,style:r}=e;const{visibleOptions:i,renderOption:s}=n;return s(i[t],t,r)},jd=kc.PREFIX_OPTION;class $d extends d.PureComponent{constructor(){var e;super(...arguments),e=this,this.onClick=(e,t)=>{const{onItemClick:n}=this.props;t.data.disabled||"disabled"in t&&t.disabled||n(e,t)},this.handleItemEnterPress=(e,t)=>{dn(e)&&this.onClick(e,t)},this.onHover=(e,t)=>{const{showNext:n,onItemHover:r}=this.props;t.data.disabled||n===Ic&&r(e,t)},this.onCheckboxChange=(e,t)=>{const{onItemCheckboxClick:n}=this.props;e.stopPropagation(),e.nativeEvent&&"function"==typeof e.nativeEvent.stopImmediatePropagation&&e.nativeEvent.stopImmediatePropagation(),n(t)},this.getItemStatus=e=>{const{activeKeys:t,selectedKeys:n,loadedKeys:r,loadingKeys:i}=this.props,s={active:!1,selected:!1,loading:!1};return t.has(e)&&(s.active=!0),n.has(e)&&(s.selected=!0),i.has(e)&&!r.has(e)&&(s.loading=!0),s},this.renderIcon=function(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=e=>e+(n?` ${jd}-icon-left`:"");switch(t){case"child":const{expandIcon:t}=e.props;return t||h().createElement(Al,{className:r(`${jd}-icon ${jd}-icon-expand`)});case"tick":return h().createElement(sn,{className:r(`${jd}-icon ${jd}-icon-active`)});case"loading":return h().createElement(dr,{wrapperClassName:r(`${jd}-spin-icon`)});case"empty":return h().createElement("span",{"aria-hidden":!0,className:r(`${jd}-icon ${jd}-icon-empty`)});default:return null}},this.highlight=e=>{const t=[],{keyword:n,separator:r}=this.props;return e.forEach(((i,s)=>{if("string"==typeof i&&n){const e=i.toLowerCase(),r=n.toLowerCase();let o=0,a=0;for(;;){const l=e.indexOf(r,o);if(-1===l){const e=i.slice(o);e&&t.push(e);break}const c=i.slice(o,l);c&&t.push(c),t.push(h().createElement("span",{className:`${jd}-label-highlight`,key:`${s}-${l}-${a}`},i.slice(l,l+n.length))),o=l+n.length,a++}}else t.push(i);s!==e.length-1&&t.push(r)})),t},this.renderFlattenOptionItem=(e,t,n)=>{var r;const{multiple:i,selectedKeys:s,checkedKeys:o,halfCheckedKeys:a,keyword:l,filterRender:c,virtualize:d}=this.props,{searchText:u,key:p,disabled:f,pathData:m}=e,g=s.has(p),y=w()(jd,{[`${jd}-flatten`]:!c,[`${jd}-disabled`]:f,[`${jd}-select`]:g&&!i}),v=t=>{this.onClick(t,e)},b=t=>this.onCheckboxChange(t,e);if(c){const t=c({className:y,inputValue:l,disabled:f,data:m,checkStatus:{checked:o.has(e.key),halfChecked:a.has(e.key)},selected:g,onClick:v,onCheck:b}),i=d?{key:p,style:Object.assign(Object.assign({},null!==(r=t.props.style)&&void 0!==r?r:{}),n)}:{key:p};return h().cloneElement(t,i)}return h().createElement("li",{role:"menuitem",className:y,style:n,key:p,onClick:v,onKeyPress:t=>this.handleItemEnterPress(t,e)},h().createElement("span",{className:`${jd}-label`},!i&&this.renderIcon("empty"),i&&h().createElement(ud,{onChange:b,disabled:f,indeterminate:a.has(e.key),checked:o.has(e.key),className:`${jd}-label-checkbox`}),this.highlight(u)))},this.renderFlattenOption=e=>{const{virtualize:t}=this.props;return h().createElement("ul",{className:`${jd}-list`,key:"flatten-list"},t?this.renderVirtualizeList(e):e.map((e=>this.renderFlattenOptionItem(e))))},this.renderVirtualizeList=e=>{var t;const{direction:n}=this.context,{virtualize:r}=this.props;return h().createElement(Ld,{height:r.height,itemCount:e.length,itemSize:r.itemSize,itemData:{visibleOptions:e,renderOption:this.renderFlattenOptionItem},width:null!==(t=r.width)&&void 0!==t?t:"100%",style:{direction:n}},Fd)}}renderItem(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{multiple:n,checkedKeys:r,halfCheckedKeys:i}=this.props;let s;const o=t.length;return t.push(h().createElement("ul",{role:"menu",className:`${jd}-list`,key:e[0].key,onScroll:e=>this.props.onListScroll(e,o)},e.map((e=>{const{data:t,key:o,parentKey:a}=e,{children:l,label:c,disabled:d,isLeaf:u}=t,{active:p,selected:f,loading:m}=this.getItemStatus(o),g=Boolean(l)&&l.length,y=g||this.props.loadData&&!u;p&&g&&(s=e);const v=w()(jd,{[`${jd}-active`]:p&&!f,[`${jd}-select`]:f&&!n,[`${jd}-disabled`]:d}),b=a?{"aria-owns":`cascaderItem-${a}`}:{};return h().createElement("li",Object.assign({role:"menuitem",id:`cascaderItem-${o}`,"aria-expanded":p,"aria-haspopup":Boolean(y),"aria-disabled":d},b,{className:v,key:o,onClick:t=>{this.onClick(t,e)},onKeyPress:t=>this.handleItemEnterPress(t,e),onMouseEnter:t=>{this.onHover(t,e)}}),h().createElement("span",{className:`${jd}-label`},f&&!n&&this.renderIcon("tick"),!f&&!n&&this.renderIcon("empty"),n&&h().createElement(ud,{onChange:t=>this.onCheckboxChange(t,e),disabled:d,indeterminate:i.has(e.key),checked:r.has(e.key),className:`${jd}-label-checkbox`}),h().createElement("span",null,c)),y?this.renderIcon(m?"loading":"child",!0):null)})))),s&&t.concat(this.renderItem(s.children,t)),t}renderEmpty(){const{emptyContent:e}=this.props;return null===e?null:h().createElement(Jt,{componentName:"Cascader"},(t=>h().createElement("ul",{className:`${jd} ${jd}-empty`,key:"empty-list"},h().createElement("span",{className:`${jd}-label`,"x-semi-prop":"emptyContent"},e||t.emptyText))))}render(){const{data:e,searchable:t}=this.props,{direction:n}=this.context,r=!e||!e.length;let i;const s=w()({[`${jd}-lists`]:!0,[`${jd}-lists-rtl`]:"rtl"===n,[`${jd}-lists-empty`]:r});return i=r?this.renderEmpty():t?this.renderFlattenOption(e):this.renderItem(e),h().createElement("div",{className:s},i)}}$d.contextType=lt,$d.propTypes={data:E().array,emptyContent:E().node,searchable:E().bool,onItemClick:E().func,onItemHover:E().func,multiple:E().bool,showNext:E().oneOf([Pc,Ic]),checkedKeys:E().object,halfCheckedKeys:E().object,onItemCheckboxClick:E().func,separator:E().string,keyword:E().string,virtualize:E().object,expandIcon:E().node},$d.defaultProps={empty:!1};const Bd={PREFIX:`${C}-tag`},Vd=["default","small","large"],zd=["grey","red","pink","purple","violet","indigo","blue","light-blue","cyan","teal","green","light-green","lime","yellow","amber","orange","white"],Hd=["light","solid","ghost"],Ud=["square","circle"];__webpack_require__("DzbD");var Kd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Wd=Bd.PREFIX,Gd=zd,qd=Vd,Xd=Hd,Yd=Ud;class Zd extends d.Component{constructor(e){super(e),this.state={visible:!0},this.close=this.close.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}static getDerivedStateFromProps(e){return"visible"in e?{visible:e.visible}:null}setVisible(e){"visible"in this.props||this.setState({visible:e})}close(e,t,n){const{onClose:r}=this.props;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r&&r(t,e,n),e.defaultPrevented||this.setVisible(!1)}handleKeyDown(e){const{closable:t,onClick:n,onKeyDown:r}=this.props;switch(e.key){case"Backspace":case"Delete":t&&this.close(e,this.props.children,this.props.tagKey),Le(e);break;case"Enter":n(e),Le(e);break;case"Escape":e.target.blur()}r&&r(e)}renderAvatar(){const{avatarShape:e,avatarSrc:t}=this.props;return h().createElement(Qr,{src:t,shape:e})}render(){const e=this.props,{tagKey:t,children:n,size:r,color:i,closable:s,visible:o,onClose:a,onClick:l,className:c,type:d,shape:u,avatarSrc:p,avatarShape:f,tabIndex:m,prefixIcon:g,suffixIcon:y,colorful:v,gradient:b}=e,x=Kd(e,["tagKey","children","size","color","closable","visible","onClose","onClick","className","type","shape","avatarSrc","avatarShape","tabIndex","prefixIcon","suffixIcon","colorful","gradient"]),{visible:E}=this.state,C=l!==Zd.defaultProps.onClick||s,S={role:"button",tabIndex:m||0,onKeyDown:this.handleKeyDown},_=Object.assign(Object.assign({},x),{onClick:l,tabIndex:m,className:w()(Wd,{[`${Wd}-default`]:"default"===r,[`${Wd}-small`]:"small"===r,[`${Wd}-large`]:"large"===r,[`${Wd}-square`]:"square"===u,[`${Wd}-circle`]:"circle"===u,[`${Wd}-${d}`]:d,[`${Wd}-${i}-${d}`]:i&&d,[`${Wd}-closable`]:s,[`${Wd}-invisible`]:!E,[`${Wd}-avatar-${f}`]:p,[`${Wd}-colorful`]:v,[`${Wd}-gradient`]:b},c)}),k=C?Object.assign(Object.assign({},_),S):_,O=s?h().createElement("div",{className:`${Wd}-close`,onClick:e=>this.close(e,n,t)},h().createElement(Ji,{size:"small"})):null,T=xe()(n),P=w()(`${Wd}-content`,`${Wd}-content-${T?"ellipsis":"center"}`);return h().createElement("div",Object.assign({"aria-label":this.props["aria-label"]||T?`${s?"Closable ":""}Tag: ${n}`:""},k),g?h().createElement("div",{className:`${Wd}-prefix-icon`},g):null,p?this.renderAvatar():null,h().createElement("div",{className:P},n),y?h().createElement("div",{className:`${Wd}-suffix-icon`},y):null,O)}}Zd.__SemiComponentName__="Tag",Zd.defaultProps=he(Zd.__SemiComponentName__,{size:qd[0],color:Gd[0],closable:!1,type:Xd[0],onClose:()=>{},onClick:()=>{},onMouseEnter:()=>{},style:{},className:"",shape:"square",avatarShape:"square",prefixIcon:null,suffixIcon:null,colorful:!1,gradient:!1}),Zd.propTypes={children:E().node,tagKey:E().oneOfType([E().string,E().number]),size:E().oneOf(qd),color:E().oneOf(Gd),type:E().oneOf(Xd),closable:E().bool,visible:E().bool,onClose:E().func,onClick:E().func,prefixIcon:E().node,suffixIcon:E().node,style:E().object,className:E().string,avatarSrc:E().string,colorful:E().bool,gradient:E().bool,avatarShape:E().oneOf(Yd),"aria-label":E().string};const Jd={PREFIX:`${C}-tagInput`},Qd=["large","default","small"],eh=["success","default","error","warning"];__webpack_require__("lZky");const th=(e,t)=>{let n=[];if(xe()(t)||er()(t))n=e.split(t);else if(M()(t)){const r=t[0];n=e;for(let e=1;e<t.length;e++)n=n.split(t[e]).join(r);n=n.split(r)}else n.push(e);return n};function nh(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}const rh=class extends c{constructor(e){super(Object.assign({},e)),this.handleInputChange=e=>{const{value:t}=e.target,{entering:n}=this.getStates();(n||this._checkInputChangeValid(t))&&this._onInputChange(t,e)},this.handleInputCompositionStart=e=>{const{maxLength:t}=this.getProps();er()(t)&&this._adapter.setEntering(!0)},this._splitArray=(e,t)=>{const{split:n}=this.getProps();return ye()(n)?n(e,t):th(e,t)},this.handleInputCompositionEnd=e=>{const{value:t}=e.target,{maxLength:n,onInputExceed:r,separator:i}=this.getProps();if(!er()(n))return;this._adapter.setEntering(!1);let s=!0;const o=this._splitArray(t,i);let a=0;for(;a<o.length;a++)if(o[a].length>n){s=!1,ye()(r)&&r(t);break}if(s)this._adapter.setInputValue(t);else{const e=o.slice(0,a);a<o.length&&e.push(o[a].slice(0,n)),this._adapter.setInputValue(e.join(i))}},this._checkInputChangeValid=e=>{const{maxLength:t,onInputExceed:n,separator:r}=this._adapter.getProps(),{inputValue:i}=this._adapter.getStates();let s=!0;if(er()(t)){const o=this._splitArray(e,r),a=this._splitArray(i,r),l=Math.max(o.length,a.length);for(let r=0;r<l;r++)if(!_e()(o[r])&&(_e()(a[r])||o[r].length>a[r].length)&&o[r].length>t){s=!1,ye()(n)&&n(e);break}}return s},this.handleKeyDown=e=>{const{inputValue:t,tagsArray:n}=this._adapter.getStates(),r=e.keyCode;r===cn.ENTER&&(e.preventDefault(),""!==t&&this._handleAddTags(e));const{length:i}=n;if(r===cn.BACKSPACE&&""===t&&i>0){const e=n.slice(0,i-1),t=n[i-1];this._onRemove(e,t,i-1)}this._adapter.notifyKeyDown(e)}}_handleAddTags(e){const{separator:t,max:n,onExceed:r,allowDuplicates:i}=this._adapter.getProps(),{inputValue:s,tagsArray:o}=this._adapter.getStates();let a=this._splitArray(s,t);a=a.filter(((e,t)=>!(!i&&(o.includes(e)||a.indexOf(e)!==t))&&(xe()(e)&&""!==e.trim())));let l=o.concat(a);er()(n)&&l.length>n&&(ye()(r)&&r(l),l=l.slice(0,n),a=a.slice(0,n-o.length)),a.length>0&&this._onAdd(l,a),this._onInputChange("",e)}handleInputBlur(e){const{addOnBlur:t}=this._adapter.getProps();!0===t&&this._handleAddTags(e),this._adapter.setFocusing(!1),this._adapter.notifyBlur(e)}handleInputFocus(e){this._adapter.setFocusing(!0),this._adapter.notifyFocus(e)}handleClearEnterPress(e){dn(e)&&this.handleClearBtn(e)}handleClearBtn(e){const{inputValue:t,tagsArray:n}=this._adapter.getStates();n.length>0&&(this._adapter.setTagsArray([]),this._adapter.notifyTagChange([])),t.length>0&&this._onInputChange("",e),e.stopPropagation()}handleTagClose(e){const{tagsArray:t}=this._adapter.getStates(),n=[...t];n.splice(e,1);const r=t[e];this._onRemove(n,r,e)}handleInputMouseEnter(){this._adapter.setHovering(!0)}handleInputMouseLeave(){this._adapter.setHovering(!1)}handleClick(e){const{disabled:t}=this.getProps();if(t)return;this._adapter.getClickOutsideHandler()||(this._adapter.setActive(!0),this._adapter.registerClickOutsideHandler((e=>this.clickOutsideCallBack())))}clickOutsideCallBack(){this._adapter.unregisterClickOutsideHandler(),this._adapter.setActive(!1)}handleClickPrefixOrSuffix(e){const{disabled:t}=this._adapter.getProps(),{isFocus:n}=this._adapter.getStates();t||n||this._adapter.toggleFocusing(!0)}handlePreventMouseDown(e){e&&ye()(e.preventDefault)&&e.preventDefault()}_onRemove(e,t,n){this._isControlledComponent()||this._adapter.setTagsArray(e),this._adapter.notifyTagChange(e),this._adapter.notifyTagRemove(t,n)}_onAdd(e,t){this._isControlledComponent()||this._adapter.setTagsArray(e),this._adapter.notifyTagChange(e),this._adapter.notifyTagAdd(t)}_onInputChange(e,t){this._adapter.setInputValue(e),this._adapter.notifyInputChange(e,t)}handleSortEnd(e){const{oldIndex:t,newIndex:n}=e,{tagsArray:r}=this.getStates(),i=nh(r,t,n);this._isControlledComponent()||this._adapter.setTagsArray(i),this._adapter.notifyTagChange(i)}};const ih=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),d.createElement("path",{d:"M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),d.createElement("path",{d:"M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",fill:"currentColor"}),d.createElement("path",{d:"M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),d.createElement("path",{d:"M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",fill:"currentColor"}),d.createElement("path",{d:"M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}))}),"handle");const sh="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function oh(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function ah(e){return"nodeType"in e}function lh(e){var t,n;return e?oh(e)?e:ah(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function ch(e){const{Document:t}=lh(e);return e instanceof t}function dh(e){return!oh(e)&&e instanceof lh(e).HTMLElement}function hh(e){return e instanceof lh(e).SVGElement}function uh(e){return e?oh(e)?e.document:ah(e)?ch(e)?e:dh(e)||hh(e)?e.ownerDocument:document:document:document}const ph=sh?d.useLayoutEffect:d.useEffect;function fh(e){const t=(0,d.useRef)(e);return ph((()=>{t.current=e})),(0,d.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function mh(e,t){void 0===t&&(t=[e]);const n=(0,d.useRef)(e);return ph((()=>{n.current!==e&&(n.current=e)}),t),n}function gh(e,t){const n=(0,d.useRef)();return(0,d.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function yh(e){const t=fh(e),n=(0,d.useRef)(null),r=(0,d.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,r]}function vh(e){const t=(0,d.useRef)();return(0,d.useEffect)((()=>{t.current=e}),[e]),t.current}let bh={};function wh(e,t){return(0,d.useMemo)((()=>{if(t)return t;const n=null==bh[e]?0:bh[e]+1;return bh[e]=n,e+"-"+n}),[e,t])}function xh(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce(((t,n)=>{const r=Object.entries(n);for(const[n,i]of r){const r=t[n];null!=r&&(t[n]=r+e*i)}return t}),{...t})}}const Eh=xh(1),Ch=xh(-1);function Sh(e){if(!e)return!1;const{KeyboardEvent:t}=lh(e.target);return t&&e instanceof t}function _h(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=lh(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const kh=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[kh.Translate.toString(e),kh.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Oh="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Th(e){return e.matches(Oh)?e:e.querySelector(Oh)}const Ph={display:"none"};function Ih(e){let{id:t,value:n}=e;return h().createElement("div",{id:t,style:Ph},n)}function Mh(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return h().createElement("div",{id:t,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const Rh=(0,d.createContext)(null);const Ah={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Nh={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Dh(e){let{announcements:t=Nh,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Ah}=e;const{announce:s,announcement:o}=function(){const[e,t]=(0,d.useState)("");return{announce:(0,d.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),a=wh("DndLiveRegion"),[l,c]=(0,d.useState)(!1);if((0,d.useEffect)((()=>{c(!0)}),[]),function(e){const t=(0,d.useContext)(Rh);(0,d.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}((0,d.useMemo)((()=>({onDragStart(e){let{active:n}=e;s(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&s(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;s(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;s(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;s(t.onDragCancel({active:n,over:r}))}})),[s,t])),!l)return null;const u=h().createElement(h().Fragment,null,h().createElement(Ih,{id:r,value:i.draggable}),h().createElement(Mh,{id:a,announcement:o}));return n?(0,Ge.createPortal)(u,n):u}var Lh;function Fh(){}function jh(e,t){return(0,d.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Lh||(Lh={}));const $h=Object.freeze({x:0,y:0});function Bh(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Vh(e,t){const n=_h(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function zh(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Hh(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Uh(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Kh(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function Wh(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Gh=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=Wh(t,t.left,t.top),s=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Bh(Wh(r),i);s.push({id:t,data:{droppableContainer:e,value:n}})}}return s.sort(zh)};function qh(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),o=i-r,a=s-n;if(r<i&&n<s){const n=t.width*t.height,r=e.width*e.height,i=o*a;return Number((i/(n+r-i)).toFixed(4))}return 0}const Xh=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const e of r){const{id:r}=e,s=n.get(r);if(s){const n=qh(s,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(Hh)};function Yh(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:$h}function Zh(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const Jh=Zh(1);function Qh(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const eu={ignoreTransform:!1};function tu(e,t){void 0===t&&(t=eu);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=lh(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=Qh(t);if(!r)return e;const{scaleX:i,scaleY:s,x:o,y:a}=r,l=e.left-o-(1-i)*parseFloat(n),c=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),d=i?e.width/i:e.width,h=s?e.height/s:e.height;return{width:d,height:h,top:c,right:l+d,bottom:c+h,left:l}}(n,t,r))}const{top:r,left:i,width:s,height:o,bottom:a,right:l}=n;return{top:r,left:i,width:s,height:o,bottom:a,right:l}}function nu(e){return tu(e,{ignoreTransform:!0})}function ru(e,t){const n=[];return e?function r(i){if(null!=t&&n.length>=t)return n;if(!i)return n;if(ch(i)&&null!=i.scrollingElement&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!dh(i)||hh(i))return n;if(n.includes(i))return n;const s=lh(e).getComputedStyle(i);return i!==e&&function(e,t){void 0===t&&(t=lh(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(i,s)&&n.push(i),function(e,t){return void 0===t&&(t=lh(e).getComputedStyle(e)),"fixed"===t.position}(i,s)?n:r(i.parentNode)}(e):n}function iu(e){const[t]=ru(e,1);return null!=t?t:null}function su(e){return sh&&e?oh(e)?e:ah(e)?ch(e)||e===uh(e).scrollingElement?window:dh(e)?e:null:null:null}function ou(e){return oh(e)?e.scrollX:e.scrollLeft}function au(e){return oh(e)?e.scrollY:e.scrollTop}function lu(e){return{x:ou(e),y:au(e)}}var cu;function du(e){return!(!sh||!e)&&e===document.scrollingElement}function hu(e){const t={x:0,y:0},n=du(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(cu||(cu={}));const uu={x:.2,y:.2};function pu(e,t,n,r,i){let{top:s,left:o,right:a,bottom:l}=n;void 0===r&&(r=10),void 0===i&&(i=uu);const{isTop:c,isBottom:d,isLeft:h,isRight:u}=hu(e),p={x:0,y:0},f={x:0,y:0},m=t.height*i.y,g=t.width*i.x;return!c&&s<=t.top+m?(p.y=cu.Backward,f.y=r*Math.abs((t.top+m-s)/m)):!d&&l>=t.bottom-m&&(p.y=cu.Forward,f.y=r*Math.abs((t.bottom-m-l)/m)),!u&&a>=t.right-g?(p.x=cu.Forward,f.x=r*Math.abs((t.right-g-a)/g)):!h&&o<=t.left+g&&(p.x=cu.Backward,f.x=r*Math.abs((t.left+g-o)/g)),{direction:p,speed:f}}function fu(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function mu(e){return e.reduce(((e,t)=>Eh(e,lu(t))),$h)}function gu(e,t){if(void 0===t&&(t=tu),!e)return;const{top:n,left:r,bottom:i,right:s}=t(e);iu(e)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const yu=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+ou(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+au(t)),0)}]];class vu{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ru(t),r=mu(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,i]of yu)for(const s of t)Object.defineProperty(this,s,{get:()=>{const t=i(n),o=r[e]-t;return this.rect[s]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class bu{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function wu(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var xu,Eu;function Cu(e){e.preventDefault()}function Su(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(xu||(xu={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(Eu||(Eu={}));const _u={start:[Eu.Space,Eu.Enter],cancel:[Eu.Esc],end:[Eu.Space,Eu.Enter]},ku=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Eu.Right:return{...n,x:n.x+25};case Eu.Left:return{...n,x:n.x-25};case Eu.Down:return{...n,y:n.y+25};case Eu.Up:return{...n,y:n.y-25}}};class Ou{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new bu(uh(t)),this.windowListeners=new bu(lh(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xu.Resize,this.handleCancel),this.windowListeners.add(xu.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(xu.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&gu(n),t($h)}handleKeyDown(e){if(Sh(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:i=_u,coordinateGetter:s=ku,scrollBehavior:o="smooth"}=r,{code:a}=e;if(i.end.includes(a))return void this.handleEnd(e);if(i.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:$h;this.referenceCoordinates||(this.referenceCoordinates=c);const d=s(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=Ch(d,c),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(const n of i){const i=e.code,{isTop:s,isRight:a,isLeft:l,isBottom:c,maxScroll:h,minScroll:u}=hu(n),p=fu(n),f={x:Math.min(i===Eu.Right?p.right-p.width/2:p.right,Math.max(i===Eu.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(i===Eu.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Eu.Down?p.top:p.top+p.height/2,d.y))},m=i===Eu.Right&&!a||i===Eu.Left&&!l,g=i===Eu.Down&&!c||i===Eu.Up&&!s;if(m&&f.x!==d.x){const e=n.scrollLeft+t.x,s=i===Eu.Right&&e<=h.x||i===Eu.Left&&e>=u.x;if(s&&!t.y)return void n.scrollTo({left:e,behavior:o});r.x=s?n.scrollLeft-e:i===Eu.Right?n.scrollLeft-h.x:n.scrollLeft-u.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&f.y!==d.y){const e=n.scrollTop+t.y,s=i===Eu.Down&&e<=h.y||i===Eu.Up&&e>=u.y;if(s&&!t.x)return void n.scrollTo({top:e,behavior:o});r.y=s?n.scrollTop-e:i===Eu.Down?n.scrollTop-h.y:n.scrollTop-u.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,Eh(Ch(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Tu(e){return Boolean(e&&"distance"in e)}function Pu(e){return Boolean(e&&"delay"in e)}Ou.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=_u,onActivation:i}=t,{active:s}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const t=s.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==i||i({event:e.nativeEvent}),!0)}return!1}}];class Iu{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=lh(e);return e instanceof t?e:uh(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:i}=e,{target:s}=i;this.props=e,this.events=t,this.document=uh(s),this.documentListeners=new bu(this.document),this.listeners=new bu(n),this.windowListeners=new bu(lh(s)),this.initialCoordinates=null!=(r=_h(i))?r:$h,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(xu.Resize,this.handleCancel),this.windowListeners.add(xu.DragStart,Cu),this.windowListeners.add(xu.VisibilityChange,this.handleCancel),this.windowListeners.add(xu.ContextMenu,Cu),this.documentListeners.add(xu.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Pu(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(Tu(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(xu.Click,Su,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xu.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:i}=this,{onMove:s,options:{activationConstraint:o}}=i;if(!r)return;const a=null!=(t=_h(e))?t:$h,l=Ch(r,a);if(!n&&o){if(Tu(o)){if(null!=o.tolerance&&wu(l,o.tolerance))return this.handleCancel();if(wu(l,o.distance))return this.handleStart()}return Pu(o)&&wu(l,o.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),s(a)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Eu.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Mu={move:{name:"pointermove"},end:{name:"pointerup"}};class Ru extends Iu{constructor(e){const{event:t}=e,n=uh(t.target);super(e,Mu,n)}}Ru.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const Au={move:{name:"mousemove"},end:{name:"mouseup"}};var Nu;!function(e){e[e.RightClick=2]="RightClick"}(Nu||(Nu={}));class Du extends Iu{constructor(e){super(e,Au,uh(e.event.target))}}Du.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Nu.RightClick&&(null==r||r({event:n}),!0)}}];const Lu={move:{name:"touchmove"},end:{name:"touchend"}};class Fu extends Iu{constructor(e){super(e,Lu)}static setup(){return window.addEventListener(Lu.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Lu.move.name,e)};function e(){}}}var ju,$u;function Bu(e){let{acceleration:t,activator:n=ju.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:o=5,order:a=$u.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:h,delta:u,threshold:p}=e;const f=function(e){let{delta:t,disabled:n}=e;const r=vh(t);return gh((e=>{if(n||!r||!e)return Vu;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[cu.Backward]:e.x[cu.Backward]||-1===i.x,[cu.Forward]:e.x[cu.Forward]||1===i.x},y:{[cu.Backward]:e.y[cu.Backward]||-1===i.y,[cu.Forward]:e.y[cu.Forward]||1===i.y}}}),[n,t,r])}({delta:u,disabled:!s}),[m,g]=function(){const e=(0,d.useRef)(null),t=(0,d.useCallback)(((t,n)=>{e.current=setInterval(t,n)}),[]);return[t,(0,d.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),y=(0,d.useRef)({x:0,y:0}),v=(0,d.useRef)({x:0,y:0}),b=(0,d.useMemo)((()=>{switch(n){case ju.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case ju.DraggableRect:return i}}),[n,i,l]),w=(0,d.useRef)(null),x=(0,d.useCallback)((()=>{const e=w.current;if(!e)return;const t=y.current.x*v.current.x,n=y.current.y*v.current.y;e.scrollBy(t,n)}),[]),E=(0,d.useMemo)((()=>a===$u.TreeOrder?[...c].reverse():c),[a,c]);(0,d.useEffect)((()=>{if(s&&c.length&&b){for(const e of E){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),i=h[n];if(!i)continue;const{direction:s,speed:a}=pu(e,i,b,t,p);for(const e of["x","y"])f[e][s[e]]||(a[e]=0,s[e]=0);if(a.x>0||a.y>0)return g(),w.current=e,m(x,o),y.current=a,void(v.current=s)}y.current={x:0,y:0},v.current={x:0,y:0},g()}else g()}),[t,x,r,g,s,o,JSON.stringify(b),JSON.stringify(f),m,c,E,h,JSON.stringify(p)])}Fu.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return!(i.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(ju||(ju={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}($u||($u={}));const Vu={x:{[cu.Backward]:!1,[cu.Forward]:!1},y:{[cu.Backward]:!1,[cu.Forward]:!1}};var zu,Hu;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(zu||(zu={})),function(e){e.Optimized="optimized"}(Hu||(Hu={}));const Uu=new Map;function Ku(e,t){return gh((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Wu(e){let{callback:t,disabled:n}=e;const r=fh(t),i=(0,d.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)}),[n]);return(0,d.useEffect)((()=>()=>null==i?void 0:i.disconnect()),[i]),i}function Gu(e){return new vu(tu(e),e)}function qu(e,t,n){void 0===t&&(t=Gu);const[r,i]=(0,d.useReducer)((function(r){if(!e)return null;var i;if(!1===e.isConnected)return null!=(i=null!=r?r:n)?i:null;const s=t(e);if(JSON.stringify(r)===JSON.stringify(s))return r;return s}),null),s=function(e){let{callback:t,disabled:n}=e;const r=fh(t),i=(0,d.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)}),[r,n]);return(0,d.useEffect)((()=>()=>null==i?void 0:i.disconnect()),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),o=Wu({callback:i});return ph((()=>{i(),e?(null==o||o.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==o||o.disconnect(),null==s||s.disconnect())}),[e]),r}const Xu=[];function Yu(e,t){void 0===t&&(t=[]);const n=(0,d.useRef)(null);return(0,d.useEffect)((()=>{n.current=null}),t),(0,d.useEffect)((()=>{const t=e!==$h;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?Ch(e,n.current):$h}function Zu(e){return(0,d.useMemo)((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Ju=[];function Qu(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return dh(t)?t:e}const ep=[{sensor:Ru,options:{}},{sensor:Ou,options:{}}],tp={current:{}},np={draggable:{measure:nu},droppable:{measure:nu,strategy:zu.WhileDragging,frequency:Hu.Optimized},dragOverlay:{measure:tu}};class rp extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const ip={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new rp,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Fh},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:np,measureDroppableContainers:Fh,windowRect:null,measuringScheduled:!1},sp={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Fh,draggableNodes:new Map,over:null,measureDroppableContainers:Fh},op=(0,d.createContext)(sp),ap=(0,d.createContext)(ip);function lp(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new rp}}}function cp(e,t){switch(t.type){case Lh.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Lh.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Lh.DragEnd:case Lh.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Lh.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new rp(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Lh.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const o=new rp(e.droppable.containers);return o.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Lh.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new rp(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function dp(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=(0,d.useContext)(op),s=vh(r),o=vh(null==n?void 0:n.id);return(0,d.useEffect)((()=>{if(!t&&!r&&s&&null!=o){if(!Sh(s))return;if(document.activeElement===s.target)return;const e=i.get(o);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Th(e);if(t){t.focus();break}}}))}}),[r,t,i,o,s]),null}function hp(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}const up=(0,d.createContext)({...$h,scaleX:1,scaleY:1});var pp;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(pp||(pp={}));const fp=(0,d.memo)((function(e){var t,n,r,i;let{id:s,accessibility:o,autoScroll:a=!0,children:l,sensors:c=ep,collisionDetection:u=Xh,measuring:p,modifiers:f,...m}=e;const g=(0,d.useReducer)(cp,void 0,lp),[y,v]=g,[b,w]=function(){const[e]=(0,d.useState)((()=>new Set)),t=(0,d.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]),n=(0,d.useCallback)((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]);return[n,t]}(),[x,E]=(0,d.useState)(pp.Uninitialized),C=x===pp.Initialized,{draggable:{active:S,nodes:_,translate:k},droppable:{containers:O}}=y,T=S?_.get(S):null,P=(0,d.useRef)({initial:null,translated:null}),I=(0,d.useMemo)((()=>{var e;return null!=S?{id:S,data:null!=(e=null==T?void 0:T.data)?e:tp,rect:P}:null}),[S,T]),M=(0,d.useRef)(null),[R,A]=(0,d.useState)(null),[N,D]=(0,d.useState)(null),L=mh(m,Object.values(m)),F=wh("DndDescribedBy",s),j=(0,d.useMemo)((()=>O.getEnabled()),[O]),$=(B=p,(0,d.useMemo)((()=>({draggable:{...np.draggable,...null==B?void 0:B.draggable},droppable:{...np.droppable,...null==B?void 0:B.droppable},dragOverlay:{...np.dragOverlay,...null==B?void 0:B.dragOverlay}})),[null==B?void 0:B.draggable,null==B?void 0:B.droppable,null==B?void 0:B.dragOverlay]));var B;const{droppableRects:V,measureDroppableContainers:z,measuringScheduled:H}=function(e,t){let{dragging:n,dependencies:r,config:i}=t;const[s,o]=(0,d.useState)(null),{frequency:a,measure:l,strategy:c}=i,h=(0,d.useRef)(e),u=function(){switch(c){case zu.Always:return!1;case zu.BeforeDragging:return n;default:return!n}}(),p=mh(u),f=(0,d.useCallback)((function(e){void 0===e&&(e=[]),p.current||o((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[p]),m=(0,d.useRef)(null),g=gh((t=>{if(u&&!n)return Uu;if(!t||t===Uu||h.current!==e||null!=s){const t=new Map;for(let n of e){if(!n)continue;if(s&&s.length>0&&!s.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new vu(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,s,n,u,l]);return(0,d.useEffect)((()=>{h.current=e}),[e]),(0,d.useEffect)((()=>{u||f()}),[n,u]),(0,d.useEffect)((()=>{s&&s.length>0&&o(null)}),[JSON.stringify(s)]),(0,d.useEffect)((()=>{u||"number"!=typeof a||null!==m.current||(m.current=setTimeout((()=>{f(),m.current=null}),a))}),[a,u,f,...r]),{droppableRects:g,measureDroppableContainers:f,measuringScheduled:null!=s}}(j,{dragging:C,dependencies:[k.x,k.y],config:$.droppable}),U=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return gh((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(_,S),K=(0,d.useMemo)((()=>N?_h(N):null),[N]),W=function(){const e=!1===(null==R?void 0:R.autoScrollEnabled),t="object"==typeof a?!1===a.enabled:!1===a,n=C&&!e&&!t;if("object"==typeof a)return{...a,enabled:n};return{enabled:n}}(),G=function(e,t){return Ku(e,t)}(U,$.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const s=(0,d.useRef)(!1),{x:o,y:a}="boolean"==typeof i?{x:i,y:i}:i;ph((()=>{if(!o&&!a||!t)return void(s.current=!1);if(s.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const i=Yh(n(e),r);if(o||(i.x=0),a||(i.y=0),s.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){const t=iu(e);t&&t.scrollBy({top:i.y,left:i.x})}}),[t,o,a,r,n])}({activeNode:S?_.get(S):null,config:W.layoutShiftCompensation,initialRect:G,measure:$.draggable.measure});const q=qu(U,$.draggable.measure,G),X=qu(U?U.parentElement:null),Y=(0,d.useRef)({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:V,draggableNodes:_,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Z=O.getNodeFor(null==(t=Y.current.over)?void 0:t.id),J=function(e){let{measure:t}=e;const[n,r]=(0,d.useState)(null),i=Wu({callback:(0,d.useCallback)((e=>{for(const{target:n}of e)if(dh(n)){r((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t])}),s=(0,d.useCallback)((e=>{const n=Qu(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)}),[t,i]),[o,a]=yh(s);return(0,d.useMemo)((()=>({nodeRef:o,rect:n,setRef:a})),[n,o,a])}({measure:$.dragOverlay.measure}),Q=null!=(n=J.nodeRef.current)?n:U,ee=C?null!=(r=J.rect)?r:q:null,te=Boolean(J.nodeRef.current&&J.rect),ne=Yh(re=te?null:q,Ku(re));var re;const ie=Zu(Q?lh(Q):null),se=function(e){const t=(0,d.useRef)(e),n=gh((n=>e?n&&n!==Xu&&e&&t.current&&e.parentNode===t.current.parentNode?n:ru(e):Xu),[e]);return(0,d.useEffect)((()=>{t.current=e}),[e]),n}(C?null!=Z?Z:U:null),oe=function(e,t){void 0===t&&(t=tu);const[n]=e,r=Zu(n?lh(n):null),[i,s]=(0,d.useReducer)((function(){return e.length?e.map((e=>du(e)?r:new vu(t(e),e))):Ju}),Ju),o=Wu({callback:s});return e.length>0&&i===Ju&&s(),ph((()=>{e.length?e.forEach((e=>null==o?void 0:o.observe(e))):(null==o||o.disconnect(),s())}),[e]),i}(se),ae=hp(f,{transform:{x:k.x-ne.x,y:k.y-ne.y,scaleX:1,scaleY:1},activatorEvent:N,active:I,activeNodeRect:q,containerNodeRect:X,draggingNodeRect:ee,over:Y.current.over,overlayNodeRect:J.rect,scrollableAncestors:se,scrollableAncestorRects:oe,windowRect:ie}),le=K?Eh(K,k):null,ce=function(e){const[t,n]=(0,d.useState)(null),r=(0,d.useRef)(e),i=(0,d.useCallback)((e=>{const t=su(e.target);t&&n((e=>e?(e.set(t,lu(t)),new Map(e)):null))}),[]);return(0,d.useEffect)((()=>{const t=r.current;if(e!==t){s(t);const o=e.map((e=>{const t=su(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,lu(t)]):null})).filter((e=>null!=e));n(o.length?new Map(o):null),r.current=e}return()=>{s(e),s(t)};function s(e){e.forEach((e=>{const t=su(e);null==t||t.removeEventListener("scroll",i)}))}}),[i,e]),(0,d.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>Eh(e,t)),$h):mu(e):$h),[e,t])}(se),de=Yu(ce),he=Yu(ce,[q]),ue=Eh(ae,de),pe=ee?Jh(ee,ae):null,fe=I&&pe?u({active:I,collisionRect:pe,droppableRects:V,droppableContainers:j,pointerCoordinates:le}):null,me=Kh(fe,"id"),[ge,ye]=(0,d.useState)(null),ve=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(te?ae:Eh(ae,he),null!=(i=null==ge?void 0:ge.rect)?i:null,q),be=(0,d.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==M.current)return;const i=_.get(M.current);if(!i)return;const s=e.nativeEvent,o=new n({active:M.current,activeNode:i,event:s,options:r,context:Y,onStart(e){const t=M.current;if(null==t)return;const n=_.get(t);if(!n)return;const{onDragStart:r}=L.current,i={active:{id:t,data:n.data,rect:P}};(0,Ge.unstable_batchedUpdates)((()=>{null==r||r(i),E(pp.Initializing),v({type:Lh.DragStart,initialCoordinates:e,active:t}),b({type:"onDragStart",event:i})}))},onMove(e){v({type:Lh.DragMove,coordinates:e})},onEnd:a(Lh.DragEnd),onCancel:a(Lh.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=Y.current;let o=null;if(t&&i){const{cancelDrop:a}=L.current;if(o={activatorEvent:s,active:t,collisions:n,delta:i,over:r},e===Lh.DragEnd&&"function"==typeof a){await Promise.resolve(a(o))&&(e=Lh.DragCancel)}}M.current=null,(0,Ge.unstable_batchedUpdates)((()=>{v({type:e}),E(pp.Uninitialized),ye(null),A(null),D(null);const t=e===Lh.DragEnd?"onDragEnd":"onDragCancel";if(o){const e=L.current[t];null==e||e(o),b({type:t,event:o})}}))}}(0,Ge.unstable_batchedUpdates)((()=>{A(o),D(e.nativeEvent)}))}),[_]),we=(0,d.useCallback)(((e,t)=>(n,r)=>{const i=n.nativeEvent,s=_.get(r);if(null!==M.current||!s||i.dndKit||i.defaultPrevented)return;const o={active:s};!0===e(n,t.options,o)&&(i.dndKit={capturedBy:t.sensor},M.current=r,be(n,t))}),[_,be]),xe=function(e,t){return(0,d.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(c,we);!function(e){(0,d.useEffect)((()=>{if(!sh)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(c),ph((()=>{q&&x===pp.Initializing&&E(pp.Initialized)}),[q,x]),(0,d.useEffect)((()=>{const{onDragMove:e}=L.current,{active:t,activatorEvent:n,collisions:r,over:i}=Y.current;if(!t||!n)return;const s={active:t,activatorEvent:n,collisions:r,delta:{x:ue.x,y:ue.y},over:i};(0,Ge.unstable_batchedUpdates)((()=>{null==e||e(s),b({type:"onDragMove",event:s})}))}),[ue.x,ue.y]),(0,d.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=Y.current;if(!e||null==M.current||!t||!i)return;const{onDragOver:s}=L.current,o=r.get(me),a=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:a};(0,Ge.unstable_batchedUpdates)((()=>{ye(a),null==s||s(l),b({type:"onDragOver",event:l})}))}),[me]),ph((()=>{Y.current={activatorEvent:N,active:I,activeNode:U,collisionRect:pe,collisions:fe,droppableRects:V,draggableNodes:_,draggingNode:Q,draggingNodeRect:ee,droppableContainers:O,over:ge,scrollableAncestors:se,scrollAdjustedTranslate:ue},P.current={initial:ee,translated:pe}}),[I,U,fe,pe,_,Q,ee,V,O,ge,se,ue]),Bu({...W,delta:k,draggingRect:pe,pointerCoordinates:le,scrollableAncestors:se,scrollableAncestorRects:oe});const Ee=(0,d.useMemo)((()=>({active:I,activeNode:U,activeNodeRect:q,activatorEvent:N,collisions:fe,containerNodeRect:X,dragOverlay:J,draggableNodes:_,droppableContainers:O,droppableRects:V,over:ge,measureDroppableContainers:z,scrollableAncestors:se,scrollableAncestorRects:oe,measuringConfiguration:$,measuringScheduled:H,windowRect:ie})),[I,U,q,N,fe,X,J,_,O,V,ge,z,se,oe,$,H,ie]),Ce=(0,d.useMemo)((()=>({activatorEvent:N,activators:xe,active:I,activeNodeRect:q,ariaDescribedById:{draggable:F},dispatch:v,draggableNodes:_,over:ge,measureDroppableContainers:z})),[N,xe,I,q,v,F,_,ge,z]);return h().createElement(Rh.Provider,{value:w},h().createElement(op.Provider,{value:Ce},h().createElement(ap.Provider,{value:Ee},h().createElement(up.Provider,{value:ve},l)),h().createElement(dp,{disabled:!1===(null==o?void 0:o.restoreFocus)})),h().createElement(Dh,{...o,hiddenTextDescribedById:F}))})),mp=(0,d.createContext)(null),gp="button",yp="Droppable";function vp(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const s=wh(yp),{activators:o,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:h,draggableNodes:u,over:p}=(0,d.useContext)(op),{role:f=gp,roleDescription:m="draggable",tabIndex:g=0}=null!=i?i:{},y=(null==l?void 0:l.id)===t,v=(0,d.useContext)(y?up:mp),[b,w]=yh(),[x,E]=yh(),C=function(e,t){return(0,d.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e}),{})),[e,t])}(o,t),S=mh(n);ph((()=>(u.set(t,{id:t,key:s,node:b,activatorNode:x,data:S}),()=>{const e=u.get(t);e&&e.key===s&&u.delete(t)})),[u,t]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:(0,d.useMemo)((()=>({role:f,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!y||f!==gp)||void 0,"aria-roledescription":m,"aria-describedby":h.draggable})),[r,f,g,y,m,h.draggable]),isDragging:y,listeners:r?void 0:C,node:b,over:p,setNodeRef:w,setActivatorNodeRef:E,transform:v}}function bp(){return(0,d.useContext)(ap)}const wp="Droppable",xp={timeout:25};function Ep(e){let{animation:t,children:n}=e;const[r,i]=(0,d.useState)(null),[s,o]=(0,d.useState)(null),a=vh(n);return n||r||!a||i(a),ph((()=>{if(!s)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,s)).then((()=>{i(null)})):i(null)}),[t,r,s]),h().createElement(h().Fragment,null,n,r?(0,d.cloneElement)(r,{ref:o}):null)}const Cp={x:0,y:0,scaleX:1,scaleY:1};function Sp(e){let{children:t}=e;return h().createElement(op.Provider,{value:sp},h().createElement(up.Provider,{value:Cp},t))}const _p={position:"fixed",touchAction:"none"},kp=e=>Sh(e)?"transform 250ms ease":void 0,Op=(0,d.forwardRef)(((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:s,className:o,rect:a,style:l,transform:c,transition:d=kp}=e;if(!a)return null;const u=i?c:{...c,scaleX:1,scaleY:1},p={..._p,width:a.width,height:a.height,top:a.top,left:a.left,transform:kh.Transform.toString(u),transformOrigin:i&&r?Vh(r,a):void 0,transition:"function"==typeof d?d(r):d,...l};return h().createElement(n,{className:o,style:p,ref:t},s)})),Tp=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:s,className:o}=e;if(null!=s&&s.active)for(const[e,t]of Object.entries(s.active))void 0!==t&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=s&&s.dragOverlay)for(const[e,t]of Object.entries(s.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=o&&o.active&&n.node.classList.add(o.active),null!=o&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[e,t]of Object.entries(i))n.node.style.setProperty(e,t);null!=o&&o.active&&n.node.classList.remove(o.active)}},Pp={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:kh.Transform.toString(t)},{transform:kh.Transform.toString(n)}]},sideEffects:Tp({styles:{active:{opacity:"0"}}})};function Ip(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return fh(((e,s)=>{if(null===t)return;const o=n.get(e);if(!o)return;const a=o.node.current;if(!a)return;const l=Qu(s);if(!l)return;const{transform:c}=lh(s).getComputedStyle(s),d=Qh(c);if(!d)return;const h="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...Pp,...e};return e=>{let{active:s,dragOverlay:o,transform:a,...l}=e;if(!t)return;const c={x:o.rect.left-s.rect.left,y:o.rect.top-s.rect.top},d={scaleX:1!==a.scaleX?s.rect.width*a.scaleX/o.rect.width:1,scaleY:1!==a.scaleY?s.rect.height*a.scaleY/o.rect.height:1},h={x:a.x-c.x,y:a.y-c.y,...d},u=i({...l,active:s,dragOverlay:o,transform:{initial:a,final:h}}),[p]=u,f=u[u.length-1];if(JSON.stringify(p)===JSON.stringify(f))return;const m=null==r?void 0:r({active:s,dragOverlay:o,...l}),g=o.node.animate(u,{duration:t,easing:n,fill:"forwards"});return new Promise((e=>{g.onfinish=()=>{null==m||m(),e()}}))}}(t);return gu(a,i.draggable.measure),h({active:{id:e,data:o.data,node:a,rect:i.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:s,rect:i.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:i,transform:d})}))}let Mp=0;function Rp(e){return(0,d.useMemo)((()=>{if(null!=e)return Mp++,Mp}),[e])}const Ap=h().memo((e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:s,modifiers:o,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:p,activeNodeRect:f,containerNodeRect:m,draggableNodes:g,droppableContainers:y,dragOverlay:v,over:b,measuringConfiguration:w,scrollableAncestors:x,scrollableAncestorRects:E,windowRect:C}=bp(),S=(0,d.useContext)(up),_=Rp(null==p?void 0:p.id),k=hp(o,{activatorEvent:u,active:p,activeNodeRect:f,containerNodeRect:m,draggingNodeRect:v.rect,over:b,overlayNodeRect:v.rect,scrollableAncestors:x,scrollableAncestorRects:E,transform:S,windowRect:C}),O=Ku(f),T=Ip({config:r,draggableNodes:g,droppableContainers:y,measuringConfiguration:w}),P=O?v.setRef:void 0;return h().createElement(Sp,null,h().createElement(Ep,{animation:T},p&&_?h().createElement(Op,{key:_,id:p.id,ref:P,as:a,activatorEvent:u,adjustScale:t,className:l,transition:s,rect:O,style:{zIndex:c,...i},transform:k},n):null))}));function Np(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Dp(e,t){return e.reduce(((e,n,r)=>{const i=t.get(n);return i&&(e[r]=i),e}),Array(e.length))}function Lp(e){return null!==e&&e>=0}const Fp=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const s=Np(t,r,n),o=t[i],a=s[i];return a&&o?{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}:null},jp={scaleX:1,scaleY:1},$p=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:s,overIndex:o}=e;const a=null!=(t=s[n])?t:r;if(!a)return null;if(i===n){const e=s[o];return e?{x:0,y:n<o?e.top+e.height-(a.top+a.height):e.top-a.top,...jp}:null}const l=function(e,t,n){const r=e[t],i=e[t-1],s=e[t+1];if(!r)return 0;if(n<t)return i?r.top-(i.top+i.height):s?s.top-(r.top+r.height):0;return s?s.top-(r.top+r.height):i?r.top-(i.top+i.height):0}(s,i,n);return i>n&&i<=o?{x:0,y:-a.height-l,...jp}:i<n&&i>=o?{x:0,y:a.height+l,...jp}:{x:0,y:0,...jp}};const Bp="Sortable",Vp=h().createContext({activeIndex:-1,containerId:Bp,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Fp,disabled:{draggable:!1,droppable:!1}});function zp(e){let{children:t,id:n,items:r,strategy:i=Fp,disabled:s=!1}=e;const{active:o,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=bp(),p=wh(Bp,n),f=Boolean(null!==a.rect),m=(0,d.useMemo)((()=>r.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[r]),g=null!=o,y=o?m.indexOf(o.id):-1,v=c?m.indexOf(c.id):-1,b=(0,d.useRef)(m),w=!function(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]!==t[n])return!1;return!0}(m,b.current),x=-1!==v&&-1===y||w,E=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(s);ph((()=>{w&&g&&u(m)}),[w,m,g,u]),(0,d.useEffect)((()=>{b.current=m}),[m]);const C=(0,d.useMemo)((()=>({activeIndex:y,containerId:p,disabled:E,disableTransforms:x,items:m,overIndex:v,useDragOverlay:f,sortedRects:Dp(m,l),strategy:i})),[y,p,E.draggable,E.droppable,x,m,v,l,f,i]);return h().createElement(Vp.Provider,{value:C},t)}const Hp=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Np(n,r,i).indexOf(t)},Up=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:s,newIndex:o,previousItems:a,previousContainerId:l,transition:c}=e;return!(!c||!r)&&((a===s||i!==o)&&(!!n||o!==i&&t===l))},Kp={duration:200,easing:"ease"},Wp="transform",Gp=kh.Transition.toString({property:Wp,duration:0,easing:"linear"}),qp={roleDescription:"sortable"};function Xp(e){let{animateLayoutChanges:t=Up,attributes:n,disabled:r,data:i,getNewIndex:s=Hp,id:o,strategy:a,resizeObserverConfig:l,transition:c=Kp}=e;const{items:h,containerId:u,activeIndex:p,disabled:f,disableTransforms:m,sortedRects:g,overIndex:y,useDragOverlay:v,strategy:b}=(0,d.useContext)(Vp),w=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,f),x=h.indexOf(o),E=(0,d.useMemo)((()=>({sortable:{containerId:u,index:x,items:h},...i})),[u,i,x,h]),C=(0,d.useMemo)((()=>h.slice(h.indexOf(o))),[h,o]),{rect:S,node:_,isOver:k,setNodeRef:O}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const s=wh(wp),{active:o,dispatch:a,over:l,measureDroppableContainers:c}=(0,d.useContext)(op),h=(0,d.useRef)({disabled:n}),u=(0,d.useRef)(!1),p=(0,d.useRef)(null),f=(0,d.useRef)(null),{disabled:m,updateMeasurementsFor:g,timeout:y}={...xp,...i},v=mh(null!=g?g:r),b=Wu({callback:(0,d.useCallback)((()=>{u.current?(null!=f.current&&clearTimeout(f.current),f.current=setTimeout((()=>{c(Array.isArray(v.current)?v.current:[v.current]),f.current=null}),y)):u.current=!0}),[y]),disabled:m||!o}),w=(0,d.useCallback)(((e,t)=>{b&&(t&&(b.unobserve(t),u.current=!1),e&&b.observe(e))}),[b]),[x,E]=yh(w),C=mh(t);return(0,d.useEffect)((()=>{b&&x.current&&(b.disconnect(),u.current=!1,b.observe(x.current))}),[x,b]),ph((()=>(a({type:Lh.RegisterDroppable,element:{id:r,key:s,disabled:n,node:x,rect:p,data:C}}),()=>a({type:Lh.UnregisterDroppable,key:s,id:r}))),[r]),(0,d.useEffect)((()=>{n!==h.current.disabled&&(a({type:Lh.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)}),[r,s,n,a]),{active:o,rect:p,isOver:(null==l?void 0:l.id)===r,node:x,over:l,setNodeRef:E}}({id:o,data:E,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...l}}),{active:T,activatorEvent:P,activeNodeRect:I,attributes:M,setNodeRef:R,listeners:A,isDragging:N,over:D,setActivatorNodeRef:L,transform:F}=vp({id:o,data:E,attributes:{...qp,...n},disabled:w.draggable}),j=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,d.useMemo)((()=>e=>{t.forEach((t=>t(e)))}),t)}(O,R),$=Boolean(T),B=$&&!m&&Lp(p)&&Lp(y),V=!v&&N,z=V&&B?F:null,H=B?null!=z?z:(null!=a?a:b)({rects:g,activeNodeRect:I,activeIndex:p,overIndex:y,index:x}):null,U=Lp(p)&&Lp(y)?s({id:o,items:h,activeIndex:p,overIndex:y}):x,K=null==T?void 0:T.id,W=(0,d.useRef)({activeId:K,items:h,newIndex:U,containerId:u}),G=h!==W.current.items,q=t({active:T,containerId:u,isDragging:N,isSorting:$,id:o,index:x,items:h,newIndex:W.current.newIndex,previousItems:W.current.items,previousContainerId:W.current.containerId,transition:c,wasDragging:null!=W.current.activeId}),X=function(e){let{disabled:t,index:n,node:r,rect:i}=e;const[s,o]=(0,d.useState)(null),a=(0,d.useRef)(n);return ph((()=>{if(!t&&n!==a.current&&r.current){const e=i.current;if(e){const t=tu(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==a.current&&(a.current=n)}),[t,n,r,i]),(0,d.useEffect)((()=>{s&&o(null)}),[s]),s}({disabled:!q,index:x,node:_,rect:S});return(0,d.useEffect)((()=>{$&&W.current.newIndex!==U&&(W.current.newIndex=U),u!==W.current.containerId&&(W.current.containerId=u),h!==W.current.items&&(W.current.items=h)}),[$,U,u,h]),(0,d.useEffect)((()=>{if(K===W.current.activeId)return;if(K&&!W.current.activeId)return void(W.current.activeId=K);const e=setTimeout((()=>{W.current.activeId=K}),50);return()=>clearTimeout(e)}),[K]),{active:T,activeIndex:p,attributes:M,data:E,rect:S,index:x,newIndex:U,items:h,isOver:k,isSorting:$,isDragging:N,listeners:A,node:_,overIndex:y,over:D,setNodeRef:j,setActivatorNodeRef:L,setDroppableNodeRef:O,setDraggableNodeRef:R,transform:null!=X?X:H,transition:function(){if(X||G&&W.current.newIndex===x)return Gp;if(V&&!Sh(P)||!c)return;if($||q)return kh.Transition.toString({...c,property:Wp});return}()}}function Yp(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Zp=[Eu.Down,Eu.Right,Eu.Up,Eu.Left];function Jp(e,t){return!(!Yp(e)||!Yp(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const Qp="semi-sortable";function ef(e){return h().createElement("div",Object.assign({style:{overflow:"auto"}},e))}const tf={coordinateGetter:(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:s,over:o,scrollableAncestors:a}}=t;if(Zp.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];s.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const s=i.get(n.id);if(s)switch(e.code){case Eu.Down:r.top<s.top&&t.push(n);break;case Eu.Up:r.top>s.top&&t.push(n);break;case Eu.Left:r.left>s.left&&t.push(n);break;case Eu.Right:r.left<s.left&&t.push(n)}}));const l=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=Uh(t),s=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Uh(r),o=i.reduce(((e,t,r)=>e+Bh(n[r],t)),0),a=Number((o/4).toFixed(4));s.push({id:t,data:{droppableContainer:e,value:a}})}}return s.sort(zh)})({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null});let c=Kh(l,"id");if(c===(null==o?void 0:o.id)&&l.length>1&&(c=l[1].id),null!=c){const e=s.get(n.id),t=s.get(c),o=t?i.get(t.id):null,l=null==t?void 0:t.node.current;if(l&&o&&e&&t){const n=ru(l).some(((e,t)=>a[t]!==e)),i=Jp(e,t),s=function(e,t){if(!Yp(e)||!Yp(t))return!1;if(!Jp(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),c=n||!i?{x:0,y:0}:{x:s?r.width-o.width:0,y:s?r.height-o.height:0},d={x:o.left,y:o.top};return c.x&&c.y?d:Ch(d,c)}}}}};function nf(e){let{items:t,onSortEnd:n,adjustScale:r,renderItem:i,transition:s,collisionDetection:o=Gh,strategy:a=Fp,useDragOverlay:l=!0,dragOverlayCls:c,container:u=ef,prefix:p=Qp}=e;const[f,m]=(0,d.useState)(null),g=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,d.useMemo)((()=>[...t].filter((e=>null!=e))),[...t])}(jh(Du),jh(Fu),jh(Ou,tf)),y=(0,d.useCallback)((e=>t.indexOf(e)),[t]),v=(0,d.useMemo)((()=>f?y(f):-1),[y,f]),b=(0,d.useCallback)((e=>{let{active:t}=e;t&&m(t.id)}),[]),w=(0,d.useCallback)((e=>{let{over:t}=e;if(m(null),t){const e=y(t.id);v!==e&&n({oldIndex:v,newIndex:e})}}),[v,y,n]),x=(0,d.useCallback)((()=>{m(null)}),[]);return h().createElement(fp,{sensors:g,collisionDetection:o,onDragStart:b,onDragEnd:w,onDragCancel:x,autoScroll:{order:$u.ReversedTreeOrder}},h().createElement(zp,{items:t,strategy:a},h().createElement(u,null,t.map(((e,t)=>h().createElement(rf,{key:e,id:e,index:t,renderItem:i,useDragOverlay:l,prefix:p,transition:s}))))),l?(0,Ge.createPortal)(h().createElement(Ap,{adjustScale:r,style:{zIndex:void 0},className:c},f?i({id:f,sortableHandle:e=>e}):null),document.body):null)}function rf(e){let{animateLayoutChanges:t,id:n,renderItem:r,prefix:i,transition:s}=e;const{listeners:o,setNodeRef:a,transform:l,transition:c,active:u,isOver:p,attributes:f}=Xp({id:n,animateLayoutChanges:t,transition:s}),m=(0,d.useCallback)((e=>()=>h().createElement("span",Object.assign({},o,{style:{lineHeight:0},onMouseDown:e=>{o.onMouseDown(e),e.preventDefault(),e.stopPropagation()}}),h().createElement(e,null))),[o]),g=w()(`${i}-sortable-item`,{[`${i}-sortable-item-over`]:p,[`${i}-sortable-item-active`]:(null==u?void 0:u.id)===n}),y=(0,d.useMemo)((()=>be()(s)?void 0:{transform:kh.Transform.toString(Object.assign(Object.assign({},l),{scaleX:1,scaleY:1})),transition:c}),[s,l,c]);return h().createElement("div",Object.assign({ref:a,style:y,className:g},f),r({id:n,sortableHandle:m}))}var sf=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const of=Jd.PREFIX;function af(e){return h().createElement("div",Object.assign({className:`${of}-sortable-list`},e))}class lf extends f{constructor(e){var t;super(e),t=this,this.updateInputWidth=()=>{const e=this.inputRef&&this.inputRef.current,t=this.inputMirrorRef&&this.inputMirrorRef.current,{inputValue:n,tagsArray:r}=this.state,{placeholder:i}=this.props;if(!e||!t)return;if(!n)return void(void 0!==this.state.inputWidth&&this.setState({inputWidth:void 0}));try{const n=window.getComputedStyle(e);t.style.font=n.font,t.style.letterSpacing=n.letterSpacing,t.style.textTransform=n.textTransform,t.style.paddingLeft=n.paddingLeft,t.style.paddingRight=n.paddingRight,t.style.borderLeftWidth=n.borderLeftWidth,t.style.borderRightWidth=n.borderRightWidth,t.style.boxSizing=n.boxSizing}catch(e){}const s=n||(0===(null==r?void 0:r.length)?i:"")||" ";t.textContent!==String(s)&&(t.textContent=String(s));const o=Math.ceil(t.scrollWidth+2);Number.isFinite(o)&&o>0&&o!==this.state.inputWidth&&this.setState({inputWidth:o})},this.handleInputChange=e=>{this.foundation.handleInputChange(e)},this.handleKeyDown=e=>{this.foundation.handleKeyDown(e)},this.handleInputFocus=e=>{this.foundation.handleInputFocus(e)},this.handleInputBlur=e=>{this.foundation.handleInputBlur(e)},this.handleClearBtn=e=>{this.foundation.handleClearBtn(e)},this.handleClearEnterPress=e=>{this.foundation.handleClearEnterPress(e)},this.handleTagClose=e=>{this.foundation.handleTagClose(e)},this.handleInputMouseLeave=e=>{this.foundation.handleInputMouseLeave()},this.handleClick=e=>{this.foundation.handleClick(e)},this.handleInputMouseEnter=e=>{this.foundation.handleInputMouseEnter()},this.handleClickPrefixOrSuffix=e=>{this.foundation.handleClickPrefixOrSuffix(e)},this.handlePreventMouseDown=e=>{this.foundation.handlePreventMouseDown(e)},this.getAllTags=()=>{const{tagsArray:e}=this.state;return e.map(((e,t)=>this.renderTag(e,t)))},this.renderTag=(e,n,r)=>{const{size:i,disabled:s,renderTagItem:o,showContentTooltip:a,draggable:l}=this.props,{active:c}=this.state,d=c&&l,u=w()(`${of}-wrapper-tag`,{[`${of}-wrapper-tag-size-${i}`]:i,[`${of}-wrapper-tag-icon`]:d}),p=w()(`${of}-wrapper-typo`,{[`${of}-wrapper-typo-disabled`]:s}),f=w()({[`${of}-drag-item`]:d,[`${of}-wrapper-tag-icon`]:d}),m=r&&r((()=>h().createElement(ih,{className:`${of}-drag-handler`}))),g=d?e:`${n}${e}`,y=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];r[1]&&"function"==typeof r[1].preventDefault&&r[1].preventDefault(),!s&&t.handleTagClose(n)};return ye()(o)?d&&r?h().createElement("div",{className:f,key:g},h().createElement(m,null),o(e,n,y)):o(e,n,y):h().createElement(Zd,{className:u,color:"white",size:"small"===i?"small":"large",type:"light",onClose:y,closable:!s,key:g,visible:!0,"aria-label":`${s?"":"Closable "}Tag: ${e}`},d&&r?h().createElement(m,null):null,h().createElement(jn,{className:p,ellipsis:{showTooltip:a,rows:1}},e))},this.renderSortTag=e=>{const{id:t,sortableHandle:n}=e,{tagsArray:r}=this.state,i=r.indexOf(t);return this.renderTag(t,i,n)},this.onSortEnd=e=>{this.foundation.handleSortEnd(e)},this.handleInputCompositionStart=e=>{this.foundation.handleInputCompositionStart(e)},this.handleInputCompositionEnd=e=>{this.foundation.handleInputCompositionEnd(e)},this.foundation=new rh(this.adapter),this.state={tagsArray:e.defaultValue||[],inputValue:"",inputWidth:void 0,focusing:!1,hovering:!1,active:!1,entering:!1},this.inputRef=h().createRef(),this.tagInputRef=h().createRef(),this.inputMirrorRef=h().createRef(),this.clickOutsideHandler=null}static getDerivedStateFromProps(e,t){const{value:n,inputValue:r}=e,{tagsArray:i}=t;let s;return s=M()(n)?n:"value"in e&&!n?[]:i,{tagsArray:s,inputValue:xe()(r)?r:t.inputValue}}get adapter(){return Object.assign(Object.assign({},super.adapter),{setInputValue:e=>{this.setState({inputValue:e})},setTagsArray:e=>{this.setState({tagsArray:e})},setFocusing:e=>{this.setState({focusing:e})},toggleFocusing:e=>{const{preventScroll:t}=this.props,n=this.inputRef&&this.inputRef.current;e?n&&n.focus({preventScroll:t}):n&&n.blur(),this.setState({focusing:e})},setHovering:e=>{this.setState({hovering:e})},setActive:e=>{this.setState({active:e})},setEntering:e=>{this.setState({entering:e})},getClickOutsideHandler:()=>this.clickOutsideHandler,notifyBlur:e=>{this.props.onBlur(e)},notifyFocus:e=>{this.props.onFocus(e)},notifyInputChange:(e,t)=>{this.props.onInputChange(e,t)},notifyTagChange:e=>{this.props.onChange(e)},notifyTagAdd:e=>{this.props.onAdd(e)},notifyTagRemove:(e,t)=>{this.props.onRemove(e,t)},notifyKeyDown:e=>{this.props.onKeyDown(e)},registerClickOutsideHandler:e=>{const t=t=>{const n=this.tagInputRef&&this.tagInputRef.current,r=t.target,i=t.composedPath&&t.composedPath()||[r];!n||n.contains(r)||i.includes(n)||e(t)};this.clickOutsideHandler=t,document.addEventListener("click",t,!1)},unregisterClickOutsideHandler:()=>{document.removeEventListener("click",this.clickOutsideHandler,!1),this.clickOutsideHandler=null}})}componentDidMount(){const{disabled:e,autoFocus:t,preventScroll:n}=this.props;!e&&t&&(this.inputRef.current.focus({preventScroll:n}),this.foundation.handleClick()),this.foundation.init(),this.updateInputWidth()}componentDidUpdate(e,t){var n,r;t.inputValue===this.state.inputValue&&e.size===this.props.size&&e.placeholder===this.props.placeholder&&(null===(n=t.tagsArray)||void 0===n?void 0:n.length)===(null===(r=this.state.tagsArray)||void 0===r?void 0:r.length)||this.updateInputWidth()}renderClearBtn(){const{hovering:e,tagsArray:t,inputValue:n}=this.state,{showClear:r,disabled:i,clearIcon:s}=this.props,o=w()(`${of}-clearBtn`,{[`${of}-clearBtn-invisible`]:!e||""===n&&0===t.length||i});return r?h().createElement("div",{role:"button",tabIndex:0,"aria-label":"Clear TagInput value",className:o,onClick:e=>this.handleClearBtn(e),onKeyPress:e=>this.handleClearEnterPress(e)},s||h().createElement(gr,null)):null}renderPrefix(){const{prefix:e,insetLabel:t,insetLabelId:n}=this.props,r=e||t;if(be()(r)||_e()(r))return null;const i=w()(`${of}-prefix`,{[`${of}-inset-label`]:t,[`${of}-prefix-text`]:r&&xe()(r),[`${of}-prefix-icon`]:oe(r)});return h().createElement("div",{className:i,onMouseDown:this.handlePreventMouseDown,onClick:this.handleClickPrefixOrSuffix,id:n,"x-semi-prop":"prefix"},r)}renderSuffix(){const{suffix:e}=this.props;if(be()(e)||_e()(e))return null;const t=w()(`${of}-suffix`,{[`${of}-suffix-text`]:e&&xe()(e),[`${of}-suffix-icon`]:oe(e)});return h().createElement("div",{className:t,onMouseDown:this.handlePreventMouseDown,onClick:this.handleClickPrefixOrSuffix,"x-semi-prop":"suffix"},e)}renderTags(){const{disabled:e,maxTagCount:t,showRestTagsPopover:n,restTagsPopoverProps:r={},draggable:i,expandRestTagsOnClick:s}=this.props,{tagsArray:o,active:a}=this.state,l=w()(`${of}-wrapper-n`,{[`${of}-wrapper-n-disabled`]:e}),c=this.getAllTags();let d=[],u=[...c];(!a||!s)&&t&&t<c.length&&(u=c.slice(0,t),d=c.slice(t));const p=h().createElement("span",{className:l},"+",o.length-t),f=c.map(((e,t)=>({item:e,key:o[t]})));return a&&i&&f.length>0?h().createElement(nf,{items:o,onSortEnd:this.onSortEnd,renderItem:this.renderSortTag,container:af,prefix:of,transition:null,dragOverlayCls:`${of}-right-item-drag-item-move`}):h().createElement(h().Fragment,null,u,d.length>0&&(n?h().createElement(Cn,Object.assign({content:d,showArrow:!0,trigger:"hover",position:"top",autoAdjustOverflow:!0},r),p):p))}blur(){this.inputRef.current.blur(),this.foundation.clickOutsideCallBack()}focus(){const{preventScroll:e,disabled:t}=this.props;this.inputRef.current.focus({preventScroll:e}),t||this.foundation.handleClick()}render(){const e=this.props,{size:t,style:n,className:r,disabled:i,placeholder:s,validateStatus:o,prefix:a,insetLabel:l,suffix:c}=e,d=sf(e,["size","style","className","disabled","placeholder","validateStatus","prefix","insetLabel","suffix"]),{focusing:u,hovering:p,tagsArray:f,inputValue:m,active:g,inputWidth:y}=this.state,v=w()(of,r,{[`${of}-focus`]:u||g,[`${of}-disabled`]:i,[`${of}-hover`]:p&&!i,[`${of}-error`]:"error"===o,[`${of}-warning`]:"warning"===o,[`${of}-small`]:"small"===t,[`${of}-large`]:"large"===t,[`${of}-with-prefix`]:!!a||!!l,[`${of}-with-suffix`]:!!c}),b=w()(`${of}-wrapper-input`,`${of}-wrapper-input-${t}`),x=w()(`${of}-wrapper`),E={};return"number"==typeof y&&(E.width=y),h().createElement("div",Object.assign({ref:this.tagInputRef,style:n,className:v,"aria-disabled":i,"aria-label":this.props["aria-label"],"aria-invalid":"error"===o,onMouseEnter:e=>{this.handleInputMouseEnter(e)},onMouseLeave:e=>{this.handleInputMouseLeave(e)},onClick:e=>{this.handleClick(e)}},this.getDataAttr(d)),this.renderPrefix(),h().createElement("div",{className:x},this.renderTags(),h().createElement("span",{ref:this.inputMirrorRef,className:`${of}-wrapper-inputMirror`}),h().createElement(kr,{"aria-label":"input value",ref:this.inputRef,className:b,style:E,disabled:i,value:m,size:t,placeholder:0===f.length?s:"",onKeyDown:e=>{this.handleKeyDown(e)},onChange:(e,t)=>{this.handleInputChange(t)},onBlur:e=>{this.handleInputBlur(e)},onFocus:e=>{this.handleInputFocus(e)},onCompositionStart:this.handleInputCompositionStart,onCompositionEnd:this.handleInputCompositionEnd})),this.renderClearBtn(),this.renderSuffix())}}lf.propTypes={children:E().node,clearIcon:E().node,style:E().object,className:E().string,disabled:E().bool,allowDuplicates:E().bool,max:E().number,maxTagCount:E().number,maxLength:E().number,showRestTagsPopover:E().bool,restTagsPopoverProps:E().object,showContentTooltip:E().oneOfType([E().shape({type:E().string,opts:E().object}),E().bool]),defaultValue:E().array,value:E().array,inputValue:E().string,placeholder:E().string,separator:E().oneOfType([E().string,E().array]),showClear:E().bool,addOnBlur:E().bool,draggable:E().bool,expandRestTagsOnClick:E().bool,autoFocus:E().bool,renderTagItem:E().func,onBlur:E().func,onFocus:E().func,onChange:E().func,onInputChange:E().func,onExceed:E().func,onInputExceed:E().func,onAdd:E().func,onRemove:E().func,onKeyDown:E().func,size:E().oneOf(Qd),validateStatus:E().oneOf(eh),prefix:E().oneOfType([E().string,E().node]),suffix:E().oneOfType([E().string,E().node]),"aria-label":E().string,preventScroll:E().bool},lf.defaultProps={showClear:!1,addOnBlur:!1,allowDuplicates:!0,showRestTagsPopover:!0,autoFocus:!1,draggable:!1,expandRestTagsOnClick:!0,showContentTooltip:!0,separator:",",size:"default",validateStatus:"default",onBlur:i(),onFocus:i(),onChange:i(),onInputChange:i(),onExceed:i(),onInputExceed:i(),onAdd:i(),onRemove:i(),onKeyDown:i()};const cf=lf,df=kc.PREFIX;class hf extends f{constructor(e){super(e),this.search=e=>{this.handleInputChange(e)},this.handleInputChange=e=>{this.foundation.handleInputChange(e)},this.handleTagRemoveInTrigger=e=>{this.foundation.handleTagRemoveInTrigger(e)},this.handleTagClose=(e,t,n)=>{t.preventDefault(),this.foundation.handleTagRemoveByKey(n)},this.renderTagItem=(e,t)=>{const{keyEntities:n,disabledKeys:r}=this.state,{size:i,disabled:s,displayProp:o,displayRender:a,disableStrictly:l}=this.props;if(n[e]){const c=s||n[e].data.disabled||l&&r.has(e),d=w()(`${df}-selection-tag`,{[`${df}-selection-tag-disabled`]:c});return ye()(a)?a(n[e],t):h().createElement(Zd,{size:"default"===i?"large":i,key:`tag-${e}-${t}`,color:"white",tagKey:e,className:d,closable:!0,onClose:this.handleTagClose},n[e].data[o])}return null},this.onRemoveInTagInput=e=>{this.foundation.handleTagRemoveByKey(e)},this.handleItemClick=(e,t)=>{this.foundation.handleItemClick(e,t)},this.handleItemHover=(e,t)=>{this.foundation.handleItemHover(e,t)},this.onItemCheckboxClick=e=>{this.foundation.onItemCheckboxClick(e)},this.handleListScroll=(e,t)=>{this.foundation.handleListScroll(e,t)},this.renderContent=()=>{const{inputValue:e,isSearching:t,activeKeys:n,selectedKeys:r,checkedKeys:i,halfCheckedKeys:s,loadedKeys:o,loadingKeys:a}=this.state,{filterTreeNode:l,dropdownClassName:c,dropdownStyle:d,loadData:u,emptyContent:p,separator:f,topSlot:m,bottomSlot:g,showNext:y,multiple:v,filterRender:b,virtualizeInSearch:x,expandIcon:E}=this.props,C=Boolean(l)&&t,S=w()(c,`${df}-popover`),_=this.foundation.getRenderData(),k=!_||!_.length?Object.assign(Object.assign({},d),{minWidth:this.state.emptyContentMinWidth}):d;return h().createElement("div",{className:S,role:"listbox",style:k,onKeyDown:this.foundation.handleKeyDown,ref:this.optionContainerEl},m,h().createElement($d,{activeKeys:n,selectedKeys:r,separator:f,loadedKeys:o,loadingKeys:a,onItemClick:this.handleItemClick,onItemHover:this.handleItemHover,showNext:y,onItemCheckboxClick:this.onItemCheckboxClick,onListScroll:this.handleListScroll,searchable:C,keyword:e,emptyContent:p,loadData:u,data:_,multiple:v,checkedKeys:i,halfCheckedKeys:s,filterRender:b,virtualize:x,expandIcon:E}),g)},this.renderPlusN=e=>{const{disabled:t,showRestTagsPopover:n,restTagsPopoverProps:r}=this.props,i=w()(`${df}-selection-n`,{[`${df}-selection-n-disabled`]:t}),s=h().createElement("span",{className:i},"+",e.length);return n?h().createElement(Cn,Object.assign({content:e,showArrow:!0,trigger:"hover",position:"top",autoAdjustOverflow:!0},r),s):s},this.renderMultipleTags=()=>{const{autoMergeValue:e,maxTagCount:t,checkRelation:n}=this.props,{checkedKeys:r,resolvedCheckedKeys:i}=this.state,s=this.mergeType===Ac||n===Lc?r:i,o=[],a=[];return[...s].forEach(((e,n)=>{const r=!er()(t)||t>=n+1,i=this.renderTagItem(e,n);r?o.push(i):a.push(i)})),h().createElement(h().Fragment,null,o,!Pe()(a)&&this.renderPlusN(a))},this.renderDisplayText=()=>{const{displayProp:e,separator:t,displayRender:n}=this.props,{selectedKeys:r}=this.state;let i="";if(r.size){const s=this.foundation.getItemPropPath([...r][0],e);i=n&&"function"==typeof n?n(s):s.map(((e,n)=>h().createElement(d.Fragment,{key:`${e}-${n}`},n<s.length-1?h().createElement(h().Fragment,null,e,t):e)))}return i},this.renderSelectContent=()=>{const{placeholder:e,filterTreeNode:t,multiple:n,searchPosition:r}=this.props,{checkedKeys:i}=this.state;if(!(Boolean(t)&&r===Nc)){if(n)return 0===i.size?h().createElement("span",{className:`${df}-selection-placeholder`},e):this.renderMultipleTags();{const t=this.renderDisplayText(),n=w()({[`${df}-selection-placeholder`]:!t});return h().createElement("span",{className:n},t||e)}}return n?this.renderTagInput():this.renderInput()},this.renderSuffix=()=>{const{suffix:e}=this.props,t=w()({[`${df}-suffix`]:!0,[`${df}-suffix-text`]:e&&xe()(e),[`${df}-suffix-icon`]:oe(e)});return h().createElement("div",{className:t,"x-semi-prop":"suffix"},e)},this.renderPrefix=()=>{const{prefix:e,insetLabel:t,insetLabelId:n}=this.props,r=e||t,i=w()({[`${df}-prefix`]:!0,[`${df}-inset-label`]:t,[`${df}-prefix-text`]:r&&xe()(r),[`${df}-prefix-icon`]:oe(r)});return h().createElement("div",{className:i,id:n,"x-semi-prop":"prefix,insetLabel"},r)},this.renderCustomTrigger=()=>{var e;const{disabled:t,triggerRender:n,multiple:r}=this.props,{selectedKeys:i,inputValue:s,inputPlaceHolder:o,resolvedCheckedKeys:a,checkedKeys:l,keyEntities:c}=this.state;let d;return r?this.mergeType===Ac?(d=new Set,l.forEach((e=>{var t;d.add(null===(t=c[e])||void 0===t?void 0:t.pos)}))):(d=new Set,a.forEach((e=>{var t;d.add(null===(t=c[e])||void 0===t?void 0:t.pos)}))):d=null===(e=c[[...i][0]])||void 0===e?void 0:e.pos,h().createElement(Pr,{value:d,inputValue:s,onChange:this.handleInputChange,onClear:this.handleClear,placeholder:o,disabled:t,triggerRender:n,componentName:"Cascader",componentProps:Object.assign({},this.props),onSearch:this.handleInputChange,onRemove:this.handleTagRemoveInTrigger})},this.handleMouseOver=()=>{this.foundation.toggleHoverState(!0)},this.handleMouseLeave=()=>{this.foundation.toggleHoverState(!1)},this.handleClear=e=>{e&&e.stopPropagation(),this.foundation.handleClear()},this.handleClearEnterPress=e=>{e&&e.stopPropagation(),this.foundation.handleClearEnterPress(e)},this.showClearBtn=()=>{const{showClear:e,disabled:t,multiple:n}=this.props,{selectedKeys:r,isOpen:i,isHovering:s,checkedKeys:o,inputValue:a}=this.state,l=r.size,c=n&&o.size;return e&&(a||l||c)&&!t&&(i||s)},this.renderClearBtn=()=>{const e=w()(`${df}-clearbtn`),{clearIcon:t}=this.props;return this.showClearBtn()?h().createElement("div",{className:e,onClick:this.handleClear,onKeyPress:this.handleClearEnterPress,role:"button",tabIndex:0},t||h().createElement(gr,null)):null},this.renderArrow=()=>{const{arrowIcon:e}=this.props;return this.showClearBtn()?null:e?h().createElement("div",{className:w()(`${df}-arrow`),"x-semi-prop":"arrowIcon"},e):null},this.renderSelection=()=>{const{disabled:e,multiple:t,filterTreeNode:n,style:r,size:i,className:s,validateStatus:o,prefix:a,suffix:l,insetLabel:c,triggerRender:u,showClear:p,id:f,borderless:m}=this.props,{isOpen:g,isFocus:y,isInput:v,checkedKeys:b}=this.state,x=Boolean(n),E="function"==typeof u,C=E?w()(s):w()(df,s,{[`${df}-borderless`]:m,[`${df}-focus`]:y||g&&!v,[`${df}-disabled`]:e,[`${df}-single`]:!0,[`${df}-filterable`]:x,[`${df}-error`]:"error"===o,[`${df}-warning`]:"warning"===o,[`${df}-small`]:"small"===i,[`${df}-large`]:"large"===i,[`${df}-with-prefix`]:a||c,[`${df}-with-suffix`]:l}),S=p?{onMouseEnter:()=>this.handleMouseOver(),onMouseLeave:()=>this.handleMouseLeave()}:{},_=w()(`${df}-selection`,{[`${df}-selection-multiple`]:t&&!Pe()(b)}),k=E?this.renderCustomTrigger():[h().createElement(d.Fragment,{key:"prefix"},a||c?this.renderPrefix():null),h().createElement(d.Fragment,{key:"selection"},h().createElement("div",{className:_},this.renderSelectContent())),h().createElement(d.Fragment,{key:"suffix"},l?this.renderSuffix():null),h().createElement(d.Fragment,{key:"clearbtn"},this.renderClearBtn()),h().createElement(d.Fragment,{key:"arrow"},this.renderArrow())];return h().createElement("div",Object.assign({className:C,style:r,ref:this.triggerRef,onClick:e=>this.foundation.handleClick(e),onKeyPress:e=>this.foundation.handleSelectionEnterPress(e),"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],"aria-required":this.props["aria-required"],id:f,onKeyDown:this.foundation.handleKeyDown},S,{role:"combobox",tabIndex:0},this.getDataAttr(this.props)),k)},this.state={emptyContentMinWidth:null,disabledKeys:new Set,isOpen:e.defaultOpen,rePosKey:0,keyEntities:{},selectedKeys:new Set([]),activeKeys:new Set([]),filteredKeys:new Set([]),inputValue:"",isSearching:!1,inputPlaceHolder:e.searchPlaceholder||e.placeholder,prevProps:{},isHovering:!1,checkedKeys:new Set([]),halfCheckedKeys:new Set([]),resolvedCheckedKeys:new Set([]),loadedKeys:new Set,loadingKeys:new Set,loading:!1,showInput:!1},this.options={},this.isEmpty=!1,this.mergeType=Vc(e.autoMergeValue,e.leafOnly),this.inputRef=h().createRef(),this.triggerRef=h().createRef(),this.optionsRef=h().createRef(),this.optionContainerEl=h().createRef(),this.clickOutsideHandler=null,this.foundation=new zc(this.adapter),this.loadingKeysRef=h().createRef(),this.loadedKeysRef=h().createRef()}get adapter(){var e=this;const t={updateInputValue:e=>{this.setState({inputValue:e})},updateInputPlaceHolder:e=>{this.setState({inputPlaceHolder:e})},focusInput:()=>{const{preventScroll:e}=this.props;this.inputRef&&this.inputRef.current&&this.inputRef.current.focus({preventScroll:e})},blurInput:()=>{this.inputRef&&this.inputRef.current&&this.inputRef.current.blur()}},n={registerClickOutsideHandler:e=>{const t=t=>{const n=this.triggerRef&&this.triggerRef.current,r=this.optionContainerEl&&this.optionContainerEl.current,i=t.target,s=t.composedPath&&t.composedPath()||[i];!r||r.contains(i)&&r.contains(i.parentNode)||!n||n.contains(i)||s.includes(n)||s.includes(r)||e(t)};this.clickOutsideHandler=t,document.addEventListener("mousedown",t,!1)},unregisterClickOutsideHandler:()=>{document.removeEventListener("mousedown",this.clickOutsideHandler,!1)},rePositionDropdown:()=>{let{rePosKey:e}=this.state;e+=1,this.setState({rePosKey:e})}};return Object.assign(Object.assign(Object.assign(Object.assign({},super.adapter),t),n),{setEmptyContentMinWidth:e=>{this.setState({emptyContentMinWidth:e})},getTriggerWidth:()=>{const e=this.triggerRef.current;return e&&e.getBoundingClientRect().width},updateStates:e=>{this.setState(Object.assign({},e))},openMenu:()=>{this.setState({isOpen:!0})},closeMenu:e=>{this.setState({isOpen:!1},(()=>{e&&e()}))},updateSelection:e=>this.setState({selectedKeys:e}),notifyChange:e=>{this.props.onChange&&this.props.onChange(e)},notifySelect:e=>{this.props.onSelect&&this.props.onSelect(e)},notifyOnSearch:e=>{this.props.onSearch&&this.props.onSearch(e)},notifyFocus:function(){e.props.onFocus&&e.props.onFocus(...arguments)},notifyBlur:function(){e.props.onBlur&&e.props.onBlur(...arguments)},notifyDropdownVisibleChange:e=>{this.props.onDropdownVisibleChange(e)},toggleHovering:e=>{this.setState({isHovering:e})},notifyLoadData:(e,t)=>{const{loadData:n}=this.props;n&&new Promise((r=>{n(e).then((()=>{setTimeout((()=>{t(),this.setState({loading:!1}),r()}))}))}))},notifyOnLoad:(e,t)=>{const{onLoad:n}=this.props;n&&n(e,t)},notifyListScroll:(e,t)=>{let{panelIndex:n,activeNode:r}=t;this.props.onListScroll(e,{panelIndex:n,activeNode:r})},notifyOnExceed:e=>this.props.onExceed(e),notifyClear:()=>this.props.onClear(),toggleInputShow:(e,t)=>{this.setState({showInput:e},(()=>{t()}))},updateFocusState:e=>{this.setState({isFocus:e})},updateLoadingKeyRefValue:e=>{this.loadingKeysRef.current=e},getLoadingKeyRefValue:()=>this.loadingKeysRef.current,updateLoadedKeyRefValue:e=>{this.loadedKeysRef.current=e},getLoadedKeyRefValue:()=>this.loadedKeysRef.current})}static getDerivedStateFromProps(e,t){const{multiple:n,value:r,defaultValue:i,onChangeWithObject:s,leafOnly:o,autoMergeValue:a,checkRelation:l,searchPlaceholder:c,placeholder:d,keyMaps:h}=e,{prevProps:u}=t;let p=t.keyEntities||{};const f={},m=c||d;m!==t.inputPlaceHolder&&(f.inputPlaceHolder=m);const g=t=>{const n=Pe()(u)&&t in e,r=u&&!Oe()(u[t],e[t]);return n||r},y=(e,t)=>{let n=[];Array.isArray(e)?n=Array.isArray(e[0])?e:[e]:void 0!==e&&(n=[[e]]);const r=[];n.forEach((e=>{const t=s&&z()(e[0])?Bc(e,h):e;t.length>0&&r.push(t)}));const i=r.reduce(((e,n)=>{const r=jc(n);return t[r]&&e.push(r),e}),[]);return i};if(n){const n=g("treeData")||(()=>{const t=!u&&"treeData"in e,n=u&&u.treeData!==e.treeData;return t||n})()||g("keyMaps"),s=g("value")||Pe()(u)&&i;if(n||s){n&&(f.treeData=e.treeData,p=$c(e.treeData,h),f.keyEntities=p);let c=t.checkedKeys;if(s){c=y(g("value")?r:i,p)}else if(n&&"value"in e){c=y(r,p)}if($l()(c)&&(c=[...c]),l===Dc){const t=cc(c,p),n=new Set(t.checkedKeys),r=new Set(t.halfCheckedKeys);e.disableStrictly&&(f.disabledKeys=Ec(p,h));const i=Vc(a,o)===Mc;f.checkedKeys=n,f.halfCheckedKeys=r,f.resolvedCheckedKeys=new Set(fc(n,p,i))}else f.checkedKeys=new Set(c);f.prevProps=e}}return f}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}componentDidUpdate(e){const t=!Oe()(e.treeData,this.props.treeData),n=!Oe()(e.keyMaps,this.props.keyMaps);if(this.props.multiple)return void((t||n)&&this.foundation.recalculateFilteredKeys());let r=!1;(t||n)&&(r=!0,this.foundation.collectOptions()),e.value===this.props.value||r||this.foundation.handleValueChange(this.props.value)}renderTagInput(){const{size:e,disabled:t,placeholder:n,maxTagCount:r,showRestTagsPopover:i,restTagsPopoverProps:s,checkRelation:o}=this.props,{inputValue:a,checkedKeys:l,keyEntities:c,resolvedCheckedKeys:d,inputPlaceHolder:u}=this.state,p=w()(`${df}-tagInput-wrapper`),f=this.mergeType===Ac||o===Lc?l:d;return h().createElement(cf,{className:p,ref:this.inputRef,disabled:t,size:e,value:[...f],showRestTagsPopover:i,restTagsPopoverProps:s,maxTagCount:r,renderTagItem:this.renderTagItem,inputValue:a,onInputChange:this.handleInputChange,onRemove:this.onRemoveInTagInput,placeholder:u,expandRestTagsOnClick:!1})}renderInput(){const{size:e,disabled:t}=this.props,n=w()(`${df}-input`),{inputValue:r,inputPlaceHolder:i,showInput:s}=this.state,o={disabled:t,value:r,className:n,onChange:this.handleInputChange},a=w()({[`${df}-search-wrapper`]:!0,[`${df}-search-wrapper-${e}`]:"default"!==e}),l=this.renderDisplayText(),c=w()({[`${df}-selection-placeholder`]:!l,[`${df}-selection-text-hide`]:s&&r,[`${df}-selection-text-inactive`]:s&&!r});return h().createElement("div",{className:a},h().createElement("span",{className:c},l||i),s&&h().createElement(kr,Object.assign({ref:this.inputRef,size:e},o)))}close(){this.foundation.close()}open(){this.foundation.open()}focus(){this.foundation.focus()}blur(){this.foundation.blur()}render(){const{zIndex:e,getPopupContainer:t,autoAdjustOverflow:n,stopPropagation:r,mouseLeaveDelay:i,mouseEnterDelay:s,position:o,motion:a,dropdownMargin:l}=this.props,{isOpen:c,rePosKey:d}=this.state,{direction:u}=this.context,p=this.renderContent(),f=this.renderSelection(),m=null!=o?o:"rtl"===u?"bottomRight":"bottomLeft";return h().createElement(Cn,{getPopupContainer:t,zIndex:e,motion:a,margin:l,ref:this.optionsRef,content:p,visible:c,trigger:"custom",rePosKey:d,position:m,autoAdjustOverflow:n,stopPropagation:r,mouseLeaveDelay:i,mouseEnterDelay:s,afterClose:()=>this.foundation.updateSearching(!1)},f)}}hf.__SemiComponentName__="Cascader",hf.contextType=lt,hf.propTypes={"aria-labelledby":E().string,"aria-invalid":E().bool,"aria-errormessage":E().string,"aria-describedby":E().string,"aria-required":E().bool,"aria-label":E().string,arrowIcon:E().node,borderless:E().bool,clearIcon:E().node,changeOnSelect:E().bool,defaultValue:E().oneOfType([E().string,E().array]),disabled:E().bool,dropdownClassName:E().string,dropdownStyle:E().object,dropdownMargin:E().oneOfType([E().number,E().object]),emptyContent:E().node,motion:E().bool,filterTreeNode:E().oneOfType([E().func,E().bool]),filterLeafOnly:E().bool,placeholder:E().string,searchPlaceholder:E().string,size:E().oneOf(Oc),style:E().object,className:E().string,treeData:E().arrayOf(E().shape({value:E().oneOfType([E().string,E().number]),label:E().any})),treeNodeFilterProp:E().string,suffix:E().node,prefix:E().node,insetLabel:E().node,insetLabelId:E().string,id:E().string,displayProp:E().string,displayRender:E().func,onChange:E().func,onSearch:E().func,onSelect:E().func,onBlur:E().func,onFocus:E().func,children:E().node,getPopupContainer:E().func,zIndex:E().number,value:E().oneOfType([E().string,E().number,E().array]),validateStatus:E().oneOf(Tc),showNext:E().oneOf([Pc,Ic]),stopPropagation:E().oneOfType([E().bool,E().string]),showClear:E().bool,defaultOpen:E().bool,autoAdjustOverflow:E().bool,onDropdownVisibleChange:E().func,triggerRender:E().func,onListScroll:E().func,onChangeWithObject:E().bool,bottomSlot:E().node,topSlot:E().node,multiple:E().bool,autoMergeValue:E().bool,maxTagCount:E().number,showRestTagsPopover:E().bool,restTagsPopoverProps:E().object,max:E().number,separator:E().string,onExceed:E().func,onClear:E().func,loadData:E().func,onLoad:E().func,loadedKeys:E().array,disableStrictly:E().bool,leafOnly:E().bool,enableLeafClick:E().bool,clickToSelect:E().bool,preventScroll:E().bool,position:E().string,searchPosition:E().string,remote:E().bool,keyMaps:E().object},hf.defaultProps=he(hf.__SemiComponentName__,{borderless:!1,leafOnly:!1,arrowIcon:h().createElement(Hc,null),stopPropagation:!0,motion:!0,defaultOpen:!1,zIndex:gn.DEFAULT_Z_INDEX,showClear:!1,autoClearSearchValue:!0,changeOnSelect:!1,disableStrictly:!1,autoMergeValue:!0,multiple:!1,filterTreeNode:!1,filterLeafOnly:!0,showRestTagsPopover:!1,restTagsPopoverProps:{},separator:" / ",size:"default",treeNodeFilterProp:"label",displayProp:"label",treeData:[],showNext:Pc,onExceed:i(),onClear:i(),onDropdownVisibleChange:i(),onListScroll:i(),enableLeafClick:!1,clickToSelect:!1,"aria-label":"Cascader",searchPosition:Nc,checkRelation:Dc,remote:!1});const uf=hf,pf={PREFIX:`${C}-collapse`};class ff extends c{constructor(e){super(Object.assign({},e))}initActiveKey(){const{defaultActiveKey:e,activeKey:t,accordion:n}=this.getProps();let r=t||e;return n&&(r=Array.isArray(r)?r[0]:r),r&&r.length?(r=Array.isArray(r)?r:[r],r):[]}handleChange(e,t){const{activeKey:n,accordion:r}=this.getProps(),{activeSet:i}=this.getStates();let s=new Set(i);s.has(e)?s.delete(e):r?s=new Set([e]):s.add(e),this._adapter.handleChange([...s.values()],t),void 0===n&&this._adapter.addActiveKey(s)}}const mf=class extends c{constructor(e){super(Object.assign({},e)),this.updateDOMInRenderTree=e=>{this._adapter.setDOMInRenderTree(e)},this.updateDOMHeight=e=>{this._adapter.setDOMHeight(e)},this.updateVisible=e=>{this._adapter.setVisible(e)},this.updateIsTransitioning=e=>{this._adapter.setIsTransitioning(e)}}},gf=`${C}-collapsible`;__webpack_require__("zWTJ");class yf extends f{constructor(e){super(e),this.domRef=h().createRef(),this.hasBeenRendered=!1,this.handleResize=e=>{const t=e[0];if(t){const e=yf.getEntryInfo(t);this.foundation.updateDOMHeight(e.height),this.foundation.updateDOMInRenderTree(e.isShown)}},this.isChildrenInRenderTree=()=>!!this.domRef.current&&this.domRef.current.offsetHeight>0,this.state={domInRenderTree:!1,domHeight:0,visible:this.props.isOpen,isTransitioning:!1,cacheIsOpen:this.props.isOpen},this.foundation=new mf(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setDOMInRenderTree:e=>{this.state.domInRenderTree!==e&&this.setState({domInRenderTree:e})},setDOMHeight:e=>{this.state.domHeight!==e&&this.setState({domHeight:e})},setVisible:e=>{this.state.visible!==e&&this.setState({visible:e})},setIsTransitioning:e=>{this.state.isTransitioning!==e&&this.setState({isTransitioning:e})}})}componentDidMount(){super.componentDidMount(),this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.domRef.current);const e=this.isChildrenInRenderTree();this.foundation.updateDOMInRenderTree(e),e&&this.foundation.updateDOMHeight(this.domRef.current.scrollHeight)}static getDerivedStateFromProps(e,t){const n={},r=e.isOpen!==t.cacheIsOpen;return r&&(!e.isOpen&&e.motion||(n.visible=e.isOpen)),e.motion&&r&&(n.isTransitioning=!0),n.cacheIsOpen=e.isOpen,n}componentDidUpdate(e,t,n){const r=Object.keys(Gl()(this.props,["reCalcKey"])).filter((t=>!Oe()(this.props[t],e[t]))),i=Object.keys(Gl()(this.state,["domInRenderTree"])).filter((e=>!Oe()(this.state[e],t[e])));r.includes("reCalcKey")&&this.foundation.updateDOMHeight(this.domRef.current.scrollHeight),i.includes("domInRenderTree")&&this.state.domInRenderTree&&this.foundation.updateDOMHeight(this.domRef.current.scrollHeight)}componentWillUnmount(){super.componentWillUnmount(),this.resizeObserver.disconnect()}render(){const{isOpen:e,collapseHeight:t,collapseHeightAdaptive:n}=this.props,r=n?Math.min(this.state.domHeight,t):t,i=Object.assign({overflow:"hidden",height:e?this.state.domHeight:r,opacity:e||!this.props.fade||0!==t?1:0,transitionDuration:`${this.props.motion&&this.state.isTransitioning?this.props.duration:0}ms`},this.props.style),s=w()(`${gf}-wrapper`,{[`${gf}-transition`]:this.props.motion&&this.state.isTransitioning},this.props.className),o=this.props.keepDOM&&(!this.props.lazyRender||this.hasBeenRendered)||0!==this.props.collapseHeight||this.state.visible||this.props.isOpen;return o&&!this.hasBeenRendered&&(this.hasBeenRendered=!0),h().createElement("div",Object.assign({className:s,style:i,onTransitionEnd:()=>{var e,t;this.props.isOpen||this.foundation.updateVisible(!1),this.foundation.updateIsTransitioning(!1),null===(t=(e=this.props).onMotionEnd)||void 0===t||t.call(e)}},this.getDataAttr(this.props)),h().createElement("div",{"x-semi-prop":"children",ref:this.domRef,style:{overflow:"hidden"},id:this.props.id},o&&this.props.children))}}yf.__SemiComponentName__="Collapsible",yf.defaultProps=he(yf.__SemiComponentName__,{isOpen:!1,duration:250,motion:!0,keepDOM:!1,lazyRender:!1,collapseHeight:0,collapseHeightAdaptive:!1,fade:!1}),yf.getEntryInfo=e=>{let t;t=e.borderBoxSize?!(0===e.borderBoxSize[0].blockSize&&0===e.borderBoxSize[0].inlineSize):!(0===e.contentRect.height&&0===e.contentRect.width);let n=0;if(e.borderBoxSize)n=Math.ceil(e.borderBoxSize[0].blockSize);else{n=e.target.clientHeight}return{isShown:t,height:n}};const vf=yf,bf=h().createContext({});var wf=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class xf extends d.PureComponent{constructor(){super(...arguments),this.headerExpandIconTriggerRef=h().createRef(),this.ariaID="",this.handleClick=(e,t)=>{var n;(this.context.clickHeaderToExpand||(null===(n=this.headerExpandIconTriggerRef.current)||void 0===n?void 0:n.contains(t.target)))&&this.context.onClick(e,t)}}componentDidMount(){this.ariaID=We({})}renderHeader(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{showArrow:n,header:r,extra:i}=this.props;let{expandIcon:s,collapseIcon:o}=this.context;const{expandIconPosition:a}=this.context;void 0===s&&(s=h().createElement(Hc,null)),void 0===o&&(o=h().createElement($i,null));const l=h().createElement("span",{ref:this.headerExpandIconTriggerRef,"aria-hidden":"true",className:w()([`${pf.PREFIX}-header-icon`,{[`${pf.PREFIX}-header-iconDisabled`]:!t}])},t&&e?o:s),c="left"===a;return"string"==typeof r?h().createElement(h().Fragment,null,n&&(c?l:null),h().createElement("span",null,r),h().createElement("span",{className:`${pf.PREFIX}-header-right`},h().createElement("span",null,i),n&&(c?null:l))):h().createElement(h().Fragment,null,n&&(c?l:null),r,n&&(c?null:l))}render(){const e=this.props,{className:t,children:n,itemKey:r,reCalcKey:i,header:s,extra:o,showArrow:a,disabled:l}=e,c=wf(e,["className","children","itemKey","reCalcKey","header","extra","showArrow","disabled"]),{keepDOM:d,expandIconPosition:u,activeSet:p,motion:f,lazyRender:m}=this.context,g=p.has(r),y=w()(t,{[`${pf.PREFIX}-item`]:!0,[`${pf.PREFIX}-item-active`]:g}),v=w()({[`${pf.PREFIX}-header`]:!0,[`${pf.PREFIX}-header-disabled`]:l,[`${pf.PREFIX}-header-iconLeft`]:"left"===u}),b=w()({[`${pf.PREFIX}-content`]:!0});return h().createElement("div",Object.assign({className:y},c),h().createElement("div",{role:"button",tabIndex:0,className:v,"aria-disabled":l,"aria-expanded":g?"true":"false","aria-owns":this.ariaID,onClick:e=>!l&&this.handleClick(r,e)},this.renderHeader(g,void 0!==n&&!l)),n&&h().createElement(vf,{lazyRender:m,isOpen:g,keepDOM:d,motion:f,onMotionEnd:this.props.onMotionEnd,reCalcKey:i},h().createElement("div",{className:b,"aria-hidden":!g,id:this.ariaID},h().createElement("div",{className:`${pf.PREFIX}-content-wrapper`},n))))}}xf.contextType=bf,xf.propTypes={itemKey:E().string,extra:E().node,header:E().oneOfType([E().string,E().node]),className:E().string,reCalcKey:E().oneOfType([E().string,E().number]),showArrow:E().bool,disabled:E().bool},xf.defaultProps={showArrow:!0,disabled:!1};__webpack_require__("X/fO");var Ef=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class Cf extends f{constructor(e){super(e),this.onChange=(e,t)=>{this.foundation.handleChange(e,t)},this.foundation=new ff(this.adapter);const t=this.foundation.initActiveKey();this.state={activeSet:new Set(t)},this.onChange=this.onChange.bind(this)}get adapter(){return Object.assign(Object.assign({},super.adapter),{handleChange:(e,t)=>this.props.onChange(e,t),addActiveKey:e=>this.setState({activeSet:e})})}static getDerivedStateFromProps(e,t){if(e.activeKey){const n=Array.isArray(e.activeKey)?e.activeKey:[e.activeKey],r=new Set(n);return Oe()(r,t.activeSet)?t:Object.assign(Object.assign({},t),{activeSet:r})}return t}componentWillUnmount(){this.foundation.destroy()}render(){const e=this.props,{defaultActiveKey:t,lazyRender:n,accordion:r,style:i,motion:s,className:o,keepDOM:a,expandIconPosition:l,expandIcon:c,collapseIcon:d,children:u,clickHeaderToExpand:p}=e,f=(Ef(e,["defaultActiveKey","lazyRender","accordion","style","motion","className","keepDOM","expandIconPosition","expandIcon","collapseIcon","children","clickHeaderToExpand"]),w()(pf.PREFIX,o)),{activeSet:m}=this.state;return h().createElement("div",Object.assign({className:f,style:i},this.getDataAttr(this.props)),h().createElement(bf.Provider,{value:{activeSet:m,expandIcon:c,collapseIcon:d,clickHeaderToExpand:p,keepDOM:a,expandIconPosition:l,onClick:this.onChange,motion:s,lazyRender:n}},u))}}Cf.Panel=xf,Cf.propTypes={activeKey:E().oneOfType([E().string,E().array]),defaultActiveKey:E().oneOfType([E().string,E().array]),accordion:E().bool,clickHeaderToExpand:E().bool,onChange:E().func,expandIcon:E().node,collapseIcon:E().node,style:E().object,className:E().string,keepDOM:E().bool,motion:E().oneOfType([E().bool,E().func,E().object]),expandIconPosition:E().oneOf(["left","right"]),lazyRender:E().bool},Cf.__SemiComponentName__="Collapse",Cf.defaultProps=he(Cf.__SemiComponentName__,{defaultActiveKey:"",clickHeaderToExpand:!0,onChange:Tt,expandIconPosition:"right",lazyRender:!1});const Sf=Cf;var _f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const kf={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},Of=lt.Consumer;class Tf extends h().Component{constructor(e){super(e),this.unRegisters=[],this.hasRegisteredMediaQueries=!1,this.hasWarnedResponsiveObserve=!1,this.screensListeners=new Set,this.changeListeners=new Set,this.currentScreensRef=null,this.ensureMediaQueriesRegistered=()=>{if(!this.props.responsiveObserve){if(!this.hasWarnedResponsiveObserve){this.hasWarnedResponsiveObserve=!0;Q("undefined"!=typeof process&&!1,"[Semi] ConfigProvider responsive observing is disabled by default. Set <ConfigProvider responsiveObserve> to enable breakpoint subscriptions.")}return}(this.screensListeners.size>0||this.changeListeners.size>0)&&(this.hasRegisteredMediaQueries||this.registerMediaQueries())},this.registerMediaQueries=()=>{if(this.hasRegisteredMediaQueries)return;const e=this.props.responsiveMap||kf,t=Object.keys(e),n={xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1};"undefined"!=typeof window&&"function"==typeof window.matchMedia&&t.forEach((t=>{n[t]=window.matchMedia(e[t]).matches})),this.currentScreensRef=n,this.unRegisters=t.map((t=>se(e[t],{match:()=>{this.updateScreen(t,!0)},unmatch:()=>{this.updateScreen(t,!1)},callInInit:!1}))),this.hasRegisteredMediaQueries=!0,this.setState({screens:n})},this.unregisterMediaQueries=()=>{this.unRegisters.forEach((e=>e())),this.unRegisters=[],this.hasRegisteredMediaQueries=!1,this.currentScreensRef=null},this.updateScreen=(e,t)=>{this.currentScreensRef&&this.currentScreensRef[e]!==t&&(this.currentScreensRef=Object.assign(Object.assign({},this.currentScreensRef),{[e]:t})),this.setState((n=>n.screens[e]===t?null:{screens:Object.assign(Object.assign({},n.screens),{[e]:t})}),(()=>{this.notifyListeners(e,t)}))},this.notifyListeners=(e,t)=>{const{screens:n}=this.state;this.screensListeners.forEach((e=>{e(n)})),null!=e&&null!=t&&this.changeListeners.forEach((n=>{let{breakpoints:r,callback:i}=n;r&&!r.includes(e)||i(e,t)}))},this.handleBreakpoint=(e,t)=>{var n,r;if("function"==typeof e){const t=e;this.screensListeners.add(t),this.ensureMediaQueriesRegistered();const r=null!==(n=this.currentScreensRef)&&void 0!==n?n:this.state.screens;return t(r),()=>{this.screensListeners.delete(t),this.props.responsiveObserve&&0===this.screensListeners.size&&0===this.changeListeners.size&&this.unregisterMediaQueries()}}const i=Array.isArray(e)?e:void 0,s=t,o={breakpoints:i,callback:s};this.changeListeners.add(o),this.ensureMediaQueriesRegistered();const a=null!==(r=this.currentScreensRef)&&void 0!==r?r:this.state.screens;return i&&"function"==typeof s&&i.forEach((e=>{s(e,a[e])})),()=>{this.changeListeners.delete(o),this.props.responsiveObserve&&0===this.screensListeners.size&&0===this.changeListeners.size&&this.unregisterMediaQueries()}},this.state={screens:{xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}}}componentDidMount(){}componentDidUpdate(e){e.responsiveObserve&&!this.props.responsiveObserve&&this.unregisterMediaQueries(),this.hasRegisteredMediaQueries&&e.responsiveMap!==this.props.responsiveMap&&(this.unregisterMediaQueries(),this.registerMediaQueries()),!e.responsiveObserve&&this.props.responsiveObserve&&this.ensureMediaQueriesRegistered()}componentWillUnmount(){this.unregisterMediaQueries(),this.screensListeners.clear(),this.changeListeners.clear()}renderChildren(){const{direction:e,children:t}=this.props;return"rtl"===e?h().createElement("div",{className:`${C}-rtl`},t):t}render(){const e=this.props,{children:t,direction:n,responsiveMap:r}=e,i=_f(e,["children","direction","responsiveMap"]),{screens:s}=this.state;return h().createElement(lt.Provider,{value:Object.assign(Object.assign({},i),{direction:n,responsiveMap:r||kf,onBreakpoint:this.handleBreakpoint,screens:s})},this.renderChildren())}}Tf.propTypes={locale:E().object,timeZone:E().oneOfType([E().string,E().number]),getPopupContainer:E().func,direction:E().oneOf(["ltr","rtl"]),responsiveMap:E().object,responsiveObserve:E().bool},Tf.defaultProps={locale:Zt,direction:"ltr",responsiveObserve:!1},Tf.defaultResponsiveMap=kf;var Pf=__webpack_require__("0iyY"),If=__webpack_require__.n(Pf),Mf=__webpack_require__("eGeI"),Rf=__webpack_require__.n(Mf),Af=__webpack_require__("ND9x"),Nf=__webpack_require__.n(Af),Df=__webpack_require__("1mr4"),Lf=__webpack_require__.n(Df);const Ff=e=>{const t=Nf()(e);return!(er()(e)&&1===t.length)&&Number.isInteger(+t[t.length-1])};function jf(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(0===t.length)return;const r=o()(e,t);(Array.isArray(r)&&r.length>0&&r.every((e=>null==e))||function(e){if(z()(e)){const t=If()(e);return!t.length||t.every((e=>void 0===e))}return!1}(r))&&Rf()(e,t),jf(e,t.slice(0,t.length-1),n)}function $f(e,t){return o()(e,t)}function Bf(e,t){Rf()(e,t);let n=Nf()(t);n=n.slice(0,n.length-1),jf(e,n,!1)}function Vf(e,t,n,r){if(r)return Y()(e,t,n);if(void 0!==n)return Y()(e,t,n);if(Ff(t)&&void 0!==$f(e,t)){Y()(e,t,void 0);let n=Nf()(t);n=n.slice(0,n.length-1),jf(e,n,!1)}else Ff(t)||void 0===$f(e,t)||Bf(e,t)}function zf(e,t){return Lf()(e,t)}function Hf(e,t){return!e||"function"!=typeof e&&"object"!=typeof e||!t||"function"!=typeof t&&"object"!=typeof t||Object.entries(t).forEach((t=>{let[n,r]=t;e[n]=r})),e}const Uf={DAY_TODAY:`${C}-datepicker-day-today`,DAY_IN_RANGE:`${C}-datepicker-day-inrange`,DAY_HOVER:`${C}-datepicker-day-inhover`,DAY_SELECTED:`${C}-datepicker-day-selected`,DAY_SELECTED_START:`${C}-datepicker-day-selected-start`,DAY_SELECTED_END:`${C}-datepicker-day-selected-end`,DAY_DISABLED:`${C}-datepicker-day-disabled`,DAY_HOVER_DAY:`${C}-datepicker-day-hoverday`,DAY_HOVER_DAY_OFFSET:`${C}-datepicker-day-hoverday-offset`,DAY_IN_OFFSET_RANGE:`${C}-datepicker-day-inoffsetrange`,DAY_SELECTED_RANGE_HOVER:`${C}-datepicker-day-selectedrange-hover`,DAY_OFFSET_RANGE_START:`${C}-datepicker-day-offsetrange-start`,DAY_OFFSET_RANGE_END:`${C}-datepicker-day-offsetrange-end`,DAY_SELECTED_START_AFTER_HOVER:`${C}-datepicker-day-selected-start-afterhover`,DAY_SELECTED_END_BEFORE_HOVER:`${C}-datepicker-day-selected-end-beforehover`,DAY_HOVER_DAY_BEFORE_RANGE:`${C}-datepicker-day-hoverday-beforerange`,DAY_HOVER_DAY_AFTER_RANGE:`${C}-datepicker-day-hoverday-afterrange`,DAY_HOVER_DAY_IN_RANGE:`${C}-datepicker-day-hoverday-inrange`,DAY_HOVER_DAY_AROUND_SINGLE_SELECTED:`${C}-datepicker-day-hoverday-around-singleselected`},Kf=Object.assign({PREFIX:`${C}-datepicker`,NAVIGATION:`${C}-datepicker-navigation`,PANEL_YAM:`${C}-datepicker-panel-yam`,MONTH:`${C}-datepicker-month`,WEEKDAY:`${C}-datepicker-weekday`,WEEKS:`${C}-datepicker-weeks`,WEEK:`${C}-datepicker-week`,DAY:`${C}-datepicker-day`},Uf),Wf=Object.assign({DEFAULT_SEPARATOR_MULTIPLE:",",DEFAULT_SEPARATOR_RANGE:" ~ ",SIZE_SET:["small","default","large"],TYPE_SET:["date","dateRange","year","month","monthRange","dateTime","dateTimeRange"],PRESET_POSITION_SET:["left","right","top","bottom"],DENSITY_SET:["default","compact"],PANEL_TYPE_LEFT:"left",PANEL_TYPE_RIGHT:"right",STATUS:Yn,POSITION_SET:mn.POSITION_SET,POSITION_INLINE_INPUT:"leftTopOver"},{FORMAT_FULL_DATE:"yyyy-MM-dd",FORMAT_TIME_PICKER:"HH:mm:ss",FORMAT_DATE_TIME:"yyyy-MM-dd HH:mm:ss",FORMAT_YEAR_MONTH:"yyyy-MM"}),Gf={WEEK_START_ON:0,WEEK_HEIGHT:36,SPACING:gn.SPACING,SPACING_INSET_INPUT:1};var qf=__webpack_require__("+f76"),Xf=__webpack_require__.n(qf),Yf=__webpack_require__("DjCF"),Zf=__webpack_require__.n(Yf);function Jf(e){Nt(1,arguments);var t=Lt(e);return t.setMilliseconds(0),t}function Qf(e,t){Nt(2,arguments);var n=Jf(e),r=Jf(t);return n.getTime()===r.getTime()}function em(e,t){Nt(2,arguments);var n=Lt(e),r=Lt(t);return n.getTime()===r.getTime()}function tm(e){return e&&"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e)}function nm(e){return("number"==typeof(t=e)||"[object Number]"===Object.prototype.toString.call(t))&&tm(new Date(e));var t}var rm=__webpack_require__("NyOe");const im=[[-11,["Pacific/Midway"]],[-10,["Pacific/Honolulu"]],[-9.5,["Pacific/Marquesas"]],[-9,["Pacific/Gambier"]],[-8,["Pacific/Pitcairn"]],[-7,["America/Phoenix"]],[-6,["America/Tegucigalpa"]],[-5,["America/Bogota"]],[-4,["America/Puerto_Rico"]],[-3.5,["America/St_Johns"]],[-3,["America/Montevideo"]],[-2,["Atlantic/South_Georgia"]],[-1,["Atlantic/Cape_Verde"]],[0,["Africa/Accra"]],[1,["Africa/Bangui"]],[2,["Africa/Cairo"]],[3,["Asia/Bahrain","Indian/Antananarivo"]],[3.5,["Asia/Tehran"]],[4,["Asia/Dubai","Asia/Muscat"]],[4.5,["Asia/Kabul"]],[5,["Asia/Samarkand","Asia/Karachi"]],[5.5,["Asia/Kolkata"]],[5.75,["Asia/Kathmandu"]],[6,["Asia/Dhaka"]],[6.5,["Asia/Rangoon","Asia/Rangoon"]],[7,["Asia/Jakarta","Asia/Phnom_Penh","Asia/Bangkok"]],[8,["Asia/Shanghai","Asia/Singapore"]],[8.75,["Australia/Eucla"]],[9,["Asia/Tokyo","Asia/Seoul","Asia/Pyongyang"]],[9.5,["Australia/Darwin"]],[10,["Pacific/Guam"]],[10.5,["Australia/Adelaide"]],[11,["Pacific/Guadalcanal"]],[12,["Pacific/Funafuti"]],[13,["Pacific/Enderbury"]],[13.75,["Pacific/Chatham"]],[14,["Pacific/Kiritimati"]]],sm={0:"Etc/GMT",1:"Etc/GMT-1",2:"Etc/GMT-2",3:"Etc/GMT-3",4:"Etc/GMT-4",5:"Etc/GMT-5",6:"Etc/GMT-6",7:"Etc/GMT-7",8:"Etc/GMT-8",9:"Etc/GMT-9",10:"Etc/GMT-10",11:"Etc/GMT-11",12:"Etc/GMT-12",13:"Etc/GMT-13",14:"Etc/GMT-14","-1":"Etc/GMT+1","-2":"Etc/GMT+2","-3":"Etc/GMT+3","-4":"Etc/GMT+4","-5":"Etc/GMT+5","-6":"Etc/GMT+6","-7":"Etc/GMT+7","-8":"Etc/GMT+8","-9":"Etc/GMT+9","-10":"Etc/GMT+10","-11":"Etc/GMT+11","-12":"Etc/GMT+12"},om=/([\-\+]{1})(\d{2})\:(\d{2})/,am=e=>{let t=null;if("string"==typeof e){if(t=e.match(om),!t)return e;const n=parseInt(t[1]+1,10),r=parseInt(t[2],10),i=parseInt(t[3],10);e=n*(r+i/60)}if("number"==typeof e){if(e in sm){const t=sm[e];if(function(e){if(lm[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),lm[e]=!0,!0}catch(e){return!1}}(t))return t}const t=im.find((t=>t[0]===e));return t&&t[1][0]}},lm={};const cm=(e,t,n)=>(0,rm.utcToZonedTime)(e,am(t),n),dm=(e,t,n)=>(0,rm.zonedTimeToUtc)(e,am(t),n);function hm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function um(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return hm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hm(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,s=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw s}}}}function pm(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function fm(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&md(e,t)}function mm(e){return mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mm(e)}function gm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gm=function(){return!!e})()}function ym(e){var t=gm();return function(){var n,r=mm(e);if(t){var i=mm(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==Dt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fd(e)}(this,n)}}function vm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bm(e){var t=function(e,t){if("object"!=Dt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Dt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Dt(t)?t:t+""}function wm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bm(r.key),r)}}function xm(e,t,n){return t&&wm(e.prototype,t),n&&wm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Em(e,t,n){return(t=bm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cm=function(){function e(){vm(this,e),Em(this,"priority",void 0),Em(this,"subPriority",0)}return xm(e,[{key:"validate",value:function(e,t){return!0}}]),e}(),Sm=function(e){fm(n,e);var t=ym(n);function n(e,r,i,s,o){var a;return vm(this,n),(a=t.call(this)).value=e,a.validateValue=r,a.setValue=i,a.priority=s,o&&(a.subPriority=o),a}return xm(n,[{key:"validate",value:function(e,t){return this.validateValue(e,this.value,t)}},{key:"set",value:function(e,t,n){return this.setValue(e,t,this.value,n)}}]),n}(Cm),_m=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",10),Em(fd(e),"subPriority",-1),e}return xm(n,[{key:"set",value:function(e,t){if(t.timestampIsSet)return e;var n=new Date(0);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}}]),n}(Cm),km=function(){function e(){vm(this,e),Em(this,"incompatibleTokens",void 0),Em(this,"priority",void 0),Em(this,"subPriority",void 0)}return xm(e,[{key:"run",value:function(e,t,n,r){var i=this.parse(e,t,n,r);return i?{setter:new Sm(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}},{key:"validate",value:function(e,t,n){return!0}}]),e}(),Om=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",140),Em(fd(e),"incompatibleTokens",["R","u","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}},{key:"set",value:function(e,t,n){return t.era=n,e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e}}]),n}(km),Tm=/^(1[0-2]|0?\d)/,Pm=/^(3[0-1]|[0-2]?\d)/,Im=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Mm=/^(5[0-3]|[0-4]?\d)/,Rm=/^(2[0-3]|[0-1]?\d)/,Am=/^(2[0-4]|[0-1]?\d)/,Nm=/^(1[0-1]|0?\d)/,Dm=/^(1[0-2]|0?\d)/,Lm=/^[0-5]?\d/,Fm=/^[0-5]?\d/,jm=/^\d/,$m=/^\d{1,2}/,Bm=/^\d{1,3}/,Vm=/^\d{1,4}/,zm=/^-?\d+/,Hm=/^-?\d/,Um=/^-?\d{1,2}/,Km=/^-?\d{1,3}/,Wm=/^-?\d{1,4}/,Gm=/^([+-])(\d{2})(\d{2})?|Z/,qm=/^([+-])(\d{2})(\d{2})|Z/,Xm=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Ym=/^([+-])(\d{2}):(\d{2})|Z/,Zm=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function Jm(e,t){return e?{value:t(e.value),rest:e.rest}:e}function Qm(e,t){var n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function eg(e,t){var n=t.match(e);if(!n)return null;if("Z"===n[0])return{value:0,rest:t.slice(1)};var r="+"===n[1]?1:-1,i=n[2]?parseInt(n[2],10):0,s=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(i*jo+s*Fo+1e3*o),rest:t.slice(n[0].length)}}function tg(e){return Qm(zm,e)}function ng(e,t){switch(e){case 1:return Qm(jm,t);case 2:return Qm($m,t);case 3:return Qm(Bm,t);case 4:return Qm(Vm,t);default:return Qm(new RegExp("^\\d{1,"+e+"}"),t)}}function rg(e,t){switch(e){case 1:return Qm(Hm,t);case 2:return Qm(Um,t);case 3:return Qm(Km,t);case 4:return Qm(Wm,t);default:return Qm(new RegExp("^-?\\d{1,"+e+"}"),t)}}function ig(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function sg(e,t){var n,r=t>0,i=r?t:1-t;if(i<=50)n=e||100;else{var s=i+50;n=e+100*Math.floor(s/100)-(e>=s%100?100:0)}return r?n:1-n}function og(e){return e%400==0||e%4==0&&e%100!=0}var ag=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",130),Em(fd(e),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){var r=function(e){return{year:e,isTwoDigitYear:"yy"===t}};switch(t){case"y":return Jm(ng(4,e),r);case"yo":return Jm(n.ordinalNumber(e,{unit:"year"}),r);default:return Jm(ng(t.length,e),r)}}},{key:"validate",value:function(e,t){return t.isTwoDigitYear||t.year>0}},{key:"set",value:function(e,t,n){var r=e.getUTCFullYear();if(n.isTwoDigitYear){var i=sg(n.year,r);return e.setUTCFullYear(i,0,1),e.setUTCHours(0,0,0,0),e}var s="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(s,0,1),e.setUTCHours(0,0,0,0),e}}]),n}(km),lg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",130),Em(fd(e),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){var r=function(e){return{year:e,isTwoDigitYear:"YY"===t}};switch(t){case"Y":return Jm(ng(4,e),r);case"Yo":return Jm(n.ordinalNumber(e,{unit:"year"}),r);default:return Jm(ng(t.length,e),r)}}},{key:"validate",value:function(e,t){return t.isTwoDigitYear||t.year>0}},{key:"set",value:function(e,t,n,r){var i=As(e,r);if(n.isTwoDigitYear){var s=sg(n.year,i);return e.setUTCFullYear(s,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),Bt(e,r)}var o="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(o,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),Bt(e,r)}}]),n}(km),cg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",130),Em(fd(e),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t){return rg("R"===t?4:t.length,e)}},{key:"set",value:function(e,t,n){var r=new Date(0);return r.setUTCFullYear(n,0,4),r.setUTCHours(0,0,0,0),Ps(r)}}]),n}(km),dg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",130),Em(fd(e),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t){return rg("u"===t?4:t.length,e)}},{key:"set",value:function(e,t,n){return e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e}}]),n}(km),hg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",120),Em(fd(e),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"Q":case"QQ":return ng(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}]),n}(km),ug=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",120),Em(fd(e),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"q":case"qq":return ng(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}]),n}(km),pg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),Em(fd(e),"priority",110),e}return xm(n,[{key:"parse",value:function(e,t,n){var r=function(e){return e-1};switch(t){case"M":return Jm(Qm(Tm,e),r);case"MM":return Jm(ng(2,e),r);case"Mo":return Jm(n.ordinalNumber(e,{unit:"month"}),r);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}]),n}(km),fg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",110),Em(fd(e),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){var r=function(e){return e-1};switch(t){case"L":return Jm(Qm(Tm,e),r);case"LL":return Jm(ng(2,e),r);case"Lo":return Jm(n.ordinalNumber(e,{unit:"month"}),r);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}]),n}(km);var mg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",100),Em(fd(e),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"w":return Qm(Mm,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return ng(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=53}},{key:"set",value:function(e,t,n,r){return Bt(function(e,t,n){Nt(2,arguments);var r=Lt(e),i=Ft(t),s=Ds(r,n)-i;return r.setUTCDate(r.getUTCDate()-7*s),r}(e,n,r),r)}}]),n}(km);var gg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",100),Em(fd(e),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"I":return Qm(Mm,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return ng(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=53}},{key:"set",value:function(e,t,n){return Ps(function(e,t){Nt(2,arguments);var n=Lt(e),r=Ft(t),i=Rs(n)-r;return n.setUTCDate(n.getUTCDate()-7*i),n}(e,n))}}]),n}(km),yg=[31,28,31,30,31,30,31,31,30,31,30,31],vg=[31,29,31,30,31,30,31,31,30,31,30,31],bg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",90),Em(fd(e),"subPriority",1),Em(fd(e),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"d":return Qm(Pm,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return ng(t.length,e)}}},{key:"validate",value:function(e,t){var n=og(e.getUTCFullYear()),r=e.getUTCMonth();return n?t>=1&&t<=vg[r]:t>=1&&t<=yg[r]}},{key:"set",value:function(e,t,n){return e.setUTCDate(n),e.setUTCHours(0,0,0,0),e}}]),n}(km),wg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",90),Em(fd(e),"subpriority",1),Em(fd(e),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"D":case"DD":return Qm(Im,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return ng(t.length,e)}}},{key:"validate",value:function(e,t){return og(e.getUTCFullYear())?t>=1&&t<=366:t>=1&&t<=365}},{key:"set",value:function(e,t,n){return e.setUTCMonth(0,n),e.setUTCHours(0,0,0,0),e}}]),n}(km);function xg(e,t,n){var r,i,s,o,a,l,c,d;Nt(2,arguments);var h=$t(),u=Ft(null!==(r=null!==(i=null!==(s=null!==(o=null==n?void 0:n.weekStartsOn)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(l=a.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==s?s:h.weekStartsOn)&&void 0!==i?i:null===(c=h.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.weekStartsOn)&&void 0!==r?r:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=Lt(e),f=Ft(t),m=((f%7+7)%7<u?7:0)+f-p.getUTCDay();return p.setUTCDate(p.getUTCDate()+m),p}var Eg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",90),Em(fd(e),"incompatibleTokens",["D","i","e","c","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=xg(e,n,r)).setUTCHours(0,0,0,0),e}}]),n}(km),Cg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",90),Em(fd(e),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n,r){var i=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return Jm(ng(t.length,e),i);case"eo":return Jm(n.ordinalNumber(e,{unit:"day"}),i);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=xg(e,n,r)).setUTCHours(0,0,0,0),e}}]),n}(km),Sg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",90),Em(fd(e),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n,r){var i=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return Jm(ng(t.length,e),i);case"co":return Jm(n.ordinalNumber(e,{unit:"day"}),i);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=xg(e,n,r)).setUTCHours(0,0,0,0),e}}]),n}(km);var _g=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",90),Em(fd(e),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){var r=function(e){return 0===e?7:e};switch(t){case"i":case"ii":return ng(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return Jm(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return Jm(n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Jm(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);default:return Jm(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r)}}},{key:"validate",value:function(e,t){return t>=1&&t<=7}},{key:"set",value:function(e,t,n){return e=function(e,t){Nt(2,arguments);var n=Ft(t);n%7==0&&(n-=7);var r=Lt(e),i=((n%7+7)%7<1?7:0)+n-r.getUTCDay();return r.setUTCDate(r.getUTCDate()+i),r}(e,n),e.setUTCHours(0,0,0,0),e}}]),n}(km),kg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",80),Em(fd(e),"incompatibleTokens",["b","B","H","k","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(ig(n),0,0,0),e}}]),n}(km),Og=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",80),Em(fd(e),"incompatibleTokens",["a","B","H","k","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(ig(n),0,0,0),e}}]),n}(km),Tg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",80),Em(fd(e),"incompatibleTokens",["a","b","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(ig(n),0,0,0),e}}]),n}(km),Pg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",70),Em(fd(e),"incompatibleTokens",["H","K","k","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"h":return Qm(Dm,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return ng(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=12}},{key:"set",value:function(e,t,n){var r=e.getUTCHours()>=12;return r&&n<12?e.setUTCHours(n+12,0,0,0):r||12!==n?e.setUTCHours(n,0,0,0):e.setUTCHours(0,0,0,0),e}}]),n}(km),Ig=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",70),Em(fd(e),"incompatibleTokens",["a","b","h","K","k","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"H":return Qm(Rm,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return ng(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=23}},{key:"set",value:function(e,t,n){return e.setUTCHours(n,0,0,0),e}}]),n}(km),Mg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",70),Em(fd(e),"incompatibleTokens",["h","H","k","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"K":return Qm(Nm,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return ng(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.getUTCHours()>=12&&n<12?e.setUTCHours(n+12,0,0,0):e.setUTCHours(n,0,0,0),e}}]),n}(km),Rg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",70),Em(fd(e),"incompatibleTokens",["a","b","h","H","K","t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"k":return Qm(Am,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return ng(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=24}},{key:"set",value:function(e,t,n){var r=n<=24?n%24:n;return e.setUTCHours(r,0,0,0),e}}]),n}(km),Ag=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",60),Em(fd(e),"incompatibleTokens",["t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"m":return Qm(Lm,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return ng(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCMinutes(n,0,0),e}}]),n}(km),Ng=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",50),Em(fd(e),"incompatibleTokens",["t","T"]),e}return xm(n,[{key:"parse",value:function(e,t,n){switch(t){case"s":return Qm(Fm,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return ng(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCSeconds(n,0),e}}]),n}(km),Dg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",30),Em(fd(e),"incompatibleTokens",["t","T"]),e}return xm(n,[{key:"parse",value:function(e,t){return Jm(ng(t.length,e),(function(e){return Math.floor(e*Math.pow(10,3-t.length))}))}},{key:"set",value:function(e,t,n){return e.setUTCMilliseconds(n),e}}]),n}(km),Lg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",10),Em(fd(e),"incompatibleTokens",["t","T","x"]),e}return xm(n,[{key:"parse",value:function(e,t){switch(t){case"X":return eg(Gm,e);case"XX":return eg(qm,e);case"XXXX":return eg(Xm,e);case"XXXXX":return eg(Zm,e);default:return eg(Ym,e)}}},{key:"set",value:function(e,t,n){return t.timestampIsSet?e:new Date(e.getTime()-n)}}]),n}(km),Fg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",10),Em(fd(e),"incompatibleTokens",["t","T","X"]),e}return xm(n,[{key:"parse",value:function(e,t){switch(t){case"x":return eg(Gm,e);case"xx":return eg(qm,e);case"xxxx":return eg(Xm,e);case"xxxxx":return eg(Zm,e);default:return eg(Ym,e)}}},{key:"set",value:function(e,t,n){return t.timestampIsSet?e:new Date(e.getTime()-n)}}]),n}(km),jg=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",40),Em(fd(e),"incompatibleTokens","*"),e}return xm(n,[{key:"parse",value:function(e){return tg(e)}},{key:"set",value:function(e,t,n){return[new Date(1e3*n),{timestampIsSet:!0}]}}]),n}(km),$g=function(e){fm(n,e);var t=ym(n);function n(){var e;vm(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Em(fd(e=t.call.apply(t,[this].concat(i))),"priority",20),Em(fd(e),"incompatibleTokens","*"),e}return xm(n,[{key:"parse",value:function(e){return tg(e)}},{key:"set",value:function(e,t,n){return[new Date(n),{timestampIsSet:!0}]}}]),n}(km),Bg={G:new Om,y:new ag,Y:new lg,R:new cg,u:new dg,Q:new hg,q:new ug,M:new pg,L:new fg,w:new mg,I:new gg,d:new bg,D:new wg,E:new Eg,e:new Cg,c:new Sg,i:new _g,a:new kg,b:new Og,B:new Tg,h:new Pg,H:new Ig,K:new Mg,k:new Rg,m:new Ag,s:new Ng,S:new Dg,X:new Lg,x:new Fg,t:new jg,T:new $g},Vg=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zg=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Hg=/^'([^]*?)'?$/,Ug=/''/g,Kg=/\S/,Wg=/[a-zA-Z]/;function Gg(e,t,n,r){var i,s,o,a,l,c,d,h,u,p,f,m,g,y,v,b,w,x;Nt(3,arguments);var E=String(e),C=String(t),S=$t(),_=null!==(i=null!==(s=null==r?void 0:r.locale)&&void 0!==s?s:S.locale)&&void 0!==i?i:mo;if(!_.match)throw new RangeError("locale must contain match property");var k=Ft(null!==(o=null!==(a=null!==(l=null!==(c=null==r?void 0:r.firstWeekContainsDate)&&void 0!==c?c:null==r||null===(d=r.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==l?l:S.firstWeekContainsDate)&&void 0!==a?a:null===(u=S.locale)||void 0===u||null===(p=u.options)||void 0===p?void 0:p.firstWeekContainsDate)&&void 0!==o?o:1);if(!(k>=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=Ft(null!==(f=null!==(m=null!==(g=null!==(y=null==r?void 0:r.weekStartsOn)&&void 0!==y?y:null==r||null===(v=r.locale)||void 0===v||null===(b=v.options)||void 0===b?void 0:b.weekStartsOn)&&void 0!==g?g:S.weekStartsOn)&&void 0!==m?m:null===(w=S.locale)||void 0===w||null===(x=w.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==f?f:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===C)return""===E?Lt(n):new Date(NaN);var T,P={firstWeekContainsDate:k,weekStartsOn:O,locale:_},I=[new _m],M=C.match(zg).map((function(e){var t=e[0];return t in Qs?(0,Qs[t])(e,_.formatLong):e})).join("").match(Vg),R=[],A=um(M);try{var N=function(){var t=T.value;null!=r&&r.useAdditionalWeekYearTokens||!io(t)||so(t,C,e),null!=r&&r.useAdditionalDayOfYearTokens||!ro(t)||so(t,C,e);var n=t[0],i=Bg[n];if(i){var s=i.incompatibleTokens;if(Array.isArray(s)){var o=R.find((function(e){return s.includes(e.token)||e.token===n}));if(o)throw new RangeError("The format string mustn't contain `".concat(o.fullToken,"` and `").concat(t,"` at the same time"))}else if("*"===i.incompatibleTokens&&R.length>0)throw new RangeError("The format string mustn't contain `".concat(t,"` and any other token at the same time"));R.push({token:n,fullToken:t});var a=i.run(E,t,_.match,P);if(!a)return{v:new Date(NaN)};I.push(a.setter),E=a.rest}else{if(n.match(Wg))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");if("''"===t?t="'":"'"===n&&(t=function(e){return e.match(Hg)[1].replace(Ug,"'")}(t)),0!==E.indexOf(t))return{v:new Date(NaN)};E=E.slice(t.length)}};for(A.s();!(T=A.n()).done;){var D=N();if("object"===Dt(D))return D.v}}catch(e){A.e(e)}finally{A.f()}if(E.length>0&&Kg.test(E))return new Date(NaN);var L=I.map((function(e){return e.priority})).sort((function(e,t){return t-e})).filter((function(e,t,n){return n.indexOf(e)===t})).map((function(e){return I.filter((function(t){return t.priority===e})).sort((function(e,t){return t.subPriority-e.subPriority}))})).map((function(e){return e[0]})),F=Lt(n);if(isNaN(F.getTime()))return new Date(NaN);var j,$=Ts(F,eo(F)),B={},V=um(L);try{for(V.s();!(j=V.n()).done;){var z=j.value;if(!z.validate($,P))return new Date(NaN);var H=z.set($,B,P);Array.isArray(H)?($=H[0],pm(B,H[1])):$=H}}catch(e){V.e(e)}finally{V.f()}return $}function qg(e,t){var n;Nt(1,arguments);var r=Ft(null!==(n=null==t?void 0:t.additionalDigits)&&void 0!==n?n:2);if(2!==r&&1!==r&&0!==r)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var i,s=function(e){var t,n={},r=e.split(Xg.dateTimeDelimiter);if(r.length>2)return n;/:/.test(r[0])?t=r[0]:(n.date=r[0],t=r[1],Xg.timeZoneDelimiter.test(n.date)&&(n.date=e.split(Xg.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length)));if(t){var i=Xg.timezone.exec(t);i?(n.time=t.replace(i[1],""),n.timezone=i[1]):n.time=t}return n}(e);if(s.date){var o=function(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,s=r[2]?parseInt(r[2]):null;return{year:null===s?i:100*s,restDateString:e.slice((r[1]||r[2]).length)}}(s.date,r);i=function(e,t){if(null===t)return new Date(NaN);var n=e.match(Yg);if(!n)return new Date(NaN);var r=!!n[4],i=Qg(n[1]),s=Qg(n[2])-1,o=Qg(n[3]),a=Qg(n[4]),l=Qg(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,a,l)?function(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var i=r.getUTCDay()||7,s=7*(t-1)+n+1-i;return r.setUTCDate(r.getUTCDate()+s),r}(t,a,l):new Date(NaN);var c=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(ty[t]||(ny(e)?29:28))}(t,s,o)&&function(e,t){return t>=1&&t<=(ny(e)?366:365)}(t,i)?(c.setUTCFullYear(t,s,Math.max(i,o)),c):new Date(NaN)}(o.restDateString,o.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var a,l=i.getTime(),c=0;if(s.time&&(c=function(e){var t=e.match(Zg);if(!t)return NaN;var n=ey(t[1]),r=ey(t[2]),i=ey(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,i))return NaN;return n*jo+r*Fo+1e3*i}(s.time),isNaN(c)))return new Date(NaN);if(!s.timezone){var d=new Date(l+c),h=new Date(0);return h.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),h.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),h}return a=function(e){if("Z"===e)return 0;var t=e.match(Jg);if(!t)return 0;var n="+"===t[1]?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,i))return NaN;return n*(r*jo+i*Fo)}(s.timezone),isNaN(a)?new Date(NaN):new Date(l+c+a)}var Xg={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Yg=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Zg=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Jg=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Qg(e){return e?parseInt(e):1}function ey(e){return e&&parseFloat(e.replace(",","."))||0}var ty=[31,null,31,30,31,30,31,31,30,31,30,31];function ny(e){return e%400==0||e%4==0&&e%100!=0}function ry(e,t,n,r){let i=null;if(e){t&&(i=Gg(e,t,n=n||new Date,{locale:r})),ks(i)||(i=qg(e)),ks(i)||(i=new Date(Date.parse(e)));const s=ks(i)&&String(i.getFullYear()).length>4;ks(i)&&!s||(i=null)}return i}const iy={date:Wf.FORMAT_FULL_DATE,dateTime:Wf.FORMAT_DATE_TIME,dateRange:Wf.FORMAT_FULL_DATE,dateTimeRange:Wf.FORMAT_DATE_TIME,month:Wf.FORMAT_YEAR_MONTH,monthRange:Wf.FORMAT_YEAR_MONTH};function sy(e){return e&&iy[e]}const oy=e=>iy;function ay(e){const{format:t,type:n}=e,r=/([yMd]{0,4}[^a-z\s]*[yMd]{0,4}[^a-z\s]*[yMd]{0,4})/i,i=/([yMd]{0,4}[^a-z\s]*[yMd]{0,4}[^a-z\s]*[yMd]{0,4}) (H{0,2}[^a-z\s]*m{0,2}[^a-z\s]*s{0,2})/i,s=sy(n);let o;switch(n){case"dateTime":case"dateTimeRange":const e=i.exec(t);o=e&&e[1]&&e[2]?`${e[1]} ${e[2]}`:s;break;default:const n=r.exec(t);o=n&&n[1]||s}return o}function ly(e){const{inputValue:t="",rangeSeparator:n,type:r}=e;let i,s,o,a;const l={monthLeft:{dateInput:"",timeInput:""},monthRight:{dateInput:"",timeInput:""}};switch(r){case"date":case"month":case"monthRange":l.monthLeft.dateInput=t;break;case"dateRange":[i="",o=""]=t.split(n),l.monthLeft.dateInput=i,l.monthRight.dateInput=o;break;case"dateTime":[i="",s=""]=t.split(" "),l.monthLeft.dateInput=i,l.monthLeft.timeInput=s;break;case"dateTimeRange":const[e="",r=""]=t.split(n);[i="",s=""]=e.split(" "),[o="",a=""]=r.split(" "),l.monthLeft.dateInput=i,l.monthLeft.timeInput=s,l.monthRight.dateInput=o,l.monthRight.timeInput=a}return l}function cy(e){return["string","number"].includes(typeof e)&&""!==e}class dy extends c{constructor(e){super(Object.assign({},e)),this.clearRangeInputFocus=()=>{const{type:e}=this._adapter.getProps(),{rangeInputFocus:t}=this._adapter.getStates();"dateTimeRange"===e&&t&&this._adapter.setRangeInputFocus(!1)},this._isRangeType=()=>{const e=this._adapter.getProp("type");return/range/i.test(e)},this._isRangeValueComplete=e=>{let t=!1;return Array.isArray(e)&&(t=!e.some((e=>Re(e)))),t}}init(){const e=this.getProp("timeZone");this._isControlledComponent()?this.initFromProps({timeZone:e,value:this.getProp("value")}):this._isInProps("defaultValue")&&this.initFromProps({timeZone:e,value:this.getProp("defaultValue")}),this.initPanelOpenStatus(this.getProp("defaultOpen"))}initFromProps(e){let{value:t,timeZone:n,prevTimeZone:r}=e;const i=(Array.isArray(t)?[...t]:(t||0===t)&&[t])||[],s=this.parseWithTimezone(i,n,r);this._adapter.updatePrevTimezone(r),this.clearInputValue(),this._adapter.updateValue(s),this.resetCachedSelectedValue(s),this.initRangeInputFocus(s),this._adapter.needConfirm()&&this._adapter.updateCachedSelectedValue(s)}initRangeInputFocus(e){const{triggerRender:t}=this.getProps();this._isRangeType()&&ye()(t)&&0===e.length&&this._adapter.setRangeInputFocus("rangeStart")}parseWithTimezone(e,t,n){const r=[];if(Array.isArray(e)&&e.length)for(const i of e){let e=(i||0===i)&&this._parseValue(i);e?(cy(n)&&(e=dm(e,n)),r.push(cy(t)?cm(e,t):e)):Q(!0,`[Semi DatePicker] value cannot be parsed, value: ${String(i)}`)}return r}_isMultiple(){return Boolean(this.getProp("multiple"))}_parseValue(e){const t=this._adapter.getProp("dateFnsLocale");let n;if(!e&&0!==e)return new Date;if(tm(e))n=e;else if(xe()(e))n=ry(e,this.getProp("format"),void 0,t);else{if(!nm(e))throw new TypeError("defaultValue should be valid Date object/timestamp or string");n=new Date(e)}return n}destroy(){this._adapter.togglePanel(!1),this._adapter.unregisterClickOutSide()}initPanelOpenStatus(e){!this.getProp("open")&&!e||this.getProp("disabled")?(this._adapter.togglePanel(!1),this._adapter.unregisterClickOutSide()):(this._adapter.togglePanel(!0),this._adapter.registerClickOutSide())}openPanel(){this.getProp("disabled")||(this._isControlledComponent("open")||this.open(),this._adapter.notifyOpenChange(!0))}clearInsetInputValue(){const{insetInput:e}=this._adapter.getProps();e&&this._adapter.updateInsetInputValue(null)}resetCachedSelectedValue(e){const{value:t,cachedSelectedValue:n}=this._adapter.getStates(),r=Array.isArray(e)?e:t;Oe()(r,n)||this._adapter.updateCachedSelectedValue(r)}closePanel(){this._isControlledComponent("open")?this.resetInnerSelectedStates():this.close(),this._adapter.notifyOpenChange(!1)}open(){this._adapter.togglePanel(!0),this._adapter.registerClickOutSide()}close(){this._adapter.togglePanel(!1),this.resetInnerSelectedStates(),this._adapter.unregisterClickOutSide()}focus(e){if(this._isRangeType()){const t=null!=e?e:"rangeStart";this._adapter.setRangeInputFocus(t)}else this._adapter.setInputFocus()}blur(){this._isRangeType()?this._adapter.setRangeInputBlur():this._adapter.setInputBlur()}resetInnerSelectedStates(){setTimeout((()=>{const{value:e,cachedSelectedValue:t}=this._adapter.getStates();Oe()(e,t)||this.resetCachedSelectedValue(e)}),0),this.resetFocus(),this.clearInputValue()}resetFocus(e){this._adapter.setRangeInputFocus(!1),this._adapter.notifyBlur(e)}isCachedSelectedValueValid(e){const t=e||this._adapter.getState("cachedSelectedValue"),{type:n}=this._adapter.getProps();let r=!0;switch(!0){case"dateRange"===n:case"dateTimeRange"===n:this._isRangeValueComplete(t)||(r=!1);break;default:const e=null==t?void 0:t.filter((e=>e));Array.isArray(e)&&e.length||(r=!1)}return r}clearInputValue(){this._adapter.updateInputValue(null),this._adapter.updateInsetInputValue(null)}handleInputChange(e,t){const n=this._isMultiple()?this.parseMultipleInput(e):this.parseInput(e),{value:r}=this.getStates();if(this._updateCachedSelectedValueFromInput(e),n&&n.length||""===e){if(o()(t,ur.CLEARBTN_CLICKED_EVENT_FLAG)&&this._isControlledComponent("value"))return void this._notifyChange(n);this._updateValueAndInput(n,""===e,e);const i=this._getChangedDates(n);this._someDateDisabled(i,n)||Oe()(n,r)||this._notifyChange(n)}else this._adapter.updateInputValue(e)}handleInsetInputChange(e){const{insetInputStr:t,format:n,insetInputValue:r}=e,i=this._isMultiple(),s=i?this.parseMultipleInput(t,n):this.parseInput(t,n),{value:o}=this.getStates();if(this._updateCachedSelectedValueFromInput(t),s&&s.length){const e=this._getChangedDates(s);if(!this._someDateDisabled(e,s)){Oe()(s,o)||(this._isControlledComponent()||this._adapter.needConfirm()||this._adapter.updateValue(s),this._notifyChange(s));const e=i?this.formatMultipleDates(s):this.formatDates(s);this._adapter.updateInputValue(e)}}this._adapter.updateInsetInputValue(r)}_updateCachedSelectedValueFromInput(e){const t=this.getLooseDateFromInput(e),n=this._getChangedDates(t);this._someDateDisabled(n,t)||this.resetCachedSelectedValue(t)}handleInputBlur(){}handleRangeEndTabPress(e){this._adapter.setRangeInputFocus(!1)}handleInputFocus(e,t){const n=this._adapter.getState("rangeInputFocus");t&&this._adapter.setRangeInputFocus(t),t&&["rangeStart","rangeEnd"].includes(n)||this._adapter.notifyFocus(e,t)}handleSetRangeFocus(e){this._adapter.setRangeInputFocus(e)}handleInputClear(e){this._adapter.notifyClear(e)}handleRangeInputClear(e){const t=[];this._isControlledComponent("value")||(this._updateValueAndInput(t,!0,""),this._adapter.updateInsetInputValue(null),this.resetCachedSelectedValue(t)),this._notifyChange(t),this._adapter.setRangeInputFocus(!1),this._adapter.notifyClear(e)}handleRangeInputBlur(e,t){}handleInputComplete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e?this._isMultiple()?this.parseMultipleInput(e,",",!0):this.parseInput(e):[];if(t=t&&t.length?t:this.getState("value"),!t||!t.length){const e=new Date;t=this._isRangeType()?[e,e]:[e]}this._updateValueAndInput(t);const{value:n}=this.getStates(),r=this._getChangedDates(t);this._someDateDisabled(r,t)||Oe()(t,n)||this._notifyChange(t)}parseInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=[];const{dateFnsLocale:r,rangeSeparator:i}=this.getProps();if(e&&e.length){const s=this.getProp("type"),o=t||this.getProp("format")||sy(s);let a,l;const c=new Date;switch(s){case"date":case"dateTime":case"month":a=e?ry(e,o,c,r):"",l=a&&ks(a)&&this.localeFormat(a,o),a&&l===e&&(n=[a]);break;case"dateRange":case"dateTimeRange":case"monthRange":const t=i,s=e.split(t);a=s&&s.reduce(((e,t)=>{const n=t&&ry(t,o,c,r);return n&&e.push(n),e}),[]),l=a&&a.map((e=>e&&ks(e)&&this.localeFormat(e,o))).join(t),a&&l===e&&(a.sort(((e,t)=>e.getTime()-t.getTime())),n=a)}}return n}getLooseDateFromInput(e){return this._isMultiple()?this.parseMultipleInputLoose(e):this.parseInputLoose(e)}parseInputLoose(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];const{dateFnsLocale:n,rangeSeparator:r,type:i,format:s}=this.getProps();if(e&&e.length){const o=s||sy(i);let a,l;const c=new Date;switch(i){case"date":case"dateTime":case"month":const i=ry(e,o,c,n);tm(i)?(l=this.localeFormat(i,o),l===e&&(a=i)):a=null,t=[a];break;case"dateRange":case"dateTimeRange":const s=r,d=e.split(s);a=d&&d.reduce(((e,t)=>{let r=null;const i=ry(t,o,c,n);return tm(i)&&(l=this.localeFormat(i,o),l===t&&(r=i)),e.push(r),e}),[]),Array.isArray(a)&&a.every((e=>ks(e)))&&a.sort(((e,t)=>e.getTime()-t.getTime())),t=a}}return t}parseMultipleInputLoose(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wf.DEFAULT_SEPARATOR_MULTIPLE,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=this.getProp("max"),i=e.split(t),s=[];for(const e of i){let t=e&&this.parseInputLoose(e);if(t=Array.isArray(t)?t:t&&[t],!t||!t.length)return[];if(n?!s.filter((e=>Boolean(t.find((t=>Qf(e,t))))))&&s.push(...t):s.push(...t),r&&r>0&&s.length>r)return[]}return s}parseMultipleInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wf.DEFAULT_SEPARATOR_MULTIPLE,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=this.getProp("max"),i=e.split(t),s=[];for(const e of i){let t=e&&this.parseInput(e);if(t=Array.isArray(t)?t:t&&[t],!t||!t.length)return[];if(n?!s.filter((e=>Boolean(t.find((t=>Qf(e,t))))))&&s.push(...t):s.push(...t),r&&r>0&&s.length>r)return[]}return s}formatDates(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n="";const r=this.getProp("rangeSeparator");if(Array.isArray(e)&&e.length){const i=this.getProp("type"),s=t||this.getProp("format")||sy(i);switch(i){case"date":case"dateTime":case"month":n=this.localeFormat(e[0],s);break;case"dateRange":case"dateTimeRange":case"monthRange":const t=!Re(e[0]),i=!Re(e[1]);t&&i?n=`${this.localeFormat(e[0],s)}${r}${this.localeFormat(e[1],s)}`:t?n=`${this.localeFormat(e[0],s)}${r}`:i&&(n=`${r}${this.localeFormat(e[1],s)}`)}}return n}formatMultipleDates(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wf.DEFAULT_SEPARATOR_MULTIPLE,n=arguments.length>2?arguments[2]:void 0;const r=[];if(Array.isArray(e)&&e.length){switch(this.getProp("type")){case"date":case"dateTime":case"month":e.forEach((e=>r.push(this.formatDates([e],n))));break;case"dateRange":case"dateTimeRange":case"monthRange":for(let t=0;t<e.length;t+=2)r.push(this.formatDates(e.slice(t,t+2),n))}}return r.join(t)}_updateValueAndInput(e,t,n){let r;if(t||e){r=Array.isArray(e)?e:e?[e]:[];const t=this._getChangedDates(r);this._isControlledComponent()||this._someDateDisabled(t,r)||this._adapter.needConfirm()||this._adapter.updateValue(r)}this._adapter.updateInputValue(n)}handleSelectedChange(e,t){const{type:n,format:r,rangeSeparator:i,insetInput:s}=this._adapter.getProps(),{value:a}=this.getStates(),l=this._isControlledComponent(),c=z()(t)?t.fromPreset:t,d=o()(t,"closePanel",!0),h=o()(t,"needCheckFocusRecord",!0),u=Array.isArray(e)?[...e]:e?[e]:[],p=this._getChangedDates(u);let f,m;if(!this._someDateDisabled(p,u)){if(this.resetCachedSelectedValue(u),f=this._isMultiple()?this.formatMultipleDates(u):this.formatDates(u),s){const e=ay({format:r,type:n});m=ly({inputValue:this._isMultiple()?this.formatMultipleDates(u,void 0,e):this.formatDates(u,e),type:n,rangeSeparator:i})}if(this._isRangeType()&&!this._isRangeValueComplete(u))return this._adapter.updateInputValue(f),void this._adapter.updateInsetInputValue(m);l&&!c||(this._updateValueAndInput(u,!0,f),this._adapter.updateInsetInputValue(m)),Oe()(e,a)||this._notifyChange(e)}const g=!h||h&&this._adapter.couldPanelClosed();("date"===n&&!this._isMultiple()&&d||"dateRange"===n&&this._isRangeValueComplete(u)&&d&&g)&&this.closePanel()}handleYMSelectedChange(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{currentMonth:t,currentYear:n}=e,{type:r}=this.getProps();if("month"===r){const e=new Date(n.left,t.left-1);this.handleSelectedChange([e])}else{const e=new Date(n.left,t.left-1),r=new Date(n.right,t.right-1);this.handleSelectedChange([e,r])}}handleConfirm(){const{cachedSelectedValue:e,value:t}=this._adapter.getStates(),n=this._isRangeValueComplete(e),r=n?e:t;if(this._adapter.needConfirm()&&!this._isControlledComponent()&&this._adapter.updateValue(r),this.closePanel(),n){const{notifyValue:t,notifyDate:n}=this.disposeCallbackArgs(e);this._adapter.notifyConfirm(n,t)}}handleCancel(){this.closePanel();const e=this.getState("value"),{notifyValue:t,notifyDate:n}=this.disposeCallbackArgs(e);this._adapter.notifyCancel(n,t)}handlePresetClick(e,t){const{type:n,timeZone:r}=this.getProps(),i=this.getState("prevTimezone"),s="function"==typeof e.start?e.start():e.start,o="function"==typeof e.end?e.end():e.end;let a;switch(n){case"month":case"dateTime":case"date":a=this.parseWithTimezone([s],r,i),this.handleSelectedChange(a);break;case"dateTimeRange":case"dateRange":a=this.parseWithTimezone([s,o],r,i),this.handleSelectedChange(a,{needCheckFocusRecord:!1})}this._adapter.notifyPresetsClick(e,t)}disposeCallbackArgs(e){let t=Array.isArray(e)?e:e&&[e]||[];const n=this.getProp("timeZone");cy(n)&&(t=t.map((e=>dm(e,n))));const r=this.getProp("type"),i=this.getProp("format")||sy(r);let s,o;switch(r){case"date":case"dateTime":case"month":this._isMultiple()?(s=t.map((e=>e&&this.localeFormat(e,i))),o=[...t]):(s=t[0]&&this.localeFormat(t[0],i),[o]=t);break;case"dateRange":case"dateTimeRange":case"monthRange":s=t.map((e=>e&&this.localeFormat(e,i))),o=[...t]}return{notifyValue:s,notifyDate:o}}_notifyChange(e){if(this._isRangeType()&&!this._isRangeValueComplete(e))return;const{onChangeWithDateFirst:t}=this.getProps(),{notifyValue:n,notifyDate:r}=this.disposeCallbackArgs(e);t?this._adapter.notifyChange(r,n):this._adapter.notifyChange(n,r)}_getChangedDates(e){const t=this._adapter.getProp("type"),{cachedSelectedValue:n}=this._adapter.getStates(),r=[];switch(t){case"dateRange":case"dateTimeRange":const[t,i]=n,[s,o]=e;em(s,t)||r.push(s),em(o,i)||r.push(o);break;default:const a=new Set;n.forEach((e=>a.add(_s(e)&&e.valueOf())));for(const t of e)a.has(_s(t)&&t.valueOf())||r.push(t)}return r}_someDateDisabled(e,t){const{rangeInputFocus:n}=this.getStates(),r={rangeStart:"",rangeEnd:"",rangeInputFocus:n};if(this._isRangeType()&&Array.isArray(t)){if(ks(t[0])){const e=xo(t[0],"yyyy-MM-dd");r.rangeStart=e}if(ks(t[1])){const e=xo(t[1],"yyyy-MM-dd");r.rangeEnd=e}}let i=!1;for(const t of e)if(!Re(t)){const e=this._isRangeType()&&ks(t)?Cs(t):t;if(this.disabledDisposeDate(e,r)){i=!0;break}}return i}localeFormat(e,t){return xo(e,t,{locale:this._adapter.getProp("dateFnsLocale")})}disposeDateFn(e,t){const{notifyDate:n}=this.disposeCallbackArgs(t),r=Array.isArray(t);let i;i=r===Array.isArray(n)?n:r?[n]:n[0];for(var s=arguments.length,o=new Array(s>2?s-2:0),a=2;a<s;a++)o[a-2]=arguments[a];return e(i,...o)}disabledDisposeDate(e){const{disabledDate:t}=this.getProps();for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return this.disposeDateFn(t,e,...r)}disabledDisposeTime(e){const{disabledTime:t}=this.getProps();for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return this.disposeDateFn(t,e,...r)}handleTriggerWrapperClick(e){const{disabled:t,triggerRender:n}=this._adapter.getProps(),{rangeInputFocus:r}=this._adapter.getStates();t||(this._isRangeType()&&!r?(this._adapter.isEventTarget(e)?setTimeout((()=>{this.handleInputFocus(e,"rangeStart")}),0):ye()(n)&&this._adapter.setRangeInputFocus("rangeStart"),this.openPanel()):this.openPanel())}handlePanelVisibleChange(e){e?(this._adapter.setInsetInputFocus(),setTimeout((()=>{this._adapter.setTriggerDisabled(!0)}),0)):this._adapter.setTriggerDisabled(!1)}}function hy(e,t){let{groupInnerSeparator:n=Wf.DEFAULT_SEPARATOR_RANGE,groupSize:r=1,groupSeparator:i=Wf.DEFAULT_SEPARATOR_MULTIPLE}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0,o="";if((r<=0||"number"!=typeof r)&&(r=1),Array.isArray(e)&&e.length){const a=[],{length:l}=e;for(let t=0;t<l;t++){t%r==0&&a.push([]);a[Math.floor(t/r)].push(e[t])}o=a.map((e=>e.map((e=>e?xo(e,t,{locale:s}):"")).join(n))).join(i)}return o}function uy(e,t){Nt(2,arguments);var n=Lt(e),r=Ft(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),s=new Date(n.getTime());return s.setMonth(n.getMonth()+r+1,0),i>=s.getDate()?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}function py(e){const{defaultPickerValue:t,format:n,dateFnsLocale:r}=e;let i=Array.isArray(t)?t[0]:t,s=Array.isArray(t)?t[1]:void 0;switch(!0){case tm(i):break;case nm(i):i=new Date(i);break;case"string"==typeof i:i=ry(i,n,void 0,r);break;default:i=new Date}switch(!0){case tm(s):break;case nm(s):s=new Date(s);break;case"string"==typeof s:s=ry(s,n,void 0,r);break;default:s=uy(i,1)}return{nowDate:i,nextDate:s}}var fy=Function.prototype.toString,my=Object.create,gy=Object.prototype.toString,yy=function(){function e(){this._keys=[],this._values=[]}return e.prototype.has=function(e){return!!~this._keys.indexOf(e)},e.prototype.get=function(e){return this._values[this._keys.indexOf(e)]},e.prototype.set=function(e,t){this._keys.push(e),this._values.push(t)},e}();var vy="undefined"!=typeof WeakMap?function(){return new WeakMap}:function(){return new yy};function by(e){if(!e)return my(null);var t=e.constructor;if(t===Object)return e===Object.prototype?{}:my(e);if(t&&~fy.call(t).indexOf("[native code]"))try{return new t}catch(e){}return my(e)}var wy="g"===/test/g.flags?function(e){return e.flags}:function(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function xy(e){var t=gy.call(e);return t.substring(8,t.length-1)}var Ey="undefined"!=typeof Symbol?function(e){return e[Symbol.toStringTag]||xy(e)}:xy,Cy=Object.defineProperty,Sy=Object.getOwnPropertyDescriptor,_y=Object.getOwnPropertyNames,ky=Object.getOwnPropertySymbols,Oy=Object.prototype,Ty=Oy.hasOwnProperty,Py=Oy.propertyIsEnumerable,Iy="function"==typeof ky;var My=Iy?function(e){return _y(e).concat(ky(e))}:_y;function Ry(e,t,n){for(var r=My(e),i=0,s=r.length,o=void 0,a=void 0;i<s;++i)if("callee"!==(o=r[i])&&"caller"!==o)if(a=Sy(e,o)){a.get||a.set||(a.value=n.copier(a.value,n));try{Cy(t,o,a)}catch(e){t[o]=a.value}}else t[o]=n.copier(e[o],n);return t}function Ay(e,t){return e.slice(0)}function Ny(e,t){var n=new t.Constructor;return t.cache.set(e,n),e.forEach((function(e,r){n.set(r,t.copier(e,t))})),n}var Dy=Iy?function(e,t){var n=by(t.prototype);for(var r in t.cache.set(e,n),e)Ty.call(e,r)&&(n[r]=t.copier(e[r],t));for(var i=ky(e),s=0,o=i.length,a=void 0;s<o;++s)a=i[s],Py.call(e,a)&&(n[a]=t.copier(e[a],t));return n}:function(e,t){var n=by(t.prototype);for(var r in t.cache.set(e,n),e)Ty.call(e,r)&&(n[r]=t.copier(e[r],t));return n};function Ly(e,t){return new t.Constructor(e.valueOf())}function Fy(e,t){return e}function jy(e,t){var n=new t.Constructor;return t.cache.set(e,n),e.forEach((function(e){n.add(t.copier(e,t))})),n}var $y=Array.isArray,By=Object.assign,Vy=Object.getPrototypeOf||function(e){return e.__proto__},zy={array:function(e,t){var n=new t.Constructor;t.cache.set(e,n);for(var r=0,i=e.length;r<i;++r)n[r]=t.copier(e[r],t);return n},arrayBuffer:Ay,blob:function(e,t){return e.slice(0,e.size,e.type)},dataView:function(e,t){return new t.Constructor(Ay(e.buffer))},date:function(e,t){return new t.Constructor(e.getTime())},error:Fy,map:Ny,object:Dy,regExp:function(e,t){var n=new t.Constructor(e.source,wy(e));return n.lastIndex=e.lastIndex,n},set:jy},Hy=By({},zy,{array:function(e,t){var n=new t.Constructor;return t.cache.set(e,n),Ry(e,n,t)},map:function(e,t){return Ry(e,Ny(e,t),t)},object:function(e,t){var n=by(t.prototype);return t.cache.set(e,n),Ry(e,n,t)},set:function(e,t){return Ry(e,jy(e,t),t)}});function Uy(e){var t=function(e){return{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,Blob:e.blob,Boolean:Ly,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:Ly,Object:e.object,Promise:Fy,RegExp:e.regExp,Set:e.set,String:Ly,WeakMap:Fy,WeakSet:Fy,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer,Uint64Array:e.arrayBuffer}}(By({},zy,e)),n=t.Array,r=t.Object;function i(e,i){if(i.prototype=i.Constructor=void 0,!e||"object"!=typeof e)return e;if(i.cache.has(e))return i.cache.get(e);if(i.prototype=Vy(e),i.Constructor=i.prototype&&i.prototype.constructor,!i.Constructor||i.Constructor===Object)return r(e,i);if($y(e))return n(e,i);var s=t[Ey(e)];return s?s(e,i):"function"==typeof e.then?e:r(e,i)}return function(e){return i(e,{Constructor:void 0,cache:vy(),copier:i,prototype:void 0})}}!function(e){Uy(By({},Hy,e))}({});var Ky=Uy({});const Wy="Enter";class Gy extends c{constructor(e){super(Object.assign({},e))}init(){}destroy(){}handleClick(e){this._adapter.notifyClick(e)}handleChange(e,t){this._adapter.notifyChange(e,t)}handleInputComplete(e){e.key===Wy&&this._adapter.notifyEnter(e.target.value)}handleInputClear(e){this._adapter.notifyClear(e)}handleRangeInputClear(e){this.stopPropagation(e),this._adapter.notifyRangeInputClear(e)}handleRangeInputEnterPress(e,t){e.key===Wy&&this._adapter.notifyEnter(t)}handleRangeInputEndKeyPress(e){"Tab"===e.key&&this._adapter.notifyTabPress(e)}handleRangeInputFocus(e,t){this._adapter.notifyRangeInputFocus(e,t)}formatShowText(e,t){const{type:n,dateFnsLocale:r,format:i,rangeSeparator:s}=this._adapter.getProps(),o=t||i||sy(n);let a="";switch(n){case"date":case"dateTime":case"month":a=hy(e,o,void 0,r);break;case"dateRange":case"dateTimeRange":case"monthRange":a=hy(e,o,{groupSize:2,groupInnerSeparator:s},r)}return a}handleInsetInputChange(e){const{value:t,valuePath:n,insetInputValue:r}=e,{format:i,type:s,rangeSeparator:o}=this._adapter.getProps(),a=ay({type:s,format:i}),l=Y()(Ky(r),n,t),c=ly({inputValue:this.concatInsetInputValue({insetInputValue:l}),type:s,rangeSeparator:o}),d=this._autoFillTimeToInsetInputValue({insetInputValue:c,valuePath:n,format:a}),h=this.concatInsetInputValue({insetInputValue:d});this._adapter.notifyInsetInputChange({insetInputValue:d,format:a,insetInputStr:h})}_autoFillTimeToInsetInputValue(e){const{valuePath:t,insetInputValue:n,format:r}=e,{type:i,defaultPickerValue:s,dateFnsLocale:a}=this._adapter.getProps(),l=Ky(n),{nowDate:c,nextDate:d}=py({defaultPickerValue:s,format:r,dateFnsLocale:a});if(i.includes("Time")){let e="";const n=o()(r.split(" "),"0",Wf.FORMAT_FULL_DATE),i=o()(r.split(" "),"1",Wf.FORMAT_TIME_PICKER);switch(t){case"monthLeft.dateInput":const t=l.monthLeft.dateInput;if(!l.monthLeft.timeInput&&t.length===n.length){tm(ry(l.monthLeft.dateInput,n))&&(e=xo(c,i),l.monthLeft.timeInput=e)}break;case"monthRight.dateInput":const r=l.monthRight.dateInput;if(!l.monthRight.timeInput&&r.length===n.length){tm(ry(r,n))&&(e=xo(d,i),l.monthRight.timeInput=e)}}}return l}getInsetInputPlaceholder(){const{type:e,format:t,rangeSeparator:n}=this._adapter.getProps(),r=ay({type:e,format:t});let i,s;switch(e){case"date":case"month":case"dateRange":i=r;break;case"dateTime":case"dateTimeRange":[i,s]=r.split(" ");break;case"monthRange":i=r+n+r}return{datePlaceholder:i,timePlaceholder:s}}getInsetInputValue(e){let{value:t,insetInputValue:n}=e;const{type:r,rangeSeparator:i,format:s}=this._adapter.getProps();let o="";if(z()(n))o=this.concatInsetInputValue({insetInputValue:n});else{const e=ay({format:s,type:r});o=this.formatShowText(t,e)}return ly({inputValue:o,type:r,rangeSeparator:i})}concatInsetDateAndTime(e){let{date:t,time:n}=e;return`${t} ${n}`}concatInsetDateRange(e){let{rangeStart:t,rangeEnd:n}=e;const{rangeSeparator:r}=this._adapter.getProps();return`${t}${r}${n}`}concatInsetInputValue(e){let{insetInputValue:t}=e;const{type:n}=this._adapter.getProps();let r="";switch(n){case"date":case"month":case"monthRange":r=t.monthLeft.dateInput;break;case"dateRange":r=this.concatInsetDateRange({rangeStart:t.monthLeft.dateInput,rangeEnd:t.monthRight.dateInput});break;case"dateTime":r=this.concatInsetDateAndTime({date:t.monthLeft.dateInput,time:t.monthLeft.timeInput});break;case"dateTimeRange":const e=this.concatInsetDateAndTime({date:t.monthLeft.dateInput,time:t.monthLeft.timeInput}),n=this.concatInsetDateAndTime({date:t.monthRight.dateInput,time:t.monthRight.timeInput});r=this.concatInsetDateRange({rangeStart:e,rangeEnd:n})}return r}}const qy=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 20V8h16v12H4ZM2 4c0-1.1.9-2 2-2h16a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4Zm4 6.5c0-.28.22-.5.5-.5h2c.28 0 .5.22.5.5v2a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2Zm.5 4.5a.5.5 0 0 0-.5.5v2c0 .28.22.5.5.5h2a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5h-2Zm4-4.5c0-.28.22-.5.5-.5h2c.28 0 .5.22.5.5v2a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2ZM11 15a.5.5 0 0 0-.5.5v2c0 .28.22.5.5.5h2a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5h-2Zm4-4.5c0-.28.22-.5.5-.5h2c.28 0 .5.22.5.5v2a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2Zm.5 4.5a.5.5 0 0 0-.5.5v2c0 .28.22.5.5.5h2a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5h-2Z",fill:"currentColor"}))}),"calendar");const Xy=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M2 5v14a3 3 0 0 0 3 3h7.1a7.02 7.02 0 0 1-1.43-2H6a2 2 0 0 1-2-2V8a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2.67c.75.36 1.43.85 2 1.43V5a3 3 0 0 0-3-3H5a3 3 0 0 0-3 3Z",fill:"currentColor"}),d.createElement("path",{d:"M16 10h1c-.54 0-1.06.06-1.57.18A1 1 0 0 1 16 10Z",fill:"currentColor"}),d.createElement("path",{d:"M13.5 10.94a1 1 0 0 0-1-.94h-1a1 1 0 0 0-1 1v1a1 1 0 0 0 .77.97 7.03 7.03 0 0 1 2.23-2.03Z",fill:"currentColor"}),d.createElement("path",{d:"M7 10a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1a1 1 0 0 0-1-1H7Z",fill:"currentColor"}),d.createElement("path",{d:"M6 16a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-1Z",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22 17a5 5 0 1 1-10 0 5 5 0 0 1 10 0Zm-4-2a1 1 0 1 0-2 0v2c0 .27.1.52.3.7l1.5 1.5a1 1 0 0 0 1.4-1.4L18 16.58V15Z",fill:"currentColor"}))}),"calendar_clock");function Yy(e){const{insetInputValue:t,valuePath:n,onFocus:r,onChange:i,placeholder:s,forwardRef:a}=e,l=o()(t,n);return h().createElement(kr,{value:l,onChange:(e,r)=>{i({value:e,event:r,insetInputValue:t,valuePath:n})},onFocus:r,placeholder:s,ref:a})}function Zy(e){const{insetInputValue:t,valuePath:n,type:r,onFocus:i,onChange:s,placeholder:a,disabled:l}=e;if(!r.includes("Time"))return null;const c=o()(t,n);return h().createElement(kr,{value:c,onChange:(e,r)=>{s({value:e,event:r,insetInputValue:t,valuePath:n})},onFocus:i,placeholder:a,disabled:l})}var Jy=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class Qy extends f{constructor(e){super(e),this.handleChange=(e,t)=>this.foundation.handleChange(e,t),this.handleEnterPress=e=>this.foundation.handleInputComplete(e),this.handleInputClear=e=>this.foundation.handleInputClear(e),this.handleRangeInputChange=(e,t,n)=>{const r=this.getRangeInputValue(e,t);this.foundation.handleChange(r,n)},this.handleRangeInputClear=e=>{this.foundation.handleRangeInputClear(e)},this.handleRangeInputEnterPress=(e,t,n)=>{const r=this.getRangeInputValue(t,n);this.foundation.handleRangeInputEnterPress(e,r)},this.handleRangeInputEndKeyPress=e=>{this.foundation.handleRangeInputEndKeyPress(e)},this.handleRangeInputFocus=(e,t)=>{this.foundation.handleRangeInputFocus(e,t)},this.handleRangeStartFocus=e=>{this.handleRangeInputFocus(e,"rangeStart")},this.handleInsetInputChange=e=>{this.foundation.handleInsetInputChange(e)},this.getRangeInputValue=(e,t)=>{const{rangeSeparator:n}=this.props;return`${e}${n}${t}`},this.foundation=new Gy(this.adapter)}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{updateIsFocusing:e=>this.setState({isFocusing:e}),notifyClick:function(){return e.props.onClick(...arguments)},notifyChange:function(){return e.props.onChange(...arguments)},notifyEnter:function(){return e.props.onEnterPress(...arguments)},notifyBlur:function(){return e.props.onBlur(...arguments)},notifyClear:function(){return e.props.onClear(...arguments)},notifyFocus:function(){return e.props.onFocus(...arguments)},notifyRangeInputClear:function(){return e.props.onRangeClear(...arguments)},notifyRangeInputFocus:function(){return e.props.onFocus(...arguments)},notifyTabPress:function(){return e.props.onRangeEndTabPress(...arguments)},notifyInsetInputChange:e=>this.props.onInsetInputChange(e)})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}formatText(e){return e&&e.length?this.foundation.formatShowText(e):""}renderRangePrefix(){const{prefix:e,insetLabel:t,prefixCls:n,disabled:r,rangeInputFocus:i}=this.props,s=e||t;return s?h().createElement("div",{className:`${n}-range-input-prefix`,onClick:e=>!r&&!i&&this.handleRangeStartFocus(e),"x-semi-prop":"prefix,insetLabel"},s):null}renderRangeSeparator(e,t){const{disabled:n,rangeSeparator:r,rangeSeparatorNode:i}=this.props,s=w()({[`${Kf.PREFIX}-range-input-separator`]:!0,[`${Kf.PREFIX}-range-input-separator-active`]:(e||t)&&!n});return h().createElement("span",{onClick:e=>!n&&this.handleRangeStartFocus(e),className:s},null!=i?i:r)}renderRangeClearBtn(e,t){const{showClear:n,prefixCls:r,disabled:i,clearIcon:s,showClearIgnoreDisabled:o}=this.props;return(e||t)&&n&&!(i&&!o)?h().createElement("div",{role:"button",tabIndex:0,"aria-label":"Clear range input value",className:`${r}-range-input-clearbtn`,onMouseDown:e=>this.handleRangeInputClear(e)},s||h().createElement(gr,{"aria-hidden":!0})):null}renderRangeSuffix(e){const{prefixCls:t,disabled:n,rangeInputFocus:r}=this.props,i=e?h().createElement("div",{className:`${t}-range-input-suffix`,onClick:e=>!n&&!r&&this.handleRangeStartFocus(e)},e):null;return i}renderRangeInput(e){const{placeholder:t,inputStyle:n,disabled:r,inputReadOnly:i,autofocus:s,size:o,text:a,suffix:l,inputCls:c,rangeInputStartRef:d,rangeInputEndRef:u,rangeInputFocus:p,prefixCls:f,rangeSeparator:m,borderless:g}=e,[y,v=""]=a.split(m)||[],b="large"===o?"default":"small",x=Array.isArray(t)?t:[t,t],[E,C]=x,S=w()(`${f}-range-input-wrapper-start`,`${f}-range-input-wrapper`,{[`${f}-range-input-wrapper-active`]:"rangeStart"===p&&!r,[`${f}-range-input-wrapper-start-with-prefix`]:this.props.prefix||this.props.insetLabel,[`${f}-borderless`]:g}),_=w()(`${f}-range-input-wrapper-end`,`${f}-range-input-wrapper`,{[`${f}-range-input-wrapper-active`]:"rangeEnd"===p&&!r,[`${f}-borderless`]:g});return h().createElement(h().Fragment,null,this.renderRangePrefix(),h().createElement("div",{onClick:e=>!r&&this.handleRangeInputFocus(e,"rangeStart"),className:`${c} ${S}`},h().createElement(kr,{borderless:g,size:b,style:n,disabled:r,readonly:i,placeholder:E,value:y,onChange:(e,t)=>this.handleRangeInputChange(e,v,t),onEnterPress:e=>this.handleRangeInputEnterPress(e,y,v),onFocus:e=>this.handleRangeInputFocus(e,"rangeStart"),autoFocus:s,ref:d})),this.renderRangeSeparator(y,v),h().createElement("div",{className:`${c} ${_}`,onClick:e=>!r&&this.handleRangeInputFocus(e,"rangeEnd")},h().createElement(kr,{borderless:g,size:b,style:n,disabled:r,readonly:i,placeholder:C,value:v,onChange:(e,t)=>this.handleRangeInputChange(y,e,t),onEnterPress:e=>this.handleRangeInputEnterPress(e,y,v),onFocus:e=>this.handleRangeInputFocus(e,"rangeEnd"),onKeyDown:this.handleRangeInputEndKeyPress,ref:u})),this.renderRangeClearBtn(y,v),this.renderRangeSuffix(l))}isRenderMultipleInputs(){const{type:e}=this.props;return e.includes("Range")&&"monthRange"!==e}renderInputInset(){const{type:e,handleInsetDateFocus:t,handleInsetTimeFocus:n,value:r,insetInputValue:i,prefixCls:s,rangeInputStartRef:a,rangeInputEndRef:l,density:c,insetInput:d}=this.props,u=this.foundation.getInsetInputValue({value:r,insetInputValue:i}),{dateStart:p,dateEnd:f,timeStart:m,timeEnd:g}=o()(d,"placeholder",{}),{datePlaceholder:y,timePlaceholder:v}=this.foundation.getInsetInputPlaceholder(),b=`${s}-inset-input-wrapper`,w=`${s}-inset-input-separator`;return h().createElement("div",{className:b,"x-type":e},h().createElement(Yy,{forwardRef:a,insetInputValue:u,placeholder:null!=p?p:y,valuePath:"monthLeft.dateInput",onChange:this.handleInsetInputChange,onFocus:e=>t(e,"rangeStart")}),h().createElement(Zy,{disabled:!u.monthLeft.dateInput,insetInputValue:u,placeholder:null!=m?m:v,type:e,valuePath:"monthLeft.timeInput",onChange:this.handleInsetInputChange,onFocus:n}),this.isRenderMultipleInputs()&&h().createElement(h().Fragment,null,h().createElement("div",{className:w},"compact"===c?null:"-"),h().createElement(Yy,{forwardRef:l,insetInputValue:u,placeholder:null!=f?f:y,valuePath:"monthRight.dateInput",onChange:this.handleInsetInputChange,onFocus:e=>t(e,"rangeEnd")}),h().createElement(Zy,{disabled:!u.monthRight.dateInput,insetInputValue:u,placeholder:null!=g?g:v,type:e,valuePath:"monthRight.timeInput",onChange:this.handleInsetInputChange,onFocus:n})))}renderTriggerInput(){const e=this.props,{placeholder:t,type:n,value:r,inputValue:i,inputStyle:s,disabled:o,showClear:a,inputReadOnly:l,insetLabel:c,validateStatus:d,block:u,prefixCls:p,multiple:f,dateFnsLocale:m,onBlur:g,onClear:y,onFocus:v,prefix:b,autofocus:x,size:E,inputRef:C,rangeInputStartRef:S,rangeInputEndRef:_,onRangeClear:k,onRangeBlur:O,onRangeEndTabPress:T,rangeInputFocus:P,rangeSeparator:I,rangeSeparatorNode:M,insetInput:R,insetInputValue:A,defaultPickerValue:N,showClearIgnoreDisabled:D}=e,L=Jy(e,["placeholder","type","value","inputValue","inputStyle","disabled","showClear","inputReadOnly","insetLabel","validateStatus","block","prefixCls","multiple","dateFnsLocale","onBlur","onClear","onFocus","prefix","autofocus","size","inputRef","rangeInputStartRef","rangeInputEndRef","onRangeClear","onRangeBlur","onRangeEndTabPress","rangeInputFocus","rangeSeparator","rangeSeparatorNode","insetInput","insetInputValue","defaultPickerValue","showClearIgnoreDisabled"]),F=h().createElement(qy,{"aria-hidden":!0}),j=h().createElement(Xy,{"aria-hidden":!0}),$=n.includes("Time")?j:F;let B="";Re(i)?r&&(B=this.formatText(r)):B=i;const V=w()({[`${p}-input-readonly`]:l,[`${p}-monthRange-input`]:"monthRange"===n}),z=Object.assign(Object.assign({},this.props),{text:B,suffix:$,inputCls:V});return this.isRenderMultipleInputs()?this.renderRangeInput(z):h().createElement(kr,Object.assign({},L,{ref:C,insetLabel:c,disabled:o,showClearIgnoreDisabled:D,readonly:l,className:V,style:s,hideSuffix:a,placeholder:"monthRange"===n&&Array.isArray(t)?t[0]+I+t[1]:t,onEnterPress:this.handleEnterPress,onChange:this.handleChange,onClear:this.handleInputClear,suffix:$,showClear:a,value:B,validateStatus:d,prefix:b,autoFocus:x,size:E,onBlur:g,onFocus:v}))}render(){const{insetInput:e}=this.props;return e?this.renderInputInset():this.renderTriggerInput()}}function ev(e,t){Nt(2,arguments);var n=Lt(e),r=Lt(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function tv(e,t){return Nt(2,arguments),uy(e,12*Ft(t))}function nv(e){Nt(1,arguments);var t=Lt(e),n=t.getFullYear(),r=t.getMonth(),i=new Date(0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function rv(e,t){Nt(2,arguments);var n=Lt(e),r=Ft(t),i=n.getFullYear(),s=n.getDate(),o=new Date(0);o.setFullYear(i,r,15),o.setHours(0,0,0,0);var a=nv(o);return n.setMonth(r,Math.min(s,a)),n}function iv(e,t){if(Nt(2,arguments),"object"!==Dt(t)||null===t)throw new RangeError("values parameter must be an object");var n=Lt(e);return isNaN(n.getTime())?new Date(NaN):(null!=t.year&&n.setFullYear(t.year),null!=t.month&&(n=rv(n,t.month)),null!=t.date&&n.setDate(Ft(t.date)),null!=t.hours&&n.setHours(Ft(t.hours)),null!=t.minutes&&n.setMinutes(Ft(t.minutes)),null!=t.seconds&&n.setSeconds(Ft(t.seconds)),null!=t.milliseconds&&n.setMilliseconds(Ft(t.milliseconds)),n)}Qy.propTypes={borderless:E().bool,onClick:E().func,onChange:E().func,onEnterPress:E().func,onBlur:E().func,onClear:E().func,onFocus:E().func,value:E().array,disabled:E().bool,type:E().oneOf(Wf.TYPE_SET),showClear:E().bool,format:E().string,inputStyle:E().object,inputReadOnly:E().bool,insetLabel:E().node,validateStatus:E().string,prefix:E().node,prefixCls:E().string,dateFnsLocale:E().object.isRequired,placeholder:E().oneOfType([E().string,E().array]),rangeInputFocus:E().oneOfType([E().string,E().bool]),rangeInputStartRef:E().object,rangeInputEndRef:E().object,rangeSeparator:E().string,rangeSeparatorNode:E().node,insetInput:E().oneOfType([E().bool,E().object]),insetInputValue:E().object,defaultPickerValue:E().oneOfType([E().string,E().number,E().object,E().array])},Qy.defaultProps={borderless:!1,showClear:!0,onClick:Tt,onChange:Tt,onEnterPress:Tt,onBlur:Tt,onClear:Tt,onFocus:Tt,type:"date",inputStyle:{},inputReadOnly:!1,prefixCls:Kf.PREFIX,rangeSeparator:Wf.DEFAULT_SEPARATOR_RANGE};const sv=(e,t)=>{if(!t)return"";const n=new Date(t),r=ye()(e)?e(n):n;return xo(new Date(r),Wf.FORMAT_FULL_DATE)};function ov(e){return"string"==typeof e}function av(e,t){return Po(ov(e)?qg(e):e,ov(t)?qg(t):t)}function lv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="";const i="number"==typeof t&&t<10?`0${t}`:t.toString(),s="number"==typeof n&&n<10?`0${n}`:n.toString();return r=`${String(e)}-${i}-${s}`,r}const cv=(e,t)=>{const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n={dayNumber:"",dateNumberFull:"",fullDate:""},r=nv(e),i=xo(e,"yyyy"),s=xo(e,"MM"),o=ko(e),a=Co(e),l=Number(xo(a,"e",{weekStartsOn:t})),c=[];let d=[];for(let e=1;e<l;e++)d.push(n);for(let e=0;e<r;e++){const t=e+1,n=t<10?`0${t}`:t.toString(),r=lv(i,s,t);d.push({dayNumber:t,dayNumberFull:n,fullDate:r}),(7===d.length||r===xo(o,"yyyy-MM-dd"))&&(c.push(d),d=[])}return c}(e,t);return{monthText:xo(e,"yyyy-MM"),weeks:n,month:e}},dv={month:ev,year:function(e,t){Nt(2,arguments);var n=Lt(e),r=Lt(t);return n.getFullYear()-r.getFullYear()}},hv={prevMonth:function(e,t){return Nt(2,arguments),uy(e,-Ft(t))},nextMonth:uy,prevYear:function(e,t){return Nt(2,arguments),tv(e,-Ft(t))},nextYear:tv};class uv extends c{constructor(e){super(Object.assign({},e)),this.newBiMonthPanelDate=[this.getState("monthLeft").pickerDate,this.getState("monthRight").pickerDate]}init(){const e=this.getProp("defaultValue");this.initDefaultPickerValue(),this.updateSelectedFromProps(e)}initDefaultPickerValue(){const e=ry(this.getProp("defaultPickerValue"));e&&tm(e)&&(this._updatePanelDetail(Wf.PANEL_TYPE_LEFT,{pickerDate:e}),this._updatePanelDetail(Wf.PANEL_TYPE_RIGHT,{pickerDate:uy(e,1)}))}updateSelectedFromProps(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.getProp("type"),{selected:r,rangeStart:i,rangeEnd:s}=this.getStates();if(e&&(null==e?void 0:e.length))switch(n){case"date":this._initDatePickerFromValue(e,t);break;case"dateRange":this._initDateRangePickerFromValue(e);break;case"dateTime":this._initDateTimePickerFromValue(e);break;case"dateTimeRange":this._initDateTimeRangePickerFormValue(e)}else(Array.isArray(e)&&!e.length||!e)&&($l()(r)&&r.size&&this._adapter.updateDaySelected(new Set),i&&this._adapter.setRangeStart(""),s&&this._adapter.setRangeEnd(""))}calcDisabledTime(e){const{disabledTime:t,type:n}=this.getProps();if("function"==typeof t&&e&&["dateTime","dateTimeRange"].includes(n)){const{rangeStart:r,rangeEnd:i,monthLeft:s}=this.getStates(),o=[];"dateTimeRange"===n?(r&&o.push(r),r&&i&&o.push(i)):s&&s.showDate&&o.push(s.showDate);const a=o.map((e=>e instanceof Date?e:qg(e)));return t("dateTimeRange"===n?a:a[0],e)}}_initDatePickerFromValue(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{monthLeft:n}=this._adapter.getStates(),r=Object.assign({},n);this._adapter.updateMonthOnLeft(r);const i=new Set,s=this._isMultiple();if(s?e.forEach((e=>{e&&i.add(xo(e,Wf.FORMAT_FULL_DATE))})):e[0]&&i.add(xo(e[0],Wf.FORMAT_FULL_DATE)),t)if(s){!(null==e?void 0:e.some((e=>e&&0===ev(e,n.pickerDate))))&&this.handleShowDateAndTime(Wf.PANEL_TYPE_LEFT,e[0]||r.pickerDate)}else this.handleShowDateAndTime(Wf.PANEL_TYPE_LEFT,e[0]||r.pickerDate);else this.handleShowDateAndTime(Wf.PANEL_TYPE_LEFT,r.pickerDate);this._adapter.updateDaySelected(i)}_initDateRangePickerFromValue(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.getState("monthLeft"),r=this.getState("monthRight"),i=this._autoAdjustMonth(Object.assign(Object.assign({},n),{pickerDate:e[0]||n.pickerDate}),Object.assign(Object.assign({},r),{pickerDate:e[1]||r.pickerDate}));if(Array.isArray(e)&&e.filter((e=>e)).length>1)this.handleShowDateAndTime(Wf.PANEL_TYPE_LEFT,i.monthLeft.pickerDate),this.handleShowDateAndTime(Wf.PANEL_TYPE_RIGHT,i.monthRight.pickerDate);else{const t=e.find((e=>e));if(t){const e=Math.abs(ev(t,n.pickerDate))>0,s=Math.abs(ev(t,r.pickerDate))>0;e&&s&&(this.handleShowDateAndTime(Wf.PANEL_TYPE_LEFT,i.monthLeft.pickerDate),this.handleShowDateAndTime(Wf.PANEL_TYPE_RIGHT,i.monthRight.pickerDate))}}const s=t?Wf.FORMAT_DATE_TIME:Wf.FORMAT_FULL_DATE;let o=e[0]&&xo(e[0],s),a=e[1]&&xo(e[1],s);this._isNeedSwap(o,a)&&([o,a]=[a,o]),this._adapter.setRangeStart(o),this._adapter.setRangeEnd(a),this._adapter.setHoverDay(a)}_initDateTimePickerFromValue(e){this._initDatePickerFromValue(e)}_initDateTimeRangePickerFormValue(e){this._initDateRangePickerFromValue(e,!0)}destroy(){}handleSyncChangeMonths(e){const{panelType:t,target:n}=e,{type:r}=this._adapter.getProps(),{monthLeft:i,monthRight:s}=this._adapter.getStates();this.isRangeType(r)&&("right"===t&&0===ev(n,i.pickerDate)?this.handleYearOrMonthChange("prevMonth","left",1,!0):"left"===t&&0===ev(s.pickerDate,n)&&this.handleYearOrMonthChange("nextMonth","right",1,!0))}getTargetChangeDate(e){const{panelType:t,switchType:n}=e,{monthRight:r,monthLeft:i}=this._adapter.getStates(),s="left"===t?i.pickerDate:r.pickerDate;let o;switch(n){case"prevMonth":o=uy(s,-1);break;case"nextMonth":o=uy(s,1);break;case"prevYear":o=tv(s,-1);break;case"nextYear":o=tv(s,1)}return o}toMonth(e,t){const{type:n}=this._adapter.getProps(),r=this._getDiff("month",t,e);this.handleYearOrMonthChange(r<0?"prevMonth":"nextMonth",e,Math.abs(r),!1),this.isRangeType(n)&&this.handleSyncChangeMonths({panelType:e,target:t})}toYear(e,t){const n=this._getDiff("year",t,e);this.handleYearOrMonthChange(n<0?"prevYear":"nextYear",e,Math.abs(n),!1)}toYearMonth(e,t){this.toYear(e,t),this.toMonth(e,t)}isRangeType(e){const{type:t}=this.getProps(),n=e||t;return"string"==typeof n&&/range/i.test(n)}handleSwitchMonthOrYear(e,t){const{type:n,syncSwitchMonth:r}=this.getProps(),i=this.isRangeType(n);if(i&&r)this.handleYearOrMonthChange(e,"left",1,!0),this.handleYearOrMonthChange(e,"right",1,!0);else if(this.handleYearOrMonthChange(e,t),i){const n=this.getTargetChangeDate({panelType:t,switchType:e});this.handleSyncChangeMonths({panelType:t,target:n})}}prevMonth(e){this.handleSwitchMonthOrYear("prevMonth",e)}nextMonth(e){this.handleSwitchMonthOrYear("nextMonth",e)}prevYear(e){this.handleSwitchMonthOrYear("prevYear",e)}nextYear(e){this.handleSwitchMonthOrYear("nextYear",e)}_getDiff(e,t,n){const r=this._getPanelDetail(n);return dv[e]&&dv[e](t,r.pickerDate)}_getPanelDetail(e){return e===Wf.PANEL_TYPE_RIGHT?this.getState("monthRight"):this.getState("monthLeft")}localeFormat(e,t){return xo(e,t,{locale:this._adapter.getProp("dateFnsLocale")})}disposeCallbackArgs(e){let t=Array.isArray(e)?e:e&&[e]||[];const n=this.getProp("timeZone");cy(n)&&(t=t.map((e=>dm(e,n))));const r=this.getProp("type"),i=this.getProp("format")||sy(r);let s,o;switch(r){case"date":case"dateTime":case"month":this._isMultiple()?(s=t.map((e=>e&&this.localeFormat(e,i))),o=[...t]):(s=t[0]&&this.localeFormat(t[0],i),[o]=t);break;case"dateRange":case"dateTimeRange":s=t.map((e=>e&&this.localeFormat(e,i))),o=[...t]}return{notifyValue:s,notifyDate:o}}handleYearOrMonthChange(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wf.PANEL_TYPE_LEFT,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{autoSwitchDate:i,type:s}=this.getProps(),{monthLeft:o,monthRight:a}=this.getStates(),l=this.isRangeType(s),c=l&&t===Wf.PANEL_TYPE_LEFT,d=this._getPanelDetail(t),{pickerDate:h}=d,u=(0,hv[e])(h,n),p=t===Wf.PANEL_TYPE_LEFT&&!Oe()(u,o.pickerDate)||t===Wf.PANEL_TYPE_RIGHT&&!Oe()(u,a.pickerDate);if(this._updatePanelDetail(t,{pickerDate:u}),p)if(l){if(c?this.newBiMonthPanelDate[0]=u:this.newBiMonthPanelDate[1]=u,!c||!r){const{notifyValue:e,notifyDate:t}=this.disposeCallbackArgs(this.newBiMonthPanelDate);this._adapter.notifyPanelChange(t,e)}}else{const{notifyValue:e,notifyDate:t}=this.disposeCallbackArgs(u);this._adapter.notifyPanelChange(t,e)}i&&this.updateDateAfterChangeYM(e,u)}updateDateAfterChangeYM(e,t){const{multiple:n,disabledDate:r,type:i}=this.getProps(),{selected:s,rangeStart:o,rangeEnd:a,monthLeft:l}=this.getStates(),c=["dateRange","dateTimeRange"].includes(e),d={closePanel:!1};if(!n&&!c&&s.size){const e=Array.from(s)[0];let n=iv(new Date(e),{year:t.getFullYear(),month:t.getMonth()});if("dateTime"===i&&(n=this._mergeDateAndTime(n,l.pickerDate)),r(n,{rangeStart:o,rangeEnd:a}))return;this._adapter.notifySelectedChange([n],d)}}_isMultiple(){return Boolean(this.getProp("multiple"))&&"date"===this.getProp("type")}_isRange(){}handleDayClick(e,t){const n=this.getProp("type");switch(!0){case"date"===n||"dateTime"===n:this.handleDateSelected(e,t);break;case"dateRange"===n||"dateTimeRange"===n:this.handleRangeSelected(e)}}handleDateSelected(e,t){const{max:n,type:r,isControlledComponent:i,dateFnsLocale:s}=this.getProps(),o=this._isMultiple(),{selected:a}=this.getStates(),l=this._getPanelDetail(t),c=new Set(o?[...a]:[]),{fullDate:d}=e,h=l.pickerDate,u=d;o?c.has(u)?c.delete(u):n&&c.size===n?this._adapter.notifyMaxLimit():c.add(u):c.add(u);const p=[...c].map((e=>"dateTime"===r?this._mergeDateAndTime(e,h):ry(e,Wf.FORMAT_FULL_DATE,void 0,s)));this.handleShowDateAndTime(t,h),i||this._adapter.updateDaySelected(c),this._adapter.notifySelectedChange(p)}handleShowDateAndTime(e,t,n){const r=n||t;this._updatePanelDetail(e,{showDate:r,pickerDate:t})}_mergeDateAndTime(e,t){const n=this._adapter.getProp("dateFnsLocale"),r=xo(tm(e)?e:ry(e,Wf.FORMAT_FULL_DATE,void 0,n),Wf.FORMAT_FULL_DATE),i=xo(tm(t)?t:ry(t,Wf.FORMAT_TIME_PICKER,void 0,n),Wf.FORMAT_TIME_PICKER);return ry(`${r} ${i}`,this.getValidTimeFormat(),void 0,n)}handleRangeSelected(e){let{rangeStart:t,rangeEnd:n}=this.getStates();const{startDateOffset:r,endDateOffset:i,type:s,dateFnsLocale:o,rangeInputFocus:a,triggerRender:l}=this._adapter.getProps(),{fullDate:c}=e;let d=!1,h=!1;const u=(r||i)&&"dateRange"===s;u?(t=sv(r,c),n=sv(i,c)):"rangeEnd"===a?(n=c,t&&n&&av(n,t.trim().split(/\s+/)[0])&&(t=null,d=!0)):"rangeStart"!==a&&a||(t=c,t&&n&&av(n.trim().split(/\s+/)[0],t)&&(n=null,h=!0));/range/i.test(s)&&(u?(this._adapter.setRangeStart(t),this._adapter.setRangeEnd(n)):"rangeEnd"===a?(this._adapter.setRangeEnd(n),d&&this._adapter.setRangeStart(t),this._adapter.isAnotherPanelHasOpened("rangeEnd")&&t||this._adapter.setRangeInputFocus("rangeStart")):"rangeStart"!==a&&a||(this._adapter.setRangeStart(t),h&&this._adapter.setRangeEnd(n),this._adapter.isAnotherPanelHasOpened("rangeStart")&&n||this._adapter.setRangeInputFocus("rangeEnd")));const p=this.getValidDateFormat();if(t||n){const[e,r]=[ry(t,p,void 0,o),ry(n,p,void 0,o)];let i=[e,r];if("dateTimeRange"===s){const s=this.getState("monthLeft").pickerDate,o=this.getState("monthRight").pickerDate,a=t?this._mergeDateAndTime(t,s):null,l=n?this._mergeDateAndTime(n,o):null;i=Ss(e,r)&&av(l,a)?[a,a]:[a,l]}const a=!("dateRange"===s&&u);this._adapter.notifySelectedChange(i,{needCheckFocusRecord:a})}}_isNeedSwap(e,t){return e&&t&&av(t,e)}handleDayHover(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{fullDate:""};const{fullDate:t}=e,{startDateOffset:n,endDateOffset:r,type:i}=this.getProps();if(this._adapter.setHoverDay(t),(n||r)&&"dateRange"===i){const e=sv(n,t),i=sv(r,t);this._adapter.setOffsetRangeStart(e),this._adapter.setOffsetRangeEnd(i)}}_autoAdjustMonth(e,t){let n=e,r=t;const i=ev(e.pickerDate,t.pickerDate);return i>0?(n=Object.assign({},t),r=Object.assign({},e)):0===i&&(n=e,r=Object.assign(Object.assign({},t),{pickerDate:uy(t.pickerDate,1)})),{monthLeft:n,monthRight:r}}getValidTimeFormat(){const e=this.getProp("format")||Wf.FORMAT_TIME_PICKER,t=[];return(Vl()(e,"h")||Vl()(e,"H"))&&t.push("HH"),Vl()(e,"m")&&t.push("mm"),Vl()(e,"s")&&t.push("ss"),t.join(":")}getValidDateFormat(){return this.getProp("format")||oy(this.getProp("type"))}handleTimeChange(e,t){const{rangeEnd:n,rangeStart:r}=this.getStates(),i=this.getProp("dateFnsLocale"),s=e.timeStampValue,o=this.getProp("type"),a=this._getPanelDetail(t),{showDate:l}=a,c=new Date(s),d=this.getValidDateFormat(),h=t===Wf.PANEL_TYPE_RIGHT?n:r;let u,p,f;if("dateTimeRange"===o&&h){const e=ry(h,d,void 0,i);u=e.getFullYear(),p=e.getMonth(),f=e.getDate()}else u=l.getFullYear(),p=l.getMonth(),f=l.getDate();const m=c.getHours(),g=c.getMinutes(),y=c.getSeconds(),v=c.getMilliseconds(),b=new Date(...[u,p,f,m,g,y,v]);if("dateTimeRange"===o)this.handleShowDateAndTime(t,b,l),this._updateTimeInDateRange(t,b);else{const e=lv(u,p+1,f);this.handleDateSelected({fullDate:e,fullValidDate:b},t),this.handleShowDateAndTime(t,b),this._adapter.notifySelectedChange([b])}}_updateTimeInDateRange(e,t){const{isControlledComponent:n,dateFnsLocale:r}=this.getProps();let i=this.getState("rangeStart"),s=this.getState("rangeEnd");const o=this.getValidDateFormat();if(i&&s){let a=ry(i,o,void 0,r),l=ry(s,o,void 0,r);e===Wf.PANEL_TYPE_RIGHT?(l=this._mergeDateAndTime(t,t),s=xo(l,Wf.FORMAT_DATE_TIME),this._isNeedSwap(i,s)&&([i,s]=[s,i],[a,l]=[l,a]),n||this._adapter.setRangeEnd(s)):(a=this._mergeDateAndTime(t,t),i=xo(a,Wf.FORMAT_DATE_TIME),this._isNeedSwap(i,s)&&([i,s]=[s,i],[a,l]=[l,a]),n||this._adapter.setRangeStart(i)),this._adapter.notifySelectedChange([a,l])}}_updatePanelDetail(e,t){const{monthLeft:n,monthRight:r}=this.getStates();e===Wf.PANEL_TYPE_RIGHT?this._adapter.updateMonthOnRight(Object.assign(Object.assign({},r),t)):this._adapter.updateMonthOnLeft(Object.assign(Object.assign({},n),t))}showYearPicker(e){this._updatePanelDetail(e,{isTimePickerOpen:!1,isYearPickerOpen:!0})}showTimePicker(e,t){this.getProp("disabledTimePicker")||this._updatePanelDetail(e,{isTimePickerOpen:!0,isYearPickerOpen:!1})}showDatePanel(e){this._updatePanelDetail(e,{isTimePickerOpen:!1,isYearPickerOpen:!1})}getYAMOpenType(){const{monthLeft:e,monthRight:t}=this._adapter.getStates(),n=e.isYearPickerOpen,r=t.isYearPickerOpen;return n&&r?"both":n?"left":r?"right":"none"}}const pv=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.62 4.4c.5.53.5 1.38 0 1.91L7.14 12l5.48 5.69c.5.53.5 1.38 0 1.91-.51.53-1.33.53-1.84 0l-6.4-6.64a1.4 1.4 0 0 1 0-1.92l6.4-6.64c.5-.53 1.33-.53 1.84 0Z",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.62 4.4c.5.53.5 1.38 0 1.91L14.14 12l5.48 5.69c.5.53.5 1.38 0 1.91-.51.53-1.34.53-1.84 0l-6.4-6.64a1.4 1.4 0 0 1 0-1.92l6.4-6.64c.5-.53 1.33-.53 1.84 0Z",fill:"currentColor"}))}),"double_chevron_left");const fv=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.38 4.4c.51-.53 1.34-.53 1.84 0l6.4 6.64c.5.53.5 1.39 0 1.92l-6.4 6.64c-.5.53-1.33.53-1.84 0a1.4 1.4 0 0 1 0-1.91L9.86 12 4.38 6.31a1.4 1.4 0 0 1 0-1.91Z",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.38 4.4c.51-.53 1.33-.53 1.84 0l6.4 6.64c.5.53.5 1.39 0 1.92l-6.4 6.64c-.5.53-1.33.53-1.84 0a1.4 1.4 0 0 1 0-1.91L16.86 12l-5.48-5.69a1.4 1.4 0 0 1 0-1.91Z",fill:"currentColor"}))}),"double_chevron_right"),mv=Kf.NAVIGATION;class gv extends d.PureComponent{constructor(e){super(e),this.navRef=h().createRef()}render(){const{forwardRef:e,monthText:t,onMonthClick:n,onNextMonth:r,onPrevMonth:i,onPrevYear:s,onNextYear:o,density:a,shouldBimonthSwitch:l,panelType:c}=this.props,d="borderless",u="compact"===a?"default":"large",p=!0,f="compact"===a?"small":"default",m=c===Wf.PANEL_TYPE_LEFT,g=c===Wf.PANEL_TYPE_RIGHT,y=l&&m,v={},b={};l&&g&&(v.visibility="hidden"),y&&(b.visibility="hidden");const w=e||this.navRef;return h().createElement("div",{className:mv,ref:w},h().createElement(ji,{key:"double-chevron-left","aria-label":"Previous year",icon:h().createElement(pv,{"aria-hidden":!0,size:u}),size:f,theme:d,noHorizontalPadding:p,onClick:s,style:v}),h().createElement(ji,{key:"chevron-left","aria-label":"Previous month",icon:h().createElement(Rl,{"aria-hidden":!0,size:u}),size:f,onClick:i,theme:d,noHorizontalPadding:p,style:v}),h().createElement("div",{className:`${mv}-month`},h().createElement(vs,{onClick:n,theme:d,size:f},h().createElement("span",null,t))),h().createElement(ji,{key:"chevron-right","aria-label":"Next month",icon:h().createElement(Al,{"aria-hidden":!0,size:u}),size:f,onClick:r,theme:d,noHorizontalPadding:p,style:b}),h().createElement(ji,{key:"double-chevron-right","aria-label":"Next year",icon:h().createElement(fv,{"aria-hidden":!0,size:u}),size:f,theme:d,noHorizontalPadding:p,onClick:o,style:b}))}}gv.propTypes={monthText:E().string,density:E().string,onMonthClick:E().func,onNextMonth:E().func,onPrevMonth:E().func,onNextYear:E().func,onPrevYear:E().func,navPrev:E().node,navNext:E().node,shouldBimonthSwitch:E().bool,panelType:E().oneOf([Wf.PANEL_TYPE_LEFT,Wf.PANEL_TYPE_RIGHT])},gv.defaultProps={monthText:"",onMonthClick:i(),onNextMonth:i(),onPrevMonth:i(),onNextYear:i(),onPrevYear:i()};const yv=e=>{let{weekStartsOn:t=0}=e;const n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];for(let e=0;e<t;e++)n.push(n.shift());return n};class vv extends c{constructor(e){super(Object.assign({},e))}init(){this._getToday(),this.getMonthTable()}_getToday(){const e=xo(new Date,"yyyy-MM-dd");this._adapter.updateToday(e)}getMonthTable(){const e=this._adapter.getProp("month"),t=this.getState("weeksRowNum");if(e){this.updateWeekDays();const n=this._adapter.getProp("weekStartsOn"),r=cv(e,n),{weeks:i}=r;this._adapter.updateMonthTable(r),Re(t)?this._adapter.setWeeksRowNum(i.length):Array.isArray(i)&&i.length!==t&&this._adapter.setWeeksRowNum(i.length,(()=>{this._adapter.notifyWeeksRowNumChange(i.length)}))}}updateWeekDays(){const e=this._adapter.getProp("weekStartsOn"),t=yv({weekStartsOn:e});this._adapter.setWeekDays(t)}destroy(){}handleClick(e){this._adapter.notifyDayClick(e)}handleHover(e){this._adapter.notifyDayHover(e)}}function bv(e,t){return Io(ov(e)?qg(e):e,ov(t)?qg(t):t)}function wv(e,t){return Ss(ov(e)?qg(e):e,ov(t)?qg(t):t)}function xv(e,t){let{start:n,end:r}=t;const i=ov(e)?qg(e):e,s=ov(n)?qg(n):n,o=ov(r)?qg(r):r;return Po(s,o)&&function(e,t){Nt(2,arguments);var n=Lt(e).getTime(),r=Lt(t.start).getTime(),i=Lt(t.end).getTime();if(!(r<=i))throw new RangeError("Invalid interval");return n>=r&&n<=i}(i,{start:s,end:o})&&!em(i,s)&&!em(i,o)}const Ev=Kf.PREFIX;class Cv extends f{constructor(e){super(e),this.state={weekdays:[],month:{weeks:[],monthText:""},todayText:"",weeksRowNum:e.weeksRowNum},this.monthRef=h().createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{updateToday:e=>this.setState({todayText:e}),setWeekDays:e=>this.setState({weekdays:e}),setWeeksRowNum:(e,t)=>this.setState({weeksRowNum:e},t),updateMonthTable:e=>this.setState({month:e}),notifyDayClick:e=>this.props.onDayClick(e),notifyDayHover:e=>this.props.onDayHover(e),notifyWeeksRowNumChange:e=>this.props.onWeeksRowNumChange(e)})}componentDidMount(){this.foundation=new vv(this.adapter),this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}componentDidUpdate(e,t){e.month!==this.props.month&&this.foundation.getMonthTable()}getSingleDayStatus(e){const{rangeInputFocus:t}=this.props,{fullDate:n,todayText:r,selected:i,disabledDate:s,rangeStart:o,rangeEnd:a}=e,l={rangeStart:o,rangeEnd:a,rangeInputFocus:t},c=n===r,d=i.has(n);let h=s&&s(qg(n),l);return!h&&"rangeStart"===this.props.rangeInputFocus&&a&&this.props.focusRecordsRef&&this.props.focusRecordsRef.current.rangeEnd&&(h=bv(n,a.trim().split(/\s+/)[0])),!h&&"rangeEnd"===this.props.rangeInputFocus&&o&&this.props.focusRecordsRef&&this.props.focusRecordsRef.current.rangeStart&&(h=av(n,o.trim().split(/\s+/)[0])),{isToday:c,isSelected:d,isDisabled:h}}getDateRangeStatus(e){const{rangeStart:t,rangeEnd:n,fullDate:r,hoverDay:i,offsetRangeStart:s,offsetRangeEnd:o,rangeInputFocus:a}=e,l=Boolean(t||n),c=Boolean(t&&n),d=s||o;if(!l)return{};const h=wv(i,r);let u,p,f,m,g,y,v,b,w,x,E,C;return t&&(f=wv(r,t),"rangeEnd"===a&&(u=xv(r,{start:t,end:i}))),n&&(m=wv(r,n),"rangeStart"===a&&(p=xv(r,{start:i,end:n}))),!c&&l&&(g=h),d||(y=u||p||h),c&&(v=xv(r,{start:t,end:n}),d||(b=f&&bv(t,i),w=m&&av(n,i),x=h&&"rangeStart"===a,E=h&&"rangeEnd"===a,C=h&&xv(i,{start:t,end:n}))),{isHoverDay:h,isSelectedStart:f,isSelectedEnd:m,isInRange:v,isHover:y,isSelectedStartAfterHover:b,isSelectedEndBeforeHover:w,isHoverDayInRange:C,isHoverDayInStartSelection:x,isHoverDayInEndSelection:E,isHoverDayAroundOneSelected:g}}getOffsetDateStatus(e){const{offsetRangeStart:t,offsetRangeEnd:n,rangeStart:r,rangeEnd:i,fullDate:s,hoverDay:o}=e;if(!(t||n))return{};const a=xv(s,{start:r,end:i}),l=wv(o,s),c=r&&wv(s,r),d=i&&wv(s,i),h=Boolean(r&&i),u=wv(s,t),p=wv(s,n),f=l;let m,g;h&&(m=a&&l);return Boolean(t&&n)&&(g=c||xv(s,{start:t,end:n})||d),{isOffsetRangeStart:u,isOffsetRangeEnd:p,isHoverInOffsetRange:m,isHoverDayOffset:f,isInOffsetRange:g}}getDayStatus(e,t){const{fullDate:n}=e,{hoverDay:r,rangeStart:i,rangeEnd:s,todayText:o,offsetRangeStart:a,offsetRangeEnd:l,disabledDate:c,selected:d,rangeInputFocus:h}=t,u=this.getSingleDayStatus({fullDate:n,todayText:o,hoverDay:r,selected:d,disabledDate:c,rangeStart:i,rangeEnd:s}),p=this.getDateRangeStatus(Object.assign({fullDate:n,rangeStart:i,rangeEnd:s,hoverDay:r,offsetRangeStart:a,offsetRangeEnd:l,rangeInputFocus:h},u)),f=this.getOffsetDateStatus(Object.assign(Object.assign({offsetRangeStart:a,offsetRangeEnd:l,rangeStart:i,rangeEnd:s,fullDate:n,hoverDay:r},u),p));return Object.assign(Object.assign(Object.assign({},u),p),f)}renderDayOfWeek(){const{locale:e}=this.props,t=w()(Kf.WEEKDAY),n=w()(`${Ev}-weekday-item`),{weekdays:r}=this.state,i=r.map((t=>e.weeks[t]));return h().createElement("div",{role:"row",className:t},i.map(((e,t)=>h().createElement("div",{role:"columnheader",key:e+t,className:n},e))))}renderWeeks(){const{month:e}=this.state,{weeks:t}=e,{weeksRowNum:n}=this.props;let r={};if(n){r={height:n*Gf.WEEK_HEIGHT}}const i=w()(Kf.WEEKS);return h().createElement("div",{className:i,style:r},t.map(((e,t)=>this.renderWeek(e,t))))}renderWeek(e,t){const n=Kf.WEEK;return h().createElement("div",{role:"row",className:n,key:t},e.map(((e,t)=>this.renderDay(e,t))))}renderDay(e,t){const{todayText:n}=this.state,{renderFullDate:r,renderDate:i}=this.props,{fullDate:s,dayNumber:o}=e;if(!s)return h().createElement("div",{role:"gridcell",tabIndex:-1,key:o+t,className:Kf.DAY},h().createElement("span",null));const a=this.getDayStatus(e,Object.assign({todayText:n},this.props)),l=w()(Kf.DAY,{[Kf.DAY_TODAY]:a.isToday,[Kf.DAY_IN_RANGE]:a.isInRange,[Kf.DAY_HOVER]:a.isHover,[Kf.DAY_SELECTED]:a.isSelected,[Kf.DAY_SELECTED_START]:a.isSelectedStart,[Kf.DAY_SELECTED_END]:a.isSelectedEnd,[Kf.DAY_DISABLED]:a.isDisabled,[Kf.DAY_HOVER_DAY]:a.isHoverDayOffset,[Kf.DAY_IN_OFFSET_RANGE]:a.isInOffsetRange,[Kf.DAY_SELECTED_RANGE_HOVER]:a.isHoverInOffsetRange,[Kf.DAY_OFFSET_RANGE_START]:a.isOffsetRangeStart,[Kf.DAY_OFFSET_RANGE_END]:a.isOffsetRangeEnd,[Kf.DAY_SELECTED_START_AFTER_HOVER]:a.isSelectedStartAfterHover,[Kf.DAY_SELECTED_END_BEFORE_HOVER]:a.isSelectedEndBeforeHover,[Kf.DAY_HOVER_DAY_BEFORE_RANGE]:a.isHoverDayInStartSelection,[Kf.DAY_HOVER_DAY_AFTER_RANGE]:a.isHoverDayInEndSelection,[Kf.DAY_HOVER_DAY_AROUND_SINGLE_SELECTED]:a.isHoverDayAroundOneSelected}),c=w()({[`${Kf.DAY}-main`]:!0}),d=[o,s,a],u=ye()(r);return h().createElement("div",{role:"gridcell",tabIndex:a.isDisabled?-1:0,"aria-disabled":a.isDisabled,"aria-selected":a.isSelected,"aria-label":s,className:u?Kf.DAY:l,title:s,key:o+t,onClick:t=>!a.isDisabled&&this.foundation.handleClick(e),onMouseEnter:()=>this.foundation.handleHover(e),onMouseLeave:()=>this.foundation.handleHover()},u?r(...d):h().createElement("div",{className:c},ye()(i)?i(o,s):h().createElement("span",null,o)))}render(){const{forwardRef:e,multiple:t}=this.props,n=this.renderDayOfWeek(),r=this.renderWeeks(),i=w()(Kf.MONTH),s=e||this.monthRef;return h().createElement("div",{role:"grid","aria-multiselectable":t,ref:s,className:i},n,r)}}Cv.propTypes={month:E().object,selected:E().object,rangeStart:E().string,rangeEnd:E().string,offsetRangeStart:E().string,offsetRangeEnd:E().string,onDayClick:E().func,onDayHover:E().func,weekStartsOn:E().number,disabledDate:E().func,weeksRowNum:E().number,onWeeksRowNumChange:E().func,renderDate:E().func,renderFullDate:E().func,hoverDay:E().string,startDateOffset:E().func,endDateOffset:E().func,rangeInputFocus:E().oneOfType([E().string,E().bool]),focusRecordsRef:E().object,multiple:E().bool},Cv.defaultProps={month:new Date,selected:new Set,rangeStart:"",rangeEnd:"",onDayClick:i(),onDayHover:i(),onWeeksRowNumChange:i(),weekStartsOn:Gf.WEEK_START_ON,disabledDate:Zf(),weeksRowNum:0};const Sv="time",_v="timeRange",kv={PREFIX:`${C}-timepicker`,RANGE_PICKER:`${C}-timepicker-range-panel`,RANGE_PANEL_LISTS:`${C}-timepicker-lists`},Ov={TYPES:[Sv,_v],TYPE_TIME_PICKER:Sv,TYPE_TIME_RANGE_PICKER:_v,DEFAULT_TYPE:Sv,DEFAULT_RANGE_SEPARATOR:" ~ ",DEFAULT_MULTIPLE_SEPARATOR:",",SIZE:ur.SIZE,DEFAULT_FORMAT:"HH:mm:ss",DEFAULT_FORMAT_A:"a h:mm:ss",STATUS:Yn,DEFAULT_POSITION:{[Sv]:"bottomLeft",[_v]:"bottomLeft"}},Tv={PREFIX:`${C}-scrolllist`,SELECTED:`${C}-scrolllist-item-selected`},Pv=36,Iv=120;var Mv=__webpack_require__("15pl"),Rv=__webpack_require__.n(Mv),Av=__webpack_require__("FllU"),Nv=__webpack_require__.n(Av),Dv=__webpack_require__("mbB6"),Lv=__webpack_require__.n(Dv),Fv=__webpack_require__("6R5o"),jv=__webpack_require__.n(Fv),$v=__webpack_require__("+n+S"),Bv=__webpack_require__.n($v);class Vv extends c{constructor(){super(...arguments),this._cachedSelectedNode=null}selectIndex(e,t){const{type:n,list:r}=this.getProps();if(e>-1&&Array.isArray(r)&&r.length&&ee(t)){const i=e%r.length,s=r[i],o=t.children[e];this._adapter.setSelectedNode(o),this._adapter.notifySelectItem(Object.assign(Object.assign({},s),{value:s.value,type:n,index:i}))}}selectNode(e,t){const{type:n,list:r}=this.getProps();if(ee(e)&&ee(t)){const i=Nv()(t.children,(t=>t===e))%r.length,s=Nv()(t.children,(e=>e===this._cachedSelectedNode))%r.length,o=r[i];this._adapter.setSelectedNode(e),this._adapter.scrollToCenter(e),this._cachedSelectedNode!==e&&(this._cachedSelectedNode=e,s!==i&&this._adapter.notifySelectItem(Object.assign(Object.assign({},o),{value:o.value,type:n,index:i})))}}shouldAppend(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(ee(e)&&ee(t)){const r=e.querySelectorAll("li"),i=r[r.length-1],{list:s}=this.getProps();if(i){const e=t.getBoundingClientRect(),r=i.getBoundingClientRect(),o=r.height*s.length;if(o<=0)return 0;let a=r.top,l=0;for(;a<=e.top+e.height*n;)l+=1,a+=o;return l}}return!1}shouldPrepend(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(ee(e)&&ee(t)){const r=e.querySelectorAll("li")[0],{list:i}=this.getProps();if(r){const e=t.getBoundingClientRect(),s=r.getBoundingClientRect(),o=s.height*i.length;if(o<=0)return 0;let a=s.top,l=0;for(;a+s.height>=e.top-e.height*n;)l+=1,a-=o;return l}}return 0}initWheelList(e,t,n){const{list:r}=this.getProps();if(ee(t)&&ee(e)&&r&&r.length){const i=e.children,s=(Bv()(i,0,r.length),this.shouldPrepend(e,t)),o=this.shouldAppend(e,t);this._adapter.setState({prependCount:s,appendCount:o},n)}}adjustInfiniteList(e,t,n){const{list:r}=this.getProps();if(ee(t)&&ee(e)&&r&&r.length){const n=e.querySelectorAll("li"),i=n.length,s=1,o=this.shouldPrepend(e,t,s),a=this.shouldAppend(e,t,s);if(o)for(let t=0;t<o;t++){De(e,...Bv()(n,i-r.length*(t+1),i-r.length*t))}if(a)for(let t=0;t<a;t++){Ne(e,...Bv()(n,t*r.length,(t+1)*r.length))}}}getNearestNodeInfo(e,t){if(ee(e)&&ee(t)){const n=t.getBoundingClientRect().top,r=e.querySelectorAll("li");let i=null,s=-1,o=1/0;return Array.from(r).map(((e,t)=>{const r=e.getBoundingClientRect().top,a=Math.abs(r-n);a<o&&!this._adapter.isDisabledIndex(t)&&(o=a,i=e,s=t)})),{nearestNode:i,nearestIndex:s}}}getTargetNode(e,t){if(e&&ee(t)){const n="li",r=e.target,i=t.querySelectorAll(n),s=this.getProp("list"),o=Array.isArray(s)?s.length:0;let a=-1,l=-1,c=null;const d=jv()(i,((e,t)=>{if(e===r||e.contains(r))return a=t,o>0&&(l=t%o),!0}));return l>-1&&(c=s[l]),{targetNode:d,targetIndex:a,indexInList:l,infoInList:c}}return null}}const zv=(e,t,n)=>{const r=new Ei({from:{scrollTop:e.scrollTop},to:{scrollTop:t}},{duration:n});return r.on("frame",(t=>{let{scrollTop:n}=t;e.scrollTop=n})),r},Hv=1e3/60,Uv=/^\s*$/,Kv="wheel";class Wv extends f{constructor(){var e;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),e=this,this._cacheNode=(e,t)=>e&&t&&Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=t),this._cacheSelectedNode=e=>this._cacheNode("selectedNode",e),this._cacheWillSelectNode=e=>this._cacheNode("willSelectNode",e),this._cacheListNode=e=>this._cacheNode("list",e),this._cacheSelectorNode=e=>this._cacheNode("selector",e),this._cacheWrapperNode=e=>this._cacheNode("wrapper",e),this._isFirst=e=>{const{list:t}=this;if(ee(e)&&ee(t)){const n=t.children;return 0===Nv()(n,e)}return!1},this._isLast=e=>{const{list:t}=this;if(ee(e)&&ee(t)){const{children:n}=t;return Nv()(n,e)===n.length-1}return!1},this.indexIsSame=(e,t)=>{const{list:n}=this.props;if(n.length)return e%n.length==t%n.length},this.isDisabledIndex=e=>{const{list:t}=this.props;if(Array.isArray(t)&&t.length&&e>-1){const n=e%t.length;return this.isDisabledData(t[n])}return!1},this.isDisabledNode=e=>{const t=this.list;if(ee(e)&&ee(t)){const n=Nv()(t.children,(t=>t===e));return this.isDisabledIndex(n)}return!1},this.isDisabledData=e=>e&&"object"==typeof e&&e.disabled,this.isWheelMode=()=>this.props.mode===Kv,this.addClassToNode=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tv.SELECTED;const{list:r}=e;if(ee(t=t||e.selectedNode)&&ee(r)){const{children:e}=r,i=new RegExp(`\\s*${n}\\s*`,"g");Lv()(e,(e=>{e.className=e.className&&e.className.replace(i," "),Uv.test(e.className)&&(e.className="")})),t.className&&!Uv.test(t.className)?t.className+=` ${n}`:t.className=n}},this.getIndexByNode=e=>Nv()(this.list.children,e),this.getNodeByIndex=e=>{if(e>-1)return jv()(this.list.children,((t,n)=>n===e));return jv()(this.list.children,(e=>!this.isDisabledNode(e)))},this.scrollToIndex=(e,t)=>{t="number"==typeof t?t:Iv,e=null==e?this.props.selectedIndex:e,this.scrollToNode(this.selectedNode,t)},this.scrollToNode=(e,t)=>{const{wrapper:n}=this,r=n.offsetHeight,i=this.getItmHeight(e),s=(e.offsetTop||this.list.children.length*i/2)-(r-i)/2;this.scrollToPos(s,t)},this.scrollToPos=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Iv;const{wrapper:r}=e;if(n&&e.props.motion)if(e.scrollAnimation&&(e.scrollAnimation.destroy(),e.scrolling=!1),r.scrollTop===t){if(e.isWheelMode()){const t=e.foundation.getNearestNodeInfo(e.list,e.selector);e.addClassToNode(t.nearestNode)}}else e.scrollAnimation=zv(r,t,n),e.scrollAnimation.on("rest",(()=>{if(e.isWheelMode()){const t=e.foundation.getNearestNodeInfo(e.list,e.selector);e.addClassToNode(t.nearestNode)}})),e.scrollAnimation.start();else r.scrollTop=t},this.scrollToSelectItem=e=>{const{nearestNode:t}=this.foundation.getNearestNodeInfo(this.list,this.selector);this.props.cycled&&this.throttledAdjustList(e,t),this.debouncedSelect(e,t)},this.scrollToCenter=(e,t,n)=>{if(e=e||this.selectedNode,t=t||this.wrapper,ee(e)&&ee(t)){const r=t.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.scrollTop+(i.top-(r.top+r.height/2-i.height/2));this.scrollToPos(s,"number"==typeof n?n:Iv)}},this.clickToSelectItem=e=>{e&&e.nativeEvent&&e.nativeEvent.stopImmediatePropagation();const{targetNode:t,infoInList:n}=this.foundation.getTargetNode(e,this.list);t&&n&&!n.disabled&&this.debouncedSelect(null,t)},this.getItmHeight=e=>e&&e.offsetHeight||Pv,this.renderItemList=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{selectedIndex:n,mode:r,transform:i,list:s}=e.props;return s.map(((s,o)=>{const{transform:a}=s,l="function"==typeof a?a:i,c=n===o,d=w()({[`${Tv.PREFIX}-item-sel`]:c&&r!==Kv,[`${Tv.PREFIX}-item-disabled`]:Boolean(s.disabled)});let u="";u=c&&"function"==typeof l?l(s.value,s.text):null==s.text?s.value:s.text;const p={};return e.isWheelMode()||s.disabled||(p.onClick=()=>e.foundation.selectIndex(o,e.list)),h().createElement("li",Object.assign({key:t+o},p,{className:d,role:"option","aria-disabled":s.disabled}),u)}))},this.renderNormalList=()=>{const{list:e,className:t,style:n}=this.props,r=this.renderItemList(),i=w()(`${Tv.PREFIX}-item`,t);return h().createElement("div",{style:n,className:i,ref:this._cacheWrapperNode},h().createElement("ul",{role:"listbox","aria-multiselectable":!1,"aria-label":this.props["aria-label"],ref:this._cacheListNode},r))},this.renderInfiniteList=()=>{const{list:e,cycled:t,className:n,style:r}=this.props,{prependCount:i,appendCount:s}=this.state,o=Rv()(i).reduce(((e,t)=>{const n=this.renderItemList(`pre_${t}_`);return e.unshift(...n),e}),[]),a=Rv()(s).reduce(((e,t)=>{const n=this.renderItemList(`app_${t}_`);return e.push(...n),e}),[]),l=this.renderItemList(),c=w()(`${Tv.PREFIX}-list-outer`,{[`${Tv.PREFIX}-list-outer-nocycle`]:!t}),d=w()(`${Tv.PREFIX}-item-wheel`,n),u=w()(`${Tv.PREFIX}-selector`),p=w()(`${Tv.PREFIX}-shade`,`${Tv.PREFIX}-shade-pre`),f=w()(`${Tv.PREFIX}-shade`,`${Tv.PREFIX}-shade-post`);return h().createElement("div",{className:d,style:r},h().createElement("div",{className:p}),h().createElement("div",{className:u,ref:this._cacheSelectorNode}),h().createElement("div",{className:f}),h().createElement("div",{className:c,ref:this._cacheWrapperNode,onScroll:this.scrollToSelectItem},h().createElement("ul",{role:"listbox","aria-label":this.props["aria-label"],"aria-multiselectable":!1,ref:this._cacheListNode,onClick:this.clickToSelectItem},o,l,a)))},this.state={prependCount:0,appendCount:0},this.selectedNode=null,this.willSelectNode=null,this.list=null,this.wrapper=null,this.selector=null,this.scrollAnimation=null,this.foundation=new Vv(this.adapter),this.throttledAdjustList=g()(((e,t)=>{this.foundation.adjustInfiniteList(this.list,this.wrapper,t)}),Hv),this.debouncedSelect=v()(((e,t)=>{this._cacheSelectedNode(t),this.foundation.selectNode(t,this.list)}),33.333333333333336)}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{setState:(e,t)=>this.setState(Object.assign({},e),t),setPrependCount:e=>this.setState({prependCount:e}),setAppendCount:e=>this.setState({appendCount:e}),isDisabledIndex:this.isDisabledIndex,setSelectedNode:e=>this._cacheWillSelectNode(e),notifySelectItem:function(){return e.props.onSelect(...arguments)},scrollToCenter:this.scrollToCenter})}componentWillUnmount(){this.props.cycled&&(this.throttledAdjustList.cancel(),this.debouncedSelect.cancel())}componentDidMount(){this.foundation.init();const{mode:e,cycled:t,selectedIndex:n,list:r}=this.props,i=this.getNodeByIndex("number"==typeof n&&n>-1?n:0);this._cacheSelectedNode(i),this._cacheWillSelectNode(i),e===Kv&&t?this.foundation.initWheelList(this.list,this.wrapper,(()=>{this.scrollToNode(i,0)})):this.scrollToNode(i,0)}componentDidUpdate(e){const{selectedIndex:t}=this.props;if(e.selectedIndex!==t){const n=this.getIndexByNode(this.willSelectNode);if(!this.indexIsSame(n,t)){const n=this.getNodeByOffset(this.selectedNode,t-e.selectedIndex,this.list);this._cacheWillSelectNode(n)}this._cacheSelectedNode(this.willSelectNode),this.scrollToIndex(t)}}getNodeByOffset(e,t,n){const{list:r}=this.props;if(ee(e)&&ee(n)&&"number"==typeof t&&Array.isArray(r)&&r.length){t%=r.length;let n=this.getIndexByNode(e)+t;for(;n<0;)n+=r.length;if(t)return this.getNodeByIndex(n)}return e}render(){return this.isWheelMode()?this.renderInfiniteList():this.renderNormalList()}}Wv.propTypes={mode:E().oneOf(["normal","wheel"]),cycled:E().bool,list:E().array,selectedIndex:E().number,onSelect:E().func,transform:E().func,className:E().string,style:E().object,motion:E().oneOfType([E().func,E().bool]),type:E().oneOfType([E().string,E().number])},Wv.defaultProps={selectedIndex:0,motion:!0,list:[],onSelect:i(),cycled:!1,mode:Kv};class Gv extends c{}__webpack_require__("TEru");var qv=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class Xv extends f{constructor(e){super(e),this.foundation=new Gv(this.adapter)}render(){const e=this.props,{children:t,header:n,footer:r,prefixCls:i,bodyHeight:s,className:o,style:a}=e,l=qv(e,["children","header","footer","prefixCls","bodyHeight","className","style"]),c=w()(o,{[i||Tv.PREFIX]:!0}),d=w()({[`${i||Tv.PREFIX}-header`]:!0});return h().createElement("div",Object.assign({className:c,style:a},this.getDataAttr(l)),n?h().createElement("div",{className:d},h().createElement("div",{className:`${d}-title`,"x-semi-prop":this.props["x-semi-header-alias"]||"header"},n),h().createElement("div",{className:`${c}-line`})):null,h().createElement("div",{className:`${c}-body`,style:{height:s||""},"x-semi-prop":"children"},t),r?h().createElement("div",{className:`${c}-footer`,"x-semi-prop":this.props["x-semi-footer-alias"]||"footer"},r):null)}}Xv.Item=Wv,Xv.propTypes={className:E().string,header:E().node,footer:E().node,children:E().node,bodyHeight:E().oneOfType([E().number,E().string])};const Yv=Xv,Zv=(e,t)=>{let n=`${e}`;e<10&&(n=`0${e}`);let r=!1;return t&&t.indexOf(e)>=0&&(r=!0),{value:n,disabled:r}};function Jv(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const i=[];for(let s=0;s<e;s+=r)(!t||t.indexOf(s)<0||!n)&&i.push(s);return i}const Qv=class extends c{constructor(e){super(Object.assign({},e))}isAM(){return this.getProp("isAM")}initData(){const{timeStampValue:e,hourStep:t,disabledMinutes:n,disabledSeconds:r,hideDisabledOptions:i,minuteStep:s,secondStep:o}=this.getProps(),a=this.getValidFormat(),l=this.getDisplayDateFromTimeStamp(e),c=this.disabledHours(),d=n(l?l.getHours():null),h=r(l?l.getHours():null,l?l.getMinutes():null),u=Jv(24,c,i,t),p=Jv(60,d,i,s),f=Jv(60,h,i,o);return{showHour:Boolean(a.match(/HH|hh|H|h/g)),showMinute:Boolean(a.match(/mm/g)),showSecond:Boolean(a.match(/ss/g)),hourOptions:u,minuteOptions:p,secondOptions:f}}getPosition(){const e=this.getProp("position"),t=this.getProp("type")||Ov.DEFAULT_TYPE;return e||Ov.DEFAULT_POSITION[t]}getDefaultFormatIfNeed(){return this._isInProps("format")?this.getProp("format"):this.getProp("use12Hours")?Ov.DEFAULT_FORMAT_A:Ov.DEFAULT_FORMAT}disabledHours(){const{use12Hours:e,disabledHours:t}=this.getProps();let n=t&&t();return e&&Array.isArray(n)&&(n=this.isAM()?n.filter((e=>e<12)).map((e=>0===e?12:e)):n.map((e=>12===e?12:e-12))),n}getValidFormat(e){let t=Re(e)?this.getProp("format"):e;return t=this.getDefaultFormatIfNeed(),t="string"==typeof t?t:Ov.DEFAULT_FORMAT,t}getDisplayDateFromTimeStamp(e){let t;return e&&(t=new Date(e)),e&&tm(t)?t:this.createDateDefault()}createDateDefault(){const e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate())}};class eb extends f{constructor(e){super(e),this.cacheRefCurrent=(e,t)=>{e&&"string"==typeof e&&this.adapter.setCache(e,t)},this.reselect=()=>{["ampm","hour","minute","second"].forEach((e=>{const t=this.adapter.getCache(e);t&&t.scrollToIndex&&t.scrollToIndex()}))},this.onItemChange=e=>{let{type:t,value:n,disabled:r}=e,{onChange:i,use12Hours:s,isAM:o,format:a,timeStampValue:l}=this.props;const c=this.foundation.getDisplayDateFromTimeStamp(l);if("hour"===t)s?o?c.setHours(Number(n)%12):c.setHours(Number(n)%12+12):c.setHours(Number(n));else if("minute"===t)c.setMinutes(Number(n));else if("ampm"===t){const e=n.toUpperCase();s&&("PM"===e&&(o=!1,c.getHours()<12&&c.setHours(c.getHours()%12+12)),"AM"===e&&(o=!0,c.getHours()>=12&&c.setHours(c.getHours()-12)))}else c.setSeconds(Number(n));i&&i({isAM:o,value:xo(c,a&&a.replace(/(\s+)A/g,"$1a")),timeStampValue:Number(c)})},this.onEnterSelectPanel=e=>{const{onCurrentSelectPanelChange:t}=this.props;t(e)},this.getDisplayDateFromTimeStamp=e=>this.foundation.getDisplayDateFromTimeStamp(e),this.foundation=new Qv(this.adapter),this.state=Object.assign({},this.foundation.initData())}componentDidUpdate(e,t){e.timeStampValue===this.props.timeStampValue&&e.format===this.props.format&&e.hideDisabledOptions===this.props.hideDisabledOptions&&e.use12Hours===this.props.use12Hours&&e.hourStep===this.props.hourStep&&e.minuteStep===this.props.minuteStep&&e.secondStep===this.props.secondStep&&e.disabledHours===this.props.disabledHours&&e.disabledMinutes===this.props.disabledMinutes&&e.disabledSeconds===this.props.disabledSeconds||this.setState(Object.assign({},this.foundation.initData()))}componentWillUnmount(){}componentDidMount(){}renderHourSelect(e,t){const{prefixCls:n,disabledHours:r,use12Hours:i,scrollItemProps:s}=this.props,{showHour:o,hourOptions:a}=this.state;if(!o)return null;const l=r();let c,d;i?(c=[12].concat(a.filter((e=>e<12&&e>0))),d=e%12||12):(c=a,d=e);const u=`${n}-list-hour`;return h().createElement(Wv,Object.assign({ref:e=>this.cacheRefCurrent("hour",e),mode:"normal",transform:e=>e+t.hour,className:u,list:c.map((e=>Zv(e,l))),selectedIndex:c.indexOf(d),type:"hour",onSelect:this.onItemChange},s))}renderMinuteSelect(e,t){const{prefixCls:n,disabledMinutes:r,timeStampValue:i,scrollItemProps:s}=this.props,{showMinute:o,minuteOptions:a}=this.state;if(!o)return null;const l=new Date(i),c=r&&r(l.getHours()),d=`${n}-list-minute`;return h().createElement(Wv,Object.assign({ref:e=>this.cacheRefCurrent("minute",e),mode:"normal",transform:e=>e+t.minute,list:a.map((e=>Zv(e,c))),selectedIndex:a.indexOf(e),type:"minute",onSelect:this.onItemChange,className:d},s))}renderSecondSelect(e,t){const{prefixCls:n,disabledSeconds:r,timeStampValue:i,scrollItemProps:s}=this.props,{showSecond:o,secondOptions:a}=this.state;if(!o)return null;const l=new Date(i),c=r&&r(l.getHours(),l.getMinutes()),d=`${n}-list-second`;return h().createElement(Wv,Object.assign({ref:e=>this.cacheRefCurrent("second",e),mode:"normal",transform:e=>String(e)+t.second,list:a.map((e=>Zv(e,c))),selectedIndex:a.indexOf(e),className:d,type:"second",onSelect:this.onItemChange},s))}renderAMPMSelect(e,t){const{prefixCls:n,use12Hours:r,isAM:i,scrollItemProps:s}=this.props;if(!r)return null;const o=[{value:"AM",text:e.AM||"上午"},{value:"PM",text:e.PM||"下午"}],a=i?0:1,l=`${n}-list-ampm`;return h().createElement(Wv,Object.assign({ref:e=>this.cacheRefCurrent("ampm",e),mode:"normal",className:l,list:o,selectedIndex:a,type:"ampm",onSelect:this.onItemChange},s))}render(){const{timeStampValue:e,panelHeader:t,panelFooter:n}=this.props,r=this.getDisplayDateFromTimeStamp(e);return h().createElement(Jt,{componentName:"TimePicker"},((e,i)=>h().createElement(Yv,{header:t,footer:n,"x-semi-header-alias":"panelHeader","x-semi-footer-alias":"panelFooter"},this.renderAMPMSelect(e,i),this.renderHourSelect(r.getHours(),e),this.renderMinuteSelect(r.getMinutes(),e),this.renderSecondSelect(r.getSeconds(),e))))}}eb.propTypes={format:E().string,defaultOpenValue:E().object,prefixCls:E().string,onChange:E().func,showHour:E().bool,showMinute:E().bool,showSecond:E().bool,disabledHours:E().func,disabledMinutes:E().func,disabledSeconds:E().func,hideDisabledOptions:E().bool,onCurrentSelectPanelChange:E().func,use12Hours:E().bool,isAM:E().bool,timeStampValue:E().any,scrollItemProps:E().object},eb.defaultProps={disabledHours:i(),disabledMinutes:i(),disabledSeconds:i(),format:Ov.DEFAULT_FORMAT};const tb=eb;function nb(e,t){Nt(2,arguments);var n=Lt(e),r=Ft(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}class rb extends c{constructor(e){super(Object.assign({},e))}init(){}destroy(){}selectYear(e,t){const{currentYear:n,currentMonth:r}=this.getStates(),{type:i}=this.getProps(),s=Wf.PANEL_TYPE_LEFT,o=Wf.PANEL_TYPE_RIGHT,a=Ky(n);if(a[t]=e.value,"monthRange"===i){const n=a[s]===a[o]&&r[s]>r[o];t===s&&e.value>a[o]||t===s&&n?a[o]=e.value+1:t===o&&n&&(a[s]=e.value-1)}this._adapter.setCurrentYear(a,(()=>this.autoSelectMonth(e,t,a))),this._adapter.notifySelectYear(a)}selectMonth(e,t){const{currentMonth:n,currentYear:r}=this.getStates(),{type:i}=this.getProps(),s=Wf.PANEL_TYPE_LEFT,o=Wf.PANEL_TYPE_RIGHT,a=Ky(n);a[t]=e.month,"monthRange"===i&&t===s&&r[s]===r[o]&&e.month>a[o]&&(a[o]=e.month),this._adapter.setCurrentMonth(a),this._adapter.notifySelectMonth(a)}autoSelectMonth(e,t,n){const{disabledDate:r,locale:i}=this._adapter.getProps(),{months:s,currentMonth:o}=this._adapter.getStates(),a=t===Wf.PANEL_TYPE_LEFT?"right":"left",l=nb(Date.now(),e.year),c=r(rv(l,o[t]-1)),d=r(rv(nb(Date.now(),n[a]),o[a]-1));if(!c&&!d)return;let h=n,u=o;if(c){const n=s.findIndex((e=>{let{month:n}=e;return n===o[t]}));let i;i=s.slice(n).find((e=>{let{month:t}=e;return!r(rv(l,t-1))})),i||(i=s.slice(0,n).find((e=>{let{month:t}=e;return!r(rv(l,t-1))}))),i&&!d?u[t]=i.month:i&&d&&(h={left:e.year,right:e.year},u={left:i.month,right:i.month})}else!c&&d&&(h={left:e.year,right:e.year},u={left:o[t],right:o[t]});this._adapter.setCurrentYearAndMonth(h,u),this._adapter.notifySelectYearAndMonth(h,u)}backToMain(){this._adapter.notifyBackToMain()}}function ib(e,t){const n=(new Date).getFullYear(),r=(new Date).getMonth(),i=t.right||r+2,s=e.right||(i<=12?n:n+1);return{year:{left:e.left||n,right:s},month:{left:t.left||r+1,right:i<=12?i:1}}}const sb=(e,t)=>{const n=(new Date).getFullYear();let r="number"==typeof e?e:n-100,i="number"==typeof t?t:n+100;return i<r&&([r,i]=[i,r]),Array.from({length:i-r+1},((e,t)=>r+t))},ob=`${C}-datepicker`;class ab extends f{constructor(e){super(e),this.selectYear=(e,t)=>{this.foundation.selectYear(e,t)},this.selectMonth=(e,t)=>{this.foundation.selectMonth(e,t)},this.reselect=()=>{["yearRef","monthRef"].forEach((e=>{const t=this[e];t&&t.current&&t.current.scrollToIndex&&t.current.scrollToIndex()}))},this.backToMain=e=>{e.nativeEvent.stopImmediatePropagation(),this.foundation.backToMain()};new Date;let{currentYear:t,currentMonth:n}=e;const{year:r,month:i}=ib(t,n);this.state={years:sb(e.startYear,e.endYear).map((e=>({value:e,year:e}))),months:Array(12).fill(0).map(((e,t)=>({value:t+1,month:t+1}))),currentYear:r,currentMonth:i},this.yearRef=h().createRef(),this.monthRef=h().createRef(),this.foundation=new rb(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setCurrentYear:(e,t)=>this.setState({currentYear:e},t),setCurrentMonth:e=>this.setState({currentMonth:e}),setCurrentYearAndMonth:(e,t)=>this.setState({currentYear:e,currentMonth:t}),notifySelectYear:e=>this.props.onSelect({currentMonth:this.state.currentMonth,currentYear:e}),notifySelectMonth:e=>this.props.onSelect({currentYear:this.state.currentYear,currentMonth:e}),notifySelectYearAndMonth:(e,t)=>this.props.onSelect({currentYear:e,currentMonth:t}),notifyBackToMain:()=>this.props.onBackToMain()})}static getDerivedStateFromProps(e,t){const n={},{year:r,month:i}=ib(e.currentYear,e.currentMonth);return Oe()(e.currentYear,t.currentYear)||(n.currentYear=r),Oe()(e.currentMonth,t.currentMonth)||(n.currentMonth=i),n}renderColYear(e){const{years:t,currentYear:n,currentMonth:r,months:i}=this.state,{disabledDate:s,localeCode:o,yearCycled:a,yearAndMonthOpts:l}=this.props,c=rv(Date.now(),r[e]-1),d=Wf.PANEL_TYPE_LEFT,u=Wf.PANEL_TYPE_RIGHT,p=t.map((t=>{let{value:r,year:o}=t;const a=i.every((e=>{let{month:t}=e;return s(iv(c,{year:o,month:t-1}))})),l=(t=>!(e!==u||!n[d])&&n[d]>t)(o);return{year:o,value:r,disabled:a||l}}));let f=e=>e;return"zh-CN"!==o&&"zh-TW"!==o||(f=e=>`${e}年`),h().createElement(Wv,Object.assign({ref:this.yearRef,cycled:a,list:p,transform:f,selectedIndex:t.findIndex((t=>t.value===n[e])),type:"year",onSelect:t=>this.selectYear(t,e),mode:"normal"},l))}renderColMonth(e){const{months:t,currentMonth:n,currentYear:r}=this.state,{locale:i,localeCode:s,monthCycled:o,disabledDate:a,yearAndMonthOpts:l}=this.props;let c=e=>e;const d=nb(Date.now(),r[e]),u=Wf.PANEL_TYPE_LEFT,p=Wf.PANEL_TYPE_RIGHT;"zh-CN"!==s&&"zh-TW"!==s||(c=e=>`${e}月`);const f=t.map((t=>{let{value:s,month:o}=t;const l=e===p&&n[u]&&r[u]===r[p]&&n[u]>o;return{month:o,disabled:a(rv(d,o-1))||l,value:i.fullMonths[s]}})),m=f.findIndex((t=>t.month===n[e]));return h().createElement(Wv,Object.assign({ref:this.monthRef,cycled:o,list:f,transform:c,selectedIndex:m,type:"month",onSelect:t=>this.selectMonth(t,e),mode:"normal"},l))}renderPanel(e){return h().createElement(h().Fragment,null,h().createElement(Yv,null,this.renderColYear(e),this.renderColMonth(e)))}render(){const{locale:e,noBackBtn:t,density:n,presetPosition:r,renderQuickControls:i,renderDateInput:s,type:o}=this.props,a=`${ob}-yearmonth-header`,l=`${ob}-yearmonth-body`,c=e.selectDate,d="compact"===n?"default":"large",u="compact"===n?"small":"default",p=Wf.PANEL_TYPE_LEFT,f=Wf.PANEL_TYPE_RIGHT;let m=null;return m="month"===o?this.renderPanel(p):h().createElement("div",{className:l},this.renderPanel(p),this.renderPanel(f)),h().createElement(h().Fragment,null,t?null:h().createElement("div",{className:a},h().createElement(ji,{noHorizontalPadding:!1,icon:h().createElement(Rl,{"aria-hidden":!0,size:d}),size:u,onClick:this.backToMain},h().createElement("span",null,c))),r?h().createElement("div",{style:{display:"flex"}},"left"===r&&"monthRange"!==o&&i,h().createElement("div",null,s,m),"right"===r&&"monthRange"!==o&&i):h().createElement(h().Fragment,null,s,m))}}ab.propTypes={currentYear:E().object,currentMonth:E().object,onSelect:E().func,locale:E().object,localeCode:E().string,monthCycled:E().bool,yearCycled:E().bool,noBackBtn:E().bool,disabledDate:E().func,density:E().string,presetPosition:E().oneOf(Wf.PRESET_POSITION_SET),renderQuickControls:E().node,renderDateInput:E().node,type:E().oneOf(Wf.TYPE_SET),startYear:E().number,endYear:E().number},ab.defaultProps={disabledDate:Zf(),monthCycled:!1,yearCycled:!1,noBackBtn:!1,onSelect:i(),type:"month"};const lb=ab;const cb=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm1.5-16.5v4.88l3.56 3.56a1.5 1.5 0 0 1-2.12 2.12l-4-4A1.5 1.5 0 0 1 10.5 12V6.5a1.5 1.5 0 0 1 3 0Z",fill:"currentColor"}))}),"clock"),db=Kf.PREFIX;class hb extends f{constructor(e){super(e),this.cacheRefCurrent=(e,t)=>{"string"==typeof e&&e.length&&this.adapter.setCache(e,t)},this.leftIsYearOrTime=e=>{const{monthLeft:t}=e||this.state;return!(!t||!t.isTimePickerOpen&&!t.isYearPickerOpen)},this.rightIsYearOrTime=e=>{const{monthRight:t}=e||this.state;return!(!t||!t.isTimePickerOpen&&!t.isYearPickerOpen)},this.calcScrollListHeight=()=>{const e=this.adapter.getCache(`wrap-${Wf.PANEL_TYPE_LEFT}`),t=this.adapter.getCache(`wrap-${Wf.PANEL_TYPE_RIGHT}`),n=this.adapter.getCache(`switch-${Wf.PANEL_TYPE_LEFT}`),r=this.adapter.getCache(`switch-${Wf.PANEL_TYPE_RIGHT}`),i=e&&e.getBoundingClientRect(),s=t&&t.getBoundingClientRect();let o=i&&i.height||0,a=s&&s.height||0;return n&&(o+=n.getBoundingClientRect().height),r&&(a+=r.getBoundingClientRect().height),Math.max(o,a)},this.handleWeeksRowNumChange=(e,t)=>{const n=t===Wf.PANEL_TYPE_RIGHT,r=t===Wf.PANEL_TYPE_RIGHT,i=this.leftIsYearOrTime()&&this.rightIsYearOrTime();if(this.foundation.isRangeType()&&!i){const t={weeksRowNum:e,currentPanelHeight:this.calcScrollListHeight()};this.setState(t,(()=>{(this.leftIsYearOrTime()&&r||this.rightIsYearOrTime()&&n)&&this.reselect()}))}},this.reselect=()=>{[`timepicker-${Wf.PANEL_TYPE_LEFT}`,`timepicker-${Wf.PANEL_TYPE_RIGHT}`,`yam-${Wf.PANEL_TYPE_LEFT}`,`yam-${Wf.PANEL_TYPE_RIGHT}`].forEach((e=>{const t=this.adapter.getCache(e);t&&"function"==typeof t.reselect&&t.reselect()}))},this.getYAMOpenType=()=>this.foundation.getYAMOpenType();const t=e.format||sy(e.type),{nowDate:n,nextDate:r}=py({defaultPickerValue:e.defaultPickerValue,format:t,dateFnsLocale:e.dateFnsLocale}),i={selected:new Set},s={monthLeft:{pickerDate:n,showDate:n,isTimePickerOpen:!1,isYearPickerOpen:!1},monthRight:{pickerDate:r,showDate:r,isTimePickerOpen:!1,isYearPickerOpen:!1},maxWeekNum:0,hoverDay:"",rangeStart:e.rangeStart,rangeEnd:"",currentPanelHeight:0,offsetRangeStart:"",offsetRangeEnd:""};this.state=Object.assign(Object.assign({},i),s),this.foundation=new uv(this.adapter)}get dateAdapter(){return{updateDaySelected:e=>this.setState({selected:e})}}get rangeAdapter(){return{setRangeStart:e=>this.setState({rangeStart:e}),setRangeEnd:e=>this.setState({rangeEnd:e}),setHoverDay:e=>this.setState({hoverDay:e}),setWeeksHeight:e=>this.setState({maxWeekNum:e}),setOffsetRangeStart:e=>this.setState({offsetRangeStart:e}),setOffsetRangeEnd:e=>this.setState({offsetRangeEnd:e})}}get adapter(){return Object.assign(Object.assign(Object.assign(Object.assign({},super.adapter),this.dateAdapter),this.rangeAdapter),{updateMonthOnLeft:e=>this.setState({monthLeft:e}),updateMonthOnRight:e=>this.setState({monthRight:e}),notifySelectedChange:(e,t)=>this.props.onChange(e,t),notifyMaxLimit:e=>this.props.onMaxSelect(e),notifyPanelChange:(e,t)=>this.props.onPanelChange(e,t),setRangeInputFocus:e=>this.props.setRangeInputFocus(e),isAnotherPanelHasOpened:e=>this.props.isAnotherPanelHasOpened(e)})}componentDidMount(){super.componentDidMount()}componentDidUpdate(e,t){const{defaultValue:n,defaultPickerValue:r}=this.props;e.defaultValue!==n&&this.foundation.updateSelectedFromProps(n),e.defaultPickerValue!==r&&this.foundation.initDefaultPickerValue();if(this.foundation.isRangeType()){const e=this.leftIsYearOrTime(t)&&this.rightIsYearOrTime(t),n=this.leftIsYearOrTime(t)&&!this.rightIsYearOrTime(t)||!this.leftIsYearOrTime(t)&&this.rightIsYearOrTime(t),r=this.leftIsYearOrTime()&&this.rightIsYearOrTime(),i=this.leftIsYearOrTime()&&!this.rightIsYearOrTime()||!this.leftIsYearOrTime()&&this.rightIsYearOrTime(),s=e&&i;n&&r?this.setState({currentPanelHeight:this.calcScrollListHeight()},this.reselect):s&&this.reselect()}}renderPanel(e,t){let n=w()(`${db}-month-grid-${t}`);const{monthLeft:r,monthRight:i,currentPanelHeight:s}=this.state,{insetInput:o}=this.props,a=t===Wf.PANEL_TYPE_RIGHT?i:r,{isTimePickerOpen:l,isYearPickerOpen:c}=a,d=this.renderMonth(e,t),u=c?h().createElement("div",{className:`${db}-yam`},this.renderYearAndMonth(t,a)):null,p=l?h().createElement("div",{className:`${db}-tpk`},this.renderTimePicker(t,a)):null,f={},m=this.adapter.getCache(`wrap-${Wf.PANEL_TYPE_LEFT}`),g=this.adapter.getCache(`wrap-${Wf.PANEL_TYPE_RIGHT}`),y=t===Wf.PANEL_TYPE_RIGHT?g:m;this.foundation.isRangeType()?((c||l)&&(f.minWidth=y.getBoundingClientRect().width),this.leftIsYearOrTime()&&this.rightIsYearOrTime()&&!o&&(f.minHeight=s||this.calcScrollListHeight())):"year"!==this.props.type&&"month"!==this.props.type&&(l||c)&&(n=w()(n,`${db}-yam-showing`));const v=!(c||l)?"date":c?"year":"time";return h().createElement("div",{className:n,key:t,style:f,"x-open-type":v},u,p,this.foundation.isRangeType()?d:c||l?null:d,this.renderSwitch(t))}showYearPicker(e,t){t.nativeEvent.stopImmediatePropagation(),this.foundation.showYearPicker(e)}renderMonth(e,t){const{selected:n,rangeStart:r,rangeEnd:i,hoverDay:s,maxWeekNum:o,offsetRangeStart:a,offsetRangeEnd:l}=this.state,{weekStartsOn:c,disabledDate:d,locale:u,localeCode:p,renderDate:f,renderFullDate:m,startDateOffset:g,endDateOffset:y,density:v,rangeInputFocus:b,syncSwitchMonth:w,multiple:x}=this.props;let E="";if(e){const t=e?xo(e,"yyyy"):"",n=e?xo(e,"L"):"",r=u.months[n];E=u.monthText.replace("${year}",t).replace("${month}",r)}let C={};const S=t===Wf.PANEL_TYPE_RIGHT?this.state.monthRight:this.state.monthLeft,_=this.foundation.isRangeType(),k=_&&w;return _&&S&&(S.isYearPickerOpen||S.isTimePickerOpen)&&(C={visibility:"hidden",position:"absolute",pointerEvents:"none"}),h().createElement("div",{ref:e=>this.cacheRefCurrent(`wrap-${t}`,e),style:C},h().createElement(gv,{forwardRef:e=>this.cacheRefCurrent(`nav-${t}`,e),monthText:E,density:v,onMonthClick:e=>this.showYearPicker(t,e),onPrevMonth:()=>this.foundation.prevMonth(t),onNextMonth:()=>this.foundation.nextMonth(t),onNextYear:()=>this.foundation.nextYear(t),onPrevYear:()=>this.foundation.prevYear(t),shouldBimonthSwitch:k,panelType:t}),h().createElement(Cv,{locale:u,localeCode:p,forwardRef:e=>this.cacheRefCurrent(`month-${t}`,e),disabledDate:d,weekStartsOn:c,month:e,selected:n,rangeStart:r,rangeEnd:i,rangeInputFocus:b,offsetRangeStart:a,offsetRangeEnd:l,hoverDay:s,weeksRowNum:o,renderDate:f,renderFullDate:m,onDayClick:e=>this.foundation.handleDayClick(e,t),onDayHover:e=>this.foundation.handleDayHover(e,t),onWeeksRowNumChange:e=>this.handleWeeksRowNumChange(e,t),startDateOffset:g,endDateOffset:y,focusRecordsRef:this.props.focusRecordsRef,multiple:x}))}renderTimePicker(e,t){const{type:n,locale:r,format:i,hideDisabledOptions:s,timePickerOpts:o,dateFnsLocale:a}=this.props,{pickerDate:l}=t,c=w()(`${db}-time`),d=Object.assign(Object.assign({},o),{hideDisabledOptions:s}),u=this.foundation.calcDisabledTime(e);u&&["disabledHours","disabledMinutes","disabledSeconds"].forEach((e=>{u[e]&&(d[e]=u[e])}));const{rangeStart:p,rangeEnd:f}=this.state,m=this.foundation.getValidDateFormat();let g,y;"dateTimeRange"===n&&p&&f&&Ss(g=ry(p,m,void 0,a),y=ry(f,m,void 0,a))&&(e===Wf.PANEL_TYPE_RIGHT?p&&(d.startDate=g):f&&(d.endDate=y));const v=r.selectTime;return h().createElement("div",{className:c},h().createElement(tb,Object.assign({ref:t=>this.cacheRefCurrent(`timepicker-${e}`,t),panelHeader:v,format:i||Wf.FORMAT_TIME_PICKER,timeStampValue:l,onChange:t=>this.foundation.handleTimeChange(t,e)},d)))}renderYearAndMonth(e,t){const{pickerDate:n}=t,{locale:r,localeCode:i,density:s,yearAndMonthOpts:o,startYear:a,endYear:l}=this.props,c=n.getFullYear(),d=n.getMonth()+1;return h().createElement(lb,{ref:t=>this.cacheRefCurrent(`yam-${e}`,t),locale:r,localeCode:i,currentYear:{left:c,right:0},currentMonth:{left:d,right:0},onSelect:t=>this.foundation.toYearMonth(e,new Date(t.currentYear.left,t.currentMonth.left-1)),onBackToMain:()=>{this.foundation.showDatePanel(e);const t=this.adapter.getCache(`wrap-${e}`);t&&(t.style.height="auto")},density:s,yearAndMonthOpts:o,startYear:a,endYear:l})}renderSwitch(e){const{rangeStart:t,rangeEnd:n,monthLeft:r,monthRight:i}=this.state,{type:s,locale:o,disabledTimePicker:a,density:l,dateFnsLocale:c,insetInput:d}=this.props;if(!s.includes("Time")||d)return null;let u,p;const{FORMAT_SWITCH_DATE:f}=o.localeFormatToken,m=this.foundation.getValidTimeFormat(),g=this.foundation.getValidDateFormat();e===Wf.PANEL_TYPE_LEFT?(u=r,p=t?xo(ry(t,g,void 0,c),f):""):(u=i,p=n?xo(ry(n,g,void 0,c),f):"");const{isTimePickerOpen:y,showDate:v}=u,b=v?xo(v,f):"",x=v?xo(v,m):"",E=["default"].includes(l),C=w()(`${db}-switch`),S=w()({[`${db}-switch-date`]:!0,[`${db}-switch-date-active`]:!y}),_=w()({[`${db}-switch-time`]:!0,[`${db}-switch-time-disabled`]:a,[`${db}-switch-date-active`]:y}),k=w()(`${db}-switch-text`);return h().createElement("div",{className:C,ref:t=>this.adapter.setCache(`switch-${e}`,t)},h().createElement("div",{role:"button","aria-label":"Switch to date panel",className:S,onClick:t=>this.foundation.showDatePanel(e)},E&&h().createElement(qy,{"aria-hidden":!0}),h().createElement("span",{className:k},p||b)),h().createElement("div",{role:"button","aria-label":"Switch to time panel",className:_,onClick:t=>this.foundation.showTimePicker(e,!0)},E&&h().createElement(cb,{"aria-hidden":!0}),h().createElement("span",{className:k},x)))}render(){const{monthLeft:e,monthRight:t}=this.state,{type:n,insetInput:r,presetPosition:i,renderQuickControls:s,renderDateInput:o}=this.props,a=w()({[`${db}-month-grid`]:!0}),l=Wf.PANEL_TYPE_LEFT,c=Wf.PANEL_TYPE_RIGHT;let d=null;"date"===n||"dateTime"===n?d=this.renderPanel(e.pickerDate,l):"dateRange"===n||"dateTimeRange"===n?d=[this.renderPanel(e.pickerDate,l),this.renderPanel(t.pickerDate,c)]:"year"!==n&&"month"!==n||(d="year month");const u=this.getYAMOpenType();return h().createElement("div",{style:{display:"flex"}},"left"===i&&s,h().createElement("div",null,o,h().createElement("div",{className:a,"x-type":n,"x-panel-yearandmonth-open-type":u,"x-insetinput":r?"true":"false","x-preset-position":null===s?"null":i,ref:e=>this.cacheRefCurrent("monthGrid",e)},d)),"right"===i&&s)}}hb.propTypes={type:E().oneOf(Wf.TYPE_SET),defaultValue:E().array,defaultPickerValue:E().oneOfType([E().string,E().number,E().object,E().array]),multiple:E().bool,max:E().number,weekStartsOn:E().number,disabledDate:E().func,disabledTime:E().func,disabledTimePicker:E().bool,hideDisabledOptions:E().bool,navPrev:E().node,navNext:E().node,onMaxSelect:E().func,timePickerOpts:E().object,isControlledComponent:E().bool,rangeStart:E().oneOfType([E().string]),rangeInputFocus:E().oneOfType([E().bool,E().string]),locale:E().object,localeCode:E().string,format:E().string,renderDate:E().func,renderFullDate:E().func,startDateOffset:E().func,endDateOffset:E().func,autoSwitchDate:E().bool,density:E().string,dateFnsLocale:E().object.isRequired,timeZone:E().oneOfType([E().string,E().number]),syncSwitchMonth:E().bool,onPanelChange:E().func,focusRecordsRef:E().object,triggerRender:E().func,presetPosition:E().oneOf(Wf.PRESET_POSITION_SET),renderQuickControls:E().node,renderDateInput:E().node},hb.defaultProps={type:"date",rangeStart:"",multiple:!1,weekStartsOn:Gf.WEEK_START_ON,disabledDate:Zf(),onMaxSelect:i(),locale:{}};const ub=Kf.PREFIX,{Text:pb}=Un;class fb extends d.PureComponent{render(){const{presets:e,onPresetClick:t,type:n,presetPosition:r,insetInput:i,locale:s}=this.props,o="top"===r||"bottom"===r,a=o&&("dateRange"===n||"dateTimeRange"===n),l=o&&"month"===n,c=w()(`${ub}-quick-control`,{[`${ub}-quick-control-${n}`]:n,[`${ub}-quick-control-${r}`]:!0}),d=w()({[`${ub}-quick-control-header`]:!0}),u=w()({[`${ub}-quick-control-${r}-content-wrapper`]:!0}),p=w()({[`${ub}-quick-control-${r}-content`]:!a&&!l,[`${ub}-quick-control-${r}-range-content`]:a,[`${ub}-quick-control-${r}-month-content`]:l}),f=w()({[`${ub}-quick-control-${r}-content-item`]:!a&&!l,[`${ub}-quick-control-${r}-range-content-item`]:a,[`${ub}-quick-control-${r}-month-content-item`]:l}),m=w()({[`${ub}-quick-control-${r}-content-item-ellipsis`]:!a&&!l,[`${ub}-quick-control-${r}-range-content-item-ellipsis`]:a,[`${ub}-quick-control-${r}-month-content-item-ellipsis`]:l});return e.length?h().createElement("div",{className:c,"x-insetinput":i?"true":"false"},!o&&h().createElement("div",{className:d},s.presets),h().createElement("div",{className:u},h().createElement("div",{className:p},e.map(((e,n)=>{const r="function"==typeof e?e():e;return h().createElement(vs,{size:"small",type:"primary",onClick:e=>t(r,e),key:n},h().createElement("div",{className:f},h().createElement(pb,{ellipsis:{showTooltip:!0},className:m},r.text)))}))))):null}}fb.propTypes={presets:E().array,presetPosition:E().oneOf(Wf.PRESET_POSITION_SET),onPresetClick:E().func,type:E().string,insetInput:E().oneOfType([E().bool,E().object]),locale:E().object},fb.defaultProps={presets:[],presetPosition:"bottom",onPresetClick:Tt};const mb=fb;function gb(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{prefixCls:t,locale:n,onCancelClick:r,onConfirmClick:i,disabledConfirm:s}=e,a=w()(`${t}-footer`);return h().createElement("div",{className:a},h().createElement(vs,{theme:"borderless",onClick:r},o()(n,"footer.cancel","")),h().createElement(vs,{theme:"solid",onClick:i,disabled:s},o()(n,"footer.confirm","")))}__webpack_require__("zEHc");var yb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class vb extends f{constructor(e){var t;super(e),t=this,this.setTriggerRef=e=>this.triggerElRef.current=e,this.handleSelectedChange=(e,t)=>this.foundation.handleSelectedChange(e,t),this.handleYMSelectedChange=e=>this.foundation.handleYMSelectedChange(e),this.disabledDisposeDate=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.foundation.disabledDisposeDate(e,...r)},this.disabledDisposeTime=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.foundation.disabledDisposeTime(e,...r)},this.handleOpenPanel=()=>this.foundation.openPanel(),this.handleInputChange=function(){return t.foundation.handleInputChange(...arguments)},this.handleInsetInputChange=e=>this.foundation.handleInsetInputChange(e),this.handleInputComplete=e=>this.foundation.handleInputComplete(e),this.handleInputBlur=e=>this.foundation.handleInputBlur(o()(e,"nativeEvent.target.value"),e),this.handleInputFocus=function(){return t.foundation.handleInputFocus(...arguments)},this.handleInputClear=e=>this.foundation.handleInputClear(e),this.handleTriggerWrapperClick=e=>this.foundation.handleTriggerWrapperClick(e),this.handleSetRangeFocus=e=>this.foundation.handleSetRangeFocus(e),this.handleRangeInputBlur=(e,t)=>this.foundation.handleRangeInputBlur(e,t),this.handleRangeInputClear=e=>this.foundation.handleRangeInputClear(e),this.handleRangeEndTabPress=e=>this.foundation.handleRangeEndTabPress(e),this.isAnotherPanelHasOpened=e=>"rangeStart"===e?this.focusRecordsRef.current.rangeEnd:this.focusRecordsRef.current.rangeStart,this.handleInsetDateFocus=(e,t)=>{const n=o()(this,"monthGrid.current.foundation");n&&(n.showDatePanel(Wf.PANEL_TYPE_LEFT),n.showDatePanel(Wf.PANEL_TYPE_RIGHT)),this.handleInputFocus(e,t)},this.handleInsetTimeFocus=()=>{const e=o()(this,"monthGrid.current.foundation");e&&(e.showTimePicker(Wf.PANEL_TYPE_LEFT),e.showTimePicker(Wf.PANEL_TYPE_RIGHT))},this.handlePanelVisibleChange=e=>{this.foundation.handlePanelVisibleChange(e)},this.handleConfirm=e=>this.foundation.handleConfirm(),this.handleCancel=e=>this.foundation.handleCancel(),this.renderFooter=(e,t)=>{var n;if(this.adapter.needConfirm()){const{cachedSelectedValue:r}=this.state,i=/range/i.test(null!==(n=this.props.type)&&void 0!==n?n:""),s=Array.isArray(r)&&(0===r.length||2===r.length&&r.every((e=>null!=e))),o=!!i&&!s;return h().createElement(gb,Object.assign({},this.props,{locale:e,localeCode:t,onConfirmClick:this.handleConfirm,onCancelClick:this.handleCancel,disabledConfirm:o}))}return null},this.renderPanel=(e,t,n)=>{const{dropdownClassName:r,dropdownStyle:i,density:s,topSlot:o,bottomSlot:a,presetPosition:l,type:c,leftSlot:d,rightSlot:u}=this.props,p=w()(Kf.PREFIX,{[Kf.PANEL_YAM]:this.adapter.typeIsYearOrMonth(),[`${Kf.PREFIX}-compact`]:"compact"===s},r);return h().createElement("div",{ref:this.panelRef,className:p,style:i,"x-type":c},h().createElement("div",{className:`${Kf.PREFIX}-container`},d&&h().createElement("div",{className:`${Kf.PREFIX}-leftSlot`,"x-semi-prop":"leftSlot"},d),h().createElement("div",null,o&&h().createElement("div",{className:`${Kf.PREFIX}-topSlot`,"x-semi-prop":"topSlot"},o),"top"===l&&"monthRange"!==c&&this.renderQuickControls(),this.adapter.typeIsYearOrMonth()?this.renderYearMonthPanel(e,t):this.renderMonthGrid(e,t,n),"bottom"===l&&"monthRange"!==c&&this.renderQuickControls(),a&&h().createElement("div",{className:`${Kf.PREFIX}-bottomSlot`,"x-semi-prop":"bottomSlot"},a)),u&&h().createElement("div",{className:`${Kf.PREFIX}-rightSlot`,"x-semi-prop":"rightSlot"},u)),this.renderFooter(e,t))},this.renderYearMonthPanel=(e,t)=>{const{density:n,presetPosition:r,yearAndMonthOpts:i,type:s,startYear:o,endYear:a}=this.props,l=this.state.value[0],c={left:0,right:0},d={left:0,right:0};if(Xf()(l)&&(c.left=l.getFullYear(),d.left=l.getMonth()+1),"monthRange"===s){const e=this.state.value[1];Xf()(e)&&(c.right=e.getFullYear(),d.right=e.getMonth()+1)}return h().createElement(lb,{locale:e,localeCode:t,disabledDate:this.disabledDisposeDate,noBackBtn:!0,monthCycled:!0,onSelect:this.handleYMSelectedChange,currentYear:c,currentMonth:d,density:n,presetPosition:r,renderQuickControls:this.renderQuickControls(),renderDateInput:this.renderDateInput(),type:s,yearAndMonthOpts:i,startYear:o,endYear:a})},this.wrapPopover=e=>{const{panelShow:t}=this.state,{direction:n}=this.context,r="rtl"===n?"bottomRight":"bottomLeft",{motion:i,zIndex:s,position:o=r,getPopupContainer:a,locale:l,localeCode:c,dateFnsLocale:d,stopPropagation:u,autoAdjustOverflow:p,spacing:f,dropdownMargin:m}=this.props;return h().createElement(Cn,{getPopupContainer:a,autoAdjustOverflow:p,zIndex:s,motion:i,margin:m,content:this.renderPanel(l,c,d),trigger:"custom",position:o,visible:t,stopPropagation:u,spacing:f,onVisibleChange:this.handlePanelVisibleChange},e)},this.state={panelShow:e.open||e.defaultOpen,isRange:!1,inputValue:null,value:[],cachedSelectedValue:[],prevTimeZone:null,rangeInputFocus:void 0,autofocus:e.autoFocus||this.isRangeType(e.type,e.triggerRender)&&(e.open||e.defaultOpen),insetInputValue:null,triggerDisabled:void 0},this.triggerElRef=h().createRef(),this.panelRef=h().createRef(),this.monthGrid=h().createRef(),this.inputRef=h().createRef(),this.rangeInputStartRef=h().createRef(),this.rangeInputEndRef=h().createRef(),this.focusRecordsRef=h().createRef(),this.focusRecordsRef.current={rangeStart:!1,rangeEnd:!1},this.foundation=new dy(this.adapter)}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{togglePanel:(e,t)=>{this.setState({panelShow:e},t),e||(this.focusRecordsRef.current.rangeEnd=!1,this.focusRecordsRef.current.rangeStart=!1)},registerClickOutSide:()=>{this.clickOutSideHandler&&(this.adapter.unregisterClickOutSide(),this.clickOutSideHandler=null),this.clickOutSideHandler=e=>{const t=this.triggerElRef&&this.triggerElRef.current,n=this.panelRef&&this.panelRef.current,r=e.target,i=e.composedPath&&e.composedPath()||[r];t&&t.contains(r)||n&&n.contains(r)||i.includes(t)||i.includes(n)||(this.props.onClickOutSide(e),this.adapter.needConfirm()||this.foundation.closePanel())},document.addEventListener("mousedown",this.clickOutSideHandler)},unregisterClickOutSide:()=>{document.removeEventListener("mousedown",this.clickOutSideHandler)},notifyBlur:function(){return e.props.onBlur(...arguments)},notifyFocus:function(){return e.props.onFocus(...arguments)},notifyClear:function(){return e.props.onClear(...arguments)},notifyChange:function(){return e.props.onChange(...arguments)},notifyCancel:function(){return e.props.onCancel(...arguments)},notifyConfirm:function(){return e.props.onConfirm(...arguments)},notifyOpenChange:function(){return e.props.onOpenChange(...arguments)},notifyPresetsClick:function(){return e.props.onPresetClick(...arguments)},updateValue:e=>this.setState({value:e}),updatePrevTimezone:e=>this.setState({prevTimeZone:e}),updateCachedSelectedValue:e=>{let t=e;e&&!Array.isArray(e)&&(t=[...e]),this.setState({cachedSelectedValue:t})},updateInputValue:e=>{this.setState({inputValue:e})},updateInsetInputValue:e=>{const{insetInput:t}=this.props;t&&!Oe()(e,this.state.insetInputValue)&&this.setState({insetInputValue:e})},needConfirm:()=>["dateTime","dateTimeRange"].includes(this.props.type)&&!0===this.props.needConfirm,typeIsYearOrMonth:()=>["month","year","monthRange"].includes(this.props.type),setRangeInputFocus:e=>{const{preventScroll:t}=this.props;switch(e!==this.state.rangeInputFocus&&this.setState({rangeInputFocus:e}),e){case"rangeStart":const e=o()(this,"rangeInputStartRef.current");e&&e.focus({preventScroll:t}),setTimeout((()=>{this.focusRecordsRef.current.rangeStart=!0}),0);break;case"rangeEnd":const n=o()(this,"rangeInputEndRef.current");n&&n.focus({preventScroll:t}),setTimeout((()=>{this.focusRecordsRef.current.rangeEnd=!0}),0);break;default:return}},couldPanelClosed:()=>this.focusRecordsRef.current.rangeStart&&this.focusRecordsRef.current.rangeEnd,isEventTarget:e=>e&&e.target===e.currentTarget,setInsetInputFocus:()=>{const{preventScroll:e}=this.props,{rangeInputFocus:t}=this.state;if("rangeEnd"===t){if(document.activeElement!==this.rangeInputEndRef.current){const t=o()(this,"rangeInputEndRef.current");t&&t.focus({preventScroll:e})}}else if(document.activeElement!==this.rangeInputStartRef.current){const t=o()(this,"rangeInputStartRef.current");t&&t.focus({preventScroll:e})}},setInputFocus:()=>{const{preventScroll:e}=this.props,t=o()(this,"inputRef.current");t&&t.focus({preventScroll:e})},setInputBlur:()=>{const e=o()(this,"inputRef.current");e&&e.blur()},setRangeInputBlur:()=>{const{rangeInputFocus:e}=this.state;if("rangeStart"===e){const e=o()(this,"rangeInputStartRef.current");e&&e.blur()}else if("rangeEnd"===e){const e=o()(this,"rangeInputEndRef.current");e&&e.blur()}this.adapter.setRangeInputFocus(!1)},setTriggerDisabled:e=>{this.setState({triggerDisabled:e})}})}isRangeType(e,t){return/range/i.test(e)&&!ye()(t)}componentDidUpdate(e){Oe()(e.value,this.props.value)?this.props.timeZone!==e.timeZone&&this.foundation.initFromProps({value:this.state.value,timeZone:this.props.timeZone,prevTimeZone:e.timeZone}):this.foundation.initFromProps(Object.assign({},this.props)),e.open!==this.props.open&&(this.foundation.initPanelOpenStatus(),this.props.open||this.foundation.clearRangeInputFocus())}componentDidMount(){this._mounted=!0,super.componentDidMount()}componentWillUnmount(){this._mounted=!1,super.componentWillUnmount()}open(){this.foundation.open()}close(){this.foundation.close()}focus(e){this.foundation.focus(e)}blur(){this.foundation.blur()}renderMonthGrid(e,t,n){const{type:r,multiple:i,max:s,weekStartsOn:o,timePickerOpts:a,defaultPickerValue:l,format:c,hideDisabledOptions:d,disabledTimePicker:u,renderDate:p,renderFullDate:f,startDateOffset:m,endDateOffset:g,autoSwitchDate:y,density:v,syncSwitchMonth:b,onPanelChange:w,timeZone:x,triggerRender:E,insetInput:C,presetPosition:S,yearAndMonthOpts:_,startYear:k,endYear:O}=this.props,{cachedSelectedValue:T,rangeInputFocus:P}=this.state,I=T;return h().createElement(hb,{ref:this.monthGrid,locale:e,localeCode:t,dateFnsLocale:n,weekStartsOn:o,type:r,multiple:i,max:s,format:c,disabledDate:this.disabledDisposeDate,hideDisabledOptions:d,disabledTimePicker:u,disabledTime:this.disabledDisposeTime,defaultValue:I,defaultPickerValue:l,timePickerOpts:a,isControlledComponent:!this.adapter.needConfirm()&&this.isControlled("value"),onChange:this.handleSelectedChange,renderDate:p,renderFullDate:f,startDateOffset:m,endDateOffset:g,autoSwitchDate:y,density:v,rangeInputFocus:P,setRangeInputFocus:this.handleSetRangeFocus,isAnotherPanelHasOpened:this.isAnotherPanelHasOpened,syncSwitchMonth:b,onPanelChange:w,timeZone:x,focusRecordsRef:this.focusRecordsRef,triggerRender:E,insetInput:C,presetPosition:S,renderQuickControls:this.renderQuickControls(),renderDateInput:this.renderDateInput(),yearAndMonthOpts:_,startYear:k,endYear:O})}renderQuickControls(){const{presets:e,type:t,presetPosition:n,insetInput:r,locale:i}=this.props;return h().createElement(mb,{type:t,presets:e,insetInput:r,presetPosition:n,onPresetClick:(e,t)=>this.foundation.handlePresetClick(e,t),locale:i})}renderDateInput(){const{insetInput:e,dateFnsLocale:t,density:n,type:r,format:i,rangeSeparator:s,rangeSeparatorNode:o,defaultPickerValue:a}=this.props,{insetInputValue:l,value:c}=this.state,d={dateFnsLocale:t,format:i,insetInputValue:l,rangeSeparator:s,rangeSeparatorNode:o,type:r,value:c,handleInsetDateFocus:this.handleInsetDateFocus,handleInsetTimeFocus:this.handleInsetTimeFocus,onInsetInputChange:this.handleInsetInputChange,rangeInputStartRef:this.rangeInputStartRef,rangeInputEndRef:this.rangeInputEndRef,density:n,defaultPickerValue:a};return e?h().createElement(Qy,Object.assign({},d,{insetInput:e})):null}renderInner(e){const{clearIcon:t,type:n,format:r,multiple:i,disabled:s,showClear:o,insetLabel:a,insetLabelId:l,placeholder:c,validateStatus:d,inputStyle:u,prefix:p,locale:f,dateFnsLocale:m,triggerRender:g,size:y,inputReadOnly:v,rangeSeparator:b,rangeSeparatorNode:x,insetInput:E,defaultPickerValue:C,borderless:S}=this.props,{value:_,inputValue:k,rangeInputFocus:O,triggerDisabled:T}=this.state,P=this.isRangeType(n,g),I=s||E&&T,M=w()(`${Kf.PREFIX}-input`,{[`${Kf.PREFIX}-range-input`]:P,[`${Kf.PREFIX}-range-input-${y}`]:P&&y,[`${Kf.PREFIX}-range-input-active`]:P&&O&&!I,[`${Kf.PREFIX}-range-input-disabled`]:P&&I,[`${Kf.PREFIX}-range-input-${d}`]:P&&d,[`${Kf.PREFIX}-borderless`]:S}),R=c||f.placeholder[n],A=Object.assign(Object.assign({},e),{showClearIgnoreDisabled:Boolean(E),placeholder:R,clearIcon:t,disabled:I,inputValue:k,value:_,defaultPickerValue:C,onChange:this.handleInputChange,onEnterPress:this.handleInputComplete,block:!0,inputStyle:u,showClear:o,insetLabel:a,insetLabelId:l,type:n,format:r,multiple:i,validateStatus:d,inputReadOnly:v||Boolean(E),onBlur:this.handleInputBlur,onFocus:this.handleInputFocus,onClear:this.handleInputClear,prefix:p,size:y,autofocus:this.state.autofocus,dateFnsLocale:m,rangeInputFocus:O,rangeSeparator:b,rangeSeparatorNode:x,onRangeBlur:this.handleRangeInputBlur,onRangeClear:this.handleRangeInputClear,onRangeEndTabPress:this.handleRangeEndTabPress,rangeInputStartRef:E?null:this.rangeInputStartRef,rangeInputEndRef:E?null:this.rangeInputEndRef,inputRef:this.inputRef});return h().createElement("div",{role:"combobox","aria-label":Array.isArray(_)&&_.length?"Change date":"Choose date","aria-disabled":s,onClick:this.handleTriggerWrapperClick,className:M},"function"==typeof g?h().createElement(Pr,Object.assign({},A,{triggerRender:g,componentName:"DatePicker",componentProps:Object.assign({},this.props)})):h().createElement(Qy,Object.assign({},A)))}render(){const e=this.props,{style:t,className:n,prefixCls:r,type:i}=e,s=yb(e,["style","className","prefixCls","type"]),o=Object.assign({style:t,className:w()(n,{[r]:!0}),ref:this.setTriggerRef,"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],"aria-required":this.props["aria-required"]},this.getDataAttr(s)),a=[];i.toLowerCase().includes("range")||a.push("borderless");const l=this.renderInner(Gl()(this.props,a)),c=this.wrapPopover(l);return h().createElement("div",Object.assign({},o),c)}}vb.contextType=lt,vb.propTypes={"aria-describedby":E().string,"aria-errormessage":E().string,"aria-invalid":E().bool,"aria-labelledby":E().string,"aria-required":E().bool,borderless:E().bool,type:E().oneOf(Wf.TYPE_SET),size:E().oneOf(Wf.SIZE_SET),clearIcon:E().node,density:E().oneOf(Wf.DENSITY_SET),defaultValue:E().oneOfType([E().string,E().number,E().object,E().array]),value:E().oneOfType([E().string,E().number,E().object,E().array]),defaultPickerValue:E().oneOfType([E().string,E().number,E().object,E().array]),disabledTime:E().func,disabledTimePicker:E().bool,hideDisabledOptions:E().bool,format:E().string,disabled:E().bool,multiple:E().bool,max:E().number,placeholder:E().oneOfType([E().string,E().array]),presets:E().array,presetPosition:E().oneOf(Wf.PRESET_POSITION_SET),onChange:E().func,onChangeWithDateFirst:E().bool,weekStartsOn:E().number,disabledDate:E().func,timePickerOpts:E().object,showClear:E().bool,onOpenChange:E().func,open:E().bool,defaultOpen:E().bool,motion:E().oneOfType([E().bool,E().func,E().object]),className:E().string,prefixCls:E().string,prefix:E().node,insetLabel:E().node,insetLabelId:E().string,zIndex:E().number,position:E().oneOf(mn.POSITION_SET),getPopupContainer:E().func,onCancel:E().func,onConfirm:E().func,needConfirm:E().bool,inputStyle:E().object,timeZone:E().oneOfType([E().string,E().number]),triggerRender:E().func,stopPropagation:E().oneOfType([E().bool,E().string]),autoAdjustOverflow:E().bool,onBlur:E().func,onFocus:E().func,onClear:E().func,style:E().object,autoFocus:E().bool,inputReadOnly:E().bool,validateStatus:E().oneOf(Wf.STATUS),renderDate:E().func,renderFullDate:E().func,spacing:E().oneOfType([E().number,E().object]),startDateOffset:E().func,endDateOffset:E().func,autoSwitchDate:E().bool,dropdownClassName:E().string,dropdownStyle:E().object,dropdownMargin:E().oneOfType([E().number,E().object]),topSlot:E().node,bottomSlot:E().node,dateFnsLocale:E().object,syncSwitchMonth:E().bool,onPanelChange:E().func,rangeSeparator:E().string,rangeSeparatorNode:E().node,preventScroll:E().bool,yearAndMonthOpts:E().object,onClickOutSide:E().func},vb.__SemiComponentName__="DatePicker",vb.defaultProps=he(vb.__SemiComponentName__,{onChangeWithDateFirst:!0,borderless:!1,autoAdjustOverflow:!0,stopPropagation:!0,motion:!0,prefixCls:Kf.PREFIX,presetPosition:"bottom",zIndex:gn.DEFAULT_Z_INDEX,type:"date",size:"default",density:"default",multiple:!1,defaultOpen:!1,disabledHours:i(),disabledMinutes:i(),disabledSeconds:i(),hideDisabledOptions:!1,onBlur:i(),onFocus:i(),onClear:i(),onCancel:i(),onConfirm:i(),onChange:i(),onOpenChange:i(),onPanelChange:i(),onPresetClick:i(),weekStartsOn:Gf.WEEK_START_ON,disabledDate:Zf(),disabledTime:Zf(),inputReadOnly:!1,spacing:Gf.SPACING,autoSwitchDate:!0,syncSwitchMonth:!1,rangeSeparator:Wf.DEFAULT_SEPARATOR_RANGE,insetInput:!1,onClickOutSide:i()});const bb=Hf(h().forwardRef(((e,t)=>{const n=Object.assign({},e),{type:r,format:i,rangeSeparator:s}=n;return"string"==typeof i&&i&&(/[Hhms]+/.test(i)||("dateTime"===r?n.type="date":"dateTimeRange"===r&&(n.type="dateRange"))),s&&"string"==typeof s&&(n.rangeSeparator=` ${s.trim()} `),n.insetInput&&(n.position||(n.position=Wf.POSITION_INLINE_INPUT),n.position.includes("Over")&&!n.spacing&&(n.spacing=Gf.SPACING_INSET_INPUT)),h().createElement(lt.Consumer,null,(e=>{let{timeZone:r}=e;return h().createElement(Jt,{componentName:"DatePicker"},((e,i,s)=>h().createElement(vb,Object.assign({timeZone:r,localeCode:i,locale:e,dateFnsLocale:s},n,{ref:t}))))}))})),vb);var wb=__webpack_require__("Kkar"),xb=__webpack_require__.n(wb);const Eb={PREFIX:`${C}-descriptions`},Cb=["left","justify","plain","center"],Sb=["small","medium","large"],_b=["horizontal","vertical"];__webpack_require__("Q1hM");const kb=h().createContext(null);var Ob=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Tb=Eb.PREFIX,Pb=`${Tb}-key`,Ib=`${Tb}-value`;class Mb extends d.PureComponent{render(){const e=this.props,{itemKey:t,hidden:n,className:r,span:i,style:s,children:o,keyStyle:a}=e,l=Ob(e,["itemKey","hidden","className","span","style","children","keyStyle"]),{align:c,layout:d}=this.context;if(n)return null;const p=h().createElement("td",{className:`${Tb}-item`,colSpan:i||1},h().createElement("span",{className:Pb,style:a},t,":"),h().createElement("span",{className:Ib},"function"==typeof o?o():o)),f=h().createElement(h().Fragment,null,h().createElement("th",{className:`${Tb}-item ${Tb}-item-th`},h().createElement("span",{className:Pb,style:a},t)),h().createElement("td",{className:`${Tb}-item ${Tb}-item-td`,colSpan:i?2*i-1:1},h().createElement("span",{className:Ib},"function"==typeof o?o():o))),m="plain"===c?h().createElement("tr",Object.assign({className:r,style:s},u(l)),p):h().createElement("tr",Object.assign({className:r,style:s},u(l)),f);return"horizontal"===d?"plain"===c?p:f:m}}Mb.propTypes={itemKey:E().node,hidden:E().bool,className:E().string,style:E().object,keyStyle:E().object},Mb.contextType=kb;class Rb extends c{constructor(e){super(Object.assign({},e))}getHorizontalList(){const{column:e,data:t,children:n}=this.getProps(),r=this._adapter.getColumns().filter((e=>!e.hidden)),i=[],s={totalSpan:0,itemList:[]};for(const t of r)s.totalSpan+=t.span||1,s.itemList.push(t),s.totalSpan>=e&&(i.push(s.itemList),s.itemList=[],s.totalSpan=0);if(0!=s.itemList.length){const t=s.itemList[s.itemList.length-1];if(isNaN(t.span)){let n=0;s.itemList.forEach((e=>n+=isNaN(e.span)?1:e.span)),n<e&&(t.span=e-n+1)}i.push(s.itemList)}return i}}var Ab=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Nb=Eb.PREFIX;class Db extends f{constructor(e){super(e),this.renderChildrenList=()=>{const e=this.props,{layout:t,data:n,children:r}=e;if("horizontal"===t){return this.foundation.getHorizontalList().map(((e,t)=>h().createElement("tr",{key:t},e.map(((e,n)=>xb()(e)?h().createElement(Mb,Object.assign({itemKey:e.key},e,{key:t+"-"+n}),e.value):null)))))}return n&&n.length?n.map(((e,t)=>xb()(e)?h().createElement(Mb,Object.assign({itemKey:e.key},e,{key:t}),e.value):null)):r},this.foundation=new Rb(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{getColumns:()=>{var e,t;return(null===(e=this.props.data)||void 0===e?void 0:e.length)?this.props.data:this.props.children?null===(t=h().Children.toArray(this.props.children))||void 0===t?void 0:t.map((e=>(0,d.isValidElement)(e)?Object.assign({value:e.props.children},e.props):[])):[]}})}render(){const e=this.props,{align:t,row:n,size:r,className:i,style:s,children:o,data:a,layout:l}=e,c=Ab(e,["align","row","size","className","style","children","data","layout"]),d=w()(Nb,i,{[`${Nb}-${t}`]:!n,[`${Nb}-double`]:n,[`${Nb}-double-${r}`]:n,[`${Nb}-horizontal`]:"horizontal"===l,[`${Nb}-vertical`]:"vertical"===l});return h().createElement("div",Object.assign({className:d,style:s},u(c)),h().createElement("table",null,h().createElement("tbody",null,h().createElement(kb.Provider,{value:{align:t,layout:l}},this.renderChildrenList()))))}}Db.Item=Mb,Db.contextType=kb,Db.propTypes={align:E().oneOf(Cb),row:E().bool,size:E().oneOf(Sb),style:E().object,className:E().string,data:E().arrayOf(E().shape({key:E().node,value:E().oneOfType([E().node,E().func]),hidden:E().bool,className:E().string,style:E().object,span:E().number,keyStyle:E().object})),layout:E().oneOf(_b),column:E().number},Db.defaultProps={align:"center",row:!1,size:"medium",data:[],layout:"vertical",column:3};const Lb=Db,Fb={PREFIX:`${C}`};__webpack_require__("Sr6T");var jb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const $b=Fb.PREFIX,Bb=e=>{const{layout:t="horizontal",dashed:n,align:r="center",className:i,margin:s,style:o,children:a}=e,l=jb(e,["layout","dashed","align","className","margin","style","children"]),c=w()(`${$b}-divider`,i,{[`${$b}-divider-horizontal`]:"horizontal"===t,[`${$b}-divider-vertical`]:"vertical"===t,[`${$b}-divider-dashed`]:!!n,[`${$b}-divider-with-text`]:a&&"horizontal"===t,[`${$b}-divider-with-text-${r}`]:a&&"horizontal"===t});let d={};return void 0!==s&&("vertical"===t?d={marginLeft:s,marginRight:s}:"horizontal"===t&&(d={marginTop:s,marginBottom:s})),h().createElement("div",Object.assign({},l,{className:c,style:Object.assign(Object.assign({},d),o)}),a&&"horizontal"===t?"string"==typeof a?h().createElement("span",{className:`${$b}-divider_inner-text`,"x-semi-prop":"children"},a):a:null)},Vb={PREFIX:`${C}-empty`};__webpack_require__("e3UD");var zb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Hb=Vb.PREFIX;class Ub extends f{constructor(e){super(e),this.observe=e=>{for(const t of e)"attributes"===t.type&&"theme-mode"===t.attributeName&&this.updateMode()},this.updateMode=()=>{const e=this.body.getAttribute("theme-mode");e!==this.state.mode&&this.setState({mode:e})},this.state={mode:null}}componentDidMount(){if(this.props.darkModeImage){this.body=window.document.body,this.updateMode();const e={attributes:!0,childList:!1,subtree:!1};this.observer=new MutationObserver(this.observe),this.observer.observe(this.body,e)}}componentWillUnmount(){this.observer&&this.observer.disconnect()}render(){const e=this.props,{className:t,image:n,description:r,style:i,title:s,imageStyle:o,children:a,layout:l,darkModeImage:c}=e,d=zb(e,["className","image","description","style","title","imageStyle","children","layout","darkModeImage"]),u="string"==typeof r?r:"empty",p="dark"===this.state.mode&&c?c:n;let f=null;f="string"==typeof p?h().createElement("img",{alt:u,src:p}):p&&"id"in p?h().createElement("svg",{"aria-hidden":"true"},h().createElement("use",{xlinkHref:`#${p.id}`})):p;const m=w()(t,Hb,{[`${Hb}-${l}`]:l}),g=f?{heading:4}:{heading:6,style:{fontWeight:400}};return h().createElement("div",Object.assign({className:m,style:i},this.getDataAttr(d)),h().createElement("div",{className:`${Hb}-image`,style:o,"x-semi-prop":"image,darkModeImage"},f),h().createElement("div",{className:`${Hb}-content`},s?h().createElement(Un.Title,Object.assign({},g,{className:`${Hb}-title`,"x-semi-prop":"title"}),s):null,r?h().createElement("div",{className:`${Hb}-description`,"x-semi-prop":"description"},r):null,a?h().createElement("div",{className:`${Hb}-footer`,"x-semi-prop":"children"},a):null))}}Ub.defaultProps={layout:"vertical"};__webpack_require__("hKJu");const Kb=`${C}-modal`,Wb=["small","medium","large","full-width"],Gb=["ltr","rtl"];function qb(e){return null!==(t=e)&&"object"==typeof t&&"function"==typeof e.then;var t}class Xb extends c{constructor(e){super(Object.assign({},e)),this._debouncedOk=v()((e=>{this._invokeOk(e)}),100,{leading:!0,trailing:!1}),this._debouncedCancel=v()((e=>{this._invokeCancel(e)}),100,{leading:!0,trailing:!1}),this._lastCancelTarget=null,this._lastOkTarget=null,this.toggleDisplayNone=(e,t)=>{this._adapter.toggleDisplayNone(e,t)}}destroy(){this._debouncedOk.cancel(),this._debouncedCancel.cancel(),this.afterHide()}handleCancel(e){var t,n;const r=null!==(n=null!==(t=null==e?void 0:e.currentTarget)&&void 0!==t?t:null==e?void 0:e.target)&&void 0!==n?n:null;r!==this._lastCancelTarget&&this._debouncedCancel.cancel(),this._lastCancelTarget=r,this._debouncedCancel(e)}handleOk(e){var t,n;const r=null!==(n=null!==(t=null==e?void 0:e.currentTarget)&&void 0!==t?t:null==e?void 0:e.target)&&void 0!==n?n:null;r!==this._lastOkTarget&&this._debouncedOk.cancel(),this._lastOkTarget=r,this._debouncedOk(e)}_invokeCancel(e){var t;const n=this._adapter.notifyCancel(e);qb(n)&&(this._adapter.setState({onCancelReturnPromiseStatus:"pending"}),null===(t=null==n?void 0:n.then((()=>{this._adapter.setState({onCancelReturnPromiseStatus:"fulfilled"})})))||void 0===t||t.catch((e=>{throw this._adapter.setState({onCancelReturnPromiseStatus:"rejected"}),e})))}_invokeOk(e){var t;const n=this._adapter.notifyOk(e);qb(n)&&(this._adapter.setState({onOKReturnPromiseStatus:"pending"}),null===(t=null==n?void 0:n.then((()=>{this._adapter.setState({onOKReturnPromiseStatus:"fulfilled"})})))||void 0===t||t.catch((e=>{throw this._adapter.setState({onOKReturnPromiseStatus:"rejected"}),e})))}beforeShow(){this._adapter.disabledBodyScroll()}afterHide(){this._adapter.enabledBodyScroll(),this._adapter.notifyClose()}enabledBodyScroll(){this._adapter.enabledBodyScroll()}}class Yb extends c{constructor(e){super(Object.assign(Object.assign({},Yb.defaultAdapter),e)),this.handleKeyDown=e=>{const{closeOnEsc:t}=this.getProps();if(t&&e.keyCode===cn.ESC)return e.stopPropagation(),void this.close(e)}}destroy(){this.handleKeyDownEventListenerUnmount(),this.modalDialogBlur(),this.prevFocusElementReFocus()}handleDialogMouseDown(){this._adapter.notifyDialogMouseDown()}handleMaskMouseUp(){this._adapter.notifyDialogMouseUp()}handleKeyDownEventListenerMount(){this._adapter.addKeyDownEventListener()}handleKeyDownEventListenerUnmount(){this._adapter.removeKeyDownEventListener()}getMouseState(){this._adapter.getMouseState()}handleMaskClick(e){const{dialogMouseDown:t}=this.getStates();e.target!==e.currentTarget||t||this.close(e)}close(e){this._adapter.notifyClose(e)}modalDialogFocus(){this._adapter.modalDialogFocus()}modalDialogBlur(){this._adapter.modalDialogBlur()}prevFocusElementReFocus(){this._adapter.prevFocusElementReFocus()}}var Zb=__webpack_require__("uUTq"),Jb=__webpack_require__.n(Zb);class Qb{constructor(e,t){var n;this.addFocusRedirectListener=e=>(this.focusRedirectListenerList.push(e),()=>this.removeFocusRedirectListener(e)),this.removeFocusRedirectListener=e=>{this.focusRedirectListenerList=Jb()(this.focusRedirectListenerList,e)},this.destroy=()=>{var e;null===(e=this.container)||void 0===e||e.removeEventListener("keydown",this.onKeyPress)},this.shouldFocusRedirect=e=>{if(!this.enable)return!1;for(const t of this.focusRedirectListenerList){if(!t(e))return!1}return!0},this.focusElement=(e,t)=>{const{preventScroll:n}=this.options;null==e||e.focus({preventScroll:n}),t.preventDefault()},this.onKeyPress=e=>{if(e&&"Tab"===e.key){const t=Qb.getFocusableElements(this.container);t.length&&(e.shiftKey?this.handleContainerShiftTabKeyDown(t,e):this.handleContainerTabKeyDown(t,e))}},this.handleContainerTabKeyDown=(e,t)=>{const n=Qb.getActiveElement(),r=e[e.length-1]===n,i=e[0];r&&this.shouldFocusRedirect(i)&&this.focusElement(i,t)},this.handleContainerShiftTabKeyDown=(e,t)=>{const n=Qb.getActiveElement(),r=e[0]===n,i=e[e.length-1];r&&this.shouldFocusRedirect(i)&&this.focusElement(i,t)},Object.freeze(t),this.container=e,this.options=t,this.enable=null===(n=null==t?void 0:t.enable)||void 0===n||n,this.focusRedirectListenerList=(null==t?void 0:t.onFocusRedirectListener)?Array.isArray(t.onFocusRedirectListener)?[...t.onFocusRedirectListener]:[t.onFocusRedirectListener]:[],this.container.addEventListener("keydown",this.onKeyPress)}get enable(){return this._enable}set enable(e){this._enable=e}static getFocusableElements(e){if(!ee(e))return[];const t=["input:not([disabled]):not([tabindex='-1'])","textarea:not([disabled]):not([tabindex='-1'])","button:not([disabled]):not([tabindex='-1'])","a[href]:not([tabindex='-1'])","select:not([disabled]):not([tabindex='-1'])","area[href]:not([tabindex='-1'])","iframe:not([tabindex='-1'])","object:not([tabindex='-1'])","*[tabindex]:not([tabindex='-1'])","*[contenteditable]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(t))}static getActiveElement(){return document?document.activeElement:null}}const ew=Qb;var tw=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let nw=0;class rw extends f{constructor(e){super(e),this.onKeyDown=e=>{this.foundation.handleKeyDown(e)},this.onDialogMouseDown=()=>{this.foundation.handleDialogMouseDown()},this.onMaskMouseUp=()=>{this.foundation.handleMaskMouseUp()},this.onMaskClick=e=>{this.foundation.handleMaskClick(e)},this.close=e=>{this.foundation.close(e)},this.getMaskElement=()=>{const e=tw(this.props,[]),{mask:t,maskClassName:n}=e;if(t){const t=w()(`${Kb}-mask`,{});return h().createElement("div",Object.assign({key:"mask"},this.props.maskExtraProps,{className:w()(t,n),style:e.maskStyle}))}return null},this.renderCloseBtn=()=>{const{closable:e,closeIcon:t}=this.props;let n;if(e){const e=t||h().createElement(Ji,{"x-semi-prop":"closeIcon"});n=h().createElement(ji,{"aria-label":"close",className:`${Kb}-close`,key:"close-btn",onClick:this.close,type:"tertiary",icon:e,theme:"borderless",size:"small"})}return n},this.renderIcon=()=>{const{icon:e}=this.props;return e?h().createElement("span",{className:`${Kb}-icon-wrapper`,"x-semi-prop":"icon"},e):null},this.renderHeader=()=>{if("header"in this.props)return this.props.header;const{title:e}=this.props,t=this.renderCloseBtn(),n=this.renderIcon();return null==e?null:h().createElement("div",{className:`${Kb}-header`},n,h().createElement(Un.Title,{heading:5,className:`${Kb}-title`,id:`${Kb}-title`,"x-semi-prop":"title"},e),t)},this.renderBody=()=>{const{bodyStyle:e,children:t,title:n}=this.props,r=w()(`${Kb}-body`,{[`${Kb}-withIcon`]:this.props.icon}),i=this.renderCloseBtn(),s=this.renderIcon();return null!=n||"header"in this.props?h().createElement("div",{className:r,id:`${Kb}-body`,style:e,"x-semi-prop":"children"},t):h().createElement("div",{className:`${Kb}-body-wrapper`},s,h().createElement("div",{className:r,style:e,"x-semi-prop":"children"},t),i)},this.getDialogElement=()=>{const e=tw(this.props,[]),t={},n=w()(`${Kb}`,{[`${Kb}-centered`]:e.centered,[`${Kb}-${e.size}`]:e.size});e.width&&(t.width=e.width),e.height&&(t.height=e.height),e.isFullScreen&&(t.width="100%",t.height="100%",t.margin="unset");const r=this.renderBody(),i=this.renderHeader(),s=e.footer?h().createElement("div",{className:`${Kb}-footer`,"x-semi-prop":"footer"},e.footer):null,a=h().createElement("div",{role:"dialog",ref:this.modalDialogRef,"aria-modal":"true","aria-labelledby":`${Kb}-title`,"aria-describedby":`${Kb}-body`,onAnimationEnd:e.onAnimationEnd,className:w()([`${Kb}-content`,e.contentClassName,{[`${Kb}-content-fullScreen`]:e.isFullScreen,[`${Kb}-content-height-set`]:e.height||o()(e.style,"height")}])},i,r,s);return h().createElement("div",{key:"dialog-element",className:n,onMouseDown:this.onDialogMouseDown,style:Object.assign(Object.assign({},e.style),t),id:this.dialogId},(null==e?void 0:e.modalRender)?null==e?void 0:e.modalRender(a):a)},this.state={dialogMouseDown:!1,prevFocusElement:ew.getActiveElement()},this.foundation=new Yb(this.adapter),this.dialogId="dialog-"+nw++,this.modalDialogRef=h().createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyClose:e=>{this.props.onClose(e)},notifyDialogMouseDown:()=>{this.setState({dialogMouseDown:!0})},notifyDialogMouseUp:()=>{this.state.dialogMouseDown&&(this.timeoutId=setTimeout((()=>{this.setState({dialogMouseDown:!1})}),0))},addKeyDownEventListener:()=>{this.props.closeOnEsc&&document.addEventListener("keydown",this.foundation.handleKeyDown)},removeKeyDownEventListener:()=>{this.props.closeOnEsc&&document.removeEventListener("keydown",this.foundation.handleKeyDown)},getMouseState:()=>this.state.dialogMouseDown,modalDialogFocus:()=>{var e,t,n;const{preventScroll:r}=this.props;let i;if(this.modalDialogRef){const t=ew.getActiveElement();i=this.modalDialogRef.current.contains(t),null===(e=this.focusTrapHandle)||void 0===e||e.destroy(),this.focusTrapHandle=new ew(this.modalDialogRef.current,{preventScroll:r})}i||null===(n=null===(t=this.modalDialogRef)||void 0===t?void 0:t.current)||void 0===n||n.focus({preventScroll:r})},modalDialogBlur:()=>{var e,t;null===(e=this.modalDialogRef)||void 0===e||e.current.blur(),null===(t=this.focusTrapHandle)||void 0===t||t.destroy()},prevFocusElementReFocus:()=>{const{prevFocusElement:e}=this.state,{preventScroll:t}=this.props,n=o()(e,"focus");ye()(n)&&e.focus({preventScroll:t})}})}componentDidMount(){var e;this.foundation.handleKeyDownEventListenerMount(),this.foundation.modalDialogFocus();const t=ew.getFocusableElements(this.modalDialogRef.current);this.modalDialogRef.current.contains(document.activeElement)||null===(e=t[0])||void 0===e||e.focus()}componentWillUnmount(){clearTimeout(this.timeoutId),this.foundation.destroy()}render(){var e;const t=this.props,{maskClosable:n,className:r,getPopupContainer:i,maskFixed:s,getContainerContext:o}=t,a=tw(t,["maskClosable","className","getPopupContainer","maskFixed","getContainerContext"]),{direction:l}=this.context,c=w()(r,{[`${Kb}-popup`]:i&&i()!==(null===(e=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===e?void 0:e.body)&&!s,[`${Kb}-fixed`]:s,[`${Kb}-rtl`]:"rtl"===l}),d=o(),u=this.getDataAttr(a),p=h().createElement("div",Object.assign({className:c},u),this.getMaskElement(),h().createElement("div",Object.assign({role:"none",className:w()({[`${Kb}-wrap`]:!0,[`${Kb}-wrap-center`]:this.props.centered}),onClick:n?this.onMaskClick:null,onMouseUp:n?this.onMaskMouseUp:null},this.props.contentExtraProps),this.getDialogElement()));return d&&d.Provider?h().createElement(d.Provider,{value:d.value},p):p}}rw.contextType=lt,rw.propTypes={close:E().func,getContainerContext:E().func,contentClassName:E().string,maskClassName:E().string,onAnimationEnd:E().func,preventScroll:E().bool},rw.defaultProps={close:i(),getContainerContext:i(),contentClassName:"",maskClassName:""};var iw=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const sw=e=>{const[t,n]=(0,d.useState)(!0),[r,i]=(0,d.useState)(),[s,o]=(0,d.useState)(),{direction:a}=e,{title:l,content:c,icon:u,type:p,onCancel:f,onOk:m,className:g}=e,y=iw(e,["title","content","icon","type","onCancel","onOk","className"]),v=(0,d.useCallback)((e=>{const t=m&&m(e);t&&t.then?(i(!0),t.then((function(){n(!1),i(!1)}),(e=>{i(!1)}))):n(!1)}),[m]),b=(0,d.useCallback)((e=>{const t=f&&f(e);t&&t.then?(o(!0),t.then((function(){n(!1),o(!1)}),(e=>{o(!1)}))):n(!1)}),[f]),x=`${Kb}-confirm`,E=w()(g,x,{[`${x}-rtl`]:"rtl"===a}),C=w()(`${Kb}-${p}`),S=oe(u)?h().cloneElement(u,{className:`${x}-icon ${C}-icon`,size:"extra-large"}):u,_=null==l?null:h().createElement("span",{className:`${x}-title-text`},l),k=w()(`${x}-content`,{[`${x}-content-withIcon`]:e.icon});return h().createElement(ww,Object.assign({className:E,title:_,confirmLoading:r,cancelLoading:s,onOk:v,onCancel:b,icon:S,visible:t},y),h().createElement("div",{className:k,"x-semi-prop":"content"},c))};const ow=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm-.17-8.4c-.86 0-1.3-.53-1.3-1.23 0-1.05.53-1.72 1.74-2.64l.06-.05c.83-.62 1.4-1.06 1.4-1.85 0-.9-.83-1.4-1.76-1.4-.76 0-1.34.28-1.8.87-.33.34-.6.53-1.05.53C8.38 8.83 8 8.3 8 7.7c0-.6.34-1.22.88-1.68A5.15 5.15 0 0 1 12.28 5c2.71 0 4.62 1.34 4.62 3.64 0 1.68-1 2.5-2.2 3.31-.8.59-1.17.93-1.48 1.62-.33.6-.58 1.04-1.4 1.04Zm-.02 4.17c-.94 0-1.71-.6-1.71-1.54 0-.94.77-1.55 1.7-1.55.95 0 1.7.6 1.7 1.55 0 .93-.75 1.54-1.7 1.54Z",fill:"currentColor"}))}),"help_circle");function aw(e){const t=document.createElement("div");document.body.appendChild(t);let n=Object.assign({},e);const r=()=>{st(t),t.parentNode&&t.parentNode.removeChild(t);for(let e=0;e<vw.length;e++){if(vw[e]===s){vw.splice(e,1);break}}};function i(n){const{afterClose:i}=n;it(h().createElement(sw,Object.assign({},n,{afterClose:()=>{null==i||i(),r()},motion:e.motion})),t)}function s(){n=Object.assign(Object.assign({},n),{visible:!1}),i(n)}return i(n),vw.push(s),{destroy:s,update:function(e){n=Object.assign(Object.assign({},n),e),i(n)}}}function lw(e){return Object.assign({type:"info",icon:h().createElement(ts,null)},e)}function cw(e){return Object.assign({type:"success",icon:h().createElement(es,null)},e)}function dw(e){return Object.assign({type:"warning",icon:h().createElement(Qi,null)},e)}function hw(e){return Object.assign({type:"error",icon:h().createElement(ns,null),okButtonProps:Object.assign({type:"danger"},e.okButtonProps)},W()(e,["okButtonProps"]))}function uw(e){return Object.assign({type:"confirm",icon:h().createElement(ow,null)},e)}var pw=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const fw=(e,t)=>{var{afterClose:n,config:r}=e;pw(e,["afterClose","config"]);const[i,s]=h().useState(r);h().useImperativeHandle(t,(()=>({destroy:()=>{s((e=>Object.assign(Object.assign({},e),{visible:!1})))},update:e=>{s((t=>Object.assign(Object.assign({},t),e)))}})));return h().createElement(sw,Object.assign({},i,{afterClose:()=>{var e;null===(e=null==r?void 0:r.afterClose)||void 0===e||e.call(r),n()}}))},mw=h().forwardRef(fw);let gw=0;var yw=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let vw=[];class bw extends f{constructor(e){super(e),this.bodyOverflow=null,this.handleCancel=e=>{this.foundation.handleCancel(e)},this.handleOk=e=>{this.foundation.handleOk(e)},this.updateState=()=>{const{visible:e}=this.props;this.foundation.toggleDisplayNone(!e)},this.renderFooter=()=>{const{okText:e,okType:t,cancelText:n,confirmLoading:r,cancelLoading:i,hasCancel:s,footerFill:o}=this.props,a=e=>{var t;return s?h().createElement(vs,Object.assign({"aria-label":"cancel",onClick:this.handleCancel,loading:void 0===i?"pending"===this.state.onCancelReturnPromiseStatus:i,type:"tertiary",block:o,autoFocus:!0},this.props.cancelButtonProps,{style:Object.assign(Object.assign({},o?{marginLeft:"unset"}:{}),null===(t=this.props.cancelButtonProps)||void 0===t?void 0:t.style),"x-semi-children-alias":"cancelText"}),n||e.cancel):null};return h().createElement(Jt,{componentName:"Modal"},((n,i)=>h().createElement("div",{className:w()({[`${Kb}-footerfill`]:o})},a(n),h().createElement(vs,Object.assign({"aria-label":"confirm",type:t,theme:"solid",block:o,loading:void 0===r?"pending"===this.state.onOKReturnPromiseStatus:r,onClick:this.handleOk},this.props.okButtonProps,{"x-semi-children-alias":"okText"}),e||n.confirm))))},this.renderDialog=()=>{var e;let t=this.props,{footer:n,className:r,motion:i,maskStyle:s,keepDOM:o,style:a,zIndex:l,getPopupContainer:c,visible:d,modalContentClass:u}=t,p=yw(t,["footer","className","motion","maskStyle","keepDOM","style","zIndex","getPopupContainer","visible","modalContentClass"]),f=a;const m=s,g="footer"in this.props?n:this.renderFooter();let y={zIndex:l};c&&c()!==(null===(e=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===e?void 0:e.body)&&(y={zIndex:l,position:"static"});const v=w()(r,{[`${Kb}-displayNone`]:o&&this.state.displayNone}),b=this.props.visible||this.props.keepDOM&&(!this.props.lazyRender||this._haveRendered)||this.props.motion&&!this.state.displayNone;return b&&(this._haveRendered=!0),h().createElement(vt,{motion:this.props.motion,animationState:d?"enter":"leave",startClassName:d?`${Kb}-content-animate-show`:`${Kb}-content-animate-hide`,onAnimationEnd:()=>{this.updateState()}},(e=>{let{animationClassName:t,animationEventsNeedBind:n}=e;return h().createElement(vt,{motion:this.props.motion,animationState:d?"enter":"leave",startClassName:d?`${Kb}-mask-animate-show`:`${Kb}-mask-animate-hide`,onAnimationEnd:()=>{this.updateState()}},(e=>{let{animationClassName:r,animationEventsNeedBind:i}=e;return b?h().createElement(ht,{style:y,getPopupContainer:c}," ",h().createElement(rw,Object.assign({},p,{contentExtraProps:n,maskExtraProps:i,isFullScreen:this.state.isFullScreen,contentClassName:`${t} ${u}`,maskClassName:r,className:v,getPopupContainer:c,maskStyle:m,style:f,ref:this.modalRef,footer:g,onClose:this.handleCancel}))):h().createElement(h().Fragment,null)}))}))},this.state={displayNone:!e.visible,isFullScreen:e.fullScreen},this.foundation=new Xb(this.adapter),this.modalRef=h().createRef(),this.scrollBarWidth=0,this.originBodyWidth="100%"}get adapter(){return Object.assign(Object.assign({},super.adapter),{getProps:()=>this.props,disabledBodyScroll:()=>{var e;const{getPopupContainer:t}=this.props;this.bodyOverflow=document.body.style.overflow||"",t&&t()!==(null===(e=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===e?void 0:e.body)||"hidden"===this.bodyOverflow||(document.body.style.overflow="hidden",document.body.style.width=`calc(${this.originBodyWidth||"100%"} - ${this.scrollBarWidth}px)`)},enabledBodyScroll:()=>{var e;const{getPopupContainer:t}=this.props;t&&t()!==(null===(e=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===e?void 0:e.body)||null===this.bodyOverflow||"hidden"===this.bodyOverflow||(document.body.style.overflow=this.bodyOverflow,document.body.style.width=this.originBodyWidth)},notifyCancel:e=>this.props.onCancel(e),notifyOk:e=>this.props.onOk(e),notifyClose:()=>{this.props.afterClose()},toggleDisplayNone:(e,t)=>{e!==this.state.displayNone&&this.setState({displayNone:e},t||i())},notifyFullScreen:e=>{e!==this.state.isFullScreen&&this.setState({isFullScreen:e})}})}static getDerivedStateFromProps(e,t){const n={};return e.fullScreen!==t.isFullScreen&&(n.isFullScreen=e.fullScreen),e.visible&&t.displayNone&&(n.displayNone=!1),n}componentDidMount(){this.scrollBarWidth=de(),this.originBodyWidth=document.body.style.width,this.props.visible&&this.foundation.beforeShow()}componentDidUpdate(e,t,n){!e.visible&&this.props.visible&&this.foundation.beforeShow(),!t.displayNone&&this.state.displayNone&&this.foundation.afterHide()}componentWillUnmount(){this.props.visible?this.foundation.destroy():this.foundation.enabledBodyScroll()}render(){const{visible:e,keepDOM:t,lazyRender:n}=this.props;return this.renderDialog()}}bw.propTypes={mask:E().bool,closable:E().bool,centered:E().bool,visible:E().bool,width:E().oneOfType([E().string,E().number]),height:E().oneOfType([E().string,E().number]),confirmLoading:E().bool,cancelLoading:E().bool,okText:E().string,okType:E().string,cancelText:E().string,maskClosable:E().bool,onCancel:E().func,onOk:E().func,modalRender:E().func,afterClose:E().func,okButtonProps:E().object,cancelButtonProps:E().object,style:E().object,className:E().string,maskStyle:E().object,bodyStyle:E().object,zIndex:E().number,title:E().node,icon:E().node,header:E().node,footer:E().node,hasCancel:E().bool,motion:E().bool,children:E().node,getPopupContainer:E().func,getContainerContext:E().func,maskFixed:E().bool,closeIcon:E().node,closeOnEsc:E().bool,size:E().oneOf(Wb),keepDOM:E().bool,lazyRender:E().bool,direction:E().oneOf(Gb),fullScreen:E().bool,footerFill:E().bool},bw.__SemiComponentName__="Modal",bw.defaultProps=he(bw.__SemiComponentName__,{zIndex:1e3,motion:!0,mask:!0,centered:!1,closable:!0,visible:!1,okType:"primary",maskClosable:!0,hasCancel:!0,onCancel:i(),onOk:i(),afterClose:i(),maskFixed:!1,closeOnEsc:!0,size:"small",keepDOM:!1,lazyRender:!0,fullScreen:!1}),bw.useModal=function(){const[e,t]=function(){const[e,t]=h().useState([]);return[e,function(e){return t((t=>[...t,e])),()=>{t((t=>t.filter((t=>t!==e))))}}]}();function n(e){return function(n){gw+=1;const r=h().createRef();let i;const s=h().createElement(mw,{key:`semi-modal-${gw}`,config:e(n),ref:r,afterClose:()=>{i()}});return i=t(s),{destroy:()=>{r.current&&r.current.destroy()},update:e=>{r.current&&r.current.update(e)}}}}return[{info:n(lw),success:n(cw),error:n(hw),warning:n(dw),confirm:n(uw)},h().createElement(h().Fragment,null,e)]},bw.info=function(e){return aw(lw(e))},bw.success=function(e){return aw(cw(e))},bw.error=function(e){return aw(hw(e))},bw.warning=function(e){return aw(dw(e))},bw.confirm=function(e){return aw(uw(e))},bw.destroyAll=function(){for(let e=0,t=vw.length;e<t;e++){const t=vw[e];t&&t()}vw=[]};const ww=bw,xw=ww,Ew={PREFIX:`${C}-dropdown`,SELECTED:`${C}-dropdown-item-selected`,DISABLED:`${C}-dropdown-item-disabled`},Cw={POSITION_SET:ze.POSITION_SET,TRIGGER_SET:["hover","focus","click","custom","contextMenu"],DEFAULT_LEAVE_DELAY:100,ITEM_TYPE:["primary","secondary","tertiary","warning","danger"]},Sw=4,_w=2;class kw extends c{handleVisibleChange(e){this._adapter.setPopVisible(e),this._adapter.notifyVisibleChange(e);const{trigger:t}=this.getProps();if(e&&"click"===t){const e=this._adapter.getPopupId();this.setFocusToFirstMenuItem(e)}}getMenuItemNodes(e){const t=document.getElementById(e);return t?Array.from(t.getElementsByTagName("li")).filter((e=>"false"===e.ariaDisabled)):null}setFocusToFirstMenuItem(e){const t=this.getMenuItemNodes(e);var n;t&&((n=t).length>0&&Fe(n,n[0]))}setFocusToLastMenuItem(e){const t=this.getMenuItemNodes(e);var n;t&&((n=t).length>0&&Fe(n,n[n.length-1]))}handleKeyDown(e){var t,n;const r=null===(n=null===(t=e.target)||void 0===t?void 0:t.attributes["data-popupid"])||void 0===n?void 0:n.value,{visible:i}=this._adapter.getStates();switch(e.key){case" ":case"Enter":e.target.click();break;case"ArrowDown":this.setFocusToFirstMenuItem(r),i&&Le(e);break;case"ArrowUp":this.setFocusToLastMenuItem(r),i&&Le(e)}}}class Ow extends c{constructor(){super(...arguments),this.menuItemNodes=null,this.firstChars=[]}handleEscape(e){if("custom"===this._adapter.getContext("trigger")){const t=e&&function(e,t){for(let n=0;n<e.length;n++){const r=e[n].attributes["data-popupid"];if(r&&r.value===t)return e[n]}return null}(document.querySelectorAll("[data-popupid]"),e.id);t.focus()}}setFocusByFirstCharacter(e,t){const n=function(e,t,n,r){let i,s;return!e||!n||!r||r.length>1?-1:(r=r.toLowerCase(),i=e.indexOf(t)+1,i>=e.length&&(i=0),s=n.indexOf(r,i),-1===s&&(s=n.indexOf(r,0)),s>=0?s:-1)}(this.menuItemNodes,e,this.firstChars,t);n>=0&&Fe(this.menuItemNodes,this.menuItemNodes[n])}onMenuKeydown(e){const t=function(e,t){if(!e)return null;for(;e.parentElement&&o()(e.parentElement,"attributes.role.value","")!==t;)e=e.parentElement;return e.parentElement}(e.target,"tooltip");this.menuItemNodes||(this.menuItemNodes=[...e.target.parentNode.getElementsByTagName("li")].filter((e=>"true"!==e.ariaDisabled))),0===this.firstChars.length&&this.menuItemNodes.forEach((e=>{var t;this.firstChars.push(null===(t=e.textContent.trim()[0])||void 0===t?void 0:t.toLowerCase())}));const n=this.menuItemNodes.find((e=>0===e.tabIndex));switch(e.key){case" ":case"Enter":e.target.click();break;case"Escape":this.handleEscape(t);break;case"ArrowUp":!function(e,t){let n,r;e.length>0&&(t===e[0]?n=e[e.length-1]:(r=e.indexOf(t),n=e[r-1]),Fe(e,n))}(this.menuItemNodes,n),Le(e);break;case"ArrowDown":!function(e,t){let n,r;e.length>0&&(t===e[e.length-1]?n=e[0]:(r=e.indexOf(t),n=e[r+1]),Fe(e,n))}(this.menuItemNodes,n),Le(e);break;default:(function(e){return 1===e.length&&e.match(/\S/)})(e.key)&&this.setFocusByFirstCharacter(n,e.key)}}}const Tw=h().createContext({level:0});var Pw=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Iw=Ew.PREFIX;class Mw extends f{constructor(e){super(e),this.foundation=new Ow(this.adapter)}get adapter(){return Object.assign({},super.adapter)}render(){const e=this.props,{children:t,className:n,style:r}=e,i=Pw(e,["children","className","style"]);return h().createElement("ul",Object.assign({role:"menu","aria-orientation":"vertical"},i,{className:w()(`${Iw}-menu`,n),style:r,onKeyDown:e=>this.foundation.onMenuKeydown(e)}),t)}}Mw.propTypes={children:E().node,className:E().string,style:E().object},Mw.contextType=Tw;const Rw=Mw,Aw=Ew.PREFIX;class Nw extends f{render(){const{children:e,disabled:t,className:n,forwardRef:r,style:i,type:s,active:o,icon:a,onKeyDown:l,showTick:c,hover:d,innerRef:u}=this.props,{showTick:p}=this.context,f=null!=p?p:c,m=w()(n,{[`${Aw}-item`]:!0,[`${Aw}-item-disabled`]:t,[`${Aw}-item-hover`]:d,[`${Aw}-item-withTick`]:f,[`${Aw}-item-${s}`]:s,[`${Aw}-item-active`]:o}),g={};t||["onClick","onMouseEnter","onMouseLeave","onContextMenu"].forEach((e=>{1!==this.context.level&&"onClick"===e?g.onMouseDown=t=>{var n,r;0===t.button&&(null===(r=(n=this.props)[e])||void 0===r||r.call(n,t))}:g[e]=this.props[e]}));let y=null;switch(!0){case f&&o:y=h().createElement(sn,null);break;case f&&!o:y=h().createElement(sn,{style:{color:"transparent"}});break;default:y=null}let v=null;return a&&(v=h().createElement("div",{className:`${Aw}-item-icon`},a)),h().createElement("li",Object.assign({role:"menuitem",tabIndex:-1,"aria-disabled":t},g,{onKeyDown:l,ref:e=>{r(e),"function"==typeof u?u(e):u&&"object"==typeof u&&(u.current=e)},className:m,style:i},this.getDataAttr(this.props)),y,v,e)}}Nw.propTypes={children:E().oneOfType([E().string,E().node]),name:E().string,disabled:E().bool,selected:E().bool,onClick:E().func,onMouseEnter:E().func,onMouseLeave:E().func,onContextMenu:E().func,className:E().string,style:E().object,forwardRef:E().func,type:E().oneOf(Cw.ITEM_TYPE),active:E().bool,icon:E().node},Nw.contextType=Tw,Nw.defaultProps={disabled:!1,divided:!1,selected:!1,onMouseEnter:i(),onMouseLeave:i(),forwardRef:i()};const Dw=h().forwardRef(((e,t)=>h().createElement(Nw,Object.assign({},e,{innerRef:t}))));Dw.elementType="Dropdown.Item";const Lw=Dw,Fw=Ew.PREFIX,jw=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{style:t,className:n}=e;return h().createElement("div",{className:w()(`${Fw}-divider`,n),style:t})},$w=Ew.PREFIX;class Bw extends d.PureComponent{render(){const{className:e,style:t,children:n}=this.props,{showTick:r}=this.context,i=w()({[`${$w}-title`]:!0,[`${$w}-title-withTick`]:r},e);return h().createElement("div",{className:i,style:t},n)}}Bw.propTypes={children:E().node,className:E().string,style:E().object},Bw.contextType=Tw;const Vw=Bw;__webpack_require__("J057");var zw=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Hw=Cw.POSITION_SET,Uw=Cw.TRIGGER_SET;class Kw extends f{constructor(e){super(e),this.handleVisibleChange=e=>this.foundation.handleVisibleChange(e),this.state={popVisible:e.visible},this.foundation=new kw(this.adapter),this.tooltipRef=h().createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{setPopVisible:e=>this.setState({popVisible:e}),notifyVisibleChange:e=>{var t,n;return null===(n=(t=this.props).onVisibleChange)||void 0===n?void 0:n.call(t,e)},getPopupId:()=>this.tooltipRef.current.getPopupId()})}renderContent(){const{render:e,menu:t,contentClassName:n,style:r,showTick:i,prefixCls:s,trigger:o}=this.props,a=w()(s,n),{level:l=0}=this.context,c={showTick:i,level:l+1,trigger:o};let d=null;return h().isValidElement(e)?d=e:Array.isArray(t)&&(d=this.renderMenu()),h().createElement(Tw.Provider,{value:c},h().createElement("div",{className:a,style:r},h().createElement("div",{className:`${s}-content`,"x-semi-prop":"render"},d)))}renderMenu(){const{menu:e}=this.props,t=e.map(((e,t)=>{switch(e.node){case"title":{const{name:n,node:r}=e,i=zw(e,["name","node"]);return h().createElement(Kw.Title,Object.assign({},i,{key:r+n+t}),n)}case"item":{const{node:n,name:r}=e,i=zw(e,["node","name"]);return h().createElement(Kw.Item,Object.assign({},i,{key:n+r+t}),r)}case"divider":return h().createElement(Kw.Divider,{key:e.node+t});default:return null}}));return h().createElement(Kw.Menu,null,t)}renderPopCard(){const{render:e,contentClassName:t,style:n,showTick:r,prefixCls:i}=this.props,s=w()(i,t),{level:o=0}=this.context,a={showTick:r,level:o+1};return h().createElement(Tw.Provider,{value:a},h().createElement("div",{className:s,style:n},h().createElement("div",{className:`${i}-content`},e)))}render(){const e=this.props,{children:t,position:n,trigger:r,onVisibleChange:i,zIndex:s,className:a,motion:l,margin:c,style:d,prefixCls:u}=e,p=zw(e,["children","position","trigger","onVisibleChange","zIndex","className","motion","margin","style","prefixCls"]);let{spacing:f}=this.props;const{level:m}=this.context,{popVisible:g}=this.state,y=this.renderContent();return m>0?f="number"==typeof f?f:_w:null==f&&(f=Sw),h().createElement(_t,Object.assign({zIndex:s,motion:l,margin:c,content:y,className:a,prefixCls:u,spacing:f,position:n,trigger:r,onVisibleChange:this.handleVisibleChange,showArrow:!1,returnFocusOnClose:!0,ref:this.tooltipRef},p),h().isValidElement(t)?h().cloneElement(t,{className:w()(o()(t,"props.className"),{[`${u}-showing`]:g}),"aria-haspopup":!0,"aria-expanded":g,onKeyDown:e=>{this.foundation.handleKeyDown(e);const n=o()(t,"props.onKeyDown");n&&n(e)}}):t)}}Kw.Menu=Rw,Kw.Item=Lw,Kw.Divider=jw,Kw.Title=Vw,Kw.contextType=Tw,Kw.propTypes={children:E().node,contentClassName:E().oneOfType([E().string,E().array]),className:E().string,getPopupContainer:E().func,margin:E().oneOfType([E().number,E().object]),mouseEnterDelay:E().number,mouseLeaveDelay:E().number,menu:E().array,motion:E().oneOfType([E().bool,E().func,E().object]),onVisibleChange:E().func,prefixCls:E().string,position:E().oneOf(Hw),rePosKey:E().oneOfType([E().string,E().number]),render:E().node,spacing:E().oneOfType([E().number,E().object]),showTick:E().bool,style:E().object,trigger:E().oneOf(Uw),visible:E().bool,zIndex:E().number},Kw.__SemiComponentName__="Dropdown",Kw.defaultProps=he(Kw.__SemiComponentName__,{onVisibleChange:i(),prefixCls:Ew.PREFIX,zIndex:He.DEFAULT_Z_INDEX,motion:!0,trigger:"hover",position:"bottom",mouseLeaveDelay:Cw.DEFAULT_LEAVE_DELAY,showTick:!1,closeOnEsc:!0,onEscKeyDown:i()});const Ww=Kw,Gw={PREFIX:`${C}`};__webpack_require__("5ztO");var qw=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Xw=["xxl","xl","lg","md","sm","xs"],Yw=h().createContext(null),Zw={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"};class Jw extends h().Component{constructor(){super(...arguments),this.state={screens:{xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}},this.unRegisters=[]}componentDidMount(){this.unRegisters=Object.keys(Zw).map((e=>se(Zw[e],{match:()=>{"object"==typeof this.props.gutter&&this.setState((t=>({screens:Object.assign(Object.assign({},t.screens),{[e]:!0})})))},unmatch:()=>{"object"==typeof this.props.gutter&&this.setState((t=>({screens:Object.assign(Object.assign({},t.screens),{[e]:!1})})))}})))}componentWillUnmount(){this.unRegisters.forEach((e=>e()))}getGutter(){const{gutter:e=0}=this.props,t=[0,0];return(Array.isArray(e)?e.slice(0,2):[e,0]).forEach(((e,n)=>{if("object"==typeof e)for(let r=0;r<Xw.length;r++){const i=Xw[r];if(this.state.screens[i]&&void 0!==e[i]){t[n]=e[i];break}}else t[n]=e||0})),t}render(){const e=this.props,{prefixCls:t,type:n,justify:r,align:i,className:s,style:o,children:a}=e,l=qw(e,["prefixCls","type","justify","align","className","style","children"]),c=this.getGutter(),d=`${t}-row`,u=w()({[d]:"flex"!==n,[`${d}-${n}`]:n,[`${d}-${n}-${r}`]:n&&r,[`${d}-${n}-${i}`]:n&&i},s),p=Object.assign(Object.assign(Object.assign({},c[0]>0?{marginLeft:c[0]/-2,marginRight:c[0]/-2}:{}),c[1]>0?{marginTop:c[1]/-2,marginBottom:c[1]/-2}:{}),o),f=Object.assign({},l);return delete f.gutter,h().createElement(Yw.Provider,{value:{gutters:c}},h().createElement("div",Object.assign({},f,{className:u,style:p,"x-semi-prop":"children"}),a))}}Jw.propTypes={type:E().oneOf(["flex"]),align:E().oneOf(["top","middle","bottom"]),justify:E().oneOf(["start","end","center","space-around","space-between"]),className:E().string,style:E().object,children:E().node,gutter:E().oneOfType([E().object,E().number,E().array]),prefixCls:E().string},Jw.defaultProps={prefixCls:Gw.PREFIX},Jw.RowContext={gutters:E().any};const Qw=Jw;var ex=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const tx=E().oneOfType([E().object,E().number]);class nx extends h().Component{render(){const{props:e}=this,{prefixCls:t,span:n,order:r,offset:i,push:s,pull:o,className:a,children:l}=e,c=ex(e,["prefixCls","span","order","offset","push","pull","className","children"]);let d={};const u=`${t}-col`;["xs","sm","md","lg","xl","xxl"].forEach((t=>{let n={};"number"==typeof e[t]?n.span=e[t]:"object"==typeof e[t]&&(n=e[t]||{}),delete c[t],d=Object.assign(Object.assign({},d),{[`${u}-${t}-${n.span}`]:void 0!==n.span,[`${u}-${t}-order-${n.order}`]:n.order||0===n.order,[`${u}-${t}-offset-${n.offset}`]:n.offset||0===n.offset,[`${u}-${t}-push-${n.push}`]:n.push||0===n.push,[`${u}-${t}-pull-${n.pull}`]:n.pull||0===n.pull})}));const p=w()(u,{[`${u}-${n}`]:void 0!==n,[`${u}-order-${r}`]:r,[`${u}-offset-${i}`]:i,[`${u}-push-${s}`]:s,[`${u}-pull-${o}`]:o},a,d);let f,{style:m}=c;try{f=this.context.gutters}catch(e){throw new Error("please make sure <Col> inside <Row>")}return m=Object.assign(Object.assign(Object.assign({},f[0]>0?{paddingLeft:f[0]/2,paddingRight:f[0]/2}:{}),f[1]>0?{paddingTop:f[1]/2,paddingBottom:f[1]/2}:{}),m),h().createElement("div",Object.assign({},c,{style:m,className:p,"x-semi-prop":"children"}),l)}}nx.contextType=Yw,nx.propTypes={span:E().number,order:E().number,offset:E().number,push:E().number,pull:E().number,className:E().string,children:E().node,xs:tx,sm:tx,md:tx,lg:tx,xl:tx,xxl:tx,prefixCls:E().string},nx.defaultProps={prefixCls:Gw.PREFIX};const rx=nx,ix={PREFIX:`${C}-layout`};__webpack_require__("C+lc");const sx=h().createContext({siderHook:{addSider:Tt,removeSider:Tt}});var ox=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const ax={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},lx=(()=>{let e=0;return()=>(e+=1,`${ix.PREFIX}-sider-${e}`)})(),cx=["xs","sm","md","lg","xl","xxl"];class dx extends h().PureComponent{constructor(e){super(e),this.unRegisters=[],this.uniqueId="",this.uniqueId=lx()}componentDidMount(){const{breakpoint:e}=this.props,t=Object.keys(ax).filter((t=>e&&-1!==e.indexOf(t))).map((e=>se(ax[e],{match:()=>{this.responsiveHandler(e,!0)},unmatch:()=>{this.responsiveHandler(e,!1)}})));this.unRegisters=t,this.context.siderHook&&this.context.siderHook.addSider(this.uniqueId)}componentWillUnmount(){this.unRegisters.forEach((e=>e())),this.context.siderHook&&this.context.siderHook.removeSider(this.uniqueId)}responsiveHandler(e,t){const{onBreakpoint:n}=this.props;n&&n(e,t)}render(){const e=this.props,{prefixCls:t,className:n,children:r,style:i}=e,s=ox(e,["prefixCls","className","children","style"]),o=w()(n,{[`${t}-sider`]:!0});return h().createElement("aside",Object.assign({className:o,"aria-label":this.props["aria-label"],style:i},u(s)),h().createElement("div",{className:`${t}-sider-children`},r))}}dx.propTypes={prefixCls:E().string,style:E().object,className:E().string,breakpoint:E().arrayOf(E().oneOf(cx)),onBreakpoint:E().func,"aria-label":E().string,role:E().string},dx.defaultProps={prefixCls:ix.PREFIX},dx.contextType=sx,dx.elementType="Layout.Sider";const hx=dx;var ux=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const px={Header:"header",Footer:"footer",Content:"main",Layout:"section"};function fx(e){const t=px[e],n=e.toLowerCase();return e=>class extends h().PureComponent{render(){return h().createElement(e,Object.assign({role:this.props.role,"aria-label":this.props["aria-label"],type:n,tagName:t},this.props))}}}class mx extends h().PureComponent{render(){const e=this.props,{prefixCls:t,type:n,className:r,children:i,tagName:s}=e,o=ux(e,["prefixCls","type","className","children","tagName"]),a=w()(r,`${t}-${n}`);return h().createElement(s,Object.assign({className:a},o),i)}}mx.propTypes={prefixCls:E().string,style:E().object,className:E().string},mx.defaultProps={prefixCls:ix.PREFIX};const gx=fx("Header")(mx),yx=fx("Footer")(mx),vx=fx("Content")(mx);class bx extends h().Component{constructor(e){super(e),this.state={siders:[]}}getSiderHook(){return{addSider:e=>{this.setState((t=>({siders:[...t.siders,e]})))},removeSider:e=>{this.setState((t=>({siders:t.siders.filter((t=>t!==e))})))}}}render(){const e=this.props,{prefixCls:t,className:n,children:r,hasSider:i,tagName:s}=e,o=ux(e,["prefixCls","className","children","hasSider","tagName"]),{siders:a}=this.state,l=w()(n,t,{[`${t}-has-sider`]:"boolean"==typeof i&&i||a.length>0||h().Children.toArray(r).some((e=>h().isValidElement(e)&&e.type&&"Layout.Sider"===e.type.elementType))}),c=s;return h().createElement(sx.Provider,{value:{siderHook:this.getSiderHook()}},h().createElement(c,Object.assign({className:l},o),r))}}bx.propTypes={prefixCls:E().string,style:E().object,className:E().string},bx.defaultProps={prefixCls:ix.PREFIX,tagName:"section"},bx.Header=gx,bx.Footer=yx,bx.Content=vx,bx.Sider=hx;const wx={PREFIX:`${C}-list`},xx=["large","small","default"],Ex=["vertical","horizontal"],Cx=["flex-start","flex-end","center","baseline","stretch"];__webpack_require__("qgWt");const Sx=h().createContext(null);var _x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const kx=wx.PREFIX;class Ox extends d.PureComponent{wrapWithGrid(e){const{grid:t}=this.context,{gutter:n,justify:r,type:i,align:s}=t,o=_x(t,["gutter","justify","type","align"]);return h().createElement(rx,Object.assign({},o),e)}render(){const e=this.props,{header:t,main:n,className:r,style:i,extra:s,children:o,align:a,onClick:l,onRightClick:c,onMouseEnter:d,onMouseLeave:p}=e,f=_x(e,["header","main","className","style","extra","children","align","onClick","onRightClick","onMouseEnter","onMouseLeave"]),{onRightClick:m,onClick:g,grid:y}=this.context,v=c||m,b=l||g,x=w()(`${kx}-item`,r),E=w()(`${kx}-item-body`,{[`${kx}-item-body-${a}`]:a});let C;(t||n)&&(C=h().createElement("div",{className:E},t?h().createElement("div",{className:`${kx}-item-body-header`},t):null,n?h().createElement("div",{className:`${kx}-item-body-main`},n):null));let S=h().createElement("li",Object.assign({className:x,style:i,onClick:b,onContextMenu:v,onMouseEnter:d,onMouseLeave:p},u(f)),C||null,o,s?h().createElement("div",{className:`${kx}-item-extra`},s):null);return this.context&&y&&(S=this.wrapWithGrid(S)),S}}Ox.contextType=Sx,Ox.propTypes={extra:E().node,header:E().node,main:E().node,align:E().oneOf(Cx),className:E().string,children:E().node,style:E().object,onClick:E().func,onRightClick:E().func,onMouseEnter:E().func,onMouseLeave:E().func},Ox.defaultProps={align:"flex-start",onMouseEnter:i(),onMouseLeave:i()};var Tx=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Px=wx.PREFIX;class Ix extends f{constructor(){super(...arguments),this.renderEmpty=()=>{const{emptyContent:e}=this.props;return e?h().createElement("div",{className:`${wx.PREFIX}-empty`,"x-semi-prop":"emptyContent"},e):h().createElement(Jt,{componentName:"List"},(e=>h().createElement("div",{className:`${wx.PREFIX}-empty`},e.emptyText)))}}wrapChildren(e,t){const{grid:n}=this.props;if(n){const r={};return["align","gutter","justify","type"].forEach((e=>{e in n&&(r[e]=n[e])})),h().createElement(Qw,Object.assign({type:"flex"},r),e||null,t)}return h().createElement("ul",{className:`${Px}-items`},e||null,t)}render(){const e=this.props,{style:t,className:n,header:r,loading:i,onRightClick:s,onClick:o,footer:a,layout:l,grid:c,size:d,split:u,loadMore:p,bordered:f,dataSource:m,renderItem:g,children:y}=e,v=Tx(e,["style","className","header","loading","onRightClick","onClick","footer","layout","grid","size","split","loadMore","bordered","dataSource","renderItem","children"]),b=w()(Px,n,{[`${Px}-flex`]:"horizontal"===l,[`${Px}-${d}`]:d,[`${Px}-grid`]:c,[`${Px}-split`]:u,[`${Px}-bordered`]:f});let x;if(m&&m.length){x=[];const e=g?m.map(((e,t)=>g(e,t))):[];h().Children.forEach(e,((e,t)=>{const n=e.key||`list-item-${t}`;x.push(h().cloneElement(e,{key:n}))}))}else y||(x=this.renderEmpty());return h().createElement("div",Object.assign({className:b,style:t},this.getDataAttr(v)),r?h().createElement("div",{className:`${wx.PREFIX}-header`,"x-semi-prop":"header"},r):null,h().createElement(Sx.Provider,{value:{grid:c,onRightClick:s,onClick:o}},h().createElement(dr,{spinning:i,size:"large"},this.wrapChildren(x,y))),a?h().createElement("div",{className:`${wx.PREFIX}-footer`,"x-semi-prop":"footer"},a):null,p||null)}}Ix.Item=Ox,Ix.propTypes={style:E().object,className:E().string,bordered:E().bool,footer:E().node,header:E().node,layout:E().oneOf(Ex),size:E().oneOf(xx),split:E().bool,emptyContent:E().node,dataSource:E().array,renderItem:E().func,grid:E().object,loading:E().bool,loadMore:E().node,onRightClick:E().func,onClick:E().func},Ix.defaultProps={bordered:!1,split:!0,loading:!1,layout:"vertical",size:"default",onRightClick:i(),onClick:i()};const Mx=Ix,Rx=rn,Ax={PREFIX:`${C}-form`},Nx={LAYOUT:["horizontal","vertical"],LABEL_POS:["left","top","inset"],LABEL_ALIGN:["left","right"],EXTRA_POS:["middle","bottom"],DEFAULT_TRIGGER:"change"},Dx=Ax.PREFIX;class Lx extends d.PureComponent{render(){const{children:e,required:t,text:n,disabled:r,name:i,width:s,align:o,style:a,className:l,extra:c,id:d,optional:u}=this.props,p=w()(l,{[`${Dx}-field-label`]:!0,[`${Dx}-field-label-left`]:"left"===o,[`${Dx}-field-label-right`]:"right"===o,[`${Dx}-field-label-required`]:t,[`${Dx}-field-label-disabled`]:r,[`${Dx}-field-label-with-extra`]:c}),f=a||{};s&&(f.width=s);const m=h().createElement(Jt,{componentName:"Form"},(e=>h().createElement("span",{className:`${Dx}-field-label-optional-text`},e.optional))),g=h().createElement("div",{className:`${Dx}-field-label-text`,"x-semi-prop":"label"},void 0!==n?n:e,u?m:null),y=h().createElement(h().Fragment,null,g,h().createElement("div",{className:`${Dx}-field-label-extra`},c));return h().createElement("label",{className:p,htmlFor:i,style:f,id:d},c?y:g)}}Lx.defaultProps={required:!1,name:"",align:"left",className:"",optional:!1},Lx.propTypes={id:E().string,children:E().node,required:E().bool,text:E().node,disabled:E().bool,name:E().string,align:E().string,width:E().oneOfType([E().number,E().string]),style:E().object,className:E().string,extra:E().node,optional:E().bool};var Fx=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const jx=hr.PREFIX,$x=ur.SIZE;class Bx extends f{renderGroupWithLabel(e){const t=this.props,{size:n,className:r,label:i,labelPosition:s}=t,o=(Fx(t,["size","className","label","labelPosition"]),w()({[`${jx}-group-wrapper`]:!0,[`${jx}-group-wrapper-with-top-label`]:"top"===s,[`${jx}-group-wrapper-with-left-label`]:"left"===s})),a=w()(`${jx}-group`,r,{[`${jx}-${n}`]:"default"!==n}),l="input-group";return h().createElement("div",{className:o},i&&i.text?h().createElement(Lx,Object.assign({name:l},i)):null,h().createElement("span",{role:"group","aria-disabled":this.props.disabled,id:i&&i.name||l,className:a,style:this.props.style,onFocus:this.props.onFocus,onBlur:this.props.onBlur},e))}render(){const e=this.props,{size:t,style:n,className:r,children:i,label:s,onBlur:a,onFocus:l,disabled:c}=e,d=Fx(e,["size","style","className","children","label","onBlur","onFocus","disabled"]),u=w()(`${jx}-group`,{[`${jx}-${t}`]:"default"!==t},r);let p;return i&&(p=(Array.isArray(i)?i:[i]).map(((e,n)=>{if(e){const{onBlur:r,onFocus:i,disabled:s}=e.props,u=ye()(r)&&"noop"!==o()(r,"name")?r:a,p=ye()(i)&&"noop"!==o()(i,"name")?i:l,f="boolean"==typeof s?s:c;return h().cloneElement(e,Object.assign(Object.assign({key:n},d),{size:t,onBlur:u,onFocus:p,disabled:f}))}return null}))),s&&s.text?this.renderGroupWithLabel(p):h().createElement("span",{role:"group","aria-label":"Input group","aria-disabled":this.props.disabled,className:u,style:n,onFocus:this.props.onFocus,onBlur:this.props.onBlur},p)}}Bx.propTypes={className:E().string,children:E().node,size:E().oneOf($x),style:E().object,onBlur:E().func,onFocus:E().func,label:E().object,labelPosition:E().string},Bx.defaultProps={size:"default",className:"",onBlur:Tt,onFocus:Tt};let Vx=null;const zx={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},Hx=e=>{Object.keys(zx).forEach((t=>{e.style.setProperty(t,zx[t],"important")}))},Ux=(e,t)=>{const n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize};const Kx=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width"],Wx=e=>{const t=window.getComputedStyle(e);if(null===t)return null;const n=Gl()(t,Kx),{boxSizing:r}=n;if(""===r)return null;return{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}};class Gx extends c{static get textAreaDefaultAdapter(){return{notifyChange:i(),setValue:i(),toggleFocusing:i(),toggleHovering:i(),notifyFocus:i(),notifyBlur:i(),notifyKeyDown:i(),notifyEnterPress:i()}}constructor(e){super(Object.assign(Object.assign({},Gx.textAreaDefaultAdapter),e)),this.compositionEnter=!1,this._changeValue=(e,t)=>{this._isControlledComponent()||this._adapter.setValue(e),this._adapter.notifyChange(e,t)},this.getNextValue=e=>{const{maxLength:t,minLength:n,getValueLength:r}=this._adapter.getProps();return ye()(r)?t?this.handleVisibleMaxLength(e):(n&&this.handleVisibleMinLength(e),e):e},this.handleCompositionStart=e=>{this.compositionEnter=!0,this._adapter.notifyCompositionStart(e)},this.handleCompositionEnd=e=>{const{composition:t}=this._adapter.getProps(),n=e.target.value;if(this.compositionEnter=!1,this._adapter.notifyCompositionEnd(e),t){const t=this.getNextValue(n);return void this._changeValue(t,e)}const{getValueLength:r,maxLength:i,minLength:s}=this.getProps();if(ye()(r)){if(i){const t=this.handleVisibleMaxLength(n);t!==n&&this._changeValue(t,e)}s&&this.handleVisibleMinLength(n)}},this.handleCompositionUpdate=e=>{this._adapter.notifyCompositionUpdate(e)},this.resizeTextarea=()=>{var e;const{height:t}=this.getStates(),{rows:n,autosize:r}=this.getProps(),i=this._adapter.getRef(),s=Wx(i);if(!s)return;const[o,a]=null!==r&&"object"==typeof r?[null!==(e=null==r?void 0:r.minRows)&&void 0!==e?e:n,null==r?void 0:r.maxRows]:[n],l=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;Vx||(Vx=document.createElement("textarea"),Vx.setAttribute("tab-index","-1"),Vx.setAttribute("aria-hidden","true"),Hx(Vx)),null===Vx.parentNode&&document.body.appendChild(Vx);const{paddingSize:i,borderSize:s,sizingStyle:o}=e,{boxSizing:a}=o;Object.keys(o).forEach((e=>{Vx.style[e]=o[e]})),Hx(Vx),Vx.value=t;let l=Ux(Vx,e);Vx.value="x";const c=Ux(Vx,e)-i-s;let d=c*n;"border-box"===a&&(d=d+i+s),l=Math.max(d,l);let h=c*r;return"border-box"===a&&(h=h+i+s),l=Math.min(h,l),l}(s,i.value||i.placeholder||"x",o,a);return t!==l?(this._adapter.notifyHeightUpdate(l),void(i.style.height=`${l}px`)):void 0}}destroy(){}handleValueChange(e){this._adapter.setValue(e)}handleChange(e,t){const{composition:n}=this._adapter.getProps();let r=e;n&&this.compositionEnter?this._adapter.setValue(r):(this.compositionEnter||(r=this.getNextValue(r)),this._changeValue(r,t))}handleVisibleMinLength(e){const{minLength:t,getValueLength:n}=this._adapter.getProps(),{minLength:r}=this._adapter.getStates();if(er()(t)&&t>=0&&ye()(n)&&xe()(e)){const i=n(e);if(i<t){const n=e.length+(t-i);n!==r&&this._adapter.setMinLength(n)}else r!==t&&this._adapter.setMinLength(t)}}handleVisibleMaxLength(e){const{maxLength:t,getValueLength:n}=this._adapter.getProps();if(er()(t)&&t>=0&&xe()(e)){if(ye()(n)){if(n(e)>t){console.warn("[Semi TextArea] The input character is truncated because the input length exceeds the maximum length limit");return this.handleTruncateValue(e,t)}}else if(e.length>t)return console.warn("[Semi TextArea] The input character is truncated because the input length exceeds the maximum length limit"),e.slice(0,t);return e}}handleTruncateValue(e,t){const{getValueLength:n}=this._adapter.getProps();return pr({value:e,maxLength:t,getValueLength:n})}handleFocus(e){const{value:t}=this.getStates();this._adapter.toggleFocusing(!0),this._adapter.notifyFocus(t,e)}handleBlur(e){const{value:t}=this.getStates(),{maxLength:n}=this.getProps();let r=t;n&&(r=this.handleVisibleMaxLength(t),r!==t&&(this._isControlledComponent()||this._adapter.setValue(r),this._adapter.notifyChange(r,e))),this._adapter.toggleFocusing(!1),this._adapter.notifyBlur(r,e)}handleKeyDown(e){const{disabledEnterStartNewLine:t}=this.getProps();t&&"Enter"===e.key&&!e.shiftKey&&e.preventDefault(),this._adapter.notifyKeyDown(e),13===e.keyCode&&this._adapter.notifyPressEnter(e)}handleMouseEnter(e){this._adapter.toggleHovering(!0)}handleMouseLeave(e){this._adapter.toggleHovering(!1)}isAllowClear(){const{value:e,isFocus:t,isHover:n}=this._adapter.getStates(),{showClear:r,disabled:i,readonly:s}=this._adapter.getProps();return e&&r&&!i&&(t||n)&&!s}handleClear(e){const{isFocus:t}=this.getStates();this._isControlledComponent("value")?this._adapter.setState({isFocus:!1}):this._adapter.setState({value:"",isFocus:!1}),t&&this._adapter.notifyBlur("",e),this._adapter.notifyChange("",e),this._adapter.notifyClear(e),this.stopPropagation(e)}handleClick(e){const{disabled:t,readonly:n}=this._adapter.getProps(),{isFocus:r}=this._adapter.getStates();t||n||r||this._adapter.isEventTarget(e)&&(this._adapter.focusInput(),this._adapter.toggleFocusing(!0))}handleCounterClick(e){const{disabled:t,readonly:n}=this._adapter.getProps(),{isFocus:r}=this._adapter.getStates();t||n||r||(this._adapter.focusInput(),this._adapter.toggleFocusing(!0))}}__webpack_require__("Lmqm");var qx=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Xx=hr.PREFIX;class Yx extends f{constructor(e){super(e),this.handleNativeResize=e=>{var t,n;if(this.props.autosize)return;const r=e&&e[0],i=r&&r.contentRect;if(!i)return;const s=i.width,o=i.height;if(!this.nativeResizeObservedOnce)return this.nativeResizeObservedOnce=!0,void(this.lastNativeSize={width:s,height:o});const a=this.lastNativeSize;a&&a.width===s&&a.height===o||(this.lastNativeSize={width:s,height:o},null===(n=(t=this.props).onResize)||void 0===n||n.call(t,{height:o,width:s}))},this.handleClear=e=>{this.foundation.handleClear(e)},this.handleClick=e=>{this.foundation.handleClick(e)},this.handleCounterClick=e=>{this.foundation.handleCounterClick(e)},this.setRef=e=>{this.libRef.current=e;const{forwardRef:t}=this.props;"function"==typeof t?t(e):t&&"object"==typeof t&&(t.current=e)},this.handleTextAreaScroll=e=>{const{showLineNumber:t}=this.props;t&&this.lineNumberRef.current&&requestAnimationFrame((()=>{const t=this.lineNumberRef.current;t&&(t.scrollTop=e.target.scrollTop)}))},this.getTextareaLineHeightPx=e=>{const t=window.getComputedStyle(e),n=t.lineHeight,r=parseFloat(t.fontSize)||14;if(!n||"normal"===n)return 1.5*r;const i=parseFloat(n);return Number.isFinite(i)&&i>0?i:1.5*r},this.calculateWrappedLines=(e,t)=>{if(!e)return 1;const n=window.getComputedStyle(t),r=document.createElement("canvas").getContext("2d");if(!r)return 1;const i=n.fontSize,s=n.fontFamily;r.font=`${i} ${s}`;const o=parseFloat(n.paddingLeft)||0,a=parseFloat(n.paddingRight)||0,l=t.clientWidth-o-a;if(l<=0)return 1;const c=r.measureText(e).width,d=Math.ceil(c/l);return Math.max(1,d)};const t="value"in e?e.value:e.defaultValue;this.state={value:t,isFocus:!1,isHover:!1,height:0,minLength:e.minLength,cachedValue:e.value,textareaWidth:0,textareaHeight:0},this.focusing=!1,this.foundation=new Gx(this.adapter),this.lineNumberResizeObserver=null,this.libRef=h().createRef(),this.lineNumberRef=h().createRef(),this.throttledResizeTextarea=g()(this.foundation.resizeTextarea,10),this.throttledNotifyNativeResize=g()(this.handleNativeResize,10),this.nativeResizeObservedOnce=!1,this.lastNativeSize=null}get adapter(){return Object.assign(Object.assign({},super.adapter),{setValue:e=>this.setState({value:e},(()=>{this.props.autosize&&this.foundation.resizeTextarea()})),getRef:()=>this.libRef.current,toggleFocusing:e=>this.setState({isFocus:e}),toggleHovering:e=>this.setState({isHover:e}),notifyChange:(e,t)=>{this.props.onChange(e,t)},notifyClear:e=>this.props.onClear(e),notifyBlur:(e,t)=>this.props.onBlur(t),notifyFocus:(e,t)=>this.props.onFocus(t),notifyKeyDown:e=>{this.props.onKeyDown(e)},notifyHeightUpdate:e=>{this.setState({height:e}),this.props.onResize({height:e})},notifyPressEnter:e=>{this.props.onEnterPress&&this.props.onEnterPress(e)},notifyCompositionStart:e=>this.props.onCompositionStart(e),notifyCompositionEnd:e=>this.props.onCompositionEnd(e),notifyCompositionUpdate:e=>this.props.onCompositionUpdate(e),setMinLength:e=>this.setState({minLength:e}),focusInput:()=>{const e=this.libRef&&this.libRef.current;e&&e.focus()},isEventTarget:e=>e&&e.target===e.currentTarget})}static getDerivedStateFromProps(e,t){const n={};return e.value!==t.cachedValue&&(n.value=e.value,n.cachedValue=e.value),n}componentDidMount(){if(this.props.showLineNumber&&this.libRef.current&&void 0!==globalThis.ResizeObserver){const e=this.libRef.current;this.setState({textareaWidth:e.clientWidth,textareaHeight:e.clientHeight}),this.lineNumberResizeObserver=new globalThis.ResizeObserver((e=>{for(const t of e){const e=t.contentRect.width,n=t.contentRect.height;this.setState({textareaWidth:e,textareaHeight:n})}})),this.lineNumberResizeObserver.observe(e)}}componentWillUnmount(){var e,t,n,r;this.throttledResizeTextarea&&(null===(t=null===(e=this.throttledResizeTextarea)||void 0===e?void 0:e.cancel)||void 0===t||t.call(e),this.throttledResizeTextarea=null),this.throttledNotifyNativeResize&&(null===(r=null===(n=this.throttledNotifyNativeResize)||void 0===n?void 0:n.cancel)||void 0===r||r.call(n),this.throttledNotifyNativeResize=null),this.lineNumberResizeObserver&&(this.lineNumberResizeObserver.disconnect(),this.lineNumberResizeObserver=null)}componentDidUpdate(e,t){if(this.props.value===e.value&&this.props.placeholder===e.placeholder||!this.props.autosize||this.foundation.resizeTextarea(),this.props.showLineNumber!==e.showLineNumber)if(this.props.showLineNumber&&this.libRef.current&&void 0!==globalThis.ResizeObserver){const e=this.libRef.current;this.setState({textareaWidth:e.clientWidth,textareaHeight:e.clientHeight}),this.lineNumberResizeObserver||(this.lineNumberResizeObserver=new globalThis.ResizeObserver((e=>{for(const t of e){const e=t.contentRect.width,n=t.contentRect.height;this.setState({textareaWidth:e,textareaHeight:n})}}))),this.lineNumberResizeObserver.observe(e)}else this.lineNumberResizeObserver&&(this.lineNumberResizeObserver.disconnect(),this.lineNumberResizeObserver=null)}renderClearBtn(){const{showClear:e}=this.props,t=this.foundation.isAllowClear(),n=w()(`${Xx}-clearbtn`,{[`${Xx}-clearbtn-hidden`]:!t});return e?h().createElement("div",{className:n,onClick:this.handleClear},h().createElement(gr,null)):null}renderCounter(){let e,t,n,r;const{showCounter:i,maxCount:s,getValueLength:o}=this.props;if(i||s){const{value:i}=this.state;t=i?ye()(o)?o(i):i.length:0,n=s||null,r=w()(`${Xx}-textarea-counter`,{[`${Xx}-textarea-counter-exceed`]:t>n}),e=h().createElement("div",{className:r,onClick:this.handleCounterClick},t,n?"/":null,n)}else e=null;return e}renderLineNumbers(){const{showLineNumber:e,lineNumberStart:t=1,lineNumberClassName:n,lineNumberStyle:r}=this.props;if(!e)return null;const{value:i,textareaWidth:s,textareaHeight:o}=this.state,a=this.libRef.current,l=i?i.split("\n"):[""],c=w()(`${Xx}-textarea-lineNumber`,n),d=a?this.getTextareaLineHeightPx(a):21,u=Object.assign(Object.assign({},r||{}),{height:o?`${o}px`:void 0,maxHeight:o?`${o}px`:void 0});return h().createElement("div",{ref:this.lineNumberRef,className:c,style:u},l.map(((e,n)=>{const r=a?this.calculateWrappedLines(e,a):1;return h().createElement("div",{key:n,className:`${Xx}-textarea-lineNumber-item`,style:{minHeight:r*d+"px",lineHeight:`${d}px`}},t+n)})))}render(){const e=this.props,{autosize:t,placeholder:n,onEnterPress:r,onResize:i,resize:s,disabled:o,readonly:a,className:l,showCounter:c,validateStatus:d,maxCount:u,defaultValue:p,style:f,textareaStyle:m,forwardRef:g,getValueLength:y,maxLength:v,minLength:b,showClear:x,borderless:E,autoFocus:C,showLineNumber:S,lineNumberStart:_,lineNumberClassName:k,lineNumberStyle:O,composition:T}=e,P=qx(e,["autosize","placeholder","onEnterPress","onResize","resize","disabled","readonly","className","showCounter","validateStatus","maxCount","defaultValue","style","textareaStyle","forwardRef","getValueLength","maxLength","minLength","showClear","borderless","autoFocus","showLineNumber","lineNumberStart","lineNumberClassName","lineNumberStyle","composition"]),{isFocus:I,value:M,minLength:R}=this.state,A=!_e()(s),N=!t&&A&&["horizontal","both","inline"].includes(s),D=!t&&A&&["vertical","both","block"].includes(s),L=w()(l,`${Xx}-textarea-wrapper`,{[`${Xx}-textarea-borderless`]:E,[`${Xx}-textarea-wrapper-disabled`]:o,[`${Xx}-textarea-wrapper-readonly`]:a,[`${Xx}-textarea-wrapper-${d}`]:Boolean(d),[`${Xx}-textarea-wrapper-focus`]:I,[`${Xx}-textarea-wrapper-withLineNumber`]:S,[`${Xx}-textarea-wrapper-resizeX`]:N,[`${Xx}-textarea-wrapper-resizeY`]:D}),F=w()(`${Xx}-textarea`,{[`${Xx}-textarea-disabled`]:o,[`${Xx}-textarea-readonly`]:a,[`${Xx}-textarea-autosize`]:z()(t)?_e()(null==t?void 0:t.maxRows):t,[`${Xx}-textarea-showClear`]:x}),j=Object.assign({},m||{});t?j.resize="none":A&&(j.resize=s);const $=!t&&A&&s&&"none"!==s,B=Object.assign(Object.assign({},W()(P,"insetLabel","insetLabelId","getValueLength","onClear","showClear","disabledEnterStartNewLine","composition")),{style:j,autoFocus:C||this.props.autofocus,className:F,disabled:o,readOnly:a,placeholder:n||null,onChange:e=>this.foundation.handleChange(e.target.value,e),onFocus:e=>this.foundation.handleFocus(e),onBlur:e=>this.foundation.handleBlur(e.nativeEvent),onKeyDown:e=>this.foundation.handleKeyDown(e),onScroll:this.handleTextAreaScroll,value:null==M?"":M,onCompositionStart:this.foundation.handleCompositionStart,onCompositionEnd:this.foundation.handleCompositionEnd,onCompositionUpdate:this.foundation.handleCompositionUpdate});return ye()(y)||(B.maxLength=v),R&&(B.minLength=R),h().createElement("div",{className:L,style:f,onMouseEnter:e=>this.foundation.handleMouseEnter(e),onMouseLeave:e=>this.foundation.handleMouseLeave(e),onClick:e=>this.handleClick(e)},this.renderLineNumbers(),S?h().createElement("div",{className:`${Xx}-textarea-content`},t?h().createElement(Pn,{onResize:this.throttledResizeTextarea},h().createElement("textarea",Object.assign({},B,{ref:this.setRef}))):$?h().createElement(Pn,{onResize:this.throttledNotifyNativeResize},h().createElement("textarea",Object.assign({},B,{ref:this.setRef}))):h().createElement("textarea",Object.assign({},B,{ref:this.setRef}))):t?h().createElement(Pn,{onResize:this.throttledResizeTextarea},h().createElement("textarea",Object.assign({},B,{ref:this.setRef}))):$?h().createElement(Pn,{onResize:this.throttledNotifyNativeResize},h().createElement("textarea",Object.assign({},B,{ref:this.setRef}))):h().createElement("textarea",Object.assign({},B,{ref:this.setRef})),this.renderClearBtn(),this.renderCounter())}}Yx.propTypes={autosize:E().oneOfType([E().bool,E().object]),borderless:E().bool,placeholder:E().string,value:E().string,rows:E().number,cols:E().number,maxCount:E().number,onEnterPress:E().func,validateStatus:E().string,className:E().string,style:E().object,textareaStyle:E().object,showClear:E().bool,onClear:E().func,onResize:E().func,onCompositionStart:E().func,onCompositionEnd:E().func,onCompositionUpdate:E().func,getValueLength:E().func,disabledEnterStartNewLine:E().bool,composition:E().bool,showLineNumber:E().bool,lineNumberStart:E().number,lineNumberClassName:E().string,lineNumberStyle:E().object,resize:E().oneOf(["none","both","horizontal","vertical","block","inline"])},Yx.defaultProps={autosize:!1,borderless:!1,rows:4,cols:20,showCounter:!1,showClear:!1,onEnterPress:i(),onChange:i(),onBlur:i(),onFocus:i(),onKeyDown:i(),onResize:i(),onClear:i(),onCompositionStart:i(),onCompositionEnd:i(),onCompositionUpdate:i(),composition:!1,showLineNumber:!1,lineNumberStart:1};const Zx=h().forwardRef(((e,t)=>h().createElement(Yx,Object.assign({},e,{forwardRef:t})))),Jx=Zx;var Qx=__webpack_require__("DlqW"),eE=__webpack_require__.n(Qx);const tE=(e,t)=>{const{isNaN:n}=Number;return n(e)&&n(t)};var nE=__webpack_require__("dw5g"),rE=__webpack_require__.n(nE),iE=__webpack_require__("nvU9"),sE=__webpack_require__.n(iE);const oE=Object.assign({},hr),aE=Object.assign(Object.assign({},{}),{DEFAULT_STEP:1,DEFAULT_SHIFT_STEP:10,DEFAULT_PRESS_TIMEOUT:250,DEFAULT_PRESS_INTERVAL:0,MOUSE_BUTTON_LEFT:0}),lE=Object.assign({},ur);function cE(e,t){return function(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=Math.pow(10,Math.max(n,r));return Math.round(e*i+t*i)/i}(e,-t)}const dE=class extends c{constructor(){super(...arguments),this._decimalPointSymbol=void 0,this._currencySymbol=""}init(){this._isCurrency()&&this._setCurrencySymbol(),this._setInitValue()}destroy(){this._unregisterInterval(),this._unregisterTimer(),this._adapter.unregisterGlobalEvent("mouseup")}isControlled(){return this._isControlledComponent("value")}_isCurrency(){const{currency:e}=this.getProps();return!0===e||"string"==typeof e&&""!==e.trim()}_getFinalCurrency(){const{currency:e}=this.getProps();return!0===e?this.getProp("defaultCurrency"):e}_doInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e,i=e,s=!0;const o=this.isControlled();"number"!=typeof e&&(i=this.doParse(e,!1),s=!isNaN(i)),s&&(r=i,o||this._adapter.setNumber(i)),o||this._adapter.setValue(e,n),this.getProp("keepFocus")&&this._adapter.setFocusing(!0,(()=>{this._adapter.setClickUpOrDown(!0)})),this.notifyChange(r,t)}_registerInterval(e){const t=this.getProp("pressInterval")||aE.DEFAULT_PRESS_INTERVAL;this._intervalHasRegistered=!0,this._interval=setInterval((()=>{"function"==typeof e&&this._intervalHasRegistered&&e()}),t)}_unregisterInterval(){this._interval&&(this._intervalHasRegistered=!1,clearInterval(this._interval),this._interval=null)}_registerTimer(e){const t=this.getProp("pressTimeout")||aE.DEFAULT_PRESS_TIMEOUT;this._timerHasRegistered=!0,this._timer=setTimeout((()=>{this._timerHasRegistered&&"function"==typeof e&&e()}),t)}_unregisterTimer(){this._timer&&(this._timerHasRegistered=!1,clearTimeout(this._timer),this._timer=null)}_setCurrencySymbol(){const{localeCode:e,currencyDisplay:t}=this.getProps(),n=new Intl.NumberFormat(e,{style:"currency",currency:this._getFinalCurrency()||this.getCurrencyByLocaleCode(),currencyDisplay:t}).formatToParts(1234.5);for(const e of n)"decimal"===e.type&&(this._decimalPointSymbol=e.value),"currency"===e.type&&(this._currencySymbol=e.value)}handleInputFocus(e){const t=this.getState("value");if(""!==t&&this._isScientificNotation()&&!this._isCurrency()){const e=rE()(t);if(/e/i.test(e)&&/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)[eE][+-]?\d+$/.test(e.trim())){const t=this.doParse(e,!1,!1,!1);if(this.isValidNumber(t)){const e=this.doFormat(t,!0,!1);this._adapter.setValue(e)}}}this._adapter.recordCursorPosition(),this._adapter.setFocusing(!0,null),this._adapter.setClickUpOrDown(!1),this._adapter.notifyFocus(e)}handleInputChange(e,t){const n=this.doParse(e,!0,!0,!0),r=this.doParse(e,!1,!1,!1),i=this.afterParser(e);let s;this._adapter.recordCursorPosition();let o=r,a=e;if(""===e)this.isControlled()||(o=null);else if(this.isValidNumber(r)&&this.isValidNumber(n))s=r,a=this.doFormat(r,!1);else{if("number"!=typeof r||isNaN(r))a=this.doFormat(i,!1);else{a=this.doFormat(r,!1);const e=i.lastIndexOf("."),t=i.length-1-e,n=this._getPrecLen(r);if(n){if(n<t)for(let e=0;e<t-n;e++)a+="0"}else{a+=e>-1?i.slice(e):""}o=r}s=this.isControlled()?a:i}this.isControlled()||null!==o&&("number"!=typeof o||isNaN(o))||this._adapter.setNumber(o),this._adapter.setValue(this.isControlled()&&!this._isCurrency()?a:this.doFormat(i,!1),(()=>{this._adapter.restoreCursor()})),this.notifyChange(s,t)}handleInputKeyDown(e){const t=e.keyCode;if(t===cn.UP||t===cn.DOWN){this._adapter.setClickUpOrDown(!0),this._adapter.recordCursorPosition();const n=t===cn.UP?this.add(null,e):this.minus(null,e);this._doInput(n,e,(()=>{this._adapter.restoreCursor()})),e.preventDefault()}this._adapter.notifyKeyDown(e)}handleInputBlur(e){const t=rE()(this.getState("value"));let n=this.getState("number");if(null!=n||null!=t&&""!==t){const r=this.doParse(t,!1,!0,!0);let i,s,o=!1,a=!1;if(this.isValidNumber(r)&&n!==r&&(i=r,this.isControlled()||(n=i),o=!0),!this.isValidNumber(r)){const e=parseFloat(t);if(isNaN(e)){if("number"==typeof n&&!isNaN(n)){const e=this.fetchMinOrMax(n);e!==n&&(i=e,this.isControlled()||(n=i),o=!0)}}else{const t=this.fetchMinOrMax(e);t!==n&&(i=t,this.isControlled()||(n=i),o=!0)}}const l=this.doFormat(n,!0,!0);if(l!==t&&(s=l,a=!0),a||o){const t=null!=s?s:i;null!=s&&this._adapter.setValue(s),null!=i&&(this._isControlledComponent("value")||this._adapter.setNumber(i)),this.notifyChange(t,e)}}this._adapter.setFocusing(!1),this._adapter.notifyBlur(e)}handleInputMouseEnter(e){this._adapter.setHovering(!0)}handleInputMouseLeave(e){this._adapter.setHovering(!1)}handleInputMouseMove(e){this._adapter.setHovering(!0)}handleMouseUp(e){this._unregisterInterval(),this._unregisterTimer(),this._adapter.unregisterGlobalEvent("mouseup")}handleUpClick(e){const{readonly:t}=this.getProps();this._isMouseButtonLeft(e)&&!t&&(this._adapter.setClickUpOrDown(!0),e&&(this._persistEvent(e),e.stopPropagation(),this._preventDefault(e)),this.upClick(e),this._registerTimer((()=>{this._registerInterval((()=>{this.upClick(e)}))})))}handleDownClick(e){const{readonly:t}=this.getProps();this._isMouseButtonLeft(e)&&!t&&(this._adapter.setClickUpOrDown(!0),e&&(this._persistEvent(e),e.stopPropagation(),this._preventDefault(e)),this.downClick(e),this._registerTimer((()=>{this._registerInterval((()=>{this.downClick(e)}))})))}_isMouseButtonLeft(e){return o()(e,"button")===aE.MOUSE_BUTTON_LEFT}_preventDefault(e){const t=this._adapter.getProp("keepFocus"),n=this._adapter.getProp("innerButtons");(t||n)&&e.preventDefault()}handleMouseLeave(e){this._adapter.registerGlobalEvent("mouseup",(()=>{this.handleMouseUp(e)}))}upClick(e){const t=this.add(null,e);this._doInput(t,e),this._adapter.notifyUpClick(t,e)}downClick(e){const t=this.minus(null,e);this._doInput(t,e),this._adapter.notifyDownClick(t,e)}_setInitValue(){const{defaultValue:e,value:t}=this.getProps(),n=this._isControlledComponent("value")?t:e;let r=n;"number"!=typeof n||this._isCurrency()?this._isCurrency()||(r=rE()(n)):r=this.doFormat(n);const i=this.doParse(r,!1,!0,!0);let s=null;"number"!=typeof i||isNaN(i)||(s=i);const o="number"==typeof s?this.doFormat(s,!0,!0):"";this._adapter.setNumber(s),this._adapter.setValue(o),xe()(o)&&o!==String(null!=n?n:"")&&this.notifyChange(o,null)}add(e,t){const n=t&&t.shiftKey?this.getProp("shiftStep"):this.getProp("step");e=null==e?n:Number(e);const r=Math.abs(sE()(e)),i=this.getState("number");let s=this.toNumber(i)||0;const o=this.getProp("min"),a=this.getProp("max"),l=this._getPrecLen(o),c=this._getPrecLen(a),d=this._getPrecLen(s),h=this._getPrecLen(e),u=Math.pow(10,Math.max(l,c,d,h));return e<0?Math.abs(cE(o,s))>=r&&(s=Math.round(s*u+e*u)/u):e>0&&Math.abs(cE(a,s))>=r&&(s=Math.round(s*u+e*u)/u),"number"==typeof o&&o>s&&(s=o),"number"==typeof a&&a<s&&(s=a),this.doFormat(s,!0,this._isCurrency())}minus(e,t){const n=t&&t.shiftKey?this.getProp("shiftStep"):this.getProp("step");return e=null==e?n:Number(e),this.add(-e,t)}_getPrecLen(e){if("string"!=typeof e){const t=Number(e||"");if(!isFinite(t)||0===t)return 0;const n=Math.abs(t).toString();if(/e/i.test(n)){const[e,t]=n.split(/e/i),r=(e.split(".")[1]||"").length;return Math.max(0,r-parseInt(t,10))}e=n}const t=e.indexOf(".")+1;return t?e.length-t:0}_adjustPrec(e){const t=this.getProp("precision");return"number"!=typeof t||""===e||null===e||Number.isNaN(Number(e))||(e=Number(e).toFixed(t)),rE()(e)}formatCurrency(e){const{localeCode:t,minimumFractionDigits:n,precision:r,maximumFractionDigits:i,currencyDisplay:s,showCurrencySymbol:o}=this.getProps();let a=e;"string"==typeof e&&Number.isNaN(Number(e))&&(a=this.parseInternationalCurrency(e));const l=new Intl.NumberFormat(t,{style:"currency",currency:this._getFinalCurrency()||this.getCurrencyByLocaleCode(),currencyDisplay:s,minimumFractionDigits:n||r||void 0,maximumFractionDigits:i||r||void 0}).format(Number(a));return o?l:l.replace(this._currencySymbol,"").trim()}_isScientificNotation(){const{scientificNotation:e}=this.getProps();return!0===e||"object"==typeof e&&null!==e}_getScientificNotationThreshold(){const{scientificNotation:e}=this.getProps();if("object"==typeof e&&null!==e){const t=e.threshold;return"number"==typeof t&&Number.isFinite(t)&&t>=1?t:15}return 15}_toScientificNotation(e){const t=this._getScientificNotationThreshold(),n=Math.abs(e),r=String(n),i=/e/i.test(r),s=r.replace(/[.\-+eE]/g,"").replace(/^0+/,"");if((i||s.length>=t)&&0!==n){const n=Math.max(0,Math.min(100,Math.floor(t)-1));return e.toExponential(n).replace(/(\.\d*?)0+e/,"$1e").replace(/\.e/,"e")}return String(e)}doFormat(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{formatter:r}=this.getProps();let i;if(i=this._isCurrency()&&n?this.formatCurrency(e):t?this._adjustPrec(e):rE()(e),this._isScientificNotation()&&n&&!this._isCurrency()){const t="number"==typeof e?e:parseFloat(i);!isNaN(t)&&isFinite(t)&&(i=this._toScientificNotation(t))}return"function"==typeof r&&(i=r(i)),i}fetchMinOrMax(e){const{min:t,max:n}=this.getProps();return e<t?t:e>n?n:e}parseInternationalCurrency(e){let t=e.replace(this._currencySymbol,"").replace(new RegExp(`[^\\d${this._decimalPointSymbol}\\-]`,"g"),"");return this._decimalPointSymbol&&"."!==this._decimalPointSymbol&&(t=t.replace(this._decimalPointSymbol,".")),parseFloat(t)}doParse(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this._isCurrency()&&"string"==typeof e&&(e=this.parseInternationalCurrency(e)),"number"==typeof e)return r&&(e=this.fetchMinOrMax(e)),n&&(e=this._adjustPrec(e)),sE()(e);const i=this.getProp("parser");if("function"==typeof i){const t=i(e);e="number"==typeof t?rE()(t):t}if("string"==typeof e&&/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)[eE][+-]?\d+$/.test(e.trim())){const t=parseFloat(e.trim());if(!isNaN(t))return r?this.fetchMinOrMax(t):n?sE()(this._adjustPrec(t)):t}if(t&&"string"==typeof e){const t=-1===e.indexOf(".")||e.indexOf(".")>-1&&("0"===e||e.lastIndexOf("0")<e.length-1),n=e.lastIndexOf(".")<e.length-1&&e.split("").filter((e=>"."===e)).length<2;if(!t||!n)return NaN}return n&&(e=this._adjustPrec(e)),"string"==typeof e&&e.length?r?this.fetchMinOrMax(sE()(e)):sE()(e):NaN}afterParser(e){const t=this.getProp("parser");return"string"==typeof e&&"function"==typeof t?rE()(t(e)):rE()(e)}toNumber(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("number"==typeof e)return e;if("string"==typeof e){const{parser:n}=this.getProps();if(this._isCurrency()&&(e=this.parseInternationalCurrency(e)),"function"==typeof n){const t=n(e);e="number"==typeof t?rE()(t):t}t&&(e=this._adjustPrec(e))}return sE()(e)}isValidNumber(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("number"==typeof e&&!isNaN(e)){const{min:n,max:r,precision:i}=this.getProps(),s=this._getPrecLen(e);if(e>=n&&e<=r&&(!t||("number"==typeof i&&s<=i||"number"!=typeof i)))return!0}return!1}isValidString(e){if("string"==typeof e&&e.length){const t=this.doParse(e);return this.isValidNumber(t)}return!1}notifyChange(e,t){if(null==e||""===e)this._adapter.notifyChange("",t);else{const n=this.toNumber(e,!0);"number"!=typeof n||isNaN(n)?this._adapter.notifyChange(this.afterParser(e),t):(this._adapter.notifyChange(n,t),this.notifyNumberChange(n,t))}}notifyNumberChange(e,t){const{number:n}=this.getStates();this.isValidNumber(e)&&e!==n&&this._adapter.notifyNumberChange(e,t)}updateStates(e,t){this._adapter.updateStates(e,t)}getCurrencyByLocaleCode(){const{localeCode:e}=this.getProps(),t={"zh-CN":"CNY","zh-HK":"HKD","zh-TW":"TWD","ja-JP":"JPY","ko-KR":"KRW","th-TH":"THB","vi-VN":"VND","ms-MY":"MYR","id-ID":"IDR","hi-IN":"INR","ar-SA":"SAR","en-GB":"GBP","de-DE":"EUR","fr-FR":"EUR","it-IT":"EUR","es-ES":"EUR","pt-PT":"EUR","ru-RU":"RUB","en-US":"USD","en-CA":"CAD","es-MX":"MXN","pt-BR":"BRL","es-AR":"ARS","en-AU":"AUD","en-NZ":"NZD","en-ZA":"ZAR","ar-EG":"EGP"};if(t[e])return t[e];const n=e.split("-")[0],r={en:"USD",zh:"CNY",es:"EUR",fr:"EUR",de:"EUR",it:"EUR",ja:"JPY",ko:"KRW",ru:"RUB",ar:"SAR"};return r[n]?r[n]:"USD"}};__webpack_require__("EAsp");var hE=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class uE extends f{get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{setValue:(e,t)=>this.setState({value:e},t),setNumber:(e,t)=>this.setState({number:e},t),setFocusing:(e,t)=>this.setState({focusing:e},t),setHovering:e=>this.setState({hovering:e}),notifyChange:function(){return e.props.onChange(...arguments)},notifyNumberChange:function(){return e.props.onNumberChange(...arguments)},notifyBlur:e=>this.props.onBlur(e),notifyFocus:e=>this.props.onFocus(e),notifyUpClick:(e,t)=>this.props.onUpClick(e,t),notifyDownClick:(e,t)=>this.props.onDownClick(e,t),notifyKeyDown:e=>this.props.onKeyDown(e),registerGlobalEvent:(e,t)=>{e&&"function"==typeof t&&(this.adapter.unregisterGlobalEvent(e),this.adapter.setCache(e,t),document.addEventListener(e,t))},unregisterGlobalEvent:e=>{if(e){const t=this.adapter.getCache(e);document.removeEventListener(e,t),this.adapter.setCache(e,null)}},getInputCharacter:e=>this.inputNode.value[e],recordCursorPosition:()=>{try{this.inputNode&&(this.cursorStart=this.inputNode.selectionStart,this.cursorEnd=this.inputNode.selectionEnd,this.currentValue=this.inputNode.value,this.cursorBefore=this.inputNode.value.substring(0,this.cursorStart),this.cursorAfter=this.inputNode.value.substring(this.cursorEnd))}catch(e){console.warn(e)}},restoreByAfter:e=>{if(Re(e))return!1;const t=this.inputNode.value,n=t.lastIndexOf(e);return-1!==n&&(n+e.length===t.length&&(this.adapter.fixCaret(n,n),!0))},restoreCursor:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.cursorAfter;return!Re(t)&&Array.prototype.some.call(t,((n,r)=>{const i=t.substring(r);return e.adapter.restoreByAfter(i)}))},fixCaret:(e,t)=>{if(void 0!==e&&void 0!==t&&this.inputNode&&this.inputNode.value)try{const n=this.inputNode.selectionStart,r=this.inputNode.selectionEnd;e===n&&t===r||this.inputNode.setSelectionRange(e,t)}catch(e){}},setClickUpOrDown:e=>{this.clickUpOrDown=e},updateStates:(e,t)=>{this.setState(e,t)}})}constructor(e){super(e),this.setInputRef=e=>{const{forwardedRef:t}=this.props;this.inputNode=e,t&&"object"==typeof t?t.current=e:"function"==typeof t&&t(e)},this.handleInputFocus=e=>this.foundation.handleInputFocus(e),this.handleInputChange=(e,t)=>this.foundation.handleInputChange(e,t),this.handleInputBlur=e=>this.foundation.handleInputBlur(e),this.handleInputKeyDown=e=>this.foundation.handleInputKeyDown(e),this.handleInputMouseEnter=e=>this.foundation.handleInputMouseEnter(e),this.handleInputMouseLeave=e=>this.foundation.handleInputMouseLeave(e),this.handleInputMouseMove=e=>this.foundation.handleInputMouseMove(e),this.handleUpClick=e=>this.foundation.handleUpClick(e),this.handleDownClick=e=>this.foundation.handleDownClick(e),this.handleMouseUp=e=>this.foundation.handleMouseUp(e),this.handleMouseLeave=e=>this.foundation.handleMouseLeave(e),this.renderButtons=()=>{const{prefixCls:e,disabled:t,innerButtons:n,max:r,min:s}=this.props,{hovering:o,focusing:a,number:l}=this.state,c=t||l===r,d=t||l===s,u=w()(`${e}-number-suffix-btns`,{[`${e}-number-suffix-btns-inner`]:n,[`${e}-number-suffix-btns-inner-hover`]:n&&o&&!a}),p=w()(`${e}-number-button`,`${e}-number-button-up`,{[`${e}-number-button-up-disabled`]:t,[`${e}-number-button-up-not-allowed`]:c}),f=w()(`${e}-number-button`,`${e}-number-button-down`,{[`${e}-number-button-down-disabled`]:t,[`${e}-number-button-down-not-allowed`]:d});return h().createElement("div",{className:u},h().createElement("span",{className:p,onMouseDown:c?i():this.handleUpClick,onMouseUp:this.handleMouseUp,onMouseLeave:this.handleMouseLeave},h().createElement($i,{size:"extra-small"})),h().createElement("span",{className:f,onMouseDown:d?i():this.handleDownClick,onMouseUp:this.handleMouseUp,onMouseLeave:this.handleMouseLeave},h().createElement(Hc,{size:"extra-small"})))},this.renderSuffix=()=>{const{innerButtons:e,suffix:t}=this.props,{hovering:n,focusing:r}=this.state;if(e&&(n||r)){return this.renderButtons()}return t},this.foundation=new dE(this.adapter),this.inputNode=null,this.clickUpOrDown=!1;const t=this._getInitState(e);this.state={value:t.value,number:t.number,focusing:Boolean(e.autofocus)||!1,hovering:!1}}_getInitState(e){const t=this.isControlled("value")?e.value:e.defaultValue;if(Re(t)||""===t)return{value:"",number:null};if(!0===e.currency||"string"==typeof e.currency&&""!==e.currency.trim()){if("number"==typeof t){const e=this.foundation.doParse(t,!1,!0,!0);if(this.foundation.isValidNumber(e)){return{value:this.foundation.doFormat(e,!0,!1),number:e}}return{value:"",number:null}}return{value:String(t),number:null}}let n=t;"number"==typeof t&&(n=this.foundation.doFormat(t));const r=this.foundation.doParse(n,!1,!0,!0);if(this.foundation.isValidNumber(r)){return{value:this.foundation.doFormat(r,!0,!0),number:r}}return{value:"",number:null}}componentDidUpdate(e){const{value:t,preventScroll:n}=this.props,{focusing:r}=this.state;let i;if(t!==e.value&&!tE(t,e.value)){if(Re(t)||""===t)i="",this.foundation.updateStates({value:i,number:null});else{let e=t;"number"==typeof t&&(e=this.foundation.doFormat(t));const n=this.foundation.doParse(e,!1,!0,!0),s="number"==typeof t?t:this.foundation.doParse(e,!1,!1,!1);if(r)if(this.foundation.isValidNumber(n)&&n!==this.state.number){const e={number:n};this.clickUpOrDown&&(e.value=this.foundation.doFormat(e.number,!0),i=e.value),this.foundation.updateStates(e,(()=>this.adapter.restoreCursor()))}else eE()(s)?this.foundation.updateStates({value:e}):(i=this.foundation.doFormat(s,!1),this.foundation.updateStates({value:i}));else this.foundation.isValidNumber(n)?(i=this.foundation.doFormat(n,!0,!0),this.foundation.updateStates({number:n,value:i})):(i="",this.foundation.updateStates({number:null,value:i}))}if(i&&xe()(i)&&i!==String(this.props.value))if(this.foundation._isCurrency()){this.foundation.doParse(i)!==("string"==typeof this.props.value?this.foundation.doParse(this.props.value):this.props.value)&&this.foundation.notifyChange(i,null)}else this.foundation.notifyChange(i,null)}this.clickUpOrDown&&this.props.keepFocus&&this.state.focusing&&document.activeElement!==this.inputNode&&this.inputNode.focus({preventScroll:n})}render(){const e=this.props,{disabled:t,className:n,prefixCls:r,min:i,max:s,step:o,shiftStep:a,precision:l,formatter:c,parser:d,forwardedRef:u,onUpClick:p,onDownClick:f,pressInterval:m,pressTimeout:g,suffix:y,size:v,hideButtons:b,innerButtons:x,style:E,onNumberChange:C,keepFocus:S,defaultValue:_,defaultCurrency:k,currency:O,currencyDisplay:T,minimumFractionDigits:P,maximumFractionDigits:I,showCurrencySymbol:M,localeCode:R}=e,A=hE(e,["disabled","className","prefixCls","min","max","step","shiftStep","precision","formatter","parser","forwardedRef","onUpClick","onDownClick","pressInterval","pressTimeout","suffix","size","hideButtons","innerButtons","style","onNumberChange","keepFocus","defaultValue","defaultCurrency","currency","currencyDisplay","minimumFractionDigits","maximumFractionDigits","showCurrencySymbol","localeCode"]),{value:N,number:D}=this.state,L=w()(n,`${r}-number`,{[`${r}-number-size-${v}`]:v}),F=this.renderButtons(),j={"aria-disabled":t,step:o};D&&(j["aria-valuenow"]=D),s!==1/0&&(j["aria-valuemax"]=s),i!==-1/0&&(j["aria-valuemin"]=i);const $=h().createElement("div",{className:L,style:E,onMouseMove:e=>this.handleInputMouseMove(e),onMouseEnter:e=>this.handleInputMouseEnter(e),onMouseLeave:e=>this.handleInputMouseLeave(e)},h().createElement(kr,Object.assign({role:"spinbutton"},j,A,{size:v,disabled:t,ref:this.setInputRef,value:N,onFocus:this.handleInputFocus,onChange:this.handleInputChange,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,suffix:this.renderSuffix()})),b||x?null:F);return $}}uE.propTypes={"aria-label":E().string,"aria-labelledby":E().string,"aria-invalid":E().bool,"aria-errormessage":E().string,"aria-describedby":E().string,"aria-required":E().bool,autofocus:E().bool,clearIcon:E().node,className:E().string,defaultValue:E().oneOfType([E().number,E().string]),disabled:E().bool,formatter:E().func,forwardedRef:E().any,hideButtons:E().bool,innerButtons:E().bool,insetLabel:E().node,insetLabelId:E().string,keepFocus:E().bool,max:E().number,min:E().number,parser:E().func,precision:E().number,prefixCls:E().string,pressInterval:E().number,pressTimeout:E().number,preventScroll:E().bool,shiftStep:E().number,showCurrencySymbol:E().bool,step:E().number,style:E().object,suffix:E().any,value:E().oneOfType([E().number,E().string]),scientificNotation:E().oneOfType([E().bool,E().object]),onBlur:E().func,onChange:E().func,onDownClick:E().func,onKeyDown:E().func,onNumberChange:E().func,onUpClick:E().func},uE.defaultProps={forwardedRef:i(),innerButtons:!1,keepFocus:!1,max:1/0,min:-1/0,prefixCls:oE.PREFIX,pressInterval:aE.DEFAULT_PRESS_TIMEOUT,pressTimeout:aE.DEFAULT_PRESS_TIMEOUT,shiftStep:aE.DEFAULT_SHIFT_STEP,showCurrencySymbol:!0,size:lE.DEFAULT_SIZE,step:aE.DEFAULT_STEP,onBlur:i(),onChange:i(),onDownClick:i(),onFocus:i(),onKeyDown:i(),onNumberChange:i(),onUpClick:i()};const pE=Hf(h().forwardRef((function(e,t){return h().createElement(Jt,{componentName:"InputNumber"},((n,r,i,s)=>h().createElement(uE,Object.assign({localeCode:r,defaultCurrency:s},e,{forwardedRef:t}))))})),uE),fE="horizontal",mE="vertical",gE={PREFIX:`${C}-navigation`},yE={MODE:[mE,fE],MODE_VERTICAL:mE,MODE_HORIZONTAL:fE,ICON_POS_LEFT:"left",ICON_POS_RIGHT:"right",DEFAULT_LOGO_ICON_SIZE:"extra-large",TOGGLE_ICON_LEFT:"left",TOGGLE_ICON_RIGHT:"right"},vE=999,bE=0,wE=100,xE=0,EE=100,CE={open:"chevron_up",closed:"chevron_down"};class SE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=e&&"object"==typeof e||(e={text:e,itemKey:e,maxHeight:vE,link:null,items:null,icon:"",indent:!1});for(const t of Object.keys(e))this[t]=e[t];e.items&&Array.isArray(e.items)&&e.items.length?(this.items=e.items.map((e=>new SE(e))),this.toggleIcon="toggleIcon"in e&&SE.isValidToggleIcon(e.toggleIcon)?Object.assign({},e.toggleIcon):Object.assign({},CE)):this.items=null}static isValidToggleIcon(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.open&&e.open.length&&"string"==typeof e.closed&&e.closed.length)}}class _E extends c{constructor(e){super(Object.assign({},e))}static getZeroParentKeys(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];if(r.length)for(const n of r)if(Array.isArray(e[n])&&e[n].length){const r=e[n][0];Re(r)||t.push(r)}return t}static buildItemKeysMap(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"itemKey";var i;if(Array.isArray(e)&&e.length)for(const s of e)if(Array.isArray(s))_E.buildItemKeysMap(s,t,[...n],r);else{let e;if(s&&"object"==typeof s&&(e=s[r]||s.props&&s.props[r]),e){t[e]=[...n];const o=null===(i=s.props)||void 0===i?void 0:i.children;if(Array.isArray(s.items)&&s.items.length)_E.buildItemKeysMap(s.items,t,[...n,e],r);else if(o){const i=Array.isArray(o)?o:[o];_E.buildItemKeysMap(i,t,[...n,e],r)}}}return t}init(e){const{defaultSelectedKeys:t,selectedKeys:n}=this.getProps();let r=n||t||[];const{itemKeysMap:i,willOpenKeys:s,formattedItems:o}=this.getCalcState(),a=this.selectLevelZeroParentKeys(i,r);if(r=r.concat(a),"constructor"===e)return{selectedKeys:r,itemKeysMap:i,openKeys:s,items:o};this._adapter.updateSelectedKeys(r,!1),this._adapter.setItemKeysMap(i),this._adapter.updateOpenKeys(s),this._adapter.updateItems(o),this._adapter.setItemsChanged(!0)}getCalcState(){const{itemKeysMap:e,formattedItems:t}=this.getFormattedItems();return{itemKeysMap:e,willOpenKeys:this.getWillOpenKeys(e),formattedItems:t}}getFormattedItems(){const{items:e,children:t}=this.getProps(),n=this.formatItems(e),r=Array.isArray(e)&&e.length?n:t;return{itemKeysMap:_E.buildItemKeysMap(r),formattedItems:n}}getWillOpenKeys(e){const{defaultOpenKeys:t,openKeys:n,defaultSelectedKeys:r,selectedKeys:i,mode:s}=this.getProps(),{openKeys:o=[]}=this.getStates();let a=n||t||[];if(!Array.isArray(t)&&!Array.isArray(n)&&s===yE.MODE_VERTICAL&&(Array.isArray(r)||Array.isArray(i))){const t=Array.isArray(i)?i:r;a=o.concat(this.getShouldOpenKeys(e,t)),a=Array.from(new Set(a))}return[...a]}getShouldOpenKeys(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=new Set;return Array.isArray(t)&&t.length&&t.forEach((t=>{if(t){const r=o()(e,t);Array.isArray(r)&&r.forEach((e=>n.add(e)))}})),[...n]}destroy(){}selectLevelZeroParentKeys(e,t){const n=Re(e)?this.getState("itemKeysMap"):e,r=[];if(t.length)for(const e of t)if(Array.isArray(n[e])&&n[e].length){const t=n[e][0];Re(t)||r.push(t)}return r.length?r:[]}formatItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[];for(const n of e)t.push(new SE(n));return t}handleSelect(e){this._adapter.notifySelect(e)}judgeIfOpen(e,t){let n=!1;const r=Array.isArray(e)?e:e&&[e];if(r&&Array.isArray(t)&&t.length)for(const e of t)if(n=r.includes(e.itemKey)||this.judgeIfOpen(r,e.items),n)break;return n}handleCollapseChange(){const e=!this.getState("isCollapsed");this._isControlledComponent("isCollapsed")||this._adapter.setIsCollapsed(e),this._adapter.notifyCollapseChange(e)}handleItemsChange(e){this._adapter.setItemsChanged(e)}}__webpack_require__("ywzD");const kE=function(){const e=new Set(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((t=>t&&e.add(t))),Array.from(e)},OE=function(){const e=new Set(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((t=>t&&e.delete(t))),Array.from(e)};class TE extends c{constructor(e){super(Object.assign({},e))}init(){this._timer=null}destroy(){this.clearDelayTimer()}clearDelayTimer(){this._timer&&(clearTimeout(this._timer),this._timer=null)}isValidKey(e){return null!=e&&("number"==typeof e||"string"==typeof e)}handleDropdownVisibleChange(e){const t=this.getProp("itemKey"),n=this._adapter.getOpenKeysIsControlled(),r=this._adapter.getCanUpdateOpenKeys(),i=this._adapter.getOpenKeys(),s=e?kE(i,t):OE(i,t);this.clearDelayTimer(),n||r&&this._adapter.updateOpen(e),this._adapter.notifyGlobalOpenChange({itemKey:t,openKeys:s,isOpen:e})}handleClick(e,t){const{itemKey:n,disabled:r}=this.getProps();if(r)return;const i=t&&t.contains(e.target);let s=Boolean(this._adapter.getIsOpen());s=!!i&&!s;const o={itemKey:n,openKeys:s?kE(this._adapter.getOpenKeys(),n):OE(this._adapter.getOpenKeys(),n),isOpen:s,domEvent:e},a=this._adapter.getOpenKeysIsControlled(),l=this._adapter.getCanUpdateOpenKeys();!a&&l&&this._adapter.updateOpen(s),this._adapter.notifyGlobalOpenChange(o),this._adapter.notifyGlobalOnClick(o)}handleKeyPress(e,t){dn(e)&&this.handleClick(e,t)}}class PE extends c{constructor(e){super(Object.assign({},e))}init(){this._timer=null,this._mounted=!0}destroy(){this._mounted=!1}isValidKey(e){return null!=e&&("string"==typeof e||"number"==typeof e)}handleClick(e){const{isSubNav:t,itemKey:n,text:r,disabled:i}=this.getProps();if(i)return;t||!this.isValidKey(n)||this._adapter.getSelectedKeysIsControlled()||this._adapter.getSelected()||this._adapter.updateSelected(!0);const s=[n];if(!t){if(!this._adapter.getSelected()){const t=[this._adapter.cloneDeep(this.getProps())];this._adapter.notifyGlobalOnSelect({itemKey:n,selectedKeys:s,selectedItems:t,domEvent:e})}this._adapter.notifyGlobalOnClick({itemKey:n,text:r,domEvent:e})}this._adapter.notifyClick({itemKey:n,text:r,domEvent:e})}handleKeyPress(e){if(dn(e)){const{link:t,linkOptions:n}=this.getProps(),r=o()(n,"target","_self");this.handleClick(e),"string"==typeof t&&("_blank"===r?window.open(t):window.location.href=t)}}}const IE=h().createContext({isCollapsed:!1,selectedKeys:[],openKeys:[]}),ME=`${gE.PREFIX}-item`;class RE extends f{constructor(e){super(e),this.setItemRef=e=>{this.props.forwardRef&&this.props.forwardRef(e)},this.wrapTooltip=e=>{const{text:t,tooltipHideDelay:n,tooltipShowDelay:r}=this.props,i=null!=n?n:this.context.tooltipHideDelay,s=null!=r?r:this.context.tooltipShowDelay;return h().createElement(_t,{content:t,wrapWhenSpecial:!1,position:"right",trigger:"hover",mouseEnterDelay:s,mouseLeaveDelay:i},e)},this.handleClick=e=>this.foundation.handleClick(e),this.handleKeyPress=e=>this.foundation.handleKeyPress(e),this.state={tooltipShow:!1},this.foundation=new PE(this.adapter)}_invokeContextFunc(e){if(e&&this.context&&"function"==typeof this.context[e]){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.context[e](...n)}return null}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{cloneDeep:ie,updateTooltipShow:e=>this.setState({tooltipShow:e}),updateSelected:e=>this._invokeContextFunc("updateSelectedKeys",[this.props.itemKey]),updateGlobalSelectedKeys:e=>this._invokeContextFunc("updateSelectedKeys",[...e]),getSelectedKeys:()=>this.context&&this.context.selectedKeys,getSelectedKeysIsControlled:()=>this.context&&this.context.selectedKeysIsControlled,notifyGlobalOnSelect:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e._invokeContextFunc("onSelect",...n)},notifyGlobalOnClick:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e._invokeContextFunc("onClick",...n)},notifyClick:function(){return e.props.onClick(...arguments)},notifyMouseEnter:function(){return e.props.onMouseEnter(...arguments)},notifyMouseLeave:function(){return e.props.onMouseLeave(...arguments)},getIsCollapsed:()=>this.props.isCollapsed||Boolean(this.context&&this.context.isCollapsed)||!1,getSelected:()=>Boolean(this.context&&this.context.selectedKeys&&this.context.selectedKeys.includes(this.props.itemKey)),getIsOpen:()=>Boolean(this.context&&this.context.openKeys&&this.context.openKeys.includes(this.props.itemKey))})}renderIcon(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(this.props.isSubNav)return null;if(!e&&this.context.mode===yE.MODE_HORIZONTAL)return null;let i="large";t===yE.ICON_POS_RIGHT&&(i="default");const s=w()(`${ME}-icon`,{[`${ME}-icon-toggle-${this.context.toggleIconPosition}`]:n,[`${ME}-icon-info`]:!n});return h().createElement("i",{className:s,key:r},oe(e)?h().cloneElement(e,{size:e.props.size||i}):e)}render(){var e;const{text:t,icon:n,toggleIcon:r,className:i,isSubNav:s,style:o,indent:a,onMouseEnter:l,onMouseLeave:c,link:d,linkOptions:u,disabled:p,level:f=0,tabIndex:m}=this.props,{mode:g,isInSubNav:y,prefixCls:v,limitIndent:b}=this.context,x=this.adapter.getIsCollapsed(),E=this.adapter.getSelected();let C=null;const S=null===(e=this.props)||void 0===e?void 0:e.children;if(Re(S)){let e=null;if(g===yE.MODE_VERTICAL&&!b&&!x){const t=n&&!a?f:f-1;e=Rv()(t,(e=>this.renderIcon(null,yE.ICON_POS_RIGHT,!1,e)))}C=h().createElement(h().Fragment,null,e,this.context.toggleIconPosition===yE.TOGGLE_ICON_LEFT&&this.renderIcon(r,yE.ICON_POS_RIGHT,!0,"key-toggle-pos-right"),n||a||y?this.renderIcon(n,yE.ICON_POS_LEFT,!1,"key-position-left"):null,Re(t)?"":h().createElement("span",{className:`${gE.PREFIX}-item-text`},t),this.context.toggleIconPosition===yE.TOGGLE_ICON_RIGHT&&this.renderIcon(r,yE.ICON_POS_RIGHT,!0,"key-toggle-pos-right"))}else C=S;"string"==typeof d&&(C=h().createElement("a",Object.assign({className:`${v}-item-link`,href:d,tabIndex:-1},u),C));let _="";if(y&&(x||g===yE.MODE_HORIZONTAL)){const e=w()({[ME]:!0,[`${ME}-sub`]:s,[`${ME}-selected`]:E,[`${ME}-collapsed`]:x,[`${ME}-disabled`]:p});_=h().createElement(Ww.Item,{selected:E,active:E,forwardRef:this.setItemRef,className:e,onClick:this.handleClick,onMouseEnter:l,onMouseLeave:c,disabled:p,onKeyDown:this.handleKeyPress},C)}else{const e=w()(`${i||`${ME}-normal`}`,{[ME]:!0,[`${ME}-sub`]:s,[`${ME}-selected`]:E&&!s,[`${ME}-collapsed`]:x,[`${ME}-disabled`]:p,[`${ME}-has-link`]:"string"==typeof d}),t={"aria-disabled":p};if(s){const e=this.adapter.getIsOpen();t["aria-expanded"]=e}_=h().createElement("li",Object.assign({role:s?null:"menuitem",tabIndex:s?-1:m},t,{style:o,ref:this.setItemRef,className:e,onClick:this.handleClick,onMouseEnter:l,onMouseLeave:c,onKeyPress:this.handleKeyPress},this.getDataAttr(this.props)),C)}return(x&&!y&&!s||x&&s&&p)&&(_=this.wrapTooltip(_)),"function"==typeof this.context.renderWrapper?this.context.renderWrapper({itemElement:_,isSubNav:s,isInSubNav:y,props:this.props}):_}}RE.contextType=IE,RE.propTypes={text:E().oneOfType([E().string,E().node]),itemKey:E().oneOfType([E().string,E().number]),onClick:E().func,onMouseEnter:E().func,onMouseLeave:E().func,icon:E().oneOfType([E().node]),className:E().string,toggleIcon:E().string,style:E().object,forwardRef:E().func,indent:E().oneOfType([E().bool,E().number]),isCollapsed:E().bool,isSubNav:E().bool,link:E().string,linkOptions:E().object,disabled:E().bool,tabIndex:E().number},RE.defaultProps={isSubNav:!1,indent:!1,forwardRef:i(),isCollapsed:!1,onClick:i(),onMouseEnter:i(),onMouseLeave:i(),disabled:!1,tabIndex:0};class AE extends f{constructor(e){super(e),this.setItemRef=e=>{e&&e.current?this.itemRef=e:this.itemRef={current:e}},this.setTitleRef=e=>{e&&e.current?this.titleRef=e:this.titleRef={current:e}},this.handleClick=e=>{this.foundation.handleClick(e&&e.nativeEvent,this.titleRef&&this.titleRef.current)},this.handleKeyPress=e=>{this.foundation.handleKeyPress(e&&e.nativeEvent,this.titleRef&&this.titleRef.current)},this.handleDropdownVisible=e=>this.foundation.handleDropdownVisibleChange(e),this.state={isHovered:!1},this.adapter.setCache("firstMounted",!0),this.titleRef=h().createRef(),this.itemRef=h().createRef(),this.foundation=new TE(this.adapter)}_invokeContextFunc(e){if(e&&this.context&&"function"==typeof this.context[e]){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.context[e](...n)}return null}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{updateIsHovered:e=>this.setState({isHovered:e}),getOpenKeys:()=>this.context&&this.context.openKeys,getOpenKeysIsControlled:()=>this.context&&this.context.openKeysIsControlled,getCanUpdateOpenKeys:()=>this.context&&this.context.canUpdateOpenKeys,updateOpen:e=>this._invokeContextFunc(e?"addOpenKeys":"removeOpenKeys",this.props.itemKey),notifyGlobalOpenChange:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e._invokeContextFunc("onOpenChange",...n)},notifyGlobalOnSelect:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e._invokeContextFunc("onSelect",...n)},notifyGlobalOnClick:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e._invokeContextFunc("onClick",...n)},getIsSelected:e=>Boolean(!Re(e)&&o()(this.context,"selectedKeys",[]).includes(String(e))),getIsOpen:()=>{const{itemKey:e}=this.props;return Boolean(this.context&&this.context.openKeys&&this.context.openKeys.includes(this.props.itemKey))}})}renderIcon(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;const{prefixCls:s}=this.context;let o="large";t===yE.ICON_POS_RIGHT&&(o="default");const a=w()(`${s}-item-icon`,{[`${s}-item-icon-toggle-${this.context.toggleIconPosition}`]:r,[`${s}-item-icon-info`]:!r}),l=this.adapter.getIsOpen(),c=h().isValidElement(e)?n?h().createElement(vt,{animationState:l?"enter":"leave",startClassName:`${gE.PREFIX}-icon-rotate-${l?"180":"0"}`},(t=>{let{animationClassName:n}=t;return h().cloneElement(e,{size:o,className:n})})):h().cloneElement(e,{size:o}):null;return h().createElement("i",{key:i,className:a},c)}renderTitleDiv(){const{text:e,icon:t,itemKey:n,indent:r,disabled:i,level:s,expandIcon:o}=this.props,{mode:a,isInSubNav:l,isCollapsed:c,prefixCls:d,subNavMotion:u,limitIndent:p}=this.context,f=this.adapter.getIsOpen(),m=w()(`${d}-sub-title`,{[`${d}-sub-title-selected`]:this.adapter.getIsSelected(n),[`${d}-sub-title-disabled`]:i});let g=!1,y="";c?y=l?h().createElement(Al,null):null:a===yE.MODE_HORIZONTAL?y=l?h().createElement(Al,{"aria-hidden":!0}):o||h().createElement(Hc,{"aria-hidden":!0}):(u&&(g=!0),y=o||h().createElement(Hc,{"aria-hidden":!0}));let v=null;if(a===yE.MODE_VERTICAL&&!p&&!c){const e=t&&!r?s:s-1;v=Rv()(e,(e=>this.renderIcon(null,yE.ICON_POS_RIGHT,!1,!1,e)))}const b=!c&&l&&a===yE.MODE_HORIZONTAL||c&&l;return h().createElement("div",{role:"menuitem",tabIndex:b?-1:0,ref:this.setTitleRef,className:m,onClick:this.handleClick,onKeyPress:this.handleKeyPress,"aria-expanded":f?"true":"false"},h().createElement("div",{className:`${d}-item-inner`},v,this.context.toggleIconPosition===yE.TOGGLE_ICON_LEFT&&this.renderIcon(y,yE.ICON_POS_RIGHT,g,!0,"key-toggle-position-left"),t||r||l&&a!==yE.MODE_HORIZONTAL?this.renderIcon(t,yE.ICON_POS_LEFT,!1,!1,"key-inSubNav-position-left"):null,h().createElement("span",{className:`${d}-item-text`},e),this.context.toggleIconPosition===yE.TOGGLE_ICON_RIGHT&&this.renderIcon(y,yE.ICON_POS_RIGHT,g,!0,"key-toggle-position-right")))}renderSubUl(){const{children:e,maxHeight:t}=this.props,{isCollapsed:n,mode:r,subNavMotion:i,prefixCls:s}=this.context,o=this.adapter.getIsOpen(),a=r===yE.MODE_HORIZONTAL,l=w()(`${s}-sub`,{[`${s}-sub-open`]:o,[`${s}-sub-popover`]:n||a});return a?null:i?h().createElement(vf,{motion:i,isOpen:o,keepDOM:!1,fade:!0},n?null:h().createElement("ul",{className:l},e)):o&&!n?h().createElement("ul",{className:l},e):null}wrapDropdown(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{children:t,dropdownStyle:n,disabled:r,subDropdownProps:i,dropdownProps:s}=this.props,{mode:o,isInSubNav:a,isCollapsed:l,subNavCloseDelay:c,subNavOpenDelay:d,prefixCls:u,getPopupContainer:p}=this.context,f=this.adapter.getIsOpen(),m=this.adapter.getOpenKeysIsControlled(),g=w()({[`${u}-popover`]:l}),y={trigger:"hover",style:n};return m&&(y.trigger="custom",y.visible=f),p&&(y.getPopupContainer=p),(l||o===yE.MODE_HORIZONTAL)&&(e=r?e:h().createElement(Ww,Object.assign({className:g,render:h().createElement(Ww.Menu,null,t),position:o!==yE.MODE_HORIZONTAL||a?"rightTop":"bottomLeft",mouseEnterDelay:d,mouseLeaveDelay:c,onVisibleChange:this.handleDropdownVisible},s||i,y),e)),e}render(){const{itemKey:e,style:t,onMouseEnter:n,onMouseLeave:r,disabled:i,text:s}=this.props,{mode:o,isCollapsed:a,prefixCls:l}=this.context;let c=this.renderTitleDiv();const d=this.renderSubUl();return(a||o===yE.MODE_HORIZONTAL)&&(c=this.wrapDropdown(c)),h().createElement(RE,{style:t,isSubNav:!0,itemKey:e,forwardRef:this.setItemRef,isCollapsed:a,className:`${l}-sub-wrap`,onMouseEnter:n,onMouseLeave:r,disabled:i,text:s},h().createElement(IE.Provider,{value:Object.assign(Object.assign({},this.context),{isInSubNav:!0})},c,d))}}AE.contextType=IE,AE.propTypes={itemKey:E().oneOfType([E().string,E().number]),text:E().oneOfType([E().string,E().node]),isOpen:E().bool,isCollapsed:E().bool,indent:E().oneOfType([E().bool,E().number]),children:E().node,style:E().object,icon:E().node,maxHeight:E().number,onMouseEnter:E().func,onMouseLeave:E().func,disabled:E().bool,level:E().number},AE.defaultProps={level:0,indent:!1,isCollapsed:!1,isOpen:!1,maxHeight:vE,disabled:!1};const NE=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 2h14a3 3 0 0 1 3 3v14a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3Zm1 2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H6Z",fill:"currentColor"}))}),"sidebar");function DE(e){let{prefixCls:t,locale:n,collapseText:r,isCollapsed:s,onClick:o=i()}=e;const a={icon:h().createElement(NE,null),type:"tertiary",theme:"borderless",onClick:()=>{"function"==typeof o&&o(!s)}};let l=s?null==n?void 0:n.expandText:null==n?void 0:n.collapseText;return"function"==typeof r&&(l=r(s)),h().createElement("div",{className:`${t}-collapse-btn`},s?h().createElement(_t,{content:l,position:"right"},h().createElement("span",{className:`${t}-collapse-wrapper`},h().createElement(vs,Object.assign({},a)))):h().createElement(vs,Object.assign({},a),l))}class LE extends d.PureComponent{constructor(){super(...arguments),this.renderCollapseButton=()=>{const{collapseButton:e,collapseText:t}=this.props;if(h().isValidElement(e))return e;const{onCollapseChange:n,prefixCls:r,locale:i,isCollapsed:s}=this.context;return h().createElement(DE,{prefixCls:r,isCollapsed:s,locale:i,onClick:n,collapseText:t})}}render(){const{style:e,className:t,collapseButton:n,onClick:r}=this.props;let{children:i}=this.props;const{isCollapsed:s,mode:o}=this.context;!h().isValidElement(i)&&n&&o!==yE.MODE_HORIZONTAL&&(i=this.renderCollapseButton());const a=w()(t,`${gE.PREFIX}-footer`,{[`${gE.PREFIX}-footer-collapsed`]:s});return h().createElement("div",{className:a,style:e,onClick:r},i)}}LE.contextType=IE,LE.propTypes={children:E().node,style:E().object,className:E().string,collapseButton:E().oneOfType([E().node,E().bool]),collapseText:E().func,onClick:E().func},LE.defaultProps={collapseButton:!1,onClick:i()},LE.elementType="NavFooter";class FE extends d.PureComponent{renderLogo(e){return h().isValidElement(e)?e:null}render(){const{children:e,style:t,className:n,logo:r,text:i,link:s,linkOptions:o,prefixCls:a}=this.props,{isCollapsed:l}=this.context,c=w()(n,`${gE.PREFIX}-header`,{[`${gE.PREFIX}-header-collapsed`]:l});let d=h().createElement(h().Fragment,null,r?h().createElement("i",{className:`${gE.PREFIX}-header-logo`},this.renderLogo(r)):null,Re(i)||l?null:h().createElement("span",{className:`${gE.PREFIX}-header-text`},i),e);return"string"==typeof s&&(d=h().createElement("a",Object.assign({className:`${a}-header-link`,href:s},o),d)),h().createElement("div",{className:c,style:t},d)}}FE.contextType=IE,FE.propTypes={prefixCls:E().string,logo:E().oneOfType([E().string,E().object,E().node]),text:E().oneOfType([E().string,E().node]),children:E().node,style:E().object,className:E().string,link:E().string,linkOptions:E().object},FE.defaultProps={prefixCls:gE.PREFIX},FE.elementType="NavHeader";var jE=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function $E(e,t){return function(){const n=new Set(e.state[t]);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];i.forEach((e=>e&&n.add(e))),e.setState({[t]:Array.from(n)})}}function BE(e,t){return function(){const n=new Set(e.state[t]);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];i.forEach((e=>e&&n.delete(e))),e.setState({[t]:Array.from(n)})}}const{hasOwnProperty:VE}=Object.prototype;class zE extends f{constructor(e){super(e),this.onCollapseChange=()=>{this.foundation.handleCollapseChange()},this.foundation=new _E(this.adapter),this.itemsChanged=!0;const{isCollapsed:t,defaultIsCollapsed:n,items:r,children:i}=e,s={isCollapsed:Boolean(this.isControlled("isCollapsed")?t:n),openKeys:[],items:[],itemKeysMap:{},selectedKeys:[]};if(this.state=Object.assign({},s),r&&r.length||i){const e=this.foundation.init("constructor");this.state=Object.assign(Object.assign({},s),e)}}static getDerivedStateFromProps(e,t){const n={};return VE.call(e,"isCollapsed")&&e.isCollapsed!==t.isCollapsed&&(n.isCollapsed=e.isCollapsed),n}componentDidMount(){}componentDidUpdate(e){if(e.items!==this.props.items||e.children!==this.props.children)this.foundation.init();else{if(this.foundation.handleItemsChange(!1),this.props.selectedKeys&&!Oe()(e.selectedKeys,this.props.selectedKeys)){this.adapter.updateSelectedKeys(this.props.selectedKeys);const e=this.foundation.getWillOpenKeys(this.state.itemKeysMap);this.adapter.updateOpenKeys(e)}this.props.openKeys&&!Oe()(e.openKeys,this.props.openKeys)&&this.adapter.updateOpenKeys(this.props.openKeys)}}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{notifySelect:function(){return e.props.onSelect(...arguments)},notifyOpenChange:function(){return e.props.onOpenChange(...arguments)},setIsCollapsed:e=>this.setState({isCollapsed:e}),notifyCollapseChange:function(){return e.props.onCollapseChange(...arguments)},updateItems:e=>this.setState({items:[...e]}),setItemKeysMap:e=>this.setState({itemKeysMap:Object.assign({},e)}),addSelectedKeys:$E(this,"selectedKeys"),removeSelectedKeys:BE(this,"selectedKeys"),updateSelectedKeys:function(t){let n=t;if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){const r=e.foundation.selectLevelZeroParentKeys(null,t);n=Array.from(new Set(t.concat(r)))}e.setState({selectedKeys:n})},updateOpenKeys:e=>this.setState({openKeys:[...e]}),addOpenKeys:$E(this,"openKeys"),removeOpenKeys:BE(this,"openKeys"),setItemsChanged:e=>{this.itemsChanged=e}})}renderItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const{expandIcon:n,subDropdownProps:r}=this.props;return h().createElement(h().Fragment,null,e.map(((e,i)=>Array.isArray(e.items)&&e.items.length?h().createElement(AE,Object.assign({key:e.itemKey||String(t)+i},e,{level:t,expandIcon:n,subDropdownProps:r}),this.renderItems(e.items,t+1)):h().createElement(RE,Object.assign({key:e.itemKey||String(t)+i},e,{level:t})))))}render(){const e=this.props,{children:t,mode:n,onOpenChange:r,onSelect:i,onClick:s,style:a,className:l,subNavCloseDelay:c,subNavOpenDelay:u,subNavMotion:p,tooltipShowDelay:f,tooltipHideDelay:m,prefixCls:g,bodyStyle:y,footer:v,header:b,toggleIconPosition:x,limitIndent:E,renderWrapper:C,getPopupContainer:S}=e,_=jE(e,["children","mode","onOpenChange","onSelect","onClick","style","className","subNavCloseDelay","subNavOpenDelay","subNavMotion","tooltipShowDelay","tooltipHideDelay","prefixCls","bodyStyle","footer","header","toggleIconPosition","limitIndent","renderWrapper","getPopupContainer"]),{selectedKeys:k,openKeys:O,items:T,isCollapsed:P}=this.state,{updateOpenKeys:I,addOpenKeys:M,removeOpenKeys:R,updateSelectedKeys:A,addSelectedKeys:N,removeSelectedKeys:D}=this.adapter,L=Object.assign({},a);let F=d.Children.toArray(t);const j=[],$=[];if(h().isValidElement(v)?j.push(h().createElement(LE,{key:0},v)):v&&"object"==typeof v&&j.push(h().createElement(LE,Object.assign({key:0},v))),h().isValidElement(b)?$.push(h().createElement(FE,{key:0},b)):b&&"object"==typeof b&&$.push(h().createElement(FE,Object.assign({key:0},b))),Array.isArray(F)&&F.length){F=[...F];let e=F.length;for(let t=0;t<e;t++){const n=F[t];n.type===LE||"NavFooter"===o()(n,"type.elementType")?(j.push(n),F.splice(t,1),t--,e--):n.type!==FE&&"NavHeader"!==o()(n,"type.elementType")||($.push(n),F.splice(t,1),t--,e--)}}const B=w()(g,l,{[`${g}-collapsed`]:P,[`${g}-horizontal`]:"horizontal"===n,[`${g}-vertical`]:"vertical"===n}),V=w()(`${g}-header-list-outer`,{[`${g}-header-list-outer-collapsed`]:P});return this.itemsChanged&&this.adapter.setCache("itemElems",this.renderItems(T)),h().createElement(Jt,{componentName:"Navigation"},(e=>h().createElement(IE.Provider,{value:{subNavCloseDelay:c,subNavOpenDelay:u,subNavMotion:p,tooltipShowDelay:f,tooltipHideDelay:m,openKeys:O,openKeysIsControlled:this.isControlled("openKeys")&&"vertical"===n&&!P,canUpdateOpenKeys:!0,selectedKeys:k,selectedKeysIsControlled:this.isControlled("selectedKeys"),isCollapsed:P,onCollapseChange:this.onCollapseChange,mode:n,onSelect:i,onOpenChange:r,updateOpenKeys:I,addOpenKeys:M,removeOpenKeys:R,updateSelectedKeys:A,addSelectedKeys:N,removeSelectedKeys:D,onClick:s,locale:e,prefixCls:g,toggleIconPosition:x,limitIndent:E,renderWrapper:C,getPopupContainer:S}},h().createElement("div",Object.assign({className:B,style:L},this.getDataAttr(_)),h().createElement("div",{className:`${g}-inner`},h().createElement("div",{className:V},$,h().createElement("div",{style:y,className:`${g}-list-wrapper`},h().createElement("ul",{role:"menu","aria-orientation":n,className:`${g}-list`},this.adapter.getCache("itemElems"),F))),j)))))}}zE.Sub=AE,zE.Item=RE,zE.Header=FE,zE.Footer=LE,zE.propTypes={collapseIcon:E().node,defaultOpenKeys:E().arrayOf(E().oneOfType([E().string,E().number])),openKeys:E().arrayOf(E().oneOfType([E().string,E().number])),defaultSelectedKeys:E().arrayOf(E().oneOfType([E().string,E().number])),expandIcon:E().node,selectedKeys:E().arrayOf(E().oneOfType([E().string,E().number])),mode:E().oneOf([...yE.MODE]),onSelect:E().func,onClick:E().func,onOpenChange:E().func,items:E().array,isCollapsed:E().bool,defaultIsCollapsed:E().bool,onCollapseChange:E().func,multiple:E().bool,onDeselect:E().func,subNavMotion:E().oneOfType([E().bool,E().object,E().func]),subNavCloseDelay:E().number,subNavOpenDelay:E().number,tooltipShowDelay:E().number,tooltipHideDelay:E().number,children:E().node,style:E().object,bodyStyle:E().object,className:E().string,toggleIconPosition:E().string,prefixCls:E().string,header:E().oneOfType([E().node,E().object]),footer:E().oneOfType([E().node,E().object]),limitIndent:E().bool,getPopupContainer:E().func},zE.__SemiComponentName__="Navigation",zE.defaultProps=he(zE.__SemiComponentName__,{subNavCloseDelay:EE,subNavOpenDelay:xE,tooltipHideDelay:wE,tooltipShowDelay:bE,onCollapseChange:i(),onSelect:i(),onClick:i(),onOpenChange:i(),toggleIconPosition:"right",limitIndent:!0,prefixCls:gE.PREFIX,subNavMotion:!0,mode:yE.MODE_VERTICAL});const HE=zE;class UE extends c{addNotice(e){const t=this._adapter.getNotices();this._adapter.updateNotices([e,...t])}has(e){return this._adapter.getNotices().some((t=>t.id===e))}update(e,t){let n=this._adapter.getNotices();n=n.map((n=>n.id===e?Object.assign(Object.assign({},n),t):n));const r=n.filter((t=>t.id===e));this._adapter.updateNotices(n,[],r)}removeNotice(e){let t=this._adapter.getNotices();const n=[];t=t.filter((t=>t.id!==e||(n.push(t),!1))),this._adapter.updateNotices(t,n)}destroyAll(){const e=this._adapter.getNotices();e.length>0&&this._adapter.updateNotices([],e)}}const KE={WRAPPER:`${C}-notification-wrapper`,LIST:`${C}-notification-list`,NOTICE:`${C}-notification-notice`},WE={types:["warning","success","info","error","default"],themes:["normal","light"],directions:["ltr","rtl"]};class GE extends c{constructor(e){super(Object.assign(Object.assign({},GE.defaultAdapter),e)),this._timer=null,this._id=null}init(){this._startCloseTimer(),this._id=this.getProp("id")}destroy(){this._clearCloseTimer()}_startCloseTimer(){const e=this.getProp("duration");e&&er()(e)&&(this._timer=setTimeout((()=>{this.close()}),1e3*e))}close(e){e&&e.stopPropagation(),this._adapter.notifyWrapperToRemove(this._id),this._adapter.notifyClose()}_clearCloseTimer(){this._timer&&(clearTimeout(this._timer),this._timer=null)}restartCloseTimer(){this._clearCloseTimer(),this._startCloseTimer()}}var qE=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const XE=KE.NOTICE,{duration:YE}={duration:3},{types:ZE,themes:JE,directions:QE}=WE;class eC extends f{get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyWrapperToRemove:e=>{this.props.close(e)},notifyClose:()=>{this.props.onClose(),this.props.onHookClose&&this.props.onHookClose()}})}constructor(e){super(e),this.clearCloseTimer=()=>{this.foundation._clearCloseTimer()},this.startCloseTimer=()=>{this.foundation._startCloseTimer()},this.close=e=>{this.props.onCloseClick(this.props.id),this.foundation.close(e)},this.notifyClick=e=>{this.props.onClick(e)},this.state={visible:!0},this.foundation=new GE(this.adapter)}componentWillUnmount(){this.foundation.destroy()}renderTypeIcon(){const{type:e,icon:t}=this.props;let n={warning:h().createElement(Qi,{size:"large"}),success:h().createElement(es,{size:"large"}),info:h().createElement(ts,{size:"large"}),error:h().createElement(ns,{size:"large"})}[e];const r=w()({[`${XE}-icon`]:!0,[`${XE}-${e}`]:!0});return t&&(n=t),n?h().createElement("div",{className:r,"x-semi-prop":"icon"},oe(n)?h().cloneElement(n,{size:n.props.size||"large"}):n):null}render(){const e=this.props.direction||this.context.direction,t="rtl"===e?"topLeft":"topRight",n=this.props,{content:r,title:i,theme:s,position:o=t,type:a,id:l,onCloseClick:c,className:d,showClose:u,style:p}=n,{visible:f}=(qE(n,["content","title","theme","position","type","id","onCloseClick","className","showClose","style"]),this.state),m=w()(XE,d,{[`${XE}-close`]:!f,[`${XE}-icon-show`]:ZE.includes(a),[`${XE}-${a}`]:!0,[`${XE}-${s}`]:"light"===s,[`${XE}-rtl`]:"rtl"===e}),g=We({});return h().createElement("div",{className:m,style:p,onMouseEnter:this.clearCloseTimer,onMouseLeave:this.startCloseTimer,onClick:this.notifyClick,"aria-labelledby":g,role:"alert",onAnimationEnd:this.props.onAnimationEnd,onAnimationStart:this.props.onAnimationStart},h().createElement("div",null,this.renderTypeIcon()),h().createElement("div",{className:`${XE}-inner`},h().createElement("div",{className:`${XE}-content-wrapper`},i?h().createElement("div",{id:g,className:`${XE}-title`,"x-semi-prop":"title"},i):"",r?h().createElement("div",{className:`${XE}-content`,"x-semi-prop":"content"},r):""),u&&h().createElement(ji,{className:`${XE}-icon-close`,type:"tertiary",icon:h().createElement(Ji,null),theme:"borderless",size:"small",onClick:this.close})))}}eC.contextType=lt,eC.propTypes={duration:E().number,id:E().string,title:E().node,content:E().node,type:E().oneOf(ZE),theme:E().oneOf(JE),icon:E().node,onClick:E().func,onClose:E().func,onCloseClick:E().func,showClose:E().bool,close:E().func,direction:E().oneOf(QE)},eC.__SemiComponentName__="Notification",eC.defaultProps=he(eC.__SemiComponentName__,{duration:YE,id:"",close:i(),onClose:i(),onClick:i(),onCloseClick:i(),content:"",title:"",showClose:!0,theme:"normal"});const tC=eC;__webpack_require__("waO6");var nC=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const rC=(e,t)=>{var{afterClose:n}=e,r=nC(e,["afterClose"]);const[i,s]=(0,d.useState)(!0);return h().useImperativeHandle(t,(()=>({close:()=>{s(!1)}}))),(0,d.useEffect)((()=>{i||n(String(r.id))}),[i]),i?h().createElement(tC,Object.assign({},r,{onHookClose:()=>{s(!1)}})):null},iC=h().forwardRef(rC),sC={duration:3,position:"topRight",motion:!0,content:"",title:"",zIndex:1010};let oC=null;const aC={duration:3,position:"topRight",motion:!0,content:"",title:"",zIndex:1010};class lC extends f{constructor(e){var t;super(e),t=this,this.add=e=>this.foundation.addNotice(e),this.has=e=>this.foundation.has(e),this.remove=e=>{this.foundation.removeNotice(String(e))},this.update=(e,t)=>this.foundation.update(e,t),this.destroyAll=()=>this.foundation.destroyAll(),this.renderNoticeInPosition=function(e,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const s=w()(KE.LIST);if(e.length){const o=t.setPosInStyle(e[0]);return h().createElement("div",{placement:n,key:n,className:s,style:o},e.map(((e,s)=>{const o=void 0!==r.find((t=>t.id===e.id));return h().createElement(vt,{key:e.id,animationState:o?"leave":"enter",startClassName:`${KE.NOTICE}-animation-${o?"hide":"show"}_${n}`},(n=>{let{animationClassName:r,animationEventsNeedBind:s,isAnimating:a}=n;return o&&!a?null:h().createElement(tC,Object.assign({},e,{ref:e=>{e&&i.some((t=>t.id===e.props.id))&&e.foundation.restartCloseTimer()},className:w()({[e.className]:Boolean(e.className),[r]:!0})},s,{style:Object.assign({},e.style),close:t.remove}))}))})))}return null},this.state={notices:[],removedItems:[],updatedItems:[]},this.noticeStorage=[],this.removeItemStorage=[],this.foundation=new UE(this.adapter)}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{updateNotices:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];e.noticeStorage=[...t],e.removeItemStorage=[...n],e.setState({notices:t,removedItems:n,updatedItems:r})},getNotices:()=>this.noticeStorage})}static addNotice(e){var t,n,r;const i=(null===(n=null===(t=null==te?void 0:te.config)||void 0===t?void 0:t.overrideDefaultProps)||void 0===n?void 0:n.Notification)||{},s=null!==(r=(e=Object.assign(Object.assign(Object.assign({},aC),i),e)).id)&&void 0!==r?r:Ue("notification");if(oC)oC.has(`${s}`)?oC.update(s,e):oC.add(Object.assign(Object.assign({},e),{id:s}));else{const{getPopupContainer:t}=e,n=document.createElement("div");if(this.wrapperId||(this.wrapperId=Ue("notification-wrapper").slice(0,32)),n.className=KE.WRAPPER,n.id=this.wrapperId,n.style.zIndex=String("number"==typeof e.zIndex?e.zIndex:aC.zIndex),t){t().appendChild(n)}else document.body.appendChild(n);it(h().createElement(lC,{ref:t=>{t&&(oC=t,t.add(Object.assign(Object.assign({},e),{id:s})))}}),n)}return s}static removeNotice(e){return oC&&oC.remove(e),e}static info(e){var t,n;const r=(null===(n=null===(t=null==te?void 0:te.config)||void 0===t?void 0:t.overrideDefaultProps)||void 0===n?void 0:n.Notification)||{};return this.addNotice(Object.assign(Object.assign(Object.assign(Object.assign({},aC),r),e),{type:"info"}))}static success(e){var t,n;const r=(null===(n=null===(t=null==te?void 0:te.config)||void 0===t?void 0:t.overrideDefaultProps)||void 0===n?void 0:n.Notification)||{};return this.addNotice(Object.assign(Object.assign(Object.assign(Object.assign({},aC),r),e),{type:"success"}))}static error(e){var t,n;const r=(null===(n=null===(t=null==te?void 0:te.config)||void 0===t?void 0:t.overrideDefaultProps)||void 0===n?void 0:n.Notification)||{};return this.addNotice(Object.assign(Object.assign(Object.assign(Object.assign({},aC),r),e),{type:"error"}))}static warning(e){var t,n;const r=(null===(n=null===(t=null==te?void 0:te.config)||void 0===t?void 0:t.overrideDefaultProps)||void 0===n?void 0:n.Notification)||{};return this.addNotice(Object.assign(Object.assign(Object.assign(Object.assign({},aC),r),e),{type:"warning"}))}static open(e){var t,n;const r=(null===(n=null===(t=null==te?void 0:te.config)||void 0===t?void 0:t.overrideDefaultProps)||void 0===n?void 0:n.Notification)||{};return this.addNotice(Object.assign(Object.assign(Object.assign(Object.assign({},aC),r),e),{type:"default"}))}static close(e){return this.removeNotice(e)}static destroyAll(){var e;if(oC){oC.destroyAll();const t=document.querySelector(`#${this.wrapperId}`);t&&(st(t),null===(e=t.parentNode)||void 0===e||e.removeChild(t)),oC=null,this.wrapperId=null}}static config(e){["top","left","bottom","right"].map((t=>{t in e&&(aC[t]=e[t])})),"number"==typeof e.zIndex&&(aC.zIndex=e.zIndex),"number"==typeof e.duration&&(aC.duration=e.duration),"string"==typeof e.position&&(aC.position=e.position)}setPosInStyle(e){const t={};return["top","left","bottom","right"].forEach((n=>{if(n in e){const r=e[n];t[n]="number"==typeof r?`${r}px`:r}})),t}render(){let{notices:e}=this.state;const{removedItems:t,updatedItems:n}=this.state;e=Array.from(new Set([...e,...t]));const r={top:[],topLeft:[],topRight:[],bottom:[],bottomLeft:[],bottomRight:[]};e.forEach((e=>{const t="rtl"===(e.direction||this.context.direction)?"topLeft":"topRight",n=e.position||t;r[n].push(e)}));const i=Object.entries(r).map((e=>{const r=e[0],i=e[1];return this.renderNoticeInPosition(i,r,t,n)}));return h().createElement(h().Fragment,null,i)}}lC.contextType=lt,lC.propTypes={style:E().object,className:E().string,direction:E().oneOf(WE.directions)},lC.defaultProps={},lC.useNotification=function(){const[e,t]=function(){const[e,t]=(0,d.useState)([]);return[function(){const t={top:[],topLeft:[],topRight:[],bottom:[],bottomLeft:[],bottomRight:[]};return e.forEach((e=>{let{element:n,config:r}=e;const{position:i}=r;t[i].push(n)})),Object.entries(t).map((e=>{const t=e[0],n=e[1];return Array.isArray(n)&&n.length?h().createElement("div",{key:t,className:w()(KE.LIST),placement:t},n):null}))}(),function(e,n){return t((t=>[{element:e,config:n},...t])),e=>{t((t=>t.filter((t=>{let{config:n}=t;return n.id!==e}))))}}]}(),n=new Map,r=e=>{const r=Ue("semi_notice_"),i=Object.assign(Object.assign({},e),{id:r});let s;const o=h().createElement(iC,Object.assign({key:r},i,{afterClose:e=>s(e),ref:e=>{n.set(r,e)}}));return s=t(o,Object.assign({},i)),r};return[{success:e=>r(Object.assign(Object.assign(Object.assign({},sC),e),{type:"success"})),info:e=>r(Object.assign(Object.assign(Object.assign({},sC),e),{type:"info"})),error:e=>r(Object.assign(Object.assign(Object.assign({},sC),e),{type:"error"})),warning:e=>r(Object.assign(Object.assign(Object.assign({},sC),e),{type:"warning"})),open:e=>r(Object.assign(Object.assign(Object.assign({},sC),e),{type:"default"})),close:e=>{const t=n.get(e);t&&t.close()}},h().createElement(h().Fragment,null,e)]};const cC=lC,dC={PREFIX:C+"-overflow-list"},hC={COLLAPSE:"collapse",SCROLL:"scroll"},uC={START:"start",END:"end"},pC={BOUNDARY_SET:Object.values(uC),POSITION_SET:["vertical","horizontal"],MODE_SET:Object.values(hC),MODE_MAP:hC,BOUNDARY_MAP:uC,OVERFLOW_DIR:{NONE:0,GROW:1,SHRINK:2}},fC=4;class mC extends h().PureComponent{componentDidMount(){const{items:e}=this.props;this.cachedKeys=Object.keys(e);const{root:t,threshold:n,rootMargin:r,option:i,onIntersect:s}=this.props;this.observer=new IntersectionObserver(s,Object.assign({root:t,threshold:n,rootMargin:r},i)),this.observeElement()}componentDidUpdate(){const{items:e}=this.props,t=Object.keys(e);Oe()(this.cachedKeys,t)||(this.observeElement(!0),this.cachedKeys=t)}componentWillUnmount(){this.observer&&(this.observer.disconnect(),this.observer=null)}observeElement(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{items:t}=this.props;Pe()(t)?this.observer.disconnect():(e&&this.observer.disconnect(),Object.keys(t).forEach((e=>{const n=t[e];n&&ee(n)&&this.observer.observe(n)})))}render(){const{children:e}=this.props;return e}}mC.propTypes={onIntersect:E().func,option:E().object,root:E().any,threshold:E().number,rootMargin:E().string,items:E().object},mC.defaultProps={onIntersect:()=>{},threshold:.75,rootMargin:"0px",option:{},items:{}};const gC=pC.BOUNDARY_MAP;const yC=class extends c{constructor(e){super(Object.assign({},e)),this.previousY=void 0,this.isScrollMode=()=>{const{renderMode:e}=this.getProps();return"scroll"===e},this.getReversedItems=()=>{const{items:e}=this.getProps();return Ky(e).reverse()}}getOverflowItem(){const{items:e}=this.getProps(),{visibleState:t,overflow:n,scrollOverflow:r}=this.getStates();if(!this.isScrollMode())return n;if(!t||0===t.size)return Array.isArray(r)&&2===r.length?r:[[],[]];const i=e.map((e=>{let{key:n}=e;return Boolean(t.get(n))})),s=i.indexOf(!0),o=i.lastIndexOf(!0);if(s<0||o<0)return Array.isArray(r)&&2===r.length?r:[[],[]];const a=[];return a[0]=s>=0?e.slice(0,s):[],a[1]=o>=0?e.slice(o+1,e.length):e.slice(),a}_syncScrollOverflowCache(e){if(!this.isScrollMode())return;const{items:t}=this.getProps(),n=t.map((t=>{let{key:n}=t;return Boolean(e.get(n))})),r=n.indexOf(!0),i=n.lastIndexOf(!0);if(r<0||i<0)return void this._adapter.updateStates({isScrollOverflowCalculating:!0});const s=[];s[0]=r>=0?t.slice(0,r):[],s[1]=i>=0?t.slice(i+1,t.length):t.slice(),this._adapter.updateStates({scrollOverflow:s,isScrollOverflowCalculating:!1})}handleIntersect(e){const t=Ky(this.getState("visibleState")),n={};e.forEach((e=>{const r=o()(e,"target.dataset.scrollkey"),i=e.isIntersecting;n[r]=e,t.set(r,i)}));let r=!1;for(const e of t.values())if(e){r=!0;break}const i=r,[s]=e,a=s.boundingClientRect.y;i||void 0===this.previousY||a===this.previousY?(this.previousY=a,this._adapter.updateVisibleState(t),this._syncScrollOverflowCache(t),this._adapter.notifyIntersect(n)):this.previousY=a}handleCollapseOverflow(){const{minVisibleItems:e,collapseFrom:t}=this.getProps(),{overflowWidth:n,containerWidth:r,pivot:i,overflowStatus:s}=this.getStates(),{items:o,onOverflow:a}=this.getProps();let l=n,c=0,d=!1;for(const e of this._adapter.getItemSizeMap().values()){if(l+=e,l>r){d=!0;break}if(c===o.length-1){this._adapter.updateStates({overflowStatus:"normal",pivot:o.length-1,visible:o,overflow:[]});break}c++}if(d){const n=Math.max(e,c),r=t===gC.START,s=r?this.getReversedItems().slice(0,n).reverse():o.slice(0,n),l=r?this.getReversedItems().slice(n).reverse():o.slice(n);return this._adapter.updateStates({overflowStatus:"overflowed",pivot:n,visible:s,overflow:l}),void(i!==n&&a(l))}}};__webpack_require__("5CK9");const vC=dC.PREFIX,bC=pC.BOUNDARY_MAP,wC=pC.OVERFLOW_DIR,xC=pC.MODE_MAP;class EC extends f{constructor(e){var t;super(e),t=this,this.scroller=null,this.spacer=null,this.isScrollMode=()=>{const{renderMode:e}=this.props;return e===xC.SCROLL},this.resize=function(){var e;const n=null===(e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])[0])||void 0===e?void 0:e.target.clientWidth;t.setState({containerWidth:n,overflowStatus:"calculating"})},this.reintersect=e=>{this.foundation.handleIntersect(e)},this.mergeRef=(e,t,n)=>{this.itemRefs[n]=t,"function"==typeof e?e(t):"object"==typeof e&&e&&"current"in e&&(e.current=t)},this.renderOverflow=()=>{const e=this.foundation.getOverflowItem();return this.props.overflowRenderer(e)},this.getItemKey=(e,t)=>{const{itemKey:n}=this.props;return ye()(n)?n(e):o()(e,n||"key",t)},this.renderItemList=()=>{const{className:e,wrapperClassName:t,wrapperStyle:n,style:r,visibleItemRenderer:i,renderMode:s,collapseFrom:o}=this.props,{visible:a,overflowStatus:l}=this.state;let c=this.renderOverflow();if(!this.isScrollMode()&&(Array.isArray(c)&&(c=h().createElement(h().Fragment,null,c)),h().isValidElement(c))){const e=h().cloneElement(c);c=h().createElement(Pn,{onResize:e=>{let[t]=e;this.setState({overflowWidth:t.target.clientWidth,overflowStatus:"calculating"})}},h().createElement("div",{className:`${vC}-overflow`},e))}const d=s===xC.SCROLL?(()=>{const e=[h().createElement("div",{className:w()(t,`${vC}-scroll-wrapper`),ref:e=>{this.scroller=e},style:Object.assign({},n),key:`${vC}-scroll-wrapper`},a.map(i).map((e=>{const{forwardRef:t,key:n}=e;return h().cloneElement(e,{ref:e=>this.mergeRef(t,e,n),"data-scrollkey":`${n}`,key:n})})))];return"both"===this.props.overflowRenderDirection?(e.unshift(c[0]),e.push(c[1])):"start"===this.props.overflowRenderDirection?(e.unshift(c[1]),e.unshift(c[0])):(e.push(c[0]),e.push(c[1])),e})():[o===bC.START?c:null,a.map(((e,t)=>{const n=this.getItemKey(e,t),r=i(e,t),s=h().cloneElement(r);return h().createElement(Pn,{key:null!=n?n:t,onResize:n=>{let[r]=n;return this.onItemResize(r,e,t)}},h().createElement("div",{key:null!=n?n:t,className:`${vC}-item`},s))})),o===bC.END?c:null];return h().createElement("div",{className:w()(`${vC}`,e),style:Object.assign(Object.assign({},r),s===xC.COLLAPSE?{maxWidth:"100%",visibility:"calculating"===l&&this.state.pivot<0?"hidden":"visible"}:null)},...d)},this.onItemResize=(e,t,n)=>{const r=this.getItemKey(t,n),i=this.itemSizeMap.get(r);i?i!==e.target.clientWidth&&(this.itemSizeMap.set(r,e.target.clientWidth),this.setState({overflowStatus:"calculating"})):this.itemSizeMap.set(r,e.target.clientWidth);const{maxCount:s}=this.state;this.itemSizeMap.size===s&&this.setState({overflowStatus:"calculating"})},this.state={direction:wC.GROW,lastOverflowCount:0,overflow:[],visible:[],containerWidth:0,visibleState:new Map,itemSizeMap:new Map,overflowStatus:"calculating",pivot:-1,overflowWidth:0,maxCount:0,scrollOverflow:[[],[]],isScrollOverflowCalculating:!0},this.foundation=new yC(this.adapter),this.previousWidths=new Map,this.itemRefs={},this.itemSizeMap=new Map}static getDerivedStateFromProps(e,t){const{prevProps:n}=t,r={};r.prevProps=e;const i=t=>!n&&t in e||n&&!Oe()(n[t],e[t]),s=i("items");if(s||i("style")){if(r.direction=wC.GROW,r.lastOverflowCount=0,r.maxCount=0,r.isScrollOverflowCalculating=!0,s&&e.renderMode===xC.SCROLL&&Array.isArray(t.scrollOverflow)){const n=(t,n)=>{const{itemKey:r}=e;return ye()(r)?r(t):o()(t,r||"key",n)},i=e.items||[],s=new Map;i.forEach(((e,t)=>{s.set(n(e,t),e)}));const a=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(((e,t)=>s.get(n(e,t)))).filter(Boolean)},[l,c]=t.scrollOverflow;r.scrollOverflow=[a(l),a(c)]}if(e.renderMode===xC.SCROLL)r.visible=e.items,r.overflow=[];else{let n=e.items.length;0!==Math.floor(t.containerWidth/fC)&&(n=Math.min(n,Math.floor(t.containerWidth/fC)));const i=e.collapseFrom===bC.START,s=i?Ky(e.items).reverse().slice(0,n):e.items.slice(0,n),o=i?Ky(e.items).reverse().slice(n):e.items.slice(n);r.visible=s,r.overflow=o,r.maxCount=n}r.overflowStatus="calculating"}return r}get adapter(){return Object.assign(Object.assign({},super.adapter),{updateVisibleState:e=>{this.setState({visibleState:e},(()=>{var t,n;null===(n=(t=this.props).onVisibleStateChange)||void 0===n||n.call(t,e)}))},updateStates:e=>{this.setState(Object.assign({},e))},notifyIntersect:e=>{this.props.onIntersect&&this.props.onIntersect(e)},getItemSizeMap:()=>this.itemSizeMap})}componentDidUpdate(e,t){const n=e.items.map(((e,t)=>this.getItemKey(e,t))),r=this.props.items.map(((e,t)=>this.getItemKey(e,t)));Oe()(n,r)||(this.itemRefs={},this.itemSizeMap=new Map,this.setState({visibleState:new Map,isScrollOverflowCalculating:!0}));const{overflow:i,containerWidth:s,visible:o,overflowStatus:a}=this.state;this.isScrollMode()||"calculating"!==a||this.foundation.handleCollapseOverflow()}render(){const e=this.renderItemList(),{renderMode:t}=this.props;return t===xC.SCROLL?h().createElement(mC,{onIntersect:this.reintersect,root:this.scroller,threshold:this.props.threshold,items:this.itemRefs},e):h().createElement(Pn,{onResize:this.resize},e)}}EC.__SemiComponentName__="OverflowList",EC.defaultProps=he(EC.__SemiComponentName__,{collapseFrom:"end",minVisibleItems:0,overflowRenderer:()=>null,renderMode:"collapse",threshold:.75,visibleItemRenderer:()=>null,onOverflow:()=>null,overflowRenderDirection:"both"}),EC.propTypes={className:E().string,collapseFrom:E().oneOf(pC.BOUNDARY_SET),direction:E().oneOf(pC.POSITION_SET),items:E().array,minVisibleItems:E().number,onIntersect:E().func,onOverflow:E().func,overflowRenderer:E().func,renderMode:E().oneOf(pC.MODE_SET),style:E().object,threshold:E().number,visibleItemRenderer:E().func,wrapperClassName:E().string,wrapperStyle:E().object,collapseMask:E().object,overflowRenderDirection:E().string};const CC=EC,SC={PREFIX:`${C}-page`},_C={PAGE_SHOW_MAX:7,REST_PAGE_SHOW_MAX:5,DEFAULT_PAGE_SIZE:10,PAGE_SIZE_OPTION:[10,20,40,100],REST_PAGE_MAX_SIZE:1e6};const kC=class extends c{constructor(e){super(Object.assign({},e))}init(){const{currentPage:e,total:t,pageSize:n}=this.getStates();this._updateDisabled({currentPage:e,total:t,pageSize:n}),this._updatePageList({currentPage:e,total:t,pageSize:n}),this._registerEventHandler()}destroy(){this._unregisterEventHandler()}_registerEventHandler(){this._adapter.registerKeyDownHandler(this.handleKeyDown)}_unregisterEventHandler(){this._adapter.unregisterKeyDownHandler(this.handleKeyDown)}_updateDisabled(e){const{currentPage:t,total:n,pageSize:r}=e,i=this._getTotalPageNumber(n,r);let s=!1,o=!1;1===t?(s=!0,o=i<2):t===i&&(s=!1,o=!0);const{prevDisabled:a,nextDisabled:l}=this.getStates();s===a&&o===l||this._adapter.setDisabled(s,o)}goPage(e){if("..."===e)return;const{pageSize:t,currentPage:n}=this.getStates(),r=this._isInProps("currentPage");e!==n&&(r?(this._adapter.notifyPageChange(e),this._adapter.notifyChange(e,t)):(this.updatePage(e),this._adapter.notifyPageChange(e),this._adapter.notifyChange(e,t)))}updatePage(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;null==t&&(t=this.getState("total")),null==n&&(n=this.getState("pageSize")),this._updateDisabled({currentPage:e,total:t,pageSize:n}),this._updatePageList({currentPage:e,total:t,pageSize:n}),t!==this.getState("total")&&this._adapter.updateTotal(t),e!==this.getState("currentPage")&&this._adapter.setCurrentPage(e),n!==this.getState("pageSize")&&this._adapter.updatePageSize(n)}updateAllPageNumbers(e,t){const{size:n,hoverShowPageSelect:r,disabled:i}=this.getProps();if("small"===n&&r&&!i){const n=Array.from({length:Math.ceil(e/t)},((e,t)=>t+1));this._adapter.updateAllPageNumbers(n)}}goPrev(){const{currentPage:e}=this.getStates();e>1&&this.goPage(e-1)}goNext(){const{currentPage:e,total:t,pageSize:n}=this.getStates();e<=this._getTotalPageNumber(t,n)-1&&this.goPage(e+1)}_updatePageList(e){const{currentPage:t,total:n,pageSize:r}=e;let i=[],s=[],o=[];const a=this._getTotalPageNumber(n,r),{PAGE_SHOW_MAX:l,REST_PAGE_MAX_SIZE:c}=_C;if(a<=l)i=Array.from({length:a},((e,t)=>t+1)),s=[],o=[];else switch(!0){case t<4:i=[1,2,3,4,"...",a-1,a],o=Array.from({length:Math.min(a-6,c)},((e,t)=>t+5)),s=[];break;case 4===t:i=[1,2,3,4,5,"...",a],o=Array.from({length:Math.min(a-6,c)},((e,t)=>t+6)),s=[];break;case 4<t&&t<a-3:const e=Array.from({length:3},((e,n)=>t+(n-1)));i=[1].concat("...",e,"...",a),o=Array.from({length:Math.min(a-t-2,c)},((e,n)=>t+n+2)),s=Array.from({length:Math.min(t-3,c)},((e,t)=>t+2));break;case t-3<=t&&t<=a:const n=Array.from({length:5},((e,t)=>a-(4-t)));i=[1,"..."].concat(n),o=[],s=Array.from({length:Math.min(n[0]-2,c)},((e,t)=>t+2))}this._adapter.setPageList({pageList:i,restLeftPageList:s,restRightPageList:o})}changePageSize(e){const{pageSize:t}=this.getStates();this._adapter.updatePageSize(e),this._adapter.notifyPageSizeChange(e);const{total:n,currentPage:r}=this.getStates(),{preventPageChangeOnPageSizeChange:i}=this.getProps();let s=r;if(!i){const n=(r-1)*t+1;s=Math.ceil(n/e)}this.updatePage(s,n,e),r!==s&&this._adapter.notifyPageChange(s),this._adapter.notifyChange(s,e)}handleKeyDown(){}pageSizeInOpts(){const{pageSizeOpts:e}=this.getProps(),{pageSize:t}=this.getStates(),n=[...e];if(-1===n.indexOf(t)){const e=n.findIndex((e=>e>t));n.splice(e,0,t)}return n}handleQuickJumpNumberChange(e){this._adapter.updateQuickJumpPage(e)}_handleQuickJump(e){let t=Number(e);const{pageSize:n,total:r}=this.getStates(),i=this._getTotalPageNumber(r,n);Number.isNaN(t)||(t>i&&(t=i),t<=0&&(t=1),this._adapter.updateQuickJumpPage(""),this.goPage(t))}handleQuickJumpBlur(){const{quickJumpPage:e}=this.getStates();("string"==typeof e&&e||"number"==typeof e)&&this._handleQuickJump(e)}handleQuickJumpEnterPress(e){this._handleQuickJump(e)}_getTotalPageNumber(e,t){return Math.ceil(e/t)}};__webpack_require__("bpxB");const OC={PREFIX:`${C}-select`,PREFIX_OPTION:`${C}-select-option`,PREFIX_GROUP:`${C}-select-group`},TC={SIZE_SET:["small","large","default"],POSITION_SET:ze.POSITION_SET,MODE_SELECT:"select",MODE_AUTOCOMPLETE:"autoComplete",STATUS:Yn,SEARCH_POSITION_TRIGGER:"trigger",SEARCH_POSITION_DROPDOWN:"dropdown"},PC=270;var IC=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class MC extends c{constructor(e){super(Object.assign({},e)),this._keydownHandler=null}init(){this._setDropdownWidth();const e=this.getProp("defaultOpen"),t=this.getProp("open"),n=this._collectOptions();this._setDefaultSelection(n),(e||t)&&this.open(void 0,n);this.getProp("autoFocus")&&this.focus(n)}focus(e,t){const n=this._isFilterable(),r=this._isMultiple(),{isOpen:i}=this.getStates(),{searchPosition:s}=this.getProps(),o=!1!==t;if(this._adapter.updateFocusState(!0),this._adapter.setIsFocusInContainer(!1),n){if(!o)return void(s===TC.SEARCH_POSITION_TRIGGER?r?this.focusInput():this.toggle2SearchInput(!0):this._focusTrigger());r?(this.focusInput(),i||this.open(void 0,e)):(this.toggle2SearchInput(!0),i||this.open(void 0,e))}else this._focusTrigger()}_focusTrigger(){this._adapter.focusTrigger()}destroy(){this._adapter.unregisterClickOutsideHandler()}_setDropdownWidth(){const{style:e,dropdownMatchSelectWidth:t}=this.getProps();let n;t&&(n=e&&er()(e.width)||e&&xe()(e.width)&&!e.width.includes("%")?e.width:this._adapter.getTriggerWidth(),this._adapter.setOptionWrapperWidth(n))}_collectOptions(){const e=this._adapter.getOptionsFromChildren();return this._adapter.updateOptions(e),this._adapter.rePositionDropdown(),e}_setDefaultSelection(e){let{value:t}=this.getProps();const{defaultValue:n}=this.getProps();this._isControlledComponent()||(t=n),this._update(t,e)}handleOptionListChange(){const e=this._collectOptions(),{selections:t}=this.getStates();this.updateOptionsActiveStatus(t,e);const{defaultActiveFirstOption:n}=this.getProps();n&&this._adapter.updateFocusIndex(0)}handleOptionListChangeHadDefaultValue(){const e=this.getState("selections");let t;const{onChangeWithObject:n}=this.getProps(),r=this._isMultiple();switch(!0){case r&&Boolean(e.size):try{t=[...e].map((e=>n?e[1]:e[1].value))}catch(e){t=[]}break;case r&&!e.size:t=[];break;case!r&&Boolean(e.size):try{t=n?[...e][0][1]:[...e][0][1].value}catch(e){}case!r&&!e.size:}const i=this._adapter.getOptionsFromChildren();this._update(t,i)}handleValueChange(e){const{allowCreate:t,autoClearSearchValue:n,remote:r}=this.getProps(),{inputValue:i}=this.getStates();let s;t&&this._isControlledComponent()?(s=this.getState("options"),s.forEach((e=>e._show=!0))):s=this._adapter.getOptionsFromChildren(),this._adapter.rePositionDropdown(),this._isFilterable()&&!n&&i&&!r&&(s=this._filterOption(s,i)),this._update(e,s)}_update(e,t){let n;this._isMultiple()?(n=this._updateMultiple(e,t),this.updateOverflowItemCount(n.size)):n=this._updateSingle(e,t),this._adapter.updateSelection(n),this.updateOptionsActiveStatus(n,t)}_updateSingle(e,t){const n=new Map,{onChangeWithObject:r}=this.getProps(),i=r&&void 0!==e?e.value:e,s=t.filter((e=>e.value===i)),o=!s.length&&null!=i;if(s.length){const e=s[0],t=Object.assign({},e);n.set(t.label,t)}else if(o){let t={value:e,label:e,_notExist:!0,_scrollIndex:-1};r&&(t=Object.assign(Object.assign({},e),{_notExist:!0,_scrollIndex:-1})),n.set(t.label,t)}return n}_updateMultiple(e,t){const n=this.getState("selections");let r=[];const i=Array.isArray(e);this.checkMultipleProps(),n.size&&(r=[...n].map((e=>e[1])));const s=new Map;let o=e;const{onChangeWithObject:a}=this.getProps();return a&&i&&(o=e.map((e=>e.value))),i&&o.length&&o.forEach(((n,i)=>{const o=t.findIndex((e=>e.value===n));if(-1!==o)s.set(t[o].label,t[o]);else{const t=r.findIndex((e=>e.value===n));if(-1!==t){const n=r[t];if(a){const t=Object.assign({},e[i]);Oe()(t,n)?s.set(n.label,n):s.set(t.label,t)}else s.set(n.label,n)}else{let t={value:n,label:n,_notExist:!0};a&&(t=Object.assign(Object.assign({},e[i]),{_notExist:!0})),s.set(t.label,Object.assign(Object.assign({},t),{_scrollIndex:-1}))}}})),s}_isMultiple(){return this.getProp("multiple")}_isDisabled(){return this.getProp("disabled")}_isFilterable(){return Boolean(this.getProp("filter"))}handleClick(e){const{clickToHide:t}=this.getProps(),{isOpen:n}=this.getStates();this._isDisabled()||(n?n&&t?this.close({event:e}):n&&!t&&this.focusInput():(this.open(),this._notifyFocus(e)))}open(e,t){const n=this._isFilterable(),r=t||this.getState("options");if(n){const e="",t=this._filterOption(r,e).filter((e=>!e._inputCreateOnly));this._adapter.updateOptions(t),this.toggle2SearchInput(!0)}else this._adapter.updateFocusState(!0);this._adapter.openMenu((()=>{const{searchPosition:e,autoFocus:t}=this.getProps();t&&e===TC.SEARCH_POSITION_DROPDOWN&&this._adapter.focusDropdownInput()})),this._setDropdownWidth(),this._adapter.notifyDropdownVisibleChange(!0),this.bindKeyBoardEvent(),this._adapter.registerClickOutsideHandler((e=>{this.close({event:e}),this._notifyBlur(e),this._adapter.updateFocusState(!1)}))}toggle2SearchInput(e){e?this._adapter.toggleInputShow(e,(()=>this.focusInput())):this._adapter.toggleInputShow(e,(()=>{}))}close(e){const{event:t,closeCb:n,notToggleInput:r}=e||{},{isFocus:i}=this.getStates();this._adapter.closeMenu(),this._adapter.notifyDropdownVisibleChange(!1),this._adapter.setIsFocusInContainer(!1),i&&this._focusTrigger(),this._adapter.unregisterClickOutsideHandler();const s=this._isFilterable();s&&!r&&this.toggle2SearchInput(!1),this._adapter.once("popoverClose",(()=>{s&&this.clearInput(t),n&&n()}))}onSelect(e,t,n){if(this._isDisabled())return;e._inputCreateOnly&&this._adapter.notifyCreate(e);this._isMultiple()?this._handleMultipleSelect(e,n):this._handleSingleSelect(e,n),this._adapter.updateFocusIndex(t)}_handleSingleSelect(e,t){var{value:n,label:r}=e,i=IC(e,["value","label"]);const s=(new Map).set(r,Object.assign({value:n,label:r},i));this._notifySelect(n,Object.assign({value:n,label:r},i));const o=this._isFilterable();this._isControlledComponent()?this.close({event:t,notToggleInput:!0,closeCb:()=>{this._notifyChange(s),o&&this.toggle2SearchInput(!1)}}):(this._adapter.updateSelection(s),this._notifyChange(s),this.close({event:t,closeCb:()=>{this.updateOptionsActiveStatus(s)}}))}_handleMultipleSelect(e,t){var{value:n,label:r}=e,i=IC(e,["value","label"]);const s=this._adapter.getMaxLimit(),o=this._adapter.getSelections(),{autoClearSearchValue:a}=this.getProps();if(o.has(r))this._notifyDeselect(n,Object.assign({value:n,label:r},i)),o.delete(r);else{if(s&&o.size>=s)return void this._adapter.notifyMaxLimit(Object.assign({value:n,label:r},W()(i,"_scrollIndex")));this._notifySelect(n,Object.assign({value:n,label:r},i)),o.set(r,Object.assign({value:n,label:r},i))}if(this._isControlledComponent())this._notifyChange(o),this._isFilterable()&&(a&&this.clearInput(t),this.focusInput());else{this._adapter.updateSelection(o),this.updateOverflowItemCount(o.size),this._adapter.rePositionDropdown();let{options:e}=this.getStates();if(this._isFilterable()){if(a){this.clearInput(t);const n="";e=this._filterOption(e,n)}this.focusInput()}this.updateOptionsActiveStatus(o,e),this._notifyChange(o)}}clearSelected(){const e=new Map;this._isControlledComponent()?(this._notifyChange(e),this._adapter.notifyClear()):(this._adapter.updateSelection(e),this.updateOptionsActiveStatus(e),this._notifyChange(e),this._adapter.notifyClear());const{isOpen:t}=this.getStates();t&&this._adapter.rePositionDropdown()}updateOptionsActiveStatus(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getState("options");const{allowCreate:n}=this.getProps(),r=t.map((t=>(e.has(t.label)?(t._selected=!0,n&&delete t._inputCreateOnly):(t._inputCreateOnly&&(t._show=!1),t._selected=!1),t)));this._adapter.updateOptions(r)}removeTag(e){const t=this._adapter.getSelections();t.delete(e.label),this._isControlledComponent()?(this._notifyDeselect(e.value,e),this._notifyChange(t)):(this._notifyDeselect(e.value,e),this._adapter.updateSelection(t),this.updateOverflowItemCount(t.size),this.updateOptionsActiveStatus(t),this._adapter.rePositionDropdown(),this._notifyChange(t))}clearInput(e){const{inputValue:t}=this.getStates();if(""!==t){this._adapter.updateInputValue(""),this._adapter.notifySearch("",e);const{options:t}=this.getStates(),{remote:n}=this.getProps();let r=t;n||(r=this._filterOption(t,"")),this._adapter.updateOptions(r)}}focusInput(){this._adapter.focusInput(),this._adapter.updateFocusState(!0),this._adapter.setIsFocusInContainer(!1)}handleInputChange(e,t){this._adapter.updateInputValue(e);const{options:n,isOpen:r}=this.getStates(),{allowCreate:i,remote:s}=this.getProps();let o=n;s||(o=this._filterOption(n,e)),o=this._createOptionByInput(i,o,e),this._adapter.updateOptions(o),this._adapter.notifySearch(e,t),this._isMultiple()&&this._adapter.rePositionDropdown()}_filterOption(e,t){const n=this.getProp("filter");if(!n)return e;if("boolean"==typeof n&&n){const n=t.toLowerCase();return e.map((e=>{const t=e.label.toString().toLowerCase(),r=e._parentGroup&&e._parentGroup.label,i=t.includes(n),s=xe()(r)&&r.toLowerCase().includes(n);return e._show=!(!i&&!s),e}))}return"function"==typeof n?e.map((e=>(n(t,e)?e._show=!0:e._show=!1,e))):void 0}_createOptionByInput(e,t,n){if(e)if(n){const e={_show:!0,_selected:!1,value:n,label:n,_inputCreateOnly:!0};let r=-1,i=-1;t.forEach(((e,t)=>{(e._show||e._inputCreateOnly)&&(e.label===n&&(i=t),e._inputCreateOnly&&(r=t,e.value=n,e.label=n,e._show=!0))})),-1===r&&-1===i&&t.push(e),-1!==i&&(t=t.filter((e=>!e._inputCreateOnly)))}else t=t.filter((e=>!e._inputCreateOnly));return t}bindKeyBoardEvent(){this._keydownHandler=e=>{this._handleKeyDown(e)},this._adapter.registerKeyDown(this._keydownHandler)}unBindKeyBoardEvent(){this._keydownHandler&&this._adapter.unregisterKeyDown()}_handleKeyDown(e){const t=e.keyCode,{loading:n,filter:r,multiple:i,disabled:s}=this.getProps(),{isOpen:o}=this.getStates();if(!n&&!s)switch(t){case cn.UP:e.preventDefault(),this._handleArrowKeyDown(-1);break;case cn.DOWN:e.preventDefault(),this._handleArrowKeyDown(1);break;case cn.BACKSPACE:this._handleBackspaceKeyDown();break;case cn.ENTER:Le(e),this._handleEnterKeyDown(e);break;case cn.ESC:o&&this.close({event:e}),r&&!i&&this._focusTrigger();break;case cn.TAB:this._handleTabKeyDown(e)}}handleContainerKeyDown(e){const t=e.keyCode,{isOpen:n}=this.getStates();if(t===cn.TAB)n&&this._handleTabKeyDown(e)}_getEnableFocusIndex(e){const{focusIndex:t,options:n}=this.getStates(),r=n.filter((e=>e._show)),i=r.length;let s=t+e;if(s<0&&(s=i-1),s>=i&&(s=0),e>0){let e=-1;for(let t=0;t<r.length;t++){if(!r[t].disabled&&(e=t),e>=s)break}s=e}else{let e=r.length;for(let t=i-1;t>=0;t--){if(!r[t].disabled&&(e=t),e<=s)break}s=e}this._adapter.updateFocusIndex(s),this._adapter.updateScrollTop(s)}_handleArrowKeyDown(e){const{isOpen:t}=this.getStates();t?this._getEnableFocusIndex(e):this.open()}_handleTabKeyDown(e){const{isOpen:t}=this.getStates();if(this._adapter.updateFocusState(!1),t){const t=this._adapter.getContainer(),n=this._adapter.getFocusableElements(t);n.length>0?e.shiftKey?this._handlePanelOpenShiftTabKeyDown(n,e):this._handlePanelOpenTabKeyDown(n,e):(this.close({event:e}),this._notifyBlur(e))}else this._notifyBlur(e)}_handlePanelOpenTabKeyDown(e,t){const n=this._adapter.getActiveElement();this._adapter.getIsFocusInContainer()?n===e[e.length-1]&&(this._focusTrigger(),this.close({event:t}),Le(t)):(e[0].focus(),this._adapter.setIsFocusInContainer(!0),Le(t))}_handlePanelOpenShiftTabKeyDown(e,t){const n=this._adapter.getActiveElement();this._adapter.getIsFocusInContainer()?n===e[0]&&(this._focusTrigger(),this._adapter.setIsFocusInContainer(!1),Le(t)):(this.close({event:t}),this._notifyBlur(t))}_handleEnterKeyDown(e){const{isOpen:t,options:n,focusIndex:r}=this.getStates();if(t)if(-1!==r){const t=n.filter((e=>e._show)),{length:i}=t;if(i<=r)return;if(t&&i){const n=t[r];if(n.disabled)return;this.onSelect(n,r,e)}}else this.close({event:e});else this.open()}_handleBackspaceKeyDown(){if(this._isMultiple()){const e=this._adapter.getSelections(),{inputValue:t}=this.getStates(),n=e.size;if(n&&!t){const t=[...e.keys()];let r=n-1,i=t[r],s=e.get(i),o=!1;if(s.disabled&&0===r)return;for(;s.disabled&&0!==r;)r-=1,i=t[r],s=e.get(i),0==r&&s.disabled&&(o=!0);o||this.removeTag(s)}}}_notifyChange(e){const{onChangeWithObject:t}=this.getProps(),n=this.getState("selections");let r;const i=[...e.values()],s=this._isMultiple();if(this._diffSelections(e,n,s))switch(!0){case t:this._notifyChangeWithObject(e);break;case!t&&!s:r=i.length?i[0].value:void 0,this._adapter.notifyChange(r);break;case!t&&s:r=i.length?i.map((e=>e.value)):[],this._adapter.notifyChange(r)}}_removeInternalKey(e){let t=Object.assign({},e);return delete t._parentGroup,delete t._show,delete t._selected,delete t._scrollIndex,delete t._keyInJsx,"_keyInOptionList"in t&&(t.key=t._keyInOptionList,delete t._keyInOptionList),t}_notifySelect(e,t){const n=this._removeInternalKey(t);this._adapter.notifySelect(e,n)}_notifyDeselect(e,t){const n=this._removeInternalKey(t);this._adapter.notifyDeselect(e,n)}_diffSelections(e,t,n){let r=!0,i=!0;if(!n){const n=[...e.values()],s=[...t.values()],o=n[0]?n[0].value:n[0],a=s[0]?s[0].value:s[0];i=!Oe()(o,a);const l=n[0]?n[0].label:n[0],c=s[0]?s[0].label:s[0];r=!Oe()(l,c)}return i||r}_notifyChangeWithObject(e){this.getState("selections");const t=[];for(const n of e.entries()){let e=Object.assign({label:n[0]},n[1]);e=this._removeInternalKey(e),t.push(e)}this._isMultiple()?this._adapter.notifyChange(t):this._adapter.notifyChange(t[0])}_notifyBlur(e){this._adapter.notifyBlur(e)}_notifyFocus(e){this._adapter.notifyFocus(e)}handleMouseEnter(e){this._adapter.updateHovering(!0),this._adapter.notifyMouseEnter(e)}handleMouseLeave(e){this._adapter.updateHovering(!1),this._adapter.notifyMouseLeave(e)}handleClearClick(e){const{filter:t,searchPosition:n}=this.getProps();t&&n===TC.SEARCH_POSITION_TRIGGER&&this.clearInput(e),this.focus(void 0,!1),this.clearSelected(),e.stopPropagation()}handleKeyPress(e){e&&e.key===an&&this.handleClick(e)}handleClearBtnEnterPress(e){dn(e)&&this.handleClearClick(e)}handleOptionMouseEnter(e){this._adapter.updateFocusIndex(e)}handleListScroll(e){this._adapter.notifyListScroll(e)}handleTriggerFocus(e){this.bindKeyBoardEvent(),this._adapter.setIsFocusInContainer(!1)}handleTriggerBlur(e){const{filter:t,autoFocus:n}=this.getProps(),{isOpen:r,isFocus:i}=this.getStates();i&&!r&&(this._notifyBlur(e),this._adapter.updateFocusState(!1))}handleInputBlur(e){const{filter:t,autoFocus:n}=this.getProps(),{showInput:r,isOpen:i}=this.getStates(),s=this._isMultiple();t&&!s&&(!r&&!n||i||this.toggle2SearchInput(!1))}selectAll(){const{options:e}=this.getStates(),{onChangeWithObject:t}=this.getProps();let n=[];this._isMultiple()?(n=t?e:e.map((e=>e.value)),this.handleValueChange(n),this._adapter.notifyChange(n)):console.warn("[Semi Select]: It seems that you have called the selectAll method in the single-selection Select.\n Please note that this is not a legal way to use it")}checkMultipleProps(e){if(this._isMultiple()){const t=e||this.getProps(),{defaultValue:n,value:r}=t,i=r||n;Re(i)||Array.isArray(i)||Q(!0,"[Semi Select] defaultValue/value should be array type in multiple mode")}}updateScrollTop(){this._adapter.updateScrollTop()}updateOverflowItemCount(e,t){const{maxTagCount:n,ellipsisTrigger:r}=this.getProps();r&&(t?this._adapter.updateOverflowItemCount(t):"number"==typeof n&&(e-n>0?this._adapter.updateOverflowItemCount(e-n):this._adapter.updateOverflowItemCount(0)))}updateIsFullTags(){const{isFullTags:e}=this.getStates();e||this._adapter.setState({isFullTags:!0})}handlePopoverClose(){this._adapter.emit("popoverClose")}handleSlotMouseEnter(){this._adapter.updateFocusIndex(-1)}}const RC=Bd.PREFIX,AC=Vd,NC=Ud;class DC extends d.PureComponent{renderNTag(e,t){const{size:n,showPopover:r,popoverProps:i,onPlusNMouseEnter:s}=this.props;let o=h().createElement(Zd,{closable:!1,size:n,color:"grey",style:{backgroundColor:"transparent"},key:"_+n",onMouseEnter:s},"+",e);return r&&(o=h().createElement(Cn,Object.assign({showArrow:!0,content:t,trigger:"hover",position:"top",autoAdjustOverflow:!0,className:`${RC}-rest-group-popover`},i,{key:"_+n_Popover"}),o)),o}renderMergeTags(e){const{maxTagCount:t,tagList:n,restCount:r}=this.props,i=r||n.length-t;let s=e;const o=e.slice(0,t),a=e.slice(t);let l=null;return i>0&&(l=this.renderNTag(i,a),o.push(l),s=o),s}renderAllTags(){const{tagList:e,size:t,mode:n,avatarShape:r,onTagClose:i}=this.props,s=e.map((e=>{if("custom"===n)return e;const s=Object.assign({},e);return s.size||(s.size=t),s.avatarShape||(s.avatarShape=r),s.tagKey||("string"==typeof s.children||"number"==typeof s.children?s.tagKey=s.children:s.tagKey=Math.random()),h().createElement(Zd,Object.assign({},s,{key:s.tagKey,onClose:(e,t,n)=>{s.onClose&&s.onClose(e,t,n),i&&i(e,t,n)}}))}));return s}render(){const{style:e,className:t,maxTagCount:n,size:r}=this.props,i=w()({[`${RC}-group`]:!0,[`${RC}-group-max`]:n,[`${RC}-group-small`]:"small"===r,[`${RC}-group-large`]:"large"===r},t),s=this.renderAllTags(),o=void 0===n?s:this.renderMergeTags(s);return h().createElement("div",{style:e,className:i},o)}}DC.defaultProps={style:{},className:"",size:AC[0],avatarShape:"square",onTagClose:()=>{},onPlusNMouseEnter:()=>{}},DC.propTypes={children:E().node,style:E().object,className:E().string,maxTagCount:E().number,restCount:E().number,tagList:E().array,size:E().oneOf(AC),mode:E().string,onTagClose:E().func,showPopover:E().bool,popoverProps:E().object,avatarShape:E().oneOf(NC)};var LC=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const FC=(e,t,n,r)=>{const i=e.props;if(!e||!i)return null;const s=Object.assign(Object.assign({value:i.value,label:i.label||i.children||i.value,_show:!0,_selected:!1,_scrollIndex:n},i),{_parentGroup:t});return s._keyInJsx=r||e.key,s},jC=e=>{let{index:t,data:n,style:r}=e;const{visibleOptions:i,renderOption:s}=n;return s(i[t],t,r)};var $C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class BC extends d.PureComponent{onClick(e,t){var{value:n,label:r,children:i}=e,s=$C(e,["value","label","children"]);const{props:o}=this;o.disabled||o.onSelect(Object.assign(Object.assign({},s),{value:n,label:r||i}),t)}renderOptionContent(e){let{config:t,children:n,inputValue:r,prefixCls:i}=e;return xe()(n)&&r?h().createElement(Nr,{searchWords:t.searchWords,sourceString:t.sourceString,highlightClassName:t.highlightClassName}):n}render(){const e=this.props,{children:t,disabled:n,value:r,selected:i,label:s,empty:o,emptyContent:a,onSelect:l,focused:c,showTick:d,className:p,style:f,onMouseEnter:m,prefixCls:g,renderOptionItem:y,inputValue:v,semiOptionId:b}=e,x=$C(e,["children","disabled","value","selected","label","empty","emptyContent","onSelect","focused","showTick","className","style","onMouseEnter","prefixCls","renderOptionItem","inputValue","semiOptionId"]),E=w()(g,{[`${g}-disabled`]:n,[`${g}-selected`]:i,[`${g}-focused`]:c,[`${g}-empty`]:o,[p]:p}),C=w()([`${g}-icon`]);if(o)return null===a?null:h().createElement(Jt,{componentName:"Select"},(e=>h().createElement("div",{className:E,"x-semi-prop":"emptyContent"},a||e.emptyText)));if("function"==typeof y){const e=w()(p,{[`${g}-custom`]:!0,[`${g}-custom-selected`]:i});return y(Object.assign({disabled:n,focused:c,selected:i,style:f,label:s,value:r,inputValue:v,onMouseEnter:e=>m(e),onClick:e=>this.onClick(Object.assign({value:r,label:s,children:t},x),e),className:e},x))}const S={searchWords:[v],sourceString:t,highlightClassName:`${g}-keyword`};return h().createElement("div",Object.assign({className:E,onClick:e=>{this.onClick(Object.assign({value:r,label:s,children:t},x),e)},onMouseEnter:e=>m&&m(e),role:"option",id:b,"aria-selected":i?"true":"false","aria-disabled":n?"true":"false",style:f},u(x)),d?h().createElement("div",{className:C},h().createElement(sn,null)):null,xe()(t)?h().createElement("div",{className:`${g}-text`},this.renderOptionContent({children:t,config:S,inputValue:v,prefixCls:g})):t)}}BC.isSelectOption=!0,BC.propTypes={children:E().node,disabled:E().bool,value:E().oneOfType([E().string,E().number]),selected:E().bool,label:E().node,empty:E().bool,emptyContent:E().node,onSelect:E().func,focused:E().bool,showTick:E().bool,className:E().string,style:E().object,onMouseEnter:E().func,prefixCls:E().string,renderOptionItem:E().func,inputValue:E().string},BC.defaultProps={prefixCls:OC.PREFIX_OPTION};const VC=BC;var zC=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const HC=OC.PREFIX_GROUP;class UC extends f{render(){const e=this.props,{label:t,className:n,style:r}=e,i=zC(e,["label","className","style"]),s=w()(n,{[HC]:!0});return t||"number"==typeof t?h().createElement("div",Object.assign({className:s,style:r},this.getDataAttr(i)),t):null}}UC.isSelectOptionGroup=!0,UC.propTypes={children:E().oneOfType([E().array,E().node]),label:E().node,className:E().string,style:E().object};const KC=UC;const WC=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 2a8.5 8.5 0 1 0 4.86 15.48l4.08 4.08a1.5 1.5 0 1 0 2.12-2.12l-4.08-4.08A8.5 8.5 0 0 0 10.5 2ZM5 10.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",fill:"currentColor"}))}),"search");__webpack_require__("1Mf8");var GC=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const qC=OC.PREFIX;class XC extends f{constructor(e){super(e),this.setOptionContainerEl=e=>this.optionContainerEl={current:e},this.handleInputChange=(e,t)=>this.foundation.handleInputChange(e,t),this.getTagItem=(e,t,n)=>{const{size:r,disabled:i}=this.props,s=e[0],{value:o}=e[1],a=e[1].disabled||i,l=(e,t)=>{t&&"function"==typeof t.preventDefault&&t.preventDefault(),this.foundation.removeTag({label:s,value:o})},{content:c,isRenderInTag:u}=n(e[1],{index:t,disabled:a,onClose:l}),p={disabled:a,closable:!a,onClose:l};return u?h().createElement(Zd,Object.assign({},p,{color:"white",size:r||"large",key:o,tabIndex:-1}),c):h().createElement(d.Fragment,{key:o},c)},this.state={isOpen:!1,isFocus:!1,options:[],selections:new Map,dropdownMinWidth:null,optionKey:0,inputValue:"",showInput:!1,focusIndex:e.defaultActiveFirstOption?0:-1,keyboardEventSet:{},optionGroups:[],isHovering:!1,isFocusInContainer:!1,isFullTags:!1,overflowItemCount:0},this.selectOptionListID="",this.selectID="",this.virtualizeListRef=h().createRef(),this.inputRef=h().createRef(),this.dropdownInputRef=h().createRef(),this.triggerRef=h().createRef(),this.optionsRef=h().createRef(),this.optionContainerEl=h().createRef(),this.clickOutsideHandler=null,this.onSelect=this.onSelect.bind(this),this.onClear=this.onClear.bind(this),this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.renderOption=this.renderOption.bind(this),this.onKeyPress=this.onKeyPress.bind(this),this.eventManager=new Ae,this.foundation=new MC(this.adapter)}get adapter(){var e=this;const t={registerKeyDown:e=>{const t={onKeyDown:e};this.setState({keyboardEventSet:t})},unregisterKeyDown:()=>{this.setState({keyboardEventSet:{}})},updateFocusIndex:e=>{this.setState({focusIndex:e})},scrollToFocusOption:()=>{}},n={updateInputValue:e=>{this.setState({inputValue:e})},toggleInputShow:(e,t)=>{this.setState({showInput:e},(()=>{t()}))},focusInput:()=>{const{preventScroll:e}=this.props;this.inputRef&&this.inputRef.current&&this.inputRef.current.focus({preventScroll:e})},focusDropdownInput:()=>{const{preventScroll:e}=this.props;this.dropdownInputRef&&this.dropdownInputRef.current&&this.dropdownInputRef.current.focus({preventScroll:e})}},r={notifyMaxLimit:e=>this.props.onExceed(e),getMaxLimit:()=>this.props.max,registerClickOutsideHandler:e=>{const t=t=>{const n=this.triggerRef&&this.triggerRef.current,r=this.optionContainerEl&&this.optionContainerEl.current,i=t.target,s=t.composedPath&&t.composedPath()||[i];r&&r.contains(i)||n&&n.contains(i)||s.includes(n)||s.includes(r)||e(t)};this.clickOutsideHandler=t,document.addEventListener("mousedown",t,!1)},unregisterClickOutsideHandler:()=>{this.clickOutsideHandler&&(document.removeEventListener("mousedown",this.clickOutsideHandler,!1),this.clickOutsideHandler=null)},rePositionDropdown:()=>{let{optionKey:e}=this.state;e+=1,this.setState({optionKey:e})},notifyDeselect:(e,t)=>{delete t._parentGroup,this.props.onDeselect(e,t)}};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},super.adapter),t),n),r),{on:(e,t)=>this.eventManager.on(e,t),off:e=>this.eventManager.off(e),once:(e,t)=>this.eventManager.once(e,t),emit:e=>this.eventManager.emit(e),getOptionsFromChildren:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.props.children,n=[],r=[];const{optionList:i}=e.props;if(i&&i.length)r=i.map(((e,t)=>Object.assign({_show:!0,_selected:!1,_scrollIndex:t},e))),n[0]={children:r,label:""};else{const e=(e=>{let t=[],n=[];const r={label:"",children:[],_show:!1};let i=h().Children.toArray(e);i=i.filter((e=>e&&e.props));let s="",o=-1;return i.forEach((e=>{if(e.type.isSelectOption){s="option",o++;const t=FC(e,void 0,o);r.children.push(t),n.push(t)}else if(e.type.isSelectOptionGroup){s="group";let r=e.props,{children:i}=r,a=LC(r,["children"]);a.key=e.key;let l=[];Array.isArray(i)?l=i.map((e=>e.key)):l.push(i.key),i=h().Children.toArray(i);const c=i.map(((t,n)=>{let r=t.key;return null===l[n]&&(r=e.key+""+t.key),o++,FC(t,a,o,r)})),d=Object.assign(Object.assign({},e.props),{children:c,key:e.key});t.push(d),n=n.concat(c)}else Q(!0,"[Semi Select] The children of `Select` should be `Select.Option` or `Select.OptionGroup`")})),"option"===s&&(t=[r]),{optionGroups:t,options:n}})(t);n=e.optionGroups,r=e.options}return e.setState({optionGroups:n}),r},updateOptions:e=>{this.setState({options:e})},openMenu:e=>{this.setState({isOpen:!0},(()=>{null==e||e()}))},closeMenu:()=>{this.setState({isOpen:!1})},getTriggerWidth:()=>{const e=this.triggerRef.current;return e&&e.getBoundingClientRect().width},setOptionWrapperWidth:e=>{this.setState({dropdownMinWidth:e})},updateSelection:e=>{this.setState({selections:e})},getSelections:()=>new Map(this.state.selections),notifyChange:e=>{this.props.onChange(e)},notifySelect:(e,t)=>{delete t._parentGroup,this.props.onSelect(e,t)},notifyDropdownVisibleChange:e=>{this.props.onDropdownVisibleChange(e)},notifySearch:(e,t)=>{this.props.onSearch(e,t)},notifyCreate:e=>{this.props.onCreate(e)},notifyMouseEnter:e=>{this.props.onMouseEnter(e)},notifyMouseLeave:e=>{this.props.onMouseLeave(e)},notifyFocus:e=>{this.props.onFocus(e)},notifyBlur:e=>{this.props.onBlur(e)},notifyClear:()=>{this.props.onClear()},notifyListScroll:e=>{this.props.onListScroll(e)},updateHovering:e=>{this.setState({isHovering:e})},updateFocusState:e=>{this.setState({isFocus:e})},updateOverflowItemCount:e=>{this.setState({overflowItemCount:e})},focusTrigger:()=>{try{const{preventScroll:e}=this.props;this.triggerRef.current.focus({preventScroll:e})}catch(e){}},getContainer:()=>this.optionContainerEl&&this.optionContainerEl.current,getFocusableElements:e=>le(e),getActiveElement:()=>ae(),setIsFocusInContainer:e=>{this.setState({isFocusInContainer:e})},getIsFocusInContainer:()=>this.state.isFocusInContainer,updateScrollTop:e=>{let t;"renderOptionItem"in this.props?(t=`.${qC}-option-custom-selected`,void 0!==e&&(t=`.${qC}-option-custom:nth-child(${e+1})`)):(t=`.${qC}-option-selected`,void 0!==e&&(t=`.${qC}-option:nth-child(${e+1})`));let n=document.querySelector(`#${qC}-${this.selectOptionListID} ${t}`);if(Array.isArray(n)&&(n=n[0]),n){const e=n.parentNode;e.scrollTop=n.offsetTop-e.offsetTop-e.clientHeight/2+n.clientHeight/2}}})}componentDidMount(){this.foundation.init(),this.selectOptionListID=We(),this.selectID=this.props.id||We()}componentWillUnmount(){this.foundation.destroy()}componentDidUpdate(e,t){const n=h().Children.toArray(e.children).map((e=>e.key)),r=h().Children.toArray(this.props.children).map((e=>e.key));let i=!1;Oe()(n,r)&&Oe()(e.optionList,this.props.optionList)||(i=!0,this.foundation.handleOptionListChange()),Oe()(this.props.value,e.value)&&!i||("value"in this.props?this.foundation.handleValueChange(this.props.value):this.foundation.handleOptionListChangeHadDefaultValue())}renderTriggerInput(){const{size:e,multiple:t,disabled:n,inputProps:r,filter:i}=this.props,s=o()(r,"className"),a=w()(`${qC}-input`,{[`${qC}-input-single`]:!t,[`${qC}-input-multiple`]:t},s),{inputValue:l,focusIndex:c}=this.state,d=Object.assign({value:l,disabled:n,className:a,onChange:this.handleInputChange},r);let u={};return t&&(u={width:l?16*l.length+"px":"2px"},d.style=u),h().createElement(kr,Object.assign({ref:this.inputRef,size:e,"aria-activedescendant":-1!==c?`${this.selectID}-option-${c}`:"",onFocus:e=>{t&&Boolean(i)&&this.setState({isFocus:!0}),e.stopPropagation()},onBlur:e=>this.foundation.handleInputBlur(e)},d))}renderDropdownInput(){const{size:e,multiple:t,disabled:n,inputProps:r,filter:i,searchPosition:s,searchPlaceholder:a}=this.props,{inputValue:l,focusIndex:c}=this.state,d=w()(`${qC}-dropdown-search-wrapper`,{}),u=o()(r,"className"),p=w()(`${qC}-dropdown-input`,{[`${qC}-dropdown-input-single`]:!t,[`${qC}-dropdown-input-multiple`]:t},u),f=Object.assign(Object.assign({value:l,disabled:n,className:p,onChange:this.handleInputChange,placeholder:a,showClear:!0},r),{onKeyDown:e=>this.foundation._handleKeyDown(e)});return h().createElement("div",{className:d},h().createElement(kr,Object.assign({ref:this.dropdownInputRef,prefix:h().createElement(WC,null),"aria-activedescendant":-1!==c?`${this.selectID}-option-${c}`:""},f)))}close(){this.foundation.close()}open(){this.foundation.open()}clearInput(){this.foundation.clearInput()}selectAll(){this.foundation.selectAll()}deselectAll(){this.foundation.clearSelected()}focus(){this.foundation.focus()}rePosition(){let{optionKey:e}=this.state;e+=1,this.setState({optionKey:e})}onSelect(e,t,n){this.foundation.onSelect(e,t,n)}onClear(e){e.nativeEvent.stopImmediatePropagation(),this.foundation.handleClearClick(e)}search(e,t){this.handleInputChange(e,t)}renderEmpty(){return h().createElement(VC,{empty:!0,emptyContent:this.props.emptyContent})}renderLoading(){const e=`${qC}-loading-wrapper`;return h().createElement("div",{className:e},h().createElement(dr,null))}renderOption(e,t,n){const{focusIndex:r,inputValue:i}=this.state,{renderOptionItem:s}=this.props;let o;const a=t===r;let l=n||{};return e.style&&(l=Object.assign(Object.assign({},l),e.style)),e._inputCreateOnly?o=this.renderCreateOption(e,a,t,n):("key"in e&&(e._keyInOptionList=e.key),o=h().createElement(VC,Object.assign({showTick:!0},e,{selected:e._selected,onSelect:(e,n)=>this.onSelect(e,t,n),focused:a,onMouseEnter:()=>this.onOptionHover(t),style:l,key:e._keyInOptionList||e._keyInJsx||e.label+e.value+t,renderOptionItem:s,inputValue:i,semiOptionId:`${this.selectID}-option-${t}`}),e.label)),o}renderCreateOption(e,t,n,r){const{renderCreateItem:i}=this.props;if(void 0===i){const i=h().createElement(VC,Object.assign({key:e.key||e.label+e.value,onSelect:(e,t)=>this.onSelect(e,n,t),onMouseEnter:()=>this.onOptionHover(n),showTick:!0},e,{focused:t,style:r}),h().createElement(Jt,{componentName:"Select"},(t=>h().createElement(h().Fragment,null,h().createElement("span",{className:`${qC}-create-tips`},t.createText),e.value))));return i}const s=i(e.value,t,r);return h().createElement("div",{role:"button","aria-label":"Use the input box to create an optional item",onClick:t=>this.onSelect(e,n,t),key:e.key||e.label},s)}onOptionHover(e){this.foundation.handleOptionMouseEnter(e)}renderWithGroup(e){const t=[],n=new Map;return e.forEach(((e,r)=>{const i=e._parentGroup,s=this.renderOption(e,r);if(i&&!n.has(i.label)){const e="string"==typeof i.label||"number"==typeof i.label?i.label:i.key,r=h().createElement(KC,Object.assign({},i,{key:e}));n.set(i.label,!0),t.push(r)}t.push(s)})),t}renderVirtualizeList(e){const{virtualize:t}=this.props,{direction:n}=this.context,{height:r,width:i,itemSize:s}=t;return h().createElement(Ld,{ref:this.virtualizeListRef,height:r||PC,itemCount:e.length,itemSize:s,itemData:{visibleOptions:e,renderOption:this.renderOption},width:i||"100%",style:{direction:n}},jC)}renderOptions(e){const{dropdownMinWidth:t,options:n,selections:r}=this.state,{maxHeight:i,dropdownClassName:s,dropdownStyle:o,outerTopSlot:a,innerTopSlot:l,outerBottomSlot:c,innerBottomSlot:d,loading:u,virtualize:p,multiple:f,emptyContent:m,searchPosition:g,filter:y}=this.props,v=n.filter((e=>e._show));let b=this.renderWithGroup(v);p&&(b=this.renderVirtualizeList(v));const x=Object.assign({minWidth:t},o),E=w()({[`${qC}-option-list`]:!0,[`${qC}-option-list-chosen`]:r.size}),C=!n.length||!n.some((e=>e._show));return h().createElement("div",{id:`${qC}-${this.selectOptionListID}`,className:w()({[`${qC}-option-list-wrapper`]:!(C&&null===m)},s),style:x,ref:this.setOptionContainerEl,onKeyDown:e=>this.foundation.handleContainerKeyDown(e)},a?h().createElement("div",{className:`${qC}-option-list-outer-top-slot`,onMouseEnter:()=>this.foundation.handleSlotMouseEnter()},a):null,g===TC.SEARCH_POSITION_DROPDOWN&&y?this.renderDropdownInput():null,h().createElement("div",{style:{maxHeight:`${i}px`},className:E,role:"listbox","aria-multiselectable":f,onScroll:e=>this.foundation.handleListScroll(e)},l?h().createElement("div",{className:`${qC}-option-list-inner-top-slot`,onMouseEnter:()=>this.foundation.handleSlotMouseEnter()},l):null,u?this.renderLoading():C?this.renderEmpty():b,d?h().createElement("div",{className:`${qC}-option-list-inner-bottom-slot`,onMouseEnter:()=>this.foundation.handleSlotMouseEnter()},d):null),c?h().createElement("div",{className:`${qC}-option-list-outer-bottom-slot`,onMouseEnter:()=>this.foundation.handleSlotMouseEnter()},c):null)}renderSingleSelection(e,t){let{renderSelectedItem:n,searchPosition:r}=this.props;const{placeholder:i}=this.props,{showInput:s,inputValue:o}=this.state;let a="";const l=[...e];if(void 0===n&&(n=e=>e.label),l.length){a=n(l[0][1])}const c=r===TC.SEARCH_POSITION_TRIGGER,d=w()({[`${qC}-selection-text`]:!0,[`${qC}-selection-placeholder`]:!a&&0!==a,[`${qC}-selection-text-hide`]:o&&s&&c,[`${qC}-selection-text-inactive`]:!o&&s&&c}),u=`${qC}-content-wrapper`;return h().createElement(h().Fragment,null,h().createElement("div",{className:u},h().createElement("span",{className:d,"x-semi-prop":"placeholder"},a||0===a?a:i),t&&s&&c?this.renderTriggerInput():null))}renderTag(e,t,n){const{size:r,disabled:i}=this.props;let{renderSelectedItem:s}=this.props;const o=e[0],{value:a}=e[1],l=e[1].disabled||i,c=(e,t)=>{t&&"function"==typeof t.preventDefault&&t.preventDefault(),this.foundation.removeTag({label:o,value:a})};void 0===s&&(s=e=>({isRenderInTag:!0,content:e.label}));const{content:u,isRenderInTag:p}=s(e[1],{index:t,disabled:l,onClose:c}),f={disabled:l,closable:!l,onClose:c},m=n&&!ye()(this.props.renderSelectedItem)?h().createElement(Nn,{size:"small",ellipsis:{rows:1,showTooltip:{type:"popover",opts:{style:{width:"auto",fontSize:12}}}}},u):u;return p?h().createElement(Zd,Object.assign({},f,{color:"white",size:r||"large",key:a,style:{maxWidth:"100%"}}),m):h().createElement(d.Fragment,{key:a},m)}renderNTag(e,t){const{size:n,showRestTagsPopover:r,restTagsPopoverProps:i}=this.props;let s=h().createElement(Zd,{closable:!1,size:n||"large",color:"grey",className:`${qC}-content-wrapper-collapse-tag`,key:`_+${e}`,style:{marginRight:0,flexShrink:0}},"+",e);return r&&(s=h().createElement(Cn,Object.assign({showArrow:!0,content:h().createElement(il,{spacing:2,wrap:!0,style:{maxWidth:"400px"}},t.map(((e,t)=>this.renderTag(e,t)))),trigger:"hover",position:"top",autoAdjustOverflow:!0},i,{key:`_+${e}_Popover`}),s)),s}renderOverflow(e,t){return e.length&&e[0]?this.renderTag(e[0],t,!0):null}handleOverflow(e){const{overflowItemCount:t,selections:n}=this.state,{maxTagCount:r}=this.props,i=n.size-r>0?n.size-r+e.length-1:e.length-1;t!==i&&this.foundation.updateOverflowItemCount(n.size,i)}renderCollapsedTags(e,t){const{overflowItemCount:n}=this.state,r="number"==typeof t?e.slice(0,t):e;return h().createElement("div",{className:`${qC}-content-wrapper-collapse`},h().createElement(CC,{items:r,itemKey:e=>{var t;return null===(t=null==e?void 0:e[1])||void 0===t?void 0:t.value},overflowRenderer:e=>this.renderOverflow(e,t-1),onOverflow:e=>this.handleOverflow(e),visibleItemRenderer:(e,t)=>this.renderTag(e,t)}),n>0&&this.renderNTag(n,e.slice(e.length-n)))}renderOneLineTags(e,t){let{renderSelectedItem:n}=this.props;const{showRestTagsPopover:r,restTagsPopoverProps:i,maxTagCount:s}=this.props,{isFullTags:o}=this.state;let a;if(void 0===n&&(n=e=>({isRenderInTag:!0,content:e.label})),r){const l=(o?e:e.slice(0,s)).map(((e,t)=>this.getTagItem(e,t,n)));a=h().createElement(DC,{tagList:l,maxTagCount:t,restCount:o?void 0:e.length-s,size:"large",mode:"custom",showPopover:r,popoverProps:i,onPlusNMouseEnter:()=>{this.foundation.updateIsFullTags()}})}else{const r=e.slice(0,s).map(((e,t)=>this.getTagItem(e,t,n)));a=h().createElement(DC,{tagList:r,maxTagCount:t,restCount:e.length-s,size:"large",mode:"custom"})}return a}renderMultipleSelection(e,t){let{renderSelectedItem:n,searchPosition:r}=this.props;const{placeholder:i,maxTagCount:s,expandRestTagsOnClick:o,ellipsisTrigger:a}=this.props,{inputValue:l,isOpen:c}=this.state,d=[...e];void 0===n&&(n=e=>({isRenderInTag:!0,content:e.label}));const u=w()({[`${qC}-content-wrapper`]:!0,[`${qC}-content-wrapper-one-line`]:s&&!c,[`${qC}-content-wrapper-empty`]:!d.length}),p=w()({[`${qC}-selection-text`]:!0,[`${qC}-selection-placeholder`]:!d.length,[`${qC}-selection-text-hide`]:d&&d.length}),f=i&&!l?h().createElement("span",{className:p},i):null,m=d.length>s?s:void 0,g=!s,y=a?this.renderCollapsedTags(d,m):this.renderOneLineTags(d,m),v=g||o&&c?d.map(((e,t)=>this.renderTag(e,t))):y,b=t&&r===TC.SEARCH_POSITION_TRIGGER;return h().createElement(h().Fragment,null,h().createElement("div",{className:u},d&&d.length?v:f,b?this.renderTriggerInput():null))}onMouseEnter(e){this.foundation.handleMouseEnter(e)}onMouseLeave(e){this.foundation.handleMouseLeave(e)}onKeyPress(e){this.foundation.handleKeyPress(e)}handlePopoverVisibleChange(e){const{virtualize:t}=this.props,{selections:n}=this.state;if(e)if(t){let e=-1;if(n.forEach((t=>{const n=o()(t,"_scrollIndex");er()(n)&&n>=0&&(e=-1!==e&&e<n?e:n)})),-1!==e)try{this.virtualizeListRef.current.scrollToItem(e,"center")}catch(e){}}else this.foundation.updateScrollTop()}renderSuffix(){const{suffix:e}=this.props,t=w()({[`${qC}-suffix`]:!0,[`${qC}-suffix-text`]:e&&xe()(e),[`${qC}-suffix-icon`]:oe(e)});return h().createElement("div",{className:t,"x-semi-prop":"suffix"},e)}renderPrefix(){const{prefix:e,insetLabel:t,insetLabelId:n}=this.props,r=e||t,i=w()({[`${qC}-prefix`]:!0,[`${qC}-inset-label`]:t,[`${qC}-prefix-text`]:r&&xe()(r),[`${qC}-prefix-icon`]:oe(r)});return h().createElement("div",{className:i,id:n,"x-semi-prop":"prefix,insetLabel"},r)}renderSelection(){const e=this.props,{disabled:t,multiple:n,filter:r,style:i,id:s,size:o,className:a,validateStatus:l,showArrow:c,suffix:u,prefix:p,insetLabel:f,placeholder:m,triggerRender:g,arrowIcon:y,clearIcon:v,borderless:b}=e,x=GC(e,["disabled","multiple","filter","style","id","size","className","validateStatus","showArrow","suffix","prefix","insetLabel","placeholder","triggerRender","arrowIcon","clearIcon","borderless"]),{selections:E,isOpen:C,keyboardEventSet:S,inputValue:_,isHovering:k,isFocus:O,showInput:T,focusIndex:P}=this.state,I="function"==typeof g,M=Boolean(r),R=I?w()(a):w()(qC,a,{[`${qC}-borderless`]:b,[`${qC}-open`]:C,[`${qC}-focus`]:O,[`${qC}-disabled`]:t,[`${qC}-single`]:!n,[`${qC}-multiple`]:n,[`${qC}-filterable`]:M,[`${qC}-small`]:"small"===o,[`${qC}-large`]:"large"===o,[`${qC}-error`]:"error"===l,[`${qC}-warning`]:"warning"===l,[`${qC}-no-arrow`]:!c,[`${qC}-with-prefix`]:p||f,[`${qC}-with-suffix`]:u}),A=this.props.showClear&&(E.size||_)&&!t&&(k||C),N=c?h().createElement("div",{className:`${qC}-arrow`,"x-semi-prop":"arrowIcon"},y):h().createElement("div",{className:`${qC}-arrow-empty`}),D=v||h().createElement(gr,null),L=I?h().createElement(Pr,{value:Array.from(E.values()),inputValue:_,onChange:this.handleInputChange,onSearch:this.handleInputChange,onRemove:e=>this.foundation.removeTag(e),onClear:this.onClear,disabled:t,triggerRender:g,placeholder:m,componentName:"Select",componentProps:Object.assign({},this.props)}):[h().createElement(d.Fragment,{key:"prefix"},p||f?this.renderPrefix():null),h().createElement(d.Fragment,{key:"selection"},h().createElement("div",{className:w()(`${qC}-selection`)},n?this.renderMultipleSelection(E,M):this.renderSingleSelection(E,M))),h().createElement(d.Fragment,{key:"suffix"},u?this.renderSuffix():null),h().createElement(d.Fragment,{key:"clearicon"},A?h().createElement("div",{className:w()(`${qC}-clear`),onClick:this.onClear},D):N)],F=t||M&&T||M&&n?-1:0;return h().createElement("div",Object.assign({role:"combobox","aria-disabled":t,"aria-expanded":C,"aria-controls":`${qC}-${this.selectOptionListID}`,"aria-haspopup":"listbox","aria-label":E.size?"selected":"","aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],"aria-required":this.props["aria-required"],className:R,ref:e=>{this.triggerRef.current=e},onClick:e=>this.foundation.handleClick(e),style:i,id:this.selectID,tabIndex:F,"aria-activedescendant":-1!==P?`${this.selectID}-option-${P}`:"",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onFocus:e=>this.foundation.handleTriggerFocus(e),onBlur:e=>this.foundation.handleTriggerBlur(e),onKeyPress:this.onKeyPress},S,this.getDataAttr(x)),L)}render(){const{direction:e}=this.context,t="rtl"===e?"bottomRight":"bottomLeft",{children:n,position:r=t,zIndex:i,getPopupContainer:s,motion:o,autoAdjustOverflow:a,mouseLeaveDelay:l,mouseEnterDelay:c,spacing:d,stopPropagation:u,dropdownMargin:p,rePosKey:f}=this.props,{isOpen:m,optionKey:g}=this.state,y=this.renderSelection(),v=void 0!==f?`${g}-${f}`:g;return h().createElement(Cn,{getPopupContainer:s,motion:o,margin:p,autoAdjustOverflow:a,mouseLeaveDelay:l,mouseEnterDelay:c,zIndex:i,ref:this.optionsRef,content:()=>this.renderOptions(n),visible:m,trigger:"custom",rePosKey:v,position:r,spacing:d,stopPropagation:u,disableArrowKeyDown:!0,onVisibleChange:e=>this.handlePopoverVisibleChange(e),afterClose:()=>this.foundation.handlePopoverClose()},y)}}XC.contextType=lt,XC.Option=VC,XC.OptGroup=KC,XC.propTypes={"aria-describedby":E().string,"aria-errormessage":E().string,"aria-invalid":E().bool,"aria-labelledby":E().string,"aria-required":E().bool,autoFocus:E().bool,autoClearSearchValue:E().bool,borderless:E().bool,children:E().node,clearIcon:E().node,defaultValue:E().oneOfType([E().string,E().number,E().array,E().object]),ellipsisTrigger:E().bool,value:E().oneOfType([E().string,E().number,E().array,E().object]),placeholder:E().node,onChange:E().func,multiple:E().bool,filter:E().oneOfType([E().func,E().bool]),max:E().number,maxTagCount:E().number,maxHeight:E().oneOfType([E().string,E().number]),style:E().object,className:E().string,size:E().oneOf(TC.SIZE_SET),disabled:E().bool,emptyContent:E().node,expandRestTagsOnClick:E().bool,onDropdownVisibleChange:E().func,zIndex:E().number,position:E().oneOf(TC.POSITION_SET),onSearch:E().func,getPopupContainer:E().func,dropdownClassName:E().string,dropdownStyle:E().object,dropdownMargin:E().oneOfType([E().number,E().object]),outerTopSlot:E().node,innerTopSlot:E().node,inputProps:E().object,outerBottomSlot:E().node,innerBottomSlot:E().node,optionList:E().array,dropdownMatchSelectWidth:E().bool,loading:E().bool,defaultOpen:E().bool,validateStatus:E().oneOf(TC.STATUS),defaultActiveFirstOption:E().bool,triggerRender:E().func,stopPropagation:E().bool,searchPosition:E().string,motion:E().bool,onChangeWithObject:E().bool,suffix:E().node,prefix:E().node,insetLabel:E().node,insetLabelId:E().string,showClear:E().bool,showArrow:E().bool,renderSelectedItem:E().func,allowCreate:E().bool,renderCreateItem:E().func,onMouseEnter:E().func,onMouseLeave:E().func,clickToHide:E().bool,onExceed:E().func,onCreate:E().func,remote:E().bool,onDeselect:E().func,onSelect:E().func,autoAdjustOverflow:E().bool,mouseEnterDelay:E().number,mouseLeaveDelay:E().number,spacing:E().oneOfType([E().number,E().object]),rePosKey:E().oneOfType([E().string,E().number]),onBlur:E().func,onFocus:E().func,onClear:E().func,virtualize:E().object,renderOptionItem:E().func,onListScroll:E().func,arrowIcon:E().node,preventScroll:E().bool},XC.__SemiComponentName__="Select",XC.defaultProps=he(XC.__SemiComponentName__,{stopPropagation:!0,motion:!0,borderless:!1,zIndex:gn.DEFAULT_Z_INDEX,filter:!1,multiple:!1,disabled:!1,defaultOpen:!1,allowCreate:!1,placeholder:"",onDropdownVisibleChange:i(),onChangeWithObject:!1,onChange:i(),onSearch:i(),onMouseEnter:i(),onMouseLeave:i(),onDeselect:i(),onSelect:i(),onCreate:i(),onExceed:i(),onFocus:i(),onBlur:i(),onClear:i(),onListScroll:i(),maxHeight:PC,dropdownMatchSelectWidth:!0,defaultActiveFirstOption:!0,showArrow:!0,showClear:!1,searchPosition:TC.SEARCH_POSITION_TRIGGER,remote:!1,autoAdjustOverflow:!0,autoClearSearchValue:!0,arrowIcon:h().createElement(Hc,{"aria-label":""}),showRestTagsPopover:!1,restTagsPopoverProps:{},expandRestTagsOnClick:!1,ellipsisTrigger:!1});const YC=XC;var ZC=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const JC=SC.PREFIX,{Option:QC}=YC;class eS extends f{constructor(e){super(e);const t=e.total,n=e.pageSize||e.pageSizeOpts[0]||_C.DEFAULT_PAGE_SIZE,r="small"===e.size&&e.hoverShowPageSelect&&!e.disabled;this.state={total:t,showTotal:e.showTotal,currentPage:e.currentPage||e.defaultCurrentPage,pageSize:n,pageList:[],prevDisabled:!1,nextDisabled:!1,restLeftPageList:[],restRightPageList:[],quickJumpPage:"",allPageNumbers:r?Array.from({length:Math.ceil(t/n)},((e,t)=>t+1)):[]},this.foundation=new kC(this.adapter),this.renderDefaultPage=this.renderDefaultPage.bind(this),this.renderSmallPage=this.renderSmallPage.bind(this),Q(Boolean(e.showSizeChanger&&e.hideOnSinglePage),"[Semi Pagination] You should not use showSizeChanger and hideOnSinglePage in ths same time. At this time, hideOnSinglePage no longer takes effect, otherwise there may be a problem that the switch entry disappears")}get adapter(){return Object.assign(Object.assign({},super.adapter),{setPageList:e=>{const{pageList:t,restLeftPageList:n,restRightPageList:r}=e;this.setState({pageList:t,restLeftPageList:n,restRightPageList:r})},setDisabled:(e,t)=>{this.setState({prevDisabled:e,nextDisabled:t})},updateTotal:e=>this.setState({total:e}),updatePageSize:e=>this.setState({pageSize:e}),updateQuickJumpPage:e=>this.setState({quickJumpPage:e}),updateAllPageNumbers:e=>this.setState({allPageNumbers:e}),setCurrentPage:e=>{this.setState({currentPage:e})},registerKeyDownHandler:e=>{document.addEventListener("keydown",e)},unregisterKeyDownHandler:e=>{document.removeEventListener("keydown",e)},notifyPageChange:e=>{this.props.onPageChange(e)},notifyPageSizeChange:e=>{this.props.onPageSizeChange(e)},notifyChange:(e,t)=>{this.props.onChange(e,t)}})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}componentDidUpdate(e){const t={currentPage:this.props.currentPage,total:this.props.total,pageSize:this.props.pageSize};let n=!1,r=!1;e.currentPage!==this.props.currentPage&&(n=!0),e.total!==this.props.total&&(n=!0,r=!0),e.pageSize!==this.props.pageSize&&(n=!0,r=!0),n&&this.foundation.updatePage(t.currentPage,t.total,t.pageSize),r&&this.foundation.updateAllPageNumbers(t.total,t.pageSize)}renderPrevBtn(){const{prevText:e,disabled:t}=this.props,{prevDisabled:n}=this.state,r=n||t,i=w()({[`${JC}-item`]:!0,[`${JC}-prev`]:!0,[`${JC}-item-disabled`]:r});return h().createElement("li",{role:"button","aria-disabled":!!r,"aria-label":"Previous",onClick:e=>!r&&this.foundation.goPrev(e),className:i,"x-semi-prop":"prevText"},e||h().createElement(Rl,{size:"large"}))}renderNextBtn(){const{nextText:e,disabled:t}=this.props,{nextDisabled:n}=this.state,r=n||t,i=w()({[`${JC}-item`]:!0,[`${JC}-item-disabled`]:r,[`${JC}-next`]:!0});return h().createElement("li",{role:"button","aria-disabled":!!r,"aria-label":"Next",onClick:e=>!r&&this.foundation.goNext(e),className:i,"x-semi-prop":"nextText"},e||h().createElement(Al,{size:"large"}))}renderPageSizeSwitch(e){const{direction:t}=this.context,n="rtl"===t?"bottomRight":"bottomLeft",{showSizeChanger:r,popoverPosition:i=n,disabled:s,popoverZIndex:o}=this.props,{pageSize:a}=this.state,l=w()(`${JC}-switch`);if(!r)return null;const c=this.foundation.pageSizeInOpts(),d=e.pageSize,u=c.map((e=>h().createElement(QC,{value:e,key:e},h().createElement("span",null,d.replace("${pageSize}",e.toString())))));return h().createElement("div",{className:l},h().createElement(YC,{"aria-label":"Page size selector",disabled:s,onChange:e=>this.foundation.changePageSize(e),value:a,key:a+d,position:i||"bottomRight",clickToHide:!0,zIndex:o,dropdownClassName:`${JC}-select-dropdown`},u))}renderQuickJump(e){const{showQuickJumper:t,disabled:n}=this.props,{quickJumpPage:r,total:i,pageSize:s}=this.state;if(!t)return null;const o=1===this.foundation._getTotalPageNumber(i,s)||n,a=w()({[`${JC}-quickjump`]:!0,[`${JC}-quickjump-disabled`]:o});return h().createElement("div",{className:a},h().createElement("span",null,e.jumpTo),h().createElement(pE,{value:r,className:`${JC}-quickjump-input-number`,hideButtons:!0,disabled:o,onBlur:e=>this.foundation.handleQuickJumpBlur(),onEnterPress:e=>this.foundation.handleQuickJumpEnterPress(e.target.value),onChange:e=>this.foundation.handleQuickJumpNumberChange(e)}),h().createElement("span",null,e.page))}renderPageList(){const{pageList:e,currentPage:t,restLeftPageList:n,restRightPageList:r}=this.state,{popoverPosition:i,popoverZIndex:s,disabled:o}=this.props;return e.map(((e,a)=>{const l=w()(`${JC}-item`,{[`${JC}-item-active`]:t===e,[`${JC}-item-all-disabled`]:o,[`${JC}-item-all-disabled-active`]:t===e&&o}),c=h().createElement("li",{key:`${e}${a}`,onClick:()=>!o&&this.foundation.goPage(e,a),className:l,"aria-label":"..."===e?"More":`Page ${e}`,"aria-current":t===e&&"page"},e);if("..."===e&&!o){let t;return t=a<3?n:r,h().createElement(Cn,{rePosKey:this.props.currentPage,trigger:"hover",content:this.renderRestPageList(t),key:`${e}${a}`,position:i,zIndex:s},c)}return c}))}renderRestPageList(e){const{direction:t}=this.context,n=w()(`${JC}-rest-item`),r=e.length,i=t=>{const{index:r,style:i}=t,s=e[r];return h().createElement("div",{role:"listitem",key:`${s}${r}`,className:n,onClick:()=>this.foundation.goPage(s,r),style:i,"aria-label":`${s}`},s)},s=r>=5?160:32*r;return h().createElement(Ld,{className:`${JC}-rest-list`,itemData:e,itemSize:32,width:78,itemCount:r,height:s,style:{direction:t}},i)}renderSmallPageSelect(e){const t=this.state.allPageNumbers,n=this.renderRestPageList(t);return h().createElement(Cn,{content:n},e)}renderSmallPage(e){const t=this.props,{className:n,style:r,hideOnSinglePage:i,hoverShowPageSelect:s,showSizeChanger:o,disabled:a}=t,l=ZC(t,["className","style","hideOnSinglePage","hoverShowPageSelect","showSizeChanger","disabled"]),c=w()(`${JC}-small`,JC,n,{[`${JC}-disabled`]:a}),{currentPage:d,total:u,pageSize:p}=this.state,f=Math.ceil(u/p);if(f<2&&i&&!o)return null;const m=w()({[`${JC}-item`]:!0,[`${JC}-item-small`]:!0,[`${JC}-item-all-disabled`]:a}),g=h().createElement("div",{className:m},d,"/",f," ");return h().createElement("div",Object.assign({className:c,style:r},this.getDataAttr(l)),this.renderPrevBtn(),s&&!a?this.renderSmallPageSelect(g):g,this.renderNextBtn(),this.renderQuickJump(e))}renderDefaultPage(e){const{total:t,pageSize:n}=this.state,r=this.props,{showTotal:i,className:s,style:o,hideOnSinglePage:a,showSizeChanger:l,disabled:c}=r,d=ZC(r,["showTotal","className","style","hideOnSinglePage","showSizeChanger","disabled"]),u=w()(s,`${JC}`,{[`${JC}-disabled`]:c}),p=`${JC}-total`;if(Math.ceil(t/n)<2&&a&&!l)return null;const f=Math.ceil(t/n),m=e.total.replace("${total}",f.toString());return h().createElement("ul",Object.assign({className:u,style:o},this.getDataAttr(d)),i?h().createElement("span",{className:p},m):null,this.renderPrevBtn(),this.renderPageList(),this.renderNextBtn(),this.renderPageSizeSwitch(e),this.renderQuickJump(e))}render(){const{size:e}=this.props;return h().createElement(Jt,{componentName:"Pagination"},(t=>"small"===e?this.renderSmallPage(t):this.renderDefaultPage(t)))}}eS.contextType=lt,eS.propTypes={total:E().number,showTotal:E().bool,pageSize:E().number,pageSizeOpts:E().array,size:E().string,currentPage:E().number,defaultCurrentPage:E().number,onPageChange:E().func,onPageSizeChange:E().func,onChange:E().func,prevText:E().node,nextText:E().node,showSizeChanger:E().bool,popoverZIndex:E().number,popoverPosition:E().string,style:E().object,className:E().string,hideOnSinglePage:E().bool,hoverShowPageSelect:E().bool,showQuickJumper:E().bool,disabled:E().bool,preventPageChangeOnPageSizeChange:E().bool},eS.defaultProps={total:1,popoverZIndex:gn.DEFAULT_Z_INDEX,showTotal:!1,pageSize:null,pageSizeOpts:_C.PAGE_SIZE_OPTION,defaultCurrentPage:1,size:"default",onPageChange:i(),onPageSizeChange:i(),onChange:i(),showSizeChanger:!1,className:"",hideOnSinglePage:!1,showQuickJumper:!1,disabled:!1,preventPageChangeOnPageSizeChange:!1};const tS={PREFIX:`${C}-popconfirm`,POPOVER:`${C}-popconfirm-popover`};class nS extends c{init(){}destroy(){}handleCancel(e){const t=this._adapter.notifyCancel(e);qb(t)?(this._adapter.updateCancelLoading(!0),t.then((e=>{this.handleVisibleChange(!1),this._adapter.updateCancelLoading(!1)}),(e=>{this._adapter.updateCancelLoading(!1)}))):this.handleVisibleChange(!1)}handleConfirm(e){const t=this._adapter.notifyConfirm(e);qb(t)?(this._adapter.updateConfirmLoading(!0),t.then((e=>{this._adapter.updateConfirmLoading(!1),this.handleVisibleChange(!1)}),(e=>{this._adapter.updateConfirmLoading(!1)}))):this.handleVisibleChange(!1)}handleClickOutSide(e){this._adapter.notifyClickOutSide(e)}handleVisibleChange(e){this._isControlledComponent("visible")||this._adapter.setVisible(e),e?this.handleFocusOperateButton():this._adapter.focusPrevFocusElement(),this._adapter.notifyVisibleChange(e)}handleFocusOperateButton(){const{cancelButtonProps:e,okButtonProps:t}=this._adapter.getProps();o()(e,"autoFocus")&&!o()(e,"disabled")?this._adapter.focusCancelButton():o()(t,"autoFocus")&&!o()(t,"disabled")&&this._adapter.focusOkButton()}}__webpack_require__("GKo3");var rS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class iS extends f{constructor(e){super(e),this.handleCancel=e=>this.foundation.handleCancel(e&&e.nativeEvent),this.handleConfirm=e=>this.foundation.handleConfirm(e&&e.nativeEvent),this.handleVisibleChange=e=>this.foundation.handleVisibleChange(e),this.handleClickOutSide=e=>this.foundation.handleClickOutSide(e),this.stopImmediatePropagation=e=>e&&e.nativeEvent&&e.nativeEvent.stopImmediatePropagation(),this.renderConfirmPopCard=e=>{let{initialFocusRef:t}=e;const{content:n,title:r,className:i,style:s,cancelType:o,icon:a,prefixCls:l,showCloseIcon:c}=this.props,{direction:d}=this.context,u=w()(l,i,{[`${l}-rtl`]:"rtl"===d}),p=null!=r,f=!(null==n),m=h().isValidElement(a),g=w()({[`${l}-body`]:!0,[`${l}-body-withIcon`]:m});return h().createElement("div",{className:u,onClick:this.stopImmediatePropagation,style:s},h().createElement("div",{className:`${l}-inner`},h().createElement("div",{className:`${l}-header`},m?h().createElement("i",{className:`${l}-header-icon`,"x-semi-prop":"icon"},a):null,h().createElement("div",{className:`${l}-header-body`},p?h().createElement("div",{className:`${l}-header-title`,"x-semi-prop":"title"},r):null),c?h().createElement(vs,{className:`${l}-btn-close`,icon:h().createElement(Ji,null),size:"small",theme:"borderless",type:o,onClick:this.handleCancel}):null),f?h().createElement("div",{className:g,"x-semi-prop":"content"},ye()(n)?n({initialFocusRef:t}):n):null,h().createElement("div",{className:`${l}-footer`,ref:this.footerRef},this.renderControls())))},this.state={cancelLoading:!1,confirmLoading:!1,visible:e.defaultVisible||!1},this.foundation=new nS(this.adapter),this.footerRef=h().createRef(),this.popoverRef=h().createRef()}static getDerivedStateFromProps(e,t){const n={},{hasOwnProperty:r}=Object.prototype;return r.call(e,"visible")&&(n.visible=e.visible),n}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVisible:e=>this.setState({visible:e}),updateConfirmLoading:e=>this.setState({confirmLoading:e}),updateCancelLoading:e=>this.setState({cancelLoading:e}),notifyConfirm:e=>this.props.onConfirm(e),notifyCancel:e=>this.props.onCancel(e),notifyVisibleChange:e=>this.props.onVisibleChange(e),notifyClickOutSide:e=>this.props.onClickOutSide(e),focusCancelButton:()=>{var e,t;const n=null===(t=null===(e=this.footerRef)||void 0===e?void 0:e.current)||void 0===t?void 0:t.querySelector("[data-type=cancel]");null==n||n.focus({preventScroll:!0})},focusOkButton:()=>{var e,t;const n=null===(t=null===(e=this.footerRef)||void 0===e?void 0:e.current)||void 0===t?void 0:t.querySelector("[data-type=ok]");null==n||n.focus({preventScroll:!0})},focusPrevFocusElement:()=>{var e;null===(e=this.popoverRef.current)||void 0===e||e.focusTrigger()}})}renderControls(){const{okText:e,cancelText:t,okType:n,cancelType:r,cancelButtonProps:i,okButtonProps:s}=this.props,{cancelLoading:a,confirmLoading:l}=this.state;return h().createElement(Jt,{componentName:"Popconfirm"},((c,d)=>h().createElement(h().Fragment,null,h().createElement(vs,Object.assign({"data-type":"cancel",type:r,onClick:this.handleCancel,loading:a},W()(i,"autoFocus")),t||o()(c,"cancel")),h().createElement(vs,Object.assign({"data-type":"ok",type:n,theme:"solid",onClick:this.handleConfirm,loading:l},W()(s,"autoFocus")),e||o()(c,"confirm")))))}render(){const{direction:e}=this.context,t="rtl"===e?"bottomRight":"bottomLeft",n=this.props,{className:r,prefixCls:i,disabled:s,children:o,style:a,position:l=t}=n,c=rS(n,["className","prefixCls","disabled","children","style","position"]);if(s)return o;const{visible:d}=this.state,u={onVisibleChange:this.handleVisibleChange,className:tS.POPOVER,onClickOutSide:this.handleClickOutSide};return this.isControlled("visible")&&(u.trigger="custom"),h().createElement(Cn,Object.assign({ref:this.popoverRef},c,{content:e=>{let{initialFocusRef:t}=e;return this.renderConfirmPopCard({initialFocusRef:t})},visible:d,position:l},u),o)}}iS.contextType=lt,iS.propTypes={motion:E().oneOfType([E().bool,E().func,E().object]),disabled:E().bool,content:E().oneOfType([E().node,E().func]),title:E().any,prefixCls:E().string,className:E().string,style:E().object,icon:E().node,okText:E().string,okType:E().string,cancelText:E().string,cancelType:E().string,onCancel:E().func,onConfirm:E().func,onClickOutSide:E().func,onVisibleChange:E().func,visible:E().bool,defaultVisible:E().bool,okButtonProps:E().object,cancelButtonProps:E().object,stopPropagation:E().oneOfType([E().bool,E().string]),showCloseIcon:E().bool,zIndex:E().number,trigger:E().string,position:E().string},iS.__SemiComponentName__="Popconfirm",iS.defaultProps=he(iS.__SemiComponentName__,{stopPropagation:!0,trigger:"click",onVisibleChange:i(),disabled:!1,icon:h().createElement(Qi,{size:"extra-large"}),okType:"primary",cancelType:"tertiary",prefixCls:tS.PREFIX,zIndex:1030,showCloseIcon:!0,onCancel:i(),onConfirm:i(),onClickOutSide:i()});const sS={PREFIX:`${C}-progress`},oS={types:["line","circle"],DEFAULT_TYPE:"line",STROKE_DEFAULT:"var(--semi-color-success)",strokeLineCap:["square","round"],DEFAULT_LINECAP:"round",sizes:["default","small","large"],DEFAULT_SIZE:"default",directions:["vertical","horizontal"],DEFAULT_DIRECTION:"horizontal"};__webpack_require__("3zWe");function aS(e,t,n){try{const r=function(e,t,n){if(e.sort(((e,t)=>e.percent-t.percent)),e[0].percent>t)return oS.STROKE_DEFAULT;const r=e[e.length-1];if(r.percent<t)return cS(r.color);for(const[r,i]of e.entries()){if(i.percent===t)return cS(i.color);if(t>i.percent)continue;const s=e[r-1];return n?lS({startColor:cS(s.color),endColor:cS(i.color),size:i.percent-s.percent-1},t-s.percent-1):cS(s.color)}return}(e,t,n);if(0!==r.length)return r}catch(e){return}}function lS(e,t){const{startColor:n,endColor:r,size:i}=e,s=n.split(""),o=r.split(""),a=[parseInt(`${s[1]}${s[2]}`,16),parseInt(`${o[1]}${o[2]}`,16)],l=[parseInt(`${s[3]}${s[4]}`,16),parseInt(`${o[3]}${o[4]}`,16)],c=[parseInt(`${s[5]}${s[6]}`,16),parseInt(`${o[5]}${o[6]}`,16)],d=[parseInt(`${s[7]}${s[8]}`,16),parseInt(`${o[7]}${o[8]}`,16)],h=(a[0]-a[1])/(i+1),u=(l[0]-l[1])/(i+1),p=(c[0]-c[1])/(i+1),f=(d[0]-d[1])/(i+1);function m(e){const t=Math.round(a[0]-h*(e+1)).toString(16),n=Math.round(l[0]-u*(e+1)).toString(16),r=Math.round(c[0]-p*(e+1)).toString(16),i=`${g(t)}${g(n)}${g(r)}`,s=Math.floor(f*(e+1)+d[1]).toString(16);return dS.Hex(`#${i}`,s)}function g(e){return 1===e.length?`0${e}`:0===e.length?"00":e}if(void 0===t){const e=[n];for(let t=0;t<i;t+=1)e.push(m(t));return e}return m(t)}function cS(e){return e=e.trim().toLowerCase(),hS.hex.test(e)?dS.Hex(e,void 0):hS.hslA.test(e)?dS.Hex(dS.HslA(e),void 0):hS.rgbA.test(e)?dS.Hex(dS.RgbA(e),void 0):hS.semiDesignTokens.test(e)?-1!==uS.ALONG.indexOf(e)?dS.SemiDesignToken(e):-1!==uS.SEQUENCE.indexOf(e)?dS.SemiDesignToken(`${e}-5`):dS.SemiDesignToken(`${e}`):void 0}const dS={Hex:(e,t)=>8===(e=e.replace("#","")).length?`#${e}`:(6===e.length||3===e.length&&(e=e.split("").map((e=>e+e)).join("")),`#${e}${t||"ff"}`),SemiDesignToken(e){if("undefined"==typeof window)return;const t=getComputedStyle(document.body).getPropertyValue(`--semi-${e}`);if(""===t)return;const n=`rgba(${t}, 1)`;return dS.RgbA(n)},HslA(e){const t=hS.hslA.exec(e),n=parseInt(t[2]),r=parseInt(t[3])/100,i=parseInt(t[4])/100,s=t[5],o=(1-Math.abs(2*i-1))*r,a=o*(1-Math.abs(n/60%2-1)),l=i-o/2;let c=0,d=0,h=0;return 0<=n&&n<60?(c=o,d=a,h=0):60<=n&&n<120?(c=a,d=o,h=0):120<=n&&n<180?(c=0,d=o,h=a):180<=n&&n<240?(c=0,d=a,h=o):240<=n&&n<300?(c=a,d=0,h=o):300<=n&&n<360&&(c=o,d=0,h=a),c=Math.round(255*(c+l)).toString(16),d=Math.round(255*(d+l)).toString(16),h=Math.round(255*(h+l)).toString(16),dS.utils.pAL(c,d,h,s)},RgbA(e){const t=hS.rgbA.exec(e),n=parseInt(t[2],10).toString(16),r=parseInt(t[3],10).toString(16),i=parseInt(t[4],10).toString(16),s=t[5];return dS.utils.pAL(n,r,i,s)},utils:{pAL:(e,t,n,r)=>(1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==n.length&&(n="0"+n),void 0!==r?(1==(r=Math.round(255*parseInt(r)).toString(16)).length&&(r="0"+r),"#"+e+t+n+r):"#"+e+t+n)}},hS={hex:/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,hslA:/(hsl)a?\(\s*?(\d+),?\s*?(\d+)%,?\s*?(\d+)%,?\s*?\/?(\s*?[\d.]+)?\s*?\)/,rgbA:/(rgb)a?\(\s*?(\d+),?\s*?(\d+),?\s*?(\d+),?\s*?\/?(\s*?[\d.]+)?\s*?\)/,semiDesignTokens:/(\w+)?-?(\w+)-?(\d)?/},uS={ALONG:["black","white"],SEQUENCE:["amber","blue","cyan","green","grey","indigo","light-blue","light-green","lime","orange","pink","purple","red","teal","violet","yellow"]};var pS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const fS=sS.PREFIX;class mS extends d.Component{constructor(e){super(e),this._mounted=!0,this._mounted=!0,this.state={percentNumber:this.props.percent}}componentDidUpdate(e){if(isNaN(this.props.percent)||isNaN(e.percent))throw new Error("[Semi Progress]:percent can not be NaN");if(e.percent!==this.props.percent){if(!this.props.motion)return void this.setState({percentNumber:this.props.percent});this.animation&&this.animation.destroy&&this.animation.destroy(),this.animation=new Ei({from:{value:e.percent},to:{value:this.props.percent}},{easing:"linear",duration:300}),this.animation.on("frame",(e=>{if(!1===this._mounted)return;const t=parseInt(e.value);this.setState({percentNumber:t})})),this.animation.on("rest",(()=>{!1!==this._mounted&&this.setState({percentNumber:this.props.percent})})),this.animation.start()}}componentWillUnmount(){this.animation&&this.animation.destroy(),this._mounted=!1}renderCircleProgress(){const e=this.props,{strokeLinecap:t,style:n,className:r,strokeWidth:i,format:s,size:o,stroke:a,strokeGradient:l,showInfo:c,percent:d,orbitStroke:p,id:f,indeterminate:m}=e,g=pS(e,["strokeLinecap","style","className","strokeWidth","format","size","stroke","strokeGradient","showInfo","percent","orbitStroke","id","indeterminate"]),y=this.props["aria-label"],v=this.props["aria-labelledby"],b=this.props["aria-valuetext"],{percentNumber:x}=this.state,E={wrapper:w()(`${fS}-circle`,r),svg:w()(`${fS}-circle-ring`),circle:w()(`${fS}-circle-ring-inner`,{[`${fS}-circle-ring-inner-indeterminate`]:m}),track:w()(`${fS}-circle-ring-track`)},C=this.calcPercent(d),S=this.calcPercent(x);let _;_=this.props.width?this.props.width:o===oS.DEFAULT_SIZE?72:24;const k=this.selectStroke(a,d,l),O=_/2,T=_/2,P=(_-i)/2,I=2*P*Math.PI,M=m?0:(1-C/100)*I,R=m?`${.3*I} ${I}`:`${I} ${I}`,A=`${I} ${I}`,N=s(S);return h().createElement("div",Object.assign({id:f,className:E.wrapper,style:n,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":m?void 0:S,"aria-labelledby":v,"aria-label":y,"aria-valuetext":b},u(g)),h().createElement("svg",{key:o,className:E.svg,height:_,width:_,"aria-hidden":!0},h().createElement("circle",{className:E.track,strokeDashoffset:0,strokeWidth:i,strokeDasharray:A,strokeLinecap:t,fill:"transparent",style:{stroke:p},r:P,cx:T,cy:O,"aria-hidden":!0}),h().createElement("circle",{className:E.circle,strokeDashoffset:M,strokeWidth:i,strokeDasharray:R,strokeLinecap:t,fill:"transparent",style:{stroke:k},r:P,cx:T,cy:O,"aria-hidden":!0})),c&&"small"!==o&&!m?h().createElement("span",{className:`${fS}-circle-text`},N):null)}calcPercent(e){let t;return t=e>100?100:e<0?0:e,t}selectStroke(e,t,n){if("string"==typeof e)return e;const r=aS(e,t,n);return void 0!==r?r:null}renderLineProgress(){const e=this.props,{className:t,style:n,stroke:r,strokeGradient:i,direction:s,format:o,showInfo:a,size:l,percent:c,orbitStroke:d,id:p,indeterminate:f}=e,m=pS(e,["className","style","stroke","strokeGradient","direction","format","showInfo","size","percent","orbitStroke","id","indeterminate"]),g=this.props["aria-label"],y=this.props["aria-labelledby"],v=this.props["aria-valuetext"],{percentNumber:b}=this.state,x=w()(fS,t,{[`${fS}-horizontal`]:s===oS.DEFAULT_DIRECTION,[`${fS}-vertical`]:s!==oS.DEFAULT_DIRECTION,[`${fS}-large`]:"large"===l,[`${fS}-indeterminate`]:f}),E=w()({[`${fS}-track`]:!0}),C=w()(`${fS}-track-inner`,{[`${fS}-track-inner-indeterminate`]:f}),S=this.calcPercent(c),_=this.calcPercent(b),k={background:this.selectStroke(r,c,i)};f||(s===oS.DEFAULT_DIRECTION?k.width=`${S}%`:k.height=`${S}%`);const O=o(_);return h().createElement("div",Object.assign({id:p,className:x,style:n,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":f?void 0:S,"aria-labelledby":y,"aria-label":g,"aria-valuetext":v},u(m)),h().createElement("div",{className:E,style:d?{backgroundColor:d}:{},"aria-hidden":!0},h().createElement("div",{className:C,style:k,"aria-hidden":!0})),a&&!f?h().createElement("div",{className:`${fS}-line-text`},O):null)}render(){const{type:e}=this.props;return"line"===e?this.renderLineProgress():this.renderCircleProgress()}}mS.__SemiComponentName__="Progress",mS.propTypes={"aria-label":E().string,"aria-labelledby":E().string,"aria-valuetext":E().string,className:E().string,direction:E().oneOf(oS.directions),format:E().oneOfType([E().func,E().node]),id:E().string,indeterminate:E().bool,motion:E().oneOfType([E().bool,E().func,E().object]),orbitStroke:E().string,percent:E().number,scale:E().number,showInfo:E().bool,size:E().oneOf(oS.sizes),stroke:E().oneOfType([E().string,E().arrayOf(E().shape({percent:E().number,color:E().string}))]),strokeGradient:E().bool,strokeLinecap:E().oneOf(oS.strokeLineCap),strokeWidth:E().number,style:E().object,type:E().oneOf(oS.types),width:E().number},mS.defaultProps=he(mS.__SemiComponentName__,{className:"",direction:oS.DEFAULT_DIRECTION,format:e=>`${e}%`,indeterminate:!1,motion:!0,percent:0,showInfo:!1,size:oS.DEFAULT_SIZE,strokeGradient:!1,strokeLinecap:oS.DEFAULT_LINECAP,strokeWidth:4,style:{},type:oS.DEFAULT_TYPE});const gS=mS,yS={PREFIX:`${C}-radio`,INNER:`${C}-radio-inner`,TEXT:`${C}-radio-text`,INPUT:`${C}-radio-input`,CHECKED:`${C}-radio-checked`,DISABLED:`${C}-radio-disabled`,BUTTON:`${C}-radio-button`},vS={PREFIX:`${C}-radioGroup`,INNER:`${C}-radioGroup-inner`,TEXT:`${C}-radioGroup-text`,INPUT:`${C}-radioGroup-input`,CHECKED:`${C}-radioGroup-checked`,DISABLED:`${C}-radioGroup-disabled`},bS=["horizontal","vertical"],wS="horizontal",xS=["advanced",""],ES="default",CS="button",SS="card",_S="pureCard",kS=["middle","small","large"];class OS extends c{constructor(e){super(Object.assign({},e))}init(){const e=this._getDisplayValue();this._setValue(e)}_getDisplayValue(){const{value:e,defaultValue:t}=this.getProps();let n;return"value"in this.getProps()?n=e:"defaultValue"in this.getProps()&&(n=t),n}handleChange(e){const t=this.getProp("mode"),n=this.getState("value"),{checked:r,value:i}=e.target,s=this._adapter.isInProps("value"),o=Object.assign(Object.assign({},e),{target:Object.assign(Object.assign({},e.target),{value:i})});"advanced"!==t||r||(o.target.value=void 0),s||("advanced"!==t||r?this._setValue(i):this._setValue(void 0)),"advanced"!==t&&n===i||this._adapter.notifyChange(o)}handlePropValueChange(e){this._setValue(e)}_setValue(e){this._adapter.setValue(e)}destroy(){}}const TS=h().createContext(null);class PS extends c{constructor(){super(...arguments),this.handleFocusVisible=e=>{const{target:t}=e;try{t.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch(e){Q(!0,"Warning: [Semi Radio] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this._adapter.setFocusVisible(!1)}}init(){const{children:e,extra:t,extraId:n,addonId:r}=this._adapter.getProps();e&&!r&&this._adapter.setAddonId(),t&&!n&&this._adapter.setExtraId()}setHover(e){this._adapter.setHover(e)}setChecked(e){this._adapter.setChecked(e)}}__webpack_require__("Vs0Q");class IS extends c{constructor(e){super(Object.assign({},e))}init(){const e=this._adapter.getProp("checked"),t=this._adapter.getProp("defaultChecked");this.setChecked(e||t)}setChecked(e){this._adapter.setNativeControlChecked(e)}getChecked(){return this._adapter.getProp("checked")}handleChange(e){const t="checked"in this.getProps(),{checked:n}=e.target,r={target:Object.assign(Object.assign({},this.getProps()),{checked:n}),stopPropagation:()=>{e.stopPropagation()},preventDefault:()=>{e.preventDefault()}};t||this.setChecked(n),this._adapter.notifyChange(r)}destroy(){}}const MS=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("circle",{cx:12,cy:12,r:5,fill:"currentColor"}))}),"radio");class RS extends f{constructor(e){super(e),this.state={checked:!1},this.foundation=new IS(this.adapter),this.onChange=this.onChange.bind(this)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setNativeControlChecked:e=>{this.setState({checked:e})},notifyChange:e=>{this.props.onChange(e)}})}componentDidMount(){this.foundation.init()}componentDidUpdate(e){e.checked!==this.props.checked&&this.foundation.setChecked(this.props.checked)}componentWillUnmount(){this.foundation.destroy()}blur(){this.inputEntity.blur()}focus(){const{preventScroll:e}=this.props;this.inputEntity.focus({preventScroll:e})}onChange(e){this.foundation.handleChange(e)}render(){const{disabled:e,mode:t,autoFocus:n,name:r,isButtonRadio:i,isPureCardRadioGroup:s,addonId:o,extraId:a,"aria-label":l,focusInner:c,onInputFocus:d,onInputBlur:u}=this.props,{checked:p}=this.state,f=this.props.prefixCls||yS.PREFIX,m=w()({[`${f}-inner`]:!0,[`${f}-inner-checked`]:Boolean(p),[`${f}-inner-buttonRadio`]:i,[`${f}-inner-pureCardRadio`]:s}),g=w()({[`${f}-focus`]:c,[`${f}-focus-border`]:c&&!p,[`${f}-inner-display`]:!i});return h().createElement("span",{className:m},h().createElement("input",{ref:e=>{this.inputEntity=e},autoFocus:n,type:"advanced"===t?"checkbox":"radio",checked:Boolean(p),disabled:e,onChange:this.onChange,name:r,"aria-label":l,"aria-labelledby":o,"aria-describedby":a,onFocus:d,onBlur:u}),h().createElement("span",{className:g},p?h().createElement(MS,null):null))}}RS.contextType=TS,RS.propTypes={checked:E().bool,disabled:E().bool,isButtonRadio:E().bool,onChange:E().func,mode:E().oneOf(["advanced",""]),"aria-label":E().string,focusInner:E().bool,onInputFocus:E().func,onInputBlur:E().func,preventScroll:E().bool},RS.defaultProps={onChange:i(),isButtonRadio:!1};const AS=RS;var NS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class DS extends f{constructor(e){super(e),this.onChange=e=>{const{onChange:t}=this.props;if(this.isInGroup()){const{radioGroup:t}=this.context;t.onChange&&t.onChange(e)}!("checked"in this.props)&&this.foundation.setChecked(e.target.checked),t&&t(e)},this.handleMouseEnter=e=>{this.props.onMouseEnter(e),this.foundation.setHover(!0)},this.handleMouseLeave=e=>{this.props.onMouseLeave(e),this.foundation.setHover(!1)},this.handleFocusVisible=e=>{this.foundation.handleFocusVisible(e)},this.handleBlur=e=>{this.foundation.handleBlur()},this.state={hover:!1,addonId:e.addonId,extraId:e.extraId,checked:e.checked||e.defaultChecked||!1},this.foundation=new PS(this.adapter),this.radioEntity=null}componentDidUpdate(e){this.props.checked!==e.checked&&(_e()(this.props.checked)?this.foundation.setChecked(!1):Kc()(this.props.checked)&&this.foundation.setChecked(this.props.checked))}get adapter(){return Object.assign(Object.assign({},super.adapter),{setHover:e=>{this.setState({hover:e})},setAddonId:()=>{this.setState({addonId:We({prefix:"addon"})})},setChecked:e=>{this.setState({checked:e})},setExtraId:()=>{this.setState({extraId:We({prefix:"extra"})})},setFocusVisible:e=>{this.setState({focusVisible:e})}})}isInGroup(){return this.context&&this.context.radioGroup}focus(){this.radioEntity.focus()}blur(){this.radioEntity.blur()}render(){const e=this.props,{addonClassName:t,addonStyle:n,disabled:r,style:i,className:s,prefixCls:o,displayMode:a,children:l,extra:c,mode:d,type:u,value:p,name:f}=e,m=NS(e,["addonClassName","addonStyle","disabled","style","className","prefixCls","displayMode","children","extra","mode","type","value","name"]);let g,y,v,b,x,E,C,S,_;const{hover:k,addonId:O,extraId:T,focusVisible:P,checked:I}=this.state,M={checked:I,disabled:r};this.isInGroup()?(g=this.context.radioGroup.value===p,y=r||this.context.radioGroup.disabled,v=this.context.mode,b=this.context.radioGroup.isButtonRadio,x=this.context.radioGroup.isCardRadio,E=this.context.radioGroup.isPureCardRadio,S=this.context.radioGroup.buttonSize,_=o||this.context.radioGroup.prefixCls,M.checked=g,M.disabled=y):(g=I,y=r,v=d,C="button"===u,_=o,b=u===CS,E=u===_S,x=u===SS||E);const R=void 0===b?C:b,A=_||yS.PREFIX,N=x||E||R,D=w()(A,{[`${A}-disabled`]:y,[`${A}-checked`]:g,[`${A}-${a}`]:Boolean(a),[`${A}-buttonRadioComponent`]:C,[`${A}-buttonRadioGroup`]:b,[`${A}-buttonRadioGroup-${S}`]:b&&S,[`${A}-cardRadioGroup`]:x,[`${A}-cardRadioGroup_disabled`]:y&&x,[`${A}-cardRadioGroup_checked`]:x&&g&&!y,[`${A}-cardRadioGroup_checked_disabled`]:x&&g&&y,[`${A}-cardRadioGroup_hover`]:x&&!g&&k&&!y,[s]:Boolean(s),[`${A}-focus`]:P&&(x||E)}),L=this.isInGroup()&&this.context.radioGroup.name,F=w()({[`${A}-addon`]:!R,[`${A}-addon-buttonRadio`]:R,[`${A}-addon-buttonRadio-checked`]:R&&g,[`${A}-addon-buttonRadio-disabled`]:R&&y,[`${A}-addon-buttonRadio-hover`]:R&&!g&&!y&&k,[`${A}-addon-buttonRadio-${S}`]:R&&S,[`${A}-focus`]:P&&R},t);return h().createElement("label",Object.assign({style:i,className:D,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},this.getDataAttr(m)),h().createElement(AS,Object.assign({},this.props,M,{mode:v,name:null!=f?f:L,isButtonRadio:R,isPureCardRadioGroup:E,onChange:this.onChange,ref:e=>{this.radioEntity=e},addonId:l&&O,extraId:c&&T,focusInner:P&&!N,onInputFocus:this.handleFocusVisible,onInputBlur:this.handleBlur})),l||c?h().createElement("div",{className:w()([`${A}-content`,{[`${A}-isCardRadioGroup_content`]:x}])},l?h().createElement("span",{className:F,style:n,id:O,"x-semi-prop":"children"},l):null,c&&!R?h().createElement("div",{className:`${A}-extra`,id:T,"x-semi-prop":"extra"},c):null):null)}}DS.__SemiComponentName__="Radio",DS.contextType=TS,DS.propTypes={autoFocus:E().bool,checked:E().bool,defaultChecked:E().bool,value:E().any,style:E().object,className:E().string,disabled:E().bool,prefixCls:E().string,displayMode:E().oneOf(["vertical",""]),onChange:E().func,onMouseEnter:E().func,onMouseLeave:E().func,mode:E().oneOf(xS),extra:E().node,addonStyle:E().object,addonClassName:E().string,type:E().oneOf([ES,CS,SS,_S]),"aria-label":E().string,preventScroll:E().bool},DS.defaultProps=he(DS.__SemiComponentName__,{autoFocus:!1,defaultChecked:!1,value:void 0,style:void 0,onMouseEnter:i(),onMouseLeave:i(),mode:"",type:"default"}),DS.elementType="Radio";const LS=DS;var FS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class jS extends f{constructor(e){super(e),this.onChange=e=>{this.foundation.handleChange(e)},this.getFormatName=()=>this.props.name||"default",this.state={value:e.value||e.defaultValue},this.foundation=new OS(this.adapter)}componentDidMount(){this.foundation.init()}componentDidUpdate(e){"number"==typeof e.value&&isNaN(e.value)&&"number"==typeof this.props.value&&isNaN(this.props.value)||e.value!==this.props.value&&this.foundation.handlePropValueChange(this.props.value)}componentWillUnmount(){this.foundation.destroy()}get adapter(){return Object.assign(Object.assign({},super.adapter),{setValue:e=>{this.setState({value:e})},getProps:()=>this.props,isInProps:e=>Boolean(e in this.props),notifyChange:e=>{this.props.onChange&&this.props.onChange(e)}})}render(){const e=this.props,{children:t,options:n,mode:r,prefixCls:i,className:s,style:o,direction:a,type:l,buttonSize:c,id:d}=e,u=FS(e,["children","options","mode","prefixCls","className","style","direction","type","buttonSize","id"]),p=l===CS,f=l===_S,m=l===SS||f,g=l===ES,y=i||vS.PREFIX,v=w()(s,{[y]:!0,[`${y}-wrapper`]:!0,[`${y}-${a}`]:a&&!p,[`${y}-${a}-default`]:a&&g,[`${y}-${a}-card`]:a&&m,[`${y}-buttonRadio`]:p}),b=this.state.value;let x;return n?x=(n||[]).map(((e,t)=>"string"==typeof e?h().createElement(LS,{key:t,disabled:this.props.disabled,value:e},e):h().createElement(LS,{key:t,disabled:e.disabled||this.props.disabled,value:e.value,extra:e.extra,className:e.className,style:e.style,addonId:e.addonId,addonStyle:e.addonStyle,addonClassName:e.addonClassName,extraId:e.extraId},e.label))):t&&(x=h().Children.map(t,((e,t)=>h().isValidElement(e)?h().cloneElement(e,{key:t}):null))),h().createElement("div",Object.assign({className:v,style:o,id:d,"aria-label":this.props["aria-label"],"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],"aria-required":this.props["aria-required"]},this.getDataAttr(u)),h().createElement(TS.Provider,{value:{radioGroup:{onChange:this.onChange,value:b,disabled:this.props.disabled,name:this.getFormatName(),isButtonRadio:p,isCardRadio:m,isPureCardRadio:f,buttonSize:c,prefixCls:i},mode:r}},x))}}jS.propTypes={defaultValue:E().any,disabled:E().bool,name:E().string,options:E().array,buttonSize:E().oneOf(kS),type:E().oneOf([ES,CS,SS,_S]),value:E().any,onChange:E().func,children:E().node,prefixCls:E().string,className:E().string,style:E().object,direction:E().oneOf(bS),mode:E().oneOf(xS),"aria-label":E().string,"aria-describedby":E().string,"aria-errormessage":E().string,"aria-invalid":E().bool,"aria-labelledby":E().string,"aria-required":E().bool,id:E().string},jS.defaultProps={disabled:!1,onChange:i(),direction:wS,mode:"",type:ES,buttonSize:"middle"};const $S=jS;class BS extends LS{}BS.Group=$S;const VS=BS,zS={PREFIX:`${C}-rating`},HS=["default","small"];__webpack_require__("yqmi");const US=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M10.75 1.9c.4-1.2 2.1-1.2 2.5 0l1.99 6.12h6.45a1.3 1.3 0 0 1 .77 2.37l-5.22 3.78 2 6.11c.39 1.2-1 2.2-2.02 1.46L12 17.96l-5.22 3.78c-1.02.75-2.4-.25-2.01-1.46l1.99-6.11-5.22-3.78a1.3 1.3 0 0 1 .77-2.37h6.45l2-6.12Z",fill:"currentColor"}))}),"star");class KS extends c{constructor(e){super(Object.assign(Object.assign({},KS.defaultAdapter),e)),this.handleStarFocusVisible=e=>{const{target:t}=e,{count:n}=this.getProps();try{t.matches(":focus-visible")&&this._adapter.setEmptyStarFocusVisible(!0)}catch(e){Q(!0,"Warning: [Semi Rating] The current browser does not support the focus-visible")}},this.handleStarBlur=e=>{const{emptyStarFocusVisible:t}=this.getStates();t&&this._adapter.setEmptyStarFocusVisible(!1)}}init(){const{autoFocus:e,disabled:t}=this.getProps();e&&!t&&this._adapter.focus()}_getScroll(e,t){let n=t?e.pageYOffset:e.pageXOffset;const r=t?"scrollTop":"scrollLeft";if("number"!=typeof n){const t=e.document;n=t.documentElement[r],"number"!=typeof n&&(n=t.body[r])}return n}_getClientPosition(e){let t,n;const r=e.ownerDocument,{body:i}=r,s=r&&r.documentElement,o=e.getBoundingClientRect();return t=o.left,n=o.top,t-=s.clientLeft||i.clientLeft||0,n-=s.clientTop||i.clientTop||0,{left:t,top:n}}_getOffsetLeft(e){const t=this._getClientPosition(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=this._getScroll(r),t.left}getStarValue(e,t){const{allowHalf:n}=this.getProps(),r="rtl"===this._adapter.getContext("direction");let i=e+1;if(n){const n=this._adapter.getStarDOM(e),s=this._getOffsetLeft(n),o=n.clientWidth;(r&&t-s>o/2||!r&&t-s<o/2)&&(i-=.5)}return i}handleHover(e,t){const n=this.getStarValue(t,e.pageX),{clearedValue:r,hoverValue:i}=this.getStates();n!==i&&n!==r&&this._adapter.notifyHoverChange(n,null)}handleMouseLeave(){this._adapter.notifyHoverChange(void 0,null)}handleClick(e,t){const{allowClear:n}=this.getProps(),{value:r}=this.getStates(),i=this.getStarValue(t,e.pageX),s=!!n&&i===r;this._adapter.updateValue(s?0:i),s?this._adapter.notifyHoverChange(void 0,i):this._adapter.clearValue(null)}handleFocus(e){this._adapter.notifyFocus(e)}handleBlur(e){this._adapter.notifyBlur(e)}handleKeyDown(e,t){const{key:n}=e,{count:r,allowHalf:i}=this.getProps(),s="rtl"===this._adapter.getContext("direction"),o=i?.5:1;let a,l;"ArrowRight"===n||"ArrowUp"===n?a=t+(s?-o:o):"ArrowLeft"!==n&&"ArrowDown"!==n||(a=t+(s?o:-o)),l=a>r?0:a<0?r:a,["ArrowRight","ArrowUp","ArrowLeft","ArrowDown"].includes(n)&&(this._adapter.notifyKeyDown(e),this._adapter.updateValue(l),this.changeFocusStar(l,e),e.preventDefault(),this._adapter.notifyHoverChange(void 0,null))}changeFocusStar(e,t){const{count:n,allowHalf:r,preventScroll:i,tooltips:s}=this.getProps(),o=Math.ceil(e)-1,a=[...t.currentTarget.childNodes].map((e=>s?e.childNodes[0].childNodes[0].childNodes:e.childNodes[0].childNodes));o<0?a[n][0].focus({preventScroll:i}):a[o][r?10*e%10==5?0:1:0].focus({preventScroll:i})}}class WS extends c{constructor(e){super(Object.assign(Object.assign({},WS.defaultAdapter),e)),this.handleFocusVisible=(e,t)=>{const{target:n}=e;try{n.matches(":focus-visible")&&("first"===t?this._adapter.setFirstStarFocus(!0):this._adapter.setSecondStarFocus(!0))}catch(e){Q(!0,"Warning: [Semi Rating] The current browser does not support the focus-visible")}},this.handleBlur=(e,t)=>{const{firstStarFocus:n,secondStarFocus:r}=this.getStates();"first"===t?n&&this._adapter.setFirstStarFocus(!1):r&&this._adapter.setSecondStarFocus(!1)}}}class GS extends f{constructor(e){super(e),this.getDomNode=()=>this.liRef&&this.liRef.current,this.firstStar=null,this.secondStar=null,this.onHover=e=>{const{onHover:t,index:n}=this.props;t(e,n)},this.onClick=e=>{const{onClick:t,index:n}=this.props;t(e,n)},this.onFocus=(e,t)=>{const{onFocus:n}=this.props;n&&n(e),this.foundation.handleFocusVisible(e,t)},this.onBlur=(e,t)=>{const{onBlur:n}=this.props;n&&n(e),this.foundation.handleBlur(e,t)},this.onKeyDown=e=>{const{onClick:t,index:n}=this.props;13===e.keyCode&&t(e,n)},this.starFocus=()=>{const{value:e,index:t,preventScroll:n}=this.props;e-t==.5?this.firstStar.focus({preventScroll:n}):this.secondStar.focus({preventScroll:n})},this.saveFirstStar=e=>{this.firstStar=e},this.saveSecondStar=e=>{this.secondStar=e},this.liRef=h().createRef(),this.state={firstStarFocus:!1,secondStarFocus:!1},this.foundation=new WS(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setFirstStarFocus:e=>{this.setState({firstStarFocus:e})},setSecondStarFocus:e=>{this.setState({secondStarFocus:e})}})}render(){const{index:e,prefixCls:t,character:n,count:r,value:i,disabled:s,allowHalf:o,focused:a,size:l,ariaLabelPrefix:c}=this.props,{firstStarFocus:d,secondStarFocus:u}=this.state,p=e+1,f=p-i,m=o&&f<1&&f>0,g=1-f,y=p<=i,v="number"==typeof l,b=w()(t,{[`${t}-half`]:m,[`${t}-full`]:y,[`${t}-${l}`]:!v}),x=v?{width:l,height:l,fontSize:l}:{},E=v?"inherit":"small"===l?"default":"extra-large",C=n||h().createElement(US,{size:E,style:{display:"block"}}),S=e===r,_=w()(`${t}-wrapper`,{[`${t}-disabled`]:s,[`${zS.PREFIX}-focus`]:(d||u)&&0!==i}),k={onClick:s?null:this.onClick,onKeyDown:s?null:this.onKeyDown,onMouseMove:s?null:this.onHover,className:_},O=o?2*r+1:r+1,T={ref:this.saveFirstStar,role:"radio","aria-checked":i===e+.5,"aria-posinset":2*e+1,"aria-setsize":O,"aria-disabled":s,"aria-label":`${e+.5} ${c}s`,"aria-labelledby":this.props["aria-describedby"],"aria-describedby":this.props["aria-describedby"],className:w()(`${t}-first`,`${zS.PREFIX}-no-focus`),tabIndex:s||i!==e+.5?-1:0,onFocus:e=>{this.onFocus(e,"first")},onBlur:e=>{this.onBlur(e,"first")}},P=!s&&(i===e+1||S&&0===i)?0:-1,I={ref:this.saveSecondStar,role:"radio","aria-checked":S?0===i:i===e+1,"aria-posinset":o?2*(e+1):e+1,"aria-setsize":O,"aria-disabled":s,"aria-label":`${S?0:e+1} ${c}${0===e?"":"s"}`,"aria-labelledby":this.props["aria-describedby"],"aria-describedby":this.props["aria-describedby"],className:w()(`${t}-second`,`${zS.PREFIX}-no-focus`),tabIndex:P,onFocus:e=>{this.onFocus(e,"second")},onBlur:e=>{this.onBlur(e,"second")}};return h().createElement("li",{className:b,style:Object.assign({},x),key:e,ref:this.liRef},h().createElement("div",Object.assign({},k),o&&!S&&h().createElement("div",Object.assign({},T,{style:{width:100*g+"%"}}),C),h().createElement("div",Object.assign({},I,{"x-semi-prop":"character"}),C)))}}GS.propTypes={value:E().number,index:E().number,prefixCls:E().string,allowHalf:E().bool,onHover:E().func,onClick:E().func,character:E().node,focused:E().bool,disabled:E().bool,count:E().number,ariaLabelPrefix:E().string,size:E().oneOfType([E().oneOf(HS),E().number]),"aria-describedby":E().string,onFocus:E().func,onBlur:E().func,preventScroll:E().bool};var qS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class XS extends f{constructor(e){super(e),this.rate=null,this.onHover=(e,t)=>{this.foundation.handleHover(e,t)},this.onMouseLeave=()=>{this.foundation.handleMouseLeave()},this.onClick=(e,t)=>{this.foundation.handleClick(e,t)},this.onFocus=e=>{this.foundation.handleFocus(e)},this.onBlur=e=>{this.foundation.handleBlur(e)},this.onKeyDown=e=>{const{value:t}=this.state;this.foundation.handleKeyDown(e,t)},this.focus=()=>{const{disabled:e,preventScroll:t}=this.props;e||this.rate.focus({preventScroll:t})},this.blur=()=>{const{disabled:e}=this.props;e||this.rate.blur()},this.saveRef=e=>t=>{this.stars[e]=t},this.saveRate=e=>{this.rate=e},this.handleStarFocusVisible=e=>{this.foundation.handleStarFocusVisible(e)},this.handleStarBlur=e=>{this.foundation.handleStarBlur(e)},this.getAriaLabelPrefix=()=>{if(this.props["aria-label"])return this.props["aria-label"];let e="star";const{character:t}=this.props;return"string"==typeof t&&(e=t),e},this.getItemList=e=>{const{count:t,allowHalf:n,prefixCls:r,disabled:i,character:s,size:o,tooltips:a}=this.props,{value:l,hoverValue:c,focused:d}=this.state,u=[...Array(t+1).keys()].map((u=>{const p=h().createElement(GS,{ref:this.saveRef(u),index:u,count:t,prefixCls:`${r}-star`,allowHalf:n,value:void 0===c?l:c,onClick:i?Tt:this.onClick,onHover:i?Tt:this.onHover,key:u,disabled:i,character:s,focused:d,size:u===t?0:o,ariaLabelPrefix:e,onFocus:i||t!==u?Tt:this.handleStarFocusVisible,onBlur:i||t!==u?Tt:this.handleStarBlur});if(a){const e=a[u]?a[u]:"",t=c-1===u;return h().createElement(_t,{visible:t,trigger:"custom",content:e,key:`${u}-${t}`},h().createElement("span",{className:`${r}-star-outer`},p))}return p}));return u};const t=void 0===e.value?e.defaultValue:e.value;this.stars={},this.state={value:t,focused:!1,hoverValue:void 0,clearedValue:null,emptyStarFocusVisible:!1},this.foundation=new KS(this.adapter)}static getDerivedStateFromProps(e,t){return"value"in e&&void 0!==e.value?Object.assign(Object.assign({},t),{value:e.value}):t}get adapter(){return Object.assign(Object.assign({},super.adapter),{focus:()=>{const{disabled:e,count:t}=this.props,{value:n}=this.state;if(!e){const e=Math.ceil(n)-1;this.stars[e<0?t:e].starFocus()}},getStarDOM:e=>(this.stars&&this.stars[e]).getDomNode(),notifyHoverChange:(e,t)=>{const{onHoverChange:n}=this.props;this.setState({hoverValue:e,clearedValue:t}),n(e)},updateValue:e=>{const{onChange:t}=this.props;"value"in this.props||this.setState({value:e}),t(e)},clearValue:e=>{this.setState({clearedValue:e})},notifyFocus:e=>{const{onFocus:t}=this.props;this.setState({focused:!0}),t&&t(e)},notifyBlur:e=>{const{onBlur:t}=this.props;this.setState({focused:!1}),t&&t(e)},notifyKeyDown:e=>{const{onKeyDown:t}=this.props;this.setState({focused:!1}),t&&t(e)},setEmptyStarFocusVisible:e=>{this.setState({emptyStarFocusVisible:e})}})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}render(){const e=this.props,{style:t,prefixCls:n,disabled:r,className:i,id:s,count:o,tabIndex:a}=e,l=qS(e,["style","prefixCls","disabled","className","id","count","tabIndex"]),{value:c,emptyStarFocusVisible:d}=this.state,u=this.getAriaLabelPrefix(),p=`Rating: ${c} of ${o} ${u}${1===c?"":"s"},`,f=this.getItemList(u),m=w()(n,{[`${n}-disabled`]:r,[`${n}-focus`]:d},i);return h().createElement("ul",Object.assign({"aria-label":p,"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],className:m,style:t,onMouseLeave:r?Tt:this.onMouseLeave,tabIndex:r?-1:a,onFocus:r?Tt:this.onFocus,onBlur:r?Tt:this.onBlur,onKeyDown:r?Tt:this.onKeyDown,ref:this.saveRate,id:s},this.getDataAttr(l)),f)}}XS.contextType=lt,XS.propTypes={"aria-describedby":E().string,"aria-errormessage":E().string,"aria-invalid":E().bool,"aria-label":E().string,"aria-labelledby":E().string,"aria-required":E().bool,disabled:E().bool,value:E().number,defaultValue:E().number,count:E().number,allowHalf:E().bool,allowClear:E().bool,style:E().object,prefixCls:E().string,onChange:E().func,onHoverChange:E().func,className:E().string,character:E().node,tabIndex:E().number,onFocus:E().func,onBlur:E().func,onKeyDown:E().func,autoFocus:E().bool,size:E().oneOfType([E().oneOf(HS),E().number]),tooltips:E().arrayOf(E().string),id:E().string,preventScroll:E().bool},XS.defaultProps={defaultValue:0,count:5,allowHalf:!1,allowClear:!0,style:{},prefixCls:zS.PREFIX,onChange:Tt,onHoverChange:Tt,tabIndex:-1,size:"default"};const YS={PREFIX:`${C}-sidesheet`,DIALOG:`${C}-modal`},ZS=["top","right","bottom","left"],JS=["small","medium","large"],QS=448;var e_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let t_=0;const n_=YS.PREFIX;class r_ extends h().PureComponent{constructor(){super(...arguments),this.onMaskClick=e=>{e.target===e.currentTarget&&this.close(e)},this.close=e=>{const{onClose:t}=this.props;t&&t(e)}}componentDidMount(){this.sideSheetId="sidesheet-"+t_++}componentWillUnmount(){clearTimeout(this.timeoutId)}getMaskElement(){var e;const{mask:t,maskStyle:n,maskClosable:r}=this.props;return t?h().createElement("div",Object.assign({"aria-hidden":!0,key:"mask",className:w()(`${n_}-mask`,null!==(e=this.props.maskClassName)&&void 0!==e?e:""),style:n,onClick:r?this.onMaskClick:null},this.props.maskExtraProps)):null}renderHeader(){const{title:e,closable:t,headerStyle:n,closeIcon:r}=this.props;let i,s;if(e&&(i=h().createElement("div",{className:`${n_}-title`,"x-semi-prop":"title"},this.props.title)),t){const e=r||h().createElement(Ji,null);s=h().createElement(ji,{className:`${n_}-close`,key:"close-btn",onClick:this.close,type:"tertiary",icon:e,theme:"borderless",size:"small"})}return h().createElement("div",{className:`${n_}-header`,role:"heading","aria-level":1,style:Object.assign({},n)},i,s)}getDialogElement(){var e;const t=e_(this.props,[]),n={};t.width&&(n.width=t.width,t.mask||(n.width="100%")),t.height&&(n.height=t.height);const r=this.renderHeader();return h().createElement("div",Object.assign({key:"dialog-element",role:"dialog",tabIndex:-1,className:w()(`${n_}-inner`,`${n_}-inner-wrap`,null!==(e=this.props.dialogClassName)&&void 0!==e?e:"",`${n_}-size-${t.size}`),style:Object.assign(Object.assign({},t.style),n)},this.props.wrapperExtraProps),h().createElement("div",{className:`${n_}-content`},r,h().createElement("div",{className:`${n_}-body`,style:t.bodyStyle,"x-semi-prop":"children"},t.children),t.footer?h().createElement("div",{className:`${n_}-footer`,"x-semi-prop":"footer"},t.footer):null))}render(){const e=this.props,{mask:t,className:n,width:r,onClose:i,maskStyle:s,maskClosable:o,maskClassName:a,title:l,closable:c,headerStyle:d,height:p,style:f,size:m,bodyStyle:g,dialogClassName:y,children:v,footer:b,maskExtraProps:x,wrapperExtraProps:E}=e,C=e_(e,["mask","className","width","onClose","maskStyle","maskClosable","maskClassName","title","closable","headerStyle","height","style","size","bodyStyle","dialogClassName","children","footer","maskExtraProps","wrapperExtraProps"]),S=w()(n,{[`${n_}-fixed`]:!t,[`${n_}-size-${this.props.size}`]:!t}),_={};!t&&r&&(_.width=r);const k=u(C);return h().createElement("div",Object.assign({className:S,style:_},k),this.getMaskElement(),this.getDialogElement())}}r_.propTypes={onClose:E().func,closeIcon:E().node},r_.defaultProps={onClose:i()};class i_ extends c{constructor(e){super(Object.assign(Object.assign({},i_.defaultAdapter),e)),this.toggleDisplayNone=e=>{this._adapter.toggleDisplayNone(e)}}get defaultAdapter(){return{handleCancel:i(),beforeShow:i(),afterHide:i()}}destroy(){this.afterHide()}handleCancel(e){this._adapter.notifyCancel(e)}beforeShow(){this.getProp("disableScroll")&&this._adapter.disabledBodyScroll(),this._adapter.setOnKeyDownListener()}afterHide(){this.getProp("disableScroll")&&this._adapter.enabledBodyScroll(),this._adapter.removeKeyDownListener()}handleKeyDown(e){const{closeOnEsc:t}=this.getProps();if(t&&e.keyCode===cn.ESC)return e.stopPropagation(),void this.handleCancel(e)}onVisibleChange(e){this._adapter.notifyVisibleChange(e)}}__webpack_require__("9Id+");var s_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const o_=YS.PREFIX,a_=QS;class l_ extends f{constructor(e){super(e),this.handleCancel=e=>{this.foundation.handleCancel(e)},this.handleKeyDown=e=>{this.foundation.handleKeyDown(e)},this.updateState=()=>{this.foundation.toggleDisplayNone(!this.props.visible)},this.state={displayNone:!this.props.visible},this.foundation=new i_(this.adapter),this.bodyOverflow="",this.scrollBarWidth=0,this.originBodyWidth="100%"}get adapter(){return Object.assign(Object.assign({},super.adapter),{disabledBodyScroll:()=>{const{getPopupContainer:e}=this.props;this.bodyOverflow=document.body.style.overflow||"",e||"hidden"===this.bodyOverflow||(document.body.style.overflow="hidden",document.body.style.width=`calc(${this.originBodyWidth||"100%"} - ${this.scrollBarWidth}px)`)},enabledBodyScroll:()=>{const{getPopupContainer:e}=this.props;e||"hidden"===this.bodyOverflow||(document.body.style.overflow=this.bodyOverflow,document.body.style.width=this.originBodyWidth)},notifyCancel:e=>{this.props.onCancel&&this.props.onCancel(e)},notifyVisibleChange:e=>{this.props.afterVisibleChange(e)},setOnKeyDownListener:()=>{window&&window.addEventListener("keydown",this.handleKeyDown)},removeKeyDownListener:()=>{window&&window.removeEventListener("keydown",this.handleKeyDown)},toggleDisplayNone:e=>{e!==this.state.displayNone&&this.setState({displayNone:e})}})}static getDerivedStateFromProps(e,t){const n={};return e.visible&&t.displayNone&&(n.displayNone=!1),e.visible||e.motion||t.displayNone||(n.displayNone=!0),n}componentDidMount(){this.scrollBarWidth=de(),this.originBodyWidth=document.body.style.width,this.props.visible&&this.foundation.beforeShow()}componentDidUpdate(e,t,n){!e.visible&&this.props.visible&&this.foundation.beforeShow(),e.visible&&!this.props.visible&&this.foundation.afterHide(),t.displayNone!==this.state.displayNone&&this.foundation.onVisibleChange(!this.state.displayNone)}componentWillUnmount(){this.props.visible&&this.foundation.destroy()}renderContent(){const e=this.props,{placement:t,className:n,children:r,width:i,height:s,motion:o,visible:a,style:l,maskStyle:c,size:d,zIndex:u,getPopupContainer:p,keepDOM:f,canVerticalSetWidth:m}=e,g=s_(e,["placement","className","children","width","height","motion","visible","style","maskStyle","size","zIndex","getPopupContainer","keepDOM","canVerticalSetWidth"]);let y={zIndex:u};p&&(y={zIndex:u,position:"static"});const{direction:v}=this.context,b="left"===t||"right"===t,x="top"===t||"bottom"===t,E=x?s||a_:"100%",C=w()(o_,n,{[`${o_}-${t}`]:t,[`${o_}-popup`]:p,[`${o_}-horizontal`]:x,[`${o_}-rtl`]:"rtl"===v,[`${o_}-hidden`]:f&&this.state.displayNone}),S=Object.assign(Object.assign(Object.assign({},b||m?i?{width:i}:{}:{width:"100%"}),g),{visible:a,motion:!1,size:d,className:C,height:E,onClose:this.handleCancel}),_=this.props.visible||this.props.keepDOM||this.props.motion&&!this.state.displayNone;return h().createElement(vt,{motion:this.props.motion,animationState:a?"enter":"leave",startClassName:a?`${o_}-animation-mask_show`:`${o_}-animation-mask_hide`,onAnimationEnd:this.updateState},(e=>{let{animationClassName:t,animationEventsNeedBind:n}=e;return h().createElement(vt,{motion:this.props.motion,animationState:a?"enter":"leave",startClassName:a?`${o_}-animation-content_show_${this.props.placement}`:`${o_}-animation-content_hide_${this.props.placement}`,onAnimationEnd:this.updateState},(e=>{let{animationClassName:i,animationStyle:s,animationEventsNeedBind:o}=e;return _?h().createElement(ht,{getPopupContainer:p,style:y},h().createElement(r_,Object.assign({},S,{maskExtraProps:n,wrapperExtraProps:o,dialogClassName:i,maskClassName:t,maskStyle:Object.assign({},c),style:Object.assign(Object.assign({},s),l)}),r)):h().createElement(h().Fragment,null)}))}))}render(){const{zIndex:e,getPopupContainer:t,visible:n}=this.props;return this.renderContent()}}l_.contextType=lt,l_.propTypes={bodyStyle:E().object,headerStyle:E().object,children:E().node,className:E().string,closable:E().bool,disableScroll:E().bool,getPopupContainer:E().func,height:E().oneOfType([E().number,E().string]),mask:E().bool,maskClosable:E().bool,maskStyle:E().object,motion:E().oneOfType([E().bool,E().object,E().func]),onCancel:E().func,placement:E().oneOf(ZS),size:E().oneOf(JS),style:E().object,title:E().node,visible:E().bool,width:E().oneOfType([E().number,E().string]),zIndex:E().number,afterVisibleChange:E().func,closeOnEsc:E().bool,footer:E().node,keepDOM:E().bool,"aria-label":E().string},l_.__SemiComponentName__="SideSheet",l_.defaultProps=he(l_.__SemiComponentName__,{visible:!1,motion:!0,mask:!0,placement:"right",closable:!0,footer:null,zIndex:1e3,maskClosable:!0,size:"small",disableScroll:!0,closeOnEsc:!1,afterVisibleChange:i(),keepDOM:!1});const c_={PREFIX:`${C}-slider`,DISABLED:`${C}-slider-disabled`,VERTICAL:`${C}-slider-vertical`,TRACK:`${C}-slider-track`,DOTS:`${C}-slider-dots`,MARKS:`${C}-slider-marks`,HANDLE:`${C}-slider-handle`,HANDLE_DOT:`${C}-slider-handle-dot`},d_=(e,t)=>{if(!(globalThis.Touch&&e instanceof Touch))return e;return["stopPropagation","preventDefault"].forEach((n=>{let r=t[n];r&&("function"==typeof r&&(r=function(){return t[n](...arguments)}),e[n]?Q(!0,`"The key ${n}" exist in Touch.`):e[n]=r)})),e};class h_ extends c{constructor(e){var t;super(Object.assign(Object.assign({},h_.defaultAdapter),e)),t=this,this.getMinAndMaxPercent=e=>{const{range:t,min:n,max:r}=this._adapter.getProps(),i=t?(e[0]-n)/(r-n):(e-n)/(r-n),s=t?(e[1]-n)/(r-n):1;return{min:this._checkValidity(i),max:this._checkValidity(s)}},this._checkValidity=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return e>n?n:e<t?t:e},this.computeHandleVisibleVal=(e,t,n)=>{const{focusPos:r,currentValue:i}=this._adapter.getStates(),s={min:!1,max:!1};let o;o=t?{min:t(n?this.outPutValue(i[0]):this.outPutValue(i)),max:n?t(this.outPutValue(i[1])):null}:{min:n?this.outPutValue(i[0]):this.outPutValue(i),max:n?this.outPutValue(i[1]):null},e?(s.min=!0,s.max=!0):void 0===e&&t&&("min"===r?s.min=!0:"max"===r&&(s.max=!0));return{tipVisible:s,tipChildren:o}},this.valueFormatIsCorrect=e=>Array.isArray(e)?"number"==typeof e[0]&&"number"==typeof e[0]:"number"==typeof e,this.handleMousePos=(e,t)=>{const n=this._adapter.getParentRect();return{x:e-(n?n.left:0),y:t-(n?n.top:0)}},this.getScrollParent=e=>{const t=/(auto|scroll)/,n=(e,t)=>window.getComputedStyle(e,null).getPropertyValue(t),r=e=>e&&e!==document.body&&e instanceof Element?(e=>t.test(n(e,"overflow")+n(e,"overflow-y")+n(e,"overflow-x")))(e)?e:r(e.parentNode):document.body;return r(e)},this.checkMeetMinMax=e=>{const{vertical:t,verticalReverse:n,range:r}=this._adapter.getProps(),i="rtl"===this._adapter.getContext("direction")&&!t,s=this._adapter.getState("currentValue"),{sliderX:o,sliderY:a,sliderWidth:l,sliderHeight:c}=(this.transValueToPos(s),this._adapter.getSliderLengths()),{chooseMovePos:d,isDrag:h}=this._adapter.getStates(),u=t?c:l;let p,f;return p=t&&n?a+u:i?o+u:t?a:o,f=t&&n?a:i?o:t?a+c:o+l,t&&n||i?e>=p?e=p:e<=f&&(e=f):e<=p?e=p:e>=f&&(e=f),e},this.transPosToValue=(e,t)=>{const n=this.checkMeetMinMax(e),{min:r,max:i,currentValue:s}=this._adapter.getStates(),{range:o,vertical:a,step:l,verticalReverse:c}=this._adapter.getProps(),d="rtl"===this._adapter.getContext("direction")&&!a,{sliderX:h,sliderY:u,sliderWidth:p,sliderHeight:f}=this._adapter.getSliderLengths(),m=a?u:h,g=a?f:p;let y,v;return y=a&&c||d?(m+g-n)/g*(i-r)+r:(n-m)/g*(i-r)+r,v=o?t?s[0]:s[1]:s,1!==l&&(y=Math.round(y/l)*l),o&&y!==v?t?[y,s[1]]:[s[0],y]:!o&&y!==v&&y},this.transValueToPos=e=>{const{min:t,max:n}=this._adapter.getStates(),{vertical:r,range:i,verticalReverse:s}=this._adapter.getProps(),o="rtl"===this._adapter.getContext("direction")&&!r,{sliderX:a,sliderY:l,sliderWidth:c,sliderHeight:d}=this._adapter.getSliderLengths(),h=r?l:a,u=r?d:c,p=e=>{const i=(e-t)/(n-t);return r&&s||o?h+u-i*u:h+i*u};return i?[p(e[0]),p(e[1])]:p(e)},this.isMarkActive=e=>{const{min:t,max:n,range:r,included:i}=this._adapter.getProps(),s=this._adapter.getState("currentValue");return"number"==typeof(e/1)&&e>=t&&e<=n&&(r?(e>s[1]||e<s[0])&&i?"unActive":"active":e<=s&&i?"active":"unActive")},this.outPutValue=e=>{const t=this._adapter.getProp("step"),n=(()=>{const e=(e=>{var t,n;return/^\d+(\.\d+)?$/.test(String(e))&&null!==(n=null===(t=e.toString().split(".")[1])||void 0===t?void 0:t.length)&&void 0!==n?n:0})(t),n=Math.pow(10,e);return e=>Math.round(e*n)/n})();if(Array.isArray(e)){const t=n(e[0]),r=n(e[1]);return t>r?"min"===this.getState("focusPos")?[r,r]:[t,t]:[t,r]}return n(e)},this.handleDisabledChange=e=>{this._adapter.updateDisabled(e)},this.checkAndUpdateIsInRenderTreeState=()=>this._adapter.checkAndUpdateIsInRenderTreeState(),this.calculateOutputValue=(e,t)=>{const n=this.transPosToValue(e,t);if(!1!==n)return this.outPutValue(n)},this.handleValueChange=(e,t)=>{const{min:n,max:r}=this._adapter.getStates();let i=null;const s={};this.valueFormatIsCorrect(t)?(Array.isArray(e)&&Array.isArray(t)&&(t=[t[0]<n?n:t[0],t[1]>r?r:t[1]],i=Object.assign(s,{currentValue:t})),"number"==typeof e&&"number"==typeof t&&(t=t>r?r:t<n?n:t,i=Object.assign(s,{currentValue:t}))):i=s,i&&this._adapter.transNewPropsToState(i)},this.onHandleDown=(e,t)=>{this._adapter.onHandleDown(e);const n=this._adapter.getState("disabled"),{vertical:r}=this._adapter.getProps(),{dragging:i}=this._adapter.getOverallVars();if(n)return!1;this._adapter.setStateVal("isDrag",!0),this._adapter.setStateVal("chooseMovePos",t),"min"===t?this._adapter.setDragging([!0,i[1]]):this._adapter.setDragging([i[0],!0]);const s=this.handleMousePos(e.clientX,e.clientY);let o=r?s.y:s.x;if(this._adapter.isEventFromHandle(e)){const t=this._getHandleCenterPosition(r,e.target);this._dragOffset=o-t,o=t}else this._dragOffset=0;return!0},this.onHandleMove=e=>{this._adapter.setEventDefault(e);const{disabled:t,chooseMovePos:n}=this._adapter.getStates(),{vertical:r}=this._adapter.getProps(),{dragging:i}=this._adapter.getOverallVars();if(t)return!1;this.onHandleEnter(n);const s=this.handleMousePos(e.clientX,e.clientY);let o=r?s.y:s.x;if(o-=this._dragOffset,"min"===n&&i[0]||"max"===n&&i[1]){const e=this.calculateOutputValue(o,"min"===n);if(void 0===e)return!1;this._adapter.notifyChange(e),this._adapter.onHandleMove(o,"min"===n,void 0,!1,e)}return!0},this.onHandleTouchStart=(e,t)=>{const n=this._adapter.getMinHandleEl(),r=this._adapter.getMaxHandleEl();if(e.target===n||e.target===r){Le(e);const n=d_(e.touches[0],e);this.onHandleDown(n,t)}},this.onHandleTouchMove=e=>{const t=this._adapter.getMinHandleEl(),n=this._adapter.getMaxHandleEl();if(e.target===t||e.target===n){const t=d_(e.touches[0],e);this.onHandleMove(t)}},this.onHandleEnter=e=>{const{disabled:t,focusPos:n}=this._adapter.getStates();t||n||e===n||this._adapter.onHandleEnter(e)},this.onHandleLeave=()=>{const e=this._adapter.getState("disabled"),t=this._adapter.getState("isDrag");e||t||this._adapter.onHandleLeave()},this.onHandleUp=e=>{this._adapter.onHandleUpBefore(e);const{disabled:t,chooseMovePos:n}=this._adapter.getStates(),{dragging:r}=this._adapter.getOverallVars();return!t&&("min"===n?this._adapter.setDragging([!1,r[1]]):this._adapter.setDragging([r[0],!1]),this._adapter.setStateVal("isDrag",!1),this._adapter.onHandleLeave(),this._adapter.onHandleUpAfter(),!0)},this._handleValueDecreaseWithKeyBoard=(e,t)=>{const{min:n,currentValue:r}=this.getStates(),{range:i}=this.getProps();if("min"===t){if(i){let t=r[0]-e;return t=t<n?n:t,[t,r[1]]}{let t=r-e;return t=t<n?n:t,t}}{let t=r[1]-e;return t=t<r[0]?r[0]:t,[r[0],t]}},this._handleValueIncreaseWithKeyBoard=(e,t)=>{const{max:n,currentValue:r}=this.getStates(),{range:i}=this.getProps();if("min"===t){if(i){let t=r[0]+e;return t=t>r[1]?r[1]:t,[t,r[1]]}{let t=r+e;return t=t>n?n:t,t}}{let t=r[1]+e;return t=t>n?n:t,[r[0],t]}},this._handleHomeKey=e=>{const{min:t,currentValue:n}=this.getStates(),{range:r}=this.getProps();return"min"===e?r?[t,n[1]]:t:[n[0],n[0]]},this._handleEndKey=e=>{const{max:t,currentValue:n}=this.getStates(),{range:r}=this.getProps();return"min"===e?r?[n[1],n[1]]:t:[n[0],t]},this.handleKeyDown=(e,t)=>{const{min:n,max:r,currentValue:i}=this.getStates(),{step:s,range:o,vertical:a}=this.getProps(),l="rtl"===this._adapter.getContext("direction")&&!a;let c;switch(e.key){case"ArrowLeft":case"ArrowDown":c=l?this._handleValueIncreaseWithKeyBoard(s,t):this._handleValueDecreaseWithKeyBoard(s,t);break;case"ArrowRight":case"ArrowUp":c=l?this._handleValueDecreaseWithKeyBoard(s,t):this._handleValueIncreaseWithKeyBoard(s,t);break;case"PageUp":c=l?this._handleValueDecreaseWithKeyBoard(10*s,t):this._handleValueIncreaseWithKeyBoard(10*s,t);break;case"PageDown":c=l?this._handleValueIncreaseWithKeyBoard(10*s,t):this._handleValueDecreaseWithKeyBoard(10*s,t);break;case"Home":c=this._handleHomeKey(t);break;case"End":c=this._handleEndKey(t)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(e.key)){let t=!0;t=Array.isArray(i)?!(i[0]===c[0]&&i[1]===c[1]):i!==c,t&&(this._adapter.updateCurrentValue(c),this._adapter.notifyChange(c)),Le(e)}},this._noTooltip=()=>{const{tipFormatter:e,tooltipVisible:t}=this.getProps();return null===e||!1===t},this.onFocus=(e,t)=>{if(this._noTooltip())return;Le(e);const{target:n}=e;try{n.matches(":focus-visible")&&("min"===t?this._adapter.setStateVal("firstDotFocusVisible",!0):this._adapter.setStateVal("secondDotFocusVisible",!0))}catch(e){Q(!0,"Warning: [Semi Slider] The current browser does not support the focus-visible")}},this.onBlur=(e,t)=>{if(this._noTooltip())return;const{firstDotFocusVisible:n,secondDotFocusVisible:r}=this.getStates();"min"===t?n&&this._adapter.setStateVal("firstDotFocusVisible",!1):r&&this._adapter.setStateVal("secondDotFocusVisible",!1)},this.handleWrapClick=e=>{const{disabled:t,isDrag:n}=this._adapter.getStates();if(n||t||this._adapter.isEventFromHandle(e))return;const{vertical:r}=this.getProps(),i=this.handleMousePos(e.clientX,e.clientY),s=r?i.y:i.x,o=this.checkWhichHandle(s),a=this.calculateOutputValue(s,o);void 0!==a&&(this._adapter.notifyChange(a),this._isControlledComponent()||this.setHandlePos(s,o,!0,a))},this.setHandlePos=function(e,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;t._adapter.onHandleMove(e,n,(()=>t._adapter.onHandleUpAfter()),r,i)},this.checkWhichHandle=e=>{const{vertical:t,verticalReverse:n}=this.getProps(),{currentValue:r}=this._adapter.getStates(),i=this.transValueToPos(r);let s=!0;if(Array.isArray(i)){s=Math.abs(e-i[0])<=Math.abs(e-i[1])}return t&&n&&(s=!s),s},this.handleWrapperEnter=()=>{this._adapter.setStateVal("showBoundary",!0)},this.handleWrapperLeave=()=>{this._adapter.setStateVal("showBoundary",!1)}}init(){this._checkCurrentValue(),this._dragOffset=0}_checkCurrentValue(){const{currentValue:e,min:t,max:n}=this.getStates();let r;Array.isArray(e)?(r=[],r[0]=this._checkValidity(e[0],t,n),r[1]=this._checkValidity(e[1],t,n)):r=this._checkValidity(e,t,n),this._adapter.updateCurrentValue(r)}destroy(){this._adapter.unSubscribeEventListener()}_getHandleCenterPosition(e,t){const n=t.getBoundingClientRect(),{x:r,y:i}=this.handleMousePos(n.left+.5*n.width,n.top+.5*n.height);return e?i:r}}__webpack_require__("unlL");var u_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const p_=c_.PREFIX;class f_ extends f{constructor(e){super(e),this.renderHandle=()=>{var e,t,n,r,i;const{vertical:s,range:o,tooltipVisible:a,tipFormatter:l,"aria-label":c,"aria-labelledby":d,"aria-valuetext":u,getAriaValueText:p,disabled:f}=this.props,{chooseMovePos:m,isDrag:g,isInRenderTree:y,firstDotFocusVisible:v,secondDotFocusVisible:b}=this.state,x=this.context.direction,E=s?"top":"rtl"===x&&!s?"right":"left",C=this.foundation.getMinAndMaxPercent(this.state.currentValue),S=C.min,_=C.max,{tipVisible:k,tipChildren:O}=this.foundation.computeHandleVisibleVal(a&&y,l,o),T=w()(c_.HANDLE,{[`${c_.HANDLE}-clicked`]:"min"===m&&g}),P=w()(c_.HANDLE,{[`${c_.HANDLE}-clicked`]:"max"===m&&g}),{min:I,max:M,currentValue:R}=this.state,A={"aria-label":null!=c?c:f?"Disabled Slider":void 0,"aria-labelledby":d,"aria-disabled":f};s&&Object.assign(A,{"aria-orientation":"vertical"});const N=this.props.handleDot,D=o?h().createElement(h().Fragment,null,h().createElement(_t,{content:O.min,position:"top",trigger:"custom",rePosKey:S,visible:y&&(k.min||v),className:`${c_.HANDLE}-tooltip`},h().createElement("span",Object.assign({ref:this.minHanleEl,className:T,style:{[E]:100*S+"%",zIndex:"min"===m?2:1},onMouseDown:e=>{this.foundation.onHandleDown(e,"min")},onMouseEnter:()=>{this.foundation.onHandleEnter("min")},onTouchStart:e=>{this.foundation.onHandleTouchStart(e,"min")},onMouseLeave:()=>{this.foundation.onHandleLeave()},onKeyUp:e=>{this.foundation.onHandleUp(e)},onTouchEnd:e=>{this.foundation.onHandleUp(e)},onKeyDown:e=>{this.foundation.handleKeyDown(e,"min")},onFocus:e=>{this.foundation.onFocus(e,"min")},onBlur:e=>{this.foundation.onBlur(e,"min")},role:"slider",tabIndex:f?-1:0},A,{"aria-valuetext":p?p(R[0],0):u,"aria-valuenow":R[0],"aria-valuemax":R[1],"aria-valuemin":I}),(null==N?void 0:N[0])&&h().createElement("div",{className:c_.HANDLE_DOT,style:Object.assign(Object.assign({},(null===(e=N[0])||void 0===e?void 0:e.size)?{width:N[0].size,height:N[0].size}:{}),(null===(t=N[0])||void 0===t?void 0:t.color)?{backgroundColor:N[0].color}:{})}))),h().createElement(_t,{content:O.max,position:"top",trigger:"custom",rePosKey:_,visible:y&&(k.max||b),className:`${c_.HANDLE}-tooltip`},h().createElement("span",Object.assign({ref:this.maxHanleEl,className:P,style:{[E]:100*_+"%",zIndex:"max"===m?2:1},onMouseDown:e=>{this.foundation.onHandleDown(e,"max")},onMouseEnter:()=>{this.foundation.onHandleEnter("max")},onMouseLeave:()=>{this.foundation.onHandleLeave()},onKeyUp:e=>{this.foundation.onHandleUp(e)},onTouchStart:e=>{this.foundation.onHandleTouchStart(e,"max")},onTouchEnd:e=>{this.foundation.onHandleUp(e)},onKeyDown:e=>{this.foundation.handleKeyDown(e,"max")},onFocus:e=>{this.foundation.onFocus(e,"max")},onBlur:e=>{this.foundation.onBlur(e,"max")},role:"slider",tabIndex:f?-1:0},A,{"aria-valuetext":p?p(R[1],1):u,"aria-valuenow":R[1],"aria-valuemax":M,"aria-valuemin":R[0]}),(null===(n=this.props.handleDot)||void 0===n?void 0:n[1])&&h().createElement("div",{className:c_.HANDLE_DOT,style:Object.assign(Object.assign({},(null===(r=this.props.handleDot[1])||void 0===r?void 0:r.size)?{width:this.props.handleDot[1].size,height:this.props.handleDot[1].size}:{}),(null===(i=this.props.handleDot[1])||void 0===i?void 0:i.color)?{backgroundColor:this.props.handleDot[1].color}:{})})))):h().createElement(_t,{content:O.min,showArrow:this.props.showArrow,position:"top",trigger:"custom",rePosKey:S,visible:y&&(k.min||v),className:`${c_.HANDLE}-tooltip`},h().createElement("span",Object.assign({onMouseOver:this.foundation.checkAndUpdateIsInRenderTreeState,ref:this.minHanleEl,className:T,style:{[E]:100*S+"%",zIndex:"min"===m&&g?2:1},onMouseDown:e=>{this.foundation.onHandleDown(e,"min")},onMouseEnter:()=>{this.foundation.onHandleEnter("min")},onTouchStart:e=>{this.foundation.onHandleTouchStart(e,"min")},onMouseLeave:()=>{this.foundation.onHandleLeave()},onKeyUp:e=>{this.foundation.onHandleUp(e)},onTouchEnd:e=>{this.foundation.onHandleUp(e)},onKeyDown:e=>{this.foundation.handleKeyDown(e,"min")},onFocus:e=>{this.foundation.onFocus(e,"min")},onBlur:e=>{this.foundation.onBlur(e,"min")},role:"slider","aria-valuetext":p?p(R,0):u,tabIndex:f?-1:0},A,{"aria-valuenow":R,"aria-valuemax":M,"aria-valuemin":I}),N&&h().createElement("div",{className:c_.HANDLE_DOT,style:Object.assign(Object.assign({},(null==N?void 0:N.size)?{width:N.size,height:N.size}:{}),(null==N?void 0:N.color)?{backgroundColor:N.color}:{})})));return D},this.renderTrack=()=>{const{range:e,included:t,vertical:n}=this.props,r="rtl"===this.context.direction&&!n,i=this.foundation.getMinAndMaxPercent(this.state.currentValue),s=i.min,o=i.max;let a;return a=n?{height:e?100*Math.abs(o-s)+"%":100*s+"%",top:e?100*Math.min(s,o)+"%":0}:r?{width:e?100*Math.abs(o-s)+"%":100*s+"%",right:e?100*Math.min(s,o)+"%":0}:{width:e?100*Math.abs(o-s)+"%":100*s+"%",left:e?100*Math.min(s,o)+"%":0},a=t?a:{},h().createElement("div",{className:c_.TRACK,style:a,onClick:this.foundation.handleWrapClick})},this.renderStepDot=()=>{const{min:e,max:t,vertical:n,marks:r}=this.props,i=this.context.direction,s=n?"top":"rtl"===i&&!n?"right":"left",o=r&&Object.keys(r).length>0?h().createElement("div",{className:c_.DOTS},Object.keys(r).map((n=>{const i=this.foundation.isMarkActive(Number(n)),o=w()(`${p_}-dot`,{[`${p_}-dot-active`]:"active"===this.foundation.isMarkActive(Number(n))}),a=(Number(n)-e)/(t-e),l=h().createElement("span",{key:n,onClick:this.foundation.handleWrapClick,className:o,style:{[s]:`calc(${100*a}% - 2px)`}});return i?this.props.tooltipOnMark?h().createElement(_t,{content:r[n]},l):l:null}))):null;return o},this.renderLabel=()=>{if(!this.props.showMarkLabel)return null;const{min:e,max:t,vertical:n,marks:r,verticalReverse:i}=this.props,s=this.context.direction,o=n?"top":"rtl"===s&&!n?"right":"left",a=r&&Object.keys(r).length>0?h().createElement("div",{className:c_.MARKS+(n&&i?"-reverse":"")},Object.keys(r).map((s=>{const a=this.foundation.isMarkActive(Number(s)),l=(Number(s)-e)/(t-e);return a?h().createElement("span",{key:s,className:w()(`${p_}-mark${n&&i?"-reverse":""}`),style:{[o]:100*l+"%"},onClick:this.foundation.handleWrapClick},r[s]):null}))):null;return a},this._getAriaValueText=(e,t)=>{const{getAriaValueText:n}=this.props;return n?n(e,t):e};let{value:t}=this.props;t||(t=this.props.defaultValue),this.state={currentValue:t||(this.props.range?[0,0]:0),min:this.props.min||0,max:this.props.max||0,focusPos:"",onChange:this.props.onChange,disabled:this.props.disabled||!1,chooseMovePos:"",isDrag:!1,clickValue:0,showBoundary:!1,isInRenderTree:!0,firstDotFocusVisible:!1,secondDotFocusVisible:!1},this.sliderEl=h().createRef(),this.minHanleEl=h().createRef(),this.maxHanleEl=h().createRef(),this.dragging=[!1,!1],this.foundation=new h_(this.adapter),this.eventListenerSet=new Set,this.handleDownEventListenerSet=new Set}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{getSliderLengths:()=>{var e;if(this.sliderEl&&this.sliderEl.current){const t=this.sliderEl.current.getBoundingClientRect(),n=null===(e=this.sliderEl.current.offsetParent)||void 0===e?void 0:e.getBoundingClientRect(),r={x:n?t.left-n.left:this.sliderEl.current.offsetLeft,y:n?t.top-n.top:this.sliderEl.current.offsetTop};return{sliderX:r.x,sliderY:r.y,sliderWidth:t.width,sliderHeight:t.height}}return{sliderX:0,sliderY:0,sliderWidth:0,sliderHeight:0}},getParentRect:()=>{const e=this.sliderEl&&this.sliderEl.current&&this.sliderEl.current.offsetParent;if(e)return e.getBoundingClientRect()},getScrollParentVal:()=>{const e=this.foundation.getScrollParent(this.sliderEl.current);return{scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}},isEventFromHandle:e=>{const t=[this.minHanleEl,this.maxHanleEl];let n=!1;return t.forEach((t=>{if(!t)return;const r=t&&t.current;r&&r.contains(e.target)&&(n=!0)})),n},getOverallVars:()=>({dragging:this.dragging}),updateDisabled:e=>{this.setState({disabled:e})},transNewPropsToState(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i();this.setState(e,t)},notifyChange:e=>{this.props.onChange(Array.isArray(e)?[...e].sort(((e,t)=>e-t)):e)},setDragging:e=>{this.dragging=e},updateCurrentValue:e=>{const{currentValue:t}=this.state;e!==t&&this.setState({currentValue:e})},setOverallVars:(e,t)=>{this[e]=t},getMinHandleEl:()=>this.minHanleEl.current,getMaxHandleEl:()=>this.maxHanleEl.current,onHandleDown:e=>{this.handleDownEventListenerSet.add(this._addEventListener(document.body,"mousemove",this.foundation.onHandleMove,!1)),this.handleDownEventListenerSet.add(this._addEventListener(window,"mouseup",this.foundation.onHandleUp,!1)),this.handleDownEventListenerSet.add(this._addEventListener(document.body,"touchmove",this.foundation.onHandleTouchMove,!1))},onHandleMove:function(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i(),s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(!e.foundation.checkAndUpdateIsInRenderTreeState())return;const{value:a}=e.props;let l=o;if(void 0===l){const r=e.foundation.transPosToValue(t,n);if(!1===r)return;l=e.foundation.outPutValue(r)}const{currentValue:c}=e.state;if(!Oe()(e.foundation.outPutValue(c),l)){if(!s&&e.foundation.valueFormatIsCorrect(a))return!1;e.setState({currentValue:l},r)}},setEventDefault:e=>{e.stopPropagation(),e.preventDefault()},setStateVal:(e,t)=>{this.setState({[e]:t})},checkAndUpdateIsInRenderTreeState:()=>{const e=function(e){return!!e&&Boolean(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}(this.sliderEl.current);return e!==this.state.isInRenderTree&&this.setState({isInRenderTree:e}),e},onHandleEnter:e=>{this.setState({focusPos:e})},onHandleLeave:()=>{this.setState({focusPos:""})},onHandleUpBefore:e=>{var t,n;null===(n=(t=this.props).onMouseUp)||void 0===n||n.call(t,e),e.stopPropagation(),e.preventDefault(),Array.from(this.handleDownEventListenerSet).forEach((e=>e())),this.handleDownEventListenerSet.clear()},onHandleUpAfter:()=>{const{currentValue:e}=this.state,t=this.foundation.outPutValue(e);this.props.onAfterChange(t)},unSubscribeEventListener:()=>{Array.from(this.eventListenerSet).forEach((e=>e()))}})}componentDidMount(){this.foundation.init()}componentDidUpdate(e,t){const n=!Oe()(this.props.value,e.value);if(this.props.disabled!==e.disabled&&this.foundation.handleDisabledChange(this.props.disabled),n){const e=this.props.value,t=this.state.currentValue;this.foundation.handleValueChange(t,e),this.props.onAfterChange(this.props.value)}}componentWillUnmount(){this.foundation.destroy()}render(){const{disabled:e,currentValue:t,min:n,max:r}=this.state,i=this.props,{vertical:s,verticalReverse:o,style:a,railStyle:l,range:c,className:d}=i,u=u_(i,["vertical","verticalReverse","style","railStyle","range","className"]),p=w()(`${p_}-wrapper`,{[`${p_}-disabled`]:e,[`${c_.VERTICAL}-wrapper`]:s,[`${p_}-reverse`]:s&&o},d),f=w()(`${p_}-boundary`,{[`${p_}-boundary-show`]:this.props.showBoundary&&this.state.showBoundary}),m=w()({[`${p_}`]:!s,[c_.VERTICAL]:s}),g=Array.isArray(t)?[...t].sort():t,y=c?`Range: ${this._getAriaValueText(g[0],0)} to ${this._getAriaValueText(g[1],1)}`:void 0,v=h().createElement("div",Object.assign({className:p,style:a,ref:this.sliderEl,"aria-label":y,onMouseEnter:()=>this.foundation.handleWrapperEnter(),onMouseLeave:()=>this.foundation.handleWrapperLeave()},this.getDataAttr(u)),h().createElement("div",{className:`${p_}-rail`,onClick:this.foundation.handleWrapClick,style:l}),this.renderTrack(),this.renderStepDot(),h().createElement("div",null,this.renderHandle()),this.renderLabel(),h().createElement("div",{className:f},h().createElement("span",{className:`${p_}-boundary-min`},n),h().createElement("span",{className:`${p_}-boundary-max`},r)));return s?v:h().createElement("div",{className:m},v)}_addEventListener(e,t,n){if(e.addEventListener){for(var r=arguments.length,s=new Array(r>3?r-3:0),o=3;o<r;o++)s[o-3]=arguments[o];e.addEventListener(t,n,...s);const i=()=>{null==e||e.removeEventListener(t,n),Promise.resolve().then((()=>{this.eventListenerSet.delete(i)}))};return this.eventListenerSet.add(i),i}return i()}}f_.__SemiComponentName__="Slider",f_.contextType=lt,f_.propTypes={defaultValue:E().oneOfType([E().number,E().array]),disabled:E().bool,showMarkLabel:E().bool,included:E().bool,marks:E().object,max:E().number,min:E().number,range:E().bool,step:E().number,tipFormatter:E().func,value:E().oneOfType([E().number,E().array]),vertical:E().bool,onAfterChange:E().func,onChange:E().func,onMouseUp:E().func,tooltipOnMark:E().bool,tooltipVisible:E().bool,showArrow:E().bool,style:E().object,className:E().string,showBoundary:E().bool,railStyle:E().object,verticalReverse:E().bool,getAriaValueText:E().func,handleDot:E().oneOfType([E().shape({size:E().string,color:E().string}),E().arrayOf(E().shape({size:E().string,color:E().string}))])},f_.defaultProps=he(f_.__SemiComponentName__,{disabled:!1,showMarkLabel:!0,tooltipOnMark:!1,included:!0,max:100,min:0,range:!1,showArrow:!0,step:1,tipFormatter:e=>e,vertical:!1,showBoundary:!1,onAfterChange:e=>{},onChange:e=>{},verticalReverse:!1});const m_=Si.PREFIX;class g_ extends f{constructor(){super(...arguments),this.containerRef=h().createRef(),this.mutationObserver=null}componentDidMount(){const e=()=>{const e=this.containerRef.current.querySelectorAll("button"),t=e[0],n=e[e.length-1];(null==t?void 0:t.classList.contains(`${m_}-first`))||null==t||t.classList.add(`${m_}-first`),(null==n?void 0:n.classList.contains(`${m_}-last`))||null==n||n.classList.add(`${m_}-last`)};if(this.containerRef.current){e();const t=new MutationObserver(((t,n)=>{for(const n of t)("attributes"===n.type&&"class"===n.attributeName||"childList"===n.type&&Array.from(n.addedNodes).some((e=>"BUTTON"===e.nodeName)))&&e()}));t.observe(this.containerRef.current,{attributes:!0,childList:!0,subtree:!0}),this.mutationObserver=t}}componentWillUnmount(){var e;super.componentWillUnmount(),null===(e=this.mutationObserver)||void 0===e||e.disconnect()}render(){const{children:e,style:t,className:n}=this.props,r=w()(`${m_}-split`,n);return h().createElement("div",{ref:this.containerRef,className:r,style:t,role:"group","aria-label":this.props["aria-label"]},e)}}g_.propTypes={style:E().object,className:E().string,"aria-label":E().string};const y_={PREFIX:`${C}-steps`,ITEM:`${C}-steps-item`};var v_;!function(e){e.small="large",e.default="extra-large"}(v_||(v_={}));const b_=e=>{const{prefixCls:t=y_.ITEM,className:n="",size:r,title:i,description:s,status:o="wait",style:a,active:l=!1,done:c=!1,icon:d,stepNumber:u,onClick:p,onChange:f,onKeyDown:m}=e,g=w()(t,`${t}-${o}`,{[`${t}-active`]:l,[`${t}-done`]:c,[`${t}-hover`]:f||e.onClick,[`${t}-clickable`]:f||p,[`${t}-${o}-hover`]:f||e.onClick},n),y=w()(`${t}-title-text`,{[`${t}-title-text-empty`]:!i});return h().createElement("div",{role:e.role,"aria-label":e["aria-label"],tabIndex:0,"aria-current":"step",className:g,style:a,onClick:e=>(e=>{null==p||p(e),null==f||f()})(e),onKeyDown:e=>{"Enter"===e.key&&(null==m||m(e),null==f||f())}},h().createElement("div",{className:`${t}-container`},h().createElement("div",{className:`${t}-left`},(()=>{let n,i;if("icon"in e)h().isValidElement(d)&&(n=d);else if("status"in e)switch(o){case"error":n=h().createElement(ns,{size:v_[r]});break;case"wait":n=h().createElement("span",{className:`${t}-number-icon`},u);break;case"process":n=h().createElement("span",{className:`${t}-number-icon`},u),i=!0;break;case"finish":n=h().createElement(es,{size:v_[r]});break;case"warning":n=h().createElement(Qi,{size:v_[r]});break;default:n=null}const s=w()({[`${t}-icon`]:!0,[`${t}-custom-icon`]:"icon"in e,[`${t}-icon-process`]:i});return n?h().createElement("span",{className:s},n):null})()),h().createElement("div",{className:`${t}-content`},h().createElement("div",{className:`${t}-title`},h().createElement("div",{className:y},i)),s&&h().createElement("div",{className:`${t}-description`},s))))},w_=e=>{const{prefixCls:t=y_.ITEM,className:n="",title:r,description:i,status:s="wait",style:o,onClick:a,icon:l,onChange:c,stepNumber:d,onKeyDown:u}=e;return h().createElement("div",{role:e.role,"aria-label":e["aria-label"],"aria-current":"step",tabIndex:0,className:w()({[t]:!0,[`${t}-${s}`]:Boolean(s),[`${t}-${s}-hover`]:Boolean(s)&&(c||a),[`${t}-${s}-active`]:Boolean(s)&&(c||a),[`${t}-clickable`]:c||a},n),style:o,onClick:e=>{(e=>{null==a||a(e),null==c||c()})(e)},onKeyDown:e=>{"Enter"===e.key&&(null==u||u(e),null==c||c())}},(()=>{let n,r;if("icon"in e)n=l;else if("status"in e)switch(s){case"error":n=h().createElement(ns,{size:"extra-large"});break;case"wait":n=d;break;case"process":n=d,r=!0;break;case"finish":n=h().createElement(es,{size:"extra-large"});break;case"warning":n=h().createElement(Qi,{size:"extra-large"});break;default:n=null}const i=w()({[`${t}-left`]:!0,[`${t}-icon`]:"icon"in e,[`${t}-plain`]:!("icon"in e),[`${t}-icon-process`]:r,[`${t}-hover`]:c||a});return n?h().createElement("div",{className:i},n):null})(),h().createElement("div",{className:`${t}-content`},h().createElement("div",{className:`${t}-title`,title:"string"==typeof r?r:null},h().createElement("span",{className:`${t}-title-text`},r)),h().createElement("div",{className:`${t}-description`,title:"string"==typeof i?i:null},i)))},x_=e=>{const{prefixCls:t=y_.ITEM,className:n="",title:r,style:i,active:s=!1,index:o,total:a,onClick:l,onKeyDown:c,onChange:d}=e,u=w()(t,{[`${t}-active`]:s},n);return h().createElement("div",{role:e.role,"aria-label":e["aria-label"],"aria-current":"step",tabIndex:0,className:u,style:i,onClick:e=>(e=>{null==l||l(e),null==d||d()})(e),onKeyDown:e=>{"Enter"===e.key&&(null==c||c(e),null==d||d())}},h().createElement("div",{className:`${t}-container`},h().createElement("div",{className:`${t}-content`},h().createElement("div",{className:`${t}-title`},r)),o!==a-1&&h().createElement("div",{className:`${t}-icon`},h().createElement(Al,{size:"small"}))))},E_=h().createContext(null),C_=e=>{const{type:t}=(0,d.useContext)(E_);return(()=>{switch(t){case"fill":return h().createElement(w_,Object.assign({},e));case"basic":return h().createElement(b_,Object.assign({},e));case"nav":return h().createElement(x_,Object.assign({},e));default:return null}})()};__webpack_require__("hlZc");var S_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const __=e=>{const{current:t=0,status:n="process",children:r,prefixCls:i=y_.PREFIX,initial:s=0,direction:o="horizontal",className:a,style:l,onChange:c}=e,p=S_(e,["current","status","children","prefixCls","initial","direction","className","style","onChange"]),f=(0,d.useMemo)((()=>{const e=d.Children.toArray(r).filter((e=>(0,d.isValidElement)(e))),a="vertical"===o?null:{width:100/e.length+"%"},l=d.Children.map(e,((e,r)=>{if(!e)return null;const l=s+r,u=Object.assign({stepNumber:`${l+1}`,direction:o},e.props);return"error"===n&&r===t-1&&(u.className=`${i}-next-error`),e.props.status||(u.status=l===t?n:l<t?"finish":"wait"),u.onChange=c?()=>{r!==t&&c(r+s)}:void 0,h().createElement(rx,{style:a},(0,d.cloneElement)(e,Object.assign({},u)))}));return l}),[r,s,i,o,n,t,c]),m=w()(a,{[i]:!0,[`${i}-${o}`]:!0});return h().createElement("div",Object.assign({className:m,style:l,"aria-label":e["aria-label"]},u(p)),h().createElement(Qw,{type:"flex",justify:"start"},f))};var k_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const O_=e=>{const{size:t="",current:n=0,status:r="process",children:i,prefixCls:s=y_.PREFIX,initial:o=0,direction:a="horizontal",className:l,style:c,hasLine:p=!0,onChange:f}=e,m=k_(e,["size","current","status","children","prefixCls","initial","direction","className","style","hasLine","onChange"]),g=(0,d.useMemo)((()=>{const e=d.Children.toArray(i).filter((e=>(0,d.isValidElement)(e))),a=d.Children.map(e,((e,i)=>{if(!e)return null;const a=o+i,l=Object.assign({stepNumber:`${a+1}`,size:t},e.props);return"error"===r&&i===n-1&&(l.className=`${s}-next-error`),e.props.status||(l.status=a===n?r:a<n?"finish":"wait"),l.active=a===n,l.done=a<n,l.onChange=f?()=>{i!==n&&f(i+o)}:void 0,(0,d.cloneElement)(e,Object.assign({},l))}));return a}),[i,o,s,a,r,n,t,f]),y=w()(l,{[`${s}-basic`]:!0,[`${s}-${a}`]:!0,[`${s}-${t}`]:"default"!==t,[`${s}-hasline`]:p});return h().createElement("div",Object.assign({"aria-label":e["aria-label"],className:y,style:c},u(m)),g)};var T_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const P_=e=>{const{size:t="default",current:n=0,initial:r=0,children:i,prefixCls:s=y_.PREFIX,className:o,style:a,onChange:l}=e,c=T_(e,["size","current","initial","children","prefixCls","className","style","onChange"]),p=(0,d.useMemo)((()=>{const e=d.Children.toArray(i).filter((e=>(0,d.isValidElement)(e))),t=e.length,s=d.Children.map(e,((e,i)=>{if(!e)return null;const s=Object.assign({index:i,total:t},e.props);return s.active=i===n,s.onChange=l?()=>{i!==n&&l(i+r)}:void 0,(0,d.cloneElement)(e,Object.assign({},s))}));return s}),[i,s,n,t,r,l]),f=w()(o,{[`${s}-nav`]:!0,[`${s}-${t}`]:"default"!==t});return h().createElement("div",Object.assign({"aria-label":e["aria-label"],className:f,style:a},u(c)),p)};var I_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class M_ extends d.Component{renderComponent(){const e=this.props,{type:t}=e,n=I_(e,["type"]);switch(t){case"fill":return h().createElement(__,Object.assign({},n));case"basic":return h().createElement(O_,Object.assign({},n));case"nav":return h().createElement(P_,Object.assign({},n));default:return null}}render(){const{type:e}=this.props;return h().createElement(E_.Provider,{value:{type:e}},this.renderComponent())}}M_.Step=C_,M_.propTypes={onChange:E().func,type:E().oneOf(["fill","basic","nav"]),size:E().oneOf(["small","default"])},M_.defaultProps={type:"fill",size:"default"};const R_=M_;class A_ extends c{constructor(e){super(Object.assign({},e)),this.handleFocusVisible=e=>{const{target:t}=e;try{t.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch(e){Q(!0,"Warning: [Semi Switch] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this._adapter.setFocusVisible(!1)}}init(){const{disabled:e}=this.getProps();this.setDisabled(e)}setChecked(e){this._adapter.setNativeControlChecked(e)}setDisabled(e){this._adapter.setNativeControlDisabled(e)}handleChange(e,t){void 0!==this.getProps().checked||this._adapter.setNativeControlChecked(e),this._adapter.notifyChange(e,t)}destroy(){}}const N_={PREFIX:`${C}-switch`,FOCUS:`${C}-switch-focus`,LARGE:`${C}-switch-large`,SMALL:`${C}-switch-small`,CHECKED:`${C}-switch-checked`,DISABLED:`${C}-switch-disabled`,ACTIVE:`${C}-switch-active`,KNOB:`${C}-switch-knob`,NATIVE_CONTROL:`${C}-switch-native-control`,CHECKED_TEXT:`${C}-switch-checked-text`,UNCHECKED_TEXT:`${C}-switch-unchecked-text`,LOADING_SPIN:`${C}-switch-loading-spin`,LOADING:`${C}-switch-loading`};__webpack_require__("Ak1P");var D_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class L_ extends f{constructor(e){super(e),this.handleFocusVisible=e=>{this.foundation.handleFocusVisible(e)},this.handleBlur=e=>{this.foundation.handleBlur()},this.state={nativeControlChecked:e.defaultChecked||e.checked,nativeControlDisabled:!1,focusVisible:!1},this.switchRef=h().createRef(),this.foundation=new A_(this.adapter)}componentDidMount(){this.foundation.init()}componentDidUpdate(e){this.props.checked!==e.checked&&this.foundation.setChecked(this.props.checked),this.props.disabled!==e.disabled&&this.foundation.setDisabled(this.props.disabled)}componentWillUnmount(){this.foundation.destroy()}get adapter(){return Object.assign(Object.assign({},super.adapter),{setNativeControlChecked:e=>{this.setState({nativeControlChecked:e})},setNativeControlDisabled:e=>{this.setState({nativeControlDisabled:e})},setFocusVisible:e=>{this.setState({focusVisible:e})},notifyChange:(e,t)=>{this.props.onChange(e,t)}})}render(){const{nativeControlChecked:e,nativeControlDisabled:t,focusVisible:n}=this.state,r=this.props,{className:i,style:s,onMouseEnter:o,onMouseLeave:a,size:l,checkedText:c,uncheckedText:d,loading:u,id:p}=r,f=D_(r,["className","style","onMouseEnter","onMouseLeave","size","checkedText","uncheckedText","loading","id"]),m=w()(i,{[N_.PREFIX]:!0,[N_.CHECKED]:e,[N_.DISABLED]:t,[N_.LARGE]:"large"===l,[N_.SMALL]:"small"===l,[N_.LOADING]:u,[N_.FOCUS]:n}),g={type:"checkbox",className:N_.NATIVE_CONTROL,disabled:t||u,checked:e||!1},y=c&&e&&"small"!==l,v=d&&!e&&"small"!==l;return h().createElement("div",Object.assign({className:m,style:s,onMouseEnter:o,onMouseLeave:a},this.getDataAttr(f)),u?h().createElement(dr,{wrapperClassName:N_.LOADING_SPIN,size:"default"===l?"middle":l}):h().createElement("div",{className:N_.KNOB,"aria-hidden":!0}),y?h().createElement("div",{className:N_.CHECKED_TEXT,"x-semi-prop":"checkedText"},c):null,v?h().createElement("div",{className:N_.UNCHECKED_TEXT,"x-semi-prop":"uncheckedText"},d):null,h().createElement("input",Object.assign({},g,{ref:this.switchRef,id:p,role:"switch","aria-checked":e,"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],"aria-disabled":this.props.disabled,onChange:e=>this.foundation.handleChange(e.target.checked,e),onFocus:e=>this.handleFocusVisible(e),onBlur:e=>this.handleBlur(e)})))}}L_.__SemiComponentName__="Switch",L_.propTypes={"aria-label":E().string,"aria-labelledby":E().string,"aria-invalid":E().bool,"aria-errormessage":E().string,"aria-describedby":E().string,className:E().string,checked:E().bool,checkedText:E().node,defaultChecked:E().bool,disabled:E().bool,loading:E().bool,onChange:E().func,onMouseEnter:E().func,onMouseLeave:E().func,style:E().object,size:E().oneOf(["default","small","large"]),uncheckedText:E().node,id:E().string},L_.defaultProps=he(L_.__SemiComponentName__,{disabled:!1,className:"",onChange:i(),loading:!1,onMouseEnter:i(),onMouseLeave:i(),size:"default"});const F_=L_;var j_=__webpack_require__("cdI6"),$_=__webpack_require__.n(j_),B_=__webpack_require__("oBkS"),V_=__webpack_require__.n(B_),z_=__webpack_require__("+DnP"),H_=__webpack_require__.n(z_),U_=__webpack_require__("6OdC"),K_=__webpack_require__.n(U_);const W_={PREFIX:`${C}-table`,TABLE:`${C}-table`,WRAP:`${C}-table-wrapper`,THEAD:`${C}-table-thead`,TR:`${C}-table-row`,TH:`${C}-table-row-head`,TD:`${C}-table-row-cell`},G_={SIZE_SMALL:"small",SIZE_MIDDLE:"middle",SIZES:["small","default","middle"],LAYOUTS:["","auto","fixed"],PAGINATION_POSITIONS:["bottom","top","both"],FOOTER_POSITIONS:[!1,!0,"left","right"],SORT_DIRECTIONS:["ascend","descend"],FIXED_SET:[!1,!0,"left","right"],ALIGNS:["left","right","center"],JUSTIFY_CONTENT:["flex-start","flex-end","center"],SCROLL_HORIZONTAL_POSITIONS:["left","middle","right"],DEFAULT_KEY_COLUMN_SELECTION:"column-selection",DEFAULT_KEY_COLUMN_EXPAND:"column-expand",DEFAULT_KEY_COLUMN_TITLE:"column-title",DEFAULT_KEY_COLUMN_SORTER:"column-sorter",DEFAULT_KEY_COLUMN_FILTER:"column-filter",DEFAULT_KEY_COLUMN_SCROLLBAR:"column-scrollbar",DEFAULT_COMPONENTS:{table:"table",header:{outer:"table",wrapper:"thead",row:"tr",cell:"th"},body:{outer:"table",wrapper:"tbody",row:"tr",cell:"td"},footer:{wrapper:"tfoot",row:"tr",cell:"td"}},EXPAND_RELATED_PROPS:["expandedRowRender","dataSource","hideExpandedColumn","childrenRecordName","rowExpandable"]},q_={DEFAULT_PAGE_SIZE:10,DEFAULT_WIDTH_COLUMN_EXPAND:60,DEFAULT_WIDTH_COLUMN_SELECTION:60,DEFAULT_INDENT_WIDTH:20,DEFAULT_CELL_PADDING_LEFT:16,DEFAULT_CELL_PADDING_RIGHT:16,DEFAULT_CELL_PADDING_TOP:16,DEFAULT_CELL_PADDING_BOTTOM:16,DEFAULT_CELL_MIDDLE_PADDING_TOP:12,DEFAULT_CELL_MIDDLE_PADDING_BOTTOM:12,DEFAULT_CELL_SMALL_PADDING_TOP:8,DEFAULT_CELL_SMALL_PADDING_BOTTOM:8,DEFAULT_CELL_BORDER_WIDTH_LEFT:1,DEFAULT_CELL_BORDER_WIDTH_RIGHT:1,DEFAULT_CELL_BORDER_WITH_BOTTOM:1,DEFAULT_CELL_LINE_HEIGHT:20,DEFAULT_VIRTUALIZED_BODY_HEIGHT:600,DEFAULT_VIRTUALIZED_SECTION_ROW_HEIGHT:53,DEFAULT_VIRTUALIZED_ROW_HEIGHT:53,DEFAULT_VIRTUALIZED_ROW_MIN_HEIGHT:33,DEFAULT_VIRTUALIZED_SECTION_ROW_MIDDLE_HEIGHT:45,DEFAULT_VIRTUALIZED_ROW_MIDDLE_HEIGHT:45,DEFAULT_VIRTUALIZED_ROW_MIDDLE_MIN_HEIGHT:25,DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT:37,DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT:37,DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT:17};const X_=class{constructor(e){this._prefix=e}_isEmpty(e){return null==e||""===e}_baseLog(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"log";if("function"==typeof console[e]){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=[...n];this._isEmpty(this._prefix)||i.unshift(this._prefix,":"),console[e](...i)}}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._baseLog("log",...t)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._baseLog("warn",...t)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._baseLog("error",...t)}info(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._baseLog("info",...t)}};function Y_(e,t){t=Array.isArray(t)?t:["key","dataIndex"];let n=null;return Me()(t,(t=>{if(n=o()(e,t),null!=n)return!1})),n}function Z_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;t=t<0||"number"!=typeof t?0:t,n=n>e.length||"number"!=typeof n?e.length:n;let r=0;return Me()(e,((e,i)=>{i>=t&&i<n&&(r+="number"!=typeof e||isNaN(e)?0:e)})),r}function J_(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["key"];const r=H_()(e,(e=>!0===e.fixed||"left"===e.fixed)),i=Nv()(r,(e=>n.every((n=>null!=e[n]&&e[n]===t[n]))));return r.length>0&&i===r.length-1}function Q_(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["key"];const r=H_()(e,(e=>"right"===e.fixed)),i=Nv()(r,(e=>n.every((n=>null!=e[n]&&e[n]===t[n]))));return r.length>0&&0===i}function ek(e){return["left",!0].includes(o()(e,"fixed"))}function tk(e){return["right"].includes(o()(e,"fixed"))}function nk(e){return o()(e,"key")===G_.DEFAULT_KEY_COLUMN_EXPAND}function rk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[G_.DEFAULT_KEY_COLUMN_SCROLLBAR];return H_()(e,(e=>!t.includes(e.key)))}function ik(e,t){return void 0===t&&(t="key"),"function"==typeof t?t(e):o()(e,t)}function sk(e,t){return null!=t&&Vl()(e,t)}function ok(e,t){return null!==t&&e.has(t)}function ak(e,t){return null!==t&&e.has(t)}function lk(e,t,n){return void 0===n&&(n="key"),jv()(e,(e=>null!=t&&""!==t&&ik(e,n)===t))}function ck(){let e=arguments.length>1?arguments[1]:void 0;return void 0===e&&(e="__expanded_row"),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")+e}function dk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"children";const n=[];if(Array.isArray(e)&&e.length)for(const r of e)Array.isArray(r[t])&&r[t].length?n.push(...dk(r[t],t)):(gk(r),n.push(r));return n}function hk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"children",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=[];return Me()(e,((e,i)=>{if(null==e.key){const t=e.dataIndex||i;e.key=`${n}-${t}`}Array.isArray(e[t])&&e[t].length&&r.push(...e[t])})),r.length&&hk(r,t,n+1),e}function uk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=[];return Array.isArray(e)&&e.length&&r<=t&&e.forEach((e=>{const s=e[n];Array.isArray(s)&&s.length&&r<t?i.push(...uk(s,t,n,r+1)):i.push(e)})),i}function pk(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children";return Me()(e,(e=>{if(e&&null!=e.key&&!n&&e.key===t.key&&(n=e),e&&Array.isArray(e[r])&&!n&&(n=pk(e[r],t,r)),n)return!1})),n}function fk(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=n.findIndex((n=>e.dataIndex===n.dataIndex&&(t=Object.assign(Object.assign({},n),e),!0)));return r>-1?n.splice(r,1,t):n.push(t),[...n]}function mk(e){let{dataSource:t,getCheckboxProps:n,childrenRecordName:r,rowKey:i}=e;const s=[];if(Array.isArray(t)&&t.length&&"function"==typeof n)for(const e of t){const t=n(e),a="function"==typeof i?i(e):o()(e,i);t&&t.disabled&&s.push(a);const l=o()(e,r);if(Array.isArray(l)&&l.length){const e=mk({dataSource:l,getCheckboxProps:n});s.push(...e)}}return s}function gk(e){if("object"==typeof e&&null!==e){const{filters:t,sorter:n,dataIndex:r,onFilter:i}=e,s=new X_("[@douyinfe/semi-ui Table]");(Array.isArray(t)||ye()(i)||ye()(n))&&Re(r)&&s.warn("The column with sorter or filter must pass the 'dataIndex' prop")}}function yk(e){let{dataSource:t,childrenRecordName:n="children"}=e,r=!1;if(Array.isArray(t))for(const e of t){const t=o()(e,n);if(Array.isArray(t)&&t.length){r=!0;break}}return r}function vk(e,t){if("rtl"===t)switch(e){case"left":return"right";case"right":return"left";default:return e}return e}function bk(e){return!0===e||o()(e,"showTitle",!0)}const wk=class{constructor(e){this._state=Object.assign({},e),this._listeners=[]}subscribe(e){this._listeners.push(e);return()=>{const t=this._listeners.indexOf(e);t>-1&&this._listeners.splice(t,1)}}setState(e){Object.assign(this._state,Object.assign({},e));for(const e of this._listeners)"function"==typeof e&&e(this._state)}getState(){return this._state}};var xk=__webpack_require__("NbvU"),Ek=__webpack_require__.n(xk),Ck=__webpack_require__("jHPj"),Sk=__webpack_require__.n(Ck);function _k(e,t){if(e===t&&(t=function(e){return new Set(e)}(t)),$l()(e)&&e.size&&$l()(t)&&t.size){for(const n of t)e.has(n)&&e.delete(n);return e}return e}function kk(e,t){if(null!==e&&e.length&&null!==t&&t.length){const n=_k(new Set(e),new Set(t));return Array.from(n)}return e}class Ok extends c{static initColumnsFilteredValueAndSorterOrder(e){return e.forEach((e=>{Ok.initFilteredValue(e),Ok.initSorterOrder(e)})),e}static initFilteredValue(e){const{defaultFilteredValue:t,filteredValue:n}=e;_e()(n)&&(Array.isArray(t)&&t.length?e.filteredValue=t:e.filteredValue=[])}static initSorterOrder(e){const{defaultSortOrder:t,sortOrder:n,sorter:r}=e;r&&_e()(n)&&(_e()(t)?e.sortOrder=!1:e.sortOrder=t)}constructor(e){super(Object.assign({},e)),this.setPage=(e,t)=>{e=e||this._adapter.getCurrentPage();const n=this.getState("pagination"),{dataSource:r,pagination:i,disabledRowKeys:s,allRowKeys:o}=this.getCurrentPageData(null,Object.assign(Object.assign({},n),{currentPage:e,pageSize:t}));!this._pagerIsControlled()&&e>0&&(this._adapter.setDisabledRowKeys(s),this._adapter.setAllRowKeys(o),this._adapter.setPagination(i),this._adapter.setDataSource(r)),this._notifyChange(i,void 0,void 0,{changeType:"pagination"})},this.setCachedFilteredSortedDataSource=e=>{this._adapter.setCachedFilteredSortedDataSource(e);const t=this.getAllRowKeys(e);this._adapter.setCachedFilteredSortedRowKeys(t)},this.handleMouseDown=e=>{var t,n;this.mouseDownTarget={targetName:null===(t=e.target)||void 0===t?void 0:t.tagName,className:null===(n=e.target)||void 0===n?void 0:n.className}},this.isSortOrderValid=e=>G_.SORT_DIRECTIONS.includes(e)||!1===e;const t=this._adapter.getHandleColumns(),n=this._adapter.getMergePagination();this.mouseDownTarget=null,this.memoizedWithFnsColumns=wd(t,Oe()),this.memoizedFilterColumns=wd(rk),this.memoizedFlattenFnsColumns=wd(dk),this.memoizedPagination=wd(n,Oe())}init(){const e=[...this.getProp("dataSource")],{queries:t}=this._adapter.getStates(),n=this.getFilteredSortedDataSource(e,t),r=this.getAllDisabledRowKeys(n),i=this.getCurrentPageData(n);this.setAdapterPageData(i),this.initExpandedRowKeys(i),this.initSelectedRowKeys(i),this.setCachedFilteredSortedDataSource(n),this.setAllDisabledRowKeys(r)}initExpandedRowKeys(){let{groups:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{defaultExpandAllRows:t,defaultExpandedRowKeys:n=[],expandedRowKeys:r=[],dataSource:i=[],expandAllRows:s,defaultExpandAllGroupRows:o,expandAllGroupRows:a}=this.getProps(),l=[];t||s?this._addNoDuplicatedItemsToArr(l,this.getAllRowKeys(i),e&&Ek()(e)&&e.size?Array.from(e.keys()):[]):o||a?this._addNoDuplicatedItemsToArr(l,r,e&&Ek()(e)&&e.size?Array.from(e.keys()):[]):Array.isArray(n)&&n.length?this._addNoDuplicatedItemsToArr(l,n):Array.isArray(r)&&r.length&&this._addNoDuplicatedItemsToArr(l,r),this._adapter.setExpandedRowKeys(l)}initSelectedRowKeys(e){let{disabledRowKeys:t}=e;const n=this.getProp("rowSelection"),r=[];if(n){const e=o()(n,"selectedRowKeys"),i=o()(n,"defaultSelectedRowKeys");Array.isArray(e)?this._addNoDuplicatedItemsToArr(r,e):Array.isArray(i)&&this._addNoDuplicatedItemsToArr(r,i),Array.isArray(t)&&t.length&&Sk()(r,...t),this._adapter.setSelectedRowKeys(r)}}getFilteredSortedDataSource(e,t){const n=this.filterDataSource(e,t.filter((e=>{const t=e.filteredValue?e.filteredValue:e.defaultFilteredValue;return ye()(e.onFilter)&&Array.isArray(t)&&t.length})));return this.sortDataSource(n,t.filter((e=>e&&ye()(e.sorter))))}getCurrentPageData(e,t,n){const r=this._adapter.getCachedFilteredSortedDataSource();let i;if(e=null==e?[...r]:e,t=null==t?this.getState("pagination")&&Object.assign({},this.getState("pagination")):t,n=null==n?[...this.getState("queries")]:n,null!=this.getProp("groupBy")){const{groups:t,dataSource:n}=this.groupDataSource(e);e=n,i=t}t=this.normalizePagination(t,e);return{dataSource:e=this.limitPageDataSource(e,t),groups:i,pagination:t,disabledRowKeys:this.getAllDisabledRowKeys(e),allRowKeys:this.getAllRowKeys(e),queries:n}}groupDataSource(e,t){t=null==t?this.getProp("groupBy"):t;const n=new Map,r=[];return null!=t&&Me()(e,((e,r)=>{const i="function"==typeof t?t(e):o()(e,t);if(null!=i&&""!==i){const t=this.getRecordKey(e);let r=n.get(i);$l()(r)?r.add(t):(r=new Set([t]),n.set(i,r))}})),n&&n.size?n.forEach(((e,t)=>{$l()(e)&&e.forEach((e=>{r.push(this._getRecord(e))}))})):r.push(...e),{groups:n,dataSource:r}}sortDataSource(e,t){return Me()(t,(t=>{const{sorter:n,sortOrder:r,defaultSortOrder:i,sortChildrenRecord:s}=t,o=this.isSortOrderValid(r)?r:i;if(ye()(n)&&o&&G_.SORT_DIRECTIONS.includes(o)){if(s){const n=this.getProp("childrenRecordName");e=e&&e.map((e=>{const r=this._getRecordChildren(e);return Array.isArray(r)&&r.length?Object.assign(Object.assign({},e),{[n]:this.sortDataSource(r,[t])}):e}))}return e.sort(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ascend";return"descend"===t?(n,r)=>{const i=Number(e(n,r,t));return 0!==i?-i:i}:(n,r)=>e(n,r,t)}(n,o)),!1}})),e}filterDataSource(e,t){let n=null,r=!1;const i=this.getProp("childrenRecordName");return Me()(t,(t=>{const{onFilter:s,filteredValue:a,filterChildrenRecord:l,defaultFilteredValue:c}=t,d=Array.isArray(a)?a:c;"function"==typeof s&&Array.isArray(d)&&d.length&&(r=!0,null===n||(e=Array.from(n&&n.values())),n=new Map,Me()(e,(e=>{Me()(d,(r=>{const a=o()(e,i),c=this.getRecordKey(e);let d;if(Array.isArray(a)&&a.length&&l&&(d=this.filterDataSource(a,[t])),Array.isArray(d)&&d.length){if(null!=c){const t=o()(n.get(c),i,[]);n.set(c,Object.assign(Object.assign({},e),{[i]:d.reduce(((e,t)=>(null==e.find((e=>this.getRecordKey(e)===this.getRecordKey(t)))&&e.push(t),e)),[...t])}))}}else s(r,e)&&n.set(c,e)}))})))})),r&&(e=Array.from(n&&n.values())),e}limitPageDataSource(e,t){e=null==e?this.getProp("dataSource"):e,t=null==t?this.getState("pagination"):t;let n=e;const r=o()(t,"currentPage");if(!1!==this.getProp("pagination")&&r&&e&&t&&!this._pagerIsControlled()){const{pageSize:i=q_.DEFAULT_PAGE_SIZE}=t,s=(r-1)*i,o=r*i;n=Bv()(e,s,o)}return n}normalizePagination(e,t){e=null==e?this._getPagination():e,t=null==t?this._getDataSource():t;const n=this.getProp("pagination");if(e&&(e="object"==typeof e?Object.assign({},e):{},e=Ce()({total:t&&t.length||0,pageSize:q_.DEFAULT_PAGE_SIZE,currentPage:o()(n,"defaultCurrentPage",1),position:G_.PAGINATION_POSITIONS[0]},e),!this._pagerIsControlled())){const r=o()(n,"total",t.length),{currentPage:i,pageSize:s}=e,a=Math.ceil(r/s);e.total=r,i>a&&(e.currentPage=1)}return e}setAdapterPageData(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{pagination:t,dataSource:n,disabledRowKeys:r,allRowKeys:i,groups:s}=e;this._adapter.setDisabledRowKeys(r),this._adapter.setAllRowKeys(i),this._adapter.setPagination(t),this._adapter.setGroups(s),this._adapter.setDataSource(n)}destroy(){}setAllDisabledRowKeys(e){this._adapter.setAllDisabledRowKeys(e)}handleClick(e){}handleMouseEnter(e){}handleMouseLeave(e){}stopPropagation(e){this._adapter.stopPropagation(e)}_addNoDuplicatedItemsToArr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(const t of n)if(Array.isArray(t))for(const n of t)e.includes(n)||e.push(n);return e}_notifyChange(e,t,n,r){e=null==e?this._getPagination():e,t=null==t?this._getAllFilters():t,n=null==n?this._getAllSorters()[0]:n,o()(this.getProp("scroll"),"scrollToFirstRowOnChange")&&this._adapter.resetScrollY(),this._adapter.notifyChange({pagination:Object.assign({},e),filters:[...t],sorter:n,extra:Object.assign({},r)})}_rowExpansionIsControlled(){return Array.isArray(this.getProp("expandedRowKeys"))}_pagerIsControlled(){return null!=o()(this.getProp("pagination"),"currentPage")}_selectionIsControlled(){return Array.isArray(o()(this.getProp("rowSelection"),"selectedRowKeys"))}_sorterIsControlled(e){const t=e&&this.getQuery(e,this.getState("flattenColumns"));return Boolean(t&&null!=t.sortOrder)}_filterIsControlled(e){const t=e&&this.getQuery(e,this.getState("flattenColumns"));return Boolean(t&&Array.isArray(t.filteredValue))}_filterShowIsControlled(e){const t=e&&this.getQuery(e,this.getState("flattenColumns"));return Boolean(t&&(!0===t.filterDropdownVisible||!1===t.filterDropdownVisible))}_getSelectedRowKeys(){const e=this.getState("rowSelection");return[...o()(e,"selectedRowKeys",[])]}_getSelectedRowKeysSet(){const e=this.getState("rowSelection");return o()(e,"selectedRowKeysSet",new Set)}_getDataSource(){return this.getProp("dataSource")||[]}_getRecord(e){return jv()(this.getProp("dataSource"),(t=>null!=e&&""!==e&&this.getRecordKey(t)===e))}_getRecordChildren(e){return o()(e,this.getProp("childrenRecordName"))}_getPagination(){return this.getState("pagination")||{}}_getAllFilters(e){e=e||this.getState("queries");const t=[];return Me()(e,(e=>{Array.isArray(e.filteredValue)&&(e.filteredValue.length||this._filterIsControlled(e.dataIndex))&&t.push(e)})),t}_getAllSorters(e){return e=e||this.getState("queries"),H_()(e,(e=>e.sorter&&e.sortOrder))}_filterQueries(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["dataIndex"];t=null==t?this.getState("queries"):t;const r=[],i=[];return Me()(t,((t,s)=>{V_()(n,(n=>n&&null!=e[n]&&e[n]===t[n]))&&(r.push(t),i.push(s))})),{filteredQueries:r,filteredIndexes:i}}_mergeToQueries(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["dataIndex"];t=null==t?this.getState("queries"):t,t=[...t],e=Object.assign({},e);const{filteredQueries:r,filteredIndexes:i}=this._filterQueries(e,t,n);return Me()(r,((n,r)=>{t[i[r]]=Object.assign({},e)})),t}getRecordKey(e){if(!e)return;const t=this.getProp("rowKey");return"function"==typeof t?t(e):o()(e,t)}isEmpty(e){return e=null==e?this.getProp("dataSource"):e,!(Array.isArray(e)&&e.length>0)}buildKeyEntities(e){e=null==e?this._getDataSource():e;const t=this.getProp("childrenRecordName"),n=this.getProp("rowKey"),r=e=>e.map((e=>{const i="function"==typeof n?n(e):o()(e,n),s=o()(e,t),a=Object.assign({key:i},e);return Array.isArray(s)&&s.length&&(a.children=r(s)),a})),i=r(e),{keyEntities:s}=ic(i,{key:"key",children:"children"});return s}calcCheckedKeysForSelect(e,t,n,r){const i=this._adapter.getKeyEntities(),s=String(e);return i&&i[s]?t?gc(s,i,n,r):yc(s,i,n,r):(t?n.add(s):n.delete(s),{checkedKeys:n,halfCheckedKeys:r})}handleSelectRow(e,t,n){if(this.stopPropagation(n),"boolean"==typeof t&&null!=e){const r=this._adapter.getCheckRelation(),i=this._getSelectedRowKeys(),s=[...this._adapter.getHalfCheckedRowKeys()||[]];let o=-1;const a=this.getSelectedRows(null,[e])[0];let l;if("related"===r){this._adapter.getKeyEntities();const r=new Set(i.map((e=>String(e)))),o=new Set(s.map((e=>String(e)))),{checkedKeys:c,halfCheckedKeys:d}=this.calcCheckedKeysForSelect(String(e),t,r,o),h=[...c],u=[...d];l=this.getSelectedRows(null,h),this._adapter.setHalfCheckedRowKeys(u),this._selectionIsControlled()||this._adapter.setSelectedRowKeys(h),this._adapter.notifySelect(a,t,l,n),this._adapter.notifySelectionChange(h,l)}else(o=i.indexOf(e))>-1&&!1===t?(i.splice(o,1),l=this.getSelectedRows(null,i),this._selectionIsControlled()||this._adapter.setSelectedRowKeys(i),this._adapter.notifySelect(a,t,l,n),this._adapter.notifySelectionChange(i,l)):-1===i.indexOf(e)&&!0===t&&(i.push(e),l=this.getSelectedRows(null,i),this._selectionIsControlled()||this._adapter.setSelectedRowKeys(i),this._adapter.notifySelect(a,t,l,n),this._adapter.notifySelectionChange(i,l))}}handleSelectAllRow(e,t){if(this.stopPropagation(t),"boolean"==typeof e){const n=this._adapter.getCheckRelation(),r=this._getSelectedRowKeys();let i=[...r];const s=this._getSelectedRowKeysSet();let o=[...this._adapter.getCachedFilteredSortedRowKeys()];const a=this._adapter.getAllDisabledRowKeys(),l=this._adapter.getAllDisabledRowKeysSet();let c;if("related"===n){const n=this._adapter.getKeyEntities(),s=[...this._adapter.getHalfCheckedRowKeys()||[]];let a=new Set(i.map((e=>String(e)))),d=new Set(s.map((e=>String(e))));if(e){const e=o.filter((e=>!l.has(e)));for(const t of e){const e=String(t);if(!a.has(e)&&n&&n[e]){const t=gc(e,n,a,d);a=t.checkedKeys,d=t.halfCheckedKeys}}c=e}else{const e=[...a];for(const t of e)if(n&&n[t]){const e=yc(t,n,a,d);a=e.checkedKeys,d=e.halfCheckedKeys}c=[...r]}i=[...a];const h=[...d],u=this.getSelectedRows(null,c||[]),p=this.getSelectedRows(null,i||[]);this._adapter.setHalfCheckedRowKeys(h),this._selectionIsControlled()||this._adapter.setSelectedRowKeys(i),this._adapter.notifySelectAll(e,p,u,t),this._adapter.notifySelectionChange(i,p)}else{if(e){for(const e of o)l.has(e)||s.has(e)||i.push(e);o=kk(o,[...a,...r]),c=[...o]}else i=kk(i,o),c=[...r];const n=this.getSelectedRows(null,c||[]),d=this.getSelectedRows(null,i||[]);this._selectionIsControlled()||this._adapter.setSelectedRowKeys(i),this._adapter.notifySelectAll(e,d,n,t),this._adapter.notifySelectionChange(i,d)}}}getSelectedRows(e,t,n){e=null==e?this._getDataSource():e,t=null==t?this._getSelectedRowKeys():t,$l()(n)||(n=new Set(t));const r=this.getProp("childrenRecordName"),i=[];if($l()(n)&&n.size&&Array.isArray(e)&&e.length&&(i.push(...e.filter((e=>n.has(this.getRecordKey(e))))),i.length<t.length))for(const s of e){const e=o()(s,r);if(Array.isArray(e)&&e.length){const r=this.getSelectedRows(e,t,n);i.push(...r)}}return i}getAllDisabledRowKeys(e,t){e=null==e?this._getDataSource():e,t=null==t?o()(this.getProp("rowSelection"),"getCheckboxProps"):t;const n=this.getProp("childrenRecordName"),r=[];if(Array.isArray(e)&&e.length&&"function"==typeof t)for(const i of e){const e=t(i);e&&e.disabled&&r.push(this.getRecordKey(i));const s=o()(i,n);if(Array.isArray(s)&&s.length){const e=this.getAllDisabledRowKeys(s,t);r.push(...e)}}return r}getAllRowKeys(e){e=null==e?this._getDataSource():e;const t=this.getProp("childrenRecordName"),n=[];if(Array.isArray(e)&&e.length)for(const r of e){const e=[],i=o()(r,t);Array.isArray(i)&&i.length&&e.push(...this.getAllRowKeys(i)),n.push(this.getRecordKey(r),...e)}return n}hasRowSelected(e,t){return Boolean(Array.isArray(e)&&e.length&&$l()(t)&&t.size&&e.filter((e=>t.has(e))).length)}handleRowExpanded(e,t,n){this.stopPropagation(n);const r=[...this.getState("expandedRowKeys")],i=r.indexOf(t),s="string"==typeof t||"number"==typeof t;s&&e&&-1===i?r.push(t):s&&!e&&i>-1&&r.splice(i,1),this._rowExpansionIsControlled()||this._adapter.setExpandedRowKeys(r);const o=this.getSelectedRows(null,r);let a=this.getSelectedRows(null,[t])[0];const l=this._getGroups();if(l){l.has(t)&&(a={groupKey:t});for(let e=0,n=r.length;e<n;e++)l.has(t)&&o.push({groupKey:r[e]})}this._adapter.notifyExpand(e,a,n),this._adapter.notifyExpandedRowsChange(o)}_getGroups(){if(null!==this._adapter.getProp("groupBy")){return this._adapter.getState("groups")}return null}allIsSelected(e,t,n){const r=H_()(n,(e=>null!=e&&!t.has(e)));if(r&&r.length){for(const t of r)if(null!=t&&!e.has(t))return!1;return!0}return n.length&&n.every((t=>e.has(t)))||!1}allIsNotSelected(e,t){for(const n of t)if(null!=n&&Array.isArray(e)&&e.includes(n))return!0;return!1}formatPaginationInfo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="";const r=o()(this.getProp("pagination"),"formatPageText"),{total:i,pageSize:s,currentPage:a}=e,l=Math.min((a-1)*s+1,i),c=Math.min(a*s,i);return(r||!1!==r&&t&&i>0)&&(n="function"==typeof r?r({currentStart:l,currentEnd:c,total:i}):t.replace("${currentStart}",l).replace("${currentEnd}",c).replace("${total}",i)),n}toggleShowFilter(e,t){let n=this.getQuery(e);const r=t;n=Object.assign(Object.assign({},n),{filterDropdownVisible:r}),this._filterShowIsControlled(),this._adapter.notifyFilterDropdownVisibleChange(r,e)}handleFilterSelect(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getQuery(e),r=[...this._adapter.getState("queries")];const{filteredValue:i}=t;n=Object.assign(Object.assign({},n),{filteredValue:i}),r=fk(n,r);const s=this._mergeToQueries(n,null),o=this._getAllFilters(s);this._filterIsControlled(e)||(this._adapter.setQueries(r),this.handleClickFilterOrSorter(r)),this._notifyChange(null,o,void 0,{changeType:"filter"})}handleSort(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t,n,r,i;if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]){if(this.mouseDownTarget&&"SPAN"===(null===(t=this.mouseDownTarget)||void 0===t?void 0:t.targetName)&&(null===(i=null===(r=null===(n=this.mouseDownTarget)||void 0===n?void 0:n.className)||void 0===r?void 0:r.includes)||void 0===i?void 0:i.call(r,"react-resizable-handle")))return;this.mouseDownTarget=null}const{dataIndex:s}=e;let a=this.getState("queries"),l=null;a=[...a],Me()(a,((e,t,n)=>{if(e.sorter){const r=Object.assign({},e),i=o()(r,"sortOrder"),a=o()(r,"defaultSortOrder",!1);let c=this.isSortOrderValid(i)?i:a;c=!(!s||s!==r.dataIndex)&&(c===G_.SORT_DIRECTIONS[0]?G_.SORT_DIRECTIONS[1]:c!==G_.SORT_DIRECTIONS[1]&&G_.SORT_DIRECTIONS[0]),n[t]=Object.assign(Object.assign({},r),{sortOrder:c}),s===r.dataIndex&&(l=n[t])}})),this._sorterIsControlled(s)||(this._adapter.setQueries(a),this.handleClickFilterOrSorter(a)),this._notifyChange(null,null,l,{changeType:"sorter"})}handleClickFilterOrSorter(e){const t=[...this.getProp("dataSource")],n=this.getFilteredSortedDataSource(t,e),r=this.getAllDisabledRowKeys(n);this.setCachedFilteredSortedDataSource(n),this.setAllDisabledRowKeys(r);const i=this.getCurrentPageData(n);this.setAdapterPageData(i)}getQuery(e,t){if(t=t||this.getState("queries"),null!=e)return jv()(t,(t=>t.dataIndex===e))}getCellWidths(e,t,n){return this._adapter.getCellWidths(e,t,n)}setHeadWidths(e,t){return this._adapter.setHeadWidths(e,t)}getHeadWidths(e){return this._adapter.getHeadWidths(e)}mergedRowExpandable(e){return this._adapter.mergedRowExpandable(e)}setBodyHasScrollbar(e){this._adapter.setBodyHasScrollbar(e)}}const Tk=Ok;__webpack_require__("u+/o");const Pk={align:E().oneOf(G_.ALIGNS),className:E().string,colSpan:E().number,dataIndex:E().string,defaultSortOrder:E().oneOf(G_.SORT_DIRECTIONS),filterChildrenRecord:E().bool,filterDropdownProps:E().object,filterDropdown:E().node,filterDropdownVisible:E().bool,filterIcon:E().func,filterMultiple:E().bool,filteredValue:E().arrayOf(E().any),filters:E().array,fixed:E().oneOf(G_.FIXED_SET),onCell:E().func,onFilter:E().func,onFilterDropdownVisibleChange:E().func,onHeaderCell:E().func,onSorterChange:E().func,render:E().func,renderFilterDropdownItem:E().func,sortChildrenRecord:E().bool,sortDirections:E().arrayOf(E().string),sortOrder:E().oneOfType([E().bool,E().string]),sorter:E().oneOfType([E().bool,E().func]),title:E().oneOfType([E().func,E().node]),useFullRender:E().bool,width:E().oneOfType([E().number,E().string]),showSortTip:E().bool};class Ik extends h().PureComponent{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}render(){return null}}function Mk(e){if(e){const t=[];return h().Children.forEach(e,(e=>{if(h().isValidElement(e)&&(e.type===Ik||"Column"===o()(e,"type.elementType"))){const n=W()(e.props,["children"]);Array.isArray(e.props.children)&&e.props.children.length&&(n.children=Mk(e.props.children)),t.push(Object.assign({key:e.key},n))}})),t}return[]}Ik.propTypes=Object.assign({},Pk),Ik.elementType="Column";const Rk=h().createContext({headWidths:[],setHeadWidths:i(),handleRowExpanded:i()}),Ak=e=>{let{children:t,anyColumnFixed:n,flattenedColumns:r,tableWidth:i,headWidths:s,setHeadWidths:o,getHeadWidths:a,getCellWidths:l,handleRowExpanded:c,renderExpandIcon:u,renderSelection:p,getVirtualizedListRef:f,setBodyHasScrollbar:m,direction:g,handleRowSelection:y,headerStyle:v,rowSpanHover:b}=e;const w=(0,d.useMemo)((()=>({anyColumnFixed:n,flattenedColumns:r,renderExpandIcon:u,renderSelection:p,setHeadWidths:o,getHeadWidths:a,getCellWidths:l,headWidths:s,tableWidth:i,handleRowExpanded:c,getVirtualizedListRef:f,setBodyHasScrollbar:m,direction:g,handleRowSelection:y,headerStyle:v,rowSpanHover:b})),[n,r,u,p,o,a,l,s,i,c,f,m,g,y,v,b]);return h().createElement(Rk.Provider,{value:w},t)};class Nk extends c{handleChange(e){const t=e.target.checked;this._adapter.notifyChange(t,e)}}class Dk extends f{get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{notifyChange:function(){return e.props.onChange(...arguments)}})}constructor(e){super(e),this.handleChange=e=>this.foundation.handleChange(e),this.foundation=new Nk(this.adapter)}render(){const{selected:e,getCheckboxProps:t,indeterminate:n,disabled:r,prefixCls:i,className:s}=this.props,o=this.props["aria-label"];let a={onChange:this.handleChange,disabled:r,indeterminate:n,checked:e};"function"==typeof t&&(a=Object.assign(Object.assign({},a),t()));const l=w()(`${i}-selection-wrap`,{[`${i}-selection-disabled`]:r},s);return h().createElement("span",{className:l},h().createElement(od,Object.assign({"aria-label":o},a)))}}Dk.propTypes={columnTitle:E().string,getCheckboxProps:E().func,type:E().string,onChange:E().func,selected:E().bool,disabled:E().bool,indeterminate:E().bool,prefixCls:E().string,className:E().string,"aria-label":E().string},Dk.defaultProps={disabled:!1,onChange:i(),prefixCls:W_.PREFIX};class Lk extends d.PureComponent{render(){const{pagination:e,prefixCls:t,info:n,renderPagination:r}=this.props,i=o()(e,"total"),s=r&&ye()(r)?r(e):null;return h().createElement("div",{className:`${t}-pagination-outer`},(0,d.isValidElement)(s)?s:h().createElement(h().Fragment,null,h().createElement("span",{className:`${t}-pagination-info`},n),h().createElement("span",{className:`${t}-pagination-wrapper`},i>0?h().createElement(eS,Object.assign({},e,{key:o()(e,"pageSize","pagination")})):null)))}}Lk.propTypes={style:E().object,prefixCls:E().string,pagination:E().object,info:E().oneOfType([E().string,E().node]),renderPagination:E().func},Lk.defaultProps={prefixCls:W_.PREFIX};const Fk=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.1 2.58A1 1 0 0 1 2 2h20a1 1 0 0 1 .76 1.65l-8.2 9.18V21a1 1 0 0 1-1.44.9l-3.07-2a1 1 0 0 1-.55-.9v-6.17L1.24 3.65a1 1 0 0 1-.15-1.07Z",fill:"currentColor"}))}),"filter");var jk=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function $k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;const{filterMultiple:s=!0,filters:o=[],filteredValue:a=[],filterDropdownVisible:l,onSelect:c=i(),onFilterDropdownVisibleChange:d=i(),trigger:u="click",position:p="bottom",renderFilterDropdown:f,renderFilterDropdownItem:m,filterConfirmMode:g="immediate",tempFilteredValue:y,setTempFilteredValue:v,confirm:b,clear:w,close:x,reset:E}=null!=e?e:{},C="confirm"===g?null!=y?y:[]:a,S=Gl()(e,["tempFilteredValue","setTempFilteredValue","confirm","clear","close","filters"]),_="function"==typeof f?f(S):h().createElement(Ww.Menu,null,Array.isArray(o)&&o.map(((t,i)=>{const o=e=>{const n=e&&e.nativeEvent;if(n&&(n.stopImmediatePropagation(),n.stopPropagation(),n.preventDefault()),"confirm"!==g){let e=[...a];const r=e.includes(t.value),i=e.indexOf(t.value);return i>-1?e.splice(i,1):s?e.push(t.value):e=[t.value],c({value:t.value,filteredValue:e,included:!r,domEvent:n})}{let e=[...null!=y?y:[...a]];e.includes(t.value);const n=e.indexOf(t.value);n>-1?e.splice(n,1):s?e.push(t.value):e=[t.value],null==v||v(e)}},l=C.includes(t.value),{text:d}=t,{value:u}=t,p=`${n}_${i}`,f="function"==typeof m?m({onChange:o,filterMultiple:s,value:u,text:d,checked:l,filteredValue:C,level:n}):null;let b=f&&h().isValidElement(f)?h().cloneElement(f,{key:p}):h().createElement(Ww.Item,{key:p,onClick:o},s?h().createElement(od,{checked:l},d):h().createElement(LS,{checked:l},d));if(Array.isArray(t.children)&&t.children.length){const i=Object.assign(Object.assign({},e),{filters:t.children,trigger:"hover",position:"right"});delete i.filterDropdownVisible,b=$k(i,b,n+1,r)}return b})),"confirm"===g&&0===n&&h().createElement("div",{style:{padding:"8px 12px",borderTop:"1px solid var(--semi-color-border)",display:"flex",justifyContent:"flex-end"}},h().createElement(il,null,h().createElement(vs,{size:"small",onClick:()=>null==E?void 0:E()},(null==r?void 0:r.resetFilter)||"Reset"),h().createElement(vs,{size:"small",theme:"solid",onClick:()=>null==b?void 0:b({closeDropdown:!0})},(null==r?void 0:r.confirmFilter)||"OK")))),{filterDropdownVisible:k}=e,O=jk(e,["filterDropdownVisible"]),T=Object.assign(Object.assign({},O),{trigger:u,position:p,render:_,onVisibleChange:e=>d(e)});return null!=l&&(T.visible=l),h().createElement(Ww,Object.assign({},T,{key:`Dropdown_level_${n}`,className:`${W_.PREFIX}-column-filter-dropdown`}),t)}function Bk(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{prefixCls:t=W_.PREFIX,filteredValue:n,filterIcon:r="filter",filterDropdownProps:i,onSelect:s,filterDropdownVisible:o,renderFilterDropdown:a,onFilterDropdownVisibleChange:l,filterConfirmMode:c="immediate"}=e;let{filterDropdown:u=null}=e;const p=void 0!==o,f=!p&&("function"==typeof a||"confirm"===c),[m,g]=(0,d.useState)(n),[y,v]=(0,d.useState)(n),b=!f&&o,[x,E]=(0,d.useState)(b);(0,d.useEffect)((()=>{void 0!==o&&E(o)}),[o]),(0,d.useEffect)((()=>{g(n)}),[n]);const C={tempFilteredValue:m,setTempFilteredValue:g,confirm:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(null==e?void 0:e.filteredValue)||m;Oe()(t,n)||s({filteredValue:t}),e.closeDropdown&&E(!1)},clear:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};g([]),s({filteredValue:[]}),e.closeDropdown&&E(!1)},close:()=>{E(!1)},reset:()=>{g(y)},filters:e.filters},S=w()(`${t}-column-filter`,{on:Array.isArray(n)&&n.length});let _;_="function"==typeof r?r(Array.isArray(n)&&n.length>0):(0,d.isValidElement)(r)?r:h().createElement("div",{className:S},"",h().createElement(Fk,{role:"button","aria-label":"Filter data with this column","aria-haspopup":"listbox",tabIndex:-1,size:"default"}));const k=Object.assign(Object.assign(Object.assign(Object.assign({},e),i),C),{filterDropdownVisible:p?o:x,onFilterDropdownVisibleChange:e=>{f&&E(e),e&&"confirm"===c&&(v(n),g(n)),l(e)}});return h().createElement(Jt,{componentName:"Table"},(e=>h().isValidElement(u)?u:$k(k,_,0,e)))}const Vk=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"m6.45 8.34 4.8-5.48a1 1 0 0 1 1.5 0l4.8 5.48A1 1 0 0 1 16.8 10H7.2a1 1 0 0 1-.75-1.66Z",fill:"currentColor"}))}),"caretup");const zk=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"m17.55 15.66-4.8 5.48a1 1 0 0 1-1.5 0l-4.8-5.48A1 1 0 0 1 7.2 14h9.6a1 1 0 0 1 .75 1.66Z",fill:"currentColor"}))}),"caretdown");var Hk=__webpack_require__("zr3P"),Uk=__webpack_require__.n(Hk);let Kk,Wk;const Gk={position:"absolute",top:"-9999px",width:"50px",height:"50px"};function qk(e){return"number"==typeof e?e-q_.DEFAULT_CELL_PADDING_LEFT-q_.DEFAULT_CELL_PADDING_RIGHT-q_.DEFAULT_CELL_BORDER_WIDTH_LEFT-q_.DEFAULT_CELL_BORDER_WIDTH_RIGHT-function(){if("undefined"==typeof document||"undefined"==typeof window)return 0;const e="vertical"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"vertical");if(e&&Kk)return Kk;if(!e&&Wk)return Wk;const t=document.createElement("div");Object.keys(Gk).forEach((e=>{t.style[e]=Gk[e]})),e?t.style.overflowY="scroll":t.style.overflowX="scroll",document.body.appendChild(t);let n=0;return e?(n=t.offsetWidth-t.clientWidth,Kk=n):(n=t.offsetHeight-t.clientHeight,Wk=n),document.body.removeChild(t),n}("vertical"):void 0}function Xk(e,t){return Ce()({},{table:"table",header:{outer:"table",wrapper:"thead",row:"tr",cell:"th"},body:t?{outer:"div",wrapper:"div",row:"div",cell:"div",colgroup:{wrapper:"div",col:"div"}}:{outer:"table",wrapper:"tbody",row:"tr",cell:"td",colgroup:{wrapper:"colgroup",col:"col"}},footer:{wrapper:"tfoot",row:"tr",cell:"td"}},e)}const Yk=new X_("[@douyinfe/semi-ui Table]");function Zk(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=[],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3]?ie:Uk();return Lv()(t,(t=>{const s=Y_(t=Object.assign({},t),n),o=null!=s&&jv()(e,(e=>Y_(e,n)===s));o?r.push(i(Object.assign(Object.assign({},o),t))):r.push(i(t))})),r}function Jk(e){switch(e){case G_.SORT_DIRECTIONS[0]:return G_.SORT_DIRECTIONS[1];case G_.SORT_DIRECTIONS[1]:return"cancelSort";default:return G_.SORT_DIRECTIONS[0]}}class Qk extends d.PureComponent{render(){const{prefixCls:e,onClick:t,sortOrder:n,style:r,title:i,sortIcon:s,showTooltip:o}=this.props,a="default",l=w()(`${e}-column-sorter-up`,{on:n===G_.SORT_DIRECTIONS[0]}),c=w()(`${e}-column-sorter-down`,{on:n===G_.SORT_DIRECTIONS[1]}),d={"aria-label":"Current sort order is "+(n?`${n}ing`:"none"),"aria-roledescription":"Sort data with this column"};return h().createElement("div",Object.assign({role:"button"},d,{tabIndex:-1,className:`${e}-column-sorter-wrapper`,onClick:t,onKeyPress:e=>dn(e)&&t(e)}),i,(()=>{if("function"==typeof s)return s({sortOrder:n});{const t=h().createElement("div",{style:r,className:`${e}-column-sorter`},h().createElement("span",{className:`${l}`},h().createElement(Vk,{size:a})),h().createElement("span",{className:`${c}`},h().createElement(zk,{size:a})));if(o){let e=Jk(n);return h().createElement(Jt,{componentName:"Table"},((n,r)=>h().createElement(_t,{content:n[e]},t)))}return t}})())}}Qk.propTypes={className:E().string,style:E().object,onClick:E().func,prefixCls:E().string,sortOrder:E().oneOfType([E().string,E().bool]),sortIcon:E().func,showTooltip:E().bool},Qk.defaultProps={prefixCls:W_.PREFIX,onClick:i(),sortOrder:!1,showTooltip:!1};const eO=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"m20.56 9.66-7.8 8.97a1 1 0 0 1-1.51 0L3.44 9.66A1 1 0 0 1 4.19 8h15.62a1 1 0 0 1 .75 1.66Z",fill:"currentColor"}))}),"tree_triangle_down");const tO=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"m9.66 3.44 8.97 7.8a1 1 0 0 1 0 1.51l-8.97 7.81A1 1 0 0 1 8 19.81V4.19a1 1 0 0 1 1.66-.75Z",fill:"currentColor"}))}),"tree_triangle_right");function nO(e){const{expanded:t,componentType:n="expand",onClick:r=i(),onMouseEnter:s=i(),onMouseLeave:o=i(),expandIcon:a,prefixCls:l=W_.PREFIX,motion:c=!0}=e;let u;u=h().isValidElement(a)?a:"function"==typeof a?a(t):"tree"===n?t&&!c?h().createElement(eO,{size:"small"}):h().createElement(tO,{size:"small"}):t&&!c?h().createElement(Hc,null):h().createElement(Al,null);const p=(0,d.useCallback)((e=>{"function"==typeof r&&r(!t,e)}),[t]);if(c){const e=u;u=h().createElement(vt,{animationState:t?"enter":"leave",startClassName:`${W_.PREFIX}-expandedIcon-${t?"show":"hide"}`},(t=>{let{animationClassName:n}=t;return h().cloneElement(e,{className:(e.props.className||"")+" "+n})}))}return h().createElement("span",{role:"button","aria-label":"Expand this row",tabIndex:-1,onClick:p,onMouseEnter:s,onMouseLeave:o,className:`${l}-expand-icon`,onKeyPress:e=>dn(e)&&p(e)},u)}class rO extends h().PureComponent{render(){const{columns:e,className:t,style:n,prefixCls:r,components:i}=this.props,s=o()(i,"colgroup.wrapper","colgroup"),a=o()(i,"colgroup.col","col"),l=dk(e).map(((e,t)=>{const n={};return e.width&&(n.width=e.width,n.minWidth=n.width),h().createElement(a,{className:w()(`${r}-col`,e.className),key:e.key||e.dataIndex||t,style:n})})),c=w()(`${r}-colgroup`,t);return h().createElement(s,{className:c,style:n},l)}}rO.propTypes={columns:E().array,prefixCls:E().string,className:E().string,style:E().object,components:E().object},rO.defaultProps={columns:[],prefixCls:W_.PREFIX};var iO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class sO extends f{get adapter(){return Object.assign({},super.adapter)}constructor(e){super(e),this.cacheRef=e=>{if(this.headerNode=e,e&&this.context.setHeadWidths){const{prefixCls:t,row:n,index:r}=this.props,i=`.${t}-row-head`,s=e&&e.querySelectorAll&&e.querySelectorAll(i);this.context.setHeadWidths(Lv()(s,((e,t)=>{let r=o()(n,[t,"column","width"]);const i=o()(n,[t,"column","key"]);return"number"!=typeof r&&(r=e&&e.getBoundingClientRect().width||0),{width:r,key:i}})),r)}},this.headerNode=null}componentDidUpdate(e){e.columns!==this.props.columns&&this.headerNode&&this.cacheRef(this.headerNode)}render(){const{components:e,row:t,prefixCls:n,onHeaderRow:r,index:i,style:s,columns:a}=this.props,{getCellWidths:l,direction:c,headerStyle:d}=this.context,u="rtl"===c,p=uk(a,i),f=l(p),m=o()(e,"header.row","tr"),g=o()(e,"header.cell","th"),y=r(a,i)||{};Y()(y,"className",w()(o()(y,"className"),`${n}-row`));const v=Lv()(t,((e,t)=>{const{column:r}=e,s=iO(e,["column"]),o="function"==typeof r.onHeaderCell?r.onHeaderCell(r,t,i):{};let a,l,m,y,v=Object.assign(Object.assign({},d),o.style);if(r.align){const e=vk(r.align,c);v=Object.assign(Object.assign({},v),{textAlign:e}),o.className=w()(o.className,r.className,{[`${n}-align-${e}`]:Boolean(e)})}if(u?(a=tk(r),l=ek(r),m=Q_(p,r),y=J_(p,r)):(a=ek(r),l=tk(r),m=J_(p,r),y=Q_(p,r)),o.className=w()(`${n}-row-head`,r.className,o.className,{[`${n}-cell-fixed-left`]:a,[`${n}-cell-fixed-left-last`]:m,[`${n}-cell-fixed-right`]:l,[`${n}-cell-fixed-right-first`]:y,[`${n}-row-head-ellipsis`]:r.ellipsis,[`${n}-row-head-clickSort`]:r.clickToSort}),f.length&&p.length){const e=Nv()(p,(e=>e&&null!=e.key&&e.key===r.key));if(e>-1)if(ek(r)){const t=u?"right":"left";v=Object.assign(Object.assign({},v),{position:"sticky",[t]:Z_(f,0,e)})}else if(tk(r)){const t=u?"left":"right";v=Object.assign(Object.assign({},v),{position:"sticky",[t]:Z_(f,e+1)})}}Object.assign(s,{resize:r.resize});const b=W()(Object.assign(Object.assign({},s),o),["colStart","colEnd","hasSubColumns","parents","level"]),{rowSpan:x,colSpan:E}=b;if(0===x||0===E)return null;if("function"==typeof r.clickToSort)if(b.onClick){const e=b.onClick;b.onClick=t=>{e(t),r.clickToSort(t)}}else b.onClick=r.clickToSort;if("function"==typeof r.mouseDown)if(b.onMouseDown){const e=b.onMouseDown;b.onMouseDown=t=>{e(t),r.mouseDown(t)}}else b.onMouseDown=r.mouseDown;const C=h().createElement(g,Object.assign({role:"columnheader","aria-colindex":t+1},b,{style:v,key:r.key||r.dataIndex||t}));if("function"==typeof r.clickToSort&&!0===r.showSortTip){let e=Jk(r.sortOrder);return h().createElement(Jt,{componentName:"Table",key:r.key||r.dataIndex||t},((t,n)=>h().createElement(_t,{content:t[e]},C)))}return C}));return h().createElement(m,Object.assign({role:"row","aria-rowindex":i+1},y,{style:s,ref:this.cacheRef}),v)}}sO.contextType=Rk,sO.propTypes={components:E().object,row:E().array,prefixCls:E().string,onHeaderRow:E().func,index:E().oneOfType([E().string,E().number]),style:E().object,columns:E().array,fixed:E().oneOfType([E().bool,E().string]),selectedRowKeysSet:E().instanceOf(Set).isRequired},sO.defaultProps={onHeaderRow:i(),prefixCls:W_.PREFIX,columns:[],components:{header:{wrapper:"thead",row:"tr",cell:"th"}}};class oO extends f{get adapter(){return Object.assign({},super.adapter)}render(){const{components:e,columns:t,prefixCls:n,fixed:r,onHeaderRow:i,forwardedRef:s,selectedRowKeysSet:o}=this.props,a=function(e){const t=[];!function e(n,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;t[s]=t[s]||[];let a=r;return n.map((n=>{const r={key:n.key,className:n.className||"",children:ye()(n.title)?n.title():n.title,column:n,colStart:a,level:o,parents:i};let l=1;const c=n.children;return c&&c.length>0&&(l=e(c,a,[...i,r],s+1,o+1).reduce(((e,t)=>e+t),0),r.hasSubColumns=!0),"colSpan"in n&&({colSpan:l}=n),"rowSpan"in n&&(r.rowSpan=n.rowSpan),n.key===G_.DEFAULT_KEY_COLUMN_SCROLLBAR&&(r["x-type"]=G_.DEFAULT_KEY_COLUMN_SCROLLBAR),r.colSpan=l,r.colEnd=r.colStart+l-1,t[s].push(r),a+=l,bk(null==n?void 0:n.ellipsis)&&"string"==typeof r.children&&(r.title=r.children),l}))}(e,0);const n=t.length;for(let e=0;e<n;e+=1)t[e].forEach((t=>{"rowSpan"in t||t.hasSubColumns||(t.rowSpan=n-e)}));return t}(t),l=e.header.wrapper;return h().createElement(l,{className:`${n}-thead`,ref:s},a.map(((s,a)=>h().createElement(sO,{prefixCls:n,key:a,index:a,fixed:r,columns:t,row:s,components:e,onHeaderRow:i,selectedRowKeysSet:o}))))}}oO.propTypes={components:E().any,columns:E().array,columnManager:E().object,prefixCls:E().string,onHeaderRow:E().func,onDidUpdate:E().func,fixed:E().oneOfType([E().bool,E().string]),selectedRowKeysSet:E().instanceOf(Set).isRequired},oO.defaultProps={columns:[],prefixCls:W_.PREFIX,onHeaderRow:i(),onDidUpdate:i(),components:{header:{wrapper:"thead",row:"tr",cell:"th"}}};const aO=h().forwardRef(((e,t)=>h().createElement(oO,Object.assign({},e,{forwardedRef:t}))));class lO extends h().PureComponent{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{selectedRowKeysSet:new Set})}render(){const{scroll:e,prefixCls:t,fixed:n,forwardedRef:r,handleBodyScroll:i,columns:s,components:a,onDidUpdate:l,showHeader:c,tableLayout:d,bodyHasScrollBar:u,sticky:p}=this.props,f=o()(a,"header.outer","table"),m=o()(e,"x"),g={},y={};m&&!n&&(y.width=m),u&&(g.overflowY="scroll");const v=h().createElement(rO,{columns:s,prefixCls:t}),b=h().createElement(aO,Object.assign({},this.props,{columns:s,components:a,onDidUpdate:l})),x=w()(`${t}-header`,{[`${t}-header-sticky`]:p,[`${t}-header-hidden`]:!c}),E=o()(p,"top",0);return"number"==typeof E&&(g.top=E),h().createElement("div",{key:"headTable",style:g,className:x,ref:r,onScroll:i},h().createElement(f,{style:y,className:w()(t,{[`${t}-fixed`]:"fixed"===d})},v,b))}}lO.propTypes={tableLayout:E().string,bodyHasScrollBar:E().bool,columns:E().array,components:E().object,dataSource:E().array,fixed:E().oneOfType([E().bool,E().string]),handleBodyScroll:E().func,prefixCls:E().string,forwardedRef:E().oneOfType([E().object,E().func]),scroll:E().shape({x:E().oneOfType([E().number,E().string,E().bool]),y:E().oneOfType([E().number,E().string])}),selectedRowKeysSet:E().instanceOf(Set).isRequired,showHeader:E().bool,onDidUpdate:E().func,onHeaderRow:E().func},lO.defaultProps={handleBodyScroll:i()};const cO=h().forwardRef(((e,t)=>h().createElement(lO,Object.assign({},e,{forwardedRef:t}))));var dO=__webpack_require__("7seP"),hO=__webpack_require__.n(dO),uO=__webpack_require__("ehGJ"),pO=__webpack_require__.n(uO);class fO extends c{init(){this.initVirtualizedData(),this.initExpandBtnShouldInRow()}destroy(){this.unobserveBodyResize()}initVirtualizedData(e){this._adapter.setVirtualizedData(this.flattenData(this.getProp("dataSource")),e)}initExpandBtnShouldInRow(e){const t=this.getProps(),n=function(e){const{expandedRowRender:t,dataSource:n,hideExpandedColumn:r,childrenRecordName:i,rowExpandable:s}=e,a="function"==typeof t;return r&&a||!a&&n.some((e=>{const t=o()(e,i);return!!(Array.isArray(t)&&t.length||s(e))}))}(t);if(this._adapter.setCachedExpandBtnShouldInRow(n),!z()(e)&&!e){e=G_.EXPAND_RELATED_PROPS.map((e=>o()(t,e,void 0)))}this._adapter.setCachedExpandRelatedProps(e)}flattenData(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const i=[],{rowKey:s,childrenRecordName:a,expandedRowRender:l,expandedRowKeys:c,groups:d}=this.getProps();return 0===t&&Ek()(d)?d.forEach(((o,a)=>{const l=e.findIndex((e=>o.has(ik(e,s))));if(l>-1){const d=pO()(e,(e=>o.has(ik(e,s)))),h=Vl()(c,a);i.push({key:a,level:t,sectionRow:!0,group:o,groupKey:a,expanded:h}),h&&i.push(...this.flattenData(e.slice(l,d+1),t+1,[...n],[...r]))}})):e.forEach(((e,d)=>{const h=ik(e,s),u=function(e,t){return void 0===t&&(t="children"),o()(e,t)}(e,a);t&&r.push(h);const p={key:h,record:e,level:t,parentKeys:[...n],childrenKeys:[...r]};i.push(p);const f=[];Vl()(c,h)&&(Array.isArray(u)&&u.length?f.push(...this.flattenData(u,t+1,[...p.parentKeys],[...p.childrenKeys])):l&&f.push({key:ck(h),level:t,expandedRow:!0,record:e}),i.push(...f))})),i}observeBodyResize(e){const{scroll:t}=this.getProps();if(o()(t,"y"))return this._adapter.observeBodyResize(e)}unobserveBodyResize(){return this._adapter.unobserveBodyResize()}}var mO=__webpack_require__("LF7v"),gO=__webpack_require__.n(mO);class yO extends c{handleClick(e){const{expanded:t,rowKey:n}=this.getProps();this._adapter.notifyClick(n,e,t)}handleDoubleClick(e){this._adapter.notifyDoubleClick(this.getProp("record"),e)}handleMouseEnter(e){const t=this.getProp("record");this._adapter.notifyMouseEnter(t,e)}handleMouseLeave(e){const t=this.getProp("record");this._adapter.notifyMouseLeave(t,e)}}class vO extends c{handleClick(e){this._adapter.notifyClick(this.getProp("record"),e)}}function bO(e){return e&&!h().isValidElement(e)&&"[object Object]"===Object.prototype.toString.call(e)}class wO extends f{get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{notifyClick:function(){const{onClick:t}=e.props;"function"==typeof t&&t(...arguments)}})}constructor(e){super(e),this.setRef=e=>this.ref=e,this.handleClick=e=>{this.foundation.handleClick(e);const t=this.adapter.getCache("customCellProps");t&&"function"==typeof t.onClick&&t.onClick(e)},this.ref=(0,d.createRef)(),this.foundation=new vO(this.adapter)}shouldComponentUpdate(e){const t=this.props,{column:n,expandIcon:r}=t,i=function(e){return o()(e,"key")===G_.DEFAULT_KEY_COLUMN_SELECTION}(n),{shouldCellUpdate:s}=n;if("function"==typeof s)return s(e,t);const a=nk(n)||r;if((i||a)&&!Oe()(e,this.props))return!0;{const n=["selected","expanded","expandIcon","disabled"],r=W()(t,n),i=W()(e,n);if(!Oe()(i,r))return!0}return!1}componentDidUpdate(){this.props.onDidUpdate(this.ref)}getTdProps(){const{record:e,index:t,column:n={},fixedLeft:r,fixedRight:i,width:s,height:a}=this.props;let l={},c={};const{direction:d}=this.context,h="rtl"===d,u=i||"number"==typeof i;if(r||"number"==typeof r?Y()(l,h?"style.right":"style.left","number"==typeof r?r:0):u&&Y()(l,h?"style.left":"style.right","number"==typeof i?i:0),null!=s&&Y()(l,"style.width",s),null!=a&&Y()(l,"style.height",a),n.onCell){c=n.onCell(e,t),this.adapter.setCache("customCellProps",Object.assign({},c)),l=Object.assign(Object.assign({},l),W()(c,["style","className","onClick"]));const r=o()(c,"style")||{};l.style=Object.assign(Object.assign({},l.style),r)}if(n.align){const e=vk(n.align,d),t=function(e,t){if("rtl"===t)switch(e){case"left":return"flex-end";case"right":return"flex-start";default:return e}else switch(e){case"left":return"flex-start";case"right":return"flex-end";default:return e}}(n.align,d);l.style=Object.assign(Object.assign({},l.style),{textAlign:e,justifyContent:t})}return{tdProps:l,customCellProps:c}}renderText(e){const{record:t,indentSize:n,prefixCls:r,indent:i,index:s,expandIcon:a,renderExpandIcon:l,column:c={},hovered:d}=this.props,{dataIndex:u,render:p,useFullRender:f}=c;let m,g,y;m="number"==typeof u||u&&0!==u.length?o()(t,u):t;const v=i&&n?h().createElement("span",{style:{paddingLeft:n*i+"px"},className:`${r}-row-indent indent-level-${i}`}):null,b="function"==typeof l?l(t):a;if(p){const n={expandIcon:b,isHovering:d};if(f){const{renderSelection:e}=this.context,r="function"==typeof e?e(t):null;Object.assign(n,{selection:r,indentText:v})}m=p(m,t,s,n),bO(m)&&(g=(e=m.props?Ce()(e,m.props):e).colSpan,y=e.rowSpan,m=m.children)}return{text:m,indentText:v,rowSpan:y,colSpan:g,realExpandIcon:b,tdProps:e}}renderInner(e,t,n){const{prefixCls:r,isSection:i,expandIcon:s,column:o={}}=this.props,{tableWidth:a,anyColumnFixed:l}=this.context,{useFullRender:c}=o;let u=null;return u=c?e:[h().createElement(d.Fragment,{key:"indentText"},t),h().createElement(d.Fragment,{key:"expandIcon"},s?n:null),h().createElement(d.Fragment,{key:"text"},e)],i&&(u=h().createElement("div",{className:w()(`${r}-section-inner`),style:{width:l?qk(a):void 0}},u)),u}render(){const{prefixCls:e,column:t={},component:n,fixedLeft:r,fixedRight:i,lastFixedLeft:s,firstFixedRight:a,colIndex:l}=this.props,{direction:c}=this.context,d="rtl"===c,{className:u,ellipsis:p}=t,f=r||"number"==typeof r,m=i||"number"==typeof i,{tdProps:g,customCellProps:y}=this.getTdProps(),v=this.renderText(g);let{text:b}=v;const{indentText:x,rowSpan:E,colSpan:C,realExpandIcon:S,tdProps:_}=v;let k;if(bk(p)&&"string"==typeof b&&(k=b),0===E||0===C)return null;bO(b)&&(b=null);const O=this.renderInner(b,x,S);let T,P,I,M;d?(T=m,P=a,I=f,M=s):(T=f,P=s,I=m,M=a);const R=w()(u,`${e}-row-cell`,o()(y,"className"),{[`${e}-cell-fixed-left`]:T,[`${e}-cell-fixed-left-last`]:P,[`${e}-cell-fixed-right`]:I,[`${e}-cell-fixed-right-first`]:M,[`${e}-row-cell-ellipsis`]:p});return h().createElement(n,Object.assign({role:"gridcell","aria-colindex":l+1,className:R,onClick:this.handleClick,title:k},_,{ref:this.setRef}),O)}}wO.contextType=Rk,wO.defaultProps={indent:0,indentSize:q_.DEFAULT_INDENT_WIDTH,onClick:i(),prefixCls:W_.PREFIX,component:"td",onDidUpdate:i(),column:{}},wO.propTypes={record:E().object,prefixCls:E().string,index:E().number,fixedLeft:E().oneOfType([E().bool,E().number]),lastFixedLeft:E().bool,fixedRight:E().oneOfType([E().bool,E().number]),firstFixedRight:E().bool,indent:E().number,indentSize:E().number,column:E().object,expandIcon:E().any,renderExpandIcon:E().func,hideExpandedColumn:E().bool,component:E().any,onClick:E().func,onDidUpdate:E().func,isSection:E().bool,width:E().oneOfType([E().string,E().number]),height:E().oneOfType([E().string,E().number]),selected:E().bool,expanded:E().bool,colIndex:E().number,hovered:E().bool};var xO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const EO={anyColumnFixed:E().bool,cellWidths:E().array.isRequired,className:E().string,columns:E().array.isRequired,components:E().object.isRequired,disabled:E().bool,expandIcon:E().oneOfType([E().bool,E().func,E().node]),expandableRow:E().bool,expanded:E().bool,displayNone:E().bool,expandedRow:E().bool,fixed:E().oneOfType([E().string,E().bool]),height:E().oneOfType([E().string,E().number]),hideExpandedColumn:E().bool,hovered:E().bool,indent:E().number,indentSize:E().number,index:E().number,isSection:E().bool,level:E().number,onDidUpdate:E().func,onHover:E().func,onRow:E().func,onRowClick:E().func,onRowContextMenu:E().func,onRowDoubleClick:E().func,onRowMouseEnter:E().func,onRowMouseLeave:E().func,prefixCls:E().string,record:E().object,renderExpandIcon:E().func,replaceClassName:E().string,rowExpandable:E().func,rowKey:E().oneOfType([E().string,E().number]).isRequired,selected:E().bool,store:E().object,style:E().object,virtualized:E().oneOfType([E().object,E().bool]),visible:E().bool.isRequired};class CO extends f{get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{notifyClick:function(){return e.props.onRowClick(...arguments)},notifyDoubleClick:function(){return e.props.onRowDoubleClick(...arguments)},notifyMouseLeave:function(){e.props.onHover(!1,e.props.rowKey),e.props.onRowMouseLeave(...arguments)},notifyMouseEnter:function(){e.props.onHover(!0,e.props.rowKey),e.props.onRowMouseEnter(...arguments)}})}constructor(e){super(e),this.renderExpandIcon=e=>{const{renderExpandIcon:t}=this.props;return t(e,!0)},this.handleMouseEnter=e=>{this.foundation.handleMouseEnter(e);const t=this.adapter.getCache("customRowProps");"function"==typeof(null==t?void 0:t.onMouseEnter)&&t.onMouseEnter(e)},this.handleMouseLeave=e=>{this.foundation.handleMouseLeave(e);const t=this.adapter.getCache("customRowProps");"function"==typeof(null==t?void 0:t.onMouseLeave)&&t.onMouseLeave(e)},this.handleClick=e=>{this.foundation.handleClick(e);const t=this.adapter.getCache("customRowProps");t&&"function"==typeof t.onClick&&t.onClick(e);const{handleRowSelection:n}=this.context,{rowKey:r,selected:i,disabled:s,record:o}=this.props;"function"!=typeof n||s||n(r,!i,e)},this.foundation=new yO(this.adapter)}componentDidMount(){const{onRow:e,index:t,record:n,disabled:r,selected:i}=this.props;if(void 0===this.adapter.getCache("customRowProps")){const s=e(n,t,{disabled:r,selected:i})||{},{className:o,style:a}=s,l=xO(s,["className","style"]);this.adapter.setCache("customRowProps",Object.assign({},l))}}shouldComponentUpdate(e){const t=["cellWidths"],n=function(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(let r=0;r<i;r++){const i=n[r];if(e[i]!==t[i]||!Object.prototype.hasOwnProperty.call(t,i))return!1}return!0}(W()(e,t),W()(this.props,t));return!n||!Oe()(Gl()(e,t),Gl()(this.props,t))}renderCells(){const{columns:e,record:t,index:n,prefixCls:r,fixed:i,components:s,expandableRow:a,level:l,expandIcon:c,rowExpandable:d,isSection:u,expandedRow:p,virtualized:f,indentSize:m,hideExpandedColumn:g,cellWidths:y,selected:v,expanded:b,disabled:w,onDidUpdate:x,hovered:E}=this.props,C=o()(s,"body.cell",G_.DEFAULT_COMPONENTS.body.cell),S=[],_=d(t);let k=0;return Me()(e,((s,d)=>{const O=o()(s,"key"),T={};if("right"!==i&&(function(e){return[G_.DEFAULT_KEY_COLUMN_EXPAND,G_.DEFAULT_KEY_COLUMN_SCROLLBAR,G_.DEFAULT_KEY_COLUMN_SELECTION].includes(e)}(O)&&k++,a&&d===k&&(T.renderExpandIcon=this.renderExpandIcon,(g||u)&&(T.expandIcon=null==c||c)),null!=l&&d===k)){T.indent=l;!a&&g&&(!1!==c||!("boolean"==typeof c)&&null!==c)&&(T.indent=l+1)}if(nk(s)&&!_)S.push(h().createElement(wO,{key:d,colIndex:d,isSection:u}));else if(!function(e){return o()(e,"key")===G_.DEFAULT_KEY_COLUMN_SCROLLBAR}(s)){const i={};C!==G_.DEFAULT_COMPONENTS.body.cell&&f&&!p&&(i.width=o()(y,d)),S.push(h().createElement(wO,Object.assign({colIndex:d},T,i,{hideExpandedColumn:g,indentSize:m,isSection:u,prefixCls:`${r}`,column:s,key:d,index:n,record:t,component:C,fixedLeft:ek(s)&&Z_(y,0,d),lastFixedLeft:J_(e,s),fixedRight:tk(s)&&Z_(y,d+1),firstFixedRight:Q_(e,s),selected:v,expanded:b,disabled:w,onDidUpdate:x,hovered:E})))}})),S}render(){const{style:e}=this.props,{components:t,prefixCls:n,selected:r,disabled:i,onRow:s,index:o,className:a,replaceClassName:l,record:c,hovered:d,expanded:u,displayNone:p,expandableRow:f,level:m,expandedRow:g,isSection:y,rowKey:v}=this.props,b=t.body.row,x=s(c,o,{disabled:i,selected:r})||{},{className:E,style:C}=x,S=xO(x,["className","style"]);this.adapter.setCache("customRowProps",Object.assign({},S));const _=Object.assign(Object.assign({},e),C),k="string"==typeof l&&l.length?w()(l,E):w()(a,`${n}-row`,{[`${n}-row-selected`]:r,[`${n}-row-expanded`]:u,[`${n}-row-hovered`]:d,[`${n}-row-hidden`]:p},E),O={};return"number"==typeof o&&(O["aria-rowindex"]=o+1),f&&(O["aria-expanded"]=u),(u||g)&&(O["aria-level"]=2),"number"==typeof m&&(O["aria-level"]=m+1),y&&(O["aria-level"]=1),h().createElement(b,Object.assign({role:"row"},O,S,{style:_,className:k,"data-row-key":v,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onClick:this.handleClick}),this.renderCells())}}CO.propTypes=EO,CO.contextType=Rk,CO.defaultProps={columns:[],rowExpandable:gO(),components:{body:{row:"tr",cell:"td"}},prefixCls:W_.PREFIX,onRow:i(),onRowClick:i(),onRowDoubleClick:i(),onRowMouseEnter:i(),onRowMouseLeave:i(),onHover:i(),onDidUpdate:i(),visible:!0,hovered:!1,selected:!1,disabled:!1};var SO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class _O extends d.PureComponent{render(){const{record:e,columns:t=[],prefixCls:n,className:r,expanded:i,expandedRowRender:s,renderExpandIcon:a,index:l,store:c,components:u,style:p,virtualized:f,indentSize:m,cellWidths:g,displayNone:y}=this.props,{tableWidth:v,anyColumnFixed:b,getCellWidths:x}=this.context,E=s(e,l,i);let C=null;const S={};let _={};if(be()(E))return null;if((0,d.isValidElement)(E))C=E;else if(E&&"[object Object]"===Object.prototype.toString.call(E)){const e=E,{children:t,fixed:n}=e,r=SO(e,["children","fixed"]);C=t,_=Object.assign({},r)}o()(u,"body.cell")!==G_.DEFAULT_COMPONENTS.body.cell?(f&&Y()(S,"style.height","100%"),Y()(S,"style.display","block"),Y()(S,"style.width",Z_(g,0,t.length))):S.colSpan=rk(t).length;const k=[Object.assign({render:()=>({props:S,children:h().createElement("div",{className:w()(`${n}-expand-inner`),style:{width:b?qk(v):void 0}},C)})},_)],O=w()(r,`${n}-row-expand`),T=x(k);return h().createElement(CO,{style:p,components:u,className:O,expandedRow:!0,renderExpandIcon:a,rowKey:`${e.key}-expanded-row`,columns:k,store:c,virtualized:f,indentSize:m,cellWidths:T,displayNone:y})}}_O.contextType=Rk,_O.propTypes={cellWidths:E().array.isRequired,className:E().string,columns:E().array,components:E().object,defaultExpandAllRows:E().bool,defaultExpandedRowKeys:E().array,expandIcon:E().oneOfType([E().object,E().node,E().func]),expandRowByClick:E().bool,expanded:E().bool,expandedRowKeys:E().array,expandedRowRender:E().func,indentSize:E().number,index:E().oneOfType([E().string,E().number]),onExpand:E().func,onExpandedRowsChange:E().func,prefixCls:E().string,record:E().object,renderExpandIcon:E().func,store:E().object,style:E().object,virtualized:E().oneOfType([E().bool,E().object])},_O.defaultProps={record:{},prefixCls:W_.PREFIX};var kO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const OO={record:E().object,index:E().number,columns:E().array,group:E().object.isRequired,groupKey:E().oneOfType([E().string,E().number]).isRequired,data:E().array,renderGroupSection:E().func,onGroupedRow:E().func,clickGroupedRowToExpand:E().bool,components:E().object,expanded:E().bool,prefixCls:E().string,onExpand:E().func,virtualized:E().oneOfType([E().bool,E().object]),style:E().object,renderExpandIcon:E().func,className:E().string,store:E().object,rowKey:E().oneOfType([E().string,E().number,E().func])};class TO extends d.PureComponent{constructor(){var e;super(...arguments),e=this,this.onRow=function(){const{onGroupedRow:t,clickGroupedRowToExpand:n,onExpand:r,groupKey:i,expanded:s}=e.props,o={};return"function"==typeof t&&Object.assign(o,t(...arguments)),Object.assign(Object.assign({},o),{onClick:e=>{"function"==typeof r&&n&&r(!s,i,e),"function"==typeof o.onClick&&o.onClick(e)}})},this.collectGroupedData=()=>{const{data:e,group:t,rowKey:n}=this.props;return Array.isArray(e)&&e.length&&$l()(t)?e.filter((e=>{const r="function"==typeof n?n(e):o()(e,n);return null!=r&&""!==r&&t.has(r)})):[]},this.renderExpandIcon=e=>{const{renderExpandIcon:t,groupKey:n}=this.props;return"function"==typeof t?t(e,!1,n):null}}isInnerColumnKey(e){return null!=e&&[G_.DEFAULT_KEY_COLUMN_EXPAND,G_.DEFAULT_KEY_COLUMN_SELECTION].includes(e)}render(){const{record:e,columns:t=[],prefixCls:n,className:r,expanded:i,renderGroupSection:s,components:o,index:a,store:l,group:c,groupKey:u,virtualized:p,style:f}=this.props,m={};let g={},y=null;const v="function"==typeof s?s(u,[...c]):null;if((0,d.isValidElement)(v))y=v;else if(v&&"[object Object]"===Object.prototype.toString.call(v)){const e=v,{children:t}=e,n=kO(e,["children"]);y=t,g=Object.assign({},n)}m.colSpan=rk(t).length;const b=[Object.assign({render:()=>({props:m,children:y})},g)],x=w()(r,`${n}-row-section`,{on:i}),{getCellWidths:E}=this.context,C=E(b,null,!0);return h().createElement(CO,{components:o,virtualized:p,index:a,onRow:this.onRow,expanded:i,expandIcon:!0,isSection:!0,record:e,replaceClassName:x,expandableRow:!0,renderExpandIcon:this.renderExpandIcon,rowKey:u,columns:b,store:l,style:f,cellWidths:C})}}TO.contextType=Rk,TO.propTypes=OO,TO.defaultProps={prefixCls:W_.PREFIX,components:{body:{row:"tr",cell:"td"}}};const PO=TO;var IO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class MO extends f{constructor(e,t){var n;super(e),n=this,this.onRowHover=(e,t)=>{const{store:n}=this.props,{rowSpanHover:r}=this.context;if(n){const r=e?t:null;o()(n.getState(),"hoveredRowKey")!==r&&n.setState({hoveredRowKey:r})}if(r){const n=String(t);if(e){const e=this.getHoveredRowKeysFromDOM(n);this.updateRowHoverClass(e)}else this.updateRowHoverClass([])}},this.updateRowHoverClass=e=>{var t;const n=this.ref.current;if(!n)return void this.hoveredRowKeySet.clear();const r=(null===(t=n.closest)||void 0===t?void 0:t.call(n,`.${this.props.prefixCls}-wrapper`))||n,i=new Set(e);for(const e of this.hoveredRowKeySet)if(!i.has(e)){r.querySelectorAll(`tr[data-row-key="${this.cssEscape(e)}"]`).forEach((e=>e.classList.remove(`${this.props.prefixCls}-row-hovered`)))}for(const e of i)if(!this.hoveredRowKeySet.has(e)){r.querySelectorAll(`tr[data-row-key="${this.cssEscape(e)}"]`).forEach((e=>e.classList.add(`${this.props.prefixCls}-row-hovered`)))}this.hoveredRowKeySet=i},this.getHoveredRowKeysFromDOM=e=>{var t;const n=new Set;n.add(e);const r=this.ref.current,i=null!==(t=null==r?void 0:r.querySelector(".semi-table-tbody"))&&void 0!==t?t:r;if(!i)return Array.from(n);const s=i.querySelector(`tr[data-row-key="${this.cssEscape(e)}"]`);if(!s)return Array.from(n);const o=Array.from(i.querySelectorAll("tr[data-row-key]")),a=o.indexOf(s);return-1===a||o.forEach(((e,t)=>{e.querySelectorAll("td[rowspan]").forEach((e=>{const r=parseInt(e.getAttribute("rowspan")||"1",10);if(r>1){const e=t+r-1;if(a>=t&&a<=e)for(let r=t;r<=e&&r<o.length;r++){const e=o[r].getAttribute("data-row-key");e&&n.add(e)}}}))})),Array.from(n)},this.cssEscape=e=>{const t=globalThis.CSS;return t&&"function"==typeof t.escape?t.escape(e):e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')},this.forwardRef=e=>{const{forwardedRef:t}=this.props;this.ref.current=e,this.foundation.observeBodyResize(e),"function"==typeof t?t(e):t&&"object"==typeof t&&(t.current=e)},this.setListRef=e=>{this.listRef.current=e;const{getVirtualizedListRef:t}=this.context;t&&(this.props.virtualized?t(this.listRef):console.warn("getVirtualizedListRef only works with virtualized. See https://semi.design/en-US/show/table for more information."))},this.itemSize=e=>{const{virtualized:t,size:n}=this.props,{virtualizedData:r}=this.state,i=o()(r,e),s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={};return"small"===e?(n.height=t?q_.DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT:q_.DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT,n.minHeight=q_.DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT):"middle"===e?(n.height=t?q_.DEFAULT_VIRTUALIZED_SECTION_ROW_MIDDLE_HEIGHT:q_.DEFAULT_VIRTUALIZED_ROW_MIDDLE_HEIGHT,n.minHeight=q_.DEFAULT_VIRTUALIZED_ROW_MIDDLE_MIN_HEIGHT):(n.height=t?q_.DEFAULT_VIRTUALIZED_SECTION_ROW_HEIGHT:q_.DEFAULT_VIRTUALIZED_ROW_HEIGHT,n.minHeight=q_.DEFAULT_VIRTUALIZED_ROW_MIN_HEIGHT),n}(n,i.sectionRow),a=o()(t,"itemSize",s.height);let l=a;return"function"==typeof a&&(l=a(e,{expandedRow:o()(i,"expandedRow",!1),sectionRow:o()(i,"sectionRow",!1)})),l<s.minHeight&&Yk.warn(`The computed real \`itemSize\` cannot be less than ${s.minHeight}`),l},this.itemKey=(e,t)=>o()(t,[e,"key"],e),this.handleRowClick=(e,t,n)=>{const{handleRowExpanded:r}=this.context;r(!n,e,t)},this.handleVirtualizedScroll=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=o()(n.props.virtualized,"onScroll");"function"==typeof t&&t(e)},this.handleVirtualizedBodyScroll=e=>{const{handleBodyScroll:t}=this.props,n=o()(e,"nativeEvent.target.scrollLeft"),r=o()(e,"nativeEvent.target.scrollTop");r===this.state.cache.virtualizedScrollTop&&this.handleVirtualizedScroll({horizontalScrolling:!0}),this.state.cache.virtualizedScrollLeft=n,this.state.cache.virtualizedScrollTop=r,"function"==typeof t&&t(e)},this.getVirtualizedRowWidth=()=>{const{getCellWidths:e}=this.context,{columns:t}=this.props;return Z_(e(t),0,hO()(t))},this.renderVirtualizedRow=e=>{const{index:t,style:n}=e,{virtualizedData:r,cachedExpandBtnShouldInRow:i}=this.state,{flattenedColumns:s}=this.context,a=o()(r,[t],{}),{key:l,parentKeys:c,expandedRow:d,sectionRow:h}=a,u=IO(a,["key","parentKeys","expandedRow","sectionRow"]),p=this.getVirtualizedRowWidth(),f=i,m=Object.assign(Object.assign(Object.assign(Object.assign({},this.props),{style:Object.assign(Object.assign({},n),{width:p})}),u),{columns:s,index:t,expandBtnShouldInRow:f});return h?this.renderSectionRow(m):d?this.renderExpandedRow(m):this.renderBaseRow(m)},this.renderTbody=h().forwardRef((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return h().createElement("div",Object.assign({},e,{onScroll:function(){e.onScroll&&e.onScroll(...arguments)},className:w()(e.className,`${n.props.prefixCls}-tbody`),style:Object.assign({},e.style),ref:t}))})),this.renderOuter=h().forwardRef(((e,t)=>{const{children:r}=e,i=IO(e,["children"]),{handleWheel:s,prefixCls:o,emptySlot:a,dataSource:l}=this.props,c=this.getVirtualizedRowWidth(),d=w()(`${o}`,`${o}-fixed`);return h().createElement("div",Object.assign({},i,{ref:t,onWheel:function(){s&&s(...arguments),i.onWheel&&i.onWheel(...arguments)},onScroll:function(){n.handleVirtualizedBodyScroll(...arguments),i.onScroll&&i.onScroll(...arguments)}}),h().createElement("div",{style:{width:c},className:d},r),0===hO()(l)&&a)})),this.onItemsRendered=e=>{this.state.cache.virtualizedScrollLeft&&this.ref.current&&(this.ref.current.scrollLeft=this.state.cache.virtualizedScrollLeft)},this.renderVirtualizedBody=e=>{const{scroll:t,prefixCls:n,virtualized:r,columns:i}=this.props,{virtualizedData:s}=this.state,{getCellWidths:a}=this.context,l=a(i);if(!hO()(l))return null;const c=o()(t,"y"),d="number"==typeof c,u=d?c:600;d||Yk.warn('You have to specific "scroll.y" which must be a number for table virtualization!');const p={width:"100%",height:(null==s?void 0:s.length)?u:null,overflowX:"auto",overflowY:"auto"},f=w()(`${n}-body`);return h().createElement(Dd,Object.assign({},"object"==typeof r?r:{},{initialScrollOffset:this.state.cache.virtualizedScrollTop,onScroll:this.handleVirtualizedScroll,onItemsRendered:this.onItemsRendered,ref:this.setListRef,className:f,outerRef:this.forwardRef,height:(null==s?void 0:s.length)?u:0,width:p.width,itemData:s,itemSize:this.itemSize,itemCount:s.length,itemKey:this.itemKey,innerElementType:this.renderTbody,outerElementType:this.renderOuter,style:Object.assign(Object.assign({},p),{direction:e}),direction:e}),this.renderVirtualizedRow)},this.renderSectionRow=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{groupKey:void 0};const{dataSource:t,rowKey:r,group:i,groupKey:s,index:o}=e,a=Object.keys(OO),l=Gl()(e,a),{handleRowExpanded:c}=n.context;return h().createElement(PO,Object.assign({},l,{record:{groupKey:s,records:[...i].map((e=>lk(t,e,r)))},index:o,onExpand:c,data:t,key:s||o}))},this.renderExpandedRow=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{renderExpandIcon:()=>null};const{style:t,components:r,renderExpandIcon:i,expandedRowRender:s,record:o,columns:a,expanded:l,index:c,rowKey:d,virtualized:u,displayNone:p}=e;let f=ik(o,d);null==f&&(f=c);const{flattenedColumns:m,getCellWidths:g}=n.context;return m!==n.flattenedColumns&&(n.flattenedColumns=m,n.cellWidths=g(m)),h().createElement(_O,{style:t,components:r,renderExpandIcon:i,expandedRowRender:s,record:o,columns:a,expanded:l,index:c,virtualized:u,key:ck(f),cellWidths:n.cellWidths,displayNone:p})},this.renderGroupedRows=()=>{const{groups:e,dataSource:t,rowKey:n,expandedRowKeys:r,keepDOM:i}=this.props,{flattenedColumns:s}=this.context,o=new Map,a=[];null!=e&&Array.isArray(t)&&t.length&&t.forEach((t=>{const r=ik(t,n);e.forEach(((e,t)=>{if(e.has(r))return o.has(t)||o.set(t,new Set([])),o.get(t).add(r),!1}))}));let l=-1;return o.forEach(((e,o)=>{const c=sk(r,o);if(a.push(this.renderSectionRow(Object.assign(Object.assign({},this.props),{columns:s,index:++l,group:e,groupKey:o,expanded:c}))),c||i){const r=[];e.forEach((e=>{const i=lk(t,e,n);null!=i&&r.push(i)})),a.push(this.renderBodyRows(r,void 0,[],!c))}})),a},this.renderBody=e=>{const{scroll:t,prefixCls:n,columns:r,components:i,fixed:s,handleWheel:a,headerRef:l,handleBodyScroll:c,anyColumnFixed:d,showHeader:u,emptySlot:p,includeHeader:f,dataSource:m,onScroll:g,groups:y,expandedRowRender:v,tableLayout:b}=this.props,x=o()(t,"x"),E=o()(t,"y"),C={},S={},_=o()(i,"body.outer","table"),k=o()(i,"body.wrapper")||"tbody";E&&(C.maxHeight=E),x&&(S.width=x),d&&hO()(m)&&(C.overflow="auto",C.WebkitTransform="translate3d (0, 0, 0)");const O=h().createElement(rO,{components:o()(i,"body"),columns:r,prefixCls:n}),T=`${n}-body`,P=h().createElement("div",{key:"bodyTable",className:T,style:C,ref:this.forwardRef,onMouseLeave:()=>{this.context.rowSpanHover&&this.updateRowHoverClass([])},onWheel:a,onScroll:c},h().createElement(_,{role:Ek()(y)||ye()(v)||yk({dataSource:m})?"treegrid":"grid","aria-rowcount":m&&m.length,"aria-colcount":r&&r.length,style:S,className:w()(n,{[`${n}-fixed`]:"fixed"===b})},O,f&&u?h().createElement(aO,Object.assign({},this.props,{ref:l,components:i,columns:r})):null,h().createElement(k,{className:`${n}-tbody`,onScroll:g},Ek()(y)?this.renderGroupedRows():this.renderBodyRows(m))),p);return s&&r.length?h().createElement("div",{key:"bodyTable",className:`${n}-body-outer`},P):P},this.ref=h().createRef(),this.state={virtualizedData:[],cache:{virtualizedScrollTop:null,virtualizedScrollLeft:null},cachedExpandBtnShouldInRow:null,cachedExpandRelatedProps:[],hoveredRowKey:null},this.listRef=h().createRef();const{flattenedColumns:r,getCellWidths:i}=t;this.foundation=new fO(this.adapter),this.flattenedColumns=r,this.cellWidths=i(r),this.observer=null,this.hoveredRowKeySet=new Set}componentDidMount(){const{store:e}=this.props;e&&(this.unsubscribe=e.subscribe((e=>{const{hoveredRowKey:t}=e;t!==this.state.hoveredRowKey&&this.setState({hoveredRowKey:t})})))}componentWillUnmount(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVirtualizedData:(e,t)=>this.setState({virtualizedData:e},t),setCachedExpandBtnShouldInRow:e=>this.setState({cachedExpandBtnShouldInRow:e}),setCachedExpandRelatedProps:e=>this.setState({cachedExpandRelatedProps:e}),observeBodyResize:e=>{const{setBodyHasScrollbar:t}=this.context,n=()=>{(window.requestAnimationFrame||window.setTimeout)((()=>{const{offsetWidth:n,clientWidth:r}=e;t(r<n)}))};e&&(o()(window,"ResizeObserver")?(this.observer&&(this.observer.unobserve(e),this.observer=null),this.observer=new ResizeObserver(n),this.observer.observe(e)):Yk.warn("The current browser does not support ResizeObserver,and the table may be misaligned after plugging and unplugging the mouse and keyboard.You can try to refresh it."))},unobserveBodyResize:()=>{const e=this.ref.current;this.observer&&(this.observer.unobserve(e),this.observer=null)}})}componentDidUpdate(e,t){const{virtualized:n,dataSource:r,expandedRowKeys:i,columns:s,scroll:a}=this.props;n&&(e.dataSource===r&&e.expandedRowKeys===i&&e.columns===s||this.foundation.initVirtualizedData());const l=G_.EXPAND_RELATED_PROPS.map((e=>o()(this.props,e,void 0)));Oe()(l,t.cachedExpandRelatedProps)||this.foundation.initExpandBtnShouldInRow(l);const c=o()(a,"y"),d=this.ref.current;c&&c!==o()(e,"scroll.y")&&this.foundation.observeBodyResize(d)}renderBaseRow(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{rowKey:t,columns:n,expandedRowKeys:r,rowExpandable:i,record:s,index:o,level:a,expandBtnShouldInRow:l,selectedRowKeysSet:c,disabledRowKeysSet:d,expandRowByClick:u}=e,p=Object.keys(EO),f=Gl()(e,p);let m=ik(s,t);null==m&&(m=o);const g=sk(r,m),y=i&&i(s),v={level:void 0,expanded:g};(y||l)&&(v.level=a,v.expandableRow=y,u&&(v.onRowClick=this.handleRowClick));const b={selected:ok(c,m),disabled:ak(d,m)},{getCellWidths:w}=this.context,x=w(n,null,!0),{hoveredRowKey:E}=this.state,C=E===m;return h().createElement(CO,Object.assign({},f,v,b,{key:m,rowKey:m,cellWidths:x,hovered:C,onHover:this.onRowHover}))}renderBodyRows(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{rowKey:i,expandedRowRender:s,expandedRowKeys:a,childrenRecordName:l,rowExpandable:c,keepDOM:d}=this.props,h="function"==typeof s,u=this.state.cachedExpandBtnShouldInRow,{flattenedColumns:p}=this.context;return Me()(e,((e,s)=>{let f=ik(e,i);null==f&&(f=s);const m=o()(e,l),g=Boolean(Array.isArray(m)&&m.length);n.push(this.renderBaseRow(Object.assign(Object.assign({},this.props),{columns:p,expandBtnShouldInRow:u,displayNone:r,record:e,key:f,level:t,index:s})));const y=sk(a,f),v=y||d;if(h&&c&&c(e)&&v){const i=this.renderExpandedRow(Object.assign(Object.assign({},this.props),{columns:p,level:t,index:s,record:e,expanded:y,displayNone:r||!y}));be()(i)||n.push(i)}if(g&&v){const e=this.renderBodyRows(m,t+1,[],r||!y);n.push(...e)}})),n}render(){const{virtualized:e}=this.props,{direction:t}=this.context;return e?this.renderVirtualizedBody(t):this.renderBody(t)}}MO.contextType=Rk,MO.propTypes={anyColumnFixed:E().bool,childrenRecordName:E().string,columns:E().array,components:E().object,dataSource:E().array,disabledRowKeysSet:E().instanceOf(Set).isRequired,emptySlot:E().node,expandRowByClick:E().bool,expandedRowKeys:E().array,expandedRowRender:E().func,fixed:E().oneOfType([E().string,E().bool]),forwardedRef:E().oneOfType([E().object,E().func]),groups:E().instanceOf(Map),handleBodyScroll:E().func,handleWheel:E().func,headerRef:E().oneOfType([E().object,E().func]),includeHeader:E().bool,onScroll:E().func,prefixCls:E().string,renderExpandIcon:E().func,rowExpandable:E().func,rowKey:E().oneOfType([E().string,E().bool,E().func]),scroll:E().object,selectedRowKeysSet:E().instanceOf(Set).isRequired,showHeader:E().bool,size:E().string,store:E().object,virtualized:E().oneOfType([E().bool,E().object])};const RO=h().forwardRef((function(e,t){return h().createElement(MO,Object.assign({},e,{forwardedRef:t}))}));var AO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class NO extends f{get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{resetScrollY:()=>{const{scroll:e={}}=this.props;Boolean(o()(e,"y"))?this.bodyWrapRef.current&&(this.bodyWrapRef.current.scrollTop=0):this.wrapRef.current&&this.wrapRef.current.scrollIntoView({behavior:"smooth",block:"start"})},setSelectedRowKeys:e=>{this.setState({rowSelection:Object.assign(Object.assign({},this.state.rowSelection),{selectedRowKeys:[...e],selectedRowKeysSet:new Set(e)})})},setDisabledRowKeys:e=>{this.setState({disabledRowKeys:e,disabledRowKeysSet:new Set(e)})},setCurrentPage:e=>{const{pagination:t}=this.state;"object"==typeof t?this.setState({pagination:Object.assign(Object.assign({},t),{currentPage:e})}):this.setState({pagination:{currentPage:e}})},setPagination:e=>this.setState({pagination:e}),setGroups:e=>this.setState({groups:e}),setDataSource:e=>this.setState({dataSource:e}),setExpandedRowKeys:e=>this.setState({expandedRowKeys:[...e]}),setQuery:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[...e.state.queries];n=fk(t,n),e.setState({queries:n})},setQueries:e=>this.setState({queries:e}),setFlattenData:e=>this.setState({flattenData:e}),setAllRowKeys:e=>this.setState({allRowKeys:e}),setHoveredRowKey:e=>{this.store.setState({hoveredRowKey:e})},setHoveredRowKeys:e=>{this.store.setState({hoveredRowKeys:e})},setCachedFilteredSortedDataSource:e=>{this.cachedFilteredSortedDataSource=e},setCachedFilteredSortedRowKeys:e=>{this.cachedFilteredSortedRowKeys=e,this.cachedFilteredSortedRowKeysSet=new Set(e)},setAllDisabledRowKeys:e=>{const t=new Set(e);this.setState({allDisabledRowKeys:e,allDisabledRowKeysSet:t})},getCurrentPage:()=>o()(this.state,"pagination.currentPage",1),getCurrentPageSize:()=>o()(this.state,"pagination.pageSize",q_.DEFAULT_PAGE_SIZE),getCachedFilteredSortedDataSource:()=>this.cachedFilteredSortedDataSource,getCachedFilteredSortedRowKeys:()=>this.cachedFilteredSortedRowKeys,getCachedFilteredSortedRowKeysSet:()=>this.cachedFilteredSortedRowKeysSet,getAllDisabledRowKeys:()=>this.state.allDisabledRowKeys,getAllDisabledRowKeysSet:()=>this.state.allDisabledRowKeysSet,getHalfCheckedRowKeys:()=>this.state.halfCheckedRowKeys||[],getHalfCheckedRowKeysSet:()=>this.state.halfCheckedRowKeysSet||new Set,setHalfCheckedRowKeys:e=>{this.setState({halfCheckedRowKeys:e,halfCheckedRowKeysSet:new Set(e)})},getKeyEntities:()=>this.state.keyEntities||{},setKeyEntities:e=>{this.setState({keyEntities:e})},getCheckRelation:()=>{const{rowSelection:e}=this.state;return e&&"object"==typeof e?o()(e,"checkRelation","unRelated"):"unRelated"},notifyFilterDropdownVisibleChange:(e,t)=>this._invokeColumnFn(t,"onFilterDropdownVisibleChange",e),notifyChange:function(){return e.props.onChange(...arguments)},notifyExpand:function(){return e.props.onExpand(...arguments)},notifyExpandedRowsChange:function(){return e.props.onExpandedRowsChange(...arguments)},notifySelect:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e._invokeRowSelection("onSelect",...n)},notifySelectAll:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e._invokeRowSelection("onSelectAll",...n)},notifySelectInvert:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e._invokeRowSelection("onSelectInvert",...n)},notifySelectionChange:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e._invokeRowSelection("onChange",...n)},isAnyColumnFixed:e=>V_()(this.getColumns(e||this.props.columns,this.props.children),(e=>Boolean(e.fixed))),useFixedHeader:()=>{const{scroll:e,sticky:t}=this.props;return!!o()(e,"y")||!!t},getTableLayout:()=>{let e=!1;const{flattenColumns:t}=this.state;return Array.isArray(t)&&(e=t.some((e=>Boolean(e.ellipsis)||Boolean(e.fixed)))),this.adapter.useFixedHeader()&&(e=!0),e?"fixed":"auto"},setHeadWidths:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var r,i,s;r=e.state.headWidths[n],i=t,K_()(r,i,(function(e,t){if("function"==typeof e&&"function"==typeof t)return rE()(e)===rE()(t);if("function"==typeof s){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return s(e,t,...r)}}))||e.setState((e=>{const r=[...e.headWidths];return r[n]=[...t],{headWidths:r}}))},getHeadWidths:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(e.state.headWidths.length&&"number"==typeof t){return(e.state.headWidths[t]||[]).map((e=>e.width))}return[]},getCellWidths:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Array.isArray(t)&&t.length&&(n=null==n&&e.state.headWidths.length?$_()(e.state.headWidths):[],Array.isArray(n)&&n.length)?t.reduce(((e,t)=>{const i=t.key===G_.DEFAULT_KEY_COLUMN_SCROLLBAR&&r?null:jv()(n,(e=>e&&null!=e.key&&e.key===t.key));return i&&e.push(i.width),e}),[]):[]},mergedRowExpandable:e=>{const{expandedRowRender:t,childrenRecordName:n,rowExpandable:r}=this.props,i=o()(e,n),s="function"==typeof t,a="function"==typeof r,l=Array.isArray(i)&&i.length,c=a&&r(e);return(s||l)&&(!a||c)||!(s||l)&&c},isAnyColumnUseFullRender:e=>V_()(e,(e=>Boolean(e.useFullRender))),getNormalizeColumns:()=>this.normalizeColumns,getHandleColumns:()=>this.handleColumns,getMergePagination:()=>this.mergePagination,setBodyHasScrollbar:e=>{e!==this.state.bodyHasScrollBar&&this.setState({bodyHasScrollBar:e})},stopPropagation(e){e&&"object"==typeof e&&("function"==typeof e.stopPropagation&&e.stopPropagation(),e.nativeEvent&&"function"==typeof e.nativeEvent.stopPropagation?e.nativeEvent.stopPropagation():"function"==typeof e.stopImmediatePropagation&&e.stopImmediatePropagation())}})}constructor(e,t){var n;super(e),n=this,this._warnIfNoKey=()=>{(this.props.rowSelection||this.props.expandedRowRender)&&V_()(this.props.dataSource,(e=>null==this.foundation.getRecordKey(e)))&&Yk.error('You must specify a key for each element in the dataSource or use "rowKey" to specify an attribute name as the primary key!')},this._invokeRowSelection=function(e){const t=o()(n.state,["rowSelection",e]);if("function"==typeof t){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];t(...i)}},this._invokeColumnFn=function(e,t){if(e&&t){const a=n.foundation.getQuery(e),l=o()(a,t,null);if("function"==typeof l){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];l(...i)}}},this._cacheHeaderRef=e=>{this.headerWrapRef.current=e},this.getCurrentPageData=()=>{const e=this.foundation.getCurrentPageData(),t=["dataSource","groups"].reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{});return ie(t)},this.getColumns=(e,t)=>Array.isArray(e)&&e&&e.length?e:Mk(t),this.getCellWidths=function(){return n.foundation.getCellWidths(...arguments)},this.setHeadWidths=function(){return n.foundation.setHeadWidths(...arguments)},this.getHeadWidths=function(){return n.foundation.getHeadWidths(...arguments)},this.mergedRowExpandable=function(){return n.foundation.mergedRowExpandable(...arguments)},this.setBodyHasScrollbar=function(){return n.foundation.setBodyHasScrollbar(...arguments)},this.handleWheel=e=>{const{scroll:t={}}=this.props;if(window.navigator.userAgent.match(/Trident\/7\./)&&t.y){e.preventDefault();const t=e.deltaY,{target:n}=e,r=this.bodyWrapRef.current;let i=0;i=this.lastScrollTop?this.lastScrollTop+t:t,r&&n!==r&&(r.scrollTop=i)}},this.handleBodyScrollLeft=e=>{if(e.currentTarget!==e.target)return;const{target:t}=e,n=this.headerWrapRef.current,r=this.bodyWrapRef.current;t.scrollLeft!==this.lastScrollLeft&&(t===r&&n?n.scrollLeft=t.scrollLeft:t===n&&r&&(r.scrollLeft=t.scrollLeft),this.setScrollPositionClassName()),this.lastScrollLeft=t.scrollLeft},this.handleWindowResize=()=>{this.syncTableWidth(),this.setScrollPositionClassName()},this.handleBodyScrollTop=e=>{const{target:t}=e;if(e.currentTarget!==t)return;const{scroll:n={}}=this.props,r=this.headerWrapRef.current,i=this.bodyWrapRef.current;if(t.scrollTop!==this.lastScrollTop&&n.y&&t!==r){const{scrollTop:e}=t;i&&t!==i&&(i.scrollTop=e)}this.lastScrollTop=t.scrollTop},this.handleBodyScroll=e=>{this.handleBodyScrollLeft(e),this.handleBodyScrollTop(e)},this.setScrollPosition=e=>{const{prefixCls:t}=this.props,n=[`${t}-scroll-position-both`,`${t}-scroll-position-middle`,`${t}-scroll-position-left`,`${t}-scroll-position-right`];this.position=e,this.scrollPosition=e;const r=this.wrapRef.current;if(r&&r.nodeType)if("both"===e){const e=[`${t}-scroll-position-left`,`${t}-scroll-position-right`];r.classList.remove(...Kl()(n,e)),r.classList.add(...e)}else{const i=[`${t}-scroll-position-${e}`];r.classList.remove(...Kl()(n,i)),r.classList.add(...i)}},this.setScrollPositionClassName=()=>{const e=this.bodyWrapRef.current;if(e&&e.children&&e.children.length){const t=0===e.scrollLeft,n=Math.abs(e.scrollLeft)+1>=e.children[0].getBoundingClientRect().width-e.getBoundingClientRect().width;t&&n?this.setScrollPosition("both"):t?this.setScrollPosition("left"):n?this.setScrollPosition("right"):"middle"!==this.scrollPosition&&this.setScrollPosition("middle")}},this.syncTableWidth=()=>{var e;const t=null===(e=this.rootWrapRef)||void 0===e?void 0:e.current;if(!t)return;const n=t.getBoundingClientRect().width,r=this.state.tableWidth;"number"==typeof r&&Math.abs(r-n)<.5||this.setState({tableWidth:n})},this.observeTableWrapperResize=()=>{const e=this.rootWrapRef.current;if(!e)return;this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null);const t=o()(window,"ResizeObserver");t&&(this.resizeObserver=new t((e=>{const t=()=>{this.syncTableWidth(),this.setScrollPositionClassName()};"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(t):window.setTimeout(t,0)})),this.resizeObserver.observe(e))},this.needSyncTableWidth=()=>this.adapter.isAnyColumnFixed()||this.props.showHeader&&this.adapter.useFixedHeader(),this.bindWindowResize=()=>{this.hasBindWindowResize||this.debouncedWindowResize&&(window.addEventListener("resize",this.debouncedWindowResize),this.hasBindWindowResize=!0)},this.unbindWindowResize=()=>{this.hasBindWindowResize&&(this.debouncedWindowResize&&window.removeEventListener("resize",this.debouncedWindowResize),this.hasBindWindowResize=!1)},this.syncResizeListeners=()=>{if(this.needSyncTableWidth()){const e=this.hasBindWindowResize;this.bindWindowResize(),this.resizeObserver||this.observeTableWrapperResize(),e||this.handleWindowResize()}else this.unbindWindowResize(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},this.renderSelection=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;const{rowSelection:i,allDisabledRowKeysSet:s,halfCheckedRowKeysSet:a,keyEntities:l}=n.state;if(i&&"object"==typeof i){const{selectedRowKeys:l=[],selectedRowKeysSet:c=new Set,getCheckboxProps:d,disabled:u,renderCell:p,checkRelation:f="unRelated"}=i,m=n.cachedFilteredSortedRowKeys,g=n.cachedFilteredSortedRowKeysSet,y=n.foundation.allIsSelected(c,s,m),v=n.foundation.hasRowSelected(l,g)&&!y;if(t){const r=o()(i,"key",G_.DEFAULT_KEY_COLUMN_SELECTION),s=h().createElement(Dk,{"aria-label":(y?"Deselect":"Select")+" all rows",disabled:u,key:r,selected:y,indeterminate:v,onChange:(e,t)=>{n.toggleSelectAllRow(e,t)}}),a=(e,t)=>n.toggleSelectAllRow(e,t);return ye()(p)?p({selected:y,record:e,originNode:s,inHeader:t,disabled:u,indeterminate:v,selectAll:a}):s}{const t=n.foundation.getRecordKey(e),i=c.has(t),s="related"===f&&a&&a.has(t),o=()=>"function"==typeof d?d(e):{},l=h().createElement(Dk,{"aria-label":(i?"Deselect":"Select")+" this row",getCheckboxProps:o,selected:i,indeterminate:s,onChange:(e,r)=>n.toggleSelectRow(e,t,r)}),m=(e,r)=>n.toggleSelectRow(e,t,r);return ye()(p)?p({selected:i,record:e,index:r,originNode:l,inHeader:!1,disabled:u,indeterminate:s,selectRow:m}):l}}return null},this.renderRowSelectionCallback=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return n.renderSelection(t,!1,r)},this.renderTitleSelectionCallback=()=>this.renderSelection(void 0,!0),this.normalizeSelectionColumn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{rowSelection:t,prefixCls:r}=e;let i={};if(t){const e=["selectedRowKeys","selectedRowKeysSet"];i={key:G_.DEFAULT_KEY_COLUMN_SELECTION},z()(t)&&(i=Object.assign(Object.assign({},i),W()(t,e))),i.className=w()(i.className,`${r}-column-selection`),i.title=n.renderTitleSelectionCallback,i.render=n.renderRowSelectionCallback}return i},this.normalizeScrollbarColumn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{scrollbarWidth:t=0}=e;return{key:G_.DEFAULT_KEY_COLUMN_SCROLLBAR,width:t,fixed:"right"}},this.renderExpandIcon=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const{expandedRowKeys:i}=n.state,{expandIcon:s}=n.props,o="string"==typeof r||"number"==typeof r?r:n.foundation.getRecordKey(e);return h().createElement(nO,{key:o,componentType:t?"tree":"expand",expanded:Vl()(i,o),expandIcon:s,onClick:(e,t)=>n.handleRowExpanded(e,o,t)})},this.handleRowExpanded=function(){return n.foundation.handleRowExpanded(...arguments)},this.normalizeExpandColumn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null;const{prefixCls:r,expandCellFixed:i,expandIcon:s}=e;return t={fixed:i,key:G_.DEFAULT_KEY_COLUMN_EXPAND},t.className=w()(t.className,`${r}-column-expand`),t.render=!1!==s?function(){let e=arguments.length>1?arguments[1]:void 0;return n.adapter.mergedRowExpandable(e)?n.renderExpandIcon(e):null}:()=>null,t},this.addFnsInColumn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{prefixCls:t}=n.props;if(e&&(e.sorter||e.filters||e.onFilter||e.useFullRender)){let r="function"==typeof e.sorter||!0===e.sorter,i=Array.isArray(e.filters)&&e.filters.length||(0,d.isValidElement)(e.filterDropdown)||"function"==typeof e.renderFilterDropdown,s=!1;const a=!("sortOrder"in e)&&!0===e.showSortTip,{dataIndex:l,title:c,useFullRender:u}=e,p=r&&!i&&!Boolean(u),f=n.foundation.getQuery(l),m={},g=[];u&&(m.selection=n.renderSelection(null,!0));const y=o()(f,"sortOrder"),v=o()(f,"defaultSortOrder",!1),b=n.foundation.isSortOrderValid(y)?y:v,w=bk(e.ellipsis),x="function"!=typeof c&&h().createElement("span",{className:`${t}-row-head-title`,key:G_.DEFAULT_KEY_COLUMN_TITLE,title:w&&"string"==typeof c?c:void 0},c);if(r){const t=h().createElement(Qk,{key:G_.DEFAULT_KEY_COLUMN_SORTER,sortOrder:b,sortIcon:e.sortIcon,onClick:u||i?t=>n.foundation.handleSort(e,t):null,title:x,showTooltip:!p&&a});u&&(m.sorter=t),s=!0,g.push(t)}else g.push(x);const E=o()(f,"filteredValue"),C=o()(f,"defaultFilteredValue"),S=E||C;if(i){const e=h().createElement(Bk,Object.assign({key:G_.DEFAULT_KEY_COLUMN_FILTER},W()(f,"children"),{filteredValue:S,onFilterDropdownVisibleChange:e=>n.foundation.toggleShowFilter(l,e),onSelect:e=>n.foundation.handleFilterSelect(l,e)}));u&&(m.filter=e),s=!0,g.push(e)}const _="function"==typeof c?()=>c(m):s?h().createElement("div",{className:`${t}-operate-wrapper`},g):g;e=Object.assign(Object.assign({},e),{title:_}),p&&(e.clickToSort=t=>{n.foundation.handleSort(e,t,!0)},e.mouseDown=n.foundation.handleMouseDown,e.sortOrder=b,e.showSortTip=a)}return e},this.toggleSelectRow=(e,t,n)=>{this.foundation.handleSelectRow(t,e,n)},this.handleRowClickSelection=(e,t,n)=>{const{rowSelection:r}=this.state;if(o()(r,"clickRow",!1)&&r){const i=o()(r,"disabled",!1),s=o()(r,"getCheckboxProps");if(i)return;const a=this.cachedFilteredSortedDataSource.find((t=>this.foundation.getRecordKey(t)===e));if(a&&"function"==typeof s){if(s(a).disabled)return}this.foundation.handleSelectRow(e,t,n)}},this.toggleSelectAllRow=(e,t)=>{this.foundation.handleSelectAllRow(e,t)},this.renderPagination=(e,t)=>{if(!e)return null;const n=this.foundation.memoizedPagination(e);return h().createElement(Jt,{componentName:"Table"},(e=>{const r=this.foundation.formatPaginationInfo(n,e.pageText);return h().createElement(Lk,{info:r,pagination:n,renderPagination:t})}))},this.renderTitle=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{title:t}=e;const{prefixCls:n,dataSource:r}=e;return"function"==typeof t&&(t=t(r)),(0,d.isValidElement)(t)||"string"==typeof t?h().createElement("div",{className:`${n}-title`,"x-semi-prop":"title"},t):null},this.renderEmpty=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{prefixCls:t,empty:r,dataSource:i}=e,s=`${t}-placeholder`;return n.foundation.isEmpty(i)?h().createElement(Jt,{componentName:"Table",key:"emptyText"},((e,n)=>h().createElement("div",{className:s},h().createElement("div",{className:`${t}-empty`,"x-semi-prop":"empty"},r||e.emptyText)))):null},this.renderFooter=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{footer:t}=e;const{prefixCls:n,dataSource:r}=e;return"function"==typeof t&&(t=t(r)),(0,d.isValidElement)(t)||"string"==typeof t?h().createElement("div",{className:`${n}-footer`,key:"footer","x-semi-prop":"footer"},t):null},this.renderMainTable=e=>{const t=this.adapter.useFixedHeader(),n=this.renderEmpty(e);return[this.renderTable(Object.assign(Object.assign({},e),{fixed:!1,useFixedHeader:t,headerRef:this._cacheHeaderRef,bodyRef:this.bodyWrapRef,includeHeader:!t,emptySlot:n})),this.renderFooter(e)]},this.renderTable=e=>{const{columns:t,filteredColumns:n,fixed:r,useFixedHeader:i,scroll:s,prefixCls:a,anyColumnFixed:l,includeHeader:c,showHeader:d,components:u,headerRef:p,bodyRef:f,onHeaderRow:m,rowSelection:g,dataSource:y,bodyHasScrollBar:v,disabledRowKeysSet:b,sticky:w}=e,x=o()(g,"selectedRowKeysSet",new Set),E=this.adapter.getTableLayout();return[r||i?h().createElement(cO,{key:"head",tableLayout:E,ref:p,columns:n,prefixCls:a,fixed:r,handleBodyScroll:this.handleBodyScrollLeft,components:u,scroll:s,showHeader:d,selectedRowKeysSet:x,onHeaderRow:m,dataSource:y,bodyHasScrollBar:v,sticky:w}):null,h().createElement(RO,Object.assign({},W()(e,["rowSelection","headWidths"]),{key:"body",ref:f,columns:n,fixed:r,prefixCls:a,handleWheel:this.handleWheel,handleBodyScroll:this.handleBodyScroll,anyColumnFixed:l,tableLayout:E,includeHeader:c,showHeader:d,scroll:s,components:u,store:this.store,selectedRowKeysSet:x,disabledRowKeysSet:b}))]},this.handleColumns=(e,t)=>{const{hideExpandedColumn:r,scroll:i,prefixCls:s,expandCellFixed:a,expandIcon:l,rowSelection:c}=this.props,d="children";let h=ie(t);const u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Array.isArray(e)&&e.length&&Me()(e,((e,t,r)=>{const i=n.addFnsInColumn(e),s=e[d];if(Array.isArray(s)&&s.length){const e=[...s];u(e),i[d]=e}r[t]=i}))};if(u(h),!r){const e=this.normalizeExpandColumn({prefixCls:s,expandCellFixed:a,expandIcon:l}),t=Nv()(h,(e=>e.key===G_.DEFAULT_KEY_COLUMN_EXPAND));e&&(t>-1?h[t]=Object.assign(Object.assign({},e),h[t]):h="right"===e.fixed?[...h,e]:[e,...h])}if(c&&!o()(c,"hidden")){const e=Nv()(h,(e=>e.key===G_.DEFAULT_KEY_COLUMN_SELECTION)),t=this.normalizeSelectionColumn({rowSelection:c,prefixCls:s});e>-1?h[e]=Object.assign(Object.assign({},t),h[e]):h="right"===t.fixed?[...h,t]:[t,...h]}return hk(h),h},this.normalizeColumns=(e,t)=>ie(this.getColumns(e,t)),this.mergePagination=e=>{const t=null==e?void 0:e.onChange,{scroll:n}=this.props;if(o()(n,"scrollToFirstRowOnChange")){return Object.assign(Object.assign({},e),{onChange:(e,n)=>{this.foundation.setPage(e,n),"function"==typeof t&&t(e,n)}})}return Object.assign({onChange:this.foundation.setPage},e)},this.foundation=new Tk(this.adapter);const r=this.getColumns(e.columns,e.children),i=dk(r),s=Tk.initColumnsFilteredValueAndSorterOrder(ie(i)),a=this.foundation.getFilteredSortedDataSource(this.props.dataSource,s),l=xb()(this.props.pagination)?this.props.pagination:{},c=this.foundation.getCurrentPageData(a,l,s);this.state={cachedColumns:r,cachedChildren:e.children,flattenColumns:i,components:Xk(e.components,e.virtualized),queries:s,dataSource:c.dataSource,flattenData:[],expandedRowKeys:[...e.expandedRowKeys||[],...e.defaultExpandedRowKeys||[]],rowSelection:e.rowSelection?z()(e.rowSelection)?Object.assign({},e.rowSelection):{}:null,pagination:c.pagination,groups:null,allRowKeys:[],disabledRowKeys:[],disabledRowKeysSet:new Set,allDisabledRowKeys:[],allDisabledRowKeysSet:new Set,headWidths:[],bodyHasScrollBar:!1,prePropRowSelection:void 0,prePagination:void 0,halfCheckedRowKeys:[],halfCheckedRowKeysSet:new Set,keyEntities:{}},this.rootWrapRef=(0,d.createRef)(),this.wrapRef=(0,d.createRef)(),this.bodyWrapRef=(0,d.createRef)(),this.headerWrapRef=(0,d.createRef)(),this.store=new wk({hoveredRowKey:null,hoveredRowKeys:[]}),this.debouncedWindowResize=v()(this.handleWindowResize,150),this.cachedFilteredSortedDataSource=[],this.cachedFilteredSortedRowKeys=[],this.cachedFilteredSortedRowKeysSet=new Set,this.resizeObserver=null,this.hasBindWindowResize=!1}static getDerivedStateFromProps(e,t){const n={},{rowSelection:r,dataSource:i,childrenRecordName:s,rowKey:a,pagination:l}=e;if(e.columns&&e.children&&Yk.warn("columns should not given by object and children at the same time"),e.columns&&e.columns!==t.cachedColumns){const r=dk(e.columns);n.flattenColumns=r,n.queries=Zk(t.queries,r,null,!1),n.cachedColumns=e.columns,n.cachedChildren=null}else if(e.children&&e.children!==t.cachedChildren){const r=Mk(e.children),i=dk(r),s=Zk(t.queries,i,null,!1);n.flattenColumns=i,n.queries=[...s],n.cachedColumns=[...r],n.cachedChildren=e.children}if(r!==t.prePropRowSelection){let e={};z()(t.rowSelection)&&(e=Object.assign(Object.assign({},e),t.rowSelection)),z()(r)&&(e=Object.assign(Object.assign({},e),r));const l=o()(r,"selectedRowKeys"),c=o()(r,"getCheckboxProps");if(l&&Array.isArray(l)&&(e.selectedRowKeysSet=new Set(l)),ye()(c)){const e=mk({dataSource:i,getCheckboxProps:c,childrenRecordName:s,rowKey:a}),t=new Set(e);n.disabledRowKeys=e,n.disabledRowKeysSet=t,n.allDisabledRowKeys=e,n.allDisabledRowKeysSet=t}n.rowSelection=e,n.prePropRowSelection=r}if(l!==t.prePagination){let e={};z()(t.pagination)&&(e=Object.assign(Object.assign({},e),t.pagination)),z()(l)&&(e=Object.assign(Object.assign({},e),l)),n.pagination=e,n.prePagination=l}return n}componentDidMount(){super.componentDidMount(),this.setScrollPosition("left");const{dataSource:e,childrenRecordName:t}=this.props;if("related"===o()(this.state.rowSelection,"checkRelation","unRelated")&&e&&e.length){const t=this.foundation.buildKeyEntities(e);this.adapter.setKeyEntities(t)}"undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame((()=>this.setScrollPositionClassName())):setTimeout((()=>this.setScrollPositionClassName()),0),this.syncResizeListeners()}componentDidUpdate(e,t){const{dataSource:n,expandedRowKeys:r,expandAllRows:i,expandAllGroupRows:s,virtualized:a,components:l,pagination:c}=this.props,{pagination:d,queries:h,cachedColumns:u,cachedChildren:p,groups:f}=this.state,m={};this._warnIfNoKey(),Array.isArray(r)&&r!==e.expandedRowKeys&&this.setState({expandedRowKeys:r}),l===e.components&&a===e.virtualized||this.setState({components:Xk(l,a)}),i===e.expandAllRows&&s===e.expandAllGroupRows||this.foundation.initExpandedRowKeys({groups:f});const g=o()(this.props.rowSelection,"getCheckboxProps"),y=o()(e.rowSelection,"getCheckboxProps");if(n!==e.dataSource||h!==t.queries||g!==y){const e=[...n],t=this.foundation.getFilteredSortedDataSource(e,h),r=this.foundation.getAllDisabledRowKeys(t);this.foundation.setCachedFilteredSortedDataSource(t),this.foundation.setAllDisabledRowKeys(r),m.dataSource=t;if("related"===o()(this.state.rowSelection,"checkRelation","unRelated")){const t=this.foundation.buildKeyEntities(e);this.adapter.setKeyEntities(t)}this.props.groupBy&&(m.groups=null)}if(n!==e.dataSource&&(m.pagination=z()(d)?Object.assign(Object.assign({},d),{currentPage:z()(c)&&c.currentPage?c.currentPage:1}):d),Object.keys(m).length){const{pagination:e=null,queries:t=null,dataSource:n=null}=m,r=this.foundation.getCurrentPageData(n,e,t);this.adapter.setAllRowKeys(r.allRowKeys),this.adapter.setDisabledRowKeys(r.disabledRowKeys),"dataSource"in m&&((this.props.defaultExpandAllRows&&r.groups&&r.groups.size||this.props.expandAllRows||this.props.expandAllGroupRows)&&this.foundation.initExpandedRowKeys(r),m.pagination=r.pagination);const i=Object.keys(m);for(const e of i)this.setState({[e]:r[e]})}this.syncResizeListeners()}componentWillUnmount(){super.componentWillUnmount(),this.unbindWindowResize(),this.debouncedWindowResize&&(this.debouncedWindowResize.cancel(),this.debouncedWindowResize=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}render(){let e,t=this.props,{scroll:n,prefixCls:r,className:i,style:s={},bordered:a,id:l,pagination:c,virtualized:d,size:u,renderPagination:p,getVirtualizedListRef:f,loading:m,hideExpandedColumn:g,rowSelection:y}=t,v=AO(t,["scroll","prefixCls","className","style","bordered","id","pagination","virtualized","size","renderPagination","getVirtualizedListRef","loading","hideExpandedColumn","rowSelection"]),{rowSelection:b,expandedRowKeys:x,headWidths:E,tableWidth:C,pagination:S,dataSource:_,queries:k,cachedColumns:O,bodyHasScrollBar:T}=this.state;if(s=Object.assign({},s),this.adapter.isAnyColumnUseFullRender(k))e=this.handleColumns(k,O);else{const t=y&&!o()(y,"hidden");e=this.foundation.memoizedWithFnsColumns(k,O,t,g,T)}const P=this.foundation.memoizedFilterColumns(e),I=this.foundation.memoizedFlattenFnsColumns(e),M=this.adapter.isAnyColumnFixed(e),R=Object.assign(Object.assign(Object.assign({},v),this.state),{virtualized:d,scroll:n,prefixCls:r,size:u,hideExpandedColumn:g,columns:e,anyColumnFixed:M,rowExpandable:this.mergedRowExpandable,pagination:S,dataSource:_,rowSelection:b,expandedRowKeys:x,renderExpandIcon:this.renderExpandIcon,filteredColumns:P}),A=o()(n,"x"),N=o()(n,"y");d&&"number"!=typeof s.width&&(s.width=A);const D=w()({[`${r}-${G_.SIZE_SMALL}`]:u===G_.SIZE_SMALL,[`${r}-${G_.SIZE_MIDDLE}`]:u===G_.SIZE_MIDDLE,[`${r}-virtualized`]:Boolean(d),[`${r}-bordered`]:a,[`${r}-fixed-header`]:Boolean(N),[`${r}-scroll-position-left`]:["both","left"].includes(this.position),[`${r}-scroll-position-right`]:["both","right"].includes(this.position)}),L=S&&c?this.renderPagination(S,p):null,F=o()(c,"position","bottom"),j=Object.assign(Object.assign({},this.context),{headWidths:E,tableWidth:C,anyColumnFixed:M,flattenedColumns:I,renderExpandIcon:this.renderExpandIcon,renderSelection:this.renderSelection,setHeadWidths:this.setHeadWidths,getHeadWidths:this.getHeadWidths,getCellWidths:this.getCellWidths,handleRowExpanded:this.handleRowExpanded,getVirtualizedListRef:f,setBodyHasScrollbar:this.setBodyHasScrollbar,handleRowSelection:this.handleRowClickSelection,headerStyle:R.headerStyle,rowSpanHover:R.rowSpanHover}),$=this.getDataAttr(v);return h().createElement("div",Object.assign({ref:this.rootWrapRef,className:w()(i,`${r}-wrapper`,`${r}-wrapper-${R.direction}`),"data-column-fixed":M,style:s,id:l},$),h().createElement(Ak,Object.assign({},j,{direction:R.direction}),h().createElement(dr,{spinning:m,size:"large"},h().createElement("div",{ref:this.wrapRef,className:D},h().createElement(h().Fragment,{key:"pagination-top"},["top","both"].includes(F)?L:null),this.renderTitle({title:R.title,dataSource:R.dataSource,prefixCls:R.prefixCls}),h().createElement("div",{className:`${r}-container`},this.renderMainTable(Object.assign({},R))),h().createElement(h().Fragment,{key:"pagination-bottom"},["bottom","both"].includes(F)?L:null)))))}}NO.contextType=Rk,NO.propTypes={className:E().string,style:E().object,prefixCls:E().string,components:E().any,bordered:E().bool,loading:E().bool,size:E().oneOf(G_.SIZES),tableLayout:E().oneOf(G_.LAYOUTS),columns:E().arrayOf(E().shape(Pk)),hideExpandedColumn:E().bool,id:E().string,expandIcon:E().oneOfType([E().bool,E().func,E().node]),expandCellFixed:E().oneOf(G_.FIXED_SET),title:E().oneOfType([E().string,E().node,E().func]),onHeaderRow:E().func,showHeader:E().bool,indentSize:E().number,rowKey:E().oneOfType([E().func,E().string,E().number]),onRow:E().func,onExpandedRowsChange:E().func,onExpand:E().func,rowExpandable:E().func,expandedRowRender:E().func,expandedRowKeys:E().array,defaultExpandAllRows:E().bool,expandAllRows:E().bool,defaultExpandAllGroupRows:E().bool,expandAllGroupRows:E().bool,defaultExpandedRowKeys:E().array,pagination:E().oneOfType([E().object,E().bool]),renderPagination:E().func,footer:E().oneOfType([E().func,E().string,E().node]),empty:E().node,dataSource:E().array,childrenRecordName:E().string,rowSelection:E().oneOfType([E().object,E().bool]),onChange:E().func,scroll:E().shape({x:E().oneOfType([E().number,E().string,E().bool]),y:E().oneOfType([E().number,E().string])}),groupBy:E().oneOfType([E().string,E().number,E().func]),headerStyle:E().object,renderGroupSection:E().oneOfType([E().func]),onGroupedRow:E().func,clickGroupedRowToExpand:E().bool,virtualized:E().oneOfType([E().object,E().bool]),dropdownPrefixCls:E().string,expandRowByClick:E().bool,getVirtualizedListRef:E().func,rowSpanHover:E().bool},NO.defaultProps={tableLayout:"",dataSource:[],prefixCls:W_.PREFIX,rowSelection:null,className:"",childrenRecordName:"children",size:"default",loading:!1,bordered:!1,expandCellFixed:!1,hideExpandedColumn:!0,showHeader:!0,indentSize:q_.DEFAULT_INDENT_WIDTH,onChange:i(),pagination:!0,rowKey:"key",defaultExpandedRowKeys:[],defaultExpandAllRows:!1,defaultExpandAllGroupRows:!1,expandAllRows:!1,expandAllGroupRows:!1,onFilterDropdownVisibleChange:i(),onExpand:i(),onExpandedRowsChange:i(),expandRowByClick:!1};const DO=NO;var LO=__webpack_require__("ExWj"),FO=__webpack_require__.n(LO);function jO(e){const t=FO()(e,/\s+/);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];const s=H_()(r,(e=>!t.includes(e)));return w()(e,...s)}function $O(e){const t=FO()(e,/\s+/);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Lv()(r,(e=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})),w()(...t)}var BO=__webpack_require__("7kvy"),VO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class zO extends h().PureComponent{render(){const e=this.props,{onResize:t,onResizeStart:n,onResizeStop:r,width:i,resize:s}=e,o=VO(e,["onResize","onResizeStart","onResizeStop","width","resize"]);if("number"!=typeof i||!1===s)return h().createElement("th",Object.assign({},o));let{children:a}=o;return a=h().Children.map(a,((e,t)=>h().createElement(h().Fragment,{key:t},e))),h().createElement(BO.Resizable,{width:i,height:0,onResize:t,onResizeStart:n,onResizeStop:r,draggableOpts:{enableUserSelectHack:!1},axis:"x"},h().createElement("th",Object.assign({},o),a))}}const HO=zO;var UO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const KO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const{components:n,columns:r,resizable:s}=e,a=UO(e,["components","columns","resizable"]),l="children",c=o()(s,"onResize",i()),u=o()(s,"onResizeStart",i()),p=o()(s,"onResizeStop",i()),f=Array.isArray(r)&&r.length?r:Mk(e.children),m=hk(ie(f),l),g=hk(ie(f),l);"function"!=typeof e.expandedRowRender||e.hideExpandedColumn||jv()(m,(e=>e.key===G_.DEFAULT_KEY_COLUMN_EXPAND))||g.unshift({key:G_.DEFAULT_KEY_COLUMN_EXPAND,width:q_.DEFAULT_WIDTH_COLUMN_EXPAND}),!e.rowSelection||o()(e.rowSelection,"hidden")||jv()(m,(e=>e.key===G_.DEFAULT_KEY_COLUMN_SELECTION))||g.unshift({width:o()(e,"rowSelection.width",q_.DEFAULT_WIDTH_COLUMN_SELECTION),key:G_.DEFAULT_KEY_COLUMN_SELECTION});const[y,v]=(0,d.useState)(g);(0,d.useEffect)((()=>{const e=function(e,t){const n=[...t];for(const t of e)if(!Re(t.width)){const e=t.key,r=Nv()(n,(t=>t.key===e));-1!==r&&(n[r].width=o()(t,"width"))}return n}(y,g);v(Zk(y,e))}),[r,e.expandedRowRender,e.hideExpandedColumn,e.rowSelection]);const b=(0,d.useMemo)((()=>Ce()({header:{cell:HO}},n)),[n]),w=o()(s,"handlerClassName","resizing"),x=e=>(t,n)=>{let{size:r}=n;const i=ie(y),s=pk(i,e,l);let o=Object.assign(Object.assign({},s),{width:r.width});const a=c(o)||{};o=Object.assign(Object.assign({},o),a),Object.assign(s,o),v(i)},E=e=>t=>{if("undefined"!=typeof window){const e=window.getSelection();e&&e.removeAllRanges()}const n=ie(y),r=pk(n,e,l);let i=Object.assign(Object.assign({},r),{className:jO(r.className,w)});const s=u(i)||{};i=Object.assign(Object.assign({},i),s),Object.assign(r,i),v(n)},C=e=>t=>{const n=ie(y),r=pk(n,e,l);let i=Object.assign(Object.assign({},r),{className:$O(r.className,w)});const s=p(i)||{};i=Object.assign(Object.assign({},i),s),Object.assign(r,i),v(n)},S=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Array.isArray(e)&&e.length?e.map(((e,n)=>{var r,i;const s=null!==(i=null===(r=e.onHeaderCell)||void 0===r?void 0:r.call(e,e,n,t))&&void 0!==i?i:{};Object.assign(e,function(e,t){let n=arguments.length>3?arguments[3]:void 0;return Object.assign(Object.assign({},e),{onHeaderCell:e=>Object.assign(Object.assign({},n),{width:e.width,onResize:x(e),onResizeStart:E(e),onResizeStop:C(e)})})}(e,n,t,s));const o=e[l];return Array.isArray(o)&&o.length&&(e[l]=S(o,t+1)),e})):[]},_=(0,d.useMemo)((()=>S(y)),[y]);return h().createElement(DO,Object.assign({},a,{columns:_,components:b,ref:t}))},WO=h().forwardRef(KO);class GO extends h().PureComponent{constructor(e){super(e),this.getCurrentPageData=()=>this.tableRef.current&&this.tableRef.current.getCurrentPageData(),this.tableRef=h().createRef()}render(){var e;const t=this.props,n=null!==(e=this.props.direction)&&void 0!==e?e:this.context.direction;return t.resizable?h().createElement(WO,Object.assign({},t,{ref:this.tableRef,direction:n})):h().createElement(DO,Object.assign({},t,{ref:this.tableRef,direction:n}))}}GO.Column=Ik,GO.__SemiComponentName__="Table",GO.DEFAULT_KEY_COLUMN_SELECTION=G_.DEFAULT_KEY_COLUMN_SELECTION,GO.DEFAULT_KEY_COLUMN_EXPAND=G_.DEFAULT_KEY_COLUMN_EXPAND,GO.propTypes=Object.assign(Object.assign({},DO.propTypes),{resizable:E().oneOfType([E().bool,E().object])}),GO.defaultProps=he(GO.__SemiComponentName__,{hideExpandedColumn:!0}),GO.contextType=lt;const qO=GO,XO={TABS:`${C}-tabs`,TABS_BAR:`${C}-tabs-bar`,TABS_BAR_LINE:`${C}-tabs-bar-line`,TABS_BAR_CARD:`${C}-tabs-bar-card`,TABS_BAR_BUTTON:`${C}-tabs-bar-button`,TABS_BAR_SLASH:`${C}-tabs-bar-slash`,TABS_BAR_EXTRA:`${C}-tabs-bar-extra`,TABS_TAB:`${C}-tabs-tab`,TABS_TAB_ACTIVE:`${C}-tabs-tab-active`,TABS_TAB_DISABLED:`${C}-tabs-tab-disabled`,TABS_CONTENT:`${C}-tabs-content`,TABS_CONTENT_ANIMATED:`${C}-tabs-content-animated`,TABS_CONTENT_NO_ANIMATED:`${C}-tabs-content-no-animated`,TABS_PANE:`${C}-tabs-pane`,TABS_PANE_INACTIVE:`${C}-tabs-pane-inactive`,TABS_PANE_ACTIVE:`${C}-tabs-pane-active`,TABS_PANE_MOTION_OVERLAY:`${C}-tabs-pane-motion-overlay`,TABS_PANE_ANIMATING:`${C}-tabs-pane-animating`,TABS_PANE_ANIMATE_LEFT_SHOW:`${C}-tabs-pane-animate-leftShow`,TABS_PANE_ANIMATE_RIGHT_SHOW:`${C}-tabs-pane-animate-rightShow`,TABS_PANE_ANIMATE_TOP_SHOW:`${C}-tabs-pane-animate-topShow`,TABS_PANE_ANIMATE_BOTTOM_SHOW:`${C}-tabs-pane-animate-bottomShow`},YO=["line","card","button","slash"],ZO=["small","medium","large"],JO=["top","left"];const QO=class extends c{constructor(e){super(Object.assign({},e)),this.destroy=i(),this.handlePrevent=e=>{e.stopPropagation(),e.preventDefault()},this.handleKeyDown=(e,t,n)=>{const{preventScroll:r}=this.getProps(),i=[...e.target.parentNode.childNodes].filter((e=>o()(e,"attributes.data-tabkey.value","").includes("semiTab")&&"true"!==o()(e,"attributes.aria-disabled.value","")));switch(e.key){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":this.determineOrientation(e,i);break;case"Backspace":case"Delete":this.handleDeleteKeyDown(e,i,t,n);break;case"Enter":case" ":this.handleTabClick(t,e),this.handlePrevent(e);break;case"Home":i[0].focus({preventScroll:r}),this.handlePrevent(e);break;case"End":i[i.length-1].focus({preventScroll:r}),this.handlePrevent(e)}}}init(){this._adapter.collectPane()}_notifyChange(e){const{activeKey:t}=this.getStates();t!==e&&this._adapter.notifyChange(e)}handleTabClick(e,t){this._isInProps("activeKey")?this._notifyChange(e):(this._notifyChange(e),this.handleNewActiveKey(e)),this._adapter.notifyTabClick(e,t)}handleNewActiveKey(e){const{activeKey:t}=this.getStates();t!==e&&this._adapter.setNewActiveKey(e)}getDefaultActiveKey(){let e;const t=this.getProps();return e="activeKey"in t?t.activeKey:"defaultActiveKey"in t?t.defaultActiveKey:this._adapter.getDefaultActiveKeyFromChildren(),e}handleTabListChange(){this._adapter.collectPane()}handleTabPanesChange(){this._adapter.collectPane(),this._adapter.collectActiveKey()}handleTabDelete(e){this._adapter.notifyTabDelete(e)}determineOrientation(e,t){const{tabPosition:n}=this.getProps();"left"===n?"ArrowUp"!==e.key&&"ArrowDown"!==e.key||(this.switchTabOnArrowPress(e,t),this.handlePrevent(e)):"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(this.switchTabOnArrowPress(e,t),this.handlePrevent(e))}handleDeleteKeyDown(e,t,n,r){const{preventScroll:i}=this.getProps();if(r){this.handleTabDelete(n);const r=t.indexOf(e.target);1!==t.length&&t[r+1>=t.length?r-1:r+1].focus({preventScroll:i})}}switchTabOnArrowPress(e,t){const{preventScroll:n}=this.getProps(),r=t.indexOf(e.target),i={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1};i[e.key]&&void 0!==r&&(t[r+i[e.key]]?t[r+i[e.key]].focus({preventScroll:n}):"ArrowLeft"===e.key||"ArrowUp"===e.key?t[t.length-1].focus({preventScroll:n}):"ArrowRight"!==e.key&&"ArrowDown"!=e.key||t[0].focus({preventScroll:n}))}};__webpack_require__("NN0O");var eT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const tT=(e,t)=>{const{tab:n,size:r,type:i,icon:s,selected:o,closable:a,disabled:l,itemKey:c,deleteTabItem:u,tabPosition:p,handleKeyDown:f,onClick:m}=e,g=eT(e,["tab","size","type","icon","selected","closable","disabled","itemKey","deleteTabItem","tabPosition","handleKeyDown","onClick"]),y=(0,d.useMemo)((()=>a?h().createElement(Ji,{"aria-label":"Close",role:"button",className:`${XO.TABS_TAB}-icon-close`,onClick:e=>u(c,e)}):null),[i,a,u,c]),v=(0,d.useCallback)((e=>h().createElement("span",{className:`${XO.TABS_BAR}-icon`},e)),[]),b=(0,d.useCallback)((e=>{f&&f(e,c,a)}),[f,c,a]),x=(0,d.useCallback)((e=>{!l&&m&&m(c,e)}),[c,l,m]),E=s?v(s):null,C=w()(XO.TABS_TAB,`${XO.TABS_TAB}-${i}`,`${XO.TABS_TAB}-${p}`,`${XO.TABS_TAB}-single`,{[XO.TABS_TAB_ACTIVE]:o,[XO.TABS_TAB_DISABLED]:l,[`${XO.TABS_TAB}-small`]:"small"===r,[`${XO.TABS_TAB}-medium`]:"medium"===r});return h().createElement("div",Object.assign({role:"tab",id:`semiTab${c}`,"data-tabkey":`semiTab${c}`,"aria-controls":`semiTabPanel${c}`,"aria-disabled":l?"true":"false","aria-selected":o?"true":"false",tabIndex:o?0:-1,onKeyDown:b,onClick:x,className:C},g,{ref:t}),E,n,y)},nT=(0,d.forwardRef)(tT);nT.elementType="Tabs.TabItem";const rT=nT;var iT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class sT extends h().Component{constructor(e){var t;super(e),t=this,this.getEffectiveCollapsible=()=>{const{collapsible:e}=this.props;return"auto"===e?this.state.shouldCollapse:e||!1},this.checkOverflow=()=>{if("auto"!==this.props.collapsible)return;if(this.state.shouldCollapse)return;const e=this.tabBarRef.current;if(!e)return;const t=this.isTabsWrapped(e)||e.scrollWidth>e.clientWidth+1;t!==this.state.shouldCollapse&&this.setState({shouldCollapse:t})},this.isTabsWrapped=e=>{var t;if("left"===this.props.tabPosition)return!1;const n=Array.from(e.querySelectorAll(`.${XO.TABS_TAB}`));if(n.length<=1)return!1;const r=null===(t=n[0])||void 0===t?void 0:t.offsetTop;return"number"==typeof r&&n.some((e=>e.offsetTop!==r))},this.handleResize=()=>{"auto"===this.props.collapsible&&this.checkOverflow()},this.handleItemClick=(e,t)=>{this.props.onTabClick(e,t)},this.handleKeyDown=(e,t,n)=>{this.props.handleKeyDown(e,t,n)},this.renderTabItem=e=>{const{size:t,type:n,deleteTabItem:r,handleKeyDown:i,tabPosition:s}=this.props,o=this._isActive(e.itemKey);return h().createElement(rT,Object.assign({},Gl()(e,["disabled","icon","itemKey","tab","closable"]),{key:this._getBarItemKeyByItemKey(e.itemKey),selected:o,size:t,type:n,tabPosition:s,handleKeyDown:i,deleteTabItem:r,onClick:this.handleItemClick}))},this.scrollTabItemIntoViewByKey=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"nearest",r=arguments.length>2?arguments[2]:void 0;const i=document.querySelector(`[data-uuid="${t.state.uuid}"] .${XO.TABS_TAB}[data-scrollkey="${e}"]`);null==i||i.scrollIntoView({behavior:r||"smooth",block:n,inline:n})},this.scrollActiveTabItemIntoView=(e,t)=>{const n=this._getBarItemKeyByItemKey(this.props.activeKey);this.scrollTabItemIntoViewByKey(n,e,t)},this.renderTabComponents=e=>e.map((e=>this.renderTabItem(e))),this.handleArrowClick=(e,t)=>{const n="start"===t?e.pop():e.shift();if(!n)return;const r=this._getBarItemKeyByItemKey(n.itemKey);this.scrollTabItemIntoViewByKey(r)},this.renderCollapse=(e,t,n)=>{var r;const i=w()({[`${XO.TABS_BAR}-arrow-${n}`]:n,[`${XO.TABS_BAR}-arrow`]:!0});if(Pe()(e))return h().createElement("div",{role:"presentation",className:i},h().createElement(vs,{disabled:!0,icon:t,theme:"borderless"}));const{dropdownClassName:s,dropdownStyle:o,showRestInDropdown:a,dropdownProps:l}=this.props,{rePosKey:c}=this.state,d=!e.length,u=h().createElement(Ww.Menu,null,e.map((e=>{const{icon:t,tab:n,itemKey:r}=e,i=t?this.renderIcon(e.icon):null;return h().createElement(Ww.Item,{key:r,onClick:e=>this.handleItemClick(r,e),active:this._isActive(r)},i,n)}))),p=h().createElement("div",{role:"presentation",className:i,onClick:t=>this.handleArrowClick(e,n)},h().createElement(vs,{disabled:d,icon:t,theme:"borderless"})),f=w()(s,{[`${XO.TABS_BAR}-dropdown`]:!0}),m=null!==(r=null==l?void 0:l[n])&&void 0!==r?r:{};return h().createElement(h().Fragment,null,a?h().createElement(Ww,Object.assign({className:f,clickToHide:!0,clickTriggerToHide:!0,key:`${c}-${n}`,position:"start"===n?"bottomLeft":"bottomRight",render:d?null:u,showTick:!0,style:o,trigger:"hover",disableFocusListener:!0},m),p):p)},this.renderOverflow=e=>e.map(((e,t)=>{const n=0===t?"start":"end",r=0===t?h().createElement(Rl,null):h().createElement(Al,null),i=this.renderCollapse(e,r,n);return this.props.renderArrow?this.props.renderArrow(e,n,(()=>this.handleArrowClick(e,n)),i):i})),this.renderCollapsedTab=()=>{const{list:e}=this.props,t=e.map((e=>{const{itemKey:t}=e;return Object.assign({key:this._getBarItemKeyByItemKey(t),active:this._isActive(t)},e)}));return h().createElement(CC,{items:t,overflowRenderDirection:this.props.arrowPosition,wrapperStyle:this.props.visibleTabsStyle,overflowRenderer:this.renderOverflow,renderMode:"scroll",className:`${XO.TABS_BAR}-overflow-list`,visibleItemRenderer:this.renderTabItem,onVisibleStateChange:e=>{var t,n;const r=new Map;if(e.forEach(((e,t)=>{r.set(this._getItemKeyByBarItemKey(t),e)})),this.isFirstShowInViewport){Array.from(r.values()).some((e=>e))&&(this.scrollActiveTabItemIntoView("nearest","auto"),this.isFirstShowInViewport=!1)}if("auto"===this.props.collapsible){if(Array.from(r.values()).some((e=>e))){const e=Array.from(r.values()).some((e=>!e));e!==this.state.shouldCollapse&&this.setState({shouldCollapse:e})}}null===(n=(t=this.props).onVisibleTabsChange)||void 0===n||n.call(t,r)}})},this.renderWithMoreTrigger=()=>{const{list:e,more:t}=this.props;let n,r=[],i=h().createElement("div",{className:w()({[`${XO.TABS_BAR}-more-trigger`]:!0,[`${XO.TABS_BAR}-more-trigger-${this.props.type}`]:!0})},h().createElement(Jt,{componentName:"Tabs"},((e,t)=>h().createElement("div",{className:`${XO.TABS_BAR}-more-trigger-content`},h().createElement("div",null,e.more),h().createElement(Hc,{className:`${XO.TABS_BAR}-more-trigger-content-icon`})))));if("number"==typeof t)n=e.length-Math.min(t,e.length),r=e.slice(0,n).map((e=>this.renderTabItem(e)));else if("object"==typeof t)n=e.length-Math.min(t.count,e.length),r=e.slice(0,n).map((e=>this.renderTabItem(e))),t.render&&(i=t.render());else if(void 0!==t)throw new Error("[Semi Tabs]: invalid tab props format: more");return h().createElement(h().Fragment,null,r,this.renderMoreDropdown(e.slice(n),null==t?void 0:t.dropdownProps,i))},this.renderMoreDropdown=(e,t,n)=>h().createElement(Ww,Object.assign({trigger:"hover",showTick:!0,position:"bottomLeft",className:`${XO.TABS_BAR}-more-dropdown-${this.props.type}`,clickToHide:!0,menu:e.map((e=>({node:"item",name:e.tab,icon:e.icon,onClick:t=>this.props.onTabClick(e.itemKey,t),active:this.props.activeKey===e.itemKey})))},t),n),this._isActive=e=>e===this.props.activeKey,this._getBarItemKeyByItemKey=e=>`${e}-bar`,this._getItemKeyByBarItemKey=e=>e.replace(/-bar$/,""),this.state={endInd:e.list.length,rePosKey:0,startInd:0,uuid:"",currentVisibleItems:[],shouldCollapse:!1},this.isFirstShowInViewport=!0,this.tabBarRef=(0,d.createRef)()}componentDidMount(){this.setState({uuid:Ke()}),"auto"===this.props.collapsible&&requestAnimationFrame((()=>this.checkOverflow()))}componentDidUpdate(e){if(e.activeKey!==this.props.activeKey){this.getEffectiveCollapsible()&&this.scrollActiveTabItemIntoView()}"auto"===this.props.collapsible&&e.list!==this.props.list&&this.checkOverflow()}renderIcon(e){return h().createElement("span",null,e)}renderExtra(){const{tabBarExtraContent:e,type:t,size:n}=this.props,r={float:"right"},i=e&&e.props?e.props.style:{},s=w()(XO.TABS_BAR_EXTRA,{[`${XO.TABS_BAR}-${t}-extra`]:t,[`${XO.TABS_BAR}-${t}-extra-${n}`]:n});if(e){const t=Object.assign(Object.assign({},r),i);return h().createElement("div",{className:s,style:t,"x-semi-prop":"tabBarExtraContent"},e)}return null}render(){const e=this.props,{type:t,style:n,className:r,list:i,tabPosition:s,more:o,collapsible:a}=e,l=iT(e,["type","style","className","list","tabPosition","more","collapsible"]),c=this.getEffectiveCollapsible(),d=w()(r,{[XO.TABS_BAR]:!0,[XO.TABS_BAR_LINE]:"line"===t,[XO.TABS_BAR_CARD]:"card"===t,[XO.TABS_BAR_BUTTON]:"button"===t,[XO.TABS_BAR_SLASH]:"slash"===t,[`${XO.TABS_BAR}-${s}`]:s,[`${XO.TABS_BAR}-collapse`]:c}),p=this.renderExtra(),f=c?this.renderCollapsedTab():o?this.renderWithMoreTrigger():this.renderTabComponents(i),m=h().createElement("div",Object.assign({role:"tablist","aria-orientation":"left"===s?"vertical":"horizontal",className:d,style:n},u(l),{"data-uuid":this.state.uuid,ref:this.tabBarRef}),f,p);return"auto"===a?h().createElement(Pn,{onResize:this.handleResize},m):m}}sT.propTypes={activeKey:E().string,className:E().string,collapsible:E().oneOfType([E().bool,E().oneOf(["auto"])]),list:E().array,onTabClick:E().func,size:E().oneOf(ZO),style:E().object,tabBarExtraContent:E().node,tabPosition:E().oneOf(JO),type:E().oneOf(YO),closable:E().bool,deleteTabItem:E().func,more:E().oneOfType([E().number,E().object])};const oT=sT,aT=h().createContext({});var lT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class cT extends d.PureComponent{constructor(){super(...arguments),this.ref=(0,d.createRef)(),this.getDirection=(e,t,n,r)=>{if(null!==t&&null!==e&&Array.isArray(n)&&n.length){const i=n.findIndex((t=>t.itemKey===e)),s=n.findIndex((e=>e.itemKey===t)),o=n.findIndex((e=>e.itemKey===r));return i===s?o>i:s<i}return!1},this.shouldRender=()=>{const{itemKey:e}=this.props,{activeKey:t,lazyRender:n}=this.context,r=t===e;return this._active=this._active||r,!n||this._active}}render(){const{tabPaneMotion:e,tabPosition:t,prevActiveKey:n}=this.context,r=this.props,{className:i,style:s,children:o,itemKey:a,tabIndex:l}=r,c=lT(r,["className","style","children","itemKey","tabIndex"]),d=this.context.activeKey===a,p=w()(i,{[XO.TABS_PANE_INACTIVE]:!d,[XO.TABS_PANE_ACTIVE]:d,[XO.TABS_PANE]:!0}),f=this.shouldRender(),m=(()=>{const e=this.getDirection(this.context.activeKey,a,this.context.panes,n);return"top"===t?e?XO.TABS_PANE_ANIMATE_RIGHT_SHOW:XO.TABS_PANE_ANIMATE_LEFT_SHOW:e?XO.TABS_PANE_ANIMATE_BOTTOM_SHOW:XO.TABS_PANE_ANIMATE_TOP_SHOW})(),g=!this.context.panes.find((e=>e.itemKey===n)),y=e&&d&&!g&&!this.context.forceDisableMotion;return h().createElement("div",Object.assign({ref:this.ref,role:"tabpanel",id:`semiTabPanel${a}`,"aria-labelledby":`semiTab${a}`,className:p,style:s,"aria-hidden":d?"false":"true",tabIndex:l||0},u(c),{"x-semi-prop":"children"}),h().createElement(vt,{motion:y,animationState:d?"enter":"leave",startClassName:m},(e=>{let{animationClassName:t,animationEventsNeedBind:n}=e;return h().createElement("div",Object.assign({className:w()(XO.TABS_PANE_MOTION_OVERLAY,t),"x-semi-prop":"children"},n),f?o:null)})))}}cT.isTabPane=!0,cT.contextType=aT,cT.propTypes={className:E().string,style:E().object,children:E().node,disabled:E().bool,itemKey:E().string,tab:E().node,icon:E().node,closable:E().bool};const dT=cT;var hT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const uT=["className","style","disabled","itemKey","tab","icon"];class pT extends f{constructor(e){super(e),this.setContentRef=e=>{this.contentRef={current:e}},this.getPanes=()=>{const{tabList:e,children:t}=this.props;return Array.isArray(e)&&e.length?e:h().Children.map(t,(e=>{if(e){const{tab:t,icon:n,disabled:r,itemKey:i,closable:s}=e.props;return{tab:t,icon:n,disabled:r,itemKey:i,closable:s}}}))},this.onTabClick=(e,t)=>{this.foundation.handleTabClick(e,t)},this.rePosChildren=(e,t)=>{const n=[],r=h().Children.toArray(e);return e.length&&(n.push(...r.filter((e=>e.props&&e.props.itemKey===t))),n.push(...r.filter((e=>e.props&&e.props.itemKey!==t)))),n},this.getActiveItem=()=>{const{activeKey:e}=this.state,{children:t,tabList:n}=this.props;return n||!Array.isArray(t)?t:h().Children.toArray(t).filter((t=>!((0,d.isValidElement)(t)&&t.type&&t.type.isTabPane)||t.props.itemKey===e))},this.deleteTabItem=(e,t)=>{t.stopPropagation(),this.foundation.handleTabDelete(e)},this.foundation=new QO(this.adapter),this.state={activeKey:this.foundation.getDefaultActiveKey(),panes:this.getPanes(),prevActiveKey:null,forceDisableMotion:!1},this.contentRef=(0,d.createRef)(),this.contentHeight="auto"}get adapter(){return Object.assign(Object.assign({},super.adapter),{collectPane:()=>{const e=this.getPanes();this.setState({panes:e})},collectActiveKey:()=>{const{tabList:e,children:t,activeKey:n}=this.props;if(void 0!==n)return;const{activeKey:r}=this.state,i=this.getPanes();-1===i.findIndex((e=>e.itemKey===r))&&(i.length>0?this.setState({activeKey:i[0].itemKey}):this.setState({activeKey:""}))},notifyTabClick:(e,t)=>{this.props.onTabClick(e,t)},notifyChange:e=>{this.props.onChange(e)},setNewActiveKey:e=>{this.setState({activeKey:e})},getDefaultActiveKeyFromChildren:()=>{const{tabList:e,children:t}=this.props;let n="";return(e||h().Children.toArray(t).map((e=>(0,d.isValidElement)(e)?e.props:null))).forEach((e=>{!e||n||e.disabled||(n=e.itemKey)})),n},notifyTabDelete:e=>{this.props.onTabClose&&this.props.onTabClose(e)}})}static getDerivedStateFromProps(e,t){const n={};return Re(e.activeKey)||e.activeKey===t.activeKey||(t.prevActiveKey=t.activeKey,n.activeKey=e.activeKey),n}componentDidUpdate(e,t){const n=h().Children.toArray(e.children).map((e=>Gl()((0,d.isValidElement)(e)?e.props:null,uT))),r=h().Children.toArray(this.props.children).map((e=>Gl()((0,d.isValidElement)(e)?e.props:null,uT))),i=this.props.tabList||e.tabList;if(Oe()(this.props.tabList,e.tabList)||this.foundation.handleTabListChange(),t.activeKey!==this.state.activeKey&&t.activeKey!==this.state.prevActiveKey&&this.setState({prevActiveKey:t.activeKey}),e.activeKey!==this.props.activeKey){const e=(()=>{const e=new Set(n.map((e=>e.itemKey)));return r.map((e=>e.itemKey)).filter((t=>!e.has(t)))})();this.setState({forceDisableMotion:e.includes(this.props.activeKey)})}Oe()(n,r)||i||this.foundation.handleTabPanesChange()}render(){const e=this.props,{children:t,className:n,collapsible:r,contentStyle:i,keepDOM:s,lazyRender:o,renderTabBar:a,showRestInDropdown:l,size:c,style:d,tabBarClassName:u,tabBarExtraContent:p,tabBarStyle:f,tabPaneMotion:m,tabPosition:g,type:y,more:v,onVisibleTabsChange:b,visibleTabsStyle:x,arrowPosition:E,renderArrow:C,dropdownProps:S}=e,_=hT(e,["children","className","collapsible","contentStyle","keepDOM","lazyRender","renderTabBar","showRestInDropdown","size","style","tabBarClassName","tabBarExtraContent","tabBarStyle","tabPaneMotion","tabPosition","type","more","onVisibleTabsChange","visibleTabsStyle","arrowPosition","renderArrow","dropdownProps"]),{panes:k,activeKey:O}=this.state,T=w()(n,{[XO.TABS]:!0,[`${XO.TABS}-${g}`]:g}),P=w()({[XO.TABS_CONTENT]:!0,[`${XO.TABS_CONTENT}-${g}`]:g}),I={activeKey:O,className:u,collapsible:r,list:k,onTabClick:this.onTabClick,showRestInDropdown:l,size:c,style:f,tabBarExtraContent:p,tabPosition:g,type:y,deleteTabItem:this.deleteTabItem,handleKeyDown:this.foundation.handleKeyDown,more:v,onVisibleTabsChange:b,visibleTabsStyle:x,arrowPosition:E,renderArrow:C,dropdownProps:S},M=a?a(I,oT):h().createElement(oT,Object.assign({},I)),R=s?t:this.getActiveItem();return h().createElement("div",Object.assign({className:T,style:d},this.getDataAttr(_)),M,h().createElement(aT.Provider,{value:{activeKey:O,lazyRender:o,panes:k,tabPaneMotion:m,tabPosition:g,prevActiveKey:this.state.prevActiveKey,forceDisableMotion:this.state.forceDisableMotion}},h().createElement("div",{ref:this.setContentRef,className:P,style:Object.assign({},i)},R)))}}pT.TabPane=dT,pT.TabItem=rT,pT.propTypes={activeKey:E().string,className:E().string,collapsible:E().oneOfType([E().bool,E().oneOf(["auto"])]),contentStyle:E().oneOfType([E().object]),defaultActiveKey:E().string,keepDOM:E().bool,lazyRender:E().bool,onChange:E().func,onTabClick:E().func,renderTabBar:E().func,showRestInDropdown:E().bool,size:E().oneOf(ZO),style:E().object,tabBarClassName:E().string,tabBarExtraContent:E().node,tabBarStyle:E().object,tabList:E().array,tabPaneMotion:E().bool,tabPosition:E().oneOf(JO),type:E().oneOf(YO),onTabClose:E().func,preventScroll:E().bool,more:E().oneOfType([E().number,E().object]),arrowPosition:E().string,renderArrow:E().func,dropdownProps:E().object},pT.__SemiComponentName__="Tabs",pT.defaultProps=he(pT.__SemiComponentName__,{children:[],collapsible:!1,keepDOM:!0,lazyRender:!1,onChange:()=>{},onTabClick:()=>{},size:"large",tabPaneMotion:!0,tabPosition:"top",type:"line",onTabClose:()=>{},showRestInDropdown:!0,arrowPosition:"both"});const fT=pT,mT=Bd.PREFIX;class gT extends f{constructor(){super(...arguments),this.decorateChildren=e=>{const t=d.Children.toArray(e).filter((e=>(0,d.isValidElement)(e))).length-1;let n=-1;return d.Children.map(e,(e=>{var r;if(!(0,d.isValidElement)(e))return e;n+=1;const i=w()(null===(r=e.props)||void 0===r?void 0:r.className,{[`${mT}-first`]:0===n,[`${mT}-last`]:n===t});return(0,d.cloneElement)(e,{className:i})}))}}render(){const{children:e,style:t,className:n}=this.props,r=w()(`${mT}-split`,n);return h().createElement("div",{className:r,style:t,role:"group","aria-label":this.props["aria-label"]},this.decorateChildren(e))}}gT.propTypes={style:E().object,className:E().string,children:E().node,"aria-label":E().string},gT.defaultProps={};__webpack_require__("iiC6");const yT={PREFIX:`${C}-timeline`,ITEM:`${C}-timeline-item`},vT=["left","alternate","right","center"],bT=["left","right"],wT=["ongoing","success","warning","error","default"];var xT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const ET=yT.ITEM;class CT extends d.PureComponent{render(){const e=this.props,{className:t,color:n,children:r,dot:i,type:s,style:o,time:a,extra:l,onClick:c}=e,d=xT(e,["className","color","children","dot","type","style","time","extra","onClick"]),p=w()(ET,t),f=w()({[`${ET}-head`]:!0,[`${ET}-head-custom`]:i,[`${ET}-head-${s}`]:s}),m=n?{style:{backgroundColor:n}}:null;return h().createElement("li",Object.assign({className:p,style:o,onClick:c},u(d)),h().createElement("div",{className:`${ET}-tail`,"aria-hidden":!0}),h().createElement("div",Object.assign({className:f,"aria-hidden":!0},m),i),h().createElement("div",{className:`${ET}-content`},r,l&&h().createElement("div",{className:`${ET}-content-extra`},l),a&&h().createElement("div",{className:`${ET}-content-time`},a)))}}CT.propTypes={color:E().string,time:E().node,type:E().oneOf(wT),dot:E().node,extra:E().node,position:E().oneOf(bT),className:E().string,style:E().object,onClick:E().func},CT.defaultProps={type:"default",time:"",onClick:i()};var ST=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const _T=yT.PREFIX;class kT extends d.PureComponent{constructor(){super(...arguments),this.getPosCls=(e,t)=>{const{mode:n}=this.props;return"alternate"===n?e.props.position?`${_T}-item-${e.props.position}`:t%2==0?`${_T}-item-left`:`${_T}-item-right`:"center"===n?e.props.position?`${_T}-item-${e.props.position}`:`${_T}-item-left`:"left"===n||"right"===n?`${_T}-item-${n}`:e.props.position?`${_T}-item-${e.props.position}`:""},this.addClassName=e=>h().Children.map(e,((e,t)=>h().isValidElement(e)?h().cloneElement(e,{className:w()(e.props.className,this.getPosCls(e,t))}):e))}render(){const e=this.props,{children:t,className:n,style:r,mode:i,dataSource:s}=e,o=ST(e,["children","className","style","mode","dataSource"]),a=w()(_T,n,{[`${_T}-${i}`]:i});let l;if(s&&s.length){const e=s.map(((e,t)=>h().createElement(CT,Object.assign({key:`timeline-item-${t}`},e),e.content)));l=this.addClassName(e)}const c=l||this.addClassName(t);return h().createElement("ul",Object.assign({"aria-label":this.props["aria-label"],style:r,className:a},u(o)),c)}}kT.contextType=lt,kT.Item=CT,kT.propTypes={mode:E().oneOf(vT),className:E().string,style:E().object,dataSource:E().array},kT.defaultProps={mode:"left"};const OT=kT,TT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ov.DEFAULT_FORMAT,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Yt;if(e instanceof Date)return e;if("number"==typeof e)return new Date(sE()(e));if("string"==typeof e){if(""===e)return;let r=new Date;return r=Gg(e,t,r,{locale:n}),r}return void 0!==e?new Date:void 0},PT=function(e){return xo(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ov.DEFAULT_FORMAT,{locale:arguments.length>2&&void 0!==arguments[2]?arguments[2]:Yt})},IT=e=>Array.isArray(e)?[...e]:[];const MT=class extends c{constructor(e){super(Object.assign({},e))}init(){this.initDataFromDefaultValue();(this._isControlledComponent("open")?this.getProp("open"):this.getProp("defaultOpen"))&&!this._isControlledComponent("open")&&this._adapter.registerClickOutSide()}getPosition(){const e=this.getProp("position"),t=this.getProp("type")||Ov.DEFAULT_TYPE,n=this.getContext("direction");return e||("rtl"===n?"bottomRight":"")||Ov.DEFAULT_POSITION[t]}getDisabledTimeFns(e,t){const{disabledHours:n,disabledMinutes:r,disabledSeconds:i,disabledTime:s}=this.getProps();if("function"==typeof s&&this._adapter.isRangePicker()){const o=s(t,e)||{};return{disabledHours:o.disabledHours||n,disabledMinutes:o.disabledMinutes||r,disabledSeconds:o.disabledSeconds||i}}return{disabledHours:n,disabledMinutes:r,disabledSeconds:i}}isDisabledHMS(e){let{hours:t,minutes:n,seconds:r}=e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"left",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const{disabledHours:o,disabledMinutes:a,disabledSeconds:l}=this.getDisabledTimeFns(i,s),c=!Re(t)&&((e,t)=>{if("function"==typeof e){const n=e();if(Array.isArray(n)&&!Re(t)&&n.some((e=>sE()(e)===sE()(t))))return!0}return!1})(o,t),d=!Re(t)&&!Re(n)&&((e,t,n)=>{if("function"==typeof e){const r=e(t);if(Array.isArray(r)&&!Re(t)&&!Re(n)&&r.some((e=>sE()(e)===sE()(n))))return!0}return!1})(a,t,n),h=!Re(t)&&!Re(n)&&!Re(r)&&((e,t,n,r)=>{if("function"==typeof e){const i=e(t,n);if(Array.isArray(i)&&!Re(t)&&!Re(n)&&!Re(r)&&i.some((e=>sE()(e)===sE()(r))))return!0}return!1})(l,t,n,r);return c||d||h}isValidTimeZone(e){return["string","number"].includes(typeof e)&&""!==e}getDefaultFormatIfNeed(){return this._isInProps("format")?this.getProp("format"):this.getProp("use12Hours")?Ov.DEFAULT_FORMAT_A:Ov.DEFAULT_FORMAT}initDataFromDefaultValue(){const e=this.getProp("defaultValue");let t=this.getProp("value");const n=this.getProp("timeZone"),r=this.getValidFormat(),{rangeSeparator:i,dateFnsLocale:s}=this.getProps();t=t||e,Array.isArray(t)||(t=t?[t]:[]);const o=[];let a=!1;t.forEach((e=>{const t=TT(e,r,s);isNaN(t.getTime())||o.push(this.isValidTimeZone(n)?cm(t,n):t)}));const l=[!0,!1];o.map(((e,t)=>{l[t]=No(e)<12})),o.length===t.length?t=o:(t=[],t.length&&(a=!0));let c="";a||(c=t.map((e=>PT(e,r,s))).join(i)),this.setState({isAM:l,value:t,inputValue:c,invalid:a})}getValidFormat(e){let t=e;return Re(t)&&(t=this.getDefaultFormatIfNeed()),"string"!=typeof t&&(t=Ov.DEFAULT_FORMAT),t}handlePanelChange(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.getValidFormat(),r=this.getProp("dateFnsLocale"),i=this.getState("value");let s=this.getState("isAM");const o=IT(i);if(s=IT(s),e){const a=Boolean(e.isAM),l=TT(e.timeStampValue,n,r);o[t]=l,s[t]=a;const c=this.formatValue(o);if(this.getState("isAM")[t]!==e.isAM&&this.setState({isAM:s}),!this._isControlledComponent("value")){const e=this.validateDates(o);this.setState({isAM:s,value:o,inputValue:c,invalid:e})}this._hasChanged(o,i)&&this._notifyChange(o,c)}}refreshProps(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{value:t,timeZone:n,__prevTimeZone:r}=e;let i=this.parseValue(t),s=i.some((e=>isNaN(Number(e))));if(!s)if(this.isValidTimeZone(n)&&(i=i.map((e=>cm(this.isValidTimeZone(r)?dm(e,r):e,n)))),this._adapter.isRangePicker())s=i.some(((e,t)=>{const n=1===t?"right":"left";return this.isDisabledHMS({hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()},n,i)}));else{const e=i[0];s=!!e&&this.isDisabledHMS({hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()},"left",i)}const o=this.formatValue(i);this.setState({value:i,invalid:s,inputValue:o})}handleFocus(e){this.getState("open")||this.handlePanelOpen(),this._adapter.notifyFocus(e)}setPanel(e){this._adapter.togglePanel(e)}destroy(){this._adapter.unregisterClickOutSide()}handlePanelOpen(){this._isControlledComponent("open")||(this._adapter.registerClickOutSide(),this.setPanel(!0)),this._adapter.notifyOpenChange(!0)}handlePanelClose(e,t){this._isControlledComponent("open")||(this._adapter.unregisterClickOutSide(),this.setPanel(!1)),this._adapter.notifyOpenChange(!1),this._adapter.notifyBlur(t)}handleVisibleChange(e){this._isControlledComponent("open")||this._adapter.togglePanel(e),this._adapter.notifyOpenChange(e)}handleInputChange(e){this._adapter.setInputValue(e);const t=this.getProp("rangeSeparator"),n=FO()(e,t),r=this.getValidFormat();if(""!==e&&n.some((e=>!((e,t)=>{let n=!0;const r="BDEGHKLMOPQRSTXYabcehimopqstuwxyz",i=new RegExp(`[${r}]`,"g"),s=new RegExp(`[^${r}]`,"g"),o=/[H|m|s]{1,2}/,a=t.split(s),l=t.replace(i,""),c=new RegExp(`[${l}]`,"g"),d=e.split(c);if(a.length!==d.length)n=!1;else for(let e=0,t=d.length;e<t;e++){const t=a[e],r=d[e];if(o.test(t)&&r.length<t.length){n=!1;break}}return n})(e,r))))return;const i=this.parseInput(e),s=this.validateDates(i),o={invalid:s},a=this.getState("value");let l=IT(a);s||(o.value=i,l=[...i]),this._isControlledComponent("value")||this.setState(o),this._hasChanged(l,a)&&this._notifyChange(l,e)}doValidate(e){return"string"==typeof e?this.validateStr(e):Array.isArray(e)?this.validateDates(e):void 0}validateStr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=this.parseInput(e);return this.validateDates(t)}validateDates(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.some((e=>isNaN(Number(e))));if(!t)if(this._adapter.isRangePicker())t=e.some(((t,n)=>{const r=1===n?"right":"left";return this.isDisabledHMS({hours:t.getHours(),minutes:t.getMinutes(),seconds:t.getSeconds()},r,e)}));else{const n=e[0];t=!!n&&this.isDisabledHMS({hours:n.getHours(),minutes:n.getMinutes(),seconds:n.getSeconds()},"left",e)}return t}handleInputBlur(e){const t=this.getState("invalid"),n=this.getState("inputValue"),r=this.getState("value");n?t?this.setState({inputValue:this.formatValue(r),invalid:!1}):this.setState({inputValue:this.formatValue(r)}):this.setState({inputValue:"",value:[],invalid:!1})}formatValue(e){const t=this.getValidFormat(),n=this.getProp("rangeSeparator"),r=this.getProp("dateFnsLocale");let i=e;if(i&&!Array.isArray(i)&&(i=i[i]),i&&Array.isArray(i)){const e=i.map((e=>{let n;return n=_e()(e)?"":PT(e,t,r),n}));return e.join(n)}}parseInput(e){const t=this.getValidFormat(),n=this.getProp("rangeSeparator"),r=this.getProp("dateFnsLocale");return e&&"string"==typeof e?FO()(e,n).map((e=>TT(e,t,r))):[]}parseValue(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.getValidFormat(),n=this.getProp("dateFnsLocale");let r=e;return Array.isArray(r)||(r=r?[r]:[]),Array.isArray(r)?r.map((e=>TT(e,t,n))):[]}_notifyChange(e,t){let n=t,r=e;const i=this.getProp("timeZone");if(this._adapter.isRangePicker()){const e=this.getProp("rangeSeparator");n=FO()(t,e)}else r=Array.isArray(r)?r[0]:r;if(this.isValidTimeZone(i)&&r){const e=this.getValidFormat();Array.isArray(r)?(r=r.map((e=>dm(e,i))),n=r.map((t=>xo(t,e)))):(r=dm(r,i),n=xo(r,e))}this.getProp("onChangeWithDateFirst")?this._adapter.notifyChange(r,n):this._adapter.notifyChange(n,r)}_hasChanged(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=this.getValidFormat(),r=this.getProp("dateFnsLocale");return e.length!==t.length||e.some(((e,i)=>{const s=t[i];return!ks(e)||!ks(s)||PT(e,n,r)!==PT(s,n,r)}))}};const RT=class extends c{constructor(e){super(Object.assign({},e))}init(){}destroy(){}handleFocus(e){this.storeCursor(),this._adapter.notifyFocus(e)}handleChange(e){this.storeCursor(),this._adapter.notifyChange(e)}handleBlur(e){this.clearCursor(),this._adapter.notifyBlur(e)}storeCursor(){const e=this.getCache("inputNode");if(e){const{selectionStart:t}=e;this.setCache("cursorIndex",t)}}restoreCursor(){const e=this.getCache("inputNode"),t=this.getCache("cursorIndex");e&&!Re(t)&&(e.selectionStart=t,e.selectionEnd=t)}clearCursor(){this.setCache("cursorIndex",null),this.setCache("beforeStr",null),this.setCache("afterStr",null)}};var AT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class NT extends f{constructor(e){super(e),this.setRef=e=>this.adapter.setCache("inputNode",e),this.handleClick=e=>this.props.onClick(e),this.handleFocus=e=>this.foundation.handleFocus(e),this.handleBlur=e=>this.foundation.handleBlur(e),this.handleChange=e=>this.foundation.handleChange(e),this.foundation=new RT(this.adapter),this.state={}}componentDidMount(){super.componentDidMount();const{focusOnOpen:e,preventScroll:t}=this.props;if(e){(window.requestAnimationFrame||window.setTimeout)((()=>{const e=this.adapter.getCache("inputNode");e&&(e.focus({preventScroll:t}),e.select())}))}}componentDidUpdate(e){const{timeStampValue:t}=this.props;this.isControlled("timeStampValue")&&t!==this.state.timeStampValue&&this.foundation.restoreCursor(),this.props.value!==e.value&&this.foundation.restoreCursor()}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{notifyChange:function(){return e.props.onChange(...arguments)},notifyFocus:function(){return e.props.onFocus(...arguments)},notifyBlur:function(){return e.props.onBlur(...arguments)}})}getInput(){const e=this.props,{prefixCls:t,placeholder:n,inputReadOnly:r,onFocus:i,disabled:s,type:o,locale:a,localeCode:l,insetLabel:c,validateStatus:d,value:u,onChange:p,invalid:f,format:m,clearText:g,disabledHours:y,disabledMinutes:v,disabledSeconds:b,onEsc:x,defaultOpenValue:E,currentSelectPanel:C,focusOnOpen:S,timeStampValue:_,timeZone:k,defaultOpen:O,dateFnsLocale:T}=e,P=AT(e,["prefixCls","placeholder","inputReadOnly","onFocus","disabled","type","locale","localeCode","insetLabel","validateStatus","value","onChange","invalid","format","clearText","disabledHours","disabledMinutes","disabledSeconds","onEsc","defaultOpenValue","currentSelectPanel","focusOnOpen","timeStampValue","timeZone","defaultOpen","dateFnsLocale"]),I=w()(`${t}-input`,{[`${t}-input-invalid`]:f,[`${t}-input-readonly`]:r}),M=f?"error":d;return h().createElement(kr,Object.assign({},P,{hideSuffix:!0,className:I,ref:this.setRef,value:u,placeholder:n||a.placeholder[o],readonly:Boolean(r),onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur,suffix:h().createElement(cb,{onClick:this.handleClick}),validateStatus:M,disabled:s,insetLabel:c}))}render(){const{prefixCls:e}=this.props;return h().createElement("div",{className:`${e}-input-wrap`},this.getInput())}}NT.propTypes={borderless:E().bool,format:E().string,prefixCls:E().string,placeholder:E().string,clearText:E().string,inputReadOnly:E().bool,hourOptions:E().array,minuteOptions:E().array,secondOptions:E().array,disabledHours:E().func,disabledMinutes:E().func,disabledSeconds:E().func,onChange:E().func,onFocus:E().func,onBlur:E().func,onEsc:E().func,onClick:E().func,defaultOpenValue:E().object,currentSelectPanel:E().string,focusOnOpen:E().bool,timeStampValue:E().any,locale:E().object,localeCode:E().string,insetLabel:E().node,validateStatus:E().string,preventScroll:E().bool},NT.defaultProps={borderless:!1,inputReadOnly:!1,onChange:i(),onBlur:i(),onFocus:i(),onClick:i(),disabledHours:i(),disabledMinutes:i(),disabledSeconds:i(),format:Ov.DEFAULT_FORMAT};const DT=NT,LT={panelHeader:E().oneOfType([E().node,E().string]),panelFooter:E().oneOfType([E().node,E().string])},FT=[E().string,E().number,E().instanceOf(Date)],jT=E().oneOfType([...FT,E().arrayOf(E().string),E().arrayOf(E().number),E().arrayOf(E().instanceOf(Date))]);__webpack_require__("x6Mr");var $T=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class BT extends f{constructor(e){var t;super(e),t=this,this.onCurrentSelectPanelChange=e=>{this.setState({currentSelectPanel:e})},this.handlePanelChange=(e,t)=>this.foundation.handlePanelChange(e,t),this.handleInput=e=>this.foundation.handleInputChange(e),this.createPanelProps=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{panels:n,panelFooter:r,panelHeader:i,locale:s}=t.props,a={panelHeader:i,panelFooter:r};if(t.adapter.isRangePicker()){const t={0:s.begin,1:s.end};a.panelHeader=o()(n,e,Re(i)?o()(t,e,null):Array.isArray(i)?i[e]:i),a.panelFooter=o()(n,e,Array.isArray(r)?r[e]:r)}return a},this.handlePanelVisibleChange=e=>this.foundation.handleVisibleChange(e),this.openPanel=()=>{this.foundation.handlePanelOpen()},this.handleFocus=e=>{this.foundation.handleFocus(e)},this.handleBlur=e=>this.foundation.handleInputBlur(e),this.setTimePickerRef=e=>this.timePickerRef.current=e;const{format:n=Ov.DEFAULT_FORMAT}=e;this.state={open:e.open||e.defaultOpen||!1,value:[],inputValue:"",currentSelectPanel:0,isAM:[!0,!1],showHour:Boolean(n.match(/HH|hh|H|h/g)),showMinute:Boolean(n.match(/mm/g)),showSecond:Boolean(n.match(/ss/g)),invalid:void 0},this.foundation=new MT(this.adapter),this.timePickerRef=h().createRef(),this.savePanelRef=h().createRef(),this.useCustomTrigger="function"==typeof this.props.triggerRender}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{togglePanel:e=>{this.setState({open:e})},registerClickOutSide:()=>{this.clickOutSideHandler&&this.adapter.unregisterClickOutSide(),this.clickOutSideHandler=e=>{const t=this.savePanelRef&&this.savePanelRef.current,n=this.timePickerRef&&this.timePickerRef.current,r=e.target,i=e.composedPath&&e.composedPath()||[r];t&&t.contains(r)||n&&n.contains(r)||i.includes(n)||i.includes(t)||this.foundation.handlePanelClose(!0,e)},document.addEventListener("mousedown",this.clickOutSideHandler)},setInputValue:(e,t)=>this.setState({inputValue:e},t),unregisterClickOutSide:()=>{this.clickOutSideHandler&&(document.removeEventListener("mousedown",this.clickOutSideHandler),this.clickOutSideHandler=null)},notifyOpenChange:function(){return e.props.onOpenChange(...arguments)},notifyChange:(e,t)=>this.props.onChange&&this.props.onChange(e,t),notifyFocus:function(){return e.props.onFocus&&e.props.onFocus(...arguments)},notifyBlur:function(){return e.props.onBlur&&e.props.onBlur(...arguments)},isRangePicker:()=>this.props.type===Ov.TYPE_TIME_RANGE_PICKER})}static getDerivedStateFromProps(e,t){return"open"in e&&e.open!==t.open?{open:e.open}:null}componentDidUpdate(e){this.isControlled("value")&&this.props.value!==e.value?this.foundation.refreshProps(Object.assign({},this.props)):this.props.timeZone!==e.timeZone&&this.foundation.refreshProps({timeZone:this.props.timeZone,__prevTimeZone:e.timeZone,value:this.state.value})}getDisabledTimeOptions(e){const{disabledTime:t}=this.props,{value:n}=this.state;if("function"==typeof t&&this.adapter.isRangePicker())return t(n,e)}getPanelElement(){const{prefixCls:e,type:t,disabledHours:n,disabledMinutes:r,disabledSeconds:i}=this.props,{isAM:s,value:o}=this.state,a=this.foundation.getDefaultFormatIfNeed(),l=this.getDisabledTimeOptions("left")||{},c=this.getDisabledTimeOptions("right")||{},d=[h().createElement(tb,Object.assign({},this.props,{key:0,format:a,isAM:s[0],timeStampValue:o[0],prefixCls:`${e}-panel`,onChange:e=>this.handlePanelChange(e,0),onCurrentSelectPanelChange:this.onCurrentSelectPanelChange,disabledHours:l.disabledHours||n,disabledMinutes:l.disabledMinutes||r,disabledSeconds:l.disabledSeconds||i},this.createPanelProps(0)))];t===Ov.TYPE_TIME_RANGE_PICKER&&d.push(h().createElement(tb,Object.assign({},this.props,{key:1,format:a,isAM:s[1],timeStampValue:o[1],prefixCls:`${e}-panel`,onChange:e=>this.handlePanelChange(e,1),onCurrentSelectPanelChange:this.onCurrentSelectPanelChange,disabledHours:c.disabledHours||n,disabledMinutes:c.disabledMinutes||r,disabledSeconds:c.disabledSeconds||i},this.createPanelProps(1))));const u=w()({[kv.RANGE_PANEL_LISTS]:this.adapter.isRangePicker()});return h().createElement("div",{ref:this.savePanelRef,className:u},d.map((e=>e)))}getPopupClassName(){const{use12Hours:e,prefixCls:t,popupClassName:n}=this.props,{showHour:r,showMinute:i,showSecond:s}=this.state;let o=0;return r&&(o+=1),i&&(o+=1),s&&(o+=1),e&&(o+=1),w()(`${t}-panel`,n,{[`${t}-panel-narrow`]:!(r&&i&&s||e),[kv.RANGE_PICKER]:this.adapter.isRangePicker()},`${t}-panel-column-${o}`)}focus(){}blur(){}render(){const e=this.props,{prefixCls:t,placeholder:n,disabled:r,defaultValue:i,dropdownMargin:s,className:o,popupStyle:a,size:l,style:c,locale:d,localeCode:u,zIndex:p,getPopupContainer:f,insetLabel:m,insetLabelId:g,inputStyle:y,showClear:v,panelHeader:b,panelFooter:x,rangeSeparator:E,onOpenChange:C,onChangeWithDateFirst:S,popupClassName:_,hideDisabledOptions:k,use12Hours:O,minuteStep:T,hourStep:P,secondStep:I,scrollItemProps:M,triggerRender:R,motion:A,autoAdjustOverflow:N,stopPropagation:D}=e,L=$T(e,["prefixCls","placeholder","disabled","defaultValue","dropdownMargin","className","popupStyle","size","style","locale","localeCode","zIndex","getPopupContainer","insetLabel","insetLabelId","inputStyle","showClear","panelHeader","panelFooter","rangeSeparator","onOpenChange","onChangeWithDateFirst","popupClassName","hideDisabledOptions","use12Hours","minuteStep","hourStep","secondStep","scrollItemProps","triggerRender","motion","autoAdjustOverflow","stopPropagation"]),F=this.foundation.getDefaultFormatIfNeed(),j=this.foundation.getPosition(),{open:$,inputValue:B,invalid:V,value:z}=this.state,H=this.getPopupClassName(),U=w()({[`${t}-header`]:!0}),K=w()({[`${t}-panel`]:!0,[`${t}-panel-${l}`]:l}),W=Object.assign(Object.assign({},L),{disabled:r,prefixCls:t,size:l,showClear:!r&&v,style:y,value:B,onFocus:this.handleFocus,insetLabel:m,insetLabelId:g,format:F,locale:d,localeCode:u,invalid:V,placeholder:n,onChange:this.handleInput,onBlur:this.handleBlur}),G={};return this.useCustomTrigger&&(G.onClick=this.openPanel),h().createElement("div",Object.assign({ref:this.setTimePickerRef,className:w()({[t]:!0},o),style:c},G),h().createElement(Cn,{getPopupContainer:f,zIndex:p,prefixCls:K,contentClassName:H,style:a,content:this.getPanelElement(),trigger:"custom",position:j,visible:!r&&Boolean($),motion:A,margin:s,autoAdjustOverflow:N,stopPropagation:D},this.useCustomTrigger?h().createElement(Pr,{triggerRender:R,disabled:r,value:z,inputValue:B,onChange:this.handleInput,placeholder:n,componentName:"TimePicker",componentProps:Object.assign({},this.props)}):h().createElement("span",{className:U},h().createElement(DT,Object.assign({},W)))))}}BT.contextType=lt,BT.propTypes=Object.assign(Object.assign({"aria-labelledby":E().string,"aria-invalid":E().bool,"aria-errormessage":E().string,"aria-describedby":E().string,"aria-required":E().bool,prefixCls:E().string,borderless:E().bool,clearText:E().string,clearIcon:E().node,value:jT,inputReadOnly:E().bool,disabled:E().bool,showClear:E().bool,defaultValue:jT,open:E().bool,defaultOpen:E().bool,onOpenChange:E().func,position:E().any,getPopupContainer:E().func,placeholder:E().string,format:E().string,style:E().object,className:E().string,popupClassName:E().string,popupStyle:E().object,disabledHours:E().func,disabledMinutes:E().func,disabledSeconds:E().func,disabledTime:E().func,dropdownMargin:E().oneOfType([E().number,E().object]),hideDisabledOptions:E().bool,onChange:E().func,use12Hours:E().bool,hourStep:E().number,minuteStep:E().number,secondStep:E().number,focusOnOpen:E().bool,autoFocus:E().bool,size:E().oneOf(Ov.SIZE),stopPropagation:E().bool,panels:E().arrayOf(E().shape(LT)),onFocus:E().func,onBlur:E().func,locale:E().object,localeCode:E().string,dateFnsLocale:E().object,zIndex:E().oneOfType([E().number,E().string]),insetLabel:E().node,insetLabelId:E().string,validateStatus:E().oneOf(Ov.STATUS),type:E().oneOf(Ov.TYPES),rangeSeparator:E().string,triggerRender:E().func,timeZone:E().oneOfType([E().string,E().number]),scrollItemProps:E().object,motion:E().oneOfType([E().bool,E().func,E().object]),autoAdjustOverflow:E().bool},LT),{inputStyle:E().object,preventScroll:E().bool}),BT.defaultProps=Object.assign({autoAdjustOverflow:!0,borderless:!1,getPopupContainer:()=>document.body,showClear:!0,zIndex:gn.DEFAULT_Z_INDEX,rangeSeparator:Ov.DEFAULT_RANGE_SEPARATOR,onOpenChange:i(),clearText:"clear",prefixCls:kv.PREFIX,inputReadOnly:!1,style:{},stopPropagation:!0,className:"",popupClassName:"",popupStyle:{left:"0px",top:"0px"},disabledHours:()=>[],disabledMinutes:()=>[],disabledSeconds:()=>[],hideDisabledOptions:!1,onFocus:i(),onBlur:i(),onChange:i(),onChangeWithDateFirst:!0,use12Hours:!1,focusOnOpen:!1,onKeyDown:i(),size:"default",type:Ov.DEFAULT_TYPE,motion:!0},{});class VT extends h().PureComponent{render(){const{type:e}=this.props;return h().createElement(lt.Consumer,null,(t=>{let{timeZone:n}=t;return h().createElement(Jt,{componentName:"TimePicker"},((t,r,i)=>h().createElement(BT,Object.assign({timeZone:n,placeholder:o()(t,["placeholder",e])},this.props,{locale:t,localeCode:r,dateFnsLocale:i}))))}))}}VT.propTypes=BT.propTypes,VT.__SemiComponentName__="TimePicker",VT.defaultProps=he(VT.__SemiComponentName__,BT.defaultProps);class zT extends c{constructor(e){super(Object.assign(Object.assign({},zT.defaultAdapter),e)),this.handleMouseInSideChange=e=>{this._adapter.handleMouseInSideChange(e)},this.getInputWrapperRect=()=>this._adapter.getInputWrapperRect()}hasToast(e){return this._adapter.getState("list").map((e=>{let{id:t}=e;return t})).includes(e)}addToast(e){const t=this._adapter.getState("list");t.push(e),this._adapter.updateToast(t,[],[])}updateToast(e,t){let n=this._adapter.getState("list");n=n.map((n=>n.id===e?Object.assign(Object.assign({},n),t):n));const r=n.filter((t=>t.id===e));this._adapter.updateToast(n,[],r)}removeToast(e){let t=this._adapter.getState("list");const n=[];t=t.filter((t=>t.id!==e||(n.push(t),!1))),this._adapter.updateToast(t,n,[])}destroyAll(){const e=this._adapter.getState("list");e.length>0&&this._adapter.updateToast([],e,[])}}const HT=`${C}-toast`,UT={PREFIX:HT,WRAPPER:`${HT}-wrapper`,LIST:`${HT}-list`},KT={types:["warning","success","info","error","default"],themes:["normal","light"],directions:["ltr","rtl"]};class WT extends c{constructor(e){super(Object.assign(Object.assign({},WT.defaultAdapter),e)),this._timer=null,this._id=null}init(){this.startCloseTimer_(),this._id=this._adapter.getProp("id")}destroy(){this.clearCloseTimer_()}startCloseTimer_(){const e=this._adapter.getProp("duration");e&&er()(e)&&(this._timer=setTimeout((()=>{this.close()}),1e3*e))}close(e){e&&e.stopPropagation(),this._adapter.notifyWrapperToRemove(this._id),this._adapter.notifyClose()}clearCloseTimer_(){this._timer&&(clearTimeout(this._timer),this._timer=null)}restartCloseTimer(){this.clearCloseTimer_(),this.startCloseTimer_()}}const GT=UT.PREFIX;class qT extends f{constructor(e){super(e),this.toastEle=h().createRef(),this.clearCloseTimer=()=>{this.foundation.clearCloseTimer_()},this.startCloseTimer=()=>{this.foundation.startCloseTimer_()},this.restartCloseTimer=()=>{this.foundation.restartCloseTimer()},this.state={},this.foundation=new WT(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyWrapperToRemove:e=>{this.props.close(e)},notifyClose:()=>{this.props.onClose()}})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}close(e){this.foundation.close(e)}renderIcon(){const{type:e,icon:t}=this.props,n={warning:h().createElement(Qi,null),success:h().createElement(es,null),info:h().createElement(ts,null),error:h().createElement(ns,null)}[e],r="large",i=w()(`${GT}-icon`,`${GT}-icon-${e}`);return t?oe(t)?h().cloneElement(t,{size:r,className:`${GT}-icon`}):t:e&&n?h().cloneElement(n,{size:r,className:i}):null}render(){const{content:e,type:t,theme:n,showClose:r,textMaxWidth:i,className:s,style:o}=this.props,a=this.props.direction||this.context.direction,l=w()(GT,s,{[`${GT}-${t}`]:!0,[`${GT}-${n}`]:"light"===n,[`${GT}-rtl`]:"rtl"===a}),c={};c.maxWidth=i;const d=this.props.positionInList?this.props.positionInList.length-this.props.positionInList.index-1:0,u=h().createElement("div",{ref:this.toastEle,role:"alert","aria-label":`${t||"default"} type`,className:l,style:Object.assign(Object.assign({},o),{transform:`translate3d(0,0,${-10*d}px)`}),onMouseEnter:this.clearCloseTimer,onMouseLeave:this.startCloseTimer,onAnimationStart:this.props.onAnimationStart,onAnimationEnd:this.props.onAnimationEnd},h().createElement("div",{className:`${GT}-content`},this.renderIcon(),h().createElement("span",{className:`${GT}-content-text`,style:c,"x-semi-prop":"content"},e),r&&h().createElement("div",{className:`${GT}-close-button`},h().createElement(ji,{onClick:e=>this.close(e),type:"tertiary",icon:h().createElement(Ji,{"x-semi-prop":"icon"}),theme:"borderless",size:"small"}))));if(this.props.stack){const e=this.props.stackExpanded&&this.toastEle.current&&getComputedStyle(this.toastEle.current).height||0;return h().createElement("div",{className:`${GT}-zero-height-wrapper`,style:{height:e}},u)}return u}}qT.contextType=lt,qT.propTypes={onClose:E().func,content:E().node,close:E().func,duration:E().number,theme:E().oneOf(KT.themes),type:E().oneOf(KT.types),textMaxWidth:E().oneOfType([E().string,E().number]),style:E().object,className:E().string,showClose:E().bool,stack:E().bool,stackExpanded:E().bool,icon:E().node,direction:E().oneOf(KT.directions)},qT.__SemiComponentName__="Toast",qT.defaultProps=he(qT.__SemiComponentName__,{onClose:i(),content:"",close:i(),duration:3,textMaxWidth:450,showClose:!0,stack:!1,stackExpanded:!1,theme:"normal"});const XT=qT;__webpack_require__("36if");var YT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const ZT=(e,t)=>{var{afterClose:n}=e,r=YT(e,["afterClose"]);const[i,s]=(0,d.useState)(!0);return h().useImperativeHandle(t,(()=>({close:()=>{s(!1)}}))),(0,d.useEffect)((()=>{i||n(r.id)}),[i]),i?h().createElement(XT,Object.assign({},r,{close:()=>{s(!1)}})):null},JT=h().forwardRef(ZT),QT={motion:!0,zIndex:1010,duration:3};function eP(){const[e,t]=function(){const[e,t]=h().useState([]);return[e,function(e,n){return t((t=>[{element:e,config:n},...t])),e=>{t((t=>t.filter((t=>{let{config:n}=t;return n.id!==e}))))}}]}(),n=(0,d.useRef)(new Map),r=e=>{const r=Ue("semi_toast_"),s=Object.assign(Object.assign({},e),{id:r});let o;const a=h().createElement(JT,Object.assign({},s,{key:r,afterClose:e=>o(e),ref:e=>{var t;n.current.set(r,{close:null!==(t=null==e?void 0:e.close)&&void 0!==t?t:i()})}}));return o=t(a,Object.assign({},s)),r};return[{success:e=>r(Object.assign(Object.assign(Object.assign({},QT),e),{type:"success"})),info:e=>r(Object.assign(Object.assign(Object.assign({},QT),e),{type:"info"})),error:e=>r(Object.assign(Object.assign(Object.assign({},QT),e),{type:"error"})),warning:e=>r(Object.assign(Object.assign(Object.assign({},QT),e),{type:"warning"})),open:e=>r(Object.assign(Object.assign(Object.assign({},QT),e),{type:"default"})),close:e=>(e=>{var t;const{close:r}=null!==(t=n.current.get(e))&&void 0!==t?t:{};null==r||r()})(e)},h().createElement(h().Fragment,null,Array.isArray(e)&&e.length?h().createElement(h().Fragment,null,e.map((e=>e.element))):null)]}const tP=()=>{var e;return e=class e extends f{constructor(e){super(e),this.stack=!1,this.innerWrapperRef=h().createRef(),this.handleMouseEnter=e=>{this.stack&&this.foundation.handleMouseInSideChange(!0)},this.handleMouseLeave=e=>{var t;if(this.stack){(null===(t=this.foundation.getInputWrapperRect())||void 0===t?void 0:t.height)&&this.foundation.handleMouseInSideChange(!1)}},this.state={list:[],removedItems:[],updatedItems:[],mouseInSide:!1},this.foundation=new zT(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{updateToast:(e,t,n)=>{this.setState({list:e,removedItems:t,updatedItems:n})},handleMouseInSideChange:e=>{this.setState({mouseInSide:e})},getInputWrapperRect:()=>{var e;return null===(e=this.innerWrapperRef.current)||void 0===e?void 0:e.getBoundingClientRect()}})}static create(t){var n,r,i;const s=null!==(n=t.id)&&void 0!==n?n:Ue("toast"),o=(null===(i=null===(r=null==te?void 0:te.config)||void 0===r?void 0:r.overrideDefaultProps)||void 0===i?void 0:i.Toast)||{},a=Object.assign(Object.assign(Object.assign({},e.defaultOpts),o),t);if(e.ref){const t=document.querySelector(`#${this.wrapperId}`);["top","left","bottom","right"].map((e=>{e in a&&(t.style[e]="number"==typeof a[e]?`${a[e]}px`:a[e])})),Boolean(a.stack)!==e.ref.stack&&(e.ref.stack=Boolean(a.stack)),e.ref.has(s)?e.ref.update(s,Object.assign(Object.assign({},a),{id:s})):e.ref.add(Object.assign(Object.assign({},a),{id:s}))}else{const n=document.createElement("div");if(this.wrapperId||(this.wrapperId=Ue("toast-wrapper").slice(0,26)),n.className=UT.WRAPPER,n.id=this.wrapperId,n.style.zIndex=String("number"==typeof t.zIndex?t.zIndex:a.zIndex),["top","left","bottom","right"].map((e=>{if(e in a){const t=a[e];n.style[e]="number"==typeof t?`${t}px`:t}})),a.getPopupContainer){a.getPopupContainer().appendChild(n)}else document.body.appendChild(n);it(h().createElement(e,{ref:t=>{t&&(e.ref=t,t.add(Object.assign(Object.assign({},a),{id:s})),t.stack=Boolean(a.stack))}}),n)}return s}static close(t){e.ref&&e.ref.remove(t)}static destroyAll(){var t;if(e.ref){e.ref.destroyAll();const n=document.querySelector(`#${this.wrapperId}`);n&&(st(n),null===(t=n.parentNode)||void 0===t||t.removeChild(n)),e.ref=null,this.wrapperId=null}}static getWrapperId(){return this.wrapperId}static info(t){var n,r;"string"==typeof t&&(t={content:t});const i=(null===(r=null===(n=null==te?void 0:te.config)||void 0===n?void 0:n.overrideDefaultProps)||void 0===r?void 0:r.Toast)||{};return this.create(Object.assign(Object.assign(Object.assign(Object.assign({},e.defaultOpts),i),t),{type:"info"}))}static warning(t){var n,r;"string"==typeof t&&(t={content:t});const i=(null===(r=null===(n=null==te?void 0:te.config)||void 0===n?void 0:n.overrideDefaultProps)||void 0===r?void 0:r.Toast)||{};return this.create(Object.assign(Object.assign(Object.assign(Object.assign({},e.defaultOpts),i),t),{type:"warning"}))}static error(t){var n,r;"string"==typeof t&&(t={content:t});const i=(null===(r=null===(n=null==te?void 0:te.config)||void 0===n?void 0:n.overrideDefaultProps)||void 0===r?void 0:r.Toast)||{};return this.create(Object.assign(Object.assign(Object.assign(Object.assign({},e.defaultOpts),i),t),{type:"error"}))}static success(t){var n,r;"string"==typeof t&&(t={content:t});const i=(null===(r=null===(n=null==te?void 0:te.config)||void 0===n?void 0:n.overrideDefaultProps)||void 0===r?void 0:r.Toast)||{};return this.create(Object.assign(Object.assign(Object.assign(Object.assign({},e.defaultOpts),i),t),{type:"success"}))}static config(t){["top","left","bottom","right"].forEach((n=>{n in t&&(e.defaultOpts[n]=t[n])})),"string"==typeof t.theme&&KT.themes.includes(t.theme)&&(e.defaultOpts.theme=t.theme),"number"==typeof t.zIndex&&(e.defaultOpts.zIndex=t.zIndex),"number"==typeof t.duration&&(e.defaultOpts.duration=t.duration),"function"==typeof t.getPopupContainer&&(e.defaultOpts.getPopupContainer=t.getPopupContainer)}has(e){return this.foundation.hasToast(e)}add(e){return this.foundation.addToast(e)}update(e,t){return this.foundation.updateToast(e,t)}remove(e){return this.foundation.removeToast(e)}destroyAll(){return this.foundation.destroyAll()}render(){let{list:e}=this.state;const{removedItems:t,updatedItems:n}=this.state;e=Array.from(new Set([...e,...t]));const r=n.map((e=>{let{id:t}=e;return t})),i=e=>{var t;(null===(t=null==e?void 0:e.foundation)||void 0===t?void 0:t._id)&&r.includes(e.foundation._id)&&e.foundation.restartCloseTimer()};return h().createElement(h().Fragment,null,h().createElement("div",{className:w()({[`${UT.PREFIX}-innerWrapper`]:!0,[`${UT.PREFIX}-innerWrapper-hover`]:this.state.mouseInSide}),ref:this.innerWrapperRef,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},e.map(((n,r)=>{const s=void 0!==t.find((e=>e.id===n.id)),o=s?"leave":"enter";return h().createElement(vt,{key:n.id,motion:n.motion,animationState:o,startClassName:s?`${UT.PREFIX}-animation-hide`:`${UT.PREFIX}-animation-show`,onAnimationEnd:e=>{"leave"===o&&this.setState((e=>{var t;return(null===(t=e.removedItems)||void 0===t?void 0:t.some((e=>e.id===n.id)))?Object.assign(Object.assign({},e),{removedItems:e.removedItems.filter((e=>e.id!==n.id))}):null}))}},(t=>{let{animationClassName:s,animationEventsNeedBind:o,isAnimating:a}=t;return h().createElement(XT,Object.assign({},n,{stack:this.stack,stackExpanded:this.state.mouseInSide,positionInList:{length:e.length,index:r},className:w()({[n.className]:Boolean(n.className),[s]:!0})},o,{style:Object.assign({},n.style),close:e=>this.remove(e),ref:i}))}))}))))}},e.defaultOpts={motion:!0,zIndex:1010,content:""},e.propTypes={content:E().node,duration:E().number,onClose:E().func,icon:E().node,direction:E().oneOf(KT.directions),stack:E().bool},e.defaultProps={},e};class nP{static create(e){const t=tP();return t.useToast=eP,e&&t.config(e),t}}const rP=nP.create();class iP extends c{constructor(e){super(Object.assign({},e)),this.clearDragState=()=>{this._adapter.updateState({dragOverNodeKey:"",dragging:!1})},this.throttledDragOverUpdate=g()((e=>{this._adapter.updateState({dropPosition:e})}),16)}destroy(){super.destroy(),this.throttledDragOverUpdate&&this.throttledDragOverUpdate.cancel(),this.delayedDragEnterLogic&&(Object.keys(this.delayedDragEnterLogic).forEach((e=>{clearTimeout(this.delayedDragEnterLogic[e])})),this.delayedDragEnterLogic=null)}_isMultiple(){return this.getProp("multiple")}_isAnimated(){return this.getProp("motion")}_isDisabled(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getProp("disabled")||e.disabled}_isExpandControlled(){return!_e()(this.getProp("expandedKeys"))}_isLoadControlled(){return!_e()(this.getProp("loadedKeys"))}_isFilterable(){return Boolean(this.getProp("filterTreeNode"))}_showFilteredOnly(){const{inputValue:e}=this.getStates(),{showFilteredOnly:t}=this.getProps();return Boolean(e)&&t}getTreeNodeProps(e){const{expandedKeys:t=new Set([]),selectedKeys:n=[],checkedKeys:r=new Set([]),halfCheckedKeys:i=new Set([]),realCheckedKeys:s=new Set([]),keyEntities:o={},filteredKeys:a=new Set([]),inputValue:l="",loadedKeys:c=new Set([]),loadingKeys:d=new Set([]),filteredExpandedKeys:h=new Set([]),disabledKeys:u=new Set([])}=this.getStates(),{treeNodeFilterProp:p,checkRelation:f}=this.getProps(),m=o[e];if(!m)return null;let g=!1,y=!1;"related"===f?(g=r.has(e),y=i.has(e)):"unRelated"===f&&(g=s.has(e),y=!1);const v={eventKey:e,expanded:Boolean(l)?h.has(e):t.has(e),selected:n.includes(e),checked:g,halfChecked:y,pos:String(m?m.pos:""),level:m.level,filtered:a.has(e),loading:d.has(e)&&!c.has(e),loaded:c.has(e),keyword:l,treeNodeFilterProp:p};return this.getProp("disableStrictly")&&u.has(e)&&(v.disabled=!0),v}notifyJsonChange(e,t){const n=this.getProp("treeDataSimpleJson"),r=(i=e,Array.isArray(i)?i:[i]).map((e=>e.replaceAll(ec,".")));var i;const s=Gl()(n,r);this._adapter.notifyChange(s)}constructDataForValue(e){const{keyMaps:t}=this.getProps(),n=o()(t,"key","key"),r=o()(t,"label","label");return{[n]:e,[r]:e}}findDataForValue(e){const{value:t,defaultValue:n,keyMaps:r}=this.getProps(),i=o()(r,"value","value"),s=o()(r,"key","key");let a=[];return t?a=Array.isArray(t)?t:[t]:n&&(a=Array.isArray(n)?n:[n]),a.find((t=>t[i]===e||t[s]===e))}getDataForKeyNotInKeyEntities(e){const{onChangeWithObject:t}=this.getProps();return t?this.findDataForValue(e):this.constructDataForValue(e)}notifyMultipleChange(e,t){const{keyEntities:n}=this.getStates(),{leafOnly:r,checkRelation:i,keyMaps:s,autoMergeValue:o}=this.getProps();let a,l=[];"related"===i?l=o?fc(e,n,r,!0):e:"unRelated"===i&&(l=e);const c=l.map((e=>n[e]?n[e].data:this.getDataForKeyNotInKeyEntities(e)));a=this.getProp("onChangeWithObject")?c:bc(c,s),this._adapter.notifyChange(a)}notifyChange(e,t){const n=this._isMultiple(),{keyMaps:r}=this.getProps(),{keyEntities:i}=this.getStates();if(this.getProp("treeDataSimpleJson"))this.notifyJsonChange(e,t);else if(n)this.notifyMultipleChange(e,t);else{let t;if(this.getProp("onChangeWithObject"))t=o()(i,e).data;else{const{data:n}=o()(i,e);t=bc(n,r)}this._adapter.notifyChange(t)}}handleInputChange(e){this._adapter.updateInputValue(e);const{expandedKeys:t,selectedKeys:n,keyEntities:r,treeData:i}=this.getStates(),{showFilteredOnly:s,filterTreeNode:a,treeNodeFilterProp:l,keyMaps:c}=this.getProps(),d="label"!==l?l:o()(c,"label","label");let h=[],u=[],p=[],f=new Set([]);if(e){h=Object.values(r).filter((t=>pc(e,t.data,a,d))).map((e=>e.key)),u=lc(h,r,!1);const t=oc(h,r,!0);f=new Set([...t,...u]),p=rc(i,new Set(u),c,s&&f)}else u=lc(n,r),u.forEach((e=>t.add(e))),p=rc(i,t,c);const m=new Set(u);this._adapter.notifySearch(e,Array.from(m)),this._adapter.updateState({expandedKeys:t,flattenNodes:p,motionKeys:new Set([]),filteredKeys:new Set(h),filteredExpandedKeys:m,filteredShownKeys:f})}handleNodeSelect(e,t){this._isDisabled(t)||(this._isMultiple()?this.handleMultipleSelect(e,t):this.handleSingleSelect(e,t))}handleNodeRightClick(e,t){this._adapter.notifyRightClick(e,t.data)}handleNodeDoubleClick(e,t){this._adapter.notifyDoubleClick(e,t.data)}handleSingleSelect(e,t){let n=[...this.getState("selectedKeys")];const{selected:r,eventKey:i,data:s}=t,o=!r;this._adapter.notifySelect(i,!0,s),o&&(n.includes(i)||(n=[i],this.notifyChange(i,e),this._isControlledComponent()||this._adapter.updateState({selectedKeys:n})))}calcCheckedKeys(e,t){const{keyEntities:n}=this.getStates(),r=new Set(this.getState("checkedKeys")),i=new Set(this.getState("halfCheckedKeys"));return t?gc(e,n,r,i):yc(e,n,r,i)}calcCheckedStatus(e,t){if(!e)return e;const{checkedKeys:n,keyEntities:r,disabledKeys:i}=this.getStates(),s=fc(oc([t],r,!1),r,!0),o=s.some((e=>i.has(e)));if(!o)return e;const a=s.filter((e=>!i.has(e))),l=a.every((e=>n.has(e)));return!l}calcNonDisabledCheckedKeys(e,t){const{keyEntities:n,disabledKeys:r}=this.getStates(),i=new Set(this.getState("checkedKeys")),s=fc(oc([e],n,!1),n,!0),o=s.some((e=>r.has(e)));if(!o)return this.calcCheckedKeys(e,t);const a=s.filter((e=>!r.has(e)));return cc(t?[...a,...i]:Kl()(fc([...i],n,!0,!0),a),n)}handleMultipleSelect(e,t){const{disableStrictly:n,checkRelation:r}=this.getProps(),{realCheckedKeys:i}=this.getStates(),{checked:s,eventKey:o,data:a}=t;if("related"===r){const t=n?this.calcCheckedStatus(!s,o):!s,{checkedKeys:r,halfCheckedKeys:i}=n?this.calcNonDisabledCheckedKeys(o,t):this.calcCheckedKeys(o,t);this._adapter.notifySelect(o,t,a),this.notifyChange([...r],e),this._isControlledComponent()||this._adapter.updateState({checkedKeys:r,halfCheckedKeys:i})}else if("unRelated"===r){const t=new Set(i);let n;i.has(o)?(t.delete(o),n=!1):(t.add(o),n=!0),this._adapter.notifySelect(o,n,a),this.notifyChange([...t],e),this._isControlledComponent()||this._adapter.updateState({realCheckedKeys:t})}}setExpandedStatus(e){const{inputValue:t,treeData:n,filteredShownKeys:r,keyEntities:i}=this.getStates(),{keyMaps:s}=this.getProps(),o=Boolean(t),a=this._showFilteredOnly(),l=o?"filteredExpandedKeys":"expandedKeys",c=new Set(this.getState(l));let d="show";const{eventKey:h,expanded:u,data:p}=e;if(u?c.has(h)&&(c.delete(h),d="hide"):c.add(h),this._adapter.cacheFlattenNodes("hide"===d&&this._isAnimated()),!this._isExpandControlled()){const e=rc(n,c,s,o&&a&&r);let t=this._isAnimated()?mc(h,c,i):[];o&&a&&(t=t.filter((e=>r.has(e))));const u={[l]:c,flattenNodes:e,motionKeys:new Set(t),motionType:d};this._adapter.updateState(u)}return{expandedKeys:c,expanded:!u,data:p}}handleNodeExpand(e,t){const{loadData:n}=this.getProps();if(!(n||t.children&&t.children.length))return;const{expandedKeys:r,data:i,expanded:s}=this.setExpandedStatus(t);this._adapter.notifyExpand(r,{expanded:s,node:i})}handleNodeLoad(e,t,n,r){const{loadData:i,onLoad:s}=this.getProps(),{key:o}=n;return!i||e.has(o)||t.has(o)?{}:(i(n).then((()=>{const e=new Set(this.getState("loadedKeys")),t=new Set(this.getState("loadingKeys")),i=e.add(o),a=new Set([...t]);a.delete(o),s&&s(i,n),this._isLoadControlled()||this._adapter.updateState({loadedKeys:i}),this._adapter.setState({loadingKeys:a}),r()})),{loadingKeys:t.add(o)})}getDragEventNodeData(e){return Object.assign(Object.assign({},e.data),Gl()(e,["expanded","pos","children"]))}triggerDragEvent(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=this.getProp(e);i&&i(Object.assign({event:t,node:this.getDragEventNodeData(n)},r))}handleNodeDragStart(e,t){const{keyEntities:n}=this.getStates(),{hideDraggingNode:r,renderDraggingNode:i}=this.getProps(),{eventKey:s,nodeInstance:o,data:a}=t;if(r||i){let t;"function"==typeof i?t=i(o,a):r&&(t=o.cloneNode(!0),t.style.opacity=0),document.body.appendChild(t),e.dataTransfer.setDragImage(t,0,0)}this._adapter.setDragNode(t),this._adapter.updateState({dragging:!0,dragNodesKeys:new Set(Sc(s,n))}),this.triggerDragEvent("onDragStart",e,t)}handleNodeDragEnter(e,t,n){const{dragging:r,dragNodesKeys:i}=this.getStates(),{autoExpandWhenDragEnter:s}=this.getProps(),{pos:o,eventKey:a,expanded:l}=t;if(!n||i.has(a))return;const c=Cc(e,t);n.eventKey!==a||0!==c?setTimeout((()=>{this._adapter.updateState({dragOverNodeKey:a,dropPosition:c}),s&&!l?(this.delayedDragEnterLogic||(this.delayedDragEnterLogic={}),Object.keys(this.delayedDragEnterLogic).forEach((e=>{clearTimeout(this.delayedDragEnterLogic[e])})),this.delayedDragEnterLogic[o]=window.setTimeout((()=>{if(!r)return;const{expandedKeys:n}=this.setExpandedStatus(t);this.triggerDragEvent("onDragEnter",e,t,{expandedKeys:[...n]})}),400)):this.triggerDragEvent("onDragEnter",e,t)}),0):this._adapter.updateState({dragOverNodeKey:"",dropPosition:null})}handleNodeDragOver(e,t,n){const{dropPosition:r,dragNodesKeys:i,dragOverNodeKey:s}=this.getStates(),{eventKey:o}=t;if(!i.has(o)){if(n&&o===s){const n=Cc(e,t);if(r===n)return;this.throttledDragOverUpdate(n)}this.triggerDragEvent("onDragOver",e,t)}}handleNodeDragLeave(e,t){this.throttledDragOverUpdate.cancel(),this._adapter.updateState({dragOverNodeKey:""}),this.triggerDragEvent("onDragLeave",e,t)}handleNodeDragEnd(e,t){this.throttledDragOverUpdate.flush(),this.clearDragState(),this.triggerDragEvent("onDragEnd",e,t),this._adapter.setDragNode(null)}handleNodeDrop(e,t,n){this.throttledDragOverUpdate.flush();const{dropPosition:r,dragNodesKeys:i}=this.getStates(),{eventKey:s,pos:o}=t;if(this.clearDragState(),i.has(s))return;const a={dragNode:n?this.getDragEventNodeData(n):null,dragNodesKeys:[...i],dropPosition:_c(o,r),dropToGap:0!==r};this.triggerDragEvent("onDrop",e,t,a),this._adapter.setDragNode(null)}}function sP(e){return J()(e,(e=>xb()(e)&&!e._innerDataTag||h().isValidElement(e)?e:void 0))}const oP=Jl.PREFIX;class aP extends d.PureComponent{constructor(e){super(e),this._onResize=e=>{const t=e&&e[1]&&e[1].target;if(t){const e=o()(t,"offsetHeight")||0,n=window.getComputedStyle(t)||{},r=parseInt(o()(n,"paddingTop"),10)||0,i=parseInt(o()(n,"paddingBottom"),10)||0,s=e-r-i;this.state.height!==s&&this.setState({height:e-r-i})}},this.state={height:this.props.defaultHeight||0}}componentDidMount(){const{height:e}=this.state}render(){const{children:e,defaultWidth:t,defaultHeight:n}=this.props,{height:r}=this.state;let i=!1;return 0!==r&&"number"==typeof r||(i=!0),h().createElement(Pn,{observeParent:!0,onResize:this._onResize},h().createElement("div",{style:{height:n,overflow:"visible"},className:`${oP}-auto-wrapper`},!i&&e({height:r,width:t})))}}aP.propTypes={defaultHeight:E().oneOfType([E().number,E().string]),defaultWidth:E().oneOfType([E().number,E().string])},aP.defaultProps={defaultHeight:"100%",defaultWidth:"100%"};const lP=h().createContext(null);const cP=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2a1 1 0 0 0-1-1H6a2 2 0 0 0-2 2v18c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V10a1 1 0 0 0-1-1h-5a2 2 0 0 1-2-2V2ZM7 8a1 1 0 0 1 1-1h1a1 1 0 0 1 0 2H8a1 1 0 0 1-1-1Zm0 5a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Zm1 4a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2H8Zm11.07-9.5H14.5a1 1 0 0 1-1-1V1.93a.8.8 0 0 1 1.37-.56l4.76 4.76a.8.8 0 0 1-.56 1.37Z",fill:"currentColor"}))}),"file");const dP=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5a3 3 0 0 1 3-3h3.3a2 2 0 0 1 1.25.44l1.13.9a3 3 0 0 0 1.87.66H18c2 0 3 2 3 4H7.53A2 2 0 0 0 5.6 9.48L2.57 20.76C2.21 20.26 2 19.66 2 19V5Zm20.17 5H9.5a2 2 0 0 0-1.92 1.44l-2.7 9.28A1 1 0 0 0 5.82 22H18.5a2 2 0 0 0 1.92-1.44l2.7-9.28a1 1 0 0 0-.95-1.28Z",fill:"currentColor"}))}),"folder_open");const hP=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M5 2a3 3 0 0 0-3 3v3h20c0-2-1-4-3-4h-6.45a3 3 0 0 1-1.87-.66l-1.13-.9A2 2 0 0 0 8.3 2H5Z",fill:"currentColor"}),d.createElement("path",{d:"M22 10H2v9a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-9Z",fill:"currentColor"}))}),"folder"),uP=e=>{let{prefixcls:t,level:n,isEnd:r,showLine:i}=e;const s=`${t}-indent-unit`,o=[];for(let e=0;e<n;e+=1)o.push(d.createElement("span",{key:e,className:w()(s,{[`${s}-end`]:r[e]})}));return d.createElement("span",{"aria-hidden":"true",className:w()(`${t}-indent`,{[`${t}-indent-show-line`]:i})},o)},pP=d.memo(uP);var fP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const mP=Jl.PREFIX_OPTION;class gP extends d.PureComponent{constructor(e){super(e),this.onSelect=e=>{const{onNodeSelect:t}=this.context;t(e,this.props)},this.onExpand=e=>{const{onNodeExpand:t}=this.context;e&&e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),t(e,this.props)},this.onCheck=e=>{var t,n;if(this.isDisabled())return;const{onNodeCheck:r}=this.context;e.stopPropagation(),null===(n=null===(t=e.nativeEvent)||void 0===t?void 0:t.stopImmediatePropagation)||void 0===n||n.call(t),r(e,this.props)},this.handleCheckEnterPress=e=>{dn(e)&&this.onCheck(e)},this.onContextMenu=e=>{const{onNodeRightClick:t}=this.context;t(e,this.props)},this.onClick=e=>{const{expandAction:t}=this.context;"doubleClick"!==t?(this.onSelect(e),"click"===t&&this.onExpand(e)):this.debounceSelect(e)},this.handleliEnterPress=e=>{dn(e)&&this.onClick(e)},this.onDoubleClick=e=>{const{expandAction:t,onNodeDoubleClick:n}=this.context;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),ye()(n)&&n(e,this.props),"doubleClick"===t&&this.onExpand(e)},this.onDragStart=e=>{const{onNodeDragStart:t}=this.context;e.stopPropagation(),t(e,Object.assign(Object.assign({},this.props),{nodeInstance:this.refNode}));try{e.dataTransfer.setData("text/plain","")}catch(e){}},this.onDragEnter=e=>{const{onNodeDragEnter:t}=this.context;e.preventDefault(),e.stopPropagation(),t(e,Object.assign(Object.assign({},this.props),{nodeInstance:this.refNode}))},this.onDragOver=e=>{const{onNodeDragOver:t}=this.context;e.preventDefault(),e.stopPropagation(),t(e,Object.assign(Object.assign({},this.props),{nodeInstance:this.refNode}))},this.onDragLeave=e=>{const{onNodeDragLeave:t}=this.context;e.stopPropagation(),t(e,Object.assign(Object.assign({},this.props),{nodeInstance:this.refNode}))},this.onDragEnd=e=>{const{onNodeDragEnd:t}=this.context;e.stopPropagation(),t(e,Object.assign(Object.assign({},this.props),{nodeInstance:this.refNode}))},this.onDrop=e=>{const{onNodeDrop:t}=this.context;e.preventDefault(),e.stopPropagation(),t(e,Object.assign(Object.assign({},this.props),{nodeInstance:this.refNode}))},this.getNodeChildren=()=>{const{children:e}=this.props;return e||[]},this.isLeaf=()=>{const{isLeaf:e,loaded:t}=this.props,{loadData:n}=this.context,r=0!==this.getNodeChildren().length;return!1!==e&&(e||!n&&!r||n&&t&&!r)},this.isDisabled=()=>{const{disabled:e}=this.props,{treeDisabled:t}=this.context;return!1!==e&&Boolean(t||e)},this.renderSwitcher=()=>this.isLeaf()?h().createElement("span",{className:w()(`${mP}-switcher`)},h().createElement("span",{className:`${mP}-switcher-leaf-line`})):null,this.renderRealLabel=()=>{const{renderLabel:e}=this.context,{label:t,keyword:n,data:r,filtered:i,treeNodeFilterProp:s}=this.props;return ye()(e)?e(t,r,n):xe()(t)&&i&&n?h().createElement(Nr,{highlightClassName:`${mP}-highlight`,component:"span",sourceString:t,searchWords:[n]}):t},this.setRef=e=>{this.refNode=e},this.state={},this.debounceSelect=v()(this.onSelect,500,{leading:!0,trailing:!1})}renderArrow(){var e,t;const n=!this.isLeaf(),{loading:r,expanded:i,showLine:s,expandIcon:o}=this.props;if(r)return h().createElement(dr,{wrapperClassName:`${mP}-spin-icon`});if(n){if(o){if("function"==typeof o)return o({onClick:this.onExpand,className:`${mP}-expand-icon`,expanded:i});if(h().isValidElement(o)){const n=w()(`${mP}-expand-icon`,{[null===(e=null==o?void 0:o.props)||void 0===e?void 0:e.className]:null===(t=null==o?void 0:o.props)||void 0===t?void 0:t.className});return h().cloneElement(o,{onClick:this.onExpand,className:n})}return o}return h().createElement(eO,{role:"button","aria-label":(i?"Expand":"Collapse")+" the tree item",className:`${mP}-expand-icon`,size:"small",onClick:this.onExpand})}return s?this.renderSwitcher():h().createElement("span",{className:`${mP}-empty-icon`})}renderCheckbox(){const{checked:e,halfChecked:t,eventKey:n}=this.props,r=this.isDisabled();return h().createElement("div",{role:"none",onClick:this.onCheck,onKeyPress:this.handleCheckEnterPress},h().createElement(od,{"aria-label":"Toggle the checked state of checkbox",value:n,indeterminate:t,checked:e,disabled:Boolean(r)}))}renderIcon(){const{directory:e,treeIcon:t}=this.context,{expanded:n,icon:r,data:i}=this.props;if(r)return r;if(t)return"function"==typeof t?t(this.props):t;if(e){return!this.isLeaf()?n?h().createElement(dP,{className:`${mP}-item-icon`}):h().createElement(hP,{className:`${mP}-item-icon`}):h().createElement(cP,{className:`${mP}-item-icon`})}return null}renderEmptyNode(){const{emptyContent:e}=this.props,t=w()(mP,{[`${mP}-empty`]:!0});return h().createElement("ul",{className:t},h().createElement("li",{className:`${mP}-label ${mP}-label-empty`,"x-semi-prop":"emptyContent"},e))}render(){const e=this.props,{eventKey:t,expanded:n,selected:r,checked:i,halfChecked:s,loading:a,active:l,level:c,empty:d,filtered:u,treeNodeFilterProp:p,display:f,style:m,isEnd:g,showLine:y}=e,v=fP(e,["eventKey","expanded","selected","checked","halfChecked","loading","active","level","empty","filtered","treeNodeFilterProp","display","style","isEnd","showLine"]);if(d)return this.renderEmptyNode();const{multiple:b,draggable:x,renderFullLabel:E,dragOverNodeKey:C,dropPosition:S,labelEllipsis:_}=this.context,k=g[g.length-1],O=this.isDisabled(),T=C===t&&0===S,P=C===t&&-1===S,I=C===t&&1===S,M=w()(mP,{[`${mP}-level-${c+1}`]:!0,[`${mP}-fullLabel-level-${c+1}`]:E,[`${mP}-collapsed`]:!n,[`${mP}-disabled`]:Boolean(O),[`${mP}-selected`]:r,[`${mP}-active`]:!b&&l,[`${mP}-ellipsis`]:_,[`${mP}-drag-over`]:!O&&T,[`${mP}-draggable`]:!O&&x&&!E,[`${mP}-fullLabel-draggable`]:!O&&x&&E,[`${mP}-fullLabel-drag-over-gap-top`]:!O&&P&&E,[`${mP}-fullLabel-drag-over-gap-bottom`]:!O&&I&&E,[`${mP}-tree-node-last-leaf`]:k}),R={onClick:this.onClick,onContextMenu:this.onContextMenu,onDoubleClick:this.onDoubleClick,className:M,onExpand:this.onExpand,data:v.data,level:c,onCheck:this.onCheck,style:m,expandIcon:this.renderArrow(),checkStatus:{checked:i,halfChecked:s},expandStatus:{expanded:n,loading:a},filtered:u,searchWord:v.keyword},A={onDoubleClick:this.onDoubleClick,onDragStart:x?this.onDragStart:void 0,onDragEnter:x?this.onDragEnter:void 0,onDragOver:x?this.onDragOver:void 0,onDragLeave:x?this.onDragLeave:void 0,onDrop:x?this.onDrop:void 0,onDragEnd:x?this.onDragEnd:void 0,draggable:!O&&x||void 0};if(E){const e=E(Object.assign({},R));return x?h().cloneElement(e,Object.assign({ref:this.setRef},A)):Pe()(m)?e:h().cloneElement(e,{style:Object.assign(Object.assign({},o()(e,["props","style"])),m)})}const N=w()(`${mP}-label`,{[`${mP}-drag-over-gap-top`]:!O&&P,[`${mP}-drag-over-gap-bottom`]:!O&&I}),D=o()(v,["data","children","length"]),L=xe()(v.pos)?Number(v.pos.split("-")[c+1])+1:1;return h().createElement("li",Object.assign({className:M,role:"treeitem","aria-disabled":O,"aria-checked":i,"aria-selected":r,"aria-setsize":D,"aria-posinset":L,"aria-expanded":n,"aria-level":c+1,"data-key":t,onClick:this.onClick,onKeyPress:this.handleliEnterPress,onContextMenu:this.onContextMenu,onDoubleClick:this.onDoubleClick,ref:this.setRef,style:m},A),h().createElement(pP,{showLine:y,prefixcls:mP,level:c,isEnd:g}),this.renderArrow(),h().createElement("span",{className:N},b?this.renderCheckbox():null,this.renderIcon(),h().createElement("span",{className:`${mP}-label-text`},this.renderRealLabel())))}}gP.contextType=lP,gP.propTypes={expanded:E().bool,selected:E().bool,checked:E().bool,halfChecked:E().bool,active:E().bool,disabled:E().bool,loaded:E().bool,loading:E().bool,isLeaf:E().bool,pos:E().string,children:E().oneOfType([E().array,E().object]),icon:E().node,directory:E().bool,keyword:E().string,treeNodeFilterProp:E().string,selectedKey:E().string,motionKey:E().oneOfType([E().string,E().arrayOf(E().string)]),isEnd:E().arrayOf(E().bool),showLine:E().bool,expandIcon:E().oneOfType([E().node,E().func])},gP.defaultProps={selectedKey:"",motionKey:""};var yP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const vP=function(e){const{open:t,children:n}=e,r=yP(e,["open","children"]),[i,s]=(0,d.useState)(e.open);return(0,d.useEffect)((()=>{setTimeout((()=>{s(!e.open)}),0)}),[]),h().createElement(vf,Object.assign({},r,{isOpen:i}),n)},bP=e=>e.key;class wP extends d.PureComponent{constructor(e){super(e),this.onMotionEnd=()=>{"function"==typeof this.props.onMotionEnd&&this.props.onMotionEnd(),this.setState({transitionNodes:[]})},this.state={transitionNodes:[]}}static getDerivedStateFromProps(e,t){const{flattenNodes:n=[],motionKeys:r,motionType:i,flattenList:s=[]}=e,o=!Oe()(t.cachedMotionKeys,r)||!Oe()(t.cachedData.map((e=>e.key)),n.map((e=>e.key))),a=[...r];if(!o||!a.length)return null;const l=[],c=[];let d=0,h={};return("hide"===i&&s?s:n).forEach(((e,t)=>{const n=bP(e);r.has(n)?(c.push(e),n===a[0]&&(d=t)):l.push(e)})),l.splice(d,0,c),h={transitionNodes:l,cachedData:n,cachedMotionKeys:r,cachedMotionType:i},h}render(){const{flattenNodes:e,motionType:t,searchTargetIsDeep:n,renderTreeNode:r}=this.props,{transitionNodes:i}=this.state,s=(i.length&&!n?i:e).map((e=>{const n=Array.isArray(e);if(n&&!e.length)return null;if(n&&e.length){const n=bP(e[0]);return h().createElement(vP,{open:"hide"===t,duration:200,motion:Boolean(t),key:`motion-${n}`,onMotionEnd:this.onMotionEnd},e.map((e=>r(e))))}return r(e)}));return s}}wP.contextType=lP;__webpack_require__("+Ta2");var xP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const EP=Jl.PREFIX,CP={key:E().string,value:E().oneOfType([E().string,E().number]),label:E().any,isLeaf:E().bool,children:E().array};CP.children=E().arrayOf(E().shape(CP));class SP extends f{constructor(e){super(e),this.search=e=>{this.foundation.handleInputChange(e)},this.scrollTo=e=>{var t;const{key:n,align:r="center"}=e,{flattenNodes:i}=this.state;if(n){const e=null==i?void 0:i.findIndex((e=>e.key===n));e>=0&&(null===(t=this.virtualizedListRef.current)||void 0===t||t.scrollToItem(e,r))}},this.renderEmpty=()=>{const{emptyContent:e}=this.props;return e?h().createElement(gP,{empty:!0,emptyContent:this.props.emptyContent}):h().createElement(Jt,{componentName:"Tree"},(e=>h().createElement(gP,{empty:!0,emptyContent:o()(e,"emptyText")})))},this.onNodeSelect=(e,t)=>{this.foundation.handleNodeSelect(e,t)},this.onNodeLoad=e=>new Promise((t=>{this.setState((n=>{let{loadedKeys:r=new Set([]),loadingKeys:i=new Set([])}=n;return this.foundation.handleNodeLoad(r,i,e,t)}))})),this.onNodeCheck=(e,t)=>{this.foundation.handleNodeSelect(e,t)},this.onNodeExpand=(e,t)=>{this.foundation.handleNodeExpand(e,t)},this.onNodeRightClick=(e,t)=>{this.foundation.handleNodeRightClick(e,t)},this.onNodeDoubleClick=(e,t)=>{this.foundation.handleNodeDoubleClick(e,t)},this.onNodeDragStart=(e,t)=>{this.foundation.handleNodeDragStart(e,t)},this.onNodeDragEnter=(e,t)=>{this.foundation.handleNodeDragEnter(e,t,this.dragNode)},this.onNodeDragOver=(e,t)=>{this.foundation.handleNodeDragOver(e,t,this.dragNode)},this.onNodeDragLeave=(e,t)=>{this.foundation.handleNodeDragLeave(e,t)},this.onNodeDragEnd=(e,t)=>{this.foundation.handleNodeDragEnd(e,t)},this.onNodeDrop=(e,t)=>{this.foundation.handleNodeDrop(e,t,this.dragNode)},this.getTreeNodeRequiredProps=()=>{const{expandedKeys:e,selectedKeys:t,checkedKeys:n,halfCheckedKeys:r,keyEntities:i,filteredKeys:s}=this.state;return{expandedKeys:e||new Set,selectedKeys:t||[],checkedKeys:n||new Set,halfCheckedKeys:r||new Set,filteredKeys:s||new Set,keyEntities:i}},this.getTreeNodeKey=e=>{const{data:t}=e,{key:n}=t;return n},this.renderTreeNode=(e,t,n)=>{const{data:r,key:i}=e,s=this.foundation.getTreeNodeProps(i);if(!s)return null;const{keyMaps:a,showLine:l,expandIcon:c}=this.props,d=Gl()(e,["key","label","disabled","isLeaf","icon","isEnd"]),u=r[o()(a,"children","children")];return!_e()(u)&&(d.children=u),h().createElement(gP,Object.assign({},s,r,d,{showLine:l,data:r,expandIcon:c,style:Pe()(n)?{}:n}))},this.itemKey=(e,t)=>t[e].key,this.option=e=>{let{index:t,style:n,data:r}=e;return this.renderTreeNode(r[t],t,n)},this.state={inputValue:"",keyEntities:{},treeData:[],flattenNodes:[],selectedKeys:[],checkedKeys:new Set,halfCheckedKeys:new Set,realCheckedKeys:new Set([]),motionKeys:new Set([]),motionType:"hide",expandedKeys:new Set(e.expandedKeys),filteredKeys:new Set,filteredExpandedKeys:new Set,filteredShownKeys:new Set,prevProps:null,loadedKeys:new Set,loadingKeys:new Set,cachedFlattenNodes:void 0,cachedKeyValuePairs:{},disabledKeys:new Set,dragging:!1,dragNodesKeys:new Set,dragOverNodeKey:null,dropPosition:null},this.inputRef=h().createRef(),this.optionsRef=h().createRef(),this.foundation=new iP(this.adapter),this.dragNode=null,this.virtualizedListRef=h().createRef()}static getDerivedStateFromProps(e,t){var n;const{prevProps:r}=t,{keyMaps:i}=e;let s,a=t.keyEntities||{},l=t.cachedKeyValuePairs||{};const c=Boolean(e.filterTreeNode&&t.inputValue&&t.inputValue.length),d={prevProps:e},h="expandedKeys"in e,u=t=>{const n=!r&&t in e,i=r&&!Oe()(r[t],e[t]);return n||i},p=u("treeDataSimpleJson"),f=(()=>{const t=!r&&"treeData"in e,n=r&&r.treeData!==e.treeData;return t||n})(),m=(()=>{if(!r&&"treeData"in e)return!0;if(r){return!((e,t)=>{if(e===t)return!0;if(!e||!t)return e===t;if(e.length!==t.length)return!1;const n=o()(i,"key","key"),r=o()(i,"value","value"),s=o()(i,"children","children"),a=(e,t)=>{if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++){const o=e[i],l=t[i];if(o[n]!==l[n]||o[r]!==l[r])return!1;const c=o[s]||[],d=l[s]||[];if(c.length!==d.length)return!1;if(c.length>0&&!a(c,d))return!1}return!0};return a(e,t)})(r.treeData,e.treeData)}return!1})();if(f){s=e.treeData,d.treeData=s;const t=ic(s,i);d.keyEntities=Object.assign({},t.keyEntities),a=d.keyEntities,d.cachedKeyValuePairs=Object.assign({},t.valueEntities),l=d.cachedKeyValuePairs}else if(p){s=function(e){const t=[],n=(e,t,r,i)=>{const s=[...r,e],o={key:s.join(ec),label:e,value:t};if(z()(t)){const e=[];Object.entries(t).forEach((t=>{n(t[0],t[1],s,e)})),o.children=e}i.push(o)};return Object.entries(e).forEach((e=>n(e[0],e[1],[],t))),t}(e.treeDataSimpleJson),d.treeData=s;const t=ic(s,i);d.keyEntities=Object.assign({},t.keyEntities),a=d.keyEntities,d.cachedKeyValuePairs=Object.assign({},t.valueEntities),l=d.cachedKeyValuePairs}const g=p||m;g&&e.motion&&r&&e.motion&&(d.motionKeys=new Set([]),d.motionType=null);const y=g,v=y&&e.expandAll;if(c){let n;if(s&&(n=vc({treeData:s,inputValue:t.inputValue,filterTreeNode:e.filterTreeNode,filterProps:e.treeNodeFilterProp,showFilteredOnly:e.showFilteredOnly,keyEntities:d.keyEntities,prevExpandedKeys:[...t.filteredExpandedKeys],keyMaps:i}),d.flattenNodes=n.flattenNodes,d.motionKeys=new Set([]),d.filteredKeys=n.filteredKeys,d.filteredShownKeys=n.filteredShownKeys,d.filteredExpandedKeys=n.filteredExpandedKeys),e.expandedKeys){if(d.filteredExpandedKeys=dc(e.expandedKeys,a,e.autoExpandParent||!r),r&&e.motion){const n=t?t.filteredExpandedKeys:new Set([]);if(!s){const r=uc(n,d.filteredExpandedKeys,a);let{motionKeys:i}=r;const{motionType:s}=r;e.showFilteredOnly&&(i=i.filter((e=>t.filteredShownKeys.has(e)))),"hide"===s&&(d.cachedFlattenNodes=sP(t.flattenNodes)),d.motionKeys=new Set(i),d.motionType=s}}d.flattenNodes=rc(s||t.treeData,d.filteredExpandedKeys||t.filteredExpandedKeys,i,e.showFilteredOnly&&t.filteredShownKeys)}}else{if(u("expandedKeys")||r&&u("autoExpandParent")){if(d.expandedKeys=dc(e.expandedKeys,a,e.autoExpandParent||!r),r&&e.motion&&!s){const{motionKeys:e,motionType:n}=uc(t.expandedKeys,d.expandedKeys,a);d.motionKeys=new Set(e),d.motionType=n,"hide"===n&&(d.cachedFlattenNodes=sP(t.flattenNodes))}}else!r&&(e.defaultExpandAll||e.expandAll)||v?d.expandedKeys=new Set(Object.keys(a)):!r&&e.defaultExpandedKeys?d.expandedKeys=dc(e.defaultExpandedKeys,a):!r&&e.defaultValue?d.expandedKeys=hc(e.defaultValue,a,e.multiple,l):!r&&e.value?d.expandedKeys=hc(e.value,a,e.multiple,l):!h&&y&&e.value&&(t.treeData&&(null===(n=t.treeData)||void 0===n?void 0:n.length)>0&&e.loadData||(d.expandedKeys=hc(e.value,a,e.multiple,l)));if(d.expandedKeys||delete d.expandedKeys,s||d.expandedKeys){const e=rc(s||t.treeData,d.expandedKeys||t.expandedKeys,i);d.flattenNodes=e}}const b=e.onChangeWithObject,w=e.multiple;if(w){let n;if(u("value")?n=sc(wc(e.value,b,i),l,w):!r&&e.defaultValue?n=sc(wc(e.defaultValue,b,i),l,w):s&&(n=e.value?sc(wc(e.value,b,i)||[],l,w):xc("related"===e.checkRelation?t.checkedKeys:t.realCheckedKeys,a)),n)if("unRelated"===e.checkRelation)d.realCheckedKeys=new Set(n);else if("related"===e.checkRelation){const{checkedKeys:e,halfCheckedKeys:t}=cc(n,a);d.checkedKeys=e,d.halfCheckedKeys=t}}else u("value")?d.selectedKeys=sc(wc(e.value,b,i),l,w):!r&&e.defaultValue?d.selectedKeys=sc(wc(e.defaultValue,b,i),l,w):s&&e.value&&(d.selectedKeys=sc(wc(e.value,b,i)||"",l,w));return u("loadedKeys")&&(d.loadedKeys=new Set(e.loadedKeys)),s&&e.disableStrictly&&"related"===e.checkRelation&&(d.disabledKeys=Ec(a,i)),d}get adapter(){const e={updateInputValue:e=>{this.setState({inputValue:e})},focusInput:()=>{const{preventScroll:e}=this.props;this.inputRef&&this.inputRef.current&&this.inputRef.current.focus({preventScroll:e})}};return Object.assign(Object.assign(Object.assign({},super.adapter),e),{updateState:e=>{this.setState(Object.assign({},e))},notifyExpand:(e,t)=>{let{expanded:n,node:r}=t;this.props.onExpand&&this.props.onExpand([...e],{expanded:n,node:r}),n&&this.props.loadData&&this.onNodeLoad(r)},notifySelect:(e,t,n)=>{this.props.onSelect&&this.props.onSelect(e,t,n)},notifyChange:e=>{this.props.onChange&&this.props.onChange(e)},notifySearch:(e,t)=>{this.props.onSearch&&this.props.onSearch(e,t)},notifyRightClick:(e,t)=>{this.props.onContextMenu&&this.props.onContextMenu(e,t)},notifyDoubleClick:(e,t)=>{this.props.onDoubleClick&&this.props.onDoubleClick(e,t)},cacheFlattenNodes:e=>{this.setState({cachedFlattenNodes:e?sP(this.state.flattenNodes):void 0})},setDragNode:e=>{this.dragNode=e}})}renderInput(){const{searchClassName:e,searchStyle:t,searchRender:n,searchPlaceholder:r,showClear:i}=this.props;if(!1===n)return null;const s=w()(`${EP}-input`),{inputValue:a}=this.state,l={value:a,className:s,onChange:e=>this.search(e),prefix:h().createElement(WC,null),showClear:i,placeholder:r},c=w()(`${EP}-search-wrapper`,e);return h().createElement("div",{className:c,style:t},h().createElement(Jt,{componentName:"Tree"},(e=>(l.placeholder=r||o()(e,"searchPlaceholder"),ye()(n)?n(Object.assign({},l)):h().createElement(kr,Object.assign({"aria-label":"Filter Tree",ref:this.inputRef},l))))))}renderNodeList(){const{flattenNodes:e,cachedFlattenNodes:t,motionKeys:n,motionType:r}=this.state,{virtualize:i,motion:s}=this.props,{direction:o}=this.context;if(!Pe()(e))return!i||Pe()(i)?h().createElement(wP,{flattenNodes:e,flattenList:t,motionKeys:s?n:new Set([]),motionType:r,onMotionEnd:this.onMotionEnd,renderTreeNode:this.renderTreeNode}):h().createElement(aP,{defaultHeight:i.height,defaultWidth:i.width},(t=>{let{height:n,width:r}=t;return h().createElement(Ld,{ref:this.virtualizedListRef,itemCount:e.length,itemSize:i.itemSize,height:n,width:r,itemKey:this.itemKey,itemData:e,className:`${EP}-virtual-list`,style:{direction:o}},this.option)}))}render(){const{keyEntities:e,motionKeys:t,motionType:n,inputValue:r,filteredKeys:i,dragOverNodeKey:s,dropPosition:o,checkedKeys:a,realCheckedKeys:l}=this.state,c=this.props,{blockNode:d,className:u,style:p,filterTreeNode:f,disabled:m,icon:g,directory:y,multiple:v,showFilteredOnly:b,showLine:x,motion:E,expandAction:C,loadData:S,renderLabel:_,draggable:k,renderFullLabel:O,labelEllipsis:T,virtualize:P,checkRelation:I}=c,M=xP(c,["blockNode","className","style","filterTreeNode","disabled","icon","directory","multiple","showFilteredOnly","showLine","motion","expandAction","loadData","renderLabel","draggable","renderFullLabel","labelEllipsis","virtualize","checkRelation"]),R=w()(`${EP}-wrapper`,u),A=w()(`${EP}-option-list`,{[`${EP}-option-list-block`]:d}),N=Boolean(r)&&!i.size,D=Pe()(e)||b&&N,L={role:D?"none":"tree"};return"tree"===L.role&&(L["aria-multiselectable"]=!!v),h().createElement(lP.Provider,{value:{treeDisabled:m,treeIcon:g,motion:E,motionKeys:t,motionType:n,filterTreeNode:f,keyEntities:e,onNodeClick:this.onNodeClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeRightClick:this.onNodeRightClick,onNodeDoubleClick:this.onNodeDoubleClick,renderTreeNode:this.renderTreeNode,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop,expandAction:C,directory:y,multiple:v,showFilteredOnly:b,isSearching:Boolean(r),loadData:S,onNodeLoad:this.onNodeLoad,renderLabel:_,draggable:k,renderFullLabel:O,dragOverNodeKey:s,dropPosition:o,labelEllipsis:void 0===T?P:T}},h().createElement("div",Object.assign({"aria-label":this.props["aria-label"],className:R,style:p},this.getDataAttr(M)),f?this.renderInput():null,h().createElement("div",Object.assign({className:A},L),D?this.renderEmpty():v?h().createElement(dd,{value:Array.from("related"===I?a:l)},this.renderNodeList()):this.renderNodeList())))}}SP.__SemiComponentName__="Tree",SP.contextType=lt,SP.propTypes={autoMergeValue:E().bool,blockNode:E().bool,className:E().string,showClear:E().bool,defaultExpandAll:E().bool,defaultExpandedKeys:E().array,defaultValue:E().oneOfType([E().string,E().array]),directory:E().bool,disabled:E().bool,emptyContent:E().node,expandAll:E().bool,expandedKeys:E().array,filterTreeNode:E().oneOfType([E().func,E().bool]),icon:E().node,onChangeWithObject:E().bool,motion:E().bool,multiple:E().bool,onChange:E().func,onExpand:E().func,onSearch:E().func,onSelect:E().func,onContextMenu:E().func,onDoubleClick:E().func,searchClassName:E().string,searchPlaceholder:E().string,searchStyle:E().object,selectedKey:E().string,showFilteredOnly:E().bool,showLine:E().bool,style:E().object,treeData:E().arrayOf(E().shape(CP)),keyMaps:E().object,treeDataSimpleJson:E().object,treeNodeFilterProp:E().string,value:E().oneOfType([E().string,E().number,E().array,E().object]),virtualize:E().object,autoExpandParent:E().bool,expandAction:E().oneOf(Ql),searchRender:E().oneOfType([E().func,E().bool]),renderLabel:E().func,renderFullLabel:E().func,leafOnly:E().bool,loadedKeys:E().array,loadData:E().func,onLoad:E().func,disableStrictly:E().bool,draggable:E().bool,autoExpandWhenDragEnter:E().bool,hideDraggingNode:E().bool,renderDraggingNode:E().func,onDragEnd:E().func,onDragEnter:E().func,onDragLeave:E().func,onDragOver:E().func,onDragStart:E().func,onDrop:E().func,labelEllipsis:E().bool,checkRelation:E().string,"aria-label":E().string,preventScroll:E().bool},SP.defaultProps=he(SP.__SemiComponentName__,{showClear:!0,disabled:!1,blockNode:!0,multiple:!1,filterTreeNode:!1,autoExpandParent:!1,treeNodeFilterProp:"label",defaultExpandAll:!1,expandAll:!1,onChangeWithObject:!1,motion:!0,leafOnly:!1,showFilteredOnly:!1,showLine:!1,expandAction:!1,disableStrictly:!1,draggable:!1,autoExpandWhenDragEnter:!0,checkRelation:"related",autoMergeValue:!0}),SP.TreeNode=gP;const _P=SP,kP={PREFIX:`${C}-tree-select`,PREFIX_TREE:`${C}-tree`,PREFIX_OPTION:`${C}-tree-select-option`},OP=["small","large","default"],TP="dropdown",PP="trigger",IP=Yn;class MP extends c{constructor(e){super(Object.assign({},e)),this.handleKeyDown=e=>{if(e.key===ln){this.getState("isOpen")&&this.close(e)}},this._registerClickOutsideHandler=()=>{this._adapter.registerClickOutsideHandler((e=>{this.handlerTriggerBlur(e),this.close(e)}))},this.clearInputValue=()=>{const{inputValue:e}=this.getStates();e&&this._adapter.updateInputValue("")},this.onClickSingleTriggerSearchItem=e=>{this.focusInput(!0)}}init(){const{searchAutoFocus:e,searchPosition:t,filterTreeNode:n}=this.getProps(),r=e&&(t===PP&&n);this._setDropdownWidth();const i=!this._isDisabled();(this.getProp("defaultOpen")||r)&&i&&(this.open(),this._registerClickOutsideHandler()),r&&i&&this.handleTriggerFocus(null)}destroy(){this._adapter.unregisterClickOutsideHandler()}_setDropdownWidth(){const{style:e,dropdownMatchSelectWidth:t}=this.getProps();let n;t&&(n=e&&er()(e.width)||e&&xe()(e.width)&&!e.width.includes("%")?e.width:this._adapter.getTriggerWidth(),this._adapter.setOptionWrapperWidth(n))}_isMultiple(){return this.getProp("multiple")}_isAnimated(){return this.getProp("motionExpand")}_isDisabled(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getProp("disabled")||e.disabled}_isExpandControlled(){return this.getProp("expandedKeys")}_isSelectToClose(){return!this.getProp("expandAction")}_isLoadControlled(){return this.getProp("loadedKeys")}_showFilteredOnly(){const{inputValue:e}=this.getStates(),{showFilteredOnly:t}=this.getProps();return Boolean(e)&&t}findDataForValue(e){const{value:t,defaultValue:n,keyMaps:r}=this.getProps(),i=o()(r,"value","value"),s=o()(r,"key","key");let a=[];return t?a=Array.isArray(t)?t:[t]:n&&(a=Array.isArray(n)?n:[n]),a.find((t=>t[i]===e||t[s]===e))}constructDataForValue(e){const{treeNodeLabelProp:t,keyMaps:n}=this.getProps(),r=o()(n,"key","key"),i=o()(n,"label",t);return{[r]:e,[i]:e}}getDataForKeyNotInKeyEntities(e){const{onChangeWithObject:t}=this.getProps();return t?this.findDataForValue(e):this.constructDataForValue(e)}getTreeNodeProps(e){const{expandedKeys:t=new Set([]),selectedKeys:n=[],checkedKeys:r=new Set([]),halfCheckedKeys:i=new Set([]),realCheckedKeys:s=new Set([]),keyEntities:o={},filteredKeys:a=new Set([]),inputValue:l="",loadedKeys:c,loadingKeys:d,filteredExpandedKeys:h=new Set([]),disabledKeys:u=new Set([])}=this.getStates(),{treeNodeFilterProp:p,checkRelation:f}=this.getProps(),m=o[e];if(!m)return null;let g=!1,y=!1;"related"===f?(g=r.has(e),y=i.has(e)):"unRelated"===f&&(g=s.has(e),y=!1);const v={eventKey:e,expanded:Boolean(l)?h.has(e):t.has(e),selected:n.includes(e),checked:g,halfChecked:y,pos:String(m?m.pos:""),level:m.level,filtered:a.has(e),keyword:l,treeNodeFilterProp:p,loading:d.has(e)&&!c.has(e),loaded:c.has(e)};return this.getProp("disableStrictly")&&u.has(e)&&(v.disabled=!0),v}handleNodeLoad(e,t,n,r){const{loadData:i}=this.getProps(),{key:s}=n;return!i||e.has(s)||t.has(s)?{}:(i(n).then((()=>{const e=new Set(this.getState("loadedKeys")),t=new Set(this.getState("loadingKeys")),i=e.add(s),o=new Set([...t]);o.delete(s),this._adapter.notifyLoad(i,n),this._isLoadControlled()||this._adapter.updateState({loadedKeys:i}),this._adapter.setState({loadingKeys:o}),r()})),{loadingKeys:t.add(s)})}focusInput(e){this._adapter.updateInputFocus(e)}_notifyMultipleChange(e,t){const{keyEntities:n}=this.getStates(),{leafOnly:r,checkRelation:i,keyMaps:s,autoMergeValue:o}=this.getProps();let a=[];"related"===i?a=o?fc(e,n,r,!0):e:"unRelated"===i&&(a=e);const l=a.map((e=>n[e]&&n[e].key===e?n[e].data:this.getDataForKeyNotInKeyEntities(e)));if(this.getProp("onChangeWithObject"))this._adapter.notifyChangeWithObject(l,t);else{const e=bc(l,s);this._adapter.notifyChange(e,l,t)}}_notifyChange(e,t){const{keyEntities:n}=this.getStates(),{keyMaps:r}=this.getProps();if(this._isMultiple()&&Array.isArray(e))this._notifyMultipleChange(e,t);else{const i=_e()(e)?e:n[e].data,s=_e()(e)?e:bc(i,r);this.getProp("onChangeWithObject")?this._adapter.notifyChangeWithObject(i,t):this._adapter.notifyChange(s,i,t)}}_notifyFocus(e){this._adapter.notifyFocus(e)}handleTriggerFocus(e){this._adapter.updateIsFocus(!0),this._notifyFocus(e),this._registerClickOutsideHandler()}_notifyBlur(e){this._adapter.notifyBlur(e)}handlerTriggerBlur(e){this.getState("isFocus")&&(this._adapter.updateIsFocus(!1),this._notifyBlur(e),this._adapter.unregisterClickOutsideHandler())}toggleHoverState(e){this._adapter.toggleHovering(e)}open(){this._adapter.openMenu(),this._setDropdownWidth()}close(e){this._adapter.closeMenu(),this.getProp("motionExpand")&&this._adapter.updateState({motionKeys:new Set([])})}handleClick(e){const t=this._isDisabled(),{isOpen:n,inputValue:r,isFocus:i}=this.getStates(),{searchPosition:s,clickTriggerToHide:o}=this.getProps();if(!t)if(i||this.handleTriggerFocus(e),n){if("trigger"===s&&r)return;o&&this.close(e)}else this.open()}handleSelectionEnterPress(e){dn(e)&&this.handleClick(e)}handleClear(e){const{searchPosition:t,filterTreeNode:n}=this.getProps(),{inputValue:r,selectedKeys:i}=this.getStates(),s=this._isMultiple(),o=this._isControlledComponent(),a=s?[]:void 0;this._notifyChange(a,e),o||(this._adapter.rePositionDropdown(),this._adapter.updateState({selectedKeys:[],checkedKeys:new Set,halfCheckedKeys:new Set,realCheckedKeys:new Set([])})),n&&t===PP&&""!==r&&(Pe()(i)?this.handleInputChange(""):this.clearInput()),this._adapter.notifyClear(e)}handleClearEnterPress(e){dn(e)&&this.handleClear(e)}removeTag(e){const{disableStrictly:t,checkRelation:n,keyMaps:r}=this.getProps(),{keyEntities:i,disabledKeys:s,realCheckedKeys:a}=this.getStates(),l=i[e]&&i[e].key===e?i[e].data:this.getDataForKeyNotInKeyEntities(e);if(!(l[o()(r,"disabled","disabled")]||t&&s.has(e))){if("unRelated"===n){const t=new Set(a);t.delete(e),this._notifyChange([...t],null),this._isControlledComponent()||(this._adapter.updateState({realCheckedKeys:t}),this._adapter.rePositionDropdown())}else if("related"===n){const{checkedKeys:t,halfCheckedKeys:n}=this.calcCheckedKeys(e,!1);this._notifyChange([...t],null),this._isControlledComponent()||(this._adapter.updateState({checkedKeys:t,halfCheckedKeys:n}),this._adapter.rePositionDropdown())}this._adapter.notifySelect(e,!1,l),this._adapter.rePositionDropdown()}}clearInput(){const{flattenNodes:e,expandedKeys:t,selectedKeys:n,keyEntities:r,treeData:i}=this.getStates(),{keyMaps:s}=this.getProps(),o=new Set(t),a=(this._isExpandControlled(),lc(n,r,!1));a.forEach((e=>o.add(e)));const l=rc(i,o,s);this._adapter.updateState({expandedKeys:o,flattenNodes:l,inputValue:"",motionKeys:new Set([]),filteredKeys:new Set([]),filteredExpandedKeys:new Set(a),filteredShownKeys:new Set([])}),this._adapter.rePositionDropdown()}handleInputChange(e){this._adapter.updateInputValue(e);const{flattenNodes:t,expandedKeys:n,selectedKeys:r,keyEntities:i,treeData:s}=this.getStates(),{showFilteredOnly:a,filterTreeNode:l,treeNodeFilterProp:c,keyMaps:d,remote:h}=this.getProps();if(h)return this._adapter.notifySearch(e,[],[]),void this._adapter.rePositionDropdown();const u="label"!==c?c:o()(d,"label","label"),p=new Set(n);let f=[],m=[],g=[],y=[],v=new Set([]);if(e){const t=Object.values(i).filter((t=>{const{data:n}=t;return pc(e,n,l,u)}));f=t.map((e=>e.data)),m=t.map((e=>e.key)),g=lc(m,i,!1);const n=oc(m,i,!0);v=new Set([...n,...g]),y=rc(s,new Set(g),d,a&&v)}else g=lc(r,i,!1),g.forEach((e=>p.add(e))),y=rc(s,p,d);const b=new Set(g);this._adapter.notifySearch(e,Array.from(b),f),this._adapter.updateState({expandedKeys:p,flattenNodes:y,motionKeys:new Set([]),filteredKeys:new Set(m),filteredExpandedKeys:b,filteredShownKeys:v}),this._adapter.rePositionDropdown()}handleNodeSelect(e,t){this._isDisabled(t)||(this._isMultiple()?this.handleMultipleSelect(e,t):this.handleSingleSelect(e,t))}handleSingleSelect(e,t){let n=[...this.getState("selectedKeys")];const{clickToHide:r}=this.getProps(),{selected:i,eventKey:s,data:o}=t;this._adapter.notifySelect(s,!0,o),n.includes(s)||i||(n=[s],this._notifyChange(s,e),this._isControlledComponent()||this._adapter.updateState({selectedKeys:n})),!r||!this._isSelectToClose()&&o.children||(this.close(e),this.handlerTriggerBlur(e))}calcCheckedKeys(e,t){const{keyEntities:n}=this.getStates(),r=new Set(this.getState("checkedKeys")),i=new Set(this.getState("halfCheckedKeys"));return t?gc(e,n,r,i):yc(e,n,r,i)}handleMultipleSelect(e,t){const{searchPosition:n,disableStrictly:r,checkRelation:i}=this.getProps(),{inputValue:s,realCheckedKeys:o}=this.getStates(),{checked:a,eventKey:l,data:c}=t;if("related"===i){const t=r?this.calcCheckedStatus(!a,l):!a,{checkedKeys:n,halfCheckedKeys:i}=r?this.calcNonDisabledCheckedKeys(l,t):this.calcCheckedKeys(l,t);this._adapter.notifySelect(l,t,c),this._notifyChange([...n],e),this._isControlledComponent()||(this._adapter.updateState({checkedKeys:n,halfCheckedKeys:i}),this._adapter.rePositionDropdown())}else if("unRelated"===i){const t=new Set(o);let n;o.has(l)?(t.delete(l),n=!1):(t.add(l),n=!0),this._adapter.notifySelect(l,n,c),this._notifyChange([...t],e),this._isControlledComponent()||(this._adapter.updateState({realCheckedKeys:t}),this._adapter.rePositionDropdown())}n===PP&&""!==s&&this._adapter.updateState({inputValue:""})}calcNonDisabledCheckedKeys(e,t){const{keyEntities:n,disabledKeys:r}=this.getStates(),i=new Set(this.getState("checkedKeys")),s=fc(oc([e],n,!1),n,!0),o=s.some((e=>r.has(e)));if(!o)return this.calcCheckedKeys(e,t);const a=s.filter((e=>!r.has(e)));return cc(t?[...a,...i]:Kl()(fc([...i],n,!0,!0),a),n)}calcCheckedStatus(e,t){if(!e)return e;const{checkedKeys:n,keyEntities:r,disabledKeys:i}=this.getStates(),s=fc(oc([t],r,!1),r,!0),o=s.some((e=>i.has(e)));if(!o)return e;const a=s.filter((e=>!i.has(e))),l=a.every((e=>n.has(e)));return!l}handleNodeExpandInSearch(e,t){const{treeData:n,filteredShownKeys:r,keyEntities:i}=this.getStates(),{keyMaps:s}=this.getProps(),o=this._showFilteredOnly(),a=new Set(this.getState("filteredExpandedKeys"));let l="show";const{eventKey:c,expanded:d,data:h}=t;if(d?a.has(c)&&(a.delete(c),l="hide"):a.add(c),this._adapter.cacheFlattenNodes("hide"===l&&this._isAnimated()),!this._isExpandControlled()){const e=rc(n,a,s,o&&r),t=this._isAnimated()?mc(c,a,i):[],d={filteredExpandedKeys:a,flattenNodes:e,motionKeys:new Set(t),motionType:l};this._adapter.updateState(d)}this._adapter.notifyExpand(a,{expanded:!d,node:h})}handleNodeExpand(e,t){const{loadData:n,keyMaps:r}=this.getProps(),{inputValue:i,keyEntities:s}=this.getStates(),o=Boolean(i);if(!(n||t.children&&t.children.length))return;const a=this._isExpandControlled();if(o)return void this.handleNodeExpandInSearch(e,t);const{treeData:l}=this.getStates(),c=new Set(this.getState("expandedKeys"));let d="show";const{eventKey:h,expanded:u,data:p}=t;if(u?c.has(h)&&(c.delete(h),d="hide"):c.add(h),this._adapter.cacheFlattenNodes("hide"===d&&this._isAnimated()),!a){const e=rc(l,c,r),t=this._isAnimated()?mc(h,c,s):[],n={expandedKeys:c,flattenNodes:e,motionKeys:new Set(t),motionType:d};this._adapter.updateState(n)}this._adapter.notifyExpand(c,{expanded:!u,node:p})}getRenderTextInSingle(){const{renderSelectedItem:e,treeNodeLabelProp:t,keyMaps:n}=this.getProps(),{selectedKeys:r,keyEntities:i}=this.getStates(),s=o()(n,"label",t),a=ye()(e)?e:e=>o()(e,s,null);let l;if(r.length){const e=r[0];l=i[e]&&i[e].key===e?i[e].data:this.getDataForKeyNotInKeyEntities(e)}return l?a(l):null}handleInputTriggerBlur(){this._adapter.updateState({inputTriggerFocus:!1})}handleInputTriggerFocus(){this.clearInput(),this._adapter.updateState({inputTriggerFocus:!0})}setLoadKeys(e,t){this._adapter.updateLoadKeys(e,t)}handlePopoverVisibleChange(e){const{filterTreeNode:t,searchAutoFocus:n,searchPosition:r}=this.getProps();!1===e&&t&&this.clearInputValue(),t&&r===TP&&e&&n&&this.focusInput(!0)}handleAfterClose(){const{filterTreeNode:e}=this.getProps();e&&this.clearInput()}}__webpack_require__("HEBl");var RP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const AP=kP.PREFIX,NP=kP.PREFIX_TREE;class DP extends f{constructor(e){super(e),this.renderSuffix=()=>{const{suffix:e}=this.props,t=w()({[`${AP}-suffix`]:!0,[`${AP}-suffix-text`]:e&&xe()(e),[`${AP}-suffix-icon`]:oe(e)});return h().createElement("div",{className:t,"x-semi-prop":"suffix"},e)},this.renderPrefix=()=>{const{prefix:e,insetLabel:t,insetLabelId:n}=this.props,r=e||t,i=w()({[`${AP}-prefix`]:!0,[`${AP}-inset-label`]:t,[`${AP}-prefix-text`]:r&&xe()(r),[`${AP}-prefix-icon`]:oe(r)});return h().createElement("div",{className:i,id:n,"x-semi-prop":"prefix,insetLabel"},r)},this.renderContent=()=>{const{dropdownMinWidth:e}=this.state,{dropdownStyle:t,dropdownClassName:n}=this.props,r=Object.assign({minWidth:e},t),i=w()(n,`${AP}-popover`);return h().createElement("div",{className:i,style:r,onKeyDown:this.foundation.handleKeyDown,ref:this.optionContainerEl},this.renderTree())},this.removeTag=e=>{this.foundation.removeTag(e)},this.handleClick=e=>{this.foundation.handleClick(e)},this.getDataForKeyNotInKeyEntities=e=>this.foundation.getDataForKeyNotInKeyEntities(e),this.handleSelectionEnterPress=e=>{this.foundation.handleSelectionEnterPress(e)},this.hasValue=()=>{const{multiple:e,checkRelation:t}=this.props,{realCheckedKeys:n,checkedKeys:r,selectedKeys:i}=this.state;let s=!1;return e?"related"===t?s=Boolean(r.size):"unRelated"===t&&(s=Boolean(n.size)):s=Boolean(i.length),s},this.showClearBtn=()=>{const{showClear:e,disabled:t,searchPosition:n}=this.props,{inputValue:r,isOpen:i,isHovering:s}=this.state,o=n===PP&&r;return e&&(this.hasValue()||o)&&!t&&(i||s)},this.renderTagList=e=>{const{keyEntities:t,disabledKeys:n}=this.state,{treeNodeLabelProp:r,leafOnly:i,disabled:s,disableStrictly:a,size:l,renderSelectedItem:c,keyMaps:d}=this.props,u=o()(d,"label",r),p=ye()(c)?c:e=>({isRenderInTag:!0,content:o()(e,u,null)}),f=[];return e.forEach(((e,r)=>{const i=t[e]&&t[e].key===e?t[e].data:this.getDataForKeyNotInKeyEntities(e),o=(t,n)=>{n&&"function"==typeof n.preventDefault&&n.preventDefault(),this.removeTag(e)},{content:c,isRenderInTag:d}=i?p(i,{index:r,onClose:o}):{};if(be()(c)||_e()(c))return;const u={closable:!(s||i.disabled||a&&n.has(i.key)),color:"white",visible:!0,onClose:o,key:`tag-${e}-${r}`,size:"small"===l?"small":"large"};d?f.push(h().createElement(Zd,Object.assign({},u),c)):f.push(c)})),f},this.renderSingleTriggerSearchItem=()=>{const{placeholder:e,disabled:t}=this.props,{inputTriggerFocus:n}=this.state,r=this.foundation.getRenderTextInSingle(),i=w()(`${AP}-selection-TriggerSearchItem`,{[`${AP}-selection-TriggerSearchItem-placeholder`]:(n||!r)&&!t,[`${AP}-selection-TriggerSearchItem-disabled`]:t});return h().createElement("span",{className:i,onClick:this.foundation.onClickSingleTriggerSearchItem},r||e)},this.renderSingleTriggerSearch=()=>{const{inputValue:e}=this.state;return h().createElement(h().Fragment,null,this.renderInput(),!e&&this.renderSingleTriggerSearchItem())},this.renderSelectContent=e=>{const{multiple:t,placeholder:n,maxTagCount:r,searchPosition:i,filterTreeNode:s,showRestTagsPopover:o,restTagsPopoverProps:a}=this.props;if(s&&i===PP)return t?this.renderTagInput(e):this.renderSingleTriggerSearch();if(!t||!this.hasValue()){const e=this.foundation.getRenderTextInSingle(),t=w()(`${AP}-selection-content`,{[`${AP}-selection-placeholder`]:!e});return h().createElement("span",{className:t},e||n)}const l=this.renderTagList(e);return h().createElement(DC,{maxTagCount:r,tagList:l,size:"large",mode:"custom",showPopover:o,popoverProps:a})},this.handleClear=e=>{e&&e.stopPropagation(),this.foundation.handleClear(e)},this.handleClearEnterPress=e=>{e&&e.stopPropagation(),this.foundation.handleClearEnterPress(e)},this.handleMouseOver=e=>{this.foundation.toggleHoverState(!0)},this.handleMouseLeave=e=>{this.foundation.toggleHoverState(!1)},this.search=e=>{const{isOpen:t}=this.state;t||this.foundation.open(),this.foundation.handleInputChange(e)},this.close=()=>{this.foundation.close(null)},this.renderArrow=()=>{const e=this.showClearBtn(),{arrowIcon:t}=this.props;return e?null:t?h().createElement("div",{className:w()(`${AP}-arrow`),"x-semi-prop":"arrowIcon"},t):null},this.renderClearBtn=()=>{const e=this.showClearBtn(),{clearIcon:t}=this.props,n=w()(`${AP}-clearbtn`);return e?h().createElement("div",{role:"button",tabIndex:0,"aria-label":"Clear TreeSelect value",className:n,onClick:this.handleClear,onKeyPress:this.handleClearEnterPress},t||h().createElement(gr,null)):null},this.renderSelection=()=>{const e=this.props,{disabled:t,multiple:n,filterTreeNode:r,validateStatus:i,prefix:s,suffix:a,style:l,size:c,insetLabel:u,className:p,placeholder:f,showClear:m,leafOnly:g,searchPosition:y,triggerRender:v,borderless:b,autoMergeValue:x,checkRelation:E,triggerTagWrap:C}=e,S=RP(e,["disabled","multiple","filterTreeNode","validateStatus","prefix","suffix","style","size","insetLabel","className","placeholder","showClear","leafOnly","searchPosition","triggerRender","borderless","autoMergeValue","checkRelation","triggerTagWrap"]),{inputValue:_,selectedKeys:k,checkedKeys:O,keyEntities:T,isFocus:P,realCheckedKeys:I}=this.state,M=Boolean(r),R="function"==typeof v,A=m?{onMouseEnter:e=>this.handleMouseOver(e),onMouseLeave:e=>this.handleMouseLeave(e)}:{},N=y===PP&&M,D=N&&Pe()(O),L=N&&!Pe()(O),F=R?w()(p):w()(AP,{[`${AP}-borderless`]:b,[`${AP}-focus`]:P,[`${AP}-disabled`]:t,[`${AP}-single`]:!n,[`${AP}-multiple`]:n,[`${AP}-multiple-tagInput-empty`]:n&&D,[`${AP}-multiple-tagInput-notEmpty`]:n&&L,[`${AP}-filterable`]:M,[`${AP}-error`]:"error"===i,[`${AP}-warning`]:"warning"===i,[`${AP}-small`]:"small"===c,[`${AP}-large`]:"large"===c,[`${AP}-with-prefix`]:s||u,[`${AP}-with-suffix`]:a,[`${AP}-with-suffix`]:a,[`${AP}-triggerTagWrap`]:Boolean(C)&&n&&N},p);let j,$=[];n?x?"related"===E?$=fc([...O],T,g,!0):"unRelated"===E&&($=[...I]):$=[...O]:$=k,j=R?h().createElement(Pr,{inputValue:_,value:$.map((e=>o()(T,[e,"data"]))),disabled:t,placeholder:f,onClear:this.handleClear,componentName:"TreeSelect",triggerRender:v,componentProps:Object.assign({},this.props),onSearch:this.search,onRemove:this.removeTag}):[h().createElement(d.Fragment,{key:"prefix"},s||u?this.renderPrefix():null),h().createElement(d.Fragment,{key:"selection"},h().createElement("div",{className:`${AP}-selection`},this.renderSelectContent($))),h().createElement(d.Fragment,{key:"suffix"},a?this.renderSuffix():null),h().createElement(d.Fragment,{key:"clearBtn"},m||N&&_?this.renderClearBtn():null),h().createElement(d.Fragment,{key:"arrow"},this.renderArrow())];const B=t?null:0;return h().createElement("div",Object.assign({role:"combobox","aria-disabled":t,"aria-haspopup":"tree",tabIndex:B,className:F,style:l,ref:this.triggerRef,onClick:this.handleClick,onKeyPress:this.handleSelectionEnterPress,onKeyDown:this.foundation.handleKeyDown,"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],"aria-required":this.props["aria-required"]},A,this.getDataAttr(S)),j)},this.renderTagItem=(e,t)=>{const{keyEntities:n,disabledKeys:r}=this.state,{size:i,leafOnly:s,disabled:a,disableStrictly:l,renderSelectedItem:c,treeNodeLabelProp:d,keyMaps:u}=this.props,p=o()(u,"label",d),f=fc([e],n,s,!0).map((t=>n[e]&&n[e].key===e?n[e].data:this.getDataForKeyNotInKeyEntities(e))),m=bc(f,u),g=w()(`${AP}-selection-tag`,{[`${AP}-selection-tag-disabled`]:a}),y=!Pe()(f)&&!Pe()(f[0]),v=l&&y&&r.has(f[0].key),b=(t,n)=>{n.preventDefault(),this.removeTag(e)},x={size:"small"===i?"small":"large",key:`tag-${m}-${t}`,color:"white",className:g,closable:y&&!f[0].disabled&&!a&&!v,onClose:b},E=f[0],C=ye()(c)?c:e=>({isRenderInTag:!0,content:o()(e,p,null)});if(ye()(C)){const{content:e,isRenderInTag:n}=E?C(E,{index:t,onClose:b}):{};return n?h().createElement(Zd,Object.assign({},x),e):e}return h().createElement(Zd,Object.assign({},x),m)},this.renderTagInput=e=>{const{disabled:t,size:n,searchAutoFocus:r,placeholder:i,maxTagCount:s,showRestTagsPopover:o,restTagsPopoverProps:a,searchPosition:l,filterTreeNode:c,preventScroll:d}=this.props,{inputValue:u}=this.state,p=c&&l===PP?r:void 0;return h().createElement(cf,{maxTagCount:s,disabled:t,onInputChange:e=>this.search(e),ref:this.tagInputRef,placeholder:i,value:e,inputValue:u,size:n,showRestTagsPopover:o,restTagsPopoverProps:a,autoFocus:p,renderTagItem:(e,t)=>this.renderTagItem(e,t),onRemove:e=>this.removeTag(e),expandRestTagsOnClick:!1,preventScroll:d})},this.renderInput=()=>{const{searchPlaceholder:e,searchRender:t,showSearchClear:n,searchPosition:r,searchAutoFocus:i,multiple:s,disabled:o,preventScroll:a}=this.props,{inputValue:l,inputTriggerFocus:c}=this.state,d=r===TP,u={value:l,className:w()({[`${NP}-input`]:d,[`${AP}-inputTrigger`]:!d}),preventScroll:a,onChange:e=>this.search(e)},p=d?{showClear:n,prefix:h().createElement(WC,null)}:{autofocus:i,onFocus:e=>this.foundation.handleInputTriggerFocus(),onBlur:e=>this.foundation.handleInputTriggerBlur(),disabled:o},f=w()({[`${NP}-search-wrapper`]:d,[`${AP}-triggerSingleSearch-wrapper`]:!d&&!s,[`${AP}-triggerSingleSearch-upper`]:!d&&c}),m="function"==typeof t||"boolean"==typeof t;return m&&!t?null:h().createElement("div",{className:f},h().createElement(Jt,{componentName:"TreeSelect"},(n=>{const r=d?e||n.searchPlaceholder:"";return m?t(Object.assign(Object.assign(Object.assign({},p),u),{placeholder:r})):h().createElement(kr,Object.assign({"aria-label":"Filter TreeSelect item",ref:this.inputRef,placeholder:r},u,p))})))},this.renderEmpty=()=>{const{emptyContent:e}=this.props;return null===e?null:e?h().createElement(gP,{empty:!0,emptyContent:this.props.emptyContent}):h().createElement(Jt,{componentName:"Tree"},(e=>h().createElement(gP,{empty:!0,emptyContent:e.emptyText})))},this.onNodeLoad=e=>new Promise((t=>this.foundation.setLoadKeys(e,t))),this.onNodeSelect=(e,t)=>{this.foundation.handleNodeSelect(e,t)},this.onNodeCheck=(e,t)=>{this.foundation.handleNodeSelect(e,t)},this.onNodeExpand=(e,t)=>{this.foundation.handleNodeExpand(e,t)},this.getTreeNodeRequiredProps=()=>{const{expandedKeys:e,selectedKeys:t,checkedKeys:n,halfCheckedKeys:r,keyEntities:i,filteredKeys:s}=this.state;return{expandedKeys:e||new Set,selectedKeys:t||[],checkedKeys:n||new Set,halfCheckedKeys:r||new Set,filteredKeys:s||new Set,keyEntities:i}},this.getTreeNodeKey=e=>{const{data:t}=e,{key:n}=t;return n},this.handlePopoverVisibleChange=e=>{this.foundation.handlePopoverVisibleChange(e)},this.afterClose=()=>{this.foundation.handleAfterClose()},this.renderTreeNode=(e,t,n)=>{const{data:r,key:i}=e,s=this.foundation.getTreeNodeProps(i),{showLine:a}=this.props;if(!s)return null;const l=Gl()(e,["key","label","disabled","isLeaf","icon","isEnd"]),{keyMaps:c,expandIcon:d}=this.props,u=r[o()(c,"children","children")];return!_e()(u)&&(l.children=u),h().createElement(gP,Object.assign({},s,r,l,{data:r,style:n,showLine:a,expandIcon:d}))},this.itemKey=(e,t)=>{const{visibleOptions:n}=t;return n[e].key},this.renderNodeList=()=>{const{flattenNodes:e,cachedFlattenNodes:t,motionKeys:n,motionType:r,filteredKeys:i}=this.state,{direction:s}=this.context,{virtualize:o,motionExpand:a}=this.props,l="expandedKeys"in this.props;if(!o||Pe()(o))return h().createElement(wP,{flattenNodes:e,flattenList:t,motionKeys:a?n:new Set([]),motionType:r,searchTargetIsDeep:l&&a&&Pe()(n)&&!Pe()(i),onMotionEnd:this.onMotionEnd,renderTreeNode:this.renderTreeNode});const c={visibleOptions:e,renderOption:this.renderTreeNode};return h().createElement(aP,{defaultHeight:o.height,defaultWidth:o.width},(t=>{let{height:n,width:r}=t;return h().createElement(Ld,{itemCount:e.length,itemSize:o.itemSize,height:n,width:r,itemKey:this.itemKey,itemData:c,className:`${NP}-virtual-list`,style:{direction:s}},jC)}))},this.renderTree=()=>{const{keyEntities:e,motionKeys:t,motionType:n,inputValue:r,filteredKeys:s,flattenNodes:o,checkedKeys:a,realCheckedKeys:l}=this.state,{loadData:c,filterTreeNode:d,disabled:u,multiple:p,showFilteredOnly:f,motionExpand:m,outerBottomSlot:g,outerTopSlot:y,expandAction:v,labelEllipsis:b,virtualize:x,optionListStyle:E,searchPosition:C,renderLabel:S,renderFullLabel:_,checkRelation:k,emptyContent:O}=this.props,T=w()(`${NP}-wrapper`),P=Boolean(r)&&!s.size,I=Pe()(o)||f&&P,M=C===TP,R=w()(`${NP}-option-list ${NP}-option-list-block`,{[`${NP}-option-list-hidden`]:null===O&&I});return h().createElement(lP.Provider,{value:{loadData:c,treeDisabled:u,motion:m,motionKeys:t,motionType:n,expandAction:v,filterTreeNode:d,keyEntities:e,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeRightClick:i(),onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,renderTreeNode:this.renderTreeNode,multiple:p,showFilteredOnly:f,isSearching:Boolean(r),renderLabel:S,renderFullLabel:_,labelEllipsis:void 0===b?x:b}},h().createElement("div",{className:T},y,!y&&d&&M&&this.renderInput(),h().createElement("div",{className:R,role:"tree","aria-multiselectable":!!p,style:E},I?this.renderEmpty():p?h().createElement(dd,{value:Array.from("related"===k?a:l)},this.renderNodeList()):this.renderNodeList()),g))},this.state={inputTriggerFocus:!1,isOpen:!1,isFocus:!1,rePosKey:0,dropdownMinWidth:null,inputValue:"",keyEntities:{},treeData:[],flattenNodes:[],cachedFlattenNodes:void 0,selectedKeys:[],checkedKeys:new Set,halfCheckedKeys:new Set,realCheckedKeys:new Set([]),disabledKeys:new Set,motionKeys:new Set([]),motionType:"hide",expandedKeys:new Set(e.expandedKeys),filteredKeys:new Set,filteredExpandedKeys:new Set,filteredShownKeys:new Set,prevProps:null,isHovering:!1,cachedKeyValuePairs:{},loadedKeys:new Set,loadingKeys:new Set},this.inputRef=h().createRef(),this.tagInputRef=h().createRef(),this.triggerRef=h().createRef(),this.optionsRef=h().createRef(),this.optionContainerEl=h().createRef(),this.clickOutsideHandler=null,this.foundation=new MP(this.adapter),this.treeSelectID=Math.random().toString(36).slice(2),this.onMotionEnd=()=>{this.adapter.rePositionDropdown()}}static getDerivedStateFromProps(e,t){const{prevProps:n,rePosKey:r}=t,{keyMaps:i}=e,s=t=>!n&&t in e||n&&!Oe()(n[t],e[t]);let o;const a=e.onChangeWithObject;let l=t.keyEntities||{},c=t.cachedKeyValuePairs||{};const d={prevProps:e},h=s("treeData"),u=s("expandedKeys"),p=Boolean(e.filterTreeNode&&!e.remote&&t.inputValue&&t.inputValue.length);if(h){o=e.treeData,d.treeData=o;const t=ic(o,i);d.keyEntities=Object.assign({},t.keyEntities),l=d.keyEntities,d.cachedKeyValuePairs=Object.assign({},t.valueEntities),c=d.cachedKeyValuePairs}o&&e.motion&&!Oe()(Object.keys(d.keyEntities),Object.keys(t.keyEntities))&&n&&e.motion&&(d.motionKeys=new Set([]),d.motionType=null);const f=h&&e.expandAll;if(p){let r;if(o&&(r=vc({treeData:o,inputValue:t.inputValue,filterTreeNode:e.filterTreeNode,filterProps:e.treeNodeFilterProp,showFilteredOnly:e.showFilteredOnly,keyEntities:d.keyEntities,prevExpandedKeys:[...t.filteredExpandedKeys],keyMaps:i}),d.flattenNodes=r.flattenNodes,d.motionKeys=new Set([]),d.filteredKeys=r.filteredKeys,d.filteredShownKeys=r.filteredShownKeys,d.filteredExpandedKeys=r.filteredExpandedKeys),e.expandedKeys){if(d.filteredExpandedKeys=dc(e.expandedKeys,l,e.autoExpandParent||!n),n&&e.motion){const n=t?t.filteredExpandedKeys:new Set([]);if(!o){const r=uc(n,d.filteredExpandedKeys,l);let{motionKeys:i}=r;const{motionType:s}=r;e.showFilteredOnly&&(i=i.filter((e=>t.filteredShownKeys.has(e)))),"hide"===s&&(d.cachedFlattenNodes=sP(t.flattenNodes)),d.motionKeys=new Set(i),d.motionType=s}}d.flattenNodes=rc(o||t.treeData,d.filteredExpandedKeys||t.filteredExpandedKeys,i,e.showFilteredOnly&&t.filteredShownKeys)}}else{if(u||n&&s("autoExpandParent")){if(d.expandedKeys=dc(e.expandedKeys,l,e.autoExpandParent||!n),n&&e.motion&&!o){const{motionKeys:e,motionType:n}=uc(t.expandedKeys,d.expandedKeys,l);d.motionKeys=new Set(e),d.motionType=n,"hide"===n&&(d.cachedFlattenNodes=sP(t.flattenNodes))}}else!n&&(e.defaultExpandAll||e.expandAll)||f?d.expandedKeys=new Set(Object.keys(l)):!n&&e.defaultExpandedKeys?d.expandedKeys=dc(e.defaultExpandedKeys,l):!n&&e.defaultValue?d.expandedKeys=hc(wc(e.defaultValue,a,i),l,e.multiple,c):!n&&e.value&&(d.expandedKeys=hc(wc(e.value,a,i),l,e.multiple,c));if(d.expandedKeys||delete d.expandedKeys,o||d.expandedKeys){const e=rc(o||t.treeData,d.expandedKeys||t.expandedKeys,i);d.flattenNodes=e}}const m=e.multiple;if(m){let r;if(s("value")?r=sc(wc(e.value,a,i),c,m):!n&&e.defaultValue?r=sc(wc(e.defaultValue,a,i),c,m):o&&(r=e.value?sc(wc(e.value,a,i)||[],c,m):xc("related"===e.checkRelation?t.checkedKeys:t.realCheckedKeys,l)),r)if("unRelated"===e.checkRelation)d.realCheckedKeys=new Set(r);else if("related"===e.checkRelation){const{checkedKeys:e,halfCheckedKeys:t}=cc(r,l);d.checkedKeys=e,d.halfCheckedKeys=t}}else s("value")?d.selectedKeys=sc(wc(e.value,a,i),c,m):!n&&e.defaultValue?d.selectedKeys=sc(wc(e.defaultValue,a,i),c,m):o&&(e.value?d.selectedKeys=sc(wc(e.value,a,i)||"",c,m):d.selectedKeys=xc(t.selectedKeys,l));return s("loadedKeys")&&(d.loadedKeys=new Set(e.loadedKeys)),(h||s("value"))&&(d.rePosKey=r+1),o&&e.disableStrictly&&"related"===e.checkRelation&&(d.disabledKeys=Ec(l,i)),d}get adapter(){var e=this;const t={updateInputValue:e=>{this.setState({inputValue:e})}},n={registerClickOutsideHandler:e=>{this.adapter.unregisterClickOutsideHandler();const t=t=>{const n=this.triggerRef&&this.triggerRef.current,r=this.optionContainerEl&&this.optionContainerEl.current,i=t.target,s=t.composedPath&&t.composedPath()||[i];!r||r.contains(i)&&r.contains(i.parentNode)||!n||n.contains(i)||s.includes(n)||s.includes(r)||e(t)};this.clickOutsideHandler=t,document.addEventListener("mousedown",t,!1)},unregisterClickOutsideHandler:()=>{this.clickOutsideHandler&&(document.removeEventListener("mousedown",this.clickOutsideHandler,!1),this.clickOutsideHandler=null)},rePositionDropdown:()=>{let{rePosKey:e}=this.state;e+=1,this.setState({rePosKey:e})}},r={updateState:e=>{this.setState(Object.assign({},e))},notifySelect:(e,t,n)=>{this.props.onSelect&&this.props.onSelect(e,t,n)},notifySearch:(e,t,n)=>{this.props.onSearch&&this.props.onSearch(e,t,n)},cacheFlattenNodes:e=>{this.setState({cachedFlattenNodes:e?sP(this.state.flattenNodes):void 0})},notifyLoad:(e,t)=>{const{onLoad:n}=this.props;ye()(n)&&n(e,t)},notifyClear:e=>{this.props.onClear&&this.props.onClear(e)}};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},super.adapter),t),n),r),{updateLoadKeys:(e,t)=>{this.setState((n=>{let{loadedKeys:r,loadingKeys:i}=n;return this.foundation.handleNodeLoad(r,i,e,t)}))},updateState:e=>{this.setState(Object.assign({},e))},openMenu:()=>{this.setState({isOpen:!0},(()=>{this.props.onVisibleChange(!0)}))},closeMenu:e=>{this.setState({isOpen:!1},(()=>{e&&e(),this.props.onVisibleChange(!1)}))},getTriggerWidth:()=>{const e=this.triggerRef.current;return e&&e.getBoundingClientRect().width},setOptionWrapperWidth:e=>{this.setState({dropdownMinWidth:e})},notifyChange:(e,t,n)=>{this.props.onChange&&this.props.onChange(e,t,n)},notifyChangeWithObject:(e,t)=>{this.props.onChange&&this.props.onChange(e,t)},notifyExpand:(e,t)=>{let{expanded:n,node:r}=t;this.props.onExpand&&this.props.onExpand([...e],{expanded:n,node:r}),n&&this.props.loadData&&this.onNodeLoad(r)},notifyFocus:function(){e.props.onFocus&&e.props.onFocus(...arguments)},notifyBlur:function(){e.props.onBlur&&e.props.onBlur(...arguments)},toggleHovering:e=>{this.setState({isHovering:e})},updateInputFocus:e=>{if(e){if(this.inputRef&&this.inputRef.current){const{preventScroll:e}=this.props;this.inputRef.current.focus({preventScroll:e})}this.tagInputRef&&this.tagInputRef.current&&this.tagInputRef.current.focus()}else this.inputRef&&this.inputRef.current&&this.inputRef.current.blur(),this.tagInputRef&&this.tagInputRef.current&&this.tagInputRef.current.blur()},updateIsFocus:e=>{this.setState({isFocus:e})}})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}render(){const e=this.renderContent(),{motion:t,zIndex:n,mouseLeaveDelay:r,mouseEnterDelay:i,autoAdjustOverflow:s,stopPropagation:o,getPopupContainer:a,dropdownMargin:l,position:c}=this.props,{isOpen:d,rePosKey:u}=this.state,p=this.renderSelection(),f=c||"bottomLeft";return h().createElement(Cn,{stopPropagation:o,getPopupContainer:a,zIndex:n,motion:t,margin:l,ref:this.optionsRef,content:e,visible:d,trigger:"custom",rePosKey:u,position:f,autoAdjustOverflow:s,mouseLeaveDelay:r,mouseEnterDelay:i,onVisibleChange:this.handlePopoverVisibleChange,afterClose:this.afterClose},p)}}DP.__SemiComponentName__="TreeSelect",DP.contextType=lt,DP.propTypes={"aria-describedby":E().string,"aria-errormessage":E().string,"aria-invalid":E().bool,"aria-labelledby":E().string,"aria-required":E().bool,borderless:E().bool,loadedKeys:E().arrayOf(E().string),loadData:E().func,onLoad:E().func,arrowIcon:E().node,clearIcon:E().node,defaultOpen:E().bool,defaultValue:E().oneOfType([E().string,E().array,E().object]),defaultExpandAll:E().bool,defaultExpandedKeys:E().array,expandAll:E().bool,disabled:E().bool,disableStrictly:E().bool,filterTreeNode:E().oneOfType([E().func,E().bool]),multiple:E().bool,remote:E().bool,searchPlaceholder:E().string,searchAutoFocus:E().bool,virtualize:E().object,treeNodeFilterProp:E().string,onChange:E().func,onClear:E().func,onSearch:E().func,onSelect:E().func,onExpand:E().func,onChangeWithObject:E().bool,onBlur:E().func,onFocus:E().func,value:E().oneOfType([E().string,E().number,E().array,E().object]),expandedKeys:E().array,autoExpandParent:E().bool,showClear:E().bool,showSearchClear:E().bool,autoAdjustOverflow:E().bool,showFilteredOnly:E().bool,showLine:E().bool,motionExpand:E().bool,emptyContent:E().node,keyMaps:E().object,leafOnly:E().bool,treeData:E().arrayOf(E().shape({key:E().string,value:E().oneOfType([E().string,E().number]),label:E().any})),dropdownClassName:E().string,dropdownStyle:E().object,dropdownMargin:E().oneOfType([E().number,E().object]),motion:E().bool,placeholder:E().string,maxTagCount:E().number,size:E().oneOf(OP),className:E().string,style:E().object,treeNodeLabelProp:E().string,suffix:E().node,prefix:E().node,insetLabel:E().node,insetLabelId:E().string,zIndex:E().number,getPopupContainer:E().func,dropdownMatchSelectWidth:E().bool,validateStatus:E().oneOf(IP),mouseEnterDelay:E().number,mouseLeaveDelay:E().number,triggerRender:E().func,stopPropagation:E().oneOfType([E().bool,E().string]),outerBottomSlot:E().node,outerTopSlot:E().node,onVisibleChange:E().func,expandAction:E().oneOf(["click","doubleClick",!1]),searchPosition:E().oneOf([TP,PP]),clickToHide:E().bool,renderLabel:E().func,renderFullLabel:E().func,labelEllipsis:E().bool,optionListStyle:E().object,searchRender:E().oneOfType([E().func,E().bool]),renderSelectedItem:E().func,checkRelation:E().string,"aria-label":E().string,showRestTagsPopover:E().bool,restTagsPopoverProps:E().object,preventScroll:E().bool,clickTriggerToHide:E().bool,autoMergeValue:E().bool,triggerTagWrap:E().bool},DP.defaultProps=he(DP.__SemiComponentName__,{borderless:!1,searchPosition:TP,arrowIcon:h().createElement(Hc,null),autoExpandParent:!1,autoAdjustOverflow:!0,stopPropagation:!0,motion:!0,motionExpand:!0,expandAll:!1,zIndex:gn.DEFAULT_Z_INDEX,disableStrictly:!1,multiple:!1,remote:!1,filterTreeNode:!1,size:"default",treeNodeFilterProp:"label",onChangeWithObject:!1,treeNodeLabelProp:"label",dropdownMatchSelectWidth:!0,defaultOpen:!1,showSearchClear:!0,showClear:!1,onVisibleChange:i(),expandAction:!1,clickToHide:!0,searchAutoFocus:!1,checkRelation:"related","aria-label":"TreeSelect",showRestTagsPopover:!1,restTagsPopoverProps:{},clickTriggerToHide:!0,autoMergeValue:!0,triggerTagWrap:!1});const LP=DP,FP=`${C}-upload`,jP="picture",$P="list",BP={PREFIX:FP,LIST:`${FP}-list`},VP="auto",zP="custom",HP={FILE_STATUS_UPLOADING:"uploading",FILE_STATUS_SUCCESS:"success",FILE_STATUS_UPLOAD_FAIL:"uploadFail",FILE_STATUS_VALIDATING:"validating",FILE_STATUS_VALID_FAIL:"validateFail",FILE_STATUS_WAIT_UPLOAD:"wait",FILE_LIST_PIC:jP,FILE_LIST_DEFAULT:$P,LIST_TYPE:[jP,$P,"none"],imageTypes:["image","webp","png","svg","gif","jpg","jpeg","bmp","dpg"],DRAG_AREA_DEFAULT:"default",DRAG_AREA_LEGAL:"legal",DRAG_AREA_ILLEGAL:"illegal",TRIGGER_AUTO:VP,TRIGGER_CUSTOM:zP,UPLOAD_TRIGGER:[VP,zP],VALIDATE_STATUS:Yn,PROMPT_POSITION:["left","right","bottom"]},UP=.95;var KP=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};const WP=1024,GP=1048576;function qP(e){return e<WP?`${(e/WP).toFixed(2)}KB`:e>=WP&&e<GP?`${(e/WP).toFixed(1)}KB`:e>=GP?`${(e/GP).toFixed(1)}MB`:void 0}function XP(e){return KP(this,void 0,void 0,(function*(){const t=[],n=(e,r)=>KP(this,void 0,void 0,(function*(){if(r=r||"",e.path=r,e.isFile)t.push(new Promise(((t,n)=>{e.file((n=>{e.fullPath&&!n.webkitRelativePath&&(Object.defineProperties(n,{webkitRelativePath:{writable:!0}}),n.webkitRelativePath=e.fullPath.replace(/^\//,""),Object.defineProperties(n,{webkitRelativePath:{writable:!1}})),t(n)}),n)})));else if(e.isDirectory){const t=yield function(e){return KP(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{const r=e.createReader();let i=[];!function e(){r.readEntries((n=>{const r=Array.prototype.slice.apply(n);i=i.concat(r),r.length?e():t(i)}),n)}()}))}))}(e);for(let i=0;i<t.length;i++){const s=t[i];yield n(s,`${r}${e.name}/`)}}}));try{const r=e.map((e=>n(e.webkitGetAsEntry())));yield Promise.all(r);return yield Promise.all(t)}catch(e){return console.warn("Captured error while loop directory."),console.error(e),[]}}))}var YP=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};const{FILE_STATUS_UPLOADING:ZP,FILE_STATUS_SUCCESS:JP,FILE_STATUS_UPLOAD_FAIL:QP,FILE_STATUS_VALID_FAIL:eI,FILE_STATUS_WAIT_UPLOAD:tI,DRAG_AREA_DEFAULT:nI,DRAG_AREA_LEGAL:rI,TRIGGER_AUTO:iI}=HP;const sI=class extends c{updateFileListInternal(e,t){this._batchFileList&&(this._batchFileList=e),this._latestFileList=e,this._adapter.updateFileList(e,t)}syncLatestFileList(e){this._latestFileList=e.slice()}getLatestFileList(){return this._batchFileList||this._latestFileList||this.getState("fileList")}constructor(e){super(Object.assign({},e)),this.destroyState=!1,this._localUrls={},this._pasteHandled=!1,this._batchFileList=null,this._latestFileList=null}init(){this.destroyState=!1,this.syncLatestFileList(this.getState("fileList")),this._syncLocalUrlsFromFileList();const{disabled:e,addOnPasting:t}=this.getProps();t&&!e&&this.bindPastingHandler()}_syncLocalUrlsFromFileList(){const{fileList:e}=this.getStates(),t={};if(!Array.isArray(e))return this._localUrls={},void this._adapter.updateLocalUrls([]);e.forEach((e=>{const n=e&&e.uid,r=e&&e.url,i=e&&e.fileInstance,s="undefined"!=typeof File&&i instanceof File;n&&"string"==typeof r&&r.startsWith("blob:")&&s&&(t[n]=r)})),this._localUrls=t,this._adapter.updateLocalUrls(Object.values(this._localUrls))}destroy(){const{disabled:e,addOnPasting:t}=this.getProps();e||this.unbindPastingHandler(),this._batchFileList=null,this._latestFileList=null,this.destroyState=!0}_releaseFileUrl(e){if(!e)return;const t=this._localUrls&&this._localUrls[e];if(!t)return;this._releaseBlob(t);const n=Object.assign({},this._localUrls||{});delete n[e],this._localUrls=n,this._adapter.updateLocalUrls(Object.values(this._localUrls))}_releaseAllFileUrls(){const e=this._localUrls;e&&"object"==typeof e&&(Object.keys(e).forEach((t=>{const n=e[t];n&&this._releaseBlob(n)})),this._localUrls={},this._adapter.updateLocalUrls([]))}getError(e){let{action:t,xhr:n,message:r,fileName:i}=e;const s=n?n.status:0,o=new Error(r||`cannot post ${i} to ${t}, xhr status: ${s}'`);return o.status=s,o.method="post",o.url=t,o}getBody(e){if(!e)return;const t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}checkFileSize(e){const{size:t}=e,{maxSize:n,minSize:r}=this.getProps();let i=!1;return(t>n*WP||t<r*WP)&&(i=!0),i}handleChange(e){const t=[],{limit:n,transformFile:r,accept:i}=this.getProps(),{fileList:s}=this.getStates();let o=Array.from(e);if(void 0!==i&&(o=o.filter((e=>{const n=this.checkFileFormat(i,e);return n||t.push(e),n})),0!==t.length&&this._adapter.notifyAcceptInvalid(t),0===o.length))return;o=o.map((e=>(r&&(e=r(e)),e.uid||(e.uid=Ke()),this.checkFileSize(e)&&(e._sizeInvalid=!0,e.status=eI,this._adapter.notifySizeError(e,s)),e)));const a=s.length+o.length;if(void 0!==n&&a>n){if(this._adapter.notifyExceed(o),1===n)return o=o.slice(-1),this._adapter.notifyFileSelect(o),this._adapter.resetInput(),void this.replaceFileList(o);const e=n-s.length;o=o.slice(0,e)}this._adapter.notifyFileSelect(o),this._adapter.resetInput(),this.addFilesToList(o)}handleReplaceChange(e){if(0===e.length)return;const{transformFile:t,uploadTrigger:n,accept:r}=this.getProps(),{replaceIdx:i,fileList:s}=this.getStates();let o=Array.from(e).pop();if(void 0!==r&&!this.checkFileFormat(r,o))return void this._adapter.notifyAcceptInvalid([o]);t&&(o=t(o)),o.uid||(o.uid=Ke()),this.checkFileSize(o)&&(o._sizeInvalid=!0,o.status=eI,this._adapter.notifySizeError(o,s)),this._adapter.notifyFileSelect([o]);const a=this.buildFileItem(o,n),l=[...s],c=l[i];c&&c.uid&&this._releaseFileUrl(c.uid),l.splice(i,1,a),this._adapter.notifyChange({currentFile:a,fileList:l}),this.updateFileListInternal(l,(()=>{this._adapter.resetReplaceInput(),a._sizeInvalid||this.upload(a)}))}buildFileItem(e,t){const{_sizeInvalid:n,status:r}=e;try{delete e._sizeInvalid,delete e.status}catch(e){}const i={status:r||(t===iI?ZP:tI),name:e.name,size:qP(e.size),uid:e.uid,percent:0,fileInstance:e,url:this._createURL(e,e.uid)};return n&&(i._sizeInvalid=!0),this.isImage(e)&&(i.preview=!0),i}replaceFileList(e){const{uploadTrigger:t}=this.getProps(),n=e.map((e=>this.buildFileItem(e,t)));this._adapter.notifyChange({fileList:n,currentFile:n[0]}),this.updateFileListInternal(n,(()=>{t===iI&&this.startUpload(n)}))}addFilesToList(e){const t=this.getState("fileList").slice(),{uploadTrigger:n}=this.getProps(),r=e.map((e=>this.buildFileItem(e,n)));r.forEach((e=>{const n=t.findIndex((t=>t.uid===e.uid));-1!==n?t[n]=e:(t.push(e),this._adapter.notifyChange({fileList:t,currentFile:e}))})),this.updateFileListInternal(t,(()=>{n===iI&&this.startUpload(r)}))}insertFileToList(e,t){const{limit:n,transformFile:r,accept:i,uploadTrigger:s}=this.getProps(),{fileList:o}=this.getStates(),a=[];let l=Array.from(e);if(void 0!==i&&(l=l.filter((e=>{const t=this.checkFileFormat(i,e);return t||a.push(e),t})),0!==a.length&&this._adapter.notifyAcceptInvalid(a),0===l.length))return;l=l.map((e=>(e.uid||(e.uid=Ke()),this.checkFileSize(e)&&(e._sizeInvalid=!0,e.status=eI,this._adapter.notifySizeError(e,o)),r&&(e=r(e)),e)));const c=o.length+l.length;if(void 0!==n&&c>n){if(1===n)return l=l.slice(-1),this._adapter.notifyFileSelect(l),this._adapter.resetInput(),void this.replaceFileList(l);const e=n-o.length;l=l.slice(0,e),this._adapter.notifyExceed(l)}const d=l.map((e=>this.buildFileItem(e,s))),h=o.slice();void 0!==t?h.splice(t,0,...d):h.push(...d),this._adapter.notifyFileSelect(l),this._adapter.notifyChange({fileList:h,currentFile:null}),this.updateFileListInternal(h,(()=>{s===iI&&this.startUpload(d)}))}manualUpload(){const e=this.getLatestFileList().filter((e=>e.status===tI));this.startUpload(e)}startUpload(e){this._batchFileList=this.getLatestFileList().slice();try{e.forEach((e=>{e._sizeInvalid||this.upload(e)}))}finally{this._batchFileList=null}}upload(e){const{beforeUpload:t}=this.getProps();if(void 0!==t){if("function"==typeof t){const t=this.getLatestFileList(),n=this._adapter.notifyBeforeUpload({file:e,fileList:t});switch(!0){case!0===n:this.post(e);break;case!1===n:{const t={shouldUpload:!1,status:HP.FILE_STATUS_VALID_FAIL};this.handleBeforeUploadResultInObject(t,e);break}case n&&qb(n):Promise.resolve(n).then((t=>{let n={shouldUpload:!0};"Object"===Object.prototype.toString.call(t).slice(8,-1)&&(n=Object.assign(Object.assign({},n),t)),this.handleBeforeUploadResultInObject(n,e)}),(t=>{let n={shouldUpload:!1,status:HP.FILE_STATUS_VALID_FAIL};"Object"===Object.prototype.toString.call(t).slice(8,-1)&&(n=Object.assign(Object.assign({},n),t)),this.handleBeforeUploadResultInObject(n,e)}));break;case"object"==typeof n:this.handleBeforeUploadResultInObject(n,e)}}}else this.post(e)}handleBeforeUploadResultInObject(e,t){const{shouldUpload:n,status:r,autoRemove:i,validateMessage:s,fileInstance:o}=e;let a=this.getLatestFileList().slice();if(i)this._releaseFileUrl(t.uid),a=a.filter((e=>e.uid!==t.uid));else{const e=this._getFileIndex(t,a);if(e<0)return;r&&(a[e].status=r),s&&(a[e].validateMessage=s),o&&(o.uid=t.uid,a[e].fileInstance=o,a[e].size=qP(o.size),a[e].name=o.name,this._releaseFileUrl(t.uid),a[e].url=this._createURL(o,t.uid)),a[e].shouldUpload=n}this.updateFileListInternal(a),this._adapter.notifyChange({fileList:a,currentFile:t}),n&&this.post(t)}post(e){const{fileInstance:t}=e,n=this.getProps();if("undefined"==typeof XMLHttpRequest)return;const r=new XMLHttpRequest,i=new FormData,{action:s}=n;let{data:o}=n;o&&("function"==typeof o&&(o=o(t)),Object.keys(o).forEach((e=>{i.append(e,o[e])})));const a=n.name||n.fileName||t.name;if(n.customRequest)return n.customRequest({fileName:a,data:o,file:e,fileInstance:t,onProgress:e=>this.handleProgress({e,fileInstance:t}),onError:(e,n)=>this.handleError({e:n,xhr:e,fileInstance:t}),onSuccess:(e,n)=>this.handleSuccess({response:e,fileInstance:t,e:n,isCustomRequest:!0}),withCredentials:n.withCredentials,action:n.action});i.append(a,t),r.open("post",s,!0),n.withCredentials&&"withCredentials"in r&&(r.withCredentials=!0),r.upload&&(r.upload.onprogress=e=>{this.destroyState?r.abort():this.handleProgress({e,fileInstance:t})}),r.onload=e=>{this.destroyState||this.handleOnLoad({e,xhr:r,fileInstance:t})},r.onerror=e=>{this.destroyState||this.handleError({e,xhr:r,fileInstance:t})};let l=n.headers||{};"function"==typeof l&&(l=l(t));for(const e in l)Object.prototype.hasOwnProperty.call(l,e)&&null!==l[e]&&r.setRequestHeader(e,l[e]);r.send(i)}handleProgress(e){let{e:t,fileInstance:n}=e;const r=this.getLatestFileList().slice();let i=0;t.total>0&&(i=Number((t.loaded/t.total*100*UP).toFixed(0))||0);const s=this._getFileIndex(n,r);s<0||(r[s].percent=i,r[s].status=ZP,this._adapter.notifyProgress(i,n,r),this.updateFileListInternal(r),this._adapter.notifyChange({fileList:r,currentFile:r[s]}))}handleOnLoad(e){let{e:t,xhr:n,fileInstance:r}=e;const i=this.getLatestFileList(),s=this._getFileIndex(r,i);s<0||(n.status<200||n.status>=300?this.handleError({e:t,xhr:n,fileInstance:r}):this.handleSuccess({e:t,xhr:n,fileInstance:r,index:s}))}handleSuccess(e){let{e:t,fileInstance:n,isCustomRequest:r=!1,xhr:i,response:s}=e;const o=this.getLatestFileList();let a=null;const l=this._getFileIndex(n,o);if(l<0)return;a=r?s:this.getBody(i);const c=o.slice(),{afterUpload:d}=this.getProps();if(c[l].status=JP,c[l].percent=100,this._adapter.notifyProgress(100,n,c),c[l].response=a,t&&(c[l].event=t),d&&"function"==typeof d){const{autoRemove:e,status:t,validateMessage:n,name:r,url:i}=this._adapter.notifyAfterUpload({response:a,file:c[l],fileList:c})||{};t&&(c[l].status=t),n&&(c[l].validateMessage=n),r&&(c[l].name=r),i&&(this._releaseFileUrl(c[l].uid),c[l].url=i),e&&(this._releaseFileUrl(c[l].uid),c.splice(l,1))}this._adapter.notifySuccess(a,n,c),this._adapter.notifyChange({fileList:c,currentFile:c[l]}),this.updateFileListInternal(c)}_getFileIndex(e,t){return t.findIndex((t=>t.uid===e.uid))}handleRemove(e){const{disabled:t}=this.getProps();if(t)return;const{fileList:n}=this.getStates();Promise.resolve(this._adapter.notifyBeforeRemove(e,n)).then((t=>{if(!1===t)return;const r=n.slice(),i=this._getFileIndex(e,n);i<0||(r.splice(i,1),this._releaseFileUrl(e.uid),this._adapter.notifyRemove(e.fileInstance,r,e),this.updateFileListInternal(r),this._adapter.notifyChange({fileList:r,currentFile:e}))}))}handleError(e){let{e:t,xhr:n,fileInstance:r}=e;const i=this.getLatestFileList(),s=this._getFileIndex(r,i);if(s<0)return;const{action:o}=this.getProps(),a=i.slice(),l=this.getError({action:o,xhr:n,fileName:r.name});a[s].status=QP,a[s].response=l,a[s].event=t,this._adapter.notifyError(l,r,a,n),this.updateFileListInternal(a),this._adapter.notifyChange({currentFile:a[s],fileList:a})}handleClear(){const{disabled:e}=this.getProps(),{fileList:t}=this.getStates();e||Promise.resolve(this._adapter.notifyBeforeClear(t)).then((e=>{!1!==e&&(this._releaseAllFileUrls(),this.updateFileListInternal([]),this._adapter.notifyClear(),this._adapter.notifyChange({fileList:[]}))})).catch((e=>{}))}_createURL(e,t){const n=URL.createObjectURL(e),r=Object.assign({},this._localUrls||{});return t&&r[t]&&r[t]!==n&&this._releaseBlob(r[t]),t&&(r[t]=n),this._localUrls=r,this._adapter.updateLocalUrls(Object.values(this._localUrls)),n}releaseMemory(){if(this._localUrls&&Object.keys(this._localUrls).length)return void this._releaseAllFileUrls();const{localUrls:e}=this.getStates();e&&(Array.isArray(e)?e.forEach((e=>{this._releaseBlob(e)})):"object"==typeof e&&Object.keys(e).forEach((t=>{const n=e[t];n&&this._releaseBlob(n)})))}_releaseBlob(e){try{URL.revokeObjectURL(e)}catch(e){console.log(e)}}isImage(e){return/(webp|svg|png|gif|jpg|jpeg|bmp|dpg)$/i.test(e.type)}isMultiple(){return Boolean(this.getProp("multiple"))}handleDragEnter(e){e.preventDefault(),e.stopPropagation(),this._dragEnterTarget=e.currentTarget;const{disabled:t}=this.getProps();t||this._adapter.updateDragAreaStatus(rI)}handleDirectoryDrop(e){return YP(this,void 0,void 0,(function*(){const t=this.getState("fileList").slice(),n=[].slice.call(e.dataTransfer.items),r=yield XP(n);this.handleChange(r),this._adapter.updateDragAreaStatus(nI),this._adapter.notifyDrop(e,r,t)}))}handleDrop(e){e.preventDefault(),e.stopPropagation();const{disabled:t,directory:n}=this.getProps(),r=this.getState("fileList").slice();if(!t){if(n)return void this.handleDirectoryDrop(e);const t=Array.from(e.dataTransfer.files);this.handleChange(t),this._adapter.updateDragAreaStatus(nI),this._adapter.notifyDrop(e,t,r)}}handleDragOver(e){e.preventDefault(),e.stopPropagation()}handleDragLeave(e){e.preventDefault(),e.stopPropagation(),this._dragEnterTarget===e.target&&this._adapter.updateDragAreaStatus(nI)}checkFileFormat(e,t){const n=e.split(",").map((e=>e.trim())).filter((e=>e)),r=t.type||"",i=r.replace(/\/.*$/,"");return n.some((e=>{if("."===e.charAt(0)){const r=t.name||"",i=e.split(".").pop().toLowerCase();return n=r.toLowerCase(),s=i,-1!==n.indexOf(s,n.length-s.length)}var n,s;if(/\/\*$/.test(e)){const t=e.replace(/\/.*$/,"");return i===t}return!!/^[^\/]+\/[^\/]+$/.test(e)&&r===e}))}retry(e){const{onRetry:t}=this.getProps();t&&"function"==typeof t&&t(e),this.post(e)}handlePreviewClick(e){this._adapter.notifyPreviewClick(e)}readFileFromClipboard(e){for(const t of e)for(const e of t.types)e.startsWith("image")&&t.getType(e).then((e=>e.arrayBuffer())).then((t=>{const n=e.split("/")[1],r=new File([t],`upload.${n}`,{type:e});this.handleChange([r])}))}handlePasting(e){const{addOnPasting:t}=this.getProps();if(!t)return;if("paste"===e.type&&e.clipboardData&&e.clipboardData.items){const t=e.clipboardData.items,n=[];for(let e=0;e<t.length;e++){const r=t[e];if("file"===r.kind){const e=r.getAsFile();e&&n.push(e)}}if(n.length>0)return e.preventDefault(),this.handleChange(n),this._pasteHandled=!0,void setTimeout((()=>{this._pasteHandled=!1}),100)}if(this._pasteHandled)return void(this._pasteHandled=!1);if((this._adapter.isMac()?e.metaKey:e.ctrlKey)&&"KeyV"===e.code){if(!navigator.clipboard||"function"!=typeof navigator.clipboard.read)return;const e="clipboard-read";navigator.permissions.query({name:e}).then((e=>{"granted"===e.state||"prompt"===e.state?navigator.clipboard.read().then((e=>{this.readFileFromClipboard(e)})).catch((e=>{this._adapter.notifyPastingError(e)})):this._adapter.notifyPastingError(e)})).catch((e=>{this._adapter.notifyPastingError(e)}))}}bindPastingHandler(){this._adapter.registerPastingHandler((e=>this.handlePasting(e))),this._adapter.registerPasteEventHandler((e=>this.handlePasting(e)))}unbindPastingHandler(){this._adapter.unRegisterPastingHandler(),this._adapter.unRegisterPasteEventHandler()}};const oI=class extends c{constructor(e){super(Object.assign({},e))}handleImageError(e){this._adapter.updateFallbackPreview(!0)}};const aI=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 12a7.5 7.5 0 0 1 13.8-4.07l-2-.4a1.5 1.5 0 0 0-.6 2.94l5 1c.76.15 1.51-.3 1.74-1.04l1.5-5a1.5 1.5 0 1 0-2.88-.86l-.43 1.45A10.49 10.49 0 0 0 1.5 12a10.5 10.5 0 0 0 20.4 3.5 1.5 1.5 0 1 0-2.83-1A7.5 7.5 0 0 1 4.5 12Z",fill:"currentColor"}))}),"refresh");function lI(e){return h().isValidElement(e)}function cI(e){return 0===h().Children.count(e)}const dI=BP.PREFIX,hI=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return h().createElement("svg",Object.assign({focusable:!1,"aria-hidden":!0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),h().createElement("circle",{cx:"7.99992",cy:"7.99992",r:"6.66667",fill:"white"}),h().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.3332 8.00008C15.3332 12.0502 12.0499 15.3334 7.99984 15.3334C3.94975 15.3334 0.666504 12.0502 0.666504 8.00008C0.666504 3.94999 3.94975 0.666748 7.99984 0.666748C12.0499 0.666748 15.3332 3.94999 15.3332 8.00008ZM8.99984 11.6667C8.99984 11.1145 8.55212 10.6667 7.99984 10.6667C7.44755 10.6667 6.99984 11.1145 6.99984 11.6667C6.99984 12.219 7.44755 12.6667 7.99984 12.6667C8.55212 12.6667 8.99984 12.219 8.99984 11.6667ZM7.99984 3.33341C7.27573 3.33341 6.7003 3.94171 6.74046 4.66469L6.94437 8.33495C6.97549 8.89513 7.4388 9.33341 7.99984 9.33341C8.56087 9.33341 9.02419 8.89513 9.05531 8.33495L9.25921 4.66469C9.29938 3.94171 8.72394 3.33341 7.99984 3.33341Z",fill:"#F93920"}))},uI=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return h().createElement("svg",Object.assign({focusable:!1,"aria-hidden":!0,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),h().createElement("circle",{cx:"14",cy:"14",r:"14",fill:"#16161A",fillOpacity:"0.6"}),h().createElement("path",{d:"M9 10.25V18.25L10.25 13.25H17.875V11.75C17.875 11.4739 17.6511 11.25 17.375 11.25H14L12.75 9.75H9.5C9.22386 9.75 9 9.97386 9 10.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h().createElement("path",{d:"M18 18.25L19 13.25H10.2031L9 18.25H18Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))},pI=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return h().createElement("svg",Object.assign({focusable:!1,"aria-hidden":!0,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),h().createElement("path",{d:"M6 17V7.58824C6 7.26336 6.26863 7 6.6 7H10.5L12 8.76471H16.05C16.3814 8.76471 16.65 9.02806 16.65 9.35294V11.1176H7.5L6 17ZM6 17L7.44375 11.1176H18L16.8 17L6 17Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};class fI extends f{constructor(e){super(e),this.state={fallbackPreview:!1},this.foundation=new oI(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{updateFallbackPreview:e=>this.setState({fallbackPreview:e})})}transSize(e){return"number"==typeof e?qP(e):e}renderValidateMessage(){const{status:e,validateMessage:t}=this.props;let n=null;switch(!0){case"string"==typeof t&&e===HP.FILE_STATUS_VALIDATING:n=h().createElement(h().Fragment,null,h().createElement(dr,{size:"small",wrapperClassName:`${dI}-file-card-icon-loading`}),t);break;case"string"==typeof t:n=h().createElement(h().Fragment,null,h().createElement(ns,{className:`${dI}-file-card-icon-error`}),t);break;case lI(t):n=t}return n}renderPicValidateMsg(){const{status:e,validateMessage:t}=this.props;let n=null;switch(!0){case t&&e===HP.FILE_STATUS_VALIDATING:n=h().createElement("span",{className:`${dI}-tooltip-children-wrapper ${dI}-picture-file-card-icon-loading`},h().createElement(dr,{size:"small"}));break;case t&&(e===HP.FILE_STATUS_VALID_FAIL||e===HP.FILE_STATUS_UPLOAD_FAIL):n=h().createElement("div",{className:`${dI}-picture-file-card-icon-error`},h().createElement(hI,null))}return n?h().createElement(_t,{content:t,trigger:"hover",position:"bottom"},n):null}renderPic(e){const{fallbackPreview:t}=this.state,{url:n,percent:r,status:i,disabled:s,style:o,onPreviewClick:a,showPicInfo:l,renderPicInfo:c,renderPicClose:d,renderPicPreviewIcon:u,renderThumbnail:p,name:f,index:m,picHeight:g,picWidth:y}=this.props,v=i===HP.FILE_STATUS_UPLOADING&&100!==r,b=i===HP.FILE_STATUS_UPLOAD_FAIL&&this.props.showRetry,x=i===HP.FILE_STATUS_SUCCESS&&this.props.showReplace,E=i===HP.FILE_STATUS_SUCCESS&&!this.props.showReplace,C="function"==typeof p,S=w()({[`${dI}-picture-file-card`]:!0,[`${dI}-picture-file-card-preview-fallback`]:t,[`${dI}-picture-file-card-disabled`]:s,[`${dI}-picture-file-card-show-pointer`]:void 0!==a,[`${dI}-picture-file-card-error`]:i===HP.FILE_STATUS_UPLOAD_FAIL,[`${dI}-picture-file-card-uploading`]:v,[`${dI}-picture-file-card-custom-thumbnail`]:C&&g&&y}),_=h().createElement("div",{role:"button",tabIndex:0,className:`${dI}-picture-file-card-retry`,onClick:e=>this.onRetry(e)},h().createElement(aI,{className:`${dI}-picture-file-card-icon-retry`})),k=h().createElement(_t,{trigger:"hover",position:"top",content:e.replace,showArrow:!1,spacing:4},h().createElement("div",{role:"button",tabIndex:0,className:`${dI}-picture-file-card-replace`,onClick:e=>this.onReplace(e)},h().createElement(uI,{className:`${dI}-picture-file-card-icon-replace`}))),O=h().createElement("div",{className:`${dI}-picture-file-card-preview`},"function"==typeof u?u(this.props):null),T=h().createElement(h().Fragment,null,"function"==typeof d?h().createElement(h().Fragment,null,d({className:`${dI}-picture-file-card-close`,remove:e=>this.onRemove(e)})):h().createElement("div",{role:"button",tabIndex:0,className:`${dI}-picture-file-card-close`,onClick:e=>this.onRemove(e)},h().createElement(gr,{className:`${dI}-picture-file-card-icon-close`}))),P="function"==typeof c?c(this.props):h().createElement("div",{className:`${dI}-picture-file-card-pic-info`},m+1);let I={},M=o?Object.assign({},o):{};g&&(M.height=g,I.height=g),y&&(M.width=y,I.width=y);const R=t?h().createElement(cP,{size:"large"}):h().createElement("img",{src:n,alt:f,onError:e=>this.foundation.handleImageError(e),style:I}),A=C?p(this.props):R;return h().createElement("div",{role:"listitem",className:S,style:M,onClick:a},A,v?h().createElement(gS,{percent:r,type:"circle",size:"small",orbitStroke:"#FFF","aria-label":"uploading file progress"}):null,b?_:null,x&&k,E&&O,l&&P,!s&&T,this.renderPicValidateMsg())}renderFile(e){const{name:t,size:n,percent:r,url:i,showRetry:s,showReplace:o,preview:a,previewFile:l,status:c,style:d,onPreviewClick:u,renderFileOperation:p,showTooltip:f}=this.props,{fallbackPreview:m}=this.state,g=w()({[`${dI}-file-card`]:!0,[`${dI}-file-card-fail`]:c===HP.FILE_STATUS_VALID_FAIL||c===HP.FILE_STATUS_UPLOAD_FAIL,[`${dI}-file-card-show-pointer`]:void 0!==u}),y=w()({[`${dI}-file-card-preview`]:!0,[`${dI}-file-card-preview-placeholder`]:!a||l||m}),v=`${dI}-file-card-info`,b=`${dI}-file-card-close`,x=`${dI}-file-card-replace`,E=!(100===r||void 0===r)&&c===HP.FILE_STATUS_UPLOADING,C=c===HP.FILE_STATUS_UPLOAD_FAIL&&s,S=c===HP.FILE_STATUS_SUCCESS&&o,_=this.transSize(n);let k=a&&!m?h().createElement("img",{src:i,alt:t,onError:e=>this.foundation.handleImageError(e)}):h().createElement(cP,{size:"large"});l&&(k=l(this.props));const O="function"==typeof p?p(this.props):h().createElement(vs,{onClick:e=>this.onRemove(e),type:"tertiary",icon:h().createElement(Ji,null),theme:"borderless",size:"small",className:b});return h().createElement("div",{role:"listitem",className:g,style:d,onClick:u},h().createElement("div",{className:y},k),h().createElement("div",{className:`${v}-main`},h().createElement("div",{className:`${v}-main-text`},h().createElement(Un.Text,{className:`${v}-name`,ellipsis:{showTooltip:f}},t),h().createElement("span",null,h().createElement("span",{className:`${v}-size`},_),S&&h().createElement(_t,{trigger:"hover",position:"top",showArrow:!1,content:e.replace},h().createElement("span",{className:`${dI}-tooltip-children-wrapper ${x}`},h().createElement(vs,{onClick:e=>this.onReplace(e),type:"tertiary",theme:"borderless",size:"small",icon:h().createElement(pI,null)}))))),E?h().createElement(gS,{percent:r,style:{width:"100%"},"aria-label":"uploading file progress"}):null,h().createElement("div",{className:`${v}-main-control`},h().createElement("span",{className:`${v}-validate-message`},this.renderValidateMessage()),C?h().createElement("span",{role:"button",tabIndex:0,className:`${v}-retry`,onClick:e=>this.onRetry(e)},e.retry):null)),O)}onRemove(e){e.stopPropagation(),this.props.onRemove()}onReplace(e){e.stopPropagation(),this.props.onReplace()}onRetry(e){e.stopPropagation(),this.props.onRetry()}render(){const{listType:e}=this.props;return e===HP.FILE_LIST_PIC?h().createElement(Jt,{componentName:"Upload"},(e=>this.renderPic(e))):e===HP.FILE_LIST_DEFAULT?h().createElement(Jt,{componentName:"Upload"},(e=>this.renderFile(e))):null}}fI.propTypes={className:E().string,disabled:E().bool,listType:E().string,name:E().string,onPreviewClick:E().func,onRemove:E().func,onReplace:E().func,onRetry:E().func,percent:E().number,preview:E().bool,previewFile:E().func,picWidth:E().oneOfType([E().number,E().string]),picHeight:E().oneOfType([E().number,E().string]),showReplace:E().bool,showRetry:E().bool,size:E().oneOfType([E().number,E().string]),status:E().string,style:E().object,url:E().string,validateMessage:E().node,index:E().number,showTooltip:E().oneOfType([E().bool,E().object])},fI.defaultProps={listType:HP.FILE_LIST_DEFAULT,name:"",onRemove:()=>{},onRetry:()=>{},preview:!1,size:"",showTooltip:!0};const mI=fI;const gI=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.84 8.06A6.5 6.5 0 1 0 5.18 11 4.5 4.5 0 0 0 5.5 20H17a6 6 0 0 0 .84-11.94Zm-5.52.2a.5.5 0 0 0-.64 0l-5.15 4.3a.25.25 0 0 0 .16.44H10v4.5c0 .28.22.5.5.5h3a.5.5 0 0 0 .5-.5V13h3.31c.23 0 .34-.3.16-.44l-5.15-4.3Z",fill:"currentColor"}))}),"upload");__webpack_require__("ivmT");function yI(e,t){let[n,r]=t;return Math.min(Math.max(e,n),r)}function vI(e,t,n){return e/t>n?e=t*n:t=e/n,[e,t]}class bI extends c{constructor(e){super(Object.assign({},e)),this.getImgDataWhenResize=e=>{const{imgData:t}=this.getStates(),n={width:t.width*e,height:t.height*e,centerPoint:{x:t.centerPoint.x*e,y:t.centerPoint.y*e}};return this.imgData.scale*=e,n},this.getCropperBoxWhenResize=(e,t)=>{const{cropperBox:n}=this.getStates(),{aspectRatio:r}=this.getProps(),i={width:n.width*e,height:n.height*e,centerPoint:{x:n.centerPoint.x*e,y:n.centerPoint.y*e}};let s=i.centerPoint.x-i.width/2,o=i.centerPoint.x+i.width/2,a=i.centerPoint.y-i.height/2,l=i.centerPoint.y+i.height/2;return r?(o>t.width&&(o=t.width,s=i.width>t.width?0:t.width-i.width,i.width=o-s,i.height=i.width/r,l=a+i.height),l>t.height&&(l=t.height,a=i.height>t.height?0:t.height-i.height,i.height=l-a,i.width=i.height*r,o=s+i.width)):(o>t.width&&(o=t.width,s=i.width>t.width?0:t.width-i.width),l>t.height&&(l=t.height,a=i.height>t.height?0:t.height-i.height)),{width:o-s,height:l-a,centerPoint:{x:(o+s)/2,y:(l+a)/2}}},this.handleResize=()=>{const{loaded:e}=this.getStates();if(!this.initial)return void(this.initial=!0);if(!e)return;const t=this._adapter.getContainer(),n={width:t.clientWidth,height:t.clientHeight},r=n.width/this.containerData.width,i=this.getImgDataWhenResize(r),s=this.getCropperBoxWhenResize(r,n);this.containerData=n,this.setState({imgData:i,cropperBox:s})},this.handleImageLoad=e=>{const{naturalWidth:t,naturalHeight:n}=e.target,{width:r,height:i}=this.containerData;this.imgData.originalWidth=t,this.imgData.originalHeight=n;let s=1;const o={};t/r>n/i?(s=r/t,o.width=r,o.height=n*s):(s=i/n,o.width=t*s,o.height=i),this.imgData.scale=s,o.centerPoint={},o.centerPoint.x=r/2,o.centerPoint.y=i/2;const a={},{defaultAspectRatio:l,aspectRatio:c}=this.getProps(),d=c||l;r/i>d?(a.width=i*d,a.height=i):(a.width=r,a.height=r/d),a.centerPoint={},a.centerPoint.x=r/2,a.centerPoint.y=i/2,this.setState({imgData:o,cropperBox:a,loaded:!0}),this.renderPreview()},this.renderPreview=()=>{const{preview:e,src:t}=this.getProps(),n=null==e?void 0:e();if(!n)return;const r=document.createElement("img");this.previewImg=r,this.previewContainer=n,r.src=t,n.appendChild(r),this.previewContainer.style.overflow="hidden";const{width:i,height:s}=n.getBoundingClientRect();this.previewContainerInitSize={width:i,height:s}},this.updatePreview=e=>{if(!this.previewImg)return;const{cropperBox:t}=this.getStates();let n=1;const{width:r,height:i}=this.previewContainerInitSize;let s=r,o=i;if(s<o){n=r/t.width;let e=n*t.height;e>i?(n=i/t.height,s=n*t.width):o=e}else{n=i/t.height;let e=n*t.width;e>r?(n=r/t.width,o=n*t.height):s=e}const{width:a,height:l,translateX:c,translateY:d,rotate:h}=e;this.previewImg.style.width=a*n+"px",this.previewImg.style.height=l*n+"px",this.previewImg.style.transform=`translate(${c*n}px, ${d*n}px) rotate(${h}deg)`,this.previewImg.style.transformOrigin="center",this.previewContainer.style.width=`${s}px`,this.previewContainer.style.height=`${o}px`},this.removePreview=()=>{this.previewImg&&this.previewContainer&&(this.previewContainer.removeChild(this.previewImg),this.previewImg=null)},this.handleWheel=e=>{e.preventDefault();const{imgData:t,zoom:n}=this.getStates(),{maxZoom:r,minZoom:i,zoomStep:s}=this.getProps();let o;if(e.deltaY<0?n+s<=r&&(o=Number((n+s).toFixed(2))):e.deltaY>0&&n-s>=i&&(o=Number((n-s).toFixed(2))),void 0===o)return;const a=e.currentTarget.getBoundingClientRect(),l=e.clientX-a.left,c=-(e.clientY-a.top),d=Object.assign({},t.centerPoint);d.y=-d.y;const h={x:(d.x-l)/n*o+l,y:-[(d.y-c)/n*o+c]},u={width:t.width/n*o,height:t.height/n*o,centerPoint:h};this.setState({imgData:u,zoom:o}),this._adapter.notifyZoomChange(o)},this.getRangeForAspectChange=()=>{const{cropperBox:e}=this.getStates(),{aspectRatio:t}=this.getProps(),{width:n,height:r}=this.containerData;let i,s;const o=e.centerPoint.x-e.width/2,a=e.centerPoint.x+e.width/2,l=e.centerPoint.y-e.height/2,c=e.centerPoint.y+e.height/2;switch(this.boxMoveDir){case"tl":i=c,s=a,[s,i]=vI(s,i,t),this.rangeX=[a-s,a],this.rangeY=[c-i,c];break;case"tm":i=c;const d=e.centerPoint.x,h=n-e.centerPoint.x;s=2*(d<h?d:h),[s,i]=vI(s,i,t),this.rangeX=[e.centerPoint.x-s/2,e.centerPoint.x+s/2],this.rangeY=[c-i,c];break;case"tr":i=c,s=n-o,[s,i]=vI(s,i,t),this.rangeX=[o,o+s],this.rangeY=[c-i,c];break;case"ml":s=a;const u=e.centerPoint.y,p=r-e.centerPoint.y;i=2*(u<p?u:p),[s,i]=vI(s,i,t),this.rangeX=[a-s,a],this.rangeY=[e.centerPoint.y-i/2,e.centerPoint.y+i/2];break;case"mr":s=n-o;const f=e.centerPoint.y,m=r-e.centerPoint.y;i=2*(f<m?f:m),[s,i]=vI(s,i,t),this.rangeX=[o,o+s],this.rangeY=[e.centerPoint.y-i/2,e.centerPoint.y+i/2];break;case"bl":i=r-l,s=a,[s,i]=vI(s,i,t),this.rangeX=[a-s,a],this.rangeY=[l,l+i];break;case"bm":i=r-l;const g=e.centerPoint.x,y=n-e.centerPoint.x;s=2*(g<y?g:y),[s,i]=vI(s,i,t),this.rangeX=[e.centerPoint.x-s/2,e.centerPoint.x+s/2],this.rangeY=[l,l+i];break;case"br":i=r-l,s=n-o,[s,i]=vI(s,i,t),this.rangeX=[o,o+s],this.rangeY=[l,l+i]}},this.handleCornerMouseDown=e=>{const t=e.currentTarget;if(!t)return;e.preventDefault();const n=t.dataset.dir;this.boxMoveDir=n,this.boxMoveParam=this.getMoveParamByDir(n),this.bindResizeEvent();const{aspectRatio:r}=this.getProps();r?this.getRangeForAspectChange():(this.rangeX=[0,this.containerData.width],this.rangeY=[0,this.containerData.height])},this.bindResizeEvent=()=>{const{aspectRatio:e}=this.getProps();document.addEventListener("mousemove",e?this.handleCornerAspectMouseMove:this.handleCornerMouseMove),document.addEventListener("mouseup",this.handleCornerMouseUp)},this.unBindResizeEvent=()=>{const{aspectRatio:e}=this.getProps();document.removeEventListener("mousemove",e?this.handleCornerAspectMouseMove:this.handleCornerMouseMove),document.removeEventListener("mouseup",this.handleCornerMouseUp)},this.viewIMGDragStart=e=>{e.preventDefault()},this.handleCornerAspectMouseMove=e=>{e.preventDefault();const{clientX:t,clientY:n}=e,{cropperBox:r}=this.getStates(),{aspectRatio:i}=this.getProps(),s=this._adapter.getContainer().getBoundingClientRect(),o={width:r.width,height:r.height,centerPoint:Object.assign({},r.centerPoint)};let a,l;switch(["ml","mr"].includes(this.boxMoveDir)?a=yI(t-s.left,this.rangeX):l=yI(n-s.top,this.rangeY),this.boxMoveDir){case"tl":o.height=this.rangeY[1]-l,o.width=o.height*i,o.centerPoint={x:this.rangeX[1]-o.width/2,y:this.rangeY[1]-o.height/2};break;case"tm":o.height=this.rangeY[1]-l,o.width=o.height*i,o.centerPoint={x:r.centerPoint.x,y:this.rangeY[1]-o.height/2};break;case"tr":o.height=this.rangeY[1]-l,o.width=o.height*i,o.centerPoint={x:this.rangeX[0]+o.width/2,y:this.rangeY[1]-o.height/2};break;case"ml":o.width=this.rangeX[1]-a,o.height=o.width/i,o.centerPoint={x:this.rangeX[1]-o.width/2,y:r.centerPoint.y};break;case"mr":o.width=a-this.rangeX[0],o.height=o.width/i,o.centerPoint={x:this.rangeX[0]+o.width/2,y:r.centerPoint.y};break;case"bl":o.height=l-this.rangeY[0],o.width=o.height*i,o.centerPoint={x:this.rangeX[1]-o.width/2,y:this.rangeY[0]+o.height/2};break;case"bm":o.height=l-this.rangeY[0],o.width=o.height*i,o.centerPoint={x:r.centerPoint.x,y:this.rangeY[0]+o.height/2};break;case"br":o.height=l-this.rangeY[0],o.width=o.height*i,o.centerPoint={x:this.rangeX[0]+o.width/2,y:this.rangeY[0]+o.height/2}}0===o.height&&0===o.width&&(this.changeDir(),this.getRangeForAspectChange()),this.setState({cropperBox:o})},this.changeDir=()=>{this.boxMoveDir.includes("t")?this.boxMoveDir=this.boxMoveDir.replace("t","b"):this.boxMoveDir.includes("b")&&(this.boxMoveDir=this.boxMoveDir.replace("b","t")),this.boxMoveDir.includes("l")?this.boxMoveDir=this.boxMoveDir.replace("l","r"):this.boxMoveDir.includes("r")&&(this.boxMoveDir=this.boxMoveDir.replace("r","l"))},this.handleCornerMouseMove=e=>{e.preventDefault();const{clientX:t,clientY:n}=e,{cropperBox:r}=this.getStates(),i=this._adapter.getContainer().getBoundingClientRect();let s=yI(t-i.left,this.rangeX),o=yI(n-i.top,this.rangeY);const a={width:r.width,height:r.height,centerPoint:{x:r.centerPoint.x,y:r.centerPoint.y}},{paramX:l,paramY:c}=this.boxMoveParam;let d,h;l&&(d=r.centerPoint.x+l*r.width/2,a.width=r.width+l*(s-d),a.width<0&&(a.width=-a.width,this.boxMoveParam.paramX=-l),a.centerPoint.x=s-l*a.width/2),c&&(h=r.centerPoint.y+c*r.height/2,a.height=r.height+c*(o-h),a.height<0&&(a.height=-a.height,this.boxMoveParam.paramY=-c),a.centerPoint.y=o-c*a.height/2),this.setState({cropperBox:a})},this.handleCornerMouseUp=e=>{this.boxMoveParam={paramX:0,paramY:0},this.unBindResizeEvent()},this.handleCropperBoxMouseDown=e=>{const t=e.target,{cropperBox:n}=this.getStates(),r=this._adapter.getContainer().getBoundingClientRect();t.dataset.dir||(this.cropperBoxMoveStart={x:e.clientX,y:e.clientY},this.bindMoveEvent(),this.moveRange={xMin:n.width/2,xMax:r.width-n.width/2,yMin:n.height/2,yMax:r.height-n.height/2})},this.bindMoveEvent=()=>{document.addEventListener("mousemove",this.handleCropperBoxMouseMove),document.addEventListener("mouseup",this.handleCropperBoxMouseUp)},this.unBindMoveEvent=()=>{document.removeEventListener("mousemove",this.handleCropperBoxMouseMove),document.removeEventListener("mouseup",this.handleCropperBoxMouseUp)},this.handleCropperBoxMouseMove=e=>{if(!this.cropperBoxMoveStart)return;const{clientX:t,clientY:n}=e,{cropperBox:r}=this.getStates(),i=t-this.cropperBoxMoveStart.x,s=n-this.cropperBoxMoveStart.y,o=yI(r.centerPoint.x+i,[this.moveRange.xMin,this.moveRange.xMax]),a=yI(r.centerPoint.y+s,[this.moveRange.yMin,this.moveRange.yMax]),l={width:r.width,height:r.height,centerPoint:{x:o,y:a}};this.cropperBoxMoveStart={x:t,y:n},this.setState({cropperBox:l})},this.handleCropperBoxMouseUp=e=>{this.cropperBoxMoveStart&&(this.cropperBoxMoveStart=null,this.unBindMoveEvent())},this.handleMaskMouseDown=e=>{e.currentTarget===e.target&&(this.bindImgMoveEvent(),this.imgMoveStart={x:e.clientX,y:e.clientY})},this.bindImgMoveEvent=()=>{document.addEventListener("mousemove",this.handleImgMove),document.addEventListener("mouseup",this.handleImgMoveUp)},this.unBindImgMoveEvent=()=>{document.removeEventListener("mousemove",this.handleImgMove),document.removeEventListener("mouseup",this.handleImgMoveUp)},this.handleImgMove=e=>{if(!this.imgMoveStart)return;const{clientX:t,clientY:n}=e,{imgData:r}=this.getStates(),i=t-this.imgMoveStart.x,s=n-this.imgMoveStart.y,o=r.centerPoint.x+i,a=r.centerPoint.y+s,l={width:r.width,height:r.height,centerPoint:{x:o,y:a}};this.imgMoveStart={x:t,y:n},this.setState({imgData:l})},this.handleImgMoveUp=e=>{this.imgMoveStart&&(this.imgMoveStart=null,this.unBindImgMoveEvent())},this.getCropperCanvas=()=>{const{cropperBox:e,imgData:t,rotate:n,zoom:r}=this.getStates(),{fill:i}=this.getProps(),s=document.createElement("canvas"),o=s.getContext("2d"),a=this._adapter.getImg(),l=n*Math.PI/180,c=Math.abs(Math.sin(l)),d=Math.abs(Math.cos(l)),h=this.imgData.originalWidth,u=this.imgData.originalHeight,p=h*d+u*c,f=u*d+h*c,m=p*r*this.imgData.scale,g=f*r*this.imgData.scale,y=t.centerPoint.y-g/2,v=t.centerPoint.x-m/2,b=e.centerPoint.x-e.width/2,w=e.centerPoint.y-e.height/2,x=r*this.imgData.scale,E=(b-v)/x,C=(w-y)/x,S=e.width/x,_=e.height/x,k=E+S,O=C+_;if(k<0||O<0||E>p||C>f){const e=document.createElement("canvas"),t=e.getContext("2d");return e.width=S,e.height=_,t.fillStyle=i,t.fillRect(0,0,S,_),e}s.width=p,s.height=f,o.fillStyle=i,o.fillRect(0,0,p,f);const T=p/2,P=f/2;o.translate(T,P),o.rotate(n*Math.PI/180),o.translate(-T,-P);const I=(p-h)/2,M=(f-u)/2;o.drawImage(a,0,0,h,u,I,M,h,u);const R=document.createElement("canvas"),A=R.getContext("2d");let N=E,D=C,L=S,F=_;E<0&&(N=0),C<0&&(D=0),k>p?L=p-N:E<0&&(L=k),O>f?F=f-D:C<0&&(F=O);const j=o.getImageData(N,D,L,F);return R.width=S,R.height=_,A.fillStyle=i,A.fillRect(0,0,S,_),A.putImageData(j,E<0?-E:0,C<0?-C:0),R},this.containerData={},this.imgData={},this.boxMoveDir="",this.boxMoveParam={paramX:0,paramY:0},this.rangeX=null,this.rangeY=null,this.initial=!1,this.previewImg=null,this.previewContainer=null}init(){const e=this._adapter.getContainer();this.containerData.width=e.clientWidth,this.containerData.height=e.clientHeight,this.cropperBoxMoveStart=null}destroy(){this.unBindMoveEvent(),this.unBindResizeEvent(),this.removePreview()}getMoveParamByDir(e){let t=0,n=0;switch(e){case"tl":t=-1,n=-1;break;case"tm":n=-1;break;case"tr":t=1,n=-1;break;case"ml":t=-1;break;case"mr":t=1;break;case"bl":t=-1,n=1;break;case"bm":n=1;break;case"br":t=1,n=1}return{paramX:t,paramY:n}}}const wI=`${C}-cropper`,xI={PREFIX:`${wI}`,IMG:`${wI}-img`,IMG_WRAPPER:`${wI}-img-wrapper`,CROPPER_BOX:`${wI}-box`,CROPPER_VIEW_BOX:`${wI}-view-box`,CROPPER_VIEW_BOX_ROUND:`${wI}-view-box-round`,CROPPER_IMG:`${wI}-view-img`,MASK:`${wI}-mask`,CORNER:`${wI}-box-corner`},EI=["tl","tm","tr","ml","mr","bl","bm","br"],CI=["tm","ml","mr","bm"],SI=xI.PREFIX;class _I extends f{constructor(e){super(e),this.unRegisterImageWrapRef=()=>{this.containerRef&&this.containerRef.removeEventListener("wheel",this.foundation.handleWheel),this.containerRef=null},this.registryImageWrapRef=e=>{this.unRegisterImageWrapRef(),e&&e.addEventListener("wheel",this.foundation.handleWheel,{passive:!1}),this.containerRef=e},this.getCropperCanvas=()=>this.foundation.getCropperCanvas(),this.state={imgData:{width:0,height:0,centerPoint:{x:0,y:0}},cropperBox:{width:0,height:0,centerPoint:{x:0,y:0}},zoom:1,rotate:0,loaded:!1},this.foundation=new bI(this.adapter),this.imgRef=h().createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{getContainer:()=>this.containerRef,notifyZoomChange:e=>{const{onZoomChange:t}=this.props;null==t||t(e)},getImg:()=>this.imgRef.current})}static getDerivedStateFromProps(e,t){const{rotate:n,zoom:r}=e,{rotate:i,zoom:s,imgData:o,cropperBox:a,loaded:l}=t;let c=o.width,d=o.height,h=Object.assign({},o.centerPoint);const u={};if(!l)return null;if(!_e()(n)&&n!==i&&(u.rotate=n,l)){const e={x:a.centerPoint.x,y:-a.centerPoint.y},t={x:o.centerPoint.x,y:-o.centerPoint.y},r=(n-i)*Math.PI/180;h={x:(t.x-e.x)*Math.cos(r)+(t.y-e.y)*Math.sin(r)+e.x,y:-(-(t.x-e.x)*Math.sin(r)+(t.y-e.y)*Math.cos(r)+e.y)}}if(!_e()(n)&&r!==s&&(u.zoom=r,l)){const e={x:a.centerPoint.x,y:-a.centerPoint.y},t={x:h.x,y:-h.y};c=o.width/s*r,d=o.height/s*r,h={x:(t.x-e.x)/s*r+e.x,y:-[(t.y-e.y)/s*r+e.y]}}return n===i&&r===s||(u.imgData={width:c,height:d,centerPoint:h}),Object.keys(u).length?u:null}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy(),this.unRegisterImageWrapRef()}render(){const{className:e,style:t,src:n,shape:r,showResizeBox:i,cropperBoxStyle:s,cropperBoxCls:o}=this.props,{imgData:a,cropperBox:l,rotate:c,loaded:d}=this.state,u=a.centerPoint.x-a.width/2,p=a.centerPoint.y-a.height/2,f=l.centerPoint.x-l.width/2,m=l.centerPoint.y-l.height/2,g=u-f,y=p-m;return this.foundation.updatePreview({width:a.width,height:a.height,translateX:g,translateY:y,rotate:c}),h().createElement(Pn,{onResize:this.foundation.handleResize,observerProperty:Tn.Width},h().createElement("div",{className:w()(SI,e),style:t,ref:this.registryImageWrapRef},h().createElement("div",{className:xI.IMG_WRAPPER},h().createElement("img",{ref:this.imgRef,src:n,onLoad:this.foundation.handleImageLoad,className:xI.IMG,crossOrigin:"anonymous",style:{width:a.width,height:a.height,transformOrigin:"center",transform:`translate(${u}px, ${p}px) rotate(${c}deg)`}})),h().createElement("div",{className:xI.MASK,onMouseDown:this.foundation.handleMaskMouseDown}),h().createElement("div",{className:w()(xI.CROPPER_BOX,{[o]:o,[xI.CROPPER_VIEW_BOX_ROUND]:"round"===r}),style:Object.assign(Object.assign({},s),{width:l.width,height:l.height,transform:`translate(${f}px, ${m}px)`}),onMouseDown:this.foundation.handleCropperBoxMouseDown},h().createElement("div",{className:w()(xI.CROPPER_VIEW_BOX,{[xI.CROPPER_VIEW_BOX_ROUND]:r.includes("round")})},h().createElement("img",{onDragStart:this.foundation.viewIMGDragStart,className:xI.CROPPER_IMG,src:n,style:{width:a.width,height:a.height,transformOrigin:"center",transform:`translate(${g}px, ${y}px) rotate(${c}deg)`}})),d&&i&&("round"===r?CI:EI).map((e=>h().createElement("div",{className:w()(xI.CORNER,`${xI.CORNER}-${e}`),"data-dir":e,key:e,onMouseDown:this.foundation.handleCornerMouseDown}))))))}}_I.__SemiComponentName__="Cropper",_I.propTypes={className:E().string,style:E().object},_I.defaultProps=he(_I.__SemiComponentName__,{shape:"rect",defaultAspectRatio:1,showResizeBox:!0,fill:"rgba(0, 0, 0, 0)",maxZoom:3,minZoom:.1,zoomStep:.1});const kI=_I;__webpack_require__("YHYY");var OI=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))},TI=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const PI=BP.PREFIX;class II extends f{constructor(e){var t;super(e),t=this,this.inputRef=null,this.replaceInputRef=null,this.cropperRef=null,this.pastingCb=null,this.pasteEventCb=null,this.onClick=()=>{const{inputRef:e,props:t}=this,{onOpenFileDialog:n}=t;!Boolean(this.props.disabled)&&e&&e.current&&(e.current.click(),n&&n())},this.onChange=e=>{const{files:t}=e.target,{crop:n}=this.props;if(n&&t&&t.length>0){const e=Array.from(t);if(e.some((e=>this.isImageFile(e))))return void this.handleCropFiles(e)}this.foundation.handleChange(t)},this.isImageFile=e=>e.type.startsWith("image/"),this.handleCropFiles=function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return OI(t,void 0,void 0,(function*(){const t=e.filter((e=>this.isImageFile(e))),r=e.filter((e=>!this.isImageFile(e)));if(0===t.length)return void this.dispatchUpload(e,n);if(!(yield this.shouldCropFile(t[0],e)))return void this.dispatchUpload(e,n);const i=n?[t[0]]:t,[s,...o]=i;this.setState({cropperVisible:!0,cropperFile:s,cropperSrc:URL.createObjectURL(s),pendingImageFiles:o,nonImageFiles:n?[]:r,croppedFiles:[],isReplaceOperation:n})}))},this.shouldCropFile=(e,t)=>OI(this,void 0,void 0,(function*(){const{beforeCrop:n,onCropError:r}=this.props;if(!n)return!0;try{return!1!==(yield n(e,t))}catch(e){return null==r||r(e),!1}})),this.dispatchUpload=(e,t)=>{t?this.foundation.handleReplaceChange(e):this.foundation.handleChange(e)},this.handleCropOk=()=>OI(this,void 0,void 0,(function*(){var e;const{cropperFile:t,pendingImageFiles:n,nonImageFiles:r,croppedFiles:i,isReplaceOperation:s}=this.state,{crop:o,onCropError:a}=this.props;try{const a=this.cropperRef.current;if(!a||!t)throw new Error("Cropper instance not found");const l=a.getCropperCanvas(),c=null!==(e=("object"==typeof o?o:{}).quality)&&void 0!==e?e:.92,d=t.type||"image/png",h=yield new Promise(((e,t)=>{l.toBlob((n=>n?e(n):t(new Error("Failed to create blob"))),d,c)})),u=new File([h],t.name,{type:d,lastModified:t.lastModified}),p=[...i,u];if(n.length>0){const[e,...t]=n;return this.state.cropperSrc&&URL.revokeObjectURL(this.state.cropperSrc),void this.setState({cropperFile:e,cropperSrc:URL.createObjectURL(e),pendingImageFiles:t,croppedFiles:p})}this.closeCropperAndReset(),this.dispatchUpload([...p,...r],s)}catch(e){null==a||a(e)}})),this.handleCropCancel=()=>{this.closeCropperAndReset()},this.closeCropperAndReset=()=>{const{cropperSrc:e}=this.state;e&&URL.revokeObjectURL(e),this.setState({cropperVisible:!1,cropperFile:null,cropperSrc:"",pendingImageFiles:[],nonImageFiles:[],croppedFiles:[],isReplaceOperation:!1,inputKey:Math.random(),replaceInputKey:Math.random()})},this.replace=e=>{this.setState({replaceIdx:e},(()=>{this.replaceInputRef.current.click()}))},this.onReplaceChange=e=>{const{files:t}=e.target,{crop:n}=this.props;if(n&&t&&t.length>0){const e=Array.from(t);if(e.some((e=>this.isImageFile(e))))return void this.handleCropFiles(e,!0)}this.foundation.handleReplaceChange(t)},this.clear=()=>{this.foundation.handleClear()},this.remove=e=>{this.foundation.handleRemove(e)},this.insert=(e,t)=>this.foundation.insertFileToList(e,t),this.upload=()=>{this.foundation.manualUpload()},this.openFileDialog=()=>{this.onClick()},this.renderFile=(e,t,n)=>{const{name:r,status:i,validateMessage:s,_sizeInvalid:o,uid:a}=e,{previewFile:l,listType:c,itemStyle:d,showPicInfo:u,renderPicInfo:p,renderPicClose:f,renderPicPreviewIcon:m,renderFileOperation:g,renderFileItem:y,renderThumbnail:v,disabled:b,onPreviewClick:w,picWidth:x,picHeight:E,showTooltip:C}=this.props,S=Object.assign(Object.assign(Object.assign({},Gl()(this.props,["showRetry","showReplace",""])),e),{previewFile:l,listType:c,onRemove:()=>this.remove(e),onRetry:()=>{this.foundation.retry(e)},index:t,key:a||`${r}${t}`,style:d,disabled:b,showPicInfo:u,renderPicInfo:p,renderPicPreviewIcon:m,renderPicClose:f,renderFileOperation:g,renderThumbnail:v,onReplace:()=>{this.replace(t)},onPreviewClick:void 0!==w?()=>this.foundation.handlePreviewClick(e):void 0,picWidth:x,picHeight:E,showTooltip:C});return i!==HP.FILE_STATUS_UPLOAD_FAIL||s||(S.validateMessage=n.fail),o&&!s&&(S.validateMessage=n.illegalSize),void 0===y?h().createElement(mI,Object.assign({},S)):y(S)},this.renderFileList=()=>{const{listType:e}=this.props;return e===HP.FILE_LIST_PIC?this.renderFileListPic():e===HP.FILE_LIST_DEFAULT?this.renderFileListDefault():null},this.renderFileListPic=()=>{const{showUploadList:e,limit:t,disabled:n,children:r,draggable:i,hotSpotLocation:s,picHeight:o,picWidth:a}=this.props,{fileList:l,dragAreaStatus:c}=this.state,d=this.props.fileList||l,u=!t||t>d.length,p=`${PI}-drag-area`,f=w()(`${PI}-add`,{[`${PI}-picture-add`]:!0,[`${PI}-picture-add-disabled`]:n}),m=w()(`${PI}-file-list`,{[`${PI}-picture-file-list`]:!0}),g=w()({[`${p}-legal`]:c===HP.DRAG_AREA_LEGAL,[`${p}-illegal`]:c===HP.DRAG_AREA_ILLEGAL}),y=`${PI}-file-list-main`,v={role:"button",className:f,onClick:this.onClick,style:{height:o,width:a}},b={className:m},x={onDrop:this.onDrop,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,onDragEnter:this.onDragEnter};i&&Object.assign(v,x,{className:w()(f,g)});const E=h().createElement("div",Object.assign({},v,{"x-semi-prop":"children"}),r);return e&&d.length?h().createElement(Jt,{componentName:"Upload"},(e=>h().createElement("div",Object.assign({},b),h().createElement("div",{className:y,role:"list","aria-label":"picture list"},u&&"start"===s?E:null,d.map(((t,n)=>this.renderFile(t,n,e))),u&&"end"===s?E:null)))):u?E:null},this.renderFileListDefault=()=>{const{showUploadList:e,limit:t,disabled:n,fileListTitle:r}=this.props,{fileList:i}=this.state,s=this.props.fileList||i,o=w()(`${PI}-file-list`),a=`${PI}-file-list-title`,l=`${PI}-file-list-main`,c=1!==t&&s.length,d=this.props.showClear&&!n,u={className:o};return e&&s.length?h().createElement(Jt,{componentName:"Upload"},(e=>{let t;return t="function"==typeof r?r({fileList:s,onClear:this.clear,clearText:e.clear}):h().createElement(h().Fragment,null,h().createElement("span",{className:`${a}-choosen`},r||e.selectedFiles),d?h().createElement("span",{role:"button",tabIndex:0,onClick:this.clear,className:`${a}-clear`},e.clear):null),h().createElement("div",Object.assign({},u),c?h().createElement("div",{className:a},t):null,h().createElement("div",{className:l,role:"list","aria-label":"file list"},s.map(((t,n)=>this.renderFile(t,n,e)))))})):null},this.onDrop=e=>{const{crop:t,directory:n,disabled:r}=this.props;if(r||n||!t)return void this.foundation.handleDrop(e);const i=e.dataTransfer&&e.dataTransfer.files?Array.from(e.dataTransfer.files):[];if(0===i.length||!i.some((e=>this.isImageFile(e))))return void this.foundation.handleDrop(e);e.preventDefault(),e.stopPropagation();const s=this.state.fileList.slice();this.setState({dragAreaStatus:"default"});const o=e.nativeEvent||e;this.props.onDrop(o,i,s),this.handleCropFiles(i)},this.onDragOver=e=>{this.foundation.handleDragOver(e)},this.onDragLeave=e=>{this.foundation.handleDragLeave(e)},this.onDragEnter=e=>{this.foundation.handleDragEnter(e)},this.renderAddContent=()=>{const{draggable:e,children:t,listType:n,disabled:r}=this.props,i=w()(`${PI}-add`);return n===HP.FILE_LIST_PIC?null:e?this.renderDragArea():h().createElement("div",{role:"button",tabIndex:0,"aria-disabled":r,className:i,onClick:this.onClick},t)},this.renderDragArea=()=>{const{dragAreaStatus:e}=this.state,{children:t,dragIcon:n,dragMainText:r,dragSubText:i,disabled:s}=this.props,o=`${PI}-drag-area`,a=w()(o,{[`${o}-legal`]:e===HP.DRAG_AREA_LEGAL,[`${o}-illegal`]:e===HP.DRAG_AREA_ILLEGAL,[`${o}-custom`]:t});return h().createElement(Jt,{componentName:"Upload"},(l=>h().createElement("div",{role:"button",tabIndex:0,"aria-disabled":s,className:a,onDrop:this.onDrop,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,onDragEnter:this.onDragEnter,onClick:this.onClick},t||h().createElement(h().Fragment,null,h().createElement("div",{className:`${o}-icon`,"x-semi-prop":"dragIcon"},n||h().createElement(gI,{size:"extra-large"})),h().createElement("div",{className:`${o}-text`},h().createElement("div",{className:`${o}-main-text`,"x-semi-prop":"dragMainText"},r||l.mainText),h().createElement("div",{className:`${o}-sub-text`,"x-semi-prop":"dragSubText"},i),h().createElement("div",{className:`${o}-tips`},e===HP.DRAG_AREA_LEGAL&&h().createElement("span",{className:`${o}-tips-legal`},l.legalTips),e===HP.DRAG_AREA_ILLEGAL&&h().createElement("span",{className:`${o}-tips-illegal`},l.illegalTips)))))))},this.renderCropperModal=()=>{const{cropperVisible:e,cropperSrc:t}=this.state,{crop:n,cropModalProps:r}=this.props,i="object"==typeof n?n:{},s=r||{},{style:o,bodyStyle:a}=s,l=TI(s,["style","bodyStyle"]);return h().createElement(Jt,{componentName:"Upload"},(n=>{const r=i.modalTitle||n.cropTitle||"裁切图片",s=i.modalOkText||n.cropOk||"确定",c=i.modalCancelText||n.cropCancel||"取消";return h().createElement(xw,Object.assign({},l,{width:600,title:r,visible:e,onOk:this.handleCropOk,onCancel:this.handleCropCancel,okText:s,cancelText:c,style:Object.assign({height:500},o||{}),bodyStyle:Object.assign({height:400},a||{})}),t&&h().createElement(kI,{ref:this.cropperRef,src:t,shape:i.shape||"rect",aspectRatio:i.aspectRatio,minZoom:i.minZoom,maxZoom:i.maxZoom,zoomStep:i.zoomStep,fill:i.fill,style:{width:"100%",height:"100%"}}))}))},this.state={fileList:e.defaultFileList||[],replaceIdx:-1,inputKey:Math.random(),replaceInputKey:Math.random(),dragAreaStatus:"default",localUrls:[],cropperVisible:!1,cropperFile:null,cropperSrc:"",pendingImageFiles:[],nonImageFiles:[],croppedFiles:[],isReplaceOperation:!1},this.foundation=new sI(this.adapter),this.inputRef=h().createRef(),this.replaceInputRef=h().createRef(),this.cropperRef=h().createRef()}static getDerivedStateFromProps(e){const{fileList:t}=e;return"fileList"in e?{fileList:t||[]}:null}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyFileSelect:e=>this.props.onFileChange(e),notifyError:(e,t,n,r)=>this.props.onError(e,t,n,r),notifySuccess:(e,t,n)=>this.props.onSuccess(e,t,n),notifyProgress:(e,t,n)=>this.props.onProgress(e,t,n),notifyRemove:(e,t,n)=>this.props.onRemove(e,t,n),notifySizeError:(e,t)=>this.props.onSizeError(e,t),notifyExceed:e=>this.props.onExceed(e),updateFileList:(e,t)=>{"function"==typeof t?this.setState({fileList:e},t):this.setState({fileList:e})},notifyBeforeUpload:e=>{let{file:t,fileList:n}=e;return this.props.beforeUpload({file:t,fileList:n})},notifyAfterUpload:e=>{let{response:t,file:n,fileList:r}=e;return this.props.afterUpload({response:t,file:n,fileList:r})},resetInput:()=>{this.setState((e=>({inputKey:Math.random()})))},resetReplaceInput:()=>{this.setState((e=>({replaceInputKey:Math.random()})))},isMac:()=>navigator.platform.toUpperCase().indexOf("MAC")>=0,registerPastingHandler:e=>{const t=t=>{const{crop:n}=this.props;if(n&&"keydown"===t.type&&"code"in t){if((navigator.platform.toUpperCase().indexOf("MAC")>=0?t.metaKey:t.ctrlKey)&&"KeyV"===t.code&&navigator.clipboard&&"function"==typeof navigator.clipboard.read){const e="clipboard-read";return void navigator.permissions.query({name:e}).then((e=>{"granted"!==e.state&&"prompt"!==e.state||navigator.clipboard.read().then((e=>{const t=[];(()=>{OI(this,void 0,void 0,(function*(){for(const n of e)for(const e of n.types)if(e.startsWith("image")){const r=yield n.getType(e),i=yield r.arrayBuffer(),s=e.split("/")[1],o=new File([i],`paste.${s}`,{type:e});t.push(o)}if(t.length>0){const e=t.filter((e=>this.isImageFile(e)));e.length>0?this.handleCropFiles(t):this.foundation.handleChange(t)}}))})()})).catch((e=>{this.props.onPastingError(e)}))})).catch((e=>{this.props.onPastingError(e)}))}}null==e||e(t)};document.body.addEventListener("keydown",t),this.pastingCb=t},unRegisterPastingHandler:()=>{this.pastingCb&&document.body.removeEventListener("keydown",this.pastingCb)},registerPasteEventHandler:e=>{const t=t=>{const{crop:n}=this.props;if(n&&t.clipboardData&&t.clipboardData.items){const e=[];for(let n=0;n<t.clipboardData.items.length;n++){const r=t.clipboardData.items[n];if("file"===r.kind){const t=r.getAsFile();t&&e.push(t)}}if(e.length>0&&e.some((e=>this.isImageFile(e))))return t.preventDefault(),void this.handleCropFiles(e)}null==e||e(t)};document.body.addEventListener("paste",t),this.pasteEventCb=t},unRegisterPasteEventHandler:()=>{this.pasteEventCb&&document.body.removeEventListener("paste",this.pasteEventCb)},notifyPastingError:e=>this.props.onPastingError(e),updateDragAreaStatus:e=>this.setState({dragAreaStatus:e}),notifyChange:e=>{let{currentFile:t,fileList:n}=e;return this.props.onChange({currentFile:t,fileList:n})},updateLocalUrls:e=>this.setState({localUrls:e}),notifyClear:()=>this.props.onClear(),notifyPreviewClick:e=>this.props.onPreviewClick(e),notifyDrop:(e,t,n)=>this.props.onDrop(e,t,n),notifyAcceptInvalid:e=>this.props.onAcceptInvalid(e),notifyBeforeRemove:(e,t)=>this.props.beforeRemove(e,t),notifyBeforeClear:e=>this.props.beforeClear(e)})}componentDidMount(){this.foundation.init()}componentDidUpdate(){"fileList"in this.props&&this.foundation.syncLatestFileList(this.props.fileList||[])}componentWillUnmount(){this.foundation.destroy()}render(){const e=this.props,{style:t,className:n,multiple:r,accept:i,disabled:s,children:o,capture:a,listType:l,prompt:c,promptPosition:d,draggable:u,validateMessage:p,validateStatus:f,directory:m}=e,g=TI(e,["style","className","multiple","accept","disabled","children","capture","listType","prompt","promptPosition","draggable","validateMessage","validateStatus","directory"]),y=w()(PI,{[`${PI}-picture`]:l===HP.FILE_LIST_PIC,[`${PI}-disabled`]:s,[`${PI}-default`]:"default"===f,[`${PI}-error`]:"error"===f,[`${PI}-warning`]:"warning"===f,[`${PI}-success`]:"success"===f},n),v=w()(`${PI}-hidden-input`),b=w()(`${PI}-hidden-input-replace`),x=w()(`${PI}-prompt`),E=w()(`${PI}-validate-message`),C=m?{directory:"directory",webkitdirectory:"webkitdirectory"}:{};return h().createElement("div",Object.assign({className:y,style:t,"x-prompt-pos":d},this.getDataAttr(g)),h().createElement("input",Object.assign({key:this.state.inputKey,capture:a,multiple:r,accept:i,onChange:this.onChange,type:"file",autoComplete:"off",tabIndex:-1,className:v,ref:this.inputRef},C)),h().createElement("input",{key:this.state.replaceInputKey,multiple:!1,accept:i,onChange:this.onReplaceChange,type:"file",autoComplete:"off",tabIndex:-1,className:b,ref:this.replaceInputRef}),this.renderAddContent(),c?h().createElement("div",{className:x,"x-semi-prop":"prompt"},c):null,p?h().createElement("div",{className:E,"x-semi-prop":"validateMessage"},p):null,this.renderFileList(),this.renderCropperModal())}}II.__SemiComponentName__="Upload",II.propTypes={accept:E().string,action:E().string.isRequired,addOnPasting:E().bool,afterUpload:E().func,beforeClear:E().func,beforeRemove:E().func,beforeUpload:E().func,children:E().node,className:E().string,customRequest:E().func,data:E().oneOfType([E().object,E().func]),defaultFileList:E().array,directory:E().bool,disabled:E().bool,dragIcon:E().node,dragMainText:E().node,dragSubText:E().node,draggable:E().bool,fileList:E().array,fileName:E().string,headers:E().oneOfType([E().object,E().func]),hotSpotLocation:E().oneOf(["start","end"]),itemStyle:E().object,limit:E().number,listType:E().oneOf(HP.LIST_TYPE),maxSize:E().number,minSize:E().number,multiple:E().bool,name:E().string,onAcceptInvalid:E().func,onChange:E().func,onClear:E().func,onDrop:E().func,onError:E().func,onExceed:E().func,onFileChange:E().func,onOpenFileDialog:E().func,onPreviewClick:E().func,onProgress:E().func,onRemove:E().func,onRetry:E().func,onSizeError:E().func,onSuccess:E().func,onPastingError:E().func,previewFile:E().func,prompt:E().node,promptPosition:E().oneOf(HP.PROMPT_POSITION),picWidth:E().oneOfType([E().number,E().string]),picHeight:E().oneOfType([E().number,E().string]),renderFileItem:E().func,renderPicPreviewIcon:E().func,renderFileOperation:E().func,renderPicClose:E().func,renderPicInfo:E().func,renderThumbnail:E().func,fileListTitle:E().oneOfType([E().node,E().func]),showClear:E().bool,showPicInfo:E().bool,showReplace:E().bool,showRetry:E().bool,showUploadList:E().bool,style:E().object,timeout:E().number,transformFile:E().func,uploadTrigger:E().oneOf(HP.UPLOAD_TRIGGER),validateMessage:E().node,validateStatus:E().oneOf(HP.VALIDATE_STATUS),withCredentials:E().bool,showTooltip:E().oneOfType([E().bool,E().object]),crop:E().oneOfType([E().bool,E().object]),beforeCrop:E().func,onCropError:E().func,cropModalProps:E().object},II.defaultProps=he(II.__SemiComponentName__,{defaultFileList:[],disabled:!1,listType:"list",hotSpotLocation:"end",multiple:!1,onAcceptInvalid:i(),onChange:i(),beforeRemove:()=>!0,beforeClear:()=>!0,onClear:i(),onDrop:i(),onError:i(),onExceed:i(),onFileChange:i(),onOpenFileDialog:i(),onProgress:i(),onRemove:i(),onRetry:i(),onSizeError:i(),onSuccess:i(),onPastingError:i(),promptPosition:"right",showClear:!0,showPicInfo:!1,showReplace:!1,showRetry:!0,showUploadList:!0,uploadTrigger:"auto",withCredentials:!1,showTooltip:!0}),II.FileCard=mI;const MI=II,RI={PREFIX:`${C}-transfer`},AI="groupList",NI="list",DI="treeList",LI=10;var FI=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function jI(e){const t=[];for(const n of e)n.children.forEach((e=>{const{children:r}=n,i=FI(n,["children"]);t.push(Object.assign(Object.assign({},e),{_parent:i}))}));return t}function $I(e){const t=[],n=[...e].reverse();for(;n.length;){const e=n.pop();if(e.path=e.path||[W()(e,["children"])],e.children&&Array.isArray(e.children)){const t=e.children;for(let r=t.length-1;r>=0;r--){const i=Object.assign({},t[r]);i.path=[].concat(e.path).concat(W()(i,["children"])),n.push(i)}}else e.isLeaf=!0;t.push(W()(e,["children"]))}return t}function BI(e,t){const n=e.slice()||[];return t===AI?jI(n):t===DI?$I(n):n}function VI(e,t){const n=new Map;return e.forEach((e=>{const r=t.findIndex((t=>t.value===e));if(-1!==r){const e=t[r];n.set(e.key,e)}})),n}class zI extends c{constructor(e){super(Object.assign({},e))}_generateGroupedData(e){return jI(e)}_generateTreeData(e){return $I(e)}_generatePath(e){const{path:t=[]}=e;return t.map((e=>e.label)).join(" > ")}_getFullPath(e){const{type:t,showPath:n}=this.getProps();if(t===DI&&!0===n&&Array.isArray(e.path))return e.path.map((e=>Object.assign({},e)))}_injectFullPath(e){const t=this._getFullPath(e);return t?Object.assign(Object.assign({},e),{fullPath:t}):e}handleInputChange(e,t){const{data:n}=this.getStates(),{filter:r,type:i}=this.getProps();if(i===DI){const r=new Set(n.map((e=>e.key)));return this._adapter.searchTree(e),t&&this._adapter.notifySearch(e),this._adapter.updateInput(e),void this._adapter.updateSearchResult(r)}const s="function"==typeof r?t=>r(e,t):t=>"string"==typeof t.label&&t.label.includes(e),o=n.filter(s),a=new Set(o.map((e=>e.key)));t&&this._adapter.notifySearch(e),this._adapter.updateInput(e),this._adapter.updateSearchResult(a)}handleAll(e){const{disabled:t,type:n}=this.getProps(),{selectedItems:r,data:i,searchResult:s,inputValue:o}=this.getStates();if(t)return;let a=[];a=""!==o?i.filter((e=>s.has(e.key))):i,a=n===DI?i:a;let l=new Map;switch(!0){case!e:l=new Map(r),a.forEach((e=>{e.disabled||l.delete(e.key)}));break;case e:l=new Map(r),a.forEach((e=>{e.disabled?r.has(e.key)&&l.set(e.key,e):l.set(e.key,e)}))}this._isControlledComponent()||this._adapter.updateSelected(l),this._notifyChange(l)}handleClear(){const{disabled:e}=this.getProps(),{selectedItems:t,data:n}=this.getStates();if(e)return;const r=new Map(t);n.forEach((e=>{e.disabled||r.delete(e.key)})),this._isControlledComponent()||this._adapter.updateSelected(r),this._notifyChange(r)}handleSelectOrRemove(e){const{disabled:t}=this.getProps(),n=this._adapter.getSelected(),r=this._injectFullPath(e);t||e.disabled||(n.has(e.key)?(n.delete(e.key),this._adapter.notifyDeselect(r)):(n.set(e.key,e),this._adapter.notifySelect(r)),this._isControlledComponent()||this._adapter.updateSelected(n),this._notifyChange(n))}handleSelect(e){const{disabled:t}=this.getProps(),n=this._adapter.getSelected(),{data:r}=this.getStates(),i=r.map((e=>[e.value,e])),s=new Map(i),o=new Map;t||(e.forEach((e=>{const t=s.get(e);n.has(t.key)?o.set(t.key,t):t.disabled||o.set(t.key,t)})),this._isControlledComponent()||this._adapter.updateSelected(o),this._notifyChange(o))}getValuesAndItemsFromMap(e){const{type:t}=this.getProps(),n=[],r=[];for(const i of e){let e=t===AI?W()(i[1],"_parent"):i[1];e=this._injectFullPath(e),n.push(e),r.push(e.value)}return{items:n,values:r}}_notifyChange(e){const{items:t,values:n}=this.getValuesAndItemsFromMap(e);this._adapter.notifyChange(n,t)}handleSortEnd(e){const{oldIndex:t,newIndex:n}=e;let r=[...this._adapter.getSelected().values()];r=nh(r,t,n);let i=new Map;r.forEach((e=>{i=i.set(e.key,e)})),this._adapter.updateSelected(i),this._notifyChange(i)}handlePageChange(e){this._adapter.updateCurrentPage(e),this._adapter.notifyPageChange(e)}}__webpack_require__("EwKa");var HI=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const UI=RI.PREFIX;class KI extends f{constructor(e){var t,n;super(e),this._treeRef=null,this.renderRightItem=(e,t)=>{const{renderSelectedItem:n,draggable:r,type:i,showPath:s}=this.props,o=()=>this.foundation.handleSelectOrRemove(e),a=w()({[`${UI}-item`]:!0,[`${UI}-right-item`]:!0,[`${UI}-right-item-draggable`]:r}),l=i===DI&&!0===s,c=this.getFullPath(e),d=l?this.foundation._generatePath(e):e.label;if(n)return n(Object.assign(Object.assign({},e),{fullPath:c,onRemove:o,sortableHandle:t}));const u=t&&t((()=>h().createElement(ih,{role:"button","aria-label":"Drag and sort",className:`${UI}-right-item-drag-handler`})));return h().createElement("div",{role:"listitem",className:a,key:e.key},r&&t?h().createElement(u,null):null,h().createElement("div",{className:`${UI}-right-item-text`},d),h().createElement(Ji,{onClick:o,"aria-disabled":e.disabled,className:w()(`${UI}-item-close-icon`,{[`${UI}-item-close-icon-disabled`]:e.disabled})}))},this.renderSortItem=e=>{const{id:t,sortableHandle:n}=e,{selectedItems:r}=this.state,i=[...r.values()].find((e=>e.key===t));return this.renderRightItem(i,n)};const{defaultValue:r=[],dataSource:i,type:s,pagination:o}=e;this.foundation=new zI(this.adapter),this.state={data:[],selectedItems:new Map,searchResult:new Set,inputValue:"",leftCurrentPage:null!==(n=null!==(t=null==o?void 0:o.defaultCurrentPage)&&void 0!==t?t:null==o?void 0:o.currentPage)&&void 0!==n?n:1},Boolean(i)&&M()(i)&&(this.state.data=BI(i,s)),Boolean(r)&&M()(r)&&(this.state.selectedItems=VI(r,this.state.data)),this.onSelectOrRemove=this.onSelectOrRemove.bind(this),this.onInputChange=this.onInputChange.bind(this),this.onSortEnd=this.onSortEnd.bind(this),this.handleLeftPageChange=this.handleLeftPageChange.bind(this)}static getDerivedStateFromProps(e,t){const{value:n,dataSource:r,type:i,filter:s,pagination:o}=e,a={};let l=t.data,c=t.selectedItems;if(Boolean(r)&&Array.isArray(r)&&(l=BI(r,i),a.data=l),Boolean(n)&&Array.isArray(n)&&(c=VI(n,l),a.selectedItems=c),!Oe()(t.data,l)&&"string"==typeof t.inputValue&&""!==t.inputValue){const e="function"==typeof s?e=>s(t.inputValue,e):e=>"string"==typeof e.label&&e.label.includes(t.inputValue),n=l.filter(e),r=new Set(n.map((e=>e.key)));a.searchResult=r}return o&&"number"==typeof o.currentPage&&(a.leftCurrentPage=o.currentPage),Pe()(a)?null:a}get adapter(){return Object.assign(Object.assign({},super.adapter),{getSelected:()=>new Map(this.state.selectedItems),updateSelected:e=>{this.setState({selectedItems:e})},notifyChange:(e,t)=>{this.props.onChange(e,t)},notifySearch:e=>{this.props.onSearch(e)},notifySelect:e=>{this.props.onSelect(e)},notifyDeselect:e=>{this.props.onDeselect(e)},updateInput:e=>{this.setState({inputValue:e,leftCurrentPage:1})},updateSearchResult:e=>{this.setState({searchResult:e})},searchTree:e=>{this._treeRef&&this._treeRef.search(e)},updateCurrentPage:e=>{this.setState({leftCurrentPage:e})},notifyPageChange:e=>{var t,n;null===(n=null===(t=this.props.pagination)||void 0===t?void 0:t.onPageChange)||void 0===n||n.call(t,e)}})}onInputChange(e){this.foundation.handleInputChange(e,!0)}handleLeftPageChange(e){this.foundation.handlePageChange(e)}search(e){this.foundation.handleInputChange(e,!1)}onSelectOrRemove(e){this.foundation.handleSelectOrRemove(e)}onSortEnd(e){this.foundation.handleSortEnd(e)}renderFilter(e){const{inputProps:t,filter:n,disabled:r}=this.props;return"boolean"!=typeof n||n?h().createElement("div",{role:"search","aria-label":"Transfer filter",className:`${UI}-filter`},h().createElement(kr,Object.assign({prefix:h().createElement(WC,null),placeholder:e.placeholder,showClear:!0,value:this.state.inputValue,disabled:r,onChange:this.onInputChange},t))):null}renderHeader(e){const{disabled:t,renderSourceHeader:n,renderSelectedHeader:r}=this.props,{totalContent:i,allContent:s,onAllClick:o,type:a,showButton:l}=e,c=w()({[`${UI}-header`]:!0,[`${UI}-right-header`]:"right"===a,[`${UI}-left-header`]:"left"===a});if("left"===a&&"function"==typeof n){const{num:t,showButton:r,allChecked:i,onAllClick:s,leafOnlyNum:o}=e;return n({num:t,showButton:r,allChecked:i,onAllClick:s,leafOnlyNum:o})}if("right"===a&&"function"==typeof r){const{num:t,showButton:n,onAllClick:i}=e;return r({num:t,showButton:n,onClear:i})}return h().createElement("div",{className:c},h().createElement("span",{className:`${UI}-header-total`},i),l?h().createElement(vs,{theme:"borderless",disabled:t,type:"tertiary",size:"small",className:`${UI}-header-all`,onClick:o},s):null)}renderLeftItem(e,t){const{renderSourceItem:n,disabled:r}=this.props,{selectedItems:i}=this.state,s=i.has(e.key);if(n)return n(Object.assign(Object.assign({},e),{checked:s,onChange:()=>this.onSelectOrRemove(e)}));const o=w()({[`${UI}-item`]:!0,[`${UI}-item-disabled`]:e.disabled});return h().createElement(od,{key:t,disabled:e.disabled||r,className:o,checked:s,role:"listitem",onChange:()=>this.onSelectOrRemove(e),"x-semi-children-alias":`dataSource[${t}].label`},e.label)}renderLeft(e){var t;const{data:n,selectedItems:r,inputValue:i,searchResult:s,leftCurrentPage:o}=this.state,{loading:a,type:l,emptyContent:c,renderSourcePanel:d,dataSource:u,pagination:p}=this.props,f=e.total,m=""!==i,g=m?s.size:n.length,y=m?n.filter((e=>s.has(e.key))):n;let v;if(l===DI){v=(m?y.filter((e=>e.isLeaf)):n.filter((e=>e.isLeaf))).length}let b=!0;const w=Boolean(y.find((e=>!e.disabled&&(b&&(b=!1),!r.has(e.key))))),x={totalContent:f.replace("${total}",`${g}`),allContent:w?e.selectAll:e.clearSelectAll,onAllClick:()=>this.foundation.handleAll(w),type:"left",showButton:l!==DI&&!b,num:g,allChecked:!w,leafOnlyNum:v},E=this.renderFilter(e),C=this.renderHeader(x),S=m&&0===s.size,_=c.search?c.search:e.emptySearch,k=c.left?c.left:e.emptyLeft,O=this.renderEmpty("left",k),T=this.renderEmpty("left",_),P=h().createElement(dr,null),I=null!==(t=null==p?void 0:p.pageSize)&&void 0!==t?t:LI,M=Boolean(p),R=o,A=Math.ceil(y.length/I),N=(R-1)*I,D=N+I,L=M?y.slice(N,D):y;let F=null;switch(!0){case a:F=P;break;case S:F=T;break;case 0===n.length:F=O;break;case l===DI:F=h().createElement(h().Fragment,null,C,this.renderLeftTree());break;case!S&&(l===NI||l===AI):F=h().createElement(h().Fragment,null,C,this.renderLeftList(L),M&&A>1&&h().createElement("div",{className:`${UI}-left-pagination`},h().createElement(eS,{total:y.length,currentPage:R,pageSize:I,onPageChange:this.handleLeftPageChange})));break;default:F=null}const{values:j}=this.foundation.getValuesAndItemsFromMap(r),$={loading:a,noMatch:S,filterData:y,sourceData:n,propsDataSource:u,allChecked:!w,showNumber:g,inputValue:i,selectedItems:r,value:j,onSelect:this.foundation.handleSelect.bind(this.foundation),onAllClick:()=>this.foundation.handleAll(w),onSearch:this.onInputChange,onSelectOrRemove:e=>this.onSelectOrRemove(e)};return d?d($):h().createElement("section",{className:`${UI}-left`},E,F)}renderGroupTitle(e,t){const n=w()(`${UI}-group-title`);return h().createElement("div",{className:n,key:`title-${t}`},e.title)}renderLeftTree(){const{selectedItems:e}=this.state,{disabled:t,dataSource:n,treeProps:r}=this.props,{values:i}=this.foundation.getValuesAndItemsFromMap(e),s=W()(r,["value","ref","onChange"]);return h().createElement(_P,Object.assign({disabled:t,treeData:n,multiple:!0,disableStrictly:!0,value:i,defaultExpandAll:!0,leafOnly:!0,ref:e=>this._treeRef=e,filterTreeNode:!0,searchRender:!1,searchStyle:{padding:0},style:{flex:1,overflow:"overlay"},onChange:e=>{this.foundation.handleSelect(e)}},s))}renderLeftList(e){const t=[],n=new Map;return e.forEach(((e,r)=>{const i=e._parent,s=this.renderLeftItem(e,r);if(i&&n.has(i.title))t.push(s);else if(i){const e=this.renderGroupTitle(i,r);n.set(i.title,!0),t.push(e),t.push(s)}else t.push(s)})),h().createElement("div",{className:`${UI}-left-list`,role:"list","aria-label":"Option list"},t)}getFullPath(e){const{type:t,showPath:n}=this.props;if(t===DI&&!0===n&&Array.isArray(e.path))return e.path.map((e=>Object.assign({},e)))}renderEmpty(e,t){const n=w()({[`${UI}-empty`]:!0,[`${UI}-right-empty`]:"right"===e,[`${UI}-left-empty`]:"left"===e});return h().createElement("div",{"aria-label":"empty",className:n},t)}renderRightSortableList(e){const t=e.map((e=>e.key));return h().createElement(nf,{strategy:$p,onSortEnd:this.onSortEnd,items:t,renderItem:this.renderSortItem,prefix:`${UI}-right-item`,dragOverlayCls:`${UI}-right-item-drag-item-move`})}renderVirtualizedSelectedList(e){const{virtualize:t}=this.props;if(!t||Pe()(t))return null;const{height:n,width:r,itemSize:i}=t,s=t=>{var n;const r=e[t];return null!==(n=null==r?void 0:r.key)&&void 0!==n?n:t},o=h().forwardRef(((e,t)=>h().createElement("div",Object.assign({},e,{ref:t,role:"list","aria-label":"Selected list"})))),a=`${UI}-right-list ${UI}-right-virtual-list`,l=t=>{let{index:n,style:r}=t;const i=e[n];return h().createElement("div",{role:"presentation",style:r},this.renderRightItem(i))};return"number"!=typeof n?h().createElement("div",{style:{flexGrow:1,minHeight:0}},h().createElement(aP,{defaultHeight:n,defaultWidth:r},(t=>{let{height:n,width:r}=t;return h().createElement(Ld,{height:n,width:r,itemCount:e.length,itemSize:i,itemKey:s,className:a,outerElementType:o},l)}))):h().createElement(Ld,{height:n,width:r||"100%",itemCount:e.length,itemSize:i,itemKey:s,className:a,outerElementType:o},l)}renderRight(e){const{selectedItems:t}=this.state,{emptyContent:n,renderSelectedPanel:r,draggable:i,virtualize:s}=this.props,o=[...t.values()].map((e=>Object.assign(Object.assign({},e),{fullPath:this.getFullPath(e)}))),a={length:o.length,selectedData:o,onClear:()=>this.foundation.handleClear(),onRemove:e=>this.foundation.handleSelectOrRemove(e),onSortEnd:e=>this.onSortEnd(e)};if(r)return r(a);const l=e.selected.replace("${total}",`${o.length}`),c=-1!==o.findIndex((e=>!e.disabled)),d={totalContent:l,allContent:e.clear,onAllClick:()=>this.foundation.handleClear(),type:"right",showButton:Boolean(o.length)&&c,num:o.length},u=this.renderHeader(d),p=this.renderEmpty("right",n.right?n.right:e.emptyRight),f=`${UI}-right`;let m=null;const g=s&&!Pe()(s);switch(!0){case!o.length:m=p;break;case g&&o.length&&!i:m=this.renderVirtualizedSelectedList(o);break;case!g&&o.length&&!i:m=h().createElement("div",{className:`${UI}-right-list`,role:"list","aria-label":"Selected list"},o.map((e=>this.renderRightItem(Object.assign({},e)))));break;case o.length&&i:m=this.renderRightSortableList(o)}return h().createElement("section",{className:f},u,m)}render(){const e=this.props,{className:t,style:n,disabled:r,renderSelectedPanel:i,renderSourcePanel:s}=e,o=HI(e,["className","style","disabled","renderSelectedPanel","renderSourcePanel"]),a=w()(UI,t,{[`${UI}-disabled`]:r,[`${UI}-custom-panel`]:i&&s});return h().createElement(Jt,{componentName:"Transfer"},(e=>h().createElement("div",Object.assign({className:a,style:n},this.getDataAttr(o)),this.renderLeft(e),this.renderRight(e))))}}KI.propTypes={style:E().object,className:E().string,disabled:E().bool,dataSource:E().array,filter:E().oneOfType([E().func,E().bool]),onSearch:E().func,inputProps:E().object,value:E().array,defaultValue:E().array,onChange:E().func,onSelect:E().func,onDeselect:E().func,renderSourceItem:E().func,renderSelectedItem:E().func,loading:E().bool,type:E().oneOf(["list","groupList","treeList"]),treeProps:E().object,showPath:E().bool,emptyContent:E().shape({search:E().node,left:E().node,right:E().node}),renderSourcePanel:E().func,renderSelectedPanel:E().func,draggable:E().bool,virtualize:E().object,pagination:E().shape({currentPage:E().number,defaultCurrentPage:E().number,pageSize:E().number,onPageChange:E().func})},KI.defaultProps={type:NI,dataSource:[],onSearch:i(),onChange:i(),onSelect:i(),onDeselect:i(),onClear:i(),defaultValue:[],emptyContent:{},showPath:!1};const WI=KI;class GI extends d.Component{constructor(e){super(e),this.state={}}render(){const{children:e,locale:t}=this.props;return h().createElement(Pt.Provider,{value:t},e)}}function qI(){return qI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qI.apply(this,arguments)}function XI(e){return XI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},XI(e)}function YI(e,t){return YI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},YI(e,t)}function ZI(e,t,n){return ZI=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&YI(i,n.prototype),i},ZI.apply(null,arguments)}function JI(e){var t="function"==typeof Map?new Map:void 0;return JI=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return ZI(e,arguments,XI(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),YI(r,e)},JI(e)}GI.propTypes={locale:E().object,children:E().node},GI.defaultProps={locale:Zt};var QI=/%[sdj%]/g;function eM(e){if(!e||!e.length)return null;var t={};return e.forEach((function(e){var n=e.field;t[n]=t[n]||[],t[n].push(e)})),t}function tM(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=1,i=t[0],s=t.length;return"function"==typeof i?i.apply(null,t.slice(1)):"string"==typeof i?String(i).replace(QI,(function(e){if("%%"===e)return"%";if(r>=s)return e;switch(e){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch(e){return"[Circular]"}break;default:return e}})):i}function nM(e,t){return null==e||(!("array"!==t||!Array.isArray(e)||e.length)||!(!function(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"date"===e||"pattern"===e}(t)||"string"!=typeof e||e))}function rM(e,t,n){var r=0,i=e.length;!function s(o){if(o&&o.length)n(o);else{var a=r;r+=1,a<i?t(e[a],s):n([])}}([])}var iM=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,"Async Validation Error")||this).errors=t,r.fields=n,r}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,YI(t,n),r}(JI(Error));function sM(e,t,n,r){if(t.first){var i=new Promise((function(t,i){var s=function(e){var t=[];return Object.keys(e).forEach((function(n){t.push.apply(t,e[n])})),t}(e);rM(s,n,(function(e){return r(e),e.length?i(new iM(e,eM(e))):t()}))}));return i.catch((function(e){return e})),i}var s=t.firstFields||[];!0===s&&(s=Object.keys(e));var o=Object.keys(e),a=o.length,l=0,c=[],d=new Promise((function(t,i){var d=function(e){if(c.push.apply(c,e),++l===a)return r(c),c.length?i(new iM(c,eM(c))):t()};o.length||(r(c),t()),o.forEach((function(t){var r=e[t];-1!==s.indexOf(t)?rM(r,n,d):function(e,t,n){var r=[],i=0,s=e.length;function o(e){r.push.apply(r,e),++i===s&&n(r)}e.forEach((function(e){t(e,o)}))}(r,n,d)}))}));return d.catch((function(e){return e})),d}function oM(e){return function(t){return t&&t.message?(t.field=t.field||e.fullField,t):{message:"function"==typeof t?t():t,field:t.field||e.fullField}}}function aM(e,t){if(t)for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];"object"==typeof r&&"object"==typeof e[n]?e[n]=qI({},e[n],r):e[n]=r}return e}function lM(e,t,n,r,i,s){!e.required||n.hasOwnProperty(e.field)&&!nM(t,s||e.type)||r.push(tM(i.messages.required,e.fullField))}var cM={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},dM={integer:function(e){return dM.number(e)&&parseInt(e,10)===e},float:function(e){return dM.number(e)&&!dM.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(e){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"==typeof e&&!dM.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&!!e.match(cM.email)&&e.length<255},url:function(e){return"string"==typeof e&&!!e.match(cM.url)},hex:function(e){return"string"==typeof e&&!!e.match(cM.hex)}};var hM="enum";var uM={required:lM,whitespace:function(e,t,n,r,i){(/^\s+$/.test(t)||""===t)&&r.push(tM(i.messages.whitespace,e.fullField))},type:function(e,t,n,r,i){if(e.required&&void 0===t)lM(e,t,n,r,i);else{var s=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(s)>-1?dM[s](t)||r.push(tM(i.messages.types[s],e.fullField,e.type)):s&&typeof t!==e.type&&r.push(tM(i.messages.types[s],e.fullField,e.type))}},range:function(e,t,n,r,i){var s="number"==typeof e.len,o="number"==typeof e.min,a="number"==typeof e.max,l=t,c=null,d="number"==typeof t,h="string"==typeof t,u=Array.isArray(t);if(d?c="number":h?c="string":u&&(c="array"),!c)return!1;u&&(l=t.length),h&&(l=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),s?l!==e.len&&r.push(tM(i.messages[c].len,e.fullField,e.len)):o&&!a&&l<e.min?r.push(tM(i.messages[c].min,e.fullField,e.min)):a&&!o&&l>e.max?r.push(tM(i.messages[c].max,e.fullField,e.max)):o&&a&&(l<e.min||l>e.max)&&r.push(tM(i.messages[c].range,e.fullField,e.min,e.max))},enum:function(e,t,n,r,i){e[hM]=Array.isArray(e[hM])?e[hM]:[],-1===e[hM].indexOf(t)&&r.push(tM(i.messages[hM],e.fullField,e[hM].join(", ")))},pattern:function(e,t,n,r,i){if(e.pattern)if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(tM(i.messages.pattern.mismatch,e.fullField,t,e.pattern));else if("string"==typeof e.pattern){new RegExp(e.pattern).test(t)||r.push(tM(i.messages.pattern.mismatch,e.fullField,t,e.pattern))}}};function pM(e,t,n,r,i){var s=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nM(t,s)&&!e.required)return n();uM.required(e,t,r,o,i,s),nM(t,s)||uM.type(e,t,r,o,i)}n(o)}var fM={string:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nM(t,"string")&&!e.required)return n();uM.required(e,t,r,s,i,"string"),nM(t,"string")||(uM.type(e,t,r,s,i),uM.range(e,t,r,s,i),uM.pattern(e,t,r,s,i),!0===e.whitespace&&uM.whitespace(e,t,r,s,i))}n(s)},method:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nM(t)&&!e.required)return n();uM.required(e,t,r,s,i),void 0!==t&&uM.type(e,t,r,s,i)}n(s)},number:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(""===t&&(t=void 0),nM(t)&&!e.required)return n();uM.required(e,t,r,s,i),void 0!==t&&(uM.type(e,t,r,s,i),uM.range(e,t,r,s,i))}n(s)},boolean:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nM(t)&&!e.required)return n();uM.required(e,t,r,s,i),void 0!==t&&uM.type(e,t,r,s,i)}n(s)},regexp:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nM(t)&&!e.required)return n();uM.required(e,t,r,s,i),nM(t)||uM.type(e,t,r,s,i)}n(s)},integer:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nM(t)&&!e.required)return n();uM.required(e,t,r,s,i),void 0!==t&&(uM.type(e,t,r,s,i),uM.range(e,t,r,s,i))}n(s)},float:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nM(t)&&!e.required)return n();uM.required(e,t,r,s,i),void 0!==t&&(uM.type(e,t,r,s,i),uM.range(e,t,r,s,i))}n(s)},array:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(null==t&&!e.required)return n();uM.required(e,t,r,s,i,"array"),null!=t&&(uM.type(e,t,r,s,i),uM.range(e,t,r,s,i))}n(s)},object:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nM(t)&&!e.required)return n();uM.required(e,t,r,s,i),void 0!==t&&uM.type(e,t,r,s,i)}n(s)},enum:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nM(t)&&!e.required)return n();uM.required(e,t,r,s,i),void 0!==t&&uM.enum(e,t,r,s,i)}n(s)},pattern:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nM(t,"string")&&!e.required)return n();uM.required(e,t,r,s,i),nM(t,"string")||uM.pattern(e,t,r,s,i)}n(s)},date:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nM(t,"date")&&!e.required)return n();var o;if(uM.required(e,t,r,s,i),!nM(t,"date"))o=t instanceof Date?t:new Date(t),uM.type(e,o,r,s,i),o&&uM.range(e,o.getTime(),r,s,i)}n(s)},url:pM,hex:pM,email:pM,required:function(e,t,n,r,i){var s=[],o=Array.isArray(t)?"array":typeof t;uM.required(e,t,r,s,i,o),n(s)},any:function(e,t,n,r,i){var s=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nM(t)&&!e.required)return n();uM.required(e,t,r,s,i)}n(s)}};function mM(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var gM=mM();function yM(e){this.rules=null,this._messages=gM,this.define(e)}yM.prototype={messages:function(e){return e&&(this._messages=aM(mM(),e)),this._messages},define:function(e){if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!=typeof e||Array.isArray(e))throw new Error("Rules must be an object");var t,n;for(t in this.rules={},e)e.hasOwnProperty(t)&&(n=e[t],this.rules[t]=Array.isArray(n)?n:[n])},validate:function(e,t,n){var r=this;void 0===t&&(t={}),void 0===n&&(n=function(){});var i,s,o=e,a=t,l=n;if("function"==typeof a&&(l=a,a={}),!this.rules||0===Object.keys(this.rules).length)return l&&l(),Promise.resolve();if(a.messages){var c=this.messages();c===gM&&(c=mM()),aM(c,a.messages),a.messages=c}else a.messages=this.messages();var d={};(a.keys||Object.keys(this.rules)).forEach((function(t){i=r.rules[t],s=o[t],i.forEach((function(n){var i=n;"function"==typeof i.transform&&(o===e&&(o=qI({},o)),s=o[t]=i.transform(s)),(i="function"==typeof i?{validator:i}:qI({},i)).validator=r.getValidationMethod(i),i.field=t,i.fullField=i.fullField||t,i.type=r.getType(i),i.validator&&(d[t]=d[t]||[],d[t].push({rule:i,value:s,source:o,field:t}))}))}));var h={};return sM(d,a,(function(e,t){var n,r=e.rule,i=!("object"!==r.type&&"array"!==r.type||"object"!=typeof r.fields&&"object"!=typeof r.defaultField);function s(e,t){return qI({},t,{fullField:r.fullField+"."+e})}function o(n){void 0===n&&(n=[]);var o=n;if(Array.isArray(o)||(o=[o]),!a.suppressWarning&&o.length&&yM.warning("async-validator:",o),o.length&&void 0!==r.message&&(o=[].concat(r.message)),o=o.map(oM(r)),a.first&&o.length)return h[r.field]=1,t(o);if(i){if(r.required&&!e.value)return void 0!==r.message?o=[].concat(r.message).map(oM(r)):a.error&&(o=[a.error(r,tM(a.messages.required,r.field))]),t(o);var l={};if(r.defaultField)for(var c in e.value)e.value.hasOwnProperty(c)&&(l[c]=r.defaultField);for(var d in l=qI({},l,e.rule.fields))if(l.hasOwnProperty(d)){var u=Array.isArray(l[d])?l[d]:[l[d]];l[d]=u.map(s.bind(null,d))}var p=new yM(l);p.messages(a.messages),e.rule.options&&(e.rule.options.messages=a.messages,e.rule.options.error=a.error),p.validate(e.value,e.rule.options||a,(function(e){var n=[];o&&o.length&&n.push.apply(n,o),e&&e.length&&n.push.apply(n,e),t(n.length?n:null)}))}else t(o)}i=i&&(r.required||!r.required&&e.value),r.field=e.field,r.asyncValidator?n=r.asyncValidator(r,e.value,o,e.source,a):r.validator&&(!0===(n=r.validator(r,e.value,o,e.source,a))?o():!1===n?o(r.message||r.field+" fails"):n instanceof Array?o(n):n instanceof Error&&o(n.message)),n&&n.then&&n.then((function(){return o()}),(function(e){return o(e)}))}),(function(e){!function(e){var t,n=[],r={};function i(e){var t;Array.isArray(e)?n=(t=n).concat.apply(t,e):n.push(e)}for(t=0;t<e.length;t++)i(e[t]);n.length?r=eM(n):(n=null,r=null),l(n,r)}(e)}))},getType:function(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!fM.hasOwnProperty(e.type))throw new Error(tM("Unknown rule type %s",e.type));return e.type||"string"},getValidationMethod:function(e){if("function"==typeof e.validator)return e.validator;var t=Object.keys(e),n=t.indexOf("message");return-1!==n&&t.splice(n,1),1===t.length&&"required"===t[0]?fM.required:fM[this.getType(e)]||!1}},yM.register=function(e,t){if("function"!=typeof t)throw new Error("Cannot register a validator by type, validator is not a function");fM[e]=t},yM.warning=function(){},yM.messages=gM,yM.validators=fM;const vM=yM;var bM=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function wM(e){let t=!0;return"string"==typeof e&&e.length?t=!1:Array.isArray(e)&&e.length?t=e.every((e=>wM(e))):"boolean"==typeof e?t=e:e&&"symbol"==typeof e.$$typeof&&"Symbol(react.element)"===e.$$typeof.toString()&&(t=!1),t}function xM(e){let t=Object.assign(Object.assign({},{allowEmptyString:!1,allowEmpty:!1,emptyValue:"",noLabel:!1,noErrorMessage:!1,isInInputGroup:!1}),e),{field:n,label:r,labelPosition:i,labelWidth:s,labelAlign:o,labelCol:a,wrapperCol:l,initValue:c,validate:d,validator:h,validateStatus:u,trigger:p,allowEmptyString:f,allowEmpty:m,emptyValue:g,rules:y,onChange:v,keepState:b,transform:w,name:x,fieldClassName:E,fieldStyle:C,noLabel:S,noErrorMessage:_,isInInputGroup:k,stopValidateWithError:O,convert:T,showValidateIcon:P,helpText:I,extraText:M,extraTextPosition:R,pure:A,id:N}=t,D=bM(t,["field","label","labelPosition","labelWidth","labelAlign","labelCol","wrapperCol","initValue","validate","validator","validateStatus","trigger","allowEmptyString","allowEmpty","emptyValue","rules","onChange","keepState","transform","name","fieldClassName","fieldStyle","noLabel","noErrorMessage","isInInputGroup","stopValidateWithError","convert","showValidateIcon","helpText","extraText","extraTextPosition","pure","id"]);delete D.defaultChecked,delete D.defaultValue,delete D.checked,void 0!==c&&(c=Ky(c));const L=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=!1;return"object"==typeof e&&"required"in e?t=e.required:Array.isArray(e)&&e.length&&e.forEach((e=>{e.required&&(t=!0)})),t}(y);g=void 0!==g?g:"";return{field:n,label:r,labelPosition:i,labelWidth:s,labelAlign:o,labelCol:a,wrapperCol:l,noLabel:S,noErrorMessage:_,isInInputGroup:k,initValue:c,validate:h||d,validateStatus:u,trigger:p,allowEmptyString:f,allowEmpty:m,emptyValue:g,rules:y,required:L,keepState:b,transform:w,name:x,fieldClassName:E,fieldStyle:C,convert:T,stopValidateWithError:O,showValidateIcon:P,helpText:I,extraText:M,extraTextPosition:R,pure:A,rest:D,id:N}}class EM extends c{constructor(e){super(Object.assign({},e));let{initValues:t}=this._adapter.getProps();t=this._adapter.cloneDeep(t),this.data={values:t||{},errors:{},touched:{}},this.fields=new Map,this.registered={},this.registeredArrayField=new Map,this.register=this.register.bind(this),this.unRegister=this.unRegister.bind(this),this.registerArrayField=this.registerArrayField.bind(this),this.unRegisterArrayField=this.unRegisterArrayField.bind(this),this.getArrayField=this.getArrayField.bind(this),this.updateArrayField=this.updateArrayField.bind(this),this.getField=this.getField.bind(this),this.setValues=this.setValues.bind(this),this.updateStateValue=this.updateStateValue.bind(this),this.updateStateError=this.updateStateError.bind(this),this.updateStateTouched=this.updateStateTouched.bind(this),this.getFormState=this.getFormState.bind(this),this.getValue=this.getValue.bind(this),this.getError=this.getError.bind(this),this.getTouched=this.getTouched.bind(this),this.getInitValues=this.getInitValues.bind(this),this.getInitValue=this.getInitValue.bind(this),this.getFormProps=this.getFormProps.bind(this),this.getFieldExist=this.getFieldExist.bind(this),this.scrollToField=this.scrollToField.bind(this),this.scrollToError=this.scrollToError.bind(this)}init(){this._adapter.initFormId()}getField(e){return this.fields.get(e)}register(e,t,n){const r=this.registered[e];if(this.registered[e]=!0,this.fields.set(e,n),n.keepState&&r){const r=zf(this.data.values,e),i=$f(this.data.values,e),s=zf(this.data.errors,e),o=$f(this.data.errors,e),a=zf(this.data.touched,e),l=$f(this.data.touched,e),c=n.allowEmpty||!1,d={notNotify:!0,notUpdate:!1,fieldAllowEmpty:c};if(r)this.updateStateValue(e,i,d),n.fieldApi.setValue(i,Object.assign(Object.assign({},d),{notUpdate:!0}));else{let n=t.value;c||""!==n||(n=void 0),this.updateStateValue(e,n,d)}s&&(this.updateStateError(e,o,d),n.fieldApi.setError(o,Object.assign(Object.assign({},d),{notUpdate:!0}))),a&&(this.updateStateTouched(e,l,d),n.fieldApi.setTouched(l,Object.assign(Object.assign({},d),{notUpdate:!0})))}else{const r=n.allowEmpty||!1,i={notNotify:!0,notUpdate:!1,fieldAllowEmpty:r};let s=t.value;r||""!==s||(s=void 0),this.updateStateValue(e,s,i),t.error&&this.updateStateError(e,t.error,i)}}unRegister(e){const t=this.fields.get(e);try{t.keepState||(Bf(this.data.values,e),Bf(this.data.errors,e),Bf(this.data.touched,e))}catch(t){console.error(`some thing wrong when unregister field:${e}`)}this.fields.delete(e),this._adapter.notifyChange(this.data),this._adapter.forceUpdate()}registerArrayField(e,t){this.updateArrayField(e,{updateKey:(new Date).valueOf(),initValue:t})}unRegisterArrayField(e){this.registeredArrayField.delete(e)}getArrayField(e){return this.registeredArrayField.get(e)}updateArrayField(e,t){const n=Object.assign(Object.assign({},this.registeredArrayField.get(e)),t);this.registeredArrayField.set(e,n)}validate(e){const t=this.getProps(),n=t.validator||t.validateFields;let r,i=!1;if(e&&!Array.isArray(e)){const t=e;r=t.fields,i=t.silent||!1}else r=e;return n&&ye()(n)?this._formValidate(i):this._fieldsValidate(r,i)}_formValidate(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{values:t}=this.data,n=this.getProps(),r=n.validator||n.validateFields;return new Promise(((n,i)=>{let s;try{s=r(t)}catch(e){s=e}if(s)qb(s)?s.then((r=>{if(r)e||(this.data.errors=r,this._adapter.notifyChange(this.data),this.injectErrorToField(r),this._adapter.forceUpdate(),this._autoScroll(100)),i(r);else{const r=this._adapter.cloneDeep(t);n(r),e||this.injectErrorToField({})}}),(t=>{e||this._autoScroll(100),i(t)})):(e||(this.data.errors=s,this.injectErrorToField(s),this._adapter.notifyChange(this.data),this._adapter.forceUpdate(),this._autoScroll(100)),i(s));else{const r=this._adapter.cloneDeep(t);n(r),e||this.injectErrorToField({})}}))}_fieldsValidate(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{values:n}=this.data;return new Promise(((r,i)=>{let s=[];const o=this._getOperateFieldMap(e);o.forEach(((e,n)=>{const r=this.getValue(n),i={notNotify:!0,notUpdate:!0,silent:t},o=e.fieldApi.validate(r,i);s.push(o),t||e.fieldApi.setTouched(!0,{notNotify:!0,notUpdate:!0})})),Promise.all(s).then((()=>{t||(this._adapter.notifyChange(this.data),this._adapter.forceUpdate());const e=this.getError();if(this._isValid(o)){const e=this._adapter.cloneDeep(n);r(e)}else t||this._autoScroll(),i(e)}))}))}submit(e){const{values:t}=this.data;this.validate().then((t=>{const n=this._adapter.cloneDeep(t);this._adapter.notifySubmit(n,e)})).catch((n=>{const r=this._adapter.cloneDeep(n),i=this._adapter.cloneDeep(t);this._adapter.notifySubmitFail(r,i,e)}))}_getNestedField(e){const t=this.fields,n=[...t].map((e=>e[0]));let r=new Map;return n.forEach((n=>{let i=Nf()(n),s=Nf()(e);if(s.every(((e,t)=>s[t]===i[t]))){const e=t.get(n);r.set(n,e)}})),r}_getOperateFieldMap(e){let t=new Map;return _e()(e)?t=this.fields:e.forEach((e=>{const n=this.fields.get(e);if(_e()(n)){const n=this._getNestedField(e);t=new Map([...t,...n])}else t.set(e,n)})),t}reset(e){this._getOperateFieldMap(e).forEach((e=>{e.fieldApi.reset()})),this.registeredArrayField.size&&this._resetArrayField(),this._adapter.notifyChange(this.data),this._adapter.forceUpdate(),this._adapter.notifyReset()}_resetArrayField(){[...this.registeredArrayField.keys()].forEach((e=>{const t=this.registeredArrayField.get(e).initValue;this.updateStateValue(e,t,{notNotify:!0,notUpdate:!0}),this.updateArrayField(e,{updateKey:(new Date).valueOf()})}))}injectErrorToField(e){this.fields.forEach((t=>{const n=$f(e,t.field);t.fieldApi.setError(n,{notNotify:!0,notUpdate:!0})}))}getValue(e,t){const n=void 0===e,r=t&&t.needClone;let i,s;switch(!0){case!n&&!r:i=$f(this.data.values,e);break;case!n&&r:s=$f(this.data.values,e),i=this._adapter.cloneDeep(s);break;case n&&!r:i=Object.assign({},this.data.values);break;case n&&r:i=this._adapter.cloneDeep(this.data.values)}return i}setValues(e,t){let{isOverride:n=!1}=t;const r=this._adapter.cloneDeep(e);if(this.fields.forEach((e=>{const t=$f(r,e.field);e.fieldApi.setValue(t,{notNotify:!0,notUpdate:!0})})),this.registeredArrayField.size){[...this.registeredArrayField.keys()].forEach((e=>{this.updateArrayField(e,{updateKey:(new Date).valueOf()})}))}n&&(this.data.values=r),this._adapter.notifyChange(this.data),this._adapter.notifyValueChange(this.data.values,Object.assign({},e)),this._adapter.forceUpdate()}updateStateValue(e,t,n,r){const i=n&&n.notNotify,s=n&&n.notUpdate,o=n&&n.fieldAllowEmpty,a=this.getProp("allowEmpty"),l=o||a;Vf(this.data.values,e,t,l),i||(this._adapter.notifyChange(this.data),this._adapter.notifyValueChange(this.data.values,{[e]:t})),s||this._adapter.forceUpdate(r)}getTouched(e){return void 0===e?this.data.touched:$f(this.data.touched,e)}updateStateTouched(e,t,n,r){const i=n&&n.notNotify,s=n&&n.notUpdate;Vf(this.data.touched,e,t),i||this._adapter.notifyChange(this.data),s||this._adapter.forceUpdate(r)}getError(e){return void 0===e?this.data.errors:$f(this.data.errors,e)}updateStateError(e,t,n,r){const i=n&&n.notNotify,s=n&&n.notUpdate;Vf(this.data.errors,e,t),i||this._adapter.notifyChange(this.data),this._adapter.notifyErrorChange(this.data.errors,{[e]:t}),s||this._adapter.forceUpdate(r)}getFieldSetterApi(){return{setValue:(e,t,n)=>{const r=this.fields.get(e)?this.fields.get(e).fieldApi:void 0,i=this._adapter.cloneDeep(t);r?r.setValue(i,n):(this.updateStateValue(e,i,n,(()=>{let t=this._getNestedField(e);t.size&&t.forEach((e=>{let t=e.field,n=$f(this.data.values,t);e.fieldApi.setValue(n,{notNotify:!0,notUpdate:!0})}))})),this.getArrayField(e)&&this.updateArrayField(e,{updateKey:(new Date).valueOf()}))},setError:(e,t,n)=>{const r=this.fields.get(e)?this.fields.get(e).fieldApi:void 0,i=this._adapter.cloneDeep(t);r?r.setError(i,n):(this.updateStateError(e,i,n,(()=>{let t=this._getNestedField(e);t.size&&t.forEach((e=>{let t=e.field,n=$f(this.data.errors,t);e.fieldApi.setError(n,{notNotify:!0,notUpdate:!0})}))})),this.getArrayField(e)&&this.updateArrayField(e,{updateKey:(new Date).valueOf()}))},setTouched:(e,t,n)=>{const r=this.fields.get(e)?this.fields.get(e).fieldApi:void 0;r?r.setTouched(t,n):(this.updateStateTouched(e,t,n,(()=>{let t=this._getNestedField(e);t.size&&t.forEach((e=>{let t=e.field,n=$f(this.data.touched,t);e.fieldApi.setTouched(n,{notNotify:!0,notUpdate:!0})}))})),this.getArrayField(e)&&this.updateArrayField(e,{updateKey:(new Date).valueOf()}))}}}getModifyFormStateApi(){return{register:this.register,unRegister:this.unRegister,updateStateValue:this.updateStateValue,updateStateError:this.updateStateError,updateStateTouched:this.updateStateTouched,getValue:this.getValue,getError:this.getError,getTouched:this.getTouched,getInitValues:this.getInitValues,getInitValue:this.getInitValue,getFormProps:this.getFormProps,getField:this.getField,registerArrayField:this.registerArrayField,unRegisterArrayField:this.unRegisterArrayField,getArrayField:this.getArrayField,updateArrayField:this.updateArrayField}}getFormApi(){const e=this.getFieldSetterApi();return Object.assign(Object.assign({},e),{reset:e=>this.reset(e),validate:e=>this.validate(e),getValue:e=>this.getValue(e,{needClone:!0}),getValues:()=>this.getValue(void 0,{needClone:!0}),getFormState:()=>this.getFormState(!0),getFormProps:e=>this.getFormProps(e),getInitValue:e=>this.getInitValue(e),getInitValues:()=>this.getInitValues(),getTouched:e=>this.getTouched(e),getError:e=>this.getError(e),setValues:(e,t)=>this.setValues(e,t||{isOverride:!1}),submitForm:()=>this.submit(),getFieldExist:e=>this.getFieldExist(e),scrollToField:(e,t)=>this.scrollToField(e,t),scrollToError:e=>this.scrollToError(e)})}getFormState(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this._adapter.cloneDeep(this.data):Object.assign({},this.data)}_isValid(e){let t=!0;if(e){[...e.keys()].forEach((e=>{wM($f(this.data.errors,e))||(t=!1)}))}else t=Boolean(function(e){return 0===If()(e).length}(this.data.errors));return t}getInitValues(){return this._adapter.getInitValues()}getInitValue(e){return void 0===e?this._adapter.getInitValues():$f(this._adapter.getInitValues(),e)}getFormProps(e){return this._adapter.getFormProps(e)}getFieldExist(e){return Boolean(this.fields.has(e))}_autoScroll(e){const{autoScrollToError:t}=this.getFormProps();if(!t)return;let n={behavior:"smooth",block:"start"};"object"==typeof t&&(n=t),e?setTimeout((()=>this._getErrorFieldAndScroll(n)),100):this._getErrorFieldAndScroll(n)}_getErrorFieldAndScroll(e){const t=this._adapter.getAllErrorDOM();if(t&&t.length)try{const n=t[0].parentNode.parentNode;j(n,e)}catch(e){}}scrollToField(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{behavior:"smooth",block:"start"};if(this.getFieldExist(e)){const n=this._adapter.getFieldDOM(e);j(n,t)}}scrollToError(e){let t,n,r=e&&e.scrollOpts?e.scrollOpts:{behavior:"smooth",block:"start"},i=e&&e.field,s=e&&e.index;if("number"==typeof s){let e=this._adapter.getAllErrorDOM()[s];e&&(t=e.parentNode.parentNode)}else if(i)n=this._adapter.getFieldErrorDOM(i),n&&(t=n.parentNode.parentNode);else if(void 0===i){let e=this._adapter.getAllErrorDOM();e&&e.length&&(t=e[0].parentNode.parentNode)}t&&j(t,r)}}const CM=h().createContext({});CM.displayName="FormState";const SM=h().createContext({});SM.displayName="FormApi";const _M=h().createContext({});_M.displayName="FormUpdater";const kM=h().createContext({shouldUseInitValue:!0,inArrayField:!1}),OM=Ax.PREFIX;class TM extends d.PureComponent{generatorText(e){const{helpTextId:t,errorMessageId:n}=this.props;let r=n;if(this.props.error||(r=t),"string"==typeof e)return h().createElement("span",{id:r},e);if(Array.isArray(e)){const t=e.filter((e=>e));return t.length?h().createElement("span",{id:r},t.join(", ")):null}return h().isValidElement(e)?e:null}render(){const{error:e,className:t,style:n,validateStatus:r,helpText:i,showValidateIcon:s,isInInputGroup:o}=this.props,a=w()({[OM+"-field-error-message"]:Boolean(e),[OM+"-field-help-text"]:Boolean(i)},t);if(!e&&!i)return null;if(""===e&&"error"===r)return null;const l={warning:h().createElement(Qi,null),error:h().createElement(ns,null)},c=e?this.generatorText(e):this.generatorText(i);if(Array.isArray(e)&&!c&&!i)return null;const d=`${OM}-field-validate-status-icon`;let u=null;return o?u=h().createElement(ns,{className:d}):l[r]&&(u=h().cloneElement(l[r],{className:d})),h().createElement("div",{className:a,style:n},s&&c?u:null,c)}}TM.propTypes={error:E().oneOfType([E().bool,E().string,E().array,E().node]),className:E().string,style:E().object,validateStatus:E().string,showValidateIcon:E().bool,helpText:E().node,isInInputGroup:E().bool,errorMessageId:E().string,helpTextId:E().string};var PM=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const IM=Ax.PREFIX,MM=e=>{let t,n,r,i,s,o="top";try{const e=(0,d.useContext)(_M).getFormProps(["labelPosition","labelWidth","labelAlign","labelCol","wrapperCol"]);t=e.labelCol,n=e.wrapperCol,r=e.labelWidth,i=e.labelAlign,o=e.labelPosition?e.labelPosition:o}catch(p){}e.labelPosition&&(o=e.labelPosition);let{children:a,label:l,className:c,style:u,error:p,noLabel:f}=e;PM(e,["children","label","className","style","error","noLabel"]);const m=t&&n,g=w()({[`${IM}-field`]:!0,[`${IM}-slot`]:!0},c),y=w()({[`${IM}-col-${i}`]:!0});switch(!0){case z()(l)&&!h().isValidElement(l):break;case xe()(l)||er()(l):case h().isValidElement(l):l={text:l}}let v=null;if(void 0!==typeof p){let e={};switch(!0){case z()(p)&&!h().isValidElement(p):e=p;break;case xe()(p)||er()(p):case h().isValidElement(p):e={error:p}}v=h().createElement(TM,Object.assign({},e))}let b=Object.assign({align:i,width:r},l),x=w()({[`${IM}-field-main`]:!0,[`${IM}-slot-main`]:!0});switch(!0){case!m&&!f:s=h().createElement(h().Fragment,null,h().createElement(Lx,Object.assign({},b)),h().createElement("div",{className:x},a,v));break;case!m&&f:s=h().createElement(h().Fragment,null,h().createElement("div",{className:x},a,v));break;case m&&"top"===o:s=h().createElement(h().Fragment,null,h().createElement("div",{style:{overflow:"hidden"}},h().createElement(rx,Object.assign({},t,{className:y}),h().createElement(Lx,Object.assign({},b)))),h().createElement(rx,null,a,v));break;case m&&"top"!==o:s=h().createElement(h().Fragment,null,h().createElement(rx,Object.assign({},t,{className:y}),h().createElement(Lx,Object.assign({},b))),h().createElement(rx,null,a,v))}return h().createElement("div",{className:g,"x-label-pos":o,style:u},s)},RM=Ax.PREFIX;class AM extends d.PureComponent{render(){const{text:e,className:t,style:n,children:r}=this.props,i=w()({[RM+"-section"]:!0},t),s=RM+"-section-text";return h().createElement("section",{className:i,style:n},h().createElement("h5",{className:s},e),r)}}AM.propTypes={text:E().node,className:E().string,style:E().object,children:E().node};const NM=function(){return(0,d.useContext)(CM)};var DM=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const LM=Ax.PREFIX,FM=e=>{const{fieldSet:t}=e,n=NM(),r=t.map((e=>$f(n.errors,e)));return wM(r)?null:h().createElement(TM,{error:r,showValidateIcon:e.showValidateIcon,isInInputGroup:e.isInInputGroup})};class jM extends d.Component{renderLabel(e,t){return e?xe()(e)?h().createElement(Lx,{width:t.labelWidth,text:e}):h().createElement(Lx,Object.assign({width:t.labelWidth},e)):null}render(){const e=this.props,{children:t,label:n,extraText:r,extraTextPosition:i}=e,s=DM(e,["children","label","extraText","extraTextPosition"]),o=this.context.getFormProps(["labelPosition","labelWidth","labelAlign","showValidateIcon","wrapperCol","labelCol","disabled"]),a=this.props.labelPosition||o.labelPosition,l=[],c=h().Children.map(t,(e=>e&&e.props&&e.props.field?(l.push(e.props.field),h().cloneElement(e,{isInInputGroup:!0})):null)),d=w()({[`${LM}-field-group`]:!0}),u=o.labelCol,p=o.wrapperCol,f=o.labelAlign,m=u&&p,g=u?`${LM}-col-${f}`:"",y=this.renderLabel(n,o),v=h().createElement(Bx,Object.assign({disabled:o.disabled},s),c),b=h().createElement(FM,{fieldSet:l,showValidateIcon:o.showValidateIcon,isInInputGroup:!0}),x=w()(`${LM}-field-extra`,{[`${LM}-field-extra-string`]:"string"==typeof r,[`${LM}-field-extra-middle`]:"middle"===i,[`${LM}-field-extra-bottom`]:"bottom"===i}),E=r?h().createElement("div",{className:x,"x-semi-prop":"extraText"},r):null;let C;switch(!0){case!m:C=h().createElement(h().Fragment,null,y,h().createElement("div",null,"middle"===i?E:null,v,"bottom"===i?E:null,b));break;case m&&"top"===a:C=h().createElement(h().Fragment,null,h().createElement("div",{style:{overflow:"hidden"}},h().createElement(rx,Object.assign({},u,{className:g}),y)),h().createElement(rx,Object.assign({},p),"middle"===i?E:null,v,"bottom"===i?E:null,b));break;case m&&"top"!==a:C=h().createElement(h().Fragment,null,h().createElement(rx,Object.assign({},u,{className:g}),y),h().createElement(rx,Object.assign({},p),"middle"===i?E:null,v,"bottom"===i?E:null,b))}return h().createElement("div",{"x-label-pos":a,className:d},C)}}jM.contextType=_M,jM.defaultProps={extraTextPosition:"bottom"};const $M=jM;__webpack_require__("WMVM");const BM=function(){return(0,d.useContext)(kM)};function VM(e){const t=(0,d.useRef)(void 0),[n,r]=(0,d.useState)(e);t.current=n;return[n,e=>{t.current=e,r(e)},()=>t.current]}function zM(e){const t=(0,d.useRef)(e);return function(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}(t.current,e)||(t.current=e),t.current}const HM=Ax.PREFIX,UM="undefined"!=typeof window?d.useLayoutEffect:d.useEffect;const KM=function(e,t){let n=(n,r)=>{let{field:i,label:s,labelPosition:o,labelWidth:a,labelAlign:l,labelCol:c,wrapperCol:u,noLabel:p,noErrorMessage:f,isInInputGroup:m,initValue:g,validate:y,validateStatus:v,trigger:b,allowEmptyString:x,allowEmpty:E,emptyValue:C,rules:S,required:_,keepState:k,transform:O,name:T,fieldClassName:P,fieldStyle:I,convert:M,stopValidateWithError:R,helpText:A,extraText:N,extraTextPosition:D,pure:L,id:F,rest:j}=xM(n),{options:$,shouldInject:B}=function(e,t){const n=Object.assign(Object.assign({},{valueKey:"value",onKeyChangeFnName:"onChange",valuePath:"",maintainCursor:!1,shouldInject:!0,shouldMemo:!0}),e);return{options:n,shouldInject:"field"in t||n.shouldInject}}(t,n);if(Q(void 0===i&&$.shouldInject,"[Semi Form]: 'field' is required, please check your props of Field Component"),!B)return h().createElement(e,Object.assign({},j,{ref:r}));NM();const V=(0,d.useContext)(_M);if(!V.getFormProps)return Q(!0,"[Semi Form]: Field Component must be use inside the Form, please check your dom declaration"),null;let z,H=V.getFormProps(["labelPosition","labelWidth","labelAlign","labelCol","wrapperCol","disabled","showValidateIcon","extraTextPosition","stopValidateWithError","trigger"]),U=o||H.labelPosition,K=a||H.labelWidth,W=l||H.labelAlign,G=c||H.labelCol,q=u||H.wrapperCol,X=D||H.extraTextPosition||"bottom",Y=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return _e()(e)?_e()(t)?n:t:e}(R,H.stopValidateWithError,!1),Z=function(e,t){let n=[],r=[];return n=_e()(e)?_e()(t)?Nx.DEFAULT_TRIGGER:t:e,Array.isArray(n)&&(r=n),"string"==typeof n&&(r[0]=n),r}(b,H.trigger),J=void 0!==i?V.getValue(i):void 0,ee=void 0!==g?g:J,te=!1;try{z=BM(),z&&(te=Boolean(z.inArrayField),ee=void 0!==g?z.shouldUseInitValue?g:void 0!==J?J:g:J)}catch(e){}const[ne,re,ie]=VM(void 0!==typeof ee?ee:null),se=Z.includes("mount");E=E||V.getFormProps().allowEmpty,k&&te&&(Q(!0,`[Semi Form]: 'keepState' is not supported on Field "${i}" inside <ArrayField/>. It will be ignored. Use add/remove on the ArrayField to manage array items instead.`),k=!1);const[oe,ae,le]=VM(),[ce,de]=(0,d.useState)(),[he,ue,pe]=VM(0),[fe,me]=(0,d.useState)(v),ge=(0,d.useRef)(!1),ye=(0,d.useRef)(S),ve=(0,d.useRef)(y),be=(0,d.useRef)(null),we=(e,t)=>{de(e),V.updateStateTouched(i,e,t)},xe=(e,t)=>{if(ge.current)return;if(e===le())return;t&&t.silent||(ae(e),wM(e)?me("success"):me("error")),V.updateStateError(i,e,t)},Ee=(e,t)=>{re(e);let n=Object.assign(Object.assign({},t),{allowEmpty:E});V.updateStateValue(i,e,n)},Ce=(e,t)=>{let n=ye.current||[];const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n={};return n[e]=t,new vM(n)}(i,n),s={[i]:e},o=new Promise(((e,n)=>{r.validate(s,{first:Y},((e,t)=>{})).then((n=>{ge.current||be.current!==o?console.warn(`[Semi Form]: When FieldComponent (${i}) has an unfinished validation process, you repeatedly trigger a new validation, the old validation will be abandoned, and will neither resolve nor reject. Usually this is an unreasonable practice. Please check your code.`):(me("success"),xe(void 0,t),e({}))})).catch((n=>{if(ge.current||be.current!==o)return void console.warn(`[Semi Form]: When FieldComponent (${i}) has an unfinished validation process, you repeatedly trigger a new validation, the old validation will be abandoned, and will neither resolve nor reject. Usually this is an unreasonable practice. Please check your code.`);let{errors:r,fields:s}=n;if(!r||!s)throw(null==t?void 0:t.silent)||me("error"),xe(n.message,t),e(n.message),n;{let n=r.map((e=>e.message));1===n.length&&(n=n[0]);Array.isArray(r)&&r.length>0&&((null==t?void 0:t.silent)||me("error"),xe(n,t),e(r))}}))}));return be.current=o,o},Se=(e,t)=>{let n=e,r=ye.current;return O&&(n=O(e)),ve.current?((e,t,n)=>{const r=new Promise((s=>{let o;try{o=ve.current(e,t)}catch(e){o=e}void 0===o?(s({}),xe(void 0,n)):qb(o)?o.then((e=>{ge.current||be.current!==r?console.warn(`[Semi Form]: When Field: (${i}) has an unfinished validation process, you repeatedly trigger a new validation, the old validation will be abandoned, and will neither resolve nor reject. Usually this is an unreasonable practice. Please check your code.`):wM(e)?(xe(void 0,n),s(null)):(xe(e,n),s(e))})):wM(o)?(xe(void 0,n),s(null)):(xe(o,n),s(o))}));return be.current=r,r})(n,V.getValue(),t):r?Ce(n,t):null},ke=function(e,t){let r;r=$.valuePath?$f(e,$.valuePath):e,"function"==typeof M&&(r=M(r)),x||E||r===C&&(r=void 0);try{t&&t.target&&t.target.selectionStart&&ue(t.target.selectionStart)}catch(e){}const s=ie(),o=V.getValue(i,{needClone:!0}),a=$.onKeyChangeFnName;try{if(re(r),V.updateStateValue(i,r,{notNotify:!0,notUpdate:!0,allowEmpty:E}),a in n&&"function"==typeof n[a]){const r=V.getValue();for(var l=arguments.length,c=new Array(l>2?l-2:0),d=2;d<l;d++)c[d-2]=arguments[d];n[a](e,t,...c,r)}de(!0),V.updateStateTouched(i,!0,{notNotify:!0,notUpdate:!0}),V.updateStateValue(i,r,{allowEmpty:E}),Z.includes("change")&&Se(r)}catch(e){throw re(s),V.updateStateValue(i,o,{notNotify:!0,notUpdate:!0,allowEmpty:E}),e}},Oe=function(){if(n.onBlur&&n.onBlur(...arguments),ce||we(!0),Z.includes("blur")){let e=ie();Se(e)}},Te={setValue:Ee,setTouched:we,setError:xe,reset:()=>{let e={notNotify:!0,notUpdate:!0};Ee(null!==ee?ee:void 0,e),xe(void 0,e),we(void 0,e),me("default")},validate:Se},Pe={value:ne,error:oe,touched:ce,status:fe};UM((()=>{ye.current=S,ve.current=y}),[S,y]),UM((()=>(ge.current=!1,se&&Se(ne),()=>{ge.current=!0})),[]),UM((()=>{if(void 0===i)return()=>{};const e=ie();return V.register(i,{value:e,error:oe,touched:ce,status:fe},{field:i,fieldApi:Te,keepState:k,allowEmpty:E||x}),()=>{V.unRegister(i)}}),[i]);const Ie=F||i,Me=`${Ie}-label`,Re=`${Ie}-helpText`,Ae=`${Ie}-extraText`,Ne=`${Ie}-errormessage`,De=()=>{let t=v||fe;const n=w()(`${HM}-field-extra`,{[`${HM}-field-extra-string`]:"string"==typeof N,[`${HM}-field-extra-middle`]:"middle"===X,[`${HM}-field-extra-bottom`]:"bottom"===X}),o=N?h().createElement("div",{className:n,id:Ae,"x-semi-prop":"extraText"},N):null;let a=Object.assign(Object.assign({id:Ie,disabled:H.disabled},j),{ref:r,onBlur:Oe,[$.onKeyChangeFnName]:ke,[$.valueKey]:ne,validateStatus:t,"aria-required":_,"aria-labelledby":Me});T&&(a.name=T),A&&(a["aria-describedby"]=N?`${Re} ${Ae}`:Re),N&&(a["aria-describedby"]=A?`${Re} ${Ae}`:Ae),"error"===fe&&(a["aria-errormessage"]=Ne,a["aria-invalid"]=!0);const l=w()({[`${HM}-field`]:!0,[`${HM}-field-${T}`]:Boolean(T),[P]:Boolean(P)}),c=w()({[`${HM}-field-main`]:!0});"inset"!==U||p||(a.insetLabel=s||i,a.insetLabelId=Me,"object"!=typeof s||lI(s)||(a.insetLabel=s.text,a.insetLabelId=Me));const d=h().createElement(e,Object.assign({},a));if(m)return d;if(L){let t=w()(j.className,{[`${HM}-field-pure`]:!0,[`${HM}-field-${T}`]:Boolean(T),[P]:Boolean(P)});return a.className=t,h().createElement(e,Object.assign({},a))}let u=G&&q;const g=W?`${HM}-col-${W}`:"";let y=null;if(!p&&"inset"!==U){let e="object"!=typeof s||lI(s)?{}:s;y=h().createElement(Lx,Object.assign({text:s||i,id:Me,required:_,name:Ie||T||i,width:K,align:W},e))}const b=h().createElement("div",{className:c},"middle"===X?o:null,d,f?null:h().createElement(TM,{error:oe,validateStatus:t,helpText:A,helpTextId:Re,errorMessageId:Ne,showValidateIcon:H.showValidateIcon}),"bottom"===X?o:null),x=h().createElement(h().Fragment,null,"top"===U?h().createElement("div",{style:{overflow:"hidden"}},h().createElement(rx,Object.assign({},G,{className:g}),y)):h().createElement(rx,Object.assign({},G,{className:g}),y),h().createElement(rx,Object.assign({},q),b));return h().createElement("div",{className:l,style:I,"x-label-pos":U,"x-field-id":i,"x-extra-pos":X},u?x:h().createElement(h().Fragment,null,y,b))},Le=zM(Object.keys(n).sort()),Fe=zM(Le.map((e=>n[e]))),je=[...Object.values(Pe),Le,Fe,i,U,W,H.disabled];return $.shouldMemo?(0,d.useMemo)(De,[...je]):De()};return n=(0,d.forwardRef)(n),n.displayName=function(e){const t=e.displayName||e.name;return t?`SemiField${t}`:"SemiField"}(e),n};var WM=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};class GM extends c{constructor(e){var t;super(Object.assign({},e)),t=this,this.handleCurrentActiveIndexChange=(e,t)=>{"focus"===t&&this._adapter.onCurrentActiveIndexChange(e)},this.completeSingleInput=(e,t)=>WM(this,void 0,void 0,(function*(){var n;const r=this._isInProps("value");yield this._adapter.onCurrentActiveIndexChange(e+1);const i=[...this.getState("valueList")];i[e]=t,this._adapter.notifyValueChange(i),r||(yield this.updateValueList(i));const s=this.getProp("count");e+1>s-1?(this._adapter.changeSpecificInputFocusState(e,"blur"),null===(n=this.getProp("onComplete"))||void 0===n||n(i.join(""))):this._adapter.changeSpecificInputFocusState(e+1,"focus")})),this.validateValue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const n=t.getProp("format");let r=e=>!0;return"string"==typeof n?"number"===n?r=e=>0===e.length||GM.numberReg.test(e):"mixed"===n&&(r=e=>0===e.length||GM.mixedReg.test(e)):n instanceof RegExp?r=e=>n.test(e):"function"==typeof n&&(r=n),r(e)},this.updateValueList=e=>WM(this,void 0,void 0,(function*(){this._adapter.updateValueList(e)})),this.handlePaste=(e,t)=>WM(this,void 0,void 0,(function*(){e.preventDefault();const n=e.clipboardData.getData("text"),r=this.getProp("count");for(let e=t,i=0;e<r&&i<n.length;e++,i++){const t=n[i];if(!this.validateValue(t))break;yield this.completeSingleInput(e,t)}})),this.handleKeyDownOnSingleInput=(e,t)=>{const n=[...this.getState("valueList")];"Backspace"===e.key?(n[t]="",this.updateValueList(n),this._adapter.notifyValueChange(n),this._adapter.changeSpecificInputFocusState(Math.max(0,t-1),"focus"),e.preventDefault()):"Delete"===e.key?(n[t]="",this.updateValueList(n),this._adapter.notifyValueChange(n),this._adapter.changeSpecificInputFocusState(Math.min(n.length-1,t+1),"focus"),e.preventDefault()):"ArrowLeft"===e.key?(this._adapter.changeSpecificInputFocusState(Math.max(0,t-1),"focus"),e.preventDefault()):"ArrowRight"===e.key&&(this._adapter.changeSpecificInputFocusState(Math.min(n.length-1,t+1),"focus"),e.preventDefault())}}}GM.numberReg=/^\d*$/,GM.mixedReg=/^[0-9a-zA-Z]$/;const qM=GM,XM=`${C}-pincode`;__webpack_require__("5Nuo");var YM=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};class ZM extends f{constructor(e){super(e),this.inputDOMList=[],this.focus=e=>{const t=this.inputDOMList[e];null==t||t.focus(),null==t||t.setSelectionRange(1,1)},this.blur=e=>{var t;null===(t=this.inputDOMList[e])||void 0===t||t.blur()},this.renderSingleInput=e=>h().createElement(kr,{ref:t=>this.inputDOMList[e]=t,key:`input-${e}`,autoFocus:this.props.autoFocus&&0===e,inputMode:"number"===this.props.format?"numeric":"text",value:this.state.valueList[e],size:this.props.size,disabled:this.props.disabled,onBlur:()=>this.foundation.handleCurrentActiveIndexChange(e,"blur"),onFocus:()=>this.foundation.handleCurrentActiveIndexChange(e,"focus"),onPaste:t=>this.foundation.handlePaste(t.nativeEvent,e),onKeyDown:t=>{this.foundation.handleKeyDownOnSingleInput(t.nativeEvent,e)},onChange:(t,n)=>{const r=n.nativeEvent;if(r&&"isComposing"in r&&r.isComposing)return;const i=t[t.length-1];this.foundation.validateValue(i)&&this.foundation.completeSingleInput(e,i)}}),this.foundation=new qM(this.adapter),this.state={valueList:(this.props.value||this.props.defaultValue)&&(this.props.value||this.props.defaultValue).split("")||[],currentActiveIndex:0}}componentDidUpdate(e,t,n){e.value!==this.props.value&&this.foundation.updateValueList((this.props.value||"").split(""))}get adapter(){return Object.assign(Object.assign({},super.adapter),{onCurrentActiveIndexChange:e=>YM(this,void 0,void 0,(function*(){yield this.setStateAsync({currentActiveIndex:e})})),notifyValueChange:e=>{var t,n;null===(n=(t=this.props).onChange)||void 0===n||n.call(t,e.join(""))},changeSpecificInputFocusState:(e,t)=>{var n,r,i,s;"focus"===t?null===(r=null===(n=this.inputDOMList[e])||void 0===n?void 0:n.focus)||void 0===r||r.call(n):"blur"===t&&(null===(s=null===(i=this.inputDOMList[e])||void 0===i?void 0:i.blur)||void 0===s||s.call(i))},updateValueList:e=>YM(this,void 0,void 0,(function*(){yield this.setStateAsync({valueList:e})}))})}render(){const e=[];for(let t=0;t<this.props.count;t++)e.push(this.renderSingleInput(t));return h().createElement("div",{className:w()(`${XM}-wrapper`,this.props.className),style:this.props.style},e)}}ZM.__SemiComponentName__="PinCode",ZM.propTypes={value:E().string,format:E().oneOfType([E().string,E().object,E().func]),onChange:E().func,defaultValue:E().string,count:E().number,className:E().string,style:E().object,autoFocus:E().bool,onComplete:E().func},ZM.defaultProps=he(ZM.__SemiComponentName__,{count:6,format:"number",autoFocus:!0});const JM=ZM,QM=KM(kr,{maintainCursor:!0}),eR=KM(pE,{maintainCursor:!0}),tR=KM(Jx,{maintainCursor:!0}),nR=KM(YC);nR.Option=YC.Option,nR.OptGroup=YC.OptGroup;const rR=KM(dd),iR=KM(od,{valueKey:"checked",valuePath:"target.checked",shouldInject:!1}),sR=KM($S,{valuePath:"target.value"}),oR=KM(LS,{valueKey:"checked",valuePath:"target.checked",shouldInject:!1}),aR=KM(bb),lR=KM(F_,{valueKey:"checked"}),cR=KM(f_),dR=KM(VT),hR=KM(LP),uR=KM(uf),pR=KM(XS),fR=KM(Hr,{valueKey:"value",onKeyChangeFnName:"onChange"}),mR=KM(MI,{valueKey:"fileList",valuePath:"fileList",onKeyChangeFnName:"onChange"}),gR=KM(cf),yR=KM(JM),vR={values:{},errors:{},touched:{}};const bR=function(){const[e,t]=(0,d.useState)(vR),n=(0,d.useRef)(null),r=(0,d.useRef)(null),i=(0,d.useCallback)((e=>{n.current=e,r.current&&(r.current.__realApi=e),t(e.getFormState())}),[]),s=(0,d.useCallback)((()=>{n.current=null,r.current&&(r.current.__realApi=null),t(vR)}),[]),o=(0,d.useCallback)((e=>{t((t=>t===e?t:e))}),[]);if(r.current)r.current.__bind=i,r.current.__unbind=s,r.current.__updateState=o;else{const e=new Proxy({__realApi:null,__bind:i,__unbind:s,__updateState:o},{get(e,t){if(t.startsWith("__"))return e[t];const n=e.__realApi;if(!n)return"string"==typeof t?function(){console.warn(`[Semi Form] FormApi.${t}() is called before Form component is mounted. Please ensure the Form component is rendered first.`)}:void 0;const r=n[t];return"function"==typeof r?r.bind(n):r},set:(e,t,n)=>!!t.startsWith("__")&&(e[t]=n,!0)});r.current=e}const a=e.values;return[r.current,e,a]};var wR=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const xR=Ax.PREFIX;class ER extends f{constructor(e){super(e),this.state={formId:""},Q(Boolean(e.component&&e.render),"[Semi Form] You should not use <Form component> and <Form render> in ths same time; <Form render> will be ignored"),Q(e.component&&e.children&&!cI(e.children),"[Semi Form] You should not use <Form component> and <Form>{children}</Form> in ths same time; <Form>{children}</Form> will be ignored"),Q(e.render&&e.children&&!cI(e.children),"[Semi Form] You should not use <Form render> and <Form>{children}</Form> in ths same time; <Form>{children}</Form> will be ignored"),this.submit=this.submit.bind(this),this.reset=this.reset.bind(this),this.foundation=new EM(this.adapter),this.formApi=this.foundation.getFormApi(),this.props.getFormApi&&this.props.getFormApi(this.formApi)}componentDidMount(){this.foundation.init(),this.props.form&&"function"==typeof this.props.form.__bind&&this.props.form.__bind(this.formApi)}componentWillUnmount(){this.foundation.destroy(),this.props.form&&"function"==typeof this.props.form.__unbind&&this.props.form.__unbind()}get adapter(){return Object.assign(Object.assign({},super.adapter),{cloneDeep:ie,notifySubmit:(e,t)=>{this.props.onSubmit(e,t)},notifySubmitFail:(e,t,n)=>{this.props.onSubmitFail(e,t,n)},forceUpdate:e=>{if(this.forceUpdate(e),this.props.form&&"function"==typeof this.props.form.__updateState){const e=this.foundation.getFormState();this.props.form.__updateState(e)}},notifyChange:e=>{this.props.onChange(e)},notifyValueChange:(e,t)=>{this.props.onValueChange(e,t)},notifyErrorChange:(e,t)=>{this.props.onErrorChange(e,t)},notifyReset:()=>{this.props.onReset()},initFormId:()=>{this.setState({formId:Ke()})},getInitValues:()=>this.props.initValues,getFormProps:e=>{if(void 0===e)return this.props;if("string"==typeof e)return this.props[e];{const t={};return e.forEach((e=>{t[e]=this.props[e]})),t}},getAllErrorDOM:()=>{const{formId:e}=this.state,{id:t}=this.props,n=t||e;return document.querySelectorAll(`form[x-form-id="${n}"] .${Ax.PREFIX}-field-error-message`)},getFieldDOM:e=>{const{formId:t}=this.state,{id:n}=this.props,r=n||t;return document.querySelector(`form[x-form-id="${r}"] .${Ax.PREFIX}-field[x-field-id="${e}"]`)},getFieldErrorDOM:e=>{const{formId:t}=this.state,{id:n}=this.props;let r=`form[x-form-id="${n||t}"] .${Ax.PREFIX}-field[x-field-id="${e}"] .${Ax.PREFIX}-field-error-message`;return document.querySelector(r)}})}get content(){const{children:e,component:t,render:n}=this.props,r=this.foundation.getFormState(),i={formState:r,formApi:this.foundation.getFormApi(),values:r.values};return t?h().createElement(t,i):n?n(i):"function"==typeof e?e(i):e}submit(e){e.preventDefault(),this.props.stopPropagation&&this.props.stopPropagation.submit&&e.stopPropagation(),this.foundation.submit(e)}reset(e){e.preventDefault(),this.props.stopPropagation&&this.props.stopPropagation.reset&&e.stopPropagation(),this.foundation.reset()}render(){const e=this.foundation.getFormState(!1),t=this.foundation.getModifyFormStateApi(),{formId:n}=this.state,r=this.props,{children:i,form:s,getFormApi:o,onChange:a,onSubmit:l,onSubmitFail:c,onErrorChange:d,onValueChange:u,component:p,render:f,validateFields:m,validator:g,initValues:y,layout:v,style:b,className:x,labelPosition:E,labelWidth:C,labelAlign:S,labelCol:_,wrapperCol:k,allowEmpty:O,autoScrollToError:T,showValidateIcon:P,stopValidateWithError:I,extraTextPosition:M,id:R,trigger:A}=r,N=wR(r,["children","form","getFormApi","onChange","onSubmit","onSubmitFail","onErrorChange","onValueChange","component","render","validateFields","validator","initValues","layout","style","className","labelPosition","labelWidth","labelAlign","labelCol","wrapperCol","allowEmpty","autoScrollToError","showValidateIcon","stopValidateWithError","extraTextPosition","id","trigger"]),D=w()(xR,x,{[xR+"-vertical"]:"vertical"===v,[xR+"-horizontal"]:"horizontal"===v}),L=k&&_,F=h().createElement("form",Object.assign({style:b},N,{onReset:this.reset,onSubmit:this.submit,className:D,id:R||n,"x-form-id":R||n}),this.content),j=h().createElement(Qw,null,F);return h().createElement(_M.Provider,{value:t},h().createElement(SM.Provider,{value:this.formApi},h().createElement(CM.Provider,{value:e},L?j:F)))}}ER.__SemiComponentName__="Form",ER.propTypes={"aria-label":E().string,onSubmit:E().func,onSubmitFail:E().func,onChange:E().func,onReset:E().func,onValueChange:E().func,autoScrollToError:E().oneOfType([E().bool,E().object]),allowEmpty:E().bool,className:E().string,component:E().oneOfType([E().node,E().func]),disabled:E().bool,extraTextPosition:E().oneOf(Nx.EXTRA_POS),getFormApi:E().func,initValues:E().object,validateFields:E().func,validator:E().func,layout:E().oneOf(Nx.LAYOUT),labelPosition:E().oneOf(Nx.LABEL_POS),labelWidth:E().oneOfType([E().number,E().string]),labelAlign:E().oneOf(Nx.LABEL_ALIGN),labelCol:E().object,render:E().func,style:E().object,showValidateIcon:E().bool,stopValidateWithError:E().bool,stopPropagation:E().shape({submit:E().bool,reset:E().bool}),id:E().string,wrapperCol:E().object,trigger:E().oneOfType([E().oneOf(["blur","change","custom","mount"]),E().arrayOf(E().oneOf(["blur","change","custom","mount"]))]),form:E().object},ER.defaultProps=he(ER.__SemiComponentName__,{onChange:i(),onSubmitFail:i(),onSubmit:i(),onReset:i(),onValueChange:i(),onErrorChange:i(),layout:"vertical",labelPosition:"top",allowEmpty:!1,autoScrollToError:!1,showValidateIcon:!0}),ER.Input=QM,ER.TextArea=tR,ER.InputNumber=eR,ER.Select=nR,ER.Checkbox=iR,ER.CheckboxGroup=rR,ER.Radio=oR,ER.RadioGroup=sR,ER.DatePicker=aR,ER.TimePicker=dR,ER.Switch=lR,ER.Slider=cR,ER.TreeSelect=hR,ER.Cascader=uR,ER.Rating=pR,ER.AutoComplete=fR,ER.Upload=mR,ER.TagInput=gR,ER.PinCode=yR,ER.Slot=MM,ER.ErrorMessage=TM,ER.InputGroup=$M,ER.Label=Lx,ER.Section=AM,ER.useForm=bR;const CR=ER;function SR(){return(0,d.useContext)(SM)}const _R=function(e){return((e,t)=>({getError:()=>e.getError(t),setError:n=>e.setError(t,n),getTouched:()=>e.getTouched(t),setTouched:n=>e.setTouched(t,n),getValue:()=>e.getValue(t),setValue:n=>e.setValue(t,n)}))(SR(),e)};const kR=function(e){return((e,t)=>({value:$f(e.values,t),error:$f(e.errors,t),touched:$f(e.touched,t)}))(NM(),e)};const OR=function(e){let t=(t,n)=>h().createElement(CM.Consumer,null,(r=>h().createElement(e,Object.assign({formState:r,ref:n},t))));return t=(0,d.forwardRef)(t),t};const TR=function(e){let t=(t,n)=>h().createElement(SM.Consumer,null,(r=>h().createElement(e,Object.assign({formApi:r,ref:n},t))));return t=(0,d.forwardRef)(t),t},PR=(e,t)=>{const n=(e=>e.map((()=>Ke())))((e=>{const t=[];return Array.isArray(e)?e:(Q(!_e()(e),"[Semi Form ArrayField] initValue of ArrayField must be an array. Please check the type of your props"),t)})(e)),r=n.map(((e,n)=>t&&t[n]?t[n]:e));return r};class IR extends d.Component{constructor(e,t){super(e,t);const n=this.props.initValue,{field:r}=this.props,i=t.getValue(r),s=n||i;this.state={keys:PR(s)},this.add=this.add.bind(this),this.addWithInitValue=this.addWithInitValue.bind(this),this.remove=this.remove.bind(this),this.cacheFieldValues=null,this.cacheUpdateKey=null,this.shouldUseInitValue=!t.getArrayField(r);const o=Ky(s),a=Ky(s);t.registerArrayField(r,a),t.updateStateValue(r,o,{notNotify:!0,notUpdate:!0})}componentWillUnmount(){const e=this.context,{field:t}=this.props;e.unRegisterArrayField(t)}componentDidUpdate(){const e=this.context,{field:t}=this.props,{keys:n}=this.state,r=e.getValue(t),i=(e=>{if(e)return e&&e.updateKey?e.updateKey:void 0})(e.getArrayField(t));if(i!==this.cacheUpdateKey){const e=PR(r,n);this.setState({keys:e}),this.cacheUpdateKey=i,null!==this.cacheUpdateKey&&(this.shouldUseInitValue=!1)}}add(e){const{keys:t}=this.state,{field:n}=this.props,r=this.context,i=Ke(),s={notNotify:!0,notUpdate:!0};if("number"==typeof e){const o=Math.max(0,Math.min(e,t.length));t.splice(o,0,i);let a=r.getValue(n);Array.isArray(a)&&(a=a.slice(),a.splice(o,0,void 0),r.updateStateValue(n,a,s));let l=r.getError(n);Array.isArray(l)&&(l=l.slice(),l.splice(o,0,void 0),r.updateStateError(n,l,s))}else t.push(i);this.shouldUseInitValue=!0,this.setState({keys:t});const o=(new Date).valueOf();return r.updateArrayField(n,{updateKey:o}),this.cacheUpdateKey=o,i}addWithInitValue(e,t){const n=this.context,{field:r}=this.props,i=n.getValue(r)?n.getValue(r).slice():[],s=Ky(e);if("number"==typeof t){const e=Math.max(0,Math.min(t,i.length));i.splice(e,0,s)}else i.push(s);n.updateStateValue(r,i,{}),n.updateArrayField(r,{updateKey:(new Date).valueOf()})}remove(e){const t=this.context,{keys:n}=this.state,{field:r}=this.props,i=((e,t)=>e.filter(((e,n)=>n!==t)))(n,e);let s=t.getError(r);const o={notNotify:!0,notUpdate:!0};Array.isArray(s)&&(s=s.slice(),s.splice(e,1),t.updateStateError(r,s,o));let a=t.getValue(r);Array.isArray(a)&&(a=a.slice(),a.splice(e,1),t.updateStateValue(r,a)),this.setState({keys:i})}render(){const{children:e,field:t}=this.props,{keys:n}=this.state,r=n.map(((e,n)=>({key:e,field:`${t}[${n}]`,remove:()=>this.remove(n)}))),{add:i}=this,{addWithInitValue:s}=this,o={shouldUseInitValue:this.shouldUseInitValue,inArrayField:!0};return h().createElement(kM.Provider,{value:o},e({arrayFields:r,add:i,addWithInitValue:s}))}}IR.contextType=_M;const MR=IR,RR={PREFIX:`${C}-image`};const AR=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-9.5 5.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0ZM12 5a1.9 1.9 0 0 0-1.89 2l.3 5.5a1.59 1.59 0 0 0 3.17 0l.3-5.5c.07-1.09-.8-2-1.88-2Z",fill:"currentColor"}))}),"upload_error");const NR=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23 12c0 .83-.67 1.5-1.5 1.5H6.12l6.44 6.44a1.5 1.5 0 0 1-2.12 2.12l-9-9a1.5 1.5 0 0 1 0-2.12l9-9a1.5 1.5 0 0 1 2.12 2.12L6.12 10.5H21.5c.83 0 1.5.67 1.5 1.5Z",fill:"currentColor"}))}),"arrow_left");const DR=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 12c0-.83.67-1.5 1.5-1.5h15.38l-6.44-6.44a1.5 1.5 0 0 1 2.12-2.12l9 9a1.5 1.5 0 0 1 0 2.12l-9 9a1.5 1.5 0 0 1-2.12-2.12l6.44-6.44H2.5A1.5 1.5 0 0 1 1 12Z",fill:"currentColor"}))}),"arrow_right"),LR=(0,d.createContext)({}),FR=`${RR.PREFIX}-preview-header`,jR=(0,d.forwardRef)(((e,t)=>{let{onClose:n,titleStyle:r,className:i,renderHeader:s,closable:o,renderCloseIcon:a}=e;return h().createElement(LR.Consumer,null,(e=>{let l,{currentIndex:c,titles:d}=e;d&&"number"==typeof c&&(l=d[c]);const u="function"==typeof a?null==a?void 0:a():a;return void 0===u||h().isValidElement(u)||console.warn("[Semi ImagePreview] RenderCloseIcon should be a valid react element or a function that returns a react element"),h().createElement("section",{ref:t,className:w()(FR,i)},h().createElement("section",{className:`${FR}-title`,style:r},s?s(l):l),o&&h().createElement("section",{className:`${FR}-close`,onMouseUp:n},h().isValidElement(u)?u:h().createElement(Ji,null)))}))})),$R=jR;const BR=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M2 12c0-.83.67-1.5 1.5-1.5h17a1.5 1.5 0 0 1 0 3h-17A1.5 1.5 0 0 1 2 12Z",fill:"currentColor"}))}),"minus");const VR=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M20.5 13.5a1.5 1.5 0 0 0 0-3h-7v-7a1.5 1.5 0 0 0-3 0v7h-7a1.5 1.5 0 0 0 0 3h7v7a1.5 1.5 0 0 0 3 0v-7h7Z",fill:"currentColor"}))}),"plus");const zR=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 6c0-1.1.9-2 2-2h18a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V6Zm20 0H3v12h18V6ZM5 9a1 1 0 0 1 1-1h1.5a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0v-5H6a1 1 0 0 1-1-1Zm11-1a1 1 0 1 0 0 2h.5v5a1 1 0 1 0 2 0V9a1 1 0 0 0-1-1H16Zm-3 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-1 5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"currentColor"}))}),"real_size_stroked");const HR=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 3a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V4h-5a1 1 0 0 1-1-1Zm-4 18a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-6a1 1 0 1 1 2 0v5h5a1 1 0 0 1 1 1ZM2 9a1 1 0 0 0 2 0V4h5a1 1 0 1 0 0-2H3a1 1 0 0 0-1 1v6Zm19 5a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-6a1 1 0 1 1 0-2h5v-5a1 1 0 0 1 1-1ZM8.5 7.5a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1v-7a1 1 0 0 0-1-1h-7Zm1 7v-5h5v5h-5Z",fill:"currentColor"}))}),"window_adaption_stroked");const UR=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M14.2 2.2A1 1 0 0 0 12.8.8l-2.5 2.5a1 1 0 0 0 0 1.4l2.5 2.5a1 1 0 1 0 1.4-1.4l-.79-.8H16a5 5 0 0 1 5 5v2a1 1 0 1 0 2 0v-2a7 7 0 0 0-7-7h-2.59l.8-.8Z",fill:"currentColor"}),d.createElement("path",{d:"M3 10c0-1.1.9-2 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V10Z",fill:"currentColor"}))}),"rotate");const KR=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.84 8.06A6.5 6.5 0 1 0 5.18 11 4.5 4.5 0 0 0 5.5 20H17a6 6 0 0 0 .84-11.94Zm-6.16 9.67a.5.5 0 0 0 .64 0l5.15-4.29a.25.25 0 0 0-.16-.44H14V9.5a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5V13H6.7c-.24 0-.35.3-.17.44l5.15 4.3Z",fill:"currentColor"}))}),"download");class WR extends c{constructor(){super(...arguments),this.changeSliderValue=e=>{const{zoom:t,step:n,min:r,max:i}=this.getProps();let s="plus"===e?t+n:t-n;s>i?s=i:s<r&&(s=r),this.handleValueChange(s)},this.handleValueChange=e=>{const{onZoomIn:t,onZoomOut:n,zoom:r}=this.getProps();e>r?t(Number((e/100).toFixed(2))):n(Number((e/100).toFixed(2)))},this.handleRatioClick=()=>{const{ratio:e,onAdjustRatio:t}=this.getProps();t("adaptation"===e?"realSize":"adaptation")},this.handleRotate=e=>{const{onRotate:t}=this.getProps();t&&t(e)}}}const GR=RR.PREFIX,qR=`${RR.PREFIX}-preview-footer`;class XR extends f{get adapter(){return Object.assign({},super.adapter)}constructor(e){var t;super(e),t=this,this.changeSliderValue=e=>{this.foundation.changeSliderValue(e)},this.handleMinusClick=()=>{this.changeSliderValue("minus")},this.handlePlusClick=()=>{this.changeSliderValue("plus")},this.handleRotateLeft=()=>{this.foundation.handleRotate("left")},this.handleRotateRight=()=>{this.foundation.handleRotate("right")},this.handleSlideChange=g()((e=>{this.foundation.handleValueChange(e)}),50),this.handleRatioClick=()=>{this.foundation.handleRatioClick()},this.customRenderViewMenu=()=>{const{min:e,max:t,step:n,curPage:r,totalNum:i,ratio:s,zoom:o,disabledPrev:a,disabledNext:l,disableDownload:c,onNext:d,onPrev:h,onDownload:u,renderPreviewMenu:p}=this.props;return p({min:e,max:t,step:n,curPage:r,totalNum:i,ratio:s,zoom:o,disabledPrev:a,disabledNext:l,disableDownload:c,onNext:d,onPrev:h,onDownload:u,onRotateLeft:this.handleRotateLeft,onRotateRight:this.handleRotateRight,disabledZoomIn:o===t,disabledZoomOut:o===e,onRatioClick:this.handleRatioClick,onZoomIn:this.handlePlusClick,onZoomOut:this.handleMinusClick,menuItems:this.getMenu()})},this.getFinalIconElement=function(e,n,r){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{showTooltip:s,zIndex:o}=t.props;return s?h().createElement(_t,{content:n,key:`tooltip-${r}`,zIndex:o+1},h().createElement("span",{className:w()(`${GR}-tooltip-children-wrapper`,{[`${qR}-gap`]:i})},e)):e},this.getLocalTextByKey=e=>h().createElement(Jt,{componentName:"Image"},(t=>t[e])),this.getIconChevronLeft=()=>{const{disabledPrev:e,onPrev:t,prevTip:n}=this.props,r=h().createElement(Rl,{key:"chevron-left",size:"large",className:e?`${qR}-disabled`:"",onClick:e?void 0:t}),i=null!=n?n:this.getLocalTextByKey("prevTip");return this.getFinalIconElement(r,i,"chevron-left")},this.getIconChevronRight=()=>{const{disabledNext:e,onNext:t,nextTip:n}=this.props,r=h().createElement(Al,{key:"chevron-right",size:"large",className:e?`${qR}-disabled`:"",onClick:e?void 0:t}),i=null!=n?n:this.getLocalTextByKey("nextTip");return this.getFinalIconElement(r,i,"chevron-right")},this.getIconMinus=()=>{const{zoomOutTip:e,zoom:t,min:n}=this.props,r=t===n,i=h().createElement(BR,{key:"minus",size:"large",onClick:r?void 0:this.handleMinusClick,className:r?`${qR}-disabled`:""}),s=null!=e?e:this.getLocalTextByKey("zoomOutTip");return this.getFinalIconElement(i,s,"minus")},this.getIconPlus=()=>{const{zoomInTip:e,zoom:t,max:n}=this.props,r=t===n,i=h().createElement(VR,{key:"plus",size:"large",onClick:r?void 0:this.handlePlusClick,className:r?`${qR}-disabled`:""}),s=null!=e?e:this.getLocalTextByKey("zoomInTip");return this.getFinalIconElement(i,s,"plus")},this.getIconRatio=()=>{const{ratio:e,originTip:t,adaptiveTip:n,showTooltip:r}=this.props,i={key:"ratio",size:"large",className:r?void 0:`${qR}-gap`,onClick:this.handleRatioClick},s="adaptation"===e?h().createElement(zR,Object.assign({},i)):h().createElement(HR,Object.assign({},i));let o;return o="adaptation"===e?null!=t?t:this.getLocalTextByKey("originTip"):null!=n?n:this.getLocalTextByKey("adaptiveTip"),this.getFinalIconElement(s,o,"ratio",!0)},this.getIconRotate=()=>{const{rotateTip:e}=this.props,t=h().createElement(UR,{key:"rotate",size:"large",onClick:this.handleRotateLeft}),n=null!=e?e:this.getLocalTextByKey("rotateTip");return this.getFinalIconElement(t,n,"rotate")},this.getIconDownload=()=>{const{downloadTip:e,onDownload:t,disableDownload:n,showTooltip:r}=this.props,i=h().createElement(KR,{key:"download",size:"large",onClick:n?void 0:t,className:w()({[`${qR}-gap`]:!r,[`${qR}-disabled`]:n})}),s=null!=e?e:this.getLocalTextByKey("downloadTip");return this.getFinalIconElement(i,s,"download",!0)},this.getNumberInfo=()=>{const{curPage:e,totalNum:t}=this.props;return h().createElement("div",{className:`${qR}-page`,key:"info"},e,"/",t)},this.getSlider=()=>{const{zoom:e,min:t,max:n,step:r,showTooltip:i}=this.props;return h().createElement(f_,{key:"slider",value:e,min:t,max:n,step:r,tipFormatter:e=>`${e}%`,tooltipVisible:!!i&&void 0,onChange:this.handleSlideChange})},this.getMenu=()=>[this.getIconChevronLeft(),this.getNumberInfo(),this.getIconChevronRight(),this.getIconMinus(),this.getSlider(),this.getIconPlus(),this.getIconRatio(),this.getIconRotate(),this.getIconDownload()],this.getFooterMenu=()=>{const e=this.getMenu();return e.splice(3,0,h().createElement(Bb,{layout:"vertical",key:"divider-first"})),e.splice(8,0,h().createElement(Bb,{layout:"vertical",key:"divider-second"})),e},this.foundation=new WR(this.adapter)}render(){const{className:e,renderPreviewMenu:t,forwardRef:n}=this.props,r=w()(qR,`${qR}-wrapper`,e,{[`${qR}-content`]:!Boolean(t)});return h().createElement("section",{className:r,ref:n},t?this.customRenderViewMenu():this.getFooterMenu())}}XR.propTypes={curPage:E().number,totalNum:E().number,disabledPrev:E().bool,disabledNext:E().bool,disableDownload:E().bool,className:E().string,zoom:E().number,ratio:E().string,prevTip:E().string,nextTip:E().string,zoomInTip:E().string,zoomOutTip:E().string,rotateTip:E().string,downloadTip:E().string,adaptiveTip:E().string,originTip:E().string,showTooltip:E().bool,onZoomIn:E().func,onZoomOut:E().func,onPrev:E().func,onNext:E().func,onAdjustRatio:E().func,onRotateLeft:E().func,onDownload:E().func},XR.defaultProps={min:10,max:500,step:10,showTooltip:!1,disableDownload:!1};class YR extends c{constructor(e){var t;super(Object.assign({},e)),t=this,this.startMouseClientPosition={x:0,y:0},this.originImageWidth=null,this.originImageHeight=null,this.containerWidth=0,this.containerHeight=0,this._initialZoomApplied=!1,this._initialZoomAppliedSrc=void 0,this._syncInitialZoomFlagWithSrc=()=>{const e=this.getProp("src");e!==this._initialZoomAppliedSrc&&(this._initialZoomAppliedSrc=e,this._initialZoomApplied=!1)},this._clampZoom=e=>{const{maxZoom:t,minZoom:n}=this.getProps(),r="number"==typeof t?t:5,i="number"==typeof n?n:.1;return"number"==typeof e&&Number.isFinite(e)?Math.min(r,Math.max(i,e)):i},this._isImageVertical=()=>this.getProp("rotation")%180!=0,this._getContainerBoundingRectSize=()=>{const e=this._adapter.getContainer();e&&(this.containerWidth=e.clientWidth,this.containerHeight=e.clientHeight)},this._getAdaptationZoom=()=>{let e=1;if(this._adapter.getContainer()&&this.originImageWidth&&this.originImageHeight){const{rotation:t}=this.getProps(),{width:n,height:r}=this.calcBoundingRectSize(this.originImageWidth,this.originImageHeight,t),i=this.containerWidth-80,s=this.containerHeight-80;e=Number(Math.min(i/n,s/r).toFixed(2))}return e},this._getInitialZoom=()=>{const{ratio:e,initialZoom:t}=this.getProps();let n=1;return this._syncInitialZoomFlagWithSrc(),!this._initialZoomApplied&&"number"==typeof t&&Number.isFinite(t)&&t>0?(this._initialZoomApplied=!0,this._clampZoom(t)):("adaptation"===e&&(n=this._getAdaptationZoom()),this._clampZoom(n))},this.setLoading=e=>{this._adapter.setLoading(e)},this.handleWindowResize=()=>{this._getContainerBoundingRectSize(),this.initializeImage()},this.handleLoad=e=>{if(e.target){const{naturalWidth:t,naturalHeight:n}=e.target;this.originImageHeight=n,this.originImageWidth=t,this._syncInitialZoomFlagWithSrc(),this.setState({loading:!1}),this.initializeImage(!1)}const{src:t,onLoad:n}=this.getProps();n&&n(t)},this.handleError=e=>{const{onError:t,src:n}=this.getProps();this.setState({loading:!1}),t&&t(n)},this.handleRatioChange=()=>{this.initializeImage()},this.initializeImageZoom=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{currZoom:n}=t.getStates(),{onZoom:r}=t.getProps(),i=t._getInitialZoom();n!==i?r(i,e):t.changeZoom(i)},this.initializeTranslate=()=>{this.setState({translate:{x:0,y:0}})},this.initializeImage=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t.initializeImageZoom(e),t.initializeTranslate()},this.handleRightClickImage=e=>{const{disableDownload:t}=this.getProps();return!t||(e.preventDefault(),e.stopPropagation(),!1)},this.getCanDragDirection=(e,t)=>{let n=e>this.containerWidth;return{canDragVertical:t>this.containerHeight,canDragHorizontal:n}},this.changeZoom=(e,t)=>{const n=this._adapter.getImage(),{currZoom:r,translate:i,width:s,height:o}=this.getStates(),{rotation:a}=this.getProps(),l=e/(r||1),c=Math.floor(this.originImageWidth*e),d=Math.floor(this.originImageHeight*e);let h=Math.floor(i.x*l),u=Math.floor(i.y*l);const p=this.calcBoundingRectSize(s,o,a),f={width:p.width*l,height:p.height*l};if(t&&n&&t.target===n){let n=a%360;switch(n<0&&(n=360+n),n){case 0:h=(t.offsetX-.5*s)*(1-e/r)+i.x,u=(t.offsetY-.5*o)*(1-e/r)+i.y;break;case 90:h=(.5*o-t.offsetY)*(1-e/r)+i.x,u=(t.offsetX-.5*s)*(1-e/r)+i.y;break;case 180:h=(.5*s-t.offsetX)*(1-e/r)+i.x,u=(.5*o-t.offsetY)*(1-e/r)+i.y;break;case 270:h=(t.offsetY-.5*o)*(1-e/r)+i.x,u=(.5*s-t.offsetX)*(1-e/r)+i.y}}const m=this.getSafeTranslate(f.width,f.height,h,u);if(this.setState({translate:m,width:c,height:d,currZoom:e}),n){const{canDragVertical:e,canDragHorizontal:t}=this.getCanDragDirection(f.width,f.height),n=e||t;this._adapter.setImageCursor(n)}},this.getExtremeTranslate=(e,t)=>({x:(e-this.containerWidth)/2,y:(t-this.containerHeight)/2}),this.getSafeTranslate=(e,t,n,r)=>{const{x:i,y:s}=this.getExtremeTranslate(e,t),{canDragVertical:o,canDragHorizontal:a}=this.getCanDragDirection(e,t);let l=0,c=0;return a&&(l=n>0?Math.min(n,i):Math.max(n,-i)),o&&(c=r>0?Math.min(r,s):Math.max(r,-s)),{x:l,y:c}},this.handleImageMove=e=>{1===e.buttons&&this.moveImage(e)},this.moveImage=e=>{const{clientX:t,clientY:n}=e,{width:r,height:i,translate:s}=this.getStates(),{rotation:o}=this.getProps(),a=this.calcBoundingRectSize(r,i,o),{canDragVertical:l,canDragHorizontal:c}=this.getCanDragDirection(a.width,a.height);if(l||c){let e=c?s.x+t-this.startMouseClientPosition.x:s.x,r=l?s.y+n-this.startMouseClientPosition.y:s.y;const i=this.getSafeTranslate(a.width,a.height,e,r);this.setState({translate:i}),this.startMouseClientPosition={x:t,y:n}}},this.handleImageMouseDown=e=>{this.startMouseClientPosition={x:e.clientX,y:e.clientY}},this.calcBoundingRectMouseOffset=e=>{const{width:t,height:n,offset:r,rotation:i=0}=e;let s=i%360;s=s>=0?s:360+s;let o=0,a=0;switch(s){case 0:o=r.x,a=r.y;break;case 90:o=n-r.y,a=r.x;break;case 180:o=t-r.x,a=n-r.y;break;case 270:o=r.y,a=t-r.x}return{x:o,y:a}}}init(){this._getContainerBoundingRectSize()}calcBoundingRectSize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)*Math.PI/180,r=Math.abs(Math.sin(n)),i=Math.abs(Math.cos(n));return{width:e*i+t*r,height:e*r+t*i}}}const ZR=`${RR.PREFIX}-preview-image`;class JR extends f{get adapter(){return Object.assign(Object.assign({},super.adapter),{getContainer:()=>this.containerRef.current,getImage:()=>this.imageRef.current,setLoading:e=>{this.setState({loading:e})},setImageCursor:e=>{this.imageRef.current.style.cursor=e?"grab":"default"}})}constructor(e){super(e),this.onWindowResize=()=>{this.foundation.handleWindowResize()},this.handleRightClickImage=e=>{this.foundation.handleRightClickImage(e)},this.handleLoad=e=>{this.foundation.handleLoad(e)},this.handleError=e=>{this.foundation.handleError(e)},this.handleImageMove=e=>{this.foundation.handleImageMove(e)},this.handleMouseDown=e=>{this.foundation.handleImageMouseDown(e)},this.state={width:0,height:0,loading:!0,translate:{x:0,y:0},currZoom:this.props.zoom},this.containerRef=h().createRef(),this.imageRef=h().createRef(),this.foundation=new YR(this.adapter)}componentDidMount(){this.foundation.init(),window.addEventListener("resize",this.onWindowResize)}componentWillUnmount(){window.removeEventListener("resize",this.onWindowResize)}componentDidUpdate(e,t){const n="zoom"in this.props&&this.props.zoom!==this.state.currZoom,r=this.props.src&&this.props.src!==e.src;r&&this.foundation.setLoading(!0),n||r||!e||("ratio"in this.props&&this.props.ratio!==e.ratio&&this.foundation.handleRatioChange(),"rotation"in this.props&&this.props.rotation!==e.rotation&&this.onWindowResize())}render(){const{src:e,rotation:t,crossOrigin:n}=this.props,{loading:r,width:i,height:s,translate:o}=this.state,a={position:"absolute",visibility:r?"hidden":"visible",transform:`translate(${o.x}px, ${o.y}px) rotate(${t}deg)`,width:i,height:s};return h().createElement("div",{className:`${ZR}`,ref:this.containerRef},h().createElement("img",{ref:this.imageRef,src:e,alt:"previewImag",className:`${ZR}-img`,key:e,onMouseMove:this.handleImageMove,onMouseDown:this.handleMouseDown,onContextMenu:this.handleRightClickImage,onDragStart:e=>e.preventDefault(),onLoad:this.handleLoad,onError:this.handleError,style:a,crossOrigin:n}),r&&h().createElement(dr,{size:"large",wrapperClassName:`${ZR}-spin`}))}}JR.propTypes={src:E().string,rotation:E().number,style:E().object,maxZoom:E().number,minZoom:E().number,zoom:E().number,ratio:E().string,disableDownload:E().bool,clickZoom:E().number,initialZoom:E().number,setRatio:E().func,onZoom:E().func,onLoad:E().func,onError:E().func},JR.defaultProps={zoom:void 0};var QR=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};const eA=(e,t,n,r)=>{const i=t-n,s=t+n,o=e.length;let a=[],l=[];n>=Math.floor(o/2)?r?(a=e.concat(e).slice(i+o<0?0:i+o,t+o),l=e.concat(e).slice(t+1,s+1<2*o?s+1:2*o)):(a=e.slice(0,t),l=e.slice(t+1,o)):r?(a=e.concat(e).slice(i+o,t+o),l=e.concat(e).slice(t+1,s+1)):i>=0&&s<o?(a=e.slice(i,t),l=e.slice(t+1,s+1)):i<0?(a=e.slice(0,t),l=e.slice(t+1,2*n+1)):(l=e.slice(t+1,o),a=e.slice(o-2*n-1,t));const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[];const r=e.length,i=t.length;return new Array(r<=i?r:i).fill(0).forEach(((r,i)=>{n.push(t[i]),n.push(e[i])})),r>i?n=n.concat(e.slice(i,r)):r<i&&(n=n.concat(t.slice(r,i))),n}(a.reverse(),l);return Array.from(new Set(c))},tA=["icon","footer"];class nA extends c{constructor(e){var t;super(Object.assign({},e)),t=this,this._timer=null,this._startMouseDown={x:0,y:0},this.handleViewVisibleChange=()=>{const{viewerVisible:e}=this.getStates();e&&(this.setState({viewerVisible:!1}),this.clearTimer())},this.handleMouseMove=e=>{this._persistEvent(e),this.mouseMoveHandler(e)},this.mouseMoveHandler=g()((e=>{const{viewerVisible:t}=this.getStates();this._adapter.isValidTarget(e)?(t||this.setState({viewerVisible:!0}),this.updateTimer()):this.clearTimer()}),50),this.updateTimer=()=>{const{viewerVisibleDelay:e}=this.getProps();this.clearTimer(),this._timer=setTimeout(this.handleViewVisibleChange,e)},this.clearTimer=()=>{this._timer&&(clearTimeout(this._timer),this._timer=null)},this.handleWheel=e=>{this.onWheel(e),Le(e)},this.onWheel=e=>{const{zoomStep:t,maxZoom:n,minZoom:r}=this.getProps(),{zoom:i}=this.getStates();let s;e.deltaY<0?i+t<=n&&(s=Number((i+t).toFixed(2))):e.deltaY>0&&i-t>=r&&(s=Number((i-t).toFixed(2))),_e()(s)||this.handleZoomImage(s,!0,e)},this.handleMouseUp=e=>{const{maskClosable:t}=this.getProps();let n=!((e,t)=>{const n=null==e?void 0:e.composedPath(),r=null==n?void 0:n.slice(0,n.length-4).some((e=>!(!e.className||"string"!=typeof e.className)&&t.some((t=>e.className.includes(t)))));return r})(e,tA);const{clientX:r,clientY:i}=e,{x:s,y:o}=this._startMouseDown;(Math.abs(r-s)>5||Math.abs(o-i)>5)&&(n=!1),n&&t&&this._adapter.notifyVisibleChange(!1)},this.handleMouseDown=e=>{const{clientX:t,clientY:n}=e;this._startMouseDown={x:t,y:n}},this.handleKeyDown=e=>{const{closeOnEsc:t}=this.getProps();if(t&&e.keyCode===cn.ESC)return e.stopPropagation(),this._adapter.notifyVisibleChange(!1),void this._adapter.notifyClose()},this.handleSwitchImage=e=>{const t="prev"===e?-1:1,{imgSrc:n,currentIndex:r}=this.getStates(),i=n.length,s=(r+t+i)%i;if("currentIndex"in this.getProps()){if(this._adapter.getIsInGroup()){this._adapter.getContext("setCurrentIndex")(s)}}else this.setState({currentIndex:s});this._adapter.notifyChange(s,e),this.setState({direction:e,rotation:0})},this.handleDownload=()=>{const{currentIndex:e,imgSrc:t}=this.getStates(),n=this._adapter.getSetDownloadFunc(),r=t[e],i=n?n(r):r.slice(r.lastIndexOf("/")+1).split("?")[0];((e,t,n)=>{QR(void 0,void 0,void 0,(function*(){try{const r=yield fetch(e);if(r.ok){const e=yield r.blob(),n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download=t,i.click(),URL.revokeObjectURL(n),i.remove()}else n(e)}catch(t){n(e)}}))})(r,i,this._adapter.notifyDownloadError),this._adapter.notifyDownload(r,e)},this.handlePreviewClose=e=>{this._adapter.notifyVisibleChange(!1),this._adapter.notifyClose(),Le(e)},this.handleAdjustRatio=e=>{this.setState({ratio:e}),this._adapter.notifyRatioChange(e)},this.handleRotateImage=e=>{const{rotation:t}=this.getStates(),n=t+("left"===e?-90:90);this.setState({rotation:n}),this._adapter.notifyRotateChange(n)},this.handleZoomImage=function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0;const{zoom:i}=t.getStates(),s=t._clampZoom(e);i!==s&&(n&&t._adapter.notifyZoom(s,s>i),t._adapter.changeImageZoom(s,r),t.setState({zoom:s}))},this.preloadGapImage=()=>{const{preLoad:e,preLoadGap:t,infinite:n,currentIndex:r}=this.getProps(),{imgSrc:i}=this.getStates();if(!e||"number"!=typeof t||t<1)return;const s=eA(i,r,t,n);if(0===s.length)return;const o=new Image;let a=0;function l(e){a++,a<s.length&&(o.src=s[a])}o.onload=e=>{this.setLoadSuccessStatus(o.src),l()},o.onerror=l,o.src=s[0]},this.preloadSingleImage=()=>{const{preLoad:e,preLoadGap:t,infinite:n}=this.getProps(),{imgSrc:r,currentIndex:i,direction:s,imgLoadStatus:o}=this.getStates();if(!e||"number"!=typeof t||t<1)return;let a=i+("prev"===s?-1:1)*t;if(a<0||a>=r.length){if(!n)return;a=(a+r.length)%r.length}if(!o[a]){const e=new Image;e.onload=e=>{this.setLoadSuccessStatus(r[a])},e.src=r[a]}},this.setLoadSuccessStatus=e=>{const{imgLoadStatus:t}=this.getStates(),n=Object.assign({},t);n[e]=!0,this.setState({imgLoadStatus:n})},this.onImageLoad=e=>{const{preloadAfterVisibleChange:t}=this.getStates();this.setLoadSuccessStatus(e),t?(this.preloadGapImage(),this.setState({preloadAfterVisibleChange:!1})):this.preloadSingleImage()},this._clampZoom=e=>{const{maxZoom:t,minZoom:n}=this.getProps(),r="number"==typeof t?t:5,i="number"==typeof n?n:.1;return"number"==typeof e&&Number.isFinite(e)?Math.min(r,Math.max(i,e)):i}}beforeShow(){this._adapter.registerKeyDownListener(),this._adapter.disabledBodyScroll(),this.updateTimer()}afterHide(){this._adapter.unregisterKeyDownListener(),this._adapter.enabledBodyScroll(),this.clearTimer()}}const rA=RR.PREFIX;class iA extends f{get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{getIsInGroup:()=>this.isInGroup(),disabledBodyScroll:()=>{const{getPopupContainer:e}=this.props;this.bodyOverflow=document.body.style.overflow||"",e||"hidden"===this.bodyOverflow||(document.body.style.overflow="hidden",document.body.style.width=`calc(${this.originBodyWidth||"100%"} - ${this.scrollBarWidth}px)`)},enabledBodyScroll:()=>{const{getPopupContainer:e}=this.props;e||"hidden"===this.bodyOverflow||(document.body.style.overflow=this.bodyOverflow,document.body.style.width=this.originBodyWidth)},notifyChange:(e,t)=>{const{onChange:n,onPrev:r,onNext:i}=this.props;ye()(n)&&n(e),"prev"===t?r&&r(e):i&&i(e)},notifyZoom:(e,t)=>{const{onZoomIn:n,onZoomOut:r}=this.props;t?ye()(n)&&n(e):ye()(r)&&r(e)},notifyClose:()=>{const{onClose:e}=this.props;ye()(e)&&e()},notifyVisibleChange:e=>{const{onVisibleChange:t}=this.props;ye()(t)&&t(e)},notifyRatioChange:e=>{const{onRatioChange:t}=this.props;ye()(t)&&t(e)},notifyRotateChange:e=>{const{onRotateLeft:t}=this.props;ye()(t)&&t(e)},notifyDownload:(e,t)=>{const{onDownload:n}=this.props;ye()(n)&&n(e,t)},notifyDownloadError:e=>{const{onDownloadError:t}=this.props;ye()(t)&&t(e)},registerKeyDownListener:()=>{window&&window.addEventListener("keydown",this.handleKeyDown)},unregisterKeyDownListener:()=>{window&&window.removeEventListener("keydown",this.handleKeyDown)},getSetDownloadFunc:()=>{var e,t;return null!==(t=null===(e=this.context)||void 0===e?void 0:e.setDownloadName)&&void 0!==t?t:this.props.setDownloadName},isValidTarget:e=>{const t=this.headerRef&&this.headerRef.current,n=this.footerRef&&this.footerRef.current,r=this.leftIconRef&&this.leftIconRef.current,i=this.rightIconRef&&this.rightIconRef.current,s=e.target;return!(t&&t.contains(s)||n&&n.contains(s)||r&&r.contains(s)||i&&i.contains(s))},changeImageZoom:function(){var t;(null===(t=e.imageRef)||void 0===t?void 0:t.current)&&e.imageRef.current.foundation.changeZoom(...arguments)}})}constructor(e){var t;super(e),t=this,this.viewVisibleChange=()=>{this.foundation.handleViewVisibleChange()},this.handleSwitchImage=e=>{this.foundation.handleSwitchImage(e)},this.handleDownload=()=>{this.foundation.handleDownload()},this.handlePreviewClose=e=>{this.foundation.handlePreviewClose(e)},this.handleAdjustRatio=e=>{this.foundation.handleAdjustRatio(e)},this.handleRotateImage=e=>{this.foundation.handleRotateImage(e)},this.handleZoomImage=function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t.foundation.handleZoomImage(e,n)},this.handleMouseUp=e=>{this.foundation.handleMouseUp(e.nativeEvent)},this.handleMouseMove=e=>{this.foundation.handleMouseMove(e)},this.handleKeyDown=e=>{this.foundation.handleKeyDown(e)},this.onImageError=()=>{this.foundation.preloadSingleImage()},this.onImageLoad=e=>{this.foundation.onImageLoad(e)},this.handleMouseDown=e=>{this.foundation.handleMouseDown(e)},this.handleWheel=e=>{this.foundation.handleWheel(e)},this.registryImageWrapRef=e=>{this.imageWrapRef&&this.imageWrapRef.removeEventListener("wheel",this.handleWheel),e&&e.addEventListener("wheel",this.handleWheel,{passive:!1}),this.imageWrapRef=e},this.state={imgSrc:[],imgLoadStatus:new Map,zoom:.1,currentIndex:0,ratio:"adaptation",rotation:0,viewerVisible:!0,visible:!1,preloadAfterVisibleChange:!0,direction:""},this.foundation=new nA(this.adapter),this.bodyOverflow="",this.originBodyWidth="100%",this.scrollBarWidth=0,this.imageWrapRef=null,this.imageRef=h().createRef(),this.headerRef=h().createRef(),this.footerRef=h().createRef(),this.leftIconRef=h().createRef(),this.rightIconRef=h().createRef()}static getDerivedStateFromProps(e,t){const n={};let r=[];return e.visible&&(r=Array.isArray(e.src)?e.src:[e.src]),Oe()(r,t.imgSrc)||(n.imgSrc=r),e.visible!==t.visible&&(n.visible=e.visible,e.visible&&(n.preloadAfterVisibleChange=!0,n.viewerVisible=!0,n.rotation=0,n.ratio="adaptation")),"currentIndex"in e&&e.currentIndex!==t.currentIndex&&(n.currentIndex=e.currentIndex,n.ratio="adaptation"),n}componentDidMount(){this.scrollBarWidth=de(),this.originBodyWidth=document.body.style.width,this.props.visible&&this.foundation.beforeShow()}componentDidUpdate(e,t){e.src!==this.props.src&&this.foundation.updateTimer(),!e.visible&&this.props.visible&&this.foundation.beforeShow(),e.visible&&!this.props.visible&&this.foundation.afterHide()}componentWillUnmount(){this.foundation.clearTimer()}isInGroup(){return Boolean(this.context&&this.context.isGroup)}render(){const{getPopupContainer:e,closable:t,zIndex:n,visible:r,className:i,style:s,maxZoom:o,minZoom:a,initialZoom:l,infinite:c,zoomStep:d,crossOrigin:u,prevTip:p,nextTip:f,zoomInTip:m,zoomOutTip:g,rotateTip:y,downloadTip:v,adaptiveTip:b,originTip:x,showTooltip:E,disableDownload:C,renderLeftIcon:S,renderRightIcon:_,renderCloseIcon:k,renderPreviewMenu:O,renderHeader:T}=this.props,{currentIndex:P,imgSrc:I,zoom:M,ratio:R,rotation:A,viewerVisible:N}=this.state;let D={zIndex:n};e&&(D={zIndex:n,position:"static"});const L=`${rA}-preview`,F=w()(L,{[`${rA}-hide`]:!r,[`${L}-popup`]:e},i),j=N?"":`${L}-hide`,$=I.length,B=1!==$&&(c||0!==P),V=1!==$&&(c||P!==$-1),z="function"==typeof S?S(P):S,H="function"==typeof _?_(P):_;return r&&h().createElement(ht,{getPopupContainer:e,style:D},h().createElement("div",{className:F,style:s,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,ref:this.registryImageWrapRef,onMouseMove:this.handleMouseMove},h().createElement($R,{ref:this.headerRef,className:w()(j),onClose:this.handlePreviewClose,renderHeader:T,closable:t,renderCloseIcon:k}),h().createElement(JR,{ref:this.imageRef,src:I[P],onZoom:this.handleZoomImage,disableDownload:C,setRatio:this.handleAdjustRatio,zoom:M,ratio:R,rotation:A,crossOrigin:u,initialZoom:l,maxZoom:o,minZoom:a,onError:this.onImageError,onLoad:this.onImageLoad}),B&&h().createElement("div",{ref:this.leftIconRef,className:w()(`${L}-icon`,`${L}-prev`,j),onClick:()=>this.handleSwitchImage("prev")},h().isValidElement(z)?z:h().createElement(NR,{size:"large"})),V&&h().createElement("div",{ref:this.rightIconRef,className:w()(`${L}-icon`,`${L}-next`,j),onClick:()=>this.handleSwitchImage("next")},h().isValidElement(H)?H:h().createElement(DR,{size:"large"})),h().createElement(XR,{forwardRef:this.footerRef,className:j,totalNum:$,curPage:P+1,disabledPrev:!B,disabledNext:!V,zoom:100*M,min:100*a,max:100*o,step:100*d,showTooltip:E,ratio:R,prevTip:p,nextTip:f,zIndex:n,zoomInTip:m,zoomOutTip:g,rotateTip:y,downloadTip:v,disableDownload:C,adaptiveTip:b,originTip:x,onPrev:()=>this.handleSwitchImage("prev"),onNext:()=>this.handleSwitchImage("next"),onZoomIn:this.handleZoomImage,onZoomOut:this.handleZoomImage,onDownload:this.handleDownload,onRotate:this.handleRotateImage,onAdjustRatio:this.handleAdjustRatio,renderPreviewMenu:O})))}}iA.contextType=LR,iA.propTypes={style:E().object,className:E().string,visible:E().bool,src:E().oneOfType([E().string,E().array]),currentIndex:E().number,defaultCurrentIndex:E().number,defaultVisible:E().bool,maskClosable:E().bool,closable:E().bool,zoomStep:E().number,infinite:E().bool,showTooltip:E().bool,closeOnEsc:E().bool,prevTip:E().string,nextTip:E().string,zoomInTip:E().string,zoomOutTip:E().string,downloadTip:E().string,adaptiveTip:E().string,originTip:E().string,lazyLoad:E().bool,preLoad:E().bool,preLoadGap:E().number,disableDownload:E().bool,viewerVisibleDelay:E().number,zIndex:E().number,maxZoom:E().number,minZoom:E().number,initialZoom:E().number,renderHeader:E().func,renderPreviewMenu:E().func,getPopupContainer:E().func,onVisibleChange:E().func,onChange:E().func,onClose:E().func,onZoomIn:E().func,onZoomOut:E().func,onPrev:E().func,onNext:E().func,onDownload:E().func,onRatioChange:E().func,onRotateLeft:E().func},iA.defaultProps={showTooltip:!1,zoomStep:.1,infinite:!1,closable:!0,closeOnEsc:!0,lazyLoad:!1,preLoad:!0,preLoadGap:2,zIndex:1070,maskClosable:!0,viewerVisibleDelay:1e4,maxZoom:5,minZoom:.1};class sA extends c{constructor(e){super(Object.assign({},e)),this.handleClick=e=>{const{imageID:t,preview:n}=this.getProps();if(n)if(this._adapter.getIsInGroup()){const{setCurrentIndex:e,handleVisibleChange:n}=this._adapter.getContexts();e(t),n(!0)}else this.handlePreviewVisibleChange(!0)},this.handleLoaded=e=>{const{onLoad:t}=this.getProps();t&&t(e),this.setState({loadStatus:"success"})},this.handleError=e=>{const{onError:t}=this.getProps();t&&t(e),this.setState({loadStatus:"error"})},this.handlePreviewVisibleChange=e=>{const{preview:t}=this.getProps();if(z()(t)){const{onVisibleChange:n}=t;n&&n(e),"visible"in t||this.setState({previewVisible:e})}else this.setState({previewVisible:e})}}}__webpack_require__("ANZz");var oA=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const aA=RR.PREFIX;class lA extends f{get adapter(){return Object.assign(Object.assign({},super.adapter),{getIsInGroup:()=>this.isInGroup()})}constructor(e){super(e),this.handleClick=e=>{this.foundation.handleClick(e)},this.handleLoaded=e=>{this.foundation.handleLoaded(e)},this.handleError=e=>{this.foundation.handleError(e)},this.handlePreviewVisibleChange=e=>{this.foundation.handlePreviewVisibleChange(e)},this.renderDefaultLoading=()=>{const{width:e,height:t}=this.props;return h().createElement(Xa.Image,{style:{width:e,height:t}})},this.renderDefaultError=()=>{const e=`${aA}-status`;return h().createElement("div",{className:e},h().createElement(AR,{size:"extra-large"}))},this.renderLoad=()=>{const e=`${aA}-status`,{placeholder:t}=this.props;return t?h().createElement("div",{className:e},t):this.renderDefaultLoading()},this.renderError=()=>{const{fallback:e}=this.props,t=`${aA}-status`,n="string"==typeof e?h().createElement("img",{style:{width:"100%",height:"100%"},src:e,alt:"fallback"}):e;return e?h().createElement("div",{className:t},n):this.renderDefaultError()},this.renderExtra=()=>{const{loadStatus:e}=this.state;return h().createElement("div",{className:`${aA}-overlay`},"error"===e&&this.renderError(),"loading"===e&&this.renderLoad())},this.getLocalTextByKey=e=>h().createElement(Jt,{componentName:"Image"},(t=>t[e])),this.renderMask=()=>h().createElement("div",{className:`${aA}-mask`},h().createElement("div",{className:`${aA}-mask-info`},h().createElement(vr,{size:"extra-large"}),h().createElement("span",{className:`${aA}-mask-info-text`},this.getLocalTextByKey("preview")))),this.state={src:"",loadStatus:"loading",previewVisible:!1},this.foundation=new sA(this.adapter),this.imgRef=h().createRef()}static getDerivedStateFromProps(e,t){const n={};if(e.src!==t.src&&(n.src=e.src,n.loadStatus="loading"),z()(e.preview)){const{visible:t}=e.preview;Kc()(t)&&(n.previewVisible=t)}return n}isInGroup(){return Boolean(this.context&&this.context.isGroup)}isLazyLoad(){return!!this.context&&this.context.lazyLoad}render(){var e;const{src:t,loadStatus:n,previewVisible:r}=this.state,i=this.props,{src:s,width:o,height:a,alt:l,style:c,className:d,crossOrigin:u,preview:p,fallback:f,placeholder:m,imageID:g,setDownloadName:y,imgCls:v,imgStyle:b}=i,x=oA(i,["src","width","height","alt","style","className","crossOrigin","preview","fallback","placeholder","imageID","setDownloadName","imgCls","imgStyle"]),E=Object.assign({width:o,height:a},c),C=w()(aA,d),S="success"===n&&p&&!this.isInGroup(),_=p&&"success"===n,k=z()(p)&&null!==(e=p.src)&&void 0!==e?e:t,O=z()(p)&&S?Object.assign(Object.assign({},W()(p,["className","style","previewCls","previewStyle"])),{className:null==p?void 0:p.previewCls,style:null==p?void 0:p.previewStyle}):{};return h().createElement("div",{style:E,className:C,onClick:this.handleClick},h().createElement("img",Object.assign({ref:this.imgRef},x,{src:this.isInGroup()&&this.isLazyLoad()?void 0:t,"data-src":t,alt:l,style:b,className:w()(`${aA}-img`,{[`${aA}-img-preview`]:_,[`${aA}-img-error`]:"error"===n,[v]:Boolean(v)}),width:o,height:a,crossOrigin:u,onError:this.handleError,onLoad:this.handleLoaded})),"success"!==n&&this.renderExtra(),S&&h().createElement(iA,Object.assign({},O,{src:k,visible:r,onVisibleChange:this.handlePreviewVisibleChange,crossOrigin:_e()(u)?null==O?void 0:O.crossOrigin:u,setDownloadName:y})))}}lA.isSemiImage=!0,lA.contextType=LR,lA.propTypes={style:E().object,className:E().string,src:E().string,width:E().oneOfType([E().string,E().number]),height:E().oneOfType([E().string,E().number]),alt:E().string,placeholder:E().node,fallback:E().oneOfType([E().string,E().node]),preview:E().oneOfType([E().bool,E().object]),onLoad:E().func,onError:E().func,onClick:E().func,crossOrigin:E().string,imageID:E().number},lA.defaultProps={preview:!0};const cA=lA;class dA extends c{constructor(){super(...arguments),this.handleVisibleChange=e=>{const{visible:t,onVisibleChange:n}=this.getProps();t in this.getProps()||this.setState({visible:e}),n&&n(e)},this.handleCurrentIndexChange=e=>{const{currentIndex:t,onChange:n}=this.getProps();t in this.getProps()||this.setState({currentIndex:e}),n&&n(e)}}}var hA=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const uA=RR.PREFIX;class pA extends f{get adapter(){return Object.assign({},super.adapter)}constructor(e){super(e),this.observerImages=()=>{this.previewObserver?this.previewObserver.disconnect():this.previewObserver=new IntersectionObserver((e=>{e.forEach((e=>{var t;const n=null===(t=e.target.dataset)||void 0===t?void 0:t.src;e.isIntersecting&&n&&(e.target.src=n,e.target.removeAttribute("data-src"),this.previewObserver.unobserve(e.target))}))}),{root:document.querySelector(`#${this.previewGroupId}`),rootMargin:this.props.lazyLoadMargin});document.querySelectorAll(`.${uA}-img`).forEach((e=>this.previewObserver.observe(e)))},this.handleVisibleChange=e=>{this.foundation.handleVisibleChange(e)},this.handleCurrentIndexChange=e=>{this.foundation.handleCurrentIndexChange(e)},this.loopImageIndex=()=>{const{children:e}=this.props;let t=0;const n=[],r=[],i=e=>h().Children.map(e,(e=>{var s;if(e&&e.props&&e.type&&e.type.isSemiImage){const{src:i,preview:o,alt:a}=e.props;if(o){const a=z()(o)&&null!==(s=o.src)&&void 0!==s?s:i;return n.push(a),r.push(null==o?void 0:o.previewTitle),h().cloneElement(e,{imageID:t++})}return e}return e&&e.props&&e.props.children?h().cloneElement(e,{children:i(e.props.children)}):e}));return{srcListInChildren:n,newChildren:i(e),titles:r}},this.state={currentIndex:e.currentIndex||e.defaultCurrentIndex||0,visible:e.visible||e.currentDefaultVisible||!1},this.foundation=new dA(this.adapter),this.previewGroupId=We({prefix:"semi-image-preview-group",length:4}),this.previewRef=h().createRef()}componentDidMount(){this.props.lazyLoad&&this.observerImages()}componentDidUpdate(e){if(this.props.lazyLoad){const t=h().Children.toArray(e.children).map((e=>(0,d.isValidElement)(e)?e.key:null)),n=h().Children.toArray(this.props.children).map((e=>(0,d.isValidElement)(e)?e.key:null));Oe()(t,n)||this.observerImages()}}static getDerivedStateFromProps(e,t){const n={};return"currentIndex"in e&&e.currentIndex!==t.currentIndex&&(n.currentIndex=e.currentIndex),"visible"in e&&e.visible!==t.visible&&(n.visible=e.visible),n}componentWillUnmount(){this.previewObserver&&(this.previewObserver.disconnect(),this.previewObserver=null)}render(){const e=this.props,{src:t,className:n,style:r,lazyLoad:i,setDownloadName:s}=e,o=hA(e,["src","className","style","lazyLoad","setDownloadName"]),a=Object.assign(Object.assign({},W()(o,["previewCls","previewStyle"])),{className:null==o?void 0:o.previewCls,style:null==o?void 0:o.previewStyle}),{currentIndex:l,visible:c}=this.state,{srcListInChildren:d,newChildren:u,titles:p}=this.loopImageIndex(),f=[...Array.isArray(t)?t:"string"==typeof t?[t]:[],...d];return h().createElement(LR.Provider,{value:{isGroup:!0,previewSrc:f,titles:p,currentIndex:l,visible:c,lazyLoad:i,previewObserver:this.previewObserver,setCurrentIndex:this.handleCurrentIndexChange,handleVisibleChange:this.handleVisibleChange,setDownloadName:s}},h().createElement("div",{id:this.previewGroupId,style:r,className:w()(`${uA}-preview-group`,n)},u),h().createElement(iA,Object.assign({},a,{ref:this.previewRef,src:f,currentIndex:l,visible:c,onVisibleChange:this.handleVisibleChange})))}}pA.propTypes={style:E().object,className:E().string,visible:E().bool,src:E().oneOfType([E().string,E().array]),currentIndex:E().number,defaultCurrentIndex:E().number,defaultVisible:E().bool,maskClosable:E().bool,closable:E().bool,zoomStep:E().number,infinite:E().bool,showTooltip:E().bool,closeOnEsc:E().bool,prevTip:E().string,nextTip:E().string,zoomInTip:E().string,zoomOutTip:E().string,downloadTip:E().string,adaptiveTip:E().string,originTip:E().string,lazyLoad:E().bool,lazyLoadMargin:E().string,preLoad:E().bool,preLoadGap:E().number,previewCls:E().string,previewStyle:E().object,disableDownload:E().bool,zIndex:E().number,renderHeader:E().func,renderPreviewMenu:E().func,getPopupContainer:E().func,onVisibleChange:E().func,onChange:E().func,onClose:E().func,onZoomIn:E().func,onZoomOut:E().func,onPrev:E().func,onNext:E().func,onDownload:E().func,onRotateLeft:E().func,onRatioChange:E().func},pA.defaultProps={src:[],lazyLoad:!0,lazyLoadMargin:"0px 100px 100px 0px",closable:!0};const fA=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Math.pow(10,t);return Math.round(n*e)/n},mA={grad:.9,turn:360,rad:360/(2*Math.PI)},gA=e=>RA(yA(e)),yA=e=>{"#"===e[0]&&(e=e.substring(1));return{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:(e=>{const t=parseInt(e,16);if(!isNaN(t)){return t/255}return 1})(e.substring(6,8))}},vA=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"deg";return Number(e)*(mA[t]||1)},bA=e=>MA(CA(e)),wA=e=>{let{h:t,s:n,v:r,a:i}=e;const s=(200-n)*r/100;return{h:fA(t),s:fA(s>0&&s<200?n*r/100/(s<=100?s:200-s)*100:0),l:fA(s/2),a:fA(i,2)}},xA=e=>{const{h:t,s:n,l:r}=wA(e);return`hsl(${t}, ${n}%, ${r}%)`},EA=e=>{const{h:t,s:n,l:r,a:i}=wA(e);return`hsla(${t}, ${n}%, ${r}%, ${i})`},CA=e=>{let{h:t,s:n,v:r,a:i}=e;t=t/360*6,n/=100,r/=100;const s=Math.floor(t),o=r*(1-n),a=r*(1-(t-s)*n),l=r*(1-(1-t+s)*n),c=s%6;return{r:fA(255*[r,a,o,o,l,r][c]),g:fA(255*[l,r,r,a,o,o][c]),b:fA(255*[o,o,l,r,r,a][c]),a:fA(i,2)}},SA=e=>{const{r:t,g:n,b:r,a:i}=CA(e);return`rgba(${t}, ${n}, ${r}, ${i})`},_A=e=>{const t=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?AA({h:vA(t[1],t[2]),s:Number(t[3]),v:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},kA=e=>RA(OA(e)),OA=e=>{const t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?{r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}:{r:0,g:0,b:0,a:1}},TA=OA,PA=kA,IA=e=>{const t=e.toString(16);return t.length<2?"0"+t:t},MA=e=>{let{r:t,g:n,b:r,a:i}=e;return void 0===i||1===i?"#"+IA(t)+IA(n)+IA(r):"#"+IA(t)+IA(n)+IA(r)+(e=>Math.round(e/100*255).toString(16).padStart(2,"0").toLowerCase())(100*i)},RA=e=>{let{r:t,g:n,b:r,a:i}=e;const s=Math.max(t,n,r),o=s-Math.min(t,n,r),a=o?s===t?(n-r)/o:s===n?2+(r-t)/o:4+(t-n)/o:0;return{h:fA(60*(a<0?a+6:a)),s:fA(s?o/s*100:0),v:fA(s/255*100),a:i}},AA=e=>({h:fA(e.h),s:fA(e.s),v:fA(e.v),a:fA(e.a,2)});class NA extends c{constructor(e){super(Object.assign({},e)),this.handleChangeH=(e,t)=>{const n=Object.assign(Object.assign({},e.hsva),{h:t}),r={rgba:CA(n),hsva:n,hex:bA(n)};this._adapter.notifyChange(r),this.getProp("value")||this._adapter.setState({currentColor:r})},this.handleChangeA=(e,t)=>{let n=this._adapter.getProp("alpha");n||(t=1);const r=Object.assign(Object.assign({},e.rgba),{a:t}),i=MA(r);e={rgba:r,hex:n?i:i.slice(0,7),hsva:Object.assign(Object.assign({},e.hsva),{a:t})},this._adapter.notifyChange(e),this.getProp("value")||this._adapter.setState({currentColor:e})},this.getCurrentColor=()=>{const e=this.getProp("value"),t=this.getState("currentColor");return e||t},this.handleChange=(e,t)=>{let n;if("hsva"===t)n={hsva:e,rgba:NA.hsvaToRgba(e),hex:NA.hsvaToHex(e)};else if("rgba"===t)n={rgba:e,hsva:NA.rgbaToHsva(e),hex:NA.rgbaToHex(e)};else{if("hex"!==t)throw new Error("format error");n={hex:e,hsva:NA.hexToHsva(e),rgba:NA.hexToRgba(e)}}this._adapter.notifyChange(n),this.getProp("value")||this._adapter.setState({currentColor:n})},this.handleAlphaChangeByHandle=e=>{this.handleChangeA(this.getCurrentColor(),e.a)},this.handleColorChangeByHandle=e=>{this.handleChangeH(this.getCurrentColor(),e.h)},this.getHandlePositionByHSVA=(e,t,n)=>{let{width:r,height:i}=t;return{x:e.s/100*r-n/2,y:(1-e.v/100)*i-n/2}},this.getHandlePositionByMousePosition=(e,t,n)=>{let{width:r,height:i}=t;if(e.x>r||e.x<0)return null;if(e.y>i||e.y<0)return null;return{x:e.x-n/2,y:e.y-n/2}},this.getAlphaHandlePositionByMousePosition=(e,t,n)=>e<0||e>t?null:e-n/2,this.getColorHandlePositionByMousePosition=(e,t,n)=>e<0||e>t?null:e-n/2}}NA.hsvaToRgba=CA,NA.rgbaToHsva=RA,NA.rgbaToHex=MA,NA.hsvaToHex=bA,NA.hexToRgba=yA,NA.hexToHsva=gA,NA.hsvaToHslaString=EA,NA.hsvaToHslString=xA,NA.rgbaStringToHsva=kA,NA.rgbaStringToRgba=OA;const DA=NA,LA=`${C}-colorPicker`;const FA=class extends c{constructor(e){super(Object.assign({},e)),this.getHandlePositionByHSVA=()=>{const{hsva:e,width:t,height:n,handleSize:r}=this.getProps();return this._adapter.getColorPickerFoundation().getHandlePositionByHSVA(e,{width:t,height:n},r)},this.handleMouseDown=e=>{this._adapter.handleMouseDown(e)},this.handleMouseUp=e=>{this._adapter.handleMouseUp(e)},this.setHandlePositionByMousePosition=e=>{var t;const n=null===(t=this._adapter.getDOM())||void 0===t?void 0:t.getBoundingClientRect();if(!n)return;const r={x:e.clientX-n.x,y:e.clientY-n.y},{width:i,height:s,handleSize:o}=this.getProps(),a=this._adapter.getColorPickerFoundation().getHandlePositionByMousePosition(r,{width:i,height:s},o);a&&(this.setState({handlePosition:a}),this._adapter.notifyChange({s:Math.round(r.x/i*100),v:Math.round(100-100*Math.min(Math.max(r.y/s,0),1))}))}}};const jA=class extends f{constructor(e){super(e),this.handleClick=e=>{this.foundation.setHandlePositionByMousePosition(e),this.foundation.handleMouseDown(e)},this.foundation=new FA(this.adapter),this.state={handlePosition:this.foundation.getHandlePositionByHSVA(),isHandleGrabbing:!1},this.ref=h().createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{getColorPickerFoundation:()=>this.props.foundation,handleMouseDown:e=>{this.setState({isHandleGrabbing:!0}),this.ref.current.addEventListener("mousemove",this.foundation.setHandlePositionByMousePosition),window.addEventListener("mouseup",this.foundation.handleMouseUp)},handleMouseUp:()=>{this.ref.current.removeEventListener("mousemove",this.foundation.setHandlePositionByMousePosition),window.removeEventListener("mouseup",this.foundation.handleMouseUp),this.setState({isHandleGrabbing:!1})},getDOM:()=>this.ref.current,notifyChange:e=>this.props.onChange(e)})}componentDidUpdate(e,t,n){JSON.stringify(e.hsva)!==JSON.stringify(this.props.hsva)&&this.setState({handlePosition:this.foundation.getHandlePositionByHSVA()})}render(){const e=xA({h:this.props.hsva.h,s:100,v:100,a:1}),t=CA(this.props.hsva);return h().createElement("div",{className:w()(`${LA}-colorChooseArea`,this.props.className),style:Object.assign({backgroundColor:e,width:this.props.width,height:this.props.height,cursor:this.state.isHandleGrabbing?"grabbing":"pointer"},this.props.style),ref:this.ref,"aria-label":"Color",onMouseDown:this.handleClick,"aria-valuetext":`Saturation ${fA(this.props.hsva.s)}%, Brightness ${fA(this.props.hsva.v)}%`},h().createElement("div",{className:`${LA}-handle`,style:{width:this.props.handleSize,height:this.props.handleSize,left:this.state.handlePosition.x,top:this.state.handlePosition.y,backgroundColor:`rgba(${t.r},${t.g},${t.b},${t.a})`},onMouseDown:e=>this.foundation.handleMouseDown(e)}))}};const $A=class extends c{constructor(e){super(Object.assign({},e)),this.handleMouseDown=e=>{this._adapter.handleMouseDown(e)},this.handleMouseUp=e=>{this._adapter.handleMouseUp(e)},this.setHandlePositionByMousePosition=e=>{var t;const n=null===(t=this._adapter.getDOM())||void 0===t?void 0:t.getBoundingClientRect();if(!n)return;const{width:r,handleSize:i}=this._adapter.getProps(),s=this._adapter.getColorPickerFoundation(),o=e.clientX-n.x,a=s.getAlphaHandlePositionByMousePosition(o,r,i);s.handleAlphaChangeByHandle({a:Number(Math.min(Math.max(o/r,0),1).toFixed(2))}),this.setState({handlePosition:a})}}};const BA=class extends f{constructor(e){super(e),this.handleClick=e=>{this.foundation.setHandlePositionByMousePosition(e),this.foundation.handleMouseDown(e)},this.foundation=new $A(this.adapter),this.state={handlePosition:e.hsva.a*e.width-e.handleSize/2,isHandleGrabbing:!1},this.ref=h().createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{handleMouseDown:e=>{this.setState({isHandleGrabbing:!0}),window.addEventListener("mousemove",this.foundation.setHandlePositionByMousePosition),window.addEventListener("mouseup",this.foundation.handleMouseUp)},handleMouseUp:e=>{this.setState({isHandleGrabbing:!1}),window.removeEventListener("mousemove",this.foundation.setHandlePositionByMousePosition),window.removeEventListener("mouseup",this.foundation.handleMouseUp)},getColorPickerFoundation:()=>this.props.foundation,getDOM:()=>this.ref.current})}componentDidUpdate(e,t,n){e.hsva.a!==this.props.hsva.a&&this.setState({handlePosition:this.props.hsva.a*this.props.width-this.props.handleSize/2})}render(){const e=`linear-gradient(90deg, ${EA(Object.assign(Object.assign({},this.props.hsva),{a:0}))}, ${EA(Object.assign(Object.assign({},this.props.hsva),{a:1}))})`;return h().createElement("div",{className:`${LA}-alphaSlider`,ref:this.ref,"aria-label":"Alpha","aria-valuetext":`${fA(100*this.props.hsva.a)}%`,onMouseDown:this.handleClick,style:Object.assign({width:this.props.width,height:this.props.height},this.props.style)},h().createElement("div",{className:`${LA}-alphaSliderInner`,style:{background:e}},h().createElement("div",{className:`${LA}-alphaHandle`,style:{width:this.props.handleSize,height:this.props.handleSize,left:this.state.handlePosition,top:"50%",transform:"translateY(-50%)",backgroundColor:SA(this.props.hsva)},onMouseDown:e=>this.foundation.handleMouseDown(e)})))}};const VA=class extends c{constructor(e){super(Object.assign({},e)),this.handleMouseDown=e=>{this._adapter.handleMouseDown(e)},this.handleMouseUp=e=>{this._adapter.handleMouseUp(e)},this.setHandlePositionByMousePosition=e=>{var t;const n=null===(t=this._adapter.getDOM())||void 0===t?void 0:t.getBoundingClientRect();if(!n)return;const{width:r,handleSize:i}=this._adapter.getProps(),s=this._adapter.getColorPickerFoundation(),o=e.clientX-n.x;s.handleColorChangeByHandle({h:Math.round(360*Math.min(Math.max(o/r,0),1))});const a=s.getColorHandlePositionByMousePosition(o,r,i);this.setState({handlePosition:a})}}};const zA=class extends f{constructor(e){super(e),this.handleClick=e=>{this.foundation.setHandlePositionByMousePosition(e),this.foundation.handleMouseDown(e)},this.foundation=new VA(this.adapter),this.state={handlePosition:e.hue/360*e.width-e.handleSize/2,isHandleGrabbing:!1},this.ref=h().createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{handleMouseDown:e=>{this.setState({isHandleGrabbing:!0}),window.addEventListener("mousemove",this.foundation.setHandlePositionByMousePosition),window.addEventListener("mouseup",this.foundation.handleMouseUp)},handleMouseUp:e=>{this.setState({isHandleGrabbing:!1}),window.removeEventListener("mousemove",this.foundation.setHandlePositionByMousePosition),window.removeEventListener("mouseup",this.foundation.handleMouseUp)},getColorPickerFoundation:()=>this.props.foundation,getDOM:()=>this.ref.current})}componentDidUpdate(e,t,n){e.hue!==this.props.hue&&this.setState({handlePosition:this.props.hue/360*this.props.width-this.props.handleSize/2})}render(){return h().createElement("div",{className:w()(`${LA}-colorSlider`,this.props.className),ref:this.ref,onMouseDown:this.handleClick,style:Object.assign({width:this.props.width,height:this.props.height},this.props.style)},h().createElement("div",{className:`${LA}-handle`,style:{width:this.props.handleSize,height:this.props.handleSize,left:this.state.handlePosition,top:"50%",transform:"translateY(-50%)",backgroundColor:DA.hsvaToHslString({h:this.props.hue,s:100,v:100,a:1})},onMouseDown:e=>this.foundation.handleMouseDown(e)}))}};const HA=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.22 20.77a4.24 4.24 0 0 1 .02-5.98l9.33-9.28-.94-.95a1.41 1.41 0 0 1 0-1.99 1.39 1.39 0 0 1 1.97 0l.95.97L14.9 1.2a4.16 4.16 0 0 1 5.89.02 4.24 4.24 0 0 1-.02 5.98l-2.3 2.28 1.02 1.02c.54.55.54 1.44 0 1.99-.55.55-1.43.55-1.97 0l-1.03-1.03-9.37 9.32a4.16 4.16 0 0 1-5.89-.02ZM12.54 7.49l1.97 1.99-9.35 9.3c-.55.55-1.42.55-1.97 0a1.41 1.41 0 0 1 .01-2l9.34-9.29Z",fill:"currentColor"}))}),"eyedropper"),UA=(e,t)=>{const n=e.match(/^\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,?\s*([\d.]*)\s*$/),r=[];r[0]=Number(null==n?void 0:n[1]),r[1]=Number(null==n?void 0:n[2]),r[2]=Number(null==n?void 0:n[3]),r[3]=Number(void 0===(null==n?void 0:n[4])||""===(null==n?void 0:n[4])?1:null==n?void 0:n[4]);const i=(e,t)=>!(isNaN(e)||e<0||e>t);return!!(i(r[0],"rgba"===t?255:360)&&i(r[1],"rgba"===t?255:100)&&i(r[2],"rgba"===t?255:100)&&i(r[3],1))&&("rgba"===t?{r:r[0],g:r[1],b:r[2],a:r[3]}:{h:r[0],s:r[1],v:r[2],a:r[3]})};var KA=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};const WA=class extends c{constructor(e){super(Object.assign({},e)),this.getInputValue=()=>{const{currentColor:e}=this._adapter.getProps(),{format:t}=this._adapter.getStates(),n=e.rgba,r=e.hsva,i=e.hex;return"rgba"===t?`${n.r},${n.g},${n.b}`:"hsva"===t?`${r.h},${r.s},${r.v}`:i.slice(0,7)},this.getValueByInputValue=e=>{const{format:t}=this.getStates();if("rgba"===t){const n=UA(e,t);if(n)return n}else if("hsva"===t){const n=UA(e,t);if(n)return n}else if("hex"===t&&(e.startsWith("#")||(e="#"+e),/#[\d\w]{6,8}/.test(e)))return e;return!1},this.handlePickValueWithStraw=()=>KA(this,void 0,void 0,(function*(){const e=this._adapter.getColorPickerFoundation();if(!window.EyeDropper)return;const t=new EyeDropper;try{const n=(yield t.open()).sRGBHex;if(n.startsWith("#"))e.handleChange(n,"hex");else if(n.startsWith("rgba")){const t=DA.rgbaStringToRgba(n);t.a=1,e.handleChange(t,"rgba")}}catch(e){}})),this.handleInputValueChange=e=>{this._adapter.setState({inputValue:e})},this.handleFormatChange=e=>{this._adapter.setState({format:e})}}};const GA=class extends f{constructor(e){super(e),this.handleChange=e=>{this.props.foundation.handleChange(e,this.state.format)},this.foundation=new WA(this.adapter),this.state={format:this.props.defaultFormat,inputValue:""}}get adapter(){return Object.assign(Object.assign({},super.adapter),{getColorPickerFoundation:()=>this.props.foundation})}componentDidMount(){this.foundation.handleInputValueChange(this.foundation.getInputValue())}componentDidUpdate(e,t,n){Oe()(e.currentColor,this.props.currentColor)&&t.format===this.state.format||this.foundation.handleInputValueChange(this.foundation.getInputValue())}render(){const e=this.props.currentColor.rgba;return h().createElement("div",{className:`${LA}-dataPart`,style:{width:this.props.width}},h().createElement("div",{className:`${LA}-colorDemoBlock`,style:{minWidth:20,minHeight:20,backgroundColor:`rgba(${e.r},${e.g},${e.b},${e.a})`}}),h().createElement(Bx,{size:"small",className:`${LA}-inputGroup`},h().createElement(kr,{className:`${LA}-colorPickerInput`,value:this.state.inputValue,onChange:e=>{const t=this.foundation.getValueByInputValue(e);t&&this.handleChange(t),this.foundation.handleInputValueChange(e)}}),this.props.alpha&&h().createElement(pE,{min:0,max:100,className:`${LA}-colorPickerInputNumber`,value:Number(Math.round(100*this.props.currentColor.rgba.a)),onNumberChange:e=>{if("rgba"===this.state.format)this.handleChange(Object.assign(Object.assign({},this.props.currentColor.rgba),{a:Number((e/100).toFixed(2))}));else if("hex"===this.state.format){const t=Object.assign(Object.assign({},this.props.currentColor.rgba),{a:Number((e/100).toFixed(2))}),n=DA.rgbaToHex(t);this.handleChange(n)}else if("hsva"===this.state.format){const t=Object.assign(Object.assign({},this.props.currentColor.hsva),{a:Number((e/100).toFixed(2))});this.handleChange(t)}},suffix:h().createElement("span",{className:`${LA}-inputNumberSuffix`},"%"),hideButtons:!0}),h().createElement(YC,{className:`${LA}-formatSelect`,size:"small",value:this.state.format,onSelect:e=>this.foundation.handleFormatChange(e),optionList:["hex","rgba","hsva"].map((e=>({label:e,value:e})))})),this.props.eyeDropper&&h().createElement(vs,{type:"tertiary",theme:"light",size:"small",onClick:this.foundation.handlePickValueWithStraw,icon:h().createElement(HA,null)}))}};__webpack_require__("sJoR");class qA extends f{constructor(e){var t;super(e),this.foundation=new DA(this.adapter);const n=null!==(t=e.value)&&void 0!==t?t:e.defaultValue;this.state={currentColor:n}}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyChange:e=>{var t,n;null===(n=(t=this.props).onChange)||void 0===n||n.call(t,e)}})}renderPicker(){var e,t,n,r,i;const{className:s}=this.props,o=w()(`${LA}`,s),a=this.foundation.getCurrentColor();return h().createElement("div",{className:o},this.props.topSlot,h().createElement(jA,{hsva:a.hsva,foundation:this.foundation,onChange:e=>{let{s:t,v:n}=e;this.foundation.handleChange({s:t,v:n,a:a.hsva.a,h:a.hsva.h},"hsva")},handleSize:20,width:null!==(e=this.props.width)&&void 0!==e?e:280,height:null!==(t=this.props.height)&&void 0!==t?t:280}),h().createElement(zA,{width:null!==(n=this.props.width)&&void 0!==n?n:280,height:10,handleSize:18,hue:a.hsva.h,className:"colorSliderWrapper",foundation:this.foundation}),this.props.alpha&&h().createElement(BA,{width:null!==(r=this.props.width)&&void 0!==r?r:280,height:10,handleSize:18,hsva:a.hsva,className:"alphaSliderWrapper",foundation:this.foundation}),h().createElement(GA,{currentColor:a,eyeDropper:this.props.eyeDropper,alpha:this.props.alpha,width:null!==(i=this.props.width)&&void 0!==i?i:280,foundation:this.foundation,defaultFormat:this.props.defaultFormat}),this.props.bottomSlot)}render(){var e,t;const n=this.foundation.getCurrentColor();return this.props.usePopover?h().createElement(Cn,Object.assign({},this.props.popoverProps,{className:w()(`${LA}-popover`,null===(e=this.props.popoverProps)||void 0===e?void 0:e.className),content:this.renderPicker()}),null!==(t=this.props.children)&&void 0!==t?t:h().createElement("div",{style:{backgroundColor:n.hex},className:w()(`${LA}-popover-defaultChildren`)})):this.renderPicker()}}qA.__SemiComponentName__="ColorPicker",qA.defaultProps=he(qA.__SemiComponentName__,{defaultValue:{hsva:{h:176,s:71,v:77,a:1},rgba:{r:57,g:197,b:187,a:1},hex:"#39c5bb"},eyeDropper:!0,defaultFormat:"hex"}),qA.colorStringToValue=e=>{if(e.startsWith("#"))return{hsva:gA(e),rgba:yA(e),hex:e};if(e.startsWith("rgba")){const t=OA(e);return{hsva:kA(e),rgba:t,hex:MA(t)}}if(e.startsWith("rgb")){const t=TA(e);return{hsva:PA(e),rgba:t,hex:MA(t)}}if(e.startsWith("hsv")){const t=_A(e);return{hsva:t,rgba:CA(t),hex:bA(t)}}throw new Error("Semi ColorPicker: error on static colorStringToValue method, input value is invalid: "+e)};const XA=qA;function YA(e){return e&&"object"==typeof e?"position"in e||"type"in e?JA(e.position):"start"in e||"end"in e?JA(e):"line"in e||"column"in e?ZA(e):"":""}function ZA(e){return QA(e&&e.line)+":"+QA(e&&e.column)}function JA(e){return ZA(e&&e.start)+"-"+ZA(e&&e.end)}function QA(e){return e&&"number"==typeof e?e:1}class eN extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},s=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(s=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=o?o.line:void 0,this.name=YA(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}eN.prototype.file="",eN.prototype.name="",eN.prototype.reason="",eN.prototype.message="",eN.prototype.stack="",eN.prototype.column=void 0,eN.prototype.line=void 0,eN.prototype.ancestors=void 0,eN.prototype.cause=void 0,eN.prototype.fatal=void 0,eN.prototype.place=void 0,eN.prototype.ruleId=void 0,eN.prototype.source=void 0;const tN={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');nN(e);let n,r=0,i=-1,s=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;s--;)if(47===e.codePointAt(s)){if(n){r=s+1;break}}else i<0&&(n=!0,i=s+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let o=-1,a=t.length-1;for(;s--;)if(47===e.codePointAt(s)){if(n){r=s+1;break}}else o<0&&(n=!0,o=s+1),a>-1&&(e.codePointAt(s)===t.codePointAt(a--)?a<0&&(i=s):(a=-1,i=o));r===i?i=o:i<0&&(i=e.length);return e.slice(r,i)},dirname:function(e){if(nN(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){nN(e);let t,n=e.length,r=-1,i=0,s=-1,o=0;for(;n--;){const a=e.codePointAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?s<0?s=n:1!==o&&(o=1):s>-1&&(o=-1);else if(t){i=n+1;break}}if(s<0||r<0||0===o||1===o&&s===r-1&&s===i+1)return"";return e.slice(s,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)nN(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){nN(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,i="",s=0,o=-1,a=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(o===l-1||1===a);else if(o!==l-1&&2===a){if(i.length<2||2!==s||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2))if(i.length>2){if(r=i.lastIndexOf("/"),r!==i.length-1){r<0?(i="",s=0):(i=i.slice(0,r),s=i.length-1-i.lastIndexOf("/")),o=l,a=0;continue}}else if(i.length>0){i="",s=0,o=l,a=0;continue}t&&(i=i.length>0?i+"/..":"..",s=2)}else i.length>0?i+="/"+e.slice(o+1,l):i=e.slice(o+1,l),s=l-o-1;o=l,a=0}else 46===n&&a>-1?a++:a=-1}return i}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function nN(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const rN={cwd:function(){return"/"}};function iN(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function sN(e){if("string"==typeof e)e=new URL(e);else if(!iN(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const oN=["history","path","basename","stem","extname","dirname"];class aN{constructor(e){let t;t=e?iN(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":rN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<oN.length;){const e=oN[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)oN.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?tN.basename(this.path):void 0}set basename(e){cN(e,"basename"),lN(e,"basename"),this.path=tN.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?tN.dirname(this.path):void 0}set dirname(e){dN(this.basename,"dirname"),this.path=tN.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?tN.extname(this.path):void 0}set extname(e){if(lN(e,"extname"),dN(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=tN.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){iN(e)&&(e=sN(e)),cN(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?tN.basename(this.path,this.extname):void 0}set stem(e){cN(e,"stem"),lN(e,"stem"),this.path=tN.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new eN(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function lN(e,t){if(e&&e.includes(tN.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+tN.sep+"`")}function cN(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function dN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const hN=["md","markdown","mdown","mkdn","mkd","mdwn","mkdown","ron"].map((function(e){return"."+e}));function uN(e,t){const n=(r=e,Boolean(r&&"object"==typeof r&&"message"in r&&"messages"in r)?e:new aN(e));var r;const{format:i,...s}=t||{};return{file:n,options:{format:"md"===i||"mdx"===i?i:n.extname&&(s.mdExtensions||hN).includes(n.extname)?"md":"mdx",...s}}}function pN(e){this.enter({type:"mdxFlowExpression",value:""},e),this.buffer()}function fN(e){this.enter({type:"mdxTextExpression",value:""},e),this.buffer()}function mN(e){const t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];"mdxFlowExpression"===r.type||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function gN(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function yN(e){return"{"+(e.value||"")+"}"}function vN(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}const bN=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],wN={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function xN(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}function EN(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function CN(e){return function(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}(e)||xN(e)}const SN=document.createElement("i");function _N(e){const t="&"+e+";";SN.innerHTML=t;const n=SN.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}const kN=String.fromCharCode,ON=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function TN(e){return e>=55296&&e<=57343||e>1114111}function PN(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||!(65535&~e)||65534==(65535&e)}const IN=/["&'<>`]/g,MN=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,RN=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,AN=/[|\\{}()[\]^$+*?.]/g,NN=new WeakMap;function DN(e,t){return e=e.replace(t.subset?function(e){let t=NN.get(e);t||(t=function(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(AN,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),NN.set(e,t));return t}(t.subset):IN,n),t.subset||t.escapeOnly?e:e.replace(MN,(function(e,n,r){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)})).replace(RN,n);function n(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function LN(e){return"&#x"+e.toString(16).toUpperCase()+";"}function FN(e,t){return DN(e,Object.assign({format:LN},t))}const jN=" ";function $N(){return{canContainEols:["mdxJsxTextElement"],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:h,mdxJsxFlowTagExpressionAttribute:u,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:h,mdxJsxTextTagExpressionAttribute:u,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:a,mdxJsxFlowTagNamePrimary:l,mdxJsxFlowTagNameMember:c,mdxJsxFlowTagNameLocal:d,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:f,mdxJsxFlowTagAttributeNameLocal:m,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:y,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:b,mdxJsxTextTagClosingMarker:a,mdxJsxTextTagNamePrimary:l,mdxJsxTextTagNameMember:c,mdxJsxTextTagNameLocal:d,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:f,mdxJsxTextTagAttributeNameLocal:m,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:y,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:b}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){const t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){const t=this.data.mdxJsxTagStack;if(0===t.length)throw new eN("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},"mdast-util-mdx-jsx:unexpected-closing-slash")}function s(e){const t=this.data.mdxJsxTag;if(t.close)throw new eN("Unexpected attribute in closing tag, expected the end of the tag",{start:e.start,end:e.end},"mdast-util-mdx-jsx:unexpected-attribute")}function o(e){const t=this.data.mdxJsxTag;if(t.close)throw new eN("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},"mdast-util-mdx-jsx:unexpected-self-closing-slash")}function a(){const e=this.data.mdxJsxTag;e.close=!0}function l(e){const t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function c(e){const t=this.data.mdxJsxTag;t.name+="."+this.sliceSerialize(e)}function d(e){const t=this.data.mdxJsxTag;t.name+=":"+this.sliceSerialize(e)}function h(e){const n=this.data.mdxJsxTag;s.call(this,e),n.attributes.push({type:"mdxJsxAttribute",name:"",value:null,position:{start:t(e.start),end:void 0}})}function u(e){const t=this.data.mdxJsxTag;s.call(this,e),t.attributes.push({type:"mdxJsxExpressionAttribute",value:""}),this.buffer()}function p(e){const t=this.data.mdxJsxTag,n=t.attributes[t.attributes.length-1];n.type;const r=e.estree;n.value=this.resume(),r&&(n.data={estree:r})}function f(e){const n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function m(e){const n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=":"+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){const n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=function(e,t={}){const n="string"==typeof t.additional?t.additional.charCodeAt(0):t.additional,r=[];let i,s,o=0,a=-1,l="";t.position&&("start"in t.position||"indent"in t.position?(s=t.position.indent,i=t.position.start):i=t.position);let c,d=(i?i.line:0)||1,h=(i?i.column:0)||1,u=p();for(o--;++o<=e.length;)if(10===c&&(h=(s?s[a]:0)||1),c=e.charCodeAt(o),38===c){const i=e.charCodeAt(o+1);if(9===i||10===i||12===i||32===i||38===i||60===i||Number.isNaN(i)||n&&i===n){l+=kN(c),h++;continue}const s=o+1;let a,d=s,g=s;if(35===i){g=++d;const t=e.charCodeAt(g);88===t||120===t?(a="hexadecimal",g=++d):a="decimal"}else a="named";let y="",v="",b="";const w="named"===a?CN:"decimal"===a?xN:EN;for(g--;++g<=e.length;){const t=e.charCodeAt(g);if(!w(t))break;b+=kN(t),"named"===a&&bN.includes(b)&&(y=b,v=_N(b))}let x=59===e.charCodeAt(g);if(x){g++;const e="named"===a&&_N(b);e&&(y=b,v=e)}let E=1+g-s,C="";if(x||!1!==t.nonTerminated)if(b)if("named"===a){if(x&&!v)f(5,1);else if(y!==b&&(g=d+y.length,E=1+g-d,x=!1),!x){const n=y?1:3;if(t.attribute){const t=e.charCodeAt(g);61===t?(f(n,E),v=""):CN(t)?v="":f(n,E)}else f(n,E)}C=v}else{x||f(2,E);let e=Number.parseInt(b,"hexadecimal"===a?16:10);if(TN(e))f(7,E),C=kN(65533);else if(e in wN)f(6,E),C=wN[e];else{let t="";PN(e)&&f(6,E),e>65535&&(e-=65536,t+=kN(e>>>10|55296),e=56320|1023&e),C=t+kN(e)}}else"named"!==a&&f(4,E);if(C){m(),u=p(),o=g-1,h+=g-s+1,r.push(C);const n=p();n.offset++,t.reference&&t.reference.call(t.referenceContext,C,{start:u,end:n},e.slice(s-1,g)),u=n}else b=e.slice(s-1,g),l+=b,h+=b.length,o=g-1}else 10===c&&(d++,a++,h=0),Number.isNaN(c)?m():(l+=kN(c),h++);return r.join("");function p(){return{line:d,column:h,offset:o+((i?i.offset:0)||0)}}function f(e,n){let r;t.warning&&(r=p(),r.column+=n,r.offset+=n,t.warning.call(t.warningContext,ON[e],r,e))}function m(){l&&(r.push(l),t.text&&t.text.call(t.textContext,l,{start:u,end:p()}),l="")}}(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function y(e){const n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;const i={type:"mdxJsxAttributeValueExpression",value:this.resume()},s=e.estree;s&&(i.data={estree:s}),r.value=i,r.position,r.position.end=t(e.end)}function v(){const e=this.data.mdxJsxTag;e.selfClosing=!0}function b(e){const t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new eN("Unexpected closing tag `"+E(t)+"`, expected corresponding closing tag for `"+E(r)+"` ("+YA(r)+")",{start:e.start,end:e.end},"mdast-util-mdx-jsx:end-tag-mismatch");this.resume(),t.close?n.pop():this.enter({type:"mdxJsxTextTag"===e.type?"mdxJsxTextElement":"mdxJsxFlowElement",name:t.name||null,attributes:t.attributes,children:[]},e,w),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function w(e,t){const n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":"",s=e?{start:e.start,end:e.end}:void 0;throw new eN("Expected a closing tag for `"+E(r)+"` ("+YA({start:t.start,end:t.end})+")"+i,s,"mdast-util-mdx-jsx:end-tag-mismatch")}function x(e,t){const n=this.data.mdxJsxTag;throw new eN("Expected the closing tag `"+E(n)+"` either after the end of `"+t.type+"` ("+YA(t.end)+") or another opening tag after the start of `"+t.type+"` ("+YA(t.start)+")",{start:e.start,end:e.end},"mdast-util-mdx-jsx:end-tag-mismatch")}function E(e){return"<"+(e.close?"/":"")+(e.name||"")+">"}}function BN(e){const t=e||{},n=t.quote||'"',r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,s=t.printWidth||Number.POSITIVE_INFINITY,o='"'===n?"'":'"';if('"'!==n&&"'"!==n)throw new Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return a.peek=HN,{handlers:{mdxJsxFlowElement:a,mdxJsxTextElement:a},unsafe:[{character:"<",inConstruct:["phrasing"]},{atBreak:!0,character:"<"}],fences:!0,resourceLink:!0};function a(e,t,a,l){const c="mdxJsxFlowElement"===e.type,d=!!e.name&&(!e.children||0===e.children.length),h=zN(VN(a)),u=a.createTracker(l),p=a.createTracker(l),f=[],m=(c?h:"")+"<"+(e.name||""),g=a.enter(e.type);if(u.move(m),p.move(m),e.attributes&&e.attributes.length>0){if(!e.name)throw new Error("Cannot serialize fragment w/ attributes");let t=-1;for(;++t<e.attributes.length;){const i=e.attributes[t];let s;if("mdxJsxExpressionAttribute"===i.type)s="{"+(i.value||"")+"}";else{if(!i.name)throw new Error("Cannot serialize attribute w/o name");const e=i.value,t=i.name;let a="";if(null==e);else if("object"==typeof e)a="{"+(e.value||"")+"}";else{const t=r&&vN(e,n)>vN(e,o)?o:n;a=t+FN(e,{subset:[t]})+t}s=t+(a?"=":"")+a}f.push(s)}}let y=!1;const v=f.join(" ");c&&(/\r?\n|\r/.test(v)||u.current().now.column+v.length+(d?i?2:3:1)>s)&&(y=!0);let b=u,w=m;if(y){b=p;let e=-1;for(;++e<f.length;)f[e]=h+jN+f[e];w+=b.move("\n"+f.join("\n")+"\n"+h)}else v&&(w+=b.move(" "+v));return d&&(w+=b.move((i||y?"":" ")+"/")),w+=b.move(">"),e.children&&e.children.length>0&&("mdxJsxTextElement"===e.type?w+=b.move(a.containerPhrasing(e,{...b.current(),before:">",after:"<"})):(b.shift(2),w+=b.move("\n"),w+=b.move(function(e,t,n){const r=t.indexStack,i=e.children,s=t.createTracker(n),o=zN(VN(t)),a=[];let l=-1;r.push(-1);for(;++l<i.length;){const n=i[l];r[r.length-1]=l;const c={before:"\n",after:"\n",...s.current()},d=t.handle(n,e,t,c),h="mdxJsxFlowElement"===n.type?d:t.indentLines(d,(function(e,t,n){return(n?"":o)+e}));a.push(s.move(h)),"list"!==n.type&&(t.bulletLastUsed=void 0),l<i.length-1&&a.push(s.move("\n\n"))}return r.pop(),a.join("")}(e,a,b.current())),w+=b.move("\n"))),d||(w+=b.move((c?h:"")+"</"+(e.name||"")+">")),g(),w}}function VN(e){let t=0,n=e.stack.length;for(;--n>-1;){const r=e.stack[n];if("blockquote"===r||"listItem"===r)break;"mdxJsxFlowElement"===r&&t++}return t}function zN(e){return jN.repeat(e)}function HN(){return"<"}function UN(e){this.enter({type:"mdxjsEsm",value:""},e),this.buffer()}function KN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);const r=e.estree;n.value=t,r&&(n.data={estree:r})}function WN(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function GN(e){return e.value||""}var qN=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],XN=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],YN="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",ZN={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},JN="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",QN={5:JN,"5module":JN+" export import",6:JN+" const class extends export import super"},eD=/^in(stanceof)?$/,tD=new RegExp("["+YN+"]"),nD=new RegExp("["+YN+"·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");function rD(e,t){for(var n=65536,r=0;r<t.length;r+=2){if((n+=t[r])>e)return!1;if((n+=t[r+1])>=e)return!0}return!1}function iD(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&tD.test(String.fromCharCode(e)):!1!==t&&rD(e,XN)))}function sD(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&nD.test(String.fromCharCode(e)):!1!==t&&(rD(e,XN)||rD(e,qN)))))}var oD=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function aD(e,t){return new oD(e,{beforeExpr:!0,binop:t})}var lD={beforeExpr:!0},cD={startsExpr:!0},dD={};function hD(e,t){return void 0===t&&(t={}),t.keyword=e,dD[e]=new oD(e,t)}var uD={num:new oD("num",cD),regexp:new oD("regexp",cD),string:new oD("string",cD),name:new oD("name",cD),privateId:new oD("privateId",cD),eof:new oD("eof"),bracketL:new oD("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new oD("]"),braceL:new oD("{",{beforeExpr:!0,startsExpr:!0}),braceR:new oD("}"),parenL:new oD("(",{beforeExpr:!0,startsExpr:!0}),parenR:new oD(")"),comma:new oD(",",lD),semi:new oD(";",lD),colon:new oD(":",lD),dot:new oD("."),question:new oD("?",lD),questionDot:new oD("?."),arrow:new oD("=>",lD),template:new oD("template"),invalidTemplate:new oD("invalidTemplate"),ellipsis:new oD("...",lD),backQuote:new oD("`",cD),dollarBraceL:new oD("${",{beforeExpr:!0,startsExpr:!0}),eq:new oD("=",{beforeExpr:!0,isAssign:!0}),assign:new oD("_=",{beforeExpr:!0,isAssign:!0}),incDec:new oD("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new oD("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:aD("||",1),logicalAND:aD("&&",2),bitwiseOR:aD("|",3),bitwiseXOR:aD("^",4),bitwiseAND:aD("&",5),equality:aD("==/!=/===/!==",6),relational:aD("</>/<=/>=",7),bitShift:aD("<</>>/>>>",8),plusMin:new oD("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:aD("%",10),star:aD("*",10),slash:aD("/",10),starstar:new oD("**",{beforeExpr:!0}),coalesce:aD("??",1),_break:hD("break"),_case:hD("case",lD),_catch:hD("catch"),_continue:hD("continue"),_debugger:hD("debugger"),_default:hD("default",lD),_do:hD("do",{isLoop:!0,beforeExpr:!0}),_else:hD("else",lD),_finally:hD("finally"),_for:hD("for",{isLoop:!0}),_function:hD("function",cD),_if:hD("if"),_return:hD("return",lD),_switch:hD("switch"),_throw:hD("throw",lD),_try:hD("try"),_var:hD("var"),_const:hD("const"),_while:hD("while",{isLoop:!0}),_with:hD("with"),_new:hD("new",{beforeExpr:!0,startsExpr:!0}),_this:hD("this",cD),_super:hD("super",cD),_class:hD("class",cD),_extends:hD("extends",lD),_export:hD("export"),_import:hD("import",cD),_null:hD("null",cD),_true:hD("true",cD),_false:hD("false",cD),_in:hD("in",{beforeExpr:!0,binop:7}),_instanceof:hD("instanceof",{beforeExpr:!0,binop:7}),_typeof:hD("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:hD("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:hD("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},pD=/\r\n?|\n|\u2028|\u2029/,fD=new RegExp(pD.source,"g");function mD(e){return 10===e||13===e||8232===e||8233===e}function gD(e,t,n){void 0===n&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(mD(i))return r<n-1&&13===i&&10===e.charCodeAt(r+1)?r+2:r+1}return-1}var yD=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,vD=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,bD=Object.prototype,wD=bD.hasOwnProperty,xD=bD.toString,ED=Object.hasOwn||function(e,t){return wD.call(e,t)},CD=Array.isArray||function(e){return"[object Array]"===xD.call(e)},SD=Object.create(null);function _D(e){return SD[e]||(SD[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function kD(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var OD=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,TD=function(e,t){this.line=e,this.column=t};TD.prototype.offset=function(e){return new TD(this.line,this.column+e)};var PD=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)};function ID(e,t){for(var n=1,r=0;;){var i=gD(e,r,t);if(i<0)return new TD(n,t-r);++n,r=i}}var MD={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},RD=!1;function AD(e){var t={};for(var n in MD)t[n]=e&&ED(e,n)?e[n]:MD[n];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!RD&&"object"==typeof console&&console.warn&&(RD=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),e&&null!=e.allowHashBang||(t.allowHashBang=t.ecmaVersion>=14),CD(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return CD(t.onComment)&&(t.onComment=function(e,t){return function(n,r,i,s,o,a){var l={type:n?"Block":"Line",value:r,start:i,end:s};e.locations&&(l.loc=new PD(this,o,a)),e.ranges&&(l.range=[i,s]),t.push(l)}}(t,t.onComment)),t}var ND=256;function DD(e,t){return 2|(e?4:0)|(t?8:0)}var LD=function(e,t,n){this.options=e=AD(e),this.sourceFile=e.sourceFile,this.keywords=_D(QN[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var r="";!0!==e.allowReserved&&(r=ZN[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(r+=" await")),this.reservedWords=_D(r);var i=(r?r+" ":"")+ZN.strict;this.reservedWordsStrict=_D(i),this.reservedWordsStrictBind=_D(i+" "+ZN.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(pD).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=uD.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null,this.privateNameStack=[]},FD={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};LD.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},FD.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},FD.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0&&!this.currentVarScope().inClassFieldInit},FD.inAsync.get=function(){return(4&this.currentVarScope().flags)>0&&!this.currentVarScope().inClassFieldInit},FD.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&ND)return!1;if(2&t.flags)return(4&t.flags)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},FD.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(64&t)>0||n||this.options.allowSuperOutsideMethod},FD.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},FD.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},FD.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(258&t)>0||n},FD.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ND)>0},LD.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},LD.parse=function(e,t){return new this(t,e).parse()},LD.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},LD.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(LD.prototype,FD);var jD=LD.prototype,$D=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;jD.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){vD.lastIndex=e,e+=vD.exec(this.input)[0].length;var t=$D.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){vD.lastIndex=e+t[0].length;var n=vD.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return";"===i||"}"===i||pD.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||"!"===i&&"="===this.input.charAt(r+1))}e+=t[0].length,vD.lastIndex=e,e+=vD.exec(this.input)[0].length,";"===this.input[e]&&e++}},jD.eat=function(e){return this.type===e&&(this.next(),!0)},jD.isContextual=function(e){return this.type===uD.name&&this.value===e&&!this.containsEsc},jD.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},jD.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},jD.canInsertSemicolon=function(){return this.type===uD.eof||this.type===uD.braceR||pD.test(this.input.slice(this.lastTokEnd,this.start))},jD.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},jD.semicolon=function(){this.eat(uD.semi)||this.insertSemicolon()||this.unexpected()},jD.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},jD.expect=function(e){this.eat(e)||this.unexpected()},jD.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var BD=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};jD.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?"Assigning to rvalue":"Parenthesized pattern")}},jD.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")},jD.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},jD.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var VD=LD.prototype;VD.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==uD.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var s=i[r];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var zD={kind:"loop"},HD={kind:"switch"};VD.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;vD.lastIndex=this.pos;var t=vD.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(91===r||92===r)return!0;if(e)return!1;if(123===r||r>55295&&r<56320)return!0;if(iD(r,!0)){for(var i=n+1;sD(r=this.input.charCodeAt(i),!0);)++i;if(92===r||r>55295&&r<56320)return!0;var s=this.input.slice(n,i);if(!eD.test(s))return!0}return!1},VD.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;vD.lastIndex=this.pos;var e,t=vD.exec(this.input),n=this.pos+t[0].length;return!(pD.test(this.input.slice(this.pos,n))||"function"!==this.input.slice(n,n+8)||n+8!==this.input.length&&(sD(e=this.input.charCodeAt(n+8))||e>55295&&e<56320))},VD.parseStatement=function(e,t,n){var r,i=this.type,s=this.startNode();switch(this.isLet(e)&&(i=uD._var,r="let"),i){case uD._break:case uD._continue:return this.parseBreakContinueStatement(s,i.keyword);case uD._debugger:return this.parseDebuggerStatement(s);case uD._do:return this.parseDoStatement(s);case uD._for:return this.parseForStatement(s);case uD._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case uD._class:return e&&this.unexpected(),this.parseClass(s,!0);case uD._if:return this.parseIfStatement(s);case uD._return:return this.parseReturnStatement(s);case uD._switch:return this.parseSwitchStatement(s);case uD._throw:return this.parseThrowStatement(s);case uD._try:return this.parseTryStatement(s);case uD._const:case uD._var:return r=r||this.value,e&&"var"!==r&&this.unexpected(),this.parseVarStatement(s,r);case uD._while:return this.parseWhileStatement(s);case uD._with:return this.parseWithStatement(s);case uD.braceL:return this.parseBlock(!0,s);case uD.semi:return this.parseEmptyStatement(s);case uD._export:case uD._import:if(this.options.ecmaVersion>10&&i===uD._import){vD.lastIndex=this.pos;var o=vD.exec(this.input),a=this.pos+o[0].length,l=this.input.charCodeAt(a);if(40===l||46===l)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===uD._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var c=this.value,d=this.parseExpression();return i===uD.name&&"Identifier"===d.type&&this.eat(uD.colon)?this.parseLabeledStatement(s,c,d,e):this.parseExpressionStatement(s,d)}},VD.parseBreakContinueStatement=function(e,t){var n="break"===t;this.next(),this.eat(uD.semi)||this.insertSemicolon()?e.label=null:this.type!==uD.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if(null==e.label||i.name===e.label.name){if(null!=i.kind&&(n||"loop"===i.kind))break;if(e.label&&n)break}}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,n?"BreakStatement":"ContinueStatement")},VD.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},VD.parseDoStatement=function(e){return this.next(),this.labels.push(zD),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(uD._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(uD.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},VD.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(zD),this.enterScope(0),this.expect(uD.parenL),this.type===uD.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===uD._var||this.type===uD._const||n){var r=this.startNode(),i=n?"let":this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,"VariableDeclaration"),(this.type===uD._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===r.declarations.length?(this.options.ecmaVersion>=9&&(this.type===uD._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var s=this.isContextual("let"),o=!1,a=this.containsEsc,l=new BD,c=this.start,d=t>-1?this.parseExprSubscripts(l,"await"):this.parseExpression(!0,l);return this.type===uD._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===uD._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(d.start!==c||a||"Identifier"!==d.type||"async"!==d.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),s&&o&&this.raise(d.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(d,!1,l),this.checkLValPattern(d),this.parseForIn(e,d)):(this.checkExpressionErrors(l,!0),t>-1&&this.unexpected(t),this.parseFor(e,d))},VD.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,KD|(n?0:WD),!1,t)},VD.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(uD._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},VD.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(uD.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},VD.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(uD.braceL),this.labels.push(HD),this.enterScope(0);for(var n=!1;this.type!==uD.braceR;)if(this.type===uD._case||this.type===uD._default){var r=this.type===uD._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(uD.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},VD.parseThrowStatement=function(e){return this.next(),pD.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var UD=[];VD.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?32:0),this.checkLValPattern(e,t?4:2),this.expect(uD.parenR),e},VD.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===uD._catch){var t=this.startNode();this.next(),this.eat(uD.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(uD._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},VD.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")},VD.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(zD),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},VD.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},VD.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},VD.parseLabeledStatement=function(e,t,n,r){for(var i=0,s=this.labels;i<s.length;i+=1){s[i].name===t&&this.raise(n.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===uD._switch?"switch":null,a=this.labels.length-1;a>=0;a--){var l=this.labels[a];if(l.statementStart!==e.start)break;l.statementStart=this.start,l.kind=o}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?-1===r.indexOf("label")?r+"label":r:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},VD.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},VD.parseBlock=function(e,t,n){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(uD.braceL),e&&this.enterScope(0);this.type!==uD.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},VD.parseFor=function(e,t){return e.init=t,this.expect(uD.semi),e.test=this.type===uD.semi?null:this.parseExpression(),this.expect(uD.semi),e.update=this.type===uD.parenR?null:this.parseExpression(),this.expect(uD.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},VD.parseForIn=function(e,t){var n=this.type===uD._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!n||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(uD.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")},VD.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(uD.eq)?i.init=this.parseMaybeAssign(t):r||"const"!==n||this.type===uD._in||this.options.ecmaVersion>=6&&this.isContextual("of")?r||"Identifier"===i.id.type||t&&(this.type===uD._in||this.isContextual("of"))?i.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(uD.comma))break}return e},VD.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var KD=1,WD=2;function GD(e,t){var n=t.key.name,r=e[n],i="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(i=(t.static?"s":"i")+t.kind),"iget"===r&&"iset"===i||"iset"===r&&"iget"===i||"sget"===r&&"sset"===i||"sset"===r&&"sget"===i?(e[n]="true",!1):!!r||(e[n]=i,!1)}function qD(e,t){var n=e.computed,r=e.key;return!n&&("Identifier"===r.type&&r.name===t||"Literal"===r.type&&r.value===t)}VD.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===uD.star&&t&WD&&this.unexpected(),e.generator=this.eat(uD.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&KD&&(e.id=4&t&&this.type!==uD.name?null:this.parseIdent(),!e.id||t&WD||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var s=this.yieldPos,o=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(DD(e.async,e.generator)),t&KD||(e.id=this.type===uD.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=s,this.awaitPos=o,this.awaitIdentPos=a,this.finishNode(e,t&KD?"FunctionDeclaration":"FunctionExpression")},VD.parseFunctionParams=function(e){this.expect(uD.parenL),e.params=this.parseBindingList(uD.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},VD.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),s=!1;for(i.body=[],this.expect(uD.braceL);this.type!==uD.braceR;){var o=this.parseClassElement(null!==e.superClass);o&&(i.body.push(o),"MethodDefinition"===o.type&&"constructor"===o.kind?(s&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),s=!0):o.key&&"PrivateIdentifier"===o.key.type&&GD(r,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=n,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},VD.parseClassElement=function(e){if(this.eat(uD.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r="",i=!1,s=!1,o="method",a=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(uD.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===uD.star?a=!0:r="static"}if(n.static=a,!r&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==uD.star||this.canInsertSemicolon()?r="async":s=!0),!r&&(t>=9||!s)&&this.eat(uD.star)&&(i=!0),!r&&!s&&!i){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=l:r=l)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,"Identifier")):this.parseClassElementName(n),t<13||this.type===uD.parenL||"method"!==o||i||s){var c=!n.static&&qD(n,"constructor"),d=c&&e;c&&"method"!==o&&this.raise(n.key.start,"Constructor can't have get/set modifier"),n.kind=c?"constructor":o,this.parseClassMethod(n,i,s,d)}else this.parseClassField(n);return n},VD.isClassElementNameStart=function(){return this.type===uD.name||this.type===uD.privateId||this.type===uD.num||this.type===uD.string||this.type===uD.bracketL||this.type.keyword},VD.parseClassElementName=function(e){this.type===uD.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},VD.parseClassMethod=function(e,t,n,r){var i=e.key;"constructor"===e.kind?(t&&this.raise(i.start,"Constructor can't be a generator"),n&&this.raise(i.start,"Constructor can't be an async method")):e.static&&qD(e,"prototype")&&this.raise(i.start,"Classes may not have a static property named prototype");var s=e.value=this.parseMethod(t,n,r);return"get"===e.kind&&0!==s.params.length&&this.raiseRecoverable(s.start,"getter should have no params"),"set"===e.kind&&1!==s.params.length&&this.raiseRecoverable(s.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===s.params[0].type&&this.raiseRecoverable(s.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},VD.parseClassField=function(e){if(qD(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&qD(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(uD.eq)){var t=this.currentThisScope(),n=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=n}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")},VD.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==uD.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},VD.parseClassId=function(e,t){this.type===uD.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},VD.parseClassSuper=function(e){e.superClass=this.eat(uD._extends)?this.parseExprSubscripts(null,!1):null},VD.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},VD.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=0===r?null:this.privateNameStack[r-1],s=0;s<n.length;++s){var o=n[s];ED(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class"))}},VD.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==uD.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},VD.parseExport=function(e,t){if(this.next(),this.eat(uD.star))return this.parseExportAllDeclaration(e,t);if(this.eat(uD._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==uD.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),"Literal"===i.local.type&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},VD.parseExportDeclaration=function(e){return this.parseStatement(null)},VD.parseExportDefaultDeclaration=function(){var e;if(this.type===uD._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,4|KD,!1,e)}if(this.type===uD._class){var n=this.startNode();return this.parseClass(n,"nullableID")}var r=this.parseMaybeAssign();return this.semicolon(),r},VD.checkExport=function(e,t,n){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),ED(e,t)&&this.raiseRecoverable(n,"Duplicate export '"+t+"'"),e[t]=!0)},VD.checkPatternExport=function(e,t){var n=t.type;if("Identifier"===n)this.checkExport(e,t,t.start);else if("ObjectPattern"===n)for(var r=0,i=t.properties;r<i.length;r+=1){var s=i[r];this.checkPatternExport(e,s)}else if("ArrayPattern"===n)for(var o=0,a=t.elements;o<a.length;o+=1){var l=a[o];l&&this.checkPatternExport(e,l)}else"Property"===n?this.checkPatternExport(e,t.value):"AssignmentPattern"===n?this.checkPatternExport(e,t.left):"RestElement"===n&&this.checkPatternExport(e,t.argument)},VD.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},VD.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},VD.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},VD.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(uD.braceL);!this.eat(uD.braceR);){if(n)n=!1;else if(this.expect(uD.comma),this.afterTrailingComma(uD.braceR))break;t.push(this.parseExportSpecifier(e))}return t},VD.parseImport=function(e){return this.next(),this.type===uD.string?(e.specifiers=UD,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===uD.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},VD.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportSpecifier")},VD.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportDefaultSpecifier")},VD.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportNamespaceSpecifier")},VD.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===uD.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(uD.comma)))return e;if(this.type===uD.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(uD.braceL);!this.eat(uD.braceR);){if(t)t=!1;else if(this.expect(uD.comma),this.afterTrailingComma(uD.braceR))break;e.push(this.parseImportSpecifier())}return e},VD.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===uD.string){var e=this.parseLiteral(this.value);return OD.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},VD.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},VD.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var XD=LD.prototype;XD.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var s=i[r];this.toAssignable(s,t),"RestElement"!==s.type||"ArrayPattern"!==s.argument.type&&"ObjectPattern"!==s.argument.type||this.raise(s.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,n);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else n&&this.checkPatternErrors(n,!0);return e},XD.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var s=e[n-1];6===this.options.ecmaVersion&&t&&s&&"RestElement"===s.type&&"Identifier"!==s.argument.type&&this.unexpected(s.argument.start)}return e},XD.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},XD.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==uD.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},XD.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case uD.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(uD.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case uD.braceL:return this.parseObj(!0)}return this.parseIdent()},XD.parseBindingList=function(e,t,n,r){for(var i=[],s=!0;!this.eat(e);)if(s?s=!1:this.expect(uD.comma),t&&this.type===uD.comma)i.push(null);else{if(n&&this.afterTrailingComma(e))break;if(this.type===uD.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===uD.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}i.push(this.parseAssignableListItem(r))}return i},XD.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},XD.parseBindingListItem=function(e){return e},XD.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(uD.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")},XD.checkLValSimple=function(e,t,n){void 0===t&&(t=0);var r=0!==t;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),n&&(ED(n,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),n[e.name]=!0),5!==t&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}},XD.checkLValPattern=function(e,t,n){switch(void 0===t&&(t=0),e.type){case"ObjectPattern":for(var r=0,i=e.properties;r<i.length;r+=1){var s=i[r];this.checkLValInnerPattern(s,t,n)}break;case"ArrayPattern":for(var o=0,a=e.elements;o<a.length;o+=1){var l=a[o];l&&this.checkLValInnerPattern(l,t,n)}break;default:this.checkLValSimple(e,t,n)}},XD.checkLValInnerPattern=function(e,t,n){switch(void 0===t&&(t=0),e.type){case"Property":this.checkLValInnerPattern(e.value,t,n);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,n);break;case"RestElement":this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var YD=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},ZD={b_stat:new YD("{",!1),b_expr:new YD("{",!0),b_tmpl:new YD("${",!1),p_stat:new YD("(",!1),p_expr:new YD("(",!0),q_tmpl:new YD("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new YD("function",!1),f_expr:new YD("function",!0),f_expr_gen:new YD("function",!0,!1,null,!0),f_gen:new YD("function",!1,!1,null,!0)},JD=LD.prototype;JD.initialContext=function(){return[ZD.b_stat]},JD.curContext=function(){return this.context[this.context.length-1]},JD.braceIsBlock=function(e){var t=this.curContext();return t===ZD.f_expr||t===ZD.f_stat||(e!==uD.colon||t!==ZD.b_stat&&t!==ZD.b_expr?e===uD._return||e===uD.name&&this.exprAllowed?pD.test(this.input.slice(this.lastTokEnd,this.start)):e===uD._else||e===uD.semi||e===uD.eof||e===uD.parenR||e===uD.arrow||(e===uD.braceL?t===ZD.b_stat:e!==uD._var&&e!==uD._const&&e!==uD.name&&!this.exprAllowed):!t.isExpr)},JD.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},JD.updateContext=function(e){var t,n=this.type;n.keyword&&e===uD.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},JD.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},uD.parenR.updateContext=uD.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===ZD.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},uD.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ZD.b_stat:ZD.b_expr),this.exprAllowed=!0},uD.dollarBraceL.updateContext=function(){this.context.push(ZD.b_tmpl),this.exprAllowed=!0},uD.parenL.updateContext=function(e){var t=e===uD._if||e===uD._for||e===uD._with||e===uD._while;this.context.push(t?ZD.p_stat:ZD.p_expr),this.exprAllowed=!0},uD.incDec.updateContext=function(){},uD._function.updateContext=uD._class.updateContext=function(e){!e.beforeExpr||e===uD._else||e===uD.semi&&this.curContext()!==ZD.p_stat||e===uD._return&&pD.test(this.input.slice(this.lastTokEnd,this.start))||(e===uD.colon||e===uD.braceL)&&this.curContext()===ZD.b_stat?this.context.push(ZD.f_stat):this.context.push(ZD.f_expr),this.exprAllowed=!1},uD.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},uD.backQuote.updateContext=function(){this.curContext()===ZD.q_tmpl?this.context.pop():this.context.push(ZD.q_tmpl),this.exprAllowed=!1},uD.star.updateContext=function(e){if(e===uD._function){var t=this.context.length-1;this.context[t]===ZD.f_expr?this.context[t]=ZD.f_expr_gen:this.context[t]=ZD.f_gen}this.exprAllowed=!0},uD.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==uD.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var QD=LD.prototype;function eL(e){return"Identifier"===e.type||"ParenthesizedExpression"===e.type&&eL(e.expression)}function tL(e){return"MemberExpression"===e.type&&"PrivateIdentifier"===e.property.type||"ChainExpression"===e.type&&tL(e.expression)||"ParenthesizedExpression"===e.type&&tL(e.expression)}QD.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r,i=e.key;switch(i.type){case"Identifier":r=i.name;break;case"Literal":r=String(i.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===r&&"init"===s&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=i.start):this.raiseRecoverable(i.start,"Redefinition of __proto__ property")),t.proto=!0);else{var o=t[r="$"+r];if(o)("init"===s?this.strict&&o.init||o.get||o.set:o.init||o[s])&&this.raiseRecoverable(i.start,"Redefinition of property");else o=t[r]={init:!1,get:!1,set:!1};o[s]=!0}}},QD.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===uD.comma){var s=this.startNodeAt(n,r);for(s.expressions=[i];this.eat(uD.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return i},QD.parseMaybeAssign=function(e,t,n){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,s=-1,o=-1;t?(i=t.parenthesizedAssign,s=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new BD,r=!0);var a=this.start,l=this.startLoc;this.type!==uD.parenL&&this.type!==uD.name||(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===e);var c=this.parseMaybeConditional(e,t);if(n&&(c=n.call(this,c,a,l)),this.type.isAssign){var d=this.startNodeAt(a,l);return d.operator=this.value,this.type===uD.eq&&(c=this.toAssignable(c,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===uD.eq?this.checkLValPattern(c):this.checkLValSimple(c),d.left=c,this.next(),d.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(d,"AssignmentExpression")}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),s>-1&&(t.trailingComma=s),c},QD.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(uD.question)){var s=this.startNodeAt(n,r);return s.test=i,s.consequent=this.parseMaybeAssign(),this.expect(uD.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return i},QD.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&"ArrowFunctionExpression"===i.type?i:this.parseExprOp(i,n,r,-1,e)},QD.parseExprOp=function(e,t,n,r,i){var s=this.type.binop;if(null!=s&&(!i||this.type!==uD._in)&&s>r){var o=this.type===uD.logicalOR||this.type===uD.logicalAND,a=this.type===uD.coalesce;a&&(s=uD.logicalAND.binop);var l=this.value;this.next();var c=this.start,d=this.startLoc,h=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),c,d,s,i),u=this.buildBinary(t,n,e,h,l,o||a);return(o&&this.type===uD.coalesce||a&&(this.type===uD.logicalOR||this.type===uD.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(u,t,n,r,i)}return e},QD.buildBinary=function(e,t,n,r,i,s){"PrivateIdentifier"===r.type&&this.raise(r.start,"Private identifier can only be left side of binary expression");var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,s?"LogicalExpression":"BinaryExpression")},QD.parseMaybeUnary=function(e,t,n,r){var i,s=this.start,o=this.startLoc;if(this.isContextual("await")&&this.canAwait)i=this.parseAwait(r),t=!0;else if(this.type.prefix){var a=this.startNode(),l=this.type===uD.incDec;a.operator=this.value,a.prefix=!0,this.next(),a.argument=this.parseMaybeUnary(null,!0,l,r),this.checkExpressionErrors(e,!0),l?this.checkLValSimple(a.argument):this.strict&&"delete"===a.operator&&eL(a.argument)?this.raiseRecoverable(a.start,"Deleting local variable in strict mode"):"delete"===a.operator&&tL(a.argument)?this.raiseRecoverable(a.start,"Private fields can not be deleted"):t=!0,i=this.finishNode(a,l?"UpdateExpression":"UnaryExpression")}else if(t||this.type!==uD.privateId){if(i=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(s,o);c.operator=this.value,c.prefix=!1,c.argument=i,this.checkLValSimple(i),this.next(),i=this.finishNode(c,"UpdateExpression")}}else(r||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),i=this.parsePrivateIdent(),this.type!==uD._in&&this.unexpected();return n||!this.eat(uD.starstar)?i:t?void this.unexpected(this.lastTokStart):this.buildBinary(s,o,i,this.parseMaybeUnary(null,!1,!1,r),"**",!1)},QD.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if("ArrowFunctionExpression"===i.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return i;var s=this.parseSubscripts(i,n,r,!1,t);return e&&"MemberExpression"===s.type&&(e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),s},QD.parseSubscripts=function(e,t,n,r,i){for(var s=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start==5&&this.potentialArrowAt===e.start,o=!1;;){var a=this.parseSubscript(e,t,n,r,s,o,i);if(a.optional&&(o=!0),a===e||"ArrowFunctionExpression"===a.type){if(o){var l=this.startNodeAt(t,n);l.expression=a,a=this.finishNode(l,"ChainExpression")}return a}e=a}},QD.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(uD.arrow)},QD.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},QD.parseSubscript=function(e,t,n,r,i,s,o){var a=this.options.ecmaVersion>=11,l=a&&this.eat(uD.questionDot);r&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(uD.bracketL);if(c||l&&this.type!==uD.parenL&&this.type!==uD.backQuote||this.eat(uD.dot)){var d=this.startNodeAt(t,n);d.object=e,c?(d.property=this.parseExpression(),this.expect(uD.bracketR)):this.type===uD.privateId&&"Super"!==e.type?d.property=this.parsePrivateIdent():d.property=this.parseIdent("never"!==this.options.allowReserved),d.computed=!!c,a&&(d.optional=l),e=this.finishNode(d,"MemberExpression")}else if(!r&&this.eat(uD.parenL)){var h=new BD,u=this.yieldPos,p=this.awaitPos,f=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var m=this.parseExprList(uD.parenR,this.options.ecmaVersion>=8,!1,h);if(i&&!l&&this.shouldParseAsyncArrow())return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=u,this.awaitPos=p,this.awaitIdentPos=f,this.parseSubscriptAsyncArrow(t,n,m,o);this.checkExpressionErrors(h,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=f||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=m,a&&(g.optional=l),e=this.finishNode(g,"CallExpression")}else if(this.type===uD.backQuote){(l||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var y=this.startNodeAt(t,n);y.tag=e,y.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(y,"TaggedTemplateExpression")}return e},QD.parseExprAtom=function(e,t,n){this.type===uD.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case uD._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type!==uD.parenL||this.allowDirectSuper||this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==uD.dot&&this.type!==uD.bracketL&&this.type!==uD.parenL&&this.unexpected(),this.finishNode(r,"Super");case uD._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case uD.name:var s=this.start,o=this.startLoc,a=this.containsEsc,l=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&"async"===l.name&&!this.canInsertSemicolon()&&this.eat(uD._function))return this.overrideContext(ZD.f_expr),this.parseFunction(this.startNodeAt(s,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(uD.arrow))return this.parseArrowExpression(this.startNodeAt(s,o),[l],!1,t);if(this.options.ecmaVersion>=8&&"async"===l.name&&this.type===uD.name&&!a&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return l=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(uD.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,o),[l],!0,t)}return l;case uD.regexp:var c=this.value;return(r=this.parseLiteral(c.value)).regex={pattern:c.pattern,flags:c.flags},r;case uD.num:case uD.string:return this.parseLiteral(this.value);case uD._null:case uD._true:case uD._false:return(r=this.startNode()).value=this.type===uD._null?null:this.type===uD._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case uD.parenL:var d=this.start,h=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(h)&&(e.parenthesizedAssign=d),e.parenthesizedBind<0&&(e.parenthesizedBind=d)),h;case uD.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(uD.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case uD.braceL:return this.overrideContext(ZD.b_expr),this.parseObj(!1,e);case uD._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case uD._class:return this.parseClass(this.startNode(),!1);case uD._new:return this.parseNew();case uD.backQuote:return this.parseTemplate();case uD._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},QD.parseExprAtomDefault=function(){this.unexpected()},QD.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===uD.parenL&&!e)return this.parseDynamicImport(t);if(this.type===uD.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name="import",t.meta=this.finishNode(n,"Identifier"),this.parseImportMeta(t)}this.unexpected()},QD.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(uD.parenR)){var t=this.start;this.eat(uD.comma)&&this.eat(uD.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},QD.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},QD.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},QD.parseParenExpression=function(){this.expect(uD.parenL);var e=this.parseExpression();return this.expect(uD.parenR),e},QD.shouldParseArrow=function(e){return!this.canInsertSemicolon()},QD.parseParenAndDistinguishExpression=function(e,t){var n,r=this.start,i=this.startLoc,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o,a=this.start,l=this.startLoc,c=[],d=!0,h=!1,u=new BD,p=this.yieldPos,f=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==uD.parenR;){if(d?d=!1:this.expect(uD.comma),s&&this.afterTrailingComma(uD.parenR,!0)){h=!0;break}if(this.type===uD.ellipsis){o=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===uD.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,u,this.parseParenItem))}var m=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(uD.parenR),e&&this.shouldParseArrow(c)&&this.eat(uD.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=f,this.parseParenArrowList(r,i,c,t);c.length&&!h||this.unexpected(this.lastTokStart),o&&this.unexpected(o),this.checkExpressionErrors(u,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=f||this.awaitPos,c.length>1?((n=this.startNodeAt(a,l)).expressions=c,this.finishNodeAt(n,"SequenceExpression",m,g)):n=c[0]}else n=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(r,i);return y.expression=n,this.finishNode(y,"ParenthesizedExpression")}return n},QD.parseParenItem=function(e){return e},QD.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var nL=[];QD.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===uD.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),this.eat(uD.parenL)?e.arguments=this.parseExprList(uD.parenR,this.options.ecmaVersion>=8,!1):e.arguments=nL,this.finishNode(e,"NewExpression")},QD.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===uD.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===uD.backQuote,this.finishNode(n,"TemplateElement")},QD.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===uD.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(uD.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(uD.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},QD.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===uD.name||this.type===uD.num||this.type===uD.string||this.type===uD.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===uD.star)&&!pD.test(this.input.slice(this.lastTokEnd,this.start))},QD.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(uD.braceR);){if(r)r=!1;else if(this.expect(uD.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(uD.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,i,t),n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},QD.parseProperty=function(e,t){var n,r,i,s,o=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(uD.ellipsis))return e?(o.argument=this.parseIdent(!1),this.type===uD.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(o,"RestElement")):(o.argument=this.parseMaybeAssign(!1,t),this.type===uD.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(o,"SpreadElement"));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(e||t)&&(i=this.start,s=this.startLoc),e||(n=this.eat(uD.star)));var a=this.containsEsc;return this.parsePropertyName(o),!e&&!a&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(o)?(r=!0,n=this.options.ecmaVersion>=9&&this.eat(uD.star),this.parsePropertyName(o)):r=!1,this.parsePropertyValue(o,e,n,r,i,s,t,a),this.finishNode(o,"Property")},QD.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t="get"===e.kind?0:1;if(e.value.params.length!==t){var n=e.value.start;"get"===e.kind?this.raiseRecoverable(n,"getter should have no params"):this.raiseRecoverable(n,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},QD.parsePropertyValue=function(e,t,n,r,i,s,o,a){(n||r)&&this.type===uD.colon&&this.unexpected(),this.eat(uD.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===uD.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,r)):t||a||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===uD.comma||this.type===uD.braceR||this.type===uD.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=i),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,this.copyNode(e.key)):this.type===uD.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected():((n||r)&&this.unexpected(),this.parseGetterSetter(e))},QD.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(uD.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(uD.bracketR),e.key;e.computed=!1}return e.key=this.type===uD.num||this.type===uD.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},QD.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},QD.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|DD(t,r.generator)|(n?128:0)),this.expect(uD.parenL),r.params=this.parseBindingList(uD.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(r,"FunctionExpression")},QD.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(16|DD(n,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")},QD.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==uD.braceL,s=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);s&&!a||(o=this.strictDirective(this.end))&&a&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var l=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!s&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,o&&!s),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()},QD.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1){if("Identifier"!==n[t].type)return!1}return!0},QD.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var s=i[r];this.checkLValInnerPattern(s,1,t?null:n)}},QD.parseExprList=function(e,t,n,r){for(var i=[],s=!0;!this.eat(e);){if(s)s=!1;else if(this.expect(uD.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===uD.comma?o=null:this.type===uD.ellipsis?(o=this.parseSpread(r),r&&this.type===uD.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},QD.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;(this.inGenerator&&"yield"===r&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===r&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&"arguments"===r&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),!this.inClassStaticBlock||"arguments"!==r&&"await"!==r||this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,n).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(this.inAsync||"await"!==r||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"))},QD.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),"await"!==t.name||this.awaitIdentPos||(this.awaitIdentPos=t.start)),t},QD.parseIdentNode=function(){var e=this.startNode();return this.type===uD.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,"class"!==e.name&&"function"!==e.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop(),this.type=uD.name):this.unexpected(),e},QD.parsePrivateIdent=function(){var e=this.startNode();return this.type===uD.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},QD.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===uD.semi||this.canInsertSemicolon()||this.type!==uD.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(uD.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},QD.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var rL=LD.prototype;rL.raise=function(e,t){var n=ID(this.input,e);t+=" ("+n.line+":"+n.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},rL.raiseRecoverable=rL.raise,rL.curPosition=function(){if(this.options.locations)return new TD(this.curLine,this.pos-this.lineStart)};var iL=LD.prototype,sL=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};iL.enterScope=function(e){this.scopeStack.push(new sL(e))},iL.exitScope=function(){this.scopeStack.pop()},iL.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},iL.declareName=function(e,t,n){var r=!1;if(2===t){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&1&i.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var s=this.currentScope();r=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var a=this.scopeStack[o];if(a.lexical.indexOf(e)>-1&&!(32&a.flags&&a.lexical[0]===e)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(e)>-1){r=!0;break}if(a.var.push(e),this.inModule&&1&a.flags&&delete this.undefinedExports[e],259&a.flags)break}r&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")},iL.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},iL.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},iL.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(259&t.flags)return t}},iL.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(259&t.flags&&!(16&t.flags))return t}};var oL=function(e,t,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new PD(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},aL=LD.prototype;function lL(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}aL.startNode=function(){return new oL(this,this.start,this.startLoc)},aL.startNodeAt=function(e,t){return new oL(this,e,t)},aL.finishNode=function(e,t){return lL.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},aL.finishNodeAt=function(e,t,n,r){return lL.call(this,e,t,n,r)},aL.copyNode=function(e){var t=new oL(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var cL="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",dL=cL+" Extended_Pictographic",hL=dL+" EBase EComp EMod EPres ExtPict",uL={9:cL,10:dL,11:dL,12:hL,13:hL,14:hL},pL={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},fL="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",mL="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",gL=mL+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",yL=gL+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",vL=yL+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",bL=vL+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",wL={9:mL,10:gL,11:yL,12:vL,13:bL,14:bL+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz"},xL={};function EL(e){var t=xL[e]={binary:_D(uL[e]+" "+fL),binaryOfStrings:_D(pL[e]),nonBinary:{General_Category:_D(fL),Script:_D(wL[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var CL=0,SL=[9,10,11,12,13,14];CL<SL.length;CL+=1){EL(SL[CL])}var _L=LD.prototype,kL=function(e,t){this.parent=e,this.base=t||this};kL.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},kL.prototype.sibling=function(){return new kL(this.parent,this.base)};var OL=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=xL[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function TL(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function PL(e){return e>=65&&e<=90||e>=97&&e<=122}OL.prototype.reset=function(e,t,n){var r=-1!==n.indexOf("v"),i=-1!==n.indexOf("u");this.start=0|e,this.source=t+"",this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},OL.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},OL.prototype.at=function(e,t){void 0===t&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!t&&!this.switchU||i<=55295||i>=57344||e+1>=r)return i;var s=n.charCodeAt(e+1);return s>=56320&&s<=57343?(i<<10)+s-56613888:i},OL.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i,s=n.charCodeAt(e);return!t&&!this.switchU||s<=55295||s>=57344||e+1>=r||(i=n.charCodeAt(e+1))<56320||i>57343?e+1:e+2},OL.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},OL.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},OL.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},OL.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},OL.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var s=i[r],o=this.at(n,t);if(-1===o||o!==s)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},_L.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,s=0;s<n.length;s++){var o=n.charAt(s);-1===t.indexOf(o)&&this.raise(e.start,"Invalid regular expression flag"),n.indexOf(o,s+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===o&&(r=!0),"v"===o&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,"Invalid regular expression flag")},_L.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&function(e){for(var t in e)return!0;return!1}(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},_L.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise("Invalid named capture referenced")}},_L.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new kL(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},_L.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},_L.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},_L.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},_L.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},_L.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},_L.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return-1!==i&&i<r&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=n}return!1},_L.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},_L.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},_L.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1},_L.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},_L.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},_L.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},_L.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!TL(t)&&(e.lastIntValue=t,e.advance(),!0)},_L.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;-1!==(n=e.current())&&!TL(n);)e.advance();return e.pos!==t},_L.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},_L.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var r=0,i=n;r<i.length;r+=1){i[r].separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},_L.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},_L.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=kD(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=kD(e.lastIntValue);return!0}return!1},_L.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),function(e){return iD(e,!0)||36===e||95===e}(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)},_L.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),function(e){return sD(e,!0)||36===e||95===e||8204===e||8205===e}(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)},_L.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},_L.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},_L.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},_L.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},_L.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},_L.regexp_eatZero=function(e){return 48===e.current()&&!RL(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},_L.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},_L.regexp_eatControlLetter=function(e){var t=e.current();return!!PL(t)&&(e.lastIntValue=t%32,e.advance(),!0)},_L.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var n,r=e.pos,i=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(i&&s>=55296&&s<=56319){var o=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=1024*(s-55296)+(a-56320)+65536,!0}e.pos=o,e.lastIntValue=s}return!0}if(i&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((n=e.lastIntValue)>=0&&n<=1114111))return!0;i&&e.raise("Invalid unicode escape"),e.pos=r}return!1},_L.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},_L.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};function IL(e){return PL(e)||95===e}function ML(e){return IL(e)||RL(e)}function RL(e){return e>=48&&e<=57}function AL(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function NL(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function DL(e){return e>=48&&e<=55}_L.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),1;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=80===t)||112===t)){var r;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&2===r&&e.raise("Invalid property name"),r;e.raise("Invalid property name")}return 0},_L.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),1}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return 0},_L.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){ED(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")},_L.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise("Invalid property name")},_L.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";IL(t=e.current());)e.lastStringValue+=kD(t),e.advance();return""!==e.lastStringValue},_L.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";ML(t=e.current());)e.lastStringValue+=kD(t),e.advance();return""!==e.lastStringValue},_L.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},_L.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&2===n&&e.raise("Negated character class may contain strings"),!0}return!1},_L.regexp_classContents=function(e){return 93===e.current()?1:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),1)},_L.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;!e.switchU||-1!==t&&-1!==n||e.raise("Invalid character class"),-1!==t&&-1!==n&&t>n&&e.raise("Range out of order in character class")}}},_L.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(99===n||DL(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return 93!==r&&(e.lastIntValue=r,e.advance(),!0)},_L.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},_L.regexp_classSetExpression=function(e){var t,n=1;if(this.regexp_eatClassSetRange(e));else if(t=this.regexp_eatClassSetOperand(e)){2===t&&(n=2);for(var r=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?2!==t&&(n=1):e.raise("Invalid character in character class");if(r!==e.pos)return n;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return n}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return n;2===t&&(n=2)}},_L.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return-1!==n&&-1!==r&&n>r&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},_L.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?1:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},_L.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&2===r&&e.raise("Negated character class may contain strings"),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},_L.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise("Invalid escape");e.pos=t}return null},_L.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)2===this.regexp_classString(e)&&(t=2);return t},_L.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?1:2},_L.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e))||(e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1));var n=e.current();return!(n<0||n===e.lookahead()&&function(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}(n))&&(!function(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}(n)&&(e.advance(),e.lastIntValue=n,!0))},_L.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!function(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}(t)&&(e.lastIntValue=t,e.advance(),!0)},_L.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!RL(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},_L.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},_L.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;RL(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t},_L.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;AL(n=e.current());)e.lastIntValue=16*e.lastIntValue+NL(n),e.advance();return e.pos!==t},_L.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*n+e.lastIntValue:e.lastIntValue=8*t+n}else e.lastIntValue=t;return!0}return!1},_L.regexp_eatOctalDigit=function(e){var t=e.current();return DL(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},_L.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!AL(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+NL(i),e.advance()}return!0};var LL=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new PD(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},FL=LD.prototype;function jL(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}FL.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new LL(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},FL.getToken=function(){return this.next(),new LL(this)},"undefined"!=typeof Symbol&&(FL[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===uD.eof,value:t}}}}),FL.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(uD.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},FL.readToken=function(e){return iD(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},FL.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},FL.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=gD(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},FL.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!mD(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},FL.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&yD.test(String.fromCharCode(e))))break e;++this.pos}}},FL.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},FL.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(uD.ellipsis)):(++this.pos,this.finishToken(uD.dot))},FL.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(uD.assign,2):this.finishOp(uD.slash,1)},FL.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=42===e?uD.star:uD.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++n,r=uD.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(uD.assign,n+1):this.finishOp(r,n)},FL.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(uD.assign,3);return this.finishOp(124===e?uD.logicalOR:uD.logicalAND,2)}return 61===t?this.finishOp(uD.assign,2):this.finishOp(124===e?uD.bitwiseOR:uD.bitwiseAND,1)},FL.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(uD.assign,2):this.finishOp(uD.bitwiseXOR,1)},FL.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!pD.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(uD.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(uD.assign,2):this.finishOp(uD.plusMin,1)},FL.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(uD.assign,n+1):this.finishOp(uD.bitShift,n)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(n=2),this.finishOp(uD.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},FL.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(uD.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(uD.arrow)):this.finishOp(61===e?uD.eq:uD.prefix,1)},FL.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(uD.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(uD.assign,3);return this.finishOp(uD.coalesce,2)}}return this.finishOp(uD.question,1)},FL.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,iD(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(uD.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+kD(e)+"'")},FL.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(uD.parenL);case 41:return++this.pos,this.finishToken(uD.parenR);case 59:return++this.pos,this.finishToken(uD.semi);case 44:return++this.pos,this.finishToken(uD.comma);case 91:return++this.pos,this.finishToken(uD.bracketL);case 93:return++this.pos,this.finishToken(uD.bracketR);case 123:return++this.pos,this.finishToken(uD.braceL);case 125:return++this.pos,this.finishToken(uD.braceR);case 58:return++this.pos,this.finishToken(uD.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(uD.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(uD.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+kD(e)+"'")},FL.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},FL.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(pD.test(r)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===r)t=!0;else if("]"===r&&t)t=!1;else if("/"===r&&!t)break;e="\\"===r}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var s=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(s);var a=this.regexpState||(this.regexpState=new OL(this));a.reset(n,i,o),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var l=null;try{l=new RegExp(i,o)}catch(e){}return this.finishToken(uD.regexp,{pattern:i,flags:o,value:l})},FL.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&void 0===t,i=n&&48===this.input.charCodeAt(this.pos),s=this.pos,o=0,a=0,l=0,c=null==t?1/0:t;l<c;++l,++this.pos){var d=this.input.charCodeAt(this.pos),h=void 0;if(r&&95===d)i&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===a&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===l&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),a=d;else{if((h=d>=97?d-97+10:d>=65?d-65+10:d>=48&&d<=57?d-48:1/0)>=e)break;a=d,o=o*e+h}}return r&&95===a&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||null!=t&&this.pos-s!==t?null:o},FL.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return null==n&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(n=jL(this.input.slice(t,this.pos)),++this.pos):iD(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(uD.num,n)},FL.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var n=this.pos-t>=2&&48===this.input.charCodeAt(t);n&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&110===r){var i=jL(this.input.slice(t,this.pos));return++this.pos,iD(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(uD.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),46!==r||n||(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),69!==r&&101!==r||n||(43!==(r=this.input.charCodeAt(++this.pos))&&45!==r||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),iD(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s,o=(s=this.input.slice(t,this.pos),n?parseInt(s,8):parseFloat(s.replace(/_/g,"")));return this.finishToken(uD.num,o)},FL.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},FL.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;92===r?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):8232===r||8233===r?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(mD(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(uD.string,t)};var $L={};FL.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==$L)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},FL.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw $L;this.raise(e,t)},FL.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==uD.template&&this.type!==uD.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(uD.template,e)):36===n?(this.pos+=2,this.finishToken(uD.dollarBraceL)):(++this.pos,this.finishToken(uD.backQuote));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(mD(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},FL.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(uD.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},FL.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return kD(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),"0"===r&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return mD(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},FL.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.invalidStringToken(t,"Bad character escape sequence"),n},FL.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(sD(i,r))this.pos+=i<=65535?1:2;else{if(92!==i)break;this.containsEsc=!0,e+=this.input.slice(n,this.pos);var s=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var o=this.readCodePoint();(t?iD:sD)(o,r)||this.invalidStringToken(s,"Invalid Unicode escape"),e+=kD(o),n=this.pos}t=!1}return e+this.input.slice(n,this.pos)},FL.readWord=function(){var e=this.readWord1(),t=uD.name;return this.keywords.test(e)&&(t=dD[e]),this.finishToken(t,e)};LD.acorn={Parser:LD,version:"8.12.1",defaultOptions:MD,Position:TD,SourceLocation:PD,getLineInfo:ID,Node:oL,TokenType:oD,tokTypes:uD,keywordTypes:dD,TokContext:YD,tokContexts:ZD,isIdentifierChar:sD,isIdentifierStart:iD,Token:LL,isNewLine:mD,lineBreak:pD,lineBreakG:fD,nonASCIIwhitespace:yD};var BL=__webpack_require__("yBkX");const VL=QL(/[A-Za-z]/),zL=QL(/[\dA-Za-z]/),HL=QL(/[#-'*+\--9=?A-Z^-~]/);function UL(e){return null!==e&&(e<32||127===e)}const KL=QL(/\d/),WL=QL(/[\dA-Fa-f]/),GL=QL(/[!-/:-@[-`{-~]/);function qL(e){return null!==e&&e<-2}function XL(e){return null!==e&&(e<0||32===e)}function YL(e){return-2===e||-1===e||32===e}const ZL=QL(/\p{P}|\p{S}/u),JL=QL(/\s/);function QL(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function eF(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return function(r){if(YL(r))return e.enter(n),o(r);return t(r)};function o(r){return YL(r)&&s++<i?(e.consume(r),o):(e.exit(n),t(r))}}const tF={}.hasOwnProperty,nF=Symbol("continue"),rF=Symbol("exit"),iF=Symbol("skip");function sF(e){return Array.isArray(e)?e:"number"==typeof e?[nF,e]:[e]}function oF(e){return Boolean(e&&"object"==typeof e&&"type"in e&&"string"==typeof e.type&&e.type.length>0)}function aF(e,t){const n=t.prefix||"",r=t.suffix||"",i=Object.assign({},t.acornOptions),s=[],o=[],a=i.onComment,l=i.onToken;let c,d,h=!1;const u=Object.assign({},i,{onComment:s,preserveParens:!0});l&&(u.onToken=o);const p=function(e,t){const n={value:"",stops:[]};let r=-1;for(;++r<e.length;){const i=e[r];if("enter"===i[0]){const e=i[1].type;if("lineEnding"===e||t.includes(e)){const e=i[2].sliceStream(i[1]);for(;e.length>0&&-1===e[0];)e.shift();const t=cF(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}(e,t.tokenTypes),f=p.value,m=n+f+r,g=t.expression&&lF(f);if(g&&!t.allowEmpty)throw new eN("Unexpected empty expression",{place:v(0),ruleId:"unexpected-empty-expression",source:"micromark-extension-mdx-expression"});try{c=t.expression&&!g?t.acorn.parseExpressionAt(m,0,u):t.acorn.parse(m,u)}catch(e){const t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,""),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,h=t.raisedAt>=n.length+f.length||"Unterminated comment"===t.message}if(c&&t.expression&&!g)if(lF(m.slice(c.end,m.length-r.length)))c={type:"Program",start:0,end:n.length+f.length,body:[{type:"ExpressionStatement",expression:c,start:0,end:n.length+f.length}],sourceType:"module",comments:[]};else{const e=v(c.end),t=new Error("Unexpected content after expression");t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,c=void 0}if(c){if(c.comments=s,function(e,t){let n,r;"function"==typeof t?n=t:t&&"object"==typeof t&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),function e(t,i,s,o){return oF(t)&&(a.displayName="node ("+t.type+")"),a;function a(){const a=n?sF(n(t,i,s,o)):[];if(a[0]===rF)return a;if(a[0]!==iF){let n;for(n in t)if(tF.call(t,n)&&t[n]&&"object"==typeof t[n]&&"data"!==n&&"position"!==n){const r=o.concat(t),i=t[n];if(Array.isArray(i)){const t=i;let s=0;for(;s>-1&&s<t.length;){const i=t[s];if(oF(i)){const t=e(i,n,s,r)();if(t[0]===rF)return t;s="number"==typeof t[1]?t[1]:s+1}else s++}}else if(oF(i)){const t=e(i,n,void 0,r)();if(t[0]===rF)return t}}}return r?sF(r(t,i,s,o)):a}}(e,void 0,void 0,[])()}(c,(function(e,t,n,r){let i=r[r.length-1],s=t;"ParenthesizedExpression"===e.type&&i&&s&&("number"==typeof n&&(i=i[s],s=n),i[s]=e.expression),y(e)})),Array.isArray(a))a.push(...s);else if("function"==typeof a)for(const e of s)a("Block"===e.type,e.value,e.start,e.end,e.loc.start,e.loc.end);for(const e of o)e.end<=n.length||e.start-n.length>=f.length||(y(e),Array.isArray(l)?l.push(e):l(e))}return{estree:c,error:d,swallow:h};function y(e){const t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>f.length&&(r=f.length);let i=function(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(0===n)return;const[r,i]=e[n-1],s=t-r;return{line:i.line,column:i.column+s,offset:i.offset+s}}(p.stops,r);return i||(i={line:t.start.line,column:t.start.column,offset:t.start.offset}),i}}function lF(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,""))}function cF(e){let t=-1;const n=[];let r;for(;++t<e.length;){const i=e[t];let s;if("string"==typeof i)s=i;else switch(i){case-5:s="\r";break;case-4:s="\n";break;case-3:s="\r\n";break;case-2:s="\t";break;case-1:if(r)continue;s=" ";break;default:s=String.fromCharCode(i)}r=-2===i,n.push(s)}return n.join("")}function dF(e){const t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=hF(n.start,r[0]||t.start),s=hF(n.end,r[1]||t.end);if(i&&s)return{start:i,end:s}}function hF(e,t){if(e&&"object"==typeof e){const n="line"in e?uF(e.line):void 0,r="column"in e?uF(e.column):void 0;if(n&&void 0!==r)return{line:n,column:r+1,offset:uF(t)}}}function uF(e){return"number"==typeof e&&e>-1?e:void 0}const pF=2,fF="https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression",mF="#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-",gF="#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed",yF="#unexpected-type-in-code-expected-an-object-spread-spread",vF="#unexpected-extra-content-in-spread-only-a-single-spread-is-supported",bF="#could-not-parse-expression-with-acorn";function wF(e,t,n,r,i,s,o,a,l,c,d){const h=this,u=this.events.length+3;let p,f,m=0;return function(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),p=h.now(),g};function g(d){if(null===d){if(f)throw f;const e=new eN("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:h.now(),ruleId:"unexpected-eof",source:"micromark-extension-mdx-expression"});throw e.url=fF+mF,e}if(qL(d))return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),v;if(125===d&&0===m){const m=s?xF.call(h,s,o,i,u,p,c||!1,l||!1):{type:"ok",estree:void 0};if("ok"===m.type){e.enter(r),e.consume(d),e.exit(r);const i=e.exit(n);return a&&m.estree&&Object.assign(i,{estree:m.estree}),t}return f=m.message,e.enter(i),e.consume(d),y}return e.enter(i),y(d)}function y(t){return 125===t&&0===m||null===t||qL(t)?(e.exit(i),g(t)):(123!==t||s?125===t&&(m-=1):m+=1,e.consume(t),y)}function v(t){const n=h.now();if(n.line!==p.line&&!d&&h.parser.lazy[n.line]){const e=new eN("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:h.now(),ruleId:"unexpected-lazy",source:"micromark-extension-mdx-expression"});throw e.url=fF+gF,e}return YL(t)?eF(e,g,"linePrefix",pF+1)(t):g(t)}}function xF(e,t,n,r,i,s,o){const a=aF(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:s,prefix:o?"({":"",suffix:o?"})":""}),l=a.estree;if(o&&l){const e=l.body[0];if("ExpressionStatement"!==e.type||"ObjectExpression"!==e.expression.type){const t=dF(e),n=new eN("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw n.url=fF+yF,n}if(e.expression.properties[1]){const t=dF(e.expression.properties[1]),n=new eN("Unexpected extra content in spread: only a single spread is supported",{place:t.start,ruleId:"spread-extra",source:"micromark-extension-mdx-expression"});throw n.url=fF+vF,n}if(e.expression.properties[0]&&"SpreadElement"!==e.expression.properties[0].type){const t=dF(e.expression.properties[0]),n=new eN("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw n.url=fF+yF,n}}if(a.error){const e=new eN("Could not parse expression with acorn",{cause:a.error,place:{line:a.error.loc.line,column:a.error.loc.column+1,offset:a.error.pos},ruleId:"acorn",source:"micromark-extension-mdx-expression"});return e.url=fF+bF,{type:"nok",message:e}}return{type:"ok",estree:l}}function EF(e){const t=e||{},n=t.addResult,r=t.acorn,i=t.spread;let s,o=t.allowEmpty;if(null==o&&(o=!0),r){if(!r.parseExpressionAt)throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");s=Object.assign({ecmaVersion:2024,sourceType:"module"},t.acornOptions)}else if(t.acornOptions||t.addResult)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:"mdxFlowExpression",tokenize:function(e,t,a){const l=this;return function(t){return function(t){return wF.call(l,e,c,"mdxFlowExpression","mdxFlowExpressionMarker","mdxFlowExpressionChunk",r,s,n,i,o)(t)}(t)};function c(t){return YL(t)?eF(e,d,"whitespace")(t):d(t)}function d(n){const r=l.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find((function(e){return"mdxJsxFlowTag"===e.name}));return 60===n&&i?e.attempt(i,d,a)(n):null===n||qL(n)?t(n):a(n)}},concrete:!0}},text:{123:{name:"mdxTextExpression",tokenize:function(e,t){const a=this;return function(l){return wF.call(a,e,t,"mdxTextExpression","mdxTextExpressionMarker","mdxTextExpressionChunk",r,s,n,i,o,!0)(l)}}}}}}const CF=/[$_\p{ID_Start}]/u,SF=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,_F=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,kF=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OF=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TF={};function PF(e){return!!e&&CF.test(String.fromCodePoint(e))}function IF(e,t){const n=(t||TF).jsx?_F:SF;return!!e&&n.test(String.fromCodePoint(e))}function MF(e,t){return((t||TF).jsx?OF:kF).test(e)}const RF=2,AF="https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression",NF="#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-",DF="#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed",LF="#unexpected-type-in-code-expected-an-object-spread-spread",FF="#unexpected-extra-content-in-spread-only-a-single-spread-is-supported",jF="#could-not-parse-expression-with-acorn";function $F(e,t,n,r,i,s,o,a,l,c,d){const h=this,u=this.events.length+3;let p,f,m=0;return function(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),p=h.now(),g};function g(d){if(null===d){if(f)throw f;const e=new eN("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:h.now(),ruleId:"unexpected-eof",source:"micromark-extension-mdx-expression"});throw e.url=AF+NF,e}if(qL(d))return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),v;if(125===d&&0===m){const m=s?BF.call(h,s,o,i,u,p,c||!1,l||!1):{type:"ok",estree:void 0};if("ok"===m.type){e.enter(r),e.consume(d),e.exit(r);const i=e.exit(n);return a&&m.estree&&Object.assign(i,{estree:m.estree}),t}return f=m.message,e.enter(i),e.consume(d),y}return e.enter(i),y(d)}function y(t){return 125===t&&0===m||null===t||qL(t)?(e.exit(i),g(t)):(123!==t||s?125===t&&(m-=1):m+=1,e.consume(t),y)}function v(t){const n=h.now();if(n.line!==p.line&&!d&&h.parser.lazy[n.line]){const e=new eN("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:h.now(),ruleId:"unexpected-lazy",source:"micromark-extension-mdx-expression"});throw e.url=AF+DF,e}return YL(t)?eF(e,g,"linePrefix",RF+1)(t):g(t)}}function BF(e,t,n,r,i,s,o){const a=aF(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:s,prefix:o?"({":"",suffix:o?"})":""}),l=a.estree;if(o&&l){const e=l.body[0];if("ExpressionStatement"!==e.type||"ObjectExpression"!==e.expression.type){const t=dF(e),n=new eN("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw n.url=AF+LF,n}if(e.expression.properties[1]){const t=dF(e.expression.properties[1]),n=new eN("Unexpected extra content in spread: only a single spread is supported",{place:t.start,ruleId:"spread-extra",source:"micromark-extension-mdx-expression"});throw n.url=AF+FF,n}if(e.expression.properties[0]&&"SpreadElement"!==e.expression.properties[0].type){const t=dF(e.expression.properties[0]),n=new eN("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw n.url=AF+LF,n}}if(a.error){const e=new eN("Could not parse expression with acorn",{cause:a.error,place:{line:a.error.loc.line,column:a.error.loc.column+1,offset:a.error.pos},ruleId:"acorn",source:"micromark-extension-mdx-expression"});return e.url=AF+jF,{type:"nok",message:e}}return{type:"ok",estree:l}}const VF="https://github.com/micromark/micromark-extension-mdx-jsx";function zF(e,t,n,r,i,s,o,a,l,c,d,h,u,p,f,m,g,y,v,b,w,x,E,C,S,_,k,O,T,P,I,M){const R=this;let A,N;return function(t){return e.enter(a),e.enter(l),e.consume(t),e.exit(l),D};function D(e){return XL(e)?n(e):(A=L,se(e))}function L(t){return 47===t?(e.enter(c),e.consume(t),e.exit(c),A=F,se):62===t?ie(t):null!==t&&t>=0&&PF(t)?(e.enter(h),e.enter(u),e.consume(t),j):void le(t,"before name","a character that can start a name, such as a letter, `$`, or `_`"+(33===t?" (note: to create a comment in MDX, use `{/* text */}`)":""))}function F(t){return 62===t?ie(t):null!==t&&t>=0&&PF(t)?(e.enter(h),e.enter(u),e.consume(t),j):void le(t,"before name","a character that can start a name, such as a letter, `$`, or `_`"+(42===t||47===t?" (note: JS comments in JSX tags are not supported in MDX)":""))}function j(t){return null!==t&&t>=0&&IF(t,{jsx:!0})?(e.consume(t),j):46===t||47===t||58===t||62===t||123===t||XL(t)||JL(t)?(e.exit(u),A=$,se(t)):void le(t,"in name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(64===t?" (note: to create a link in MDX, use `[text](url)`)":""))}function $(t){return 46===t?(e.enter(p),e.consume(t),e.exit(p),A=B,se):58===t?(e.enter(m),e.consume(t),e.exit(m),A=H,se):47===t||62===t||123===t||null!==t&&t>=0&&PF(t)?(e.exit(h),W(t)):void le(t,"after name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function B(t){if(null!==t&&t>=0&&PF(t))return e.enter(f),e.consume(t),V;le(t,"before member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function V(t){return null!==t&&t>=0&&IF(t,{jsx:!0})?(e.consume(t),V):46===t||47===t||62===t||123===t||XL(t)||JL(t)?(e.exit(f),A=z,se(t)):void le(t,"in member name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(64===t?" (note: to create a link in MDX, use `[text](url)`)":""))}function z(t){return 46===t?(e.enter(p),e.consume(t),e.exit(p),A=B,se):47===t||62===t||123===t||null!==t&&t>=0&&PF(t)?(e.exit(h),W(t)):void le(t,"after member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function H(t){if(null!==t&&t>=0&&PF(t))return e.enter(g),e.consume(t),U;le(t,"before local name","a character that can start a name, such as a letter, `$`, or `_`"+(43===t||null!==t&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":""))}function U(t){return null!==t&&t>=0&&IF(t,{jsx:!0})?(e.consume(t),U):47===t||62===t||123===t||XL(t)||JL(t)?(e.exit(g),A=K,se(t)):void le(t,"in local name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function K(t){if(47===t||62===t||123===t||null!==t&&t>=0&&PF(t))return e.exit(h),W(t);le(t,"after local name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function W(t){return 47===t?(e.enter(d),e.consume(t),e.exit(d),A=re,se):62===t?ie(t):123===t?$F.call(R,e,G,y,v,b,r,i,s,!0,!1,o)(t):null!==t&&t>=0&&PF(t)?(e.enter(w),e.enter(x),e.enter(E),e.consume(t),q):void le(t,"before attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function G(e){return A=W,se(e)}function q(t){return null!==t&&t>=0&&IF(t,{jsx:!0})?(e.consume(t),q):47===t||58===t||61===t||62===t||123===t||XL(t)||JL(t)?(e.exit(E),A=X,se(t)):void le(t,"in attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function X(t){return 58===t?(e.enter(C),e.consume(t),e.exit(C),A=Y,se):61===t?(e.exit(x),e.enter(_),e.consume(t),e.exit(_),A=Q,se):47===t||62===t||123===t||XL(t)||JL(t)||null!==t&&t>=0&&PF(t)?(e.exit(x),e.exit(w),A=W,se(t)):void le(t,"after attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Y(t){if(null!==t&&t>=0&&PF(t))return e.enter(S),e.consume(t),Z;le(t,"before local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Z(t){return null!==t&&t>=0&&IF(t,{jsx:!0})?(e.consume(t),Z):47===t||61===t||62===t||123===t||XL(t)||JL(t)?(e.exit(S),e.exit(x),A=J,se(t)):void le(t,"in local attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function J(t){return 61===t?(e.enter(_),e.consume(t),e.exit(_),A=Q,se):47===t||62===t||123===t||null!==t&&t>=0&&PF(t)?(e.exit(w),W(t)):void le(t,"after local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Q(t){return 34===t||39===t?(e.enter(k),e.enter(O),e.consume(t),e.exit(O),N=t,te):123===t?$F.call(R,e,ee,P,I,M,r,i,s,!1,!1,o)(t):void le(t,"before attribute value","a character that can start an attribute value, such as `\"`, `'`, or `{`"+(60===t?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":""))}function ee(t){return e.exit(w),A=W,se(t)}function te(t){return null===t&&le(t,"in attribute value","a corresponding closing quote `"+String.fromCodePoint(N)+"`"),t===N?(e.enter(O),e.consume(t),e.exit(O),e.exit(k),e.exit(w),N=void 0,A=W,se):qL(t)?(A=te,se(t)):(e.enter(T),ne(t))}function ne(t){return null===t||t===N||qL(t)?(e.exit(T),te(t)):(e.consume(t),ne)}function re(e){if(62===e)return ie(e);le(e,"after self-closing slash","`>` to end the tag"+(42===e||47===e?" (note: JS comments in JSX tags are not supported in MDX)":""))}function ie(n){return e.enter(l),e.consume(n),e.exit(l),e.exit(a),t}function se(t){return qL(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),ae):YL(t)||JL(t)?(e.enter("esWhitespace"),oe(t)):A(t)}function oe(t){return qL(t)?(e.exit("esWhitespace"),se(t)):YL(t)||JL(t)?(e.consume(t),oe):(e.exit("esWhitespace"),A(t))}function ae(e){if(!o&&R.parser.lazy[R.now().line]){const e=new eN("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",R.now(),"micromark-extension-mdx-jsx:unexpected-lazy");throw e.url=VF+"#unexpected-lazy-line-in-container-expected-line-to-be",e}return se(e)}function le(e,t,n){const r=new eN("Unexpected "+(null===e?"end of file":"character `"+(96===e?"` ` `":String.fromCodePoint(e))+"` ("+function(e){return"U+"+e.toString(16).toUpperCase().padStart(4,"0")}(e)+")")+" "+t+", expected "+n,R.now(),"micromark-extension-mdx-jsx:unexpected-"+(null===e?"eof":"character"));throw r.url=VF+(null===e?"#unexpected-end-of-file-at-expected-expect":"#unexpected-character-at-expected-expect"),r}}function HF(e,t){return{name:"mdxJsxTextTag",tokenize:function(n,r,i){return zF.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,"mdxJsxTextTag","mdxJsxTextTagMarker","mdxJsxTextTagClosingMarker","mdxJsxTextTagSelfClosingMarker","mdxJsxTextTagName","mdxJsxTextTagNamePrimary","mdxJsxTextTagNameMemberMarker","mdxJsxTextTagNameMember","mdxJsxTextTagNamePrefixMarker","mdxJsxTextTagNameLocal","mdxJsxTextTagExpressionAttribute","mdxJsxTextTagExpressionAttributeMarker","mdxJsxTextTagExpressionAttributeValue","mdxJsxTextTagAttribute","mdxJsxTextTagAttributeName","mdxJsxTextTagAttributeNamePrimary","mdxJsxTextTagAttributeNamePrefixMarker","mdxJsxTextTagAttributeNameLocal","mdxJsxTextTagAttributeInitializerMarker","mdxJsxTextTagAttributeValueLiteral","mdxJsxTextTagAttributeValueLiteralMarker","mdxJsxTextTagAttributeValueLiteralValue","mdxJsxTextTagAttributeValueExpression","mdxJsxTextTagAttributeValueExpressionMarker","mdxJsxTextTagAttributeValueExpressionValue")}}}function UF(e,t){return{name:"mdxJsxFlowTag",tokenize:function(n,r,i){const s=this;return o;function o(r){return function(r){return zF.call(s,n,a,i,e,t.acornOptions,t.addResult,!1,"mdxJsxFlowTag","mdxJsxFlowTagMarker","mdxJsxFlowTagClosingMarker","mdxJsxFlowTagSelfClosingMarker","mdxJsxFlowTagName","mdxJsxFlowTagNamePrimary","mdxJsxFlowTagNameMemberMarker","mdxJsxFlowTagNameMember","mdxJsxFlowTagNamePrefixMarker","mdxJsxFlowTagNameLocal","mdxJsxFlowTagExpressionAttribute","mdxJsxFlowTagExpressionAttributeMarker","mdxJsxFlowTagExpressionAttributeValue","mdxJsxFlowTagAttribute","mdxJsxFlowTagAttributeName","mdxJsxFlowTagAttributeNamePrimary","mdxJsxFlowTagAttributeNamePrefixMarker","mdxJsxFlowTagAttributeNameLocal","mdxJsxFlowTagAttributeInitializerMarker","mdxJsxFlowTagAttributeValueLiteral","mdxJsxFlowTagAttributeValueLiteralMarker","mdxJsxFlowTagAttributeValueLiteralValue","mdxJsxFlowTagAttributeValueExpression","mdxJsxFlowTagAttributeValueExpressionMarker","mdxJsxFlowTagAttributeValueExpressionValue")(r)}(r)}function a(e){return YL(e)?eF(n,l,"whitespace")(e):l(e)}function l(e){const t=s.parser.constructs.flow[123],a=(Array.isArray(t)?t:t?[t]:[]).find((e=>"mdxFlowExpression"===e.name));return 60===e?o(e):123===e&&a?n.attempt(a,l,i)(e):null===e||qL(e)?r(e):i(e)}},concrete:!0}}function KF(e){const t=e||{},n=t.acorn;let r;if(n){if(!n.parse||!n.parseExpressionAt)throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:"module"},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:UF(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:HF(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}const WF={tokenize:function(e,t,n){return function(t){return YL(t)?eF(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||qL(e)?t(e):n(e)}},partial:!0};const GF={tokenize:function(e,t,n){return function(r){return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),e.attempt(WF,t,n)}},partial:!0},qF="https://github.com/micromark/micromark-extension-mdxjs-esm",XF=new Set(["ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ImportDeclaration"]);function YF(e){const t={tokenize:function(t,i,s){const o=this,a=o.parser.definedModuleSpecifiers||(o.parser.definedModuleSpecifiers=[]),l=this.events.length+1;let c="";return o.interrupt?s:function(e){return o.now().column>1?s(e):(t.enter("mdxjsEsm"),t.enter("mdxjsEsmData"),t.consume(e),c+=String.fromCharCode(e),d)};function d(e){return VL(e)?(t.consume(e),c+=String.fromCharCode(e),d):"import"!==c&&"export"!==c||32!==e?s(e):(t.consume(e),h)}function h(e){return null===e||qL(e)?(t.exit("mdxjsEsmData"),u(e)):(t.consume(e),h)}function u(e){return null===e?f(e):qL(e)?t.check(GF,f,p)(e):(t.enter("mdxjsEsmData"),h(e))}function p(e){return t.enter("lineEnding"),t.consume(e),t.exit("lineEnding"),u}function f(s){const c=aF(o.events.slice(l),{acorn:n,acornOptions:r,tokenTypes:["mdxjsEsmData"],prefix:a.length>0?"var "+a.join(",")+"\n":""});if(c.error){if(null!==s&&c.swallow)return p(s);const e=new eN("Could not parse import/exports with acorn",{cause:c.error,place:{line:c.error.loc.line,column:c.error.loc.column+1,offset:c.error.pos},ruleId:"acorn",source:"micromark-extension-mdxjs-esm"});throw e.url=qF+"#could-not-parse-importexports-with-acorn",e}if(a.length>0){c.estree.body.shift()}let d=-1;for(;++d<c.estree.body.length;){const e=c.estree.body[d];if(!XF.has(e.type)){const t=new eN("Unexpected `"+e.type+"` in code: only import/exports are supported",{place:dF(e),ruleId:"non-esm",source:"micromark-extension-mdxjs-esm"});throw t.url=qF+"#unexpected-type-in-code-only-importexports-are-supported",t}if("ImportDeclaration"===e.type&&!o.interrupt){let t=-1;for(;++t<e.specifiers.length;){const n=e.specifiers[t];a.push(n.local.name)}}}return Object.assign(t.exit("mdxjsEsm"),e.addResult?{estree:c.estree}:void 0),i(s)}},concrete:!0};if(!e||!e.acorn||!e.acorn.parse)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");const n=e.acorn,r=Object.assign({ecmaVersion:2024,sourceType:"module"},e.acornOptions,{locations:!0});return{flow:{101:t,105:t}}}function ZF(e,t,n,r){const i=e.length;let s,o=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function JF(e,t){return e.length>0?(ZF(e,e.length,0,t),e):t}const QF={}.hasOwnProperty;function ej(e){const t={};let n=-1;for(;++n<e.length;)tj(t,e[n]);return t}function tj(e,t){let n;for(n in t){const r=(QF.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){QF.call(r,s)||(r[s]=[]);const e=i[s];nj(r[s],Array.isArray(e)?e:e?[e]:[])}}}function nj(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);ZF(e,0,0,r)}const rj={};function ij(e){const t=e||rj,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){const t=Object.assign({acorn:LD.extend(BL()),acornOptions:{ecmaVersion:2024,sourceType:"module"},addResult:!0},e);return ej([YF(t),EF(t),KF(t),{disable:{null:["autolink","codeIndented","htmlFlow","htmlText"]}}])}(t)),i.push([{enter:{mdxFlowExpression:pN,mdxTextExpression:fN},exit:{mdxFlowExpression:mN,mdxFlowExpressionChunk:gN,mdxTextExpression:mN,mdxTextExpressionChunk:gN}},$N(),{enter:{mdxjsEsm:UN},exit:{mdxjsEsm:KN,mdxjsEsmData:WN}}]),s.push(function(e){return{extensions:[{handlers:{mdxFlowExpression:yN,mdxTextExpression:yN},unsafe:[{character:"{",inConstruct:["phrasing"]},{atBreak:!0,character:"{"}]},BN(e),{handlers:{mdxjsEsm:GN}}]}}(t))}const sj={};function oj(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return aj(e.children,t,n)}return Array.isArray(e)?aj(e,t,n):""}function aj(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=oj(e[i],t,n);return r.join("")}class lj{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&cj(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),cj(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),cj(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);cj(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);cj(this.left,t.reverse())}}}function cj(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function dj(e){const t={};let n,r,i,s,o,a,l,c=-1;const d=new lj(e);for(;++c<d.length;){for(;c in t;)c=t[c];if(n=d.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===d.get(c-1)[1].type&&(a=n[1]._tokenizer.events,i=0,i<a.length&&"lineEndingBlank"===a[i][1].type&&(i+=2),i<a.length&&"content"===a[i][1].type))for(;++i<a.length&&"content"!==a[i][1].type;)"chunkText"===a[i][1].type&&(a[i][1]._isInFirstContentOfListItem=!0,i++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,hj(d,c)),c=t[c],l=!0);else if(n[1]._container){for(i=c,r=void 0;i--&&(s=d.get(i),"lineEnding"===s[1].type||"lineEndingBlank"===s[1].type);)"enter"===s[0]&&(r&&(d.get(r)[1].type="lineEndingBlank"),s[1].type="lineEnding",r=i);r&&(n[1].end=Object.assign({},d.get(r)[1].start),o=d.slice(r,c),o.unshift(n),d.splice(r,c-r+1,o))}}return ZF(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function hj(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[],o=n._tokenizer||r.parser[n.contentType](n.start),a=o.events,l=[],c={};let d,h,u=-1,p=n,f=0,m=0;const g=[m];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),h&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++u<a.length;)"exit"===a[u][0]&&"enter"===a[u-1][0]&&a[u][1].type===a[u-1][1].type&&a[u][1].start.line!==a[u][1].end.line&&(m=u+1,g.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),u=g.length;u--;){const t=a.slice(g[u],g[u+1]),n=s.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),u=-1;++u<l.length;)c[f+l[u][0]]=f+l[u][1],f+=l[u][1]-l[u][0]-1;return c}const uj={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,(function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),eF(e,t,"linePrefix")}),(function(t){return e.enter("paragraph"),r(t)}));let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,i(t)}function i(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):qL(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),i)}}};const pj={tokenize:function(e){const t=this,n=[];let r,i,s,o=0;return a;function a(r){if(o<n.length){const i=n[o];return t.containerState=i[1],e.attempt(i[0].continuation,l,c)(r)}return c(r)}function l(e){if(o++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let i,s=n;for(;s--;)if("exit"===t.events[s][0]&&"chunkFlow"===t.events[s][1].type){i=t.events[s][1].end;break}y(o);let a=n;for(;a<t.events.length;)t.events[a][1].end=Object.assign({},i),a++;return ZF(t.events,s+1,0,t.events.slice(n)),t.events.length=a,c(e)}return a(e)}function c(i){if(o===n.length){if(!r)return u(i);if(r.currentConstruct&&r.currentConstruct.concrete)return f(i);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fj,d,h)(i)}function d(e){return r&&v(),y(o),u(e)}function h(e){return t.parser.lazy[t.now().line]=o!==n.length,s=t.now().offset,f(e)}function u(n){return t.containerState={},e.attempt(fj,p,f)(n)}function p(e){return o++,n.push([t.currentConstruct,t.containerState]),u(e)}function f(n){return null===n?(r&&v(),y(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:r}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),y(0),void e.consume(n)):qL(n)?(e.consume(n),g(e.exit("chunkFlow")),o=0,t.interrupt=void 0,a):(e.consume(n),m)}function g(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=i,i&&(i.next=e),i=e,r.defineSkip(e.start),r.write(a),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<s&&(!r.events[e][1].end||r.events[e][1].end.offset>s))return;const n=t.events.length;let i,a,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(i){a=t.events[l][1].end;break}i=!0}for(y(o),e=n;e<t.events.length;)t.events[e][1].end=Object.assign({},a),e++;ZF(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function y(r){let i=n.length;for(;i-- >r;){const r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}},fj={tokenize:function(e,t,n){return eF(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};class mj{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&gj(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),gj(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),gj(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);gj(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);gj(this.left,t.reverse())}}}function gj(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function yj(e){const t={};let n,r,i,s,o,a,l,c=-1;const d=new mj(e);for(;++c<d.length;){for(;c in t;)c=t[c];if(n=d.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===d.get(c-1)[1].type&&(a=n[1]._tokenizer.events,i=0,i<a.length&&"lineEndingBlank"===a[i][1].type&&(i+=2),i<a.length&&"content"===a[i][1].type))for(;++i<a.length&&"content"!==a[i][1].type;)"chunkText"===a[i][1].type&&(a[i][1]._isInFirstContentOfListItem=!0,i++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,vj(d,c)),c=t[c],l=!0);else if(n[1]._container){for(i=c,r=void 0;i--&&(s=d.get(i),"lineEnding"===s[1].type||"lineEndingBlank"===s[1].type);)"enter"===s[0]&&(r&&(d.get(r)[1].type="lineEndingBlank"),s[1].type="lineEnding",r=i);r&&(n[1].end=Object.assign({},d.get(r)[1].start),o=d.slice(r,c),o.unshift(n),d.splice(r,c-r+1,o))}}return ZF(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function vj(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[],o=n._tokenizer||r.parser[n.contentType](n.start),a=o.events,l=[],c={};let d,h,u=-1,p=n,f=0,m=0;const g=[m];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),h&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++u<a.length;)"exit"===a[u][0]&&"enter"===a[u-1][0]&&a[u][1].type===a[u-1][1].type&&a[u][1].start.line!==a[u][1].end.line&&(m=u+1,g.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),u=g.length;u--;){const t=a.slice(g[u],g[u+1]),n=s.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),u=-1;++u<l.length;)c[f+l[u][0]]=f+l[u][1],f+=l[u][1]-l[u][0]-1;return c}const bj={tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):qL(t)?e.check(wj,s,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function s(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}},resolve:function(e){return yj(e),e}},wj={tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),eF(e,i,"linePrefix")};function i(i){if(null===i||qL(i))return n(i);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&"linePrefix"===s[1].type&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}},partial:!0};const xj={tokenize:function(e){const t=this,n=e.attempt(WF,(function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}),e.attempt(this.parser.constructs.flowInitial,r,eF(e,e.attempt(this.parser.constructs.flow,r,e.attempt(bj,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const Ej={resolveAll:kj()},Cj=_j("string"),Sj=_j("text");function _j(e){return{tokenize:function(t){const n=this,r=this.parser.constructs[e],i=t.attempt(r,s,o);return s;function s(e){return l(e)?i(e):o(e)}function o(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),a)}function l(e){if(null===e)return!0;const t=r[e];let i=-1;if(t)for(;++i<t.length;){const e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}},resolveAll:kj("text"===e?Oj:void 0)}}function kj(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function Oj(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],i=t.sliceStream(r);let s,o=i.length,a=-1,l=0;for(;o--;){const e=i[o];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)l++,a--;if(a)break;a=-1}else if(-2===e)s=!0,l++;else if(-1!==e){o++;break}}if(l){const i={type:n===e.length||s||l<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-l,offset:r.end.offset-l,_index:r.start._index+o,_bufferIndex:o?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},i.start),r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,["enter",i,t],["exit",i,t]),n+=2)}n++}return e}function Tj(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}function Pj(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},s=[];let o=[],a=[],l=!0;const c={consume:function(e){qL(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,w()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++));d.previous=e,l=!0},enter:function(e,t){const n=t||{};return n.type=e,n.start=f(),d.events.push(["enter",n,d]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=f(),d.events.push(["exit",t,d]),t},attempt:v((function(e,t){b(e,t.from)})),check:v(y),interrupt:v(y,{interrupt:!0})},d={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if("string"==typeof s)o=s;else switch(s){case-5:o="\r";break;case-4:o="\n";break;case-3:o="\r\n";break;case-2:o=t?" ":"\t";break;case-1:if(!t&&i)continue;o=" ";break;default:o=String.fromCharCode(s)}i=-2===s,r.push(o)}return r.join("")}(p(e),t)},now:f,defineSkip:function(e){i[e.line]=e.column,w()},write:function(e){if(o=JF(o,e),m(),null!==o[o.length-1])return[];return b(t,0),d.events=Tj(s,d.events,d),d.events}};let h,u=t.tokenize.call(d,c);return t.resolveAll&&s.push(t),d;function p(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const e=o[0];"string"==typeof e?o[0]=e.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}(o,e)}function f(){const{line:e,column:t,offset:n,_index:i,_bufferIndex:s}=r;return{line:e,column:t,offset:n,_index:i,_bufferIndex:s}}function m(){let e;for(;r._index<o.length;){const t=o[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)g(t.charCodeAt(r._bufferIndex));else g(t)}}function g(e){l=void 0,h=e,u=u(e)}function y(e,t){t.restore()}function v(e,t){return function(n,i,s){let o,h,u,p;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return m([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function m(e){return o=e,h=0,0===e.length?s:g(e[h])}function g(e){return function(n){p=function(){const e=f(),t=d.previous,n=d.currentConstruct,i=d.events.length,s=Array.from(a);return{restore:o,from:i};function o(){r=e,d.previous=t,d.currentConstruct=n,d.events.length=i,a=s,w()}}(),u=e,e.partial||(d.currentConstruct=e);if(e.name&&d.parser.constructs.disable.null.includes(e.name))return v(n);return e.tokenize.call(t?Object.assign(Object.create(d),t):d,c,y,v)(n)}}function y(t){return l=!0,e(u,p),i}function v(e){return l=!0,p.restore(),++h<o.length?g(o[h]):s}}}function b(e,t){e.resolveAll&&!s.includes(e)&&s.push(e),e.resolve&&ZF(d.events,t,d.events.length-t,e.resolve(d.events.slice(t),d)),e.resolveTo&&(d.events=e.resolveTo(d.events,d))}function w(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}const Ij={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,s(e)}(t)};function s(s){return s===r?(e.enter("thematicBreakSequence"),o(s)):i>=3&&(null===s||qL(s))?(e.exit("thematicBreak"),t(s)):n(s)}function o(t){return t===r?(e.consume(t),i++,o):(e.exit("thematicBreakSequence"),YL(t)?eF(e,s,"whitespace")(t):s(t))}}};const Mj={name:"list",tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,o=0;return function(t){const i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:KL(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(Ij,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return KL(t)&&++o<10?(e.consume(t),a):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(WF,r.interrupt?n:c,e.attempt(Rj,h,d))}function c(e){return r.containerState.initialBlankLine=!0,s++,h(e)}function d(t){return YL(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),h):n(t)}function h(n){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}},continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(WF,i,s);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,eF(e,t,"listItemIndent",r.containerState.size+1)(n)}function s(n){return r.containerState.furtherBlankLines||!YL(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Aj,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,eF(e,e.attempt(Mj,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)}},Rj={tokenize:function(e,t,n){const r=this;return eF(e,(function(e){const i=r.events[r.events.length-1];return!YL(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},Aj={tokenize:function(e,t,n){const r=this;return eF(e,(function(e){const i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)},partial:!0};const Nj={name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return YL(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}},continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(YL(t))return eF(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return i(t)};function i(r){return e.attempt(Nj,t,n)(r)}}},exit:function(e){e.exit("blockQuote")}};function Dj(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return function(t){if(60===t)return e.enter(r),e.enter(i),e.enter(s),e.consume(t),e.exit(s),h;if(null===t||32===t||41===t||UL(t))return n(t);return e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),f(t)};function h(n){return 62===n?(e.enter(s),e.consume(n),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return 62===t?(e.exit("chunkString"),e.exit(a),h(t)):null===t||60===t||qL(t)?n(t):(e.consume(t),92===t?p:u)}function p(t){return 60===t||62===t||92===t?(e.consume(t),u):u(t)}function f(i){return d||null!==i&&41!==i&&!XL(i)?d<c&&40===i?(e.consume(i),d++,f):41===i?(e.consume(i),d--,f):null===i||32===i||40===i||UL(i)?n(i):(e.consume(i),92===i?m:f):(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(i))}function m(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function Lj(e,t,n,r,i,s){const o=this;let a,l=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(s),c};function c(h){return l>999||null===h||91===h||93===h&&!a||94===h&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):93===h?(e.exit(s),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):qL(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(t){return null===t||91===t||93===t||qL(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a||(a=!YL(t)),92===t?h:d)}function h(t){return 91===t||92===t||93===t?(e.consume(t),l++,d):d(t)}}function Fj(e,t,n,r,i,s){let o;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=40===t?41:t,a;return n(t)};function a(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(s),l(n))}function l(t){return t===o?(e.exit(s),a(o)):null===t?n(t):qL(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),eF(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===o||null===t||qL(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?d:c)}function d(t){return t===o||92===t?(e.consume(t),c):c(t)}}function jj(e,t){let n;return function r(i){if(qL(i))return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r;if(YL(i))return eF(e,r,n?"linePrefix":"lineSuffix")(i);return t(i)}}function $j(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Bj={name:"definition",tokenize:function(e,t,n){const r=this;let i;return function(t){return e.enter("definition"),function(t){return Lj.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function s(t){return i=$j(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o):n(t)}function o(t){return XL(t)?jj(e,a)(t):a(t)}function a(t){return Dj(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(Vj,c,c)(t)}function c(t){return YL(t)?eF(e,d,"whitespace")(t):d(t)}function d(s){return null===s||qL(s)?(e.exit("definition"),r.parser.defined.push(i),t(s)):n(s)}}},Vj={tokenize:function(e,t,n){return function(t){return XL(t)?jj(e,r)(t):n(t)};function r(t){return Fj(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return YL(t)?eF(e,s,"whitespace")(t):s(t)}function s(e){return null===e||qL(e)?t(e):n(e)}},partial:!0};const zj={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),eF(e,i,"linePrefix",5)(t)};function i(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?s(e):n(e)}function s(t){return null===t?a(t):qL(t)?e.attempt(Hj,s,a)(t):(e.enter("codeFlowValue"),o(t))}function o(t){return null===t||qL(t)?(e.exit("codeFlowValue"),s(t)):(e.consume(t),o)}function a(n){return e.exit("codeIndented"),t(n)}}},Hj={tokenize:function(e,t,n){const r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):qL(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):eF(e,s,"linePrefix",5)(t)}function s(e){const s=r.events[r.events.length-1];return s&&"linePrefix"===s[1].type&&s[2].sliceSerialize(s[1],!0).length>=4?t(e):qL(e)?i(e):n(e)}},partial:!0};const Uj={name:"headingAtx",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),i(t)}(t)};function i(t){return 35===t&&r++<6?(e.consume(t),i):null===t||XL(t)?(e.exit("atxHeadingSequence"),s(t)):n(t)}function s(n){return 35===n?(e.enter("atxHeadingSequence"),o(n)):null===n||qL(n)?(e.exit("atxHeading"),t(n)):YL(n)?eF(e,s,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function o(t){return 35===t?(e.consume(t),o):(e.exit("atxHeadingSequence"),s(t))}function a(t){return null===t||35===t||XL(t)?(e.exit("atxHeadingText"),s(t)):(e.consume(t),a)}},resolve:function(e,t){let n,r,i=e.length-2,s=3;"whitespace"===e[s][1].type&&(s+=2);i-2>s&&"whitespace"===e[i][1].type&&(i-=2);"atxHeadingSequence"===e[i][1].type&&(s===i-1||i-4>s&&"whitespace"===e[i-2][1].type)&&(i-=s+1===i?2:4);i>s&&(n={type:"atxHeadingText",start:e[s][1].start,end:e[i][1].end},r={type:"chunkText",start:e[s][1].start,end:e[i][1].end,contentType:"text"},ZF(e,s,i-s+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e}};const Kj={name:"setextUnderline",tokenize:function(e,t,n){const r=this;let i;return function(t){let o,a=r.events.length;for(;a--;)if("lineEnding"!==r.events[a][1].type&&"linePrefix"!==r.events[a][1].type&&"content"!==r.events[a][1].type){o="paragraph"===r.events[a][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||o))return e.enter("setextHeadingLine"),i=t,function(t){return e.enter("setextHeadingLineSequence"),s(t)}(t);return n(t)};function s(t){return t===i?(e.consume(t),s):(e.exit("setextHeadingLineSequence"),YL(t)?eF(e,o,"lineSuffix")(t):o(t))}function o(r){return null===r||qL(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){let n,r,i,s=e.length;for(;s--;)if("enter"===e[s][0]){if("content"===e[s][1].type){n=s;break}"paragraph"===e[s][1].type&&(r=s)}else"content"===e[s][1].type&&e.splice(s,1),i||"definition"!==e[s][1].type||(i=s);const o={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",o,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[i][1].end)):e[n][1]=o;return e.push(["exit",o,t]),e}};const Wj=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gj=["pre","script","style","textarea"],qj={name:"htmlFlow",tokenize:function(e,t,n){const r=this;let i,s,o,a,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(a){return 33===a?(e.consume(a),d):47===a?(e.consume(a),s=!0,p):63===a?(e.consume(a),i=3,r.interrupt?t:N):VL(a)?(e.consume(a),o=String.fromCharCode(a),f):n(a)}function d(s){return 45===s?(e.consume(s),i=2,h):91===s?(e.consume(s),i=5,a=0,u):VL(s)?(e.consume(s),i=4,r.interrupt?t:N):n(s)}function h(i){return 45===i?(e.consume(i),r.interrupt?t:N):n(i)}function u(i){const s="CDATA[";return i===s.charCodeAt(a++)?(e.consume(i),6===a?r.interrupt?t:k:u):n(i)}function p(t){return VL(t)?(e.consume(t),o=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||XL(a)){const l=47===a,c=o.toLowerCase();return l||s||!Gj.includes(c)?Wj.includes(o.toLowerCase())?(i=6,l?(e.consume(a),m):r.interrupt?t(a):k(a)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(a):s?g(a):y(a)):(i=1,r.interrupt?t(a):k(a))}return 45===a||zL(a)?(e.consume(a),o+=String.fromCharCode(a),f):n(a)}function m(i){return 62===i?(e.consume(i),r.interrupt?t:k):n(i)}function g(t){return YL(t)?(e.consume(t),g):S(t)}function y(t){return 47===t?(e.consume(t),S):58===t||95===t||VL(t)?(e.consume(t),v):YL(t)?(e.consume(t),y):S(t)}function v(t){return 45===t||46===t||58===t||95===t||zL(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),w):YL(t)?(e.consume(t),b):y(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,x):YL(t)?(e.consume(t),w):E(t)}function x(t){return t===l?(e.consume(t),l=null,C):null===t||qL(t)?n(t):(e.consume(t),x)}function E(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||XL(t)?b(t):(e.consume(t),E)}function C(e){return 47===e||62===e||YL(e)?y(e):n(e)}function S(t){return 62===t?(e.consume(t),_):n(t)}function _(t){return null===t||qL(t)?k(t):YL(t)?(e.consume(t),_):n(t)}function k(t){return 45===t&&2===i?(e.consume(t),I):60===t&&1===i?(e.consume(t),M):62===t&&4===i?(e.consume(t),D):63===t&&3===i?(e.consume(t),N):93===t&&5===i?(e.consume(t),A):!qL(t)||6!==i&&7!==i?null===t||qL(t)?(e.exit("htmlFlowData"),O(t)):(e.consume(t),k):(e.exit("htmlFlowData"),e.check(Xj,L,O)(t))}function O(t){return e.check(Yj,T,L)(t)}function T(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),P}function P(t){return null===t||qL(t)?O(t):(e.enter("htmlFlowData"),k(t))}function I(t){return 45===t?(e.consume(t),N):k(t)}function M(t){return 47===t?(e.consume(t),o="",R):k(t)}function R(t){if(62===t){const n=o.toLowerCase();return Gj.includes(n)?(e.consume(t),D):k(t)}return VL(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),R):k(t)}function A(t){return 93===t?(e.consume(t),N):k(t)}function N(t){return 62===t?(e.consume(t),D):45===t&&2===i?(e.consume(t),N):k(t)}function D(t){return null===t||qL(t)?(e.exit("htmlFlowData"),L(t)):(e.consume(t),D)}function L(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},concrete:!0},Xj={tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(WF,t,n)}},partial:!0},Yj={tokenize:function(e,t,n){const r=this;return function(t){if(qL(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i;return n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0};const Zj={tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},Jj={name:"codeFenced",tokenize:function(e,t,n){const r=this,i={tokenize:function(e,t,n){let i=0;return o;function o(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),YL(t)?eF(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===s?(e.enter("codeFencedFenceSequence"),d(t)):n(t)}function d(t){return t===s?(i++,e.consume(t),d):i>=a?(e.exit("codeFencedFenceSequence"),YL(t)?eF(e,h,"whitespace")(t):h(t)):n(t)}function h(r){return null===r||qL(r)?(e.exit("codeFencedFence"),t(r)):n(r)}},partial:!0};let s,o=0,a=0;return function(t){return function(t){const n=r.events[r.events.length-1];return o=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===s?(a++,e.consume(t),l):a<3?n(t):(e.exit("codeFencedFenceSequence"),YL(t)?eF(e,c,"whitespace")(t):c(t))}function c(n){return null===n||qL(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(Zj,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return null===t||qL(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):YL(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),eF(e,h,"whitespace")(t)):96===t&&t===s?n(t):(e.consume(t),d)}function h(t){return null===t||qL(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return null===t||qL(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===s?n(t):(e.consume(t),u)}function p(t){return e.attempt(i,v,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return o>0&&YL(t)?eF(e,g,"linePrefix",o+1)(t):g(t)}function g(t){return null===t||qL(t)?e.check(Zj,p,v)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||qL(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),y)}function v(n){return e.exit("codeFenced"),t(n)}},concrete:!0};const Qj={name:"characterReference",tokenize:function(e,t,n){const r=this;let i,s,o=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,s=zL,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=WL,c):(e.enter("characterReferenceValue"),i=7,s=KL,c(t))}function c(a){if(59===a&&o){const i=e.exit("characterReferenceValue");return s!==zL||_N(r.sliceSerialize(i))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return s(a)&&o++<i?(e.consume(a),c):n(a)}}};const e$={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return GL(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const t$={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),eF(e,t,"linePrefix")}}};const n$={name:"labelEnd",tokenize:function(e,t,n){const r=this;let i,s,o=r.events.length;for(;o--;)if(("labelImage"===r.events[o][1].type||"labelLink"===r.events[o][1].type)&&!r.events[o][1]._balanced){i=r.events[o][1];break}return function(t){if(!i)return n(t);if(i._inactive)return d(t);return s=r.parser.defined.includes($j(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a};function a(t){return 40===t?e.attempt(r$,c,s?c:d)(t):91===t?e.attempt(i$,c,s?l:d)(t):s?c(t):d(t)}function l(t){return e.attempt(s$,c,d)(t)}function c(e){return t(e)}function d(e){return i._balanced=!0,n(e)}},resolveTo:function(e,t){let n,r,i,s,o=e.length,a=0;for(;o--;)if(n=e[o][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[o][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[o][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=o,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(i=o);const l={type:"labelLink"===e[r][1].type?"link":"image",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[r][1].start),end:Object.assign({},e[i][1].end)},d={type:"labelText",start:Object.assign({},e[r+a+2][1].end),end:Object.assign({},e[i-2][1].start)};return s=[["enter",l,t],["enter",c,t]],s=JF(s,e.slice(r+1,r+a+3)),s=JF(s,[["enter",d,t]]),s=JF(s,Tj(t.parser.constructs.insideSpan.null,e.slice(r+a+4,i-3),t)),s=JF(s,[["exit",d,t],e[i-2],e[i-1],["exit",c,t]]),s=JF(s,e.slice(i+1)),s=JF(s,[["exit",l,t]]),ZF(e,r,e.length,s),e},resolveAll:function(e){let t=-1;for(;++t<e.length;){const n=e[t][1];"labelImage"!==n.type&&"labelLink"!==n.type&&"labelEnd"!==n.type||(e.splice(t+1,"labelImage"===n.type?4:2),n.type="data",t++)}return e}},r$={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return XL(t)?jj(e,i)(t):i(t)}function i(t){return 41===t?c(t):Dj(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function s(t){return XL(t)?jj(e,a)(t):c(t)}function o(e){return n(e)}function a(t){return 34===t||39===t||40===t?Fj(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return XL(t)?jj(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},i$={tokenize:function(e,t,n){const r=this;return function(t){return Lj.call(r,e,i,s,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes($j(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function s(e){return n(e)}}},s$={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const o$={name:"labelStartImage",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),s):n(t)}function s(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:n$.resolveAll};function a$(e){return null===e||XL(e)||JL(e)?1:ZL(e)?2:void 0}const l$={name:"attention",tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=a$(r);let s;return function(t){return s=t,e.enter("attentionSequence"),o(t)};function o(a){if(a===s)return e.consume(a),o;const l=e.exit("attentionSequence"),c=a$(a),d=!c||2===c&&i||n.includes(a),h=!i||2===i&&c||n.includes(r);return l._open=Boolean(42===s?d:d&&(i||!h)),l._close=Boolean(42===s?h:h&&(c||!d)),t(a)}},resolveAll:function(e,t){let n,r,i,s,o,a,l,c,d=-1;for(;++d<e.length;)if("enter"===e[d][0]&&"attentionSequence"===e[d][1].type&&e[d][1]._close)for(n=d;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[d][1]).charCodeAt(0)){if((e[n][1]._close||e[d][1]._open)&&(e[d][1].end.offset-e[d][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[d][1].end.offset-e[d][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[d][1].end.offset-e[d][1].start.offset>1?2:1;const h=Object.assign({},e[n][1].end),u=Object.assign({},e[d][1].start);c$(h,-a),c$(u,a),s={type:a>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[n][1].end)},o={type:a>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[d][1].start),end:u},i={type:a>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[d][1].start)},r={type:a>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},o.end)},e[n][1].end=Object.assign({},s.start),e[d][1].start=Object.assign({},o.end),l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=JF(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=JF(l,[["enter",r,t],["enter",s,t],["exit",s,t],["enter",i,t]]),l=JF(l,Tj(t.parser.constructs.insideSpan.null,e.slice(n+1,d),t)),l=JF(l,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",r,t]]),e[d][1].end.offset-e[d][1].start.offset?(c=2,l=JF(l,[["enter",e[d][1],t],["exit",e[d][1],t]])):c=0,ZF(e,n-1,d-n+3,l),d=n+l.length-c-2;break}d=-1;for(;++d<e.length;)"attentionSequence"===e[d][1].type&&(e[d][1].type="data");return e}};function c$(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const d$={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return VL(t)?(e.consume(t),s):64===t?n(t):l(t)}function s(e){return 43===e||45===e||46===e||zL(e)?(r=1,o(e)):l(e)}function o(t){return 58===t?(e.consume(t),r=0,a):(43===t||45===t||46===t||zL(t))&&r++<32?(e.consume(t),o):(r=0,l(t))}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||UL(r)?n(r):(e.consume(r),a)}function l(t){return 64===t?(e.consume(t),c):HL(t)?(e.consume(t),l):n(t)}function c(e){return zL(e)?d(e):n(e)}function d(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):h(n)}function h(t){if((45===t||zL(t))&&r++<63){const n=45===t?h:d;return e.consume(t),n}return n(t)}}};const h$={name:"htmlText",tokenize:function(e,t,n){const r=this;let i,s,o;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),w):63===t?(e.consume(t),v):VL(t)?(e.consume(t),C):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),s=0,p):VL(t)?(e.consume(t),y):n(t)}function c(t){return 45===t?(e.consume(t),u):n(t)}function d(t){return null===t?n(t):45===t?(e.consume(t),h):qL(t)?(o=d,R(t)):(e.consume(t),d)}function h(t){return 45===t?(e.consume(t),u):d(t)}function u(e){return 62===e?M(e):45===e?h(e):d(e)}function p(t){const r="CDATA[";return t===r.charCodeAt(s++)?(e.consume(t),6===s?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),m):qL(t)?(o=f,R(t)):(e.consume(t),f)}function m(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?M(t):93===t?(e.consume(t),g):f(t)}function y(t){return null===t||62===t?M(t):qL(t)?(o=y,R(t)):(e.consume(t),y)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):qL(t)?(o=v,R(t)):(e.consume(t),v)}function b(e){return 62===e?M(e):v(e)}function w(t){return VL(t)?(e.consume(t),x):n(t)}function x(t){return 45===t||zL(t)?(e.consume(t),x):E(t)}function E(t){return qL(t)?(o=E,R(t)):YL(t)?(e.consume(t),E):M(t)}function C(t){return 45===t||zL(t)?(e.consume(t),C):47===t||62===t||XL(t)?S(t):n(t)}function S(t){return 47===t?(e.consume(t),M):58===t||95===t||VL(t)?(e.consume(t),_):qL(t)?(o=S,R(t)):YL(t)?(e.consume(t),S):M(t)}function _(t){return 45===t||46===t||58===t||95===t||zL(t)?(e.consume(t),_):k(t)}function k(t){return 61===t?(e.consume(t),O):qL(t)?(o=k,R(t)):YL(t)?(e.consume(t),k):S(t)}function O(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),i=t,T):qL(t)?(o=O,R(t)):YL(t)?(e.consume(t),O):(e.consume(t),P)}function T(t){return t===i?(e.consume(t),i=void 0,I):null===t?n(t):qL(t)?(o=T,R(t)):(e.consume(t),T)}function P(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||XL(t)?S(t):(e.consume(t),P)}function I(e){return 47===e||62===e||XL(e)?S(e):n(e)}function M(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function R(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),A}function A(t){return YL(t)?eF(e,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):N(t)}function N(t){return e.enter("htmlTextData"),o(t)}}};const u$={name:"labelStartLink",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:n$.resolveAll};const p$={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return qL(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const f$={name:"codeText",tokenize:function(e,t,n){let r,i,s=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),o(t)};function o(t){return 96===t?(e.consume(t),s++,o):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(i=e.enter("codeTextSequence"),r=0,c(t)):qL(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||qL(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(i.type="codeTextData",l(n))}},resolve:function(e){let t,n,r=e.length-4,i=3;if(!("lineEnding"!==e[i][1].type&&"space"!==e[i][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}t=i-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type}};const m$={42:Mj,43:Mj,45:Mj,48:Mj,49:Mj,50:Mj,51:Mj,52:Mj,53:Mj,54:Mj,55:Mj,56:Mj,57:Mj,62:Nj},g$={91:Bj},y$={[-2]:zj,[-1]:zj,32:zj},v$={35:Uj,42:Ij,45:[Kj,Ij],60:qj,61:Kj,95:Ij,96:Jj,126:Jj},b$={38:Qj,92:e$},w$={[-5]:t$,[-4]:t$,[-3]:t$,33:o$,38:Qj,42:l$,60:[d$,h$],91:u$,92:[p$,e$],93:n$,95:l$,96:f$},x$={null:[l$,Ej]},E$={null:[42,95]},C$={null:[]};const S$=/[\0\t\n\r]/g;function _$(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}const k$=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function O$(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return _$(n.slice(t?2:1),t?16:10)}return _N(n)||e}const T$={}.hasOwnProperty;function P$(t,n,r){return"string"!=typeof n&&(r=n,n=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(te),autolinkProtocol:_,autolinkEmail:_,atxHeading:s(Z),blockQuote:s(W),characterEscape:_,characterReference:_,codeFenced:s(G),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(G,o),codeText:s(q,o),codeTextData:_,data:_,codeFlowValue:_,definition:s(X),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Y),hardBreakEscape:s(J),hardBreakTrailing:s(J),htmlFlow:s(Q,o),htmlFlowData:_,htmlText:s(Q,o),htmlTextData:_,image:s(ee),label:o,link:s(te),listItem:s(re),listItemValue:u,listOrdered:s(ne,h),listUnordered:s(ne),paragraph:s(ie),reference:$,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Z),strong:s(se),thematicBreak:s(ae)},exit:{atxHeading:l(),atxHeadingSequence:x,autolink:l(),autolinkEmail:K,autolinkProtocol:U,blockQuote:l(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:V,characterReferenceMarkerNumeric:V,characterReferenceValue:z,characterReference:H,codeFenced:l(g),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:k,codeIndented:l(y),codeText:l(M),codeTextData:k,data:k,definition:l(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(T),hardBreakTrailing:l(T),htmlFlow:l(P),htmlFlowData:k,htmlText:l(I),htmlTextData:k,image:l(A),label:D,labelText:N,lineEnding:O,link:l(R),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:B,resourceDestinationString:L,resourceTitleString:F,resource:j,setextHeading:l(S),setextHeadingLineSequence:C,setextHeadingText:E,strong:l(),thematicBreak:l()}};M$(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const s={stack:[r],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:d,data:n},l=[];let h=-1;for(;++h<e.length;)if("listOrdered"===e[h][1].type||"listUnordered"===e[h][1].type)if("enter"===e[h][0])l.push(h);else{h=i(e,l.pop(),h)}for(h=-1;++h<e.length;){const n=t[e[h][0]];T$.call(n,e[h][1].type)&&n[e[h][1].type].call(Object.assign({sliceSerialize:e[h][2].sliceSerialize},s),e[h][1])}if(s.tokenStack.length>0){const e=s.tokenStack[s.tokenStack.length-1];(e[1]||A$).call(s,void 0,e[0])}for(r.position={start:I$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:I$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},h=-1;++h<t.transforms.length;)r=t.transforms[h](r)||r;return r}function i(e,t,n){let r,i,s,o,a=t-1,l=-1,c=!1;for(;++a<=n;){const t=e[a];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,o=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||o||l||s||(s=a),o=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:o=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let o=a;for(i=void 0;o--;){const t=e[o];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",i=o}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}s&&(!i||s<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||a,0,["exit",r,t[2]]),a++,n++}if("listItemPrefix"===t[1].type){const i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(a,0,["enter",i,t[2]]),a++,n++,s=void 0,o=!0}}}return e[t][1]._spread=c,n}function s(e,t){return n;function n(n){a.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n]),e.position={start:I$(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),c.call(this,t)}}function c(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+YA({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||A$).call(this,e,r[0])}n.position.end=I$(e.end)}function d(){return function(e,t){const n=t||sj;return oj(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function u(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function f(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function v(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=$j(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function x(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function S(){this.data.setextHeadingSlurpLineEnding=void 0}function _(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=oe(),n.position={start:I$(e.start),end:void 0},t.push(n)),this.stack.push(n)}function k(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=I$(e.end)}function O(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=I$(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(_.call(this,e),k.call(this,e))}function T(){this.data.atHardBreak=!0}function P(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function M(){const e=this.resume();this.stack[this.stack.length-1].value=e}function R(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function A(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(k$,O$)}(t),n.identifier=$j(t).toLowerCase()}function D(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function L(){const e=this.resume();this.stack[this.stack.length-1].url=e}function F(){const e=this.resume();this.stack[this.stack.length-1].title=e}function j(){this.data.inReference=void 0}function $(){this.data.referenceType="collapsed"}function B(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=$j(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function V(e){this.data.characterReferenceType=e.type}function z(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=_$(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=_N(t)}this.stack[this.stack.length-1].value+=r}function H(e){this.stack.pop().position.end=I$(e.end)}function U(e){k.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function K(e){k.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function W(){return{type:"blockquote",children:[]}}function G(){return{type:"code",lang:null,meta:null,value:""}}function q(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Y(){return{type:"emphasis",children:[]}}function Z(){return{type:"heading",depth:0,children:[]}}function J(){return{type:"break"}}function Q(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function ie(){return{type:"paragraph",children:[]}}function se(){return{type:"strong",children:[]}}function oe(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}(r)(function(e){for(;!dj(e););return e}(function(t){const n={defined:[],lazy:{},constructs:ej([e,...(t||{}).extensions||[]]),content:r(uj),document:r(pj),flow:r(xj),string:r(Cj),text:r(Sj)};return n;function r(e){return function(t){return Pj(n,e,t)}}}(r).document().write(function(){let e,t=1,n="",r=!0;return function(i,s,o){const a=[];let l,c,d,h,u;for(i=n+("string"==typeof i?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,n="",r&&(65279===i.charCodeAt(0)&&d++,r=void 0);d<i.length;){if(S$.lastIndex=d,l=S$.exec(i),h=l&&void 0!==l.index?l.index:i.length,u=i.charCodeAt(h),!l){n=i.slice(d);break}if(10===u&&d===h&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),d<h&&(a.push(i.slice(d,h)),t+=h-d),u){case 0:a.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),a.push(-2);t++<c;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}d=h+1}return o&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(t,n,!0))))}function I$(e){return{line:e.line,column:e.column,offset:e.offset}}function M$(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?M$(e,r):R$(e,r)}}function R$(e,t){let n;for(n in t)if(T$.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function A$(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+YA({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+YA({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+YA({start:t.start,end:t.end})+") is still open")}function N$(e){const t=this;t.parser=function(n){return P$(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}const D$="object"==typeof self?self:globalThis,L$=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case 0:case-1:return n(o,i);case 1:{const e=n([],i);for(const t of o)e.push(r(t));return e}case 2:{const e=n({},i);for(const[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{const{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{const e=n(new Map,i);for(const[t,n]of o)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,i);for(const t of o)e.add(r(t));return e}case 7:{const{name:e,message:t}=o;return n(new D$[e](t),i)}case 8:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i)}return n(new D$[s](o),i)};return r})(new Map,e)(0),F$="",{toString:j$}={},{keys:$$}=Object,B$=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=j$.call(e).slice(8,-1);switch(n){case"Array":return[1,F$];case"Object":return[2,F$];case"Date":return[3,F$];case"RegExp":return[4,F$];case"Map":return[5,F$];case"Set":return[6,F$]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},V$=([e,t])=>0===e&&("function"===t||"symbol"===t),z$=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const i=(e,t)=>{const i=r.push(e)-1;return n.set(t,i),i},s=r=>{if(n.has(r))return n.get(r);let[o,a]=B$(r);switch(o){case 0:{let t=r;switch(a){case"bigint":o=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);t=null;break;case"undefined":return i([-1],r)}return i([o,t],r)}case 1:{if(a)return i([a,[...r]],r);const e=[],t=i([o,e],r);for(const t of r)e.push(s(t));return t}case 2:{if(a)switch(a){case"BigInt":return i([a,r.toString()],r);case"Boolean":case"Number":case"String":return i([a,r.valueOf()],r)}if(t&&"toJSON"in r)return s(r.toJSON());const n=[],l=i([o,n],r);for(const t of $$(r))!e&&V$(B$(r[t]))||n.push([s(t),s(r[t])]);return l}case 3:return i([o,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{const t=[],n=i([o,t],r);for(const[n,i]of r)(e||!V$(B$(n))&&!V$(B$(i)))&&t.push([s(n),s(i)]);return n}case 6:{const t=[],n=i([o,t],r);for(const n of r)!e&&V$(B$(n))||t.push(s(n));return n}}const{message:l}=r;return i([o,{name:a,message:l}],r)};return s})(!(t||n),!!t,new Map,r)(e),r},H$="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?L$(z$(e,t)):structuredClone(e):(e,t)=>L$(z$(e,t));function U$(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(37===s&&zL(e.charCodeAt(n+1))&&zL(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const t=e.charCodeAt(n+1);s<56320&&t>56319&&t<57344?(o=String.fromCharCode(s,t),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function K$(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function W$(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const G$=function(e){if(null==e)return X$;if("function"==typeof e)return q$(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=G$(e[n]);return q$(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return q$(n);function n(n){const r=n;let i;for(i in e)if(r[i]!==t[i])return!1;return!0}}(e);if("string"==typeof e)return function(e){return q$(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function q$(e){return function(t,n,r){return Boolean(Y$(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function X$(){return!0}function Y$(e){return null!==e&&"object"==typeof e&&"type"in e}const Z$=[],J$=!0,Q$=!1,eB="skip";function tB(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;const s=G$(i),o=r?-1:1;!function e(i,a,l){const c=i&&"object"==typeof i?i:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(d,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return d;function d(){let c,d,h,u=Z$;if((!t||s(i,a,l[l.length-1]||void 0))&&(u=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[J$,e];return null==e?Z$:[e]}(n(i,l)),u[0]===Q$))return u;if("children"in i&&i.children){const t=i;if(t.children&&u[0]!==eB)for(d=(r?t.children.length:-1)+o,h=l.concat(t);d>-1&&d<t.children.length;){const n=t.children[d];if(c=e(n,d,h)(),c[0]===Q$)return c;d="number"==typeof c[1]?c[1]:d+o}}return u}}(e,void 0,[])()}const nB=iB("end"),rB=iB("start");function iB(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function sB(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&"text"===s.type?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&"text"===o.type?o.value+=r:i.push({type:"text",value:r}),i}function oB(e){const t=e.spread;return null==t?e.children.length>1:t}const aB=9,lB=32;function cB(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(dB(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(dB(t.slice(i),i>0,!1)),s.join("")}function dB(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===aB||t===lB;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===aB||t===lB;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}const hB={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=U$(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);void 0===a?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sB(e,t);const i={src:U$(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)},image:function(e,t){const n={src:U$(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sB(e,t);const i={href:U$(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)},link:function(e,t){const n={href:U$(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=oB(n[r])}return t}(n):oB(t),s={},o=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const e=r[a];(i||0!==a||"element"!==e.type||"p"!==e.tagName)&&o.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?o.push(e):o.push(...e.children)}const l=r[r.length-1];l&&(i||"element"!==l.type||"p"!==l.tagName)&&o.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){const n={},r=e.all(t);let i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){const e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=rB(t.children[1]),o=nB(t.children[t.children.length-1]);s&&o&&(r.position={start:s,end:o}),i.push(r)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",s=n&&"table"===n.type?n.align:void 0,o=s?s.length:t.children.length;let a=-1;const l=[];for(;++a<o;){const n=t.children[a],r={},o=s?s[a]:void 0;o&&(r.align=o);let c={type:"element",tagName:i,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),l.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:cB(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:uB,yaml:uB,definition:uB,footnoteDefinition:uB};function uB(){}const pB={}.hasOwnProperty,fB={};function mB(e,t){const n=t||fB,r=new Map,i=new Map,s=new Map,o={...hB,...n.handlers},a={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const i=a.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=wB(i.value)),!Array.isArray(i)&&"element"===i.type)){const e=i.children[0];e&&"text"===e.type&&(e.value=wB(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:yB,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:function(e,t){const n=e.type,r=a.handlers[n];if(pB.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=H$(n);return r.children=a.all(e),r}return H$(e)}const i=a.options.unknownHandler||vB;return i(a,e,t)},options:n,patch:gB,wrap:bB};return function(e,t,n,r){let i,s,o;"function"==typeof t&&"function"!=typeof n?(s=void 0,o=t,i=n):(s=t,o=n,i=r),tB(e,s,(function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}),i)}(e,(function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}})),a}function gB(e,t){e.position&&(t.position=function(e){const t=rB(e),n=nB(e);if(t&&n)return{start:t,end:n}}(e))}function yB(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&i&&Object.assign(n.properties,H$(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function vB(e,t){const n=t.data||{},r=!("value"in t)||pB.call(n,"hProperties")||pB.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function bB(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function wB(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function xB(e,t){const n=mB(e,t),r=n.one(e,void 0),i=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||K$,r=e.options.footnoteBackLabel||W$,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const i=e.footnoteById.get(e.footnoteOrder[l]);if(!i)continue;const s=e.all(i),o=String(i.identifier).toUpperCase(),c=U$(o.toLowerCase());let d=0;const h=[],u=e.footnoteCounts.get(o);for(;void 0!==u&&++d<=u;){h.length>0&&h.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,d);"string"==typeof e&&(e={type:"text",value:e}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=s[s.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...h)}else s.push(...h);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(s,!0)};e.patch(i,f),a.push(f)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...H$(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:"\n"}]}}(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:"\n"},i),s}function EB(e,t){return e&&"run"in e?async function(n,r){const i=xB(n,{file:r,...t});await e.run(i,r)}:function(n,r){return xB(n,{file:r,...t||e})}}function CB(e){if(e)throw e}var SB=__webpack_require__("YNvz");function _B(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function kB(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function i(s,...o){const a=e[++n];let l=-1;if(s)r(s);else{for(;++l<t.length;)null!==o[l]&&void 0!==o[l]||(o[l]=t[l]);t=o,a?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){if(r&&n)throw e;return i(e)}r||(o&&o.then&&"function"==typeof o.then?o.then(s,i):o instanceof Error?i(o):s(o))}function i(e,...r){n||(n=!0,t(e,...r))}function s(e){i(null,e)}}(a,i)(...o):r(null,...o)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const OB={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');TB(e);let n,r=0,i=-1,s=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;s--;)if(47===e.codePointAt(s)){if(n){r=s+1;break}}else i<0&&(n=!0,i=s+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let o=-1,a=t.length-1;for(;s--;)if(47===e.codePointAt(s)){if(n){r=s+1;break}}else o<0&&(n=!0,o=s+1),a>-1&&(e.codePointAt(s)===t.codePointAt(a--)?a<0&&(i=s):(a=-1,i=o));r===i?i=o:i<0&&(i=e.length);return e.slice(r,i)},dirname:function(e){if(TB(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){TB(e);let t,n=e.length,r=-1,i=0,s=-1,o=0;for(;n--;){const a=e.codePointAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?s<0?s=n:1!==o&&(o=1):s>-1&&(o=-1);else if(t){i=n+1;break}}if(s<0||r<0||0===o||1===o&&s===r-1&&s===i+1)return"";return e.slice(s,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)TB(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){TB(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,i="",s=0,o=-1,a=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(o===l-1||1===a);else if(o!==l-1&&2===a){if(i.length<2||2!==s||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2))if(i.length>2){if(r=i.lastIndexOf("/"),r!==i.length-1){r<0?(i="",s=0):(i=i.slice(0,r),s=i.length-1-i.lastIndexOf("/")),o=l,a=0;continue}}else if(i.length>0){i="",s=0,o=l,a=0;continue}t&&(i=i.length>0?i+"/..":"..",s=2)}else i.length>0?i+="/"+e.slice(o+1,l):i=e.slice(o+1,l),s=l-o-1;o=l,a=0}else 46===n&&a>-1?a++:a=-1}return i}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function TB(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const PB={cwd:function(){return"/"}};function IB(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function MB(e){if("string"==typeof e)e=new URL(e);else if(!IB(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const RB=["history","path","basename","stem","extname","dirname"];class AB{constructor(e){let t;t=e?IB(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":PB.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<RB.length;){const e=RB[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)RB.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?OB.basename(this.path):void 0}set basename(e){DB(e,"basename"),NB(e,"basename"),this.path=OB.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?OB.dirname(this.path):void 0}set dirname(e){LB(this.basename,"dirname"),this.path=OB.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?OB.extname(this.path):void 0}set extname(e){if(NB(e,"extname"),LB(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=OB.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){IB(e)&&(e=MB(e)),DB(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?OB.basename(this.path,this.extname):void 0}set stem(e){DB(e,"stem"),NB(e,"stem"),this.path=OB.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new eN(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function NB(e,t){if(e&&e.includes(OB.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+OB.sep+"`")}function DB(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function LB(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const FB=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},jB={}.hasOwnProperty;class $B extends FB{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=kB()}copy(){const e=new $B;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(SB(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(HB("data",this.frozen),this.namespace[e]=t,this):jB.call(this.namespace,e)&&this.namespace[e]||void 0:e?(HB("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=WB(e),n=this.parser||this.Parser;return VB("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),VB("process",this.parser||this.Parser),zB("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){const s=WB(e),o=n.parse(s);function a(e,n){e||!n?i(e):r?r(n):t(void 0,n)}n.run(o,s,(function(e,t,r){if(e||!t||!r)return a(e);const i=t,s=n.stringify(i,r);var o;"string"==typeof(o=s)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(o)?r.value=s:r.result=s,a(e,r)}))}}processSync(e){let t,n=!1;return this.freeze(),VB("processSync",this.parser||this.Parser),zB("processSync",this.compiler||this.Compiler),this.process(e,(function(e,r){n=!0,CB(e),t=r})),KB("processSync","process",n),t}run(e,t,n){UB(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,s){const o=WB(t);r.run(e,o,(function(t,r,o){const a=r||e;t?s(t):i?i(a):n(void 0,a,o)}))}}runSync(e,t){let n,r=!1;return this.run(e,t,(function(e,t){CB(e),n=t,r=!0})),KB("runSync","run",r),n}stringify(e,t){this.freeze();const n=WB(t),r=this.compiler||this.Compiler;return zB("stringify",r),UB(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(HB("use",this.frozen),null==e);else if("function"==typeof e)a(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?o(e):s(e)}return this;function i(e){if("function"==typeof e)a(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;a(t,n)}else s(e)}}function s(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=SB(!0,r.settings,e.settings))}function o(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){i(e[t])}}}function a(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...s]=t;const o=n[i][1];_B(o)&&_B(r)&&(r=SB(!0,o,r)),n[i]=[e,r,...s]}}}}const BB=(new $B).freeze();function VB(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function zB(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function HB(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function UB(e){if(!_B(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function KB(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function WB(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new AB(e)}class GB{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:e=>this.replacement=e}}replace(e,t,n,r){e&&t&&(null!=n?e[t][n]=r:e[t]=r)}remove(e,t,n){e&&t&&(null!=n?e[t].splice(n,1):delete e[t])}}class qB extends GB{constructor(e,t){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:e=>this.replacement=e},this.enter=e,this.leave=t}visit(e,t,n,r){if(e){if(this.enter){const i=this.should_skip,s=this.should_remove,o=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,e,t,n,r),this.replacement&&(e=this.replacement,this.replace(t,n,r,e)),this.should_remove&&this.remove(t,n,r);const a=this.should_skip,l=this.should_remove;if(this.should_skip=i,this.should_remove=s,this.replacement=o,a)return e;if(l)return null}let i;for(i in e){const t=e[i];if(t&&"object"==typeof t)if(Array.isArray(t)){const n=t;for(let t=0;t<n.length;t+=1){const r=n[t];XB(r)&&(this.visit(r,e,i,t)||t--)}}else XB(t)&&this.visit(t,e,i,null)}if(this.leave){const i=this.replacement,s=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,e,t,n,r),this.replacement&&(e=this.replacement,this.replace(t,n,r,e)),this.should_remove&&this.remove(t,n,r);const o=this.should_remove;if(this.replacement=i,this.should_remove=s,o)return null}}return e}}function XB(e){return null!==e&&"object"==typeof e&&"type"in e&&"string"==typeof e.type}function YB(e,{enter:t,leave:n}){return new qB(t,n).visit(e,null)}function ZB(e,t){if("MemberExpression"===e.type)return!e.computed&&ZB(e.object,e);if("Identifier"===e.type){if(!t)return!0;switch(t.type){case"MemberExpression":return t.computed||e===t.object;case"MethodDefinition":return t.computed;case"PropertyDefinition":case"Property":return t.computed||e===t.value;case"ExportSpecifier":case"ImportSpecifier":return e===t.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;default:return!0}}return!1}function JB(e){const t=new WeakMap,n=new Map,r=new eV(null,!1),i=[];let s=r;YB(e,{enter(e,n){switch(e.type){case"Identifier":n&&ZB(e,n)&&i.push([s,e]);break;case"ImportDeclaration":e.specifiers.forEach((e=>{s.declarations.set(e.local.name,e)}));break;case"FunctionExpression":case"FunctionDeclaration":case"ArrowFunctionExpression":"FunctionDeclaration"===e.type?(e.id&&s.declarations.set(e.id.name,e),t.set(e,s=new eV(s,!1))):(t.set(e,s=new eV(s,!1)),"FunctionExpression"===e.type&&e.id&&s.declarations.set(e.id.name,e)),e.params.forEach((t=>{tV(t).forEach((t=>{s.declarations.set(t,e)}))}));break;case"ForStatement":case"ForInStatement":case"ForOfStatement":case"BlockStatement":t.set(e,s=new eV(s,!0));break;case"ClassDeclaration":case"VariableDeclaration":s.add_declaration(e);break;case"CatchClause":t.set(e,s=new eV(s,!0)),e.param&&tV(e.param).forEach((t=>{e.param&&s.declarations.set(t,e.param)}))}},leave(e){t.has(e)&&null!==s&&s.parent&&(s=s.parent)}});for(let e=i.length-1;e>=0;--e){const[t,r]=i[e];t.references.has(r.name)||QB(t,r.name),t.find_owner(r.name)||n.set(r.name,r)}return{map:t,scope:r,globals:n}}function QB(e,t){e.references.add(t),e.parent&&QB(e.parent,t)}class eV{constructor(e,t){this.parent=e,this.block=t,this.declarations=new Map,this.initialised_declarations=new Set,this.references=new Set}add_declaration(e){if("VariableDeclaration"===e.type)if("var"===e.kind&&this.block&&this.parent)this.parent.add_declaration(e);else{const t=t=>{tV(t.id).forEach((n=>{this.declarations.set(n,e),t.init&&this.initialised_declarations.add(n)}))};e.declarations.forEach(t)}else e.id&&this.declarations.set(e.id.name,e)}find_owner(e){return this.declarations.has(e)?this:this.parent&&this.parent.find_owner(e)}has(e){return this.declarations.has(e)||!!this.parent&&this.parent.has(e)}}function tV(e){return nV(e).map((e=>e.name))}function nV(e,t=[]){switch(e.type){case"Identifier":t.push(e);break;case"MemberExpression":let n=e;for(;"MemberExpression"===n.type;)n=n.object;t.push(n);break;case"ObjectPattern":const r=e=>{"RestElement"===e.type?nV(e.argument,t):nV(e.value,t)};e.properties.forEach(r);break;case"ArrayPattern":const i=e=>{e&&nV(e,t)};e.elements.forEach((e=>{e&&i(e)}));break;case"RestElement":nV(e.argument,t);break;case"AssignmentPattern":nV(e.left,t)}return t}function rV(e,t){const n=["start","end","loc","range","comments"];let r=-1;for(;++r<n.length;){const i=n[r];i in e&&(t[i]=e[i])}}function iV(e){return Boolean("FunctionDeclaration"===e.type||"ClassDeclaration"===e.type||"VariableDeclaration"===e.type)}function sV(e,t){let n=-1;const r=[],i=[];let s;for(;++n<e.length;){const t=e[n];"ImportNamespaceSpecifier"===t.type?s=t:i.push(t)}if(s){const e={type:"VariableDeclarator",id:s.local,init:t};rV(s,e),r.push(e)}return r.push({type:"VariableDeclarator",id:{type:"ObjectPattern",properties:i.map((function(e){let t="ImportSpecifier"===e.type?e.imported:"ExportSpecifier"===e.type?e.exported:{type:"Identifier",name:"default"},n=e.local;"ExportSpecifier"===e.type&&(n=t,t=e.local);const r={type:"Property",kind:"init",shorthand:t.name===n.name,method:!1,computed:!1,key:t,value:n};return rV(e,r),r}))},init:s?{type:"Identifier",name:s.local.name}:t}),r}function oV(e){let t,n=-1;for(;++n<e.length;){const r=e[n],i="string"==typeof r&&MF(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};t=t?{type:"MemberExpression",object:t,property:i,computed:"Literal"===i.type,optional:!1}:i}return t.type,t}function aV(e){let t,n=-1;for(;++n<e.length;){const r=e[n];"string"==typeof r&&MF(r,{jsx:!0});const i={type:"JSXIdentifier",name:r};t=t?{type:"JSXMemberExpression",object:t,property:i}:i}return t}function lV(e){const t=e.baseUrl||void 0,n="object"==typeof t?t.href:t,r=e.outputFormat||"program",i=void 0===e.pragma?"React.createElement":e.pragma,s=void 0===e.pragmaFrag?"React.Fragment":e.pragmaFrag,o=e.pragmaImportSource||"react",a=e.jsxImportSource||"react",l=e.jsxRuntime||"automatic";return function(e,t){const d=[],h=[];let u,p,f,m=0;if("classic"===l&&s&&cV(e,"@jsxFrag",s),"classic"===l&&i&&cV(e,"@jsx",i),"automatic"===l&&a&&cV(e,"@jsxImportSource",a),l&&cV(e,"@jsxRuntime",l),"classic"===l&&o){if(!i)throw new Error("Missing `pragma` in classic runtime with `pragmaImportSource`");x({type:"ImportDeclaration",specifiers:[{type:"ImportDefaultSpecifier",local:{type:"Identifier",name:i.split(".")[0]}}],source:{type:"Literal",value:o}})}for(f of e.body)if("ExportDefaultDeclaration"===f.type)u&&t.fail("Unexpected duplicate layout, expected a single layout (previous: "+YA(dF(u))+")",{ancestors:[e,f],place:dF(f),ruleId:"duplicate-layout",source:"recma-document"}),u=f,h.push({type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"MDXLayout"},init:iV(f.declaration)?(g=f.declaration,"FunctionDeclaration"===g.type?{...g,type:"FunctionExpression"}:(g.type,{...g,type:"ClassExpression"})):f.declaration}]});else if("ExportNamedDeclaration"===f.type&&f.source){const n=f.source;f.specifiers=f.specifiers.filter((function(r){if("default"===r.exported.name){u&&t.fail("Unexpected duplicate layout, expected a single layout (previous: "+YA(dF(u))+")",{ancestors:[e,f,r],place:dF(f),ruleId:"duplicate-layout",source:"recma-document"}),u=r;const i=[];if("default"===r.local.name)i.push({type:"ImportDefaultSpecifier",local:{type:"Identifier",name:"MDXLayout"}});else{const e={type:"ImportSpecifier",imported:r.local,local:{type:"Identifier",name:"MDXLayout"}};rV(r.local,e),i.push(e)}const s={type:"Literal",value:n.value};rV(n,s);const o={type:"ImportDeclaration",specifiers:i,source:s};return rV(r,o),x(o),!1}return!0})),f.specifiers.length>0&&w(f)}else"ExportNamedDeclaration"===f.type||"ExportAllDeclaration"===f.type?w(f):"ImportDeclaration"===f.type?x(f):"ExpressionStatement"!==f.type||"JSXElement"!==f.expression.type&&"JSXFragment"!==f.expression.type?h.push(f):(p=!0,h.push(...c(f.expression,r,Boolean(u))));var g;p||h.push(...c(void 0,r,Boolean(u))),d.push(["MDXContent","default"]),"function-body"===r&&h.push({type:"ReturnStatement",argument:{type:"ObjectExpression",properties:[...Array.from({length:m}).map((function(e,t){return{type:"SpreadElement",argument:{type:"Identifier",name:"_exportAll"+(t+1)}}})),...d.map((function(e){return{type:"Property",kind:"init",method:!1,computed:!1,shorthand:"string"==typeof e,key:{type:"Identifier",name:"string"==typeof e?e:e[1]},value:{type:"Identifier",name:"string"==typeof e?e:e[0]}}}))]}}),e.body=h;let y=!1,v=!1;var b;function w(e){if("ExportNamedDeclaration"===e.type)for(f of(e.declaration&&d.push(...JB(e.declaration).scope.declarations.keys()),e.specifiers))d.push(f.exported.name);x(e)}function x(e){let t,n;if("function-body"===r)if("ImportDeclaration"===e.type||"ExportAllDeclaration"===e.type||"ExportNamedDeclaration"===e.type&&e.source){e.source;const r={type:"ImportExpression",source:e.source};rV(e,r),n={type:"AwaitExpression",argument:r},t="ImportDeclaration"!==e.type&&"ExportNamedDeclaration"!==e.type||0!==e.specifiers.length?{type:"VariableDeclaration",kind:"const",declarations:"ExportAllDeclaration"===e.type?[{type:"VariableDeclarator",id:{type:"Identifier",name:"_exportAll"+ ++m},init:n}]:sV(e.specifiers,n)}:{type:"ExpressionStatement",expression:n}}else if(e.declaration)t=e.declaration;else{const n=e.specifiers.filter((function(e){return e.local.name!==e.exported.name})).map((function(e){return{type:"VariableDeclarator",id:e.exported,init:e.local}}));n.length>0&&(t={type:"VariableDeclaration",kind:"const",declarations:n})}else t=e;t&&h.push(t)}(n||"function-body"===r)&&YB(e,{enter(e){if(("ExportAllDeclaration"===e.type||"ExportNamedDeclaration"===e.type||"ImportDeclaration"===e.type)&&e.source){let t=e.source.value;try{new URL(t)}catch{(t.startsWith("/")||t.startsWith("./")||t.startsWith("../"))&&(t=new URL(t,n).href)}const r={type:"Literal",value:t};return rV(e.source,r),void(e.source=r)}if("ImportExpression"!==e.type){if("MemberExpression"===e.type&&"object"in e&&"MetaProperty"===e.object.type&&"Identifier"===e.property.type&&"import"===e.object.meta.name&&"meta"===e.object.property.name&&"url"===e.property.name){y=!0;const t={type:"Identifier",name:"_importMetaUrl"};rV(e,t),this.replace(t)}}else{v=!0;const t={type:"CallExpression",callee:{type:"Identifier",name:"_resolveDynamicMdxSpecifier"},arguments:[e.source],optional:!1};e.source=t}}}),v&&(n||(y=!0),e.body.push((b=n?{type:"Literal",value:n}:{type:"Identifier",name:"_importMetaUrl"},{type:"FunctionDeclaration",id:{type:"Identifier",name:"_resolveDynamicMdxSpecifier"},generator:!1,async:!1,params:[{type:"Identifier",name:"d"}],body:{type:"BlockStatement",body:[{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:!0,argument:{type:"Identifier",name:"d"}},operator:"!==",right:{type:"Literal",value:"string"}},consequent:{type:"ReturnStatement",argument:{type:"Identifier",name:"d"}},alternate:null},{type:"TryStatement",block:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"NewExpression",callee:{type:"Identifier",name:"URL"},arguments:[{type:"Identifier",name:"d"}]}},{type:"ReturnStatement",argument:{type:"Identifier",name:"d"}}]},handler:{type:"CatchClause",param:null,body:{type:"BlockStatement",body:[]}},finalizer:null},{type:"IfStatement",test:{type:"LogicalExpression",left:{type:"LogicalExpression",left:{type:"CallExpression",callee:oV(["d","startsWith"]),arguments:[{type:"Literal",value:"/"}],optional:!1},operator:"||",right:{type:"CallExpression",callee:oV(["d","startsWith"]),arguments:[{type:"Literal",value:"./"}],optional:!1}},operator:"||",right:{type:"CallExpression",callee:oV(["d","startsWith"]),arguments:[{type:"Literal",value:"../"}],optional:!1}},consequent:{type:"ReturnStatement",argument:{type:"MemberExpression",object:{type:"NewExpression",callee:{type:"Identifier",name:"URL"},arguments:[{type:"Identifier",name:"d"},b]},property:{type:"Identifier",name:"href"},computed:!1,optional:!1}},alternate:null},{type:"ReturnStatement",argument:{type:"Identifier",name:"d"}}]}}))),y&&e.body.unshift({type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"_importMetaUrl"},init:oV(["arguments",0,"baseUrl"])}],kind:"const"},{type:"IfStatement",test:{type:"UnaryExpression",operator:"!",prefix:!0,argument:{type:"Identifier",name:"_importMetaUrl"}},consequent:{type:"ThrowStatement",argument:{type:"NewExpression",callee:{type:"Identifier",name:"Error"},arguments:[{type:"Literal",value:"Unexpected missing `options.baseUrl` needed to support `export … from`, `import`, or `import.meta.url` when generating `function-body`"}]}},alternate:null})};function c(e,t,n){let r={type:"JSXElement",openingElement:{type:"JSXOpeningElement",name:{type:"JSXIdentifier",name:"MDXLayout"},attributes:[{type:"JSXSpreadAttribute",argument:{type:"Identifier",name:"props"}}],selfClosing:!1},closingElement:{type:"JSXClosingElement",name:{type:"JSXIdentifier",name:"MDXLayout"}},children:[{type:"JSXElement",openingElement:{type:"JSXOpeningElement",name:{type:"JSXIdentifier",name:"_createMdxContent"},attributes:[{type:"JSXSpreadAttribute",argument:{type:"Identifier",name:"props"}}],selfClosing:!0},closingElement:null,children:[]}]};n||(r={type:"ConditionalExpression",test:{type:"Identifier",name:"MDXLayout"},consequent:r,alternate:{type:"CallExpression",callee:{type:"Identifier",name:"_createMdxContent"},arguments:[{type:"Identifier",name:"props"}],optional:!1}});let i=e||{type:"Identifier",name:"undefined"};"JSXFragment"===i.type&&1===i.children.length&&"JSXElement"===i.children[0].type&&(i=i.children[0]);let s=!1;YB(i,{enter(e){if("ArrowFunctionExpression"===e.type||"FunctionDeclaration"===e.type||"FunctionExpression"===e.type)return this.skip();("AwaitExpression"===e.type||"ForOfStatement"===e.type&&e.await)&&(s=!0)}});const o={type:"FunctionDeclaration",id:{type:"Identifier",name:"MDXContent"},params:[{type:"AssignmentPattern",left:{type:"Identifier",name:"props"},right:{type:"ObjectExpression",properties:[]}}],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:r}]}};return[{type:"FunctionDeclaration",async:s,id:{type:"Identifier",name:"_createMdxContent"},params:[{type:"Identifier",name:"props"}],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:i}]}},"program"===t?{type:"ExportDefaultDeclaration",declaration:o}:o]}}function cV(e,t,n){e.comments?.unshift({type:"Block",value:t+" "+n,data:{_mdxIsPragmaComment:!0}})}const dV=/@(jsx|jsxFrag|jsxImportSource|jsxRuntime)\s+(\S+)/g;function hV(e){let t;if(e.value)if("JSXExpressionContainer"===e.value.type){const n=e.value.expression;n.type,t=n}else{const n=e.value;"JSXElement"!==n.type&&n.type,t=n,delete t.raw}else t={type:"Literal",value:!0};const n={type:"Property",key:uV(e.name),value:t,kind:"init",method:!1,shorthand:!1,computed:!1};return fV(e,n),n}function uV(e){let t;if("JSXMemberExpression"===e.type){const n=uV(e.property);t={type:"MemberExpression",object:uV(e.object),property:n,computed:"Literal"===n.type,optional:!1}}else t="JSXNamespacedName"===e.type?{type:"Literal",value:e.namespace.name+":"+e.name.name}:MF(e.name)?{type:"Identifier",name:e.name}:{type:"Literal",value:e.name};return fV(e,t),t}function pV(e){const t=e.split(".");let n,r=-1;for(;++r<t.length;){const e=MF(t[r])?{type:"Identifier",name:t[r]}:{type:"Literal",value:t[r]};n=n?{type:"MemberExpression",object:n,property:e,computed:Boolean(r&&"Literal"===e.type),optional:!1}:e}return n}function fV(e,t){const n=["start","end","loc","range","comments"];let r=-1;for(;++r<n.length;){const i=n[r];i in e&&(t[i]=e[i])}}function mV(e){const{development:t,outputFormat:n}=e||{};return function(e,r){if(function(e,t){const n=t||{};let r="automatic"===n.runtime;const i={},s={};YB(e,{enter(e){if("Program"===e.type){const t=e.comments||[];let n=-1;for(;++n<t.length;){dV.lastIndex=0;let e=dV.exec(t[n].value);for(;e;)i[e[1]]=e[2],e=dV.exec(t[n].value)}if(i.jsxRuntime)if("automatic"===i.jsxRuntime){if(r=!0,i.jsx)throw new Error("Unexpected `@jsx` pragma w/ automatic runtime");if(i.jsxFrag)throw new Error("Unexpected `@jsxFrag` pragma w/ automatic runtime")}else{if("classic"!==i.jsxRuntime)throw new Error("Unexpected `jsxRuntime` `"+i.jsxRuntime+"`, expected `automatic` or `classic`");if(r=!1,i.jsxImportSource)throw new Error("Unexpected `@jsxImportSource` w/ classic runtime")}}},leave(e){if("Program"===e.type){const t=[];if(s.fragment&&t.push({type:"ImportSpecifier",imported:{type:"Identifier",name:"Fragment"},local:{type:"Identifier",name:"_Fragment"}}),s.jsx&&t.push({type:"ImportSpecifier",imported:{type:"Identifier",name:"jsx"},local:{type:"Identifier",name:"_jsx"}}),s.jsxs&&t.push({type:"ImportSpecifier",imported:{type:"Identifier",name:"jsxs"},local:{type:"Identifier",name:"_jsxs"}}),s.jsxDEV&&t.push({type:"ImportSpecifier",imported:{type:"Identifier",name:"jsxDEV"},local:{type:"Identifier",name:"_jsxDEV"}}),t.length>0){let r=0;for(;r<e.body.length;){const t=e.body[r];if(!("directive"in t)||!t.directive)break;r++}e.body.splice(r,0,{type:"ImportDeclaration",specifiers:t,source:{type:"Literal",value:(i.jsxImportSource||n.importSource||"react")+(n.development?"/jsx-dev-runtime":"/jsx-runtime")}})}}if("JSXElement"!==e.type&&"JSXFragment"!==e.type)return;const t=[];let o,a=-1;for(;++a<e.children.length;){const n=e.children[a];if("JSXExpressionContainer"===n.type)"JSXEmptyExpression"!==n.expression.type&&t.push(n.expression);else if("JSXText"===n.type){const e=n.value.replace(/\t/g," ").replace(/ *(\r?\n|\r) */g,"\n").replace(/\n+/g,"\n").replace(/\n+$/,"").replace(/^\n+/,"").replace(/\n/g," ");if(e){const r={type:"Literal",value:e};fV(n,r),t.push(r)}}else"JSXElement"!==n.type&&"JSXFragment"!==n.type&&n.type,t.push(n)}const l=[];let c,d,h=[];if("JSXElement"===e.type){if(o=uV(e.openingElement.name),"Identifier"===o.type&&/^[a-z]/.test(o.name)){const e={type:"Literal",value:o.name};fV(o,e),o=e}let t;const n=e.openingElement.attributes;let i=-1;for(;++i<n.length;){const e=n[i];if("JSXSpreadAttribute"===e.type)"ObjectExpression"===e.argument.type?l.push(...e.argument.properties):l.push({type:"SpreadElement",argument:e.argument}),t=!0;else{const n=hV(e);if(r&&"Identifier"===n.key.type&&"key"===n.key.name){if(t)throw new Error("Expected `key` to come before any spread expressions");const e=n.value;"AssignmentPattern"!==e.type&&"ArrayPattern"!==e.type&&"ObjectPattern"!==e.type&&e.type,c=e}else l.push(n)}}}else r?(s.fragment=!0,o={type:"Identifier",name:"_Fragment"}):o=pV(i.jsxFrag||n.pragmaFrag||"React.Fragment");if(r?t.length>0&&l.push({type:"Property",key:{type:"Identifier",name:"children"},value:t.length>1?{type:"ArrayExpression",elements:t}:t[0],kind:"init",method:!1,shorthand:!1,computed:!1}):h=t,r){h.push({type:"ObjectExpression",properties:l}),c?h.push(c):n.development&&h.push({type:"Identifier",name:"undefined"});const r=t.length>1;if(n.development){s.jsxDEV=!0,d={type:"Identifier",name:"_jsxDEV"},h.push({type:"Literal",value:r});const t={type:"ObjectExpression",properties:[{type:"Property",method:!1,shorthand:!1,computed:!1,kind:"init",key:{type:"Identifier",name:"fileName"},value:{type:"Literal",value:n.filePath||"<source.js>"}}]};e.loc&&t.properties.push({type:"Property",method:!1,shorthand:!1,computed:!1,kind:"init",key:{type:"Identifier",name:"lineNumber"},value:{type:"Literal",value:e.loc.start.line}},{type:"Property",method:!1,shorthand:!1,computed:!1,kind:"init",key:{type:"Identifier",name:"columnNumber"},value:{type:"Literal",value:e.loc.start.column+1}}),h.push(t,{type:"ThisExpression"})}else r?(s.jsxs=!0,d={type:"Identifier",name:"_jsxs"}):(s.jsx=!0,d={type:"Identifier",name:"_jsx"})}else l.length>0?h.unshift({type:"ObjectExpression",properties:l}):h.length>0&&h.unshift({type:"Literal",value:null}),d=pV(i.jsx||n.pragma||"React.createElement");h.unshift(o);const u={type:"CallExpression",callee:d,arguments:h,optional:!1};fV(e,u),this.replace(u)}})}(e,{development:t,filePath:r.history[0]}),e.comments&&(e.comments=e.comments.filter((function(e){return!e.data?._mdxIsPragmaComment}))),"function-body"===n){let t=0;for(;t<e.body.length;){const n=e.body[t];if(!("directive"in n)||!n.directive)break;t++}const n=e.body[t];n&&"ImportDeclaration"===n.type&&"string"==typeof n.source.value&&/\/jsx-(dev-)?runtime$/.test(n.source.value)&&(e.body[t]={type:"VariableDeclaration",kind:"const",declarations:sV(n.specifiers,oV(["arguments",0]))})}}}function gV(e){let t,n=-1;for(;++n<e.length;){const r=e[n];t=t?{type:"BinaryExpression",left:t,operator:"+",right:r}:r}return t}function yV(e){const{development:t,outputFormat:n,providerImportSource:r}=e;return function(e,i){const s=JB(e),o=[];let a,l=!1,c=!1;if(YB(e,{enter(e){const t=s.map.get(e);"FunctionDeclaration"!==e.type&&"FunctionExpression"!==e.type&&"ArrowFunctionExpression"!==e.type||(o.push({components:[],idToInvalidComponentName:new Map,node:e,objects:[],references:{},tags:[]}),vV(e,"MDXContent")&&t&&!bV(t,"MDXLayout")&&o[0].components.push("MDXLayout"));const n=o[0];if(n&&(vV(n.node,"_createMdxContent")||r)&&(t&&(t.node=e,a=t),a&&"JSXElement"===e.type)){let t=e.openingElement.name;if("JSXMemberExpression"===t.type){const r=[];for(;"JSXMemberExpression"===t.type;)r.unshift(t.property.name),t=t.object;r.unshift(t.name);const i=r.join("."),s=t.name,o=bV(a,s);if(!Object.hasOwn(n.references,i)){const t=a.parent;(!o||t&&"FunctionDeclaration"===t.node.type&&vV(t.node,"_createMdxContent"))&&(n.references[i]={component:!0,node:e})}n.objects.includes(s)||o||n.objects.push(s)}else if("JSXNamespacedName"===t.type);else if(MF(t.name)&&!/^[a-z]/.test(t.name)){const r=t.name;bV(a,r)||("MDXLayout"===r||Object.hasOwn(n.references,r)||(n.references[r]={component:!0,node:e}),n.components.includes(r)||n.components.push(r))}else if(e.data&&e.data._mdxExplicitJsx);else{const r=t.name;n.tags.includes(r)||n.tags.push(r);let i=["_components",r];if(!1===MF(r)){let e=n.idToInvalidComponentName.get(r);void 0===e&&(e=`_component${n.idToInvalidComponentName.size}`,n.idToInvalidComponentName.set(r,e)),i=[e]}e.openingElement.name=aV(i),e.closingElement&&(e.closingElement.name=aV(i))}}},leave(e){const n=[],i=[],s=[],d=[];if(a&&a.node===e&&(a=a.parent),"FunctionDeclaration"===e.type||"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type){const a=e,h=o[o.length-1];let u;for(u of h.tags.sort())n.push({type:"Property",kind:"init",key:MF(u)?{type:"Identifier",name:u}:{type:"Literal",value:u},value:{type:"Literal",value:u},method:!1,shorthand:!1,computed:!1});for(u of(i.push(...h.components),h.objects))i.includes(u)||i.push(u);i.sort();const p=[];if(n.length>0||i.length>0||h.idToInvalidComponentName.size>0){if(r&&(l=!0,s.push({type:"CallExpression",callee:{type:"Identifier",name:"_provideComponents"},arguments:[],optional:!1})),(vV(h.node,"MDXContent")||vV(h.node,"_createMdxContent"))&&s.push(oV(["props","components"])),n.length>0||s.length>1)for(const e of s)n.push({type:"SpreadElement",argument:e});let e,t=n.length>0?{type:"ObjectExpression",properties:n}:{type:"LogicalExpression",operator:"||",left:s[0],right:{type:"ObjectExpression",properties:[]}};if(i.length>0&&(e={type:"ObjectPattern",properties:i.map((function(e){return{type:"Property",kind:"init",key:{type:"Identifier",name:"MDXLayout"===e?"wrapper":e},value:{type:"Identifier",name:e},method:!1,shorthand:"MDXLayout"!==e,computed:!1}}))}),h.tags.length>0&&(d.push({type:"VariableDeclarator",id:{type:"Identifier",name:"_components"},init:t}),t={type:"Identifier",name:"_components"}),vV(h.node,"_createMdxContent"))for(const[e,t]of[...h.idToInvalidComponentName].sort((function([e],[t]){return e.localeCompare(t)})))d.push({type:"VariableDeclarator",id:{type:"Identifier",name:t},init:{type:"MemberExpression",object:{type:"Identifier",name:"_components"},property:{type:"Literal",value:e},computed:!0,optional:!1}});e&&d.push({type:"VariableDeclarator",id:e,init:t}),d.length>0&&p.push({type:"VariableDeclaration",kind:"const",declarations:d})}let f;for(f in h.references)if(Object.hasOwn(h.references,f)){const e=f.split(".");let t=0;for(;++t<e.length;){const n=e.slice(0,t).join(".");Object.hasOwn(h.references,n)||(h.references[n]={component:!1,node:h.references[f].node})}}const m=Object.keys(h.references).sort();let g=-1;for(;++g<m.length;){const e=m[g],n=h.references[e],r=YA(dF(n.node)),i=[{type:"Literal",value:e},{type:"Literal",value:n.component}];c=!0,t&&r&&i.push({type:"Literal",value:r}),p.push({type:"IfStatement",test:{type:"UnaryExpression",operator:"!",prefix:!0,argument:oV(e.split("."))},consequent:{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"_missingMdxReference"},arguments:i,optional:!1}},alternate:void 0})}p.length>0&&("BlockStatement"!==a.body.type&&(a.body={type:"BlockStatement",body:[{type:"ReturnStatement",argument:a.body}]}),a.body.body.unshift(...p)),o.pop()}}}),l&&r&&e.body.unshift(function(e,t){const n=[{type:"ImportSpecifier",imported:{type:"Identifier",name:"useMDXComponents"},local:{type:"Identifier",name:"_provideComponents"}}];return"function-body"===t?{type:"VariableDeclaration",kind:"const",declarations:sV(n,oV(["arguments",0]))}:{type:"ImportDeclaration",specifiers:n,source:{type:"Literal",value:e}}}(r,n)),c){const n=[{type:"Literal",value:"Expected "},{type:"ConditionalExpression",test:{type:"Identifier",name:"component"},consequent:{type:"Literal",value:"component"},alternate:{type:"Literal",value:"object"}},{type:"Literal",value:" `"},{type:"Identifier",name:"id"},{type:"Literal",value:"` to be defined: you likely forgot to import, pass, or provide it."}],r=[{type:"Identifier",name:"id"},{type:"Identifier",name:"component"}];t&&(n.push({type:"ConditionalExpression",test:{type:"Identifier",name:"place"},consequent:gV([{type:"Literal",value:"\nIt’s referenced in your code at `"},{type:"Identifier",name:"place"},{type:"Literal",value:(i.path?"` in `"+i.path:"")+"`"}]),alternate:{type:"Literal",value:""}}),r.push({type:"Identifier",name:"place"})),e.body.push({type:"FunctionDeclaration",id:{type:"Identifier",name:"_missingMdxReference"},generator:!1,async:!1,params:r,body:{type:"BlockStatement",body:[{type:"ThrowStatement",argument:{type:"NewExpression",callee:{type:"Identifier",name:"Error"},arguments:[gV(n)]}}]}})}"function-body"===n&&e.body.unshift({type:"ExpressionStatement",expression:{type:"Literal",value:"use strict"},directive:"use strict"})}}function vV(e,t){return Boolean(e&&"id"in e&&e.id&&e.id.name===t)}function bV(e,t){let n=e;for(;n;){if(n.declarations.has(t))return!0;n=n.parent||void 0}return!1}const{stringify:wV}=JSON;if(!String.prototype.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");const xV={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},EV=17,CV={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:EV,ClassExpression:EV,FunctionExpression:EV,ObjectExpression:EV,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function SV(e,t){const{generator:n}=e;if(e.write("("),null!=t&&t.length>0){n[t[0].type](t[0],e);const{length:r}=t;for(let i=1;i<r;i++){const r=t[i];e.write(", "),n[r.type](r,e)}}e.write(")")}function _V(e,t,n,r){const i=e.expressionsPrecedence[t.type];if(i===EV)return!0;const s=e.expressionsPrecedence[n.type];return i!==s?!r&&15===i&&14===s&&"**"===n.operator||i<s:(13===i||14===i)&&("**"===t.operator&&"**"===n.operator?!r:13===i&&13===s&&("??"===t.operator||"??"===n.operator)||(r?xV[t.operator]<=xV[n.operator]:xV[t.operator]<xV[n.operator]))}function kV(e,t,n,r){const{generator:i}=e;_V(e,t,n,r)?(e.write("("),i[t.type](t,e),e.write(")")):i[t.type](t,e)}function OV(e,t,n,r){const i=t.split("\n"),s=i.length-1;if(e.write(i[0].trim()),s>0){e.write(r);for(let t=1;t<s;t++)e.write(n+i[t].trim()+r);e.write(n+i[s].trim())}}function TV(e,t,n,r){const{length:i}=t;for(let s=0;s<i;s++){const i=t[s];e.write(n),"L"===i.type[0]?e.write("// "+i.value.trim()+"\n",i):(e.write("/*"),OV(e,i.value,n,r),e.write("*/"+r))}}function PV(e,t){const{generator:n}=e,{declarations:r}=t;e.write(t.kind+" ");const{length:i}=r;if(i>0){n.VariableDeclarator(r[0],e);for(let t=1;t<i;t++)e.write(", "),n.VariableDeclarator(r[t],e)}}let IV,MV,RV,AV,NV,DV;const LV={Program(e,t){const n=t.indent.repeat(t.indentLevel),{lineEnd:r,writeComments:i}=t;i&&null!=e.comments&&TV(t,e.comments,n,r);const s=e.body,{length:o}=s;for(let e=0;e<o;e++){const o=s[e];i&&null!=o.comments&&TV(t,o.comments,n,r),t.write(n),this[o.type](o,t),t.write(r)}i&&null!=e.trailingComments&&TV(t,e.trailingComments,n,r)},BlockStatement:DV=function(e,t){const n=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:i}=t,s=n+t.indent;t.write("{");const o=e.body;if(null!=o&&o.length>0){t.write(r),i&&null!=e.comments&&TV(t,e.comments,s,r);const{length:a}=o;for(let e=0;e<a;e++){const n=o[e];i&&null!=n.comments&&TV(t,n.comments,s,r),t.write(s),this[n.type](n,t),t.write(r)}t.write(n)}else i&&null!=e.comments&&(t.write(r),TV(t,e.comments,s,r),t.write(n));i&&null!=e.trailingComments&&TV(t,e.trailingComments,s,r),t.write("}"),t.indentLevel--},ClassBody:DV,StaticBlock(e,t){t.write("static "),this.BlockStatement(e,t)},EmptyStatement(e,t){t.write(";")},ExpressionStatement(e,t){const n=t.expressionsPrecedence[e.expression.type];n===EV||3===n&&"O"===e.expression.left.type[0]?(t.write("("),this[e.expression.type](e.expression,t),t.write(")")):this[e.expression.type](e.expression,t),t.write(";")},IfStatement(e,t){t.write("if ("),this[e.test.type](e.test,t),t.write(") "),this[e.consequent.type](e.consequent,t),null!=e.alternate&&(t.write(" else "),this[e.alternate.type](e.alternate,t))},LabeledStatement(e,t){this[e.label.type](e.label,t),t.write(": "),this[e.body.type](e.body,t)},BreakStatement(e,t){t.write("break"),null!=e.label&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},ContinueStatement(e,t){t.write("continue"),null!=e.label&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},WithStatement(e,t){t.write("with ("),this[e.object.type](e.object,t),t.write(") "),this[e.body.type](e.body,t)},SwitchStatement(e,t){const n=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:i}=t;t.indentLevel++;const s=n+t.indent,o=s+t.indent;t.write("switch ("),this[e.discriminant.type](e.discriminant,t),t.write(") {"+r);const{cases:a}=e,{length:l}=a;for(let e=0;e<l;e++){const n=a[e];i&&null!=n.comments&&TV(t,n.comments,s,r),n.test?(t.write(s+"case "),this[n.test.type](n.test,t),t.write(":"+r)):t.write(s+"default:"+r);const{consequent:l}=n,{length:c}=l;for(let e=0;e<c;e++){const n=l[e];i&&null!=n.comments&&TV(t,n.comments,o,r),t.write(o),this[n.type](n,t),t.write(r)}}t.indentLevel-=2,t.write(n+"}")},ReturnStatement(e,t){t.write("return"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t)),t.write(";")},ThrowStatement(e,t){t.write("throw "),this[e.argument.type](e.argument,t),t.write(";")},TryStatement(e,t){if(t.write("try "),this[e.block.type](e.block,t),e.handler){const{handler:n}=e;null==n.param?t.write(" catch "):(t.write(" catch ("),this[n.param.type](n.param,t),t.write(") ")),this[n.body.type](n.body,t)}e.finalizer&&(t.write(" finally "),this[e.finalizer.type](e.finalizer,t))},WhileStatement(e,t){t.write("while ("),this[e.test.type](e.test,t),t.write(") "),this[e.body.type](e.body,t)},DoWhileStatement(e,t){t.write("do "),this[e.body.type](e.body,t),t.write(" while ("),this[e.test.type](e.test,t),t.write(");")},ForStatement(e,t){if(t.write("for ("),null!=e.init){const{init:n}=e;"V"===n.type[0]?PV(t,n):this[n.type](n,t)}t.write("; "),e.test&&this[e.test.type](e.test,t),t.write("; "),e.update&&this[e.update.type](e.update,t),t.write(") "),this[e.body.type](e.body,t)},ForInStatement:IV=function(e,t){t.write(`for ${e.await?"await ":""}(`);const{left:n}=e;"V"===n.type[0]?PV(t,n):this[n.type](n,t),t.write("I"===e.type[3]?" in ":" of "),this[e.right.type](e.right,t),t.write(") "),this[e.body.type](e.body,t)},ForOfStatement:IV,DebuggerStatement(e,t){t.write("debugger;",e)},FunctionDeclaration:MV=function(e,t){t.write((e.async?"async ":"")+(e.generator?"function* ":"function ")+(e.id?e.id.name:""),e),SV(t,e.params),t.write(" "),this[e.body.type](e.body,t)},FunctionExpression:MV,VariableDeclaration(e,t){PV(t,e),t.write(";")},VariableDeclarator(e,t){this[e.id.type](e.id,t),null!=e.init&&(t.write(" = "),this[e.init.type](e.init,t))},ClassDeclaration(e,t){if(t.write("class "+(e.id?`${e.id.name} `:""),e),e.superClass){t.write("extends ");const{superClass:n}=e,{type:r}=n,i=t.expressionsPrecedence[r];"C"===r[0]&&"l"===r[1]&&"E"===r[5]||!(i===EV||i<t.expressionsPrecedence.ClassExpression)?this[n.type](n,t):(t.write("("),this[e.superClass.type](n,t),t.write(")")),t.write(" ")}this.ClassBody(e.body,t)},ImportDeclaration(e,t){t.write("import ");const{specifiers:n,attributes:r}=e,{length:i}=n;let s=0;if(i>0){for(;s<i;){s>0&&t.write(", ");const e=n[s],r=e.type[6];if("D"===r)t.write(e.local.name,e),s++;else{if("N"!==r)break;t.write("* as "+e.local.name,e),s++}}if(s<i){for(t.write("{");;){const e=n[s],{name:r}=e.imported;if(t.write(r,e),r!==e.local.name&&t.write(" as "+e.local.name),!(++s<i))break;t.write(", ")}t.write("}")}t.write(" from ")}if(this.Literal(e.source,t),r&&r.length>0){t.write(" with { ");for(let e=0;e<r.length;e++)this.ImportAttribute(r[e],t),e<r.length-1&&t.write(", ");t.write(" }")}t.write(";")},ImportAttribute(e,t){this.Identifier(e.key,t),t.write(": "),this.Literal(e.value,t)},ImportExpression(e,t){t.write("import("),this[e.source.type](e.source,t),t.write(")")},ExportDefaultDeclaration(e,t){t.write("export default "),this[e.declaration.type](e.declaration,t),null!=t.expressionsPrecedence[e.declaration.type]&&"F"!==e.declaration.type[0]&&t.write(";")},ExportNamedDeclaration(e,t){if(t.write("export "),e.declaration)this[e.declaration.type](e.declaration,t);else{t.write("{");const{specifiers:n}=e,{length:r}=n;if(r>0)for(let e=0;;){const i=n[e],{name:s}=i.local;if(t.write(s,i),s!==i.exported.name&&t.write(" as "+i.exported.name),!(++e<r))break;t.write(", ")}if(t.write("}"),e.source&&(t.write(" from "),this.Literal(e.source,t)),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let n=0;n<e.attributes.length;n++)this.ImportAttribute(e.attributes[n],t),n<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")}},ExportAllDeclaration(e,t){if(null!=e.exported?t.write("export * as "+e.exported.name+" from "):t.write("export * from "),this.Literal(e.source,t),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let n=0;n<e.attributes.length;n++)this.ImportAttribute(e.attributes[n],t),n<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")},MethodDefinition(e,t){e.static&&t.write("static ");const n=e.kind[0];"g"!==n&&"s"!==n||t.write(e.kind+" "),e.value.async&&t.write("async "),e.value.generator&&t.write("*"),e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),SV(t,e.value.params),t.write(" "),this[e.value.body.type](e.value.body,t)},ClassExpression(e,t){this.ClassDeclaration(e,t)},ArrowFunctionExpression(e,t){t.write(e.async?"async ":"",e);const{params:n}=e;null!=n&&(1===n.length&&"I"===n[0].type[0]?t.write(n[0].name,n[0]):SV(t,e.params)),t.write(" => "),"O"===e.body.type[0]?(t.write("("),this.ObjectExpression(e.body,t),t.write(")")):this[e.body.type](e.body,t)},ThisExpression(e,t){t.write("this",e)},Super(e,t){t.write("super",e)},RestElement:RV=function(e,t){t.write("..."),this[e.argument.type](e.argument,t)},SpreadElement:RV,YieldExpression(e,t){t.write(e.delegate?"yield*":"yield"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t))},AwaitExpression(e,t){t.write("await ",e),kV(t,e.argument,e)},TemplateLiteral(e,t){const{quasis:n,expressions:r}=e;t.write("`");const{length:i}=r;for(let e=0;e<i;e++){const i=r[e],s=n[e];t.write(s.value.raw,s),t.write("${"),this[i.type](i,t),t.write("}")}const s=n[n.length-1];t.write(s.value.raw,s),t.write("`")},TemplateElement(e,t){t.write(e.value.raw,e)},TaggedTemplateExpression(e,t){kV(t,e.tag,e),this[e.quasi.type](e.quasi,t)},ArrayExpression:NV=function(e,t){if(t.write("["),e.elements.length>0){const{elements:n}=e,{length:r}=n;for(let e=0;;){const i=n[e];if(null!=i&&this[i.type](i,t),!(++e<r)){null==i&&t.write(", ");break}t.write(", ")}}t.write("]")},ArrayPattern:NV,ObjectExpression(e,t){const n=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:i}=t,s=n+t.indent;if(t.write("{"),e.properties.length>0){t.write(r),i&&null!=e.comments&&TV(t,e.comments,s,r);const o=","+r,{properties:a}=e,{length:l}=a;for(let e=0;;){const n=a[e];if(i&&null!=n.comments&&TV(t,n.comments,s,r),t.write(s),this[n.type](n,t),!(++e<l))break;t.write(o)}t.write(r),i&&null!=e.trailingComments&&TV(t,e.trailingComments,s,r),t.write(n+"}")}else i?null!=e.comments?(t.write(r),TV(t,e.comments,s,r),null!=e.trailingComments&&TV(t,e.trailingComments,s,r),t.write(n+"}")):null!=e.trailingComments?(t.write(r),TV(t,e.trailingComments,s,r),t.write(n+"}")):t.write("}"):t.write("}");t.indentLevel--},Property(e,t){e.method||"i"!==e.kind[0]?this.MethodDefinition(e,t):(e.shorthand||(e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),t.write(": ")),this[e.value.type](e.value,t))},PropertyDefinition(e,t){e.static&&t.write("static "),e.computed&&t.write("["),this[e.key.type](e.key,t),e.computed&&t.write("]"),null!=e.value?(t.write(" = "),this[e.value.type](e.value,t),t.write(";")):"F"!==e.key.type[0]&&t.write(";")},ObjectPattern(e,t){if(t.write("{"),e.properties.length>0){const{properties:n}=e,{length:r}=n;for(let e=0;this[n[e].type](n[e],t),++e<r;)t.write(", ")}t.write("}")},SequenceExpression(e,t){SV(t,e.expressions)},UnaryExpression(e,t){if(e.prefix){const{operator:n,argument:r,argument:{type:i}}=e;t.write(n);const s=_V(t,r,e);s||!(n.length>1)&&("U"!==i[0]||"n"!==i[1]&&"p"!==i[1]||!r.prefix||r.operator[0]!==n||"+"!==n&&"-"!==n)||t.write(" "),s?(t.write(n.length>1?" (":"("),this[i](r,t),t.write(")")):this[i](r,t)}else this[e.argument.type](e.argument,t),t.write(e.operator)},UpdateExpression(e,t){e.prefix?(t.write(e.operator),this[e.argument.type](e.argument,t)):(this[e.argument.type](e.argument,t),t.write(e.operator))},AssignmentExpression(e,t){this[e.left.type](e.left,t),t.write(" "+e.operator+" "),this[e.right.type](e.right,t)},AssignmentPattern(e,t){this[e.left.type](e.left,t),t.write(" = "),this[e.right.type](e.right,t)},BinaryExpression:AV=function(e,t){const n="in"===e.operator;n&&t.write("("),kV(t,e.left,e,!1),t.write(" "+e.operator+" "),kV(t,e.right,e,!0),n&&t.write(")")},LogicalExpression:AV,ConditionalExpression(e,t){const{test:n}=e,r=t.expressionsPrecedence[n.type];r===EV||r<=t.expressionsPrecedence.ConditionalExpression?(t.write("("),this[n.type](n,t),t.write(")")):this[n.type](n,t),t.write(" ? "),this[e.consequent.type](e.consequent,t),t.write(" : "),this[e.alternate.type](e.alternate,t)},NewExpression(e,t){t.write("new ");const n=t.expressionsPrecedence[e.callee.type];n===EV||n<t.expressionsPrecedence.CallExpression||function(e){let t=e;for(;null!=t;){const{type:e}=t;if("C"===e[0]&&"a"===e[1])return!0;if("M"!==e[0]||"e"!==e[1]||"m"!==e[2])return!1;t=t.object}}(e.callee)?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),SV(t,e.arguments)},CallExpression(e,t){const n=t.expressionsPrecedence[e.callee.type];n===EV||n<t.expressionsPrecedence.CallExpression?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),e.optional&&t.write("?."),SV(t,e.arguments)},ChainExpression(e,t){this[e.expression.type](e.expression,t)},MemberExpression(e,t){const n=t.expressionsPrecedence[e.object.type];n===EV||n<t.expressionsPrecedence.MemberExpression?(t.write("("),this[e.object.type](e.object,t),t.write(")")):this[e.object.type](e.object,t),e.computed?(e.optional&&t.write("?."),t.write("["),this[e.property.type](e.property,t),t.write("]")):(e.optional?t.write("?."):t.write("."),this[e.property.type](e.property,t))},MetaProperty(e,t){t.write(e.meta.name+"."+e.property.name,e)},Identifier(e,t){t.write(e.name,e)},PrivateIdentifier(e,t){t.write(`#${e.name}`,e)},Literal(e,t){null!=e.raw?t.write(e.raw,e):null!=e.regex?this.RegExpLiteral(e,t):null!=e.bigint?t.write(e.bigint+"n",e):t.write(wV(e.value),e)},RegExpLiteral(e,t){const{regex:n}=e;t.write(`/${n.pattern}/${n.flags}`,e)}},FV={};class jV{constructor(e){const t=null==e?FV:e;this.output="",null!=t.output?(this.output=t.output,this.write=this.writeToStream):this.output="",this.generator=null!=t.generator?t.generator:LV,this.expressionsPrecedence=null!=t.expressionsPrecedence?t.expressionsPrecedence:CV,this.indent=null!=t.indent?t.indent:" ",this.lineEnd=null!=t.lineEnd?t.lineEnd:"\n",this.indentLevel=null!=t.startingIndentLevel?t.startingIndentLevel:0,this.writeComments=!!t.comments&&t.comments,null!=t.sourceMap&&(this.write=null==t.output?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=t.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split("\n").length-1,this.mapping={original:null,generated:this,name:void 0,source:t.sourceMap.file||t.sourceMap._file})}write(e){this.output+=e}writeToStream(e){this.output.write(e)}writeAndMap(e,t){this.output+=e,this.map(e,t)}writeToStreamAndMap(e,t){this.output.write(e),this.map(e,t)}map(e,t){if(null!=t){const{type:n}=t;if("L"===n[0]&&"n"===n[2])return this.column=0,void this.line++;if(null!=t.loc){const{mapping:e}=this;e.original=t.loc.start,e.name=t.name,this.sourceMap.addMapping(e)}if("T"===n[0]&&"E"===n[8]||"L"===n[0]&&"i"===n[1]&&"string"==typeof t.value){const{length:t}=e;let{column:n,line:r}=this;for(let i=0;i<t;i++)"\n"===e[i]?(n=0,r++):n++;return this.column=n,void(this.line=r)}}const{length:n}=e,{lineEnd:r}=this;n>0&&(this.lineEndSize>0&&(1===r.length?e[n-1]===r:e.endsWith(r))?(this.line+=this.lineEndSize,this.column=0):this.column+=n)}toString(){return this.output}}const $V={};function BV(e,t){const{SourceMapGenerator:n,filePath:r,handlers:i}=t||$V,s=n?new n({file:r||"<unknown>.js"}):void 0,o=function(e,t){const n=new jV(t);return n.generator[e.type](e,n),n.output}(e,{comments:!0,generator:{...LV,...i},sourceMap:s||void 0});return{value:o,map:s?s.toJSON():void 0}}const VV={JSXAttribute:function(e,t){this[e.name.type](e.name,t),null!==e.value&&void 0!==e.value&&(t.write("="),"Literal"===e.value.type?t.write('"'+zV(String(e.value.value)).replace(/"/g,""")+'"',e):this[e.value.type](e.value,t))},JSXClosingElement:function(e,t){t.write("</"),this[e.name.type](e.name,t),t.write(">")},JSXClosingFragment:function(e,t){t.write("</>",e)},JSXElement:function(e,t){let n=-1;if(this[e.openingElement.type](e.openingElement,t),e.children)for(;++n<e.children.length;){const r=e.children[n];if("JSXSpreadChild"===r.type)throw new Error("JSX spread children are not supported");this[r.type](r,t)}e.closingElement&&this[e.closingElement.type](e.closingElement,t)},JSXEmptyExpression:function(){},JSXExpressionContainer:function(e,t){t.write("{"),this[e.expression.type](e.expression,t),t.write("}")},JSXFragment:function(e,t){let n=-1;if(this[e.openingFragment.type](e.openingFragment,t),e.children)for(;++n<e.children.length;){const r=e.children[n];if("JSXSpreadChild"===r.type)throw new Error("JSX spread children are not supported");this[r.type](r,t)}this[e.closingFragment.type](e.closingFragment,t)},JSXIdentifier:function(e,t){t.write(e.name,e)},JSXMemberExpression:function(e,t){this[e.object.type](e.object,t),t.write("."),this[e.property.type](e.property,t)},JSXNamespacedName:function(e,t){this[e.namespace.type](e.namespace,t),t.write(":"),this[e.name.type](e.name,t)},JSXOpeningElement:function(e,t){let n=-1;if(t.write("<"),this[e.name.type](e.name,t),e.attributes)for(;++n<e.attributes.length;)t.write(" "),this[e.attributes[n].type](e.attributes[n],t);t.write(e.selfClosing?" />":">")},JSXOpeningFragment:function(e,t){t.write("<>",e)},JSXSpreadAttribute:function(e,t){t.write("{"),this.SpreadElement(e,t),t.write("}")},JSXText:function(e,t){t.write(zV(e.value).replace(/[<>{}]/g,HV),e)}};function zV(e){return e.replace(/&(?=[#a-z])/gi,"&")}function HV(e){return"<"===e?"<":">"===e?">":"{"===e?"{":"}"}function UV(e){const{SourceMapGenerator:t}=e;this.compiler=function(e,n){const r=BV(e,t?{SourceMapGenerator:t,filePath:n.path||"unknown.mdx",handlers:VV}:{handlers:VV});return n.map=r.map,r.value}}class KV{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function WV(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new KV(n,r,t)}function GV(e){return e.toLowerCase()}KV.prototype.property={},KV.prototype.normal={},KV.prototype.space=null;class qV{constructor(e,t){this.property=e,this.attribute=t}}qV.prototype.space=null,qV.prototype.boolean=!1,qV.prototype.booleanish=!1,qV.prototype.overloadedBoolean=!1,qV.prototype.number=!1,qV.prototype.commaSeparated=!1,qV.prototype.spaceSeparated=!1,qV.prototype.commaOrSpaceSeparated=!1,qV.prototype.mustUseProperty=!1,qV.prototype.defined=!1;let XV=0;const YV=rz(),ZV=rz(),JV=rz(),QV=rz(),ez=rz(),tz=rz(),nz=rz();function rz(){return 2**++XV}const iz=Object.keys(t);class sz extends qV{constructor(e,n,r,i){let s=-1;if(super(e,n),oz(this,"space",i),"number"==typeof r)for(;++s<iz.length;){const e=iz[s];oz(this,iz[s],(r&t[e])===t[e])}}}function oz(e,t,n){n&&(e[t]=n)}sz.prototype.defined=!0;const az={}.hasOwnProperty;function lz(e){const t={},n={};let r;for(r in e.properties)if(az.call(e.properties,r)){const i=e.properties[r],s=new sz(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[GV(r)]=r,n[GV(s.attribute)]=r}return new KV(t,n,e.space)}const cz=lz({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),dz=lz({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function hz(e,t){return t in e?e[t]:t}function uz(e,t){return hz(e,t.toLowerCase())}const pz=lz({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:uz,properties:{xmlns:null,xmlnsXLink:null}}),fz=lz({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:ZV,ariaAutoComplete:null,ariaBusy:ZV,ariaChecked:ZV,ariaColCount:QV,ariaColIndex:QV,ariaColSpan:QV,ariaControls:ez,ariaCurrent:null,ariaDescribedBy:ez,ariaDetails:null,ariaDisabled:ZV,ariaDropEffect:ez,ariaErrorMessage:null,ariaExpanded:ZV,ariaFlowTo:ez,ariaGrabbed:ZV,ariaHasPopup:null,ariaHidden:ZV,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ez,ariaLevel:QV,ariaLive:null,ariaModal:ZV,ariaMultiLine:ZV,ariaMultiSelectable:ZV,ariaOrientation:null,ariaOwns:ez,ariaPlaceholder:null,ariaPosInSet:QV,ariaPressed:ZV,ariaReadOnly:ZV,ariaRelevant:null,ariaRequired:ZV,ariaRoleDescription:ez,ariaRowCount:QV,ariaRowIndex:QV,ariaRowSpan:QV,ariaSelected:ZV,ariaSetSize:QV,ariaSort:null,ariaValueMax:QV,ariaValueMin:QV,ariaValueNow:QV,ariaValueText:null,role:null}}),mz=lz({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:uz,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:tz,acceptCharset:ez,accessKey:ez,action:null,allow:null,allowFullScreen:YV,allowPaymentRequest:YV,allowUserMedia:YV,alt:null,as:null,async:YV,autoCapitalize:null,autoComplete:ez,autoFocus:YV,autoPlay:YV,blocking:ez,capture:null,charSet:null,checked:YV,cite:null,className:ez,cols:QV,colSpan:null,content:null,contentEditable:ZV,controls:YV,controlsList:ez,coords:QV|tz,crossOrigin:null,data:null,dateTime:null,decoding:null,default:YV,defer:YV,dir:null,dirName:null,disabled:YV,download:JV,draggable:ZV,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:YV,formTarget:null,headers:ez,height:QV,hidden:YV,high:QV,href:null,hrefLang:null,htmlFor:ez,httpEquiv:ez,id:null,imageSizes:null,imageSrcSet:null,inert:YV,inputMode:null,integrity:null,is:null,isMap:YV,itemId:null,itemProp:ez,itemRef:ez,itemScope:YV,itemType:ez,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:YV,low:QV,manifest:null,max:null,maxLength:QV,media:null,method:null,min:null,minLength:QV,multiple:YV,muted:YV,name:null,nonce:null,noModule:YV,noValidate:YV,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:YV,optimum:QV,pattern:null,ping:ez,placeholder:null,playsInline:YV,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:YV,referrerPolicy:null,rel:ez,required:YV,reversed:YV,rows:QV,rowSpan:QV,sandbox:ez,scope:null,scoped:YV,seamless:YV,selected:YV,shadowRootClonable:YV,shadowRootDelegatesFocus:YV,shadowRootMode:null,shape:null,size:QV,sizes:null,slot:null,span:QV,spellCheck:ZV,src:null,srcDoc:null,srcLang:null,srcSet:null,start:QV,step:null,style:null,tabIndex:QV,target:null,title:null,translate:null,type:null,typeMustMatch:YV,useMap:null,value:ZV,width:QV,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ez,axis:null,background:null,bgColor:null,border:QV,borderColor:null,bottomMargin:QV,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:YV,declare:YV,event:null,face:null,frame:null,frameBorder:null,hSpace:QV,leftMargin:QV,link:null,longDesc:null,lowSrc:null,marginHeight:QV,marginWidth:QV,noResize:YV,noHref:YV,noShade:YV,noWrap:YV,object:null,profile:null,prompt:null,rev:null,rightMargin:QV,rules:null,scheme:null,scrolling:ZV,standby:null,summary:null,text:null,topMargin:QV,valueType:null,version:null,vAlign:null,vLink:null,vSpace:QV,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:YV,disableRemotePlayback:YV,prefix:null,property:null,results:QV,security:null,unselectable:null}}),gz=lz({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:hz,properties:{about:nz,accentHeight:QV,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:QV,amplitude:QV,arabicForm:null,ascent:QV,attributeName:null,attributeType:null,azimuth:QV,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:QV,by:null,calcMode:null,capHeight:QV,className:ez,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:QV,diffuseConstant:QV,direction:null,display:null,dur:null,divisor:QV,dominantBaseline:null,download:YV,dx:null,dy:null,edgeMode:null,editable:null,elevation:QV,enableBackground:null,end:null,event:null,exponent:QV,externalResourcesRequired:null,fill:null,fillOpacity:QV,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:tz,g2:tz,glyphName:tz,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:QV,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:QV,horizOriginX:QV,horizOriginY:QV,id:null,ideographic:QV,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:QV,k:QV,k1:QV,k2:QV,k3:QV,k4:QV,kernelMatrix:nz,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:QV,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:QV,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:QV,overlineThickness:QV,paintOrder:null,panose1:null,path:null,pathLength:QV,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ez,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:QV,pointsAtY:QV,pointsAtZ:QV,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nz,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nz,rev:nz,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nz,requiredFeatures:nz,requiredFonts:nz,requiredFormats:nz,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:QV,specularExponent:QV,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:QV,strikethroughThickness:QV,string:null,stroke:null,strokeDashArray:nz,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:QV,strokeOpacity:QV,strokeWidth:null,style:null,surfaceScale:QV,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:nz,tabIndex:QV,tableValues:null,target:null,targetX:QV,targetY:QV,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:nz,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:QV,underlineThickness:QV,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:QV,values:null,vAlphabetic:QV,vMathematical:QV,vectorEffect:null,vHanging:QV,vIdeographic:QV,version:null,vertAdvY:QV,vertOriginX:QV,vertOriginY:QV,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:QV,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),yz=WV([dz,cz,pz,fz,mz],"html"),vz=WV([dz,cz,pz,fz,gz],"svg"),bz=xz("end"),wz=xz("start");function xz(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}const Ez={}.hasOwnProperty;function Cz(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}const Sz=/^data[-\w.:]+$/i,_z=/-[a-z]/g,kz=/[A-Z]/g;function Oz(e,t){const n=GV(t);let r=t,i=qV;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Sz.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(_z,Pz);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!_z.test(e)){let n=e.replace(kz,Tz);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=sz}return new i(r,t)}function Tz(e){return"-"+e.toLowerCase()}function Pz(e){return e.charAt(1).toUpperCase()}const Iz={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};function Mz(e){return e.join(" ").trim()}const Rz=__webpack_require__("Wxh1"),Az={}.hasOwnProperty,Nz=/[A-Z]/g,Dz=/-([a-z])/g,Lz=new Set(["td","th"]);function Fz(e,t){const n={};try{Rz(e,(function(e,t){let r=e;"--"!==r.slice(0,2)&&("-ms-"===r.slice(0,4)&&(r="ms-"+r.slice(4)),r=r.replace(Dz,Bz));n[r]=t}))}catch(e){throw new Error("Could not parse `style` attribute on `"+t+"`",{cause:e})}return n}function jz(e){const t={};let n;for(n in e)Az.call(e,n)&&(t[$z(n)]=e[n]);return t}function $z(e){let t=e.replace(Nz,Vz);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function Bz(e,t){return t.toUpperCase()}function Vz(e){return"-"+e.toLowerCase()}const zz={}.hasOwnProperty,Hz=[];function Uz(e,t){const n=t?[...t].sort(Gz):Hz;n.length>0&&Kz(e,{comments:n,index:0})}function Kz(e,t){if(t.index===t.comments.length)return;const n=[],r=[];let i;for(i in e)if(zz.call(e,i)){const t=e[i];if(t&&"object"==typeof t&&"comments"!==i)if(Array.isArray(t)){let e=-1;for(;++e<t.length;)t[e]&&"string"==typeof t[e].type&&n.push(t[e])}else"string"==typeof t.type&&n.push(t)}n.sort(Gz),r.push(...Wz(t,e,!1,{leading:!0,trailing:!1}));let s=-1;for(;++s<n.length;)Kz(n[s],t);r.push(...Wz(t,e,!0,{leading:!1,trailing:n.length>0})),r.length>0&&(e.comments=r)}function Wz(e,t,n,r){const i=[];for(;e.comments[e.index]&&Gz(e.comments[e.index],t,n)<1;)i.push(Object.assign({},e.comments[e.index++],r));return i}function Gz(e,t,n){const r=n?"end":"start";return e.range&&t.range?e.range[0]-t.range[n?1:0]:e.loc&&e.loc.start&&t.loc&&t.loc[r]?e.loc.start.line-t.loc[r].line||e.loc.start.column-t.loc[r].column:"start"in e&&r in t?e.start-t[r]:Number.NaN}function qz(e,t){const n=e.data&&e.data.estree,r=n&&n.comments||[];let i;n&&(t.comments.push(...r),Uz(n,n.comments),i=n.body[0]&&"ExpressionStatement"===n.body[0].type&&n.body[0].expression||void 0),i||(i={type:"JSXEmptyExpression"},t.patch(e,i));const s={type:"JSXExpressionContainer",expression:i};return t.inherit(e,s),s}function Xz(e,t){const n=t.schema;let r=n;const i=e.attributes||[];let s=-1;e.name&&"html"===n.space&&"svg"===e.name.toLowerCase()&&(r=vz,t.schema=r);const o=t.all(e),a=[];for(;++s<i.length;){const e=i[s],n=e.value;let r;if("mdxJsxAttribute"===e.type){if(null==n)r=null;else if("object"==typeof n){const e=n.data&&n.data.estree,i=e&&e.comments||[];let s;e&&(t.comments.push(...i),Uz(e,e.comments),s=e.body[0]&&"ExpressionStatement"===e.body[0].type&&e.body[0].expression||void 0),r={type:"JSXExpressionContainer",expression:s||{type:"JSXEmptyExpression"}},t.inherit(n,r)}else r={type:"Literal",value:String(n)};const i={type:"JSXAttribute",name:t.createJsxAttributeName(e.name),value:r};t.inherit(e,i),a.push(i)}else{const n=e.data&&e.data.estree,r=n&&n.comments||[];let i;n&&(t.comments.push(...r),Uz(n,n.comments),i=n.body[0]&&"ExpressionStatement"===n.body[0].type&&n.body[0].expression&&"ObjectExpression"===n.body[0].expression.type&&n.body[0].expression.properties&&n.body[0].expression.properties[0]&&"SpreadElement"===n.body[0].expression.properties[0].type&&n.body[0].expression.properties[0].argument||void 0);const s={type:"JSXSpreadAttribute",argument:i||{type:"ObjectExpression",properties:[]}};t.inherit(e,s),a.push(s)}}t.schema=n;const l=e.name?{type:"JSXElement",openingElement:{type:"JSXOpeningElement",attributes:a,name:t.createJsxElementName(e.name),selfClosing:0===o.length},closingElement:o.length>0?{type:"JSXClosingElement",name:t.createJsxElementName(e.name)}:null,children:o}:{type:"JSXFragment",openingFragment:{type:"JSXOpeningFragment"},closingFragment:{type:"JSXClosingFragment"},children:o};return t.inherit(e,l),l}const Yz=/[ \t\n\f\r]/g;function Zz(e){return""===e.replace(Yz,"")}const Jz={comment:function(e,t){const n={type:"Block",value:e.value};t.inherit(e,n),t.comments.push(n);const r={type:"JSXEmptyExpression",comments:[Object.assign({},n,{leading:!1,trailing:!0})]};t.patch(e,r);const i={type:"JSXExpressionContainer",expression:r};return t.patch(e,i),i},doctype:function(){},element:function(e,t){const n=t.schema;let r=n;const i=e.properties||{};"html"===n.space&&"svg"===e.tagName.toLowerCase()&&(r=vz,t.schema=r);const s=t.all(e),o=[];let a,l,c;for(a in i)if(Az.call(i,a)){let n=i[a];const s=Oz(r,a);let d;if(null==n||!1===n||"number"==typeof n&&Number.isNaN(n)||!n&&s.boolean)continue;if(a="react"===t.elementAttributeNameCase&&s.space?Iz[s.property]||s.property:s.attribute,Array.isArray(n)&&(n=s.commaSeparated?Cz(n):Mz(n)),"style"===a){let r="object"==typeof n?n:Fz(String(n),e.tagName);"css"===t.stylePropertyNameCase&&(r=jz(r));const i=[];let s;for(s in r)Az.call(r,s)&&i.push({type:"Property",method:!1,shorthand:!1,computed:!1,key:MF(s)?{type:"Identifier",name:s}:{type:"Literal",value:s},value:{type:"Literal",value:String(r[s])},kind:"init"});c=i,d={type:"JSXExpressionContainer",expression:{type:"ObjectExpression",properties:i}}}else if(!0===n)d=null;else{if(t.tableCellAlignToStyle&&Lz.has(e.tagName)&&"align"===a){l=String(n);continue}d={type:"Literal",value:String(n)}}MF(a,{jsx:!0})?o.push({type:"JSXAttribute",name:{type:"JSXIdentifier",name:a},value:d}):o.push({type:"JSXSpreadAttribute",argument:{type:"ObjectExpression",properties:[{type:"Property",method:!1,shorthand:!1,computed:!1,key:{type:"Literal",value:String(a)},value:d||{type:"Literal",value:!0},kind:"init"}]}})}if(void 0!==l){c||(c=[],o.push({type:"JSXAttribute",name:{type:"JSXIdentifier",name:"style"},value:{type:"JSXExpressionContainer",expression:{type:"ObjectExpression",properties:c}}}));const e="css"===t.stylePropertyNameCase?$z("textAlign"):"textAlign";c.push({type:"Property",method:!1,shorthand:!1,computed:!1,key:MF(e)?{type:"Identifier",name:e}:{type:"Literal",value:e},value:{type:"Literal",value:l},kind:"init"})}t.schema=n;const d={type:"JSXElement",openingElement:{type:"JSXOpeningElement",attributes:o,name:t.createJsxElementName(e.tagName),selfClosing:0===s.length},closingElement:s.length>0?{type:"JSXClosingElement",name:t.createJsxElementName(e.tagName)}:null,children:s};return t.inherit(e,d),d},mdxFlowExpression:qz,mdxJsxFlowElement:Xz,mdxJsxTextElement:Xz,mdxTextExpression:qz,mdxjsEsm:function(e,t){const n=e.data&&e.data.estree,r=n&&n.comments||[];n&&(t.comments.push(...r),Uz(n,r),t.esm.push(...n.body))},root:function(e,t){const n=t.all(e),r=[];let i,s=-1;for(;++s<n.length;){const e=n[s];"JSXExpressionContainer"===e.type&&"Literal"===e.expression.type&&("object"==typeof(o=String(e.expression.value))?"text"===o.type&&Zz(o.value):Zz(o))?i&&i.push(e):(i&&r.push(...i),r.push(e),i=[])}var o;const a={type:"JSXFragment",openingFragment:{type:"JSXOpeningFragment"},closingFragment:{type:"JSXClosingFragment"},children:r};return t.inherit(e,a),a},text:function(e,t){const n=String(e.value||"");if(n){const r={type:"Literal",value:n};t.inherit(e,r);const i={type:"JSXExpressionContainer",expression:r};return t.patch(e,i),i}}};const Qz={}.hasOwnProperty,eH=new Set(["table","tbody","thead","tfoot","tr"]);function tH(e){const t=function(e,t){const n=t||{};function r(t,...n){let i=r.invalid;const s=r.handlers;if(t&&Ez.call(t,e)){const n=String(t[e]);i=Ez.call(s,n)?s[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}("type",{invalid:nH,unknown:rH,handlers:{...Jz,...e.handlers}});return{elementAttributeNameCase:e.elementAttributeNameCase||"react",schema:"svg"===e.space?vz:yz,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==e.tableCellAlignToStyle,comments:[],esm:[],all:iH,createJsxAttributeName:aH,createJsxElementName:lH,handle:function(e){return t(e,this)},inherit:sH,patch:oH}}function nH(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function rH(e){throw new Error("Cannot handle unknown node `"+e.type+"`")}function iH(e){const t=e.children||[];let n=-1;const r=[],i="html"===this.schema.space&&"element"===e.type&&eH.has(e.tagName.toLowerCase());for(;++n<t.length;){const e=t[n];if(i&&"text"===e.type&&"\n"===e.value)continue;const s=this.handle(e);Array.isArray(s)?r.push(...s):s&&r.push(s)}return r}function sH(e,t){const n=e.data;let r,i;if(oH(e,t),n){for(i in n)Qz.call(n,i)&&"estree"!==i&&(r||(r={}),r[i]=n[i]);r&&(t.data=r)}}function oH(e,t){const n=function(e){const t=wz(e),n=bz(e);if(t&&n)return{start:t,end:n}}(e);n&&void 0!==n.start.offset&&void 0!==n.end.offset&&(t.start=n.start.offset,t.end=n.end.offset,t.loc={start:{line:n.start.line,column:n.start.column-1},end:{line:n.end.line,column:n.end.column-1}},t.range=[n.start.offset,n.end.offset])}function aH(e){const t=cH(e);if("JSXMemberExpression"===t.type)throw new Error("Member expressions in attribute names are not supported");return t}function lH(e){return cH(e)}function cH(e){if(e.includes(".")){const t=e.split(".");let n=t.shift(),r={type:"JSXIdentifier",name:n};for(;n=t.shift();)r={type:"JSXMemberExpression",object:r,property:{type:"JSXIdentifier",name:n}};return r}if(e.includes(":")){const t=e.split(":");return{type:"JSXNamespacedName",namespace:{type:"JSXIdentifier",name:t[0]},name:{type:"JSXIdentifier",name:t[1]}}}return{type:"JSXIdentifier",name:e}}function dH(e){return function(t){return function(e,t){const n=tH(t||{});let r=n.handle(e);const i=n.esm;if(r){"JSXFragment"!==r.type&&"JSXElement"!==r.type&&(r={type:"JSXFragment",openingFragment:{type:"JSXOpeningFragment"},closingFragment:{type:"JSXClosingFragment"},children:[r]},n.patch(e,r));const t={type:"ExpressionStatement",expression:r};n.patch(e,t),i.push(t)}const s={type:"Program",body:i,sourceType:"module",comments:n.comments};return n.patch(e,s),s}(t,e)}}function hH(e,t,n,r){let i,s,o;"function"==typeof t&&"function"!=typeof n?(s=void 0,o=t,i=n):(s=t,o=n,i=r),tB(e,s,(function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}),i)}function uH(){return function(e){hH(e,"raw",(function(e,t,n){if(n&&"number"==typeof t)return n.children.splice(t,1),t}))}}const pH=/\s+/g,fH=/[\t\n\v\f\r ]+/g;function mH(e,t){t?"string"==typeof t&&(t={style:t}):t={};const n=t.preserveLineEndings?gH:yH;return String(e).replace("html"===t.style?fH:pH,t.trim?function(e){return t;function t(t,n,r){return 0===n||n+t.length===r.length?"":e(t)}}(n):n)}function gH(e){const t=/\r?\n|\r/.exec(e);return t?t[0]:" "}function yH(){return" "}function vH(){return function(e){hH(e,(function(e,t,n){let r=-1,i=!0,s=!1;if(n&&"number"==typeof t&&"paragraph"===e.type){const o=e.children;for(;++r<o.length;){const e=o[r];if("mdxJsxTextElement"===e.type||"mdxTextExpression"===e.type)s=!0;else if("text"!==e.type||""!==mH(e.value,{style:"html",trim:!0})){i=!1;break}}if(i&&s){r=-1;const e=[];for(;++r<o.length;){const t=o[r];"mdxJsxTextElement"===t.type&&(t.type="mdxJsxFlowElement"),"mdxTextExpression"===t.type&&(t.type="mdxFlowExpression"),"text"===t.type&&/^[\t\r\n ]+$/.test(String(t.value))||e.push(t)}return n.children.splice(t,1,...e),t}}if("mdxJsxFlowElement"===e.type||"mdxJsxTextElement"===e.type){(e.data||(e.data={}))._mdxExplicitJsx=!0}}))}}const bH=["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"],wH=["compilers","filepath","hastPlugins","mdPlugins","skipExport","wrapExport"];let xH=!1;function EH(e){const t=e||{};let n=-1;for(;++n<wH.length;){wH[n]}t.format,("classic"===t.jsxRuntime||t.pragma||t.pragmaFrag||t.pragmaImportSource)&&!xH&&(xH=!0,console.warn("Unexpected deprecated option `jsxRuntime: 'classic'`, `pragma`, `pragmaFrag`, or `pragmaImportSource`; see <https://mdxjs.com/migrating/v3/> on how to migrate"));const r=BB().use(N$);"md"!==t.format&&r.use(ij);const i=t.remarkRehypeOptions||{};return r.use(vH).use(t.remarkPlugins||[]).use(EB,{...i,allowDangerousHtml:!0,passThrough:[...i.passThrough||[],...bH]}).use(t.rehypePlugins||[]),"md"===t.format&&r.use(uH),r.use(dH,t).use(lV,t).use(yV,t),t.jsx||r.use(mV,t),r.use(UV,t).use(t.recmaPlugins||[]),r}function CH(e,t){const{file:n,options:r}=uN(e,t);return EH(r).process(n)}function SH(e){const{Fragment:t,baseUrl:n,development:r,jsx:i,jsxDEV:s,jsxs:o,useMDXComponents:a,...l}=e||{};if(!t)throw new Error("Expected `Fragment` given to `evaluate`");if(r){if(!s)throw new Error("Expected `jsxDEV` given to `evaluate`")}else{if(!i)throw new Error("Expected `jsx` given to `evaluate`");if(!o)throw new Error("Expected `jsxs` given to `evaluate`")}return{compiletime:{...l,development:r,outputFormat:"function-body",providerImportSource:a?"#":void 0},runtime:{Fragment:t,baseUrl:n,jsx:i,jsxDEV:s,jsxs:o,useMDXComponents:a}}}const _H=Object.getPrototypeOf(kH).constructor;async function kH(e,t){return new _H(String(e))(t)}function OH(e,t){const{compiletime:n,runtime:r}=SH(t);return function(e,t){return new Function(String(e))(t)}(function(e,t){const{file:n,options:r}=uN(e,t);return EH(r).processSync(n)}(e,n),r)}function TH(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}const PH=function(e){if(null==e)return MH;if("function"==typeof e)return IH(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=PH(e[n]);return IH(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return IH(n);function n(n){const r=n;let i;for(i in e)if(r[i]!==t[i])return!1;return!0}}(e);if("string"==typeof e)return function(e){return IH(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function IH(e){return function(t,n,r){return Boolean(RH(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function MH(){return!0}function RH(e){return null!==e&&"object"==typeof e&&"type"in e}function AH(e,t,n){const r=PH((n||{}).ignore||[]),i=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const e=n[r];t.push([NH(e[0]),DH(e[1])])}return t}(t);let s=-1;for(;++s<i.length;)tB(e,"text",o);function o(e,t){let n,o=-1;for(;++o<t.length;){const e=t[o],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=i[s][0],o=i[s][1];let a=0;const l=n.children.indexOf(e);let c=!1,d=[];r.lastIndex=0;let h=r.exec(e.value);for(;h;){const n=h.index,i={index:h.index,input:h.input,stack:[...t,e]};let s=o(...h,i);if("string"==typeof s&&(s=s.length>0?{type:"text",value:s}:void 0),!1===s?r.lastIndex=n+1:(a!==n&&d.push({type:"text",value:e.value.slice(a,n)}),Array.isArray(s)?d.push(...s):s&&d.push(s),a=n+h[0].length,c=!0),!r.global)break;h=r.exec(e.value)}c?(a<e.value.length&&d.push({type:"text",value:e.value.slice(a)}),n.children.splice(l,1,...d)):d=[e];return l+d.length}(e,t)}}function NH(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function DH(e){return"function"==typeof e?e:function(){return e}}const LH="phrasing",FH=["autolink","link","image","label"];function jH(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function $H(e){this.config.enter.autolinkProtocol.call(this,e)}function BH(e){this.config.exit.autolinkProtocol.call(this,e)}function VH(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function zH(e){this.config.exit.autolinkEmail.call(this,e)}function HH(e){this.exit(e)}function UH(e){AH(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,KH],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,WH]],{ignore:["link","linkReference"]})}function KH(e,t,n,r,i){let s="";if(!GH(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!function(e){const t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}(n))return!1;const o=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=TH(e,"(");let s=TH(e,")");for(;-1!==r&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function WH(e,t,n,r){return!(!GH(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function GH(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||JL(n)||ZL(n))&&(!t||47!==n)}function qH(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function XH(){this.buffer()}function YH(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=$j(this.sliceSerialize(e)).toLowerCase()}function ZH(e){this.exit(e)}function JH(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function QH(){this.buffer()}function eU(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=$j(this.sliceSerialize(e)).toLowerCase()}function tU(e){this.exit(e)}function nU(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{...i.current(),before:s,after:"]"})),a(),o(),s+=i.move("]"),s}function rU(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteDefinition"),a=n.enter("label");return s+=i.move(n.safe(n.associationId(e),{...i.current(),before:s,after:"]"})),a(),s+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),s+=i.move(n.indentLines(n.containerFlow(e,i.current()),iU)),o(),s}function iU(e,t,n){return 0===t?e:(n?"":" ")+e}nU.peek=function(){return"["};const sU=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function oU(e){this.enter({type:"delete",children:[]},e)}function aU(e){this.exit(e)}function lU(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function cU(e){return e.length}function dU(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function hU(e,t,n){return">"+(n?"":" ")+e}function uU(e,t){return pU(e,t.inConstruct,!0)&&!pU(e,t.notInConstruct,!1)}function pU(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function fU(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if("\n"===n.unsafe[i].character&&uU(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}function mU(e,t,n){return(n?"":" ")+e}function gU(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function yU(e,t,n,r){const i=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),s=n.enter("emphasis"),o=n.createTracker(r);let a=o.move(i);return a+=o.move(n.containerPhrasing(e,{before:a,after:i,...o.current()})),a+=o.move(i),s(),a}lU.peek=function(){return"~"},yU.peek=function(e,t,n){return n.options.emphasis||"*"};const vU={};function bU(e,t){const n=t||vU;return wU(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function wU(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return xU(e.children,t,n)}return Array.isArray(e)?xU(e,t,n):""}function xU(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=wU(e[i],t,n);return r.join("")}function EU(e,t){let n=!1;return function(e,t,n,r){let i,s,o;"function"==typeof t&&"function"!=typeof n?(s=void 0,o=t,i=n):(s=t,o=n,i=r),tB(e,s,(function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}),i)}(e,(function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,Q$})),Boolean((!e.depth||e.depth<3)&&bU(e)&&(t.options.setext||n))}function CU(e){return e.value||""}function SU(e,t,n,r){const i=gU(n),s='"'===i?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),o(),c}function _U(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=d,s(),"full"!==i&&c&&c===h?"shortcut"===i?l=l.slice(0,-1):l+=a.move("]"):l+=a.move(h+"]"),l}function kU(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const e=n.unsafe[s],t=n.compilePattern(e);let i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(i.index+1)}}return i+r+i}function OU(e,t){const n=bU(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function TU(e,t,n,r){const i=gU(n),s='"'===i?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(OU(e,n)){const t=n.stack;n.stack=[],a=n.enter("autolink");let r=o.move("<");return r+=o.move(n.containerPhrasing(e,{before:r,after:">",...o.current()})),r+=o.move(">"),a(),n.stack=t,r}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),a(),c}function PU(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=d,s(),"full"!==i&&c&&c===h?"shortcut"===i?l=l.slice(0,-1):l+=a.move("]"):l+=a.move(h+"]"),l}function IU(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function MU(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}CU.peek=function(){return"<"},SU.peek=function(){return"!"},_U.peek=function(){return"!"},kU.peek=function(){return"`"},TU.peek=function(e,t,n){return OU(e,n)?"<":"["},PU.peek=function(){return"["};const RU=function(e){if(null==e)return NU;if("function"==typeof e)return AU(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=RU(e[n]);return AU(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return AU(n);function n(n){const r=n;let i;for(i in e)if(r[i]!==t[i])return!1;return!0}}(e);if("string"==typeof e)return function(e){return AU(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function AU(e){return function(t,n,r){return Boolean(DU(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function NU(){return!0}function DU(e){return null!==e&&"object"==typeof e&&"type"in e}const LU=RU(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function FU(e,t,n,r){const i=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),s=n.enter("strong"),o=n.createTracker(r);let a=o.move(i+i);return a+=o.move(n.containerPhrasing(e,{before:a,after:i,...o.current()})),a+=o.move(i+i),s(),a}FU.peek=function(e,t,n){return n.options.strong||"*"};const jU={blockquote:function(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),hU);return i(),o},break:fU,code:function(e,t,n,r){const i=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),s=e.value||"",o="`"===i?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(s,mU);return e(),t}const a=n.createTracker(r),l=i.repeat(Math.max(function(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}(s,i)+1,3)),c=n.enter("codeFenced");let d=a.move(l);if(e.lang){const t=n.enter(`codeFencedLang${o}`);d+=a.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...a.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${o}`);d+=a.move(" "),d+=a.move(n.safe(e.meta,{before:d,after:"\n",encode:["`"],...a.current()})),t()}return d+=a.move("\n"),s&&(d+=a.move(s+"\n")),d+=a.move(l),c(),d},definition:function(e,t,n,r){const i=gU(n),s='"'===i?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c},emphasis:yU,hardBreak:fU,heading:function(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(EU(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),o=n.containerPhrasing(e,{...s.current(),before:"\n",after:"\n"});return r(),t(),o+"\n"+(1===i?"=":"-").repeat(o.length-(Math.max(o.lastIndexOf("\r"),o.lastIndexOf("\n"))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...s.current()});return/^[\t ]/.test(c)&&(c="&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c},html:CU,image:SU,imageReference:_U,inlineCode:kU,link:TU,linkReference:PU,list:function(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):IU(n);const a=e.ordered?"."===o?")":".":function(e){const t=IU(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let l=!(!t||!n.bulletLastUsed)&&o===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==o&&"-"!==o||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),MU(n)===o&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),c},listItem:function(e,t,n,r){const i=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let s=n.bulletCurrent||IU(n);t&&"list"===t.type&&t.ordered&&(s=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+s);let o=s.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(o=4*Math.ceil(o/4));const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),(function(e,t,n){if(t)return(n?"":" ".repeat(o))+e;return(n?s:s+" ".repeat(o-s.length))+e}));return l(),c},paragraph:function(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o},root:function(e,t,n,r){return(e.children.some((function(e){return LU(e)}))?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:FU,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(MU(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function $U(e){const t=e._align;this.enter({type:"table",align:t.map((function(e){return"none"===e?null:e})),children:[]},e),this.data.inTable=!0}function BU(e){this.exit(e),this.data.inTable=void 0}function VU(e){this.enter({type:"tableRow",children:[]},e)}function zU(e){this.exit(e)}function HU(e){this.enter({type:"tableCell",children:[]},e)}function UU(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,KU));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function KU(e,t){return"|"===t?t:e}function WU(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=jU.inlineCode(e,t,n);n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,r){return a(function(e,t,n){const r=e.children;let i=-1;const s=[],o=t.enter("table");for(;++i<r.length;)s[i]=l(r[i],t,n);return o(),s}(e,n,r),e.align)},tableCell:o,tableRow:function(e,t,n,r){const i=l(e,n,r),s=a([i]);return s.slice(0,s.indexOf("\n"))}}};function o(e,t,n,r){const i=n.enter("tableCell"),o=n.enter("phrasing"),a=n.containerPhrasing(e,{...r,before:s,after:s});return o(),i(),a}function a(e,t){return function(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||cU,i=[],s=[],o=[],a=[];let l=0,c=-1;for(;++c<e.length;){const n=[],i=[];let h=-1;for(e[c].length>l&&(l=e[c].length);++h<e[c].length;){const s=null==(d=e[c][h])?"":String(d);if(!1!==t.alignDelimiters){const e=r(s);i[h]=e,(void 0===a[h]||e>a[h])&&(a[h]=e)}n.push(s)}s[c]=n,o[c]=i}var d;let h=-1;if("object"==typeof n&&"length"in n)for(;++h<l;)i[h]=dU(n[h]);else{const e=dU(n);for(;++h<l;)i[h]=e}h=-1;const u=[],p=[];for(;++h<l;){const e=i[h];let n="",r="";99===e?(n=":",r=":"):108===e?n=":":114===e&&(r=":");let s=!1===t.alignDelimiters?1:Math.max(1,a[h]-n.length-r.length);const o=n+"-".repeat(s)+r;!1!==t.alignDelimiters&&(s=n.length+s+r.length,s>a[h]&&(a[h]=s),p[h]=s),u[h]=o}s.splice(1,0,u),o.splice(1,0,p),c=-1;const f=[];for(;++c<s.length;){const e=s[c],n=o[c];h=-1;const r=[];for(;++h<l;){const s=e[h]||"";let o="",c="";if(!1!==t.alignDelimiters){const e=a[h]-(n[h]||0),t=i[h];114===t?o=" ".repeat(e):99===t?e%2?(o=" ".repeat(e/2+.5),c=" ".repeat(e/2-.5)):(o=" ".repeat(e/2),c=o):c=" ".repeat(e)}!1===t.delimiterStart||h||r.push("|"),!1===t.padding||!1===t.alignDelimiters&&""===s||!1===t.delimiterStart&&!h||r.push(" "),!1!==t.alignDelimiters&&r.push(o),r.push(s),!1!==t.alignDelimiters&&r.push(c),!1!==t.padding&&r.push(" "),!1===t.delimiterEnd&&h===l-1||r.push("|")}f.push(!1===t.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return f.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function l(e,t,n){const r=e.children;let i=-1;const s=[],a=t.enter("tableRow");for(;++i<r.length;)s[i]=o(r[i],0,t,n);return a(),s}}function GU(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function qU(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let i,s=-1;for(;++s<r.length;){const e=r[s];if("paragraph"===e.type){i=e;break}}i===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function XU(e,t,n,r){const i=e.children[0],s="boolean"==typeof e.checked&&i&&"paragraph"===i.type,o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=jU.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,(function(e){return e+o}))),l}const YU={tokenize:function(e,t,n){let r=0;return function t(s){if((87===s||119===s)&&r<3)return r++,e.consume(s),t;if(46===s&&3===r)return e.consume(s),i;return n(s)};function i(e){return null===e?n(e):t(e)}},partial:!0},ZU={tokenize:function(e,t,n){let r,i,s;return o;function o(t){return 46===t||95===t?e.check(QU,l,a)(t):null===t||XL(t)||JL(t)||45!==t&&ZL(t)?l(t):(s=!0,e.consume(t),o)}function a(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),o}function l(e){return i||r||!s?n(e):t(e)}},partial:!0},JU={tokenize:function(e,t){let n=0,r=0;return i;function i(o){return 40===o?(n++,e.consume(o),i):41===o&&r<n?s(o):33===o||34===o||38===o||39===o||41===o||42===o||44===o||46===o||58===o||59===o||60===o||63===o||93===o||95===o||126===o?e.check(QU,t,s)(o):null===o||XL(o)||JL(o)?t(o):(e.consume(o),i)}function s(t){return 41===t&&r++,e.consume(t),i}},partial:!0},QU={tokenize:function(e,t,n){return r;function r(o){return 33===o||34===o||39===o||41===o||42===o||44===o||46===o||58===o||59===o||63===o||95===o||126===o?(e.consume(o),r):38===o?(e.consume(o),s):93===o?(e.consume(o),i):60===o||null===o||XL(o)||JL(o)?t(o):n(o)}function i(e){return null===e||40===e||91===e||XL(e)||JL(e)?t(e):r(e)}function s(e){return VL(e)?o(e):n(e)}function o(t){return 59===t?(e.consume(t),r):VL(t)?(e.consume(t),o):n(t)}},partial:!0},eK={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return zL(e)?n(e):t(e)}},partial:!0},tK={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){if(87!==t&&119!==t||!oK.call(r,r.previous)||dK(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(YU,e.attempt(ZU,e.attempt(JU,i),n),n)(t)};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:oK},nK={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let i="",s=!1;return function(t){if((72===t||104===t)&&aK.call(r,r.previous)&&!dK(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),o;return n(t)};function o(t){if(VL(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),o;if(58===t){const n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),a}return n(t)}function a(t){return 47===t?(e.consume(t),s?l:(s=!0,a)):n(t)}function l(t){return null===t||UL(t)||XL(t)||JL(t)||ZL(t)?n(t):e.attempt(ZU,e.attempt(JU,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:aK},rK={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let i,s;return function(t){if(!cK(t)||!lK.call(r,r.previous)||dK(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(t)};function o(t){return cK(t)?(e.consume(t),o):64===t?(e.consume(t),a):n(t)}function a(t){return 46===t?e.check(eK,c,l)(t):45===t||95===t||zL(t)?(s=!0,e.consume(t),a):c(t)}function l(t){return e.consume(t),i=!0,a}function c(o){return s&&i&&VL(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(o)):n(o)}},previous:lK},iK={};let sK=48;for(;sK<123;)iK[sK]=rK,sK++,58===sK?sK=65:91===sK&&(sK=97);function oK(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||XL(e)}function aK(e){return!VL(e)}function lK(e){return!(47===e||cK(e))}function cK(e){return 43===e||45===e||46===e||95===e||zL(e)}function dK(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}iK[43]=rK,iK[45]=rK,iK[46]=rK,iK[95]=rK,iK[72]=[rK,nK],iK[104]=[rK,nK],iK[87]=[rK,tK],iK[119]=[rK,tK];const hK={tokenize:function(e,t,n){const r=this;return eF(e,(function(e){const i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function uK(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const e=r.events[i][1];if("labelImage"===e.type){o=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(i){if(!o||!o._balanced)return n(i);const a=$j(r.sliceSerialize({start:o.end,end:r.now()}));if(94!==a.codePointAt(0)||!s.includes(a.slice(1)))return n(i);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)}}function pK(e,t){let n,r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){n=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},l=[e[r+1],e[r+2],["enter",i,t],e[r+3],e[r+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(r,e.length-r+1,...l),e}function fK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),a};function a(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(a){if(o>999||93===a&&!s||null===a||91===a||XL(a))return n(a);if(93===a){e.exit("chunkString");const s=e.exit("gfmFootnoteCallString");return i.includes($j(r.sliceSerialize(s)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(a)}return XL(a)||(s=!0),o++,e.consume(a),92===a?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,l):l(t)}}function mK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o,a=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(a>999||93===t&&!o||null===t||91===t||XL(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return s=$j(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return XL(t)||(o=!0),a++,e.consume(t),92===t?d:c}function d(t){return 91===t||92===t||93===t?(e.consume(t),a++,c):c(t)}function h(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i.includes(s)||i.push(s),eF(e,u,"gfmFootnoteDefinitionWhitespace")):n(t)}function u(e){return t(e)}}function gK(e,t,n){return e.check(WF,t,e.attempt(hK,t,n))}function yK(e){e.exit("gfmFootnoteDefinition")}function vK(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const i=this.previous,s=this.events;let o=0;return function(t){if(126===i&&"characterEscape"!==s[s.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),a(t)};function a(s){const l=a$(i);if(126===s)return o>1?r(s):(e.consume(s),o++,a);if(o<2&&!t)return r(s);const c=e.exit("strikethroughSequenceTemporary"),d=a$(s);return c._open=!d||2===d&&Boolean(l),c._close=!l||2===l&&Boolean(d),n(s)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},s={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",s,t]],a=t.parser.constructs.insideSpan.null;a&&ZF(o,o.length,0,Tj(a,e.slice(r+1,n),t)),ZF(o,o.length,0,[["exit",s,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),ZF(e,r-1,n-r+3,o),n=r+o.length-2;break}}n=-1;for(;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class bK{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0===n&&0===r.length)return;for(;i<e.map.length;){if(e.map[i][0]===t)return e.map[i][1]+=n,void e.map[i][2].push(...r);i+=1}e.map.push([t,n,r])}(this,e,t,n)}consume(e){if(this.map.sort((function(e,t){return e[0]-t[0]})),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push([...e]),e.length=0;let r=n.pop();for(;r;)e.push(...r),r=n.pop();this.map.length=0}}function wK(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}function xK(e,t,n){const r=this;let i,s=0,o=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const i=t>-1?r.events[t][1].type:null,s="tableHead"===i||"tableRow"===i?w:a;if(s===w&&r.parser.lazy[r.now().line])return n(e);return s(e)};function a(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return l(e);return i=!0,o+=1,l(e)}(t)}function l(t){return null===t?n(t):qL(t)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h):n(t):YL(t)?eF(e,l,"whitespace")(t):(o+=1,i&&(i=!1,s+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||XL(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?d:c)}function d(t){return 92===t||124===t?(e.consume(t),c):c(t)}function h(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),i=!1,YL(t)?eF(e,u,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):u(t))}function u(t){return 45===t||58===t?f(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):b(t)}function p(t){return YL(t)?eF(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(o+=1,m(t)):null===t||qL(t)?v(t):b(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):b(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return YL(t)?eF(e,v,"whitespace")(t):v(t)}function v(n){return 124===n?u(n):(null===n||qL(n))&&i&&s===o?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):b(n)}function b(e){return n(e)}function w(t){return e.enter("tableRow"),x(t)}function x(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),x):null===n||qL(n)?(e.exit("tableRow"),t(n)):YL(n)?eF(e,x,"whitespace")(n):(e.enter("data"),E(n))}function E(t){return null===t||124===t||XL(t)?(e.exit("data"),x(t)):(e.consume(t),92===t?C:E)}function C(t){return 92===t||124===t?(e.consume(t),E):E(t)}}function EK(e,t){let n,r,i,s=-1,o=!0,a=0,l=[0,0,0,0],c=[0,0,0,0],d=!1,h=0;const u=new bK;for(;++s<e.length;){const p=e[s],f=p[1];"enter"===p[0]?"tableHead"===f.type?(d=!1,0!==h&&(SK(u,t,h,n,r),r=void 0,h=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},u.add(s,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(o=!0,i=void 0,l=[0,0,0,0],c=[0,s+1,0,0],d&&(d=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},u.add(s,0,[["enter",r,t]])),a="tableDelimiterRow"===f.type?2:r?3:1):!a||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type?"tableCellDivider"===f.type&&(o?o=!1:(0!==l[1]&&(c[0]=c[1],i=CK(u,t,l,a,void 0,i)),l=c,c=[l[1],s,0,0])):(o=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],i=CK(u,t,l,a,void 0,i),l=[0,0,0,0]),c[2]=s)):"tableHead"===f.type?(d=!0,h=s):"tableRow"===f.type||"tableDelimiterRow"===f.type?(h=s,0!==l[1]?(c[0]=c[1],i=CK(u,t,l,a,s,i)):0!==c[1]&&(i=CK(u,t,c,a,s,i)),a=0):!a||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type||(c[3]=s)}for(0!==h&&SK(u,t,h,n,r),u.consume(t.events),s=-1;++s<t.events.length;){const e=t.events[s];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=wK(t.events,s))}return e}function CK(e,t,n,r,i,s){const o=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(s.end=Object.assign({},_K(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const a=_K(t.events,n[1]);if(s={type:o,start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",s,t]]),0!==n[2]){const i=_K(t.events,n[2]),s=_K(t.events,n[3]),o={type:"tableContent",start:Object.assign({},i),end:Object.assign({},s)};if(e.add(n[2],0,[["enter",o,t]]),2!==r){const r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",o,t]])}return void 0!==i&&(s.end=Object.assign({},_K(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function SK(e,t,n,r,i){const s=[],o=_K(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function _K(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const kK={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i};function i(t){return XL(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),s):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),s):n(t)}function s(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(t)}function o(r){return qL(r)?t(r):YL(r)?e.check({tokenize:OK},t,n)(r):n(r)}}};function OK(e,t,n){return eF(e,(function(e){return null===e?n(e):t(e)}),"whitespace")}const TK={};function PK(e){const t=e||TK,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return ej([{text:iK},{document:{91:{name:"gfmFootnoteDefinition",tokenize:mK,continuation:{tokenize:gK},exit:yK}},text:{91:{name:"gfmFootnoteCall",tokenize:fK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uK,resolveTo:pK}}},vK(e),{flow:{null:{name:"table",tokenize:xK,resolveAll:EK}}},{text:{91:kK}}])}(t)),i.push([{transforms:[UH],enter:{literalAutolink:jH,literalAutolinkEmail:$H,literalAutolinkHttp:$H,literalAutolinkWww:$H},exit:{literalAutolink:HH,literalAutolinkEmail:zH,literalAutolinkHttp:BH,literalAutolinkWww:VH}},{enter:{gfmFootnoteDefinition:qH,gfmFootnoteDefinitionLabelString:XH,gfmFootnoteCall:JH,gfmFootnoteCallString:QH},exit:{gfmFootnoteDefinition:ZH,gfmFootnoteDefinitionLabelString:YH,gfmFootnoteCall:tU,gfmFootnoteCallString:eU}},{canContainEols:["delete"],enter:{strikethrough:oU},exit:{strikethrough:aU}},{enter:{table:$U,tableData:HU,tableHeader:HU,tableRow:VU},exit:{codeText:UU,table:BU,tableData:zU,tableHeader:zU,tableRow:zU}},{exit:{taskListCheckValueChecked:GU,taskListCheckValueUnchecked:GU,paragraph:qU}}]),s.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:LH,notInConstruct:FH},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:LH,notInConstruct:FH},{character:":",before:"[ps]",after:"\\/",inConstruct:LH,notInConstruct:FH}]},{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:rU,footnoteReference:nU}},{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:sU}],handlers:{delete:lU}},WU(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:XU}}]}}(t))}var IK=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};const MK=class extends c{constructor(){super(...arguments),this.getOptions=()=>{var e,t,n;const r=this._adapter.getProp("remarkGfm"),i=[...null!==(e=this.getProp("remarkPlugins"))&&void 0!==e?e:[]];return r&&i.unshift(PK),{evaluateOptions:{remarkPlugins:i,rehypePlugins:null!==(t=this.getProp("rehypePlugins"))&&void 0!==t?t:[],format:this.getProp("format")},compileOptions:{format:this.getProp("format"),remarkPlugins:i,rehypePlugins:null!==(n=this.getProp("rehypePlugins"))&&void 0!==n?n:[]},runOptions:{}}},this.compile=e=>IK(this,void 0,void 0,(function*(){return yield CH(e,this.getOptions().compileOptions)})),this.evaluate=e=>IK(this,void 0,void 0,(function*(){return(yield async function(e,t){const{compiletime:n,runtime:r}=SH(t);return kH(await CH(e,n),r)}(e,Object.assign(Object.assign(Object.assign({},this.getOptions().runOptions),this.getOptions().evaluateOptions),this._adapter.getRuntime()))).default})),this.evaluateSync=e=>OH(e,Object.assign(Object.assign(Object.assign({},this.getOptions().runOptions),this.getOptions().evaluateOptions),this._adapter.getRuntime())).default}};__webpack_require__("jJk2");var RK=__webpack_require__("jg1C"),AK=__webpack_require__.t(RK,2);const NK={PREFIX:`${C}-markdownRender`},DK=e=>d.createElement(Un.Title,Object.assign({heading:1,className:`${NK.PREFIX}-component-header`},e)),LK=e=>d.createElement(Un.Title,Object.assign({heading:2,className:`${NK.PREFIX}-component-header`},e)),FK=e=>d.createElement(Un.Title,Object.assign({heading:3,className:`${NK.PREFIX}-component-header`},e)),jK=e=>d.createElement(Un.Title,Object.assign({heading:4,className:`${NK.PREFIX}-component-header`},e)),$K=e=>d.createElement(Un.Title,Object.assign({heading:5,className:`${NK.PREFIX}-component-header`},e)),BK=e=>d.createElement(Un.Title,Object.assign({heading:6,className:`${NK.PREFIX}-component-header`},e)),VK=e=>d.createElement(Un.Text,Object.assign({link:Object.assign({},e)},e)),zK=e=>d.createElement("div",{className:`${NK.PREFIX}-component-image`},d.createElement(cA,Object.assign({fallback:d.createElement(AR,null),width:"100%"},W()(e,"children"))),d.createElement("div",{className:`${NK.PREFIX}-component-image-alt`},e.alt)),HK=e=>{var t,n,r,i;const{children:s}=e,a=d.Children.toArray(s).filter(d.isValidElement),l=null!==(t=a.find((e=>"thead"===e.type)))&&void 0!==t?t:a[0],c=null!==(n=a.find((e=>"tbody"===e.type)))&&void 0!==n?n:a[1],h=d.Children.toArray(o()(l,"props.children")).find(d.isValidElement),u=d.Children.toArray(o()(h,"props.children")),p=d.Children.toArray(o()(c,"props.children")),f=u.map(((e,t)=>{var n,r;return{dataIndex:String(t),title:null!==(r=null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)&&void 0!==r?r:""}})),m=[];for(let e=0;e<p.length;e++){let t={key:String(e)};d.Children.toArray(null===(i=null===(r=p[e])||void 0===r?void 0:r.props)||void 0===i?void 0:i.children).forEach(((e,n)=>{var r,i;t[String(n)]=null!==(i=null===(r=null==e?void 0:e.props)||void 0===r?void 0:r.children)&&void 0!==i?i:""})),m.push(t)}return d.createElement(qO,Object.assign({dataSource:m,columns:f},W()(e,"children")))},UK=e=>d.createElement(Un.Paragraph,Object.assign({className:`${NK.PREFIX}-component-p`},e));var KK=__webpack_require__("Hz96"),WK=__webpack_require__.n(KK),GK=__webpack_require__("n5u1"),qK=__webpack_require__.n(GK);__webpack_require__("uvM7");qK().manual=!0;const XK=class extends c{constructor(e){super(Object.assign({},e)),this.highlightCode=(e,t)=>{let n=e.className;const r=`language-${t}`;n.includes(r)||(n=w()(n,r)),this.getProp("lineNumber")&&(n=w()(n,"line-numbers")),e.className=n,qK().highlightElement(e,!1)}}};__webpack_require__("wO3+");const YK={PREFIX:`${C}-codeHighlight`};class ZK extends f{constructor(e){super(e),this.codeRef=d.createRef(),this.foundation=new XK(this.adapter),this.state={}}get adapter(){return Object.assign({},super.adapter)}componentDidMount(){super.componentDidMount(),this.codeRef.current&&this.foundation.highlightCode(this.codeRef.current,this.props.language)}componentDidUpdate(e,t,n){(this.codeRef.current&&e.code!==this.props.code||this.props.language!=this.props.language)&&this.foundation.highlightCode(this.codeRef.current,this.props.language)}render(){return d.createElement("div",Object.assign({style:this.props.style,className:w()(this.props.className,YK.PREFIX,"semi-light-scrollbar",{[`${YK.PREFIX}-defaultTheme`]:this.props.defaultTheme})},this.getDataAttr(this.props)),d.createElement("pre",null,d.createElement("code",{ref:this.codeRef},this.props.code)))}}ZK.__SemiComponentName__="CodeHighlight",ZK.propTypes={className:E().string,style:E().any,code:E().string,language:E().string,lineNumber:E().bool,defaultTheme:E().bool},ZK.defaultProps=he(ZK.__SemiComponentName__,{lineNumber:!0,defaultTheme:!0});const JK=ZK,QK=e=>{var t;const n=WK()(null===(t=e.className)||void 0===t?void 0:t.split("-"),-1);return n?d.createElement(JK,{code:e.children,language:n,lineNumber:!0}):d.createElement("span",{className:`${NK.PREFIX}-simple-code`},e.children)};var eW=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};class tW extends f{constructor(e){super(e),this.foundation=new MK(this.adapter),this.state={MDXContentComponent:"div"}}componentDidMount(){(()=>{eW(this,void 0,void 0,(function*(){this.setState({MDXContentComponent:yield this.foundation.evaluate(this.props.raw)})}))})()}componentDidUpdate(e,t,n){e.raw!==this.props.raw&&(()=>{eW(this,void 0,void 0,(function*(){this.setState({MDXContentComponent:yield this.foundation.evaluate(this.props.raw)})}))})()}get adapter(){return Object.assign(Object.assign({},super.adapter),{getRuntime:()=>AK})}render(){const e=this.state.MDXContentComponent;return d.createElement("div",Object.assign({className:w()(NK.PREFIX,this.props.className),style:this.props.style},this.getDataAttr()),d.createElement(e,{components:Object.assign(Object.assign({},n),this.props.components)}))}}tW.propTypes={className:E().string,style:E().object,format:E().string,components:E().any,raw:E().string,remarkPlugins:E().arrayOf(E().any),rehypePlugins:E().arrayOf(E().any),remarkGfm:E().bool},tW.__SemiComponentName__="MarkdownRender",tW.defaultProps=he(tW.__SemiComponentName__,{format:"mdx",remarkGfm:!0}),tW.defaultComponents=n;const nW=tW;var rW=__webpack_require__("Nh1y"),iW=__webpack_require__.n(rW);class sW extends c{constructor(e){super(Object.assign(Object.assign({},sW.defaultAdapter),e)),this.animation=null,this.handleParamsUpdate=()=>{var e;this.animation.destroy(),this.animation=iW().loadAnimation(this._adapter.getLoadParams()),null===(e=this.getProp("getAnimationInstance"))||void 0===e||e(this.animation)}}init(e){var t,n;super.init(e),this.animation=iW().loadAnimation(this._adapter.getLoadParams()),null===(t=this.getProp("getAnimationInstance"))||void 0===t||t(this.animation),null===(n=this.getProp("getLottie"))||void 0===n||n(sW.getLottie())}destroy(){super.destroy(),this.animation.destroy()}}sW.getLottie=()=>iW();const oW=sW,aW={PREFIX:`${C}-lottie`};class lW extends f{constructor(e){super(e),this.container=d.createRef(),this.foundation=new oW(this.adapter)}get adapter(){const e=()=>{var e;return null!==(e=this.props.params.container)&&void 0!==e?e:this.container.current};return Object.assign(Object.assign({},super.adapter),{getContainer:e,getLoadParams:()=>Object.assign({container:e(),renderer:"svg",loop:!0,autoplay:!0},this.props.params)})}componentDidMount(){var e,t;super.componentDidMount(),null===(t=(e=this.props).getAnimationInstance)||void 0===t||t.call(e,this.foundation.animation)}componentDidUpdate(e,t,n){Oe()(e.params,this.props.params)||this.foundation.handleParamsUpdate()}get wrapperStyle(){return Object.assign({width:this.props.width,height:this.props.height},this.props.style)}get wrapperClassName(){return w()(aW.PREFIX,this.props.className)}render(){return this.props.params.container?null:d.createElement("div",Object.assign({ref:this.container,style:this.wrapperStyle,className:this.wrapperClassName},this.getDataAttr(this.props)))}}lW.__SemiComponentName__="Lottie",lW.getLottie=oW.getLottie,lW.defaultProps=he(lW.__SemiComponentName__),lW.propTypes={className:E().string,style:E().object,width:E().string,height:E().string,params:E().object,getAnimationInstance:E().func};const cW=lW;const dW=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.36 5.64a3 3 0 0 0-4.24 0L12 7.76a1 1 0 1 1-1.41-1.42l2.12-2.12a5 5 0 0 1 7.07 7.07l-2.12 2.12A1 1 0 0 1 16.24 12l2.12-2.12a3 3 0 0 0 0-4.24ZM5.64 18.36a3 3 0 0 0 4.24 0L12 16.24a1 1 0 0 1 1.41 1.42l-2.12 2.12a5 5 0 0 1-7.07-7.07l2.12-2.12A1 1 0 0 1 7.76 12l-2.12 2.12a3 3 0 0 0 0 4.24Zm9.9-8.48a1 1 0 0 0-1.42-1.42l-5.66 5.66a1 1 0 1 0 1.42 1.42l5.66-5.66Z",fill:"currentColor"}))}),"chain_stroked");const hW=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 5V4h4v1h-4ZM8 5V3a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2h4a1 1 0 1 1 0 2h-1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V7H4a1 1 0 0 1 0-2h4Zm7 2H7v13h10V7h-2ZM9 9.5c0-.28.22-.5.5-.5h1c.28 0 .5.22.5.5v7a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-7Zm4 0c0-.28.22-.5.5-.5h1c.28 0 .5.22.5.5v7a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-7Z",fill:"currentColor"}))}),"delete_stroked");const uW=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a1.5 1.5 0 0 1-1.5-1.5V6.12l-6.44 6.44a1.5 1.5 0 0 1-2.12-2.12l9-9a1.5 1.5 0 0 1 2.12 0l9 9a1.5 1.5 0 0 1-2.12 2.12L13.5 6.12V21.5c0 .83-.67 1.5-1.5 1.5Z",fill:"currentColor"}))}),"arrow_up"),pW={PREFIX:`${C}-chat`,PREFIX_DIVIDER:`${C}-chat-divider`,PREFIX_CHAT_BOX:`${C}-chat-chatBox`,PREFIX_CHAT_BOX_ACTION:`${C}-chat-chatBox-action`,PREFIX_INPUT_BOX:`${C}-chat-inputBox`,PREFIX_ATTACHMENT:`${C}-chat-attachment`,PREFIX_HINT:`${C}-chat-hint`},fW={ROLE:{USER:"user",ASSISTANT:"assistant",SYSTEM:"system",DIVIDER:"divider"},CHAT_ALIGN:{LEFT_RIGHT:"leftRight",LEFT_ALIGN:"leftAlign"},MESSAGE_STATUS:{LOADING:"loading",INCOMPLETE:"incomplete",COMPLETE:"complete",ERROR:"error"},PIC_SUFFIX_ARRAY:["png","jpg","jpeg","gif","bmp","webp"],PIC_PREFIX:"image/",SCROLL_ANIMATION_TIME:300,SHOW_SCROLL_GAP:100,MODE:{BUBBLE:"bubble",NO_BUBBLE:"noBubble",USER_BUBBLE:"userBubble"},SEND_HOT_KEY:{ENTER:"enter",SHIFT_PLUS_ENTER:"shift+enter"},FILE_STATUS:{UPLOADING:"uploading",SUCCESS:"success",UPLOAD_FAIL:"uploadFail",VALIDATING:"validating",VALID_FAIL:"validateFail",WAIT_UPLOAD:"wait"}},{SEND_HOT_KEY:mW}=fW;class gW extends c{constructor(e){super(Object.assign({},e)),this.onInputAreaChange=e=>{const t=this.getState("attachment");this._adapter.setInputValue(e),this._adapter.notifyInputChange({inputValue:e,attachment:t})},this.onAttachmentAdd=e=>{const{fileList:t}=e,{uploadProps:n}=this.getProps(),{onChange:r}=n;r&&r(e);const{content:i}=this.getStates();let s=[...t];this._adapter.setAttachment(s),this._adapter.notifyInputChange({inputValue:i,attachment:s})},this.onAttachmentDelete=e=>{const{content:t,attachment:n}=this.getStates(),r=n.filter((t=>t.uid!==e.uid));this._adapter.setAttachment(r),this._adapter.notifyInputChange({inputValue:t,attachment:r})},this.onSend=e=>{if(this.getDisableSend())return;const{content:t,attachment:n}=this.getStates();this._adapter.setInputValue(""),this._adapter.setAttachment([]),this._adapter.notifySend(t,n)},this.getDisableSend=()=>{const{content:e,attachment:t}=this.getStates(),{disableSend:n,canSend:r}=this.getProps();if("boolean"==typeof r)return!r;return n||0===e.length&&0===t.length||t.find((e=>e.status!==fW.FILE_STATUS.SUCCESS))},this.onEnterPress=e=>{const{sendHotKey:t}=this.getProps();t===mW.SHIFT_PLUS_ENTER&&!1===e.shiftKey||t===mW.ENTER&&!0===e.shiftKey||(Le(e),this.onSend(e))},this.onPaste=e=>{var t;const n=null===(t=e.clipboardData)||void 0===t?void 0:t.items,{manualUpload:r,pasteUpload:i}=this.getProps();let s=[];if(i&&n){for(const e of n){e.getAsFile()&&s.push(e.getAsFile())}s.length&&(r(s),e.preventDefault(),e.stopPropagation())}}}}const yW=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 1a2 2 0 0 0-2 2v18c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V8.41A2 2 0 0 0 20.41 7L15 1.59A2 2 0 0 0 13.59 1H5Zm8 2H5v18h14V9h-5a1 1 0 0 1-1-1V3Zm4.59 4L15 4.41V7h2.59Zm-6.09 5a.5.5 0 0 0-.5.5v1c0 .28.22.5.5.5h5a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-5Zm-4.5.5c0-.28.22-.5.5-.5h1c.28 0 .5.22.5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1Zm4.5 3.5a.5.5 0 0 0-.5.5v1c0 .28.22.5.5.5h5a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-5Zm-4.5.5c0-.28.22-.5.5-.5h1c.28 0 .5.22.5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1Z",fill:"currentColor"}))}),"brief_stroked"),{PREFIX_ATTACHMENT:vW}=pW,{PIC_SUFFIX_ARRAY:bW,PIC_PREFIX:wW}=fW,xW=h().memo((e=>{const{url:t,name:n,size:r,type:i}=e;return h().createElement("a",{href:t,target:"_blank",className:`${vW}-file`,rel:"noreferrer"},h().createElement(yW,{size:"extra-large",className:`${vW}-file-icon`}),h().createElement("div",{className:`${vW}-file-info`},h().createElement("span",{className:`${vW}-file-title`},n),h().createElement("span",{className:`${vW}-file-metadata`},h().createElement("span",{className:`${vW}-file-type`},i),i?" · ":"",r)))})),EW=h().memo((e=>{const{src:t}=e;return h().createElement(cA,{className:`${vW}-img`,width:60,height:60,src:t})})),CW=h().memo((e=>{const{attachment:t,onClear:n,showClear:r=!0,className:i}=e;return h().createElement("div",{className:w()(vW,{[i]:i})},t.map((e=>{var t,i,s,o;const{percent:a,status:l}=e,c=null==e?void 0:e.name.split(".").pop(),d=(null===(i=null===(t=null==e?void 0:e.fileInstance)||void 0===t?void 0:t.type)||void 0===i?void 0:i.startsWith(wW))||bW.includes(c),u=null!=c?c:null===(o=null===(s=null==e?void 0:e.fileInstance)||void 0===s?void 0:s.type)||void 0===o?void 0:o.split("/").pop(),p=!(100===a||void 0===a)&&l===fW.FILE_STATUS.UPLOADING;return h().createElement("div",{className:`${vW}-item`,key:e.uid},d?h().createElement(EW,{src:e.url}):h().createElement(xW,{url:e.url,name:e.name,size:e.size,type:u}),r&&h().createElement(gr,{size:"large",className:`${vW}-clear`,onClick:()=>{n&&n(e)}}),p&&h().createElement(gS,{percent:a,type:"circle",size:"small",width:30,className:`${vW}-process`,"aria-label":"upload progress"}),[fW.FILE_STATUS.UPLOAD_FAIL,fW.FILE_STATUS.VALID_FAIL].includes(l)&&h().createElement(ns,{className:`${vW}-fail`}))})))})),SW=CW;var _W=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const{PREFIX_INPUT_BOX:kW}=pW,{SEND_HOT_KEY:OW}=fW,TW={minRows:1,maxRows:5};class PW extends f{constructor(e){super(e),this.onClick=()=>{var e;null===(e=this.inputAreaRef.current)||void 0===e||e.focus()},this.renderUploadButton=()=>{const{uploadProps:e,uploadRef:t,uploadTipProps:n,clickUpload:r}=this.props;if(!r)return null;const{attachment:i}=this.state,{className:s,onChange:o,renderFileItem:a,children:l}=e,c=_W(e,["className","onChange","renderFileItem","children"]),d=Object.assign(Object.assign({},c),{className:w()(`${kW}-upload`,{[s]:s}),onChange:this.foundation.onAttachmentAdd}),u=h().createElement(MI,Object.assign({ref:t,fileList:i},d),l||h().createElement(vs,{className:`${kW}-uploadButton`,icon:h().createElement(dW,{size:"extra-large"}),theme:"borderless"}));return n?h().createElement(_t,Object.assign({},n),h().createElement("span",null,u)):u},this.renderInputArea=()=>{const{content:e,attachment:t}=this.state,{placeholder:n,sendHotKey:r}=this.props;return h().createElement("div",{className:`${kW}-inputArea`},h().createElement(Jx,{placeholder:n,onEnterPress:this.foundation.onEnterPress,value:e,onChange:this.foundation.onInputAreaChange,ref:this.inputAreaRef,className:`${kW}-textarea`,autosize:TW,disabledEnterStartNewLine:r===OW.ENTER,onPaste:this.foundation.onPaste}),h().createElement(SW,{attachment:t,onClear:this.foundation.onAttachmentDelete}))},this.renderClearButton=()=>{const{onClearContext:e}=this.props;return h().createElement(vs,{className:`${kW}-clearButton`,theme:"borderless",icon:h().createElement(hW,null),onClick:e})},this.renderSendButton=()=>{const e=this.foundation.getDisableSend();return h().createElement(vs,{disabled:e,theme:"solid",type:"primary",className:`${kW}-sendButton`,icon:h().createElement(uW,{size:"large",className:`${kW}-sendButton-icon`}),onClick:this.foundation.onSend})},this.inputAreaRef=h().createRef(),this.foundation=new gW(this.adapter),this.state={content:"",attachment:[]}}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyInputChange:e=>{const{onInputChange:t}=this.props;t&&t(e)},setInputValue:e=>{this.setState({content:e})},setAttachment:e=>{this.setState({attachment:e})},notifySend:(e,t)=>{const{onSend:n}=this.props;n&&n(e,t)}})}render(){const{onClearContext:e,renderInputArea:t,onSend:n,style:r,className:i,showClearContext:s}=this.props,o=this.renderClearButton(),a=this.renderUploadButton(),l=this.renderInputArea(),c=this.renderSendButton(),d=h().createElement("div",{className:w()(kW,{[i]:i}),style:r},h().createElement("div",{className:`${kW}-inner`,onClick:this.onClick},s&&o,h().createElement("div",{className:`${kW}-container`},a,l,c)));return t?t({defaultNode:d,onClear:e,onSend:n,detailProps:{clearContextNode:o,uploadNode:a,inputNode:l,sendNode:c,onClick:this.onClick}}):d}}PW.propTypes={uploadProps:E().object},PW.defaultProps={uploadProps:{}};const IW=PW;__webpack_require__("+onK");const{PREFIX_HINT:MW}=pW,RW=h().memo((e=>{const{value:t,onHintClick:n,renderHintBox:r,className:i,style:s}=e;return h().createElement("section",{className:w()(`${MW}s`,{[i]:!!i}),style:s},t.map(((e,t)=>r?r({content:e,index:t,onHintClick:()=>{null==n||n(e)}}):h().createElement("div",{className:`${MW}-item`,key:t,onClick:()=>{null==n||n(e)}},h().createElement("div",{className:`${MW}-content`},e),h().createElement(DR,{className:`${MW}-icon`})))))})),AW=RW;const NW=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-6 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Zm-5 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",fill:"currentColor"}))}),"disc"),{PREFIX_CHAT_BOX:DW}=pW,LW=h().memo((e=>{const{role:t,customRenderFunc:n,continueSend:r,message:i}=e,s=(0,d.useMemo)((()=>{const{avatar:e,color:n}=t,i="string"==typeof e;return h().createElement(Qr,{className:w()(`${DW}-avatar`,{[`${DW}-avatar-hidden`]:r}),src:i?e:void 0,size:"extra-small"},i?null:e)}),[t]);return n&&"function"==typeof n?n({role:t,defaultAvatar:s,message:i}):s})),FW=LW,{PREFIX_CHAT_BOX:jW}=pW,$W=h().memo((e=>{const{role:t,message:n,customRenderFunc:r}=e,i=(0,d.useMemo)((()=>h().createElement("span",{className:`${jW}-title`},null==t?void 0:t.name)),[t]);return r&&"function"==typeof r?r({role:t,message:n,defaultTitle:i}):i}));const BW=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22 16a2 2 0 0 1-2 2V4H6c0-1.1.9-2 2-2h12a2 2 0 0 1 2 2v12ZM2 8c0-1.1.9-2 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8Zm2 0h12v12H4V8Zm2 6a1 1 0 0 1 1-1h2v-2a1 1 0 1 1 2 0v2h2a1 1 0 1 1 0 2h-2v2a1 1 0 1 1-2 0v-2H7a1 1 0 0 1-1-1Z",fill:"currentColor"}))}),"copy_stroked"),{PREFIX_CHAT_BOX:VW}=pW,zW=e=>{const[t,n]=(0,d.useState)(!1),r=(0,d.useMemo)((()=>{var t;return WK()(null===(t=e.className)||void 0===t?void 0:t.split("-"),-1)}),[e.className]),i=(0,d.useCallback)((()=>{Ot()(e.children),n(!0),setTimeout((()=>{n(!1)}),2e3)}),[e.children]);return r?h().createElement("div",{className:`${VW}-content-code semi-always-dark`},h().createElement("div",{className:`${VW}-content-code-topSlot`},h().createElement("span",{className:`${VW}-content-code-topSlot-type`},r),h().createElement("span",{className:`${VW}-content-code-topSlot-copy`},t?h().createElement("span",{className:`${VW}-content-code-topSlot-copy-wrapper`},h().createElement(sn,null),h().createElement(Jt,{componentName:"Chat"},(e=>e.copied))):h().createElement("button",{className:`${VW}-content-code-topSlot-copy-wrapper ${VW}-content-code-topSlot-toCopy`,onClick:i},h().createElement(BW,null),h().createElement(Jt,{componentName:"Chat"},(e=>e.copy))))),QK(e)):QK(e)};function HW(e){const t=e.split("\n"),n=[];let r=null,i=0;for(let e=0;e<t.length;e++){const s=t[e];if(null!==r){n.push(s);const e=s.trimEnd();e.length>=i&&e[0]===r&&e===r.repeat(e.length)&&(r=null)}else{const e=s.match(/^(`{3,}|~{3,})/);e?(r=e[1][0],i=e[1].length,n.push(s)):n.push(UW(s))}}return n.join("\n")}function UW(e){const t=[];let n=0;for(;n<e.length;)if("`"===e[n]){let r=0;const i=n;for(;n<e.length&&"`"===e[n];)r++,n++;const s="`".repeat(r),o=e.indexOf(s,n);-1!==o?(t.push(e.slice(i,o+r)),n=o+r):t.push(e.slice(i,n).replace(/</g,"<"))}else if("<"===e[n])t.push("<"),n++;else{const r=e.indexOf("<",n),i=e.indexOf("`",n);let s;s=-1===r&&-1===i?e.length:-1===r?i:-1===i?r:Math.min(r,i),t.push(e.slice(n,s)),n=s}return t.join("")}const{PREFIX_CHAT_BOX:KW}=pW,{MESSAGE_STATUS:WW,MODE:GW,ROLE:qW}=fW,XW=e=>{const{message:t={},customRenderFunc:n,role:r,customMarkDownComponents:i,mode:s,markdownRenderProps:o,escapeHtml:a}=e,{content:l,role:c,status:u}=t,p=a&&c===qW.USER,f=(0,d.useMemo)((()=>Object.assign({code:zW,SemiFile:xW,img:EW},i)),[i]),m=(0,d.useMemo)((()=>{const e=c===qW.USER,t=s===GW.BUBBLE,n=s===GW.USER_BUBBLE&&e;return w()(`${KW}-content`,{[`${KW}-content-${s}`]:t||n,[`${KW}-content-user`]:t&&e||n,[`${KW}-content-error`]:u===WW.ERROR&&(t||n)})}),[c,u,s]),g=(0,d.useMemo)((()=>{if(u===WW.LOADING)return h().createElement("span",{className:`${KW}-content-loading`},h().createElement("span",{className:`${KW}-content-loading-item`}));{let e;if("string"==typeof l){const t=p?HW(l):l;e=h().createElement(nW,Object.assign({format:"md",raw:t,components:f},o))}else Array.isArray(l)&&(e=l.map(((e,t)=>{var n;if("text"===e.type){const t=p?HW(e.text):e.text;return h().createElement(nW,Object.assign({key:"index",format:"md",raw:t,components:f},o))}if("image_url"===e.type)return h().createElement(EW,{key:"index",src:e.image_url.url});if("file_url"===e.type){const{name:t,size:r,url:i,type:s}=e.file_url,o=null!==(n=t.split(".").pop())&&void 0!==n?n:null==s?void 0:s.split("/").pop();return h().createElement(xW,{key:"index",url:i,name:t,size:r,type:o})}return null})));return h().createElement(h().Fragment,null,e)}}),[u,l]);return n?n({message:t,role:r,defaultContent:g,className:m}):h().createElement("div",{className:m},g)};const YW=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m8.06 9.39 3.71-6.96c.13-.24.42-.33.64-.18.58.41 1.42 1.2 1.42 2.13 0 .5-.13 1.4-.27 2.33a23.55 23.55 0 0 0-.31 2.79h7.58c.45 0 1.17.45 1.17 1.5 0 .9-1 5.09-1.7 8.04l-.3 1.3c0 .22-.27.66-1.33.66H8.5a.5.5 0 0 1-.5-.5V9.63a.5.5 0 0 1 .06-.24ZM3.5 9.5a.5.5 0 0 0-.5.5v10.5c0 .28.22.5.5.5h2a.5.5 0 0 0 .5-.5V10a.5.5 0 0 0-.5-.5h-2Z",fill:"currentColor"}))}),"like_thumb");const ZW=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m11.42 2.1-.83-.4L6.42 9H3.2C2.54 9 2 9.54 2 10.2v10.6c0 .66.54 1.2 1.2 1.2H17.67c.65 0 1.19-.12 1.6-.4.38-.23.66-.61.72-1.06a251.76 251.76 0 0 0 1.77-7.79c.13-.68.24-1.32.24-1.68 0-.77-.3-1.38-.76-1.79a2.18 2.18 0 0 0-1.4-.53h-6.5l.19-1.16.03-.17c.13-.76.27-1.6.27-2.17 0-.97-.58-1.72-1.05-2.18a5.37 5.37 0 0 0-1.36-.98ZM6 20v-9H4v9h2Zm2 0h9.67c.19 0 .32-.02.4-.04a250.3 250.3 0 0 0 1.73-7.58c.14-.74.2-1.18.2-1.31 0-.13-.02-.2-.04-.22a.14.14 0 0 0-.03-.06.18.18 0 0 0-.06-.03l-.04-.01h-8.58v-1c0-.7.17-1.68.3-2.5v-.02c.16-.89.28-1.6.28-1.98 0-.16-.1-.42-.45-.76a2.85 2.85 0 0 0-.05-.05L8 10.27V20Z",fill:"currentColor"}))}),"thumb_up_stroked");const JW=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 12a8 8 0 0 1 13.66-5.66c.28.28.68.71 1.09 1.16H16a1 1 0 1 0 0 2h4.5a1 1 0 0 0 1-1V4a1 1 0 1 0-2 0v1.9a37.8 37.8 0 0 0-.93-.97 10 10 0 1 0 0 14.14 1 1 0 1 0-1.41-1.41A8 8 0 0 1 3.5 12Z",fill:"currentColor"}))}),"redo_stroked");class QW extends c{constructor(e){super(Object.assign({},e)),this.showDeletePopup=()=>{this._adapter.setVisible(!0),this._adapter.setShowAction(!0),this._adapter.registerClickOutsideHandler(this.hideDeletePopup)},this.hideDeletePopup=()=>{this._adapter.setVisible(!1),setTimeout((()=>{this._adapter.setShowAction(!1)}),150),this._adapter.unregisterClickOutsideHandler()},this.destroy=()=>{this._adapter.unregisterClickOutsideHandler()},this.deleteMessage=()=>{this._adapter.notifyDeleteMessage()},this.copyMessage=()=>{this._adapter.notifyMessageCopy(),this._adapter.copyToClipboardAndToast()},this.likeMessage=()=>{this._adapter.notifyLikeMessage()},this.dislikeMessage=()=>{this._adapter.notifyDislikeMessage()},this.resetMessage=()=>{this._adapter.notifyResetMessage()}}}const{PREFIX_CHAT_BOX_ACTION:eG}=pW,{ROLE:tG,MESSAGE_STATUS:nG}=fW;class rG extends f{constructor(e){super(e),this.copyNode=()=>h().createElement(vs,{key:"copy",theme:"borderless",icon:h().createElement(BW,null),type:"tertiary",onClick:this.foundation.copyMessage,className:`${eG}-btn`}),this.likeNode=()=>{const{message:e={}}=this.props,{like:t}=e;return h().createElement(vs,{key:"like",theme:"borderless",icon:t?h().createElement(YW,null):h().createElement(ZW,null),type:"tertiary",className:`${eG}-btn`,onClick:this.foundation.likeMessage})},this.dislikeNode=()=>{const{message:e={}}=this.props,{dislike:t}=e;return h().createElement(vs,{theme:"borderless",key:"dislike",icon:t?h().createElement(YW,{className:`${eG}-icon-flip`}):h().createElement(ZW,{className:"semi-chat-chatBox-action-icon-flip"}),type:"tertiary",className:`${eG}-btn`,onClick:this.foundation.dislikeMessage})},this.resetNode=()=>h().createElement(vs,{key:"reset",theme:"borderless",icon:h().createElement(JW,{className:`${eG}-icon-redo`}),type:"tertiary",onClick:this.foundation.resetMessage,className:`${eG}-btn`}),this.deleteNode=()=>{const e=h().createElement(Jt,{componentName:"Chat"},(e=>e.deleteConfirm));return h().createElement(iS,{trigger:"custom",visible:this.state.visible,key:"delete",title:e,onConfirm:this.foundation.deleteMessage,onCancel:this.foundation.hideDeletePopup,position:"top"},h().createElement("span",{ref:this.popconfirmTriggerRef,className:`${eG}-delete-wrap`},h().createElement(vs,{theme:"borderless",icon:h().createElement(hW,null),type:"tertiary",className:`${eG}-btn`,onClick:this.foundation.showDeletePopup})))},this.foundation=new QW(this.adapter),this.copySuccessNode=null,this.state={visible:!1,showAction:!1},this.clickOutsideHandler=null,this.containerRef=h().createRef(),this.popconfirmTriggerRef=h().createRef()}componentDidMount(){this.copySuccessNode=h().createElement(Jt,{componentName:"Chat"},(e=>e.copySuccess))}componentWillUnmount(){this.foundation.destroy()}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyDeleteMessage:()=>{const{message:e,onMessageDelete:t}=this.props;null==t||t(e)},notifyMessageCopy:()=>{const{message:e,onMessageCopy:t}=this.props;null==t||t(e)},copyToClipboardAndToast:()=>{var e;const{message:t={},toast:n}=this.props;if("string"==typeof t.content)Ot()(t.content);else if(Array.isArray(t.content)){const n=null===(e=t.content)||void 0===e?void 0:e.map((e=>e.text)).join("");Ot()(n)}n.success({content:this.copySuccessNode})},notifyLikeMessage:()=>{const{message:e,onMessageGoodFeedback:t}=this.props;null==t||t(e)},notifyDislikeMessage:()=>{const{message:e,onMessageBadFeedback:t}=this.props;null==t||t(e)},notifyResetMessage:()=>{const{message:e,onMessageReset:t}=this.props;null==t||t(e)},setVisible:e=>{this.setState({visible:e})},setShowAction:e=>{this.setState({showAction:e})},registerClickOutsideHandler:e=>{this.clickOutsideHandler&&this.adapter.unregisterClickOutsideHandler(),this.clickOutsideHandler=t=>{let n=this.popconfirmTriggerRef&&this.popconfirmTriggerRef.current;const r=t.target,i=t.composedPath&&t.composedPath()||[r];!n||n.contains(r)||i.includes(n)||e()},window.addEventListener("mousedown",this.clickOutsideHandler)},unregisterClickOutsideHandler:()=>{this.clickOutsideHandler&&(window.removeEventListener("mousedown",this.clickOutsideHandler),this.clickOutsideHandler=null)}})}render(){const{message:e={},lastChat:t}=this.props,{showAction:n}=this.state,{role:r,status:i=nG.COMPLETE}=e,s=i===nG.COMPLETE,o=r!==tG.USER&&s,a=t&&r===tG.ASSISTANT,l=i!==nG.LOADING&&i!==nG.INCOMPLETE,c=w()(eG,{[`${eG}-show`]:a&&l||n,[`${eG}-hidden`]:!l}),{customRenderFunc:d}=this.props;if(d){const t=[],n={};if(s){const e=this.copyNode();t.push(e),n.copyNode=e}if(o){const e=this.likeNode();t.push(e),n.likeNode=e;const r=this.dislikeNode();t.push(r),n.dislikeNode=r}if(a){const e=this.resetNode();t.push(e),n.resetNode=e}const r=this.deleteNode();return t.push(r),n.deleteNode=r,d({message:e,defaultActions:t,className:c,defaultActionsObj:n})}return h().createElement("div",{className:c,ref:this.containerRef},s&&this.copyNode(),o&&this.likeNode(),o&&this.dislikeNode(),a&&this.resetNode(),this.deleteNode())}}rG.propTypes={role:E().object,message:E().object,showReset:E().bool,onMessageBadFeedback:E().func,onMessageGoodFeedback:E().func,onMessageCopy:E().func,onChatsChange:E().func,onMessageDelete:E().func,onMessageReset:E().func,customRenderFunc:E().func};const iG=rG,{PREFIX_CHAT_BOX:sG}=pW,{ROLE:oG,CHAT_ALIGN:aG}=fW,lG=h().memo((e=>{const{message:t,lastChat:n,align:r,toast:i,mode:s,roleConfig:o,onMessageBadFeedback:a,onMessageGoodFeedback:l,onMessageCopy:c,onChatsChange:u,onMessageDelete:p,onMessageReset:f,chatBoxRenderConfig:m={},customMarkDownComponents:g,previousMessage:y,markdownRenderProps:v,escapeHtml:b}=e,{renderChatBoxAvatar:x,renderChatBoxAction:E,renderChatBoxContent:C,renderChatBoxTitle:S,renderFullChatBox:_}=m,k=(0,d.useMemo)((()=>(null==t?void 0:t.role)===(null==y?void 0:y.role)),[t.role,y]),O=(0,d.useMemo)((()=>{var e;let n={};return o&&(n=null!==(e=o[t.role])&&void 0!==e?e:{}),n}),[t.role,o]),T=(0,d.useMemo)((()=>h().createElement(FW,{continueSend:k,role:O,message:t,customRenderFunc:x})),[O,t,x]),P=(0,d.useMemo)((()=>h().createElement($W,{role:O,message:t,customRenderFunc:S})),[O,t,S]),I=(0,d.useMemo)((()=>h().createElement(XW,{mode:s,role:O,message:t,escapeHtml:b,customMarkDownComponents:g,customRenderFunc:C,markdownRenderProps:v})),[t,O,C,s,b]),M=(0,d.useMemo)((()=>h().createElement(iG,{toast:i,role:O,message:t,lastChat:n,onMessageBadFeedback:a,onMessageCopy:c,onChatsChange:u,onMessageDelete:p,onMessageGoodFeedback:l,onMessageReset:f,customRenderFunc:E})),[t,O,n,a,l,c,u,p,f,E]),R=(0,d.useMemo)((()=>w()(sG,{[`${sG}-right`]:t.role===oG.USER&&r===aG.LEFT_RIGHT})),[t.role,r]);return"function"!=typeof _?h().createElement("div",{className:R},T,h().createElement("div",{className:`${sG}-wrap`},!k&&P,I,M)):_({message:t,role:O,defaultNodes:{avatar:T,title:P,content:I,action:M},className:R})})),cG=lG,{PREFIX_DIVIDER:dG,PREFIX:hG}=pW,{ROLE:uG}=fW,pG=h().memo((e=>{const{chats:t,onMessageBadFeedback:n,onMessageCopy:r,mode:i,onChatsChange:s,onMessageDelete:o,onMessageGoodFeedback:a,onMessageReset:l,roleConfig:c,chatBoxRenderConfig:d,align:u,customMarkDownComponents:p,renderDivider:f,markdownRenderProps:m,escapeHtml:g}=e,[y,v]=rP.useToast();return h().createElement(h().Fragment,null,t.map(((e,v)=>{const b=v===t.length-1;return e.role===uG.DIVIDER?f?f(e):h().createElement(Bb,{key:e.id,className:dG},h().createElement(Jt,{componentName:"Chat"},(e=>e.clearContext))):h().createElement(cG,{previousMessage:v?t[v-1]:void 0,toast:y,align:u,mode:i,key:e.id,message:e,escapeHtml:g,roleConfig:c,onMessageBadFeedback:n,onMessageCopy:r,onChatsChange:s,onMessageDelete:o,onMessageGoodFeedback:a,onMessageReset:l,lastChat:b,customMarkDownComponents:p,chatBoxRenderConfig:d,markdownRenderProps:m})})),h().createElement("div",{className:`${hG}-toast`},v))})),fG=pG;__webpack_require__("pjuZ"),__webpack_require__("Vwau");const{PIC_PREFIX:mG,PIC_SUFFIX_ARRAY:gG,ROLE:yG,SCROLL_ANIMATION_TIME:vG,SHOW_SCROLL_GAP:bG}=fW;class wG extends c{constructor(e){super(Object.assign({},e)),this.init=()=>{this.scrollToBottomImmediately(),this._adapter.registerWheelEvent()},this.destroy=()=>{this.animation&&this.animation.destroy(),this._adapter.unRegisterWheelEvent()},this.stopGenerate=e=>{this._adapter.notifyStopGenerate(e)},this.scrollToBottomImmediately=()=>{const e=this._adapter.getContainerRef();e&&(e.scrollTop=e.scrollHeight)},this.scrollToBottomWithAnimation=()=>{const e=vG,t=this._adapter.getContainerRef();if(!t)return;const n=t.scrollTop,r=t.scrollHeight;this.animation=new Ei({from:{scrollTop:n},to:{scrollTop:r}},{duration:e,easing:"easeInOutCubic"}),this.animation.on("frame",(e=>{let{scrollTop:n}=e;t.scrollTop=n})),this.animation.start()},this.containerScroll=e=>{this._persistEvent(e);requestAnimationFrame((()=>{this.getScroll(e.target)}))},this.getScroll=v()((e=>{const t=e.scrollHeight,n=e.clientHeight,r=e.scrollTop,{backBottomVisible:i}=this.getStates();return t-r-n<=bG?i&&this._adapter.setBackBottomVisible(!1):i||this._adapter.setBackBottomVisible(!0),scroll}),100),this.handleScrollContainerResize=()=>{this.getScroll(this._adapter.getContainerRef())},this.clearContext=e=>{const{chats:t}=this.getStates();if(t[t.length-1].role===yG.DIVIDER)return;const n={role:yG.DIVIDER,id:Ke(),createAt:Date.now()},r=[...t,n];this._adapter.notifyChatsChange(r),this._adapter.notifyClearContext()},this.onMessageSend=(e,t)=>{let n;if(Boolean(t)&&0===t.length?n=e:(n=[],e&&n.push({type:"text",text:e}),(null!=t?t:[]).map((e=>{var t;const{fileInstance:r,name:i="",url:s,size:o}=e,a=i.split(".").pop();(null===(t=null==r?void 0:r.type)||void 0===t?void 0:t.startsWith(mG))||gG.includes(a)?n.push({type:"image_url",image_url:{url:s}}):n.push({type:"file_url",file_url:{url:s,name:i,size:o,type:null==r?void 0:r.type}})}))),n){const e={role:yG.USER,id:Ke(),createAt:Date.now(),content:n};this._adapter.notifyChatsChange([...this.getStates().chats,e])}this._adapter.setWheelScroll(!1),this._adapter.registerWheelEvent(),this._adapter.notifyMessageSend(e,t)},this.onHintClick=e=>{const{chats:t}=this.getStates(),n=[...t,{role:yG.USER,id:Ke(),createAt:Date.now(),content:e}];this._adapter.notifyChatsChange(n),this._adapter.notifyHintClick(e)},this.onInputChange=e=>{this._adapter.notifyInputChange(e)},this.deleteMessage=e=>{const{onMessageDelete:t,onChatsChange:n}=this.getProps(),{chats:r}=this.getStates();null==t||t(e);const i=r.filter((t=>t.id!==e.id));null==n||n(i)},this.likeMessage=e=>{const{chats:t}=this.getStates();this._adapter.notifyLikeMessage(e);const n=t.findIndex((t=>t.id===e.id)),r=Object.assign(Object.assign({},t[n]),{like:!t[n].like,dislike:!1}),i=[...t];i.splice(n,1,r),this._adapter.notifyChatsChange(i)},this.dislikeMessage=e=>{const{chats:t}=this.getStates();this._adapter.notifyDislikeMessage(e);const n=t.findIndex((t=>t.id===e.id)),r=Object.assign(Object.assign({},t[n]),{like:!1,dislike:!t[n].dislike}),i=[...t];i.splice(n,1,r),this._adapter.notifyChatsChange(i)},this.resetMessage=e=>{const{chats:t}=this.getStates(),n=t[t.length-1],r=Object.assign(Object.assign({},n),{status:"loading",content:"",id:Ke(),createAt:Date.now()}),i=t.slice(0,-1).concat(r);this._adapter.notifyChatsChange(i);const{onMessageReset:s}=this.getProps();null==s||s(e)},this.handleDragOver=e=>{this._adapter.getDragStatus()||this._adapter.setUploadAreaVisible(!0)},this.handleDragStart=e=>{this._adapter.setDragStatus(!0)},this.handleDragEnd=e=>{this._adapter.setDragStatus(!1)},this.handleContainerDragOver=e=>{Le(e)},this.handleContainerDrop=e=>{var t;this._adapter.setUploadAreaVisible(!1),this._adapter.manualUpload(null===(t=null==e?void 0:e.dataTransfer)||void 0===t?void 0:t.files),Le(e)},this.handleContainerDragLeave=e=>{Le(e);const t=this._adapter.getDropAreaElement(),n=e.relatedTarget;t.contains(n)||setTimeout((()=>{this._adapter.setUploadAreaVisible(!1)}))},this.getUploadProps=e=>{if("[object Object]"===Object.prototype.toString.call(e)){const{dragUpload:t=!0,clickUpload:n=!0,pasteUpload:r=!0}=e;return{dragUpload:t,clickUpload:n,pasteUpload:r}}return"boolean"==typeof e?{dragUpload:e,clickUpload:e,pasteUpload:e}:{dragUpload:!0,clickUpload:!0,pasteUpload:!0}}}}const xG=pW.PREFIX,{CHAT_ALIGN:EG,MODE:CG,SEND_HOT_KEY:SG,MESSAGE_STATUS:_G}=fW;class kG extends f{constructor(e){super(e),this.dragStatus=!1,this.resetMessage=()=>{this.foundation.resetMessage(null)},this.clearContext=()=>{this.foundation.clearContext(null)},this.scrollToBottom=e=>{e?this.foundation.scrollToBottomWithAnimation():this.foundation.scrollToBottomImmediately()},this.sendMessage=(e,t)=>{this.foundation.onMessageSend(e,t)},this.containerScroll=e=>{this.scrollTargetRef.current=e.target,e.target===e.currentTarget&&this.foundation.containerScroll(e)},this.containerRef=d.createRef(),this.uploadRef=d.createRef(),this.dropAreaRef=d.createRef(),this.wheelEventHandler=null,this.foundation=new wG(this.adapter),this.scrollTargetRef=d.createRef(),this.state={backBottomVisible:!1,chats:[],cacheHints:[],wheelScroll:!1,uploadAreaVisible:!1}}get adapter(){return Object.assign(Object.assign({},super.adapter),{getContainerRef:()=>{var e;return null===(e=this.containerRef)||void 0===e?void 0:e.current},setWheelScroll:e=>{this.setState({wheelScroll:e})},notifyChatsChange:e=>{const{onChatsChange:t}=this.props;t&&t(e)},notifyLikeMessage:e=>{const{onMessageGoodFeedback:t}=this.props;t&&t(e)},notifyDislikeMessage:e=>{const{onMessageBadFeedback:t}=this.props;t&&t(e)},notifyCopyMessage:e=>{const{onMessageCopy:t}=this.props;t&&t(e)},notifyClearContext:()=>{const{onClear:e}=this.props;e&&e()},notifyMessageSend:(e,t)=>{const{onMessageSend:n}=this.props;n&&n(e,t)},notifyInputChange:e=>{const{onInputChange:t}=this.props;t&&t(e)},setBackBottomVisible:e=>{this.setState((t=>t.backBottomVisible!==e?{backBottomVisible:e}:null))},registerWheelEvent:()=>{this.adapter.unRegisterWheelEvent();const e=this.containerRef.current;e&&(this.wheelEventHandler=e=>{var t;(null===(t=this.scrollTargetRef)||void 0===t?void 0:t.current)===e.currentTarget&&(this.adapter.setWheelScroll(!0),this.adapter.unRegisterWheelEvent())},e.addEventListener("wheel",this.wheelEventHandler))},unRegisterWheelEvent:()=>{if(this.wheelEventHandler){const e=this.containerRef.current;if(!e)return;e.removeEventListener("wheel",this.wheelEventHandler),this.wheelEventHandler=null}},notifyStopGenerate:e=>{const{onStopGenerator:t}=this.props;t&&t(e)},notifyHintClick:e=>{const{onHintClick:t}=this.props;t&&t(e)},setUploadAreaVisible:e=>{this.setState({uploadAreaVisible:e})},manualUpload:e=>{const t=this.uploadRef.current;t&&t.insert(e)},getDropAreaElement:()=>{var e;return null===(e=this.dropAreaRef)||void 0===e?void 0:e.current},getDragStatus:()=>this.dragStatus,setDragStatus:e=>{this.dragStatus=e}})}static getDerivedStateFromProps(e,t){const{chats:n,hints:r}=e,i={};return n!==t.chats&&(i.chats=null!=n?n:[]),r!==t.cacheHints&&(i.cacheHints=r),Object.keys(i).length?i:null}componentDidMount(){this.foundation.init()}componentDidUpdate(e,t,n){const{chats:r,hints:i}=this.props,{chats:s,cacheHints:o}=t,{wheelScroll:a}=this.state;let l=!1;if(r!==s&&Array.isArray(r)&&Array.isArray(s)){const e=r[r.length-1],t=s[s.length-1];r.length>s.length?0!==s.length&&e.id===t.id||(l=!0):r.length!==s.length||!r.length||"complete"===e.status&&e.status===t.status||(l=!0)}i!==o&&i.length>o.length&&(l=!0),!a&&l&&this.foundation.scrollToBottomImmediately()}componentWillUnmount(){this.foundation.destroy()}render(){const{topSlot:e,bottomSlot:t,roleConfig:n,hints:r,onChatsChange:i,onMessageCopy:s,renderInputArea:o,chatBoxRenderConfig:a,align:l,renderHintBox:c,style:h,className:u,showStopGenerate:p,customMarkDownComponents:f,mode:m,showClearContext:g,placeholder:y,inputBoxCls:v,inputBoxStyle:b,hintStyle:x,hintCls:E,uploadProps:C,uploadTipProps:S,sendHotKey:_,renderDivider:k,markdownRenderProps:O,enableUpload:T,canSend:P,escapeHtml:I}=this.props,{backBottomVisible:M,chats:R,wheelScroll:A,uploadAreaVisible:N}=this.state;let D=!1;const L=R.length>0&&R[R.length-1];let F=!1;if(L&&p){const e=(null==L?void 0:L.status)&&[_G.LOADING,_G.INCOMPLETE].includes(null==L?void 0:L.status);F=e,p&&(D=e)}const{dragUpload:j,clickUpload:$,pasteUpload:B}=this.foundation.getUploadProps(T),V=j?{onDragOver:this.foundation.handleDragOver,onDragStart:this.foundation.handleDragStart,onDragEnd:this.foundation.handleDragEnd}:{};return d.createElement("div",Object.assign({className:w()(`${xG}`,u),style:h},V),j&&N&&d.createElement("div",{ref:this.dropAreaRef,className:`${xG}-dropArea`,onDragOver:this.foundation.handleContainerDragOver,onDrop:this.foundation.handleContainerDrop,onDragLeave:this.foundation.handleContainerDragLeave},d.createElement("span",{className:`${xG}-dropArea-text`},d.createElement(Jt,{componentName:"Chat"},(e=>e.dropAreaText)))),d.createElement("div",{className:`${xG}-inner`},e,d.createElement("div",{className:`${xG}-content`},d.createElement(Pn,{onResize:this.foundation.handleScrollContainerResize},d.createElement("div",{className:w()(`${xG}-container`,{"semi-chat-container-scroll-hidden":!A}),onScroll:this.containerScroll,ref:this.containerRef},d.createElement(fG,{align:l,mode:m,chats:R,escapeHtml:I,roleConfig:n,customMarkDownComponents:f,onMessageDelete:this.foundation.deleteMessage,onChatsChange:i,onMessageBadFeedback:this.foundation.dislikeMessage,onMessageGoodFeedback:this.foundation.likeMessage,onMessageReset:this.foundation.resetMessage,onMessageCopy:s,chatBoxRenderConfig:a,renderDivider:k,markdownRenderProps:O}),!!(null==r?void 0:r.length)&&d.createElement(AW,{className:E,style:x,value:r,onHintClick:this.foundation.onHintClick,renderHintBox:c})))),M&&!D&&d.createElement("span",{className:`${xG}-action`},d.createElement(vs,{className:`${xG}-action-content ${xG}-action-backBottom`,icon:d.createElement(Hc,{size:"extra-large"}),type:"tertiary",onClick:this.foundation.scrollToBottomWithAnimation})),D&&d.createElement("span",{className:`${xG}-action`},d.createElement(vs,{className:`${xG}-action-content ${xG}-action-stop`,icon:d.createElement(NW,{size:"extra-large"}),type:"tertiary",onClick:this.foundation.stopGenerate},d.createElement(Jt,{componentName:"Chat"},(e=>e.stop)))),d.createElement(IW,{canSend:P,showClearContext:g,uploadRef:this.uploadRef,manualUpload:this.adapter.manualUpload,style:b,className:v,placeholder:y,disableSend:F,onClearContext:this.foundation.clearContext,onSend:this.foundation.onMessageSend,onInputChange:this.foundation.onInputChange,renderInputArea:o,uploadProps:C,uploadTipProps:S,sendHotKey:_,clickUpload:$,pasteUpload:B}),t))}}kG.__SemiComponentName__="Chat",kG.propTypes={className:E().string,style:E().object,roleConfig:E().object,chats:E().array,hints:E().array,renderHintBox:E().func,onChatsChange:E().func,align:E().string,chatBoxRenderConfig:E().object,customMarkDownComponents:E().object,onClear:E().func,onMessageDelete:E().func,onMessageReset:E().func,onMessageCopy:E().func,onMessageGoodFeedback:E().func,onMessageBadFeedback:E().func,inputContentConvert:E().func,onMessageSend:E().func,InputBoxStyle:E().object,inputBoxCls:E().string,renderFullInputBox:E().func,placeholder:E().string,topSlot:E().node||E().array,bottomSlot:E().node||E().array,showStopGenerate:E().bool,showClearContext:E().bool,hintStyle:E().object,hintCls:E().string,uploadProps:E().object,uploadTipProps:E().object,mode:E().string,markdownRenderProps:E().object,escapeHtml:E().bool},kG.defaultProps=he(kG.__SemiComponentName__,{align:EG.LEFT_RIGHT,showStopGenerate:!1,mode:CG.BUBBLE,showClearContext:!1,sendHotKey:SG.ENTER,escapeHtml:!0});const OG=kG,TG={PREFIX:`${C}-hotKeys`},PG={a:"KeyA",b:"KeyB",c:"KeyC",d:"KeyD",e:"KeyE",f:"KeyF",g:"KeyG",h:"KeyH",i:"KeyI",j:"KeyJ",k:"KeyK",l:"KeyL",m:"KeyM",n:"KeyN",o:"KeyO",p:"KeyP",q:"KeyQ",r:"KeyR",s:"KeyS",t:"KeyT",u:"KeyU",v:"KeyV",w:"KeyW",x:"KeyX",y:"KeyY",z:"KeyZ",0:"Digit0",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9"," ":"Space",enter:"Enter",escape:"Escape",backspace:"Backspace",tab:"Tab","-":"Minus","=":"Equal","[":"BracketLeft","]":"BracketRight","\\":"Backslash",";":"Semicolon","'":"Quote","`":"Backquote",",":"Comma",".":"Period","/":"Slash","?":"Slash","!":"Digit1","@":"Digit2","#":"Digit3",$:"Digit4","%":"Digit5","^":"Digit6","&":"Digit7","*":"Digit8","(":"Digit9",")":"Digit0",arrowup:"ArrowUp",arrowdown:"ArrowDown",arrowleft:"ArrowLeft",arrowright:"ArrowRight",shift:"ShiftLeft",control:"ControlLeft",alt:"AltLeft",meta:"MetaLeft",capslock:"CapsLock",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",insert:"Insert",delete:"Delete",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown",numlock:"NumLock",scrolllock:"ScrollLock",pause:"Pause",numpad0:"Numpad0",numpad1:"Numpad1",numpad2:"Numpad2",numpad3:"Numpad3",numpad4:"Numpad4",numpad5:"Numpad5",numpad6:"Numpad6",numpad7:"Numpad7",numpad8:"Numpad8",numpad9:"Numpad9",numpaddecimal:"NumpadDecimal",numpaddivide:"NumpadDivide",numpadmultiply:"NumpadMultiply",numpadsubtract:"NumpadSubtract",numpadadd:"NumpadAdd",numpadenter:"NumpadEnter"};var IG;!function(e){e.A="a",e.B="b",e.C="c",e.D="d",e.E="e",e.F="f",e.G="g",e.H="h",e.I="i",e.J="j",e.K="k",e.L="l",e.M="m",e.N="n",e.O="o",e.P="p",e.Q="q",e.R="r",e.S="s",e.T="t",e.U="u",e.V="v",e.W="w",e.X="x",e.Y="y",e.Z="z",e.Digit0="0",e.Digit1="1",e.Digit2="2",e.Digit3="3",e.Digit4="4",e.Digit5="5",e.Digit6="6",e.Digit7="7",e.Digit8="8",e.Digit9="9",e.Space=" ",e.Enter="enter",e.Escape="escape",e.Backspace="backspace",e.Tab="tab",e.Minus="-",e.Equal="=",e.BracketLeft="[",e.BracketRight="]",e.Backslash="\\",e.Semicolon=";",e.Quote="'",e.Backquote="`",e.Comma=",",e.Period=".",e.Slash="/",e.Exclamation="!",e.At="@",e.Hash="#",e.Dollar="$",e.Percent="%",e.Caret="^",e.Ampersand="&",e.Asterisk="*",e.LeftParenthesis="(",e.RightParenthesis=")",e.ArrowUp="arrowup",e.ArrowDown="arrowdown",e.ArrowLeft="arrowleft",e.ArrowRight="arrowright",e.Shift="shift",e.Control="control",e.Alt="alt",e.Meta="meta",e.CapsLock="capslock",e.F1="f1",e.F2="f2",e.F3="f3",e.F4="f4",e.F5="f5",e.F6="f6",e.F7="f7",e.F8="f8",e.F9="f9",e.F10="f10",e.F11="f11",e.F12="f12",e.Insert="insert",e.Delete="delete",e.Home="home",e.End="end",e.PageUp="pageup",e.PageDown="pagedown",e.NumLock="numlock",e.ScrollLock="scrolllock",e.Pause="pause",e.Numpad0="numpad0",e.Numpad1="numpad1",e.Numpad2="numpad2",e.Numpad3="numpad3",e.Numpad4="numpad4",e.Numpad5="numpad5",e.Numpad6="numpad6",e.Numpad7="numpad7",e.Numpad8="numpad8",e.Numpad9="numpad9",e.NumpadDecimal="numpaddecimal",e.NumpadDivide="numpaddivide",e.NumpadMultiply="numpadmultiply",e.NumpadSubtract="numpadsubtract",e.NumpadAdd="numpadadd",e.NumpadEnter="numpadenter"}(IG||(IG={}));class MG extends c{constructor(e){super(Object.assign({},e)),this.isValidHotKeys=e=>{let t=0;const n=[IG.Meta,IG.Alt,IG.Shift,IG.Control];return e.forEach((e=>{if(e=e.toLowerCase(),!Object.values(IG).some((t=>t===e)))throw new Error(`${e} is not a valid key`);n.includes(e)||(t+=1)})),1===t},this.handleKeyDown=e=>{const{mergeMetaCtrl:t,hotKeys:n,preventDefault:r}=this.getProps();let i=new Array(4).fill(!1),s=[e.metaKey,e.shiftKey,e.altKey,e.ctrlKey];const o=null==n?void 0:n.map((t=>(t=t.toLowerCase())===IG.Meta?(i[0]=!0,e.metaKey):t===IG.Shift?(i[1]=!0,e.shiftKey):t===IG.Alt?(i[2]=!0,e.altKey):t===IG.Control?(i[3]=!0,e.ctrlKey):e.code===function(e){return PG[e.toLowerCase()]||void 0}(t)));if(i.every(((e,t)=>e===s[t])))return o.every(Boolean)?(r&&e.preventDefault(),void this._adapter.notifyHotKey(e)):void 0}}init(){this._adapter.registerEvent();const e=this.getProps().hotKeys;if(!this.isValidHotKeys(e))throw new Error("HotKeys must have one common key and 0/some modifier key")}destroy(){this._adapter.unregisterEvent()}}__webpack_require__("E0iY");var RG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const AG=TG.PREFIX;class NG extends f{constructor(e){super(e),this.state={},this.foundation=new MG(this.adapter)}componentDidMount(){this.foundation.init()}componentDidUpdate(e){}componentWillUnmount(){this.foundation.destroy()}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyHotKey:e=>{var t,n;null===(n=(t=this.props).onHotKey)||void 0===n||n.call(t,e)},registerEvent:()=>{var e,t,n;(null!==(n=null===(t=(e=this.props).getListenerTarget)||void 0===t?void 0:t.call(e))&&void 0!==n?n:document.body).addEventListener("keydown",this.foundation.handleKeyDown)},unregisterEvent:()=>{var e,t,n;(null!==(n=null===(t=(e=this.props).getListenerTarget)||void 0===t?void 0:t.call(e))&&void 0!==n?n:document.body).removeEventListener("keydown",this.foundation.handleKeyDown)}})}render(){const e=this.props,{hotKeys:t,content:n,onClick:r,render:i,getListenerTarget:s,className:o,style:a}=e,l=RG(e,["hotKeys","content","onClick","render","getListenerTarget","className","style"]);if(void 0!==i)return null===i||"function"==typeof i&&null===i()?null:h().createElement("div",Object.assign({onClick:r,className:w()(AG,o),style:a},this.getDataAttr(l)),"function"==typeof i?i():i);const c=null!=n?n:t;return h().createElement("div",Object.assign({onClick:r,className:w()(AG,o),style:a},this.getDataAttr(l)),c.map(((e,t)=>0===t?h().createElement("span",{key:t},h().createElement("span",{className:AG+"-content"},e)):h().createElement("span",{key:t},h().createElement("span",{className:AG+"-split"},"+"),h().createElement("span",{className:AG+"-content"},e)))))}}NG.propTypes={preventDefault:E().bool,hotKeys:E().arrayOf(E().string),content:E().arrayOf(E().string),onClick:E().func,onHotKey:E().func,mergeMetaCtrl:E().bool,render:E().oneOfType([E().func,E().node]),getListenerTarget:E().func,className:E().string,style:E().object},NG.defaultProps={preventDefault:!1,hotKeys:null,content:null,onClick:i(),onHotKey:i(),mergeMetaCtrl:!1,render:void 0,getListenerTarget:()=>document.body,className:"",style:null},NG.Keys=IG;const DG=NG,LG=["top","right","bottom","left","topRight","bottomRight","bottomLeft","topLeft"],FG={width:"auto",height:"auto"},jG=(e,t,n)=>Math.max(Math.min(e,n),t),$G=(e,t)=>Math.round(e/t)*t,BG=(e,t)=>new RegExp(e,"i").test(t),VG=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=t.reduce(((n,r,i)=>Math.abs(r-e)<Math.abs(t[n]-e)?i:n),0),i=Math.abs(t[r]-e);return 0===n||i<n?t[r]:e},zG=e=>"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:`${e}px`,HG=(e,t,n,r)=>{if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){return t*(Number(e.replace("%",""))/100)}if(e.endsWith("vw")){return n*(Number(e.replace("vw",""))/100)}if(e.endsWith("vh")){return r*(Number(e.replace("vh",""))/100)}}return void 0===e?e:Number(e)},UG=e=>"vertical"===e?["bottom","top"]:["right","left"],KG=(e,t)=>e.endsWith("px")?Number(e.replace("px","")):e.endsWith("%")?Number(e.replace("%",""))/100*t:void 0===e?e:Number(e),WG=function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;n=null!=n?n:"100%";const s=KG(t=null!=t?t:"0%",r),o=KG(n,r);return e<s+i||e>o},GG=(e,t,n,r,i)=>{n=null!=n?n:"100%";const s=KG(t=null!=t?t:"0%",r),o=KG(n,r);return e<s+i?s+i:e>o?o:e},qG=(e,t)=>{if("horizontal"===t){return parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)}return parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)+parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth)};class XG extends c{constructor(e){super(Object.assign({},e)),this.onMouseDown=e=>{this.getProp("onResizeStart")(e,this.getProp("direction"),"mouse")},this.onTouchStart=e=>{const t=e.targetTouches[0];this.getProp("onResizeStart")(t,this.getProp("direction"),"touch")}}init(){this._adapter.registerEvent()}destroy(){this._adapter.unregisterEvent()}}class YG extends c{constructor(e){super(Object.assign({},e)),this.lockAspectRatio=1,this.resizable=null,this.parentLeft=0,this.parentTop=0,this.boundaryLeft=0,this.boundaryRight=0,this.boundaryTop=0,this.boundaryBottom=0,this.targetLeft=0,this.targetTop=0,this.onResizeStart=(e,t,n)=>{if(this.type=n,this.resizable=this._adapter.getResizable(),!this.resizable||!this.window)return;const{clientX:r,clientY:i}=e,s=this.getProps(),o=this.getStates();if(s.onResizeStart){if(!1===s.onResizeStart(e,t))return}const{size:a}=s;if(a){const{height:e,width:t}=a,{height:n,width:r}=o;void 0!==e&&e!==n&&this.setState({height:e}),void 0!==t&&t!==r&&this.setState({width:t})}let l;this.lockAspectRatio="number"==typeof s.lockAspectRatio?s.lockAspectRatio:this.size.width/this.size.height;const c=this.window.getComputedStyle(this.resizable);if("auto"!==c.flexBasis){const e=this.parent;if(e){const t=this.window.getComputedStyle(e);this.flexDirection=t.flexDirection.startsWith("row")?"row":"column",l=c.flexBasis}}this.setBoundary(),this.registerEvents();const d={original:{x:r,y:i,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Object.assign(Object.assign({},o.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:l};this.setState(d)},this.onMouseMove=e=>{this.changePosition(e)},this.onTouchMove=e=>{e.preventDefault();const t=e.targetTouches[0];this.changePosition(t)},this.changePosition=e=>{var t,n;const r=this.getStates(),i=this.getProps();if(!r.isResizing||!this.resizable||!this.window)return;const{clientX:s,clientY:o}=e,{direction:a,original:l,width:c,height:d}=r,h=this.getParentSize();let{maxWidth:u,maxHeight:p,minWidth:f,minHeight:m}=i;const g=((e,t,n,r,i,s,o)=>({maxWidth:r=HG(r,e.width,t,n),maxHeight:i=HG(i,e.height,t,n),minWidth:s=HG(s,e.width,t,n),minHeight:o=HG(o,e.height,t,n)}))(h,this.window.innerWidth,this.window.innerHeight,u,p,f,m);u=g.maxWidth,p=g.maxHeight,f=g.minWidth,m=g.minHeight;let{newWidth:y,newHeight:v}=this.calDirectionSize(s,o);const b=this.calBoundaryMax(u,p);y=HG(y,h.width,this.window.innerWidth,this.window.innerHeight),v=HG(v,h.height,this.window.innerWidth,this.window.innerHeight),i.snap&&(i.snap.x&&(y=VG(y,i.snap.x,i.snapGap)),i.snap.y&&(v=VG(v,i.snap.y,i.snapGap)));const w=this.calAspectRatioSize(y,v,{width:b.maxWidth,height:b.maxHeight},{width:f,height:m});if(y=w.newWidth,v=w.newHeight,i.grid){const[e,t]=Array.isArray(i.grid)?i.grid:[i.grid,i.grid],n=i.snapGap||0,r=$G(y,e),s=$G(v,t);y=0===n||Math.abs(r-y)<=n?r:y,v=0===n||Math.abs(s-v)<=n?s:v}const x=(e,t,n)=>n.endsWith("%")?e/t*100+"%":n.endsWith("vw")?e/this.window.innerWidth*100+"vw":n.endsWith("vh")?e/this.window.innerHeight*100+"vh":e;"string"==typeof c&&(y=x(y,h.width,c||"")),"string"==typeof d&&(v=x(v,h.height,d||""));const E={width:this.getCssPropertySize(y,"width"),height:this.getCssPropertySize(v,"height")};"row"===this.flexDirection?E.flexBasis=E.width:"column"===this.flexDirection&&(E.flexBasis=E.height);const C=r.width!==E.width,S=r.height!==E.height,_=r.flexBasis!==E.flexBasis;if(C||S||_){if(this.setState(E),i.onChange){let t={width:E.width,height:E.height};i.onChange(t,e,a)}const r=i.size;r&&this.setState({width:null!==(t=r.width)&&void 0!==t?t:"auto",height:null!==(n=r.height)&&void 0!==n?n:"auto"})}},this.onMouseUp=e=>{var t,n;const{isResizing:r,direction:i,original:s}=this.getStates();if(!r||!this.resizable)return;const{width:o,height:a}=this.size,{onResizeEnd:l,size:c}=(s.width,s.height,this.getProps());l&&l(this.size,e,i),c&&this.setState({width:null!==(t=c.width)&&void 0!==t?t:"auto",height:null!==(n=c.height)&&void 0!==n?n:"auto"}),this.unregisterEvents(),this.setState({isResizing:!1,backgroundStyle:Object.assign(Object.assign({},this.getStates().backgroundStyle),{cursor:"auto"})})}}init(){if(!this.resizable||!this.window)return;const e=this.window.getComputedStyle(this.resizable).flexBasis;this.setState({width:this.propSize.width,height:this.propSize.height,flexBasis:"auto"!==e?e:void 0}),this.onResizeStart=this.onResizeStart.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this)}get parent(){return this.resizable?this.resizable.parentNode:null}get window(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null}get propSize(){const e=this.getProps();return e.size||e.defaultSize||FG}get size(){let e=0,t=0;return this.resizable&&this.window&&(e=this.resizable.offsetWidth,t=this.resizable.offsetHeight),{width:e,height:t}}get sizeStyle(){const e=this.getProp("size"),t=e=>{var t;const n=this.getStates()[e];if(void 0===n||"auto"===n)return"auto";const r=null===(t=this.propSize)||void 0===t?void 0:t[e];if(null==r?void 0:r.toString().endsWith("%")){if(n.toString().endsWith("%"))return n.toString();const t=this.getParentSize();return`${Number(n.toString().replace("px",""))/t[e]*100}%`}return zG(n)},n=this.getStates().isResizing;return{width:e&&void 0!==e.width&&!n?zG(e.width):t("width"),height:e&&void 0!==e.height&&!n?zG(e.height):t("height")}}getParentSize(){if(!this.parent)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};const e=(()=>{if(!this.resizable||!this.window)return null;const e=this.parent;if(!e)return null;const t=this.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",e.appendChild(t),t})();if(!e)return{width:0,height:0};let t=!1;const n=this.parent.style.flexWrap;"wrap"!==n&&(t=!0,this.parent.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";const r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parent.style.flexWrap=n),(e=>{const t=this.parent;t&&t.removeChild(e)})(e),r}registerEvents(){this._adapter.registerEvent(this.type)}unregisterEvents(){this._adapter.unregisterEvent(this.type)}getCssPropertySize(e,t){var n;const r=null===(n=this.propSize)||void 0===n?void 0:n[t],i=this.getStates();return"auto"===i[t]&&i.original[t]===e&&(void 0===r||"auto"===r)?"auto":e}calBoundaryMax(e,t){const{boundsByDirection:n}=this.getProps(),{direction:r}=this.getStates(),i=n&&BG("left",r),s=n&&BG("top",r);let o,a;const l=this.getProps();if("parent"===l.boundElement){const e=this.parent;e&&(o=i?this.boundaryRight-this.parentLeft:e.offsetWidth+(this.parentLeft-this.boundaryLeft),a=s?this.boundaryBottom-this.parentTop:e.offsetHeight+(this.parentTop-this.boundaryTop))}else if("window"===l.boundElement&&this.window)o=i?this.boundaryRight:this.window.innerWidth-this.boundaryLeft,a=s?this.boundaryBottom:this.window.innerHeight-this.boundaryTop;else if(l.boundElement){const e=l.boundElement;o=i?this.boundaryRight-this.targetLeft:e.offsetWidth+(this.targetLeft-this.boundaryLeft),a=s?this.boundaryBottom-this.targetTop:e.offsetHeight+(this.targetTop-this.boundaryTop)}return o&&Number.isFinite(o)&&(e=e&&e<o?e:o),a&&Number.isFinite(a)&&(t=t&&t<a?t:a),{maxWidth:e,maxHeight:t}}calDirectionSize(e,t){const n=this.getProps(),r=n.scale||1;let i=n.ratio;const[s,o]=Array.isArray(i)?i:[i,i],{direction:a,original:l}=this.getStates(),{lockAspectRatio:c,lockAspectRatioExtraHeight:d=0,lockAspectRatioExtraWidth:h=0}=n;let u=l.width,p=l.height;const f=e=>l.width+e*s/r,m=e=>l.height+e*o/r;return BG("top",a)&&(p=m(l.y-t),c&&(u=(p-d)*this.lockAspectRatio+h)),BG("bottom",a)&&(p=m(t-l.y),c&&(u=(p-d)*this.lockAspectRatio+h)),BG("right",a)&&(u=f(e-l.x),c&&(p=(u-h)/this.lockAspectRatio+d)),BG("left",a)&&(u=f(l.x-e),c&&(p=(u-h)/this.lockAspectRatio+d)),{newWidth:u,newHeight:p}}calAspectRatioSize(e,t,n,r){const{lockAspectRatio:i,lockAspectRatioExtraHeight:s=0,lockAspectRatioExtraWidth:o=0}=this.getProps(),a=void 0===r.width?10:r.width,l=void 0===n.width||n.width<0?e:n.width,c=void 0===r.height?10:r.height,d=void 0===n.height||n.height<0?t:n.height;if(i){const n=(c-s)*this.lockAspectRatio+o,r=(d-s)*this.lockAspectRatio+o,i=(a-o)/this.lockAspectRatio+s,h=(l-o)/this.lockAspectRatio+s,u=Math.max(a,n),p=Math.min(l,r),f=Math.max(c,i),m=Math.min(d,h);e=jG(e,u,p),t=jG(t,f,m)}else e=jG(e,a,l),t=jG(t,c,d);return{newWidth:e,newHeight:t}}setBoundary(){const e=this.getProps();if("parent"===e.boundElement){const e=this.parent;if(e){const t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(e.boundElement&&"string"!=typeof e.boundElement){const t=e.boundElement.getBoundingClientRect();this.targetLeft=t.left,this.targetTop=t.top}if(this.resizable){const{left:e,top:t,right:n,bottom:r}=this.resizable.getBoundingClientRect();this.boundaryLeft=e,this.boundaryRight=n,this.boundaryTop=t,this.boundaryBottom=r}}destroy(){this.unregisterEvents()}}const ZG={PREFIX:`${C}-resizable`},JG=ZG.PREFIX;class QG extends f{constructor(e){super(e),this.state={direction:this.props.direction},this.resizeHandlerRef=(0,d.createRef)(),this.foundation=new XG(this.adapter)}componentDidMount(){this.foundation.init()}componentDidUpdate(e){}componentWillUnmount(){this.foundation.destroy()}get adapter(){return Object.assign(Object.assign({},super.adapter),{registerEvent:()=>{this.resizeHandlerRef.current.addEventListener("mousedown",this.foundation.onMouseDown),this.resizeHandlerRef.current.addEventListener("touchstart",this.foundation.onTouchStart)},unregisterEvent:()=>{this.resizeHandlerRef.current.removeEventListener("mousedown",this.foundation.onMouseDown),this.resizeHandlerRef.current.removeEventListener("touchstart",this.foundation.onTouchStart)}})}render(){const{children:e,style:t,className:n}=this.props;return h().createElement("div",{className:w()(n,JG+"-resizableHandler",JG+"-resizableHandler-"+this.props.direction),style:Object.assign({},t),ref:this.resizeHandlerRef},e)}}QG.propTypes={children:E().node,direction:E().string,onResizeStart:E().func,className:E().string,disabled:E().bool,style:E().object},QG.defaultProps={};const eq=QG;__webpack_require__("qnZ5");const tq=ZG.PREFIX;class nq extends f{constructor(e){var t,n;super(e),this.getResizable=()=>{var e;return null===(e=this.resizableRef)||void 0===e?void 0:e.current},this.renderResizeHandler=()=>{const{enable:e,handleStyle:t,handleClass:n,handleNode:r,handleWrapperStyle:i,handleWrapperClass:s}=this.props;if(!e)return null;const o=LG.map((i=>{var s;return!1!==e[i]?h().createElement(eq,{key:i,direction:i,onResizeStart:this.foundation.onResizeStart,style:t&&t[i],className:n&&n[i]},null!==(s=null==r?void 0:r[i])&&void 0!==s?s:null):null}));return h().createElement("div",{className:s,style:i},o)},this.resizableRef=(0,d.createRef)(),this.foundation=new YG(this.adapter),this.state={isResizing:!1,width:null!==(t=this.foundation.propSize.width)&&void 0!==t?t:"auto",height:null!==(n=this.foundation.propSize.height)&&void 0!==n?n:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{cursor:"auto"},flexBasis:void 0}}componentDidMount(){this.foundation.init()}componentDidUpdate(e){}componentWillUnmount(){this.foundation.destroy()}get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{getResizable:this.getResizable,registerEvent:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mouse",n=e.foundation.window;"mouse"===t?(null==n||n.addEventListener("mouseup",e.foundation.onMouseUp),null==n||n.addEventListener("mousemove",e.foundation.onMouseMove),null==n||n.addEventListener("mouseleave",e.foundation.onMouseUp)):(null==n||n.addEventListener("touchmove",e.foundation.onTouchMove,{passive:!1}),null==n||n.addEventListener("touchend",e.foundation.onMouseUp),null==n||n.addEventListener("touchcancel",e.foundation.onMouseUp))},unregisterEvent:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mouse",n=e.foundation.window;"mouse"===t?(null==n||n.removeEventListener("mouseup",e.foundation.onMouseUp),null==n||n.removeEventListener("mousemove",e.foundation.onMouseMove),null==n||n.removeEventListener("mouseleave",e.foundation.onMouseUp)):(null==n||n.removeEventListener("touchmove",e.foundation.onTouchMove,{passive:!1}),null==n||n.removeEventListener("touchend",e.foundation.onMouseUp),null==n||n.removeEventListener("touchcancel",e.foundation.onMouseUp))}})}render(){var e;const{className:t,style:n,children:r,maxHeight:i,maxWidth:s,minHeight:o,minWidth:a}=this.props,l=Object.assign(Object.assign({userSelect:this.state.isResizing?"none":"auto",maxWidth:s,maxHeight:i,minWidth:a,minHeight:o},n),this.foundation.sizeStyle);return(null===(e=this.state)||void 0===e?void 0:e.flexBasis)&&(n.flexBasis=this.state.flexBasis),h().createElement("div",Object.assign({style:l,className:w()(t,tq+"-resizable"),ref:this.resizableRef},this.getDataAttr(this.props)),this.state.isResizing&&h().createElement("div",{style:this.state.backgroundStyle,className:w()(t,tq+"-background")}),r,this.renderResizeHandler())}}nq.propTypes={style:E().object,className:E().string,grid:E().arrayOf(E().number),snap:E().shape({x:E().arrayOf(E().number),y:E().arrayOf(E().number)}),snapGap:E().number,bounds:E().oneOf(["parent","window",E().node]),boundsByDirection:E().bool,size:E().object,minWidth:E().oneOfType([E().string,E().number]),minHeight:E().oneOfType([E().string,E().number]),maxWidth:E().oneOfType([E().string,E().number]),maxHeight:E().oneOfType([E().string,E().number]),lockAspectRatio:E().oneOfType([E().bool,E().number]),lockAspectRatioExtraWidth:E().number,lockAspectRatioExtraHeight:E().number,enable:E().object,handleStyle:E().object,handleClass:E().object,handleWrapperStyle:E().object,handleWrapperClass:E().string,handleNode:E().object,children:E().object,onResizeStart:E().func,onChange:E().func,onResizeEnd:E().func,defaultSize:E().object,scale:E().number,ratio:E().oneOfType([E().number,E().arrayOf(E().number)])},nq.defaultProps={onResizeStart:()=>{},onChange:()=>{},onResizeEnd:()=>{},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,ratio:1,snapGap:0};const rq=nq;class iq extends c{constructor(e){super(Object.assign({},e))}init(){this._adapter.registerEvents()}destroy(){this._adapter.unregisterEvents()}}class sq extends c{constructor(e){super(Object.assign({},e))}init(){}destroy(){}}class oq extends c{constructor(e){super(Object.assign({},e)),this.registerEvents=()=>{this._adapter.registerEvents(this.type)},this.unregisterEvents=()=>{this._adapter.unregisterEvents(this.type)},this.onResizeStart=(e,t,n)=>{this.type=n;let r,i,{clientX:s,clientY:o}=t,a=this._adapter.getItem(e),l=this._adapter.getItem(e+1);const c=this.window.getComputedStyle(a),d=this.window.getComputedStyle(l);r=qG(c,this.direction)+this.itemMinusMap.get(e),i=qG(d,this.direction)+this.itemMinusMap.get(e+1);let h=("horizontal"===this.direction?a.offsetWidth:a.offsetHeight)+this.itemMinusMap.get(e),u=("horizontal"===this.direction?l.offsetWidth:l.offsetHeight)+this.itemMinusMap.get(e+1);const p=this.getStates();this.setState({isResizing:!0,originalPosition:{x:s,y:o,lastItemSize:h,nextItemSize:u,lastOffset:r,nextOffset:i},backgroundStyle:Object.assign(Object.assign({},p.backgroundStyle),{cursor:this.window.getComputedStyle(t.target).cursor||"auto"}),curHandler:e}),this.registerEvents();let f=this._adapter.getItemStart(e),m=this._adapter.getItemStart(e+1),[g,y]=UG(this.direction);f&&f(t,g),m&&m(t,y)},this.onMouseMove=e=>{this.onResizing(e)},this.onTouchMove=e=>{e.preventDefault(),this.onResizing(e)},this.onResizing=e=>{const t=this.getStates();if(!t.isResizing)return;const{curHandler:n,originalPosition:r}=t;let{x:i,y:s,lastItemSize:o,nextItemSize:a,lastOffset:l,nextOffset:c}=r,{clientX:d,clientY:h}="mouse"===this.type?e:e.targetTouches[0];const u=this.getProps(),{direction:p}=u;let f=this._adapter.getItem(n),m=this._adapter.getItem(n+1),g=this.groupSize,y="horizontal"===p?d-i:h-s,v=o+y,b=a-y,w=WG(v,this._adapter.getItemMin(n),this._adapter.getItemMax(n),g,l),x=WG(b,this._adapter.getItemMin(n+1),this._adapter.getItemMax(n+1),g,c);w&&(v=GG(v,this._adapter.getItemMin(n),this._adapter.getItemMax(n),g,l),b=o+a-v),x&&(b=GG(b,this._adapter.getItemMin(n+1),this._adapter.getItemMax(n+1),g,c),v=o+a-b);let E=v/g*100,C=this.itemPercentMap.get(n)+this.itemPercentMap.get(n+1)-E;this.itemPercentMap.set(n,E),this.itemPercentMap.set(n+1,C),"horizontal"===p?(f.style.width=`calc(${E}% - ${this.itemMinusMap.get(n)}px)`,m.style.width=`calc(${C}% - ${this.itemMinusMap.get(n+1)}px)`):"vertical"===p&&(f.style.height=`calc(${E}% - ${this.itemMinusMap.get(n)}px)`,m.style.height=`calc(${C}% - ${this.itemMinusMap.get(n+1)}px)`);let S=this._adapter.getItemChange(n),_=this._adapter.getItemChange(n+1),[k,O]=UG(this.direction);S&&S({width:f.offsetWidth,height:f.offsetHeight},e,k),_&&_({width:m.offsetWidth,height:m.offsetHeight},e,O)},this.onResizeEnd=e=>{const{curHandler:t}=this.getStates();let n=this._adapter.getItem(t),r=this._adapter.getItem(t+1),i=this._adapter.getItemEnd(t),s=this._adapter.getItemEnd(t+1),[o,a]=UG(this.direction);i&&i({width:n.offsetWidth,height:n.offsetHeight},e,o),s&&s({width:r.offsetWidth,height:r.offsetHeight},e,a),this.setState({isResizing:!1,curHandler:null}),this.unregisterEvents()},this.initSpace=()=>{const e=this.getProps(),{direction:t}=e;let n=new Array(this._adapter.getHandlerCount()).fill(0),r=this.groupSize;this.totalMinus=0;for(let e=0;e<this._adapter.getHandlerCount();e++){let r="horizontal"===t?this._adapter.getHandler(e).offsetWidth:this._adapter.getHandler(e).offsetHeight;n[e]=r,this.totalMinus+=r}let i=0,s=new Map,o=0;for(let e=0;e<this._adapter.getItemCount();e++){0===e?this.itemMinusMap.set(e,n[e]/2):e===this._adapter.getItemCount()-1?this.itemMinusMap.set(e,n[e-1]/2):this.itemMinusMap.set(e,n[e-1]/2+n[e]/2);const a=this._adapter.getItem(e);let l=this._adapter.getItemMin(e),c=this._adapter.getItemMax(e),d=l?KG(l,r)/r*100:0,h=c?KG(c,r)/r*100:100;d>h&&console.warn("[Semi ResizableItem]: min size bigger than max size");let u=this._adapter.getItemDefaultSize(e);if(u){let n;if("string"==typeof u){if(u.endsWith("%"))n=parseFloat(u.slice(0,-1)),this.itemPercentMap.set(e,n);else if(u.endsWith("px"))n=parseFloat(u.slice(0,-2))/r*100,this.itemPercentMap.set(e,n);else if(/^-?\d+(\.\d+)?$/.test(u)){s.set(e,parseFloat(u)),o+=parseFloat(u);continue}}else if("number"==typeof u){s.set(e,u),o+=u;continue}i+=n,"horizontal"===t?a.style.width=`calc(${n}% - ${this.itemMinusMap.get(e)}px)`:a.style.height=`calc(${n}% - ${this.itemMinusMap.get(e)}px)`,n<d&&console.warn("[Semi ResizableGroup]: item size smaller than min size"),n>h&&console.warn("[Semi ResizableGroup]: item size bigger than max size")}else s.set(e,1),o+=1}let a=100-i;i>100&&(console.warn("[Semi ResizableGroup]: total Size bigger than 100%"),a=10),s.forEach(((e,n)=>{const r=this._adapter.getItem(n),i=e/o*a;this.itemPercentMap.set(n,i),"horizontal"===t?r.style.width=`calc(${i}% - ${this.itemMinusMap.get(n)}px)`:r.style.height=`calc(${i}% - ${this.itemMinusMap.get(n)}px)`}))},this.ensureConstraint=v()((()=>{const{direction:e}=this.getProps(),t=this._adapter.getItemCount();let n=!0;for(let r=0;r<t;r++){const i=this._adapter.getItem(r),s="horizontal"===e?i.offsetWidth:i.offsetHeight;if(WG(s,this._adapter.getItemMin(r),this._adapter.getItemMax(r),this.groupSize,this.itemMinusMap.get(r))){const o=GG(s,this._adapter.getItemMin(r),this._adapter.getItemMax(r),this.groupSize,this.itemMinusMap.get(r));for(let s=r+1;s<t;s++){const a=this._adapter.getItem(s),l="horizontal"===e?a.offsetWidth:a.offsetHeight;if(!WG(l,this._adapter.getItemMin(s),this._adapter.getItemMax(s),this.groupSize,this.itemMinusMap.get(s))){let t=this.itemPercentMap.get(r),n=this.itemPercentMap.get(s),l=o/this.groupSize*100,c=t+n-l;this.itemPercentMap.set(r,l),this.itemPercentMap.set(s,c),"horizontal"===e?(i.style.width=`calc(${l}% - ${this.itemMinusMap.get(r)}px)`,a.style.width=`calc(${c}% - ${this.itemMinusMap.get(s)}px)`):(i.style.height=`calc(${l}% - ${this.itemMinusMap.get(r)}px)`,a.style.height=`calc(${c}% - ${this.itemMinusMap.get(s)}px)`);break}s===t-1&&(n=!1,console.warn("[Semi ResizableGroup]: no enough space to adjust min/max size"))}}if(!n)break}}),200)}get groupRef(){return this._adapter.getGroupRef()}get groupSize(){const{direction:e}=this.getProps();return"horizontal"===e?this.groupRef.offsetWidth:this.groupRef.offsetHeight}init(){this.direction=this.getProp("direction"),this.itemMinusMap=new Map,this.itemPercentMap=new Map,this.initSpace()}get window(){var e;return null!==(e=this.groupRef.ownerDocument.defaultView)&&void 0!==e?e:null}destroy(){}}const aq=(0,d.createContext)(void 0),lq=ZG.PREFIX;class cq extends f{constructor(e){super(e),this.itemRef=(0,d.createRef)(),this.foundation=new sq(this.adapter),this.state={isResizing:!1},this.itemIndex=-1}componentDidMount(){this.foundation.init();const{min:e,max:t,onResizeStart:n,onChange:r,onResizeEnd:i,defaultSize:s}=this.props;-1===this.itemIndex&&(this.itemIndex=this.context.registerItem(this.itemRef,e,t,s,n,r,i)),this.direction=this.context.direction}componentDidUpdate(e){var t,n;if(this.context.direction!==this.direction)if(this.direction=this.context.direction,"horizontal"===this.direction){const e=null===(t=this.itemRef.current)||void 0===t?void 0:t.style.height;this.itemRef.current.style.width=e,this.itemRef.current.style.removeProperty("height")}else{const e=null===(n=this.itemRef.current)||void 0===n?void 0:n.style.width;this.itemRef.current.style.height=e,this.itemRef.current.style.removeProperty("width")}}componentWillUnmount(){this.foundation.destroy()}get adapter(){return Object.assign({},super.adapter)}render(){const e=Object.assign({},this.props.style);return h().createElement("div",{style:e,className:w()(this.props.className,lq+"-item"),ref:this.itemRef},this.props.children)}}cq.propTypes={style:E().object,className:E().string,min:E().string,max:E().string,children:E().object,onResizeStart:E().func,onChange:E().func,onResizeEnd:E().func,defaultSize:E().oneOfType([E().string,E().number])},cq.defaultProps={onResizeStart:i(),onChange:i(),onResizeEnd:i()},cq.contextType=aq;const dq=cq,hq=ZG.PREFIX;class uq extends f{constructor(e){super(e),this.onMouseDown=e=>{const{notifyResizeStart:t}=this.context;t(this.handlerIndex,e,"mouse")},this.onTouchStart=e=>{const{notifyResizeStart:t}=this.context;t(this.handlerIndex,e.targetTouches[0],"touch")},this.getHandler=()=>this.handlerRef.current,this.state={},this.handlerRef=(0,d.createRef)(),this.foundation=new iq(this.adapter),this.handlerIndex=-1}componentDidMount(){this.foundation.init(),-1===this.handlerIndex&&(this.handlerIndex=this.context.registerHandler(this.handlerRef))}componentDidUpdate(e){}componentWillUnmount(){this.foundation.destroy()}get adapter(){return Object.assign(Object.assign({},super.adapter),{registerEvents:()=>{this.handlerRef.current.addEventListener("mousedown",this.onMouseDown),this.handlerRef.current.addEventListener("touchstart",this.onTouchStart)},unregisterEvents:()=>{this.handlerRef.current.removeEventListener("mousedown",this.onMouseDown),this.handlerRef.current.removeEventListener("touchstart",this.onTouchStart)}})}render(){const{style:e,className:t,children:n}=this.props,{direction:r}=this.context;return h().createElement("div",{className:w()(t,hq+"-handler",hq+"-handler-"+r),style:e,ref:this.handlerRef},null!=n?n:h().createElement(ih,{size:"inherit",style:{rotate:"horizontal"===this.context.direction?"0deg":"90deg"}}))}}uq.propTypes={children:E().node,direction:E().string,onResizeStart:E().func,className:E().string,disabled:E().bool,style:E().object},uq.defaultProps={},uq.contextType=aq;const pq=uq;var fq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const mq=ZG.PREFIX;class gq extends f{constructor(e){var t;super(e),t=this,this.itemRefs=new Map,this.itemMinMap=new Map,this.itemMaxMap=new Map,this.itemMinusMap=new Map,this.itemDefaultSizeList=new Map,this.itemResizeStart=new Map,this.itemResizing=new Map,this.itemResizeEnd=new Map,this.handlerRefs=new Map,this.registerEvent=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mouse";t.window&&("mouse"===e?(t.window.addEventListener("mousemove",t.foundation.onMouseMove),t.window.addEventListener("mouseup",t.foundation.onResizeEnd),t.window.addEventListener("mouseleave",t.foundation.onResizeEnd)):(t.window.addEventListener("touchmove",t.foundation.onTouchMove,{passive:!1}),t.window.addEventListener("touchend",t.foundation.onResizeEnd),t.window.addEventListener("touchcancel",t.foundation.onResizeEnd)))},this.unregisterEvent=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mouse";t.window&&("mouse"===e?(t.window.removeEventListener("mousemove",t.foundation.onMouseMove),t.window.removeEventListener("mouseup",t.foundation.onResizeEnd),t.window.removeEventListener("mouseleave",t.foundation.onResizeEnd)):(t.window.removeEventListener("touchmove",t.foundation.onTouchMove,{passive:!1}),t.window.removeEventListener("touchend",t.foundation.onResizeEnd),t.window.removeEventListener("touchcancel",t.foundation.onResizeEnd)))},this.registerItem=(e,t,n,r,i,s,o)=>{if(Array.from(this.itemRefs.values()).some((t=>t===e)))return-1;let a=this.itemRefs.size;return this.itemRefs.set(a,e),this.itemMinMap.set(a,t),this.itemMaxMap.set(a,n),this.itemDefaultSizeList.set(a,r),this.itemResizeStart.set(a,i),this.itemResizing.set(a,s),this.itemResizeEnd.set(a,o),a},this.registerHandler=e=>{if(Array.from(this.handlerRefs.values()).some((t=>t===e)))return-1;let t=this.handlerRefs.size;return this.handlerRefs.set(t,e),t},this.getGroupSize=()=>this.groupSize,this.groupRef=(0,d.createRef)(),this.foundation=new oq(this.adapter),this.state={isResizing:!1,originalPosition:{x:0,y:0,lastItemSize:0,nextItemSize:0,lastOffset:0,nextOffset:0},backgroundStyle:{cursor:"auto"},curHandler:null,contextValue:{direction:e.direction,registerItem:this.registerItem,registerHandler:this.registerHandler,notifyResizeStart:this.foundation.onResizeStart,getGroupSize:this.getGroupSize}}}componentDidMount(){this.foundation.init(),window.addEventListener("resize",this.foundation.ensureConstraint)}componentDidUpdate(e){this.props.direction!==e.direction&&(this.setState((e=>Object.assign(Object.assign({},e),{contextValue:Object.assign(Object.assign({},e.contextValue),{direction:this.props.direction})}))),this.foundation.direction=this.props.direction)}componentWillUnmount(){this.foundation.destroy(),window.removeEventListener("resize",this.foundation.ensureConstraint)}get adapter(){return Object.assign(Object.assign({},super.adapter),{getGroupRef:()=>this.groupRef.current,getItem:e=>this.itemRefs.get(e).current,getItemCount:()=>this.itemRefs.size,getHandler:e=>this.handlerRefs.get(e).current,getHandlerCount:()=>this.handlerRefs.size,getItemMin:e=>this.itemMinMap.get(e),getItemMax:e=>this.itemMaxMap.get(e),getItemChange:e=>this.itemResizing.get(e),getItemEnd:e=>this.itemResizeEnd.get(e),getItemStart:e=>this.itemResizeStart.get(e),getItemDefaultSize:e=>this.itemDefaultSizeList.get(e),registerEvents:this.registerEvent,unregisterEvents:this.unregisterEvent})}get window(){var e;return null!==(e=this.groupRef.current.ownerDocument.defaultView)&&void 0!==e?e:null}render(){const e=this.props,{children:t,direction:n,className:r}=e,i=fq(e,["children","direction","className"]);return h().createElement(aq.Provider,{value:this.state.contextValue},h().createElement("div",Object.assign({style:{flexDirection:"vertical"===n?"column":"row"},ref:this.groupRef,className:w()(r,mq+"-group")},i),this.state.isResizing&&h().createElement("div",{style:this.state.backgroundStyle,className:w()(r,mq+"-background")}),t))}}gq.propTypes={},gq.defaultProps={direction:"horizontal"},gq.contextType=aq;const yq=gq;function vq(e,t,n){const r=document.createElement(e);return r.className=t,n&&bq(r,n),r}function bq(e,t){for(const[n,r]of Object.entries(t))e.style[n]=r}function wq(e,t=!1){const n=e.length;let r=0,i="",s=0,o=16,a=0,l=0,c=0,d=0,h=0;function u(t,n){let i=0,s=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)s=16*s+t-48;else if(t>=65&&t<=70)s=16*s+t-65+10;else{if(!(t>=97&&t<=102))break;s=16*s+t-97+10}r++,i++}return i<t&&(s=-1),s}function p(){if(i="",h=0,s=r,l=a,d=c,r>=n)return s=n,o=17;let t=e.charCodeAt(r);if(xq(t)){do{r++,i+=String.fromCharCode(t),t=e.charCodeAt(r)}while(xq(t));return o=15}if(Eq(t))return r++,i+=String.fromCharCode(t),13===t&&10===e.charCodeAt(r)&&(r++,i+="\n"),a++,c=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=function(){let t="",i=r;for(;;){if(r>=n){t+=e.substring(i,r),h=2;break}const s=e.charCodeAt(r);if(34===s){t+=e.substring(i,r),r++;break}if(92!==s){if(s>=0&&s<=31){if(Eq(s)){t+=e.substring(i,r),h=2;break}h=6}r++}else{if(t+=e.substring(i,r),r++,r>=n){h=2;break}switch(e.charCodeAt(r++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:const e=u(4,!0);e>=0?t+=String.fromCharCode(e):h=4;break;default:h=5}i=r}}return t}(),o=10;case 47:const l=r-1;if(47===e.charCodeAt(r+1)){for(r+=2;r<n&&!Eq(e.charCodeAt(r));)r++;return i=e.substring(l,r),o=12}if(42===e.charCodeAt(r+1)){r+=2;const t=n-1;let s=!1;for(;r<t;){const t=e.charCodeAt(r);if(42===t&&47===e.charCodeAt(r+1)){r+=2,s=!0;break}r++,Eq(t)&&(13===t&&10===e.charCodeAt(r)&&r++,a++,c=r)}return s||(r++,h=1),i=e.substring(l,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!Cq(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=function(){let t=r;if(48===e.charCodeAt(r))r++;else for(r++;r<e.length&&Cq(e.charCodeAt(r));)r++;if(r<e.length&&46===e.charCodeAt(r)){if(r++,!(r<e.length&&Cq(e.charCodeAt(r))))return h=3,e.substring(t,r);for(r++;r<e.length&&Cq(e.charCodeAt(r));)r++}let n=r;if(r<e.length&&(69===e.charCodeAt(r)||101===e.charCodeAt(r)))if(r++,(r<e.length&&43===e.charCodeAt(r)||45===e.charCodeAt(r))&&r++,r<e.length&&Cq(e.charCodeAt(r))){for(r++;r<e.length&&Cq(e.charCodeAt(r));)r++;n=r}else h=3;return e.substring(t,n)}(),o=11;default:for(;r<n&&f(t);)r++,t=e.charCodeAt(r);if(s!==r){switch(i=e.substring(s,r),i){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function f(e){if(xq(e)||Eq(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}return{setPosition:function(e){r=e,i="",s=0,o=16,h=0},getPosition:()=>r,scan:t?function(){let e;do{e=p()}while(e>=12&&e<=15);return e}:p,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>s,getTokenLength:()=>r-s,getTokenStartLine:()=>l,getTokenStartCharacter:()=>s-d,getTokenError:()=>h}}function xq(e){return 32===e||9===e}function Eq(e){return 10===e||13===e}function Cq(e){return e>=48&&e<=57}var Sq;!function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"}(Sq||(Sq={}));new Array(20).fill(0).map(((e,t)=>" ".repeat(t)));const _q=200;new Array(_q).fill(0).map(((e,t)=>"\n"+" ".repeat(t))),new Array(_q).fill(0).map(((e,t)=>"\r"+" ".repeat(t))),new Array(_q).fill(0).map(((e,t)=>"\r\n"+" ".repeat(t))),new Array(_q).fill(0).map(((e,t)=>"\n"+"\t".repeat(t))),new Array(_q).fill(0).map(((e,t)=>"\r"+"\t".repeat(t))),new Array(_q).fill(0).map(((e,t)=>"\r\n"+"\t".repeat(t)));var kq;function Oq(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}!function(e){e.DEFAULT={allowTrailingComma:!1}}(kq||(kq={}));const Tq=wq;var Pq,Iq;!function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"}(Pq||(Pq={})),function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"}(Iq||(Iq={}));const Mq=function e(t,n,r=!1){if(function(e,t,n=!1){return t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}(t,n,r)){const i=t.children;if(Array.isArray(i))for(let t=0;t<i.length&&i[t].offset<=n;t++){const s=e(i[t],n,r);if(s)return s}return t}},Rq=function e(t){if(!t.parent||!t.parent.children)return[];const n=e(t.parent);if("property"===t.parent.type){const e=t.parent.children[0].value;n.push(e)}else if("array"===t.parent.type){const e=t.parent.children.indexOf(t);-1!==e&&n.push(e)}return n},Aq=function e(t){switch(t.type){case"array":return t.children.map(e);case"object":const n=Object.create(null);for(let r of t.children){const t=r.children[1];t&&(n[r.children[0].value]=e(t))}return n;case"null":case"string":case"number":case"boolean":return t.value;default:return}};var Nq;!function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"}(Nq||(Nq={}));function Dq(e){return{getInitialState:()=>new Zq(null,null,!1,null),tokenize:(t,n)=>function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=0,s=!1;switch(n.scanError){case qq.UnexpectedEndOfString:t='"'+t,i=1;break;case qq.UnexpectedEndOfComment:t="/*"+t,i=2}const o=Tq(t);let a=n.lastWasColon,l=n.parents;const c={tokens:[],endState:n.clone()};for(;;){let d=r+o.getPosition(),h="";const u=o.scan();if(u===Xq.EOF)break;if(d===r+o.getPosition())throw new Error("Scanner did not advance, next 3 characters are: "+t.substr(o.getPosition(),3));switch(s&&(d-=i),s=i>0,u){case Xq.OpenBraceToken:l=Yq.push(l,Gq.Object),h=`${Lq}-${l?l.depth%3:0}`,a=!1;break;case Xq.CloseBraceToken:h=`${Lq}-${l?l.depth%3:0}`,l=Yq.pop(l),a=!1;break;case Xq.OpenBracketToken:l=Yq.push(l,Gq.Array),h=`${Fq}-${l?l.depth%3:0}`,a=!1;break;case Xq.CloseBracketToken:h=`${Fq}-${l?l.depth%3:0}`,l=Yq.pop(l),a=!1;break;case Xq.ColonToken:h=jq,a=!0;break;case Xq.CommaToken:h=$q,a=!1;break;case Xq.TrueKeyword:case Xq.FalseKeyword:h=Bq,a=!1;break;case Xq.NullKeyword:h=Vq,a=!1;break;case Xq.StringLiteral:const e=(l?l.type:Gq.Object)===Gq.Array;h=a||e?zq:Uq,a=!1;break;case Xq.NumericLiteral:h=Hq,a=!1}if(e)switch(u){case Xq.LineCommentTrivia:h=Wq;break;case Xq.BlockCommentTrivia:h=Kq}c.endState=new Zq(n.getStateData(),o.getTokenError(),a,l),c.tokens.push({startIndex:d,scopes:h})}return c}(e,t,n)}}const Lq="delimiter-bracket",Fq="delimiter-array",jq="delimiter-colon",$q="delimiter-comma",Bq="keyword",Vq="keyword",zq="string-value",Hq="number",Uq="string-key",Kq="comment-block",Wq="comment-line";var Gq,qq,Xq;!function(e){e[e.Object=0]="Object",e[e.Array=1]="Array"}(Gq||(Gq={}));class Yq{constructor(e,t,n){this.parent=e,this.type=t,this.depth=n}static pop(e){return e?e.parent:null}static push(e,t){return new Yq(e,t,e?e.depth+1:0)}static equals(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;for(;e&&t;){if(e.type!==t.type||e.depth!==t.depth)return!1;e=e.parent,t=t.parent}return null===e&&null===t}}class Zq{constructor(e,t,n,r){this._state=e,this.scanError=t,this.lastWasColon=n,this.parents=r}clone(){return new Zq(this._state,this.scanError,this.lastWasColon,this.parents)}equals(e){return e===this||!!(e&&e instanceof Zq)&&(this.scanError===e.scanError&&this.lastWasColon===e.lastWasColon&&Yq.equals(this.parents,e.parents))}getStateData(){return this._state}setStateData(e){this._state=e}}!function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"}(qq||(qq={})),function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"}(Xq||(Xq={}));let Jq="default";function Qq(){return Jq}const eX=new Map;class tX{constructor(){this.listeners={}}on(e,t){var n;this.listeners[e]||(this.listeners[e]=[]),null===(n=this.listeners[e])||void 0===n||n.push(t)}off(e,t){var n;this.listeners[e]&&(this.listeners[e]=null===(n=this.listeners[e])||void 0===n?void 0:n.filter((e=>e!==t)))}dispose(){this.listeners={}}removeAllListeners(){this.listeners={}}emit(e,t){if(this.listeners[e])for(const n of this.listeners[e])n(t)}}const nX=()=>{const e=Qq();if(!e)throw new Error("currentNameSpaceId is not set");let t=eX.get(e);return t||(t=new tX,eX.set(e,t)),t};class rX{constructor(e,t,n,r){this.isSelectedAll=!1,this.isSelecting=!1,this._row=e,this._col=t,this._view=n,this.startRow=e,this.startCol=t,this.endRow=e,this.endCol=t,this.isCollapsed=!0,this._jsonModel=r}updateSelection(e,t){this._row=e,this._col=t}getSelection(){return{row:this._row,col:this._col}}getPosition(){return{lineNumber:this._row,column:this._col}}updateFromSelection(){const e=this._getValidSelection();if(!e)return;this.isCollapsed=e.isCollapsed;const t=e.anchorNode,n=e.focusNode;let{row:r,col:i}=this.convertRangeToModelPosition(t,e,!0),{row:s,col:o}=this.convertRangeToModelPosition(n,e,!1);(r>s||r===s&&i>o)&&([r,s]=[s,r],[i,o]=[o,i]),this._setSelection(r,i,s,o),this._jsonModel.lastChangeBufferPos={lineNumber:this._row,column:this._col}}updateFromSelectingStart(){const e=this._getValidSelection();if(!e)return;this.isCollapsed=e.isCollapsed;const t=e.anchorNode;let{row:n,col:r}=this.convertRangeToModelPosition(t,e,!0);this._setSelection(n,r,this.endRow,this.endCol)}updateFromSelectingEnd(){const e=this._getValidSelection();if(!e)return;this.isCollapsed=e.isCollapsed;const t=e.focusNode;let{row:n,col:r}=this.convertRangeToModelPosition(t,e,!1);this._setSelection(this.startRow,this.startCol,n,r),this._jsonModel.lastChangeBufferPos={lineNumber:this._row,column:this._col}}_getValidSelection(){const e=window.getSelection();return e&&0!==e.rangeCount&&e.anchorNode&&e.focusNode?e:null}_setSelection(e,t,n,r){this._row=e,this._col=t,this.startRow=e,this.startCol=t,this.endRow=n,this.endCol=r}toViewPosition(){const e=window.getSelection();if(!e)return;if(this.isSelectedAll){const t=this._view.scrollDom.firstChild,n=this._view.scrollDom.lastChild;if(!t||!n)return void e.removeAllRanges();const r=new Range;return r.setStartBefore(t),r.setEndAfter(n),e.removeAllRanges(),void e.addRange(r)}if(!this.isCollapsed)return void this._restoreMultiSelection(e);const t=this._jsonModel.lastChangeBufferPos.lineNumber,n=this._jsonModel.lastChangeBufferPos.column-1,r=this._view.scrollDom.firstElementChild,i=this._view.scrollDom.lastElementChild;if(!r||!i)return void e.removeAllRanges();const s=this._view.getLineElement(t),o=new Range;if(s){const e=this._findPositionInLine(s,n);e?(o.setStart(e.node,e.offset),o.setEnd(e.node,e.offset)):(o.setStart(s,0),o.setEnd(s,0))}else{const n=Number(r.dataset.lineNumber||0),s=Number(i.dataset.lineNumber||0);if(t<n)o.setStartBefore(r),o.setEndBefore(r);else{if(!(t>s))return void e.removeAllRanges();o.setStartAfter(i),o.setEndAfter(i)}}e.removeAllRanges(),e.addRange(o)}_restoreMultiSelection(e){var t;const n=this._view.scrollDom.firstElementChild,r=this._view.scrollDom.lastElementChild;if(!n||!r)return void e.removeAllRanges();const i=this._view.getLineElement(this.startRow),s=this._view.getLineElement(this.endRow),o=Number(n.dataset.lineNumber||0),a=Number(r.dataset.lineNumber||0),l=this.endRow<o,c=this.startRow>a;if(l){const t=new Range;return t.setStartBefore(n),t.setEndBefore(n),e.removeAllRanges(),void e.addRange(t)}if(c){const t=new Range;return t.setStartAfter(r),t.setEndAfter(r),e.removeAllRanges(),void e.addRange(t)}const d=new Range;if(i){const e=this._findPositionInLine(i,this.startCol-1);e?d.setStart(e.node,e.offset):d.setStart(i,0)}else d.setStartBefore(n);if(s){const e=this._findPositionInLine(s,this.endCol-1);if(e)d.setEnd(e.node,e.offset);else{const e=s.lastChild;e&&(e.nodeType===Node.TEXT_NODE?d.setEnd(e,(null===(t=e.textContent)||void 0===t?void 0:t.length)||0):d.setEnd(s,s.childNodes.length))}}else d.setEndAfter(r);e.removeAllRanges(),e.addRange(d)}_findPositionInLine(e,t){if(0===t){const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null).nextNode();return t?{node:t,offset:0}:null}const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let r=n.nextNode(),i=0;for(;r;){const e=r.length;if(i+e>=t)return{node:r,offset:t-i};i+=e,r=n.nextNode()}n.currentNode=e;let s=null;for(;n.nextNode();)s=n.currentNode;return s?{node:s,offset:s.length}:null}toLastPosition(){this.isCollapsed=!0,this.isSelectedAll=!1;const e=this._jsonModel.getLineCount(),t=this._jsonModel.getLineLength(e);this._row=e,this._col=t+1,this.startRow=e,this.startCol=t+1,this.endRow=e,this.endCol=t+1,this._jsonModel.lastChangeBufferPos={lineNumber:e,column:t+1},this.toViewPosition()}convertRangeToModelPosition(e,t,n){let r,i=1,s=0;if(!e)return{row:i,col:s};if(e instanceof HTMLElement)r=e.closest(`.${this._view.prefixCls}-view-line`);else{if(r=function(e){var t;return(null===(t=e.parentElement)||void 0===t?void 0:t.closest('[data-line-element="true"]'))||null}(e),!r)return{row:i,col:s};const o=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null);let a=o.nextNode(),l=0;for(;a;){if(a===e){l+=n?t.anchorOffset:t.focusOffset;break}if(a.parentNode===e.parentNode&&a===e){l+=n?t.anchorOffset:t.focusOffset;break}l+=a.length,a=o.nextNode()}s=l}return i=(null==r?void 0:r.lineNumber)||1,{row:i,col:s+1}}savePreviousSelection(){this.preStartRow=this.startRow,this.preStartCol=this.startCol,this.preEndRow=this.endRow,this.preEndCol=this.endCol}restorePreviousSelection(){this.startRow=this.preStartRow,this.startCol=this.preStartCol,this.endRow=this.preEndRow,this.endCol=this.preEndCol,this._jsonModel.lastChangeBufferPos={lineNumber:this.startRow,column:this.startCol}}}var iX=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};const sX=new Map;class oX{constructor(){const e=decodeURIComponent("%WORKER_RAW%"),t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this._worker=new Worker(n),this._callbacks=new Map,this._worker.onmessage=this._handleWorkerMessage.bind(this)}init(e){return iX(this,void 0,void 0,(function*(){yield this._sendRequest("init",{value:e})}))}updateModel(e){return this._sendRequest("updateModel",{op:e})}undo(){return this._sendRequest("undo",{})}redo(){return this._sendRequest("redo",{})}formatJson(e){return this._sendRequest("format",{options:e})}foldRange(){return this._sendRequest("foldRange",{})}validate(){return this._sendRequest("validate",{})}_sendRequest(e,t){return new Promise(((n,r)=>{const i=Date.now()+Math.random();this._callbacks.set(i,n),this._worker.postMessage({messageId:i,method:e,params:t})}))}_handleWorkerMessage(e){const{messageId:t,result:n,error:r}=e.data,i=this._callbacks.get(t);i&&(i(r?new Error(r):n),this._callbacks.delete(t))}dispose(){this._worker.terminate(),this._callbacks.clear()}}function aX(){const e=Qq();if(!e)throw new Error("No active worker ID set");let t=sX.get(e);return t||(t=new oX,sX.set(e,t)),t}var lX;!function(e){e[e.provider=0]="provider",e[e.userDefined=1]="userDefined",e[e.recovered=2]="recovered"}(lX||(lX={}));lX.provider,lX.userDefined,lX.recovered;const cX=16777215,dX=4278190080;class hX{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,n=e%32;return!!(this._states[t]&1<<n)}set(e,t){const n=e/32|0,r=e%32,i=this._states[n];this._states[n]=t?i|1<<r:i&~(1<<r)}}class uX{constructor(e,t,n){if(e.length!==t.length||e.length>65535)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new hX(e.length),this._userDefinedStates=new hX(e.length),this._recoveredStates=new hX(e.length),this._types=n,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(t,n)=>{const r=e[e.length-1];return this.getStartLineNumber(r)<=t&&this.getEndLineNumber(r)>=n};for(let n=0,r=this._startIndexes.length;n<r;n++){const r=this._startIndexes[n],i=this._endIndexes[n];if(r>cX||i>cX)throw new Error("startLineNumber or endLineNumber must not exceed "+cX);for(;e.length>0&&!t(r,i);)e.pop();const s=e.length>0?e[e.length-1]:-1;e.push(n),this._startIndexes[n]=r+((255&s)<<24),this._endIndexes[n]=i+((65280&s)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&cX}getEndLineNumber(e){return this._endIndexes[e]&cX}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?lX.userDefined:this.isRecovered(e)?lX.recovered:lX.provider}setSource(e,t){t===lX.userDefined?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===lX.recovered?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let n=!1;if(this._types)for(let r=0;r<this._types.length;r++)this._types[r]===e&&(this.setCollapsed(r,t),n=!0);return n}toRegion(e){return new pX(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&dX)>>>24)+((this._endIndexes[e]&dX)>>>16);return 65535===t?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,n=this._startIndexes.length;if(0===n)return-1;for(;t<n;){const r=Math.floor((t+n)/2);e<this.getStartLineNumber(r)?n=r:t=r+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);-1!==t;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&cX,endLineNumber:this._endIndexes[e]&cX,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){e=e.sort(((e,t)=>e.startLineNumber-t.startLineNumber));const t=e.length,n=new Uint32Array(t),r=new Uint32Array(t);let i=[],s=!1;for(let o=0;o<t;o++){const t=e[o];n[o]=t.startLineNumber,r[o]=t.endLineNumber,i.push(t.type),t.type&&(s=!0)}s||(i=void 0);const o=new uX(n,r,i);for(let n=0;n<t;n++)e[n].isCollapsed&&o.setCollapsed(n,!0),o.setSource(n,e[n].source);return o}static sanitizeAndMerge(e,t,n){n=null!=n?n:Number.MAX_VALUE;const r=(e,t)=>Array.isArray(e)?n=>n<t?e[n]:void 0:n=>n<t?e.toFoldRange(n):void 0,i=r(e,e.length),s=r(t,t.length);let o=0,a=0,l=i(0),c=s(0);const d=[];let h,u=0;const p=[];for(;l||c;){let e;if(c&&(!l||l.startLineNumber>=c.startLineNumber))l&&l.startLineNumber===c.startLineNumber?(c.source===lX.userDefined?e=c:(e=l,e.isCollapsed=c.isCollapsed&&l.endLineNumber===c.endLineNumber,e.source=lX.provider),l=i(++o)):(e=c,c.isCollapsed&&c.source===lX.provider&&(e.source=lX.recovered)),c=s(++a);else{let t=a,n=c;for(;;){if(!n||n.startLineNumber>l.endLineNumber){e=l;break}if(n.source===lX.userDefined&&n.endLineNumber>l.endLineNumber)break;n=s(++t)}l=i(++o)}if(e){for(;h&&h.endLineNumber<e.startLineNumber;)h=d.pop();e.endLineNumber>e.startLineNumber&&e.startLineNumber>u&&e.endLineNumber<=n&&(!h||h.endLineNumber>=e.endLineNumber)&&(p.push(e),u=e.startLineNumber,h&&d.push(h),h=e)}}return p}}class pX{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}hidesLine(e){return this.startLineNumber<e&&e<=this.endLineNumber}}var fX,mX,gX;function yX(e,t,n){const r=e.charCodeAt(n);if(function(e){return 55296<=e&&e<=56319}(r)&&n+1<t){const t=e.charCodeAt(n+1);if(function(e){return 56320<=e&&e<=57343}(t))return t-56320+(r-55296<<10)+65536}return r}function vX(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;for(let r=t;r<n;r++){const n=e.charCodeAt(r);if(n!==fX.Space&&n!==fX.Tab)return e.substring(t,r)}return e.substring(t,n)}function bX(e){let t=0,n=0,r=0,i=mX.Unknown;for(let s=0,o=e.length;s<o;s++){const a=e.charCodeAt(s);a===fX.CarriageReturn?(0===t&&(n=s),t++,s+1<o&&e.charCodeAt(s+1)===fX.LineFeed?(i|=mX.CRLF,s++):i|=mX.Invalid,r=s+1):a===fX.LineFeed&&(i|=mX.LF,0===t&&(n=s),t++,r=s+1)}return 0===t&&(n=e.length),[t,n,e.length-r,i]}!function(e){e[e.Null=0]="Null",e[e.Backspace=8]="Backspace",e[e.Tab=9]="Tab",e[e.LineFeed=10]="LineFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.DoubleQuote=34]="DoubleQuote",e[e.Hash=35]="Hash",e[e.DollarSign=36]="DollarSign",e[e.PercentSign=37]="PercentSign",e[e.Ampersand=38]="Ampersand",e[e.SingleQuote=39]="SingleQuote",e[e.OpenParen=40]="OpenParen",e[e.CloseParen=41]="CloseParen",e[e.Asterisk=42]="Asterisk",e[e.Plus=43]="Plus",e[e.Comma=44]="Comma",e[e.Dash=45]="Dash",e[e.Period=46]="Period",e[e.Slash=47]="Slash",e[e.Digit0=48]="Digit0",e[e.Digit1=49]="Digit1",e[e.Digit2=50]="Digit2",e[e.Digit3=51]="Digit3",e[e.Digit4=52]="Digit4",e[e.Digit5=53]="Digit5",e[e.Digit6=54]="Digit6",e[e.Digit7=55]="Digit7",e[e.Digit8=56]="Digit8",e[e.Digit9=57]="Digit9",e[e.Colon=58]="Colon",e[e.Semicolon=59]="Semicolon",e[e.LessThan=60]="LessThan",e[e.Equals=61]="Equals",e[e.GreaterThan=62]="GreaterThan",e[e.QuestionMark=63]="QuestionMark",e[e.AtSign=64]="AtSign",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.OpenSquareBracket=91]="OpenSquareBracket",e[e.Backslash=92]="Backslash",e[e.CloseSquareBracket=93]="CloseSquareBracket",e[e.Caret=94]="Caret",e[e.Underline=95]="Underline",e[e.BackTick=96]="BackTick",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.OpenCurlyBrace=123]="OpenCurlyBrace",e[e.Pipe=124]="Pipe",e[e.CloseCurlyBrace=125]="CloseCurlyBrace",e[e.Tilde=126]="Tilde",e[e.NoBreakSpace=160]="NoBreakSpace",e[e.U_Combining_Grave_Accent=768]="U_Combining_Grave_Accent",e[e.U_Combining_Acute_Accent=769]="U_Combining_Acute_Accent",e[e.U_Combining_Circumflex_Accent=770]="U_Combining_Circumflex_Accent",e[e.U_Combining_Tilde=771]="U_Combining_Tilde",e[e.U_Combining_Macron=772]="U_Combining_Macron",e[e.U_Combining_Overline=773]="U_Combining_Overline",e[e.U_Combining_Breve=774]="U_Combining_Breve",e[e.U_Combining_Dot_Above=775]="U_Combining_Dot_Above",e[e.U_Combining_Diaeresis=776]="U_Combining_Diaeresis",e[e.U_Combining_Hook_Above=777]="U_Combining_Hook_Above",e[e.U_Combining_Ring_Above=778]="U_Combining_Ring_Above",e[e.U_Combining_Double_Acute_Accent=779]="U_Combining_Double_Acute_Accent",e[e.U_Combining_Caron=780]="U_Combining_Caron",e[e.U_Combining_Vertical_Line_Above=781]="U_Combining_Vertical_Line_Above",e[e.U_Combining_Double_Vertical_Line_Above=782]="U_Combining_Double_Vertical_Line_Above",e[e.U_Combining_Double_Grave_Accent=783]="U_Combining_Double_Grave_Accent",e[e.U_Combining_Candrabindu=784]="U_Combining_Candrabindu",e[e.U_Combining_Inverted_Breve=785]="U_Combining_Inverted_Breve",e[e.U_Combining_Turned_Comma_Above=786]="U_Combining_Turned_Comma_Above",e[e.U_Combining_Comma_Above=787]="U_Combining_Comma_Above",e[e.U_Combining_Reversed_Comma_Above=788]="U_Combining_Reversed_Comma_Above",e[e.U_Combining_Comma_Above_Right=789]="U_Combining_Comma_Above_Right",e[e.U_Combining_Grave_Accent_Below=790]="U_Combining_Grave_Accent_Below",e[e.U_Combining_Acute_Accent_Below=791]="U_Combining_Acute_Accent_Below",e[e.U_Combining_Left_Tack_Below=792]="U_Combining_Left_Tack_Below",e[e.U_Combining_Right_Tack_Below=793]="U_Combining_Right_Tack_Below",e[e.U_Combining_Left_Angle_Above=794]="U_Combining_Left_Angle_Above",e[e.U_Combining_Horn=795]="U_Combining_Horn",e[e.U_Combining_Left_Half_Ring_Below=796]="U_Combining_Left_Half_Ring_Below",e[e.U_Combining_Up_Tack_Below=797]="U_Combining_Up_Tack_Below",e[e.U_Combining_Down_Tack_Below=798]="U_Combining_Down_Tack_Below",e[e.U_Combining_Plus_Sign_Below=799]="U_Combining_Plus_Sign_Below",e[e.U_Combining_Minus_Sign_Below=800]="U_Combining_Minus_Sign_Below",e[e.U_Combining_Palatalized_Hook_Below=801]="U_Combining_Palatalized_Hook_Below",e[e.U_Combining_Retroflex_Hook_Below=802]="U_Combining_Retroflex_Hook_Below",e[e.U_Combining_Dot_Below=803]="U_Combining_Dot_Below",e[e.U_Combining_Diaeresis_Below=804]="U_Combining_Diaeresis_Below",e[e.U_Combining_Ring_Below=805]="U_Combining_Ring_Below",e[e.U_Combining_Comma_Below=806]="U_Combining_Comma_Below",e[e.U_Combining_Cedilla=807]="U_Combining_Cedilla",e[e.U_Combining_Ogonek=808]="U_Combining_Ogonek",e[e.U_Combining_Vertical_Line_Below=809]="U_Combining_Vertical_Line_Below",e[e.U_Combining_Bridge_Below=810]="U_Combining_Bridge_Below",e[e.U_Combining_Inverted_Double_Arch_Below=811]="U_Combining_Inverted_Double_Arch_Below",e[e.U_Combining_Caron_Below=812]="U_Combining_Caron_Below",e[e.U_Combining_Circumflex_Accent_Below=813]="U_Combining_Circumflex_Accent_Below",e[e.U_Combining_Breve_Below=814]="U_Combining_Breve_Below",e[e.U_Combining_Inverted_Breve_Below=815]="U_Combining_Inverted_Breve_Below",e[e.U_Combining_Tilde_Below=816]="U_Combining_Tilde_Below",e[e.U_Combining_Macron_Below=817]="U_Combining_Macron_Below",e[e.U_Combining_Low_Line=818]="U_Combining_Low_Line",e[e.U_Combining_Double_Low_Line=819]="U_Combining_Double_Low_Line",e[e.U_Combining_Tilde_Overlay=820]="U_Combining_Tilde_Overlay",e[e.U_Combining_Short_Stroke_Overlay=821]="U_Combining_Short_Stroke_Overlay",e[e.U_Combining_Long_Stroke_Overlay=822]="U_Combining_Long_Stroke_Overlay",e[e.U_Combining_Short_Solidus_Overlay=823]="U_Combining_Short_Solidus_Overlay",e[e.U_Combining_Long_Solidus_Overlay=824]="U_Combining_Long_Solidus_Overlay",e[e.U_Combining_Right_Half_Ring_Below=825]="U_Combining_Right_Half_Ring_Below",e[e.U_Combining_Inverted_Bridge_Below=826]="U_Combining_Inverted_Bridge_Below",e[e.U_Combining_Square_Below=827]="U_Combining_Square_Below",e[e.U_Combining_Seagull_Below=828]="U_Combining_Seagull_Below",e[e.U_Combining_X_Above=829]="U_Combining_X_Above",e[e.U_Combining_Vertical_Tilde=830]="U_Combining_Vertical_Tilde",e[e.U_Combining_Double_Overline=831]="U_Combining_Double_Overline",e[e.U_Combining_Grave_Tone_Mark=832]="U_Combining_Grave_Tone_Mark",e[e.U_Combining_Acute_Tone_Mark=833]="U_Combining_Acute_Tone_Mark",e[e.U_Combining_Greek_Perispomeni=834]="U_Combining_Greek_Perispomeni",e[e.U_Combining_Greek_Koronis=835]="U_Combining_Greek_Koronis",e[e.U_Combining_Greek_Dialytika_Tonos=836]="U_Combining_Greek_Dialytika_Tonos",e[e.U_Combining_Greek_Ypogegrammeni=837]="U_Combining_Greek_Ypogegrammeni",e[e.U_Combining_Bridge_Above=838]="U_Combining_Bridge_Above",e[e.U_Combining_Equals_Sign_Below=839]="U_Combining_Equals_Sign_Below",e[e.U_Combining_Double_Vertical_Line_Below=840]="U_Combining_Double_Vertical_Line_Below",e[e.U_Combining_Left_Angle_Below=841]="U_Combining_Left_Angle_Below",e[e.U_Combining_Not_Tilde_Above=842]="U_Combining_Not_Tilde_Above",e[e.U_Combining_Homothetic_Above=843]="U_Combining_Homothetic_Above",e[e.U_Combining_Almost_Equal_To_Above=844]="U_Combining_Almost_Equal_To_Above",e[e.U_Combining_Left_Right_Arrow_Below=845]="U_Combining_Left_Right_Arrow_Below",e[e.U_Combining_Upwards_Arrow_Below=846]="U_Combining_Upwards_Arrow_Below",e[e.U_Combining_Grapheme_Joiner=847]="U_Combining_Grapheme_Joiner",e[e.U_Combining_Right_Arrowhead_Above=848]="U_Combining_Right_Arrowhead_Above",e[e.U_Combining_Left_Half_Ring_Above=849]="U_Combining_Left_Half_Ring_Above",e[e.U_Combining_Fermata=850]="U_Combining_Fermata",e[e.U_Combining_X_Below=851]="U_Combining_X_Below",e[e.U_Combining_Left_Arrowhead_Below=852]="U_Combining_Left_Arrowhead_Below",e[e.U_Combining_Right_Arrowhead_Below=853]="U_Combining_Right_Arrowhead_Below",e[e.U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below=854]="U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below",e[e.U_Combining_Right_Half_Ring_Above=855]="U_Combining_Right_Half_Ring_Above",e[e.U_Combining_Dot_Above_Right=856]="U_Combining_Dot_Above_Right",e[e.U_Combining_Asterisk_Below=857]="U_Combining_Asterisk_Below",e[e.U_Combining_Double_Ring_Below=858]="U_Combining_Double_Ring_Below",e[e.U_Combining_Zigzag_Above=859]="U_Combining_Zigzag_Above",e[e.U_Combining_Double_Breve_Below=860]="U_Combining_Double_Breve_Below",e[e.U_Combining_Double_Breve=861]="U_Combining_Double_Breve",e[e.U_Combining_Double_Macron=862]="U_Combining_Double_Macron",e[e.U_Combining_Double_Macron_Below=863]="U_Combining_Double_Macron_Below",e[e.U_Combining_Double_Tilde=864]="U_Combining_Double_Tilde",e[e.U_Combining_Double_Inverted_Breve=865]="U_Combining_Double_Inverted_Breve",e[e.U_Combining_Double_Rightwards_Arrow_Below=866]="U_Combining_Double_Rightwards_Arrow_Below",e[e.U_Combining_Latin_Small_Letter_A=867]="U_Combining_Latin_Small_Letter_A",e[e.U_Combining_Latin_Small_Letter_E=868]="U_Combining_Latin_Small_Letter_E",e[e.U_Combining_Latin_Small_Letter_I=869]="U_Combining_Latin_Small_Letter_I",e[e.U_Combining_Latin_Small_Letter_O=870]="U_Combining_Latin_Small_Letter_O",e[e.U_Combining_Latin_Small_Letter_U=871]="U_Combining_Latin_Small_Letter_U",e[e.U_Combining_Latin_Small_Letter_C=872]="U_Combining_Latin_Small_Letter_C",e[e.U_Combining_Latin_Small_Letter_D=873]="U_Combining_Latin_Small_Letter_D",e[e.U_Combining_Latin_Small_Letter_H=874]="U_Combining_Latin_Small_Letter_H",e[e.U_Combining_Latin_Small_Letter_M=875]="U_Combining_Latin_Small_Letter_M",e[e.U_Combining_Latin_Small_Letter_R=876]="U_Combining_Latin_Small_Letter_R",e[e.U_Combining_Latin_Small_Letter_T=877]="U_Combining_Latin_Small_Letter_T",e[e.U_Combining_Latin_Small_Letter_V=878]="U_Combining_Latin_Small_Letter_V",e[e.U_Combining_Latin_Small_Letter_X=879]="U_Combining_Latin_Small_Letter_X",e[e.LINE_SEPARATOR=8232]="LINE_SEPARATOR",e[e.PARAGRAPH_SEPARATOR=8233]="PARAGRAPH_SEPARATOR",e[e.NEXT_LINE=133]="NEXT_LINE",e[e.U_CIRCUMFLEX=94]="U_CIRCUMFLEX",e[e.U_GRAVE_ACCENT=96]="U_GRAVE_ACCENT",e[e.U_DIAERESIS=168]="U_DIAERESIS",e[e.U_MACRON=175]="U_MACRON",e[e.U_ACUTE_ACCENT=180]="U_ACUTE_ACCENT",e[e.U_CEDILLA=184]="U_CEDILLA",e[e.U_MODIFIER_LETTER_LEFT_ARROWHEAD=706]="U_MODIFIER_LETTER_LEFT_ARROWHEAD",e[e.U_MODIFIER_LETTER_RIGHT_ARROWHEAD=707]="U_MODIFIER_LETTER_RIGHT_ARROWHEAD",e[e.U_MODIFIER_LETTER_UP_ARROWHEAD=708]="U_MODIFIER_LETTER_UP_ARROWHEAD",e[e.U_MODIFIER_LETTER_DOWN_ARROWHEAD=709]="U_MODIFIER_LETTER_DOWN_ARROWHEAD",e[e.U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING=722]="U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING",e[e.U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING=723]="U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING",e[e.U_MODIFIER_LETTER_UP_TACK=724]="U_MODIFIER_LETTER_UP_TACK",e[e.U_MODIFIER_LETTER_DOWN_TACK=725]="U_MODIFIER_LETTER_DOWN_TACK",e[e.U_MODIFIER_LETTER_PLUS_SIGN=726]="U_MODIFIER_LETTER_PLUS_SIGN",e[e.U_MODIFIER_LETTER_MINUS_SIGN=727]="U_MODIFIER_LETTER_MINUS_SIGN",e[e.U_BREVE=728]="U_BREVE",e[e.U_DOT_ABOVE=729]="U_DOT_ABOVE",e[e.U_RING_ABOVE=730]="U_RING_ABOVE",e[e.U_OGONEK=731]="U_OGONEK",e[e.U_SMALL_TILDE=732]="U_SMALL_TILDE",e[e.U_DOUBLE_ACUTE_ACCENT=733]="U_DOUBLE_ACUTE_ACCENT",e[e.U_MODIFIER_LETTER_RHOTIC_HOOK=734]="U_MODIFIER_LETTER_RHOTIC_HOOK",e[e.U_MODIFIER_LETTER_CROSS_ACCENT=735]="U_MODIFIER_LETTER_CROSS_ACCENT",e[e.U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR=741]="U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR",e[e.U_MODIFIER_LETTER_HIGH_TONE_BAR=742]="U_MODIFIER_LETTER_HIGH_TONE_BAR",e[e.U_MODIFIER_LETTER_MID_TONE_BAR=743]="U_MODIFIER_LETTER_MID_TONE_BAR",e[e.U_MODIFIER_LETTER_LOW_TONE_BAR=744]="U_MODIFIER_LETTER_LOW_TONE_BAR",e[e.U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR=745]="U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR",e[e.U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK=746]="U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK",e[e.U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK=747]="U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK",e[e.U_MODIFIER_LETTER_UNASPIRATED=749]="U_MODIFIER_LETTER_UNASPIRATED",e[e.U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD=751]="U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_UP_ARROWHEAD=752]="U_MODIFIER_LETTER_LOW_UP_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD=753]="U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD=754]="U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_RING=755]="U_MODIFIER_LETTER_LOW_RING",e[e.U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT=756]="U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT",e[e.U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT=757]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT",e[e.U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT=758]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT",e[e.U_MODIFIER_LETTER_LOW_TILDE=759]="U_MODIFIER_LETTER_LOW_TILDE",e[e.U_MODIFIER_LETTER_RAISED_COLON=760]="U_MODIFIER_LETTER_RAISED_COLON",e[e.U_MODIFIER_LETTER_BEGIN_HIGH_TONE=761]="U_MODIFIER_LETTER_BEGIN_HIGH_TONE",e[e.U_MODIFIER_LETTER_END_HIGH_TONE=762]="U_MODIFIER_LETTER_END_HIGH_TONE",e[e.U_MODIFIER_LETTER_BEGIN_LOW_TONE=763]="U_MODIFIER_LETTER_BEGIN_LOW_TONE",e[e.U_MODIFIER_LETTER_END_LOW_TONE=764]="U_MODIFIER_LETTER_END_LOW_TONE",e[e.U_MODIFIER_LETTER_SHELF=765]="U_MODIFIER_LETTER_SHELF",e[e.U_MODIFIER_LETTER_OPEN_SHELF=766]="U_MODIFIER_LETTER_OPEN_SHELF",e[e.U_MODIFIER_LETTER_LOW_LEFT_ARROW=767]="U_MODIFIER_LETTER_LOW_LEFT_ARROW",e[e.U_GREEK_LOWER_NUMERAL_SIGN=885]="U_GREEK_LOWER_NUMERAL_SIGN",e[e.U_GREEK_TONOS=900]="U_GREEK_TONOS",e[e.U_GREEK_DIALYTIKA_TONOS=901]="U_GREEK_DIALYTIKA_TONOS",e[e.U_GREEK_KORONIS=8125]="U_GREEK_KORONIS",e[e.U_GREEK_PSILI=8127]="U_GREEK_PSILI",e[e.U_GREEK_PERISPOMENI=8128]="U_GREEK_PERISPOMENI",e[e.U_GREEK_DIALYTIKA_AND_PERISPOMENI=8129]="U_GREEK_DIALYTIKA_AND_PERISPOMENI",e[e.U_GREEK_PSILI_AND_VARIA=8141]="U_GREEK_PSILI_AND_VARIA",e[e.U_GREEK_PSILI_AND_OXIA=8142]="U_GREEK_PSILI_AND_OXIA",e[e.U_GREEK_PSILI_AND_PERISPOMENI=8143]="U_GREEK_PSILI_AND_PERISPOMENI",e[e.U_GREEK_DASIA_AND_VARIA=8157]="U_GREEK_DASIA_AND_VARIA",e[e.U_GREEK_DASIA_AND_OXIA=8158]="U_GREEK_DASIA_AND_OXIA",e[e.U_GREEK_DASIA_AND_PERISPOMENI=8159]="U_GREEK_DASIA_AND_PERISPOMENI",e[e.U_GREEK_DIALYTIKA_AND_VARIA=8173]="U_GREEK_DIALYTIKA_AND_VARIA",e[e.U_GREEK_DIALYTIKA_AND_OXIA=8174]="U_GREEK_DIALYTIKA_AND_OXIA",e[e.U_GREEK_VARIA=8175]="U_GREEK_VARIA",e[e.U_GREEK_OXIA=8189]="U_GREEK_OXIA",e[e.U_GREEK_DASIA=8190]="U_GREEK_DASIA",e[e.U_IDEOGRAPHIC_FULL_STOP=12290]="U_IDEOGRAPHIC_FULL_STOP",e[e.U_LEFT_CORNER_BRACKET=12300]="U_LEFT_CORNER_BRACKET",e[e.U_RIGHT_CORNER_BRACKET=12301]="U_RIGHT_CORNER_BRACKET",e[e.U_LEFT_BLACK_LENTICULAR_BRACKET=12304]="U_LEFT_BLACK_LENTICULAR_BRACKET",e[e.U_RIGHT_BLACK_LENTICULAR_BRACKET=12305]="U_RIGHT_BLACK_LENTICULAR_BRACKET",e[e.U_OVERLINE=8254]="U_OVERLINE",e[e.UTF8_BOM=65279]="UTF8_BOM",e[e.U_FULLWIDTH_SEMICOLON=65307]="U_FULLWIDTH_SEMICOLON",e[e.U_FULLWIDTH_COMMA=65292]="U_FULLWIDTH_COMMA"}(fX||(fX={})),function(e){e[e.Unknown=0]="Unknown",e[e.Invalid=3]="Invalid",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(mX||(mX={}));class wX{constructor(e){this._hiddenRanges=[],this._hasLineChanged=!1,this.emitter=nX(),this._foldingModel=e,this._foldingModel.regions.length&&this.updateHiddenRanges()}updateHiddenRanges(){let e=!1;const t=[];let n=0,r=0,i=Number.MAX_VALUE,s=-1;const o=this._foldingModel.regions;for(;n<o.length;n++){if(!o.isCollapsed(n))continue;const a=o.getStartLineNumber(n)+1,l=o.getEndLineNumber(n);i<=a&&l<=s||(!e&&r<this._hiddenRanges.length&&this._hiddenRanges[r].startLineNumber===a&&this._hiddenRanges[r].endLineNumber===l?(t.push(this._hiddenRanges[r]),r++):(e=!0,t.push({startLineNumber:a,startColumn:1,endLineNumber:l,endColumn:1})),i=a,s=l)}(this._hasLineChanged||e||r<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hasLineChanged=!1,this._hiddenRanges=e,this.emitter.emit("forceRender",void 0)}get hiddenRanges(){return this._hiddenRanges}isHiddenLine(e){return null!==this.findRange(e,this._hiddenRanges)}findRange(e,t){const n=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;for(;n<r;){const i=Math.floor((n+r)/2);t(e[i])?r=i:n=i+1}return n}(t,(t=>e<t.startLineNumber))-1;return n>=0&&t[n].endLineNumber>=e?t[n]:null}getHiddenLineCount(){let e=0;for(const t of this._hiddenRanges)e+=t.endLineNumber-t.startLineNumber+1;return e}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanged&&(Array.isArray(e)?this._hasLineChanged=e.some((e=>e.range.endLineNumber!==e.range.startLineNumber||0!==bX(e.newText)[0]||0!==bX(e.oldText)[0])):this._hasLineChanged=e.range.endLineNumber!==e.range.startLineNumber||0!==bX(e.newText)[0]||0!==bX(e.oldText)[0])}}class xX{get regions(){return this._regions}constructor(e){this._regions=null,this._jsonWorkerManager=aX(),this.emitter=nX(),this._jsonModel=e,this.updateFoldingRanges(),this.emitter.on("contentChanged",(e=>{this._hiddenRangeModel.notifyChangeModelContent(e)})),this.emitter.on("problemsChanged",(e=>{this._jsonWorkerManager.foldRange().then((e=>{const t=uX.fromFoldRanges(e);this.update(t),this._hiddenRangeModel.updateHiddenRanges()}))}))}updateFoldingRanges(){this._jsonWorkerManager.foldRange().then((e=>{this._regions=uX.fromFoldRanges(e),this._hiddenRangeModel=new wX(this)}))}update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=this._currentFoldedOrManualRanges(t,e),r=uX.sanitizeAndMerge(e,n,this._jsonModel.getLineCount());this._regions=uX.fromFoldRanges(r)}_currentFoldedOrManualRanges(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;const n=(n,r)=>{if(t){const e=t.findRange(n);if(-1===e)return!0;const i=t.toRegion(e);if(!i||i.endLineNumber!==r)return!0}for(const t of e)if(n<t&&t<=r)return!0;return!1},r=[];for(let e=0;e<this._regions.length;e++)if(this._regions.isCollapsed(e)){const t=this._regions.getStartLineNumber(e),i=this._regions.getEndLineNumber(e);n(t,i)||r.push({startLineNumber:t,endLineNumber:i,isCollapsed:!0,source:lX.provider,type:this._regions.getType(e)})}return r}toggleCollapseState(e){if(e.length){e=e.sort(((e,t)=>e.regionIndex-t.regionIndex));for(const t of e){const e=t.regionIndex,n=!this._regions.isCollapsed(e);this._regions.setCollapsed(e,n)}this._hiddenRangeModel.updateHiddenRanges()}}toggleFoldingRange(e){!function(e,t,n){const r=[];for(const i of n){const n=e.getRegionAtLine(i);if(n){const i=!n.isCollapsed;if(r.push(n),t>1){const s=e.getRegionsInside(n,((e,n)=>e.isCollapsed!==i&&n<t));r.push(...s)}}}e.toggleCollapseState(r)}(this,1,[e])}isCollapsed(e){if(!this._regions)return!1;const t=this._regions.findRange(e),n=this._regions.toRegion(t);return n&&n.isCollapsed}isLineCollapsed(e){return!!this._regions&&this._hiddenRangeModel.isHiddenLine(e)}isFoldable(e){if(!this._regions)return!1;const t=this._regions.findRange(e),n=this._regions.toRegion(t);return n&&n.startLineNumber===e}getVisibleLineCount(){return this._regions&&this._hiddenRangeModel?this._jsonModel.getLineCount()-this._hiddenRangeModel.getHiddenLineCount():this._jsonModel.getLineCount()}getActualLineNumber(e){if(!this._regions||!this._hiddenRangeModel)return e;let t=e;const n=this._hiddenRangeModel.hiddenRanges;for(const e of n){if(!(e.startLineNumber<=t))break;t+=e.endLineNumber-e.startLineNumber+1}return t}getNextVisibleLine(e){if(!this._regions||!this._hiddenRangeModel)return e+1;let t=e+1;const n=this._hiddenRangeModel.hiddenRanges,r=this._hiddenRangeModel.findRange(t,n);return r?r.endLineNumber+1:t}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const n=[],r=e?e.regionIndex+1:0,i=e?e.endLineNumber:Number.MAX_VALUE;if(t&&2===t.length){const e=[];for(let s=r,o=this._regions.length;s<o;s++){const r=this._regions.toRegion(s);if(!(this._regions.getStartLineNumber(s)<i))break;for(;e.length>0&&!r.containedBy(e[e.length-1]);)e.pop();e.push(r),t(r,e.length)&&n.push(r)}}else for(let e=r,s=this._regions.length;e<s;e++){const r=this._regions.toRegion(e);if(!(this._regions.getStartLineNumber(e)<i))break;t&&!t(r)||n.push(r)}return n}}class EX{constructor(e,t){this.searchResults=null,this._currentResultIndex=-1,this.matchCase=!1,this.wordSeparators=null,this.isRegex=!1,this._view=e,this._jsonModel=t}search(e,t,n,r){this._currentResultIndex=-1;const i=r,s=t,o=n?"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?":this.wordSeparators,a=1/0;this.searchResults=this._jsonModel.findMatches(e,null,i,s,o,!1,a),this._view.layout()}replace(e){if(!e||!this.searchResults)return;this._currentResultIndex<0&&(this._currentResultIndex=0);const t=this.searchResults[this._currentResultIndex],n=this._jsonModel.getOffsetAt(t.range.startLineNumber,t.range.startColumn),r=this._jsonModel.getOffsetAt(t.range.endLineNumber,t.range.endColumn),i={range:t.range,newText:e,oldText:this._jsonModel.getValueInRange(t.range),type:"replace",rangeOffset:n,rangeLength:r-n};this.searchResults.splice(this._currentResultIndex,1),this._jsonModel.applyOperation(i)}replaceAll(e){if(!e||!this.searchResults)return;const t=[];for(let n=this.searchResults.length-1;n>=0;n--){const r=this.searchResults[n],i=this._jsonModel.getOffsetAt(r.range.startLineNumber,r.range.startColumn),s=this._jsonModel.getOffsetAt(r.range.endLineNumber,r.range.endColumn);t.push({range:r.range,newText:e,oldText:this._jsonModel.getValueInRange(r.range),type:"replace",rangeOffset:i,rangeLength:s-i})}this.searchResults=null,this._jsonModel.applyOperation(t)}navigateResults(e){if(!this.searchResults||0===this.searchResults.length)return;this._currentResultIndex+=e,this._currentResultIndex<0?this._currentResultIndex=this.searchResults.length-1:this._currentResultIndex>=this.searchResults.length&&(this._currentResultIndex=0);const t=this.searchResults[this._currentResultIndex];t&&(t.range.startLineNumber>this._view.startLineNumber+this._view.visibleLineCount||t.range.startLineNumber<this._view.startLineNumber?this._view.scrollToLine(t.range.startLineNumber):this._view.layout())}binarySearchByLine(e){const t=[];if(!this.searchResults)return null;let n=0,r=this.searchResults.length-1;for(;n<=r;){const i=Math.floor((n+r)/2),s=this.searchResults[i].range.startLineNumber;if(s===e){let n=i;for(;n>=0&&this.searchResults[n].range.startLineNumber===e;)t.unshift(this.searchResults[n]),n--;for(n=i+1;n<this.searchResults.length&&this.searchResults[n].range.startLineNumber===e;)t.push(this.searchResults[n]),n++;return t}s<e?n=i+1:r=i-1}return t}}function CX(e,t){const n=e.getLineContent(t.startLineNumber),r=n.substring(0,t.startColumn-1),i=n.substring(t.startColumn-1),s=(t.startLineNumber>1&&e.getLineContent(t.startLineNumber-1),function(e,t){const n=[{open:"{",openRegExp:/\{\s*$/,close:"}",closeRegExp:/^\s*\}/},{open:"[",openRegExp:/\[\s*$/,close:"]",closeRegExp:/^\s*\]/}];if(e.length>0&&t.length>0)for(let r=0,i=n.length;r<i;r++){const i=n[r];if(i.openRegExp.test(e)&&i.closeRegExp.test(t))return{indentAction:gX.IndentOutdent}}if(e.length>0)for(let t=0,r=n.length;t<r;t++){if(n[t].openRegExp.test(e))return{indentAction:gX.Indent}}return null}(r,i));if(!s)return null;const o=s.indentAction;let a=s.appendText;const l=s.removeText||0;a?o===gX.Indent&&(a="\t"+a):a=o===gX.Indent||o===gX.IndentOutdent?"\t":"";let c=function(e,t,n){let r=vX(e.getLineContent(t));return r.length>n-1&&(r=r.substring(0,n-1)),r}(e,t.startLineNumber,t.startColumn);return l&&(c=c.substring(0,c.length-l)),{indentAction:o,appendText:a,removeText:l,indentation:c}}!function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(gX||(gX={}));class SX{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:aX();this._jsonWorkerManager=r,this._isComposition=!1,this._autoClosingPairs={"{":"}","[":"]","(":")",'"':'"'},this.emitter=nX(),this._view=e,this._jsonModel=t,this._selectionModel=n,this.attachEventListeners()}attachEventListeners(){this._jsonWorkerManager.validate().then((e=>{this.emitter.emit("problemsChanged",{problems:e.problems,root:e.root})})),this._view.contentDom.addEventListener("beforeinput",(e=>{this._handleBeforeInput(e)})),this._view.contentDom.addEventListener("compositionstart",(e=>{this._handleCompositionStart(e)})),this._view.contentDom.addEventListener("compositionend",(e=>{this._handleCompositionEnd(e)})),this._view.contentDom.addEventListener("keydown",(e=>{this._handleKeyDown(e)})),this._view.contentDom.addEventListener("mousedown",(e=>{0===e.button&&(this._selectionModel.isSelecting=!0,this._selectionModel.updateFromSelectingStart())})),this._view.contentDom.addEventListener("mousemove",(e=>{this._selectionModel.isSelecting&&e.button})),this._view.contentDom.addEventListener("mouseup",(e=>{0===e.button&&this._selectionModel.updateFromSelectingEnd()}))}buildBaseOperation(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"insert",t=this._selectionModel.startRow,n=this._selectionModel.startCol,r=this._selectionModel.endRow,i=this._selectionModel.endCol;const s=this._jsonModel.getLineCount();t>s&&(t=s,n=this._jsonModel.getLineLength(s)+1),r>s&&(r=s,i=this._jsonModel.getLineLength(s)+1),t=Math.max(1,t),n=Math.max(1,n),r=Math.max(1,r),i=Math.max(1,i);const o=this._jsonModel.getOffsetAt(t,n),a={type:e,range:{startLineNumber:t,startColumn:n,endLineNumber:r,endColumn:i},rangeOffset:o,rangeLength:this._jsonModel.getOffsetAt(r,i)-o,oldText:this._jsonModel.getValueInRange({startLineNumber:t,startColumn:n,endLineNumber:r,endColumn:i}),newText:""};return this._selectionModel.isSelectedAll&&(a.range={startLineNumber:1,startColumn:1,endLineNumber:this._jsonModel.getLineCount(),endColumn:this._jsonModel.getLineLength(this._jsonModel.getLineCount())+1},a.rangeOffset=0,a.rangeLength=this._jsonModel.getValue().length,a.oldText=this._jsonModel.getValue()),a}_handleCompositionStart(e){e.preventDefault(),this._isComposition=!0,this._selectionModel.savePreviousSelection()}_handleCompositionEnd(e){e.preventDefault(),this._isComposition=!1,this._selectionModel.restorePreviousSelection();const t=this.buildBaseOperation("replace");t.newText=e.data||"",this._selectionModel.isSelectedAll=!1,this._jsonModel.applyOperation(t)}_handleBeforeInput(e){var t;if(this._isComposition)return;e.preventDefault(),this._selectionModel.isSelecting||this._selectionModel.updateFromSelection();const n=this.buildBaseOperation(),{startLineNumber:r,startColumn:i,endLineNumber:s,endColumn:o}=n.range;switch(e.inputType){case"insertText":this._selectionModel.isCollapsed?n.type="insert":n.type="replace",n.newText=e.data||"",this._autoClosingPairs[n.newText]&&(n.newText+=this._autoClosingPairs[n.newText],n.keepPosition={lineNumber:r,column:i+1});break;case"insertParagraph":n.newText="\n",n.keepPosition={lineNumber:r+1,column:1};const a=CX(this._jsonModel,{startLineNumber:r,startColumn:i,endLineNumber:s,endColumn:o});if(a)if(a.indentAction===gX.Indent)n.newText="\n"+this.normalizeIndentation(a.appendText+a.indentation)||0,n.keepPosition={lineNumber:r+1,column:n.newText.length};else{const e=this.normalizeIndentation(a.indentation),t=this.normalizeIndentation(a.indentation+a.appendText);n.newText="\n"+t+"\n"+e,n.keepPosition={lineNumber:r+1,column:t.length+1}}else{const e=vX(this._jsonModel.getLineContent(r)).substring(0,i-1);n.newText="\n"+this.normalizeIndentation(e)||0,n.keepPosition={lineNumber:r+1,column:n.newText.length}}break;case"deleteContentBackward":if(this._jsonModel.isStartPosition()&&this._selectionModel.isCollapsed)return;this._selectionModel.isCollapsed&&(n.rangeOffset-=1,n.oldText=this._jsonModel.getValueInRange({startLineNumber:r,startColumn:i-1,endLineNumber:s,endColumn:o})),n.type="delete",n.rangeLength=n.oldText.length;break;case"insertFromPaste":const l=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData("text/plain");n.type="replace",n.newText=l||""}this._selectionModel.isSelectedAll=!1,this._selectionModel.isSelecting=!1,this._jsonModel.applyOperation(n)}format(){var e;this._jsonWorkerManager.formatJson((null===(e=this._view.options)||void 0===e?void 0:e.formatOptions)||{tabSize:2,insertSpaces:!0}).then((e=>{const t=function(e,t){let n=t.slice(0).sort(((e,t)=>{const n=e.offset-t.offset;return 0===n?e.length-t.length:n})),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(!(i.offset+i.length<=r))throw new Error("Overlapping edit");e=Oq(e,i),r=i.offset}return e}(this._jsonModel.getValue(),e),n={type:"replace",range:{startLineNumber:1,startColumn:1,endLineNumber:this._jsonModel.getLineCount(),endColumn:this._jsonModel.getLineLength(this._jsonModel.getLineCount())+1},rangeOffset:0,rangeLength:this._jsonModel.getValue().length,oldText:this._jsonModel.getValue(),newText:t};this._jsonModel.applyOperation(n)}))}normalizeIndentation(e){var t,n,r,i;const s=(null===(n=null===(t=this._view.options)||void 0===t?void 0:t.formatOptions)||void 0===n?void 0:n.tabSize)||4,o=!!(null===(i=null===(r=this._view.options)||void 0===r?void 0:r.formatOptions)||void 0===i?void 0:i.insertSpaces);let a=function(e){for(let t=0,n=e.length;t<n;t++){const n=e.charCodeAt(t);if(n!==fX.Space&&n!==fX.Tab)return t}return-1}(e);return-1===a&&(a=e.length),this._normalizeIndentationFromWhitespace(e.substring(0,a),s,o)+e.substring(a)}_normalizeIndentationFromWhitespace(e,t,n){let r=0;for(let n=0;n<e.length;n++)"\t"===e.charAt(n)?r=this.nextIndentTabStop(r,t):r++;let i="";if(!n){const e=Math.floor(r/t);r%=t;for(let t=0;t<e;t++)i+="\t"}for(let e=0;e<r;e++)i+=" ";return i}nextIndentTabStop(e,t){return e+t-e%t}_handleKeyDown(e){var t,n,r,i;this._selectionModel.isSelecting||this._selectionModel.updateFromSelection();const s=this._selectionModel.startRow,o=this._selectionModel.startCol,a=this._selectionModel.endRow,l=this._selectionModel.endCol,c=(this._jsonModel.getOffsetAt(s,o),this._jsonModel.getOffsetAt(a,l),this.buildBaseOperation()),d=e.ctrlKey||e.metaKey;switch(e.code){case"Tab":if(this._view.completeWidget.isVisible)return e.preventDefault(),void this._view.completeWidget._handleKeyDown(e);e.preventDefault();let s="";if(null===(n=null===(t=this._view.options)||void 0===t?void 0:t.formatOptions)||void 0===n?void 0:n.insertSpaces){const e=(null===(i=null===(r=this._view.options)||void 0===r?void 0:r.formatOptions)||void 0===i?void 0:i.tabSize)||4;for(let t=0;t<e;t++)s+=" "}else s="\t";c.newText=s,this._jsonModel.applyOperation(c);break;case"KeyF":e.shiftKey&&d&&(e.preventDefault(),this.format());break;case"ArrowRight":case"ArrowLeft":this._view.completeWidget.isVisible&&this._view.completeWidget.hide();break;case"ArrowDown":case"ArrowUp":case"Enter":this._view.completeWidget.isVisible&&(e.preventDefault(),this._view.completeWidget._handleKeyDown(e));break;case"KeyA":d&&(this._selectionModel.isSelectedAll=!0);break;case"KeyX":d&&(e.preventDefault(),this._cutHandler());break;case"KeyZ":d&&!e.shiftKey?(e.preventDefault(),this._jsonModel.undo()):d&&e.shiftKey&&(e.preventDefault(),this._jsonModel.redo());break;case"KeyC":d&&(e.preventDefault(),this._copyHandler())}}_cutHandler(){const e=this.buildBaseOperation("replace");if(this._selectionModel.isCollapsed){const{startLineNumber:t,endLineNumber:n}=e.range;e.rangeOffset=this._jsonModel.getOffsetAt(t,1),e.oldText=this._jsonModel.getValueInRange({startLineNumber:t,startColumn:1,endLineNumber:n,endColumn:this._jsonModel.getLineLength(n)+1}),e.range={startLineNumber:t,startColumn:1,endLineNumber:n,endColumn:this._jsonModel.getLineLength(n)+1}}navigator.clipboard.writeText(e.oldText),this._jsonModel.applyOperation(e)}_copyHandler(){const e=this.buildBaseOperation("replace");navigator.clipboard.writeText(e.oldText)}}class _X{constructor(e,t){this._isMouseOver=!1,this._view=e,this._foldingModel=t,this._attachEventListeners()}_attachEventListeners(){this._view.lineScrollDom.addEventListener("mouseover",(e=>{this._handleLineNumberHover(e)})),this._view.lineScrollDom.addEventListener("mouseleave",(()=>{this._handleLineNumberContainerLeave()}))}_handleLineNumberHover(e){this._showFoldingIcon(),this._isMouseOver=!0}_handleLineNumberContainerLeave(){this.removeAllFoldingIcons(),this._isMouseOver=!1}_showFoldingIcon(){if(this._isMouseOver)return;const e=this._view.lineScrollDom.children;for(let t=0;t<e.length;t++){const n=e[t];this._foldingModel.isFoldable(Number(n.dataset.lineNumber))&&n.appendChild(this._createFoldingIcon(Number(n.dataset.lineNumber)))}}_createFoldSvg(e){const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("width","1em"),t.setAttribute("height","1em"),e&&t.setAttribute("transform","rotate(270)");const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d","M21.8329 6.59139L12.8063 18.9004C12.4068 19.4452 11.5931 19.4452 11.1935 18.9004L2.16693 6.59139C1.68255 5.93086 2.15424 5.00003 2.97334 5.00003L21.0265 5.00003C21.8456 5.00003 22.3173 5.93087 21.8329 6.59139Z"),n.setAttribute("fill","var(--semi-color-tertiary)"),t.appendChild(n),t}_createFoldingIcon(e){const t=vq("span",`${this._view.prefixCls}-folding-icon`),n=this._foldingModel.isCollapsed(e);return t.appendChild(this._createFoldSvg(n)),bq(t,{position:"absolute",right:"0",top:"0",width:"40%",height:"100%",cursor:"pointer",zIndex:"1",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center"}),t.addEventListener("mousedown",(t=>{t.preventDefault(),t.stopPropagation(),this._foldingModel.toggleFoldingRange(e),this._view.scalingCellSizeAndPositionManager.resetCell(0),this._view.layout(),this._isMouseOver=!1})),t}removeAllFoldingIcons(){const e=`${this._view.prefixCls}-folding-icon`;this._view.lineScrollDom.querySelectorAll(`.${e}`).forEach((e=>e.remove()))}}class kX{static addRange(e,t){let n=0;for(;n<t.length&&t[n].endExclusive<e.start;)n++;let r=n;for(;r<t.length&&t[r].start<=e.endExclusive;)r++;if(n===r)t.splice(n,0,e);else{const i=Math.min(e.start,t[n].start),s=Math.max(e.endExclusive,t[r-1].endExclusive);t.splice(n,r-n,new kX(i,s))}}static tryCreate(e,t){if(!(e>t))return new kX(e,t)}static ofLength(e){return new kX(0,e)}static ofStartAndLength(e,t){return new kX(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Error(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new kX(this.start+e,this.endExclusive+e)}deltaStart(e){return new kX(this.start+e,this.endExclusive)}deltaEnd(e){return new kX(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new kX(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const t=Math.max(this.start,e.start),n=Math.min(this.endExclusive,e.endExclusive);if(t<=n)return new kX(t,n)}intersects(e){return Math.max(this.start,e.start)<Math.min(this.endExclusive,e.endExclusive)}intersectsOrTouches(e){return Math.max(this.start,e.start)<=Math.min(this.endExclusive,e.endExclusive)}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Error(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Error(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){const t=[];for(let n=this.start;n<this.endExclusive;n++)t.push(e(n));return t}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}}const OX="function"==typeof globalThis.postMessage&&!globalThis.importScripts,TX=(()=>{if(OX){const e=[];globalThis.addEventListener("message",(t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){const r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork)return e.splice(n,1),void r.callback()}}));let t=0;return n=>{const r=++t;e.push({id:r,callback:n}),globalThis.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();let PX,IX;!function(){const e=globalThis;IX="function"!=typeof e.requestIdleCallback||"function"!=typeof e.cancelIdleCallback?(e,t,n)=>{TX((()=>{if(r)return;const e=Date.now()+15,n={didTimeout:!0,timeRemaining:()=>Math.max(0,e-Date.now())};t(Object.freeze(n))}));let r=!1;return{dispose(){r||(r=!0)}}}:(e,t,n)=>{const r=e.requestIdleCallback(t,"number"==typeof n?{timeout:n}:void 0);let i=!1;return{dispose(){i||(i=!0,e.cancelIdleCallback(r))}}},PX=(e,t)=>IX(globalThis,e,t)}();const MX=globalThis.performance&&"function"==typeof globalThis.performance.now;class RX{static create(e){return new RX(e)}constructor(e){var t;this._now=MX&&!1===e?Date.now:null===(t=globalThis.performance)||void 0===t?void 0:t.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}}class AX{constructor(e,t){this.tokenizationSupport=t,this.initialState=t.getInitialState(),this.store=new DX(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class NX extends AX{constructor(e,t,n){super(e,t),this._jsonModel=n}updateTokensUntilLine(e,t){for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>e)break;const r=this._jsonModel.getLineContent(n.lineNumber),i=this.tokenizationSupport.tokenize(r,n.startState);t.setTokens(n.lineNumber,i.tokens),this.store.setEndState(n.lineNumber,i.endState)}}}class DX{constructor(e){this.lineCount=e,this._tokenizationStateStore=new LX,this._invalidatedLines=new FX,this._invalidatedLines.addRange(new kX(1,e+1))}getEndState(e){return this._tokenizationStateStore.getEndState(e)}setEndState(e,t){this._invalidatedLines.delete(e);const n=this._tokenizationStateStore.setEndState(e,t);return n&&e<this.lineCount&&this._invalidatedLines.addRange(new kX(e+1,e+2)),n}getStartState(e,t){return 1===e?t:this.getEndState(e-1)}getFirstInvalidEndStateLineNumber(){return this._invalidatedLines.min}getFirstInvalidLine(e){const t=this.getFirstInvalidEndStateLineNumber();if(null===t)return null;if(!this.getStartState(t,e))throw new Error("Start state must be defined");return{lineNumber:t,startState:this.getStartState(t,e)}}allStatesValid(){return null===this._invalidatedLines.min}invalidateRange(e){let{from:t,to:n}=e;this._invalidatedLines.addRange(new kX(t,n))}}class LX{constructor(){this._lineEndState=new Array}getEndState(e){return this._lineEndState[e]}setEndState(e,t){const n=this._lineEndState[e];return(!n||!n.equals(t))&&(this._lineEndState[e]=t,!0)}}class FX{constructor(){this._ranges=[]}getRange(){return this._ranges}addRange(e){kX.addRange(e,this._ranges)}get min(){var e,t;return null!==(t=null===(e=this._ranges[0])||void 0===e?void 0:e.start)&&void 0!==t?t:null}addRangeAndResize(e,t){let n=0;for(;!(n>=this._ranges.length||e.start<=this._ranges[n].endExclusive);)n++;let r=n;for(;!(r>=this._ranges.length||e.endExclusive<this._ranges[r].start);)r++;const i=t-e.length;for(let e=r;e<this._ranges.length;e++)this._ranges[e]=this._ranges[e].delta(i);if(n===r){const r=new kX(e.start,e.start+t);r.isEmpty||this._ranges.splice(n,0,r)}else{const t=Math.min(e.start,this._ranges[n].start),s=Math.max(e.endExclusive,this._ranges[r-1].endExclusive),o=new kX(t,s+i);o.isEmpty?this._ranges.splice(n,r-n):this._ranges.splice(n,r-n,o)}}delete(e){const t=this._ranges.findIndex((t=>t.contains(e)));if(-1!==t){const n=this._ranges[t];n.start===e?n.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new kX(e+1,n.endExclusive):n.endExclusive===e+1?this._ranges[t]=new kX(n.start,e):this._ranges.splice(t,1,new kX(n.start,e),new kX(e+1,n.endExclusive))}}}class jX{constructor(e,t){this._jsonTokenizerWithStateStoreAndModel=e,this._backgroundTokenizationStore=t}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){PX((e=>{this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),n=()=>{this._hasLinesToTokenize()&&(this._backgroundTokenize(),Date.now()<t?setTimeout(n):this._beginBackgroundTokenization())};n()}_backgroundTokenize(){const e=this._jsonTokenizerWithStateStoreAndModel._jsonModel.getLineCount(),t=RX.create(!0);do{if(t.elapsed()>1)break;if(this._tokenizeOneInvalidLine()>e)break}while(this._hasLinesToTokenize())}_hasLinesToTokenize(){return!!this._jsonTokenizerWithStateStoreAndModel&&!this._jsonTokenizerWithStateStoreAndModel.store.allStatesValid()}_tokenizeOneInvalidLine(){const e=this._jsonTokenizerWithStateStoreAndModel.getFirstInvalidLine();return e?(this._jsonTokenizerWithStateStoreAndModel.updateTokensUntilLine(e.lineNumber,this._backgroundTokenizationStore),e.lineNumber):this._jsonTokenizerWithStateStoreAndModel._jsonModel.getLineCount()+1}requestTokens(e){let{from:t,to:n}=e;this._jsonTokenizerWithStateStoreAndModel.store.invalidateRange({from:1===t?1:t-1,to:n+1})}}class $X{constructor(e){this._jsonModel=null,this.emitter=nX(),this._jsonModel=e,this.tokens=new BX(this._jsonModel)}getLineTokens(e){return this.tokens.getLineTokens(e)}handleDidChangeContent(e){this.tokens.handleDidChangeContent(e)}forceTokenize(e){this.tokens.forceTokenize(e)}requestTokens(e){var t;null===(t=this.tokens.backgroundTokenizer)||void 0===t||t.requestTokens(e)}}class BX{constructor(e){this._tokens=new Map,this._tokenizer=null,this._backgroundTokenizer=null,this.emitter=nX(),this._jsonModel=e,this.emitter.on("contentChanged",(e=>{var t,n;let r=0,i=this._jsonModel.getLineCount();r=Array.isArray(e)?e[e.length-1].range.startLineNumber:e.range.startLineNumber,null===(t=this._backgroundTokenizer)||void 0===t||t.requestTokens({from:r,to:i}),null===(n=this._backgroundTokenizer)||void 0===n||n.handleChanges()})),this.resetTokenization()}get backgroundTokenizer(){return this._backgroundTokenizer}resetTokenization(){this._tokens.clear();const e=Dq(!0),t=e.getInitialState();e&&t&&(this._tokenizer=new NX(this._jsonModel.getLineCount(),e,this._jsonModel));const n={setTokens:(e,t)=>{this._tokens.set(e,t)}};this._tokenizer&&(this._backgroundTokenizer=new jX(this._tokenizer,n),this._backgroundTokenizer.handleChanges())}getLineTokens(e){return this._tokens.get(e)||[]}handleDidChangeContent(e){var t;null===(t=this._backgroundTokenizer)||void 0===t||t.handleChanges()}forceTokenize(e){var t;const n={setTokens:(e,t)=>{this._tokens.set(e,t)}};null===(t=this._tokenizer)||void 0===t||t.updateTokensUntilLine(e,n)}}class VX{constructor(e){this._lastMeasuredIndex=-1,this._cellSizeAndPositionData={},this._lastBatchedIndex=-1,this._cellCount=e.cellCount,this._cellSizeGetter=e.cellSizeGetter,this._estimatedCellSize=e.estimatedCellSize}areOffsetsAdjusted(){return!1}configure(e){this._cellCount=e.cellCount,this._cellSizeGetter=e.cellSizeGetter,this._estimatedCellSize=e.estimatedCellSize}getCellCount(){return this._cellCount}getEstimatedCellSize(){return this._estimatedCellSize}getLastMeasuredIndex(){return this._lastMeasuredIndex}getOffsetAdjustment(){return 0}getSizeAndPositionOfCell(e){if(e<0||e>=this._cellCount)throw new Error("index out of bounds");if(e>this._lastMeasuredIndex){const t=this.getSizeAndPositionOfLastMeasuredCell();let n=t.offset+t.size;for(let t=this._lastMeasuredIndex+1;t<=e;t++){const r=this._cellSizeGetter({index:t});if(void 0===r||isNaN(r))throw new Error("invalid size");null===r?(this._cellSizeAndPositionData[t]={offset:n,size:0},this._lastBatchedIndex=e):(this._cellSizeAndPositionData[t]={offset:n,size:r},n+=r,this._lastMeasuredIndex=e)}}return this._cellSizeAndPositionData[e]}getSizeAndPositionOfLastMeasuredCell(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}}getTotalSize(){const e=this.getSizeAndPositionOfLastMeasuredCell();return e.offset+e.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize}getUpdatedOffsetForIndex(e){let{align:t,containerSize:n,currentOffset:r,targetIndex:i}=e;if(r<0)return 0;const s=this.getSizeAndPositionOfCell(i),o=s.offset,a=o-n+s.size;let l=r;switch(t){case"start":l=o;break;case"end":l=a;break;case"center":l=o-(n-s.size)/2;break;default:l=Math.max(a,Math.min(o,r))}const c=this.getTotalSize();return Math.max(0,Math.min(l,c-n))}getVisibleCellRange(e){const t=e.containerSize;let n=e.offset;if(0===this.getTotalSize())return{};const r=n+t,i=this._findNearestCell(n),s=this.getSizeAndPositionOfCell(i);n=s.offset+s.size;let o=i;for(;n<r&&o<this._cellCount-1;)o++,n+=this.getSizeAndPositionOfCell(o).size;return{start:i,stop:o}}_binarySearch(e,t,n){for(;t<=e;){const r=t+Math.floor((e-t)/2),i=this.getSizeAndPositionOfCell(r).offset;if(i===n)return r;i<n?t=r+1:i>n&&(e=r-1)}return t>0?t-1:0}resetCell(e){this._lastMeasuredIndex=Math.min(this._lastMeasuredIndex,e-1)}_exponentialSearch(e,t){let n=1;for(;e<this._cellCount&&this.getSizeAndPositionOfCell(e).offset<t;)e+=n,n*=2;return this._binarySearch(Math.min(e,this._cellCount-1),Math.floor(e/2),t)}_findNearestCell(e){if(isNaN(e))throw new Error("offset is NaN");e=Math.max(0,e);const t=this.getSizeAndPositionOfLastMeasuredCell(),n=Math.max(0,this._lastMeasuredIndex);return t.offset>=e?this._binarySearch(n,0,e):this._exponentialSearch(n,e)}}const zX=()=>"undefined"!=typeof window&&window.chrome?16777100:15e5;class HX{constructor(e){let{maxScrollSize:t=zX(),cellCount:n,cellSizeGetter:r,estimatedCellSize:i}=e;this._maxScrollSize=t,this._cellSizeAndPositionManager=new VX({cellCount:n,cellSizeGetter:r,estimatedCellSize:i})}areOffsetsAdjusted(){return this._cellSizeAndPositionManager.getTotalSize()>this._maxScrollSize}configure(e){this._cellSizeAndPositionManager.configure(e)}getCellCount(){return this._cellSizeAndPositionManager.getCellCount()}getEstimatedCellSize(){return this._cellSizeAndPositionManager.getEstimatedCellSize()}getLastMeasuredIndex(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()}getOffsetAdjustment(e){let{containerSize:t,offset:n}=e;const r=this._cellSizeAndPositionManager.getTotalSize(),i=this.getTotalSize(),s=this._getOffsetPercentage({containerSize:t,offset:n,totalSize:i});return Math.round(s*(i-r))}getTotalSize(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())}getSizeAndPositionOfCell(e){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(e)}getSizeAndPositionOfLastMeasuredCell(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()}getVisibleCellRange(e){let{containerSize:t,offset:n}=e;return n=this._safeOffsetToOffset({containerSize:t,offset:n}),this._cellSizeAndPositionManager.getVisibleCellRange({containerSize:t,offset:n})}resetCell(e){this._cellSizeAndPositionManager.resetCell(e)}getUpdatedOffsetForIndex(e){let{align:t="auto",containerSize:n,currentOffset:r,targetIndex:i}=e;r=this._safeOffsetToOffset({containerSize:n,offset:r});const s=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({align:t,containerSize:n,currentOffset:r,targetIndex:i});return this._offsetToSafeOffset({containerSize:n,offset:s})}_getOffsetPercentage(e){let{containerSize:t,offset:n,totalSize:r}=e;return r<=t?0:n/(r-t)}_offsetToSafeOffset(e){let{containerSize:t,offset:n}=e;const r=this._cellSizeAndPositionManager.getTotalSize(),i=this.getTotalSize();if(r===i)return n;{const e=this._getOffsetPercentage({containerSize:t,offset:n,totalSize:r});return Math.round(e*(i-t))}}_safeOffsetToOffset(e){let{containerSize:t,offset:n}=e;const r=this._cellSizeAndPositionManager.getTotalSize(),i=this.getTotalSize();if(r===i)return n;{const e=this._getOffsetPercentage({containerSize:t,offset:n,totalSize:i});return Math.round(e*(r-t))}}}var UX,KX,WX,GX,qX,XX,YX;!function(e){e[e.Undefined=0]="Undefined",e[e.EnumValueMismatch=1]="EnumValueMismatch",e[e.Deprecated=2]="Deprecated",e[e.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=258]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",e[e.InvalidUnicode=260]="InvalidUnicode",e[e.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",e[e.InvalidCharacter=262]="InvalidCharacter",e[e.PropertyExpected=513]="PropertyExpected",e[e.CommaExpected=514]="CommaExpected",e[e.ColonExpected=515]="ColonExpected",e[e.ValueExpected=516]="ValueExpected",e[e.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",e[e.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",e[e.TrailingComma=519]="TrailingComma",e[e.DuplicateKey=520]="DuplicateKey",e[e.CommentNotPermitted=521]="CommentNotPermitted",e[e.PropertyKeysMustBeDoublequoted=528]="PropertyKeysMustBeDoublequoted",e[e.SchemaResolveError=768]="SchemaResolveError",e[e.SchemaUnsupportedFeature=769]="SchemaUnsupportedFeature"}(UX||(UX={}));class ZX{constructor(e,t,n){this.message=e,this.code=t,this.range=n}static create(e,t,n){return new ZX(e,t,n)}}class JX{constructor(e,t){this.start=e,this.end=t}static create(e,t){return new JX(e,t)}}function QX(e){return Rq(e)}function eY(e){let t="root";for(let n=0;n<e.length;n++)"number"==typeof e[n]?t+="["+e[n]+"]":t+="."+e[n];return t}!function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(KX||(KX={})),function(e){e.PlainText=1,e.Snippet=2}(WX||(WX={})),function(e){e.replace=function(e,t){return{range:e,newText:t}}}(GX||(GX={})),function(e){e.create=function(e){return{label:e}}}(qX||(qX={}));class tY{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.offset=t,this.length=n,this.parent=e}get children(){return[]}toString(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")}}class nY extends tY{constructor(e,t){super(e,t),this.type="null",this.value=null}}class rY extends tY{constructor(e,t,n){super(e,n),this.type="boolean",this.value=t}}class iY extends tY{constructor(e,t){super(e,t),this.type="array",this.items=[]}get children(){return this.items}}class sY extends tY{constructor(e,t){super(e,t),this.type="number",this.isInteger=!0,this.value=Number.NaN}}class oY extends tY{constructor(e,t){super(e,t),this.type="object",this.properties=[]}get children(){return this.properties}}class aY extends tY{constructor(e,t,n){super(e,t,n),this.type="string",this.value=""}}class lY extends tY{constructor(e,t,n){super(e,t),this.type="property",this.colonOffset=-1,this.keyNode=n}get children(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]}}class cY{constructor(e){this.root=e}getNodeFromOffset(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.root)return Mq(this.root,e,t)}visit(e){if(this.root){const t=n=>{let r=e(n);const i=n.children;if(Array.isArray(i))for(let e=0;e<i.length&&r;e++)r=t(i[e]);return r};t(this.root)}}}function dY(e){const t=[];let n=-1;const r=e.getValue(),i=Tq(r,!1);function s(){for(;;){const e=i.scan();switch(o(),e){case Iq.LineBreakTrivia:case Iq.Trivia:break;default:return e}}}function o(){switch(i.getTokenError()){case Pq.InvalidUnicode:return c("Invalid unicode sequence in string.",UX.InvalidUnicode),!0;case Pq.InvalidEscapeCharacter:return c("Invalid escape character in string.",UX.InvalidEscapeCharacter),!0;case Pq.UnexpectedEndOfNumber:return c("Unexpected end of number.",UX.UnexpectedEndOfNumber),!0;case Pq.UnexpectedEndOfComment:return c("Unexpected end of comment.",UX.UnexpectedEndOfComment),!0;case Pq.UnexpectedEndOfString:return c("Unexpected end of string.",UX.UnexpectedEndOfString),!0;case Pq.InvalidCharacter:return c("Invalid characters in string. Control characters must be escaped.",UX.InvalidCharacter),!0}return!1}function a(r,i,s,o){if(0===t.length||s!==n){const a=JX.create(e.positionAt(s),e.positionAt(o));t.push(ZX.create(r,i,a)),n=s}}function l(e,t){return e.length=i.getTokenOffset()+i.getTokenLength()-e.offset,t&&s(),e}function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],d=i.getTokenOffset(),h=i.getTokenOffset()+i.getTokenLength();if(d===h&&d>0){for(d--;d>0&&/\s/.test(r.charAt(d));)d--;h=d+1}if(a(e,t,d,h),n&&l(n,!1),o.length+c.length>0){let e=i.getToken();for(;e!==Iq.EOF;){if(-1!==o.indexOf(e)){s();break}if(-1!==c.indexOf(e))break;e=s()}}return n}const d=new aY(void 0,0,0);function h(t,n){const r=new lY(t,i.getTokenOffset(),d);let o=u(r);if(!o){if(i.getToken()!==Iq.Unknown)return;{c("Property keys must be doublequoted",UX.PropertyKeysMustBeDoublequoted);const e=new aY(r,i.getTokenOffset(),i.getTokenLength());e.value=i.getTokenValue(),o=e,s()}}if(r.keyNode=o,"//"!==o.value){const e=n[o.value];e?(a("Duplicate object key",UX.DuplicateKey,r.keyNode.offset,r.keyNode.offset+r.keyNode.length),"object"!=typeof(l=e)||null===l||Array.isArray(l)||a("Duplicate object key",UX.DuplicateKey,e.keyNode.offset,e.keyNode.offset+e.keyNode.length),n[o.value]=!0):n[o.value]=r}var l;if(i.getToken()===Iq.ColonToken)r.colonOffset=i.getTokenOffset(),s();else if(c("Colon expected",UX.ColonExpected),i.getToken()===Iq.StringLiteral&&e.positionAt(o.offset+o.length).lineNumber<e.positionAt(i.getTokenOffset()).lineNumber)return r.length=o.length,r;const h=p(r);return h?(r.valueNode=h,r.length=h.offset+h.length-r.offset,r):c("Value expected",UX.ValueExpected,r,[],[Iq.CloseBraceToken,Iq.CommaToken])}function u(e){if(i.getToken()!==Iq.StringLiteral)return;const t=new aY(e,i.getTokenOffset());return t.value=i.getTokenValue(),l(t,!0)}function p(e){return function(e){if(i.getToken()!==Iq.OpenBracketToken)return;const t=new iY(e,i.getTokenOffset());s();let n=!1;for(;i.getToken()!==Iq.CloseBracketToken&&i.getToken()!==Iq.EOF;){if(i.getToken()===Iq.CommaToken){n||c("Value expected.",UX.ValueExpected);const e=i.getTokenOffset();if(s(),i.getToken()===Iq.CloseBracketToken){n&&a("Trailing comma",UX.TrailingComma,e,e+1);continue}}else if(n){c("Comma expected.",UX.CommaExpected,void 0,[],[Iq.CloseBracketToken]);break}const e=p(t);if(!e){c("Value expected.",UX.ValueExpected,void 0,[],[Iq.CloseBracketToken]);break}t.items.push(e),n=!0}return i.getToken()!==Iq.CloseBracketToken?c("Expected comma or closing bracket",UX.CommaOrCloseBraceExpected,t):l(t,!0)}(e)||function(e){if(i.getToken()!==Iq.OpenBraceToken)return;const t=new oY(e,i.getTokenOffset()),n=Object.create(null);s();let r=!1;for(;i.getToken()!==Iq.CloseBraceToken&&i.getToken()!==Iq.EOF;){if(i.getToken()===Iq.CommaToken){r||c("Property expected",UX.PropertyExpected);const e=i.getTokenOffset();if(s(),i.getToken()===Iq.CloseBraceToken){r&&a("Trailing comma",UX.TrailingComma,e,e+1);continue}}else r&&c("Expected comma",UX.CommaExpected);const e=h(t,n);e?t.properties.push(e):c("Property expected",UX.PropertyExpected,void 0,[],[Iq.CloseBraceToken,Iq.CommaToken]),r=!0}return i.getToken()!==Iq.CloseBraceToken?c("Expected comma or closing brace",UX.CommaOrCloseBraceExpected,t):l(t,!0)}(e)||u(e)||function(e){if(i.getToken()!==Iq.NumericLiteral)return;const t=new sY(e,i.getTokenOffset());if(i.getTokenError()===Pq.None){const e=i.getTokenValue();try{const n=JSON.parse(e);if("number"!=typeof n)return c("Invalid number format.",UX.Undefined,t);t.value=n}catch(e){return c("Invalid number format.",UX.Undefined,t)}t.isInteger=-1===e.indexOf(".")}return l(t,!0)}(e)||function(e){switch(i.getToken()){case Iq.NullKeyword:return l(new nY(e,i.getTokenOffset()),!0);case Iq.TrueKeyword:return l(new rY(e,!0,i.getTokenOffset()),!0);case Iq.FalseKeyword:return l(new rY(e,!1,i.getTokenOffset()),!0);default:return}}(e)}let f;return s()!==Iq.EOF&&(f=p(f),f?i.getToken()!==Iq.EOF&&c("End of file expected.",UX.Undefined):c("Expected a JSON object, array or literal",UX.Undefined)),{problems:t,root:new cY(f)}}class hY{constructor(e,t){this.lineNumber=e,this.column=t}}class uY{constructor(e,t,n,r){e>n||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}static create(e,t){return new uY(e.lineNumber,e.column,t.lineNumber,t.column)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn)&&!(t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}plusRange(e){return uY.plusRange(this,e)}static plusRange(e,t){let n,r,i,s;return t.startLineNumber<e.startLineNumber?(n=t.startLineNumber,r=t.startColumn):t.startLineNumber===e.startLineNumber?(n=t.startLineNumber,r=Math.min(t.startColumn,e.startColumn)):(n=e.startLineNumber,r=e.startColumn),t.endLineNumber>e.endLineNumber?(i=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(i=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(i=e.endLineNumber,s=e.endColumn),new uY(n,r,i,s)}getStartPosition(){return uY.getStartPosition(this)}static getStartPosition(e){return new hY(e.startLineNumber,e.startColumn)}}class pY{constructor(e){this._options=e}doCompletion(e,t,n){const r={items:[],isIncomplete:!1},i=e.getValue(),s=e.getOffsetAt(t.lineNumber,t.column);let o=n.getNodeFromOffset(s,!0);if(o&&s===o.offset+o.length&&s>0){const e=i[s-1];("object"===o.type&&"}"===e||"array"===o.type&&"]"===e)&&(o=o.parent)}const a=this.getCurrentWord(e,s);let l;if(!o||"string"!==o.type&&"number"!==o.type&&"boolean"!==o.type&&"null"!==o.type){let n=s-a.length;n>0&&'"'===i[n-1]&&n--,l=uY.create(e.positionAt(n),t)}else l=uY.create(e.positionAt(o.offset),e.positionAt(o.offset+o.length));const c=new Map,d={add:e=>{let t=e.label;const n=c.get(t);if(n)n.documentation||(n.documentation=e.documentation),n.detail||(n.detail=e.detail),n.labelDetails||(n.labelDetails=e.labelDetails);else{if(t=t.replace(/[\n]/g,"↵"),t.length>60){const e=t.substring(0,57).trim()+"...";c.has(e)||(t=e)}e.textEdit=GX.replace(l,e.insertText),e.label=t,c.set(t,e),r.items.push(e)}},setAsIncomplete:()=>{r.isIncomplete=!0},error:e=>{console.error(e)},getNumberOfProposals:()=>r.items.length};return Promise.resolve().then((()=>{let t,h=!0,u="";if(o&&"string"===o.type){const e=o.parent;e&&"property"===e.type&&e.keyNode===o&&(h=!e.valueNode,t=e,u=i.substr(o.offset+1,o.length-2),e&&(o=e.parent))}if(o&&"object"===o.type){if(o.offset===s)return r;o.properties.forEach((e=>{t&&t===e||c.set(e.keyNode.value,qX.create("__"))}));let p="";h&&(p=this.evaluateSeparatorAfter(e,e.getOffsetAt(l.endLineNumber,l.endColumn))),this.getSchemaLessPropertyCompletions(n,o,u,d,a),a.length>0&&'"'!==i.charAt(s-a.length-1)&&(d.add({kind:KX.Property,label:this.getLabelForValue(a),insertText:this.getInsertTextForProperty(a,void 0,!1,p),insertTextFormat:WX.Snippet,documentation:""}),d.setAsIncomplete())}const p={};return this.getSchemaLessValueCompletions(n,o,s,e,d),Promise.all([]).then((()=>{var t;if(0===d.getNumberOfProposals()){let t=s;!o||"string"!==o.type&&"number"!==o.type&&"boolean"!==o.type&&"null"!==o.type||(t=o.offset+o.length);const n=this.evaluateSeparatorAfter(e,t);this.addFillerValueCompletions(p,n,d)}else(null===(t=this._options)||void 0===t?void 0:t.staticCompletions)&&this._options.staticCompletions.forEach((e=>{d.add({label:e.label,insertText:e.insertText||e.label,documentation:e.documentation||""})}));return r}))}))}getCurrentWord(e,t){let n=t-1;const r=e.getValue();for(;n>=0&&-1===' \t\n\r\v":{[,]}'.indexOf(r.charAt(n));)n--;return r.substring(n+1,t)}evaluateSeparatorAfter(e,t){const n=Tq(e.getValue(),!0);n.setPosition(t);switch(n.scan()){case Iq.CommaToken:case Iq.CloseBraceToken:case Iq.CloseBracketToken:case Iq.EOF:return"";default:return","}}getLabelForValue(e){return JSON.stringify(e)}getInsertTextForPlainText(e){return e.replace(/[\\\$\}]/g,"\\$&")}getInsertTextForValue(e,t){const n=JSON.stringify(e,null,"\t");return"{}"===n?"{$1}"+t:"[]"===n?"[$1]"+t:this.getInsertTextForPlainText(n+t)}getFilterTextForValue(e){return JSON.stringify(e)}getInsertTextForProperty(e,t,n,r){const i=this.getInsertTextForValue(e,"");if(!n)return i;let s;return s||(s="$1"),i+": "+s+r}getSchemaLessPropertyCompletions(e,t,n,r,i){const s=e=>{e.properties.forEach((e=>{const t=e.keyNode.value;t.toLowerCase().startsWith(i.toLowerCase())&&""!==i&&r.add({kind:KX.Property,label:t,insertText:this.getInsertTextForValue(t,""),insertTextFormat:WX.Snippet,filterText:this.getFilterTextForValue(t),documentation:""})}))};if(t.parent)if("property"===t.parent.type){const n=t.parent.keyNode.value;e.visit((e=>("property"===e.type&&e!==t.parent&&e.keyNode.value===n&&e.valueNode&&"object"===e.valueNode.type&&s(e.valueNode),!0)))}else"array"===t.parent.type&&t.parent.items.forEach((e=>{"object"===e.type&&e!==t&&s(e)}))}addFillerValueCompletions(e,t,n){e.object&&n.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},t),insertTextFormat:WX.Snippet,detail:"New object",documentation:""}),e.array&&n.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],t),insertTextFormat:WX.Snippet,detail:"New array",documentation:""})}getInsertTextForGuessedValue(e,t){switch(typeof e){case"object":return null===e?"${1:null}"+t:this.getInsertTextForValue(e,t);case"string":let n=JSON.stringify(e);return n=n.substr(1,n.length-2),n=this.getInsertTextForPlainText(n),'"${1:'+n+'}"'+t;case"number":case"boolean":return"${1:"+JSON.stringify(e)+"}"+t}return this.getInsertTextForValue(e,t)}getSuggestionKind(e){if(Array.isArray(e)){const t=e;e=t.length>0?t[0]:void 0}if(!e)return KX.Value;switch(e){case"string":default:return KX.Value;case"object":return KX.Module;case"property":return KX.Property}}getSchemaLessValueCompletions(e,t,n,r,i){let s=n;if(!t||"string"!==t.type&&"number"!==t.type&&"boolean"!==t.type&&"null"!==t.type||(s=t.offset+t.length,t=t.parent),!t)return;const o=this.evaluateSeparatorAfter(r,s),a=e=>{e.parent&&!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}(e.parent,n,!0)&&i.add({kind:this.getSuggestionKind(e.type),label:this.getLabelTextForMatchingNode(e,r),insertText:this.getInsertTextForMatchingNode(e,r,o),insertTextFormat:WX.Snippet,documentation:""})};if("property"===t.type&&n>(t.colonOffset||0)){const r=t.valueNode;if(r&&(n>r.offset+r.length||"object"===r.type||"array"===r.type))return;const i=t.keyNode.value;e.visit((e=>("property"===e.type&&e.keyNode.value===i&&e.valueNode&&a(e.valueNode),!0)))}if("array"===t.type)if(t.parent&&"property"===t.parent.type){const n=t.parent.keyNode.value;e.visit((e=>("property"===e.type&&e.keyNode.value===n&&e.valueNode&&"array"===e.valueNode.type&&e.valueNode.items.forEach(a),!0)))}else t.items.forEach(a)}getLabelTextForMatchingNode(e,t){switch(e.type){case"array":return"[]";case"object":return"{}";default:return t.getValue().substr(e.offset,e.length)}}getInsertTextForMatchingNode(e,t,n){switch(e.type){case"array":return this.getInsertTextForValue([],n);case"object":return this.getInsertTextForValue({},n);default:const r=t.getValue().substr(e.offset,e.length)+n;return this.getInsertTextForPlainText(r)}}addBooleanValueCompletion(e,t,n){n.add({kind:this.getSuggestionKind("boolean"),label:e?"true":"false",insertText:this.getInsertTextForValue(e,t),insertTextFormat:WX.Snippet,documentation:""})}}class fY{constructor(e,t,n){this._selectedIndex=0,this._suggestions=[],this.isVisible=!1,this.emitter=nX(),this._handleKeyDown=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),this._selectedIndex=(this._selectedIndex+1)%this._suggestions.length,this._renderCompletions();break;case"ArrowUp":e.preventDefault(),this._selectedIndex=(this._selectedIndex-1+this._suggestions.length)%this._suggestions.length,this._renderCompletions();break;case"Enter":case"Tab":e.preventDefault(),this.complete()}},this._view=e,this._jsonModel=t,this._selectionModel=n,this._container=this.createCompleteContainer(),this._suggestionsContainer=this.createSuggestionsContainer(),this._container.appendChild(this._suggestionsContainer),this._view.jsonViewerDom.appendChild(this._container),this._attachEventListeners()}_attachEventListeners(){this._suggestionsContainer.addEventListener("click",(e=>{this._handleSuggestionClick(e)})),this.emitter.on("contentChanged",(e=>{Array.isArray(e)||((e=>"insert"===e.type&&1===e.newText.length&&!/\s/.test(e.newText))(e)?this._fetchCompletions():this.hide())}))}_fetchCompletions(){var e;const t=dY(this._jsonModel).root;const n={lineNumber:this._jsonModel.lastChangeBufferPos.lineNumber,column:this._jsonModel.lastChangeBufferPos.column};new pY((null===(e=this._view.options)||void 0===e?void 0:e.completionOptions)||null).doCompletion(this._jsonModel,n,t).then((e=>{this._suggestions=e.items||[],this.show()}))}_calculatePosition(){const e=window.getSelection();if(!e||!e.rangeCount)return{x:0,y:0};const t=e.getRangeAt(0).getBoundingClientRect(),n=this._view.contentDom.getBoundingClientRect();return{x:t.left-n.left+50,y:t.bottom-n.top}}createCompleteContainer(){const e=vq("div",`${this._view.prefixCls}-complete-container`);return bq(e,{display:"none"}),e}createSuggestionsContainer(){const e=vq("div",`${this._view.prefixCls}-complete-suggestions-container`);return bq(e,{maxHeight:"200px",overflowY:"auto"}),e}show(){if(0===this._suggestions.length)return;const{x:e,y:t}=this._calculatePosition();e<0||t<0||(this.isVisible=!0,bq(this._container,{left:`${e}px`,top:`${t}px`,display:"block"}),this._suggestionsContainer.textContent="",this._renderCompletions())}_handleSuggestionClick(e){if(e.preventDefault(),e.target instanceof HTMLLIElement){const t=Number(e.target.getAttribute("data-index"));isNaN(t)||(this._selectedIndex=t,this.complete())}}complete(){const e=this._suggestions[this._selectedIndex],{textEdit:t}=e;if(!t)return;const{range:n}=t,r=this._jsonModel.getOffsetAt(n.startLineNumber,n.startColumn),i=this._jsonModel.getOffsetAt(n.endLineNumber,n.endColumn),s={type:"replace",range:{startLineNumber:n.startLineNumber,startColumn:n.startColumn,endLineNumber:n.endLineNumber,endColumn:n.endColumn},rangeLength:i-r,rangeOffset:r,oldText:this._jsonModel.getValueInRange(n),newText:(null==t?void 0:t.newText)||""};this._jsonModel.applyOperation(s),this.hide()}_renderCompletions(){const e=`${this._view.prefixCls}-complete-suggestions-item`,t=document.createDocumentFragment();this._suggestions.forEach(((n,r)=>{const i=document.createElement("li");i.className=e,i.style.backgroundColor=r===this._selectedIndex?"var(--semi-color-fill-0)":"transparent",i.dataset.index=r.toString(),i.textContent=n.label,t.appendChild(i)})),this._suggestionsContainer.textContent="",this._suggestionsContainer.appendChild(t)}hide(){this.isVisible&&(this.isVisible=!1,this._container.style.display="none",this._suggestions=[])}}class mY{constructor(e){this._hoverDom=null,this._hoverTimer=null,this.emitter=nX(),this._view=e,this._tooltipDom=this._createTooltipDom(),this._view.jsonViewerDom.appendChild(this._tooltipDom),this._attachEventListeners()}_attachEventListeners(){this._view.contentDom.addEventListener("mousemove",(e=>{if(e.target instanceof HTMLSpanElement&&e.target.classList.contains("semi-json-viewer-string-value")){if(this._hoverDom===e.target)return;this._clearHoverTimer(),this._hideTooltip(),this._hoverDom=e.target,this._hoverTimer=window.setTimeout((()=>{var e;this._hoverDom&&this.emitter.emit("hoverNode",{value:null!==(e=this._hoverDom.textContent)&&void 0!==e?e:"",target:this._hoverDom})}),700)}})),this._view.contentDom.addEventListener("mouseout",(e=>{const t=e.relatedTarget;this._tooltipDom.contains(t)||(this._clearHoverTimer(),this._hideTooltip())})),this._tooltipDom.addEventListener("mouseleave",(e=>{var t;const n=e.relatedTarget;(null===(t=this._hoverDom)||void 0===t?void 0:t.contains(n))||this._hideTooltip()})),this.emitter.on("renderHoverNode",(e=>{this.render(e.el)}))}_clearHoverTimer(){this._hoverTimer&&(window.clearTimeout(this._hoverTimer),this._hoverTimer=null)}_hideTooltip(){bq(this._tooltipDom,{visibility:"hidden"}),this._tooltipDom.textContent="",this._hoverDom=null}_createTooltipDom(){const e=vq("div","hover-container");return bq(e,{visibility:"hidden",position:"absolute",zIndex:"1000"}),e}render(e){if(!this._hoverDom)return;this._tooltipDom.textContent="",this._tooltipDom.appendChild(e);const t=this._hoverDom.getBoundingClientRect(),n=this._view.contentDom.getBoundingClientRect(),r=this._tooltipDom.getBoundingClientRect();let i=t.left-n.left+(t.width+r.width)/2;i=Math.max(5,i),i=Math.min(i,n.width-r.width-5);let s=t.top-n.top-r.height;t.top-r.height-5<n.top&&(s=t.top-n.top+t.height),bq(this._tooltipDom,{visibility:"visible",top:`${s}px`,left:`${i}px`})}}class gY{constructor(e){this.emitter=nX(),this._problems=[],this._view=e,this._attachEventListeners()}_attachEventListeners(){this.emitter.on("problemsChanged",(e=>{this._problems=e.problems,this.renderErrorLine()}))}renderErrorLine(){0!==this._problems.length&&this._problems.forEach((e=>{const{start:t,end:n}=e.range,r=e.message;this.findDomByPos(t,n,r)}))}findDomByPos(e,t,n){var r;let i=this._view.getLineElement(e.lineNumber);if(i=null==i?void 0:i.children[0],!i)return;let s=1;for(let n=0;n<i.children.length;n++){const o=i.children[n];if(s+=(null===(r=o.textContent)||void 0===r?void 0:r.length)||0,s>e.column&&s<=t.column){const e=`${this._view.prefixCls}-error`;o.classList.add(e)}}}}class yY{constructor(e,t,n){this._lineHeight=e,this._totalLines=t,this._options=n,this.prefixCls=(null==n?void 0:n.prefixCls)||"semi-json-viewer"}createRenderContainer(){const e=vq("div","json-viewer-container");return bq(e,{position:"relative",height:"100%",width:"100%",overflow:"auto"}),e}createLineNumberContainer(){var e;const t=vq("div",`${null===(e=this._options)||void 0===e?void 0:e.prefixCls}-line-number-container`);return bq(t,{position:"absolute",left:"0",top:"0",width:"50px"}),t}createContentContainer(){var e;const t=vq("div",`${this.prefixCls}-content-container`);return bq(t,{position:"absolute",left:"50px",top:"0",right:"0",overflowX:"auto",overflowY:"scroll",outline:"none"}),(null===(e=this._options)||void 0===e?void 0:e.readOnly)||(t.contentEditable="true",t.style.caretColor="black",t.spellcheck=!1),t}createScrollElement(){var e,t,n;const r=vq("div","lines-content");return bq(r,{position:"relative",overflow:"hidden",top:"0",left:"0",tabSize:((null===(t=null===(e=this._options)||void 0===e?void 0:e.formatOptions)||void 0===t?void 0:t.tabSize)||4).toString(),height:this._lineHeight*this._totalLines+"px"}),(null===(n=this._options)||void 0===n?void 0:n.autoWrap)&&(r.style.width="100%"),r}createLineScrollContainer(){const e=vq("div","line-scroll-container");return bq(e,{position:"absolute",top:"0",left:"0",height:this._lineHeight*this._totalLines+"px",width:"100%",overflow:"hidden"}),e}}class vY{constructor(e,t,n){this._root=null,this._customRenderMap=new Map,this.startLineNumber=1,this.visibleLineCount=0,this._verticalOffsetAdjustment=0,this._jsonWorkerManager=aX(),this._measuredHeights={},this.emitter=nX(),this._container=e,this._jsonModel=t,this._selectionModel=new rX(1,0,this,t),this._foldingModel=new xX(t),this._lineHeight=(null==n?void 0:n.lineHeight)||20,this._options=n,this._customRenderRule=(null==n?void 0:n.customRenderRule)||null,this.prefixCls=(null==n?void 0:n.prefixCls)||"semi-json-viewer",this._domBuilder=new yY(this._lineHeight,t.getLineCount(),n),this._jsonViewerDom=this._domBuilder.createRenderContainer(),this._lineNumberDom=this._domBuilder.createLineNumberContainer(),this._contentDom=this._domBuilder.createContentContainer(),this._scrollDom=this._domBuilder.createScrollElement(),this._lineScrollDom=this._domBuilder.createLineScrollContainer(),this._contentDom.appendChild(this._scrollDom),this._lineNumberDom.appendChild(this._lineScrollDom),this._jsonViewerDom.appendChild(this._lineNumberDom),this._jsonViewerDom.appendChild(this._contentDom),this._container.appendChild(this._jsonViewerDom),this._searchWidget=new EX(this,this._jsonModel),this._foldWidget=new _X(this,this._foldingModel),this._editWidget=new SX(this,this._jsonModel,this._selectionModel),this._completeWidget=new fY(this,this._jsonModel,this._selectionModel),this._hoverWidget=new mY(this),this._errorWidget=new gY(this),this._tokenizationJsonModelPart=new $X(this._jsonModel),this._scalingCellSizeAndPositionManager=new HX({cellCount:this._jsonModel.getLineCount(),cellSizeGetter:e=>{let{index:t}=e;return this.getCellSize(t)},estimatedCellSize:this._lineHeight}),this._attachEventListeners()}get tokenizationJsonModelPart(){return this._tokenizationJsonModelPart}get contentDom(){return this._contentDom}get jsonViewerDom(){return this._jsonViewerDom}get scrollDom(){return this._scrollDom}get lineScrollDom(){return this._lineScrollDom}get options(){return this._options}get completeWidget(){return this._completeWidget}get editWidget(){return this._editWidget}get scalingCellSizeAndPositionManager(){return this._scalingCellSizeAndPositionManager}get searchWidget(){return this._searchWidget}dispose(){this._container.removeChild(this._jsonViewerDom)}_attachEventListeners(){var e,t;if((null===(e=this._options)||void 0===e?void 0:e.readOnly)&&this._options.customRenderRule){const{root:e}=dY(this._jsonModel);this._root=e}this._jsonViewerDom.addEventListener("scroll",(e=>{this.onScroll(this._jsonViewerDom.scrollTop)})),(null===(t=this._options)||void 0===t?void 0:t.readOnly)||(this._jsonViewerDom.addEventListener("click",(e=>{e.preventDefault(),this._selectionModel.toLastPosition()})),this._contentDom.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation(),this._completeWidget.hide(),this._selectionModel.isSelectedAll=!1,this._selectionModel.isSelecting=!1,this._selectionModel.updateFromSelection()})),this.emitter.on("contentChanged",(()=>{this.resetScalingManagerConfigAndCell(0),this._measuredHeights={},this._jsonModel.lastChangeBufferPos.lineNumber>=this.visibleLineCount+this.startLineNumber?this.scrollToLine(this._jsonModel.lastChangeBufferPos.lineNumber-this.visibleLineCount+1):this.layout()})),this.emitter.on("forceRender",(()=>{this.resetScalingManagerConfigAndCell(0),this.layout(),this._errorWidget.renderErrorLine()})))}getLineElement(e){return this.scrollDom.querySelector(`[data-line-number="${e}"]`)}updateVisibleRange(e,t){this.startLineNumber=e,this.visibleLineCount=t-e+1}onScroll(e){this._jsonViewerDom.scrollTop=e,this.layout(),this._errorWidget.renderErrorLine()}scrollToLine(e){const t=(e-1)*this._lineHeight;this._contentDom.scrollTop=t,this.onScroll(t)}createLineNumberElement(e,t){const n=vq("div",`${this.prefixCls}-line-number`),r=this._scalingCellSizeAndPositionManager.getSizeAndPositionOfCell(t);bq(n,{position:"absolute",width:"50px",height:`${this._lineHeight}px`,lineHeight:`${this._lineHeight}px`,top:`${r.offset+this._verticalOffsetAdjustment}px`});const i=vq("span","line-number-text",{position:"absolute",left:"0",top:"0",textAlign:"right",width:"60%",height:"100%"});return i.textContent=e.toString(),n.appendChild(i),n.dataset.lineNumber=e.toString(),n}createLineContentElement(e,t){var n;const r=vq("div",`${this.prefixCls}-view-line`);r.setAttribute("data-line-element","true");const i=this._scalingCellSizeAndPositionManager.getSizeAndPositionOfCell(t);return bq(r,{lineHeight:`${this._lineHeight}px`,width:"100%",position:"absolute",top:`${i.offset+this._verticalOffsetAdjustment}px`}),(null===(n=this._options)||void 0===n?void 0:n.autoWrap)||(r.style.height=`${this._lineHeight}px`),r.dataset.lineNumber=e.toString(),r.lineNumber=e,r}getCellSize(e){var t;return(null===(t=this._options)||void 0===t?void 0:t.autoWrap)&&this._measuredHeights[e]||this._lineHeight}_measureAndUpdateItemHeight(e,t){var n;const r=e.offsetHeight,i=2*e.children[0].getBoundingClientRect().width;!(null===(n=this._options)||void 0===n?void 0:n.autoWrap)&&i>this._scrollDom.offsetWidth&&(this._scrollDom.style.width=`${i}px`),0!==r?r!==this._measuredHeights[t]&&(this._measuredHeights[t]=r,this._scalingCellSizeAndPositionManager.resetCell(t),this._scalingCellSizeAndPositionManager.getSizeAndPositionOfCell(t),this._scrollDom.style.height=`${this._scalingCellSizeAndPositionManager.getTotalSize()}px`):e.style.height=`${this._lineHeight}px`}clearContainers(){this._lineScrollDom.textContent="",this._scrollDom.textContent=""}resetScalingManagerConfigAndCell(e){this._scalingCellSizeAndPositionManager.configure({cellCount:this._jsonModel.getLineCount(),cellSizeGetter:e=>{let{index:t}=e;return this.getCellSize(t)},estimatedCellSize:this._lineHeight}),this._scalingCellSizeAndPositionManager.resetCell(e)}layout(){var e,t;this.clearContainers(),this._customRenderMap.clear();const n=this._foldingModel.getVisibleLineCount();this._scalingCellSizeAndPositionManager.configure({cellCount:n,cellSizeGetter:e=>{let{index:t}=e;return this.getCellSize(t)},estimatedCellSize:this._lineHeight});const r=this._scalingCellSizeAndPositionManager.getVisibleCellRange({containerSize:this._container.clientHeight,offset:this._jsonViewerDom.scrollTop}),i=this._scalingCellSizeAndPositionManager.getOffsetAdjustment({containerSize:this._container.clientHeight,offset:this._jsonViewerDom.scrollTop});this._verticalOffsetAdjustment=i,this.renderVisibleLines(r.start,r.stop),this.updateVisibleRange(r.start+1,r.stop+1),(null===(e=this._options)||void 0===e?void 0:e.readOnly)||(this._selectionModel.toViewPosition(),this._completeWidget.show());const s=this._scalingCellSizeAndPositionManager.getTotalSize();this._scrollDom.style.height=`${s}px`,this._lineScrollDom.style.height=`${s}px`,(null===(t=this._options)||void 0===t?void 0:t.readOnly)&&this._customRenderMap.size>0&&(this._customRenderMap.forEach(((e,t)=>{t.textContent=""})),this.emitter.emit("customRender",{customRenderMap:this._customRenderMap}))}renderVisibleLines(e,t){this._tokenizationJsonModelPart.forceTokenize(t+1);let n=this._foldingModel.getActualLineNumber(e+1),r=e;for(;r<=t&&n<=this._jsonModel.getLineCount();)this._foldingModel.isLineCollapsed(n)||(this.renderLine(n,r),r++),n=this._foldingModel.getNextVisibleLine(n)}renderLine(e,t){const n=this._jsonModel.getLineContent(e),r=this._tokenizationJsonModelPart.getLineTokens(e);this.renderLineNumber(e,t),this.renderLineContent(e,t,r,n)}renderLineNumber(e,t){const n=this.createLineNumberElement(e,t);return this._lineScrollDom.appendChild(n),n}renderLineContent(e,t,n,r){const i=this.createLineContentElement(e,t),s=this.renderTokensWithHighlight(n,r,e);return i.appendChild(s),this._scrollDom.appendChild(i),this._measureAndUpdateItemHeight(i,t),i}renderTokensWithHighlight(e,t,n){var r,i,s;const o=document.createElement("span");let a=0;const l=this._searchWidget.binarySearchByLine(n);for(let c=0;c<e.length;c++){const d=e[c],h=d.startIndex,u=c+1<e.length?e[c+1].startIndex:t.length;let p=t.substring(h,u);if(l&&l.length>0){const e=this.createHighlightedContent(p,a,l,d.scopes);o.appendChild(e)}else{if((null===(r=this._options)||void 0===r?void 0:r.readOnly)&&this._tryApplyCustomRender(d.scopes,p)){const e=this._jsonModel.getOffsetAt(n,h+1),t=null===(i=this._root)||void 0===i?void 0:i.getNodeFromOffset(e),r=eY(t?QX(t):[]),s=this._renderCustomToken(p,this._customRenderRule,d,r,t);if(s instanceof HTMLElement){o.appendChild(s);continue}if(null!==s){const e=document.createElement("span");e.className=`${this.prefixCls}-${d.scopes}`,e.textContent=p,o.appendChild(e),this._customRenderMap.set(e,s);continue}}const e=document.createElement("span");e.className=`${this.prefixCls}-${d.scopes}`,e.textContent=p,(null===(s=this._options)||void 0===s?void 0:s.autoWrap)||(e.style.whiteSpace="pre"),o.appendChild(e)}a+=p.length}return o}createHighlightedContent(e,t,n,r){var i;const s=document.createElement("span");let o=0;for(const a of n){const n=Math.max(0,a.range.startColumn-1-t),l=Math.min(e.length,a.range.endColumn-1-t);if(n>=e.length||l<=0)continue;if(n>o){const t=document.createElement("span");t.className=`${this.prefixCls}-${r}`,t.textContent=e.substring(o,n),s.appendChild(t)}const c=document.createElement("span");c.textContent=e.substring(n,l);const d=null===(i=this._searchWidget.searchResults)||void 0===i?void 0:i[this._searchWidget._currentResultIndex],h=a.range.startLineNumber===(null==d?void 0:d.range.startLineNumber)&&a.range.endLineNumber===(null==d?void 0:d.range.endLineNumber)&&a.range.startColumn===(null==d?void 0:d.range.startColumn)&&a.range.endColumn===(null==d?void 0:d.range.endColumn);c.className=`${this.prefixCls}-${r} ${this.prefixCls}-search-result${h?` ${this.prefixCls}-current-search-result`:""}`,c.dataset.startColumn=a.range.startColumn.toString(),c.dataset.endColumn=a.range.endColumn.toString(),s.appendChild(c),o=l}if(o<e.length){const t=document.createElement("span");t.className=`${this.prefixCls}-${r}`,t.textContent=e.substring(o),s.appendChild(t)}return s}_tryApplyCustomRender(e,t){return!(!this._customRenderRule||this._customRenderRule.length<=0)&&(e===Bq||e===Vq||e===zq||e===Hq||e===Uq)}isMatch(e,t,n,r,i){const s=i.match;return"function"==typeof s?s(t,n,r):"string"==typeof s?s===e:s instanceof RegExp&&s.test(e)}_renderCustomToken(e,t,n,r,i){const s=e.replace(/^"|"$/g,""),o=n.scopes===Uq?"key":"value";let a=s;n.scopes!==Hq&&n.scopes!==Bq&&n.scopes!==Vq||i&&(a=function(e){return Aq(e)}(i));for(const n of t)if(this.isMatch(s,a,r,o,n)){return n.render(e)}return null}}!function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(XX||(XX={}));class bY{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}class wY{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}}class xY{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==EY)return CY(this.right);let e=this;for(;e.parent!==EY&&e.parent.left!==e;)e=e.parent;return e.parent===EY?EY:e.parent}prev(){if(this.left!==EY)return SY(this.left);let e=this;for(;e.parent!==EY&&e.parent.right!==e;)e=e.parent;return e.parent===EY?EY:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}!function(e){e[e.Black=0]="Black",e[e.Red=1]="Red"}(YX||(YX={}));const EY=new xY(null,YX.Black);function CY(e){for(;e.left!==EY;)e=e.left;return e}function SY(e){for(;e.right!==EY;)e=e.right;return e}function _Y(e){return e===EY?0:e.size_left+e.piece.length+_Y(e.right)}function kY(e){return e===EY?0:e.lf_left+e.piece.lineFeedCnt+kY(e.right)}function OY(){EY.parent=EY}function TY(e,t){const n=t.right;n.size_left+=t.size_left+(t.piece?t.piece.length:0),n.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=n.left,n.left!==EY&&(n.left.parent=t),n.parent=t.parent,t.parent===EY?e.root=n:t.parent.left===t?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}function PY(e,t){const n=t.left;t.left=n.right,n.right!==EY&&(n.right.parent=t),n.parent=t.parent,t.size_left-=n.size_left+(n.piece?n.piece.length:0),t.lf_left-=n.lf_left+(n.piece?n.piece.lineFeedCnt:0),t.parent===EY?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}function IY(e,t){let n,r;if(t.left===EY?(r=t,n=r.right):t.right===EY?(r=t,n=r.left):(r=CY(t.right),n=r.right),r===e.root)return e.root=n,n.color=YX.Black,t.detach(),OY(),void(e.root.parent=EY);const i=r.color===YX.Red;if(r===r.parent.left?r.parent.left=n:r.parent.right=n,r===t?(n.parent=r.parent,AY(e,n)):(r.parent===t?n.parent=r:n.parent=r.parent,AY(e,n),r.left=t.left,r.right=t.right,r.parent=t.parent,r.color=t.color,t===e.root?e.root=r:t===t.parent.left?t.parent.left=r:t.parent.right=r,r.left!==EY&&(r.left.parent=r),r.right!==EY&&(r.right.parent=r),r.size_left=t.size_left,r.lf_left=t.lf_left,AY(e,r)),t.detach(),n.parent.left===n){const t=_Y(n),r=kY(n);if(t!==n.parent.size_left||r!==n.parent.lf_left){const i=t-n.parent.size_left,s=r-n.parent.lf_left;n.parent.size_left=t,n.parent.lf_left=r,RY(e,n.parent,i,s)}}if(AY(e,n.parent),i)return void OY();let s;for(;n!==e.root&&n.color===YX.Black;)n===n.parent.left?(s=n.parent.right,s.color===YX.Red&&(s.color=YX.Black,n.parent.color=YX.Red,TY(e,n.parent),s=n.parent.right),s.left.color===YX.Black&&s.right.color===YX.Black?(s.color=YX.Red,n=n.parent):(s.right.color===YX.Black&&(s.left.color=YX.Black,s.color=YX.Red,PY(e,s),s=n.parent.right),s.color=n.parent.color,n.parent.color=YX.Black,s.right.color=YX.Black,TY(e,n.parent),n=e.root)):(s=n.parent.left,s.color===YX.Red&&(s.color=YX.Black,n.parent.color=YX.Red,PY(e,n.parent),s=n.parent.left),s.left.color===YX.Black&&s.right.color===YX.Black?(s.color=YX.Red,n=n.parent):(s.left.color===YX.Black&&(s.right.color=YX.Black,s.color=YX.Red,TY(e,s),s=n.parent.left),s.color=n.parent.color,n.parent.color=YX.Black,s.left.color=YX.Black,PY(e,n.parent),n=e.root));n.color=YX.Black,OY()}function MY(e,t){for(AY(e,t);t!==e.root&&t.parent.color===YX.Red;)if(t.parent===t.parent.parent.left){const n=t.parent.parent.right;n.color===YX.Red?(t.parent.color=YX.Black,n.color=YX.Black,t.parent.parent.color=YX.Red,t=t.parent.parent):(t===t.parent.right&&TY(e,t=t.parent),t.parent.color=YX.Black,t.parent.parent.color=YX.Red,PY(e,t.parent.parent))}else{const n=t.parent.parent.left;n.color===YX.Red?(t.parent.color=YX.Black,n.color=YX.Black,t.parent.parent.color=YX.Red,t=t.parent.parent):(t===t.parent.left&&PY(e,t=t.parent),t.parent.color=YX.Black,t.parent.parent.color=YX.Red,TY(e,t.parent.parent))}e.root.color=YX.Black}function RY(e,t,n,r){for(;t!==e.root&&t!==EY;)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=r),t=t.parent}function AY(e,t){let n=0,r=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(n=_Y((t=t.parent).left)-t.size_left,r=kY(t.left)-t.lf_left,t.size_left+=n,t.lf_left+=r;t!==e.root&&(0!==n||0!==r);)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=r),t=t.parent}}var NY,DY,LY,FY,jY;EY.parent=EY,EY.left=EY,EY.right=EY,EY.color=YX.Black,function(e){e[e.None=0]="None",e[e.AsOld=1]="AsOld",e[e.AsNew=2]="AsNew"}(DY||(DY={}));class $Y{constructor(){this[NY]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:DY.None;const n=this._map.get(e);if(n)return t!==DY.None&&this.touch(n,t),n.value}set(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:DY.None,r=this._map.get(e);if(r)r.value=t,n!==DY.None&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){case DY.None:this.addItemLast(r);break;case DY.AsOld:this.addItemFirst(r);break;case DY.AsNew:default:this.addItemLast(r)}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const n=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:n.key,done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return r}values(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:n.value,done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return r}entries(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:[n.key,n.value],done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return r}[(NY=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._tail,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.previous,n--;this._tail=t,this._size=n,t&&(t.next=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(t===DY.AsOld||t===DY.AsNew)if(t===DY.AsOld){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===DY.AsNew){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push([n,t])})),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}class BY extends $Y{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:DY.AsNew;return super.get(e,t)}peek(e){return super.get(e,DY.None)}set(e,t){return super.set(e,t,DY.AsNew),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}}function VY(e){return e<0?0:e>LY.MAX_UINT_8?LY.MAX_UINT_8:0|e}!function(e){e[e.MAX_SAFE_SMALL_INTEGER=1073741824]="MAX_SAFE_SMALL_INTEGER",e[e.MIN_SAFE_SMALL_INTEGER=-1073741824]="MIN_SAFE_SMALL_INTEGER",e[e.MAX_UINT_8=255]="MAX_UINT_8",e[e.MAX_UINT_16=65535]="MAX_UINT_16",e[e.MAX_UINT_32=4294967295]="MAX_UINT_32",e[e.UNICODE_SUPPLEMENTARY_PLANE_BEGIN=65536]="UNICODE_SUPPLEMENTARY_PLANE_BEGIN"}(LY||(LY={}));class zY{constructor(e){const t=VY(e);this._defaultValue=t,this._asciiMap=zY._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const n=VY(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}!function(e){e[e.False=0]="False",e[e.True=1]="True"}(FY||(FY={}));!function(e){e[e.Regular=0]="Regular",e[e.Whitespace=1]="Whitespace",e[e.WordSeparator=2]="WordSeparator"}(jY||(jY={}));class HY extends zY{constructor(e,t){super(jY.Regular),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=new Intl.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let t=0,n=e.length;t<n;t++)this.set(e.charCodeAt(t),jY.WordSeparator);this.set(fX.Space,jY.Whitespace),this.set(fX.Tab,jY.Whitespace)}findPrevIntlWordBeforeOrAtOffset(e,t){let n=null;for(const r of this._getIntlSegmenterWordsOnLine(e)){if(r.index>t)break;n=r}return n}findNextIntlWordAtOrAfterOffset(e,t){for(const n of this._getIntlSegmenterWordsOnLine(e))if(!(n.index<t))return n;return null}_getIntlSegmenterWordsOnLine(e){return this._segmenter?(this._cachedLine===e||(this._cachedLine=e,this._cachedSegments=this._filterWordSegments(this._segmenter.segment(e))),this._cachedSegments):[]}_filterWordSegments(e){const t=[];for(const n of e)this._isWordLike(n)&&t.push(n);return t}_isWordLike(e){return!!e.isWordLike}}const UY=new class extends BY{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}}(10);class KY{constructor(e){const t=[];let n=0;for(let r=0,i=e.length;r<i;r++)e.charCodeAt(r)===fX.LineFeed&&(t[n++]=r);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let n=0,r=t.length-1;if(-1===r)return 0;if(e<=t[0])return 0;for(;n<r;){const i=n+((r-n)/2|0);t[i]>=e?r=i-1:t[i+1]>=e?(n=i,r=i):n=i+1}return n+1}}class WY{static findMatches(e,t,n,r,i){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,n,new XY(s.wordSeparators,s.regex),r,i):this._doFindMatchesLineByLine(e,n,s,r,i):[]}static _doFindMatchesMultiline(e,t,n,r,i){const s=t.getStartPosition(),o=e.getOffsetAt(s.lineNumber,s.column),a=e.getValueInRange(t,XX.LF),l="\r\n"===e.getEOL()?new KY(a):null,c=[];let d,h=0;for(n.reset(0);d=n.next(a);)if(c[h++]=YY(this._getMultilineMatchRange(e,o,a,l,d.index,d[0]),d,r),h>=i)return c;return c}static _getMultilineMatchRange(e,t,n,r,i,s){let o,a,l=0;if(r?(l=r.findLineFeedCountBeforeOffset(i),o=t+i+l):o=t+i,r){const e=r.findLineFeedCountBeforeOffset(i+s.length)-l;a=o+s.length+e}else a=o+s.length;const c=e.positionAt(o),d=e.positionAt(a);return new uY(c.lineNumber,c.column,d.lineNumber,d.column)}static _doFindMatchesLineByLine(e,t,n,r,i){const s=[];let o=0;if(t.startLineNumber===t.endLineNumber){const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);o=this._findMatchesInLine(n,a,t.startLineNumber,t.startColumn-1,o,s,r,i)}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);o=this._findMatchesInLine(n,a,t.startLineNumber,t.startColumn-1,o,s,r,i);for(let a=t.startLineNumber+1;a<t.endLineNumber&&o<i;a++)o=this._findMatchesInLine(n,e.getLineContent(a),a,0,o,s,r,i);if(o<i){const a=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);o=this._findMatchesInLine(n,a,t.endLineNumber,0,o,s,r,i)}return s}static _findMatchesInLine(e,t,n,r,i,s,o,a){const l=e.wordSeparators;if(!o&&e.simpleSearch){const o=e.simpleSearch,c=o.length,d=t.length;let h=-c;for(;-1!==(h=t.indexOf(o,h+c));)if((!l||qY(l,t,d,h,c))&&(s[i++]=new bY(new uY(n,h+1+r,n,h+1+c+r),null),i>=a))return i}const c=new XY(e.wordSeparators,e.regex);let d;c.reset(0);do{if(d=c.next(t),d&&(s[i++]=YY(new uY(n,d.index+1+r,n,d.index+1+d[0].length+r),d,o),i>=a))return i}while(d);return i}}class GY{constructor(e,t,n,r){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=r}parseSearchRequest(){if(""===this.searchString)return null;let e;e=this.isRegex?function(e){if(!e||0===e.length)return!1;for(let t=0,n=e.length;t<n;t++){const r=e.charCodeAt(t);if(r===fX.LineFeed)return!0;if(r===fX.Backslash){if(t++,t>=n)break;const r=e.charCodeAt(t);if(r===fX.n||r===fX.r||r===fX.W)return!0}}return!1}(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)throw new Error("Cannot create regex from empty string");t||(e=e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")),n.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let r="";return n.global&&(r+="g"),n.matchCase||(r+="i"),n.multiline&&(r+="m"),n.unicode&&(r+="u"),new RegExp(e,r)}(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(e){return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new wY(t,this.wordSeparators?function(e,t){const n=`${e}/${t.join(",")}`;let r=UY.get(n);return r||(r=new HY(e,t),UY.set(n,r)),r}(this.wordSeparators,[]):null,n?this.searchString:null)}}function qY(e,t,n,r,i){return function(e,t,n,r,i){if(0===r)return!0;const s=t.charCodeAt(r-1);if(e.get(s)!==jY.Regular)return!0;if(s===fX.CarriageReturn||s===fX.LineFeed)return!0;if(i>0){const n=t.charCodeAt(r);if(e.get(n)!==jY.Regular)return!0}return!1}(e,t,0,r,i)&&function(e,t,n,r,i){if(r+i===n)return!0;const s=t.charCodeAt(r+i);if(e.get(s)!==jY.Regular)return!0;if(s===fX.CarriageReturn||s===fX.LineFeed)return!0;if(i>0){const n=t.charCodeAt(r+i-1);if(e.get(n)!==jY.Regular)return!0}return!1}(e,t,n,r,i)}class XY{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t)return null;if(n=this._searchRegex.exec(e),!n)return null;const r=n.index,i=n[0].length;if(r===this._prevMatchStartIndex&&i===this._prevMatchLength){if(0===i){yX(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=i,!this._wordSeparators||qY(this._wordSeparators,e,t,r,i))return n}while(n);return null}}function YY(e,t,n){if(!n)return new bY(e,null);const r=[];for(let e=0,n=t.length;e<n;e++)r[e]=t[e];return new bY(e,r)}const ZY=65535;function JY(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class QY{constructor(e,t,n,r,i){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=r,this.isBasicASCII=i}}function eZ(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=[0];let r=1;for(let t=0,i=e.length;t<i;t++){const s=e.charCodeAt(t);s===fX.CarriageReturn?t+1<i&&e.charCodeAt(t+1)===fX.LineFeed?(n[r++]=t+2,t++):n[r++]=t+1:s===fX.LineFeed&&(n[r++]=t+1)}return t?JY(n):n}class tZ{constructor(e,t,n,r,i){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=r,this.length=i}}class nZ{constructor(e,t){this.buffer=e,this.lineStarts=t}}class rZ{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==EY&&e.iterate(e.root,(e=>(e!==EY&&this._pieces.push(e.piece),!0)))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class iZ{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber<e&&n.nodeStartLineNumber+n.node.piece.lineFeedCnt>=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const n=this._cache;for(let r=0;r<n.length;r++){const i=n[r];(null===i.node.parent||i.nodeStartOffset>=e)&&(n[r]=null,t=!0)}if(t){const e=[];for(const t of n)null!==t&&e.push(t);this._cache=e}}}class sZ{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new nZ("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=EY,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let r=null;for(let t=0,n=e.length;t<n;t++)if(e[t].buffer.length>0){e[t].lineStarts||(e[t].lineStarts=eZ(e[t].buffer));const n=new tZ(t+1,{line:0,column:0},{line:e[t].lineStarts.length-1,column:e[t].buffer.length-e[t].lineStarts[e[t].lineStarts.length-1]},e[t].lineStarts.length-1,e[t].buffer.length);this._buffers.push(e[t]),r=this.rbInsertRight(r,n)}this._searchCache=new iZ(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=ZY,n=t-Math.floor(21845),r=2*n;let i="",s=0;const o=[];if(this.iterate(this.root,(t=>{const a=this.getNodeContent(t),l=a.length;if(s<=n||s+l<r)return i+=a,s+=l,!0;const c=i.replace(/\r\n|\r|\n/g,e);return o.push(new nZ(c,eZ(c))),i=a,s=l,!0})),s>0){const t=i.replace(/\r\n|\r|\n/g,e);o.push(new nZ(t,eZ(t)))}this.create(o,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new rZ(this,e)}equal(e){if(this.getLength()!==e.getLength())return!1;if(this.getLineCount()!==e.getLineCount())return!1;let t=0;const n=this.iterate(this.root,(n=>{if(n===EY)return!0;const r=this.getNodeContent(n),i=r.length,s=e.nodeAt(t),o=e.nodeAt(t+i),a=e.getValueInRange2(s,o);return t+=i,r===a}));return n}getOffsetAt(e,t){let n=0,r=this.root;for(;r!==EY;)if(r.left!==EY&&r.lf_left+1>=e)r=r.left;else{if(r.lf_left+r.piece.lineFeedCnt+1>=e){n+=r.size_left;return n+(this.getAccumulatedValue(r,e-r.lf_left-2)+t-1)}e-=r.lf_left+r.piece.lineFeedCnt,n+=r.size_left+r.piece.length,r=r.right}return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0;const r=e;for(;t!==EY;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){const i=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+i.index,0===i.index){const e=this.getOffsetAt(n+1,1);return new hY(n+1,r-e+1)}return new hY(n+1,i.remainder+1)}if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===EY){const t=this.getOffsetAt(n+1,1);return new hY(n+1,r-e-t+1)}t=t.right}return new hY(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const n=this.nodeAt2(e.startLineNumber,e.startColumn),r=this.nodeAt2(e.endLineNumber,e.endColumn),i=this.getValueInRange2(n,r);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?i:i.replace(/\r\n|\r|\n/g,t):i}getValueInRange2(e,t){if(e.node===t.node){const n=e.node,r=this._buffers[n.piece.bufferIndex].buffer,i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r.substring(i+e.remainder,i+t.remainder)}let n=e.node;const r=this._buffers[n.piece.bufferIndex].buffer,i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);let s=r.substring(i+e.remainder,i+n.piece.length);for(n=n.next();n!==EY;){const e=this._buffers[n.piece.bufferIndex].buffer,r=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){s+=e.substring(r,r+t.remainder);break}s+=e.substr(r,n.piece.length),n=n.next()}return s}getLinesContent(){const e=[];let t=0,n="",r=!1;return this.iterate(this.root,(i=>{if(i===EY)return!0;const s=i.piece;let o=s.length;if(0===o)return!0;const a=this._buffers[s.bufferIndex].buffer,l=this._buffers[s.bufferIndex].lineStarts,c=s.start.line,d=s.end.line;let h=l[c]+s.start.column;if(r&&(a.charCodeAt(h)===fX.LineFeed&&(h++,o--),e[t++]=n,n="",r=!1,0===o))return!0;if(c===d)return this._EOLNormalized||a.charCodeAt(h+o-1)!==fX.CarriageReturn?n+=a.substr(h,o):(r=!0,n+=a.substr(h,o-1)),!0;n+=this._EOLNormalized?a.substring(h,Math.max(h,l[c+1]-this._EOLLength)):a.substring(h,l[c+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;for(let r=c+1;r<d;r++)n=this._EOLNormalized?a.substring(l[r],l[r+1]-this._EOLLength):a.substring(l[r],l[r+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;return this._EOLNormalized||a.charCodeAt(l[d]+s.end.column-1)!==fX.CarriageReturn?n=a.substr(l[d],s.end.column):(r=!0,0===s.end.column?t--:n=a.substr(l[d],s.end.column-1)),!0})),r&&(e[t++]=n,n=""),e[t++]=n,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e||(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,"")),this._lastVisitedLine.value}_getCharCode(e){if(e.remainder===e.node.piece.length){const t=e.node.next();if(!t)return 0;const n=this._buffers[t.piece.bufferIndex],r=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return n.buffer.charCodeAt(r)}{const t=this._buffers[e.node.piece.bufferIndex],n=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(n)}}getLineCharCode(e,t){const n=this.nodeAt2(e,t+1);return this._getCharCode(n)}getLineLength(e){if(e===this.getLineCount()){const t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}getCharCode(e){const t=this.nodeAt(e);return this._getCharCode(t)}getNearestChunk(e){const t=this.nodeAt(e);if(t.remainder===t.node.piece.length){const e=t.node.next();if(!e||e===EY)return"";const n=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start);return n.buffer.substring(r,r+e.piece.length)}{const e=this._buffers[t.node.piece.bufferIndex],n=this.offsetInBuffer(t.node.piece.bufferIndex,t.node.piece.start),r=n+t.remainder,i=n+t.node.piece.length;return e.buffer.substring(r,i)}}findMatchesInNode(e,t,n,r,i,s,o,a,l,c,d){const h=this._buffers[e.piece.bufferIndex],u=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),p=this.offsetInBuffer(e.piece.bufferIndex,i),f=this.offsetInBuffer(e.piece.bufferIndex,s);let m;const g={line:0,column:0};let y,v;t._wordSeparators?(y=h.buffer.substring(p,f),v=e=>e+p,t.reset(0)):(y=h.buffer,v=e=>e,t.reset(p));do{if(m=t.next(y),m){if(v(m.index)>=f)return c;this.positionInBuffer(e,v(m.index)-u,g);const t=this.getLineFeedCnt(e.piece.bufferIndex,i,g),s=g.line===i.line?g.column-i.column+r:g.column+1,o=s+m[0].length;if(d[c++]=YY(new uY(n+t,s,n+t,o),m,a),v(m.index)+m[0].length>=f)return c;if(c>=l)return c}}while(m);return c}findMatchesLineByLine(e,t,n,r){const i=[];let s=0;const o=new XY(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let c=this.positionInBuffer(a.node,a.remainder);const d=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,o,e.startLineNumber,e.startColumn,c,d,t,n,r,s,i),i;let h=e.startLineNumber,u=a.node;for(;u!==l.node;){const l=this.getLineFeedCnt(u.piece.bufferIndex,c,u.piece.end);if(l>=1){const a=this._buffers[u.piece.bufferIndex].lineStarts,d=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),p=a[c.line+l],f=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(u,o,h,f,c,this.positionInBuffer(u,p-d),t,n,r,s,i),s>=r)return i;h+=l}const d=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const a=this.getLineContent(h).substring(d,e.endColumn-1);return s=this._findMatchesInLine(t,o,a,e.endLineNumber,d,s,i,n,r),i}if(s=this._findMatchesInLine(t,o,this.getLineContent(h).substr(d),h,d,s,i,n,r),s>=r)return i;h++,a=this.nodeAt2(h,1),u=a.node,c=this.positionInBuffer(a.node,a.remainder)}if(h===e.endLineNumber){const a=h===e.startLineNumber?e.startColumn-1:0,l=this.getLineContent(h).substring(a,e.endColumn-1);return s=this._findMatchesInLine(t,o,l,e.endLineNumber,a,s,i,n,r),i}const p=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(l.node,o,h,p,c,d,t,n,r,s,i),i}_findMatchesInLine(e,t,n,r,i,s,o,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,d=n.length;let h=-a;for(;-1!==(h=n.indexOf(t,h+a));)if((!c||qY(c,n,d,h,a))&&(o[s++]=new bY(new uY(r,h+1+i,r,h+1+a+i),null),s>=l))return s;return s}let d;t.reset(0);do{if(d=t.next(n),d&&(o[s++]=YY(new uY(r,d.index+1+i,r,d.index+1+d[0].length+i),d,a),s>=l))return s}while(d);return s}insert(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==EY){const{node:n,remainder:r,nodeStartOffset:i}=this.nodeAt(e),s=n.piece,o=s.bufferIndex,a=this.positionInBuffer(n,r);if(0===n.piece.bufferIndex&&s.end.line===this._lastChangeBufferPos.line&&s.end.column===this._lastChangeBufferPos.column&&i+s.length===e&&t.length<ZY)return this.appendToNode(n,t),void this.computeBufferMetadata();if(i===e)this.insertContentToNodeLeft(t,n),this._searchCache.validate(e);else if(i+n.piece.length>e){const e=[];let i=new tZ(s.bufferIndex,a,s.end,this.getLineFeedCnt(s.bufferIndex,a,s.end),this.offsetInBuffer(o,s.end)-this.offsetInBuffer(o,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)){if(10===this.nodeCharCodeAt(n,r)){const e={line:i.start.line+1,column:0};i=new tZ(i.bufferIndex,e,i.end,this.getLineFeedCnt(i.bufferIndex,e,i.end),i.length-1),t+="\n"}}if(this.shouldCheckCRLF()&&this.startWithLF(t)){if(13===this.nodeCharCodeAt(n,r-1)){const i=this.positionInBuffer(n,r-1);this.deleteNodeTail(n,i),t="\r"+t,0===n.piece.length&&e.push(n)}else this.deleteNodeTail(n,a)}else this.deleteNodeTail(n,a);const l=this.createNewPieces(t);i.length>0&&this.rbInsertRight(n,i);let c=n;for(let e=0;e<l.length;e++)c=this.rbInsertRight(c,l[e]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,n)}else{const e=this.createNewPieces(t);let n=this.rbInsertLeft(null,e[0]);for(let t=1;t<e.length;t++)n=this.rbInsertRight(n,e[t])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===EY)return;const n=this.nodeAt(e),r=this.nodeAt(e+t),i=n.node,s=r.node;if(i===s){const s=this.positionInBuffer(i,n.remainder),o=this.positionInBuffer(i,r.remainder);if(n.nodeStartOffset===e){if(t===i.piece.length){const e=i.next();return IY(this,i),this.validateCRLFWithPrevNode(e),void this.computeBufferMetadata()}return this.deleteNodeHead(i,o),this._searchCache.validate(e),this.validateCRLFWithPrevNode(i),void this.computeBufferMetadata()}return n.nodeStartOffset+i.piece.length===e+t?(this.deleteNodeTail(i,s),this.validateCRLFWithNextNode(i),void this.computeBufferMetadata()):(this.shrinkNode(i,s,o),void this.computeBufferMetadata())}const o=[],a=this.positionInBuffer(i,n.remainder);this.deleteNodeTail(i,a),this._searchCache.validate(e),0===i.piece.length&&o.push(i);const l=this.positionInBuffer(s,r.remainder);this.deleteNodeHead(s,l),0===s.piece.length&&o.push(s);for(let e=i.next();e!==EY&&e!==s;e=e.next())o.push(e);const c=0===i.piece.length?i.prev():i;this.deleteNodes(o),this.validateCRLFWithNextNode(c),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const n=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const r=t.piece,i={line:r.start.line+1,column:0},s=new tZ(r.bufferIndex,i,r.end,this.getLineFeedCnt(r.bufferIndex,i,r.end),r.length-1);t.piece=s,e+="\n",RY(this,t,-1,-1),0===t.piece.length&&n.push(t)}const r=this.createNewPieces(e);let i=this.rbInsertLeft(t,r[r.length-1]);for(let e=r.length-2;e>=0;e--)i=this.rbInsertLeft(i,r[e]);this.validateCRLFWithPrevNode(i),this.deleteNodes(n)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");const n=this.createNewPieces(e),r=this.rbInsertRight(t,n[0]);let i=r;for(let e=1;e<n.length;e++)i=this.rbInsertRight(i,n[e]);this.validateCRLFWithPrevNode(r)}positionInBuffer(e,t,n){const r=e.piece,i=e.piece.bufferIndex,s=this._buffers[i].lineStarts,o=s[r.start.line]+r.start.column+t;let a=r.start.line,l=r.end.line,c=0,d=0,h=0;for(;a<=l&&(c=a+(l-a)/2|0,h=s[c],c!==l);)if(d=s[c+1],o<h)l=c-1;else{if(!(o>=d))break;a=c+1}return n?(n.line=c,n.column=o-h,null):{line:c,column:o-h}}getLineFeedCnt(e,t,n){if(0===n.column)return n.line-t.line;const r=this._buffers[e].lineStarts;if(n.line===r.length-1)return n.line-t.line;const i=r[n.line+1],s=r[n.line]+n.column;if(i>s+1)return n.line-t.line;const o=s-1;return 13===this._buffers[e].buffer.charCodeAt(o)?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)IY(this,e[t])}createNewPieces(e){if(e.length>ZY){const t=[];for(;e.length>ZY;){const n=e.charCodeAt(65534);let r;n===fX.CarriageReturn||n>=55296&&n<=56319?(r=e.substring(0,65534),e=e.substring(65534)):(r=e.substring(0,ZY),e=e.substring(ZY));const i=eZ(r);t.push(new tZ(this._buffers.length,{line:0,column:0},{line:i.length-1,column:r.length-i[i.length-1]},i.length-1,r.length)),this._buffers.push(new nZ(r,i))}const n=eZ(e);return t.push(new tZ(this._buffers.length,{line:0,column:0},{line:n.length-1,column:e.length-n[n.length-1]},n.length-1,e.length)),this._buffers.push(new nZ(e,n)),t}let t=this._buffers[0].buffer.length;const n=eZ(e,!1);let r=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},r=this._lastChangeBufferPos;for(let e=0;e<n.length;e++)n[e]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(n.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(0!==t)for(let e=0;e<n.length;e++)n[e]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(n.slice(1)),this._buffers[0].buffer+=e}const i=this._buffers[0].buffer.length,s=this._buffers[0].lineStarts.length-1,o={line:s,column:i-this._buffers[0].lineStarts[s]},a=new tZ(0,r,o,this.getLineFeedCnt(0,r,o),i-t);return this._lastChangeBufferPos=o,[a]}getLinesRawContent(){return this.getContentOfSubTree(this.root)}getLineRawContent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.root,r="";const i=this._searchCache.get2(e);if(i){n=i.node;const s=this.getAccumulatedValue(n,e-i.nodeStartLineNumber-1),o=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(i.nodeStartLineNumber+n.piece.lineFeedCnt!==e){const r=this.getAccumulatedValue(n,e-i.nodeStartLineNumber);return o.substring(a+s,a+r-t)}r=o.substring(a+s,a+n.piece.length)}else{let i=0;const s=e;for(;n!==EY;)if(n.left!==EY&&n.lf_left>=e-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>e-1){const r=this.getAccumulatedValue(n,e-n.lf_left-2),o=this.getAccumulatedValue(n,e-n.lf_left-1),a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:i,nodeStartLineNumber:s-(e-1-n.lf_left)}),a.substring(l+r,l+o-t)}if(n.lf_left+n.piece.lineFeedCnt===e-1){const t=this.getAccumulatedValue(n,e-n.lf_left-2),i=this._buffers[n.piece.bufferIndex].buffer,s=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r=i.substring(s+t,s+n.piece.length);break}e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}}for(n=n.next();n!==EY;){const e=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){const i=this.getAccumulatedValue(n,0),s=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r+=e.substring(s,s+i-t),r}{const t=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r+=e.substr(t,n.piece.length)}n=n.next()}return r}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==EY;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){const n=e.piece,r=this.positionInBuffer(e,t),i=r.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){const t=this.getLineFeedCnt(e.piece.bufferIndex,n.start,r);if(t!==i)return{index:t,remainder:0}}return{index:i,remainder:r.column}}getAccumulatedValue(e,t){if(t<0)return 0;const n=e.piece,r=this._buffers[n.bufferIndex].lineStarts,i=n.start.line+t+1;return i>n.end.line?r[n.end.line]+n.end.column-r[n.start.line]-n.start.column:r[i]-r[n.start.line]-n.start.column}deleteNodeTail(e,t){const n=e.piece,r=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.end),s=t,o=this.offsetInBuffer(n.bufferIndex,s),a=this.getLineFeedCnt(n.bufferIndex,n.start,s),l=a-r,c=o-i,d=n.length+c;e.piece=new tZ(n.bufferIndex,n.start,s,a,d),RY(this,e,c,l)}deleteNodeHead(e,t){const n=e.piece,r=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.start),s=t,o=this.getLineFeedCnt(n.bufferIndex,s,n.end),a=o-r,l=i-this.offsetInBuffer(n.bufferIndex,s),c=n.length+l;e.piece=new tZ(n.bufferIndex,s,n.end,o,c),RY(this,e,l,a)}shrinkNode(e,t,n){const r=e.piece,i=r.start,s=r.end,o=r.length,a=r.lineFeedCnt,l=t,c=this.getLineFeedCnt(r.bufferIndex,r.start,l),d=this.offsetInBuffer(r.bufferIndex,t)-this.offsetInBuffer(r.bufferIndex,i);e.piece=new tZ(r.bufferIndex,r.start,l,c,d),RY(this,e,d-o,c-a);const h=new tZ(r.bufferIndex,n,s,this.getLineFeedCnt(r.bufferIndex,n,s),this.offsetInBuffer(r.bufferIndex,s)-this.offsetInBuffer(r.bufferIndex,n)),u=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(u)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),r=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const i=eZ(t,!1);for(let e=0;e<i.length;e++)i[e]+=r;if(n){const e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:r-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1));const s=this._buffers[0].lineStarts.length-1,o={line:s,column:this._buffers[0].buffer.length-this._buffers[0].lineStarts[s]},a=e.piece.length+t.length,l=e.piece.lineFeedCnt,c=this.getLineFeedCnt(0,e.piece.start,o),d=c-l;e.piece=new tZ(e.piece.bufferIndex,e.piece.start,o,c,a),this._lastChangeBufferPos=o,RY(this,e,t.length,d)}nodeAt(e){let t=this.root;const n=this._searchCache.get(e);if(n)return{node:n.node,nodeStartOffset:n.nodeStartOffset,remainder:e-n.nodeStartOffset};let r=0;for(;t!==EY;)if(t.size_left>e)t=t.left;else{if(t.size_left+t.piece.length>=e){r+=t.size_left;const n={node:t,remainder:e-t.size_left,nodeStartOffset:r};return this._searchCache.set(n),n}e-=t.size_left+t.piece.length,r+=t.size_left+t.piece.length,t=t.right}return null}nodeAt2(e,t){let n=this.root,r=0;for(;n!==EY;)if(n.left!==EY&&n.lf_left>=e-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>e-1){const i=this.getAccumulatedValue(n,e-n.lf_left-2),s=this.getAccumulatedValue(n,e-n.lf_left-1);return r+=n.size_left,{node:n,remainder:Math.min(i+t-1,s),nodeStartOffset:r}}if(n.lf_left+n.piece.lineFeedCnt===e-1){const i=this.getAccumulatedValue(n,e-n.lf_left-2);if(i+t-1<=n.piece.length)return{node:n,remainder:i+t-1,nodeStartOffset:r};t-=n.piece.length-i;break}e-=n.lf_left+n.piece.lineFeedCnt,r+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==EY;){if(n.piece.lineFeedCnt>0){const e=this.getAccumulatedValue(n,0),r=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,e),nodeStartOffset:r}}if(n.piece.length>=t-1){return{node:n,remainder:t-1,nodeStartOffset:this.offsetOfNode(n)}}t-=n.piece.length,n=n.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const n=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(r)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===EY||0===e.piece.lineFeedCnt)return!1;const t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,r=t.start.line,i=n[r]+t.start.column;if(r===n.length-1)return!1;return!(n[r+1]>i+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(i)}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==EY&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const n=[],r=this._buffers[e.piece.bufferIndex].lineStarts;let i;i=0===e.piece.end.column?{line:e.piece.end.line-1,column:r[e.piece.end.line]-r[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,o=e.piece.lineFeedCnt-1;e.piece=new tZ(e.piece.bufferIndex,e.piece.start,i,o,s),RY(this,e,-1,-1),0===e.piece.length&&n.push(e);const a={line:t.piece.start.line+1,column:0},l=t.piece.length-1,c=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new tZ(t.piece.bufferIndex,a,t.piece.end,c,l),RY(this,t,-1,-1),0===t.piece.length&&n.push(t);const d=this.createNewPieces("\r\n");this.rbInsertRight(e,d[0]);for(let e=0;e<n.length;e++)IY(this,n[e])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const n=t.next();if(this.startWithLF(n)){if(e+="\n",1===n.piece.length)IY(this,n);else{const e=n.piece,t={line:e.start.line+1,column:0},r=e.length-1,i=this.getLineFeedCnt(e.bufferIndex,t,e.end);n.piece=new tZ(e.bufferIndex,t,e.end,i,r),RY(this,n,-1,-1)}return!0}}return!1}iterate(e,t){if(e===EY)return t(EY);const n=this.iterate(e.left,t);return n?t(e)&&this.iterate(e.right,t):n}getNodeContent(e){if(e===EY)return"";const t=this._buffers[e.piece.bufferIndex],n=e.piece,r=this.offsetInBuffer(n.bufferIndex,n.start),i=this.offsetInBuffer(n.bufferIndex,n.end);return t.buffer.substring(r,i)}getPieceContent(e){const t=this._buffers[e.bufferIndex],n=this.offsetInBuffer(e.bufferIndex,e.start),r=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(n,r)}rbInsertRight(e,t){const n=new xY(t,YX.Red);n.left=EY,n.right=EY,n.parent=EY,n.size_left=0,n.lf_left=0;if(this.root===EY)this.root=n,n.color=YX.Black;else if(e.right===EY)e.right=n,n.parent=e;else{const t=CY(e.right);t.left=n,n.parent=t}return MY(this,n),n}rbInsertLeft(e,t){const n=new xY(t,YX.Red);if(n.left=EY,n.right=EY,n.parent=EY,n.size_left=0,n.lf_left=0,this.root===EY)this.root=n,n.color=YX.Black;else if(e.left===EY)e.left=n,n.parent=e;else{const t=SY(e.left);t.right=n,n.parent=t}return MY(this,n),n}getContentOfSubTree(e){let t="";return this.iterate(e,(e=>(t+=this.getNodeContent(e),!0))),t}}const oZ=String.fromCharCode(fX.UTF8_BOM);var aZ;!function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(aZ||(aZ={}));class lZ{constructor(e,t,n,r,i,s){this._chunks=e,this._bom=t,this._cr=n,this._lf=r,this._crlf=i,this._normalizeEOL=s}_getEOL(e){const t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return 0===t?e===aZ.LF?"\n":"\r\n":n>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let e=0,r=n.length;e<r;e++){const r=n[e].buffer.replace(/\r\n|\r|\n/g,t),i=eZ(r);n[e]=new nZ(r,i)}return new sZ(n,t,this._normalizeEOL)}getFirstLineText(e){return this._chunks[0].buffer.substr(0,100).split(/\r\n|\r|\n/)[0]}}class cZ{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0}acceptChunk(e){if(0===e.length)return;var t;0===this.chunks.length&&(t=e)&&t.length>0&&t.charCodeAt(0)===fX.UTF8_BOM&&(this.BOM=oZ,e=e.substr(1));const n=e.charCodeAt(e.length-1);n===fX.CarriageReturn||n>=55296&&n<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=n):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=n)}_acceptChunk1(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=function(e,t){e.length=0,e[0]=0;let n=1,r=0,i=0,s=0,o=!0;for(let a=0,l=t.length;a<l;a++){const c=t.charCodeAt(a);c===fX.CarriageReturn?a+1<l&&t.charCodeAt(a+1)===fX.LineFeed?(s++,e[n++]=a+2,a++):(r++,e[n++]=a+1):c===fX.LineFeed?(i++,e[n++]=a+1):o&&c!==fX.Tab&&(c<32||c>126)&&(o=!1)}const a=new QY(JY(e),r,i,s,o);return e.length=0,a}(this._tmpLineStarts,e);this.chunks.push(new nZ(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf}finish(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._finish(),new lZ(this.chunks,this.BOM,this.cr,this.lf,this.crlf,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=eZ(e.buffer);e.lineStarts=t,this._previousChar===fX.CarriageReturn&&this.cr++}}}const dZ="object"==typeof self&&self.constructor&&"DedicatedWorkerGlobalScope"===self.constructor.name;function hZ(){return dZ}class uZ{constructor(e,t){this.model=e,this.operation=t,this.oldPos=Object.assign({},e.lastChangeBufferPos),this.model.updateLastChangeBufferPos(t),this.newPos=Object.assign({},e.lastChangeBufferPos)}updateBufferPos(e){this.model.lastChangeBufferPos=Object.assign({},e?this.oldPos:this.newPos)}}class pZ extends uZ{execute(){this.model.pieceTree.insert(this.operation.rangeOffset,this.operation.newText),this.updateBufferPos(!1)}undo(){this.model.pieceTree.delete(this.operation.rangeOffset,this.operation.newText.length),this.updateBufferPos(!0)}}class fZ extends uZ{execute(){this.model.pieceTree.delete(this.operation.rangeOffset,this.operation.rangeLength),this.updateBufferPos(!1)}undo(){this.model.pieceTree.insert(this.operation.rangeOffset,this.operation.oldText),this.updateBufferPos(!0)}}class mZ extends uZ{execute(){this.model.pieceTree.delete(this.operation.rangeOffset,this.operation.oldText.length),this.model.pieceTree.insert(this.operation.rangeOffset,this.operation.newText),this.updateBufferPos(!1)}undo(){this.model.pieceTree.delete(this.operation.rangeOffset,this.operation.newText.length),this.model.pieceTree.insert(this.operation.rangeOffset,this.operation.oldText),this.updateBufferPos(!0)}}class gZ{constructor(e,t){this.model=e,this.operation=t,this.oldPos=Object.assign({},e.lastChangeBufferPos),this.newPos=Object.assign({},e.lastChangeBufferPos)}execute(){for(let e=0;e<this.operation.length;e++){const t=this.operation[e];switch(t.type){case"insert":this.model.pieceTree.insert(t.rangeOffset,t.newText);break;case"delete":this.model.pieceTree.delete(t.rangeOffset,t.rangeLength);break;case"replace":this.model.pieceTree.delete(t.rangeOffset,t.oldText.length),this.model.pieceTree.insert(t.rangeOffset,t.newText)}}this.model.lastChangeBufferPos=Object.assign({},this.newPos)}undo(){for(let e=this.operation.length-1;e>=0;e--){const t=this.operation[e];t.newText&&t.oldText?(this.model.pieceTree.delete(t.rangeOffset,t.newText.length),this.model.pieceTree.insert(t.rangeOffset,t.oldText)):t.newText?this.model.pieceTree.delete(t.rangeOffset,t.newText.length):this.model.pieceTree.insert(t.rangeOffset,t.oldText)}this.model.lastChangeBufferPos=Object.assign({},this.oldPos)}}class yZ{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._undoStack=[],this._redoStack=[],this.MAX_STACK_SIZE=20,this.lastChangeBufferPos={lineNumber:1,column:1},this._jsonWorkerManager=null,this.emitter=null,this._normalizeEOL=t,this._pieceTree=this.createTextBuffer(e),hZ()||(this._jsonWorkerManager=aX(),this.emitter=nX())}get pieceTree(){return this._pieceTree}createTextBufferFactory(e){const t=new cZ;return t.acceptChunk(e),t.finish(this._normalizeEOL)}createTextBuffer(e){return this.createTextBufferFactory(e).create(aZ.LF)}getLineCount(){return this._pieceTree.getLineCount()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineLength(e){return this._pieceTree.getLineLength(e)}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}positionAt(e){return e=Math.min(this._pieceTree.getLength(),Math.max(0,e)),this._pieceTree.getPositionAt(e)}_createCommand(e){if(Array.isArray(e))return new gZ(this,e);switch(e.type){case"insert":return new pZ(this,e);case"delete":return new fZ(this,e);case"replace":return new mZ(this,e);default:throw new Error("Unknown operation type")}}applyOperation(e){var t;this._redoStack=[];const n=this._createCommand(e);this.pushUndoStack(n),n.execute(),hZ()||null===(t=this.emitter)||void 0===t||t.emit("contentChanged",e),this._jsonWorkerManager&&this._jsonWorkerManager.updateModel(e).then((e=>{var t;return null===(t=this._jsonWorkerManager)||void 0===t?void 0:t.validate()})).then((e=>{var t;null===(t=this.emitter)||void 0===t||t.emit("problemsChanged",{problems:e.problems,root:e.root})}))}updateLastChangeBufferPos(e){if(e.keepPosition)return void(this.lastChangeBufferPos=e.keepPosition);const t=(e,t,n)=>{const r=n.split(/\r\n|\r|\n/),i=r.length-1;return 0===i?{lineNumber:e,column:t+n.length}:{lineNumber:e+i,column:r[r.length-1].length+1}};switch(e.type){case"insert":case"replace":this.lastChangeBufferPos=t(e.range.startLineNumber,e.range.startColumn,e.newText);break;case"delete":if(1===this.lastChangeBufferPos.column)this.lastChangeBufferPos.lineNumber-=1,this.lastChangeBufferPos.column=this.getLineLength(this.lastChangeBufferPos.lineNumber)+1;else{const t=e.range.startColumn,n=1===e.rangeLength?t-1:t;this.lastChangeBufferPos.column=n}}}pushUndoStack(e){this._undoStack.push(e),this._undoStack.length>this.MAX_STACK_SIZE&&this._undoStack.shift()}pushRedoStack(e){this._redoStack.push(e),this._redoStack.length>this.MAX_STACK_SIZE&&this._redoStack.shift()}canUndo(){return this._undoStack.length>0}canRedo(){return this._redoStack.length>0}undo(){var e;if(!this.canUndo())return;const t=this._undoStack.pop();t.undo(),this._redoStack.push(t),hZ()||null===(e=this.emitter)||void 0===e||e.emit("contentChanged",t.operation),this._jsonWorkerManager&&this._jsonWorkerManager.undo().then((e=>{var t;return null===(t=this._jsonWorkerManager)||void 0===t?void 0:t.validate()})).then((e=>{var t;null===(t=this.emitter)||void 0===t||t.emit("problemsChanged",{problems:e.problems,root:e.root})}))}redo(){var e;if(!this.canRedo())return;const t=this._redoStack.pop();t.execute(),this._undoStack.push(t),hZ()||null===(e=this.emitter)||void 0===e||e.emit("contentChanged",t.operation),this._jsonWorkerManager&&this._jsonWorkerManager.redo().then((e=>{var t;return null===(t=this._jsonWorkerManager)||void 0===t?void 0:t.validate()})).then((e=>{var t;null===(t=this.emitter)||void 0===t||t.emit("problemsChanged",{problems:e.problems,root:e.root})}))}getValue(){return this._pieceTree.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:this._pieceTree.getLineCount(),endColumn:this._pieceTree.getLineContent(this._pieceTree.getLineCount()).length+1})}setValue(e){const t=new cZ;t.acceptChunk(e),this._pieceTree=t.finish(this._normalizeEOL).create(1)}getEOL(){return this._pieceTree.getEOL()}_getEndOfLine(e){switch(e){case XX.LF:return"\n";case XX.CRLF:return"\r\n";case XX.TextDefined:return this.getEOL();default:throw new Error("Unknown EOL preference")}}getValueInRange(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:XX.TextDefined;return this._pieceTree.getValueInRange(e,this._getEndOfLine(t))}getFullModelRange(){const e=this.getLineCount();return new uY(1,1,e,this.getLineLength(e)+1)}findMatchesLineByLine(e,t,n,r){return this._pieceTree.findMatchesLineByLine(e,t,n,r)}findMatches(e,t,n,r,i,s){let o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1/0,a=null;null===a&&(a=[this.getFullModelRange()]),a=a.sort(((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn));const l=[];let c;if(l.push(a.reduce(((e,t)=>uY.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t)))),!n&&e.indexOf("\n")<0){const t=new GY(e,n,r,i).parseSearchRequest();if(!t)return[];c=e=>this.findMatchesLineByLine(e,t,s,o)}else c=t=>WY.findMatches(this,new GY(e,n,r,i),t,s,o);return l.map(c).reduce(((e,t)=>e.concat(t)),[])}isStartPosition(){const{lineNumber:e,column:t}=this.lastChangeBufferPos;return 1===e&&1===t}}class vZ{constructor(e,t,n){var r;this._jsonWorkerManager=null,this._id=`jsonviewer-${Math.random().toString(36).substr(2,9)}`,r=this._id,Jq=r,this.emitter=nX(),this._container=e,this._jsonModel=function(e){return new yZ(e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1])}(t),this._jsonWorkerManager=aX(),this._jsonWorkerManager.init(t),this._view=new vY(e,this._jsonModel,n)}layout(){this._view.layout()}getModel(){return this._jsonModel}getSearchWidget(){return this._view.searchWidget}format(){this._view.editWidget.format()}dispose(){(e=>{const t=eX.get(e);t&&(t.dispose(),eX.delete(e))})(this._id),function(e){const t=sX.get(e);t&&(sX.delete(e),t.dispose())}(this._id),this._view.dispose()}}const bZ={PREFIX:`${C}-json-viewer`};class wZ extends c{constructor(e){super(Object.assign(Object.assign({},wZ),e)),this.jsonViewer=null}init(){const e=this.getProps(),t=this._adapter.getEditorRef();this.jsonViewer=new vZ(t,e.value,Object.assign({prefixCls:bZ.PREFIX},e.options)),this.jsonViewer.emitter.on("customRender",(e=>{this._adapter.notifyCustomRender(e.customRenderMap)})),this.jsonViewer.layout(),this.jsonViewer.emitter.on("contentChanged",(e=>{var t;this._adapter.notifyChange(null===(t=this.jsonViewer)||void 0===t?void 0:t.getModel().getValue()),this.getState("showSearchBar")&&this.search(this._adapter.getSearchRef().value)}))}search(e,t,n,r){var i;let s;s=void 0!==t||void 0!==n||void 0!==r?{caseSensitive:null!=t&&t,wholeWord:null!=n&&n,regex:null!=r&&r}:this.getState("searchOptions");const{caseSensitive:o,wholeWord:a,regex:l}=s;null===(i=this.jsonViewer)||void 0===i||i.getSearchWidget().search(e,o,a,l)}prevSearch(e){var t,n;void 0===e?null===(t=this.jsonViewer)||void 0===t||t.getSearchWidget().navigateResults(-1):null===(n=this.jsonViewer)||void 0===n||n.getSearchWidget().navigateResults(-e)}nextSearch(e){var t,n;void 0===e?null===(t=this.jsonViewer)||void 0===t||t.getSearchWidget().navigateResults(1):null===(n=this.jsonViewer)||void 0===n||n.getSearchWidget().navigateResults(e)}replace(e){var t;this.getProps().options.readOnly||null===(t=this.jsonViewer)||void 0===t||t.getSearchWidget().replace(e)}replaceAll(e){var t;this.getProps().options.readOnly||null===(t=this.jsonViewer)||void 0===t||t.getSearchWidget().replaceAll(e)}setSearchOptions(e){this._adapter.setSearchOptions(e)}showSearchBar(){this._adapter.showSearchBar()}getSearchResults(){var e;return null===(e=this.jsonViewer)||void 0===e?void 0:e.getSearchWidget().searchResults}}const xZ=wZ;__webpack_require__("SBJh");function EZ(e,t,n){return Math.min(Math.max(e,t),n)}class CZ extends c{get constrainer(){return this._adapter.getConstrainer()}get handler(){return this._adapter.getHandler()}constructor(e){super(Object.assign({},e)),this.updatePositionStrategy=()=>{this.element.style.position="relative"===this.getProp("positionStrategy")?"relative":"absolute"},this._registerStartEvent=()=>{this.handler.addEventListener("mousedown",this.onMouseDown),this.handler.addEventListener("touchstart",this.onTouchStart)},this._unRegisterStartEvent=()=>{this.handler.removeEventListener("mousedown",this.onMouseDown),this.handler.removeEventListener("touchstart",this.onTouchStart)},this._registerDocMouseEvent=()=>{document.addEventListener("mousemove",this._onMouseMove),document.addEventListener("mouseup",this._onMouseUp)},this._unRegisterDocMouseEvent=()=>{document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp)},this._registerDocTouchEvent=()=>{document.addEventListener("touchend",this._onTouchEnd),document.addEventListener("touchmove",this._onTouchMove),document.addEventListener("touchcancel",this._onTouchCancel)},this._unRegisterDocTouchEvent=()=>{document.removeEventListener("touchend",this._onTouchEnd),document.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("touchcancel",this._onTouchCancel)},this._calcOffset=e=>{if("relative"===this.getProp("positionStrategy")){const t=window.getComputedStyle(this.element);return this.startClientX=e.clientX,this.startClientY=e.clientY,this.startLeft=parseFloat(t.left)||0,void(this.startTop=parseFloat(t.top)||0)}this.startOffsetX=e.clientX-this.element.offsetLeft,this.startOffsetY=e.clientY-this.element.offsetTop},this._preventDefault=e=>{e.preventDefault()},this.onMouseDown=e=>{this._calcMoveRange(),this._adapter.notifyMouseDown(e),this._allowMove(e)&&(this._registerDocMouseEvent(),this._calcOffset(e),this._preventDefault(e))},this.onTouchStart=e=>{if(this._calcMoveRange(),this._adapter.notifyTouchStart(e),!this._allowMove(e))return;this._registerDocTouchEvent();const t=e.targetTouches[0];this._calcOffset(t),this._preventDefault(e)},this._changePos=e=>{const{customMove:t}=this.getProps(),n="relative"===this.getProp("positionStrategy");let r=n?this.startLeft+e.clientX-this.startClientX:e.clientX-this.startOffsetX,i=n?this.startTop+e.clientY-this.startClientY:e.clientY-this.startOffsetY;this.constrainer&&(r=EZ(r,this.xMin,this.xMax),i=EZ(i,this.yMin,this.yMax)),requestAnimationFrame((()=>{t?t(this.element,i,r):(this.element.style.top=i+"px",this.element.style.left=r+"px")}))},this._onMouseMove=e=>{this._adapter.notifyMouseMove(e),this._changePos(e)},this._onTouchMove=e=>{this._adapter.notifyTouchMove(e);const t=e.targetTouches[0];this._changePos(t)},this._onMouseUp=e=>{this._adapter.notifyMouseUp(e),this._unRegisterDocMouseEvent()},this._onTouchEnd=e=>{this._adapter.notifyTouchEnd(e),this._unRegisterDocTouchEvent()},this._onTouchCancel=e=>{this._adapter.notifyTouchCancel(e),this._unRegisterDocTouchEvent()}}init(){const e=this._adapter.getDragElement();if(!e)throw new Error("drag element must be a valid element");this.element=e,this.updatePositionStrategy(),this.handler.style.cursor="move",this._registerStartEvent()}destroy(){this._unRegisterStartEvent(),this._unRegisterEvent()}_unRegisterEvent(){this._unRegisterDocMouseEvent(),this._unRegisterDocTouchEvent()}_calcMoveRange(){if(this.constrainer){if("relative"===this.getProp("positionStrategy")){const e=this.element.getBoundingClientRect(),t=this.constrainer.getBoundingClientRect(),n=window.getComputedStyle(this.element),r=parseFloat(n.left)||0,i=parseFloat(n.top)||0;return this.xMin=r+t.left-e.left,this.xMax=r+t.right-e.right,this.yMin=i+t.top-e.top,void(this.yMax=i+t.bottom-e.bottom)}let e=this.element.offsetParent,t=0,n=0;for(;e!==this.constrainer&&null!==e;)t-=e.offsetLeft,n-=e.offsetTop,e=e.offsetParent;this.xMin=t,this.xMax=t+this.constrainer.offsetWidth-this.element.offsetWidth,this.yMin=n,this.yMax=n+this.constrainer.offsetHeight-this.element.offsetHeight}}_allowMove(e){const{allowMove:t,allowInputDrag:n}=this.getProps();if(!n){let t=e.target.tagName.toLowerCase();if("input"===t||"textarea"===t)return}return!t||t(e,this.element)}}class SZ extends f{constructor(e){super(e),this.elementRef=h().createRef(),this.foundation=new CZ(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{getDragElement:()=>{let e=this.elementRef.current;return ee(e)||(e=ot(e)),e},getConstrainer:()=>{var e;const{constrainer:t}=this.props;return"string"==typeof t&&"parent"===t?null===(e=this.elementRef.current)||void 0===e?void 0:e.parentNode:"function"==typeof t?t():null},getHandler:()=>{const{handler:e}=this.props;return"function"==typeof e?e():this.adapter.getDragElement()},notifyMouseDown:e=>{this.props.onMouseDown&&this.props.onMouseDown(e)},notifyMouseMove:e=>{this.props.onMouseMove&&this.props.onMouseMove(e)},notifyMouseUp:e=>{this.props.onMouseUp&&this.props.onMouseUp(e)},notifyTouchStart:e=>{this.props.onTouchStart&&this.props.onTouchStart(e)},notifyTouchMove:e=>{this.props.onTouchMove&&this.props.onTouchMove(e)},notifyTouchEnd:e=>{this.props.onTouchEnd&&this.props.onTouchEnd(e)},notifyTouchCancel:e=>{this.props.onTouchCancel&&this.props.onTouchCancel(e)}})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}componentDidUpdate(e){e.positionStrategy!==this.props.positionStrategy&&this.foundation.updatePositionStrategy()}render(){const{children:e}=this.props,t=h().cloneElement(e,{ref:t=>{this.elementRef.current=t;const n=at(e);"function"==typeof n?n(t):n&&"object"==typeof n&&(n.current=t)}});return t}}SZ.propTypes={children:E().node,handler:E().func,allowInputDrag:E().bool,constrainNode:E().func,constrainer:E().oneOfType([E().func,E().oneOf(["parent"])]),allowMove:E().func,customMove:E().func,positionStrategy:E().oneOf(["absolute","relative"]),onMouseDown:E().func,onMouseMove:E().func,onMouseUp:E().func,onTouchStart:E().func,onTouchMove:E().func,onTouchEnd:E().func,onTouchCancel:E().func},SZ.__SemiComponentName__="DragMove",SZ.defaultProps={allowInputDrag:!1,positionStrategy:"absolute"};const _Z=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.92 4.01a1.5 1.5 0 0 0-2.84 0l-5 14.5a1.5 1.5 0 0 0 2.84.98l1.03-2.99h5.1l1.03 2.99a1.5 1.5 0 1 0 2.84-.98l-5-14.5Zm.1 9.49H5.98L7.5 9.1l1.52 4.4Zm6.98 1c0-2.03 1.22-3 2-3s2 .97 2 3c0 2.03-1.22 3-2 3s-2-.97-2-3Zm2-6c.85 0 1.62.23 2.28.63A1.5 1.5 0 0 1 23 10v9a1.5 1.5 0 0 1-2.72.87c-.66.4-1.43.63-2.28.63-3.1 0-5-3.06-5-6s1.9-6 5-6Z",fill:"currentColor"}))}),"case_sensitive");const kZ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.75 1c.83 0 1.5.67 1.5 1.5v2.7l2.17-1.45a1.5 1.5 0 1 1 1.66 2.5L19.46 8l2.62 1.75a1.5 1.5 0 1 1-1.66 2.5l-2.17-1.45v2.7a1.5 1.5 0 0 1-3 0v-2.7l-2.17 1.45a1.5 1.5 0 0 1-1.66-2.5L14.05 8l-2.63-1.75a1.5 1.5 0 0 1 1.66-2.5l2.17 1.45V2.5c0-.83.67-1.5 1.5-1.5Z",fill:"currentColor"}),d.createElement("circle",{cx:6.5,cy:17.5,r:4.5,fill:"currentColor"}))}),"reg_exp");const OZ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 5c.63 0 1.2.4 1.41.99l4 11A1.5 1.5 0 1 1 10.09 18l-.55-1.51H5.46l-.55 1.51A1.5 1.5 0 1 1 2.09 17l4-11c.22-.6.78-.99 1.41-.99Zm-.95 8.5h1.9l-.95-2.61-.95 2.61Z",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 3a1 1 0 0 1 1-1h18a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1Z",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.99 21a1 1 0 0 1 1-1H21a1 1 0 1 1 0 2H2.99a1 1 0 0 1-1-1Z",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5 5c.83 0 1.5.67 1.5 1.5V10c1.23 0 2.46.34 3.41 1.1 1 .8 1.59 1.98 1.59 3.4s-.6 2.6-1.59 3.4A5.43 5.43 0 0 1 17 19h-2a1 1 0 0 1-1-1V6.5c0-.83.67-1.5 1.5-1.5Zm1.5 8v3c.7 0 1.23-.2 1.54-.45.27-.21.46-.53.46-1.05s-.19-.84-.46-1.06A2.46 2.46 0 0 0 17 13Z",fill:"currentColor"}))}),"whole_word");var TZ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const PZ=bZ.PREFIX;class IZ extends f{constructor(e){super(e),this.isComposing=!1,this.resizeObserver=null,this.resizeRafId=null,this.lastObservedWidth=null,this.searchHandler=()=>{var e;const t=null===(e=this.searchInputRef.current)||void 0===e?void 0:e.value;this.foundation.search(t)},this.changeSearchOptions=e=>{this.foundation.setSearchOptions(e)},this.editorRef=h().createRef(),this.searchInputRef=h().createRef(),this.replaceInputRef=h().createRef(),this.foundation=new xZ(this.adapter),this.state={searchOptions:{caseSensitive:!1,wholeWord:!1,regex:!1},showSearchBar:!1,customRenderMap:new Map}}componentDidMount(){this.foundation.init(),this.setupResizeObserver()}teardownResizeObserver(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),null!==this.resizeRafId&&(cancelAnimationFrame(this.resizeRafId),this.resizeRafId=null),this.lastObservedWidth=null}setupResizeObserver(){var e;if(!(null===(e=this.props.options)||void 0===e?void 0:e.autoWrap))return void this.teardownResizeObserver();const t=this.editorRef.current;t&&"undefined"!=typeof ResizeObserver&&(this.teardownResizeObserver(),this.lastObservedWidth=t.getBoundingClientRect().width,this.resizeObserver=new ResizeObserver((e=>{var t;const n=e&&e[0];if(!n)return;const r=null===(t=n.contentRect)||void 0===t?void 0:t.width;"number"==typeof r&&(null!==this.lastObservedWidth&&Math.abs(r-this.lastObservedWidth)<.5||(this.lastObservedWidth=r,null!==this.resizeRafId&&cancelAnimationFrame(this.resizeRafId),this.resizeRafId=requestAnimationFrame((()=>{var e;this.resizeRafId=null;const t=this.foundation.jsonViewer;t&&t._view&&t._view._measuredHeights&&(t._view._measuredHeights={}),null===(e=this.foundation.jsonViewer)||void 0===e||e.layout()}))))})),this.resizeObserver.observe(t))}componentWillUnmount(){var e,t;this.teardownResizeObserver(),null===(t=null===(e=this.foundation.jsonViewer)||void 0===e?void 0:e.dispose)||void 0===t||t.call(e),super.componentWillUnmount()}componentDidUpdate(e){var t,n;if(!Oe()(e.options,this.props.options)||this.props.value!==e.value)return this.foundation.jsonViewer.dispose(),this.foundation.init(),void this.setupResizeObserver();(null===(t=e.options)||void 0===t?void 0:t.autoWrap)!==(null===(n=this.props.options)||void 0===n?void 0:n.autoWrap)&&this.setupResizeObserver()}get adapter(){return Object.assign(Object.assign({},super.adapter),{getEditorRef:()=>this.editorRef.current,getSearchRef:()=>this.searchInputRef.current,notifyChange:e=>{var t,n;null===(n=(t=this.props).onChange)||void 0===n||n.call(t,e)},notifyHover:(e,t)=>{var n,r;return null===(r=(n=this.props).renderTooltip)||void 0===r?void 0:r.call(n,e,t)},notifyCustomRender:e=>{this.setState({customRenderMap:e})},setSearchOptions:e=>{this.setState({searchOptions:Object.assign(Object.assign({},this.state.searchOptions),{[e]:!this.state.searchOptions[e]})},(()=>{this.searchHandler()}))},showSearchBar:()=>{this.setState({showSearchBar:!this.state.showSearchBar}),this.setState({searchOptions:{caseSensitive:!1,wholeWord:!1,regex:!1}})}})}getValue(){return this.foundation.jsonViewer.getModel().getValue()}format(){this.foundation.jsonViewer.format()}search(e,t,n,r){this.foundation.search(e,t,n,r)}getSearchResults(){return this.foundation.getSearchResults()}prevSearch(e){this.foundation.prevSearch(e)}nextSearch(e){this.foundation.nextSearch(e)}replace(e){this.foundation.replace(e)}replaceAll(e){this.foundation.replaceAll(e)}getStyle(){const{width:e,height:t}=this.props;return{width:e,height:t}}renderSearchBox(){return h().createElement("div",{className:`${PZ}-search-bar-container`,style:{position:"absolute",top:20,right:20}},this.renderSearchBar(),this.renderReplaceBar())}renderSearchOptions(){const e=[{key:"caseSensitive",icon:_Z},{key:"regex",icon:kZ},{key:"wholeWord",icon:OZ}];return h().createElement("ul",{className:`${PZ}-search-options`},e.map((e=>{let{key:t,icon:n}=e;return h().createElement("li",{key:t,className:w()(`${PZ}-search-options-item`,{[`${PZ}-search-options-item-active`]:this.state.searchOptions[t]})},h().createElement(n,{onClick:()=>this.changeSearchOptions(t)}))})))}renderSearchBar(){return h().createElement(Jt,{componentName:"JsonViewer"},((e,t)=>h().createElement("div",{className:`${PZ}-search-bar`},h().createElement(kr,{placeholder:e.search,className:`${PZ}-search-bar-input`,onChange:(e,t)=>{var n;t.preventDefault(),this.isComposing||this.searchHandler(),null===(n=this.searchInputRef.current)||void 0===n||n.focus()},onCompositionStart:()=>{this.isComposing=!0},onCompositionEnd:()=>{var e;this.isComposing=!1,this.searchHandler(),null===(e=this.searchInputRef.current)||void 0===e||e.focus()},ref:this.searchInputRef}),this.renderSearchOptions(),h().createElement(Es,null,h().createElement(vs,{icon:h().createElement(Rl,null),onClick:e=>{e.preventDefault(),this.foundation.prevSearch()}}),h().createElement(vs,{icon:h().createElement(Al,null),onClick:e=>{e.preventDefault(),this.foundation.nextSearch()}})),h().createElement(vs,{icon:h().createElement(Ji,null),size:"small",theme:"borderless",type:"tertiary",onClick:()=>this.foundation.showSearchBar()}))))}renderReplaceBar(){const{readOnly:e}=this.props.options;return h().createElement(Jt,{componentName:"JsonViewer"},((t,n)=>h().createElement("div",{className:`${PZ}-replace-bar`},h().createElement(kr,{placeholder:t.replace,className:`${PZ}-replace-bar-input`,onChange:(e,t)=>{t.preventDefault()},ref:this.replaceInputRef}),h().createElement(vs,{style:{width:"fit-content"},disabled:e,onClick:()=>{var e;const t=null===(e=this.replaceInputRef.current)||void 0===e?void 0:e.value;this.foundation.replace(t)}},t.replace),h().createElement(vs,{style:{width:"fit-content"},disabled:e,onClick:()=>{var e;const t=null===(e=this.replaceInputRef.current)||void 0===e?void 0:e.value;this.foundation.replaceAll(t)}},t.replaceAll))))}render(){let e=!1;const t=this.props,{width:n,className:r,style:i,showSearch:s=!0,limitSearchButtonBounds:o,renderSearchButton:a}=t,l=TZ(t,["width","className","style","showSearch","limitSearchButtonBounds","renderSearchButton"]),c=h().createElement(SZ,{constrainer:o?"parent":void 0,onMouseDown:()=>{e=!1},onMouseMove:()=>{e=!0}},h().createElement("div",{style:{position:"absolute",top:0,left:n}},this.state.showSearchBar?this.renderSearchBox():h().createElement(vs,{className:`${PZ}-search-bar-trigger`,onClick:t=>{if(t.preventDefault(),e)return t.stopPropagation(),void t.preventDefault();this.foundation.showSearchBar()},icon:h().createElement(WC,null),style:{position:"absolute",top:20,right:20}}))),d={showSearchBar:this.state.showSearchBar,onToggleSearchBar:()=>this.foundation.showSearchBar(),onSearch:(e,t,n,r)=>{this.foundation.search(e,t,n,r)},onPrevSearch:()=>this.foundation.prevSearch(),onNextSearch:()=>this.foundation.nextSearch(),onReplace:e=>this.foundation.replace(e),onReplaceAll:e=>this.foundation.replaceAll(e)};return h().createElement(h().Fragment,null,h().createElement("div",Object.assign({style:Object.assign(Object.assign(Object.assign({},this.getStyle()),{position:"relative"}),i),className:r},this.getDataAttr(l)),h().createElement("div",{style:Object.assign({},this.getStyle()),ref:this.editorRef,className:w()(PZ,`${PZ}-background`)}),s&&(a?a(c,d):c)),Array.from(this.state.customRenderMap.entries()).map((e=>{let[t,n]=e;return(0,Ge.createPortal)(n,t)})))}}IZ.defaultProps={width:400,height:400,value:"",options:{readOnly:!1,autoWrap:!0}};const MZ=IZ;__webpack_require__("ccLa");const RZ={PREFIX:`${C}-audio-player`};const AZ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M4.5 2C3.67 2 3 2.67 3 3.5v17a1.5 1.5 0 0 0 3 0v-17C6 2.67 5.33 2 4.5 2Z",fill:"currentColor"}),d.createElement("path",{d:"m8 11.21 11.38-8.94a1 1 0 0 1 1.62.79v17.88a1 1 0 0 1-1.62.79L8 12.79a1 1 0 0 1 0-1.58Z",fill:"currentColor"}))}),"restart");const NZ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M4.5 4.75a2.75 2.75 0 0 1 5.5 0v14.5a2.75 2.75 0 1 1-5.5 0V4.75Z",fill:"currentColor"}),d.createElement("path",{d:"M14 4.75a2.75 2.75 0 1 1 5.5 0v14.5a2.75 2.75 0 1 1-5.5 0V4.75Z",fill:"currentColor"}))}),"pause");const DZ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M5 2.9a1 1 0 0 1 1.57-.82l13.23 9.1a1 1 0 0 1 0 1.64l-13.23 9.1A1 1 0 0 1 5 21.1V2.9Z",fill:"currentColor"}))}),"play");const LZ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.43 2.1A1 1 0 0 1 12 3v18a1 1 0 0 1-1.62.78L4.65 17H2a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h2.65l5.73-4.78a1 1 0 0 1 1.05-.12Zm2.52 6.33a1.5 1.5 0 0 1 2.12.02 4.99 4.99 0 0 1 0 7 1.5 1.5 0 1 1-2.14-2.1 1.99 1.99 0 0 0 0-2.8 1.5 1.5 0 0 1 .02-2.12Zm4.9-4.28a1.5 1.5 0 0 0-1.7 2.47 6.5 6.5 0 0 1 0 10.76 1.5 1.5 0 0 0 1.7 2.47 9.5 9.5 0 0 0 0-15.7Z",fill:"currentColor"}))}),"volume_2");const FZ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.43 2.1A1 1 0 0 1 12 3v18a1 1 0 0 1-1.62.78L4.65 17H2a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h2.65l5.73-4.78a1 1 0 0 1 1.05-.12Z",fill:"currentColor"}))}),"volumn_silent");const jZ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M12 18.04a1 1 0 0 1-1.59.8l-8.3-6.03a1 1 0 0 1 0-1.62l8.3-6.03a1 1 0 0 1 1.59.8v12.08Z",fill:"currentColor"}),d.createElement("path",{d:"M23 18.04a1 1 0 0 1-1.59.8l-8.3-6.03a1 1 0 0 1 0-1.62l8.3-6.03a1 1 0 0 1 1.59.8v12.08Z",fill:"currentColor"}))}),"backward");const $Z=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M1 5.96a1 1 0 0 1 1.59-.8l8.3 6.03a1 1 0 0 1 0 1.62l-8.3 6.03a1 1 0 0 1-1.59-.8V5.96Z",fill:"currentColor"}),d.createElement("path",{d:"M12 5.96a1 1 0 0 1 1.59-.8l8.3 6.03a1 1 0 0 1 0 1.62l-8.3 6.03a1 1 0 0 1-1.59-.8V5.96Z",fill:"currentColor"}))}),"fast_forward"),BZ=e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`,VZ=RZ.PREFIX;class zZ extends h().Component{constructor(e){var t;super(e),t=this,this.handleMouseEnter=e=>{this.setState({isHovering:!0}),this.handleMouseEvent(e,!1)},this.handleMouseDown=e=>{this.setState({isDragging:!0}),this.handleMouseEvent(e,!0)},this.handleMouseUp=()=>{this.state.isDragging&&this.setState({isDragging:!1})},this.handleMouseEvent=function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t.sliderRef.current||t.props.disabled)return;const r=t.sliderRef.current.getBoundingClientRect(),i=t.props.vertical?r.bottom-e.clientY:e.clientX-r.left,s=t.props.vertical?r.height:r.width,o=Math.min(Math.max(i/s,0),1),a=o*t.props.max;n&&(t.state.isDragging||"mousedown"===e.type)&&t.props.onChange(a),t.setState({movingInfo:{progress:o,offset:t.props.vertical?i-r.height/2:i-r.width/2}})},this.handleMouseMove=e=>{this.handleMouseEvent(e,!0)},this.handleMouseLeave=()=>{this.setState({isHovering:!1,isDragging:!1})},this.state={isDragging:!1,isHovering:!1,movingInfo:null},this.sliderRef=h().createRef(),this.handleRef=h().createRef()}render(){const{vertical:e,width:t,height:n,showTooltip:r,max:i,value:s,theme:o}=this.props,{movingInfo:a,isHovering:l}=this.state,c=h().createElement("div",{onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onMouseMove:this.handleMouseMove,className:w()(`${VZ}-slider-wrapper`,{[`${VZ}-slider-wrapper-vertical`]:e,[`${VZ}-slider-wrapper-horizontal`]:!e})},h().createElement("div",{ref:this.sliderRef,className:w()(`${VZ}-slider`,`${VZ}-slider-${o}`,{[`${VZ}-slider-vertical`]:e,[`${VZ}-slider-horizontal`]:!e}),style:{width:e?l?8:4:t,height:e?n:l?8:4}},h().createElement("div",{className:w()(`${VZ}-slider-progress`,{[`${VZ}-slider-progress-vertical`]:e,[`${VZ}-slider-progress-horizontal`]:!e}),style:{height:e?s/i*100+"%":"100%",width:e?"100%":s/i*100+"%"}}),h().createElement("div",{ref:this.handleRef,className:w()(`${VZ}-slider-dot`),style:{left:e?"50%":`calc(${s/i*100}% - 8px)`,bottom:e?`calc(${s/i*100}% - 8px)`:void 0,top:e?void 0:"50%",transform:e?"translateX(-50%)":"translateY(-50%)",opacity:l?1:0,transition:"opacity 0.2s",pointerEvents:"none"}})));return r?h().createElement(_t,{position:e?"right":"top",autoAdjustOverflow:!0,content:BZ((null==a?void 0:a.progress)*i),style:{[e?"top":"left"]:null==a?void 0:a.offset}},c):c}}zZ.defaultProps={value:0,onChange:i(),max:100,vertical:!1,width:"100%",height:4,showTooltip:!0,disabled:!1,theme:"dark"};class HZ extends c{constructor(e){super(Object.assign(Object.assign({},HZ),e))}initAudioState(){const e=this.getAudioRef(),t=this.getProps();this.setState({totalTime:(null==e?void 0:e.duration)||0,isPlaying:t.autoPlay,volume:100*(null==e?void 0:e.volume)||100,currentRate:{label:"1.0x",value:(null==e?void 0:e.playbackRate)||1}})}endHandler(){const e=this.getProps();Array.isArray(e.audioUrl)?this.handleTrackChange("next"):this.setState({isPlaying:!1})}errorHandler(){this.setState({error:!0})}init(){this._adapter.init()}destroy(){this._adapter.destroy()}resetAudioState(){this._adapter.resetAudioState()}handleStatusClick(){this._adapter.handleStatusClick()}handleTimeUpdate(){this._adapter.handleTimeUpdate()}handleTrackChange(e){this._adapter.handleTrackChange(e)}getAudioRef(){return this._adapter.getAudioRef()}handleTimeChange(e){this._adapter.handleTimeChange(e)}handleSpeedChange(e){this._adapter.handleSpeedChange(e)}handleSeek(e){this._adapter.handleSeek(e)}handleRefresh(){this._adapter.handleRefresh()}handleVolumeChange(e){this._adapter.handleVolumeChange(e)}}const UZ=HZ,KZ=RZ.PREFIX;class WZ extends f{constructor(e){super(e),this.audioRef=h().createRef(),this.rateOptions=[{label:"0.5x",value:.5},{label:"0.75x",value:.75},{label:"1.0x",value:1},{label:"1.5x",value:1.5},{label:"2.0x",value:2}],this.handleStatusClick=()=>{this.foundation.handleStatusClick()},this.handleTrackChange=e=>{this.foundation.handleTrackChange(e)},this.handleTimeChange=e=>{this.foundation.handleTimeChange(e)},this.handleRefresh=()=>{this.foundation.handleRefresh()},this.handleSpeedChange=e=>{this.foundation.handleSpeedChange(e)},this.handleSeek=e=>{this.foundation.handleSeek(e)},this.handleTimeUpdate=()=>{this.foundation.handleTimeUpdate()},this.handleVolumeChange=e=>{this.foundation.handleVolumeChange(e)},this.handleVolumeSilent=()=>{this.audioRef.current&&(this.audioRef.current.volume=0===this.state.volume?.5:0,this.setState({volume:0===this.state.volume?50:0}))},this.getAudioInfo=e=>{if(Array.isArray(e)){const t=e[this.state.currentIndex];return"string"==typeof t?{src:t,audioTitle:null,audioCover:null}:{src:t.src,audioTitle:t.title,audioCover:t.cover}}return"string"==typeof e?{src:e,audioTitle:null,audioCover:null}:{src:e.src,audioTitle:e.title,audioCover:e.cover}},this.renderControl=()=>{const{error:e}=this.state,t=Array.isArray(this.props.audioUrl),n=w()(`${KZ}-control-button-icon`),r={borderRadius:"50%"},i={background:"transparent"};return h().createElement("div",{className:w()(`${KZ}-control`)},t&&h().createElement(Jt,{componentName:"AudioPlayer"},(e=>h().createElement(_t,{content:e.prev,autoAdjustOverflow:!0,showArrow:!1},h().createElement("span",null,h().createElement(vs,{style:Object.assign(Object.assign({},r),i),size:"large",icon:h().createElement(AZ,{size:"large",className:n}),onClick:()=>this.handleTrackChange("prev")}))))),h().createElement(vs,{style:r,size:"large",disabled:e,onClick:this.handleStatusClick,icon:this.state.isPlaying?h().createElement(NZ,{size:"large"}):h().createElement(DZ,{style:{marginLeft:"1px"},size:"large"}),className:w()(`${RZ.PREFIX}-control-button-play`,{[`${RZ.PREFIX}-control-button-play-disabled`]:e})}),t&&h().createElement(Jt,{componentName:"AudioPlayer"},(e=>h().createElement(_t,{content:e.next,autoAdjustOverflow:!0,showArrow:!1},h().createElement("span",null,h().createElement(vs,{style:Object.assign(Object.assign({},r),i),size:"large",icon:h().createElement(AZ,{size:"large",rotate:180,className:n}),onClick:()=>this.handleTrackChange("next")}))))))},this.renderInfo=()=>{const{audioTitle:e,audioCover:t}=this.getAudioInfo(this.props.audioUrl),{theme:n}=this.props,{currentTime:r,totalTime:i,error:s}=this.state;return h().createElement("div",{className:w()(`${KZ}-info-container`)},t&&h().createElement(cA,{src:t,width:50,height:50}),h().createElement("div",{className:w()(`${KZ}-info`)},e&&h().createElement("div",{className:w()(`${KZ}-info-title`)},e,s&&this.renderError()),!s&&h().createElement("div",{className:w()(`${KZ}-info-time`)},h().createElement("span",{style:{width:"38px"}},BZ(r)),h().createElement("div",{className:w()(`${KZ}-slider-container`)},h().createElement(zZ,{value:r,max:i,theme:n,onChange:this.handleTimeChange})),h().createElement("span",{style:{width:"38px"}},BZ(i)))))},this.renderToolbar=()=>{const{volume:e,error:t}=this.state,{skipDuration:n=10,theme:r="dark"}=this.props,i=w()(`${KZ}-control-button-icon`),s={background:"transparent"},o=0===e;return t?h().createElement("div",{className:w()(`${KZ}-control`)},h().createElement(vs,{onClick:()=>this.handleRefresh(),style:s,icon:h().createElement(aI,{style:{transform:"rotateY(180deg)"},className:i})})):h().createElement("div",{className:w()(`${KZ}-control`)},h().createElement(Cn,{autoAdjustOverflow:!0,content:h().createElement("div",{className:w()(`${KZ}-control-volume`)},h().createElement("div",{className:w()(`${KZ}-control-volume-title`)},e,"%"),h().createElement(zZ,{value:e,max:100,vertical:!0,height:120,theme:r,showTooltip:!1,onChange:this.handleVolumeChange}))},h().createElement("span",null,h().createElement(Jt,{componentName:"AudioPlayer"},(e=>h().createElement(_t,{content:e.volume,autoAdjustOverflow:!0,showArrow:!1},h().createElement(vs,{style:s,icon:o?h().createElement(FZ,{className:i}):h().createElement(LZ,{className:i}),onClick:this.handleVolumeSilent})))))),h().createElement(Jt,{componentName:"AudioPlayer"},(e=>h().createElement(_t,{content:e.backward.replace("${skipDuration}",String(n)),autoAdjustOverflow:!0,showArrow:!1},h().createElement("span",null,h().createElement(vs,{style:s,icon:h().createElement(jZ,{className:i}),onClick:()=>this.handleSeek(-1)}))))),h().createElement(Jt,{componentName:"AudioPlayer"},(e=>h().createElement(_t,{content:e.forward.replace("${skipDuration}",String(n)),autoAdjustOverflow:!0,showArrow:!1},h().createElement("span",null,h().createElement(vs,{style:s,icon:h().createElement($Z,{className:i}),onClick:()=>this.handleSeek(1)}))))),h().createElement(Ww,{className:w()(`${KZ}-control-speed-menu`),render:h().createElement(Ww.Menu,null,this.rateOptions.map((e=>h().createElement(Ww.Item,{className:w()(`${KZ}-control-speed-menu-item`),key:e.value,onClick:()=>this.handleSpeedChange(e),active:e.value===this.state.currentRate.value},e.label)))),onChange:this.handleSpeedChange},h().createElement("div",{className:w()(`${KZ}-control-speed`)},h().createElement("span",null,this.state.currentRate.label))),h().createElement(vs,{onClick:()=>this.handleRefresh(),style:s,icon:h().createElement(aI,{style:{transform:"rotateY(180deg)"},className:i})}))},this.renderError=()=>h().createElement("div",{className:w()(`${KZ}-error`)},h().createElement(ns,{size:"large"}),"音频加载失败"),this.state={isPlaying:!1,currentIndex:0,totalTime:0,currentTime:0,currentRate:{label:"1.0x",value:1},volume:100,error:!1},this.audioRef=h().createRef(),this.foundation=new UZ(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{init:()=>{this.audioRef.current&&(this.audioRef.current.addEventListener("loadedmetadata",(()=>{this.foundation.initAudioState()})),this.audioRef.current.addEventListener("error",(()=>{this.foundation.errorHandler()})),this.audioRef.current.addEventListener("ended",(()=>{this.foundation.endHandler()})))},destroy:()=>{this.audioRef.current&&(this.audioRef.current.removeEventListener("loadedmetadata",(()=>{this.foundation.initAudioState()})),this.audioRef.current.removeEventListener("error",(()=>{this.foundation.errorHandler()})),this.audioRef.current.removeEventListener("ended",(()=>{this.foundation.endHandler()})))},handleStatusClick:()=>{this.audioRef.current&&(this.state.isPlaying?this.audioRef.current.pause():this.audioRef.current.play(),this.setState({isPlaying:!this.state.isPlaying}))},getAudioRef:()=>this.audioRef.current,resetAudioState:()=>{this.setState({isPlaying:!0,currentTime:0,currentRate:{label:"1.0x",value:1}},(()=>{this.audioRef.current&&(this.audioRef.current.currentTime=this.state.currentTime,this.audioRef.current.playbackRate=this.state.currentRate.value,this.audioRef.current.play())}))},handleTimeUpdate:()=>{this.audioRef.current&&this.setState({currentTime:this.audioRef.current.currentTime})},handleTrackChange:e=>{if(!this.audioRef.current)return;const{audioUrl:t}=this.props;Array.isArray(t)&&("next"===e?this.setState({currentIndex:(this.state.currentIndex+1)%t.length,error:!1}):this.setState({currentIndex:(this.state.currentIndex-1+t.length)%t.length,error:!1})),this.foundation.resetAudioState()},handleTimeChange:e=>{this.audioRef.current&&(this.audioRef.current.currentTime=e,this.setState({currentTime:e}))},handleRefresh:()=>{this.audioRef.current&&(this.state.error?this.audioRef.current.load():(this.audioRef.current.currentTime=0,this.setState({currentTime:0})))},handleSpeedChange:e=>{this.audioRef.current&&(this.audioRef.current.playbackRate=e.value,this.setState({currentRate:e}))},handleSeek:e=>{if(!this.audioRef.current)return;const{skipDuration:t=10}=this.props,n=Math.min(Math.max(this.audioRef.current.currentTime+e*t,0),this.audioRef.current.duration);this.audioRef.current.currentTime=n},handleVolumeChange:e=>{if(!this.audioRef.current)return;const t=Math.floor(e);this.audioRef.current.volume=t/100,this.setState({volume:t})}})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}render(){const{audioUrl:e,autoPlay:t,className:n,style:r,showToolbar:i=!0,theme:s="dark"}=this.props,o=this.getAudioInfo(e).src;return h().createElement("div",{className:w()(KZ,n,`${KZ}-${s}`),style:r},h().createElement("audio",{src:o,autoPlay:t,className:w()(KZ,n),style:r,ref:this.audioRef,onTimeUpdate:this.handleTimeUpdate},h().createElement("track",{kind:"captions",src:o})),this.renderControl(),this.renderInfo(),i&&this.renderToolbar())}}WZ.defaultProps={autoPlay:!1,showToolbar:!0,skipDuration:10,theme:"dark"};const GZ=WZ,qZ={PREFIX:`${C}-userGuide`,PREFIX_MODAL:`${C}-userGuide-modal`},XZ=["popup","modal"],YZ=["top","topLeft","topRight","left","leftTop","leftBottom","right","rightTop","rightBottom","bottom","bottomLeft","bottomRight","leftTopOver","rightTopOver"],ZZ=["default","primary"],JZ=0,QZ=5,eJ=1030;class tJ extends c{constructor(e){super(Object.assign({},e)),this.handlePrev=()=>{const{current:e}=this.getStates(),t=e-1;this.getIsControlledComponent()||this._adapter.setCurrent(t),this._notifyChange(t),this._adapter.notifyPrev(t)},this.handleNext=()=>{const{steps:e}=this.getProps(),{current:t}=this.getStates(),n=t===e.length-1,r=n?t:t+1;n?this._adapter.notifyFinish():(this._notifyChange(r),this._adapter.notifyNext(r),this.getIsControlledComponent()||this._adapter.setCurrent(r))},this.handleSkip=()=>{this._adapter.notifySkip()}}init(){}destroy(){this._adapter.enabledBodyScroll()}_notifyChange(e){const{current:t}=this.getStates();t!==e&&this._adapter.notifyChange(e)}getIsControlledComponent(){return this._isInProps("current")}beforeShow(){this._adapter.disabledBodyScroll()}afterHide(){this._adapter.enabledBodyScroll()}getFinalPaading(){var e;const{spotlightPadding:t,steps:n}=this.getProps(),{current:r}=this.getStates(),i=null===(e=n[r])||void 0===e?void 0:e.spotlightPadding;return"number"==typeof i?i:"number"==typeof t?t:QZ}}__webpack_require__("+XD0");var nJ=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};const rJ=qZ.PREFIX;class iJ extends f{constructor(e){super(e),this.renderStep=(e,t)=>{const{theme:n,position:r,visible:i,className:s,style:o,spotlightPadding:a}=this.props,{current:l}=this.state,c=l===t;if(!c)return null;const d="function"==typeof e.target?e.target():e.target;if(!e.target)return null;const u=d.getBoundingClientRect(),p=(null==e?void 0:e.spotlightPadding)||a||QZ,f="primary"===n||"primary"===(null==e?void 0:e.theme)?{backgroundColor:"var(--semi-color-primary)"}:{};return h().createElement(Cn,{key:`userGuide-popup-${t}`,className:w()(`${rJ}-popover`,s),style:Object.assign(Object.assign(Object.assign({},{padding:0}),f),o),content:this.renderPopupContent(e,t),position:e.position||r,trigger:"custom",visible:i&&c,showArrow:!1!==e.showArrow},h().createElement("div",{style:{position:"fixed",left:u.x-p,top:u.y-p,width:u.width+2*p,height:u.height+2*p,pointerEvents:"none"}}))},this.renderIndicator=()=>{const{steps:e}=this.props,{current:t}=this.state,n=[];for(let r=0;r<e.length;r++)n.push(h().createElement("span",{key:r,"data-index":r,className:w()([`${qZ.PREFIX_MODAL}-indicator-item`],{[`${qZ.PREFIX_MODAL}-indicator-item-active`]:r===t})}));return n},this.renderModal=()=>{const{visible:e,steps:t,showSkipButton:n,showPrevButton:r,finishText:i,nextButtonProps:s,prevButtonProps:o,mask:a}=this.props,{current:l}=this.state,c=t[l],d=0===l,u=l===t.length-1,{cover:p,title:f,description:m}=c;return h().createElement(Jt,{componentName:"UserGuide"},((t,l)=>h().createElement(xw,{className:qZ.PREFIX_MODAL,bodyStyle:{padding:0},header:null,visible:e,maskClosable:!1,mask:a,centered:!0,footer:null},p&&h().createElement(h().Fragment,null,h().createElement("div",{className:`${qZ.PREFIX_MODAL}-cover`},p),h().createElement("div",{className:`${qZ.PREFIX_MODAL}-indicator`},this.renderIndicator())),(f||m)&&h().createElement("div",{className:`${qZ.PREFIX_MODAL}-body`},f&&h().createElement("div",{className:`${qZ.PREFIX_MODAL}-body-title`},f),m&&h().createElement("div",{className:`${qZ.PREFIX_MODAL}-body-description`},m)),h().createElement("div",{className:`${qZ.PREFIX_MODAL}-footer`},n&&!u&&h().createElement(vs,{type:"tertiary",onClick:this.foundation.handleSkip},t.skip),r&&!d&&h().createElement(vs,Object.assign({type:"tertiary",onClick:this.foundation.handlePrev},o),(null==o?void 0:o.children)||t.prev),h().createElement(vs,Object.assign({theme:"solid",onClick:this.foundation.handleNext},s),u?i||t.finish:(null==s?void 0:s.children)||t.next)))))},this.foundation=new tJ(this.adapter),this.state={current:e.current||JZ,spotlightRect:null},this.scrollBarWidth=0,this.userGuideId=""}get adapter(){return Object.assign(Object.assign({},super.adapter),{disabledBodyScroll:()=>{const{getPopupContainer:e}=this.props;this.bodyOverflow=document.body.style.overflow||"",e||"hidden"===this.bodyOverflow||(document.body.style.overflow="hidden",document.body.style.width=`calc(${this.originBodyWidth||"100%"} - ${this.scrollBarWidth}px)`)},enabledBodyScroll:()=>{const{getPopupContainer:e}=this.props;e||"hidden"===this.bodyOverflow||(document.body.style.overflow=this.bodyOverflow,document.body.style.width=this.originBodyWidth)},notifyChange:e=>{this.props.onChange(e)},notifyFinish:()=>{this.props.onFinish()},notifyNext:e=>{this.props.onNext(e)},notifyPrev:e=>{this.props.onPrev(e)},notifySkip:()=>{this.props.onSkip()},setCurrent:e=>{this.setState({current:e})}})}static getDerivedStateFromProps(e,t){const n={};return Re(e.current)||e.current===t.current||(n.current=e.current),n}componentDidMount(){this.foundation.init(),this.scrollBarWidth=de(),this.userGuideId=We()}componentDidUpdate(e,t){const{steps:n,mode:r,visible:i}=this.props,{current:s}=this.state;i!==e.visible&&(i?(this.foundation.beforeShow(),this.setState({current:0})):this.foundation.afterHide()),("popup"===r&&t.current!==s&&n[s]||e.visible!==i)&&this.updateSpotlightRect()}componentWillUnmount(){this.foundation.destroy()}scrollTargetIntoViewIfNeeded(e){if(!e)return;const t=e.getBoundingClientRect();t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)||e.scrollIntoView({behavior:"auto",block:"center"})}updateSpotlightRect(){return nJ(this,void 0,void 0,(function*(){const{steps:e,spotlightPadding:t}=this.props,{current:n}=this.state,r=e[n];if(r.target){const e="function"==typeof r.target?r.target():r.target;this.scrollTargetIntoViewIfNeeded(e);const n=null==e?void 0:e.getBoundingClientRect(),i=(null==r?void 0:r.spotlightPadding)||t||QZ,s=new DOMRect(n.x-i,n.y-i,n.width+2*i,n.height+2*i);requestAnimationFrame((()=>{this.setState({spotlightRect:s})}))}}))}renderPopupContent(e,t){const{showPrevButton:n,showSkipButton:r,theme:i,steps:s,finishText:o,nextButtonProps:a,prevButtonProps:l}=this.props,{current:c}=this.state,d=0===t,u=t===s.length-1,p=`${rJ}-popup-content`,f="primary"===i||"primary"===(null==e?void 0:e.theme),{cover:m,title:g,description:y}=e;return h().createElement(Jt,{componentName:"UserGuide"},((e,t)=>h().createElement("div",{className:w()(`${p}`,{[`${p}-primary`]:f})},m&&h().createElement("div",{className:`${p}-cover`},m),h().createElement("div",{className:`${p}-body`},g&&h().createElement("div",{className:`${p}-title`},g),y&&h().createElement("div",{className:`${p}-description`},y),h().createElement("div",{className:`${p}-footer`},s.length>1&&h().createElement("div",{className:`${p}-indicator`},c+1,"/",s.length),h().createElement("div",{className:`${p}-buttons`},r&&!u&&h().createElement(vs,{style:f?{backgroundColor:"var(--semi-color-fill-2)"}:{},theme:f?"solid":"light",type:f?"primary":"tertiary",onClick:this.foundation.handleSkip},e.skip),n&&!d&&h().createElement(vs,Object.assign({style:f?{backgroundColor:"var(--semi-color-fill-2)"}:{},theme:f?"solid":"light",type:f?"primary":"tertiary",onClick:this.foundation.handlePrev},l),(null==l?void 0:l.children)||e.prev),h().createElement(vs,Object.assign({style:f?{backgroundColor:"#FFF"}:{},theme:f?"borderless":"solid",type:"primary",onClick:this.foundation.handleNext},a),u?o||e.finish:(null==a?void 0:a.children)||e.next)))))))}renderSpotlight(){const{steps:e,mask:t,zIndex:n}=this.props,{spotlightRect:r,current:i}=this.state;return e[i].target?(r||this.updateSpotlightRect(),h().createElement(h().Fragment,null,r?h().createElement("svg",{className:`${rJ}-spotlight`,style:{zIndex:n}},h().createElement("defs",null,h().createElement("mask",{id:`spotlight-${this.userGuideId}`},h().createElement("rect",{width:"100%",height:"100%",fill:"white"}),h().createElement("rect",{className:`${rJ}-spotlight-rect`,x:r.x,y:r.y,width:r.width,height:r.height,rx:4,fill:"black"}))),t&&h().createElement(h().Fragment,null,h().createElement("rect",{width:"100%",height:"100%",fill:"var(--semi-color-overlay-bg)",mask:`url(#spotlight-${this.userGuideId})`}),h().createElement("rect",{x:0,y:0,width:"100%",height:r.y,fill:"transparent",className:`${rJ}-spotlight-transparent-rect`}),h().createElement("rect",{x:0,y:r.y,width:r.x,height:r.height,fill:"transparent",className:`${rJ}-spotlight-transparent-rect`}),h().createElement("rect",{x:r.x+r.width,y:r.y,width:`calc(100% - ${r.x+r.width}px)`,height:r.height,fill:"transparent",className:`${rJ}-spotlight-transparent-rect`}),h().createElement("rect",{y:r.y+r.height,width:"100%",height:`calc(100% - ${r.y+r.height}px)`,fill:"transparent",className:`${rJ}-spotlight-transparent-rect`}))):null)):null}render(){const{mode:e,steps:t,visible:n}=this.props;return n&&t.length?h().createElement(h().Fragment,null,"popup"===e?h().createElement(h().Fragment,null,null==t?void 0:t.map(((e,t)=>this.renderStep(e,t))),this.renderSpotlight()):null,"modal"===e&&this.renderModal()):null}}iJ.propTypes={mask:E().bool,mode:E().oneOf(XZ),onChange:E().func,onFinish:E().func,onNext:E().func,onPrev:E().func,onSkip:E().func,position:E().oneOf(YZ),showPrevButton:E().bool,showSkipButton:E().bool,theme:E().oneOf(ZZ),visible:E().bool,getPopupContainer:E().func,zIndex:E().number},iJ.defaultProps={mask:!0,mode:"popup",nextButtonProps:{},onChange:Tt,onFinish:Tt,onNext:Tt,onPrev:Tt,onSkip:Tt,position:"bottom",prevButtonProps:{},showPrevButton:!0,showSkipButton:!0,steps:[],theme:"default",visible:!1,zIndex:eJ};const sJ=iJ,oJ={PREFIX:`${C}-videoPlayer`,PREFIX_CONTROLS:`${C}-videoPlayer-controls`,PREFIX_PROGRESS:`${C}-videoPlayer-progress`},aJ="dark",lJ="play",cJ="next",dJ="time",hJ="volume",uJ="playbackRate",pJ="quality",fJ="route",mJ="mirror",gJ="fullscreen",yJ="pictureInPicture",vJ=100,bJ=10,wJ=1;class xJ extends c{constructor(e){super(Object.assign({},e)),this.scrollPosition=null,this.handleMouseMove=g()((()=>{this._adapter.setShowControls(!0),this.clearTimer(),this.controlsTimer=setTimeout((()=>{this._adapter.setShowControls(!1)}),3e3)}),200),this.handleVideoPlay=()=>{this._adapter.setIsPlaying(!0),this._adapter.notifyPlay()},this.handleVideoPause=()=>{this._adapter.setIsPlaying(!1),this._adapter.notifyPause()},this.handleCanPlay=()=>{this._adapter.setShowNotification(!1)},this.handleWaiting=e=>{this._adapter.setNotificationContent(e.loading),this._adapter.setShowNotification(!0)},this.handleStalled=e=>{this._adapter.setNotificationContent(e.stall),this._adapter.setShowNotification(!0)},this.handleProgress=()=>{const e=this._adapter.getVideo();if(e&&e.buffered.length>0){const t=e.buffered.end(e.buffered.length-1);this._adapter.setBufferedValue(t)}},this.handleEnded=()=>{this._adapter.setIsPlaying(!1),this._adapter.setShowControls(!0)},this.handleVolumeSilent=()=>{const e=this._adapter.getVideo(),{volume:t,muted:n}=this.getStates();e&&(n?(e.volume=t/100,this._adapter.setVolume(t),this._adapter.setMuted(!1)):(e.volume=0,this._adapter.setMuted(!0)))},this.handleFullscreen=()=>{const e=this._adapter.getVideoWrapper(),t=this.checkFullScreen();e&&(t?document.exitFullscreen():(this.scrollPosition={x:window.scrollX,y:window.scrollY},e.requestFullscreen()))},this.handleMirror=e=>{const{isMirror:t}=this.getStates();this._adapter.setIsMirror(!t),this.handleTemporaryNotification(t?e.cancelMirror:e.mirror)},this.handlePictureInPicture=()=>{const e=this._adapter.getVideo();e&&e.requestPictureInPicture()},this.handleLeavePictureInPicture=()=>{const e=this._adapter.getVideo();e&&this._adapter.setIsPlaying(!e.paused)},this.handleTemporaryNotification=e=>{this._adapter.setNotificationContent(e),this._adapter.setShowNotification(!0),setTimeout((()=>{this._adapter.setShowNotification(!1)}),1e3)},this.handleMouseEnterWrapper=()=>{this._adapter.setShowControls(!0)},this.handleMouseLeaveWrapper=()=>{const{isPlaying:e}=this.getStates();e&&this._adapter.setShowControls(!1)},this.handleFullscreenChange=()=>{this.checkFullScreen()?document.addEventListener("mousemove",this.handleMouseMove):(this.scrollPosition&&setTimeout((()=>{window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),this.scrollPosition=null}),0),document.removeEventListener("mousemove",this.handleMouseMove))},this.registerEvent=()=>{const e=this._adapter.getVideo();e&&(document.addEventListener("keydown",(e=>this.handleBodyKeyDown(e))),document.addEventListener("fullscreenchange",this.handleFullscreenChange),e.addEventListener("leavepictureinpicture",this.handleLeavePictureInPicture))},this.unregisterEvent=()=>{const e=this._adapter.getVideo();e&&(document.removeEventListener("keydown",(e=>this.handleBodyKeyDown(e))),document.removeEventListener("fullscreenchange",this.handleFullscreenChange),e.removeEventListener("leavepictureinpicture",this.handleLeavePictureInPicture))}}init(){const{volume:e,muted:t}=this.getProps(),n=this._adapter.getVideo();n&&(this._adapter.setTotalTime(n.duration),this.handleVolumeChange(t?0:e)),this.registerEvent()}destroy(){this.unregisterEvent(),this.clearTimer()}shouldShowControlItem(e){const{controlsList:t}=this.getProps();return!!t.includes(e)}clearTimer(){this.controlsTimer&&clearTimeout(this.controlsTimer)}handleTimeChange(e){const t=this._adapter.getVideo();t&&(Number.isNaN(e)||(t.currentTime=e,this._adapter.setCurrentTime(e)))}handleTimeUpdate(){const e=this._adapter.getVideo();e&&this._adapter.setCurrentTime(e.currentTime)}handleDurationChange(){const e=this._adapter.getVideo();e&&this._adapter.setTotalTime(e.duration)}handleError(){this._adapter.setIsError(!0)}handlePlayOrPause(){const e=this._adapter.getVideo();e&&(e.paused?this.handlePlay():this.handlePause())}handlePlay(){const e=this._adapter.getVideo();e&&e.play()}handlePause(){const e=this._adapter.getVideo();e&&e.pause()}handleVolumeChange(e){const t=this._adapter.getVideo();if(!t)return;const n=Math.floor(e>0?e:0);t.volume=n/100,this._adapter.setVolume(n),this._adapter.setMuted(0===n)}checkFullScreen(){const e=this._adapter.getVideoWrapper();return!!e&&!(document.fullscreenElement!==e&&(null===document||void 0===document?void 0:document.webkitFullscreenElement)!==e&&(null===document||void 0===document?void 0:document.mozFullScreenElement)!==e&&(null===document||void 0===document?void 0:document.msFullscreenElement)!==e&&!(null==e?void 0:e.webkitDisplayingFullscreen))}handleRateChange(e,t){const n=this._adapter.getVideo();n&&(n.playbackRate=e.value,this._adapter.setPlaybackRate(e.value),this._adapter.notifyRateChange(e.value),this.handleTemporaryNotification(t.rateChange.replace("${rate}",e.label)))}handleQualityChange(e,t){this._adapter.setQuality(e.value),this._adapter.notifyQualityChange(e.value),this.handleTemporaryNotification(t.qualityChange.replace("${quality}",e.label)),this.restorePlayPosition()}handleRouteChange(e,t){var n,r;this._adapter.setRoute(e.value),null===(r=(n=this._adapter).notifyRouteChange)||void 0===r||r.call(n,e.value),this.handleTemporaryNotification(t.routeChange.replace("${route}",e.label)),this.restorePlayPosition()}restorePlayPosition(){const e=this._adapter.getVideo();if(!e)return;const t=!e.paused,n=e.currentTime,r=()=>{e.currentTime=n,t&&e.play(),e.removeEventListener("loadeddata",r)};e.addEventListener("loadeddata",r)}handleBodyKeyDown(e){const t=this._adapter.getVideoWrapper();if(t&&!t.contains(document.activeElement))return;const{currentTime:n,volume:r}=this.getStates(),{seekTime:i}=this.getProps();" "===e.key?this.handlePlayOrPause():"ArrowLeft"===e.key?this.handleTimeChange(n-i):"ArrowRight"===e.key&&this.handleTimeChange(n+i)}}__webpack_require__("dFzp");const EJ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3a1 1 0 0 0-1.62-.78L4.65 7H2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h2.65l5.73 4.78A1 1 0 0 0 12 21V3Zm2.06 4.94a1.5 1.5 0 0 1 2.12 0L18 9.76l1.82-1.82a1.5 1.5 0 1 1 2.12 2.12l-1.82 1.82 1.94 1.94a1.5 1.5 0 0 1-2.12 2.12L18 14l-1.94 1.94a1.5 1.5 0 0 1-2.12-2.12l1.94-1.94-1.82-1.82a1.5 1.5 0 0 1 0-2.12Z",fill:"currentColor"}))}),"mute");const CJ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3a1 1 0 0 0-1.62-.78L4.65 7H2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h2.65l5.73 4.78A1 1 0 0 0 12 21V3Zm4.07 5.45a1.5 1.5 0 1 0-2.14 2.1 1.99 1.99 0 0 1 0 2.8 1.5 1.5 0 0 0 2.14 2.1 4.99 4.99 0 0 0 0-7Z",fill:"currentColor"}))}),"volume_1");const SJ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22ZM10.55 7.04A1 1 0 0 0 9 7.87v8.26a1 1 0 0 0 1.55.83l6.2-4.13a1 1 0 0 0 0-1.66l-6.2-4.13Z",fill:"currentColor"}))}),"play_circle");const _J=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 3a1.25 1.25 0 0 0-2.42-.44L1.83 20.3A1.25 1.25 0 0 0 3 22h6.75c.69 0 1.25-.56 1.25-1.25V3ZM8.5 19.5H4.81L8.5 9.8v9.7Z",fill:"currentColor"}),d.createElement("path",{d:"M14.02 1.77C13.43 1.88 13 2.4 13 3v17.75c0 .69.56 1.25 1.25 1.25H21a1.25 1.25 0 0 0 1.17-1.7L15.42 2.57c-.22-.57-.8-.9-1.4-.79Z",fill:"currentColor"}))}),"flip_horizontal");const kJ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 2c.83 0 1.5.67 1.5 1.5v3A3.5 3.5 0 0 1 6.5 10h-3a1.5 1.5 0 1 1 0-3h3a.5.5 0 0 0 .5-.5v-3C7 2.67 7.67 2 8.5 2ZM16 2c.83 0 1.5.67 1.5 1.5v3c0 .28.22.5.5.5h3a1.5 1.5 0 0 1 0 3h-3a3.5 3.5 0 0 1-3.5-3.5v-3c0-.83.67-1.5 1.5-1.5ZM2 15.5c0-.83.67-1.5 1.5-1.5h3a3.5 3.5 0 0 1 3.5 3.5v3a1.5 1.5 0 0 1-3 0v-3a.5.5 0 0 0-.5-.5h-3A1.5 1.5 0 0 1 2 15.5Zm12 2a3.5 3.5 0 0 1 3.5-3.5h3a1.5 1.5 0 0 1 0 3h-3a.5.5 0 0 0-.5.5v3a1.5 1.5 0 0 1-3 0v-3Z",fill:"currentColor"}))}),"minimize");const OJ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 3.5c0-.83.67-1.5 1.5-1.5h3A3.5 3.5 0 0 1 22 5.5v3a1.5 1.5 0 0 1-3 0v-3a.5.5 0 0 0-.5-.5h-3A1.5 1.5 0 0 1 14 3.5Zm-12 2A3.5 3.5 0 0 1 5.5 2h3a1.5 1.5 0 1 1 0 3h-3a.5.5 0 0 0-.5.5v3a1.5 1.5 0 1 1-3 0v-3ZM3.5 14c.83 0 1.5.67 1.5 1.5v3c0 .28.22.5.5.5h3a1.5 1.5 0 0 1 0 3h-3A3.5 3.5 0 0 1 2 18.5v-3c0-.83.67-1.5 1.5-1.5Zm17 0c.83 0 1.5.67 1.5 1.5v3a3.5 3.5 0 0 1-3.5 3.5h-3a1.5 1.5 0 0 1 0-3h3a.5.5 0 0 0 .5-.5v-3c0-.83.67-1.5 1.5-1.5Z",fill:"currentColor"}))}),"maximize");const TJ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M15.5 22a1.5 1.5 0 0 1-1.5-1.5v-5c0-.83.67-1.5 1.5-1.5h5c.83 0 1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5h-5Z",fill:"currentColor"}),d.createElement("path",{d:"M5.5 22A3.5 3.5 0 0 1 2 18.5v-13A3.5 3.5 0 0 1 5.5 2h13A3.5 3.5 0 0 1 22 5.5v4.25a1.5 1.5 0 0 1-3 0V5.5a.5.5 0 0 0-.5-.5h-13a.5.5 0 0 0-.5.5v13c0 .28.22.5.5.5h4.25a1.5 1.5 0 0 1 0 3H5.5Z",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.52 7.19a1 1 0 0 0 0 1.41l2.95 2.95h-.83a1 1 0 1 0 0 2h3.24a1 1 0 0 0 1-1V9.31a1 1 0 1 0-2 0v.83L8.93 7.19a1 1 0 0 0-1.41 0Z",fill:"currentColor"}))}),"mini_player");class PJ extends c{constructor(e){var t;super(Object.assign({},e)),t=this,this.handleDocumentMouseMove=e=>{const{isDragging:t}=this.getStates();t&&this.handleMouseEvent(e,!0)},this.handleDocumentMouseUp=()=>{const{isDragging:e}=this.getStates();e&&this._adapter.setIsDragging(!1),document.removeEventListener("mousemove",this.handleDocumentMouseMove),document.removeEventListener("mouseup",this.handleDocumentMouseUp)},this.handleMouseDown=e=>{this._adapter.setIsDragging(!0),this.handleMouseEvent(e,!0),document.addEventListener("mousemove",this.handleDocumentMouseMove),document.addEventListener("mouseup",this.handleDocumentMouseUp)},this.handleMouseUp=()=>{const{isDragging:e}=this.getStates();e&&this._adapter.setIsDragging(!1)},this.handleMouseEvent=function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{isDragging:r}=t.getStates(),{onChange:i,max:s}=t.getProps(),o=t._adapter.getSliderRef();if(!o)return;const a=o.getBoundingClientRect(),l=e.clientX-a.left,c=a.width,d=Math.min(Math.max(l/c,0),1),h=d*s;n&&(r||"mousedown"===e.type)&&(t.setActiveIndex(h),i(h)),t._adapter.setMovingInfo({progress:d,offset:l-a.width/2,value:h})},this.handleSliderMouseEnter=e=>{const{value:t}=this.getProps(),n=this._adapter.getMarkersList()[e];n.start<t&&n.end>t?this._adapter.setIsHandleHovering(!0):this._adapter.setIsHandleHovering(!1)},this.handleSliderMouseLeave=e=>{const{value:t}=this.getProps(),n=this._adapter.getMarkersList()[e];n.start<t&&n.end>t&&this._adapter.setIsHandleHovering(!1)},this.setActiveIndex=e=>{this._adapter.getMarkersList().map(((t,n)=>{e<t.end&&e>t.start&&(this._adapter.setIsHandleHovering(!0),this._adapter.setActiveIndex(n))}))},this.getValueWidth=(e,t)=>{const{start:n,end:r}=e;return t>r?"calc(100% - 2px)":t<n?"0%":(t-n)/(r-n)*100+"%"},this.getPlayedWidth=e=>{const{value:t}=this.getProps();return this.getValueWidth(e,t)},this.getLoadedWidth=e=>{const{bufferedValue:t}=this.getProps();return this.getValueWidth(e,t)}}}const IJ=e=>{if(isNaN(e))return"00:00";const t=Math.floor(e/3600);if(t>0){const n=Math.floor((e-3600*t)/60),r=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`}};class MJ extends f{constructor(e){super(e),this.initMarkerList=()=>{const{markers:e,max:t}=this.props,n=e&&e.length>0,r={start:0,end:t,left:"0",title:"",width:"100%"},i=n?[...e]:[r];let s=[];return n?i.forEach(((e,n)=>{const r=n===i.length-1?t:i[n+1].start;if(!(e.start>t||r>t)){const n={left:e.start/t*100+"%",width:(t?(r-e.start)/t*100:100)+"%",end:r,start:e.start,title:e.title};s.push(n)}})):s.push(r),s},this.handleMouseEnter=e=>{this.foundation.handleMouseEvent(e,!1)},this.handleMouseMove=e=>{this.foundation.handleMouseEvent(e,!0)},this.renderTooltipContent=()=>{var e;const{movingInfo:t}=this.state;if(this.markersList.length>0&&t){const n=this.markersList.findIndex((e=>(null==t?void 0:t.value)>e.start&&(null==t?void 0:t.value)<e.end));return h().createElement(h().Fragment,null,h().createElement("div",{className:w()(`${oJ.PREFIX_PROGRESS}-tooltip-content`)},null===(e=this.markersList[n])||void 0===e?void 0:e.title),h().createElement("div",{className:w()(`${oJ.PREFIX_PROGRESS}-tooltip-content`)},IJ(t.progress*this.props.max)))}return t&&IJ(t.progress*this.props.max)},this.state={isDragging:!1,isHandleHovering:!1,movingInfo:null,activeIndex:-1},this.sliderRef=h().createRef(),this.handleRef=h().createRef(),this.markersList=this.initMarkerList(),this.foundation=new PJ(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{getSliderRef:()=>this.sliderRef.current,getMarkersList:()=>this.markersList,setIsDragging:e=>this.setState({isDragging:e}),setIsHandleHovering:e=>this.setState({isHandleHovering:e}),setActiveIndex:e=>this.setState({activeIndex:e}),setMovingInfo:e=>this.setState({movingInfo:e})})}render(){const{showTooltip:e,max:t,value:n}=this.props,{movingInfo:r,isHandleHovering:i,isDragging:s,activeIndex:o}=this.state,a=h().createElement("div",{role:"slider",tabIndex:0,"aria-valuenow":n,ref:this.sliderRef,className:w()(`${oJ.PREFIX_PROGRESS}`),onMouseDown:this.foundation.handleMouseDown,onMouseUp:this.foundation.handleMouseUp,onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove},h().createElement("div",{className:w()(`${oJ.PREFIX_PROGRESS}-markers`)},this.markersList.map(((e,t)=>h().createElement("div",{key:`${e.start}-${t}`,className:w()(`${oJ.PREFIX_PROGRESS}-slider`,{[`${oJ.PREFIX_PROGRESS}-slider-active`]:t===o&&s}),style:{left:e.left,width:e.width},onMouseEnter:()=>this.foundation.handleSliderMouseEnter(t),onMouseLeave:()=>this.foundation.handleSliderMouseLeave(t)},h().createElement("div",{className:w()(`${oJ.PREFIX_PROGRESS}-slider-list`)}),h().createElement("div",{className:w()(`${oJ.PREFIX_PROGRESS}-slider-buffered`),style:{width:this.foundation.getLoadedWidth(e)}}),h().createElement("div",{className:w()(`${oJ.PREFIX_PROGRESS}-slider-played`),style:{width:this.foundation.getPlayedWidth(e)}}))))),h().createElement("div",{ref:this.handleRef,className:w()(`${oJ.PREFIX_PROGRESS}-handle`),style:{left:`calc(${100*(t?(n||1)/t:0)}% - 8px)`,transform:"translateY(-50%)",opacity:i||s?1:0,transition:"opacity 0.3s",pointerEvents:"none"}}));return e?h().createElement(_t,{position:"top",className:w()(`${oJ.PREFIX_PROGRESS}-tooltip`),content:this.renderTooltipContent(),style:{left:null==r?void 0:r.offset}},a):a}}MJ.defaultProps={value:0,onChange:i(),max:100,showTooltip:!0};const RJ=()=>h().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"30",viewBox:"0 0 41 30",fill:"none"},h().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.875 4.5C3.875 3.67157 4.54657 3 5.375 3H29.375C30.2034 3 30.875 3.67157 30.875 4.5V11.0446C30.875 11.9448 31.9714 12.3866 32.5956 11.7379L36.2647 7.92487C36.5768 7.60054 37.125 7.82146 37.125 8.27156V21.7284C37.125 22.1785 36.5768 22.3995 36.2647 22.0751L32.5956 18.2621C31.9714 17.6134 30.875 18.0552 30.875 18.9554V25.5C30.875 26.3284 30.2034 27 29.375 27H5.375C4.54657 27 3.875 26.3284 3.875 25.5V4.5ZM5.375 0C2.88972 0 0.875 2.01472 0.875 4.5V25.5C0.875 27.9853 2.88972 30 5.375 30H29.375C31.8603 30 33.875 27.9853 33.875 25.5V23.9183L34.103 24.1553C36.2876 26.4256 40.125 24.8792 40.125 21.7284V8.27156C40.125 5.12082 36.2876 3.5744 34.103 5.84475L33.875 6.08167V4.5C33.875 2.01472 31.8603 0 29.375 0H5.375ZM13.875 10.5C13.875 9.67157 13.2034 9 12.375 9C11.5466 9 10.875 9.67157 10.875 10.5V14.5C10.875 15.3284 11.5466 16 12.375 16C13.2034 16 13.875 15.3284 13.875 14.5V10.5ZM23.875 9C24.7034 9 25.375 9.67157 25.375 10.5V14.5C25.375 15.3284 24.7034 16 23.875 16C23.0466 16 22.375 15.3284 22.375 14.5V10.5C22.375 9.67157 23.0466 9 23.875 9ZM12.6231 22.3321C13.3039 21.3108 14.9319 20 18.375 20C20.192 20 21.3252 20.2374 22.1317 20.611C22.9124 20.9727 23.5161 21.5215 24.175 22.4C24.6721 23.0627 25.6123 23.1971 26.275 22.7C26.9377 22.2029 27.0721 21.2627 26.575 20.6C25.7339 19.4785 24.7706 18.5273 23.3928 17.889C22.0407 17.2626 20.424 17 18.375 17C14.0862 17 11.4461 18.6892 10.1269 20.6679C9.6674 21.3572 9.85366 22.2885 10.5429 22.7481C11.2322 23.2076 12.1635 23.0213 12.6231 22.3321Z",fill:"#F9F9F9",fillOpacity:"0.8"})),AJ=oJ.PREFIX;class NJ extends f{constructor(e){super(e),this.handleMouseEnterWrapper=()=>{this.foundation.handleMouseEnterWrapper()},this.handleMouseLeaveWrapper=()=>{this.foundation.handleMouseLeaveWrapper()},this.handleTimeChange=e=>{this.foundation.handleTimeChange(e)},this.handleTimeUpdate=()=>{this.foundation.handleTimeUpdate()},this.handleError=()=>{this.foundation.handleError()},this.handlePlay=()=>{this.foundation.handlePlay()},this.handlePause=()=>{this.foundation.handlePause()},this.handleVideoPlay=()=>{this.foundation.handleVideoPlay()},this.handleVideoPause=()=>{this.foundation.handleVideoPause()},this.handleCanPlay=()=>{this.foundation.handleCanPlay()},this.handleWaiting=e=>{this.foundation.handleWaiting(e)},this.handleStalled=e=>{this.foundation.handleStalled(e)},this.handleProgress=()=>{this.foundation.handleProgress()},this.handleEnded=()=>{this.foundation.handleEnded()},this.handleDurationChange=()=>{this.foundation.handleDurationChange()},this.handleVolumeChange=e=>{this.foundation.handleVolumeChange(e)},this.handleVolumeSilent=()=>{this.foundation.handleVolumeSilent()},this.handleRateChange=(e,t)=>{this.foundation.handleRateChange(e,t)},this.handleQualityChange=(e,t)=>{this.foundation.handleQualityChange(e,t)},this.handleRouteChange=(e,t)=>{this.foundation.handleRouteChange(e,t)},this.handleMirror=e=>{this.foundation.handleMirror(e)},this.handleFullscreen=()=>{this.foundation.handleFullscreen()},this.handlePictureInPicture=()=>{this.foundation.handlePictureInPicture()},this.getVolumeIcon=()=>{const{volume:e,muted:t}=this.state;return t?h().createElement(EJ,null):e<50?h().createElement(CJ,null):h().createElement(LZ,null)},this.isResourceNotFound=()=>{const{src:e}=this.props;return Re(e)},this.renderTime=()=>{const{currentTime:e,totalTime:t}=this.state;return this.foundation.shouldShowControlItem(dJ)?h().createElement("div",{className:w()(`${oJ.PREFIX_CONTROLS}-time`)},IJ(e)," / ",IJ(t)):null},this.renderResourceNotFound=e=>h().createElement("div",{className:w()(`${AJ}-resource-not-found`)},e.noResource),this.renderPauseIcon=()=>{const{isPlaying:e,isError:t}=this.state;return e||t?null:h().createElement("div",{className:w()(`${AJ}-pause`)},h().createElement(SJ,null))},this.renderError=e=>{const{isError:t}=this.state,{theme:n}=this.props;return t?h().createElement("div",{className:w()(`${AJ}-error`,{[`${AJ}-error-${n}`]:n})},h().createElement("div",{className:w()(`${AJ}-error-svg`)},h().createElement(RJ,null)),e.videoError):null},this.renderPoster=()=>{const{poster:e}=this.props,{isPlaying:t,currentTime:n,totalTime:r}=this.state,i=n>0&&n<r;return!t&&e?h().createElement("img",{className:w()(`${AJ}-poster`,{[`${AJ}-poster-hide`]:i}),src:e,alt:"poster"}):null},this.renderNotification=()=>{const{showNotification:e,notificationContent:t}=this.state;return e&&t?h().createElement("div",{className:w()(`${AJ}-notification`)},this.state.notificationContent):null},this.renderVolume=()=>{const{volume:e,muted:t}=this.state;return this.foundation.shouldShowControlItem(hJ)?h().createElement(Cn,{autoAdjustOverflow:!0,position:"top",className:w()(`${oJ.PREFIX_CONTROLS}-popover`),content:h().createElement("div",{className:w()(`${oJ.PREFIX_CONTROLS}-volume`)},h().createElement("div",{className:w()(`${oJ.PREFIX_CONTROLS}-volume-title`)},t?0:e,"%"),h().createElement(zZ,{value:t?0:e,max:100,vertical:!0,height:120,showTooltip:!1,onChange:this.handleVolumeChange}))},h().createElement(vs,{className:w()(`${oJ.PREFIX_CONTROLS}-menu-item`,`${oJ.PREFIX_CONTROLS}-menu-button`),theme:"borderless",icon:this.getVolumeIcon(),onClick:this.handleVolumeSilent})):null},this.renderIconButton=(e,t,n)=>this.foundation.shouldShowControlItem(n)?h().createElement(vs,{theme:"borderless",className:w()(`${oJ.PREFIX_CONTROLS}-menu-item`,`${oJ.PREFIX_CONTROLS}-menu-button`),icon:e,onClick:t}):null,this.renderDropdownButton=(e,t,n,r,i)=>{var s;return this.foundation.shouldShowControlItem(r)?h().createElement(Ww,{position:"top",className:w()(`${oJ.PREFIX_CONTROLS}-popup-menu`),render:h().createElement(Ww.Menu,null,t.map((t=>h().createElement(Ww.Item,{className:w()(`${oJ.PREFIX_CONTROLS}-popup-menu-item`),key:t.value,onClick:()=>n(t,i),active:t.value===e},t.label)))),onChange:e=>n(e,i)},h().createElement("div",{className:w()(`${oJ.PREFIX_CONTROLS}-menu-item`,`${oJ.PREFIX_CONTROLS}-popup`)},null===(s=t.find((t=>t.value===e)))||void 0===s?void 0:s.label)):null},this.state={bufferedValue:0,currentQuality:e.defaultQuality||"",currentRoute:e.defaultRoute||"",currentTime:0,isError:!1,isMirror:!1,isPlaying:!1,muted:e.muted,notificationContent:"",playbackRate:e.defaultPlaybackRate||1,playbackRateList:e.playbackRateList,showNotification:!1,showControls:!0,src:e.src||"",totalTime:0,volume:e.muted?0:e.volume},this.videoRef=h().createRef(),this.videoWrapperRef=h().createRef(),this.foundation=new xJ(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{getVideo:()=>this.videoRef.current,getVideoWrapper:()=>this.videoWrapperRef.current,notifyPause:()=>{var e,t;return null===(t=(e=this.props).onPause)||void 0===t?void 0:t.call(e)},notifyPlay:()=>{var e,t;return null===(t=(e=this.props).onPlay)||void 0===t?void 0:t.call(e)},notifyQualityChange:e=>{var t,n;return null===(n=(t=this.props).onQualityChange)||void 0===n?void 0:n.call(t,e)},notifyRateChange:e=>{var t,n;return null===(n=(t=this.props).onRateChange)||void 0===n?void 0:n.call(t,e)},notifyRouteChange:e=>{var t,n;return null===(n=(t=this.props).onRouteChange)||void 0===n?void 0:n.call(t,e)},notifyVolumeChange:e=>{var t,n;return null===(n=(t=this.props).onVolumeChange)||void 0===n?void 0:n.call(t,e)},setBufferedValue:e=>this.setState({bufferedValue:e}),setCurrentTime:e=>this.setState({currentTime:e}),setIsError:e=>this.setState({isError:e}),setIsMirror:e=>this.setState({isMirror:e}),setIsPlaying:e=>this.setState({isPlaying:e}),setMuted:e=>this.setState({muted:e}),setNotificationContent:e=>this.setState({notificationContent:e}),setPlaybackRate:e=>this.setState({playbackRate:e}),setQuality:e=>this.setState({currentQuality:e}),setRoute:e=>this.setState({currentRoute:e}),setShowControls:e=>this.setState({showControls:e}),setShowNotification:e=>this.setState({showNotification:e}),setTotalTime:e=>this.setState({totalTime:e}),setVolume:e=>this.setState({volume:e})})}getVideoRef(){const{forwardRef:e}=this.props;if(!_e()(e)){if("function"==typeof e)return t=>{e(t),this.videoRef={current:t}};if("[object Object]"===Object.prototype.toString.call(e))return this.videoRef=e,e}return this.videoRef}static getDerivedStateFromProps(e,t){const n={};return Re(e.src)||e.src===t.src||(n.src=e.src),n}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}render(){const{markers:e,qualityList:t,routeList:n,width:r,height:i,autoPlay:s,style:o,className:a,loop:l,captionsSrc:c,crossOrigin:d,theme:u}=this.props,{isPlaying:p,playbackRate:f,playbackRateList:m,isMirror:g,currentTime:y,totalTime:v,currentQuality:b,currentRoute:x,src:E,bufferedValue:C,showControls:S}=this.state;return h().createElement(Jt,{componentName:"VideoPlayer"},(_=>h().createElement("div",{className:w()(`${AJ}`,a,{[`${AJ}-mirror`]:g}),style:Object.assign({width:r,height:i},o),ref:this.videoWrapperRef,onMouseEnter:this.handleMouseEnterWrapper,onMouseLeave:this.handleMouseLeaveWrapper},h().createElement("div",{className:w()(`${AJ}-wrapper`,{[`${oJ.PREFIX}-wrapper-${u}`]:u})},h().createElement("video",{ref:this.getVideoRef(),autoPlay:s,loop:l,controls:!1,crossOrigin:d,src:E,onTimeUpdate:this.handleTimeUpdate,onDurationChange:this.handleDurationChange,onPlay:this.handleVideoPlay,onPause:this.handleVideoPause,onClick:()=>{this.foundation.handlePlayOrPause()},onError:this.handleError,onCanPlay:this.handleCanPlay,onWaiting:()=>this.handleWaiting(_),onStalled:()=>this.handleStalled(_),onProgress:this.handleProgress,onEnded:this.handleEnded},h().createElement("track",{kind:"captions",src:c})),this.isResourceNotFound()&&this.renderResourceNotFound(_)),this.renderPoster(),this.renderPauseIcon(),this.renderError(_),this.renderNotification(),h().createElement("div",{className:w()(`${oJ.PREFIX_CONTROLS}`,{[`${oJ.PREFIX_CONTROLS}-hide`]:!S})},h().createElement(MJ,{key:v,value:y,max:v,onChange:this.handleTimeChange,markers:e,bufferedValue:C}),h().createElement("div",{className:w()(`${oJ.PREFIX_CONTROLS}-menu`)},h().createElement("div",{className:w()(`${oJ.PREFIX_CONTROLS}-menu-left`)},this.renderIconButton(p?h().createElement(NZ,null):h().createElement(DZ,null),p?this.handlePause:this.handlePlay,lJ),this.renderIconButton(h().createElement(AZ,{rotate:180}),p?this.handlePause:this.handlePlay,cJ),this.renderTime(),this.renderVolume(),this.renderDropdownButton(f,m,this.handleRateChange,uJ,_)),h().createElement("div",{className:w()(`${oJ.PREFIX_CONTROLS}-menu-right`)},t&&t.length>0&&this.renderDropdownButton(b,t,this.handleQualityChange,pJ,_),n&&n.length>0&&this.renderDropdownButton(x,n,this.handleRouteChange,fJ,_),this.renderIconButton(h().createElement(_J,null),(()=>this.handleMirror(_)),mJ),this.renderIconButton(this.foundation.checkFullScreen()?h().createElement(kJ,null):h().createElement(OJ,null),this.handleFullscreen,gJ),this.renderIconButton(h().createElement(TJ,null),this.handlePictureInPicture,yJ)))))))}}NJ.defaultProps={autoPlay:!1,clickToPlay:!0,defaultPlaybackRate:wJ,controlsList:[lJ,cJ,dJ,hJ,uJ,pJ,fJ,mJ,gJ,yJ],loop:!1,muted:!1,playbackRateList:[{label:"2.0x",value:2},{label:"1.5x",value:1.5},{label:"1.25x",value:1.25},{label:"1.0x",value:1},{label:"0.75x",value:.75}],seekTime:bJ,theme:aJ,volume:vJ};const DJ=h().forwardRef(((e,t)=>h().createElement(NJ,Object.assign({},e,{forwardRef:t})))),LJ=DJ,FJ={PREFIX:`${C}-feedback`};var jJ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class $J extends c{constructor(e){super(Object.assign({},e)),this.handleRadioChange=e=>{const{value:t}=e.target;this._adapter.notifyRadioChange(e),this._adapter.notifyValueChange(t)},this.handleEmojiReasonChange=(e,t)=>{this._adapter.notifyTextAreaChange(e,t);const n=this._adapter.getState("value"),r=Object.assign(Object.assign({},n),{text:e});this._adapter.notifyValueChange(r)},this.handleTextChange=(e,t)=>{this._adapter.notifyTextAreaChange(e,t),this._adapter.notifyValueChange(e)},this.handleEmojiClick=e=>{const{value:t}=e.currentTarget.dataset;this._adapter.notifyValueChange({emoji:t})},this.handleCheckboxChange=e=>{this._adapter.notifyCheckBoxChange(e),this._adapter.notifyValueChange(e)},this.handleCancel=e=>{var t;const n=this._adapter.notifyCancel(e);qb(n)?(this._adapter.setState({onCancelReturnPromiseStatus:"pending"}),null===(t=null==n?void 0:n.then((()=>{this._adapter.setState({onCancelReturnPromiseStatus:"fulfilled",value:null})})))||void 0===t||t.catch((e=>{throw this._adapter.setState({onCancelReturnPromiseStatus:"rejected"}),e}))):this._adapter.setValue(null)},this.handleSubmit=e=>{var t;const n=this._adapter.notifyOk(e);qb(n)?(this._adapter.setState({onOKReturnPromiseStatus:"pending"}),null===(t=null==n?void 0:n.then((()=>{this._adapter.setState({onOKReturnPromiseStatus:"fulfilled",value:null})})))||void 0===t||t.catch((e=>{throw this._adapter.setState({onOKReturnPromiseStatus:"rejected"}),e}))):this._adapter.setValue(null)},this.handleModalOk=e=>{const t=this._adapter.notifyOk(e);return qb(t)?null==t?void 0:t.then((()=>(this._adapter.setState({value:null}),Promise.resolve()))):(this._adapter.setValue(null),null)},this.handleModalCancel=e=>{const t=this._adapter.notifyCancel(e);return qb(t)?null==t?void 0:t.then((()=>(this._adapter.setState({value:null}),Promise.resolve()))):(this._adapter.setState({value:null}),null)},this.disableSubmitButton=()=>{const e=this.getState("value");return!Boolean(e)||Array.isArray(e)&&0===e.length},this.getRestProps=()=>{const e=this._adapter.getProps(),{className:t,children:n,type:r,mode:i}=e,s=jJ(e,["className","children","type","mode"]);let o=["mode","type","onValueChange","textAreaProps","radioGroupProps","checkboxGroupProps","renderContent","onCancel","onOk"];"popup"===i&&(o=o.concat(["okButtonProps","cancelButtonProps"]));return W()(s,o)}}}__webpack_require__("mCLW");var BJ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const{Emoji:VJ}={MODE:["modal","popup"],TYPE:["text","emoji","radio","checkbox","custom"],Emoji:{bad:"😞",normal:"😐",good:"😃"}},zJ=FJ.PREFIX;class HJ extends f{constructor(e){super(e),this.textNode=()=>{const{textAreaProps:e}=this.props;return h().createElement(Jx,Object.assign({onChange:this.foundation.handleTextChange,placeholder:"Provider additional feedback"},e))},this.emojiNode=()=>{const{value:e}=this.state,{textAreaProps:t}=this.props,{emoji:n}=null!=e?e:{};return h().createElement(h().Fragment,null,h().createElement("div",{className:`${zJ}-emoji-container`},Object.values(VJ).map((e=>h().createElement("span",{key:e,className:w()(`${zJ}-emoji-item`,{[`${zJ}-emoji-item-selected`]:e===n}),"data-value":e,onClick:this.foundation.handleEmojiClick},e)))),n===VJ.bad&&h().createElement(Jx,Object.assign({onChange:this.foundation.handleEmojiReasonChange,placeholder:"Provider additional feedback(optional)"},t)))},this.radioNode=()=>{const{radioGroupProps:e}=this.props;return h().createElement("div",{className:`${zJ}-radio-container`},h().createElement($S,Object.assign({direction:"vertical",onChange:this.foundation.handleRadioChange},W()(e,"onChange"))))},this.checkboxNode=()=>{const{checkboxGroupProps:e}=this.props;return h().createElement("div",{className:`${zJ}-checkbox-container`},h().createElement(dd,Object.assign({direction:"vertical",onChange:this.foundation.handleCheckboxChange},W()(e,"onChange"))))},this.getRealChildren=()=>{const{type:e,renderContent:t,children:n}=this.props;let r=null;switch(e){case"custom":r=n;break;case"text":r=this.textNode();break;case"emoji":r=this.emojiNode();break;case"radio":r=this.radioNode();break;case"checkbox":r=this.checkboxNode()}return"function"==typeof t&&(r=t(r)),r},this.renderFooter=e=>{const{footer:t,cancelButtonProps:n,okButtonProps:r}=this.props,{onCancelReturnPromiseStatus:i,onOKReturnPromiseStatus:s}=this.state;return t||h().createElement("div",{className:`${zJ}-footer`},h().createElement(vs,Object.assign({type:"primary",onClick:this.foundation.handleCancel,loading:"pending"===i},n),e.cancel),h().createElement(vs,Object.assign({type:"primary",theme:"solid",disabled:this.disableSubmitButton(),onClick:this.foundation.handleSubmit,loading:"pending"===s},r),e.submit))},this.disableSubmitButton=()=>{const{value:e}=this.state;return!Boolean(e)||Array.isArray(e)&&0===e.length},this.state={value:null,onOKReturnPromiseStatus:"fulfilled",onCancelReturnPromiseStatus:"fulfilled"},this.foundation=new $J(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setValue:e=>{this.setState({value:e})},notifyValueChange:e=>{this.setState({value:e}),this.props.onValueChange(e)},notifyClose:()=>this.props.afterClose(),notifyCancel:e=>this.props.onCancel(e),notifyOk:e=>this.props.onOk(e),notifyTextAreaChange:(e,t)=>{const{textAreaProps:n={}}=this.props,{onChange:r}=n;null==r||r(e,t)},notifyCheckBoxChange:e=>{const{checkboxGroupProps:t={}}=this.props,{onChange:n}=t;null==n||n(e)},notifyRadioChange:e=>{var t;const{onChange:n}=null===(t=this.props)||void 0===t?void 0:t.radioGroupProps;null==n||n(e)}})}render(){const e=this.props,{className:t,children:n,type:r,mode:i}=e,s=(BJ(e,["className","children","type","mode"]),this.foundation.getRestProps()),o=this.getRealChildren(),a=this.disableSubmitButton(),l=w()(zJ,{[`${zJ}-${r}`]:r,className:t});return h().createElement(Jt,{componentName:"Feedback"},((e,t)=>"modal"===i?h().createElement(xw,Object.assign({okButtonProps:{disabled:a},okText:e.submit,cancelText:e.cancel,className:l},s,{onOk:this.foundation.handleModalOk,onCancel:this.foundation.handleModalCancel}),o):h().createElement(l_,Object.assign({mask:!1,disableScroll:!1,canVerticalSetWidth:!0,placement:"bottom",height:"auto",className:l,footer:this.renderFooter(e),onCancel:this.foundation.handleCancel},s),o)))}}HJ.__SemiComponentName__="Feedback",HJ.defaultProps=he(HJ.__SemiComponentName__,{mode:"popup",type:"emoji",onValueChange:i(),onCancel:i(),onOk:i(),afterClose:i()});const UJ={PREFIX:`${C}-floatButton`},KJ={PREFIX:`${C}-floatButtonGroup`};__webpack_require__("2mXR");const WJ=UJ.PREFIX;class GJ extends f{constructor(e){super(e),this.handleClick=e=>{const{href:t,target:n,onClick:r,disabled:i}=this.props;i||(t&&("_blank"===n?window.open(t,"_blank"):window.location.href=t),r&&r(e))}}render(){const{className:e,style:t,colorful:n,size:r,icon:i,badge:s,shape:o,disabled:a}=this.props,l=h().createElement("div",{className:w()(`${WJ}-body`,{[`${WJ}-${o}`]:o,[`${WJ}-colorful`]:n,[`${WJ}-disabled`]:a,[`${WJ}-${r}`]:r})},i);return h().createElement("div",{style:t,className:w()(WJ,e,{[`${WJ}-${r}`]:r,[`${WJ}-${o}`]:o}),onClick:this.handleClick},s?h().createElement(Xi,Object.assign({},s),l):l)}}GJ.defaultProps={shape:"round",colorful:!1,size:"default"};const qJ=KJ.PREFIX;class XJ extends f{constructor(e){super(e),this.handleClick=e=>{var t,n;const r=e.target.dataset.value;null===(n=(t=this.props).onClick)||void 0===n||n.call(t,r,e)}}render(){const{className:e,style:t,disabled:n,items:r}=this.props;return h().createElement("div",{className:w()(qJ,e,{[`${qJ}-disabled`]:n}),style:t,onClick:this.handleClick},r.map(((e,t)=>e.badge?h().createElement(Xi,Object.assign({key:t},e.badge),h().createElement("div",{className:w()(`${qJ}-item`),"data-value":e.value},e.icon,e.content)):h().createElement("div",{key:t,className:w()(`${qJ}-item`),"data-value":e.value},e.icon,e.content))))}}XJ.defaultProps={shape:"round",type:"default",size:"medium"};__webpack_require__("5QW3");const YJ={PREFIX:`${C}-ai-chat-dialogue`,PREFIX_ACTION:`${C}-ai-chat-dialogue-action`,PREFIX_CONTENT:`${C}-ai-chat-dialogue-content`,PREFIX_REASONING:`${C}-ai-chat-dialogue-reasoning`,PREFIX_ANNOTATION:`${C}-ai-chat-dialogue-annotation`,PREFIX_REFERENCES:`${C}-ai-chat-dialogue-references`,PREFIX_REFERENCE:`${C}-ai-chat-dialogue-reference`,PREFIX_STEP:`${C}-ai-chat-dialogue-step`,PREFIX_CODE:`${C}-ai-chat-dialogue-code`,PREFIX_HINT:`${C}-ai-chat-dialogue-hint`},ZJ={MESSAGE:"message",OUTPUT_TEXT:"output_text",REFUSAL:"refusal",FILE_SEARCH_CALL:"file_search_call",FUNCTION_CALL:"function_call",WEB_SEARCH_CALL:"web_search_call",REASONING:"reasoning",MCP_CALL:"mcp_call",CUSTOM_TOOL_CALL:"custom_tool_call",IMAGE_GENERATION_CALL:"image_generation_call",MCP_LIST_TOOLS:"mcp_list_tools",INPUT_TEXT:"input_text",INPUT_IMAGE:"input_image",INPUT_FILE:"input_file",STEPS:"steps",ITEM_REFERENCE:"item_reference"},JJ={SCROLL_ANIMATION_TIME:300,SHOW_SCROLL_GAP:100,STATUS:{QUEUED:"queued",IN_PROGRESS:"in_progress",INCOMPLETE:"incomplete",COMPLETED:"completed",FAILED:"failed",CANCELLED:"cancelled"},ROLE:{USER:"user",ASSISTANT:"assistant",SYSTEM:"system"},DIALOGUE_ALIGN:{LEFT_RIGHT:"leftRight",LEFT_ALIGN:"leftAlign"},MODE:{BUBBLE:"bubble",NO_BUBBLE:"noBubble",USER_BUBBLE:"userBubble"},SEND_HOT_KEY:{ENTER:"enter",SHIFT_PLUS_ENTER:"shift+enter"},MESSAGE_ITEM_TYPE:ZJ,FINISH_REASON:{STOP:"stop",LENGTH:"length",CONTENT_FILTER:"content_filter",TOOL_CALLS:"tool_calls",FUNCTION_CALL:"function_call"},TEXT_TYPES:[ZJ.INPUT_TEXT,ZJ.OUTPUT_TEXT,ZJ.REFUSAL],TOOL_CALL_TYPES:[ZJ.FUNCTION_CALL,ZJ.CUSTOM_TOOL_CALL,ZJ.MCP_CALL],DOCUMENT_TYPES:["doc","docx","txt","word"],IMAGE_TYPES:["jpeg","jpg","png","gif"],PDF_TYPES:["pdf"],EXCEL_TYPES:["excel","xlsx","xls"],CODE_TYPES:["json","js","ts","jsx","tsx"],VIDEO_TYPES:["mp4","avi","mov","wmv","flv","mkv"]};var QJ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const eQ=nn((function(e){const{fill:t}=e,n=QJ(e,["fill"]),[r,i]=Mi(t,2);return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},n),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.72 1.92a3.99 3.99 0 0 1-1.8 1.8 4.28 4.28 0 0 1-.51.21.6.6 0 0 0 0 1.14 3.99 3.99 0 0 1 .5.2 3.99 3.99 0 0 1 1.81 1.81 4.4 4.4 0 0 1 .21.51.6.6 0 0 0 1.14 0 3.98 3.98 0 0 1 .2-.5 3.99 3.99 0 0 1 1.81-1.81 4.2 4.2 0 0 1 .51-.21.6.6 0 0 0 0-1.14 3.99 3.99 0 0 1-.5-.2 3.99 3.99 0 0 1-1.81-1.81 4.4 4.4 0 0 1-.21-.51.6.6 0 0 0-1.14 0 3.98 3.98 0 0 1-.2.5Zm.78 1.47c-.31.42-.69.8-1.11 1.11.42.31.8.69 1.11 1.11.31-.42.69-.8 1.11-1.11-.42-.31-.8-.69-1.11-1.11Z",fill:r}),d.createElement("path",{d:"M10 2a1 1 0 0 1 0 2 6 6 0 1 0 6 6 1 1 0 1 1 2 0 8 8 0 0 1-1.68 4.9l5.39 5.4a1 1 0 1 1-1.42 1.4l-5.39-5.38A8 8 0 1 1 10 2Z",fill:i}))}),"ai_search_level_2"),tQ=YJ.PREFIX_REASONING,nQ=e=>{const{status:t,summary:n,content:r,markdownRenderProps:i,customRenderer:s}=e,o="completed"!==t,[a,l]=(0,d.useState)(o),c=(0,d.useCallback)((()=>{l(!a)}),[a]),u=(0,d.useCallback)((()=>n&&n.length>0?n.map((e=>e.text)).join("\n"):r&&r.length>0?r.map((e=>e.text)).join("\n"):""),[n,r]),p=(0,d.useCallback)((e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c())}),[c]);return h().createElement("div",{role:"button",tabIndex:0,className:`${tQ}-wrapper`,onClick:c,onKeyDown:p},h().createElement("div",{className:`${tQ}-header`},h().createElement("div",{className:`${tQ}-header-prefix`},h().createElement(eQ,null)),h().createElement("div",{className:`${tQ}-header-title`},h().createElement(Jt,{componentName:"AIChatDialogue"},(e=>"completed"===t?e.reasoning.completed:e.reasoning.thinking))),h().createElement("div",{className:`${tQ}-header-suffix`},a?h().createElement($i,{onClick:c}):h().createElement(Hc,{onClick:c}))),h().createElement(vf,{isOpen:a},h().createElement("div",{className:`${tQ}-content`},s?s(e):h().createElement(nW,Object.assign({format:"md",raw:u()},i)))))};const rQ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.36 12a8.36 8.36 0 1 1-16.72 0 8.36 8.36 0 0 1 16.72 0ZM23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-5.45-2.15A1.32 1.32 0 1 0 15.7 8l-5.67 5.66-2.37-2.36a1.32 1.32 0 0 0-1.86 1.86l3.3 3.3a1.32 1.32 0 0 0 1.86 0l6.6-6.6Z",fill:"currentColor"}))}),"story_stroked"),iQ=YJ.PREFIX_STEP,{PREFIX_CONTENT:sQ}=YJ,oQ=YJ.PREFIX_ANNOTATION,aQ=e=>{const{annotation:t,description:n,maxCount:r,onClick:i}=e,s=(0,d.useCallback)((e=>{null==i||i(e,t)}),[t,i]),o=(0,d.useCallback)(((e,t)=>h().createElement(Qr,{className:`${oQ}-content-logo-renderMore`,size:"extra-extra-small",alt:"more"},`+${e}`)),[]),a=(0,d.useCallback)((e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s())}),[s]);return h().createElement("div",{role:"button",tabIndex:0,className:`${oQ}-wrapper`,onClick:s,onKeyDown:a},h().createElement("div",{className:`${oQ}-content`},h().createElement(si,{maxCount:r,size:"extra-extra-small",overlapFrom:"end",renderMore:o},t.map(((e,t)=>e.logo&&h().createElement(Qr,{className:`${oQ}-content-logo`,key:t,src:e.logo,alt:e.title})))),h().createElement("div",{className:`${oQ}-content-description`},n||h().createElement(Jt,{componentName:"AIChatDialogue"},(e=>`${t.length} ${e.annotationText}`))),h().createElement("div",{className:`${oQ}-content-icon`},h().createElement(Al,null))))},{PREFIX_CODE:lQ}=YJ,cQ=e=>{const[t,n]=(0,d.useState)(!1),r=(0,d.useMemo)((()=>{var t;return WK()(null===(t=e.className)||void 0===t?void 0:t.split("-"),-1)}),[e.className]),i=(0,d.useCallback)((()=>{Ot()(e.children),n(!0),setTimeout((()=>{n(!1)}),2e3)}),[e.children]);return r?h().createElement("div",{className:`${lQ}`},h().createElement("div",{className:`${lQ}-topSlot`},h().createElement("span",{className:`${lQ}-topSlot-type`},r),h().createElement("span",{className:`${lQ}-topSlot-copy`},t?h().createElement("button",{className:`${lQ}-topSlot-copy-wrapper`},h().createElement(sn,null)):h().createElement("button",{className:`${lQ}-topSlot-copy-wrapper`,onClick:i},h().createElement(BW,null)))),QK(e)):QK(e)},{PREFIX:dQ}=YJ,hQ=h().memo((e=>{const{role:t,message:n,customRenderFunc:r}=e,i=(0,d.useMemo)((()=>h().createElement("span",{className:`${dQ}-title`},null==t?void 0:t.name)),[t]);return r&&"function"==typeof r?r({role:t,message:n,defaultTitle:i}):i})),{PREFIX:uQ}=YJ,pQ=h().memo((e=>{const{role:t,customRenderFunc:n,continueSend:r,message:i}=e,s=(0,d.useMemo)((()=>{const{avatar:e}=t;return h().createElement(Qr,{className:w()(`${uQ}-avatar`,{[`${uQ}-avatar-hidden`]:r}),src:e,size:"extra-small"})}),[r,t]);return n&&"function"==typeof n?n({role:t,defaultAvatar:s,message:i}):s})),fQ=pQ;const mQ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 5.5a3.5 3.5 0 1 1 1 2.45l-5.13 3.11a3.5 3.5 0 0 1 .03 1.79l5.22 3.08A3.49 3.49 0 0 1 21 18.5a3.5 3.5 0 1 1-6.9-.85l-5.22-3.08A3.49 3.49 0 0 1 3 12a3.5 3.5 0 0 1 5.8-2.63l5.27-3.19A3.51 3.51 0 0 1 14 5.5ZM17.5 4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm-11 6.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm9.5 8a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z",fill:"currentColor"}))}),"share_stroked");const gQ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.58 2.59a2 2 0 0 0-2.83 0L13.62 4.7l-.7.7-9.8 9.8a1 1 0 0 0-.28.55l-.83 5.08a1 1 0 0 0 1.15 1.15l5.08-.83a1 1 0 0 0 .55-.28l9.8-9.8.7-.7 2.12-2.13a2 2 0 0 0 0-2.83l-2.83-2.83Zm0 5.66L20 6.84 17.16 4l-1.41 1.42 2.83 2.83Zm-1.42 1.42-2.83-2.83-9.56 9.56-.56 3.39 3.39-.56 9.56-9.56Z",fill:"currentColor"}))}),"edit_stroked");const yQ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M7.5 12a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z",fill:"currentColor"}),d.createElement("path",{d:"M15 12a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z",fill:"currentColor"}),d.createElement("path",{d:"M20 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z",fill:"currentColor"}))}),"more_stroked");class vQ extends c{constructor(e){super(Object.assign({},e)),this.destroy=()=>{this._adapter.unregisterClickOutsideHandler()},this.copyMessage=()=>{this._adapter.notifyMessageCopy(),this._adapter.copyToClipboardAndToast()},this.resetMessage=()=>{this._adapter.notifyResetMessage()},this.likeMessage=()=>{this._adapter.notifyLikeMessage()},this.dislikeMessage=()=>{this._adapter.notifyDislikeMessage()},this.shareMessage=()=>{this._adapter.notifyShareMessage()},this.editMessage=()=>{this._adapter.notifyEditMessage()},this.deleteMessage=()=>{this._adapter.notifyDeleteMessage(),this.hideMoreDropdown()},this.showMoreDropdown=()=>{this._adapter.setVisible(!0),this._adapter.setShowAction(!0),this._adapter.registerClickOutsideHandler(this.hideMoreDropdown)},this.hideMoreDropdown=()=>{this._adapter.setVisible(!1),setTimeout((()=>{this._adapter.setShowAction(!1)}),150),this._adapter.unregisterClickOutsideHandler()}}}const{PREFIX_ACTION:bQ}=YJ,{ROLE:wQ,STATUS:xQ}=JJ;const EQ=class extends f{constructor(e){super(e),this.showDeleteModal=()=>{xw.warning({title:h().createElement(Jt,{componentName:"AIChatDialogue"},(e=>e.deleteConfirm)),content:h().createElement(Jt,{componentName:"AIChatDialogue"},(e=>e.deleteContent)),onOk:this.foundation.deleteMessage}),this.foundation.hideMoreDropdown()},this.copyNode=()=>h().createElement(vs,{key:"copy",theme:"borderless",icon:h().createElement(BW,null),type:"tertiary",onClick:this.foundation.copyMessage,className:`${bQ}-btn`}),this.resetNode=()=>h().createElement(vs,{key:"reset",theme:"borderless",icon:h().createElement(JW,{className:`${bQ}-icon-redo`}),type:"tertiary",onClick:this.foundation.resetMessage,className:`${bQ}-btn`}),this.shareNode=()=>h().createElement(vs,{key:"share",theme:"borderless",icon:h().createElement(mQ,null),type:"tertiary",onClick:this.foundation.shareMessage}),this.likeNode=()=>{const{message:e}=this.props,{like:t}=e;return h().createElement(vs,{key:"like",theme:"borderless",icon:t?h().createElement(YW,null):h().createElement(ZW,null),type:"tertiary",className:`${bQ}-btn`,onClick:()=>this.foundation.likeMessage()})},this.dislikeNode=()=>{const{message:e}=this.props,{dislike:t}=e;return h().createElement(vs,{theme:"borderless",key:"dislike",icon:t?h().createElement(YW,{className:`${bQ}-icon-flip`}):h().createElement(ZW,{className:"semi-chat-chatBox-action-icon-flip"}),type:"tertiary",className:`${bQ}-btn`,onClick:()=>this.foundation.dislikeMessage()})},this.editNode=()=>h().createElement(vs,{key:"edit",theme:"borderless",icon:h().createElement(gQ,null),type:"tertiary",onClick:()=>this.foundation.editMessage()}),this.moreNode=()=>h().createElement(Ww,{trigger:"custom",position:"bottomLeft",className:`${bQ}-dropdown`,visible:this.state.visible,onCancel:this.foundation.hideMoreDropdown,spacing:12,stopPropagation:!0,render:h().createElement(Ww.Menu,null,h().createElement(Ww.Item,{onClick:()=>this.showDeleteModal()},h().createElement(hW,null)," ",h().createElement(Jt,{componentName:"AIChatDialogue"},(e=>e.delete))))},h().createElement("span",{ref:this.dropdownTriggerRef},h().createElement(vs,{key:"more",theme:"borderless",icon:h().createElement(yQ,null),type:"tertiary",onClick:this.foundation.showMoreDropdown}))),this.foundation=new vQ(this.adapter),this.state={visible:!1,showAction:!1},this.copySuccessNode=null,this.clickOutsideHandler=null,this.containerRef=h().createRef(),this.dropdownTriggerRef=h().createRef()}componentDidMount(){this.copySuccessNode=h().createElement(Jt,{componentName:"AIChatDialogue"},(e=>e.copySuccess))}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyMessageCopy:()=>{const{message:e,onMessageCopy:t}=this.props;null==t||t(e)},copyToClipboardAndToast:()=>{var e;const{message:t}=this.props;if("string"==typeof(null==t?void 0:t.content))Ot()(t.content);else if(Array.isArray(null==t?void 0:t.content)){const n=null===(e=t.content)||void 0===e?void 0:e.map((e=>{var t;return"string"==typeof(null==e?void 0:e.content)?null==e?void 0:e.content:null===(t=null==e?void 0:e.content)||void 0===t?void 0:t.map((e=>null==e?void 0:e.text)).join("")})).join("");Ot()(n)}rP.success({content:this.copySuccessNode})},notifyLikeMessage:()=>{const{message:e,onMessageGoodFeedback:t}=this.props;null==t||t(e)},notifyDislikeMessage:()=>{const{message:e,onMessageBadFeedback:t}=this.props;null==t||t(e)},notifyResetMessage:()=>{const{message:e,onMessageReset:t}=this.props;null==t||t(e)},notifyShareMessage:()=>{const{message:e,onMessageShare:t}=this.props;null==t||t(e)},notifyEditMessage:()=>{const{message:e,onMessageEdit:t}=this.props;null==t||t(e)},notifyDeleteMessage:()=>{const{message:e,onMessageDelete:t}=this.props;null==t||t(e)},setVisible:e=>{this.setState({visible:e})},setShowAction:e=>{this.setState({showAction:e})},registerClickOutsideHandler:e=>{this.clickOutsideHandler&&this.adapter.unregisterClickOutsideHandler(),this.clickOutsideHandler=t=>{let n=this.dropdownTriggerRef&&this.dropdownTriggerRef.current;const r=t.target,i=t.composedPath&&t.composedPath()||[r];!n||n.contains(r)||i.includes(n)||e()},window.addEventListener("mousedown",this.clickOutsideHandler)},unregisterClickOutsideHandler:()=>{this.clickOutsideHandler&&(window.removeEventListener("mousedown",this.clickOutsideHandler),this.clickOutsideHandler=null)}})}render(){const{message:e,isLastChat:t}=this.props,{showAction:n}=this.state,{role:r,status:i=xQ.COMPLETED}=e,s=i===xQ.COMPLETED,o=r!==wQ.USER&&s,a=t&&r===wQ.ASSISTANT,l=i!==xQ.IN_PROGRESS&&i!==xQ.INCOMPLETE,c=r===wQ.USER,d=w()(bQ,{[`${bQ}-show`]:a&&l||n,[`${bQ}-hidden`]:!l}),{customRenderFunc:u}=this.props;if(u){const t=[],n={};if(s){const e=this.copyNode();t.push(e),n.copyNode=e}if(o){const e=this.likeNode();t.push(e),n.likeNode=e;const r=this.dislikeNode();t.push(r),n.dislikeNode=r}if(a){const e=this.resetNode();t.push(e),n.resetNode=e}const r=this.moreNode();return t.push(r),n.moreNode=r,u({message:e,defaultActions:t,className:d,defaultActionsObj:n})}return h().createElement("div",{className:d,ref:this.containerRef},s&&this.copyNode(),a&&this.resetNode(),s&&this.shareNode(),c&&this.editNode(),o&&this.likeNode(),o&&this.dislikeNode(),this.moreNode())}};const CQ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M12.6.67a1 1 0 0 1 .6.29l4.17 4.17a1 1 0 0 1 .3.7V17.5c0 1.01-.82 1.83-1.84 1.83H4.17a1.83 1.83 0 0 1-1.84-1.83v-15c0-1.01.82-1.83 1.84-1.83h8.43Zm.95 6.69a1 1 0 0 0-1.2.76l-.64 3.05-.81-1.62a1 1 0 0 0-1.72-.12l-.07.12-.81 1.62-.65-3.05a1 1 0 0 0-1.96.42l1.25 5.84a1 1 0 0 0 1.87.23l1.2-2.37 1.18 2.37a1 1 0 0 0 1.87-.23l1.25-5.84a1 1 0 0 0-.76-1.18Z",fill:"currentColor"}))}),"word");const SQ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M12.6.67a1 1 0 0 1 .6.29l4.17 4.17a1 1 0 0 1 .3.7V17.5c0 1.01-.82 1.83-1.84 1.83H4.17a1.83 1.83 0 0 1-1.84-1.83v-15c0-1.01.82-1.83 1.84-1.83h8.43ZM7.5 6.5a1 1 0 0 0-.17.02H7.3l-.05.01-.04.01a1 1 0 0 0-.31.16l-.04.03a1 1 0 0 0-.36.77v6.67a1 1 0 0 0 2 0v-2.34h4a1 1 0 0 0 1-1V7.5a1 1 0 0 0-1-1h-5Zm4 3.33h-3V8.5h3v1.33Z",fill:"currentColor"}))}),"pdf");const _Q=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M12.6.67a1 1 0 0 1 .6.29l4.17 4.17a1 1 0 0 1 .3.7V17.5c0 1.01-.82 1.83-1.84 1.83H4.17a1.83 1.83 0 0 1-1.84-1.83v-15c0-1.01.82-1.83 1.84-1.83h8.43ZM7.92 6.5a1 1 0 0 0-1 1v6.67a1 1 0 0 0 1 1h4.16a1 1 0 0 0 0-2H8.92v-1.34h3.16a1 1 0 0 0 0-2H8.92V8.5h3.16a1 1 0 0 0 0-2H7.92Z",fill:"currentColor"}))}),"excel");const kQ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.49 4.19a1.5 1.5 0 0 0-2.98-.38l-2 16a1.5 1.5 0 1 0 2.98.38l2-16ZM8.06 5.94a1.5 1.5 0 0 1 0 2.12L4.12 12l3.94 3.94a1.5 1.5 0 1 1-2.12 2.12l-5-5a1.5 1.5 0 0 1 0-2.12l5-5a1.5 1.5 0 0 1 2.12 0Zm7.88 0a1.5 1.5 0 0 1 2.12 0l5 5a1.5 1.5 0 0 1 0 2.12l-5 5a1.5 1.5 0 0 1-2.12-2.12L19.88 12l-3.94-3.94a1.5 1.5 0 0 1 0-2.12Z",fill:"currentColor"}))}),"code");const OQ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5Zm4 5.87a1 1 0 0 1 1.55-.83l6.2 4.13a1 1 0 0 1 0 1.66l-6.2 4.13A1 1 0 0 1 9 16.13V7.87Z",fill:"currentColor"}))}),"video");const TQ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 4c0-1.1.9-2 2-2h18a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2h-9.22L7 21.86A1 1 0 0 1 5.5 21v-2H3a2 2 0 0 1-2-2V4Zm20 0H3v13h3c.83 0 1.5.67 1.5 1.5v.73l3.25-1.95a2 2 0 0 1 1.03-.28H21V4Zm-7.7 3.3a1 1 0 0 1 1.4 0l3 3a1 1 0 0 1 0 1.4l-3 3a1 1 0 0 1-1.4-1.4l1.29-1.3H8a1 1 0 1 1 0-2h6.59l-1.3-1.3a1 1 0 0 1 0-1.4Z",fill:"currentColor"}))}),"send_msg_stroked");const PQ=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.53 14.53A7 7 0 0 1 1.5 5.4c.12-.31.53-.37.76-.14L5.3 8.3a1 1 0 0 0 1.42 0l1.58-1.58a1 1 0 0 0 0-1.42L5.26 2.26c-.23-.23-.17-.64.14-.76a7 7 0 0 1 9.13 9.03l7.56 7.56a2 2 0 0 1 0 2.82L20.9 22.1a2 2 0 0 1-2.82 0l-7.56-7.56Z",fill:"currentColor"}))}),"wrench"),IQ=YJ.PREFIX_REFERENCES,MQ=YJ.PREFIX_REFERENCE,{DOCUMENT_TYPES:RQ,IMAGE_TYPES:AQ,PDF_TYPES:NQ,EXCEL_TYPES:DQ,CODE_TYPES:LQ,VIDEO_TYPES:FQ}=JJ,jQ=e=>{const{references:t}=e,n=e=>e.url&&(e=>{if(e){const t=e.split(".").pop();return AQ.includes(t)}return!1})(e.name)?h().createElement(cA,{className:`${MQ}-img`,src:e.url,width:16,height:16}):null;return h().createElement("div",{className:IQ},t.map((e=>h().createElement("div",{className:MQ,key:e.id},h().createElement(TQ,null),h().createElement("span",{className:`${MQ}-content`},(e=>{if(e){const t=e.split(".").pop();let n=null,r="";return RQ.includes(t)?(n=h().createElement(CQ,{size:"small"}),r="word"):NQ.includes(t)?(n=h().createElement(SQ,{size:"small"}),r="pdf"):DQ.includes(t)?(n=h().createElement(_Q,{size:"small"}),r="excel"):LQ.includes(t)?(n=h().createElement(kQ,{size:"small"}),r="code"):FQ.includes(t)&&(n=h().createElement(OQ,{size:"small"}),r="video"),n&&h().createElement("span",{className:w()(`${MQ}-icon`,{[`${MQ}-icon-${r}`]:r})},n)}return null})(e.name),n(e),h().createElement("span",{className:`${MQ}-name`},e.name||e.content))))))};var $Q=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const{PREFIX_CONTENT:BQ}=YJ,{STATUS:VQ,MODE:zQ,ROLE:HQ,MESSAGE_ITEM_TYPE:UQ,TEXT_TYPES:KQ,TOOL_CALL_TYPES:WQ,DOCUMENT_TYPES:GQ,IMAGE_TYPES:qQ,PDF_TYPES:XQ,EXCEL_TYPES:YQ,CODE_TYPES:ZQ,VIDEO_TYPES:JQ}=JJ,QQ=h().memo((e=>{const{src:t,isList:n,msg:r,onImageClick:i,isLastImage:s}=e;return h().createElement(cA,{className:w()(`${BQ}-img`,{[`${BQ}-img-list`]:n,[`${BQ}-img-last`]:s}),src:t,onClick:()=>{i&&i(r)}})})),e0=h().memo((e=>{var t,n,r;const{onFileClick:i,disabledFileItemClick:s,role:o,onReferenceClick:a,showReference:l,isLastFile:c}=e,u=$Q(e,["onFileClick","disabledFileItemClick","role","onReferenceClick","showReference","isLastFile"]),p=null===(t=null==u?void 0:u.filename)||void 0===t?void 0:t.split(".").pop(),f=null!=p?p:null===(r=null===(n=null==u?void 0:u.fileInstance)||void 0===n?void 0:n.type)||void 0===r?void 0:r.split("/").pop(),m=(0,d.useCallback)(((e,t)=>{let n=null,r="";return GQ.includes(e)?(r="word",n=h().createElement(CQ,{size:"extra-large",className:`${BQ}-file-icon`})):qQ.includes(e)?(r="image",n=h().createElement("div",{className:`${BQ}-file-icon`,style:{backgroundImage:`url(${t.file_url})`}})):XQ.includes(e)?(r="pdf",n=h().createElement(SQ,{size:"extra-large",className:`${BQ}-file-icon`})):YQ.includes(e)?(r="excel",n=h().createElement(_Q,{size:"extra-large",className:`${BQ}-file-icon`})):ZQ.includes(e)?(r="code",n=h().createElement(kQ,{size:"extra-large",className:`${BQ}-file-icon`})):JQ.includes(e)?(r="video",n=h().createElement(OQ,{size:"extra-large",className:`${BQ}-file-icon`})):(r="default",n=h().createElement(cP,{size:"extra-large",className:`${BQ}-file-icon`})),h().createElement("div",{className:w()(`${BQ}-file-icon-wrapper`,{[`${BQ}-file-icon-${r}`]:r})},n)}),[]),g=(0,d.useCallback)((e=>{null==i||i(u),s&&e.preventDefault()}),[i,s,u]),y=(0,d.useCallback)((e=>{null==a||a({name:null==u?void 0:u.filename,url:null==u?void 0:u.file_url}),e.preventDefault()}),[a,u]);return h().createElement("a",{href:null==u?void 0:u.file_url,target:"_blank",onClick:g,className:w()(`${BQ}-file`,{[`${BQ}-file-last`]:c}),rel:"noreferrer"},m(f,u),h().createElement("div",{className:`${BQ}-file-info`},h().createElement("span",{className:w()(`${BQ}-file-title`,{[`${BQ}-file-title-ellipsis`]:o===HQ.USER&&l})},null==u?void 0:u.filename),h().createElement("span",{className:`${BQ}-file-metadata`},h().createElement("span",{className:`${BQ}-file-type`},f)," ",null==u?void 0:u.size)),o===HQ.USER&&l&&h().createElement("div",{className:`${BQ}-icon-reference`,role:"button",tabIndex:0,onClick:y},h().createElement(TQ,null)))})),t0=h().memo((e=>{const{name:t}=e;return h().createElement("div",{className:`${BQ}-tool-call`},h().createElement(PQ,null),t," ",e.arguments)})),n0=h().memo((e=>{const{message:t,customRenderFunc:n,role:r,mode:i,markdownRenderProps:s,editing:o,messageEditRender:a,showReference:l,onFileClick:c,onImageClick:u,disabledFileItemClick:p,renderDialogueContentItem:f,onAnnotationClick:m,onReferenceClick:g,escapeHtml:y}=e,{content:v,role:b,status:x,references:E}=t,C=y&&b===HQ.USER,S=(0,d.useMemo)((()=>Object.assign({code:cQ},null==s?void 0:s.components)),[s]),_=(0,d.useMemo)((()=>{const e=b===HQ.USER,t=i===zQ.BUBBLE,n=i===zQ.USER_BUBBLE&&e;return w()({[`${BQ}`]:!0,[`${BQ}-${i}`]:t||n,[`${BQ}-no-bubble`]:!(t||n),[`${BQ}-user`]:e,[`${BQ}-error`]:x===VQ.FAILED&&(t||n)})}),[b,x,i]),k=(0,d.useCallback)(((e,n,r)=>{const i=null==f?void 0:f[e];if(i){let s;if(WQ.includes(e)){const e=r,t=null==e?void 0:e.name;if("object"==typeof i&&t){const e=null==i?void 0:i[t];e&&(s=e)}}if(s||"function"!=typeof i||(s=i),s)return h().createElement("div",{className:`${BQ}-custom-renderer`,key:`index-${n}`},s(r,t))}return null}),[f,t]),O=(0,d.useCallback)(((e,t)=>{if(""!==e){const n=C?HW(e):e;return h().createElement("div",{className:_,key:t},h().createElement(nW,Object.assign({format:"md",raw:n,components:S},s)),b===HQ.USER&&l&&h().createElement("div",{className:`${BQ}-icon-reference`,role:"button",tabIndex:0,onClick:()=>null==g?void 0:g({type:"text",content:e})},h().createElement(TQ,null)))}return null}),[_,S,s,b,g,l,C]),T=(0,d.useCallback)(((e,t)=>{var n;if("string"==typeof e.content)return O(e.content,`msg-${t}`);const r=null!==(n=e.content)&&void 0!==n?n:[],i=r.filter((e=>(null==e?void 0:e.type)===UQ.INPUT_IMAGE)).length>1;return r.map(((e,n)=>{var s,o;const a=k(null==e?void 0:e.type,t,e);if(a)return a;if(KQ.includes(null==e?void 0:e.type)){const r=e.annotations,i=r&&r.length>0&&r.filter((e=>"file_citation"!==e.type&&"container_file_citation"!==e.type));return h().createElement(h().Fragment,{key:`msg-${t}-${n}`},i&&i.length>0&&h().createElement(aQ,{annotation:i,maxCount:15,onClick:()=>m(i)}),O(e.text||"",`msg-${t}-${n}`),O(e.refusal||"",`msg-${t}-${n}-refusal`))}if((null==e?void 0:e.type)===UQ.INPUT_IMAGE){const o=null===(s=r[n+1])||void 0===s?void 0:s.type,a=n===r.length-1||o===UQ.INPUT_FILE;return h().createElement(h().Fragment,{key:`msg-${t}-${n}`},h().createElement(QQ,{src:e.image_url,isList:i,msg:e,onImageClick:u,isLastImage:a}),o===UQ.INPUT_FILE&&h().createElement("br",null))}if((null==e?void 0:e.type)===UQ.INPUT_FILE){const i=null===(o=r[n+1])||void 0===o?void 0:o.type,s=n===r.length-1||i===UQ.INPUT_IMAGE;return h().createElement(h().Fragment,{key:`msg-${t}-${n}`},h().createElement(e0,Object.assign({},e,{onFileClick:c,disabledFileItemClick:!!p,role:b,onReferenceClick:g,showReference:l,isLastFile:s})),i===UQ.INPUT_IMAGE&&h().createElement("br",null))}return null}))}),[O,k,m,u,c,p,b,g,l]),P=(0,d.useCallback)(((e,t)=>h().createElement(t0,Object.assign({key:`tool-${t}`},e))),[]),I=(0,d.useMemo)((()=>({[UQ.MESSAGE]:(e,t)=>T(e,t),[UQ.REASONING]:(e,t)=>h().createElement(nQ,{key:`reason-${t}`,summary:e.summary,content:e.content,status:e.status,markdownRenderProps:s}),[UQ.FUNCTION_CALL]:P,[UQ.CUSTOM_TOOL_CALL]:P})),[T,s,P]),M=(0,d.useMemo)((()=>{const e=[VQ.QUEUED,VQ.IN_PROGRESS,VQ.INCOMPLETE].includes(x),n=v&&(null==v?void 0:v.length)>0||t.output_text;return e&&!n?h().createElement("span",{className:`${BQ}-loading`},h().createElement("span",{className:`${BQ}-loading-item`}),h().createElement("span",{className:`${BQ}-loading-item`}),h().createElement("span",{className:`${BQ}-loading-item`}),h().createElement("span",{className:`${BQ}-loading-text`},h().createElement(Jt,{componentName:"AIChatDialogue"},(e=>e.loading)))):null}),[x,v,t.output_text]),R=(0,d.useMemo)((()=>{if(o)return null==a?void 0:a(function(e){const t=[],n=[];return e.content&&"string"==typeof e.content?{references:null==e?void 0:e.references,attachments:t,inputContents:[{type:"text",text:e.content}]}:(e.content&&Array.isArray(e.content)&&e.content.forEach((e=>{if("message"===e.type){const{content:r}=e;r.forEach((e=>{"input_text"===e.type?n.push({type:"text",text:null==e?void 0:e.text}):"input_image"===e.type?t.push({name:null==e?void 0:e.name,url:null==e?void 0:e.image_url,status:"success",size:null==e?void 0:e.size,uid:null==e?void 0:e.uid}):"input_file"===e.type&&t.push({name:null==e?void 0:e.filename,url:null==e?void 0:e.file_url,status:"success",size:null==e?void 0:e.size,uid:null==e?void 0:e.uid})}))}})),{references:null==e?void 0:e.references,attachments:t,inputContents:n})}(t));{let e;const n="string"==typeof v?v:t.output_text;if(n){const r=null==f?void 0:f.default;if("function"==typeof r)e=h().createElement("div",{className:`${BQ}-custom-renderer`},r(n,t));else{const t=C?HW(n):n;e=h().createElement("div",{className:_},h().createElement(nW,Object.assign({format:"md",raw:t,components:S},s)),b===HQ.USER&&l&&h().createElement("div",{className:`${BQ}-icon-reference`,role:"button",tabIndex:0,onClick:()=>null==g?void 0:g({type:"text",content:n})},h().createElement(TQ,null)))}}else Array.isArray(v)&&(e=v.map(((e,t)=>{const n=null==e?void 0:e.type,r=null!=n?n:UQ.MESSAGE,i=k(r,t,e);if(i)return i;const s=I[r];return s?s(e,t):null})));return h().createElement("div",{className:`${BQ}-wrapper`},(x===VQ.FAILED||x===VQ.CANCELLED)&&h().createElement("div",{className:`${BQ}-failed`},h().createElement(ns,null)),h().createElement("div",{className:`${BQ}-inner`},e))}}),[x,v,o,t,b,a,s,_,S,I,k,f,l,g,C]);return n?n({message:t,role:r,defaultContent:R,className:_}):h().createElement("div",{className:w()(`${BQ}`,{[`${BQ}-editing`]:o})},E&&E.length>0&&!o&&h().createElement(jQ,{references:E}),R,M)})),r0=n0,i0=YJ.PREFIX,{ROLE:s0,DIALOGUE_ALIGN:o0}=JJ;const a0=class extends f{constructor(e){super(e),this.getRoleInfo=()=>{const{role:e,message:t}=this.props;return e instanceof Map?e.get(null==t?void 0:t.name):e},this.avatarNode=()=>{const{role:e,dialogueRenderConfig:t,continueSend:n,message:r}=this.props;return d.createElement(fQ,{role:this.getRoleInfo(),message:r,customRenderFunc:null==t?void 0:t.renderDialogueAvatar})},this.titleNode=()=>{const{role:e,dialogueRenderConfig:t,message:n}=this.props;return d.createElement(hQ,{role:this.getRoleInfo(),message:n,customRenderFunc:null==t?void 0:t.renderDialogueTitle})},this.contentNode=()=>{const{message:e,mode:t,dialogueRenderConfig:n,markdownRenderProps:r,messageEditRender:i,disabledFileItemClick:s,renderDialogueContentItem:o,onFileClick:a,onImageClick:l,onAnnotationClick:c,onReferenceClick:h,showReference:u,escapeHtml:p}=this.props;return d.createElement(r0,{key:e.editing,message:e,mode:t,editing:e.editing&&e.role===s0.USER,escapeHtml:p,messageEditRender:i,onFileClick:a,onImageClick:l,disabledFileItemClick:s,renderDialogueContentItem:o,onAnnotationClick:c,onReferenceClick:h,customRenderFunc:null==n?void 0:n.renderDialogueContent,markdownRenderProps:r,showReference:u})},this.actionNode=()=>{const{role:e,message:t,showReset:n,isLastChat:r,dialogueRenderConfig:i,onMessageReset:s,onMessageGoodFeedback:o,onMessageBadFeedback:a,onMessageCopy:l,onMessageShare:c,messageEditRender:h,onMessageEdit:u,onMessageDelete:p}=this.props;return d.createElement(EQ,{role:e,message:t,onMessageCopy:l,onMessageReset:s,onMessageGoodFeedback:o,onMessageBadFeedback:a,showReset:n,isLastChat:r,onMessageShare:c,onMessageEdit:u,onMessageDelete:p,messageEditRender:h,customRenderFunc:null==i?void 0:i.renderDialogueAction})}}render(){const{message:e,selecting:t,align:n,isSelected:r,onSelectChange:i,continueSend:s}=this.props,o=e.id,a=e.role===s0.USER&&n===o0.LEFT_RIGHT,l=w()({[`${i0}-container`]:!0,[`${i0}-container-right`]:a});return d.createElement("div",{className:w()(`${i0}-wrapper`,{[`${i0}-wrapper-selected`]:t&&r,[`${i0}-wrapper-continue-send`]:s})},t&&d.createElement("div",{className:`${i0}-checkbox`},d.createElement(od,{checked:r,onChange:e=>i(e.target.checked,o)})),d.createElement("div",{className:l},this.avatarNode(),d.createElement("div",{className:`${i0}-inner`},!s&&this.titleNode(),this.contentNode(),this.actionNode())))}};class l0 extends c{constructor(e){super(Object.assign({},e)),this.init=()=>{this.scrollToBottomImmediately(),this._adapter.registerWheelEvent()},this.destroy=()=>{this.animation&&this.animation.destroy()},this.handleSelectAll=()=>{const{chats:e}=this.getProps(),t=new Set(e.map((e=>e.id)));this._adapter.updateSelected(t),this._adapter.notifySelect(Array.from(t))},this.handleDeselectAll=()=>{this._adapter.updateSelected(new Set),this._adapter.notifySelect([])},this.handleChatsChange=e=>{this._adapter.notifyChatsChange(e)},this.handleSelectOrRemove=(e,t)=>{const{selectedIds:n}=this.getStates(),r=n instanceof Set?new Set(n):new Set(n||[]);e?r.add(t):r.delete(t),this._adapter.updateSelected(r),this._adapter.notifySelect(Array.from(r))},this.likeMessage=e=>{const{chats:t}=this.getStates();this._adapter.notifyLikeMessage(e);const n=t.findIndex((t=>t.id===e.id)),r=Object.assign(Object.assign({},t[n]),{like:!t[n].like,dislike:!1}),i=[...t];i.splice(n,1,r),this._adapter.notifyChatsChange(i)},this.dislikeMessage=e=>{const{chats:t}=this.getStates();this._adapter.notifyDislikeMessage(e);const n=t.findIndex((t=>t.id===e.id)),r=Object.assign(Object.assign({},t[n]),{like:!1,dislike:!t[n].dislike}),i=[...t];i.splice(n,1,r),this._adapter.notifyChatsChange(i)},this.resetMessage=e=>{const{chats:t}=this.getStates(),n=t[t.length-1],r=Object.assign(Object.assign({},n),{status:"in_progress",content:"",id:Ke(),createAt:Date.now()}),i=t.slice(0,-1).concat(r);this._adapter.notifyChatsChange(i);const{onMessageReset:s}=this.getProps();null==s||s(e)},this.editMessage=e=>{const{chats:t}=this.getStates();this._adapter.notifyEditMessage(e);const n=t.findIndex((t=>t.id===e.id)),r=Object.assign(Object.assign({},t[n]),{editing:!t[n].editing});t.map((e=>{e.editing&&(e.editing=!e.editing)}));const i=[...t];i.splice(n,1,r),this._adapter.notifyChatsChange(i)},this.deleteMessage=e=>{const{onMessageDelete:t,onChatsChange:n}=this.getProps(),{chats:r}=this.getStates();null==t||t(e);const i=r.filter((t=>t.id!==e.id));null==n||n(i)},this.onHintClick=e=>{const{chats:t}=this.getStates(),n=[...t,{role:JJ.ROLE.USER,id:Ke(),createAt:Date.now(),content:e}];this._adapter.notifyChatsChange(n),this._adapter.notifyHintClick(e)},this.scrollToBottomImmediately=()=>{const e=this._adapter.getContainerRef();e&&(e.scrollTop=e.scrollHeight)},this.scrollToBottomWithAnimation=()=>{const e=JJ.SCROLL_ANIMATION_TIME,t=this._adapter.getContainerRef();if(!t)return;const n=t.scrollTop,r=t.scrollHeight;this.animation=new Ei({from:{scrollTop:n},to:{scrollTop:r}},{duration:e,easing:"easeInOutCubic"}),this.animation.on("frame",(e=>{let{scrollTop:n}=e;t.scrollTop=n})),this.animation.start()},this.scrollToTopImmediately=()=>{const e=this._adapter.getContainerRef();e&&(e.scrollTop=0)},this.scrollToTopWithAnimation=()=>{const e=JJ.SCROLL_ANIMATION_TIME,t=this._adapter.getContainerRef();if(!t)return;const n=t.scrollTop;this.animation=new Ei({from:{scrollTop:n},to:{scrollTop:0}},{duration:e,easing:"easeInOutCubic"}),this.animation.on("frame",(e=>{let{scrollTop:n}=e;t.scrollTop=n})),this.animation.start()},this.containerScroll=e=>{this._persistEvent(e);requestAnimationFrame((()=>{this.getScroll(e.target)}))},this.getScroll=v()((e=>{const t=e.scrollHeight,n=e.clientHeight,r=e.scrollTop,{backBottomVisible:i}=this.getStates();return t-r-n<=JJ.SHOW_SCROLL_GAP?i&&this._adapter.setBackBottomVisible(!1):i||this._adapter.setBackBottomVisible(!0),scroll}),100)}}const{PREFIX_HINT:c0}=YJ,d0=h().memo((e=>{const{hints:t,onHintClick:n,renderHintBox:r,className:i,style:s,selecting:o}=e;return h().createElement("section",{className:w()(`${c0}s`,{[i]:!!i,[`${c0}s-selecting`]:o}),style:s},t.map(((e,t)=>r?r({content:e,index:t,onHintClick:()=>{null==n||n(e)}}):h().createElement("div",{role:"button",tabIndex:0,className:`${c0}-item`,key:t,onClick:()=>{null==n||n(e)},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||null==n||n(e)}},h().createElement("div",{className:`${c0}-content`},e)))))})),h0=d0;var u0=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const{DIALOGUE_ALIGN:p0,MODE:f0}=JJ,{PREFIX:m0}=YJ;class g0 extends f{constructor(e){super(e),this.selectAll=()=>{this.foundation.handleSelectAll()},this.deselectAll=()=>{this.foundation.handleDeselectAll()},this.scrollToBottom=e=>{e?this.foundation.scrollToBottomWithAnimation():this.foundation.scrollToBottomImmediately()},this.scrollToTop=e=>{e?this.foundation.scrollToTopWithAnimation():this.foundation.scrollToTopImmediately()},this.containerScroll=e=>{this.scrollTargetRef.current=e.target,e.target===e.currentTarget&&this.foundation.containerScroll(e)},this.foundation=new l0(this.adapter),this.containerRef=d.createRef(),this.scrollTargetRef=d.createRef(),this.wheelEventHandler=null,this.state={cacheHints:[],selectedIds:new Set,chats:[],backBottomVisible:!1,wheelScroll:!1},this.onSelectOrRemove=this.onSelectOrRemove.bind(this)}get adapter(){return Object.assign(Object.assign({},super.adapter),{getContainerRef:()=>{var e;return null===(e=this.containerRef)||void 0===e?void 0:e.current},setWheelScroll:e=>{this.setState({wheelScroll:e})},updateSelected:e=>{this.setState({selectedIds:e})},notifySelect:e=>{const{onSelect:t}=this.props;t&&t(e)},notifyChatsChange:e=>{const{onChatsChange:t}=this.props;t&&t(e)},notifyCopyMessage:e=>{const{onMessageCopy:t}=this.props;t&&t(e)},notifyLikeMessage:e=>{const{onMessageGoodFeedback:t}=this.props;t&&t(e)},notifyDislikeMessage:e=>{const{onMessageBadFeedback:t}=this.props;t&&t(e)},notifyEditMessage:e=>{const{onMessageEdit:t}=this.props;t&&t(e)},notifyHintClick:e=>{const{onHintClick:t}=this.props;t&&t(e)},setBackBottomVisible:e=>{this.setState((t=>t.backBottomVisible!==e?{backBottomVisible:e}:null))},registerWheelEvent:()=>{this.adapter.unRegisterWheelEvent();const e=this.containerRef.current;e&&(this.wheelEventHandler=e=>{var t;(null===(t=this.scrollTargetRef)||void 0===t?void 0:t.current)===e.currentTarget&&(this.adapter.setWheelScroll(!0),this.adapter.unRegisterWheelEvent())},e.addEventListener("wheel",this.wheelEventHandler))},unRegisterWheelEvent:()=>{if(this.wheelEventHandler){const e=this.containerRef.current;if(!e)return;e.removeEventListener("wheel",this.wheelEventHandler),this.wheelEventHandler=null}}})}static getDerivedStateFromProps(e,t){const{chats:n,hints:r}=e,i={};return n!==t.chats&&(i.chats=null!=n?n:[]),r!==t.cacheHints&&(i.cacheHints=r),Object.keys(i).length?i:null}componentDidMount(){this.foundation.init()}componentDidUpdate(e,t,n){const{chats:r,hints:i}=this.props,{chats:s,cacheHints:o}=t,{wheelScroll:a}=this.state;let l=!1;if(r.length>s.length&&(this.adapter.setWheelScroll(!1),this.adapter.registerWheelEvent(),this.foundation.scrollToBottomImmediately()),r!==s&&(this.foundation.handleChatsChange(r),Array.isArray(r)&&Array.isArray(s))){const e=r[r.length-1],t=s[s.length-1];r.length>s.length?0!==s.length&&e.id===t.id||(l=!0):r.length!==s.length||!r.length||"completed"===e.status&&e.status===t.status||(l=!0)}i!==o&&i.length>o.length&&(l=!0),!a&&l&&this.foundation.scrollToBottomImmediately()}componentWillUnmount(){this.foundation.destroy()}onSelectOrRemove(e,t){this.foundation.handleSelectOrRemove(e,t)}render(){const e=this.props,{roleConfig:t,onMessageBadFeedback:n,onMessageGoodFeedback:r,onMessageReset:i,onMessageEdit:s,onMessageDelete:o,onHintClick:a,selecting:l,hintCls:c,hintStyle:h,hints:u,renderHintBox:p,style:f,className:m}=e,g=u0(e,["roleConfig","onMessageBadFeedback","onMessageGoodFeedback","onMessageReset","onMessageEdit","onMessageDelete","onHintClick","selecting","hintCls","hintStyle","hints","renderHintBox","style","className"]),{selectedIds:y,chats:v,backBottomVisible:b,wheelScroll:x}=this.state;return d.createElement("div",{className:w()(`${m0}`,m),style:f},d.createElement("div",{className:w()(`${m0}-list`,{[`${m0}-list-scroll-hidden`]:!x}),onScroll:this.containerScroll,ref:this.containerRef},v.map(((e,n)=>{var r;const i=n===v.length-1;n>0&&(null==e||e.role,null===(r=v[n-1])||void 0===r||r.role);return d.createElement(a0,Object.assign({key:e.id,message:e,role:t[e.role],onSelectChange:this.onSelectOrRemove,isSelected:y.has(e.id),roleConfig:t,onMessageBadFeedback:this.foundation.dislikeMessage,onMessageGoodFeedback:this.foundation.likeMessage,onMessageReset:this.foundation.resetMessage,onMessageEdit:this.foundation.editMessage,onMessageDelete:this.foundation.deleteMessage,isLastChat:i,continueSend:!1,selecting:l},g))})),!!(null==u?void 0:u.length)&&d.createElement(h0,{className:c,style:h,hints:u,onHintClick:this.foundation.onHintClick,renderHintBox:p,selecting:l})),b&&d.createElement("span",{className:`${m0}-backBottom`},d.createElement(vs,{className:`${m0}-backBottom-button`,icon:d.createElement(Hc,{size:"extra-large"}),type:"tertiary",onClick:this.foundation.scrollToBottomWithAnimation})))}}g0.__SemiComponentName__="AIChatDialogue",g0.Reasoning=nQ,g0.Step=e=>{const[t,n]=(0,d.useState)((()=>new Set(e.steps.map(((e,t)=>t)))));(0,d.useEffect)((()=>{n(new Set(e.steps.map(((e,t)=>t))))}),[e.steps]);const r=(0,d.useCallback)((e=>{n((t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}))}),[]);return h().createElement("div",{className:`${iQ}-wrapper`},e.steps.map(((e,n)=>{const{summary:i,status:s,actions:o}=e,a=t.has(n),l=null==o?void 0:o.length;return h().createElement(h().Fragment,{key:n},h().createElement("div",{className:`${iQ}`,role:"button",tabIndex:0,onClick:()=>r(n),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),r(n))}},h().createElement("div",{className:`${iQ}-prefix`},"completed"===s?h().createElement(rQ,{className:`${iQ}-completed`}):h().createElement("span",{className:`${sQ}-loading`},h().createElement("span",{className:`${sQ}-loading-item`}),h().createElement("span",{className:`${sQ}-loading-item`}),h().createElement("span",{className:`${sQ}-loading-item`}))),h().createElement("div",{className:`${iQ}-summary`},i),l>0&&h().createElement("div",{className:`${iQ}-suffix`},a?h().createElement($i,null):h().createElement(Hc,null))),h().createElement(vf,{isOpen:a},h().createElement("div",{className:`${iQ}-panel`},h().createElement("div",{className:`${iQ}-line`}),h().createElement("div",{className:`${iQ}-action-wrapper`},null==o?void 0:o.map(((e,t)=>h().createElement("div",{key:t,className:`${iQ}-action`},h().createElement("div",{className:`${iQ}-action-summary`},e.summary),h().createElement("div",{className:`${iQ}-action-desc`},e.icon,e.description))))))))})))},g0.Annotation=aQ,g0.defaultComponents={code:cQ},g0.propTypes={align:E().oneOf(["leftRight","leftAlign"]),chats:E().arrayOf(E().shape({id:E().string.isRequired,content:E().oneOfType([E().string,E().array]),output_text:E().string,role:E().string.isRequired,name:E().string,createdAt:E().number,updatedAt:E().number,model:E().string,status:E().string})),className:E().string,disabledFileItemClick:E().bool,hints:E().arrayOf(E().string),hintCls:E().string,hintStyle:E().object,selecting:E().bool,markdownRenderProps:E().object,messageEditRender:E().func,mode:E().oneOf(["bubble","noBubble","userBubble"]),roleConfig:E().object,style:E().object,dialogueRenderConfig:E().shape({renderDialogueAction:E().func,renderDialogueAvatar:E().func,renderDialogueContent:E().func,renderDialogueTitle:E().func,renderFullDialogue:E().func}),renderHintBox:E().func,renderDialogueContentItem:E().object,onAnnotationClick:E().func,onChatsChange:E().func,onFileClick:E().func,onImageClick:E().func,onHintClick:E().func,onMessageBadFeedback:E().func,onMessageCopy:E().func,onMessageDelete:E().func,onMessageEdit:E().func,onMessageGoodFeedback:E().func,onMessageReset:E().func,onMessageShare:E().func,onReferenceClick:E().func,onSelect:E().func,showReset:E().bool,showReference:E().bool,escapeHtml:E().bool},g0.defaultProps=he(g0.__SemiComponentName__,{align:p0.LEFT_RIGHT,mode:f0.BUBBLE,selecting:!1,disabledFileItemClick:!1,showReset:!0,showReference:!1,escapeHtml:!0});const y0=g0,v0={PREFIX:`${C}-aiChatInput`},b0={TOPS_SLOT_POSITION_DEFAULT:"top",ZERO_WIDTH_CHAR:"\ufeff",PIC_PREFIX:"image/",PIC_SUFFIX_ARRAY:["png","jpg","jpeg","gif","bmp","webp"],DELETABLE:"skipCustomTransactionPlugin",SEND_HOTKEY:{ENTER:"enter",SHIFT_ENTER:"shift+enter"}},w0=300,x0=270,E0=270;const C0=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 3c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v18a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3Zm16 0H5v18h14V3Z",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 10a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-8Zm2 1v6h6v-6H9Z",fill:"currentColor"}),d.createElement("path",{d:"M7 5.5c0-.28.22-.5.5-.5h9c.28 0 .5.22.5.5v1a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5v-1Z",fill:"currentColor"}))}),"template_stroked");const S0=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.27 4.27a2.64 2.64 0 0 0-3.73 0L6.8 12.02a4.4 4.4 0 1 0 6.23 6.24l5.5-5.5a1.25 1.25 0 1 1 1.77 1.76l-5.5 5.5a6.9 6.9 0 1 1-9.77-9.76l7.75-7.75a5.14 5.14 0 1 1 7.27 7.26l-7.25 7.25a3.37 3.37 0 1 1-4.77-4.76l5.5-5.5a1.25 1.25 0 1 1 1.77 1.76l-5.5 5.5a.87.87 0 1 0 1.23 1.24L18.27 8a2.64 2.64 0 0 0 0-3.74Z",fill:"currentColor"}))}),"paperclip");const _0=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Z",fill:"currentColor"}))}),"stop");const k0=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"M8.3 2.4a1 1 0 0 0-1.3.95v7.99a3.5 3.5 0 1 0 2 3.16V5l9 2.77v7.57a3.5 3.5 0 1 0 2 3.16V6.74a1 1 0 0 0-.7-.96L8.3 2.4Z",fill:"currentColor"}))}),"music");const O0=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.62 19.12a1.25 1.25 0 0 0 1.76 1.76l7.12-7.11 7.12 7.11a1.25 1.25 0 0 0 1.76-1.76L14.27 12l7.11-7.12a1.25 1.25 0 0 0-1.76-1.76l-7.12 7.11-7.12-7.11a1.25 1.25 0 1 0-1.76 1.76L10.73 12l-7.11 7.12Z",fill:"currentColor"}))}),"cross_stroked");__webpack_require__("uEql");const T0=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.9 20.17a1.25 1.25 0 0 1-.07-1.77l5.71-6.15-5.7-6.15a1.25 1.25 0 0 1 1.83-1.7l6.5 7c.44.48.44 1.22 0 1.7l-6.5 7c-.47.5-1.26.54-1.77.07Z",fill:"currentColor"}))}),"chevron_right_stroked"),P0=e=>{let{children:t,prefix:n}=e;const r=(0,d.useRef)(null),[i,s]=(0,d.useState)(!1),[o,a]=(0,d.useState)(!1),l=(0,d.useCallback)((()=>{const e=r.current;if(e){const{scrollLeft:t,scrollWidth:n,clientWidth:r}=e;s(t>1),a(Math.ceil(t)<n-r)}}),[]);(0,d.useEffect)((()=>{const e=r.current;if(!e)return;l();const t=new ResizeObserver(l);return t.observe(e),e.addEventListener("scroll",l),()=>{t.disconnect(),e.removeEventListener("scroll",l)}}),[l,t]);const c=(0,d.useCallback)((e=>{const t=r.current;t&&t.scrollBy({left:e,behavior:"smooth"})}),[]),u=(0,d.useCallback)((()=>{c(-w0)}),[c]),p=(0,d.useCallback)((()=>{c(w0)}),[c]);return h().createElement("div",{className:`${n}-scroll-wrapper`},i&&h().createElement("button",{className:`${n}-scroll-button ${n}-scroll-button-left`,onClick:u,"aria-label":"Scroll left"},h().createElement(T0,{className:`${n}-scroll-button-left-icon`})),h().createElement("div",{className:`${n}-scroll-container`,ref:r},t),o&&h().createElement("button",{className:`${n}-scroll-button ${n}-scroll-button-right `,onClick:p,"aria-label":"Scroll right"},h().createElement(T0,null)))};function I0(e){var t,n;const{type:r,name:i,fileInstance:s}=null!=e?e:{};if(r)return r;const o=null==i?void 0:i.split(".").pop();return null!==(n=null!=o?o:null===(t=null==s?void 0:s.type)||void 0===t?void 0:t.split("/").pop())&&void 0!==n?n:"UNKNOWN"}function M0(e){var t;const{name:n,fileInstance:r}=null!=e?e:{},i=null==n?void 0:n.split(".").pop();return(null===(t=null==r?void 0:r.type)||void 0===t?void 0:t.startsWith(b0.PIC_PREFIX))||b0.PIC_SUFFIX_ARRAY.includes(i)}function R0(e){var t;return null!==(t=new Map([["docx","word"],["doc","word"],["txt","word"],["epub","word"],["mobi","word"],["js","code"],["ts","code"],["jsx","code"],["tsx","code"],["java","code"],["py","code"],["c","code"],["cpp","code"],["go","code"],["rust","code"],["php","code"],["sql","code"],["html","code"],["css","code"],["scss","code"],["less","code"],["md","code"],["json","code"],["xlsx","excel"],["xls","excel"],["pptx","ppt"],["ppt","ppt"],["mp4","video"],["mkv","video"],["avi","video"],["mov","video"],["wmv","video"],["prores","video"],["flv","video"],["ts","video"],["webm","video"],["3gp","video"],["flac","audio"],["wav","audio"],["alac","audio"],["ape","audio"],["mp3","audio"],["aac","audio"],["ogg","audio"],["wma","audio"],["m4a","audio"],["amr","audio"],["midi","audio"],["png","image"],["jpg","image"],["jpeg","image"],["gif","image"],["bmp","image"],["webp","image"],["pdf","pdf"]]).get(e))&&void 0!==t?t:"unknown"}const A0=new Map([["text",function(e){const{text:t}=e;return{type:"text",text:t!==b0.ZERO_WIDTH_CHAR?t:""}}],["selectSlot",function(e){const{attrs:t={}}=e,{value:n=""}=t;return{type:"text",text:n}}],["inputSlot",function(e){var t,n;const{content:r=[],attrs:i}=e,s=null!==(n=null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.text)&&void 0!==n?n:"";return{type:"text",text:s!==b0.ZERO_WIDTH_CHAR&&s.length?s:null==i?void 0:i.placeholder}}],["skillSlot",function(e){const{type:t,attrs:n}=e,{value:r,label:i,hasTemplate:s}=n;return L0({type:t,value:r,label:i,hasTemplate:s})}],["hardBreak",function(){return{type:"text",text:"\n"}}]]);function N0(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map;const n=[],r=e=>{var i;const{type:s,content:o=[]}=e;let a;switch(s){case"doc":o.forEach((e=>{r(e)}));break;case"paragraph":if(n.length>0){const e=n[n.length-1];e&&"text"===e.type?e.text+="\n":n.push({type:"text",text:"\n"})}o.forEach((e=>{r(e)}));break;default:const l=null!==(i=A0.get(s))&&void 0!==i?i:t.get(s);a=null==l?void 0:l(e)}if(a)if("text"===a.type){const e=n[n.length-1];e&&"text"===e.type?e.text+=a.text:"string"==typeof a.text?a.text.length&&n.push(a):n.push(a)}else n.push(a)};return r(e),n}function D0(){return{default:!0,parseHTML:e=>!0,renderHTML:e=>({"data-custom-slot":!!e.isCustomSlot||void 0})}}function L0(e){return Object.fromEntries(Object.entries(e).filter((e=>{let[t,n]=e;return void 0!==n})))}function F0(e){let t="";return e.label&&(t+=` data-label="${e.label}"`),e.value&&(t+=` data-value="${e.value}"`),"boolean"==typeof e.hasTemplate&&(t+=` data-template=${e.hasTemplate}`),`<skill-slot ${t}></skill-slot>`}const j0=h().createContext({});var $0=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const B0=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{const{field:r,onChange:i,className:s}=n,a=$0(n,["field","onChange","className"]),{valueKey:l="value",onKeyChangeFnName:c="onChange",valuePath:u,className:p,defaultProps:f={}}=t,{value:m={},onChange:g,onRemove:y}=h().useContext(j0),v=(0,d.useCallback)((e=>{const t=u?o()(e,u):e;g({[r]:t}),null==i||i(t)}),[r,g,i,u]);(0,d.useEffect)((()=>{const{initValue:e}=n;return void 0!==e&&g({[r]:n.initValue},!0),()=>{y(r)}}),[]);const b={[l]:m[r],[c]:v};return h().createElement(e,Object.assign({className:w()({[s]:s,[p]:p})},f,a,b))}};var V0=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const z0=B0((e=>{const{value:t,onChange:n,className:r,onClick:i}=e,s=V0(e,["value","onChange","className","onClick"]),o=(0,d.useCallback)((()=>{const e=!t;n(e),null==i||i(e)}),[t,n,i]);return h().createElement(vs,Object.assign({className:w()(`${v0.PREFIX}-footer-configure-button`,{[r]:r,[`${v0.PREFIX}-footer-configure-button-active`]:t}),onClick:o,theme:"outline",type:"tertiary"},s))})),H0=B0(YC,{className:`${v0.PREFIX}-footer-configure-select`});var U0=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const K0=h().memo((e=>{var t;const{className:n,style:r,options:i=[],num:s=0,children:o,onConfigureButtonClick:a,showConfigure:l=!0}=e,c=U0(e,["className","style","options","num","children","onConfigureButtonClick","showConfigure"]),u=(0,d.useCallback)((e=>{e.stopPropagation()}),[]);return h().createElement(Ww,Object.assign({style:r,className:w()({[n]:n,[`${v0.PREFIX}-footer-configure-mcp`]:!0})},c,{render:h().createElement(Jt,{componentName:"AIChatInput"},(e=>{var t;return h().createElement(h().Fragment,null,h().createElement("div",{className:`${v0.PREFIX}-footer-configure-mcp-header`},h().createElement("span",{className:`${v0.PREFIX}-footer-configure-mcp-header-title`},e.selected.replace("${count}",String(null!==(t=i.length)&&void 0!==t?t:s))),l&&h().createElement(vs,{theme:"outline",className:`${v0.PREFIX}-footer-configure-mcp-header-config`,onClick:a},e.configure)),o||h().createElement(h().Fragment,null,h().createElement(Ww.Menu,null,i.map((e=>h().createElement(Ww.Item,{key:e.value,icon:e.icon},e.label))))))}))}),h().createElement(vs,{theme:"outline",type:"tertiary",className:`${v0.PREFIX}-footer-configure-mcp-trigger`,onClick:u},"MCP · ",null!==(t=i.length)&&void 0!==t?t:s))})),W0=K0,G0=B0($S,{className:`${v0.PREFIX}-footer-configure-radio-button`,valuePath:"target.value",defaultProps:{type:"button"}});class q0 extends h().Component{constructor(e){var t;super(e),t=this,this.onChange=function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.setState((r=>{const{value:i}=r,s=Object.assign(Object.assign({},i),e),{onChange:o}=t.props;return!n&&(null==o||o(s,e)),{value:s}}))},this.onRemove=e=>{this.setState((t=>{const{value:n={}}=t,r={};Object.keys(n).forEach((t=>{t!==e&&(r[t]=n[t])}));const{onChange:i}=this.props;return null==i||i(r),{value:r}}))},this.getConfigureValue=()=>this.state.value,this.getContextValue=()=>(this._contextValue&&this._contextValue.value===this.state.value&&this._contextValue.onChange===this.onChange&&this._contextValue.onRemove===this.onRemove||(this._contextValue={value:this.state.value,onChange:this.onChange,onRemove:this.onRemove}),this._contextValue),this.state={value:e.value||e.defaultValue},this._contextValue={value:this.state.value,onChange:this.onChange,onRemove:this.onRemove}}render(){const{children:e}=this.props;return h().createElement(j0.Provider,{value:this.getContextValue()},e)}}q0.contextType=j0,q0.Button=z0,q0.Select=H0,q0.Mcp=W0,q0.RadioButton=G0;const X0=q0;function Y0(e){this.content=e}Y0.prototype={constructor:Y0,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-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),s=r.content.slice();return-1==i?s.push(n||e,t):(s[i+1]=t,n&&(s[i]=n)),new Y0(s)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new Y0(n)},addToStart:function(e,t){return new Y0([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Y0(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),s=r.find(e);return i.splice(-1==s?i.length:s,0,t,n),new Y0(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=Y0.from(e)).size?new Y0(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=Y0.from(e)).size?new Y0(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Y0.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}},Y0.from=function(e){if(e instanceof Y0)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Y0(t)};const Z0=Y0;function J0(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),s=t.child(r);if(i!=s){if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let e=0;i.text[e]==s.text[e];e++)n++;return n}if(i.content.size||s.content.size){let e=J0(i.content,s.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function Q0(e,t,n,r){for(let i=e.childCount,s=t.childCount;;){if(0==i||0==s)return i==s?null:{a:n,b:r};let o=e.child(--i),a=t.child(--s),l=o.nodeSize;if(o!=a){if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let e=0,t=Math.min(o.text.length,a.text.length);for(;e<t&&o.text[o.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let e=Q0(o.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}class e1{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;if(l>e&&!1!==n(a,r+o,i||null,s)&&a.content.size){let i=o+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}o=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",s=!0;return this.nodesBetween(e,t,((o,a)=>{let l=o.isText?o.text.slice(Math.max(e,a)-a,t-a):o.isLeaf?r?"function"==typeof r?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&l||o.isTextblock)&&n&&(s?s=!1:i+=n),i+=l}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new e1(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,s=0;s<t;i++){let o=this.content[i],a=s+o.nodeSize;a>e&&((s<e||a>t)&&(o=o.isText?o.cut(Math.max(0,e-s),Math.min(o.text.length,t-s)):o.cut(Math.max(0,e-s-1),Math.min(o.content.size,t-s-1))),n.push(o),r+=o.nodeSize),s=a}return new e1(n,r)}cutByIndex(e,t){return e==t?e1.empty:0==e&&t==this.content.length?this:new e1(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new e1(r,i)}addToStart(e){return new e1([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new e1(this.content.concat(e),this.size+e.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 new 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 J0(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Q0(this,e,t,n)}findIndex(e){if(0==e)return n1(0,e);if(e==this.size)return n1(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e)return r==e?n1(t+1,r):n1(t,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return e1.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new e1(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return e1.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new e1(t||e,n)}static from(e){if(!e)return e1.empty;if(e instanceof e1)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new e1([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}e1.empty=new e1([],0);const t1={index:0,offset:0};function n1(e,t){return t1.index=e,t1.offset=t,t1}function r1(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)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(!r1(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!r1(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class i1{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||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(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&&r1(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 new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new 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(e){if(!e||Array.isArray(e)&&0==e.length)return i1.none;if(e instanceof i1)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}i1.none=[];class s1 extends Error{}class o1{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=l1(this.content,e+this.openStart,t);return n&&new o1(n,this.openStart,this.openEnd)}removeBetween(e,t){return new o1(a1(this.content,e+this.openStart,t+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(e,t){if(!t)return o1.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new o1(e1.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new o1(e,n,r)}}function a1(e,t,n){let{index:r,offset:i}=e.findIndex(t),s=e.maybeChild(r),{index:o,offset:a}=e.findIndex(n);if(i==t||s.isText){if(a!=n&&!e.child(o).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return e.replaceChild(r,s.copy(a1(s.content,t-i-1,n-i-1)))}function l1(e,t,n,r){let{index:i,offset:s}=e.findIndex(t),o=e.maybeChild(i);if(s==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=l1(o.content,t-s-1,n,o);return a&&e.replaceChild(i,o.copy(a))}function c1(e,t,n){if(n.openStart>e.depth)throw new s1("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new s1("Inconsistent open depths");return d1(e,t,n,0)}function d1(e,t,n,r){let i=e.index(r),s=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=d1(e,t,n,r+1);return s.copy(s.content.replaceChild(i,o))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:o}=function(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(e1.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return m1(s,g1(e,i,o,t,r))}{let r=e.parent,i=r.content;return m1(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return m1(s,y1(e,t,r))}function h1(e,t){if(!t.type.compatibleContent(e.type))throw new s1("Cannot join "+t.type.name+" onto "+e.type.name)}function u1(e,t,n){let r=e.node(n);return h1(r,t.node(n)),r}function p1(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 f1(e,t,n,r){let i=(t||e).node(n),s=0,o=t?t.index(n):i.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(p1(e.nodeAfter,r),s++));for(let e=s;e<o;e++)p1(i.child(e),r);t&&t.depth==n&&t.textOffset&&p1(t.nodeBefore,r)}function m1(e,t){return e.type.checkContent(t),e.copy(t)}function g1(e,t,n,r,i){let s=e.depth>i&&u1(e,t,i+1),o=r.depth>i&&u1(n,r,i+1),a=[];return f1(null,e,i,a),s&&o&&t.index(i)==n.index(i)?(h1(s,o),p1(m1(s,g1(e,t,n,r,i+1)),a)):(s&&p1(m1(s,y1(e,t,i+1)),a),f1(t,n,i,a),o&&p1(m1(o,y1(n,r,i+1)),a)),f1(r,null,i,a),new e1(a)}function y1(e,t,n){let r=[];if(f1(null,e,n,r),e.depth>n){p1(m1(u1(e,t,n+1),y1(e,t,n+1)),r)}return f1(t,null,n,r),new e1(r)}o1.empty=new o1(e1.empty,0,0);class v1{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?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[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].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):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-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(0==e.content.size)return i1.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 s=0;s<i.length;s++)!1!==i[s].type.spec.inclusive||r&&i[s].isInSet(r.marks)||(i=i[s--].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++)!1!==n[i].type.spec.inclusive||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 E1(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(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:s}=t.content.findIndex(i),o=i-s;if(n.push(t,e,r+s),!o)break;if(t=t.child(e),t.isText)break;i=o-1,r+=s+1}return new v1(t,n,i)}static resolveCached(e,t){let n=x1.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else x1.set(e,n=new b1);let r=n.elts[n.i]=v1.resolve(e,t);return n.i=(n.i+1)%w1,r}}class b1{constructor(){this.elts=[],this.i=0}}const w1=12,x1=new WeakMap;class E1{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)}}const C1=Object.create(null);class S1{constructor(e,t,n,r=i1.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||e1.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&&r1(this.attrs,t||e.defaultAttrs||C1)&&i1.sameSet(this.marks,n||i1.none)}copy(e=null){return e==this.content?this:new S1(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new S1(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return o1.empty;let r=this.resolve(e),i=this.resolve(t),s=n?0:r.sharedDepth(t),o=r.start(s),a=r.node(s).content.cut(r.pos-o,i.pos-o);return new o1(a,r.depth-s,i.depth-s)}replace(e,t,n){return c1(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(0==e)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 v1.resolveCached(this,e)}resolveNoCache(e){return v1.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()+")"),k1(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=e1.empty,r=0,i=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,r,i),o=s&&s.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),s=i&&i.matchFragment(this.content,t);return!!s&&s.validEnd}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=i1.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(!i1.sameSet(e,this.marks))throw new 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 new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=e1.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}}S1.prototype.text=void 0;class _1 extends S1{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):k1(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(e){return e==this.marks?this:new _1(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new _1(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&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 k1(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class O1{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new T1(e,t);if(null==n.next)return O1.empty;let r=P1(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n(D1(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]);D1(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let s=t[r.join(",")]=new O1(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(N1);s.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return s}}(function(e){let t=[[]];return i(s(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 s(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(s(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let o=n();return r(t,o),i(s(e.expr,o),o),[r(o)]}if("plus"==e.type){let o=n();return i(s(e.expr,t),o),i(s(e.expr,o),o),[r(o)]}if("opt"==e.type)return[r(t)].concat(s(e.expr,t));if("range"==e.type){let o=t;for(let t=0;t<e.min;t++){let t=n();i(s(e.expr,o),t),o=t}if(-1==e.max)i(s(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(s(e.expr,o),t),o=t}return[r(o)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let o=s(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,s=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];s.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(o)&&r.push(o)}i&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}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 0!=this.next.length&&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];return function i(s,o){let a=s.matchFragment(e,n);if(a&&(!t||a.validEnd))return e1.from(o.map((e=>e.createAndFill())));for(let e=0;e<s.next.length;e++){let{type:t,next:n}=s.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}(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:s,next:o}=i.next[e];s.isLeaf||s.hasRequiredAttrs()||s.name in t||r.type&&!o.validEnd||(n.push({match:s.contentMatch,type:s,via:r}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(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("\n")}}O1.empty=new O1(!0);class T1{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 new SyntaxError(e+" (in content expression '"+this.string+"')")}}function P1(e){let t=[];do{t.push(I1(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function I1(e){let t=[];do{t.push(M1(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function M1(e){let t=function(e){if(e.eat("(")){let t=P1(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(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)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(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("{"))break;t=A1(e,t)}return t}function R1(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function A1(e,t){let n=R1(e),r=n;return e.eat(",")&&(r="}"!=e.next?R1(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function N1(e,t){return t-e}function D1(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:s}=i[e];r||-1!=n.indexOf(s)||t(s)}}(t),n.sort(N1)}function L1(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 F1(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function j1(e,t,n,r){for(let r in t)if(!(r in e))throw new 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 $1(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new V1(e,r,t[r]);return n}class B1{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=$1(e,n.attrs),this.defaultAttrs=L1(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==O1.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:F1(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new S1(this,this.computeAttrs(e),e1.from(t),i1.setFrom(n))}createChecked(e=null,t,n){return t=e1.from(t),this.checkContent(t),new S1(this,this.computeAttrs(e),t,i1.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=e1.from(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(e1.empty,!0);return i?new S1(this,e,t.append(i),i1.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 new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){j1(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:i1.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new B1(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class V1{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class z1{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=$1(e,r.attrs),this.excluded=null;let i=L1(this.attrs);this.instance=i?new i1(this,i):null}create(e=null){return!e&&this.instance?this.instance:new i1(this,F1(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new z1(e,r++,t,i))),n}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){j1(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class H1{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=Z0.from(e.nodes),t.marks=Z0.from(e.marks||{}),this.nodes=B1.compile(this.spec.nodes,this),this.marks=z1.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new 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]=O1.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?U1(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:U1(this,n.split(" "))}this.nodeFromJSON=e=>S1.fromJSON(this,e),this.markFromJSON=e=>i1.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof B1))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new 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 _1(n,n.defaultAttrs,e,i1.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function U1(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e.marks[i],o=s;if(s)n.push(s);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 new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class K1{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach((e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(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 Z1(this,t,!1);return n.addAll(e,i1.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Z1(this,t,!0);return n.addAll(e,i1.none,t.from,t.to),o1.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(J1(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)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],s=r.style;if(!(0!=s.indexOf(e)||r.context&&!n.matchesContext(r.context)||s.length>e.length&&(61!=s.charCodeAt(e.length)||s.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?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=Q1(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=Q1(e)),e.node||e.ignore||e.mark||(e.node=t)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new K1(e,K1.schemaRules(e)))}}const W1={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},G1={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},q1={ol:!0,ul:!0};function X1(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class Y1{constructor(e,t,n,r,i,s){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=s,this.content=[],this.activeMarks=i1.none,this.match=i||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(e1.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=e1.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(e1.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&&!W1.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Z1{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,i=t.topNode,s=X1(null,t.preserveWhitespace,0)|(n?4:0);r=i?new Y1(i.type,i.attrs,i1.none,!0,t.topMatch||i.type.contentMatch,s):new Y1(n?null:e.schema.topNodeType,null,i1.none,!0,null,s),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:s}=this.parser;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(s.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(s.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else 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&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(s.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s,o=e.nodeName.toLowerCase();q1.hasOwnProperty(o)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&q1.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(a?a.ignore:G1.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let n,r=this.needsBlock;if(W1.hasOwnProperty(o))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 e}let s=a&&a.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,a,n,!1===a.consuming?s:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||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)),!1!==n.consuming)break;e=n}}return t}addElementByRule(e,t,n,r){let i,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(s,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(s&&s.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;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?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 s=n?e.childNodes[n]:e.firstChild,o=null==r?null:e.childNodes[r];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,s=0;t>=0;t--){let o=this.nodes[t],a=o.findWrapping(e);if(a&&(!r||r.length>a.length+s)&&(r=a,i=o,!a.length))break;if(o.solid){if(n)break;s+=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=t.match.matchType(e.type));let n=i1.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):e2(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&&(i=this.enterInner(e,t,n,!0,r)),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let o=X1(e,i,s.options);4&s.options&&0==s.content.length&&(o|=4);let a=i1.none;return n=n.filter((t=>!(s.type?s.type.allowsMarkType(t.type):e2(t.type,e))||(a=t.addToSet(a),!1))),this.nodes.push(new Y1(e,t,a,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;this.localPreserveWS&&(this.nodes[t].options|=1)}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++)null==this.find[t].pos&&1==e.nodeType&&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++)if(null==this.find[r].pos&&1==e.nodeType&&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),s=(e,o)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;o>=i;o--)if(s(e-1,o))return!0;return!1}{let e=o>0||0==o&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;o--}}return!0};return s(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 J1(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Q1(e){let t={};for(let n in e)t[n]=e[n];return t}function e2(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let s=[],o=e=>{s.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(s.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}class t2{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=r2(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,s=0;for(;n<i.length&&s<e.marks.length;){let t=e.marks[s];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,s++}else s++}for(;n<i.length;)r=i.pop()[1];for(;s<e.marks.length;){let n=e.marks[s++],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}=o2(r2(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new 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&&o2(r2(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return o2(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t2(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=n2(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return n2(e.marks)}}function n2(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function r2(e){return e.document||window.document}const i2=new WeakMap;function s2(e){let t=i2.get(e);return void 0===t&&i2.set(e,t=function(e){let t=null;function n(e){if(e&&"object"==typeof e)if(Array.isArray(e))if("string"==typeof e[0])t||(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}(e)),t}function o2(e,t,n,r){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let i,s=t[0];if("string"!=typeof s)throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=s2(r))&&i.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o,a=s.indexOf(" ");a>0&&(n=s.slice(0,a),s=s.slice(a+1));let l=n?e.createElementNS(n,s):e.createElement(s),c=t[1],d=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){d=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?l.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&l.style?l.style.cssText=c[e]:l.setAttribute(e,c[e])}}for(let i=d;i<t.length;i++){let s=t[i];if(0===s){if(i<t.length-1||i>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}{let{dom:t,contentDOM:i}=o2(e,s,n,r);if(l.appendChild(t),i){if(o)throw new RangeError("Multiple content holes");o=i}}}return{dom:l,contentDOM:o}}const a2=Math.pow(2,16);function l2(e,t){return e+t*a2}function c2(e){return 65535&e}class d2{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class h2{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&h2.empty)return h2.empty}recover(e){let t=0,n=c2(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/a2}(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,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let a=this.ranges[o]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[o+i],c=this.ranges[o+s],d=a+l;if(e<=d){let i=a+r+((l?e==a?-1:e==d?1:t:t)<0?0:c);if(n)return i;let s=e==(t<0?a:d)?null:l2(o/3,e-a),h=e==a?2:e==d?1:4;return(t<0?e!=a:e!=d)&&(h|=8),new d2(i,h,s)}r+=c-l}return n?e+r:new d2(e+r,0,null)}touches(e,t){let n=0,r=c2(t),i=this.inverted?2:1,s=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 a=this.ranges[t+i];if(e<=o+a&&t==3*r)return!0;n+=this.ranges[t+s]-a}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 s=this.ranges[r],o=s-(this.inverted?i:0),a=s+(this.inverted?0:i),l=this.ranges[r+t],c=this.ranges[r+n];e(o,o+l,a,a+c),i+=c-l}}invert(){return new h2(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?h2.empty:new h2(e<0?[0,-e,0]:[0,0,e])}}h2.empty=new h2([]);class u2{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(e=0,t=this.maps.length){return new u2(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&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],null!=r&&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=[]),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(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new u2;return e.appendMappingInverted(this),e}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(null!=i.recover){let t=this.getMirror(n);if(null!=t&&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 d2(e,r,null)}}const p2=Object.create(null);class f2{getMap(){return h2.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=p2[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in p2)throw new RangeError("Duplicate use of step JSON ID "+e);return p2[e]=t,t.prototype.jsonID=e,t}}class m2{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new m2(e,null)}static fail(e){return new m2(null,e)}static fromReplace(e,t,n,r){try{return m2.ok(e.replace(t,n,r))}catch(e){if(e instanceof s1)return m2.fail(e.message);throw e}}}function g2(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let s=e.child(i);s.content.size&&(s=s.copy(g2(s.content,t,s))),s.isInline&&(s=t(s,n,i)),r.push(s)}return e1.fromArray(r)}class y2 extends f2{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 o1(g2(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return m2.fromReplace(e,this.from,this.to,i)}invert(){return new v2(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new y2(t.pos,n.pos,this.mark)}merge(e){return e instanceof y2&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new y2(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new y2(t.from,t.to,e.markFromJSON(t.mark))}}f2.jsonID("addMark",y2);class v2 extends f2{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 o1(g2(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return m2.fromReplace(e,this.from,this.to,n)}invert(){return new y2(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new v2(t.pos,n.pos,this.mark)}merge(e){return e instanceof v2&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new v2(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new v2(t.from,t.to,e.markFromJSON(t.mark))}}f2.jsonID("removeMark",v2);class b2 extends f2{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return m2.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return m2.fromReplace(e,this.pos,this.pos+1,new o1(e1.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new b2(this.pos,t.marks[n]);return new b2(this.pos,this.mark)}}return new w2(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new b2(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new b2(t.pos,e.markFromJSON(t.mark))}}f2.jsonID("addNodeMark",b2);class w2 extends f2{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return m2.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return m2.fromReplace(e,this.pos,this.pos+1,new o1(e1.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new b2(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new w2(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new w2(t.pos,e.markFromJSON(t.mark))}}f2.jsonID("removeNodeMark",w2);class x2 extends f2{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&C2(e,this.from,this.to)?m2.fail("Structure replace would overwrite content"):m2.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new h2([this.from,this.to-this.from,this.slice.size])}invert(e){return new x2(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new x2(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof x2)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?o1.empty:new o1(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new x2(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?o1.empty:new o1(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new x2(this.from,this.to+(e.to-e.from),t,this.structure)}}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(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new x2(t.from,t.to,o1.fromJSON(e,t.slice),!!t.structure)}}f2.jsonID("replace",x2);class E2 extends f2{constructor(e,t,n,r,i,s,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=s,this.structure=o}apply(e){if(this.structure&&(C2(e,this.from,this.gapFrom)||C2(e,this.gapTo,this.to)))return m2.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return m2.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?m2.fromReplace(e,this.from,this.to,n):m2.fail("Content does not fit in gap")}getMap(){return new h2([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new E2(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new E2(t.pos,n.pos,r,i,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(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new E2(t.from,t.to,t.gapFrom,t.gapTo,o1.fromJSON(e,t.slice),t.insert,!!t.structure)}}function C2(e,t,n){let r=e.resolve(t),i=n-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let e=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function S2(e,t,n,r=n.contentMatch,i=!0){let s=e.doc.nodeAt(t),o=[],a=t+1;for(let t=0;t<s.childCount;t++){let l=s.child(t),c=a+l.nodeSize,d=r.matchType(l.type);if(d){r=d;for(let t=0;t<l.marks.length;t++)n.allowsMarkType(l.marks[t].type)||e.step(new v2(a,c,l.marks[t]));if(i&&l.isText&&"pre"!=n.whitespace){let e,t,r=/\r?\n|\r/g;for(;e=r.exec(l.text);)t||(t=new o1(e1.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),o.push(new x2(a+e.index,a+e.index+e[0].length,t))}}else o.push(new x2(a,c,o1.empty));a=c}if(!r.validEnd){let t=r.fillBefore(e1.empty,!0);e.replace(a,a,new o1(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function _2(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function k2(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),s=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,s,t))return n;if(0==n||r.type.spec.isolating||!_2(r,i,s))break}return null}function O2(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.contentMatchAt(r).findWrapping(t);if(!s)return null;let o=s.length?s[0]:t;return n.canReplaceWith(r,i,o)?s:null}(e,t),s=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.child(r),o=t.contentMatch.findWrapping(s.type);if(!o)return null;let a=o.length?o[o.length-1]:t,l=a.contentMatch;for(let e=r;l&&e<i;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?o:null}(r,t);return s?i.map(T2).concat({type:t,attrs:n}).concat(s.map(T2)):null}function T2(e){return{type:e,attrs:null}}function P2(e,t,n,r){t.forEach(((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let i=e.mapping.slice(r).map(n+1+s+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}}))}function I2(e,t,n,r){t.forEach(((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+s);e.replaceWith(i,i+1,t.type.schema.text("\n"))}}))}function M2(e,t,n=1,r){let i=e.resolve(t),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<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>s;e--,t--){let n=i.node(e),s=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(s,n.childCount),a=r&&r[t+1];a&&(o=o.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[t]||n;if(!n.canReplace(s+1,n.childCount)||!l.type.validContent(o))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function R2(e,t){let n=e.resolve(t),r=n.index();return A2(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function A2(e,t){return!(!e||!t||e.isLeaf||!function(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 s=t.child(i),o=s.type==r?e.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n)return!1;if(!e.type.allowsMarks(s.marks))return!1}return n.validEnd}(e,t))}function N2(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,s,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(e+1),o++,s=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),s=r.node(e+1)),i&&!i.isTextblock&&A2(i,s)&&r.node(e).canReplace(o,o+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function D2(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<=(0==n.openStart&&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,s=r.index(t)+(n>0?1:0),o=r.node(t),a=!1;if(1==e)a=o.canReplace(s,s,i);else{let e=o.contentMatchAt(s).findWrapping(i.firstChild.type);a=e&&o.canReplaceWith(s,s,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function L2(e,t,n=t,r=o1.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),s=e.resolve(n);return F2(i,s,r)?new x2(t,n,r):new j2(i,s,r).fit()}function F2(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}f2.jsonID("replaceAround",E2);class j2{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=e1.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=e1.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,s=n.depth,o=r.depth;for(;s&&o&&1==i.childCount;)i=i.firstChild.content,s--,o--;let a=new o1(i,s,o);return e>-1?new E2(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new x2(n.pos,r.pos,a):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=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=V2(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 s,{type:o,match:a}=this.frontier[e],l=null;if(1==t&&(i?a.matchType(i.type)||(l=a.fillBefore(e1.from(i),!1)):r&&o.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:l};if(2==t&&i&&(s=a.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=V2(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new o1(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=V2(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new o1($2(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new o1($2(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 s=this.unplaced,o=n?n.content:s.content,a=s.openStart-e,l=0,c=[],{match:d,type:h}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));d=d.matchFragment(r)}let u=o.size+e-(s.content.size-s.openEnd);for(;l<o.childCount;){let e=o.child(l),t=d.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(d=t,c.push(z2(e.mark(h.allowedMarks(e.marks)),1==l?a:0,l==o.childCount?u:-1)))}let p=l==o.childCount;p||(u=-1),this.placed=B2(this.placed,t,e1.from(c)),this.frontier[t].match=d,p&&u<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<u;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?0==e?o1.empty:new o1($2(s.content,e-1,1),e-1,u<0?s.openEnd:e-1):new o1($2(s.content,e,l),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!H2(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e: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)),s=H2(e,t,r,n,i);if(s){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=H2(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:s,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=B2(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=B2(this.placed,this.depth,e1.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(e1.empty,!0);e.childCount&&(this.placed=B2(this.placed,this.frontier.length,e))}}function $2(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy($2(e.firstChild.content,t-1,n)))}function B2(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(B2(e.lastChild.content,t-1,n)))}function V2(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function z2(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,z2(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(e1.empty,!0)))),e.copy(r)}function H2(e,t,n,r,i){let s=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,s.content,o)?a:null}function U2(e){return e.spec.defining||e.spec.definingForContent}function K2(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(K2(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(e1.empty,!0))}return e}function W2(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}class G2 extends f2{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 m2.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 m2.fromReplace(e,this.pos,this.pos+1,new o1(e1.from(r),0,t.isLeaf?0:1))}getMap(){return h2.empty}invert(e){return new G2(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new G2(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new G2(t.pos,t.attr,t.value)}}f2.jsonID("attr",G2);class q2 extends f2{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 m2.ok(n)}getMap(){return h2.empty}invert(e){return new q2(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new q2(t.attr,t.value)}}f2.jsonID("docAttr",q2);let X2=class extends Error{};X2=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(X2.prototype=Object.create(Error.prototype)).constructor=X2,X2.prototype.name="TransformError";class Y2{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new u2}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new X2(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}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=o1.empty){let r=L2(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new o1(e1.from(n),0,0))}delete(e,t){return this.replace(e,t,o1.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),s=e.doc.resolve(n);if(F2(i,s,r))return e.step(new x2(t,n,r));let o=W2(i,e.doc.resolve(n));0==o[o.length-1]&&o.pop();let a=-(i.depth+1);o.unshift(a);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?a=e:i.before(e)==t&&o.splice(1,0,-e)}let l=o.indexOf(a),c=[],d=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=d-1;e>=0;e--){let t=c[e],n=U2(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(a)-1)))d=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+d+1)%(r.openStart+1),h=c[a];if(h)for(let t=0;t<o.length;t++){let c=o[(t+l)%o.length],d=!0;c<0&&(d=!1,c=-c);let u=i.node(c-1),p=i.index(c-1);if(u.canReplaceWith(p,p,h.type,h.marks))return e.replace(i.before(c),d?s.after(c):n,new o1(K2(r.content,0,r.openStart,a),a,r.openEnd))}}let h=e.steps.length;for(let a=o.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>h));a--){let e=o[a];e<0||(t=i.before(e),n=s.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)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}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new o1(e1.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),s=W2(r,i);for(let t=0;t<s.length;t++){let n=s[t],o=t==s.length-1;if(o&&0==n||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 s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:s}=t,o=r.before(s+1),a=i.after(s+1),l=o,c=a,d=e1.empty,h=0;for(let e=s,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,d=e1.from(r.node(e).copy(d)),h++):l--;let u=e1.empty,p=0;for(let e=s,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,u=e1.from(i.node(e).copy(u)),p++):c++;e.step(new E2(l,c,o,a,new o1(d.append(u),h,p),d.size-h,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,s=e.doc.resolve(t-n),o=s.node().type;if(i&&o.inlineContent){let e="pre"==o.whitespace,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let a=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);I2(e,r.node(),r.before(),a)}o.inlineContent&&S2(e,t+n-1,o,s.node().contentMatchAt(s.index()),null==r);let l=e.mapping.slice(a),c=l.map(t-n);if(e.step(new x2(c,l.map(t+n,-1),o1.empty,!0)),!0===r){let t=e.doc.resolve(c);P2(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=e1.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 new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=e1.from(n[e].type.create(n[e].attrs,r))}let i=t.start,s=t.end;e.step(new E2(i,s,i,s,new o1(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{let o="function"==typeof i?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(s).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}!1===i&&I2(e,t,n,s),S2(e,e.mapping.slice(s).map(n,1),r,void 0,null===i);let a=e.mapping.slice(s),l=a.map(n,1),c=a.map(n+t.nodeSize,1);return e.step(new E2(l,c,l+1,c-1,new o1(e1.from(r.create(o,null,t.marks)),0,0),1,!0)),!0===i&&P2(e,t,n,s),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return function(e,t,n,r,i){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new E2(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new o1(e1.from(o),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new G2(e,t,n)),this}setDocAttribute(e,t){return this.step(new q2(e,t)),this}addNodeMark(e,t){return this.step(new b2(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof i1)t.isInSet(n.marks)&&this.step(new w2(e,t));else{let r,i=n.marks,s=[];for(;r=t.isInSet(i);)s.push(new w2(e,r)),i=r.removeFromSet(i);for(let e=s.length-1;e>=0;e--)this.step(s[e])}return this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),s=e1.empty,o=e1.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){s=e1.from(i.node(e).copy(s));let t=r&&r[a];o=e1.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new x2(t,t,new o1(s.append(o),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,s,o=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let d=e.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),h=Math.min(l+e.nodeSize,n),u=r.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(u)||(i&&i.to==c&&i.mark.eq(d[e])?i.to=h:o.push(i=new v2(c,h,d[e])));s&&s.to==c?s.to=h:a.push(s=new y2(c,h,r))}})),o.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],s=0;e.doc.nodesBetween(t,n,((e,o)=>{if(!e.isInline)return;s++;let a=null;if(r instanceof z1){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==s-1&&l.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=s):i.push({style:l,from:Math.max(o,t),to:r,step:s})}}})),i.forEach((t=>e.step(new v2(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return S2(this,e,t,n),this}}const Z2=Object.create(null);class J2{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Q2(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=o1.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,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:a,$to:l}=s[o],c=e.mapping.slice(i);e.replaceRange(c.map(a.pos),c.map(l.pos),o?o1.empty:t),0==o&&c5(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:s,$to:o}=r[i],a=e.mapping.slice(n),l=a.map(s.pos),c=a.map(o.pos);i?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),c5(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new n5(e):l5(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?l5(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):l5(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 o5(e.node(0))}static atStart(e){return l5(e,e,0,0,1)||new o5(e)}static atEnd(e){return l5(e,e,e.content.size,e.childCount,-1)||new o5(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Z2[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Z2)throw new RangeError("Duplicate use of selection JSON ID "+e);return Z2[e]=t,t.prototype.jsonID=e,t}getBookmark(){return n5.between(this.$anchor,this.$head).getBookmark()}}J2.prototype.visible=!0;class Q2{constructor(e,t){this.$from=e,this.$to=t}}let e5=!1;function t5(e){e5||e.parent.inlineContent||(e5=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class n5 extends J2{constructor(e,t=e){t5(e),t5(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return J2.near(n);let r=e.resolve(t.map(this.anchor));return new n5(r.parent.inlineContent?r:n,n)}replace(e,t=o1.empty){if(super.replace(e,t),t==o1.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof n5&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new r5(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new n5(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=J2.findFrom(t,n,!0)||J2.findFrom(t,-n,!0);if(!e)return J2.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(J2.findFrom(e,-n,!0)||J2.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new n5(e,t)}}J2.jsonID("text",n5);class r5{constructor(e,t){this.anchor=e,this.head=t}map(e){return new r5(e.map(this.anchor),e.map(this.head))}resolve(e){return n5.between(e.resolve(this.anchor),e.resolve(this.head))}}class i5 extends J2{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?J2.near(i):new i5(i)}content(){return new o1(e1.from(this.node),0,0)}eq(e){return e instanceof i5&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new s5(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new i5(e.resolve(t.anchor))}static create(e,t){return new i5(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}i5.prototype.visible=!1,J2.jsonID("node",i5);class s5{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new r5(n,n):new s5(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&i5.isSelectable(n)?new i5(t):J2.near(t)}}class o5 extends J2{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=o1.empty){if(t==o1.empty){e.delete(0,e.doc.content.size);let t=J2.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new o5(e)}map(e){return new o5(e)}eq(e){return e instanceof o5}getBookmark(){return a5}}J2.jsonID("all",o5);const a5={map(){return this},resolve:e=>new o5(e)};function l5(e,t,n,r,i,s=!1){if(t.inlineContent)return n5.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){if(!s&&i5.isSelectable(r))return i5.create(e,n-(i<0?r.nodeSize:0))}else{let t=l5(e,r,n+i,i<0?r.childCount:0,i,s);if(t)return t}n+=r.nodeSize*i}return null}function c5(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,s=e.steps[r];(s instanceof x2||s instanceof E2)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(J2.near(e.doc.resolve(i),n)))}class d5 extends Y2{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 new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return i1.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(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,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)||i1.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!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.setSelection(J2.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function h5(e,t){return t&&e?e.bind(t):e}class u5{constructor(e,t,n){this.name=e,this.init=h5(t.init,n),this.apply=h5(t.apply,n)}}const p5=[new u5("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new u5("selection",{init:(e,t)=>e.selection||J2.atStart(t.doc),apply:e=>e.selection}),new u5("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new u5("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class f5{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=p5.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new 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 u5(e.key,e.spec.state,e))}))}}class m5{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 s=0;s<this.config.plugins.length;s++){let o=this.config.plugins[s];if(o.spec.appendTransaction){let a=r?r[s].n:0,l=r?r[s].state:this,c=a<t.length&&o.spec.appendTransaction.call(o,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<s?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[s]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new m5(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new d5(this)}static create(e){let t=new f5(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new m5(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new f5(this.schema,e.plugins),n=t.fields,r=new m5(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new 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(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new f5(e.schema,e.plugins),i=new m5(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=S1.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=J2.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let s in n){let o=n[s],a=o.spec.state;if(o.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,s))return void(i[r.name]=a.fromJSON.call(o,e,t[s],i))}i[r.name]=r.init(e,i)}})),i}}function g5(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=g5(i,t,{})),n[r]=i}return n}class y5{constructor(e){this.spec=e,this.props={},e.props&&g5(e.props,this,this.props),this.key=e.key?e.key.key:b5("plugin")}getState(e){return e[this.key]}}const v5=Object.create(null);function b5(e){return e in v5?e+"$"+ ++v5[e]:(v5[e]=0,e+"$")}class w5{constructor(e="key"){this.key=b5(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const x5=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function E5(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const C5=(e,t,n)=>{let r=E5(e,n);if(!r)return!1;let i=P5(r);if(!i){let n=r.blockRange(),i=n&&k2(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let s=i.nodeBefore;if(K5(e,i,t,-1))return!0;if(0==r.parent.content.size&&(O5(s,"end")||i5.isSelectable(s)))for(let n=r.depth;;n--){let o=L2(e.doc,r.before(n),r.after(n),o1.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(O5(s,"end")?J2.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):i5.create(n.doc,i.pos-s.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!(!s.isAtom||i.depth!=r.depth-1)&&(t&&t(e.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0)},S5=(e,t,n)=>{let r=E5(e,n);if(!r)return!1;let i=P5(r);return!!i&&k5(e,i,t)},_5=(e,t,n)=>{let r=I5(e,n);if(!r)return!1;let i=A5(r);return!!i&&k5(e,i,t)};function k5(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 s=t.nodeAfter,o=t.pos+1;for(;!s.isTextblock;o++){if(s.type.spec.isolating)return!1;let e=s.firstChild;if(!e)return!1;s=e}let a=L2(e.doc,i,o,o1.empty);if(!a||a.from!=i||a instanceof x2&&a.slice.size>=o-i)return!1;if(n){let t=e.tr.step(a);t.setSelection(n5.create(t.doc,i)),n(t.scrollIntoView())}return!0}function O5(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}const T5=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=P5(r)}let o=s&&s.nodeBefore;return!(!o||!i5.isSelectable(o))&&(t&&t(e.tr.setSelection(i5.create(e.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function P5(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 I5(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const M5=(e,t,n)=>{let r=I5(e,n);if(!r)return!1;let i=A5(r);if(!i)return!1;let s=i.nodeAfter;if(K5(e,i,t,1))return!0;if(0==r.parent.content.size&&(O5(s,"start")||i5.isSelectable(s))){let n=L2(e.doc,r.before(),r.after(),o1.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(O5(s,"start")?J2.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):i5.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!(!s.isAtom||i.depth!=r.depth-1)&&(t&&t(e.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0)},R5=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=A5(r)}let o=s&&s.nodeAfter;return!(!o||!i5.isSelectable(o))&&(t&&t(e.tr.setSelection(i5.create(e.doc,s.pos)).scrollIntoView()),!0)};function A5(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}const N5=(e,t)=>{let n,r=e.selection,i=r instanceof i5;if(i){if(r.node.isTextblock||!R2(e.doc,r.from))return!1;n=r.from}else if(n=N2(e.doc,r.from,-1),null==n)return!1;if(t){let r=e.tr.join(n);i&&r.setSelection(i5.create(r.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0},D5=(e,t)=>{let n,r=e.selection;if(r instanceof i5){if(r.node.isTextblock||!R2(e.doc,r.to))return!1;n=r.to}else if(n=N2(e.doc,r.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0},L5=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),s=i&&k2(i);return null!=s&&(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)},F5=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function j5(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const $5=(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),s=n.indexAfter(-1),o=j5(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(J2.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},B5=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof o5||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=j5(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,s.createAndFill());o.setSelection(n5.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},V5=(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(M2(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&k2(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};const z5=(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof i5&&e.selection.node.isBlock)return!(!n.parentOffset||!M2(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let i,s,o=[],a=!1,l=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){a=n.end(e)==n.pos+(n.depth-e),l=n.start(e)==n.pos-(n.depth-e),s=j5(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));let t=H5&&H5(r.parent,a,n);o.unshift(t||(a&&s?{type:s}:null)),i=e;break}if(1==e)return!1;o.unshift(null)}let c=e.tr;(e.selection instanceof n5||e.selection instanceof o5)&&c.deleteSelection();let d=c.mapping.map(n.pos),h=M2(c.doc,d,o.length,o);if(h||(o[0]=s?{type:s}:null,h=M2(c.doc,d,o.length,o)),!h)return!1;if(c.split(d,o.length,o),!a&&l&&n.node(i).type!=s){let e=c.mapping.map(n.before(i)),t=c.doc.resolve(e);s&&n.node(i-1).canReplaceWith(t.index(),t.index()+1,s)&&c.setNodeMarkup(c.mapping.map(n.before(i)),s)}return t&&t(c.scrollIntoView()),!0};var H5;const U5=(e,t)=>{let n,{$from:r,to:i}=e.selection,s=r.sharedDepth(i);return 0!=s&&(n=r.before(s),t&&t(e.tr.setSelection(i5.create(e.doc,n))),!0)};function K5(e,t,n,r){let i,s,o=t.nodeBefore,a=t.nodeAfter,l=o.type.spec.isolating||a.type.spec.isolating;if(!l&&function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,s=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(s,s+1)||!i.isTextblock&&!R2(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(i=(s=o.contentMatchAt(o.childCount)).findWrapping(a.type))&&s.matchType(i[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=e1.empty;for(let e=i.length-1;e>=0;e--)s=e1.from(i[e].create(null,s));s=e1.from(o.copy(s));let l=e.tr.step(new E2(t.pos-1,r,t.pos,r,new o1(s,1,0),i.length,!0)),c=l.doc.resolve(r+2*i.length);c.nodeAfter&&c.nodeAfter.type==o.type&&R2(l.doc,c.pos)&&l.join(c.pos),n(l.scrollIntoView())}return!0}let d=a.type.spec.isolating||r>0&&l?null:J2.findFrom(t,1),h=d&&d.$from.blockRange(d.$to),u=h&&k2(h);if(null!=u&&u>=t.depth)return n&&n(e.tr.lift(h,u).scrollIntoView()),!0;if(c&&O5(a,"start",!0)&&O5(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let s=a,l=1;for(;!s.isTextblock;s=s.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=e1.empty;for(let e=i.length-1;e>=0;e--)r=e1.from(i[e].copy(r));n(e.tr.step(new E2(t.pos-i.length,t.pos+a.nodeSize,t.pos+l,t.pos+a.nodeSize-l,new o1(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function W5(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(t.tr.setSelection(n5.create(t.doc,e<0?i.start(s):i.end(s)))),!0)}}const G5=W5(-1),q5=W5(1);function X5(e,t=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&O2(o,e,t);return!!a&&(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0)}}function Y5(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:s},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(s,o,((r,s)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)i=!0;else{let t=n.doc.resolve(s),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:s},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(s,o,e,t)}r(i.scrollIntoView())}return!0}}function Z5(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let J5=Z5(x5,C5,T5),Q5=Z5(x5,M5,R5);const e3={Enter:Z5(F5,B5,V5,z5),"Mod-Enter":$5,Backspace:J5,"Mod-Backspace":J5,"Shift-Backspace":J5,Delete:Q5,"Mod-Delete":Q5,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new o5(e.doc))),!0)},t3={"Ctrl-h":e3.Backspace,"Alt-Backspace":e3["Mod-Backspace"],"Ctrl-d":e3.Delete,"Ctrl-Alt-Backspace":e3["Mod-Delete"],"Alt-Delete":e3["Mod-Delete"],"Alt-d":e3["Mod-Delete"],"Ctrl-a":G5,"Ctrl-e":q5};for(let e in e3)t3[e]=e3[e];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&os.platform();function n3(e,t=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s);if(!o)return!1;let a=r?n.tr:null;return!!function(e,t,n,r=null){let i=!1,s=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=o.resolve(t.start-2);s=new E1(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new E1(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let a=O2(s,n,r,t);if(!a)return!1;e&&function(e,t,n,r,i){let s=e1.empty;for(let e=n.length-1;e>=0;e--)s=e1.from(n[e].type.create(n[e].attrs,s));e.step(new E2(t.start-(r?2:0),t.end,t.start,t.end,new o1(s,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let a=n.length-o,l=t.start+n.length-(r?2:0),c=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&M2(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(n).nodeSize}(e,t,a,i,n);return!0}(a,o,e,t)&&(r&&r(a.scrollIntoView()),!0)}}function r3(e){return function(t,n){let{$from:r,$to:i}=t.selection,s=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));return!!s&&(!n||(r.node(s.depth-1).type==e?function(e,t,n,r){let i=e.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new E2(s-1,o,s,o,new o1(e1.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new E1(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=k2(r);if(null==a)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);R2(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos);return t(i.scrollIntoView()),!0}(t,n,e,s):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,s=n.startIndex;t>s;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,c=s.node(-1),d=s.index(-1);if(!c.canReplace(d+(a?0:1),d+1,o.content.append(l?e1.empty:e1.from(i))))return!1;let h=s.pos,u=h+o.nodeSize;return r.step(new E2(h-(a?1:0),u+(l?1:0),h+1,u-1,new o1((a?e1.empty:e1.from(i.copy(e1.empty))).append(l?e1.empty:e1.from(i.copy(e1.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,s)))}}function i3(e){return function(t,n){let{$from:r,$to:i}=t.selection,s=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));if(!s)return!1;let o=s.startIndex;if(0==o)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=e)return!1;if(n){let r=l.lastChild&&l.lastChild.type==a.type,i=e1.from(r?e.create():null),o=new o1(e1.from(e.create(null,e1.from(a.type.create(null,i)))),r?3:1,0),c=s.start,d=s.end;n(t.tr.step(new E2(c-(r?3:1),d,c,d,o,1,!0)).scrollIntoView())}return!0}}const s3=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},o3=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let a3=null;const l3=function(e,t,n){let r=a3||(a3=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},c3=function(e,t,n,r){return n&&(h3(e,t,n,r,-1)||h3(e,t,n,r,1))},d3=/^(img|br|input|textarea|hr)$/i;function h3(e,t,n,r,i){for(var s;;){if(e==n&&t==r)return!0;if(t==(i<0?0:u3(e))){let n=e.parentNode;if(!n||1!=n.nodeType||p3(e)||d3.test(e.nodeName)||"false"==e.contentEditable)return!1;t=s3(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;{let n=e.childNodes[t+(i<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(s=n.pmViewDesc)||void 0===s?void 0:s.ignoreForSelection))return!1;t+=i}else e=n,t=i<0?u3(e):0}}}}function u3(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function p3(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)}const f3=function(e){return e.focusNode&&c3(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function m3(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const g3="undefined"!=typeof navigator?navigator:null,y3="undefined"!=typeof document?document:null,v3=g3&&g3.userAgent||"",b3=/Edge\/(\d+)/.exec(v3),w3=/MSIE \d/.exec(v3),x3=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(v3),E3=!!(w3||x3||b3),C3=w3?document.documentMode:x3?+x3[1]:b3?+b3[1]:0,S3=!E3&&/gecko\/(\d+)/i.test(v3);S3&&(/Firefox\/(\d+)/.exec(v3)||[0,0])[1];const _3=!E3&&/Chrome\/(\d+)/.exec(v3),k3=!!_3,O3=_3?+_3[1]:0,T3=!E3&&!!g3&&/Apple Computer/.test(g3.vendor),P3=T3&&(/Mobile\/\w+/.test(v3)||!!g3&&g3.maxTouchPoints>2),I3=P3||!!g3&&/Mac/.test(g3.platform),M3=!!g3&&/Win/.test(g3.platform),R3=/Android \d/.test(v3),A3=!!y3&&"webkitFontSmoothing"in y3.documentElement.style,N3=A3?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function D3(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 L3(e,t){return"number"==typeof e?e:e[t]}function F3(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 j3(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(1!=o.nodeType){o=o3(o);continue}let e=o,n=e==s.body,a=n?D3(s):F3(e),l=0,c=0;if(t.top<a.top+L3(r,"top")?c=-(a.top-t.top+L3(i,"top")):t.bottom>a.bottom-L3(r,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+L3(i,"top")-a.top:t.bottom-a.bottom+L3(i,"bottom")),t.left<a.left+L3(r,"left")?l=-(a.left-t.left+L3(i,"left")):t.right>a.right-L3(r,"right")&&(l=t.right-a.right+L3(i,"right")),l||c)if(n)s.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,s=e.scrollTop-r;t={left:t.left-i,top:t.top-s,right:t.right-i,bottom:t.bottom-s}}let d=n?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(d))break;o="absolute"==d?o.offsetParent:o3(o)}}function $3(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=o3(r));return t}function B3(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:s}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=s&&(r.scrollLeft=s)}}let V3=null;function z3(e,t){let n,r,i,s,o=2e8,a=0,l=t.top,c=t.top;for(let d=e.firstChild,h=0;d;d=d.nextSibling,h++){let e;if(1==d.nodeType)e=d.getClientRects();else{if(3!=d.nodeType)continue;e=l3(d).getClientRects()}for(let u=0;u<e.length;u++){let p=e[u];if(p.top<=l&&p.bottom>=c){l=Math.max(p.bottom,l),c=Math.min(p.top,c);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<o){n=d,o=e,r=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==d.nodeType&&e&&(a=h+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!i&&p.left<=t.left&&p.right>=t.left&&(i=d,s={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=h+1)}}return!n&&i&&(n=i,r=s,o=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=G3(r,1);if(n.top!=n.bottom&&H3(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:a}:z3(n,r)}function H3(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function U3(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)),s=i;;){let n=e.childNodes[s];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(H3(t,i))return U3(n,t,i)}}if((s=(s+1)%r)==i)break}return e}function K3(e,t){let n,r=e.dom.ownerDocument,i=0,s=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(u3(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(u3(r.startContainer),r.startOffset)}}}(r,t.left,t.top);s&&({node:n,offset:i}=s);let o,a=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!a||!e.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=e.dom.getBoundingClientRect();if(!H3(t,n))return null;if(a=U3(e.dom,t,n),!a)return null}if(T3)for(let e=a;n&&e;e=o3(e))e.draggable&&(n=void 0);if(a=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(a,t),n){if(S3&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}let r;A3&&i&&1==n.nodeType&&1==(r=n.childNodes[i-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&i--,n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let n=t,s=!1;n!=e.dom;){let t,o=e.docView.nearestDesc(n,!0);if(!o)return null;if(1==o.dom.nodeType&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((t=o.dom.getBoundingClientRect()).width||t.height)&&(o.node.isBlock&&o.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(o.dom.nodeName)&&(!s&&t.left>r.left||t.top>r.top?i=o.posBefore:(!s&&t.right<r.left||t.bottom<r.top)&&(i=o.posAfter),s=!0),!o.contentDOM&&i<0&&!o.node.isText))return(o.node.isBlock?r.top<(t.top+t.bottom)/2:r.left<(t.left+t.right)/2)?o.posBefore:o.posAfter;n=o.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=z3(t,n),s=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();s=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,s)}(e,a,t));let l=e.docView.nearestDesc(a,!0);return{pos:o,inside:l?l.posAtStart-l.border:-1}}function W3(e){return e.top<e.bottom||e.left<e.right}function G3(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(W3(e))return e}return Array.prototype.find.call(n,W3)||e.getBoundingClientRect()}const q3=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function X3(e,t,n){let{node:r,offset:i,atom:s}=e.docView.domFromPos(t,n<0?-1:1),o=A3||S3;if(3==r.nodeType){if(!o||!q3.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,s=n<0?1:-1;return n<0&&!i?(t++,s=-1):n>=0&&i==r.nodeValue.length?(e--,s=1):n<0?e--:t++,Y3(G3(l3(r,e,t),s),s<0)}{let e=G3(l3(r,i,i),n);if(S3&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=G3(l3(r,i-1,i-1),-1);if(t.top==e.top){let n=G3(l3(r,i,i+1),-1);if(n.top!=e.top)return Y3(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(null==s&&i&&(n<0||i==u3(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return Z3(e.getBoundingClientRect(),!1)}if(null==s&&i<u3(r)){let e=r.childNodes[i];if(1==e.nodeType)return Z3(e.getBoundingClientRect(),!0)}return Z3(r.getBoundingClientRect(),n>=0)}if(null==s&&i&&(n<0||i==u3(r))){let e=r.childNodes[i-1],t=3==e.nodeType?l3(e,u3(e)-(o?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Y3(G3(t,1),!1)}if(null==s&&i<u3(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?l3(e,0,o?0:1):1==e.nodeType?e:null:null;if(t)return Y3(G3(t,-1),!0)}return Y3(G3(3==r.nodeType?l3(r):r,-n),n>=0)}function Y3(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Z3(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function J3(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()}}const Q3=/[\u0590-\u08ac]/;let e4=null,t4=null,n4=!1;function r4(e,t,n){return e4==t&&t4==n?n4:(e4=t,t4=n,n4="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return J3(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-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=X3(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=l3(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=e.domSelection();return a?Q3.test(r.parent.textContent)&&a.modify?J3(e,t,(()=>{let{focusNode:t,focusOffset:i,anchorNode:s,anchorOffset:o}=e.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:d,focusOffset:h}=e.domSelectionRange(),u=d&&!c.contains(1==d.nodeType?d:d.parentNode)||t==d&&i==h;try{a.collapse(s,o),t&&(t!=s||i!=o)&&a.extend&&a.extend(t,i)}catch(e){}return null!=l&&(a.caretBidiLevel=l),u})):"left"==n||"backward"==n?s:o:r.pos==r.start()||r.pos==r.end()}(e,t,n))}class i4{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,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(1==e.nodeType?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}{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>s3(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,s=this.getDesc(r);if(s&&(!t||s.node)){if(!n||!(i=s.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return s;n=!1}}}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],s=t+i.size;if(s>e||i instanceof h4){r=e-t;break}t=s}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 s4&&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?s3(e.dom)+1:0}}{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?s3(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let s=n,o=0;;o++){let n=this.children[o],a=s+n.size;if(-1==r&&e<=a){let i=s+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=s;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=s3(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||o==this.children.length-1)){t=a;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=s3(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}s=a}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 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),s=Math.max(e,t);for(let o=0,a=0;o<this.children.length;o++){let l=this.children[o],c=a+l.size;if(i>a&&s<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c}let o=this.domFromPos(e,e?-1:1),a=t==e?o:this.domFromPos(t,t?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((S3||T3)&&e==t){let{node:e,offset:t}=o;if(3==e.nodeType){if(d=!(!t||"\n"!=e.nodeValue[t-1]),d&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(o=a={node:t.parentNode,offset:s3(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];d=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(S3&&c.focusNode&&c.focusNode!=a.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||d&&T3)&&c3(o.node,o.offset,c.anchorNode,c.anchorOffset)&&c3(a.node,a.offset,c.focusNode,c.focusOffset))return;let h=!1;if((l.extend||e==t)&&(!d||!S3)){l.collapse(o.node,o.offset);try{e!=t&&l.extend(a.node,a.offset),h=!0}catch(e){}}if(!h){if(e>t){let e=o;o=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(o.node,o.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}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],s=n+i.size;if(n==s?e<=s&&t>=n:e<s&&t>n){let r=n+i.border,o=s-i.border;if(e>=r&&t<=o)return this.dirty=e==n||t==s?2:1,void(e!=r||t!=o||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=s}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class s4 extends i4{constructor(e,t,n,r){let i,s=t.type.toDOM;if("function"==typeof s&&(s=s(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=s.nodeType){let e=document.createElement("span");e.appendChild(s),s=e}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||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}}class o4 extends i4{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.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class a4 extends i4{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(e,t,n,r){let i=r.nodeViews[t.type.name],s=i&&i(t,r,n);return s&&s.dom||(s=t2.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new a4(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=a4.create(this.parent,this.mark,!0,n),i=this.children,s=this.size;t<s&&(i=S4(i,t,s,n)),e>0&&(i=S4(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class l4 extends i4{constructor(e,t,n,r,i,s,o,a,l){super(e,[],i,s),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(e,t,n,r,i,s){let o,a=i.nodeViews[t.type.name],l=a&&a(t,i,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:s),n,r),c=l&&l.dom,d=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=t2.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:d}=e)}d||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let h=c;return c=b4(c,n,t),l?o=new u4(e,t,n,r,c,d||null,h,l,i,s+1):t.isText?new d4(e,t,n,r,c,h,i):new l4(e,t,n,r,c,d||null,h,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){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=()=>e1.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&w4(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,s=i&&i.pos>-1?i:null,o=i&&i.pos<0,a=new E4(this,s&&s.node,e);!function(e,t,n,r){let i=t.locals(e),s=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(s,o),n),s+=o.nodeSize}return}let o=0,a=[],l=null;for(let c=0;;){let d,h,u,p;for(;o<i.length&&i[o].to==s;){let e=i[o++];e.widget&&(d?(h||(h=[d])).push(e):d=e)}if(d)if(h){h.sort(C4);for(let e=0;e<h.length;e++)n(h[e],c,!!l)}else n(d,c,!!l);if(l)p=-1,u=l,l=null;else{if(!(c<e.childCount))break;p=c,u=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=s&&a.splice(e--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let f=s+u.nodeSize;if(u.isText){let e=f;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=u.cut(e-s),u=u.cut(0,e-s),f=e,p=-1)}else for(;o<i.length&&i[o].to<f;)o++;r(u,u.isInline&&!u.isLeaf?a.filter((e=>!e.inline)):a.slice(),t.forChild(s,u),p),s=f}}(this.node,this.innerDeco,((t,i,s)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!s&&a.syncToMarks(i==this.node.childCount?i1.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,s,l,c)=>{let d;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,s,l,c)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(d=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,s,l,d,e)||a.updateNextNode(t,s,l,e,c,r)||a.addNode(t,s,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),p4(this.contentDOM,this.children,e),P3&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof n5)||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,s=function(e,t,n,r){for(let i=0,s=0;i<e.childCount&&s<=r;){let o=e.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<e.childCount;){let t=e.child(i++);if(s+=t.nodeSize,!t.isText)break;l+=t.text}if(s>=n){if(s>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return s<0?null:{node:i,pos:s,text:e}}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&&(i.pmViewDesc=void 0)}let s=new o4(this,i,t,r);e.input.compositionNodes.push(s),this.children=S4(this.children,n,n+r.length,e,s)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(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=0}updateOuterDeco(e){if(w4(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=y4(this.dom,this.nodeDOM,g4(this.outerDeco,this.node,t),g4(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function c4(e,t,n,r,i){b4(r,t,e);let s=new l4(void 0,e,t,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class d4 extends l4{constructor(e,t,n,r,i,s,o){super(e,t,n,r,i,null,s,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!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&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=0,!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"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new d4(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class h4 extends i4{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class u4 extends l4{constructor(e,t,n,r,i,s,o,a,l,c){super(e,t,n,r,i,s,o,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)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}return!(!this.contentDOM&&!e.isLeaf)&&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)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function p4(e,t,n){let r=e.firstChild,i=!1;for(let s=0;s<t.length;s++){let o=t[s],a=o.dom;if(a.parentNode==e){for(;a!=r;)r=x4(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(o instanceof a4){let t=r?r.previousSibling:e.lastChild;p4(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=x4(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const f4=function(e){e&&(this.nodeName=e)};f4.prototype=Object.create(null);const m4=[new f4];function g4(e,t,n){if(0==e.length)return m4;let r=n?m4[0]:new f4,i=[r];for(let s=0;s<e.length;s++){let o=e[s].type.attrs;if(o){o.nodeName&&i.push(r=new f4(o.nodeName));for(let e in o){let s=o[e];null!=s&&(n&&1==i.length&&i.push(r=new f4(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+s:"style"==e?r.style=(r.style?r.style+";":"")+s:"nodeName"!=e&&(r[e]=s))}}}return i}function y4(e,t,n,r){if(n==m4&&r==m4)return t;let i=t;for(let t=0;t<r.length;t++){let s=r[t],o=n[t];if(t){let t;o&&o.nodeName==s.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==s.nodeName||(t=document.createElement(s.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=m4[0]),i=t}v4(i,o||m4[0],s)}return i}function v4(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&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++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function b4(e,t,n){return y4(e,e,m4,g4(t,n,1!=e.nodeType))}function w4(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 x4(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class E4{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof a4)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}(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){let r=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;r<s&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=a4.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,s=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))s=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r<i;r++){let i=this.top.children[r];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){s=r;break}}return!(s<0)&&(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,n,r,i){let s=this.top.children[r];return 3==s.dirty&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}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,s){for(let o=this.index;o<this.top.children.length;o++){let a=this.top.children[o];if(a instanceof l4){let l=this.preMatch.matched.get(a);if(null!=l&&l!=i)return!1;let c,d=a.dom,h=this.isLocked(d)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&w4(t,a.outerDeco));if(!h&&a.update(e,t,n,r))return this.destroyBetween(this.index,o),a.dom!=d&&(this.changed=!0),this.index++,!0;if(!h&&(c=this.recreateWrapper(a,e,t,n,r,s)))return this.destroyBetween(this.index,o),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,s+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!w4(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=l4.create(this.top,t,n,r,i,s);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 s=l4.create(this.top,e,t,n,r,i);s.contentDOM&&s.updateChildren(r,i+1),this.top.children.splice(this.index++,0,s),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){let r=new s4(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof a4;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof d4)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((T3||k3)&&e&&"false"==e.dom.contentEditable&&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);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new h4(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function C4(e,t){return e.type.side-t.type.side}function S4(e,t,n,r,i){let s=[];for(let o=0,a=0;o<e.length;o++){let l=e[o],c=a,d=a+=l.size;c>=n||d<=t?s.push(l):(c<t&&s.push(l.slice(0,t-c,r)),i&&(s.push(i),i=void 0),d>n&&s.push(l.slice(n-c,l.size,r)))}return s}function _4(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),s=i&&0==i.size,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a,l,c=r.resolve(o);if(f3(n)){for(a=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&i5.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==u3(e);r||i;){if(e==n)return!0;let t=s3(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==u3(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new i5(o==e?c: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 s=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(s.startContainer,s.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(s.endContainer,s.endOffset,-1))}if(t<0)return null;[a,o]=i==e.state.selection.anchor?[i,t]:[t,i],c=r.resolve(o)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let d=r.resolve(a);if(!l){l=N4(e,d,c,"pointer"==t||e.state.selection.head<c.pos&&!s?1:-1)}return l}function k4(e){return e.editable?e.hasFocus():L4(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function O4(e,t=!1){let n=e.state.selection;if(R4(e,n),k4(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&k3){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&c3(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,s3(n)+1):t.collapse(n,0);!r&&!e.state.selection.visible&&E3&&C3<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let r,i,{anchor:s,head:o}=n;!T4||n instanceof n5||(n.$from.parent.inlineContent||(r=P4(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=P4(e,n.to))),e.docView.setSelection(s,o,e,t),T4&&(r&&M4(r),i&&M4(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(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((()=>{k4(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const T4=T3||k3&&O3<63;function P4(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(T3&&i&&"false"==i.contentEditable)return I4(i);if(!(i&&"false"!=i.contentEditable||s&&"false"!=s.contentEditable)){if(i)return I4(i);if(s)return I4(s)}}function I4(e){return e.contentEditable="true",T3&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function M4(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function R4(e,t){if(t instanceof i5){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(A4(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else A4(e)}function A4(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function N4(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||n5.between(t,n,r)}function D4(e){return!(e.editable&&!e.hasFocus())&&L4(e)}function L4(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function F4(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&J2.findFrom(s,t)}function j4(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function $4(e,t,n){let r=e.state.selection;if(!(r instanceof n5)){if(r instanceof i5&&r.node.isInline)return j4(e,new n5(t>0?r.$to:r.$from));{let n=F4(e.state,t);return!!n&&j4(e,n)}}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 s=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return j4(e,new n5(r.$anchor,s))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=F4(e.state,t);return!!(n&&n instanceof i5)&&j4(e,n)}if(!(I3&&n.indexOf("m")>-1)){let n,i=r.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText)return!1;let o=t<0?i.pos-s.nodeSize:i.pos;return!!(s.isAtom||(n=e.docView.descAt(o))&&!n.contentDOM)&&(i5.isSelectable(s)?j4(e,new i5(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):!!A3&&j4(e,new n5(e.state.doc.resolve(t<0?o:o+s.nodeSize))))}}function B4(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function V4(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function z4(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,s,o=!1;S3&&1==n.nodeType&&r<B4(n)&&V4(n.childNodes[r],-1)&&(o=!0);for(;;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(V4(e,-1))i=n,s=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(H4(n))break;{let t=n.previousSibling;for(;t&&V4(t,-1);)i=n.parentNode,s=s3(t),t=t.previousSibling;if(t)n=t,r=B4(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}o?U4(e,n,r):i&&U4(e,i,s)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,s,o=B4(n);for(;;)if(r<o){if(1!=n.nodeType)break;if(!V4(n.childNodes[r],1))break;i=n,s=++r}else{if(H4(n))break;{let t=n.nextSibling;for(;t&&V4(t,1);)i=t.parentNode,s=s3(t)+1,t=t.nextSibling;if(t)n=t,r=0,o=B4(n);else{if(n=n.parentNode,n==e.dom)break;r=o=0}}}i&&U4(e,i,s)}(e)}function H4(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function U4(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!p3(e);)t=s3(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!p3(e);)t=s3(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(f3(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&&O4(e)}),50)}function K4(e,t){let n=e.state.doc.resolve(t);if(!k3&&!M3&&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"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function W4(e,t,n){let r=e.state.selection;if(r instanceof n5&&!r.empty||n.indexOf("s")>-1)return!1;if(I3&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=F4(e.state,t);if(n&&n instanceof i5)return j4(e,n)}if(!i.parent.inlineContent){let n=t<0?i:s,o=r instanceof o5?J2.near(n,t):J2.findFrom(n,t);return!!o&&j4(e,o)}return!1}function G4(e,t){if(!(e.state.selection instanceof n5))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 s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=e.state.tr;return t<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),e.dispatch(r),!0}return!1}function q4(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function X4(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||I3&&72==n&&"c"==r)return G4(e,-1)||z4(e,-1);if(46==n&&!t.shiftKey||I3&&68==n&&"c"==r)return G4(e,1)||z4(e,1);if(13==n||27==n)return!0;if(37==n||I3&&66==n&&"c"==r){let t=37==n?"ltr"==K4(e,e.state.selection.from)?-1:1:-1;return $4(e,t,r)||z4(e,t)}if(39==n||I3&&70==n&&"c"==r){let t=39==n?"ltr"==K4(e,e.state.selection.from)?1:-1:1;return $4(e,t,r)||z4(e,t)}return 38==n||I3&&80==n&&"c"==r?W4(e,-1,r)||z4(e,-1):40==n||I3&&78==n&&"c"==r?function(e){if(!T3||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;q4(e,n,"true"),setTimeout((()=>q4(e,n,"false")),20)}return!1}(e)||W4(e,1,r)||z4(e,1):r==(I3?"m":"c")&&(66==n||73==n||89==n||90==n)}function Y4(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:i,openEnd:s}=t;for(;i>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,s--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let o=e.someProp("clipboardSerializer")||t2.fromSchema(e.state.schema),a=o6(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c,d=l.firstChild,h=0;for(;d&&1==d.nodeType&&(c=i6[d.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),h++}d=l.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${i} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function Z4(e,t,n,r,i){let s,o,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=!!t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(n=>{t=n(t,a||r,e)})),a)return o=new o1(e1.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",(t=>{o=t(o,e,!0)})),o;let n=e.someProp("clipboardTextParser",(n=>n(t,i,r,e)));if(n)o=n;else{let n=i.marks(),{schema:r}=e.state,o=t2.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(o.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),s=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=o6().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&i6[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;a6||(a6=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e}));return a6.createHTML(e)}(e),n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),A3&&function(e){let t=e.querySelectorAll(k3?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let e=+d[3];e>0;e--){let e=s.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;s=e}if(!o){let t=e.someProp("clipboardParser")||e.someProp("domParser")||K1.fromSchema(e.state.schema);o=t.parseSlice(s,{preserveWhitespace:!(!l&&!d),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||J4.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(d)o=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:s,openEnd:o}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=e1.from(t.create(n[e+1],i)),s++,o++}return new o1(i,s,o)}(r6(o,+d[1],+d[2]),d[4]);else if(o=o1.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),s=[];if(e.forEach((e=>{if(!s)return;let t,n=i.findWrapping(e.type);if(!n)return s=null;if(t=s.length&&r.length&&e6(n,r,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=t6(s[s.length-1],r.length));let t=Q4(e,n);s.push(t),i=i.matchType(t.type),r=n}})),s)return e1.from(s)}return e}(o.content,i),!0),o.openStart||o.openEnd){let e=0,t=0;for(let t=o.content.firstChild;e<o.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=o.content.lastChild;t<o.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);o=r6(o,e,t)}return e.someProp("transformPasted",(t=>{o=t(o,e,l)})),o}const J4=/^(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 Q4(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,e1.from(e));return e}function e6(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let s=e6(e,t,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(e1.from(Q4(n,e,i+1))))}}function t6(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,t6(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(e1.empty,!0);return e.copy(n.append(r))}function n6(e,t,n,r,i,s){let o=t<0?e.firstChild:e.lastChild,a=o.content;return e.childCount>1&&(s=0),i<r-1&&(a=n6(a,t,n,r,i+1,s)),i>=n&&(a=t<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(e1.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(a))}function r6(e,t,n){return t<e.openStart&&(e=new o1(n6(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new o1(n6(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const i6={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let s6=null;function o6(){return s6||(s6=document.implementation.createHTMLDocument("title"))}let a6=null;const l6={},c6={},d6={touchstart:!0,touchmove:!0};class h6{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.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function u6(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function p6(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>f6(e,t))}))}function f6(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function m6(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||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function g6(e){return{left:e.clientX,top:e.clientY}}function y6(e,t,n,r,i){if(-1==r)return!1;let s=e.state.doc.resolve(r);for(let r=s.depth+1;r>0;r--)if(e.someProp(t,(t=>r>s.depth?t(e,n,s.nodeAfter,s.before(r),i,!0):t(e,n,s.node(r),s.before(r),i,!1))))return!0;return!1}function v6(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function b6(e,t,n,r,i){return y6(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof i5&&(n=i.node);let s=e.state.doc.resolve(t);for(let e=s.depth+1;e>0;e--){let t=e>s.depth?s.nodeAfter:s.node(e);if(i5.isSelectable(t)){r=n&&i.$from.depth>0&&e>=i.$from.depth&&s.before(i.$from.depth+1)==i.$from.pos?s.before(i.$from.depth):s.before(e);break}}return null!=r&&(v6(e,i5.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&i5.isSelectable(r))&&(v6(e,new i5(n),"pointer"),!0)}(e,n))}function w6(e,t,n,r){return y6(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function x6(e,t,n,r){return y6(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(v6(e,n5.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),s=i.before(t);if(n.inlineContent)v6(e,n5.create(r,s+1,s+1+n.content.size),"pointer");else{if(!i5.isSelectable(n))continue;v6(e,i5.create(r,s),"pointer")}return!0}}(e,n,r)}function E6(e){return I6(e)}c6.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!_6(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!R3||!k3||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!P3||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||X4(e,n)?n.preventDefault():u6(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,m3(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},c6.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},c6.keypress=(e,t)=>{let n=t;if(_6(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||I3&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof n5&&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()}};const C6=I3?"metaKey":"ctrlKey";l6.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=E6(e),i=Date.now(),s="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[C6]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?s="doubleClick":"doubleClick"==e.input.lastClick.type&&(s="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let o=e.posAtCoords(g6(n));o&&("singleClick"==s?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new S6(e,o,n,!!r)):("doubleClick"==s?w6:x6)(e,o.pos,o.inside,n)?n.preventDefault():u6(e,"pointer"))};class S6{constructor(e,t,n,r){let i,s;if(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[C6],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,s=n.depth?n.before():0}const o=r?null:n.target,a=o?e.docView.nearestDesc(o,!0):null;this.target=a&&1==a.dom.nodeType?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof i5&&l.from<=s&&l.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!S3||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)),u6(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((()=>O4(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(g6(e))),this.updateAllowDefault(e),this.allowDefault||!t?u6(this.view,"pointer"):b6(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||T3&&this.mightDrag&&!this.mightDrag.node.isAtom||k3&&!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)?(v6(this.view,J2.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):u6(this.view,"pointer")}move(e){this.updateAllowDefault(e),u6(this.view,"pointer"),0==e.buttons&&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)}}function _6(e,t){return!!e.composing||!!(T3&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}l6.touchstart=e=>{e.input.lastTouch=Date.now(),E6(e),u6(e,"pointer")},l6.touchmove=e=>{e.input.lastTouch=Date.now(),u6(e,"pointer")},l6.contextmenu=e=>E6(e);const k6=R3?5e3:-1;function O6(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>I6(e)),t))}function T6(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function P6(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=u3(e=e.childNodes[t-1])}else{if(!e.parentNode||p3(e))return null;t=s3(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||p3(e))return null;t=s3(e)+1,e=e.parentNode}}}(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 I6(e,t=!1){if(!(R3&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),T6(e),t||e.docView&&e.docView.dirty){let n=_4(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.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}c6.compositionstart=c6.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof n5&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),I6(e,!0),e.markCursor=null;else if(I6(e,!t.selection.empty),S3&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}O6(e,k6)},c6.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.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,O6(e,20))};const M6=E3&&C3<15||P3&&N3<604;function R6(e,t,n,r,i){let s=Z4(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,i,s||o1.empty))))return!0;if(!s)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(s),a=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(s);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function A6(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," "):""}l6.copy=c6.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let s=M6?null:n.clipboardData,o=r.content(),{dom:a,text:l}=Y4(e,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):function(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)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},c6.paste=(e,t)=>{let n=t;if(e.composing&&!R3)return;let r=M6?null:n.clipboardData,i=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&R6(e,A6(r),r.getData("text/html"),i,n)?n.preventDefault():function(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&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?R6(e,r.value,null,i,t):R6(e,r.textContent,r.innerHTML,i,t)}),50)}(e,n)};class N6{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const D6=I3?"altKey":"ctrlKey";function L6(e,t){let n=e.someProp("dragCopies",(e=>!e(t)));return null!=n?n:!t[D6]}l6.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i,s=e.state.selection,o=s.empty?null:e.posAtCoords(g6(n));if(o&&o.pos>=s.from&&o.pos<=(s instanceof i5?s.to-1:s.to));else if(r&&r.mightDrag)i=i5.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(i=i5.create(e.state.doc,t.posBefore))}let a=(i||e.state.selection).content(),{dom:l,text:c,slice:d}=Y4(e,a);(!n.dataTransfer.files.length||!k3||O3>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(M6?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",M6||n.dataTransfer.setData("text/plain",c),e.dragging=new N6(d,L6(e,n),i)},l6.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},c6.dragover=c6.dragenter=(e,t)=>t.preventDefault(),c6.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(g6(n));if(!i)return;let s=e.state.doc.resolve(i.pos),o=r&&r.slice;o?e.someProp("transformPasted",(t=>{o=t(o,e,!1)})):o=Z4(e,A6(n.dataTransfer),M6?null:n.dataTransfer.getData("text/html"),!1,s);let a=!(!r||!L6(e,n));if(e.someProp("handleDrop",(t=>t(e,n,o||o1.empty,a))))return void n.preventDefault();if(!o)return;n.preventDefault();let l=o?D2(e.state.doc,s.pos,o):s.pos;null==l&&(l=s.pos);let c=e.state.tr;if(a){let{node:e}=r;e?e.replace(c):c.deleteSelection()}let d=c.mapping.map(l),h=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,u=c.doc;if(h?c.replaceRangeWith(d,d,o.content.firstChild):c.replaceRange(d,d,o),c.doc.eq(u))return;let p=c.doc.resolve(d);if(h&&i5.isSelectable(o.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(o.content.firstChild))c.setSelection(new i5(p));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),c.setSelection(N4(e,p,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},l6.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())&&O4(e)}),20))},l6.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(),e.focused=!1)},l6.beforeinput=(e,t)=>{if(k3&&R3&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,m3(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 c6)l6[e]=c6[e];function F6(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}class j6{constructor(e,t){this.toDOM=e,this.spec=t||H6,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:s}=e.mapResult(t.from+r,this.side<0?-1:1);return s?null:new V6(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof j6&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&F6(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class $6{constructor(e,t){this.attrs=e,this.spec=t||H6}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,s=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new V6(i,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof $6&&F6(this.attrs,e.attrs)&&F6(this.spec,e.spec)}static is(e){return e.type instanceof $6}destroy(){}}class B6{constructor(e,t){this.attrs=e,this.spec=t||H6}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let s=e.mapResult(t.to+r,-1);return s.deleted||s.pos<=i.pos?null:new V6(i.pos-n,s.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof B6&&F6(this.attrs,e.attrs)&&F6(this.spec,e.spec)}destroy(){}}class V6{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new V6(e,t,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(e,t,n){return new V6(e,e,new j6(t,n))}static inline(e,t,n,r){return new V6(e,t,new $6(n,r))}static node(e,t,n,r){return new V6(e,t,new B6(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof $6}get widget(){return this.type instanceof j6}}const z6=[],H6={};class U6{constructor(e,t){this.local=e.length?e:z6,this.children=t.length?t:z6}static create(e,t){return t.length?Y6(t,e,0,H6):K6}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let s=0;s<this.local.length;s++){let o=this.local[s];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let o=this.children[s]+1;this.children[s+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==K6||0==e.maps.length?this:this.mapInner(e,t,0,0,n||H6)}mapInner(e,t,n,r,i){let s;for(let o=0;o<this.local.length;o++){let a=this.local[o].map(e,n,r);a&&a.type.valid(t,a)?(s||(s=[])).push(a):i.onRemove&&i.onRemove(this.local[o].spec)}return this.children.length?function(e,t,n,r,i,s,o){let a=e.slice();for(let e=0,t=s;e<n.maps.length;e++){let r=0;n.maps[e].forEach(((e,n,i,s)=>{let o=s-i-(n-e);for(let i=0;i<a.length;i+=3){let s=a[i+1];if(s<0||e>s+t-r)continue;let l=a[i]+t-r;n>=l?a[i+1]=e<=l?-2:-1:e>=t&&o&&(a[i]+=o,a[i+1]+=o)}r+=o})),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+s),d=c-i;if(d<0||d>=r.content.size){l=!0;continue}let h=n.map(e[t+1]+s,-1)-i,{index:u,offset:p}=r.content.findIndex(d),f=r.maybeChild(u);if(f&&p==d&&p+f.nodeSize==h){let r=a[t+2].mapInner(n,f,c+1,e[t]+s+1,o);r!=K6?(a[t]=d,a[t+1]=h,a[t+2]=r):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,r,i,s,o){function a(e,t){for(let s=0;s<e.local.length;s++){let a=e.local[s].map(r,i,t);a?n.push(a):o.onRemove&&o.onRemove(e.local[s].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+s+1);return n}(a,e,t,n,i,s,o),c=Y6(l,r,0,o);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new U6(t.sort(Z6),a)}(this.children,s||[],e,t,n,r,i):s?new U6(s.sort(Z6),z6):K6}add(e,t){return t.length?this==K6?U6.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,s)=>{let o,a=s+n;if(o=q6(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<s;)i+=3;r[i]==s?r[i+2]=r[i+2].addInner(e,o,a+1):r.splice(i,0,s,s+e.nodeSize,Y6(o,e,a+1,H6)),i+=3}}));let s=G6(i?X6(t):t,-n);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||s.splice(t--,1);return new U6(s.length?this.local.concat(s).sort(Z6):this.local,r||this.children)}remove(e){return 0==e.length||this==K6?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,s=n[r]+t,o=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>s&&t.to<o&&(e[n]=null,(i||(i=[])).push(t));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,s+1);a!=K6?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,i=0;i<e.length;i++)if(n=e[i])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new U6(r,n):K6}forChild(e,t){if(this==K6)return this;if(t.isLeaf)return U6.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,s=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<s&&t.to>i&&t.type instanceof $6){let e=Math.max(i,t.from)-i,n=Math.min(s,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new U6(r.sort(Z6),z6);return n?new W6([e,n]):e}return n||K6}eq(e){if(this==e)return!0;if(!(e instanceof U6)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return J6(this.localsInner(e))}localsInner(e){if(this==K6)return z6;if(e.inlineContent||!this.local.some($6.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof $6||t.push(this.local[e]);return t}forEachSet(e){e(this)}}U6.empty=new U6([],[]),U6.removeOverlap=J6;const K6=U6.empty;class W6{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,H6)));return W6.from(n)}forChild(e,t){if(t.isLeaf)return U6.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=K6&&(i instanceof W6?n=n.concat(i.members):n.push(i))}return W6.from(n)}eq(e){if(!(e instanceof W6)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))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){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?J6(n?t:t.sort(Z6)):z6}static from(e){switch(e.length){case 0:return K6;case 1:return e[0];default:return new W6(e.every((e=>e instanceof U6))?e:e.reduce(((e,t)=>e.concat(t instanceof U6?t:t.members)),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function G6(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 V6(i.from+t,i.to+t,i.type))}return n}function q6(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t,s=0;s<e.length;s++)(t=e[s])&&t.from>n&&t.to<r&&((i||(i=[])).push(t),e[s]=null);return i}function X6(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Y6(e,t,n,r){let i=[],s=!1;t.forEach(((t,o)=>{let a=q6(e,t,o+n);if(a){s=!0;let e=Y6(a,t,n+o+1,r);e!=K6&&i.push(o,o+t.nodeSize,e)}}));let o=G6(s?X6(e):e,-n).sort(Z6);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 U6(o,i):K6}function Z6(e,t){return e.from-t.from||e.to-t.to}function J6(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 s=t[i];if(s.from!=r.from){s.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,s.from),Q6(t,i,r.copy(s.from,r.to)));break}s.to!=r.to&&(t==e&&(t=e.slice()),t[i]=s.copy(s.from,r.to),Q6(t,i+1,s.copy(r.to,s.to)))}}return t}function Q6(e,t,n){for(;t<e.length&&Z6(n,e[t])>0;)t++;e.splice(t,0,n)}function e7(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=K6&&t.push(r)})),e.cursorWrapper&&t.push(U6.create(e.state.doc,[e.cursorWrapper.deco])),W6.from(t)}const t7={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},n7=E3&&C3<=11;class r7{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}}class i7{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new r7,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);E3&&C3<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),n7&&(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,t7)),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(D4(this.view)){if(this.suppressingSelectionUpdates)return O4(this.view);if(E3&&C3<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&c3(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,n=new Set;for(let t=e.focusNode;t;t=o3(t))n.add(t);for(let r=e.anchorNode;r;r=o3(r))if(n.has(r)){t=r;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 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)&&D4(e)&&!this.ignoreSelectionChange(n),i=-1,s=-1,o=!1,a=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],a);n&&(i=i<0?n.from:Math.min(n.from,i),s=s<0?n.to:Math.max(n.to,s),n.typeOver&&(o=!0))}if(S3&&a.length){let t=a.filter((e=>"BR"==e.nodeName));if(2==t.length){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||"LI"!=t.nodeName||n&&l7(e,n)==t||r.remove()}}}let l=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&f3(n)&&(l=_4(e))&&l.eq(J2.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,O4(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,s),function(e){if(s7.has(e))return;if(s7.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=S3,o7)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."),o7=!0}}(e)),this.handleDOMChange(i,s,o,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||O4(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("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(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(E3&&C3<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:s}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!s||Array.prototype.indexOf.call(e.addedNodes,s)<0)&&(i=s)}let s=r&&r.parentNode==e.target?s3(r)+1:0,o=n.localPosFromDOM(e.target,s,-1),a=i&&i.parentNode==e.target?s3(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let s7=new WeakMap,o7=!1;function a7(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,s=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return c3(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function l7(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 c7(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(T3&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||T3&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const d7=/^(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 h7(e,t,n,r,i){let s=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=_4(e,t);if(n&&!e.state.selection.eq(n)){if(k3&&R3&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(t=>t(e,m3(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),s&&r.setMeta("composition",s),e.dispatch(r)}return}let o=e.state.doc.resolve(t),a=o.sharedDepth(n);t=o.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l,c,d=e.state.selection,h=function(e,t,n){let r,{node:i,fromOffset:s,toOffset:o,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),d=c.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:c.anchorOffset}],f3(c)||r.push({node:c.focusNode,offset:c.focusOffset})),k3&&8===e.input.lastKeyCode)for(let e=o;e>s;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){o=e;break}if(!n||n.size)break}let h=e.state.doc,u=e.someProp("domParser")||K1.fromSchema(e.state.schema),p=h.resolve(a),f=null,m=u.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:s,to:o,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:c7,context:p});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n),u=e.state.doc,p=u.slice(h.from,h.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(l=e.state.selection.to,c="end"):(l=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let f=function(e,t,n,r,i){let s=e.findDiffStart(t,n);if(null==s)return null;let{a:o,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){r-=o+Math.max(0,s-Math.min(o,a))-s}if(o<s&&e.size<t.size){let e=r<=s&&r>=o?s-r:0;s-=e,s&&s<t.size&&f7(t.textBetween(s-1,s+1))&&(s+=e?1:-1),a=s+(a-o),o=s}else if(a<s){let t=r<=s&&r>=a?s-r:0;s-=t,s&&s<e.size&&f7(e.textBetween(s-1,s+1))&&(s+=t?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}(p.content,h.doc.content,h.from,l,c);if(f&&e.input.domChangeCount++,(P3&&e.input.lastIOSEnter>Date.now()-225||R3)&&i.some((e=>1==e.nodeType&&!d7.test(e.nodeName)))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",(t=>t(e,m3(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&d instanceof n5&&!d.empty&&d.$head.sameParent(d.$anchor))||e.composing||h.sel&&h.sel.anchor!=h.sel.head){if(h.sel){let t=u7(e,e.state.doc,h.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);s&&n.setMeta("composition",s),e.dispatch(n)}}return}f={start:d.from,endA:d.to,endB:d.to}}e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof n5&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=h.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=h.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),E3&&C3<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>h.from&&" "==h.doc.textBetween(f.start-h.from-1,f.start-h.from+1)&&(f.start--,f.endA--,f.endB--);let m,g=h.doc.resolveNoCache(f.start-h.from),y=h.doc.resolveNoCache(f.endB-h.from),v=u.resolve(f.start),b=g.sameParent(y)&&g.parent.inlineContent&&v.end()>=f.endA;if((P3&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&g.pos<h.doc.content.size&&(!g.sameParent(y)||!g.parent.inlineContent)&&!/\S/.test(h.doc.textBetween(g.pos,y.pos,"",""))&&(m=J2.findFrom(h.doc.resolve(g.pos+1),1,!0))&&m.head>g.pos)&&e.someProp("handleKeyDown",(t=>t(e,m3(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||p7(r,!0,!1)<i.pos)return!1;let s=e.resolve(t);if(!r.parent.isTextblock){let e=s.nodeAfter;return null!=e&&n==t+e.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=e.resolve(p7(s,!0,!0));return!(!o.parent.isTextblock||o.pos>n||p7(o,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(o.parent.content)}(u,f.start,f.endA,g,y)&&e.someProp("handleKeyDown",(t=>t(e,m3(8,"Backspace")))))return void(R3&&k3&&e.domObserver.suppressSelectionUpdates());k3&&f.endB==f.start&&(e.input.lastChromeDelete=Date.now()),R3&&!b&&g.start()!=y.start()&&0==y.parentOffset&&g.depth==y.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==f.endA&&(f.endB-=2,y=h.doc.resolveNoCache(f.endB-h.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,m3(13,"Enter"))}))}),20));let w,x=f.start,E=f.endA,C=t=>{let n=t||e.state.tr.replace(x,E,h.doc.slice(f.start-h.from,f.endB-h.from));if(h.sel){let t=u7(e,n.doc,h.sel);t&&!(k3&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==x||t.head==n.mapping.map(E)-1)||E3&&t.empty&&t.head==x)&&n.setSelection(t)}return s&&n.setMeta("composition",s),n.scrollIntoView()};if(b){if(g.pos==y.pos){E3&&C3<=11&&0==g.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>O4(e)),20));let t=C(e.state.tr.delete(x,E)),n=u.resolve(f.start).marksAcross(u.resolve(f.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(f.endA==f.endB&&(w=function(e,t){let n,r,i,s=e.firstChild.marks,o=t.firstChild.marks,a=s,l=o;for(let e=0;e<o.length;e++)a=o[e].removeFromSet(a);for(let e=0;e<s.length;e++)l=s[e].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(i(t.child(e)));if(e1.from(c).eq(e))return{mark:r,type:n}}(g.parent.content.cut(g.parentOffset,y.parentOffset),v.parent.content.cut(v.parentOffset,f.endA-v.start())))){let t=C(e.state.tr);"add"==w.type?t.addMark(x,E,w.mark):t.removeMark(x,E,w.mark),e.dispatch(t)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let t=g.parent.textBetween(g.parentOffset,y.parentOffset),n=()=>C(e.state.tr.insertText(t,x,E));e.someProp("handleTextInput",(r=>r(e,x,E,t,n)))||e.dispatch(n())}}else e.dispatch(C())}function u7(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:N4(e,t.resolve(n.anchor),t.resolve(n.head))}function p7(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 f7(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class m7{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 h6,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(w7),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=v7(this),y7(this),this.nodeViews=b7(this),this.docView=c4(this.state.doc,g7(this),e7(this),this.dom,this),this.domObserver=new i7(this,((e,t,n,r)=>h7(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in l6){let n=l6[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!m6(e,t)||f6(e,t)||!e.editable&&t.type in c6||n(e,t)},d6[t]?{passive:!0}:void 0)}T3&&e.dom.addEventListener("input",(()=>null)),p6(e)}(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&&p6(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(w7),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){var n;let r=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(T6(this),s=!0),this.state=e;let o=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(o||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=b7(this);(function(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})(e,this.nodeViews)&&(this.nodeViews=e,i=!0)}(o||t.handleDOMEvents!=this._props.handleDOMEvents)&&p6(this),this.editable=v7(this),y7(this);let a=e7(this),l=g7(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=i||!this.docView.matchesNode(e.doc,l,a);!d&&e.selection.eq(r.selection)||(s=!0);let h="preserve"==c&&s&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let s=(r.left+r.right)/2,o=i+1;o<Math.min(innerHeight,r.bottom);o+=5){let r=e.root.elementFromPoint(s,o);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:$3(e.dom)}}(this);if(s){this.domObserver.stop();let t=d&&(E3||k3)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(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)}(r.selection,e.selection);if(d){let n=k3?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=P6(this)),!i&&this.docView.update(e.doc,l,a,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=c4(e.doc,l,a,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return c3(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?O4(this,t):(R4(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():h&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;B3(n,0==r?0:r-t)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof i5){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&j3(this,t.getBoundingClientRect(),e)}else j3(this,this.coordsAtPos(this.state.selection.head,1),e);else;}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)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{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))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(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&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new N6(e.slice,e.move,r<0?void 0:i5.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let i=this.directPlugins[r].props[e];if(null!=i&&(n=t?t(i):i))return n}let i=this.state.plugins;if(i)for(let r=0;r<i.length;r++){let s=i[r].props[e];if(null!=s&&(n=t?t(s):s))return n}}hasFocus(){if(E3){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("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(V3)return e.focus(V3);let t=$3(e);e.focus(null==V3?{get preventScroll(){return V3={preventScroll:!0},!0}}:void 0),V3||(V3=!1,B3(t,0))}(this.dom),O4(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&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 K3(this,e)}coordsAtPos(e,t=1){return X3(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(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return r4(this,t||this.state,e)}pasteHTML(e,t){return R6(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return R6(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Y4(this,e)}destroy(){this.docView&&(!function(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)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],e7(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,a3=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){f6(e,t)||!l6[t.type]||!e.editable&&t.type in c6||l6[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?T3&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return a7(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?a7(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function g7(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),t.translate||(t.translate="no"),[V6.node(0,e.state.doc.content.size,t)]}function y7(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:V6.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function v7(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function b7(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 w7(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}m7.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var x7={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:"'"},E7={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},C7="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),S7="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),_7=0;_7<10;_7++)x7[48+_7]=x7[96+_7]=String(_7);for(_7=1;_7<=24;_7++)x7[_7+111]="F"+_7;for(_7=65;_7<=90;_7++)x7[_7]=String.fromCharCode(_7+32),E7[_7]=String.fromCharCode(_7);for(var k7 in x7)E7.hasOwnProperty(k7)||(E7[k7]=x7[k7]);const O7="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),T7="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function P7(e){let t,n,r,i,s=e.split(/-(?!$)/),o=s[s.length-1];"Space"==o&&(o=" ");for(let e=0;e<s.length-1;e++){let o=s[e];if(/^(cmd|meta|m)$/i.test(o))i=!0;else if(/^a(lt)?$/i.test(o))t=!0;else if(/^(c|ctrl|control)$/i.test(o))n=!0;else if(/^s(hift)?$/i.test(o))r=!0;else{if(!/^mod$/i.test(o))throw new Error("Unrecognized modifier name: "+o);O7?i=!0:n=!0}}return t&&(o="Alt-"+o),n&&(o="Ctrl-"+o),i&&(o="Meta-"+o),r&&(o="Shift-"+o),o}function I7(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 M7(e){return new y5({props:{handleKeyDown:R7(e)}})}function R7(e){let t=function(e){let t=Object.create(null);for(let n in e)t[P7(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(C7&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||S7&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?E7:x7)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),s=t[I7(i,n)];if(s&&s(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[I7(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(T7&&n.ctrlKey&&n.altKey)&&(r=x7[n.keyCode])&&r!=i){let i=t[I7(r,n)];if(i&&i(e.state,e.dispatch,e))return!0}}return!1}}var A7=Object.defineProperty,N7=(e,t)=>{for(var n in t)A7(e,n,{get:t[n],enumerable:!0})};function D7(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=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 s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var L7=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(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(s);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],a=!!e,l=e||i.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return o.push(i),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(l),o.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...s,dispatch:void 0})]))),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:e,editor:r,view:s,state:D7({state:i,transaction:e}),dispatch:t?()=>{}: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}},F7={};N7(F7,{blur:()=>j7,clearContent:()=>$7,clearNodes:()=>B7,command:()=>V7,createParagraphNear:()=>z7,cut:()=>H7,deleteCurrentNode:()=>U7,deleteNode:()=>W7,deleteRange:()=>G7,deleteSelection:()=>q7,enter:()=>X7,exitCode:()=>Y7,extendMarkRange:()=>r8,first:()=>i8,focus:()=>d8,forEach:()=>h8,insertContent:()=>u8,insertContentAt:()=>g8,joinBackward:()=>b8,joinDown:()=>v8,joinForward:()=>w8,joinItemBackward:()=>x8,joinItemForward:()=>E8,joinTextblockBackward:()=>C8,joinTextblockForward:()=>S8,joinUp:()=>y8,keyboardShortcut:()=>k8,lift:()=>T8,liftEmptyBlock:()=>P8,liftListItem:()=>I8,newlineInCode:()=>M8,resetAttributes:()=>N8,scrollIntoView:()=>D8,selectAll:()=>L8,selectNodeBackward:()=>F8,selectNodeForward:()=>j8,selectParentNode:()=>$8,selectTextblockEnd:()=>B8,selectTextblockStart:()=>V8,setContent:()=>H8,setMark:()=>b9,setMeta:()=>w9,setNode:()=>x9,setNodeSelection:()=>E9,setTextSelection:()=>C9,sinkListItem:()=>S9,splitBlock:()=>k9,splitListItem:()=>O9,toggleList:()=>I9,toggleMark:()=>M9,toggleNode:()=>R9,toggleWrap:()=>A9,undoInputRule:()=>N9,unsetAllMarks:()=>D9,unsetMark:()=>L9,updateAttributes:()=>F9,wrapIn:()=>j9,wrapInList:()=>$9});var j7=()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())})),!0),$7=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),B7=()=>({state:e,tr:t,dispatch:n})=>{const{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;const{doc:r,mapping:i}=t,s=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),a=s.blockRange(o);if(!a)return;const l=k2(a);if(e.type.isTextblock){const{defaultType:e}=s.parent.contentMatchAt(s.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},V7=e=>t=>e(t),z7=()=>({state:e,dispatch:t})=>B5(e,t),H7=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const o=r.mapping.map(t);return r.insert(o,s.content),r.setSelection(new n5(r.doc.resolve(Math.max(o-1,0)))),!0},U7=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1){if(i.node(n).type===r.type){if(t){const t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}}return!1};function K7(e,t){if("string"==typeof e){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 W7=e=>({tr:t,state:n,dispatch:r})=>{const i=K7(e,n.schema),s=t.selection.$anchor;for(let e=s.depth;e>0;e-=1){if(s.node(e).type===i){if(r){const n=s.before(e),r=s.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},G7=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},q7=()=>({state:e,dispatch:t})=>x5(e,t),X7=()=>({commands:e})=>e.keyboardShortcut("Enter"),Y7=()=>({state:e,dispatch:t})=>$5(e,t);function Z7(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function J7(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Z7(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Q7(e,t,n={}){return e.find((e=>e.type===t&&J7(Object.fromEntries(Object.keys(n).map((t=>[t,e.attrs[t]]))),n)))}function e8(e,t,n={}){return!!Q7(e,t,n)}function t8(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some((e=>e.type===t))||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some((e=>e.type===t)))return;n=n||(null==(r=i.node.marks[0])?void 0:r.attrs);if(!Q7([...i.node.marks],t,n))return;let s=i.index,o=e.start()+i.offset,a=s+1,l=o+i.node.nodeSize;for(;s>0&&e8([...e.parent.child(s-1).marks],t,n);)s-=1,o-=e.parent.child(s).nodeSize;for(;a<e.parent.childCount&&e8([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function n8(e,t){if("string"==typeof e){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 r8=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const s=n8(e,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){const e=t8(l,s,t);if(e&&e.from<=c&&e.to>=d){const t=n5.create(o,e.from,e.to);n.setSelection(t)}}return!0},i8=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function s8(e){return e instanceof n5}function o8(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function a8(e,t=null){if(!t)return null;const n=J2.atStart(e),r=J2.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,s=r.to;return"all"===t?n5.create(e,o8(0,i,s),o8(e.content.size,i,s)):n5.create(e,o8(t,i,s),o8(t,i,s))}function l8(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function c8(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var d8=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const o=()=>{(c8()||l8())&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(s&&null===e&&!s8(n.state.selection))return o(),!0;const a=a8(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},h8=(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),u8=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),p8=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&p8(r)}return e};function f8(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return p8(n)}function m8(e,t,n){if(e instanceof S1||e instanceof e1)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return e1.fromArray(e.map((e=>t.nodeFromJSON(e))));const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),m8("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,i="";const s=new H1({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="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?K1.fromSchema(s).parseSlice(f8(e),n.parseOptions):K1.fromSchema(s).parse(f8(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${i}`)})}const r=K1.fromSchema(t);return n.slice?r.parseSlice(f8(e),n.parseOptions).content:r.parse(f8(e),n.parseOptions)}return m8("",t,n)}var g8=(e,t,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){let i;const a=e=>{s.emit("contentError",{editor:s,error:e,disableCollaboration:()=>{"collaboration"in s.storage&&"object"==typeof s.storage.collaboration&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},l={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{m8(t,s.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(e){a(e)}try{i=m8(t,s.schema,{parseOptions:l,errorOnInvalidContent:null!=(o=n.errorOnInvalidContent)?o:s.options.enableContentCheck})}catch(e){return a(e),!1}let{from:c,to:d}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},h=!0,u=!0;if(("type"in i?[i]:i).forEach((e=>{e.check(),h=!!h&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),c===d&&u){const{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(c-=1,d+=1)}let p;if(h){if(Array.isArray(t))p=t.map((e=>e.text||"")).join("");else if(t instanceof e1){let e="";t.forEach((t=>{t.text&&(e+=t.text)})),p=e}else p="object"==typeof t&&t&&t.text?t.text:t;r.insertText(p,c,d)}else{p=i;const e=r.doc.resolve(c),t=e.node(),n=0===e.parentOffset,s=t.isText||t.isTextblock,o=t.content.size>0;n&&s&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,d,p)}n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof x2||i instanceof E2))return;const s=e.mapping.maps[r];let o=0;s.forEach(((e,t,n,r)=>{0===o&&(o=r)})),e.setSelection(J2.near(e.doc.resolve(o),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},y8=()=>({state:e,dispatch:t})=>N5(e,t),v8=()=>({state:e,dispatch:t})=>D5(e,t),b8=()=>({state:e,dispatch:t})=>C5(e,t),w8=()=>({state:e,dispatch:t})=>M5(e,t),x8=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},E8=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},C8=()=>({state:e,dispatch:t})=>S5(e,t),S8=()=>({state:e,dispatch:t})=>_5(e,t);function _8(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var k8=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const s=function(e){const t=e.split(/-(?!$)/);let n,r,i,s,o=t[t.length-1];"Space"===o&&(o=" ");for(let e=0;e<t.length-1;e+=1){const o=t[e];if(/^(cmd|meta|m)$/i.test(o))s=!0;else if(/^a(lt)?$/i.test(o))n=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))i=!0;else{if(!/^mod$/i.test(o))throw new Error(`Unrecognized modifier name: ${o}`);c8()||_8()?s=!0:r=!0}}return n&&(o=`Alt-${o}`),r&&(o=`Ctrl-${o}`),s&&(o=`Meta-${o}`),i&&(o=`Shift-${o}`),o}(e).split(/-(?!$)/),o=s.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===o?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0};function O8(e,t,n={}){const{from:r,to:i,empty:s}=e.selection,o=t?K7(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:s})}));const l=i-r,c=a.filter((e=>!o||o.name===e.node.type.name)).filter((e=>J7(e.node.attrs,n,{strict:!1})));if(s)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}var T8=(e,t={})=>({state:n,dispatch:r})=>!!O8(n,K7(e,n.schema),t)&&L5(n,r),P8=()=>({state:e,dispatch:t})=>V5(e,t),I8=e=>({state:t,dispatch:n})=>r3(K7(e,t.schema))(t,n),M8=()=>({state:e,dispatch:t})=>F5(e,t);function R8(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function A8(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}var N8=(e,t)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=R8("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(s=K7(e,r.schema)),"mark"===a&&(o=n8(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{s&&s===e.type&&n.setNodeMarkup(r,void 0,A8(e.attrs,t)),o&&e.marks.length&&e.marks.forEach((i=>{o===i.type&&n.addMark(r,r+e.nodeSize,o.create(A8(i.attrs,t)))}))}))})),!0)},D8=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),L8=()=>({tr:e,dispatch:t})=>{if(t){const t=new o5(e.doc);e.setSelection(t)}return!0},F8=()=>({state:e,dispatch:t})=>T5(e,t),j8=()=>({state:e,dispatch:t})=>R5(e,t),$8=()=>({state:e,dispatch:t})=>U5(e,t),B8=()=>({state:e,dispatch:t})=>q5(e,t),V8=()=>({state:e,dispatch:t})=>G5(e,t);function z8(e,t,n={},r={}){return m8(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var H8=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if("full"!==r.preserveWhitespace){const a=z8(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function U8(e,t){const n=n8(t,e.schema),{from:r,to:i,empty:s}=e.selection,o=[];s?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{o.push(...e.marks)}));const a=o.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function K8(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function W8(e,t,n){if(void 0===e.config[t]&&e.parent)return W8(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?W8(e.parent,t,n):null})}return e.config[t]}function G8(e){return e.map((e=>{const t=W8(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...G8(t())]:e})).flat(10)}function q8(e,t){const n=t2.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function X8(e){return"function"==typeof e}function Y8(e,t=void 0,...n){return X8(e)?t?e.bind(t)(...n):e(...n):e}function Z8(e){const t=e.filter((e=>"extension"===e.type)),n=e.filter((e=>"node"===e.type)),r=e.filter((e=>"mark"===e.type));return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function J8(e){const t=[],{nodeExtensions:n,markExtensions:r}=Z8(e),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=W8(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:i});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...s,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=W8(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...s,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&void 0===(null==i?void 0:i.default)&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function Q8(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],s=r.filter((e=>!i.includes(e)));n[e]=[...i,...s].join(" ")}else if("style"===e){const r=t?t.split(";").map((e=>e.trim())).filter(Boolean):[],i=n[e]?n[e].split(";").map((e=>e.trim())).filter(Boolean):[],s=new Map;i.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),r.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),n[e]=Array.from(s.entries()).map((([e,t])=>`${e}: ${t}`)).join("; ")}else n[e]=t;else n[e]=t})),n}),{})}function e9(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)=>Q8(e,t)),{})}function t9(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function n9(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function r9(e){var t,n,r;const i={};return(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)||void 0===(null==(n=null==e?void 0:e.attribute)?void 0:n.default)||(i.default=e.attribute.default),void 0!==(null==(r=null==e?void 0:e.attribute)?void 0:r.validate)&&(i.validate=e.attribute.validate),[e.name,i]}function i9(e,t){var n;const r=J8(e),{nodeExtensions:i,markExtensions:s}=Z8(e),o=null==(n=i.find((e=>W8(e,"topNode"))))?void 0:n.name,a=Object.fromEntries(i.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=W8(t,"extendNodeSchema",s);return{...e,...r?r(n):{}}}),{}),a=n9({...o,content:Y8(W8(n,"content",s)),marks:Y8(W8(n,"marks",s)),group:Y8(W8(n,"group",s)),inline:Y8(W8(n,"inline",s)),atom:Y8(W8(n,"atom",s)),selectable:Y8(W8(n,"selectable",s)),draggable:Y8(W8(n,"draggable",s)),code:Y8(W8(n,"code",s)),whitespace:Y8(W8(n,"whitespace",s)),linebreakReplacement:Y8(W8(n,"linebreakReplacement",s)),defining:Y8(W8(n,"defining",s)),isolating:Y8(W8(n,"isolating",s)),attrs:Object.fromEntries(i.map(r9))}),l=Y8(W8(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>t9(e,i))));const c=W8(n,"renderHTML",s);c&&(a.toDOM=e=>c({node:e,HTMLAttributes:e9(e,i)}));const d=W8(n,"renderText",s);return d&&(a.toText=d),[n.name,a]}))),l=Object.fromEntries(s.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=W8(t,"extendMarkSchema",s);return{...e,...r?r(n):{}}}),{}),a=n9({...o,inclusive:Y8(W8(n,"inclusive",s)),excludes:Y8(W8(n,"excludes",s)),group:Y8(W8(n,"group",s)),spanning:Y8(W8(n,"spanning",s)),code:Y8(W8(n,"code",s)),attrs:Object.fromEntries(i.map(r9))}),l=Y8(W8(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>t9(e,i))));const c=W8(n,"renderHTML",s);return c&&(a.toDOM=e=>c({mark:e,HTMLAttributes:e9(e,i)})),[n.name,a]})));return new H1({topNode:o,nodes:a,marks:l})}function s9(e){return e.sort(((e,t)=>{const n=W8(e,"priority")||100,r=W8(t,"priority")||100;return n>r?-1:n<r?1:0}))}function o9(e){const t=s9(G8(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return Array.from(new Set(t))}(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 a9(e,t,n){const{from:r,to:i}=t,{blockSeparator:s="\n\n",textSerializers:o={}}=n||{};let a="";return e.nodesBetween(r,i,((e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=s);const h=null==o?void 0:o[e.type.name];if(h)return l&&(a+=h({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,i-n))})),a}function l9(e,t){return a9(e,{from:0,to:e.content.size},t)}function c9(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}function d9(e,t){const n=R8("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=K7(t,e.schema),{from:r,to:i}=e.selection,s=[];e.doc.nodesBetween(r,i,(e=>{s.push(e)}));const o=s.reverse().find((e=>e.type.name===n.name));return o?{...o.attrs}:{}}(e,t):"mark"===n?U8(e,t):{}}function h9(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.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 u9(e,t){return t.nodes[e]||t.marks[e]||null}function p9(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}var f9=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,i,s)=>{var o,a;const l=(null==(a=(o=e.type.spec).toText)?void 0:a.call(o,{node:e,pos:t,parent:i,index:s}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))})),n};function m9(e,t,n={}){const{empty:r,ranges:i}=e.selection,s=t?n8(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!s||s.name===e.type.name)).find((e=>J7(e.attrs,n,{strict:!1})));let o=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);o+=s-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:s}))))}))})),0===o)return!1;const l=a.filter((e=>!s||s.name===e.mark.type.name)).filter((e=>J7(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!s||e.mark.type!==s&&e.mark.type.excludes(s))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=o}function g9(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function y9(e,t){const{nodeExtensions:n}=Z8(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=Y8(W8(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function v9(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach((e=>{!1!==r&&(v9(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))})),r}return!1}var b9=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=n8(e,r.schema);if(i)if(o){const e=U8(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,s=e.$to.pos;r.doc.nodesBetween(i,s,((e,r)=>{const o=Math.max(r,i),a=Math.min(r+e.nodeSize,s),c=e.marks.find((e=>e.type===l));c?e.marks.forEach((e=>{l===e.type&&n.addMark(o,a,l.create({...e.attrs,...t}))})):n.addMark(o,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:i}=t;let s=null;if(s8(i)&&(s=i.$cursor),s){const t=null!=(r=e.storedMarks)?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some((e=>e.type.excludes(n))))}const{ranges:o}=i;return o.some((({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(i)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),s=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));i=t&&s}return!i})),i}))}(r,n,l)},w9=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),x9=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const s=K7(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command((({commands:e})=>!!Y5(s,{...o,...t})(n)||e.clearNodes())).command((({state:e})=>Y5(s,{...o,...t})(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},E9=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=o8(e,0,n.content.size),i=i5.create(n,r);t.setSelection(i)}return!0},C9=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,s=n5.atStart(n).from,o=n5.atEnd(n).to,a=o8(r,s,o),l=o8(i,s,o),c=n5.create(n,a,l);t.setSelection(c)}return!0},S9=e=>({state:t,dispatch:n})=>i3(K7(e,t.schema))(t,n);function _9(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}var k9=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=t,{$from:a,$to:l}=s,c=p9(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(s instanceof i5&&s.node.isBlock)return!(!a.parentOffset||!M2(o,a.pos))&&(r&&(e&&_9(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=d&&h?[{type:h,attrs:c}]:void 0,p=M2(t.doc,t.mapping.map(a.pos),1,u);if(u||p||!M2(t.doc,t.mapping.map(a.pos),1,h?[{type:h}]:void 0)||(p=!0,u=h?[{type:h,attrs:c}]:void 0),r){if(p&&(s instanceof n5&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,u),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(a.before()),h)}e&&_9(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},O9=(e,t={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=K7(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const h=l.node(-1);if(h.type!==a)return!1;const u=s.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let e=e1.empty;const r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=e1.from(l.node(t).copy(e));const i=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,s={...p9(u,l.node().type.name,l.node().attrs),...t},c=(null==(o=a.contentMatch.defaultType)?void 0:o.createAndFill(s))||void 0;e=e.append(e1.from(a.createAndFill(null,c)||void 0));const d=l.before(l.depth-(r-1));n.replace(d,l.after(-i),new o1(e,4-r,0));let h=-1;n.doc.nodesBetween(d,n.doc.content.size,((e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)})),h>-1&&n.setSelection(n5.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...p9(u,h.type.name,h.attrs),...t},m={...p9(u,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!M2(n.doc,l.pos,2))return!1;if(i){const{selection:e,storedMarks:t}=r,{splittableMarks:o}=s.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!i)return!0;const c=a.filter((e=>o.includes(e.type.name)));n.ensureMarks(c)}return!0},T9=(e,t)=>{const n=K8((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,n.pos)||(e.join(n.pos),!0)},P9=(e,t)=>{const n=K8((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,r)||(e.join(r),!0)},I9=(e,t,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:h,splittableMarks:u}=i.extensionManager,p=K7(e,o.schema),f=K7(t,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:v}=m,b=y.blockRange(v),w=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const x=K8((e=>y9(e.type.name,h)))(m);if(b.depth>=1&&x&&b.depth-x.depth<=1){if(x.node.type===p)return c.liftListItem(f);if(y9(x.node.type.name,h)&&p.validContent(x.node.content)&&a)return l().command((()=>(s.setNodeMarkup(x.pos,p),!0))).command((()=>T9(s,p))).command((()=>P9(s,p))).run()}return n&&w&&a?l().command((()=>{const e=d().wrapInList(p,r),t=w.filter((e=>u.includes(e.type.name)));return s.ensureMarks(t),!!e||c.clearNodes()})).wrapInList(p,r).command((()=>T9(s,p))).command((()=>P9(s,p))).run():l().command((()=>!!d().wrapInList(p,r)||c.clearNodes())).wrapInList(p,r).command((()=>T9(s,p))).command((()=>P9(s,p))).run()},M9=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=n8(e,r.schema);return m9(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,t)},R9=(e,t,n={})=>({state:r,commands:i})=>{const s=K7(e,r.schema),o=K7(t,r.schema),a=O8(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},A9=(e,t={})=>({state:n,commands:r})=>{const i=K7(e,n.schema);return O8(n,i,t)?r.lift(i):r.wrapIn(i,t)},N9=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){const t=e.tr,n=s.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(s.text){const n=t.doc.resolve(s.from).marks();t.replaceWith(s.from,s.to,e.schema.text(s.text,n))}else t.delete(s.from,s.to)}return!0}}return!1},D9=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},L9=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=t,{selection:a}=n,l=n8(e,r.schema),{$from:c,empty:d,ranges:h}=a;if(!i)return!0;if(d&&o){let{from:e,to:t}=a;const r=null==(s=c.marks().find((e=>e.type===l)))?void 0:s.attrs,i=t8(c,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else h.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},F9=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=R8("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(s=K7(e,r.schema)),"mark"===a&&(o=n8(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;let l,c,d,h;n.selection.empty?r.doc.nodesBetween(i,a,((e,t)=>{s&&s===e.type&&(d=Math.max(t,i),h=Math.min(t+e.nodeSize,a),l=t,c=e)})):r.doc.nodesBetween(i,a,((e,r)=>{r<i&&s&&s===e.type&&(d=Math.max(r,i),h=Math.min(r+e.nodeSize,a),l=r,c=e),r>=i&&r<=a&&(s&&s===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),o&&e.marks.length&&e.marks.forEach((s=>{if(o===s.type){const l=Math.max(r,i),c=Math.min(r+e.nodeSize,a);n.addMark(l,c,o.create({...s.attrs,...t}))}})))})),c&&(void 0!==l&&n.setNodeMarkup(l,void 0,{...c.attrs,...t}),o&&c.marks.length&&c.marks.forEach((e=>{o===e.type&&n.addMark(d,h,o.create({...e.attrs,...t}))})))})),!0)},j9=(e,t={})=>({state:n,dispatch:r})=>X5(K7(e,n.schema),t)(n,r),$9=(e,t={})=>({state:n,dispatch:r})=>n3(K7(e,n.schema),t)(n,r),B9=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},V9=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}},z9=(e,t)=>{if(Z7(t))return t.exec(e);const n=t(e);if(!n)return null;const 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 H9(e){var t;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let d=!1;const h=f9(c)+s;return o.forEach((e=>{if(d)return;const t=z9(h,e.find);if(!t)return;const o=l.state.tr,c=D7({state:l.state,transaction:o}),u={from:r-(t[0].length-s.length),to:i},{commands:p,chain:f,can:m}=new L7({editor:n,state:c});null!==e.handler({state:c,range:u,match:t,commands:p,chain:f,can:m})&&o.steps.length&&(e.undoable&&o.setMeta(a,{transform:o,from:r,to:i,text:s}),l.dispatch(o),d=!0)})),d}function U9(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function K9(e,t){const n={...e};return U9(e)&&U9(t)&&Object.keys(t).forEach((r=>{U9(t[r])&&U9(e[r])?n[r]=K9(e[r],t[r]):n[r]=t[r]})),n}var W9=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{...Y8(W8(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Y8(W8(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>K9(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const 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}},G9=class e extends W9{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const i=r.marks();if(!!!i.find((e=>(null==e?void 0:e.type.name)===t.name)))return!1;const s=i.find((e=>(null==e?void 0:e.type.name)===t.name));return s&&n.removeStoredMark(s),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};var q9=(e,t,n)=>{if(Z7(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map((t=>{const 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})):[]};var X9=null;function Y9(e){const{editor:t,rules:n}=e;let r,i=null,s=!1,o=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:e,from:n,to:i,rule:s,pasteEvt:o})=>{const l=e.tr,c=D7({state:e,transaction:l}),d=function(e){const{editor:t,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=e,{commands:l,chain:c,can:d}=new L7({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,((e,t)=>{var u,p,f,m,g;if((null==(p=null==(u=e.type)?void 0:u.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;const y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,v=Math.max(r,t),b=Math.min(i,t+y);if(v>=b)return;const w=e.isText?e.text||"":e.textBetween(v-t,b-t,void 0,"");q9(w,s.find,o).forEach((e=>{if(void 0===e.index)return;const t=v+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},u=s.handler({state:n,range:i,match:e,commands:l,chain:c,can:d,pasteEvent:o,dropEvent:a});h.push(u)}))})),h.every((e=>null!==e))}({editor:t,state:c,from:Math.max(n-1,0),to:i.b-1,rule:s,pasteEvent:o,dropEvent:r});if(d&&l.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}},c=n.map((e=>new y5({view(e){const n=n=>{var r;i=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,i&&(X9=t)},r=()=>{X9&&(X9=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(o=i===e.dom.parentElement,r=t,!o){const e=X9;(null==e?void 0:e.isEditable)&&setTimeout((()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})}),10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,s=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const i=t[0],c="paste"===i.getMeta("uiEvent")&&!s,d="drop"===i.getMeta("uiEvent")&&!o,h=i.getMeta("applyPasteRules"),u=!!h;if(!c&&!d&&!u)return;if(u){let{text:t}=h;"string"==typeof t||(t=q8(e1.from(t),r.schema));const{from:n}=h,i=n+t.length,s=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return l({rule:e,state:r,from:n,to:{b:i},pasteEvt:s})}const p=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof p&&f&&p!==f.b?l({rule:e,state:r,from:p,to:f,pasteEvt:a}):void 0}})));return c}var Z9=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=o9(e),this.schema=i9(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce(((e,t)=>{const n=W8(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:u9(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=s9([...this.extensions].reverse()).flatMap((t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:u9(t.name,this.schema)},r=[],i=W8(t,"addKeyboardShortcuts",n);let s={};if("mark"===t.type&&W8(t,"exitable",n)&&(s.ArrowRight=()=>G9.handleExit({editor:e,mark:t})),i){const t=Object.fromEntries(Object.entries(i()).map((([t,n])=>[t,()=>n({editor:e})])));s={...s,...t}}const o=M7(s);r.push(o);const a=W8(t,"addInputRules",n);if(g9(t,e.options.enableInputRules)&&a){const t=a();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new y5({state:{init:()=>null,apply(e,i,s){const o=e.getMeta(r);if(o)return o;const a=e.getMeta("applyInputRules");return!!a&&setTimeout((()=>{let{text:e}=a;"string"==typeof e||(e=q8(e1.from(e),s.schema));const{from:i}=a,o=i+e.length;H9({editor:t,from:i,to:o,text:e,rules:n,plugin:r})})),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,s,o)=>H9({editor:t,from:i,to:s,text:o,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&H9({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:s}=e.state.selection;return!!s&&H9({editor:t,from:s.pos,to:s.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}const l=W8(t,"addPasteRules",n);if(g9(t,e.options.enablePasteRules)&&l){const t=l();if(t&&t.length){const n=Y9({editor:e,rules:t});r.push(...n)}}const c=W8(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r}));return t}get attributes(){return J8(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Z8(this.extensions);return Object.fromEntries(t.filter((e=>!!W8(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:K7(t.name,this.schema)},i=W8(t,"addNodeView",r);if(!i)return[];const s=i();if(!s)return[];return[t.name,(r,i,o,a,l)=>{const c=e9(r,n);return s({node:r,view:i,getPos:o,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:c})}]})))}get markViews(){const{editor:e}=this,{markExtensions:t}=Z8(this.extensions);return Object.fromEntries(t.filter((e=>!!W8(e,"addMarkView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:n8(t.name,this.schema)},i=W8(t,"addMarkView",r);if(!i)return[];return[t.name,(r,s,o)=>{const a=e9(r,n);return i()({mark:r,view:s,inline:o,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{xee(r,e,t)}})}]})))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map((e=>[e.name,e.storage]))),e.forEach((e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:u9(e.name,this.schema)};if("mark"===e.type){(null==(t=Y8(W8(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name)}const r=W8(e,"onBeforeCreate",n),i=W8(e,"onCreate",n),s=W8(e,"onUpdate",n),o=W8(e,"onSelectionUpdate",n),a=W8(e,"onTransaction",n),l=W8(e,"onFocus",n),c=W8(e,"onBlur",n),d=W8(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),s&&this.editor.on("update",s),o&&this.editor.on("selectionUpdate",o),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)}))}};Z9.resolve=o9,Z9.sort=s9,Z9.flatten=G8;N7({},{ClipboardTextSerializer:()=>Q9,Commands:()=>eee,Delete:()=>tee,Drop:()=>nee,Editable:()=>ree,FocusEvents:()=>see,Keymap:()=>oee,Paste:()=>aee,Tabindex:()=>lee,focusEventsPluginKey:()=>iee});var J9=class e extends W9{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},Q9=J9.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new y5({key:new w5("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:s}=i,o=Math.min(...s.map((e=>e.$from.pos))),a=Math.max(...s.map((e=>e.$to.pos))),l=c9(n);return a9(r,{from:o,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),eee=J9.create({name:"commands",addCommands:()=>({...F7})}),tee=J9.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const s=()=>{var n,r,i,s;if(null!=(s=null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?s:e.getMeta("y-sync$"))return;const o=function(e,t){const n=new Y2(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(e.before,[e,...t]),a=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,i)=>{const s=[];if(e.ranges.length)e.forEach(((e,t)=>{s.push({from:e,to:t})}));else{const{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;s.push({from:e,to:t})}s.forEach((({from:e,to:n})=>{const s=t.slice(i).map(e,-1),o=t.slice(i).map(n),a=t.invert().map(s,-1),l=t.invert().map(o);r.push({oldRange:{from:a,to:l},newRange:{from:s,to:o}})}))})),h9(r)}(o);a.forEach((t=>{o.mapping.mapResult(t.oldRange.from).deletedAfter&&o.mapping.mapResult(t.oldRange.to).deletedBefore&&o.before.nodesBetween(t.oldRange.from,t.oldRange.to,((n,r)=>{const i=r+n.nodeSize-2,s=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:o.mapping.map(r),newTo:o.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!s,editor:this.editor,transaction:e,combinedTransform:o})}))}));const l=o.mapping;o.steps.forEach(((t,n)=>{var r,i;if(t instanceof v2){const s=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),c=l.invert().map(s,-1),d=l.invert().map(a),h=null==(r=o.doc.nodeAt(s-1))?void 0:r.marks.some((e=>e.eq(t.mark))),u=null==(i=o.doc.nodeAt(a))?void 0:i.marks.some((e=>e.eq(t.mark)));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:s,to:a},partial:Boolean(u||h),editor:this.editor,transaction:e,combinedTransform:o})}}))};null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||i?setTimeout(s,0):s()}}),nee=J9.create({name:"drop",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),ree=J9.create({name:"editable",addProseMirrorPlugins(){return[new y5({key:new w5("editable"),props:{editable:()=>this.editor.options.editable}})]}}),iee=new w5("focusEvents"),see=J9.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new y5({key:iee,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),oee=J9.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:s}=n,{pos:o,parent:a}=s,l=s.parent.isTextblock&&o>0?t.doc.resolve(o-1):s,c=l.parent.type.spec.isolating,d=s.pos-s.parentOffset,h=c&&1===l.parent.childCount?d===s.pos:J2.atStart(r).from===o;return!(!i||!a.type.isTextblock||a.textContent.length||!h||h&&"paragraph"===s.parent.type.name)&&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 c8()||_8()?i:r},addProseMirrorPlugins(){return[new y5({key:new w5("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some((e=>e.getMeta("composition"))))return;const r=e.some((e=>e.docChanged))&&!t.doc.eq(n.doc),i=e.some((e=>e.getMeta("preventClearDocument")));if(!r||i)return;const{empty:s,from:o,to:a}=t.selection,l=J2.atStart(t.doc).from,c=J2.atEnd(t.doc).to;if(s||!(o===l&&a===c))return;if(!v9(n.doc))return;const d=n.tr,h=D7({state:n,transaction:d}),{commands:u}=new L7({editor:this.editor,state:h});return u.clearNodes(),d.steps.length?d:void 0}})]}}),aee=J9.create({name:"paste",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),lee=J9.create({name:"tabindex",addProseMirrorPlugins(){return[new y5({key:new w5("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),cee=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(){var e;return null!=(e=this.actualDepth)?e: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(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);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(0===this.depth)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,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(){const t=[];return this.node.content.forEach(((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=this.pos+r+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(o);if(!i&&a.depth<=this.depth)return;const l=new e(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),t.push(new e(a,this.editor,i,i?n:null))})),t}get firstChild(){return this.children[0]||null}get lastChild(){const 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){const e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){const 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||0===this.children.length)return r;const i=Object.keys(t);return this.children.forEach((s=>{if(!(n&&r.length>0)){if(s.node.type.name===e){const e=i.every((e=>t[e]===s.node.attrs[e]));e&&r.push(s)}n&&r.length>0||(r=r.concat(s.querySelectorAll(e,t,n)))}})),r}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}};var dee=class extends B9{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:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!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},this.isCapturingTransaction=!1,this.capturedTransaction=null,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);const t=this.createDoc(),n=a8(t,this.options.autofocus);this.editorState=m5.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("undefined"==typeof document)throw new 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||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)}),0)}unmount(){if(this.editorView){const e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?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&&"undefined"!=typeof document&&(this.css=function(e,t,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(null!==r)return r;const 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}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}',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("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw new 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){const n=X8(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;const t=this.state.plugins;let n=t;if([].concat(e).forEach((e=>{const t="string"==typeof e?`${e}$`:e.key;n=n.filter((e=>!e.key.startsWith(t)))})),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const n=[...this.options.enableCoreExtensions?[ree,Q9.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),eee,see,oee,lee,nee,aee,tee].filter((e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name])):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new Z9(n,this)}createCommandManager(){this.commandManager=new L7({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=z8(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&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter((e=>"collaboration"!==e.name)),this.createExtensionManager()}}),e=z8(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){var t;this.editorView=new m7(e,{...this.options.editorProps,attributes:{role:"textbox",...null==(t=this.options.editorProps)?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.prependClass(),this.injectCSS();this.view.dom.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;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)})):void(this.capturedTransaction=e);const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),s=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});const o=n.findLast((e=>e.getMeta("focus")||e.getMeta("blur"))),a=null==o?void 0:o.getMeta("focus"),l=null==o?void 0:o.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),e.getMeta("preventUpdate")||!n.some((e=>e.docChanged))||s.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return d9(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return O8(e,null,n)||m9(e,null,n);const r=R8(t,e.schema);return"node"===r?O8(e,t,n):"mark"===r&&m9(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return q8(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return l9(this.state.doc,{blockSeparator:t,textSerializers:{...c9(this.schema),...n}})}get isEmpty(){return v9(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new cee(t,this)}get $doc(){return this.$pos(0)}};var hee=class{constructor(e){var t,n,r,i,s;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;const t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;const t=e.touches[0];if(!t)return;const n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;const e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=e=>{"Shift"===e.key&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{"Shift"===e.key&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,(null==(t=e.options)?void 0:t.min)&&(this.minSize={...this.minSize,...e.options.min}),(null==(n=e.options)?void 0:n.max)&&(this.maxSize=e.options.max),(null==(r=null==e?void 0:e.options)?void 0:r.directions)&&(this.directions=e.options.directions),(null==(i=e.options)?void 0:i.preserveAspectRatio)&&(this.preserveAspectRatio=e.options.preserveAspectRatio),(null==(s=e.options)?void 0:s.className)&&(this.classNames={container:e.options.className.container||"",wrapper:e.options.className.wrapper||"",handle:e.options.className.handle||"",resizing:e.options.className.resizing||""}),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles()}get dom(){return this.container}get contentDOM(){return this.contentElement}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.container.remove()}createContainer(){const e=document.createElement("div");return e.dataset.resizeContainer="",e.dataset.node=this.node.type.name,e.style.display="flex",e.style.justifyContent="flex-start",e.style.alignItems="flex-start",this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){const e=document.createElement("div");return e.style.position="relative",e.style.display="block",e.dataset.resizeWrapper="",this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){const t=document.createElement("div");return t.dataset.resizeHandle=e,t.style.position="absolute",this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){const n=t.includes("top"),r=t.includes("bottom"),i=t.includes("left"),s=t.includes("right");n&&(e.style.top="0"),r&&(e.style.bottom="0"),i&&(e.style.left="0"),s&&(e.style.right="0"),"top"!==t&&"bottom"!==t||(e.style.left="0",e.style.right="0"),"left"!==t&&"right"!==t||(e.style.top="0",e.style.bottom="0")}attachHandles(){this.directions.forEach((e=>{const t=this.createHandle(e);this.positionHandle(t,e),t.addEventListener("mousedown",(t=>this.handleResizeStart(t,e))),t.addEventListener("touchstart",(t=>this.handleResizeStart(t,e))),this.wrapper.appendChild(t)}))}applyInitialSize(){const e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,(e=>"touches"in e)(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight);this.getPos();this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),s=this.applyConstraints(r,i,n);this.element.style.width=`${s.width}px`,this.element.style.height=`${s.height}px`,this.onResize&&this.onResize(s.width,s.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight;const s=e.includes("right"),o=e.includes("left"),a=e.includes("bottom"),l=e.includes("top");s?r=this.startWidth+t:o&&(r=this.startWidth-t),a?i=this.startHeight+n:l&&(i=this.startHeight-n),"right"!==e&&"left"!==e||(r=this.startWidth+(s?t:-t)),"top"!==e&&"bottom"!==e||(i=this.startHeight+(a?n:-n));return this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){var r,i,s,o;if(!n){let n=Math.max(this.minSize.width,e),s=Math.max(this.minSize.height,t);return(null==(r=this.maxSize)?void 0:r.width)&&(n=Math.min(this.maxSize.width,n)),(null==(i=this.maxSize)?void 0:i.height)&&(s=Math.min(this.maxSize.height,s)),{width:n,height:s}}let a=e,l=t;return a<this.minSize.width&&(a=this.minSize.width,l=a/this.aspectRatio),l<this.minSize.height&&(l=this.minSize.height,a=l*this.aspectRatio),(null==(s=this.maxSize)?void 0:s.width)&&a>this.maxSize.width&&(a=this.maxSize.width,l=a/this.aspectRatio),(null==(o=this.maxSize)?void 0:o.height)&&l>this.maxSize.height&&(l=this.maxSize.height,a=l*this.aspectRatio),{width:a,height:l}}applyAspectRatio(e,t,n){const r="top"===n||"bottom"===n;return"left"===n||"right"===n?{width:e,height:e/this.aspectRatio}:r?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function uee(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,(e=>(n.push(e),`__QUOTED_${n.length-1}__`))),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const e=i.map((e=>e.trim().slice(1)));t.class=e.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(t.id=s[1]);Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach((([,e,r])=>{var i;const s=parseInt((null==(i=r.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10),o=n[s];o&&(t[e]=o.slice(1,-1))}));const 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();if(o){o.split(/\s+/).filter(Boolean).forEach((e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}))}return t}function pee(e){if(!e||0===Object.keys(e).length)return"";const t=[];if(e.class){String(e.class).split(/\s+/).filter(Boolean).forEach((e=>t.push(`.${e}`)))}return e.id&&t.push(`#${e.id}`),Object.entries(e).forEach((([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))})),t.join(" ")}function fee(e){const{nodeName:t,name:n,parseAttributes:r=uee,serializeAttributes:i=pee,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=e,l=n||t;return{parseMarkdown:(e,n)=>{const r={...s,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,i){const s=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(s);if(!a)return;const c=a[1]||"",d=r(c),h=o.find((e=>!(e in d)));return h?void 0:{type:t,raw:a[0],attributes:d}}},renderMarkdown:e=>{const t=(e=>{if(!a)return e;const t={};return a.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),n=i(t);return`:::${l}${n?` {${n}}`:""} :::`}}}function mee(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=uee,serializeAttributes:s=pee,defaultAttributes:o={},content:a="block",allowedAttributes:l}=e,c=n||t;return{parseMarkdown:(e,n)=>{let i;if(r){const t=r(e);i="string"==typeof t?[{type:"text",text:t}]:t}else i="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const s={...o,...e.attributes};return n.createNode(t,s,i)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var s;const o=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(o);if(!l)return;const[d,h=""]=l,u=i(h);let p=1;const f=d.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(y);if(null===n)break;const i=n.index,o=n[1];if(!(null==(s=n[2])?void 0:s.endsWith(":::")))if(o)p+=1;else if(p-=1,0===p){const s=y.slice(0,i);m=s.trim();const o=e.slice(0,f+i+n[0].length);let l=[];if(m)if("block"===a)for(l=r.blockTokens(s),l.forEach((e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))}));l.length>0;){const e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(m);return{type:t,raw:o,attributes:u,content:m,tokens:l}}}}},renderMarkdown:(e,t)=>{const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),r=s(n),i=r?` {${r}}`:"",o=t.renderChildren(e.content||[],"\n\n");return`:::${c}${i}\n\n${o}\n\n:::`}}}function gee(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,i,s,o]=r;t[i]=s||o,r=n.exec(e)}return t}function yee(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}="${t}"`)).join(" ")}function vee(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=gee,serializeAttributes:s=yee,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const i={...o,...e.attributes};if(a)return n.createNode(t,i);const s=r?r(e):e.content||"";return s?n.createNode(t,i,[n.createTextNode(s)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const s=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(s);if(!o)return;let l="",c="";if(a){const[,e]=o;c=e}else{const[,e,t]=o;c=e,l=t||""}const h=i(c.trim());return{type:t,raw:o[0],content:l.trim(),attributes:h}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter((e=>"text"===e.type)).map((e=>e.text)).join(""));const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),i=s(n),o=i?` ${i}`:"";return a?`[${c}${o}]`:`[${c}${o}]${t}[/${c}]`}}}function bee(e,t,n){var r,i,s,o;const a=e.split("\n"),l=[];let c="",d=0;const h=t.baseIndentSize||2;for(;d<a.length;){const e=a[d],u=e.match(t.itemPattern);if(!u){if(l.length>0)break;if(""===e.trim()){d+=1;continue}return}const p=t.extractItemData(u),{indentLevel:f,mainContent:m}=p;c=`${c}${e}\n`;const g=[m];for(d+=1;d<a.length;){const e=a[d];if(""===e.trim()){const t=a.slice(d+1).findIndex((e=>""!==e.trim()));if(-1===t)break;if(((null==(i=null==(r=a[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>f){g.push(e),c=`${c}${e}\n`,d+=1;continue}break}if(!(((null==(o=null==(s=e.match(/^(\s*)/))?void 0:s[1])?void 0:o.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,d+=1}let y;const v=g.slice(1);if(v.length>0){const e=v.map((e=>e.slice(f+h))).join("\n");e.trim()&&(y=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const b=t.createToken(p,y);l.push(b)}if(0!==l.length)return{items:l,raw:c.trim()}}function wee(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i="function"==typeof n?n(r):n,[s,...o]=e.content,a=[`${i}${t.renderChildren([s])}`];return o&&o.length>0&&o.forEach((e=>{const n=t.renderChildren([e]);if(n){const e=n.split("\n").map((e=>e?t.indent(e):"")).join("\n");a.push(e)}})),a.join("\n")}function xee(e,t,n={}){const{state:r}=t,{doc:i,tr:s}=r,o=e;i.descendants(((t,r)=>{const i=s.mapping.map(r),a=s.mapping.map(r)+t.nodeSize;let l=null;if(t.marks.forEach((e=>{if(e!==o)return!1;l=e})),!l)return;let c=!1;if(Object.keys(n).forEach((e=>{n[e]!==l.attrs[e]&&(c=!0)})),c){const t=e.type.create({...e.attrs,...n});s.removeMark(i,a,e.type),s.addMark(i,a,t)}})),s.docChanged&&t.view.dispatch(s)}N7({},{createAtomBlockMarkdownSpec:()=>fee,createBlockMarkdownSpec:()=>mee,createInlineMarkdownSpec:()=>vee,parseAttributes:()=>uee,parseIndentedBlocks:()=>bee,renderNestedMarkdownContent:()=>wee,serializeAttributes:()=>pee});var Eee=class e extends W9{constructor(){super(...arguments),this.type="node"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},Cee=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,n,r,i,s,o,a;const{view:l}=this.editor,c=e.target,d=3===c.nodeType?null==(t=c.parentElement)?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null==(n=this.contentDOM)?void 0:n.contains(c))||!d)return;let h=0,u=0;if(this.dom!==d){const t=this.dom.getBoundingClientRect(),n=d.getBoundingClientRect(),a=null!=(i=e.offsetX)?i:null==(r=e.nativeEvent)?void 0:r.offsetX,l=null!=(o=e.offsetY)?o:null==(s=e.nativeEvent)?void 0:s.offsetY;h=n.x-t.x+a,u=n.y-t.y+l}const p=this.dom.cloneNode(!0);try{const e=this.dom.getBoundingClientRect();p.style.width=`${Math.round(e.width)}px`,p.style.height=`${Math.round(e.height)}px`,p.style.boxSizing="border-box",p.style.pointerEvents="none"}catch{}let f=null;try{f=document.createElement("div"),f.style.position="absolute",f.style.top="-9999px",f.style.left="-9999px",f.style.pointerEvents="none",f.appendChild(p),document.body.appendChild(f),null==(a=e.dataTransfer)||a.setDragImage(p,h,u)}finally{f&&setTimeout((()=>{try{null==f||f.remove()}catch{}}),0)}const m=this.getPos();if("number"!=typeof m)return;const g=i5.create(l.state.doc,m),y=l.state.tr.setSelection(g);l.dispatch(y)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null==(t=this.contentDOM)?void 0:t.contains(n))))return!1;const r=e.type.startsWith("drag"),i="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!i&&!r)return!0;const{isEditable:s}=this.editor,{isDragging:o}=this,a=!!this.node.type.spec.draggable,l=i5.isSelectable(this.node),c="copy"===e.type,d="paste"===e.type,h="cut"===e.type,u="mousedown"===e.type;if(!a&&l&&r&&e.target===this.dom&&e.preventDefault(),a&&r&&!o&&e.target===this.dom)return e.preventDefault(),!1;if(a&&s&&!o&&u){const e=n.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!(o||i||c||d||h||u&&l)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&(c8()||l8())&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:t})=>{const n=this.getPos();return"number"==typeof n&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)}))}deleteNode(){const e=this.getPos();if("number"!=typeof e)return;const t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};var See=__webpack_require__("NrPD"),_ee=__webpack_require__("pt2U"),kee=__webpack_require__("NuT+"),Oee=(...e)=>t=>{e.forEach((e=>{"function"==typeof e?e(t):e&&(e.current=t)}))},Tee=({contentComponent:e})=>{const t=(0,See.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,RK.jsx)(RK.Fragment,{children:Object.values(t)})};var Pee=class extends d.Component{constructor(e){var t;super(e),this.editorContentRef=d.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:Boolean(null==(t=e.editor)?void 0:t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(e.view.dom),e.setOptions({element:t}),e.contentComponent=function(){const e=new Set;let t={};return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>t,getServerSnapshot:()=>t,setRenderer(n,r){t={...t,[n]:Ge.createPortal(r.reactElement,r.element,n)},e.forEach((e=>e()))},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach((e=>e()))}}}(),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(){var e;const t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.firstChild))return;const n=document.createElement("div");n.append(t.view.dom),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return(0,RK.jsxs)(RK.Fragment,{children:[(0,RK.jsx)("div",{ref:Oee(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,RK.jsx)(Tee,{contentComponent:e.contentComponent})]})}},Iee=(0,d.forwardRef)(((e,t)=>{const n=d.useMemo((()=>Math.floor(4294967295*Math.random()).toString()),[e.editor]);return d.createElement(Pee,{key:n,innerRef:t,...e})})),Mee=d.memo(Iee),Ree="undefined"!=typeof window?d.useLayoutEffect:d.useEffect,Aee=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.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){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach((e=>e()))},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function Nee(e){var t;const[n]=(0,d.useState)((()=>new Aee(e.editor))),r=(0,kee.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:_ee);return Ree((()=>n.watch(e.editor)),[e.editor,n]),(0,d.useDebugValue)(r),r}var Dee="undefined"==typeof window,Lee=Dee||Boolean("undefined"!=typeof window&&window.next),Fee=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(){return void 0===this.options.current.immediatelyRender?Dee||Lee?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}};return new dee(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)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every(((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])})):e[n]===t[n])))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?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(null===this.previousDeps)return void(this.previousDeps=e);const t=this.previousDeps.length===e.length&&this.previousDeps.every(((t,n)=>t===e[n]));if(t)return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout((()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}),1)}};function jee(e={},t=[]){const n=(0,d.useRef)(e);n.current=e;const[r]=(0,d.useState)((()=>new Fee(n))),i=(0,See.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,d.useDebugValue)(i),(0,d.useEffect)(r.onRender(t)),Nee({editor:i,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),i}var $ee=(0,d.createContext)({editor:null});$ee.Consumer;var Bee=(0,d.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Vee=()=>(0,d.useContext)(Bee);function zee({as:e="div",...t}){const{nodeViewContentRef:n,nodeViewContentChildren:r}=Vee();return(0,RK.jsx)(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style},children:r})}var Hee=d.forwardRef(((e,t)=>{const{onDragStart:n}=Vee(),r=e.as||"div";return(0,RK.jsx)(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})}));function Uee(e){return!("function"!=typeof e||!e.prototype||!e.prototype.isReactComponent)}function Kee(e){return!("object"!=typeof e||!e.$$typeof||"Symbol(react.forward_ref)"!==e.$$typeof.toString()&&"react.forward_ref"!==e.$$typeof.description)}var Wee=class{constructor(e,{editor:t,props:n={},as:r="div",className:i=""}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).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,Ge.flushSync)((()=>{this.render()})):queueMicrotask((()=>{this.render()}))}render(){var e;const t=this.component,n=this.props,r=this.editor,i=function(){try{if(d.version)return parseInt(d.version.split(".")[0],10)>=19}catch{}return!1}(),s=function(e){if(Uee(e))return!0;if(Kee(e))return!0;if(function(e){return!("object"!=typeof e||!e.$$typeof||"Symbol(react.memo)"!==e.$$typeof.toString()&&"react.memo"!==e.$$typeof.description)}(e)){const t=e.type;if(t)return Uee(t)||Kee(t)}return!1}(t),o={...n};!o.ref||i||s||delete o.ref,o.ref||!i&&!s||(o.ref=e=>{this.ref=e}),this.reactElement=(0,RK.jsx)(t,{...o}),null==(e=null==r?void 0:r.contentComponent)||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const t=this.editor;null==(e=null==t?void 0:t.contentComponent)||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])}))}};d.createContext({markViewContentRef:()=>{}});var Gee=class extends Cee{constructor(e,t,n){if(super(e,t,n),!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";const e=this.dom.querySelector("[data-node-view-content]");if(!e)return;e.appendChild(this.contentDOMElement)}}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,d.createRef)()};if(!this.component.displayName){const e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}const 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,d.memo)((e=>(0,RK.jsx)(Bee.Provider,{value:t,children:(0,d.createElement)(n,e)})));r.displayName="ReactNodeView";let i=this.node.isInline?"span":"div";this.options.as&&(i=this.options.as);const{className:s=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new Wee(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${s}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null==(e=this.renderer.element.firstElementChild)?void 0:e.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(){const{from:e,to:t}=this.editor.state.selection,n=this.getPos();if("number"==typeof n)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){const r=e=>{this.renderer.updateProps(e),"function"==typeof this.options.attrs&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){const i=this.node,s=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.options.update({oldNode:i,oldDecorations:s,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n})})}return e===this.node&&this.decorations===t&&this.innerDecorations===n||(this.node=e,this.decorations=t,this.innerDecorations=n,r({node:e,decorations:t,innerDecorations:n})),!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}updateElementAttributes(){if(this.options.attrs){let e={};if("function"==typeof this.options.attrs){const t=this.editor.extensionManager.attributes,n=e9(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function qee(e,t){return n=>n.editor.contentComponent?new Gee(e,n,t):{}}var Xee=Object.defineProperty,Yee=(e,t)=>{for(var n in t)Xee(e,n,{get:t[n],enumerable:!0})};function Zee(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=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 s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var Jee=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(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(s);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],a=!!e,l=e||i.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return o.push(i),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(l),o.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...s,dispatch:void 0})]))),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:e,editor:r,view:s,state:Zee({state:i,transaction:e}),dispatch:t?()=>{}: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}},Qee={};Yee(Qee,{blur:()=>ete,clearContent:()=>tte,clearNodes:()=>nte,command:()=>rte,createParagraphNear:()=>ite,cut:()=>ste,deleteCurrentNode:()=>ote,deleteNode:()=>lte,deleteRange:()=>cte,deleteSelection:()=>dte,enter:()=>hte,exitCode:()=>ute,extendMarkRange:()=>bte,first:()=>wte,focus:()=>kte,forEach:()=>Ote,insertContent:()=>Tte,insertContentAt:()=>Rte,joinBackward:()=>Dte,joinDown:()=>Nte,joinForward:()=>Lte,joinItemBackward:()=>Fte,joinItemForward:()=>jte,joinTextblockBackward:()=>$te,joinTextblockForward:()=>Bte,joinUp:()=>Ate,keyboardShortcut:()=>zte,lift:()=>Ute,liftEmptyBlock:()=>Kte,liftListItem:()=>Wte,newlineInCode:()=>Gte,resetAttributes:()=>Yte,scrollIntoView:()=>Zte,selectAll:()=>Jte,selectNodeBackward:()=>Qte,selectNodeForward:()=>ene,selectParentNode:()=>tne,selectTextblockEnd:()=>nne,selectTextblockStart:()=>rne,setContent:()=>sne,setMark:()=>Rne,setMeta:()=>Ane,setNode:()=>Nne,setNodeSelection:()=>Dne,setTextSelection:()=>Lne,sinkListItem:()=>Fne,splitBlock:()=>$ne,splitListItem:()=>Bne,toggleList:()=>Hne,toggleMark:()=>Une,toggleNode:()=>Kne,toggleWrap:()=>Wne,undoInputRule:()=>Gne,unsetAllMarks:()=>qne,unsetMark:()=>Xne,updateAttributes:()=>Yne,wrapIn:()=>Zne,wrapInList:()=>Jne});var ete=()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())})),!0),tte=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),nte=()=>({state:e,tr:t,dispatch:n})=>{const{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;const{doc:r,mapping:i}=t,s=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),a=s.blockRange(o);if(!a)return;const l=k2(a);if(e.type.isTextblock){const{defaultType:e}=s.parent.contentMatchAt(s.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},rte=e=>t=>e(t),ite=()=>({state:e,dispatch:t})=>B5(e,t),ste=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const o=r.mapping.map(t);return r.insert(o,s.content),r.setSelection(new n5(r.doc.resolve(Math.max(o-1,0)))),!0},ote=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1){if(i.node(n).type===r.type){if(t){const t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}}return!1};function ate(e,t){if("string"==typeof e){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 lte=e=>({tr:t,state:n,dispatch:r})=>{const i=ate(e,n.schema),s=t.selection.$anchor;for(let e=s.depth;e>0;e-=1){if(s.node(e).type===i){if(r){const n=s.before(e),r=s.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},cte=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},dte=()=>({state:e,dispatch:t})=>x5(e,t),hte=()=>({commands:e})=>e.keyboardShortcut("Enter"),ute=()=>({state:e,dispatch:t})=>$5(e,t);function pte(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function fte(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:pte(t[r])?t[r].test(e[r]):t[r]===e[r]))}function mte(e,t,n={}){return e.find((e=>e.type===t&&fte(Object.fromEntries(Object.keys(n).map((t=>[t,e.attrs[t]]))),n)))}function gte(e,t,n={}){return!!mte(e,t,n)}function yte(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some((e=>e.type===t))||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some((e=>e.type===t)))return;n=n||(null==(r=i.node.marks[0])?void 0:r.attrs);if(!mte([...i.node.marks],t,n))return;let s=i.index,o=e.start()+i.offset,a=s+1,l=o+i.node.nodeSize;for(;s>0&>e([...e.parent.child(s-1).marks],t,n);)s-=1,o-=e.parent.child(s).nodeSize;for(;a<e.parent.childCount&>e([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function vte(e,t){if("string"==typeof e){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 bte=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const s=vte(e,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){const e=yte(l,s,t);if(e&&e.from<=c&&e.to>=d){const t=n5.create(o,e.from,e.to);n.setSelection(t)}}return!0},wte=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function xte(e){return e instanceof n5}function Ete(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Cte(e,t=null){if(!t)return null;const n=J2.atStart(e),r=J2.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,s=r.to;return"all"===t?n5.create(e,Ete(0,i,s),Ete(e.content.size,i,s)):n5.create(e,Ete(t,i,s),Ete(t,i,s))}function Ste(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function _te(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var kte=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const o=()=>{(_te()||Ste())&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(s&&null===e&&!xte(n.state.selection))return o(),!0;const a=Cte(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Ote=(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),Tte=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Pte=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&Pte(r)}return e};function Ite(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return Pte(n)}function Mte(e,t,n){if(e instanceof S1||e instanceof e1)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return e1.fromArray(e.map((e=>t.nodeFromJSON(e))));const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Mte("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,i="";const s=new H1({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="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?K1.fromSchema(s).parseSlice(Ite(e),n.parseOptions):K1.fromSchema(s).parse(Ite(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${i}`)})}const r=K1.fromSchema(t);return n.slice?r.parseSlice(Ite(e),n.parseOptions).content:r.parse(Ite(e),n.parseOptions)}return Mte("",t,n)}var Rte=(e,t,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){let i;const a=e=>{s.emit("contentError",{editor:s,error:e,disableCollaboration:()=>{"collaboration"in s.storage&&"object"==typeof s.storage.collaboration&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},l={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Mte(t,s.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(e){a(e)}try{i=Mte(t,s.schema,{parseOptions:l,errorOnInvalidContent:null!=(o=n.errorOnInvalidContent)?o:s.options.enableContentCheck})}catch(e){return a(e),!1}let{from:c,to:d}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},h=!0,u=!0;if(("type"in i?[i]:i).forEach((e=>{e.check(),h=!!h&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),c===d&&u){const{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(c-=1,d+=1)}let p;if(h){if(Array.isArray(t))p=t.map((e=>e.text||"")).join("");else if(t instanceof e1){let e="";t.forEach((t=>{t.text&&(e+=t.text)})),p=e}else p="object"==typeof t&&t&&t.text?t.text:t;r.insertText(p,c,d)}else{p=i;const e=r.doc.resolve(c),t=e.node(),n=0===e.parentOffset,s=t.isText||t.isTextblock,o=t.content.size>0;n&&s&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,d,p)}n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof x2||i instanceof E2))return;const s=e.mapping.maps[r];let o=0;s.forEach(((e,t,n,r)=>{0===o&&(o=r)})),e.setSelection(J2.near(e.doc.resolve(o),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},Ate=()=>({state:e,dispatch:t})=>N5(e,t),Nte=()=>({state:e,dispatch:t})=>D5(e,t),Dte=()=>({state:e,dispatch:t})=>C5(e,t),Lte=()=>({state:e,dispatch:t})=>M5(e,t),Fte=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},jte=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},$te=()=>({state:e,dispatch:t})=>S5(e,t),Bte=()=>({state:e,dispatch:t})=>_5(e,t);function Vte(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var zte=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const s=function(e){const t=e.split(/-(?!$)/);let n,r,i,s,o=t[t.length-1];"Space"===o&&(o=" ");for(let e=0;e<t.length-1;e+=1){const o=t[e];if(/^(cmd|meta|m)$/i.test(o))s=!0;else if(/^a(lt)?$/i.test(o))n=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))i=!0;else{if(!/^mod$/i.test(o))throw new Error(`Unrecognized modifier name: ${o}`);_te()||Vte()?s=!0:r=!0}}return n&&(o=`Alt-${o}`),r&&(o=`Ctrl-${o}`),s&&(o=`Meta-${o}`),i&&(o=`Shift-${o}`),o}(e).split(/-(?!$)/),o=s.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===o?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0};function Hte(e,t,n={}){const{from:r,to:i,empty:s}=e.selection,o=t?ate(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:s})}));const l=i-r,c=a.filter((e=>!o||o.name===e.node.type.name)).filter((e=>fte(e.node.attrs,n,{strict:!1})));if(s)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}var Ute=(e,t={})=>({state:n,dispatch:r})=>!!Hte(n,ate(e,n.schema),t)&&L5(n,r),Kte=()=>({state:e,dispatch:t})=>V5(e,t),Wte=e=>({state:t,dispatch:n})=>r3(ate(e,t.schema))(t,n),Gte=()=>({state:e,dispatch:t})=>F5(e,t);function qte(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Xte(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}var Yte=(e,t)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=qte("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(s=ate(e,r.schema)),"mark"===a&&(o=vte(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{s&&s===e.type&&n.setNodeMarkup(r,void 0,Xte(e.attrs,t)),o&&e.marks.length&&e.marks.forEach((i=>{o===i.type&&n.addMark(r,r+e.nodeSize,o.create(Xte(i.attrs,t)))}))}))})),!0)},Zte=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Jte=()=>({tr:e,dispatch:t})=>{if(t){const t=new o5(e.doc);e.setSelection(t)}return!0},Qte=()=>({state:e,dispatch:t})=>T5(e,t),ene=()=>({state:e,dispatch:t})=>R5(e,t),tne=()=>({state:e,dispatch:t})=>U5(e,t),nne=()=>({state:e,dispatch:t})=>q5(e,t),rne=()=>({state:e,dispatch:t})=>G5(e,t);function ine(e,t,n={},r={}){return Mte(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var sne=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if("full"!==r.preserveWhitespace){const a=ine(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function one(e,t){const n=vte(t,e.schema),{from:r,to:i,empty:s}=e.selection,o=[];s?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{o.push(...e.marks)}));const a=o.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function ane(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function lne(e,t,n){if(void 0===e.config[t]&&e.parent)return lne(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?lne(e.parent,t,n):null})}return e.config[t]}function cne(e){return e.map((e=>{const t=lne(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...cne(t())]:e})).flat(10)}function dne(e,t){const n=t2.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function hne(e){return"function"==typeof e}function une(e,t=void 0,...n){return hne(e)?t?e.bind(t)(...n):e(...n):e}function pne(e){const t=e.filter((e=>"extension"===e.type)),n=e.filter((e=>"node"===e.type)),r=e.filter((e=>"mark"===e.type));return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function fne(e){const t=[],{nodeExtensions:n,markExtensions:r}=pne(e),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=lne(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:i});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...s,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=lne(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...s,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&void 0===(null==i?void 0:i.default)&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function mne(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)=>function(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],s=r.filter((e=>!i.includes(e)));n[e]=[...i,...s].join(" ")}else if("style"===e){const r=t?t.split(";").map((e=>e.trim())).filter(Boolean):[],i=n[e]?n[e].split(";").map((e=>e.trim())).filter(Boolean):[],s=new Map;i.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),r.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),n[e]=Array.from(s.entries()).map((([e,t])=>`${e}: ${t}`)).join("; ")}else n[e]=t;else n[e]=t})),n}),{})}(e,t)),{})}function gne(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function yne(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function vne(e){var t,n,r;const i={};return(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)||void 0===(null==(n=null==e?void 0:e.attribute)?void 0:n.default)||(i.default=e.attribute.default),void 0!==(null==(r=null==e?void 0:e.attribute)?void 0:r.validate)&&(i.validate=e.attribute.validate),[e.name,i]}function bne(e,t){var n;const r=fne(e),{nodeExtensions:i,markExtensions:s}=pne(e),o=null==(n=i.find((e=>lne(e,"topNode"))))?void 0:n.name,a=Object.fromEntries(i.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=lne(t,"extendNodeSchema",s);return{...e,...r?r(n):{}}}),{}),a=yne({...o,content:une(lne(n,"content",s)),marks:une(lne(n,"marks",s)),group:une(lne(n,"group",s)),inline:une(lne(n,"inline",s)),atom:une(lne(n,"atom",s)),selectable:une(lne(n,"selectable",s)),draggable:une(lne(n,"draggable",s)),code:une(lne(n,"code",s)),whitespace:une(lne(n,"whitespace",s)),linebreakReplacement:une(lne(n,"linebreakReplacement",s)),defining:une(lne(n,"defining",s)),isolating:une(lne(n,"isolating",s)),attrs:Object.fromEntries(i.map(vne))}),l=une(lne(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>gne(e,i))));const c=lne(n,"renderHTML",s);c&&(a.toDOM=e=>c({node:e,HTMLAttributes:mne(e,i)}));const d=lne(n,"renderText",s);return d&&(a.toText=d),[n.name,a]}))),l=Object.fromEntries(s.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=lne(t,"extendMarkSchema",s);return{...e,...r?r(n):{}}}),{}),a=yne({...o,inclusive:une(lne(n,"inclusive",s)),excludes:une(lne(n,"excludes",s)),group:une(lne(n,"group",s)),spanning:une(lne(n,"spanning",s)),code:une(lne(n,"code",s)),attrs:Object.fromEntries(i.map(vne))}),l=une(lne(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>gne(e,i))));const c=lne(n,"renderHTML",s);return c&&(a.toDOM=e=>c({mark:e,HTMLAttributes:mne(e,i)})),[n.name,a]})));return new H1({topNode:o,nodes:a,marks:l})}function wne(e){return e.sort(((e,t)=>{const n=lne(e,"priority")||100,r=lne(t,"priority")||100;return n>r?-1:n<r?1:0}))}function xne(e){const t=wne(cne(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return Array.from(new Set(t))}(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 Ene(e,t,n){const{from:r,to:i}=t,{blockSeparator:s="\n\n",textSerializers:o={}}=n||{};let a="";return e.nodesBetween(r,i,((e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=s);const h=null==o?void 0:o[e.type.name];if(h)return l&&(a+=h({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,i-n))})),a}function Cne(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}function Sne(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.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 _ne(e,t){return t.nodes[e]||t.marks[e]||null}function kne(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}var One=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,i,s)=>{var o,a;const l=(null==(a=(o=e.type.spec).toText)?void 0:a.call(o,{node:e,pos:t,parent:i,index:s}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))})),n};function Tne(e,t,n={}){const{empty:r,ranges:i}=e.selection,s=t?vte(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!s||s.name===e.type.name)).find((e=>fte(e.attrs,n,{strict:!1})));let o=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);o+=s-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:s}))))}))})),0===o)return!1;const l=a.filter((e=>!s||s.name===e.mark.type.name)).filter((e=>fte(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!s||e.mark.type!==s&&e.mark.type.excludes(s))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=o}function Pne(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Ine(e,t){const{nodeExtensions:n}=pne(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=une(lne(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function Mne(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach((e=>{!1!==r&&(Mne(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))})),r}return!1}var Rne=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=vte(e,r.schema);if(i)if(o){const e=one(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,s=e.$to.pos;r.doc.nodesBetween(i,s,((e,r)=>{const o=Math.max(r,i),a=Math.min(r+e.nodeSize,s),c=e.marks.find((e=>e.type===l));c?e.marks.forEach((e=>{l===e.type&&n.addMark(o,a,l.create({...e.attrs,...t}))})):n.addMark(o,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:i}=t;let s=null;if(xte(i)&&(s=i.$cursor),s){const t=null!=(r=e.storedMarks)?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some((e=>e.type.excludes(n))))}const{ranges:o}=i;return o.some((({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(i)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),s=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));i=t&&s}return!i})),i}))}(r,n,l)},Ane=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Nne=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const s=ate(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command((({commands:e})=>!!Y5(s,{...o,...t})(n)||e.clearNodes())).command((({state:e})=>Y5(s,{...o,...t})(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Dne=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=Ete(e,0,n.content.size),i=i5.create(n,r);t.setSelection(i)}return!0},Lne=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,s=n5.atStart(n).from,o=n5.atEnd(n).to,a=Ete(r,s,o),l=Ete(i,s,o),c=n5.create(n,a,l);t.setSelection(c)}return!0},Fne=e=>({state:t,dispatch:n})=>i3(ate(e,t.schema))(t,n);function jne(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}var $ne=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=t,{$from:a,$to:l}=s,c=kne(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(s instanceof i5&&s.node.isBlock)return!(!a.parentOffset||!M2(o,a.pos))&&(r&&(e&&jne(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=d&&h?[{type:h,attrs:c}]:void 0,p=M2(t.doc,t.mapping.map(a.pos),1,u);if(u||p||!M2(t.doc,t.mapping.map(a.pos),1,h?[{type:h}]:void 0)||(p=!0,u=h?[{type:h,attrs:c}]:void 0),r){if(p&&(s instanceof n5&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,u),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(a.before()),h)}e&&jne(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},Bne=(e,t={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=ate(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const h=l.node(-1);if(h.type!==a)return!1;const u=s.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let e=e1.empty;const r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=e1.from(l.node(t).copy(e));const i=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,s={...kne(u,l.node().type.name,l.node().attrs),...t},c=(null==(o=a.contentMatch.defaultType)?void 0:o.createAndFill(s))||void 0;e=e.append(e1.from(a.createAndFill(null,c)||void 0));const d=l.before(l.depth-(r-1));n.replace(d,l.after(-i),new o1(e,4-r,0));let h=-1;n.doc.nodesBetween(d,n.doc.content.size,((e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)})),h>-1&&n.setSelection(n5.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...kne(u,h.type.name,h.attrs),...t},m={...kne(u,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!M2(n.doc,l.pos,2))return!1;if(i){const{selection:e,storedMarks:t}=r,{splittableMarks:o}=s.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!i)return!0;const c=a.filter((e=>o.includes(e.type.name)));n.ensureMarks(c)}return!0},Vne=(e,t)=>{const n=ane((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,n.pos)||(e.join(n.pos),!0)},zne=(e,t)=>{const n=ane((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,r)||(e.join(r),!0)},Hne=(e,t,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:h,splittableMarks:u}=i.extensionManager,p=ate(e,o.schema),f=ate(t,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:v}=m,b=y.blockRange(v),w=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const x=ane((e=>Ine(e.type.name,h)))(m);if(b.depth>=1&&x&&b.depth-x.depth<=1){if(x.node.type===p)return c.liftListItem(f);if(Ine(x.node.type.name,h)&&p.validContent(x.node.content)&&a)return l().command((()=>(s.setNodeMarkup(x.pos,p),!0))).command((()=>Vne(s,p))).command((()=>zne(s,p))).run()}return n&&w&&a?l().command((()=>{const e=d().wrapInList(p,r),t=w.filter((e=>u.includes(e.type.name)));return s.ensureMarks(t),!!e||c.clearNodes()})).wrapInList(p,r).command((()=>Vne(s,p))).command((()=>zne(s,p))).run():l().command((()=>!!d().wrapInList(p,r)||c.clearNodes())).wrapInList(p,r).command((()=>Vne(s,p))).command((()=>zne(s,p))).run()},Une=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=vte(e,r.schema);return Tne(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,t)},Kne=(e,t,n={})=>({state:r,commands:i})=>{const s=ate(e,r.schema),o=ate(t,r.schema),a=Hte(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},Wne=(e,t={})=>({state:n,commands:r})=>{const i=ate(e,n.schema);return Hte(n,i,t)?r.lift(i):r.wrapIn(i,t)},Gne=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){const t=e.tr,n=s.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(s.text){const n=t.doc.resolve(s.from).marks();t.replaceWith(s.from,s.to,e.schema.text(s.text,n))}else t.delete(s.from,s.to)}return!0}}return!1},qne=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},Xne=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=t,{selection:a}=n,l=vte(e,r.schema),{$from:c,empty:d,ranges:h}=a;if(!i)return!0;if(d&&o){let{from:e,to:t}=a;const r=null==(s=c.marks().find((e=>e.type===l)))?void 0:s.attrs,i=yte(c,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else h.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},Yne=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=qte("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(s=ate(e,r.schema)),"mark"===a&&(o=vte(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;let l,c,d,h;n.selection.empty?r.doc.nodesBetween(i,a,((e,t)=>{s&&s===e.type&&(d=Math.max(t,i),h=Math.min(t+e.nodeSize,a),l=t,c=e)})):r.doc.nodesBetween(i,a,((e,r)=>{r<i&&s&&s===e.type&&(d=Math.max(r,i),h=Math.min(r+e.nodeSize,a),l=r,c=e),r>=i&&r<=a&&(s&&s===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),o&&e.marks.length&&e.marks.forEach((s=>{if(o===s.type){const l=Math.max(r,i),c=Math.min(r+e.nodeSize,a);n.addMark(l,c,o.create({...s.attrs,...t}))}})))})),c&&(void 0!==l&&n.setNodeMarkup(l,void 0,{...c.attrs,...t}),o&&c.marks.length&&c.marks.forEach((e=>{o===e.type&&n.addMark(d,h,o.create({...e.attrs,...t}))})))})),!0)},Zne=(e,t={})=>({state:n,dispatch:r})=>X5(ate(e,n.schema),t)(n,r),Jne=(e,t={})=>({state:n,dispatch:r})=>n3(ate(e,n.schema),t)(n,r),Qne=(e,t)=>{if(pte(t))return t.exec(e);const n=t(e);if(!n)return null;const 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 ere(e){var t;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let d=!1;const h=One(c)+s;return o.forEach((e=>{if(d)return;const t=Qne(h,e.find);if(!t)return;const o=l.state.tr,c=Zee({state:l.state,transaction:o}),u={from:r-(t[0].length-s.length),to:i},{commands:p,chain:f,can:m}=new Jee({editor:n,state:c});null!==e.handler({state:c,range:u,match:t,commands:p,chain:f,can:m})&&o.steps.length&&(e.undoable&&o.setMeta(a,{transform:o,from:r,to:i,text:s}),l.dispatch(o),d=!0)})),d}function tre(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function nre(e,t){const n={...e};return tre(e)&&tre(t)&&Object.keys(t).forEach((r=>{tre(t[r])&&tre(e[r])?n[r]=nre(e[r],t[r]):n[r]=t[r]})),n}var rre=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{...une(lne(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...une(lne(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>nre(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const 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}},ire=class e extends rre{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const i=r.marks();if(!!!i.find((e=>(null==e?void 0:e.type.name)===t.name)))return!1;const s=i.find((e=>(null==e?void 0:e.type.name)===t.name));return s&&n.removeStoredMark(s),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};var sre=(e,t,n)=>{if(pte(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map((t=>{const 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})):[]};var ore=null;function are(e){const{editor:t,rules:n}=e;let r,i=null,s=!1,o=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:e,from:n,to:i,rule:s,pasteEvt:o})=>{const l=e.tr,c=Zee({state:e,transaction:l}),d=function(e){const{editor:t,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=e,{commands:l,chain:c,can:d}=new Jee({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,((e,t)=>{var u,p,f,m,g;if((null==(p=null==(u=e.type)?void 0:u.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;const y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,v=Math.max(r,t),b=Math.min(i,t+y);if(v>=b)return;const w=e.isText?e.text||"":e.textBetween(v-t,b-t,void 0,"");sre(w,s.find,o).forEach((e=>{if(void 0===e.index)return;const t=v+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},u=s.handler({state:n,range:i,match:e,commands:l,chain:c,can:d,pasteEvent:o,dropEvent:a});h.push(u)}))})),h.every((e=>null!==e))}({editor:t,state:c,from:Math.max(n-1,0),to:i.b-1,rule:s,pasteEvent:o,dropEvent:r});if(d&&l.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}},c=n.map((e=>new y5({view(e){const n=n=>{var r;i=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,i&&(ore=t)},r=()=>{ore&&(ore=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(o=i===e.dom.parentElement,r=t,!o){const e=ore;(null==e?void 0:e.isEditable)&&setTimeout((()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})}),10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,s=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const i=t[0],c="paste"===i.getMeta("uiEvent")&&!s,d="drop"===i.getMeta("uiEvent")&&!o,h=i.getMeta("applyPasteRules"),u=!!h;if(!c&&!d&&!u)return;if(u){let{text:t}=h;"string"==typeof t||(t=dne(e1.from(t),r.schema));const{from:n}=h,i=n+t.length,s=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return l({rule:e,state:r,from:n,to:{b:i},pasteEvt:s})}const p=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof p&&f&&p!==f.b?l({rule:e,state:r,from:p,to:f,pasteEvt:a}):void 0}})));return c}var lre=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=xne(e),this.schema=bne(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce(((e,t)=>{const n=lne(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:_ne(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=wne([...this.extensions].reverse()).flatMap((t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:_ne(t.name,this.schema)},r=[],i=lne(t,"addKeyboardShortcuts",n);let s={};if("mark"===t.type&&lne(t,"exitable",n)&&(s.ArrowRight=()=>ire.handleExit({editor:e,mark:t})),i){const t=Object.fromEntries(Object.entries(i()).map((([t,n])=>[t,()=>n({editor:e})])));s={...s,...t}}const o=M7(s);r.push(o);const a=lne(t,"addInputRules",n);if(Pne(t,e.options.enableInputRules)&&a){const t=a();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new y5({state:{init:()=>null,apply(e,i,s){const o=e.getMeta(r);if(o)return o;const a=e.getMeta("applyInputRules");return!!a&&setTimeout((()=>{let{text:e}=a;"string"==typeof e||(e=dne(e1.from(e),s.schema));const{from:i}=a,o=i+e.length;ere({editor:t,from:i,to:o,text:e,rules:n,plugin:r})})),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,s,o)=>ere({editor:t,from:i,to:s,text:o,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&ere({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:s}=e.state.selection;return!!s&&ere({editor:t,from:s.pos,to:s.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}const l=lne(t,"addPasteRules",n);if(Pne(t,e.options.enablePasteRules)&&l){const t=l();if(t&&t.length){const n=are({editor:e,rules:t});r.push(...n)}}const c=lne(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r}));return t}get attributes(){return fne(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=pne(this.extensions);return Object.fromEntries(t.filter((e=>!!lne(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:ate(t.name,this.schema)},i=lne(t,"addNodeView",r);if(!i)return[];const s=i();if(!s)return[];return[t.name,(r,i,o,a,l)=>{const c=mne(r,n);return s({node:r,view:i,getPos:o,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:c})}]})))}get markViews(){const{editor:e}=this,{markExtensions:t}=pne(this.extensions);return Object.fromEntries(t.filter((e=>!!lne(e,"addMarkView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:vte(t.name,this.schema)},i=lne(t,"addMarkView",r);if(!i)return[];return[t.name,(r,s,o)=>{const a=mne(r,n);return i()({mark:r,view:s,inline:o,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{Pre(r,e,t)}})}]})))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map((e=>[e.name,e.storage]))),e.forEach((e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:_ne(e.name,this.schema)};if("mark"===e.type){(null==(t=une(lne(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name)}const r=lne(e,"onBeforeCreate",n),i=lne(e,"onCreate",n),s=lne(e,"onUpdate",n),o=lne(e,"onSelectionUpdate",n),a=lne(e,"onTransaction",n),l=lne(e,"onFocus",n),c=lne(e,"onBlur",n),d=lne(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),s&&this.editor.on("update",s),o&&this.editor.on("selectionUpdate",o),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)}))}};lre.resolve=xne,lre.sort=wne,lre.flatten=cne;Yee({},{ClipboardTextSerializer:()=>dre,Commands:()=>hre,Delete:()=>ure,Drop:()=>pre,Editable:()=>fre,FocusEvents:()=>gre,Keymap:()=>yre,Paste:()=>vre,Tabindex:()=>bre,focusEventsPluginKey:()=>mre});var cre=class e extends rre{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},dre=cre.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new y5({key:new w5("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:s}=i,o=Math.min(...s.map((e=>e.$from.pos))),a=Math.max(...s.map((e=>e.$to.pos))),l=Cne(n);return Ene(r,{from:o,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),hre=cre.create({name:"commands",addCommands:()=>({...Qee})}),ure=cre.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const s=()=>{var n,r,i,s;if(null!=(s=null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?s:e.getMeta("y-sync$"))return;const o=function(e,t){const n=new Y2(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(e.before,[e,...t]),a=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,i)=>{const s=[];if(e.ranges.length)e.forEach(((e,t)=>{s.push({from:e,to:t})}));else{const{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;s.push({from:e,to:t})}s.forEach((({from:e,to:n})=>{const s=t.slice(i).map(e,-1),o=t.slice(i).map(n),a=t.invert().map(s,-1),l=t.invert().map(o);r.push({oldRange:{from:a,to:l},newRange:{from:s,to:o}})}))})),Sne(r)}(o);a.forEach((t=>{o.mapping.mapResult(t.oldRange.from).deletedAfter&&o.mapping.mapResult(t.oldRange.to).deletedBefore&&o.before.nodesBetween(t.oldRange.from,t.oldRange.to,((n,r)=>{const i=r+n.nodeSize-2,s=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:o.mapping.map(r),newTo:o.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!s,editor:this.editor,transaction:e,combinedTransform:o})}))}));const l=o.mapping;o.steps.forEach(((t,n)=>{var r,i;if(t instanceof v2){const s=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),c=l.invert().map(s,-1),d=l.invert().map(a),h=null==(r=o.doc.nodeAt(s-1))?void 0:r.marks.some((e=>e.eq(t.mark))),u=null==(i=o.doc.nodeAt(a))?void 0:i.marks.some((e=>e.eq(t.mark)));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:s,to:a},partial:Boolean(u||h),editor:this.editor,transaction:e,combinedTransform:o})}}))};null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||i?setTimeout(s,0):s()}}),pre=cre.create({name:"drop",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),fre=cre.create({name:"editable",addProseMirrorPlugins(){return[new y5({key:new w5("editable"),props:{editable:()=>this.editor.options.editable}})]}}),mre=new w5("focusEvents"),gre=cre.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new y5({key:mre,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),yre=cre.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:s}=n,{pos:o,parent:a}=s,l=s.parent.isTextblock&&o>0?t.doc.resolve(o-1):s,c=l.parent.type.spec.isolating,d=s.pos-s.parentOffset,h=c&&1===l.parent.childCount?d===s.pos:J2.atStart(r).from===o;return!(!i||!a.type.isTextblock||a.textContent.length||!h||h&&"paragraph"===s.parent.type.name)&&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 _te()||Vte()?i:r},addProseMirrorPlugins(){return[new y5({key:new w5("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some((e=>e.getMeta("composition"))))return;const r=e.some((e=>e.docChanged))&&!t.doc.eq(n.doc),i=e.some((e=>e.getMeta("preventClearDocument")));if(!r||i)return;const{empty:s,from:o,to:a}=t.selection,l=J2.atStart(t.doc).from,c=J2.atEnd(t.doc).to;if(s||!(o===l&&a===c))return;if(!Mne(n.doc))return;const d=n.tr,h=Zee({state:n,transaction:d}),{commands:u}=new Jee({editor:this.editor,state:h});return u.clearNodes(),d.steps.length?d:void 0}})]}}),vre=cre.create({name:"paste",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),bre=cre.create({name:"tabindex",addProseMirrorPlugins(){return[new y5({key:new w5("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function wre(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,(e=>(n.push(e),`__QUOTED_${n.length-1}__`))),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const e=i.map((e=>e.trim().slice(1)));t.class=e.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(t.id=s[1]);Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach((([,e,r])=>{var i;const s=parseInt((null==(i=r.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10),o=n[s];o&&(t[e]=o.slice(1,-1))}));const 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();if(o){o.split(/\s+/).filter(Boolean).forEach((e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}))}return t}function xre(e){if(!e||0===Object.keys(e).length)return"";const t=[];if(e.class){String(e.class).split(/\s+/).filter(Boolean).forEach((e=>t.push(`.${e}`)))}return e.id&&t.push(`#${e.id}`),Object.entries(e).forEach((([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))})),t.join(" ")}function Ere(e){const{nodeName:t,name:n,parseAttributes:r=wre,serializeAttributes:i=xre,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=e,l=n||t;return{parseMarkdown:(e,n)=>{const r={...s,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,i){const s=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(s);if(!a)return;const c=a[1]||"",d=r(c),h=o.find((e=>!(e in d)));return h?void 0:{type:t,raw:a[0],attributes:d}}},renderMarkdown:e=>{const t=(e=>{if(!a)return e;const t={};return a.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),n=i(t);return`:::${l}${n?` {${n}}`:""} :::`}}}function Cre(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=wre,serializeAttributes:s=xre,defaultAttributes:o={},content:a="block",allowedAttributes:l}=e,c=n||t;return{parseMarkdown:(e,n)=>{let i;if(r){const t=r(e);i="string"==typeof t?[{type:"text",text:t}]:t}else i="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const s={...o,...e.attributes};return n.createNode(t,s,i)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var s;const o=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(o);if(!l)return;const[d,h=""]=l,u=i(h);let p=1;const f=d.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(y);if(null===n)break;const i=n.index,o=n[1];if(!(null==(s=n[2])?void 0:s.endsWith(":::")))if(o)p+=1;else if(p-=1,0===p){const s=y.slice(0,i);m=s.trim();const o=e.slice(0,f+i+n[0].length);let l=[];if(m)if("block"===a)for(l=r.blockTokens(s),l.forEach((e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))}));l.length>0;){const e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(m);return{type:t,raw:o,attributes:u,content:m,tokens:l}}}}},renderMarkdown:(e,t)=>{const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),r=s(n),i=r?` {${r}}`:"",o=t.renderChildren(e.content||[],"\n\n");return`:::${c}${i}\n\n${o}\n\n:::`}}}function Sre(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,i,s,o]=r;t[i]=s||o,r=n.exec(e)}return t}function _re(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}="${t}"`)).join(" ")}function kre(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=Sre,serializeAttributes:s=_re,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const i={...o,...e.attributes};if(a)return n.createNode(t,i);const s=r?r(e):e.content||"";return s?n.createNode(t,i,[n.createTextNode(s)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const s=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(s);if(!o)return;let l="",c="";if(a){const[,e]=o;c=e}else{const[,e,t]=o;c=e,l=t||""}const h=i(c.trim());return{type:t,raw:o[0],content:l.trim(),attributes:h}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter((e=>"text"===e.type)).map((e=>e.text)).join(""));const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),i=s(n),o=i?` ${i}`:"";return a?`[${c}${o}]`:`[${c}${o}]${t}[/${c}]`}}}function Ore(e,t,n){var r,i,s,o;const a=e.split("\n"),l=[];let c="",d=0;const h=t.baseIndentSize||2;for(;d<a.length;){const e=a[d],u=e.match(t.itemPattern);if(!u){if(l.length>0)break;if(""===e.trim()){d+=1;continue}return}const p=t.extractItemData(u),{indentLevel:f,mainContent:m}=p;c=`${c}${e}\n`;const g=[m];for(d+=1;d<a.length;){const e=a[d];if(""===e.trim()){const t=a.slice(d+1).findIndex((e=>""!==e.trim()));if(-1===t)break;if(((null==(i=null==(r=a[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>f){g.push(e),c=`${c}${e}\n`,d+=1;continue}break}if(!(((null==(o=null==(s=e.match(/^(\s*)/))?void 0:s[1])?void 0:o.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,d+=1}let y;const v=g.slice(1);if(v.length>0){const e=v.map((e=>e.slice(f+h))).join("\n");e.trim()&&(y=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const b=t.createToken(p,y);l.push(b)}if(0!==l.length)return{items:l,raw:c.trim()}}function Tre(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i="function"==typeof n?n(r):n,[s,...o]=e.content,a=[`${i}${t.renderChildren([s])}`];return o&&o.length>0&&o.forEach((e=>{const n=t.renderChildren([e]);if(n){const e=n.split("\n").map((e=>e?t.indent(e):"")).join("\n");a.push(e)}})),a.join("\n")}function Pre(e,t,n={}){const{state:r}=t,{doc:i,tr:s}=r,o=e;i.descendants(((t,r)=>{const i=s.mapping.map(r),a=s.mapping.map(r)+t.nodeSize;let l=null;if(t.marks.forEach((e=>{if(e!==o)return!1;l=e})),!l)return;let c=!1;if(Object.keys(n).forEach((e=>{n[e]!==l.attrs[e]&&(c=!0)})),c){const t=e.type.create({...e.attrs,...n});s.removeMark(i,a,e.type),s.addMark(i,a,t)}})),s.docChanged&&t.view.dispatch(s)}Yee({},{createAtomBlockMarkdownSpec:()=>Ere,createBlockMarkdownSpec:()=>Cre,createInlineMarkdownSpec:()=>kre,parseAttributes:()=>wre,parseIndentedBlocks:()=>Ore,renderNestedMarkdownContent:()=>Tre,serializeAttributes:()=>xre});var Ire=class e extends rre{constructor(){super(...arguments),this.type="node"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}}.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),Mre=Ire,Rre=Object.defineProperty,Are=(e,t)=>{for(var n in t)Rre(e,n,{get:t[n],enumerable:!0})};function Nre(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=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 s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var Dre=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(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(s);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],a=!!e,l=e||i.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return o.push(i),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(l),o.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...s,dispatch:void 0})]))),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:e,editor:r,view:s,state:Nre({state:i,transaction:e}),dispatch:t?()=>{}: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}},Lre={};Are(Lre,{blur:()=>Fre,clearContent:()=>jre,clearNodes:()=>$re,command:()=>Bre,createParagraphNear:()=>Vre,cut:()=>zre,deleteCurrentNode:()=>Hre,deleteNode:()=>Kre,deleteRange:()=>Wre,deleteSelection:()=>Gre,enter:()=>qre,exitCode:()=>Xre,extendMarkRange:()=>nie,first:()=>rie,focus:()=>cie,forEach:()=>die,insertContent:()=>hie,insertContentAt:()=>mie,joinBackward:()=>vie,joinDown:()=>yie,joinForward:()=>bie,joinItemBackward:()=>wie,joinItemForward:()=>xie,joinTextblockBackward:()=>Eie,joinTextblockForward:()=>Cie,joinUp:()=>gie,keyboardShortcut:()=>_ie,lift:()=>Oie,liftEmptyBlock:()=>Tie,liftListItem:()=>Pie,newlineInCode:()=>Iie,resetAttributes:()=>Aie,scrollIntoView:()=>Nie,selectAll:()=>Die,selectNodeBackward:()=>Lie,selectNodeForward:()=>Fie,selectParentNode:()=>jie,selectTextblockEnd:()=>$ie,selectTextblockStart:()=>Bie,setContent:()=>zie,setMark:()=>mse,setMeta:()=>gse,setNode:()=>yse,setNodeSelection:()=>vse,setTextSelection:()=>bse,sinkListItem:()=>wse,splitBlock:()=>Ese,splitListItem:()=>Cse,toggleList:()=>kse,toggleMark:()=>Ose,toggleNode:()=>Tse,toggleWrap:()=>Pse,undoInputRule:()=>Ise,unsetAllMarks:()=>Mse,unsetMark:()=>Rse,updateAttributes:()=>Ase,wrapIn:()=>Nse,wrapInList:()=>Dse});var Fre=()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())})),!0),jre=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),$re=()=>({state:e,tr:t,dispatch:n})=>{const{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;const{doc:r,mapping:i}=t,s=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),a=s.blockRange(o);if(!a)return;const l=k2(a);if(e.type.isTextblock){const{defaultType:e}=s.parent.contentMatchAt(s.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},Bre=e=>t=>e(t),Vre=()=>({state:e,dispatch:t})=>B5(e,t),zre=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const o=r.mapping.map(t);return r.insert(o,s.content),r.setSelection(new n5(r.doc.resolve(Math.max(o-1,0)))),!0},Hre=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1){if(i.node(n).type===r.type){if(t){const t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}}return!1};function Ure(e,t){if("string"==typeof e){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 Kre=e=>({tr:t,state:n,dispatch:r})=>{const i=Ure(e,n.schema),s=t.selection.$anchor;for(let e=s.depth;e>0;e-=1){if(s.node(e).type===i){if(r){const n=s.before(e),r=s.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},Wre=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},Gre=()=>({state:e,dispatch:t})=>x5(e,t),qre=()=>({commands:e})=>e.keyboardShortcut("Enter"),Xre=()=>({state:e,dispatch:t})=>$5(e,t);function Yre(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function Zre(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Yre(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Jre(e,t,n={}){return e.find((e=>e.type===t&&Zre(Object.fromEntries(Object.keys(n).map((t=>[t,e.attrs[t]]))),n)))}function Qre(e,t,n={}){return!!Jre(e,t,n)}function eie(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some((e=>e.type===t))||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some((e=>e.type===t)))return;n=n||(null==(r=i.node.marks[0])?void 0:r.attrs);if(!Jre([...i.node.marks],t,n))return;let s=i.index,o=e.start()+i.offset,a=s+1,l=o+i.node.nodeSize;for(;s>0&&Qre([...e.parent.child(s-1).marks],t,n);)s-=1,o-=e.parent.child(s).nodeSize;for(;a<e.parent.childCount&&Qre([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function tie(e,t){if("string"==typeof e){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 nie=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const s=tie(e,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){const e=eie(l,s,t);if(e&&e.from<=c&&e.to>=d){const t=n5.create(o,e.from,e.to);n.setSelection(t)}}return!0},rie=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function iie(e){return e instanceof n5}function sie(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function oie(e,t=null){if(!t)return null;const n=J2.atStart(e),r=J2.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,s=r.to;return"all"===t?n5.create(e,sie(0,i,s),sie(e.content.size,i,s)):n5.create(e,sie(t,i,s),sie(t,i,s))}function aie(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function lie(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var cie=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const o=()=>{(lie()||aie())&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(s&&null===e&&!iie(n.state.selection))return o(),!0;const a=oie(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},die=(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),hie=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),uie=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&uie(r)}return e};function pie(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return uie(n)}function fie(e,t,n){if(e instanceof S1||e instanceof e1)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return e1.fromArray(e.map((e=>t.nodeFromJSON(e))));const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),fie("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,i="";const s=new H1({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="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?K1.fromSchema(s).parseSlice(pie(e),n.parseOptions):K1.fromSchema(s).parse(pie(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${i}`)})}const r=K1.fromSchema(t);return n.slice?r.parseSlice(pie(e),n.parseOptions).content:r.parse(pie(e),n.parseOptions)}return fie("",t,n)}var mie=(e,t,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){let i;const a=e=>{s.emit("contentError",{editor:s,error:e,disableCollaboration:()=>{"collaboration"in s.storage&&"object"==typeof s.storage.collaboration&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},l={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{fie(t,s.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(e){a(e)}try{i=fie(t,s.schema,{parseOptions:l,errorOnInvalidContent:null!=(o=n.errorOnInvalidContent)?o:s.options.enableContentCheck})}catch(e){return a(e),!1}let{from:c,to:d}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},h=!0,u=!0;if(("type"in i?[i]:i).forEach((e=>{e.check(),h=!!h&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),c===d&&u){const{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(c-=1,d+=1)}let p;if(h){if(Array.isArray(t))p=t.map((e=>e.text||"")).join("");else if(t instanceof e1){let e="";t.forEach((t=>{t.text&&(e+=t.text)})),p=e}else p="object"==typeof t&&t&&t.text?t.text:t;r.insertText(p,c,d)}else{p=i;const e=r.doc.resolve(c),t=e.node(),n=0===e.parentOffset,s=t.isText||t.isTextblock,o=t.content.size>0;n&&s&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,d,p)}n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof x2||i instanceof E2))return;const s=e.mapping.maps[r];let o=0;s.forEach(((e,t,n,r)=>{0===o&&(o=r)})),e.setSelection(J2.near(e.doc.resolve(o),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},gie=()=>({state:e,dispatch:t})=>N5(e,t),yie=()=>({state:e,dispatch:t})=>D5(e,t),vie=()=>({state:e,dispatch:t})=>C5(e,t),bie=()=>({state:e,dispatch:t})=>M5(e,t),wie=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},xie=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Eie=()=>({state:e,dispatch:t})=>S5(e,t),Cie=()=>({state:e,dispatch:t})=>_5(e,t);function Sie(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var _ie=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const s=function(e){const t=e.split(/-(?!$)/);let n,r,i,s,o=t[t.length-1];"Space"===o&&(o=" ");for(let e=0;e<t.length-1;e+=1){const o=t[e];if(/^(cmd|meta|m)$/i.test(o))s=!0;else if(/^a(lt)?$/i.test(o))n=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))i=!0;else{if(!/^mod$/i.test(o))throw new Error(`Unrecognized modifier name: ${o}`);lie()||Sie()?s=!0:r=!0}}return n&&(o=`Alt-${o}`),r&&(o=`Ctrl-${o}`),s&&(o=`Meta-${o}`),i&&(o=`Shift-${o}`),o}(e).split(/-(?!$)/),o=s.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===o?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0};function kie(e,t,n={}){const{from:r,to:i,empty:s}=e.selection,o=t?Ure(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:s})}));const l=i-r,c=a.filter((e=>!o||o.name===e.node.type.name)).filter((e=>Zre(e.node.attrs,n,{strict:!1})));if(s)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}var Oie=(e,t={})=>({state:n,dispatch:r})=>!!kie(n,Ure(e,n.schema),t)&&L5(n,r),Tie=()=>({state:e,dispatch:t})=>V5(e,t),Pie=e=>({state:t,dispatch:n})=>r3(Ure(e,t.schema))(t,n),Iie=()=>({state:e,dispatch:t})=>F5(e,t);function Mie(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Rie(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}var Aie=(e,t)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Mie("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(s=Ure(e,r.schema)),"mark"===a&&(o=tie(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{s&&s===e.type&&n.setNodeMarkup(r,void 0,Rie(e.attrs,t)),o&&e.marks.length&&e.marks.forEach((i=>{o===i.type&&n.addMark(r,r+e.nodeSize,o.create(Rie(i.attrs,t)))}))}))})),!0)},Nie=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Die=()=>({tr:e,dispatch:t})=>{if(t){const t=new o5(e.doc);e.setSelection(t)}return!0},Lie=()=>({state:e,dispatch:t})=>T5(e,t),Fie=()=>({state:e,dispatch:t})=>R5(e,t),jie=()=>({state:e,dispatch:t})=>U5(e,t),$ie=()=>({state:e,dispatch:t})=>q5(e,t),Bie=()=>({state:e,dispatch:t})=>G5(e,t);function Vie(e,t,n={},r={}){return fie(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var zie=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if("full"!==r.preserveWhitespace){const a=Vie(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function Hie(e,t){const n=tie(t,e.schema),{from:r,to:i,empty:s}=e.selection,o=[];s?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{o.push(...e.marks)}));const a=o.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function Uie(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function Kie(e,t,n){if(void 0===e.config[t]&&e.parent)return Kie(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?Kie(e.parent,t,n):null})}return e.config[t]}function Wie(e){return e.map((e=>{const t=Kie(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...Wie(t())]:e})).flat(10)}function Gie(e,t){const n=t2.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function qie(e){return"function"==typeof e}function Xie(e,t=void 0,...n){return qie(e)?t?e.bind(t)(...n):e(...n):e}function Yie(e){const t=e.filter((e=>"extension"===e.type)),n=e.filter((e=>"node"===e.type)),r=e.filter((e=>"mark"===e.type));return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function Zie(e){const t=[],{nodeExtensions:n,markExtensions:r}=Yie(e),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=Kie(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:i});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...s,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=Kie(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...s,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&void 0===(null==i?void 0:i.default)&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function Jie(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)=>function(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],s=r.filter((e=>!i.includes(e)));n[e]=[...i,...s].join(" ")}else if("style"===e){const r=t?t.split(";").map((e=>e.trim())).filter(Boolean):[],i=n[e]?n[e].split(";").map((e=>e.trim())).filter(Boolean):[],s=new Map;i.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),r.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),n[e]=Array.from(s.entries()).map((([e,t])=>`${e}: ${t}`)).join("; ")}else n[e]=t;else n[e]=t})),n}),{})}(e,t)),{})}function Qie(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function ese(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function tse(e){var t,n,r;const i={};return(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)||void 0===(null==(n=null==e?void 0:e.attribute)?void 0:n.default)||(i.default=e.attribute.default),void 0!==(null==(r=null==e?void 0:e.attribute)?void 0:r.validate)&&(i.validate=e.attribute.validate),[e.name,i]}function nse(e,t){var n;const r=Zie(e),{nodeExtensions:i,markExtensions:s}=Yie(e),o=null==(n=i.find((e=>Kie(e,"topNode"))))?void 0:n.name,a=Object.fromEntries(i.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=Kie(t,"extendNodeSchema",s);return{...e,...r?r(n):{}}}),{}),a=ese({...o,content:Xie(Kie(n,"content",s)),marks:Xie(Kie(n,"marks",s)),group:Xie(Kie(n,"group",s)),inline:Xie(Kie(n,"inline",s)),atom:Xie(Kie(n,"atom",s)),selectable:Xie(Kie(n,"selectable",s)),draggable:Xie(Kie(n,"draggable",s)),code:Xie(Kie(n,"code",s)),whitespace:Xie(Kie(n,"whitespace",s)),linebreakReplacement:Xie(Kie(n,"linebreakReplacement",s)),defining:Xie(Kie(n,"defining",s)),isolating:Xie(Kie(n,"isolating",s)),attrs:Object.fromEntries(i.map(tse))}),l=Xie(Kie(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>Qie(e,i))));const c=Kie(n,"renderHTML",s);c&&(a.toDOM=e=>c({node:e,HTMLAttributes:Jie(e,i)}));const d=Kie(n,"renderText",s);return d&&(a.toText=d),[n.name,a]}))),l=Object.fromEntries(s.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=Kie(t,"extendMarkSchema",s);return{...e,...r?r(n):{}}}),{}),a=ese({...o,inclusive:Xie(Kie(n,"inclusive",s)),excludes:Xie(Kie(n,"excludes",s)),group:Xie(Kie(n,"group",s)),spanning:Xie(Kie(n,"spanning",s)),code:Xie(Kie(n,"code",s)),attrs:Object.fromEntries(i.map(tse))}),l=Xie(Kie(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>Qie(e,i))));const c=Kie(n,"renderHTML",s);return c&&(a.toDOM=e=>c({mark:e,HTMLAttributes:Jie(e,i)})),[n.name,a]})));return new H1({topNode:o,nodes:a,marks:l})}function rse(e){return e.sort(((e,t)=>{const n=Kie(e,"priority")||100,r=Kie(t,"priority")||100;return n>r?-1:n<r?1:0}))}function ise(e){const t=rse(Wie(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return Array.from(new Set(t))}(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 sse(e,t,n){const{from:r,to:i}=t,{blockSeparator:s="\n\n",textSerializers:o={}}=n||{};let a="";return e.nodesBetween(r,i,((e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=s);const h=null==o?void 0:o[e.type.name];if(h)return l&&(a+=h({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,i-n))})),a}function ose(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}function ase(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.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 lse(e,t){return t.nodes[e]||t.marks[e]||null}function cse(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}var dse=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,i,s)=>{var o,a;const l=(null==(a=(o=e.type.spec).toText)?void 0:a.call(o,{node:e,pos:t,parent:i,index:s}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))})),n};function hse(e,t,n={}){const{empty:r,ranges:i}=e.selection,s=t?tie(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!s||s.name===e.type.name)).find((e=>Zre(e.attrs,n,{strict:!1})));let o=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);o+=s-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:s}))))}))})),0===o)return!1;const l=a.filter((e=>!s||s.name===e.mark.type.name)).filter((e=>Zre(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!s||e.mark.type!==s&&e.mark.type.excludes(s))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=o}function use(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function pse(e,t){const{nodeExtensions:n}=Yie(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=Xie(Kie(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function fse(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach((e=>{!1!==r&&(fse(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))})),r}return!1}var mse=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=tie(e,r.schema);if(i)if(o){const e=Hie(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,s=e.$to.pos;r.doc.nodesBetween(i,s,((e,r)=>{const o=Math.max(r,i),a=Math.min(r+e.nodeSize,s),c=e.marks.find((e=>e.type===l));c?e.marks.forEach((e=>{l===e.type&&n.addMark(o,a,l.create({...e.attrs,...t}))})):n.addMark(o,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:i}=t;let s=null;if(iie(i)&&(s=i.$cursor),s){const t=null!=(r=e.storedMarks)?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some((e=>e.type.excludes(n))))}const{ranges:o}=i;return o.some((({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(i)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),s=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));i=t&&s}return!i})),i}))}(r,n,l)},gse=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),yse=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const s=Ure(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command((({commands:e})=>!!Y5(s,{...o,...t})(n)||e.clearNodes())).command((({state:e})=>Y5(s,{...o,...t})(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},vse=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=sie(e,0,n.content.size),i=i5.create(n,r);t.setSelection(i)}return!0},bse=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,s=n5.atStart(n).from,o=n5.atEnd(n).to,a=sie(r,s,o),l=sie(i,s,o),c=n5.create(n,a,l);t.setSelection(c)}return!0},wse=e=>({state:t,dispatch:n})=>i3(Ure(e,t.schema))(t,n);function xse(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}var Ese=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=t,{$from:a,$to:l}=s,c=cse(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(s instanceof i5&&s.node.isBlock)return!(!a.parentOffset||!M2(o,a.pos))&&(r&&(e&&xse(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=d&&h?[{type:h,attrs:c}]:void 0,p=M2(t.doc,t.mapping.map(a.pos),1,u);if(u||p||!M2(t.doc,t.mapping.map(a.pos),1,h?[{type:h}]:void 0)||(p=!0,u=h?[{type:h,attrs:c}]:void 0),r){if(p&&(s instanceof n5&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,u),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(a.before()),h)}e&&xse(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},Cse=(e,t={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=Ure(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const h=l.node(-1);if(h.type!==a)return!1;const u=s.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let e=e1.empty;const r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=e1.from(l.node(t).copy(e));const i=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,s={...cse(u,l.node().type.name,l.node().attrs),...t},c=(null==(o=a.contentMatch.defaultType)?void 0:o.createAndFill(s))||void 0;e=e.append(e1.from(a.createAndFill(null,c)||void 0));const d=l.before(l.depth-(r-1));n.replace(d,l.after(-i),new o1(e,4-r,0));let h=-1;n.doc.nodesBetween(d,n.doc.content.size,((e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)})),h>-1&&n.setSelection(n5.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...cse(u,h.type.name,h.attrs),...t},m={...cse(u,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!M2(n.doc,l.pos,2))return!1;if(i){const{selection:e,storedMarks:t}=r,{splittableMarks:o}=s.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!i)return!0;const c=a.filter((e=>o.includes(e.type.name)));n.ensureMarks(c)}return!0},Sse=(e,t)=>{const n=Uie((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,n.pos)||(e.join(n.pos),!0)},_se=(e,t)=>{const n=Uie((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,r)||(e.join(r),!0)},kse=(e,t,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:h,splittableMarks:u}=i.extensionManager,p=Ure(e,o.schema),f=Ure(t,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:v}=m,b=y.blockRange(v),w=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const x=Uie((e=>pse(e.type.name,h)))(m);if(b.depth>=1&&x&&b.depth-x.depth<=1){if(x.node.type===p)return c.liftListItem(f);if(pse(x.node.type.name,h)&&p.validContent(x.node.content)&&a)return l().command((()=>(s.setNodeMarkup(x.pos,p),!0))).command((()=>Sse(s,p))).command((()=>_se(s,p))).run()}return n&&w&&a?l().command((()=>{const e=d().wrapInList(p,r),t=w.filter((e=>u.includes(e.type.name)));return s.ensureMarks(t),!!e||c.clearNodes()})).wrapInList(p,r).command((()=>Sse(s,p))).command((()=>_se(s,p))).run():l().command((()=>!!d().wrapInList(p,r)||c.clearNodes())).wrapInList(p,r).command((()=>Sse(s,p))).command((()=>_se(s,p))).run()},Ose=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=tie(e,r.schema);return hse(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,t)},Tse=(e,t,n={})=>({state:r,commands:i})=>{const s=Ure(e,r.schema),o=Ure(t,r.schema),a=kie(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},Pse=(e,t={})=>({state:n,commands:r})=>{const i=Ure(e,n.schema);return kie(n,i,t)?r.lift(i):r.wrapIn(i,t)},Ise=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){const t=e.tr,n=s.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(s.text){const n=t.doc.resolve(s.from).marks();t.replaceWith(s.from,s.to,e.schema.text(s.text,n))}else t.delete(s.from,s.to)}return!0}}return!1},Mse=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},Rse=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=t,{selection:a}=n,l=tie(e,r.schema),{$from:c,empty:d,ranges:h}=a;if(!i)return!0;if(d&&o){let{from:e,to:t}=a;const r=null==(s=c.marks().find((e=>e.type===l)))?void 0:s.attrs,i=eie(c,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else h.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},Ase=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Mie("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(s=Ure(e,r.schema)),"mark"===a&&(o=tie(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;let l,c,d,h;n.selection.empty?r.doc.nodesBetween(i,a,((e,t)=>{s&&s===e.type&&(d=Math.max(t,i),h=Math.min(t+e.nodeSize,a),l=t,c=e)})):r.doc.nodesBetween(i,a,((e,r)=>{r<i&&s&&s===e.type&&(d=Math.max(r,i),h=Math.min(r+e.nodeSize,a),l=r,c=e),r>=i&&r<=a&&(s&&s===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),o&&e.marks.length&&e.marks.forEach((s=>{if(o===s.type){const l=Math.max(r,i),c=Math.min(r+e.nodeSize,a);n.addMark(l,c,o.create({...s.attrs,...t}))}})))})),c&&(void 0!==l&&n.setNodeMarkup(l,void 0,{...c.attrs,...t}),o&&c.marks.length&&c.marks.forEach((e=>{o===e.type&&n.addMark(d,h,o.create({...e.attrs,...t}))})))})),!0)},Nse=(e,t={})=>({state:n,dispatch:r})=>X5(Ure(e,n.schema),t)(n,r),Dse=(e,t={})=>({state:n,dispatch:r})=>n3(Ure(e,n.schema),t)(n,r),Lse=(e,t)=>{if(Yre(t))return t.exec(e);const n=t(e);if(!n)return null;const 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 Fse(e){var t;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let d=!1;const h=dse(c)+s;return o.forEach((e=>{if(d)return;const t=Lse(h,e.find);if(!t)return;const o=l.state.tr,c=Nre({state:l.state,transaction:o}),u={from:r-(t[0].length-s.length),to:i},{commands:p,chain:f,can:m}=new Dre({editor:n,state:c});null!==e.handler({state:c,range:u,match:t,commands:p,chain:f,can:m})&&o.steps.length&&(e.undoable&&o.setMeta(a,{transform:o,from:r,to:i,text:s}),l.dispatch(o),d=!0)})),d}function jse(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function $se(e,t){const n={...e};return jse(e)&&jse(t)&&Object.keys(t).forEach((r=>{jse(t[r])&&jse(e[r])?n[r]=$se(e[r],t[r]):n[r]=t[r]})),n}var Bse=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{...Xie(Kie(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Xie(Kie(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>$se(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const 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}},Vse=class e extends Bse{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const i=r.marks();if(!!!i.find((e=>(null==e?void 0:e.type.name)===t.name)))return!1;const s=i.find((e=>(null==e?void 0:e.type.name)===t.name));return s&&n.removeStoredMark(s),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};var zse=(e,t,n)=>{if(Yre(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map((t=>{const 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})):[]};var Hse=null;function Use(e){const{editor:t,rules:n}=e;let r,i=null,s=!1,o=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:e,from:n,to:i,rule:s,pasteEvt:o})=>{const l=e.tr,c=Nre({state:e,transaction:l}),d=function(e){const{editor:t,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=e,{commands:l,chain:c,can:d}=new Dre({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,((e,t)=>{var u,p,f,m,g;if((null==(p=null==(u=e.type)?void 0:u.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;const y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,v=Math.max(r,t),b=Math.min(i,t+y);if(v>=b)return;const w=e.isText?e.text||"":e.textBetween(v-t,b-t,void 0,"");zse(w,s.find,o).forEach((e=>{if(void 0===e.index)return;const t=v+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},u=s.handler({state:n,range:i,match:e,commands:l,chain:c,can:d,pasteEvent:o,dropEvent:a});h.push(u)}))})),h.every((e=>null!==e))}({editor:t,state:c,from:Math.max(n-1,0),to:i.b-1,rule:s,pasteEvent:o,dropEvent:r});if(d&&l.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}},c=n.map((e=>new y5({view(e){const n=n=>{var r;i=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,i&&(Hse=t)},r=()=>{Hse&&(Hse=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(o=i===e.dom.parentElement,r=t,!o){const e=Hse;(null==e?void 0:e.isEditable)&&setTimeout((()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})}),10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,s=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const i=t[0],c="paste"===i.getMeta("uiEvent")&&!s,d="drop"===i.getMeta("uiEvent")&&!o,h=i.getMeta("applyPasteRules"),u=!!h;if(!c&&!d&&!u)return;if(u){let{text:t}=h;"string"==typeof t||(t=Gie(e1.from(t),r.schema));const{from:n}=h,i=n+t.length,s=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return l({rule:e,state:r,from:n,to:{b:i},pasteEvt:s})}const p=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof p&&f&&p!==f.b?l({rule:e,state:r,from:p,to:f,pasteEvt:a}):void 0}})));return c}var Kse=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=ise(e),this.schema=nse(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce(((e,t)=>{const n=Kie(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:lse(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=rse([...this.extensions].reverse()).flatMap((t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:lse(t.name,this.schema)},r=[],i=Kie(t,"addKeyboardShortcuts",n);let s={};if("mark"===t.type&&Kie(t,"exitable",n)&&(s.ArrowRight=()=>Vse.handleExit({editor:e,mark:t})),i){const t=Object.fromEntries(Object.entries(i()).map((([t,n])=>[t,()=>n({editor:e})])));s={...s,...t}}const o=M7(s);r.push(o);const a=Kie(t,"addInputRules",n);if(use(t,e.options.enableInputRules)&&a){const t=a();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new y5({state:{init:()=>null,apply(e,i,s){const o=e.getMeta(r);if(o)return o;const a=e.getMeta("applyInputRules");return!!a&&setTimeout((()=>{let{text:e}=a;"string"==typeof e||(e=Gie(e1.from(e),s.schema));const{from:i}=a,o=i+e.length;Fse({editor:t,from:i,to:o,text:e,rules:n,plugin:r})})),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,s,o)=>Fse({editor:t,from:i,to:s,text:o,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&Fse({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:s}=e.state.selection;return!!s&&Fse({editor:t,from:s.pos,to:s.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}const l=Kie(t,"addPasteRules",n);if(use(t,e.options.enablePasteRules)&&l){const t=l();if(t&&t.length){const n=Use({editor:e,rules:t});r.push(...n)}}const c=Kie(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r}));return t}get attributes(){return Zie(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Yie(this.extensions);return Object.fromEntries(t.filter((e=>!!Kie(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Ure(t.name,this.schema)},i=Kie(t,"addNodeView",r);if(!i)return[];const s=i();if(!s)return[];return[t.name,(r,i,o,a,l)=>{const c=Jie(r,n);return s({node:r,view:i,getPos:o,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:c})}]})))}get markViews(){const{editor:e}=this,{markExtensions:t}=Yie(this.extensions);return Object.fromEntries(t.filter((e=>!!Kie(e,"addMarkView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:tie(t.name,this.schema)},i=Kie(t,"addMarkView",r);if(!i)return[];return[t.name,(r,s,o)=>{const a=Jie(r,n);return i()({mark:r,view:s,inline:o,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{uoe(r,e,t)}})}]})))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map((e=>[e.name,e.storage]))),e.forEach((e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:lse(e.name,this.schema)};if("mark"===e.type){(null==(t=Xie(Kie(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name)}const r=Kie(e,"onBeforeCreate",n),i=Kie(e,"onCreate",n),s=Kie(e,"onUpdate",n),o=Kie(e,"onSelectionUpdate",n),a=Kie(e,"onTransaction",n),l=Kie(e,"onFocus",n),c=Kie(e,"onBlur",n),d=Kie(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),s&&this.editor.on("update",s),o&&this.editor.on("selectionUpdate",o),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)}))}};Kse.resolve=ise,Kse.sort=rse,Kse.flatten=Wie;Are({},{ClipboardTextSerializer:()=>Gse,Commands:()=>qse,Delete:()=>Xse,Drop:()=>Yse,Editable:()=>Zse,FocusEvents:()=>Qse,Keymap:()=>eoe,Paste:()=>toe,Tabindex:()=>noe,focusEventsPluginKey:()=>Jse});var Wse=class e extends Bse{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},Gse=Wse.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new y5({key:new w5("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:s}=i,o=Math.min(...s.map((e=>e.$from.pos))),a=Math.max(...s.map((e=>e.$to.pos))),l=ose(n);return sse(r,{from:o,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),qse=Wse.create({name:"commands",addCommands:()=>({...Lre})}),Xse=Wse.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const s=()=>{var n,r,i,s;if(null!=(s=null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?s:e.getMeta("y-sync$"))return;const o=function(e,t){const n=new Y2(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(e.before,[e,...t]),a=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,i)=>{const s=[];if(e.ranges.length)e.forEach(((e,t)=>{s.push({from:e,to:t})}));else{const{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;s.push({from:e,to:t})}s.forEach((({from:e,to:n})=>{const s=t.slice(i).map(e,-1),o=t.slice(i).map(n),a=t.invert().map(s,-1),l=t.invert().map(o);r.push({oldRange:{from:a,to:l},newRange:{from:s,to:o}})}))})),ase(r)}(o);a.forEach((t=>{o.mapping.mapResult(t.oldRange.from).deletedAfter&&o.mapping.mapResult(t.oldRange.to).deletedBefore&&o.before.nodesBetween(t.oldRange.from,t.oldRange.to,((n,r)=>{const i=r+n.nodeSize-2,s=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:o.mapping.map(r),newTo:o.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!s,editor:this.editor,transaction:e,combinedTransform:o})}))}));const l=o.mapping;o.steps.forEach(((t,n)=>{var r,i;if(t instanceof v2){const s=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),c=l.invert().map(s,-1),d=l.invert().map(a),h=null==(r=o.doc.nodeAt(s-1))?void 0:r.marks.some((e=>e.eq(t.mark))),u=null==(i=o.doc.nodeAt(a))?void 0:i.marks.some((e=>e.eq(t.mark)));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:s,to:a},partial:Boolean(u||h),editor:this.editor,transaction:e,combinedTransform:o})}}))};null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||i?setTimeout(s,0):s()}}),Yse=Wse.create({name:"drop",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Zse=Wse.create({name:"editable",addProseMirrorPlugins(){return[new y5({key:new w5("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Jse=new w5("focusEvents"),Qse=Wse.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new y5({key:Jse,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),eoe=Wse.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:s}=n,{pos:o,parent:a}=s,l=s.parent.isTextblock&&o>0?t.doc.resolve(o-1):s,c=l.parent.type.spec.isolating,d=s.pos-s.parentOffset,h=c&&1===l.parent.childCount?d===s.pos:J2.atStart(r).from===o;return!(!i||!a.type.isTextblock||a.textContent.length||!h||h&&"paragraph"===s.parent.type.name)&&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 lie()||Sie()?i:r},addProseMirrorPlugins(){return[new y5({key:new w5("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some((e=>e.getMeta("composition"))))return;const r=e.some((e=>e.docChanged))&&!t.doc.eq(n.doc),i=e.some((e=>e.getMeta("preventClearDocument")));if(!r||i)return;const{empty:s,from:o,to:a}=t.selection,l=J2.atStart(t.doc).from,c=J2.atEnd(t.doc).to;if(s||!(o===l&&a===c))return;if(!fse(n.doc))return;const d=n.tr,h=Nre({state:n,transaction:d}),{commands:u}=new Dre({editor:this.editor,state:h});return u.clearNodes(),d.steps.length?d:void 0}})]}}),toe=Wse.create({name:"paste",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),noe=Wse.create({name:"tabindex",addProseMirrorPlugins(){return[new y5({key:new w5("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function roe(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,(e=>(n.push(e),`__QUOTED_${n.length-1}__`))),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const e=i.map((e=>e.trim().slice(1)));t.class=e.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(t.id=s[1]);Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach((([,e,r])=>{var i;const s=parseInt((null==(i=r.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10),o=n[s];o&&(t[e]=o.slice(1,-1))}));const 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();if(o){o.split(/\s+/).filter(Boolean).forEach((e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}))}return t}function ioe(e){if(!e||0===Object.keys(e).length)return"";const t=[];if(e.class){String(e.class).split(/\s+/).filter(Boolean).forEach((e=>t.push(`.${e}`)))}return e.id&&t.push(`#${e.id}`),Object.entries(e).forEach((([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))})),t.join(" ")}function soe(e){const{nodeName:t,name:n,parseAttributes:r=roe,serializeAttributes:i=ioe,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=e,l=n||t;return{parseMarkdown:(e,n)=>{const r={...s,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,i){const s=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(s);if(!a)return;const c=a[1]||"",d=r(c),h=o.find((e=>!(e in d)));return h?void 0:{type:t,raw:a[0],attributes:d}}},renderMarkdown:e=>{const t=(e=>{if(!a)return e;const t={};return a.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),n=i(t);return`:::${l}${n?` {${n}}`:""} :::`}}}function ooe(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=roe,serializeAttributes:s=ioe,defaultAttributes:o={},content:a="block",allowedAttributes:l}=e,c=n||t;return{parseMarkdown:(e,n)=>{let i;if(r){const t=r(e);i="string"==typeof t?[{type:"text",text:t}]:t}else i="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const s={...o,...e.attributes};return n.createNode(t,s,i)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var s;const o=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(o);if(!l)return;const[d,h=""]=l,u=i(h);let p=1;const f=d.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(y);if(null===n)break;const i=n.index,o=n[1];if(!(null==(s=n[2])?void 0:s.endsWith(":::")))if(o)p+=1;else if(p-=1,0===p){const s=y.slice(0,i);m=s.trim();const o=e.slice(0,f+i+n[0].length);let l=[];if(m)if("block"===a)for(l=r.blockTokens(s),l.forEach((e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))}));l.length>0;){const e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(m);return{type:t,raw:o,attributes:u,content:m,tokens:l}}}}},renderMarkdown:(e,t)=>{const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),r=s(n),i=r?` {${r}}`:"",o=t.renderChildren(e.content||[],"\n\n");return`:::${c}${i}\n\n${o}\n\n:::`}}}function aoe(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,i,s,o]=r;t[i]=s||o,r=n.exec(e)}return t}function loe(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}="${t}"`)).join(" ")}function coe(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=aoe,serializeAttributes:s=loe,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const i={...o,...e.attributes};if(a)return n.createNode(t,i);const s=r?r(e):e.content||"";return s?n.createNode(t,i,[n.createTextNode(s)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const s=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(s);if(!o)return;let l="",c="";if(a){const[,e]=o;c=e}else{const[,e,t]=o;c=e,l=t||""}const h=i(c.trim());return{type:t,raw:o[0],content:l.trim(),attributes:h}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter((e=>"text"===e.type)).map((e=>e.text)).join(""));const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),i=s(n),o=i?` ${i}`:"";return a?`[${c}${o}]`:`[${c}${o}]${t}[/${c}]`}}}function doe(e,t,n){var r,i,s,o;const a=e.split("\n"),l=[];let c="",d=0;const h=t.baseIndentSize||2;for(;d<a.length;){const e=a[d],u=e.match(t.itemPattern);if(!u){if(l.length>0)break;if(""===e.trim()){d+=1;continue}return}const p=t.extractItemData(u),{indentLevel:f,mainContent:m}=p;c=`${c}${e}\n`;const g=[m];for(d+=1;d<a.length;){const e=a[d];if(""===e.trim()){const t=a.slice(d+1).findIndex((e=>""!==e.trim()));if(-1===t)break;if(((null==(i=null==(r=a[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>f){g.push(e),c=`${c}${e}\n`,d+=1;continue}break}if(!(((null==(o=null==(s=e.match(/^(\s*)/))?void 0:s[1])?void 0:o.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,d+=1}let y;const v=g.slice(1);if(v.length>0){const e=v.map((e=>e.slice(f+h))).join("\n");e.trim()&&(y=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const b=t.createToken(p,y);l.push(b)}if(0!==l.length)return{items:l,raw:c.trim()}}function hoe(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i="function"==typeof n?n(r):n,[s,...o]=e.content,a=[`${i}${t.renderChildren([s])}`];return o&&o.length>0&&o.forEach((e=>{const n=t.renderChildren([e]);if(n){const e=n.split("\n").map((e=>e?t.indent(e):"")).join("\n");a.push(e)}})),a.join("\n")}function uoe(e,t,n={}){const{state:r}=t,{doc:i,tr:s}=r,o=e;i.descendants(((t,r)=>{const i=s.mapping.map(r),a=s.mapping.map(r)+t.nodeSize;let l=null;if(t.marks.forEach((e=>{if(e!==o)return!1;l=e})),!l)return;let c=!1;if(Object.keys(n).forEach((e=>{n[e]!==l.attrs[e]&&(c=!0)})),c){const t=e.type.create({...e.attrs,...n});s.removeMark(i,a,e.type),s.addMark(i,a,t)}})),s.docChanged&&t.view.dispatch(s)}Are({},{createAtomBlockMarkdownSpec:()=>soe,createBlockMarkdownSpec:()=>ooe,createInlineMarkdownSpec:()=>coe,parseAttributes:()=>roe,parseIndentedBlocks:()=>doe,renderNestedMarkdownContent:()=>hoe,serializeAttributes:()=>ioe});var poe=class e extends Bse{constructor(){super(...arguments),this.type="node"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}}.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),foe=poe;function moe(e={}){return new y5({view:t=>new goe(t,e)})}class goe{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?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){null!=this.cursorPos&&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,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,i=r.getBoundingClientRect(),s=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let i=t.getBoundingClientRect(),s=n?i.bottom:i.top;n&&r&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*o;e={left:i.left,right:i.right,top:s-a,bottom:s+a}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*s;e={left:t.left-n,right:t.left+n,top:t.top,bottom:t.bottom}}let a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{let e=c.getBoundingClientRect(),t=e.width/c.offsetWidth,n=e.height/c.offsetHeight;a=e.left-c.scrollLeft*t,l=e.top-c.scrollTop*n}this.element.style.left=(e.left-a)/s+"px",this.element.style.top=(e.top-l)/o+"px",this.element.style.width=(e.right-e.left)/s+"px",this.element.style.height=(e.bottom-e.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="function"==typeof r?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=D2(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(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)}}class yoe extends J2{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return yoe.valid(n)?new yoe(n):J2.near(n)}content(){return o1.empty}eq(e){return e instanceof yoe&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new yoe(e.resolve(t.pos))}getBookmark(){return new voe(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&yoe.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let s=e.node(n);if(t>0?e.indexAfter(n)<s.childCount:e.index(n)>0){i=s.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let o=e.doc.resolve(r);if(yoe.valid(o))return o}for(;;){let s=t>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!i5.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue e}break}i=s,r+=t;let o=e.doc.resolve(r);if(yoe.valid(o))return o}return null}}}yoe.prototype.visible=!1,yoe.findFrom=yoe.findGapCursorFrom,J2.jsonID("gapcursor",yoe);class voe{constructor(e){this.pos=e}map(e){return new voe(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return yoe.valid(t)?new yoe(t):J2.near(t)}}function boe(){return new y5({props:{decorations:Soe,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&yoe.valid(n)?new yoe(n):null,handleClick:Eoe,handleKeyDown:woe,handleDOMEvents:{beforeinput:Coe}}})}const woe=R7({ArrowLeft:xoe("horiz",-1),ArrowRight:xoe("horiz",1),ArrowUp:xoe("vert",-1),ArrowDown:xoe("vert",1)});function xoe(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let s=e.selection,o=t>0?s.$to:s.$from,a=s.empty;if(s instanceof n5){if(!i.endOfTextblock(n)||0==o.depth)return!1;a=!1,o=e.doc.resolve(t>0?o.after():o.before())}let l=yoe.findGapCursorFrom(o,t,a);return!!l&&(r&&r(e.tr.setSelection(new yoe(l))),!0)}}function Eoe(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!yoe.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&i5.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new yoe(r))),!0)}function Coe(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof yoe))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=e1.empty;for(let e=r.length-1;e>=0;e--)i=e1.from(r[e].createAndFill(null,i));let s=e.state.tr.replace(n.pos,n.pos,new o1(i,0,0));return s.setSelection(n5.near(s.doc.resolve(n.pos+1))),e.dispatch(s),!1}function Soe(e){if(!(e.selection instanceof yoe))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",U6.create(e.doc,[V6.widget(e.selection.head,t,{key:"gapcursor"})])}var _oe=200,koe=function(){};koe.prototype.append=function(e){return e.length?(e=koe.from(e),!this.length&&e||e.length<_oe&&this.leafAppend(e)||this.length<_oe&&e.leafPrepend(this)||this.appendInner(e)):this},koe.prototype.prepend=function(e){return e.length?koe.from(e).append(this):this},koe.prototype.appendInner=function(e){return new Toe(this,e)},koe.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?koe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},koe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},koe.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},koe.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},koe.from=function(e){return e instanceof koe?e:e&&e.length?new Ooe(e):koe.empty};var Ooe=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 0==e&&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(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=_oe)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=_oe)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}(koe);koe.empty=new Ooe([]);var Toe=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;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&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}(koe);const Poe=koe;class Ioe{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let s,o,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new Moe(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new Moe(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(s=n?e.selection.map(n.slice(r)):e.selection,o=new Ioe(this.items.slice(0,i).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:o,transform:a,selection:s}}addTransform(e,t,n,r){let i=[],s=this.eventCount,o=this.items,a=!r&&o.length?o.get(o.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),d=new Moe(e.mapping.maps[n],c,t);(l=a&&a.merge(d))&&(d=l,n?i.pop():o=o.slice(0,o.length-1)),i.push(d),t&&(s++,t=void 0),r||(a=d)}let l=s-n.depth;return l>Aoe&&(o=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(o,l),s-=l),new Ioe(o.append(i),s)}remapping(e,t){let n=new u2;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new Ioe(this.items.append(e.map((e=>new Moe(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,s=e.steps.length,o=this.eventCount;this.items.forEach((e=>{e.selection&&o--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;s=Math.min(s,r);let l=i.maps[r];if(t.step){let s=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&o++,n.push(new Moe(l,s,c))}else n.push(new Moe(l))}),r);let l=[];for(let e=t;e<s;e++)l.push(new Moe(i.maps[e]));let c=this.items.slice(0,r).append(l).append(n),d=new Ioe(c,o);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((s,o)=>{if(o>=e)r.push(s),s.selection&&i++;else if(s.step){let e=s.step.map(t.slice(n)),o=e&&e.getMap();if(n--,o&&t.appendMap(o,n),e){let a=s.selection&&s.selection.map(t.slice(n));a&&i++;let l,c=new Moe(o.invert(),e,a),d=r.length-1;(l=r.length&&r[d].merge(c))?r[d]=l:r.push(c)}}else s.map&&n--}),this.items.length,0),new Ioe(Poe.from(r.reverse()),i)}}Ioe.empty=new Ioe(Poe.empty,0);class Moe{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Moe(t.getMap().invert(),t,this.selection)}}}class Roe{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const Aoe=20;function Noe(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,i)=>t.push(r,i)));return t}function Doe(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),s=t.map(e[r+1],-1);i<=s&&n.push(i,s)}return n}let Loe=!1,Foe=null;function joe(e){let t=e.plugins;if(Foe!=t){Loe=!1,Foe=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Loe=!0;break}}return Loe}const $oe=new w5("history"),Boe=new w5("closeHistory");function Voe(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new y5({key:$oe,state:{init:()=>new Roe(Ioe.empty,Ioe.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let i,s=n.getMeta($oe);if(s)return s.historyState;n.getMeta(Boe)&&(e=new Roe(e.done,e.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(o&&o.getMeta($oe))return o.getMeta($oe).redo?new Roe(e.done.addTransform(n,void 0,r,joe(t)),e.undone,Noe(n.mapping.maps),e.prevTime,e.prevComposition):new Roe(e.done,e.undone.addTransform(n,void 0,r,joe(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new Roe(e.done.rebased(n,i),e.undone.rebased(n,i),Doe(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Roe(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Doe(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),s=0==e.prevTime||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(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}(n,e.prevRanges)),a=o?Doe(e.prevRanges,n.mapping):Noe(n.mapping.maps);return new Roe(e.done.addTransform(n,s?t.selection.getBookmark():void 0,r,joe(t)),Ioe.empty,a,n.time,null==i?e.prevComposition:i)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Hoe:"historyRedo"==n?Uoe:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function zoe(e,t){return(n,r)=>{let i=$oe.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let s=function(e,t,n){let r=joe(t),i=$oe.get(t).spec.config,s=(n?e.undone:e.done).popEvent(t,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,r),l=new Roe(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta($oe,{redo:n,historyState:l})}(i,n,e);s&&r(t?s.scrollIntoView():s)}return!0}}const Hoe=zoe(!1,!0),Uoe=zoe(!0,!0);zoe(!1,!1),zoe(!0,!1);J9.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter((e=>""!==e)).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){const e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new y5({key:new w5("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const i=this.options.limit;if(null==i||0===i)return void(e=!0);const s=this.storage.characters({node:r.doc});if(s>i){const t=0,n=s-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const o=r.tr.deleteRange(t,n);return e=!0,o}e=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n)return!0;if(r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r)return!1;if(!e.getMeta("paste"))return!1;const s=e.selection.$head.pos,o=s-(i-n),a=s;e.deleteRange(o,a);return!(this.storage.characters({node:e.doc})>n)}})]}}),J9.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[moe(this.options)]}}),J9.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new y5({key:new w5("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,s=[];if(!n||!r)return U6.create(e,[]);let o=0;"deepest"===this.options.mode&&e.descendants(((e,t)=>{if(e.isText)return;if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}));let a=0;return e.descendants(((e,t)=>{if(e.isText)return!1;if(!(i>=t&&i<=t+e.nodeSize-1))return!1;a+=1;if("deepest"===this.options.mode&&o-a>0||"shallowest"===this.options.mode&&a>1)return"deepest"===this.options.mode;s.push(V6.node(t,t+e.nodeSize,{class:this.options.className}))})),U6.create(e,s)}}})]}}),J9.create({name:"gapCursor",addProseMirrorPlugins:()=>[boe()],extendNodeSchema(e){var t;return{allowGapCursor:null!=(t=Y8(W8(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))?t:null}}});var Koe=J9.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new y5({key:new w5("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const s=this.editor.isEmpty;return e.descendants(((e,t)=>{const n=r>=t&&r<=t+e.nodeSize,o=!e.isLeaf&&v9(e);if((n||!this.options.showOnlyCurrent)&&o){const r=[this.options.emptyNodeClass];s&&r.push(this.options.emptyEditorClass);const o=V6.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});i.push(o)}return this.options.includeChildren})),U6.create(e,i)}}})]}});J9.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new y5({key:new w5("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||n.selection instanceof i5||e.view.dragging?null:U6.create(n.doc,[V6.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});function Woe({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}J9.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;const t=new w5(this.name),n=(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||this.options.node||"paragraph",r=Object.entries(this.editor.schema.nodes).map((([,e])=>e)).filter((e=>(this.options.notAfter||[]).concat(n).includes(e.name)));return[new y5({key:t,appendTransaction:(e,r,i)=>{const{doc:s,tr:o,schema:a}=i,l=t.getState(i),c=s.content.size,d=a.nodes[n];if(l)return o.insert(c,d.create())},state:{init:(e,t)=>!Woe({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>{if(!e.docChanged)return t;if(e.getMeta("__uniqueIDTransaction"))return t;return!Woe({node:e.doc.lastChild,types:r})}}})]}});var Goe=J9.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Hoe(e,t),redo:()=>({state:e,dispatch:t})=>Uoe(e,t)}),addProseMirrorPlugins(){return[Voe(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()}}}),qoe=Object.defineProperty,Xoe=(e,t)=>{for(var n in t)qoe(e,n,{get:t[n],enumerable:!0})};function Yoe(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=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 s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var Zoe=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(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(s);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],a=!!e,l=e||i.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return o.push(i),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(l),o.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...s,dispatch:void 0})]))),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:e,editor:r,view:s,state:Yoe({state:i,transaction:e}),dispatch:t?()=>{}: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}},Joe={};Xoe(Joe,{blur:()=>Qoe,clearContent:()=>eae,clearNodes:()=>tae,command:()=>nae,createParagraphNear:()=>rae,cut:()=>iae,deleteCurrentNode:()=>sae,deleteNode:()=>aae,deleteRange:()=>lae,deleteSelection:()=>cae,enter:()=>dae,exitCode:()=>hae,extendMarkRange:()=>vae,first:()=>bae,focus:()=>_ae,forEach:()=>kae,insertContent:()=>Oae,insertContentAt:()=>Mae,joinBackward:()=>Nae,joinDown:()=>Aae,joinForward:()=>Dae,joinItemBackward:()=>Lae,joinItemForward:()=>Fae,joinTextblockBackward:()=>jae,joinTextblockForward:()=>$ae,joinUp:()=>Rae,keyboardShortcut:()=>Vae,lift:()=>Hae,liftEmptyBlock:()=>Uae,liftListItem:()=>Kae,newlineInCode:()=>Wae,resetAttributes:()=>Xae,scrollIntoView:()=>Yae,selectAll:()=>Zae,selectNodeBackward:()=>Jae,selectNodeForward:()=>Qae,selectParentNode:()=>ele,selectTextblockEnd:()=>tle,selectTextblockStart:()=>nle,setContent:()=>ile,setMark:()=>Rle,setMeta:()=>Ale,setNode:()=>Nle,setNodeSelection:()=>Dle,setTextSelection:()=>Lle,sinkListItem:()=>Fle,splitBlock:()=>$le,splitListItem:()=>Ble,toggleList:()=>Hle,toggleMark:()=>Ule,toggleNode:()=>Kle,toggleWrap:()=>Wle,undoInputRule:()=>Gle,unsetAllMarks:()=>qle,unsetMark:()=>Xle,updateAttributes:()=>Yle,wrapIn:()=>Zle,wrapInList:()=>Jle});var Qoe=()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())})),!0),eae=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),tae=()=>({state:e,tr:t,dispatch:n})=>{const{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;const{doc:r,mapping:i}=t,s=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),a=s.blockRange(o);if(!a)return;const l=k2(a);if(e.type.isTextblock){const{defaultType:e}=s.parent.contentMatchAt(s.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},nae=e=>t=>e(t),rae=()=>({state:e,dispatch:t})=>B5(e,t),iae=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const o=r.mapping.map(t);return r.insert(o,s.content),r.setSelection(new n5(r.doc.resolve(Math.max(o-1,0)))),!0},sae=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1){if(i.node(n).type===r.type){if(t){const t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}}return!1};function oae(e,t){if("string"==typeof e){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 aae=e=>({tr:t,state:n,dispatch:r})=>{const i=oae(e,n.schema),s=t.selection.$anchor;for(let e=s.depth;e>0;e-=1){if(s.node(e).type===i){if(r){const n=s.before(e),r=s.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},lae=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},cae=()=>({state:e,dispatch:t})=>x5(e,t),dae=()=>({commands:e})=>e.keyboardShortcut("Enter"),hae=()=>({state:e,dispatch:t})=>$5(e,t);function uae(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function pae(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:uae(t[r])?t[r].test(e[r]):t[r]===e[r]))}function fae(e,t,n={}){return e.find((e=>e.type===t&&pae(Object.fromEntries(Object.keys(n).map((t=>[t,e.attrs[t]]))),n)))}function mae(e,t,n={}){return!!fae(e,t,n)}function gae(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some((e=>e.type===t))||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some((e=>e.type===t)))return;n=n||(null==(r=i.node.marks[0])?void 0:r.attrs);if(!fae([...i.node.marks],t,n))return;let s=i.index,o=e.start()+i.offset,a=s+1,l=o+i.node.nodeSize;for(;s>0&&mae([...e.parent.child(s-1).marks],t,n);)s-=1,o-=e.parent.child(s).nodeSize;for(;a<e.parent.childCount&&mae([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function yae(e,t){if("string"==typeof e){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 vae=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const s=yae(e,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){const e=gae(l,s,t);if(e&&e.from<=c&&e.to>=d){const t=n5.create(o,e.from,e.to);n.setSelection(t)}}return!0},bae=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function wae(e){return e instanceof n5}function xae(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Eae(e,t=null){if(!t)return null;const n=J2.atStart(e),r=J2.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,s=r.to;return"all"===t?n5.create(e,xae(0,i,s),xae(e.content.size,i,s)):n5.create(e,xae(t,i,s),xae(t,i,s))}function Cae(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function Sae(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var _ae=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const o=()=>{(Sae()||Cae())&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(s&&null===e&&!wae(n.state.selection))return o(),!0;const a=Eae(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},kae=(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),Oae=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Tae=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&Tae(r)}return e};function Pae(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return Tae(n)}function Iae(e,t,n){if(e instanceof S1||e instanceof e1)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return e1.fromArray(e.map((e=>t.nodeFromJSON(e))));const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Iae("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,i="";const s=new H1({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="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?K1.fromSchema(s).parseSlice(Pae(e),n.parseOptions):K1.fromSchema(s).parse(Pae(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${i}`)})}const r=K1.fromSchema(t);return n.slice?r.parseSlice(Pae(e),n.parseOptions).content:r.parse(Pae(e),n.parseOptions)}return Iae("",t,n)}var Mae=(e,t,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){let i;const a=e=>{s.emit("contentError",{editor:s,error:e,disableCollaboration:()=>{"collaboration"in s.storage&&"object"==typeof s.storage.collaboration&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},l={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Iae(t,s.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(e){a(e)}try{i=Iae(t,s.schema,{parseOptions:l,errorOnInvalidContent:null!=(o=n.errorOnInvalidContent)?o:s.options.enableContentCheck})}catch(e){return a(e),!1}let{from:c,to:d}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},h=!0,u=!0;if(("type"in i?[i]:i).forEach((e=>{e.check(),h=!!h&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),c===d&&u){const{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(c-=1,d+=1)}let p;if(h){if(Array.isArray(t))p=t.map((e=>e.text||"")).join("");else if(t instanceof e1){let e="";t.forEach((t=>{t.text&&(e+=t.text)})),p=e}else p="object"==typeof t&&t&&t.text?t.text:t;r.insertText(p,c,d)}else{p=i;const e=r.doc.resolve(c),t=e.node(),n=0===e.parentOffset,s=t.isText||t.isTextblock,o=t.content.size>0;n&&s&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,d,p)}n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof x2||i instanceof E2))return;const s=e.mapping.maps[r];let o=0;s.forEach(((e,t,n,r)=>{0===o&&(o=r)})),e.setSelection(J2.near(e.doc.resolve(o),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},Rae=()=>({state:e,dispatch:t})=>N5(e,t),Aae=()=>({state:e,dispatch:t})=>D5(e,t),Nae=()=>({state:e,dispatch:t})=>C5(e,t),Dae=()=>({state:e,dispatch:t})=>M5(e,t),Lae=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Fae=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},jae=()=>({state:e,dispatch:t})=>S5(e,t),$ae=()=>({state:e,dispatch:t})=>_5(e,t);function Bae(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var Vae=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const s=function(e){const t=e.split(/-(?!$)/);let n,r,i,s,o=t[t.length-1];"Space"===o&&(o=" ");for(let e=0;e<t.length-1;e+=1){const o=t[e];if(/^(cmd|meta|m)$/i.test(o))s=!0;else if(/^a(lt)?$/i.test(o))n=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))i=!0;else{if(!/^mod$/i.test(o))throw new Error(`Unrecognized modifier name: ${o}`);Sae()||Bae()?s=!0:r=!0}}return n&&(o=`Alt-${o}`),r&&(o=`Ctrl-${o}`),s&&(o=`Meta-${o}`),i&&(o=`Shift-${o}`),o}(e).split(/-(?!$)/),o=s.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===o?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0};function zae(e,t,n={}){const{from:r,to:i,empty:s}=e.selection,o=t?oae(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:s})}));const l=i-r,c=a.filter((e=>!o||o.name===e.node.type.name)).filter((e=>pae(e.node.attrs,n,{strict:!1})));if(s)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}var Hae=(e,t={})=>({state:n,dispatch:r})=>!!zae(n,oae(e,n.schema),t)&&L5(n,r),Uae=()=>({state:e,dispatch:t})=>V5(e,t),Kae=e=>({state:t,dispatch:n})=>r3(oae(e,t.schema))(t,n),Wae=()=>({state:e,dispatch:t})=>F5(e,t);function Gae(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function qae(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}var Xae=(e,t)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Gae("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(s=oae(e,r.schema)),"mark"===a&&(o=yae(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{s&&s===e.type&&n.setNodeMarkup(r,void 0,qae(e.attrs,t)),o&&e.marks.length&&e.marks.forEach((i=>{o===i.type&&n.addMark(r,r+e.nodeSize,o.create(qae(i.attrs,t)))}))}))})),!0)},Yae=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Zae=()=>({tr:e,dispatch:t})=>{if(t){const t=new o5(e.doc);e.setSelection(t)}return!0},Jae=()=>({state:e,dispatch:t})=>T5(e,t),Qae=()=>({state:e,dispatch:t})=>R5(e,t),ele=()=>({state:e,dispatch:t})=>U5(e,t),tle=()=>({state:e,dispatch:t})=>q5(e,t),nle=()=>({state:e,dispatch:t})=>G5(e,t);function rle(e,t,n={},r={}){return Iae(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var ile=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if("full"!==r.preserveWhitespace){const a=rle(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function sle(e,t){const n=yae(t,e.schema),{from:r,to:i,empty:s}=e.selection,o=[];s?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{o.push(...e.marks)}));const a=o.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function ole(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function ale(e,t,n){if(void 0===e.config[t]&&e.parent)return ale(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?ale(e.parent,t,n):null})}return e.config[t]}function lle(e){return e.map((e=>{const t=ale(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...lle(t())]:e})).flat(10)}function cle(e,t){const n=t2.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function dle(e){return"function"==typeof e}function hle(e,t=void 0,...n){return dle(e)?t?e.bind(t)(...n):e(...n):e}function ule(e){const t=e.filter((e=>"extension"===e.type)),n=e.filter((e=>"node"===e.type)),r=e.filter((e=>"mark"===e.type));return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function ple(e){const t=[],{nodeExtensions:n,markExtensions:r}=ule(e),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=ale(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:i});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...s,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=ale(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...s,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&void 0===(null==i?void 0:i.default)&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function fle(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],s=r.filter((e=>!i.includes(e)));n[e]=[...i,...s].join(" ")}else if("style"===e){const r=t?t.split(";").map((e=>e.trim())).filter(Boolean):[],i=n[e]?n[e].split(";").map((e=>e.trim())).filter(Boolean):[],s=new Map;i.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),r.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),n[e]=Array.from(s.entries()).map((([e,t])=>`${e}: ${t}`)).join("; ")}else n[e]=t;else n[e]=t})),n}),{})}function mle(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)=>fle(e,t)),{})}function gle(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function yle(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function vle(e){var t,n,r;const i={};return(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)||void 0===(null==(n=null==e?void 0:e.attribute)?void 0:n.default)||(i.default=e.attribute.default),void 0!==(null==(r=null==e?void 0:e.attribute)?void 0:r.validate)&&(i.validate=e.attribute.validate),[e.name,i]}function ble(e,t){var n;const r=ple(e),{nodeExtensions:i,markExtensions:s}=ule(e),o=null==(n=i.find((e=>ale(e,"topNode"))))?void 0:n.name,a=Object.fromEntries(i.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=ale(t,"extendNodeSchema",s);return{...e,...r?r(n):{}}}),{}),a=yle({...o,content:hle(ale(n,"content",s)),marks:hle(ale(n,"marks",s)),group:hle(ale(n,"group",s)),inline:hle(ale(n,"inline",s)),atom:hle(ale(n,"atom",s)),selectable:hle(ale(n,"selectable",s)),draggable:hle(ale(n,"draggable",s)),code:hle(ale(n,"code",s)),whitespace:hle(ale(n,"whitespace",s)),linebreakReplacement:hle(ale(n,"linebreakReplacement",s)),defining:hle(ale(n,"defining",s)),isolating:hle(ale(n,"isolating",s)),attrs:Object.fromEntries(i.map(vle))}),l=hle(ale(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>gle(e,i))));const c=ale(n,"renderHTML",s);c&&(a.toDOM=e=>c({node:e,HTMLAttributes:mle(e,i)}));const d=ale(n,"renderText",s);return d&&(a.toText=d),[n.name,a]}))),l=Object.fromEntries(s.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=ale(t,"extendMarkSchema",s);return{...e,...r?r(n):{}}}),{}),a=yle({...o,inclusive:hle(ale(n,"inclusive",s)),excludes:hle(ale(n,"excludes",s)),group:hle(ale(n,"group",s)),spanning:hle(ale(n,"spanning",s)),code:hle(ale(n,"code",s)),attrs:Object.fromEntries(i.map(vle))}),l=hle(ale(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>gle(e,i))));const c=ale(n,"renderHTML",s);return c&&(a.toDOM=e=>c({mark:e,HTMLAttributes:mle(e,i)})),[n.name,a]})));return new H1({topNode:o,nodes:a,marks:l})}function wle(e){return e.sort(((e,t)=>{const n=ale(e,"priority")||100,r=ale(t,"priority")||100;return n>r?-1:n<r?1:0}))}function xle(e){const t=wle(lle(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return Array.from(new Set(t))}(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 Ele(e,t,n){const{from:r,to:i}=t,{blockSeparator:s="\n\n",textSerializers:o={}}=n||{};let a="";return e.nodesBetween(r,i,((e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=s);const h=null==o?void 0:o[e.type.name];if(h)return l&&(a+=h({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,i-n))})),a}function Cle(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}function Sle(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.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 _le(e,t){return t.nodes[e]||t.marks[e]||null}function kle(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}var Ole=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,i,s)=>{var o,a;const l=(null==(a=(o=e.type.spec).toText)?void 0:a.call(o,{node:e,pos:t,parent:i,index:s}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))})),n};function Tle(e,t,n={}){const{empty:r,ranges:i}=e.selection,s=t?yae(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!s||s.name===e.type.name)).find((e=>pae(e.attrs,n,{strict:!1})));let o=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);o+=s-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:s}))))}))})),0===o)return!1;const l=a.filter((e=>!s||s.name===e.mark.type.name)).filter((e=>pae(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!s||e.mark.type!==s&&e.mark.type.excludes(s))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=o}function Ple(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Ile(e,t){const{nodeExtensions:n}=ule(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=hle(ale(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function Mle(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach((e=>{!1!==r&&(Mle(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))})),r}return!1}var Rle=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=yae(e,r.schema);if(i)if(o){const e=sle(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,s=e.$to.pos;r.doc.nodesBetween(i,s,((e,r)=>{const o=Math.max(r,i),a=Math.min(r+e.nodeSize,s),c=e.marks.find((e=>e.type===l));c?e.marks.forEach((e=>{l===e.type&&n.addMark(o,a,l.create({...e.attrs,...t}))})):n.addMark(o,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:i}=t;let s=null;if(wae(i)&&(s=i.$cursor),s){const t=null!=(r=e.storedMarks)?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some((e=>e.type.excludes(n))))}const{ranges:o}=i;return o.some((({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(i)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),s=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));i=t&&s}return!i})),i}))}(r,n,l)},Ale=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Nle=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const s=oae(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command((({commands:e})=>!!Y5(s,{...o,...t})(n)||e.clearNodes())).command((({state:e})=>Y5(s,{...o,...t})(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Dle=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=xae(e,0,n.content.size),i=i5.create(n,r);t.setSelection(i)}return!0},Lle=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,s=n5.atStart(n).from,o=n5.atEnd(n).to,a=xae(r,s,o),l=xae(i,s,o),c=n5.create(n,a,l);t.setSelection(c)}return!0},Fle=e=>({state:t,dispatch:n})=>i3(oae(e,t.schema))(t,n);function jle(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}var $le=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=t,{$from:a,$to:l}=s,c=kle(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(s instanceof i5&&s.node.isBlock)return!(!a.parentOffset||!M2(o,a.pos))&&(r&&(e&&jle(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=d&&h?[{type:h,attrs:c}]:void 0,p=M2(t.doc,t.mapping.map(a.pos),1,u);if(u||p||!M2(t.doc,t.mapping.map(a.pos),1,h?[{type:h}]:void 0)||(p=!0,u=h?[{type:h,attrs:c}]:void 0),r){if(p&&(s instanceof n5&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,u),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(a.before()),h)}e&&jle(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},Ble=(e,t={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=oae(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const h=l.node(-1);if(h.type!==a)return!1;const u=s.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let e=e1.empty;const r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=e1.from(l.node(t).copy(e));const i=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,s={...kle(u,l.node().type.name,l.node().attrs),...t},c=(null==(o=a.contentMatch.defaultType)?void 0:o.createAndFill(s))||void 0;e=e.append(e1.from(a.createAndFill(null,c)||void 0));const d=l.before(l.depth-(r-1));n.replace(d,l.after(-i),new o1(e,4-r,0));let h=-1;n.doc.nodesBetween(d,n.doc.content.size,((e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)})),h>-1&&n.setSelection(n5.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...kle(u,h.type.name,h.attrs),...t},m={...kle(u,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!M2(n.doc,l.pos,2))return!1;if(i){const{selection:e,storedMarks:t}=r,{splittableMarks:o}=s.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!i)return!0;const c=a.filter((e=>o.includes(e.type.name)));n.ensureMarks(c)}return!0},Vle=(e,t)=>{const n=ole((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,n.pos)||(e.join(n.pos),!0)},zle=(e,t)=>{const n=ole((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,r)||(e.join(r),!0)},Hle=(e,t,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:h,splittableMarks:u}=i.extensionManager,p=oae(e,o.schema),f=oae(t,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:v}=m,b=y.blockRange(v),w=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const x=ole((e=>Ile(e.type.name,h)))(m);if(b.depth>=1&&x&&b.depth-x.depth<=1){if(x.node.type===p)return c.liftListItem(f);if(Ile(x.node.type.name,h)&&p.validContent(x.node.content)&&a)return l().command((()=>(s.setNodeMarkup(x.pos,p),!0))).command((()=>Vle(s,p))).command((()=>zle(s,p))).run()}return n&&w&&a?l().command((()=>{const e=d().wrapInList(p,r),t=w.filter((e=>u.includes(e.type.name)));return s.ensureMarks(t),!!e||c.clearNodes()})).wrapInList(p,r).command((()=>Vle(s,p))).command((()=>zle(s,p))).run():l().command((()=>!!d().wrapInList(p,r)||c.clearNodes())).wrapInList(p,r).command((()=>Vle(s,p))).command((()=>zle(s,p))).run()},Ule=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=yae(e,r.schema);return Tle(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,t)},Kle=(e,t,n={})=>({state:r,commands:i})=>{const s=oae(e,r.schema),o=oae(t,r.schema),a=zae(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},Wle=(e,t={})=>({state:n,commands:r})=>{const i=oae(e,n.schema);return zae(n,i,t)?r.lift(i):r.wrapIn(i,t)},Gle=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){const t=e.tr,n=s.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(s.text){const n=t.doc.resolve(s.from).marks();t.replaceWith(s.from,s.to,e.schema.text(s.text,n))}else t.delete(s.from,s.to)}return!0}}return!1},qle=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},Xle=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=t,{selection:a}=n,l=yae(e,r.schema),{$from:c,empty:d,ranges:h}=a;if(!i)return!0;if(d&&o){let{from:e,to:t}=a;const r=null==(s=c.marks().find((e=>e.type===l)))?void 0:s.attrs,i=gae(c,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else h.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},Yle=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Gae("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(s=oae(e,r.schema)),"mark"===a&&(o=yae(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;let l,c,d,h;n.selection.empty?r.doc.nodesBetween(i,a,((e,t)=>{s&&s===e.type&&(d=Math.max(t,i),h=Math.min(t+e.nodeSize,a),l=t,c=e)})):r.doc.nodesBetween(i,a,((e,r)=>{r<i&&s&&s===e.type&&(d=Math.max(r,i),h=Math.min(r+e.nodeSize,a),l=r,c=e),r>=i&&r<=a&&(s&&s===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),o&&e.marks.length&&e.marks.forEach((s=>{if(o===s.type){const l=Math.max(r,i),c=Math.min(r+e.nodeSize,a);n.addMark(l,c,o.create({...s.attrs,...t}))}})))})),c&&(void 0!==l&&n.setNodeMarkup(l,void 0,{...c.attrs,...t}),o&&c.marks.length&&c.marks.forEach((e=>{o===e.type&&n.addMark(d,h,o.create({...e.attrs,...t}))})))})),!0)},Zle=(e,t={})=>({state:n,dispatch:r})=>X5(oae(e,n.schema),t)(n,r),Jle=(e,t={})=>({state:n,dispatch:r})=>n3(oae(e,n.schema),t)(n,r),Qle=(e,t)=>{if(uae(t))return t.exec(e);const n=t(e);if(!n)return null;const 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 ece(e){var t;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let d=!1;const h=Ole(c)+s;return o.forEach((e=>{if(d)return;const t=Qle(h,e.find);if(!t)return;const o=l.state.tr,c=Yoe({state:l.state,transaction:o}),u={from:r-(t[0].length-s.length),to:i},{commands:p,chain:f,can:m}=new Zoe({editor:n,state:c});null!==e.handler({state:c,range:u,match:t,commands:p,chain:f,can:m})&&o.steps.length&&(e.undoable&&o.setMeta(a,{transform:o,from:r,to:i,text:s}),l.dispatch(o),d=!0)})),d}function tce(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function nce(e,t){const n={...e};return tce(e)&&tce(t)&&Object.keys(t).forEach((r=>{tce(t[r])&&tce(e[r])?n[r]=nce(e[r],t[r]):n[r]=t[r]})),n}var rce=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{...hle(ale(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...hle(ale(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>nce(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const 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}},ice=class e extends rce{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const i=r.marks();if(!!!i.find((e=>(null==e?void 0:e.type.name)===t.name)))return!1;const s=i.find((e=>(null==e?void 0:e.type.name)===t.name));return s&&n.removeStoredMark(s),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};var sce=(e,t,n)=>{if(uae(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map((t=>{const 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})):[]};var oce=null;function ace(e){const{editor:t,rules:n}=e;let r,i=null,s=!1,o=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:e,from:n,to:i,rule:s,pasteEvt:o})=>{const l=e.tr,c=Yoe({state:e,transaction:l}),d=function(e){const{editor:t,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=e,{commands:l,chain:c,can:d}=new Zoe({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,((e,t)=>{var u,p,f,m,g;if((null==(p=null==(u=e.type)?void 0:u.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;const y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,v=Math.max(r,t),b=Math.min(i,t+y);if(v>=b)return;const w=e.isText?e.text||"":e.textBetween(v-t,b-t,void 0,"");sce(w,s.find,o).forEach((e=>{if(void 0===e.index)return;const t=v+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},u=s.handler({state:n,range:i,match:e,commands:l,chain:c,can:d,pasteEvent:o,dropEvent:a});h.push(u)}))})),h.every((e=>null!==e))}({editor:t,state:c,from:Math.max(n-1,0),to:i.b-1,rule:s,pasteEvent:o,dropEvent:r});if(d&&l.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}},c=n.map((e=>new y5({view(e){const n=n=>{var r;i=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,i&&(oce=t)},r=()=>{oce&&(oce=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(o=i===e.dom.parentElement,r=t,!o){const e=oce;(null==e?void 0:e.isEditable)&&setTimeout((()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})}),10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,s=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const i=t[0],c="paste"===i.getMeta("uiEvent")&&!s,d="drop"===i.getMeta("uiEvent")&&!o,h=i.getMeta("applyPasteRules"),u=!!h;if(!c&&!d&&!u)return;if(u){let{text:t}=h;"string"==typeof t||(t=cle(e1.from(t),r.schema));const{from:n}=h,i=n+t.length,s=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return l({rule:e,state:r,from:n,to:{b:i},pasteEvt:s})}const p=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof p&&f&&p!==f.b?l({rule:e,state:r,from:p,to:f,pasteEvt:a}):void 0}})));return c}var lce=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=xle(e),this.schema=ble(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce(((e,t)=>{const n=ale(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:_le(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=wle([...this.extensions].reverse()).flatMap((t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:_le(t.name,this.schema)},r=[],i=ale(t,"addKeyboardShortcuts",n);let s={};if("mark"===t.type&&ale(t,"exitable",n)&&(s.ArrowRight=()=>ice.handleExit({editor:e,mark:t})),i){const t=Object.fromEntries(Object.entries(i()).map((([t,n])=>[t,()=>n({editor:e})])));s={...s,...t}}const o=M7(s);r.push(o);const a=ale(t,"addInputRules",n);if(Ple(t,e.options.enableInputRules)&&a){const t=a();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new y5({state:{init:()=>null,apply(e,i,s){const o=e.getMeta(r);if(o)return o;const a=e.getMeta("applyInputRules");return!!a&&setTimeout((()=>{let{text:e}=a;"string"==typeof e||(e=cle(e1.from(e),s.schema));const{from:i}=a,o=i+e.length;ece({editor:t,from:i,to:o,text:e,rules:n,plugin:r})})),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,s,o)=>ece({editor:t,from:i,to:s,text:o,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&ece({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:s}=e.state.selection;return!!s&&ece({editor:t,from:s.pos,to:s.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}const l=ale(t,"addPasteRules",n);if(Ple(t,e.options.enablePasteRules)&&l){const t=l();if(t&&t.length){const n=ace({editor:e,rules:t});r.push(...n)}}const c=ale(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r}));return t}get attributes(){return ple(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=ule(this.extensions);return Object.fromEntries(t.filter((e=>!!ale(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:oae(t.name,this.schema)},i=ale(t,"addNodeView",r);if(!i)return[];const s=i();if(!s)return[];return[t.name,(r,i,o,a,l)=>{const c=mle(r,n);return s({node:r,view:i,getPos:o,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:c})}]})))}get markViews(){const{editor:e}=this,{markExtensions:t}=ule(this.extensions);return Object.fromEntries(t.filter((e=>!!ale(e,"addMarkView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:yae(t.name,this.schema)},i=ale(t,"addMarkView",r);if(!i)return[];return[t.name,(r,s,o)=>{const a=mle(r,n);return i()({mark:r,view:s,inline:o,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{Pce(r,e,t)}})}]})))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map((e=>[e.name,e.storage]))),e.forEach((e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:_le(e.name,this.schema)};if("mark"===e.type){(null==(t=hle(ale(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name)}const r=ale(e,"onBeforeCreate",n),i=ale(e,"onCreate",n),s=ale(e,"onUpdate",n),o=ale(e,"onSelectionUpdate",n),a=ale(e,"onTransaction",n),l=ale(e,"onFocus",n),c=ale(e,"onBlur",n),d=ale(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),s&&this.editor.on("update",s),o&&this.editor.on("selectionUpdate",o),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)}))}};lce.resolve=xle,lce.sort=wle,lce.flatten=lle;Xoe({},{ClipboardTextSerializer:()=>dce,Commands:()=>hce,Delete:()=>uce,Drop:()=>pce,Editable:()=>fce,FocusEvents:()=>gce,Keymap:()=>yce,Paste:()=>vce,Tabindex:()=>bce,focusEventsPluginKey:()=>mce});var cce=class e extends rce{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},dce=cce.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new y5({key:new w5("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:s}=i,o=Math.min(...s.map((e=>e.$from.pos))),a=Math.max(...s.map((e=>e.$to.pos))),l=Cle(n);return Ele(r,{from:o,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),hce=cce.create({name:"commands",addCommands:()=>({...Joe})}),uce=cce.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const s=()=>{var n,r,i,s;if(null!=(s=null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?s:e.getMeta("y-sync$"))return;const o=function(e,t){const n=new Y2(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(e.before,[e,...t]),a=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,i)=>{const s=[];if(e.ranges.length)e.forEach(((e,t)=>{s.push({from:e,to:t})}));else{const{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;s.push({from:e,to:t})}s.forEach((({from:e,to:n})=>{const s=t.slice(i).map(e,-1),o=t.slice(i).map(n),a=t.invert().map(s,-1),l=t.invert().map(o);r.push({oldRange:{from:a,to:l},newRange:{from:s,to:o}})}))})),Sle(r)}(o);a.forEach((t=>{o.mapping.mapResult(t.oldRange.from).deletedAfter&&o.mapping.mapResult(t.oldRange.to).deletedBefore&&o.before.nodesBetween(t.oldRange.from,t.oldRange.to,((n,r)=>{const i=r+n.nodeSize-2,s=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:o.mapping.map(r),newTo:o.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!s,editor:this.editor,transaction:e,combinedTransform:o})}))}));const l=o.mapping;o.steps.forEach(((t,n)=>{var r,i;if(t instanceof v2){const s=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),c=l.invert().map(s,-1),d=l.invert().map(a),h=null==(r=o.doc.nodeAt(s-1))?void 0:r.marks.some((e=>e.eq(t.mark))),u=null==(i=o.doc.nodeAt(a))?void 0:i.marks.some((e=>e.eq(t.mark)));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:s,to:a},partial:Boolean(u||h),editor:this.editor,transaction:e,combinedTransform:o})}}))};null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||i?setTimeout(s,0):s()}}),pce=cce.create({name:"drop",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),fce=cce.create({name:"editable",addProseMirrorPlugins(){return[new y5({key:new w5("editable"),props:{editable:()=>this.editor.options.editable}})]}}),mce=new w5("focusEvents"),gce=cce.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new y5({key:mce,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),yce=cce.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:s}=n,{pos:o,parent:a}=s,l=s.parent.isTextblock&&o>0?t.doc.resolve(o-1):s,c=l.parent.type.spec.isolating,d=s.pos-s.parentOffset,h=c&&1===l.parent.childCount?d===s.pos:J2.atStart(r).from===o;return!(!i||!a.type.isTextblock||a.textContent.length||!h||h&&"paragraph"===s.parent.type.name)&&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 Sae()||Bae()?i:r},addProseMirrorPlugins(){return[new y5({key:new w5("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some((e=>e.getMeta("composition"))))return;const r=e.some((e=>e.docChanged))&&!t.doc.eq(n.doc),i=e.some((e=>e.getMeta("preventClearDocument")));if(!r||i)return;const{empty:s,from:o,to:a}=t.selection,l=J2.atStart(t.doc).from,c=J2.atEnd(t.doc).to;if(s||!(o===l&&a===c))return;if(!Mle(n.doc))return;const d=n.tr,h=Yoe({state:n,transaction:d}),{commands:u}=new Zoe({editor:this.editor,state:h});return u.clearNodes(),d.steps.length?d:void 0}})]}}),vce=cce.create({name:"paste",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),bce=cce.create({name:"tabindex",addProseMirrorPlugins(){return[new y5({key:new w5("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function wce(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,(e=>(n.push(e),`__QUOTED_${n.length-1}__`))),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const e=i.map((e=>e.trim().slice(1)));t.class=e.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(t.id=s[1]);Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach((([,e,r])=>{var i;const s=parseInt((null==(i=r.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10),o=n[s];o&&(t[e]=o.slice(1,-1))}));const 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();if(o){o.split(/\s+/).filter(Boolean).forEach((e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}))}return t}function xce(e){if(!e||0===Object.keys(e).length)return"";const t=[];if(e.class){String(e.class).split(/\s+/).filter(Boolean).forEach((e=>t.push(`.${e}`)))}return e.id&&t.push(`#${e.id}`),Object.entries(e).forEach((([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))})),t.join(" ")}function Ece(e){const{nodeName:t,name:n,parseAttributes:r=wce,serializeAttributes:i=xce,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=e,l=n||t;return{parseMarkdown:(e,n)=>{const r={...s,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,i){const s=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(s);if(!a)return;const c=a[1]||"",d=r(c),h=o.find((e=>!(e in d)));return h?void 0:{type:t,raw:a[0],attributes:d}}},renderMarkdown:e=>{const t=(e=>{if(!a)return e;const t={};return a.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),n=i(t);return`:::${l}${n?` {${n}}`:""} :::`}}}function Cce(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=wce,serializeAttributes:s=xce,defaultAttributes:o={},content:a="block",allowedAttributes:l}=e,c=n||t;return{parseMarkdown:(e,n)=>{let i;if(r){const t=r(e);i="string"==typeof t?[{type:"text",text:t}]:t}else i="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const s={...o,...e.attributes};return n.createNode(t,s,i)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var s;const o=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(o);if(!l)return;const[d,h=""]=l,u=i(h);let p=1;const f=d.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(y);if(null===n)break;const i=n.index,o=n[1];if(!(null==(s=n[2])?void 0:s.endsWith(":::")))if(o)p+=1;else if(p-=1,0===p){const s=y.slice(0,i);m=s.trim();const o=e.slice(0,f+i+n[0].length);let l=[];if(m)if("block"===a)for(l=r.blockTokens(s),l.forEach((e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))}));l.length>0;){const e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(m);return{type:t,raw:o,attributes:u,content:m,tokens:l}}}}},renderMarkdown:(e,t)=>{const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),r=s(n),i=r?` {${r}}`:"",o=t.renderChildren(e.content||[],"\n\n");return`:::${c}${i}\n\n${o}\n\n:::`}}}function Sce(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,i,s,o]=r;t[i]=s||o,r=n.exec(e)}return t}function _ce(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}="${t}"`)).join(" ")}function kce(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=Sce,serializeAttributes:s=_ce,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const i={...o,...e.attributes};if(a)return n.createNode(t,i);const s=r?r(e):e.content||"";return s?n.createNode(t,i,[n.createTextNode(s)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const s=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(s);if(!o)return;let l="",c="";if(a){const[,e]=o;c=e}else{const[,e,t]=o;c=e,l=t||""}const h=i(c.trim());return{type:t,raw:o[0],content:l.trim(),attributes:h}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter((e=>"text"===e.type)).map((e=>e.text)).join(""));const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),i=s(n),o=i?` ${i}`:"";return a?`[${c}${o}]`:`[${c}${o}]${t}[/${c}]`}}}function Oce(e,t,n){var r,i,s,o;const a=e.split("\n"),l=[];let c="",d=0;const h=t.baseIndentSize||2;for(;d<a.length;){const e=a[d],u=e.match(t.itemPattern);if(!u){if(l.length>0)break;if(""===e.trim()){d+=1;continue}return}const p=t.extractItemData(u),{indentLevel:f,mainContent:m}=p;c=`${c}${e}\n`;const g=[m];for(d+=1;d<a.length;){const e=a[d];if(""===e.trim()){const t=a.slice(d+1).findIndex((e=>""!==e.trim()));if(-1===t)break;if(((null==(i=null==(r=a[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>f){g.push(e),c=`${c}${e}\n`,d+=1;continue}break}if(!(((null==(o=null==(s=e.match(/^(\s*)/))?void 0:s[1])?void 0:o.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,d+=1}let y;const v=g.slice(1);if(v.length>0){const e=v.map((e=>e.slice(f+h))).join("\n");e.trim()&&(y=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const b=t.createToken(p,y);l.push(b)}if(0!==l.length)return{items:l,raw:c.trim()}}function Tce(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i="function"==typeof n?n(r):n,[s,...o]=e.content,a=[`${i}${t.renderChildren([s])}`];return o&&o.length>0&&o.forEach((e=>{const n=t.renderChildren([e]);if(n){const e=n.split("\n").map((e=>e?t.indent(e):"")).join("\n");a.push(e)}})),a.join("\n")}function Pce(e,t,n={}){const{state:r}=t,{doc:i,tr:s}=r,o=e;i.descendants(((t,r)=>{const i=s.mapping.map(r),a=s.mapping.map(r)+t.nodeSize;let l=null;if(t.marks.forEach((e=>{if(e!==o)return!1;l=e})),!l)return;let c=!1;if(Object.keys(n).forEach((e=>{n[e]!==l.attrs[e]&&(c=!0)})),c){const t=e.type.create({...e.attrs,...n});s.removeMark(i,a,e.type),s.addMark(i,a,t)}})),s.docChanged&&t.view.dispatch(s)}Xoe({},{createAtomBlockMarkdownSpec:()=>Ece,createBlockMarkdownSpec:()=>Cce,createInlineMarkdownSpec:()=>kce,parseAttributes:()=>wce,parseIndentedBlocks:()=>Oce,renderNestedMarkdownContent:()=>Tce,serializeAttributes:()=>xce});var Ice=class e extends rce{constructor(){super(...arguments),this.type="node"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}}.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",fle(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];return 1===n.length&&"image"===n[0].type?t.parseChildren([n[0]]):t.createNode("paragraph",void 0,t.parseInline(n))},renderMarkdown:(e,t)=>e&&Array.isArray(e.content)?t.renderChildren(e.content):"",addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Mce=Ice,Rce=Object.defineProperty,Ace=(e,t)=>{for(var n in t)Rce(e,n,{get:t[n],enumerable:!0})};function Nce(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=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 s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var Dce=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(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(s);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],a=!!e,l=e||i.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return o.push(i),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(l),o.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...s,dispatch:void 0})]))),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:e,editor:r,view:s,state:Nce({state:i,transaction:e}),dispatch:t?()=>{}: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}},Lce={};Ace(Lce,{blur:()=>Fce,clearContent:()=>jce,clearNodes:()=>$ce,command:()=>Bce,createParagraphNear:()=>Vce,cut:()=>zce,deleteCurrentNode:()=>Hce,deleteNode:()=>Kce,deleteRange:()=>Wce,deleteSelection:()=>Gce,enter:()=>qce,exitCode:()=>Xce,extendMarkRange:()=>nde,first:()=>rde,focus:()=>cde,forEach:()=>dde,insertContent:()=>hde,insertContentAt:()=>mde,joinBackward:()=>vde,joinDown:()=>yde,joinForward:()=>bde,joinItemBackward:()=>wde,joinItemForward:()=>xde,joinTextblockBackward:()=>Ede,joinTextblockForward:()=>Cde,joinUp:()=>gde,keyboardShortcut:()=>_de,lift:()=>Ode,liftEmptyBlock:()=>Tde,liftListItem:()=>Pde,newlineInCode:()=>Ide,resetAttributes:()=>Ade,scrollIntoView:()=>Nde,selectAll:()=>Dde,selectNodeBackward:()=>Lde,selectNodeForward:()=>Fde,selectParentNode:()=>jde,selectTextblockEnd:()=>$de,selectTextblockStart:()=>Bde,setContent:()=>zde,setMark:()=>ghe,setMeta:()=>yhe,setNode:()=>vhe,setNodeSelection:()=>bhe,setTextSelection:()=>whe,sinkListItem:()=>xhe,splitBlock:()=>Che,splitListItem:()=>She,toggleList:()=>Ohe,toggleMark:()=>The,toggleNode:()=>Phe,toggleWrap:()=>Ihe,undoInputRule:()=>Mhe,unsetAllMarks:()=>Rhe,unsetMark:()=>Ahe,updateAttributes:()=>Nhe,wrapIn:()=>Dhe,wrapInList:()=>Lhe});var Fce=()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())})),!0),jce=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),$ce=()=>({state:e,tr:t,dispatch:n})=>{const{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;const{doc:r,mapping:i}=t,s=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),a=s.blockRange(o);if(!a)return;const l=k2(a);if(e.type.isTextblock){const{defaultType:e}=s.parent.contentMatchAt(s.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},Bce=e=>t=>e(t),Vce=()=>({state:e,dispatch:t})=>B5(e,t),zce=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const o=r.mapping.map(t);return r.insert(o,s.content),r.setSelection(new n5(r.doc.resolve(Math.max(o-1,0)))),!0},Hce=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1){if(i.node(n).type===r.type){if(t){const t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}}return!1};function Uce(e,t){if("string"==typeof e){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 Kce=e=>({tr:t,state:n,dispatch:r})=>{const i=Uce(e,n.schema),s=t.selection.$anchor;for(let e=s.depth;e>0;e-=1){if(s.node(e).type===i){if(r){const n=s.before(e),r=s.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},Wce=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},Gce=()=>({state:e,dispatch:t})=>x5(e,t),qce=()=>({commands:e})=>e.keyboardShortcut("Enter"),Xce=()=>({state:e,dispatch:t})=>$5(e,t);function Yce(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function Zce(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Yce(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Jce(e,t,n={}){return e.find((e=>e.type===t&&Zce(Object.fromEntries(Object.keys(n).map((t=>[t,e.attrs[t]]))),n)))}function Qce(e,t,n={}){return!!Jce(e,t,n)}function ede(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some((e=>e.type===t))||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some((e=>e.type===t)))return;n=n||(null==(r=i.node.marks[0])?void 0:r.attrs);if(!Jce([...i.node.marks],t,n))return;let s=i.index,o=e.start()+i.offset,a=s+1,l=o+i.node.nodeSize;for(;s>0&&Qce([...e.parent.child(s-1).marks],t,n);)s-=1,o-=e.parent.child(s).nodeSize;for(;a<e.parent.childCount&&Qce([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function tde(e,t){if("string"==typeof e){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 nde=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const s=tde(e,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){const e=ede(l,s,t);if(e&&e.from<=c&&e.to>=d){const t=n5.create(o,e.from,e.to);n.setSelection(t)}}return!0},rde=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function ide(e){return e instanceof n5}function sde(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function ode(e,t=null){if(!t)return null;const n=J2.atStart(e),r=J2.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,s=r.to;return"all"===t?n5.create(e,sde(0,i,s),sde(e.content.size,i,s)):n5.create(e,sde(t,i,s),sde(t,i,s))}function ade(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function lde(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var cde=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const o=()=>{(lde()||ade())&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(s&&null===e&&!ide(n.state.selection))return o(),!0;const a=ode(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},dde=(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),hde=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),ude=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&ude(r)}return e};function pde(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return ude(n)}function fde(e,t,n){if(e instanceof S1||e instanceof e1)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return e1.fromArray(e.map((e=>t.nodeFromJSON(e))));const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),fde("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,i="";const s=new H1({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="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?K1.fromSchema(s).parseSlice(pde(e),n.parseOptions):K1.fromSchema(s).parse(pde(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${i}`)})}const r=K1.fromSchema(t);return n.slice?r.parseSlice(pde(e),n.parseOptions).content:r.parse(pde(e),n.parseOptions)}return fde("",t,n)}var mde=(e,t,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){let i;const a=e=>{s.emit("contentError",{editor:s,error:e,disableCollaboration:()=>{"collaboration"in s.storage&&"object"==typeof s.storage.collaboration&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},l={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{fde(t,s.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(e){a(e)}try{i=fde(t,s.schema,{parseOptions:l,errorOnInvalidContent:null!=(o=n.errorOnInvalidContent)?o:s.options.enableContentCheck})}catch(e){return a(e),!1}let{from:c,to:d}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},h=!0,u=!0;if(("type"in i?[i]:i).forEach((e=>{e.check(),h=!!h&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),c===d&&u){const{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(c-=1,d+=1)}let p;if(h){if(Array.isArray(t))p=t.map((e=>e.text||"")).join("");else if(t instanceof e1){let e="";t.forEach((t=>{t.text&&(e+=t.text)})),p=e}else p="object"==typeof t&&t&&t.text?t.text:t;r.insertText(p,c,d)}else{p=i;const e=r.doc.resolve(c),t=e.node(),n=0===e.parentOffset,s=t.isText||t.isTextblock,o=t.content.size>0;n&&s&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,d,p)}n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof x2||i instanceof E2))return;const s=e.mapping.maps[r];let o=0;s.forEach(((e,t,n,r)=>{0===o&&(o=r)})),e.setSelection(J2.near(e.doc.resolve(o),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},gde=()=>({state:e,dispatch:t})=>N5(e,t),yde=()=>({state:e,dispatch:t})=>D5(e,t),vde=()=>({state:e,dispatch:t})=>C5(e,t),bde=()=>({state:e,dispatch:t})=>M5(e,t),wde=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},xde=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Ede=()=>({state:e,dispatch:t})=>S5(e,t),Cde=()=>({state:e,dispatch:t})=>_5(e,t);function Sde(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var _de=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const s=function(e){const t=e.split(/-(?!$)/);let n,r,i,s,o=t[t.length-1];"Space"===o&&(o=" ");for(let e=0;e<t.length-1;e+=1){const o=t[e];if(/^(cmd|meta|m)$/i.test(o))s=!0;else if(/^a(lt)?$/i.test(o))n=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))i=!0;else{if(!/^mod$/i.test(o))throw new Error(`Unrecognized modifier name: ${o}`);lde()||Sde()?s=!0:r=!0}}return n&&(o=`Alt-${o}`),r&&(o=`Ctrl-${o}`),s&&(o=`Meta-${o}`),i&&(o=`Shift-${o}`),o}(e).split(/-(?!$)/),o=s.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===o?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0};function kde(e,t,n={}){const{from:r,to:i,empty:s}=e.selection,o=t?Uce(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:s})}));const l=i-r,c=a.filter((e=>!o||o.name===e.node.type.name)).filter((e=>Zce(e.node.attrs,n,{strict:!1})));if(s)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}var Ode=(e,t={})=>({state:n,dispatch:r})=>!!kde(n,Uce(e,n.schema),t)&&L5(n,r),Tde=()=>({state:e,dispatch:t})=>V5(e,t),Pde=e=>({state:t,dispatch:n})=>r3(Uce(e,t.schema))(t,n),Ide=()=>({state:e,dispatch:t})=>F5(e,t);function Mde(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Rde(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}var Ade=(e,t)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Mde("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(s=Uce(e,r.schema)),"mark"===a&&(o=tde(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{s&&s===e.type&&n.setNodeMarkup(r,void 0,Rde(e.attrs,t)),o&&e.marks.length&&e.marks.forEach((i=>{o===i.type&&n.addMark(r,r+e.nodeSize,o.create(Rde(i.attrs,t)))}))}))})),!0)},Nde=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Dde=()=>({tr:e,dispatch:t})=>{if(t){const t=new o5(e.doc);e.setSelection(t)}return!0},Lde=()=>({state:e,dispatch:t})=>T5(e,t),Fde=()=>({state:e,dispatch:t})=>R5(e,t),jde=()=>({state:e,dispatch:t})=>U5(e,t),$de=()=>({state:e,dispatch:t})=>q5(e,t),Bde=()=>({state:e,dispatch:t})=>G5(e,t);function Vde(e,t,n={},r={}){return fde(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var zde=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if("full"!==r.preserveWhitespace){const a=Vde(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function Hde(e,t){const n=tde(t,e.schema),{from:r,to:i,empty:s}=e.selection,o=[];s?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{o.push(...e.marks)}));const a=o.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function Ude(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function Kde(e,t,n){if(void 0===e.config[t]&&e.parent)return Kde(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?Kde(e.parent,t,n):null})}return e.config[t]}function Wde(e){return e.map((e=>{const t=Kde(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...Wde(t())]:e})).flat(10)}function Gde(e,t){const n=t2.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function qde(e){return"function"==typeof e}function Xde(e,t=void 0,...n){return qde(e)?t?e.bind(t)(...n):e(...n):e}function Yde(e){const t=e.filter((e=>"extension"===e.type)),n=e.filter((e=>"node"===e.type)),r=e.filter((e=>"mark"===e.type));return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function Zde(e){const t=[],{nodeExtensions:n,markExtensions:r}=Yde(e),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=Kde(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:i});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...s,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=Kde(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...s,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&void 0===(null==i?void 0:i.default)&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function Jde(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],s=r.filter((e=>!i.includes(e)));n[e]=[...i,...s].join(" ")}else if("style"===e){const r=t?t.split(";").map((e=>e.trim())).filter(Boolean):[],i=n[e]?n[e].split(";").map((e=>e.trim())).filter(Boolean):[],s=new Map;i.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),r.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),n[e]=Array.from(s.entries()).map((([e,t])=>`${e}: ${t}`)).join("; ")}else n[e]=t;else n[e]=t})),n}),{})}function Qde(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)=>Jde(e,t)),{})}function ehe(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function the(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function nhe(e){var t,n,r;const i={};return(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)||void 0===(null==(n=null==e?void 0:e.attribute)?void 0:n.default)||(i.default=e.attribute.default),void 0!==(null==(r=null==e?void 0:e.attribute)?void 0:r.validate)&&(i.validate=e.attribute.validate),[e.name,i]}function rhe(e,t){var n;const r=Zde(e),{nodeExtensions:i,markExtensions:s}=Yde(e),o=null==(n=i.find((e=>Kde(e,"topNode"))))?void 0:n.name,a=Object.fromEntries(i.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=Kde(t,"extendNodeSchema",s);return{...e,...r?r(n):{}}}),{}),a=the({...o,content:Xde(Kde(n,"content",s)),marks:Xde(Kde(n,"marks",s)),group:Xde(Kde(n,"group",s)),inline:Xde(Kde(n,"inline",s)),atom:Xde(Kde(n,"atom",s)),selectable:Xde(Kde(n,"selectable",s)),draggable:Xde(Kde(n,"draggable",s)),code:Xde(Kde(n,"code",s)),whitespace:Xde(Kde(n,"whitespace",s)),linebreakReplacement:Xde(Kde(n,"linebreakReplacement",s)),defining:Xde(Kde(n,"defining",s)),isolating:Xde(Kde(n,"isolating",s)),attrs:Object.fromEntries(i.map(nhe))}),l=Xde(Kde(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>ehe(e,i))));const c=Kde(n,"renderHTML",s);c&&(a.toDOM=e=>c({node:e,HTMLAttributes:Qde(e,i)}));const d=Kde(n,"renderText",s);return d&&(a.toText=d),[n.name,a]}))),l=Object.fromEntries(s.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=Kde(t,"extendMarkSchema",s);return{...e,...r?r(n):{}}}),{}),a=the({...o,inclusive:Xde(Kde(n,"inclusive",s)),excludes:Xde(Kde(n,"excludes",s)),group:Xde(Kde(n,"group",s)),spanning:Xde(Kde(n,"spanning",s)),code:Xde(Kde(n,"code",s)),attrs:Object.fromEntries(i.map(nhe))}),l=Xde(Kde(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>ehe(e,i))));const c=Kde(n,"renderHTML",s);return c&&(a.toDOM=e=>c({mark:e,HTMLAttributes:Qde(e,i)})),[n.name,a]})));return new H1({topNode:o,nodes:a,marks:l})}function ihe(e){return e.sort(((e,t)=>{const n=Kde(e,"priority")||100,r=Kde(t,"priority")||100;return n>r?-1:n<r?1:0}))}function she(e){const t=ihe(Wde(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return Array.from(new Set(t))}(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 ohe(e,t,n){const{from:r,to:i}=t,{blockSeparator:s="\n\n",textSerializers:o={}}=n||{};let a="";return e.nodesBetween(r,i,((e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=s);const h=null==o?void 0:o[e.type.name];if(h)return l&&(a+=h({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,i-n))})),a}function ahe(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}function lhe(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.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 che(e,t){return t.nodes[e]||t.marks[e]||null}function dhe(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}var hhe=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,i,s)=>{var o,a;const l=(null==(a=(o=e.type.spec).toText)?void 0:a.call(o,{node:e,pos:t,parent:i,index:s}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))})),n};function uhe(e,t,n={}){const{empty:r,ranges:i}=e.selection,s=t?tde(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!s||s.name===e.type.name)).find((e=>Zce(e.attrs,n,{strict:!1})));let o=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);o+=s-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:s}))))}))})),0===o)return!1;const l=a.filter((e=>!s||s.name===e.mark.type.name)).filter((e=>Zce(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!s||e.mark.type!==s&&e.mark.type.excludes(s))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=o}function phe(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function fhe(e,t){const{nodeExtensions:n}=Yde(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=Xde(Kde(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function mhe(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach((e=>{!1!==r&&(mhe(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))})),r}return!1}var ghe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=tde(e,r.schema);if(i)if(o){const e=Hde(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,s=e.$to.pos;r.doc.nodesBetween(i,s,((e,r)=>{const o=Math.max(r,i),a=Math.min(r+e.nodeSize,s),c=e.marks.find((e=>e.type===l));c?e.marks.forEach((e=>{l===e.type&&n.addMark(o,a,l.create({...e.attrs,...t}))})):n.addMark(o,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:i}=t;let s=null;if(ide(i)&&(s=i.$cursor),s){const t=null!=(r=e.storedMarks)?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some((e=>e.type.excludes(n))))}const{ranges:o}=i;return o.some((({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(i)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),s=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));i=t&&s}return!i})),i}))}(r,n,l)},yhe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),vhe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const s=Uce(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command((({commands:e})=>!!Y5(s,{...o,...t})(n)||e.clearNodes())).command((({state:e})=>Y5(s,{...o,...t})(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},bhe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=sde(e,0,n.content.size),i=i5.create(n,r);t.setSelection(i)}return!0},whe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,s=n5.atStart(n).from,o=n5.atEnd(n).to,a=sde(r,s,o),l=sde(i,s,o),c=n5.create(n,a,l);t.setSelection(c)}return!0},xhe=e=>({state:t,dispatch:n})=>i3(Uce(e,t.schema))(t,n);function Ehe(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}var Che=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=t,{$from:a,$to:l}=s,c=dhe(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(s instanceof i5&&s.node.isBlock)return!(!a.parentOffset||!M2(o,a.pos))&&(r&&(e&&Ehe(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=d&&h?[{type:h,attrs:c}]:void 0,p=M2(t.doc,t.mapping.map(a.pos),1,u);if(u||p||!M2(t.doc,t.mapping.map(a.pos),1,h?[{type:h}]:void 0)||(p=!0,u=h?[{type:h,attrs:c}]:void 0),r){if(p&&(s instanceof n5&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,u),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(a.before()),h)}e&&Ehe(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},She=(e,t={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=Uce(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const h=l.node(-1);if(h.type!==a)return!1;const u=s.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let e=e1.empty;const r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=e1.from(l.node(t).copy(e));const i=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,s={...dhe(u,l.node().type.name,l.node().attrs),...t},c=(null==(o=a.contentMatch.defaultType)?void 0:o.createAndFill(s))||void 0;e=e.append(e1.from(a.createAndFill(null,c)||void 0));const d=l.before(l.depth-(r-1));n.replace(d,l.after(-i),new o1(e,4-r,0));let h=-1;n.doc.nodesBetween(d,n.doc.content.size,((e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)})),h>-1&&n.setSelection(n5.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...dhe(u,h.type.name,h.attrs),...t},m={...dhe(u,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!M2(n.doc,l.pos,2))return!1;if(i){const{selection:e,storedMarks:t}=r,{splittableMarks:o}=s.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!i)return!0;const c=a.filter((e=>o.includes(e.type.name)));n.ensureMarks(c)}return!0},_he=(e,t)=>{const n=Ude((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,n.pos)||(e.join(n.pos),!0)},khe=(e,t)=>{const n=Ude((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,r)||(e.join(r),!0)},Ohe=(e,t,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:h,splittableMarks:u}=i.extensionManager,p=Uce(e,o.schema),f=Uce(t,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:v}=m,b=y.blockRange(v),w=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const x=Ude((e=>fhe(e.type.name,h)))(m);if(b.depth>=1&&x&&b.depth-x.depth<=1){if(x.node.type===p)return c.liftListItem(f);if(fhe(x.node.type.name,h)&&p.validContent(x.node.content)&&a)return l().command((()=>(s.setNodeMarkup(x.pos,p),!0))).command((()=>_he(s,p))).command((()=>khe(s,p))).run()}return n&&w&&a?l().command((()=>{const e=d().wrapInList(p,r),t=w.filter((e=>u.includes(e.type.name)));return s.ensureMarks(t),!!e||c.clearNodes()})).wrapInList(p,r).command((()=>_he(s,p))).command((()=>khe(s,p))).run():l().command((()=>!!d().wrapInList(p,r)||c.clearNodes())).wrapInList(p,r).command((()=>_he(s,p))).command((()=>khe(s,p))).run()},The=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=tde(e,r.schema);return uhe(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,t)},Phe=(e,t,n={})=>({state:r,commands:i})=>{const s=Uce(e,r.schema),o=Uce(t,r.schema),a=kde(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},Ihe=(e,t={})=>({state:n,commands:r})=>{const i=Uce(e,n.schema);return kde(n,i,t)?r.lift(i):r.wrapIn(i,t)},Mhe=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){const t=e.tr,n=s.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(s.text){const n=t.doc.resolve(s.from).marks();t.replaceWith(s.from,s.to,e.schema.text(s.text,n))}else t.delete(s.from,s.to)}return!0}}return!1},Rhe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},Ahe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=t,{selection:a}=n,l=tde(e,r.schema),{$from:c,empty:d,ranges:h}=a;if(!i)return!0;if(d&&o){let{from:e,to:t}=a;const r=null==(s=c.marks().find((e=>e.type===l)))?void 0:s.attrs,i=ede(c,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else h.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},Nhe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Mde("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(s=Uce(e,r.schema)),"mark"===a&&(o=tde(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;let l,c,d,h;n.selection.empty?r.doc.nodesBetween(i,a,((e,t)=>{s&&s===e.type&&(d=Math.max(t,i),h=Math.min(t+e.nodeSize,a),l=t,c=e)})):r.doc.nodesBetween(i,a,((e,r)=>{r<i&&s&&s===e.type&&(d=Math.max(r,i),h=Math.min(r+e.nodeSize,a),l=r,c=e),r>=i&&r<=a&&(s&&s===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),o&&e.marks.length&&e.marks.forEach((s=>{if(o===s.type){const l=Math.max(r,i),c=Math.min(r+e.nodeSize,a);n.addMark(l,c,o.create({...s.attrs,...t}))}})))})),c&&(void 0!==l&&n.setNodeMarkup(l,void 0,{...c.attrs,...t}),o&&c.marks.length&&c.marks.forEach((e=>{o===e.type&&n.addMark(d,h,o.create({...e.attrs,...t}))})))})),!0)},Dhe=(e,t={})=>({state:n,dispatch:r})=>X5(Uce(e,n.schema),t)(n,r),Lhe=(e,t={})=>({state:n,dispatch:r})=>n3(Uce(e,n.schema),t)(n,r),Fhe=(e,t)=>{if(Yce(t))return t.exec(e);const n=t(e);if(!n)return null;const 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 jhe(e){var t;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let d=!1;const h=hhe(c)+s;return o.forEach((e=>{if(d)return;const t=Fhe(h,e.find);if(!t)return;const o=l.state.tr,c=Nce({state:l.state,transaction:o}),u={from:r-(t[0].length-s.length),to:i},{commands:p,chain:f,can:m}=new Dce({editor:n,state:c});null!==e.handler({state:c,range:u,match:t,commands:p,chain:f,can:m})&&o.steps.length&&(e.undoable&&o.setMeta(a,{transform:o,from:r,to:i,text:s}),l.dispatch(o),d=!0)})),d}function $he(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function Bhe(e,t){const n={...e};return $he(e)&&$he(t)&&Object.keys(t).forEach((r=>{$he(t[r])&&$he(e[r])?n[r]=Bhe(e[r],t[r]):n[r]=t[r]})),n}var Vhe=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{...Xde(Kde(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Xde(Kde(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Bhe(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const 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}},zhe=class e extends Vhe{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const i=r.marks();if(!!!i.find((e=>(null==e?void 0:e.type.name)===t.name)))return!1;const s=i.find((e=>(null==e?void 0:e.type.name)===t.name));return s&&n.removeStoredMark(s),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};var Hhe=(e,t,n)=>{if(Yce(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map((t=>{const 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})):[]};var Uhe=null;function Khe(e){const{editor:t,rules:n}=e;let r,i=null,s=!1,o=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:e,from:n,to:i,rule:s,pasteEvt:o})=>{const l=e.tr,c=Nce({state:e,transaction:l}),d=function(e){const{editor:t,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=e,{commands:l,chain:c,can:d}=new Dce({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,((e,t)=>{var u,p,f,m,g;if((null==(p=null==(u=e.type)?void 0:u.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;const y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,v=Math.max(r,t),b=Math.min(i,t+y);if(v>=b)return;const w=e.isText?e.text||"":e.textBetween(v-t,b-t,void 0,"");Hhe(w,s.find,o).forEach((e=>{if(void 0===e.index)return;const t=v+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},u=s.handler({state:n,range:i,match:e,commands:l,chain:c,can:d,pasteEvent:o,dropEvent:a});h.push(u)}))})),h.every((e=>null!==e))}({editor:t,state:c,from:Math.max(n-1,0),to:i.b-1,rule:s,pasteEvent:o,dropEvent:r});if(d&&l.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}},c=n.map((e=>new y5({view(e){const n=n=>{var r;i=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,i&&(Uhe=t)},r=()=>{Uhe&&(Uhe=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(o=i===e.dom.parentElement,r=t,!o){const e=Uhe;(null==e?void 0:e.isEditable)&&setTimeout((()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})}),10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,s=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const i=t[0],c="paste"===i.getMeta("uiEvent")&&!s,d="drop"===i.getMeta("uiEvent")&&!o,h=i.getMeta("applyPasteRules"),u=!!h;if(!c&&!d&&!u)return;if(u){let{text:t}=h;"string"==typeof t||(t=Gde(e1.from(t),r.schema));const{from:n}=h,i=n+t.length,s=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return l({rule:e,state:r,from:n,to:{b:i},pasteEvt:s})}const p=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof p&&f&&p!==f.b?l({rule:e,state:r,from:p,to:f,pasteEvt:a}):void 0}})));return c}var Whe=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=she(e),this.schema=rhe(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce(((e,t)=>{const n=Kde(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:che(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=ihe([...this.extensions].reverse()).flatMap((t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:che(t.name,this.schema)},r=[],i=Kde(t,"addKeyboardShortcuts",n);let s={};if("mark"===t.type&&Kde(t,"exitable",n)&&(s.ArrowRight=()=>zhe.handleExit({editor:e,mark:t})),i){const t=Object.fromEntries(Object.entries(i()).map((([t,n])=>[t,()=>n({editor:e})])));s={...s,...t}}const o=M7(s);r.push(o);const a=Kde(t,"addInputRules",n);if(phe(t,e.options.enableInputRules)&&a){const t=a();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new y5({state:{init:()=>null,apply(e,i,s){const o=e.getMeta(r);if(o)return o;const a=e.getMeta("applyInputRules");return!!a&&setTimeout((()=>{let{text:e}=a;"string"==typeof e||(e=Gde(e1.from(e),s.schema));const{from:i}=a,o=i+e.length;jhe({editor:t,from:i,to:o,text:e,rules:n,plugin:r})})),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,s,o)=>jhe({editor:t,from:i,to:s,text:o,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&jhe({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:s}=e.state.selection;return!!s&&jhe({editor:t,from:s.pos,to:s.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}const l=Kde(t,"addPasteRules",n);if(phe(t,e.options.enablePasteRules)&&l){const t=l();if(t&&t.length){const n=Khe({editor:e,rules:t});r.push(...n)}}const c=Kde(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r}));return t}get attributes(){return Zde(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Yde(this.extensions);return Object.fromEntries(t.filter((e=>!!Kde(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Uce(t.name,this.schema)},i=Kde(t,"addNodeView",r);if(!i)return[];const s=i();if(!s)return[];return[t.name,(r,i,o,a,l)=>{const c=Qde(r,n);return s({node:r,view:i,getPos:o,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:c})}]})))}get markViews(){const{editor:e}=this,{markExtensions:t}=Yde(this.extensions);return Object.fromEntries(t.filter((e=>!!Kde(e,"addMarkView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:tde(t.name,this.schema)},i=Kde(t,"addMarkView",r);if(!i)return[];return[t.name,(r,s,o)=>{const a=Qde(r,n);return i()({mark:r,view:s,inline:o,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{pue(r,e,t)}})}]})))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map((e=>[e.name,e.storage]))),e.forEach((e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:che(e.name,this.schema)};if("mark"===e.type){(null==(t=Xde(Kde(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name)}const r=Kde(e,"onBeforeCreate",n),i=Kde(e,"onCreate",n),s=Kde(e,"onUpdate",n),o=Kde(e,"onSelectionUpdate",n),a=Kde(e,"onTransaction",n),l=Kde(e,"onFocus",n),c=Kde(e,"onBlur",n),d=Kde(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),s&&this.editor.on("update",s),o&&this.editor.on("selectionUpdate",o),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)}))}};Whe.resolve=she,Whe.sort=ihe,Whe.flatten=Wde;Ace({},{ClipboardTextSerializer:()=>qhe,Commands:()=>Xhe,Delete:()=>Yhe,Drop:()=>Zhe,Editable:()=>Jhe,FocusEvents:()=>eue,Keymap:()=>tue,Paste:()=>nue,Tabindex:()=>rue,focusEventsPluginKey:()=>Qhe});var Ghe=class e extends Vhe{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},qhe=Ghe.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new y5({key:new w5("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:s}=i,o=Math.min(...s.map((e=>e.$from.pos))),a=Math.max(...s.map((e=>e.$to.pos))),l=ahe(n);return ohe(r,{from:o,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),Xhe=Ghe.create({name:"commands",addCommands:()=>({...Lce})}),Yhe=Ghe.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const s=()=>{var n,r,i,s;if(null!=(s=null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?s:e.getMeta("y-sync$"))return;const o=function(e,t){const n=new Y2(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(e.before,[e,...t]),a=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,i)=>{const s=[];if(e.ranges.length)e.forEach(((e,t)=>{s.push({from:e,to:t})}));else{const{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;s.push({from:e,to:t})}s.forEach((({from:e,to:n})=>{const s=t.slice(i).map(e,-1),o=t.slice(i).map(n),a=t.invert().map(s,-1),l=t.invert().map(o);r.push({oldRange:{from:a,to:l},newRange:{from:s,to:o}})}))})),lhe(r)}(o);a.forEach((t=>{o.mapping.mapResult(t.oldRange.from).deletedAfter&&o.mapping.mapResult(t.oldRange.to).deletedBefore&&o.before.nodesBetween(t.oldRange.from,t.oldRange.to,((n,r)=>{const i=r+n.nodeSize-2,s=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:o.mapping.map(r),newTo:o.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!s,editor:this.editor,transaction:e,combinedTransform:o})}))}));const l=o.mapping;o.steps.forEach(((t,n)=>{var r,i;if(t instanceof v2){const s=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),c=l.invert().map(s,-1),d=l.invert().map(a),h=null==(r=o.doc.nodeAt(s-1))?void 0:r.marks.some((e=>e.eq(t.mark))),u=null==(i=o.doc.nodeAt(a))?void 0:i.marks.some((e=>e.eq(t.mark)));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:s,to:a},partial:Boolean(u||h),editor:this.editor,transaction:e,combinedTransform:o})}}))};null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||i?setTimeout(s,0):s()}}),Zhe=Ghe.create({name:"drop",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Jhe=Ghe.create({name:"editable",addProseMirrorPlugins(){return[new y5({key:new w5("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Qhe=new w5("focusEvents"),eue=Ghe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new y5({key:Qhe,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),tue=Ghe.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:s}=n,{pos:o,parent:a}=s,l=s.parent.isTextblock&&o>0?t.doc.resolve(o-1):s,c=l.parent.type.spec.isolating,d=s.pos-s.parentOffset,h=c&&1===l.parent.childCount?d===s.pos:J2.atStart(r).from===o;return!(!i||!a.type.isTextblock||a.textContent.length||!h||h&&"paragraph"===s.parent.type.name)&&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 lde()||Sde()?i:r},addProseMirrorPlugins(){return[new y5({key:new w5("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some((e=>e.getMeta("composition"))))return;const r=e.some((e=>e.docChanged))&&!t.doc.eq(n.doc),i=e.some((e=>e.getMeta("preventClearDocument")));if(!r||i)return;const{empty:s,from:o,to:a}=t.selection,l=J2.atStart(t.doc).from,c=J2.atEnd(t.doc).to;if(s||!(o===l&&a===c))return;if(!mhe(n.doc))return;const d=n.tr,h=Nce({state:n,transaction:d}),{commands:u}=new Dce({editor:this.editor,state:h});return u.clearNodes(),d.steps.length?d:void 0}})]}}),nue=Ghe.create({name:"paste",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),rue=Ghe.create({name:"tabindex",addProseMirrorPlugins(){return[new y5({key:new w5("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function iue(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,(e=>(n.push(e),`__QUOTED_${n.length-1}__`))),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const e=i.map((e=>e.trim().slice(1)));t.class=e.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(t.id=s[1]);Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach((([,e,r])=>{var i;const s=parseInt((null==(i=r.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10),o=n[s];o&&(t[e]=o.slice(1,-1))}));const 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();if(o){o.split(/\s+/).filter(Boolean).forEach((e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}))}return t}function sue(e){if(!e||0===Object.keys(e).length)return"";const t=[];if(e.class){String(e.class).split(/\s+/).filter(Boolean).forEach((e=>t.push(`.${e}`)))}return e.id&&t.push(`#${e.id}`),Object.entries(e).forEach((([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))})),t.join(" ")}function oue(e){const{nodeName:t,name:n,parseAttributes:r=iue,serializeAttributes:i=sue,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=e,l=n||t;return{parseMarkdown:(e,n)=>{const r={...s,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,i){const s=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(s);if(!a)return;const c=a[1]||"",d=r(c),h=o.find((e=>!(e in d)));return h?void 0:{type:t,raw:a[0],attributes:d}}},renderMarkdown:e=>{const t=(e=>{if(!a)return e;const t={};return a.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),n=i(t);return`:::${l}${n?` {${n}}`:""} :::`}}}function aue(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=iue,serializeAttributes:s=sue,defaultAttributes:o={},content:a="block",allowedAttributes:l}=e,c=n||t;return{parseMarkdown:(e,n)=>{let i;if(r){const t=r(e);i="string"==typeof t?[{type:"text",text:t}]:t}else i="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const s={...o,...e.attributes};return n.createNode(t,s,i)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var s;const o=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(o);if(!l)return;const[d,h=""]=l,u=i(h);let p=1;const f=d.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(y);if(null===n)break;const i=n.index,o=n[1];if(!(null==(s=n[2])?void 0:s.endsWith(":::")))if(o)p+=1;else if(p-=1,0===p){const s=y.slice(0,i);m=s.trim();const o=e.slice(0,f+i+n[0].length);let l=[];if(m)if("block"===a)for(l=r.blockTokens(s),l.forEach((e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))}));l.length>0;){const e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(m);return{type:t,raw:o,attributes:u,content:m,tokens:l}}}}},renderMarkdown:(e,t)=>{const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),r=s(n),i=r?` {${r}}`:"",o=t.renderChildren(e.content||[],"\n\n");return`:::${c}${i}\n\n${o}\n\n:::`}}}function lue(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,i,s,o]=r;t[i]=s||o,r=n.exec(e)}return t}function cue(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}="${t}"`)).join(" ")}function due(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=lue,serializeAttributes:s=cue,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const i={...o,...e.attributes};if(a)return n.createNode(t,i);const s=r?r(e):e.content||"";return s?n.createNode(t,i,[n.createTextNode(s)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const s=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(s);if(!o)return;let l="",c="";if(a){const[,e]=o;c=e}else{const[,e,t]=o;c=e,l=t||""}const h=i(c.trim());return{type:t,raw:o[0],content:l.trim(),attributes:h}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter((e=>"text"===e.type)).map((e=>e.text)).join(""));const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),i=s(n),o=i?` ${i}`:"";return a?`[${c}${o}]`:`[${c}${o}]${t}[/${c}]`}}}function hue(e,t,n){var r,i,s,o;const a=e.split("\n"),l=[];let c="",d=0;const h=t.baseIndentSize||2;for(;d<a.length;){const e=a[d],u=e.match(t.itemPattern);if(!u){if(l.length>0)break;if(""===e.trim()){d+=1;continue}return}const p=t.extractItemData(u),{indentLevel:f,mainContent:m}=p;c=`${c}${e}\n`;const g=[m];for(d+=1;d<a.length;){const e=a[d];if(""===e.trim()){const t=a.slice(d+1).findIndex((e=>""!==e.trim()));if(-1===t)break;if(((null==(i=null==(r=a[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>f){g.push(e),c=`${c}${e}\n`,d+=1;continue}break}if(!(((null==(o=null==(s=e.match(/^(\s*)/))?void 0:s[1])?void 0:o.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,d+=1}let y;const v=g.slice(1);if(v.length>0){const e=v.map((e=>e.slice(f+h))).join("\n");e.trim()&&(y=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const b=t.createToken(p,y);l.push(b)}if(0!==l.length)return{items:l,raw:c.trim()}}function uue(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i="function"==typeof n?n(r):n,[s,...o]=e.content,a=[`${i}${t.renderChildren([s])}`];return o&&o.length>0&&o.forEach((e=>{const n=t.renderChildren([e]);if(n){const e=n.split("\n").map((e=>e?t.indent(e):"")).join("\n");a.push(e)}})),a.join("\n")}function pue(e,t,n={}){const{state:r}=t,{doc:i,tr:s}=r,o=e;i.descendants(((t,r)=>{const i=s.mapping.map(r),a=s.mapping.map(r)+t.nodeSize;let l=null;if(t.marks.forEach((e=>{if(e!==o)return!1;l=e})),!l)return;let c=!1;if(Object.keys(n).forEach((e=>{n[e]!==l.attrs[e]&&(c=!0)})),c){const t=e.type.create({...e.attrs,...n});s.removeMark(i,a,e.type),s.addMark(i,a,t)}})),s.docChanged&&t.view.dispatch(s)}Ace({},{createAtomBlockMarkdownSpec:()=>oue,createBlockMarkdownSpec:()=>aue,createInlineMarkdownSpec:()=>due,parseAttributes:()=>iue,parseIndentedBlocks:()=>hue,renderNestedMarkdownContent:()=>uue,serializeAttributes:()=>sue});var fue=class e extends Vhe{constructor(){super(...arguments),this.type="node"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}}.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Jde(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>" \n",parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:o}=r.extensionManager,a=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&s){const t=a.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()}}}),mue=fue;const gue=e=>{const{editor:t,node:n,getPos:r}=e,i=n.textContent===b0.ZERO_WIDTH_CHAR,s=n.attrs.placeholder||"",[o,a]=(0,d.useState)(!1),l=(0,d.useCallback)((()=>{if(!t||"function"!=typeof r)return!1;const e=r(),{from:i,to:s}=t.state.selection;return i>e&&s<e+n.nodeSize}),[t,r,n.nodeSize]);(0,d.useEffect)((()=>{var e;if(!(null===(e=null==t?void 0:t.view)||void 0===e?void 0:e.dom))return;const n=()=>{l()&&a(!0)},r=()=>{a(!1)},i=t.view.dom;return i.addEventListener("compositionstart",n,!0),i.addEventListener("compositionend",r,!0),i.addEventListener("compositioncancel",r,!0),()=>{i.removeEventListener("compositionstart",n,!0),i.removeEventListener("compositionend",r,!0),i.removeEventListener("compositioncancel",r,!0)}}),[t,l]);const c=i&&!o,u=(0,d.useRef)(null),[p,f]=(0,d.useState)(void 0);return(0,d.useLayoutEffect)((()=>{if(c&&u.current){const e=setTimeout((()=>{var e;f(null===(e=u.current)||void 0===e?void 0:e.offsetWidth)}));return()=>{clearTimeout(e)}}}),[c,s]),h().createElement(Hee,{as:"span",className:"input-slot",style:{minWidth:c&&p?`${p}px`:void 0}},h().createElement("span",{ref:u,"data-placeholder":!0,contentEditable:!1,className:"input-slot-placeholder",style:{display:c?void 0:"none"}},s),h().createElement(zee,{as:"span",className:"content"}))};function yue(e){let t=[],{tr:n}=e;return e.doc.descendants(((e,r,i)=>{if("paragraph"===e.type.name&&e.childCount>0){const{lastChild:i,firstChild:s}=e;if(s&&s.attrs.isCustomSlot&&t.push(r+1),i&&i.attrs.isCustomSlot){const i=r+e.nodeSize-1;n.doc.textBetween(i-1,i,"","")!==b0.ZERO_WIDTH_CHAR&&t.push(i)}i===s&&i.isText&&i.text===b0.ZERO_WIDTH_CHAR&&t.push(["remove",r+1])}if("inputSlot"===e.type.name&&0===e.content.size&&t.push(r+1),e.attrs.isCustomSlot){let n=-1;if(i.forEach(((t,r,i)=>{t===e&&(n=i)})),n>-1&&n<i.childCount-1){i.child(n+1).attrs.isCustomSlot&&t.push(r+e.nodeSize)}}})),t.length>0?(t.sort(((e,t)=>{const n=Array.isArray(e)?e[1]:e;return(Array.isArray(t)?t[1]:t)-n})).forEach((e=>{n=Array.isArray(e)&&"remove"===e[0]?n.delete(e[1],e[1]+1):n.insertText(b0.ZERO_WIDTH_CHAR,e,e)})),n):null}function vue(e){const t=e;if(t._semiSyntheticBackspaceGuard)return;const n=e.someProp.bind(e);t._semiSyntheticBackspaceGuard=!0,t._semiOrigSomeProp=n,e.someProp=function(e,t){return n(e,"handleKeyDown"!==e||"function"!=typeof t?t:e=>t("function"!=typeof e?e:(t,n)=>(!t.composing||"inputSlot"!==t.state.selection.$from.parent.type.name||!function(e){return!("keydown"!==(null==e?void 0:e.type)||"Backspace"!==(null==e?void 0:e.key)||8!==(null==e?void 0:e.keyCode)||!1!==e.isTrusted&&e instanceof KeyboardEvent)}(n))&&e(t,n)))}}function bue(e,t){const{state:n,dispatch:r}=e,i=n.selection.$from;let s=n.tr;return"inputSlot"===i.parent.type.name?function(e,t,n,r,i){var s;const o=t.parent,a=o.textContent,l=a&&a===b0.ZERO_WIDTH_CHAR,c=!i.empty&&i.from===t.start()&&i.to===t.end();if(l||c){const i=(null===(s=e.clipboardData)||void 0===s?void 0:s.getData("text/plain"))||"";if(i){const s=t.start();n=n.insertText(i,s,s+a.length);const o=s+i.length;return(n=n.setSelection(n5.create(n.doc,o))).setMeta(b0.DELETABLE,!0),r(n),e.preventDefault(),!0}}return!1}(t,i,s,r,n.selection):(wue(i,s),s.setMeta(b0.DELETABLE,!0),r(s),!1)}function wue(e,t){return e.nodeBefore&&e.nodeBefore.isText&&e.nodeBefore.text===b0.ZERO_WIDTH_CHAR?(t=t.delete(e.pos-e.nodeBefore.nodeSize,e.pos),!0):!(!e.nodeAfter||!e.nodeAfter.isText||e.nodeAfter.text!==b0.ZERO_WIDTH_CHAR)&&(t=t.delete(e.pos,e.pos+e.nodeAfter.nodeSize),!0)}const xue=Eee.create({name:"inputSlot",group:"inline",inline:!0,content:"inline*",atom:!1,selectable:!0,draggable:!1,parseHTML:()=>[{tag:"input-slot",getAttrs:e=>({placeholder:e.getAttribute("placeholder")})}],renderHTML(e){let{HTMLAttributes:t}=e;return["input-slot",Q8(t),0]},addAttributes:()=>({placeholder:{default:"",parseHTML:e=>e.getAttribute("placeholder")||"",renderHTML:e=>({placeholder:e.placeholder})},isCustomSlot:{default:!0,parseHTML:e=>!0,renderHTML:e=>({"data-custom-slot":!!e.isCustomSlot||void 0})}}),addNodeView(){return qee(gue,{update:e=>{let{oldNode:t,newNode:n,updateProps:r}=e;return n.type===t.type&&(this.editor.view.composing||r(),!0)}})},addProseMirrorPlugins(){return[(this.editor.schema,new y5({view:e=>(vue(e),{destroy(){!function(e){const t=e;t._semiSyntheticBackspaceGuard&&t._semiOrigSomeProp&&(e.someProp=t._semiOrigSomeProp,delete t._semiOrigSomeProp,delete t._semiSyntheticBackspaceGuard)}(e)}}),appendTransaction(e,t,n){if(e.some((e=>e.getMeta("composition"))))return null;if(e.some((e=>e.getMeta(b0.DELETABLE))))return null;const r=e.some((e=>e.docChanged));return r?yue(n):null}})),(this.editor.schema,new y5({key:new w5("prevent-empty-inline-node"),props:{handleKeyDown(e,t){var n;if(e.composing)return!1;const{state:r,dispatch:i}=e,{selection:s}=r,{$from:o,$to:a}=s,l=o.node();if("ArrowLeft"===t.key&&"inputSlot"!==l.type.name&&o.nodeBefore&&o.nodeBefore.isText&&o.nodeBefore.text)if(o.nodeBefore.text===b0.ZERO_WIDTH_CHAR){const e=o.parent,n=o.index();if(n>=2){if(e.child(n-2).attrs.isCustomSlot){const e=o.pos-2;return i(r.tr.setSelection(n5.create(r.doc,e))),t.preventDefault(),!0}}else if(1===n&&0!==o.pos){const e=o.before()-1;return e>0&&i(r.tr.setSelection(n5.create(r.doc,e))),t.preventDefault(),!0}}else if(o.nodeBefore.text.endsWith(b0.ZERO_WIDTH_CHAR)){const e=o.pos-2;return i(r.tr.setSelection(n5.create(r.doc,e))),t.preventDefault(),!0}if("ArrowRight"===t.key&&"inputSlot"!==l.type.name&&o.nodeAfter&&o.nodeAfter.isText)if(o.nodeAfter.text===b0.ZERO_WIDTH_CHAR){const e=o.parent,n=o.index();if(n<e.children.length-1){if(e.child(n+1).attrs.isCustomSlot){const e=o.pos+2;return i(r.tr.setSelection(n5.create(r.doc,e))),t.preventDefault(),!0}}else if(n===e.children.length-1&&r.doc.lastChild!==l){const e=o.after()+1;return i(r.tr.setSelection(n5.create(r.doc,e))),t.preventDefault(),!0}}else if(o.nodeBefore&&o.nodeBefore.isText&&o.nodeBefore.text.startsWith(b0.ZERO_WIDTH_CHAR)){const e=o.pos+2;return i(r.tr.setSelection(n5.create(r.doc,e))),t.preventDefault(),!0}if("Backspace"===t.key&&s.empty){const e=o.nodeBefore,a=o.nodeAfter;if(o.nodeBefore&&o.nodeBefore.isText&&1===(null===(n=o.nodeBefore.text)||void 0===n?void 0:n.length)&&o.nodeBefore.text!==b0.ZERO_WIDTH_CHAR&&o.nodeAfter&&o.nodeAfter.attrs.isCustomSlot){const e=o.pos-o.nodeBefore.nodeSize,n=o.pos;let s=r.tr.delete(e,n);return s=s.insertText(b0.ZERO_WIDTH_CHAR,e,e),i(s),t.preventDefault(),!0}if(e&&e.attrs.isCustomSlot){const n=o.parent,s=o.index(),l=o.pos-e.nodeSize,c=o.pos;let d=l,h=c;if(s>1){const e=n.child(s-2);e&&e.isText&&e.text.endsWith(b0.ZERO_WIDTH_CHAR)&&(d-=1)}if(a.isText&&a.text.startsWith(b0.ZERO_WIDTH_CHAR)&&(h+=1),d!==l||h!==c)return i(r.tr.delete(d,h)),t.preventDefault(),!0}if(a&&a.isText&&a.text===b0.ZERO_WIDTH_CHAR&&0===o.index()&&1!==o.pos){const e=s.from-2;return i(r.tr.delete(e,s.to+1)),t.preventDefault(),!0}if(e&&e.isText&&e.text===b0.ZERO_WIDTH_CHAR){const n=o.parent,a=o.index();if(a>1){const s=n.child(a-2);if(s.attrs.isCustomSlot){const n=o.pos-e.nodeSize-s.nodeSize;return i(r.tr.delete(n,o.pos)),t.preventDefault(),!0}}else if(1===a&&"inputSlot"!==l.type.name&&1!==o.pos){const e=s.from-1-2;return i(r.tr.delete(e,s.to)),t.preventDefault(),!0}}else if("inputSlot"===l.type.name&&o.pos===o.start()){const e=o.node(o.depth-1);let n=null;const s=o.index(o.depth-1);if(s>0&&(n=e.child(s-1),n&&n.isText&&n.text.endsWith(b0.ZERO_WIDTH_CHAR))){const e=o.pos-2;return i(r.tr.setSelection(n5.create(r.doc,e))),t.preventDefault(),!0}const a=o.pos-1;let l=r.tr.insertText(b0.ZERO_WIDTH_CHAR,a,a+1);return l=l.setSelection(n5.create(l.doc,a)),i(l),t.preventDefault(),!0}}if("Backspace"===t.key&&!s.empty){let e=s.from,n=s.to;const a=o.nodeBefore,l=o.nodeAfter;if(a&&a.isText&&a.text.endsWith(b0.ZERO_WIDTH_CHAR)&&(e-=1),l&&l.isText&&l.text.startsWith(b0.ZERO_WIDTH_CHAR)&&(n+=1),e!==s.from||n!==s.to)return i(r.tr.delete(e,n)),t.preventDefault(),!0}if("inputSlot"===l.type.name){if(0===l.textContent.replace(new RegExp(b0.ZERO_WIDTH_CHAR,"g"),"").length&&l.textContent.length>0&&("ArrowLeft"===t.key||"ArrowRight"===t.key)){const e="ArrowLeft"===t.key?o.before():o.after();if(s.from-e!=1&&s.from-e!=-1)return i(r.tr.setSelection(n5.create(r.doc,e))),t.preventDefault(),!0}if("Backspace"===t.key&&s.empty){const e=new RegExp(b0.ZERO_WIDTH_CHAR,"g"),n=l.textContent.replace(e,""),s=l.textContent.length>0&&0===n.length;if(o.pos===o.end()&&1===n.length)return i(r.tr.insertText(b0.ZERO_WIDTH_CHAR,o.start(),o.end())),t.preventDefault(),!0;if(s){const e=o.before();return i(r.tr.delete(e,e+l.nodeSize)),t.preventDefault(),!0}}if(!s.empty&&o.parent===l&&s.from===o.start()&&s.to>=o.end()&&"Backspace"===t.key){const e=r.tr;s.to>o.end()&&e.delete(o.end(),s.to),e.insertText(b0.ZERO_WIDTH_CHAR,o.start(),o.end());const n=o.start()+1;return e.setSelection(n5.create(e.doc,n)),i(e),t.preventDefault(),!0}}return!1}}}))]}});function Eue(e){var t;const{node:n,updateAttributes:r}=e,i=null!==(t=n.attrs.value)&&void 0!==t?t:"",s=JSON.parse(n.attrs.options||"[]").map((e=>({value:e,label:e}))),o=(0,d.useCallback)((e=>{"string"==typeof e&&r({value:e})}),[r]);return h().createElement(Hee,{className:"select-slot-wrapper"},h().createElement(YC,{className:"select-slot",optionList:s,value:i,onChange:o}))}const Cue=Eee.create({name:"selectSlot",inline:!0,group:"inline",atom:!0,selectable:!1,addAttributes:()=>({value:{default:b0.ZERO_WIDTH_CHAR,parseHTML:e=>e.getAttribute("value"),renderHTML:e=>({value:e.value})},options:{default:"",parseHTML:e=>e.getAttribute("options")||"",renderHTML:e=>e.options?{options:e.options}:{}},isCustomSlot:{default:!0,parseHTML:e=>!0,renderHTML:e=>({"data-custom-slot":!!e.isCustomSlot||void 0})}}),parseHTML:()=>[{tag:"select-slot"}],renderHTML(e){let{HTMLAttributes:t}=e;return["select-slot",Q8(t)]},addNodeView:()=>qee(Eue)});function Sue(e){var t,n;const{node:r,editor:i}=e,s=null!==(n=null!==(t=r.attrs.label)&&void 0!==t?t:r.attrs.value)&&void 0!==n?n:"";return""===s?null:h().createElement(Hee,{className:"skill-slot-wrapper"},h().createElement("span",{className:"skill-slot"},s,h().createElement(Ji,{onClick:e=>{e.preventDefault(),e.stopPropagation(),null==i||i.commands.clearContent()},className:"skill-slot-delete"})))}const _ue=Eee.create({name:"skillSlot",inline:!0,group:"inline",atom:!0,selectable:!1,addAttributes:()=>({value:{default:"",parseHTML:e=>e.getAttribute("data-value"),renderHTML:e=>({"data-value":e.value})},label:{parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>({"data-label":e.label})},hasTemplate:{parseHTML:e=>"true"===e.getAttribute("data-template"),renderHTML:e=>({"data-template":e.hasTemplate})},isCustomSlot:{default:!0,parseHTML:e=>!0,renderHTML:e=>({"data-custom-slot":!!e.isCustomSlot||void 0})}}),parseHTML:()=>[{tag:"skill-slot"}],renderHTML(e){let{HTMLAttributes:t}=e;return["skill-slot",Q8(t)]},addNodeView:()=>qee(Sue)}),kue=J9.create({name:"SemiAIChatInput",addStorage:()=>({allowHotKeySend:!0}),addCommands:()=>({setAllowHotKeySendForSemiAIChatInput:e=>t=>{let{storage:n}=t;n.SemiAIChatInput.allowHotKeySend=e}})}),Oue=v0.PREFIX;const Tue=Koe.extend({addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${t=this.options.dataAttribute,t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:"data-placeholder";var t;return[new y5({key:new w5("custom-placeholder"),props:{decorations:t=>{let{doc:n,selection:r}=t;var i;const s=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=r,a=[];if(!s)return null;const l=null!==(i=this.options.showPlaceholderWhenSkillOnly)&&void 0!==i&&i,c=this.editor.isEmpty||l&&(e=>{let t=!0;return e.descendants(((e,n,r)=>{if(!t)return!1;if("skillSlot"===e.type.name)return!1;if(e.isText){if((e.text||"").replace(new RegExp(b0.ZERO_WIDTH_CHAR,"g"),"").length>0)return t=!1,!1}else if("doc"!==e.type.name&&"paragraph"!==e.type.name)return t=!1,!1;return!0})),t})(n);return n.descendants(((t,n)=>{const r=o>=n&&o<=n+t.nodeSize,i=!t.isLeaf&&("paragraph"===t.type.name&&l?(e=>{let t=!0;return e.descendants(((e,n,r)=>{if(!t)return!1;if("skillSlot"===e.type.name)return!1;if(e.isText){if((e.text||"").replace(new RegExp(b0.ZERO_WIDTH_CHAR,"g"),"").length>0)return t=!1,!1}else if("paragraph"!==e.type.name)return t=!1,!1;return!0})),t})(t):v9(t));if((r||!this.options.showOnlyCurrent)&&i){const i=[this.options.emptyNodeClass];c&&i.push(this.options.emptyEditorClass);const s=l&&"paragraph"===t.type.name&&(e=>{let t=!1;return e.descendants(((e,n,r)=>"skillSlot"!==e.type.name||(t=!0,!1))),t})(t);s&&i.push("has-skill-slot");const o={class:i.join(" "),[e]:"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder},d=V6.node(n,n+t.nodeSize,o);a.push(d)}return this.options.includeChildren})),U6.create(n,a)}}})]}}),Pue=e=>{const{setEditor:t,onKeyDown:n,onChange:r,placeholder:i,extensions:s=[],defaultContent:o,onPaste:a,onPasteEvent:l,innerRef:c,handleKeyDown:u,onFocus:p,onBlur:f,handleCreate:m,immediatelyRender:g,showPlaceholderWhenSkillOnly:y}=e,v=(0,d.useCallback)((e=>{setTimeout((()=>{!function(e){const{state:t,dispatch:n}=e,r=t.selection.$from,i=r.node();if("inputSlot"===i.type.name){const e=i.textContent,s=new RegExp(b0.ZERO_WIDTH_CHAR,"g"),o=e.replace(s,"");if(o.length>0&&o.length<e.length){const e=t.tr;return e.insertText(o,r.start(),r.end()),void n(e)}}const s=t.tr;if(r.nodeBefore&&r.nodeBefore.isText){const e=r.nodeBefore.text;if(null==e?void 0:e.startsWith(b0.ZERO_WIDTH_CHAR)){const e=r.pos-r.nodeBefore.nodeSize,t=e+1;s.delete(e,t),n(s)}}}(e)}),60)}),[]),b=(0,d.useCallback)(((e,t,n,r)=>!e.composing&&function(e,t,n,r){const{state:i,dispatch:s}=e,o=i.selection.$from;let a=i.tr;return!!wue(o,a)&&(a=a.insertText(r,a.selection.from,a.selection.to),s(a),!0)}(e,0,0,r)),[]),w=(0,d.useMemo)((()=>{const e={placeholder:i,showPlaceholderWhenSkillOnly:!0},t=y?Tue.configure(e):Koe.configure({placeholder:i});return[Mre,Mce,foe,Goe,mue,xue,Cue,_ue,t,kue,...s]}),[s,i,y]),x=(0,d.useMemo)((()=>({handleKeyDown:u,handlePaste:bue,handleTextInput:b,handleDOMEvents:{compositionend:v}})),[u,b,v]),E=(0,d.useCallback)((e=>{let{editor:t}=e;const{state:n,view:r}=t,i=yue(n);i&&r.dispatch(i),m()}),[m]),C=(0,d.useCallback)((e=>{let{editor:t}=e;const n=t.getText();r(n)}),[r]),S=(0,d.useCallback)((e=>{var t;const n=null===(t=e.clipboardData)||void 0===t?void 0:t.items;let r=[];if(n)for(const e of n){e.getAsFile()&&r.push(e.getAsFile())}r.length&&(null==a||a(r))}),[a]),_=jee({extensions:w,content:null!=o?o:"",editorProps:x,immediatelyRender:g,onCreate:E,onUpdate:C,onPaste:S});return(0,d.useEffect)((()=>{t(_)}),[_,t]),_?h().createElement(h().Fragment,null,h().createElement(Mee,{editor:_,onKeyDown:n,onFocus:p,onBlur:f,onPaste:l,ref:c,className:`${Oue}-editor-content`})):null},Iue=v0.PREFIX;class Mue extends c{constructor(e){super(Object.assign(Object.assign({},Mue.defaultAdapter),e)),this.init=()=>{},this.mouseDownTarget=null,this.destroy=()=>{this._adapter.unregisterClickOutsideHandler()},this.handleSkillSelect=e=>{this.setState({skill:e,skillVisible:!1}),this._adapter.notifySkillChange(e),this._adapter.setContent(F0(e)),this._adapter.focusEditor()},this.changeTemplateVisible=e=>{e&&this.setDropdownWidth(),this.setState({templateVisible:e})},this.handlePaste=e=>{this._adapter.manualUpload(e)},this.handleSuggestionSelect=e=>{this._adapter.setContent(e),this._adapter.focusEditor()},this.handleUploadFileDelete=e=>{var t;const{uploadProps:n}=this.getProps(),{attachments:r}=this.getStates(),i=Array.isArray(r)?r:[];if(null==n?void 0:n.disabled)return;const s=i.findIndex((t=>t.uid===e.uid));if(s<0)return;const o=null==n?void 0:n.beforeRemove;Promise.resolve(null===(t=null==o?void 0:o(e,i))||void 0===t||t).then((t=>{var r;if(!1===t)return;const o=i.slice();o.splice(s,1),null===(r=null==n?void 0:n.onRemove)||void 0===r||r.call(n,e.fileInstance,o,e),this.onUploadChange({currentFile:e,fileList:o})})).catch((()=>{}))},this.handleReferenceDelete=e=>{this._adapter.handleReferenceDelete(e)},this.handleReferenceClick=e=>{this._adapter.handleReferenceClick(e)},this.setActiveSuggestionIndex=e=>{this.setState({activeSuggestionIndex:e})},this.setActiveSkillIndex=e=>{this.setState({activeSkillIndex:e})},this.handleKeyDown=e=>{const{skills:t,suggestions:n,skillHotKey:r}=this.getProps(),{skillVisible:i,suggestionVisible:s}=this.getStates(),o=this._adapter.getEditor(),a=null==o?void 0:o.getText(),{activeSkillIndex:l,activeSuggestionIndex:c}=this.getStates(),d=this._adapter.getPopupID();if(""===a&&e.key===r&&t&&t.length)this.setState({skillVisible:!0}),this.setDropdownWidth();else if(a!==r&&0!==(null==a?void 0:a.length)||"Backspace"!==e.key)if(["ArrowUp","ArrowDown"].includes(e.key)){if(a===r&&t&&t.length){const n=(l+("ArrowUp"===e.key?-1:1)+t.length)%t.length;this.setActiveSkillIndex(n),this.updateScrollTop(n,`#${Iue}-skill-${d} .${Iue}-skill-item:nth-child(${n+1})`)}else if(s&&(null==n?void 0:n.length)){const t=(c+("ArrowUp"===e.key?-1:1)+n.length)%n.length;this.setActiveSuggestionIndex(t),this.updateScrollTop(t,`#${Iue}-suggestion-${d} .${Iue}-suggestion-item:nth-child(${t+1})`)}}else if("Enter"===e.key){if(i){this.setState({skillVisible:!1});const e=t[l];e&&this.handleSkillSelect(e)}else if(s){const e=n[c];this.handleSuggestionSelect(e),this.hideSuggestionPanel()}}else"Escape"===e.key&&(i&&this.setState({skillVisible:!1}),s&&this.hideSuggestionPanel());else this.setState({skillVisible:!1})},this.onConfigureChange=(e,t)=>{this._adapter.notifyConfigureChange(e,t)},this.updateScrollTop=(e,t)=>{if(void 0===e)return;let n=document.querySelector(t);if(n){const e=n.parentNode;e.scrollTop=n.offsetTop-e.offsetTop-e.clientHeight/2+n.clientHeight/2}},this.showSuggestionPanel=()=>{this.setState({suggestionVisible:!0}),this.setDropdownWidth(),this._adapter.registerClickOutsideHandler(this.hideSuggestionPanel)},this.hideSuggestionPanel=()=>{this.setState({suggestionVisible:!1}),this._adapter.unregisterClickOutsideHandler()},this.handleCreate=()=>{this.setState({richTextInit:!0})},this.handleContentChange=e=>{const{transformer:t}=this.getProps(),{skill:n}=this.getStates(),r=this._adapter.getEditor(),i=r.getHTML();if(n&&!i.includes("</skill-slot>"))return this.setState({skill:void 0,templateVisible:!1}),this._adapter.notifySkillChange(void 0),void this._adapter.notifyContentChange([]);if(i.includes("</skill-slot>")){const e=function(e){const t=/([\w-]+)=["']([^"']*)["']/g,n=/<skill-slot\s+([^>]*)><\/skill-slot>/i.exec(e);if(n){const e=n[1];let r,i={};for(;null!==(r=t.exec(e));)i[r[1]]=r[2];if(i["data-value"])return L0({label:i["data-label"],value:i["data-value"],hasTemplate:i["data-template"]?"true"===i["data-template"]:void 0})}}(i);(null==e?void 0:e.value)!==(null==n?void 0:n.value)&&(this.setState({skill:e}),this._adapter.notifySkillChange(e))}const s=r.getJSON(),o=N0(s,t);this._adapter.notifyContentChange(o),this.setState({content:s}),this._adapter.reposPopover()},this.onUploadChange=e=>{const{fileList:t}=e,{onUploadChange:n}=this.getProps();null==n||n(e);const{uploadProps:r}=this.getProps(),{onChange:i}=r;null==i||i(e),this.setState({attachments:t})},this._isRichTextEmpty=()=>{var e;const t=this._adapter.getEditor();if(!t)return!0;return void 0===(null===(e=t.getJSON)||void 0===e?void 0:e.call(t)).content[0].content},this.canSend=()=>{const e=this.getProp("canSend");if(void 0!==e)return e;const{attachments:t}=this.getStates(),n=!this._isRichTextEmpty(),r=Array.isArray(t)&&t.length>0;return n||r},this.handleStopGenerate=()=>{const{generating:e}=this.getProps();e&&this._adapter.notifyStopGenerate()},this.handleSend=()=>{var e,t;const{generating:n,transformer:r}=this.getProps();if(n)return;if(!this.canSend())return;const i=this.getProp("references"),{attachments:s}=this.getStates(),o=this._adapter.getEditor();let a=[];if(o){a=N0(null===(e=o.getJSON)||void 0===e?void 0:e.call(o),r)}this.setState({templateVisible:!1,skillVisible:!1,suggestionVisible:!1}),this._adapter.notifyMessageSend({references:i,attachments:s,inputContents:a,setup:null!==(t=this._adapter.getConfigureValue())&&void 0!==t?t:{}})},this.handleContainerMouseDown=e=>{this.mouseDownTarget=e.target},this.handleContainerClick=e=>{const t=e.target;if(this.mouseDownTarget&&this.mouseDownTarget!==e.target)return;const n=this._adapter.getRichTextDiv();if(!n||n!==t&&!n.contains(t))this._adapter.focusEditor();else{const{suggestions:e}=this.getProps();e&&e.length>0&&this.showSuggestionPanel()}},this.handRichTextArealKeyDown=(e,t)=>{var n;if(e.composing)return!1;const{sendHotKey:r}=this.getProps(),{suggestionVisible:i,skillVisible:s}=this.getStates();if((i||s)&&["ArrowUp","ArrowDown","Enter"].includes(t.key))return!0;const a=null!==(n=this._adapter.getEditor())&&void 0!==n?n:{},l=o()(a,"storage.SemiAIChatInput.allowHotKeySend");if("Enter"===t.key&&(r===b0.SEND_HOTKEY.ENTER?!t.shiftKey:t.shiftKey)&&l)return this.handleSend(),!0;if("Enter"===t.key&&(r===b0.SEND_HOTKEY.ENTER?t.shiftKey:!t.shiftKey)){t.preventDefault();const e=this._adapter.getEditor();if(e&&e.chain&&e.chain().splitBlock)e.chain().focus().splitBlock().run();else if(e&&e.view){const{state:t,view:n}=e;n.dispatch(t.tr.split(t.selection.from))}return!0}return t.key,!1},this.handleDeleteContent=e=>{const{uniqueKey:t}=e,n=this._adapter.getEditor();n&&n.commands.command((e=>{let{tr:r,state:i}=e,s=!1;return i.doc.descendants(((e,n)=>"referSlot"!==e.type.name||e.attrs.uniqueKey!==t||(r.setSelection(this._adapter.createSelection(r.doc,n)),s=!0,!1))),!!s&&(setTimeout((()=>{n.view.dispatch(r),n.commands.deleteSelection()}),0),!0)}))},this.handleFocus=e=>{this._adapter.notifyFocus(e)},this.handleBlur=e=>{this._adapter.notifyBlur(e)}}setDropdownWidth(){const{style:e,dropdownMatchTriggerWidth:t}=this.getProps();let n;t&&(n=e&&er()(e.width)||e&&xe()(e.width)&&!e.width.includes("%")?e.width:this._adapter.getTriggerWidth()),n&&this.setState({popupWidth:n})}}const Rue=v0.PREFIX,Aue=h().memo((e=>{const{skill:t,onClick:n,isActive:r,renderSkillItem:i,onMouseEnter:s,index:o}=e,a=w()(`${Rue}-skill-item`,{[`${Rue}-skill-item-active`]:r}),l=(0,d.useCallback)((()=>{n(t)}),[n,t]),c=(0,d.useCallback)((()=>{null==s||s(o)}),[o,s]);return i?h().createElement(h().Fragment,null,i({skill:t,className:a,onClick:l,onMouseEnter:c})):h().createElement("div",{className:a,onClick:l,onMouseEnter:c},t.icon,h().createElement("div",{className:`${Rue}-skill-item-content`},t.label))})),Nue=Aue,Due=v0.PREFIX,Lue=h().memo((e=>{const{suggestion:t,onClick:n,isActive:r,renderSuggestionItem:i,onMouseEnter:s,index:o}=e,a="string"==typeof t?t:null==t?void 0:t.content,l=w()(`${Due}-suggestion-item`,{[`${Due}-suggestion-item-active`]:r}),c=(0,d.useCallback)((()=>{null==n||n(t)}),[n,t]),u=(0,d.useCallback)((()=>{null==s||s(o)}),[o,s]);return i?h().createElement(h().Fragment,null,i({suggestion:t,className:l,onClick:c,onMouseEnter:u})):h().createElement("div",{className:l,onClick:c,onMouseEnter:u},a)})),Fue=Lue;var jue=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const $ue=v0.PREFIX;class Bue extends f{constructor(e){var t,n;super(e),this.richTextDIVRef=h().createRef(),this.suggestionPanelRef=h().createRef(),this.setContent=e=>{this.adapter.setContent(e)},this.focusEditor=e=>{this.adapter.focusEditor(e)},this.changeTemplateVisible=e=>{this.foundation.changeTemplateVisible(e)},this.getEditor=()=>this.editor,this.setEditor=e=>{this.editor=e},this.setContentWhileSaveTool=e=>{const{skill:t}=this.state;let n="";n=t?`<p>${F0(t)}${e}</p>`:`<p>${e}</p>`,this.setContent(n)},this.handleReferenceDelete=e=>{const{onReferenceDelete:t}=this.props;t(e)},this.deleteUploadFile=e=>{this.foundation.handleUploadFileDelete(e)},this.renderLeftFooter=()=>{const{renderConfigureArea:e,round:t,showTemplateButton:n}=this.props,{skill:r={}}=this.state,{hasTemplate:i}=r;return h().createElement(Jt,{componentName:"AIChatInput"},(r=>h().createElement("div",{className:`${$ue}-footer-configure`},h().createElement(X0,{ref:this.configureRef,round:t,onChange:this.foundation.onConfigureChange},null==e?void 0:e(),(n||i)&&h().createElement(X0.Button,{key:"template",field:"template",onClick:this.changeTemplateVisible,icon:h().createElement(C0,null)},r.template)))))},this.renderUploadNode=()=>{const{uploadTipProps:e,uploadProps:t,renderUploadButton:n}=this.props,{attachments:r}=this.state,i=null!=t?t:{},{children:s}=i,o=jue(i,["children"]),a=Object.assign(Object.assign({},o),{onChange:this.foundation.onUploadChange}),l={defaultNode:null!=s?s:h().createElement("button",{className:`${$ue}-footer-action-button ${$ue}-footer-action-upload`},h().createElement(S0,null)),openFileDialog:()=>{var e,t;null===(t=null===(e=this.uploadRef.current)||void 0===e?void 0:e.openFileDialog)||void 0===t||t.call(e)},disabled:Boolean(null==t?void 0:t.disabled),attachments:null!=r?r:[]},c=n?n(l):l.defaultNode,d=h().createElement(MI,Object.assign({ref:this.uploadRef,fileList:r,listType:"none"},a,{key:"upload"}),c);return e?h().createElement(_t,Object.assign({},e,{key:"upload"}),h().createElement("span",null,d)):d},this.renderSendButton=()=>{const{generating:e}=this.props,t=this.foundation.canSend();return h().createElement("button",{key:"send",className:w()(`${$ue}-footer-action-button`,{[`${$ue}-footer-action-send`]:!e,[`${$ue}-footer-action-stop`]:e,[`${$ue}-footer-action-send-disabled`]:!e&&!t}),onClick:e?this.foundation.handleStopGenerate:this.foundation.handleSend},e?h().createElement(_0,null):h().createElement(uW,null))},this.renderRightFooter=()=>{const{renderActionArea:e,showUploadButton:t}=this.props,n=`${$ue}-footer-action`,r=[t&&this.renderUploadNode(),this.renderSendButton()].filter(Boolean);return e?e({menuItem:r,className:n}):h().createElement("div",{className:n},r)},this.renderFooter=()=>{const e=this.props.round;return h().createElement("div",{className:w()(`${$ue}-footer`,{[`${$ue}-footer-round`]:e})},this.renderLeftFooter(),this.renderRightFooter())},this.editor=null;const r=null!==(n=null===(t=null==e?void 0:e.uploadProps)||void 0===t?void 0:t.defaultFileList)&&void 0!==n?n:[];this.state={popupKey:1,templateVisible:!1,skillVisible:!1,suggestionVisible:!1,attachments:r,content:null,popupWidth:null,skill:void 0,activeSkillIndex:0,activeSuggestionIndex:0,richTextInit:!1},this.triggerRef=h().createRef(),this.popUpOptionListID=We(),this.foundation=new Mue(this.adapter),this.transformedContent=[],this.uploadRef=h().createRef(),this.configureRef=h().createRef(),this.richTextDIVRef=h().createRef(),this.suggestionPanelRef=h().createRef(),this.clickOutsideHandler=null}get adapter(){return Object.assign(Object.assign({},super.adapter),{reposPopover:g()((()=>{const{templateVisible:e}=this.state;e&&this.setState({popupKey:this.state.popupKey+1})}),200),setContent:e=>{this.editor.commands.setContent(e)},clearContent:()=>{this.setContent("")},clearAttachments:()=>{this.setState({attachments:[]})},focusEditor:e=>{var t;null===(t=this.editor)||void 0===t||t.commands.focus(e||"end")},getTriggerWidth:()=>{const e=this.triggerRef.current;return e&&e.getBoundingClientRect().width},getEditor:()=>this.editor,getPopupID:()=>this.popUpOptionListID,notifySkillChange:e=>{var t,n;null===(n=(t=this.props).onSkillChange)||void 0===n||n.call(t,e)},notifyContentChange:e=>{var t,n;this.transformedContent=e,null===(n=(t=this.props).onContentChange)||void 0===n||n.call(t,e)},notifyConfigureChange:(e,t)=>{var n,r;null===(r=(n=this.props).onConfigureChange)||void 0===r||r.call(n,e,t)},manualUpload:e=>{const t=this.uploadRef.current;t&&t.insert(e)},notifyMessageSend:e=>{var t,n;null===(n=(t=this.props).onMessageSend)||void 0===n||n.call(t,e)},notifyStopGenerate:()=>{var e,t;null===(t=(e=this.props).onStopGenerate)||void 0===t||t.call(e)},getRichTextDiv:()=>{var e;return null===(e=this.richTextDIVRef)||void 0===e?void 0:e.current},registerClickOutsideHandler:e=>{const t=t=>{const n=this.suggestionPanelRef&&this.suggestionPanelRef.current,r=this.triggerRef&&this.triggerRef.current,i=t.target,s=t.composedPath&&t.composedPath()||[i];!n||n.contains(i)&&n.contains(i.parentNode)||!r||r.contains(i)||s.includes(r)||s.includes(n)||e(t)};this.clickOutsideHandler=t,document.addEventListener("mousedown",t,!1)},unregisterClickOutsideHandler:()=>{this.clickOutsideHandler&&document.removeEventListener("mousedown",this.clickOutsideHandler,!1)},handleReferenceDelete:e=>{var t,n;null===(n=(t=this.props).onReferenceDelete)||void 0===n||n.call(t,e)},handleReferenceClick:e=>{var t,n;null===(n=(t=this.props).onReferenceClick)||void 0===n||n.call(t,e)},isSelectionText:e=>e instanceof n5,createSelection:(e,t)=>i5.create(e,t),notifyFocus:e=>{var t,n;null===(n=(t=this.props).onFocus)||void 0===n||n.call(t,e)},notifyBlur:e=>{var t,n;null===(n=(t=this.props).onBlur)||void 0===n||n.call(t,e)},getConfigureValue:()=>{var e,t;return null===(t=null===(e=this.configureRef)||void 0===e?void 0:e.current)||void 0===t?void 0:t.getConfigureValue()}})}componentDidUpdate(e){const{suggestions:t,keepSkillAfterSend:n,clearContentOnGenerating:r}=this.props;if(!Oe()(t,e.suggestions)){!!(t&&t.length>0)?this.foundation.showSuggestionPanel():this.foundation.hideSuggestionPanel()}this.props.generating&&this.props.generating!==e.generating&&!1!==r&&(n?this.setContentWhileSaveTool(""):this.adapter.clearContent(),this.adapter.clearAttachments())}componentWillUnmount(){this.foundation.destroy()}deleteContent(e){this.foundation.handleDeleteContent(e)}renderTemplate(){const{skill:e}=this.state,{renderTemplate:t,templatesStyle:n,templatesCls:r}=this.props,{popupWidth:i}=this.state;return h().createElement("div",{className:w()(`${$ue}-template`,{[r]:r}),style:Object.assign({width:i,maxHeight:500},n)},null==t?void 0:t(e,this.setContent))}renderSkill(){const{popupWidth:e}=this.state,{skills:t,renderSkillItem:n}=this.props;return h().createElement("div",{id:`${$ue}-skill-${this.popUpOptionListID}`,className:`${$ue}-skill`,style:{width:e,maxHeight:x0}},null==t?void 0:t.map(((e,t)=>h().createElement(Nue,{index:t,isActive:this.state.activeSkillIndex===t,key:e.key||e.value,skill:e,renderSkillItem:n,onClick:this.foundation.handleSkillSelect,onMouseEnter:this.foundation.setActiveSkillIndex}))))}renderSuggestions(){const{suggestions:e,renderSuggestionItem:t}=this.props,{popupWidth:n,activeSuggestionIndex:r}=this.state;return h().createElement("div",{id:`${$ue}-suggestion-${this.popUpOptionListID}`,className:`${$ue}-suggestion`,style:{width:n,maxHeight:E0},ref:this.suggestionPanelRef},e.map(((e,n)=>h().createElement(Fue,{index:n,key:"string"==typeof e?e:e&&"content"in e?e.content:n,suggestion:e,isActive:r===n,renderSuggestionItem:t,onClick:this.foundation.handleSuggestionSelect,onMouseEnter:this.foundation.setActiveSuggestionIndex}))))}renderPopoverContent(){const{templateVisible:e,skillVisible:t,suggestionVisible:n}=this.state;return e?this.renderTemplate():t?this.renderSkill():n?this.renderSuggestions():null}getIconByType(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"small";if("text"===e)return null;switch(e){case"file":case"word":t=h().createElement(CQ,{size:n});break;case"code":t=h().createElement(kQ,{size:n});break;case"excel":t=h().createElement(_Q,{size:n});break;case"video":t=h().createElement(OQ,{size:n});break;case"audio":t=h().createElement(k0,{size:n});break;case"pdf":t=h().createElement(SQ,{size:n});break;default:t=h().createElement(cP,{size:n})}return t}getReferenceIconByType(e){let t=this.getIconByType(e);return h().createElement("span",{className:`${$ue}-ref-icon ${$ue}-ref-icon-${e} ${$ue}-reference-icon`},t)}getAttachmentIconByType(e){let t=this.getIconByType(e,"large");return h().createElement("span",{className:`${$ue}-attachment-icon ${$ue}-ref-icon ${$ue}-ref-icon-${e}`},t)}renderReference(){const{references:e=[],renderReference:t}=this.props;return 0===e.length?null:h().createElement("div",{className:`${$ue}-references`},e.map((e=>{if(t)return t(e);const{id:n,type:r,content:i,name:s,url:o}=e,a=M0(e),l=R0(I0(e));return h().createElement("div",{key:n,className:`${$ue}-reference`,onClick:()=>{this.foundation.handleReferenceClick(e)}},h().createElement(TQ,null),h().createElement("span",{className:`${$ue}-reference-content`},"text"!==r&&(a?h().createElement("img",{className:`${$ue}-reference-img`,src:o,alt:s}):this.getReferenceIconByType(l)),h().createElement("span",{className:`${$ue}-reference-name`},"text"===r?i:s)),h().createElement(O0,{size:"small",className:`${$ue}-reference-delete`,onClick:t=>{this.handleReferenceDelete(e),t.stopPropagation()}}))})))}renderAttachment(){const{attachments:e=[]}=this.state;return 0===e.length?null:h().createElement(P0,{prefix:`${$ue}`},null==e?void 0:e.map(((e,t)=>{const n=M0(e),r=I0(e),i=R0(r),{uid:s,name:o,url:a,size:l,percent:c,status:d}=e,u=!(100===c||void 0===c)&&"uploading"===d;return h().createElement("div",{className:`${$ue}-attachment`,key:s},n?h().createElement("img",{className:`${$ue}-attachment-img`,src:a,alt:o}):this.getAttachmentIconByType(i),h().createElement("div",{className:`${$ue}-attachment-content`},h().createElement("div",{className:`${$ue}-attachment-content-name`},o),h().createElement("div",{className:`${$ue}-attachment-content-size`},`${r} ${l}`)),u&&h().createElement(gS,{type:"circle",width:30,className:`${$ue}-attachment-progress`,percent:c,showInfo:!1,"aria-label":"upload progress"}),h().createElement(Ji,{className:`${$ue}-attachment-delete`,size:"small",onClick:()=>{this.foundation.handleUploadFileDelete(e)}}))})))}renderTopArea(){const{references:e,topSlotPosition:t,renderTopSlot:n,showReference:r,showUploadFile:i}=this.props,{attachments:s}=this.state,o=null==n?void 0:n({references:e,attachments:s,content:this.transformedContent,handleUploadFileDelete:this.foundation.handleUploadFileDelete,handleReferenceDelete:this.handleReferenceDelete});return h().createElement(h().Fragment,null,"top"===t&&o,r&&this.renderReference(),"middle"===t&&o,i&&this.renderAttachment(),"bottom"===t&&o)}render(){const{direction:e}=this.context,t="rtl"===e?"bottomRight":"bottomLeft",{style:n,className:r,popoverProps:i,placeholder:s,extensions:o,defaultContent:a,immediatelyRender:l,onPaste:c}=this.props,{templateVisible:d,skillVisible:u,suggestionVisible:p,popupKey:f}=this.state;return h().createElement(Cn,Object.assign({position:t},i,{rePosKey:f,className:w()({[`${$ue}-popover-suggestion`]:p,[`${$ue}-popover-skill`]:u,[`${$ue}-popover-template`]:d}),content:this.renderPopoverContent(),visible:d||u||p,trigger:"custom",disableArrowKeyDown:!0}),h().createElement("div",{className:w()($ue,{[r]:r}),style:n,ref:this.triggerRef,onClick:this.foundation.handleContainerClick,onMouseDown:this.foundation.handleContainerMouseDown},this.renderTopArea(),h().createElement(Pue,{immediatelyRender:l,innerRef:this.richTextDIVRef,defaultContent:a,placeholder:s,onKeyDown:this.foundation.handleKeyDown,setEditor:this.setEditor,onChange:this.foundation.handleContentChange,extensions:o,handleKeyDown:this.foundation.handRichTextArealKeyDown,onPasteEvent:c,onPaste:this.foundation.handlePaste,onFocus:this.foundation.handleFocus,onBlur:this.foundation.handleBlur,handleCreate:this.foundation.handleCreate,showPlaceholderWhenSkillOnly:this.props.showPlaceholderWhenSkillOnly}),this.renderFooter()))}}Bue.__SemiComponentName__="AIChatInput",Bue.Configure=X0,Bue.contextType=lt,Bue.getCustomSlotAttribute=D0,Bue.defaultProps=he(Bue.__SemiComponentName__,{onContentChange:i(),onStopGenerate:i(),showReference:!0,showUploadFile:!0,generating:!1,dropdownMatchTriggerWidth:!0,round:!0,topSlotPosition:"top",sendHotKey:b0.SEND_HOTKEY.ENTER,keepSkillAfterSend:!1,showUploadButton:!0,clearContentOnGenerating:!0});const Vue=Bue;function zue(e){return e.choices.map((t=>{var n,r;const i=t.message,s=i.role,o=e.id,a="completed",l=[];if(""!==i.content||""!==i.refusal){const e=(null===(n=i.annotations)||void 0===n?void 0:n.length)?i.annotations.map((e=>Object.assign({type:e.type},e.url_citation||{}))):[],t=[""!==i.content&&{type:"output_text",text:i.content,annotations:e},""!==i.refusal&&{type:"refusal",refusal:i.refusal}].filter(Boolean);l.push({type:"message",id:o,role:"assistant",status:a,content:t})}if(i.function_call&&l.push(Object.assign(Object.assign({},i.function_call),{type:"function_call",status:"completed"})),null===(r=null==i?void 0:i.tool_calls)||void 0===r?void 0:r.length){const e=i.tool_calls.map((e=>"function"===e.type?Object.assign(Object.assign({status:"completed"},e.function),{type:"function_call"}):Object.assign(Object.assign({},e.custom),{type:"custom_call"})));l.push(...e)}return i.audio&&l.push(Object.assign({type:"audio"},i.audio)),{id:o,role:s,content:l,status:a}}))}var Hue=__webpack_require__("c2re"),Uue=__webpack_require__.n(Hue);function Kue(e,t){const n=Wue(e).map(((e,n)=>{var r,i,s,o,a,l,c,d,h;const u=e[0].id,p=Gue(e),f=`${u}:${null!==(o=null===(s=null===(i=null===(r=e[0])||void 0===r?void 0:r.choices)||void 0===i?void 0:i[0])||void 0===s?void 0:s.index)&&void 0!==o?o:n}`,m=null!==(l=null===(a=null==t?void 0:t.processedCountByIndex)||void 0===a?void 0:a[f])&&void 0!==l?l:0,g=m>0?Math.min(m,e.length):0,y=t?e.slice(g):e;if(t&&0===y.length)return null===(c=t.previousResult)||void 0===c?void 0:c[n];const v=null===(d=null==t?void 0:t.previousResult)||void 0===d?void 0:d[n];let b="",w="",x={name:"",arguments:""},E=[];null===(h=null==v?void 0:v.content)||void 0===h||h.forEach((e=>{var t;null===(t=e.content)||void 0===t||t.forEach((e=>{"output_text"===e.type&&(b+=e.text),"refusal"===e.type&&(w+=e.refusal)})),"function_call"!==e.type||e.id||(x.name=e.name,x.arguments=e.arguments),("tool_call"===e.type||"function_call"===e.type&&e.id)&&E.push(e)})),y.map((e=>{const t=e.choices[0].delta;(null==t?void 0:t.content)&&(b+=t.content),(null==t?void 0:t.refusal)&&(w+=t.refusal),(null==t?void 0:t.function_call)&&(t.function_call.name&&(x.name+=t.function_call.name),x.arguments+=t.function_call.arguments),(null==t?void 0:t.tool_calls)&&(null==t||t.tool_calls.forEach((e=>{var t,n;const r=E.find((t=>t.id===e.id));r?((null===(t=null==e?void 0:e.function)||void 0===t?void 0:t.name)?(r.name+=e.function.name,r.arguments+=e.function.arguments):(null===(n=null==e?void 0:e.custom)||void 0===n?void 0:n.name)&&(r.name+=e.custom.name,r.input+=e.custom.input),r.status=p):E.push(Object.assign(Object.assign(Object.assign({},null==e?void 0:e.function),null==e?void 0:e.custom),{type:(null==e?void 0:e.function)?"function_call":"custom_call",id:e.id}))})))}));const C=[""!==b&&{type:"output_text",text:b},""!==w&&{type:"refusal",refusal:w}].filter(Boolean),S=[C.length>0&&{type:"message",id:u,role:"assistant",status:p,content:C},""!==x.name&&Object.assign({type:"function_call"},x),...E].filter(Boolean);return t&&t.processedCountByIndex?t.processedCountByIndex[f]=e.length:t={processedCountByIndex:{[f]:e.length}},{id:u,role:"assistant",content:S,status:p}})).filter(Boolean);return t.previousResult=Uue()(n),{messages:n,state:t}}const Wue=e=>{const t=[];return e.forEach((e=>{e.choices.forEach((n=>{const r=n.index;t[r]||(t[r]=[]),t[r].push(Object.assign(Object.assign({},e),{choices:[n]}))}))})),t},Gue=e=>null!==e[e.length-1].choices[0].finish_reason?"completed":"in_progress";function que(e,t){var n,r,i,s;if(!(null==e?void 0:e.length))return null;const o=e[e.length-1];if("response.completed"===o.type){const{response:e}=o,{id:t,model:n,status:r,output:i,output_text:s,created_at:a}=e;return{message:{id:t,role:"assistant",content:i,createdAt:a,output_text:s,model:n,status:r},nextState:null}}const a=t?{processedSeq:new Set(t.processedSeq),outputs:new Map(t.outputs),meta:Object.assign({},t.meta),error:null!==(n=t.error)&&void 0!==n?n:null,buffer:new Map(t.buffer),lastProcessedSeq:null!==(r=t.lastProcessedSeq)&&void 0!==r?r:-1}:{processedSeq:new Set,outputs:new Map,meta:{},error:null,buffer:new Map,lastProcessedSeq:-1},l=(Array.isArray(e)?e:[]).filter((e=>{const t=null==e?void 0:e.sequence_number;return"number"!=typeof t||!a.processedSeq.has(t)}));for(const e of l){const t=null==e?void 0:e.sequence_number;"number"==typeof t?a.buffer.set(t,e):a.buffer.set(a.lastProcessedSeq+.5,e)}const c=e=>{var t,n,r,i,s,o,l,c,d,h,u,p,f,m,g,y,v,b,w,x,E,C,S,_,k,O,T,P,I,M,R,A,N,D,L;switch(e.type){case"response.created":{const{response:s}=e;s&&(a.meta.id=null!==(t=s.id)&&void 0!==t?t:a.meta.id,a.meta.model=null!==(n=s.model)&&void 0!==n?n:a.meta.model,a.meta.status=null!==(r=s.status)&&void 0!==r?r:a.meta.status,a.meta.created_at=null!==(i=s.created_at)&&void 0!==i?i:a.meta.created_at);break}case"response.output_item.added":{const t="number"==typeof e.output_index?e.output_index:0;a.outputs.has(t)||a.outputs.set(t,Xue(null!==(s=e.item)&&void 0!==s?s:{}));break}case"response.output_item.done":{const{output_index:t,item:n}=e;a.outputs.set(t,Xue(n));break}case"response.content_part.added":case"response.content_part.done":{const{output_index:t,content_index:n,part:r}=e,i=a.outputs.get(t);i.content=null!==(o=i.content)&&void 0!==o?o:[],i.content[n]=Xue(r);break}case"response.output_text.delta":{const{output_index:t,content_index:n,delta:r}=e,i=a.outputs.get(t);i.content=null!==(l=i.content)&&void 0!==l?l:[],i.content[n]=null!==(c=i.content[n])&&void 0!==c?c:{type:"output_text",text:""},i.content[n].text=(null!==(d=i.content[n].text)&&void 0!==d?d:"")+(null!=r?r:"");break}case"response.output_text.done":{const{output_index:t,content_index:n,text:r}=e,i=a.outputs.get(t);i.content=null!==(h=i.content)&&void 0!==h?h:[],i.content[n]=null!==(u=i.content[n])&&void 0!==u?u:{type:"output_text",text:""},i.content[n].text=r;break}case"response.output_text.annotation.added":{const{output_index:t,content_index:n,annotation_index:r,annotation:i}=e,s=a.outputs.get(t);s.content=null!==(p=s.content)&&void 0!==p?p:[],s.content[n]=null!==(f=s.content[n])&&void 0!==f?f:{type:"output_text",text:"",annotations:[]},s.content[n].annotations=null!==(m=s.content[n].annotations)&&void 0!==m?m:[],s.content[n].annotations[r]=Xue(i);break}case"response.refusal.delta":{const{output_index:t,content_index:n,delta:r}=e,i=a.outputs.get(t);i.content=null!==(g=i.content)&&void 0!==g?g:[],i.content[n]=null!==(y=i.content[n])&&void 0!==y?y:{type:"refusal",refusal:""},i.content[n].refusal=(null!==(v=i.content[n].refusal)&&void 0!==v?v:"")+(null!=r?r:"");break}case"response.refusal.done":{const{output_index:t,content_index:n,refusal:r}=e,i=a.outputs.get(t);i.content=null!==(b=i.content)&&void 0!==b?b:[],i.content[n]=null!==(w=i.content[n])&&void 0!==w?w:{type:"refusal",refusal:""},i.content[n].refusal=r;break}case"response.reasoning_summary_part.added":case"response.reasoning_summary_part.done":{const{output_index:t,summary_index:n,part:r}=e,i=a.outputs.get(t);i.summary=null!==(x=i.summary)&&void 0!==x?x:[],i.summary[n]=Xue(r);break}case"response.reasoning_summary_text.delta":{const{output_index:t,summary_index:n,delta:r}=e,i=a.outputs.get(t);i.summary=null!==(E=i.summary)&&void 0!==E?E:[],i.summary[n]=null!==(C=i.summary[n])&&void 0!==C?C:{type:"reasoning",text:""},i.summary[n].text=(null!==(S=i.summary[n].text)&&void 0!==S?S:"")+(null!=r?r:"");break}case"response.reasoning_summary_text.done":{const{output_index:t,summary_index:n,text:r}=e,i=a.outputs.get(t);i.summary=null!==(_=i.summary)&&void 0!==_?_:[],i.summary[n]=null!==(k=i.summary[n])&&void 0!==k?k:{type:"reasoning",text:""},i.summary[n].text=r;break}case"response.reasoning_text.delta":{const{output_index:t,content_index:n,delta:r}=e,i=a.outputs.get(t);i.content=null!==(O=i.content)&&void 0!==O?O:[],i.content[n]=null!==(T=i.content[n])&&void 0!==T?T:{type:"reasoning",text:""},i.content[n].text=(null!==(P=i.content[n].text)&&void 0!==P?P:"")+(null!=r?r:"");break}case"response.reasoning_text.done":{const{output_index:t,content_index:n,text:r}=e,i=a.outputs.get(t);i.content=null!==(I=i.content)&&void 0!==I?I:[],i.content[n]=null!==(M=i.content[n])&&void 0!==M?M:{type:"reasoning",text:""},i.content[n].text=r;break}case"response.function_call_arguments.delta":{const{output_index:t,delta:n}=e,r=a.outputs.get(t);r.arguments=(null!==(R=r.arguments)&&void 0!==R?R:"")+(null!=n?n:"");break}case"response.function_call_arguments.done":{const{output_index:t,name:n}=e,r=a.outputs.get(t);r.arguments=e.arguments,r.name=n;break}case"response.custom_tool_call_input.delta":{const{output_index:t,delta:n}=e,r=a.outputs.get(t);r.input=(null!==(A=r.input)&&void 0!==A?A:"")+(null!=n?n:"");break}case"response.custom_tool_call_input.done":{const{output_index:t,input:n}=e;a.outputs.get(t).input=n;break}case"response.mcp_call_arguments.delta":{const{output_index:t,delta:n}=e,r=a.outputs.get(t);r.arguments=(null!==(N=r.arguments)&&void 0!==N?N:"")+(null!=n?n:"");break}case"response.mcp_call_arguments.done":{const{output_index:t}=e;a.outputs.get(t).arguments=e.arguments;break}case"response.file_search_call.in_progress":case"response.web_search_call.in_progress":case"response.image_generation_call.in_progress":case"response.mcp_call.in_progress":case"response.mcp_list_tools.in_progress":case"response.code_interpreter_call.in_progress":{const t=a.outputs.get(e.output_index);t&&(t.status="in_progress");break}case"response.mcp_call.failed":case"response.mcp_list_tools.failed":{const t=a.outputs.get(e.output_index);t&&(t.status="failed");break}case"response.file_search_call.completed":case"response.web_search_call.completed":case"response.image_generation_call.completed":case"response.mcp_call.completed":case"response.mcp_list_tools.completed":case"response.code_interpreter_call.completed":{const t=a.outputs.get(e.output_index);t&&(t.status="completed");break}case"response.code_interpreter_call_code.delta":{const{output_index:t,delta:n}=e,r=a.outputs.get(t);r.code=(null!==(D=r.code)&&void 0!==D?D:"")+(null!=n?n:"");break}case"response.code_interpreter_call_code.done":{const{output_index:t,code:n}=e;a.outputs.get(t).code=n;break}case"response.image_generation_call.partial_image":{const t=a.outputs.get(e.output_index);t&&(t.result=e.partial_image_b64);break}case"error":a.error={code:e.code,message:e.message};break;case"response.completed":e.response?a.meta.status=null!==(L=e.response.status)&&void 0!==L?L:"completed":a.meta.status="completed"}};let d=a.lastProcessedSeq+1,h=!1;do{h=!1;const e=a.buffer.get(d);if(e)c(e),a.processedSeq.add(d),a.buffer.delete(d),a.lastProcessedSeq=d,d++,h=!0;else{const e=a.lastProcessedSeq+.5,t=a.buffer.get(e);t&&(c(t),a.buffer.delete(e),a.lastProcessedSeq=d,d++,h=!0)}}while(h);const u=Array.from(a.buffer.keys()).filter((e=>"number"==typeof e&&e===Math.floor(e))).sort(((e,t)=>e-t));if(u.length>10){let e=a.lastProcessedSeq;for(const t of u){if(t!==e+1)break;{const n=a.buffer.get(t);n&&(c(n),a.processedSeq.add(t),a.buffer.delete(t),a.lastProcessedSeq=t,e=t)}}}const p=Array.from(a.outputs.values()).filter((e=>null!==e)),f=p.filter((e=>"output_text"===(null==e?void 0:e.type))).map((e=>{var t;return null!==(t=null==e?void 0:e.text)&&void 0!==t?t:""})).join("");return{message:(null==p?void 0:p.length)||a.meta.id?{id:a.meta.id,role:"assistant",content:p,createdAt:a.meta.created_at,output_text:f,model:a.meta.model,status:null!==(i=a.meta.status)&&void 0!==i?i:"in_progress",error:null!==(s=a.error)&&void 0!==s?s:null}:null,nextState:a}}function Xue(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map((e=>Xue(e)));const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=Xue(e[n]));return t}function Yue(e){const{id:t,model:n,status:r,output:i,output_text:s,created_at:o}=e;return{id:t,role:"assistant",content:i,createdAt:o,output_text:s,model:n,status:r}}function Zue(e){const{references:t,attachments:n,inputContents:r,setup:i}=e;let s=[];return(null==n?void 0:n.length)&&n.forEach((e=>{const{name:t,url:n}=e;t.includes(".png")||t.includes(".jpg")||t.includes(".jpeg")?s.push(Object.assign(Object.assign({},e),{type:"input_image",image_url:n,detail:"auto"})):s.push(Object.assign(Object.assign({},e),{type:"input_file",file_url:n,filename:t}))})),(null==r?void 0:r.length)&&r.forEach((e=>{s.push({type:"input_text",text:e.text})})),{role:"user",content:[{type:"message",role:"user",content:s}],model:null==i?void 0:i.model,references:t,setup:null!=i?i:{}}}function Jue(e){const{references:t,attachments:n,inputContents:r,setup:i}=e;let s=[];return(null==n?void 0:n.length)&&n.forEach((e=>{const{name:t,url:n}=e;t.includes(".png")||t.includes(".jpg")||t.includes(".jpeg")?s.push({type:"image_url",image_url:{url:n}}):s.push({type:"file",file:{file_data:e.file_data,filename:t,file_id:null==e?void 0:e.id}})})),(null==r?void 0:r.length)&&r.forEach((e=>{s.push({type:"text",text:e.text})})),{role:"user",messages:[{role:"user",content:s}],model:null==i?void 0:i.model,references:t,setup:null!=i?i:{}}}const Que={SIDEBAR:`${C}-sidebar`,COLLAPSE:`${C}-sidebar-collapse`,SIDEBAR_CONTENT:`${C}-sidebar-content`,MCP_CONFIGURE_CONTENT:`${C}-sidebar-mcp-configure-content`,ANNOTATION_CONTENT:`${C}-sidebar-annotation_content`,ANNOTATION_ITEM:`${C}-sidebar-annotation-item`,ANNOTATION:`${C}-sidebar-annotation`,OPTIONS:`${C}-sidebar-options`,FILE:`${C}-sidebar-file`},epe={MODE:{MAIN:"main",CODE:"code",FILE:"file"},MCP_MODE:{INNER:"inner",CUSTOM:"custom"},DIRECTION:{left:!0,right:!1,top:!1,bottom:!1,topLeft:!1,topRight:!1,bottomLeft:!1,bottomRight:!1},JSON_VIEWER_OPTIONS:{readOnly:!0,autoWrap:!0}};__webpack_require__("YFjQ");class tpe extends c{constructor(e){super(Object.assign(Object.assign({},tpe.defaultAdapter),e)),this.init=()=>{},this.destroy=()=>{this.afterHide()},this.toggleDisplayNone=e=>{this._adapter.toggleDisplayNone(e)},this.handleAnimationEnd=()=>{const{visible:e}=this.getProps();this.toggleDisplayNone(!e)}}handleCancel(e){this._adapter.notifyCancel(e)}beforeShow(){this._adapter.setOnKeyDownListener()}afterHide(){this._adapter.removeKeyDownListener()}handleKeyDown(e){const{closeOnEsc:t}=this.getProps();if(t&&e.keyCode===cn.ESC)return e.stopPropagation(),void this.handleCancel(e)}onVisibleChange(e){this._adapter.notifyVisibleChange(e)}}const npe=Que.SIDEBAR;class rpe extends f{constructor(e){super(e),this.handleKeyDown=e=>{this.foundation.handleKeyDown(e)},this.handleCancel=e=>{this.foundation.handleCancel(e)},this.renderHeader=()=>{const{renderHeader:e}=this.props,{onCancel:t,title:n,showClose:r}=this.props,i=null==e?void 0:e();return i||h().createElement("div",{className:`${npe}-container-header`},h().createElement("div",{className:`${npe}-container-header-title`},n),r&&h().createElement(vs,{className:`${npe}-container-header-closeBtn`,icon:h().createElement(Ji,null),theme:"borderless",type:"tertiary","aria-label":"close",onClick:t,size:"small"}))},this.innerContent=e=>{var t;const{animationClassName:n,animationStyle:r,animationEventsNeedBind:i}=e,{containerRef:s}=this.props,{children:o,style:a={},className:l}=this.props;return h().createElement("div",Object.assign({className:w()(`${npe}-container`,{[l]:l,[n]:n}),ref:s,style:Object.assign(Object.assign({},a),r)},i),null===(t=this.renderHeader)||void 0===t?void 0:t.call(this),h().createElement("div",{className:`${npe}-container-content`},o))},this.renderContent=()=>{const{visible:e,resizable:t,minWidth:n,maxWidth:r,motion:i,defaultSize:s}=this.props,o=this.props.visible||this.props.motion&&!this.state.displayNone;return h().createElement(vt,{startClassName:e?`${npe}-animation-content_show`:`${npe}-animation-content_hide`,animationState:e?"enter":"leave",motion:i,onAnimationEnd:this.foundation.handleAnimationEnd},(e=>{let{animationClassName:i,animationStyle:a,animationEventsNeedBind:l}=e;return o?t?h().createElement(rq,{enable:epe.DIRECTION,minWidth:n,defaultSize:s,maxWidth:r},this.innerContent({animationClassName:i,animationStyle:a,animationEventsNeedBind:l})):this.innerContent({animationClassName:i,animationStyle:a,animationEventsNeedBind:l}):h().createElement(h().Fragment,null)}))},this.state={displayNone:!e.visible},this.foundation=new tpe(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyCancel:e=>{this.props.onCancel&&this.props.onCancel(e)},notifyVisibleChange:e=>{var t,n;null===(n=(t=this.props).afterVisibleChange)||void 0===n||n.call(t,e)},setOnKeyDownListener:()=>{"undefined"!=typeof window&&window.addEventListener("keydown",this.handleKeyDown)},removeKeyDownListener:()=>{"undefined"!=typeof window&&window.removeEventListener("keydown",this.handleKeyDown)},toggleDisplayNone:e=>{e!==this.state.displayNone&&this.setState({displayNone:e})}})}static getDerivedStateFromProps(e,t){const n={};return e.visible&&t.displayNone&&(n.displayNone=!1),n}componentDidMount(){this.props.visible&&this.foundation.beforeShow()}componentDidUpdate(e,t,n){!e.visible&&this.props.visible&&this.foundation.beforeShow(),!t.displayNone&&this.state.displayNone&&this.foundation.afterHide()}componentWillUnmount(){this.props.visible&&this.foundation.destroy()}render(){return this.renderContent()}}rpe.propTypes={title:E().node,style:E().object,visible:E().bool,motion:E().bool,minWidth:E().oneOfType([E().string,E().number]),maxWidth:E().oneOfType([E().string,E().number]),onCancel:E().func,afterVisibleChange:E().func,resizable:E().bool,defaultSize:E().object,children:E().node,className:E().string,renderHeader:E().func,showClose:E().bool},rpe.__SemiComponentName__="Sidebar.Container",rpe.defaultProps={motion:!0,minWidth:150,showClose:!0,resizable:!0};const ipe=rpe;const spe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5.07c-.8.47-1.8.46-2.6 0l-.24-.15a1.4 1.4 0 0 0-1.82.29c-.64.82-1.16 1.73-1.55 2.7a1.4 1.4 0 0 0 .66 1.71l.24.14a2.57 2.57 0 0 1 0 4.48l-.24.14a1.4 1.4 0 0 0-.66 1.72 11.1 11.1 0 0 0 1.55 2.69 1.4 1.4 0 0 0 1.82.3l.25-.15a2.57 2.57 0 0 1 3.88 2.24v.28c-.01.7.46 1.33 1.16 1.43a11 11 0 0 0 3.1 0 1.4 1.4 0 0 0 1.17-1.43v-.28a2.57 2.57 0 0 1 3.87-2.24l.25.14c.6.36 1.38.26 1.82-.29.64-.82 1.16-1.73 1.55-2.7a1.4 1.4 0 0 0-.66-1.71l-.24-.14a2.57 2.57 0 0 1 0-4.48l.24-.14a1.4 1.4 0 0 0 .66-1.72 11.08 11.08 0 0 0-1.55-2.69 1.4 1.4 0 0 0-1.82-.3l-.25.15a2.57 2.57 0 0 1-3.88-2.24v-.28c.01-.7-.46-1.33-1.16-1.43a10.99 10.99 0 0 0-3.1 0c-.7.1-1.17.72-1.17 1.43v.28C9.3 3.75 8.8 4.61 8 5.07Zm6 10.4a4 4 0 1 0-4-6.93 4 4 0 0 0 4 6.92Z",fill:"currentColor"}))}),"setting");const ope=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{d:"m14.5 4.5 5 5 2.09-2.09a2 2 0 0 0 0-2.82L19.4 2.4a2 2 0 0 0-2.82 0L14.5 4.5Z",fill:"currentColor"}),d.createElement("path",{d:"m2.25 21.13 1.68-5.88a1 1 0 0 1 .25-.43L13 6l5 5-8.82 8.82a1 1 0 0 1-.43.25l-5.88 1.68a.5.5 0 0 1-.62-.62Z",fill:"currentColor"}))}),"edit");Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var ape=Object.defineProperty,lpe=Object.getOwnPropertySymbols,cpe=Object.prototype.hasOwnProperty,dpe=Object.prototype.propertyIsEnumerable,hpe=(e,t,n)=>t in e?ape(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var upe=function(e){return d.createElement("svg",((e,t)=>{for(var n in t||(t={}))cpe.call(t,n)&&hpe(e,n,t[n]);if(lpe)for(var n of lpe(t))dpe.call(t,n)&&hpe(e,n,t[n]);return e})({width:200,height:200,viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m123.17 114.66-.2-.18-34.6 27.1.46-.04c10.03-.9 16.71-.38 18.79 0l.1.02 15.45-26.9Z",fill:"#1C1F23"}),d.createElement("rect",{x:67.706,y:73.871,width:55.6333,height:39.8004,fill:"#C6CACD",stroke:"#1C1F23"}),d.createElement("path",{d:"m49.97 136.5 17.7-22.44h55.44l-17.7 22.45H49.97Z",fill:"#888D92",stroke:"#1C1F23"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M101.67 78.57H75.75v21.45h18.77v6.25h14.6v-13.7h-7.45v-14Z",fill:"#888D92"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M76.66 79.43h24.26v13.14h-6.4v6.65H76.66v-19.8Zm17.86 20.62H75.74V78.6h26.01v13.97h7.36v13.7h-14.6v-6.22Zm7.23-6.65h6.54v12.05H95.34v-5.4h6.41V93.4Zm-.83 0v5.82h-5.58V93.4h5.58Z",fill:"#C6CACD"}),d.createElement("path",{d:"M43.29 174.89h-9.78c4.19-1.22 4.04-11.99 3.44-17.22.89 5.73 4.6 13.87 6.34 17.22Z",fill:"#1C1F23",stroke:"#1C1F23"}),d.createElement("path",{d:"M75.93 40.59a32.78 32.78 0 1 1-65.56 0 32.78 32.78 0 0 1 65.56 0Z",fill:"var(--semi-color-primary)",fillOpacity:.2}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M47.56 25.12a4.4 4.4 0 0 0-8.82 0v11.06H27.68a4.4 4.4 0 0 0 0 8.82h11.06v11.06a4.4 4.4 0 0 0 8.82 0V45h11.06a4.4 4.4 0 1 0 0-8.82H47.56V25.12Z",fill:"var(--semi-color-primary)"}),d.createElement("path",{d:"M63.82 83.33C59.3 81.5 50.3 75.37 50.44 65.54",stroke:"#1C1F23"}),d.createElement("path",{d:"M52.59 110.23c2.88.1 6.5.91 9.97 4.88 2.48 2.84 4.67 7.21 7.45 14.5a73.5 73.5 0 0 1 4.27-16.32c1.2-3.07 5.29-10.25 9.35-10.52 4.06-.26 4.47 3.57 2.57 4.65-1.9 1.08-3 .96-4.8 3.41-1.77 2.46-2.95 4.95-2 11.34.72-2.94 1.76-4.59 2.77-5.7 1-1.13 8.8-8.07 14.36-8.36 3.86-.2 5.2.7 4.78 1.73a9.27 9.27 0 0 1 4.08-.32c2.08.4 2.78 1.9 1.83 3.17 2.19-.16 4.28.23 5.36 1.84.33.49.24 1.64-.56 2.59-.77.91-2.25 1.63-2.83 1.94-1.2.63-5.94 3.72-7.35 8.1-1.41 4.4-2.73 7.47 3.46 20.83 4.71 10.16 5.64 21.33 1.87 29.6 8.96-.27 16.89-2.14 22.02-5.04 4.39-2.48 8.27-5.5 10.39-10.5-2.33-19.66-2.27-57.26.91-57.43 4.5-.23 1.73 48 0 54.7a19.5 19.5 0 0 1-.91 2.72c.67 5.67 1.54 9.84 2.59 11.2 1.7 2.19 40.44 4.76 50.2 1.59 1.28-.41 2.07-.93 2.2-1.55 1.02-4.54-14.79-8.26-20.87-13.96-4.19-3.91-2.77-32.42-4.97-50.45-2.2-18.04-7.9-36.48-25.26-40.71-13.62-3.33-24.98 1.73-30.14 5.64H85.62c2.71-5.6 10.46-16.06 26.4-19.18 19.26-3.78 36.18 5.19 46.96 17.46 4.95 5.25 7.75 8.71 9.23 8.71 1.48 0 9.22-4.68 17.6-5.22 2.5-.16 2.46 2.64 1.19 6.8a30.9 30.9 0 0 1-2.09 5.07c-2.44 4.94-7.83 14.3-16.18 21.42 2.2 18.04.78 46.55 4.97 50.46 6.08 5.7 21.89 9.42 20.88 13.96-.14.62-.93 1.14-2.2 1.55-9.77 3.17-48.51.6-50.21-1.59-1.05-1.36-1.92-5.53-2.6-11.2-2.1 5.02-5.99 8.03-10.38 10.51-5.13 2.9-13.06 4.77-22.02 5.05a20.4 20.4 0 0 1-5.01 6.87c-9 7.98-28.99 11.67-47.77 1.67-9.57-5.08-14.72-17.62-17.5-30.17v.06c.85 8.92 1.34 14.13-2.18 18.52a49.9 49.9 0 0 1-19.58-1.92c-5.22-1.61-12.91-8.31-8.38-22.61 4.54-14.3 27.98-32.78 30.14-34.21 2.15-1.44 7.96-5.58 15.7-5.58Z",fill:"#C6CACD"}),d.createElement("path",{d:"M70.01 129.61c-1.78 10.7.14 28.07 3.33 27.29 1-.25 1.57-1.58 1.67-3.9 7.16.34 27.77 7.99 34.47 11.8.15 4.62-.59 9.01-2.31 12.8a20.38 20.38 0 0 1-5.01 6.87c-9 7.98-28.99 11.67-47.77 1.67-9.57-5.09-14.72-17.62-17.5-30.17v.06c.85 8.92 1.34 14.13-2.18 18.52a49.9 49.9 0 0 1-19.58-1.92c-5.22-1.61-12.91-8.31-8.38-22.61 4.54-14.3 27.98-32.78 30.14-34.21 2.15-1.44 7.96-5.58 15.7-5.58 2.88.1 6.5.91 9.97 4.88 2.48 2.84 4.67 7.21 7.45 14.5Z",fill:"#888D92"}),d.createElement("path",{d:"M105.3 148c4.71 10.15 5.64 21.32 1.87 29.6 8.96-.28 16.89-2.15 22.02-5.05 4.39-2.48 8.27-5.5 10.39-10.5-2.33-19.66-2.27-57.26.91-57.43 4.5-.23 1.73 48 0 54.7a19.5 19.5 0 0 1-.91 2.72c.67 5.67 1.54 9.84 2.59 11.2 1.7 2.19 40.44 4.76 50.2 1.59 1.28-.41 2.07-.93 2.2-1.55 1.02-4.54-14.79-8.26-20.87-13.96-4.19-3.91-2.77-32.42-4.97-50.45-2.2-18.04-7.9-36.48-25.26-40.71-13.62-3.33-24.98 1.73-30.14 5.64h10.17v39.9l-16 27.8-4.96-.07a86.47 86.47 0 0 0 2.76 6.56Z",fill:"#C6CACD"}),d.createElement("path",{d:"M70.01 129.61c5.5 16.51 6.26 26.57 3.33 27.29-3.2.78-5.1-16.59-3.33-27.29Zm0 0c-2.78-7.29-4.97-11.66-7.45-14.5-3.46-3.97-7.09-4.79-9.97-4.88-7.74 0-13.55 4.14-15.7 5.58-2.16 1.43-25.6 19.9-30.14 34.2-4.53 14.3 3.16 21 8.38 22.62 6.19 1.92 12.5 2.54 19.58 1.92 3.53-4.4 3.03-9.62 2.18-18.58M70 129.61a73.5 73.5 0 0 1 4.27-16.32c1.2-3.07 5.29-10.25 9.35-10.52 4.06-.26 4.47 3.57 2.57 4.65-1.9 1.08-3 .96-4.8 3.41-1.77 2.46-2.95 4.95-2 11.34.72-2.94 1.76-4.59 2.77-5.7 1-1.13 8.8-8.07 14.36-8.36 5.57-.29 5.88 1.73 3.28 3.08-2.6 1.34-7.62 2.6-14.34 12.16 0 0-.6-5.24 10-11.04 2.88-1.57 7-3.36 9.92-2.8 3.14.62 3.12 3.7-.94 4.81a15.88 15.88 0 0 0-5.09 2.92 30.45 30.45 0 0 0-5.78 6.54c.43-3.53 4.31-8.52 8.96-10.08 3.21-1.08 8.15-1.98 10.04.83.33.49.24 1.64-.56 2.59-.77.91-2.25 1.63-2.83 1.94-1.2.63-5.94 3.72-7.35 8.1-1.15 3.57-2.23 6.26.7 14.27m-68.88-15.17c.08 5.48.55 17.6 3.23 29.71m0 0c2.78 12.55 7.93 25.09 17.5 30.17 18.78 10 38.78 6.3 47.77-1.67a20.4 20.4 0 0 0 5-6.87m0 0c3.78-8.28 2.85-19.45-1.86-29.6a86.47 86.47 0 0 1-2.76-6.57m4.63 36.17c8.96-.28 16.89-2.15 22.02-5.05 4.39-2.48 8.27-5.5 10.39-10.5m29.15-53.19c2.2 18.04.78 46.55 4.97 50.46 6.08 5.7 21.89 9.42 20.88 13.96-.14.62-.93 1.14-2.2 1.55m-23.65-65.97c-2.2-18.03-7.9-36.47-25.26-40.7-13.62-3.33-24.98 1.73-30.14 5.64m55.4 35.06c8.35-7.12 13.74-16.48 16.18-21.42 1-2 1.57-3.36 2.09-5.07m5.38 92.46c-9.77 3.17-48.51.6-50.21-1.59-1.05-1.36-1.92-5.53-2.6-11.2m52.8 12.79c-.42-2.92-1.24-3.56-4.8-4.6M187 82.37c1.27-4.16 1.3-6.96-1.19-6.8-8.38.54-16.12 5.22-17.6 5.22-1.49 0-4.28-3.46-9.23-8.7-10.78-12.28-27.7-21.25-46.96-17.47-15.94 3.12-23.69 13.58-26.4 19.18h27.7M187 82.37c.01-1 .15-2.07-.43-2.74-1.77-2.02-5.89-2.07-6.46 1.98m-66.79-7.81h10.18v39.9l-16 27.8-4.96-.07m37.04 20.61c-2.33-19.65-2.27-57.25.91-57.42 4.5-.23 1.73 48 0 54.7a19.5 19.5 0 0 1-.91 2.72Z",stroke:"#1C1F23"}),d.createElement("path",{d:"M58.12 104.22A10.5 10.5 0 0 1 47.7 114.8a10.5 10.5 0 0 1-10.43-10.58A10.5 10.5 0 0 1 47.7 93.65a10.5 10.5 0 0 1 10.43 10.57Z",fill:"#C6CACD",stroke:"#1C1F23"}),d.createElement("mask",{id:"path-15-inside-1",fill:"white"},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.01 93.79c6.18.59 4.56 12.3.6 17.58-2.89 3.82-1.18 7.13.9 11.15a77 77 0 0 1 1.28 2.56 17.5 17.5 0 0 1 3.1 9.92c0 10.25-8.96 18.55-20 18.55S14.9 145.25 14.9 135c0-7.89 5.3-14.63 12.79-17.31 7.3-4.04 9.58-8.08 9.85-15.11.24-6.1 5.3-9.38 11.47-8.79Z"})),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.01 93.79c6.18.59 4.56 12.3.6 17.58-2.89 3.82-1.18 7.13.9 11.15a77 77 0 0 1 1.28 2.56 17.5 17.5 0 0 1 3.1 9.92c0 10.25-8.96 18.55-20 18.55S14.9 145.25 14.9 135c0-7.89 5.3-14.63 12.79-17.31 7.3-4.04 9.58-8.08 9.85-15.11.24-6.1 5.3-9.38 11.47-8.79Z",fill:"#1C1F23"}),d.createElement("path",{d:"m49.6 111.37 2.4 1.8-2.4-1.8Zm-.59-17.58-.28 2.99.28-2.99Zm1.5 28.73 2.67-1.38-2.67 1.38Zm1.28 2.56-2.71 1.28.1.21.13.2 2.48-1.69Zm-24.1-7.4 1.01 2.83.23-.08.2-.12-1.44-2.62Zm9.85-15.1 3 .11-3-.11ZM52 113.18c2.4-3.2 3.97-8.06 4.11-12.25.08-2.1-.2-4.37-1.18-6.27a6.93 6.93 0 0 0-5.63-3.86l-.57 5.98c.4.03.63.16.88.64.32.63.56 1.74.5 3.3-.1 3.13-1.34 6.76-2.9 8.84l4.79 3.61Zm1.18 7.96c-1.1-2.12-1.8-3.53-2.03-4.8-.18-1-.08-1.94.85-3.17l-4.8-3.6a9.65 9.65 0 0 0-1.95 7.83c.42 2.34 1.61 4.6 2.6 6.5l5.33-2.76Zm1.33 2.66c-.45-.94-.91-1.84-1.33-2.66l-5.34 2.76c.43.82.85 1.63 1.24 2.46l5.43-2.56Zm-5.2 2.97A14.5 14.5 0 0 1 51.9 135h6a20.5 20.5 0 0 0-3.62-11.61l-4.96 3.38ZM51.9 135c0 8.38-7.4 15.55-17 15.55v6c12.49 0 23-9.44 23-21.55h-6Zm-17 15.55c-9.6 0-16.99-7.17-16.99-15.55h-6c0 12.11 10.51 21.55 23 21.55v-6ZM17.9 135c0-6.47 4.36-12.18 10.8-14.49l-2.03-5.65C18.15 117.92 11.9 125.7 11.9 135h6Zm16.64-32.54c-.12 3.22-.7 5.4-1.82 7.2-1.15 1.8-3.07 3.51-6.49 5.4l2.9 5.25c3.9-2.14 6.77-4.47 8.65-7.45 1.9-3 2.61-6.35 2.76-10.17l-6-.23ZM49.3 90.8c-3.67-.34-7.25.43-10.02 2.46a11.64 11.64 0 0 0-4.74 9.2l6 .23a5.65 5.65 0 0 1 2.28-4.59c1.36-1 3.4-1.56 5.91-1.32l.57-5.98Z",fill:"#1C1F23",mask:"url(#path-15-inside-1)"}),d.createElement("path",{d:"M54.1 105.95c0 1.69-1.43 3.1-3.24 3.1-1.8 0-3.24-1.41-3.24-3.1 0-1.7 1.43-3.1 3.24-3.1 1.8 0 3.24 1.4 3.24 3.1Z",fill:"#C6CACD",stroke:"#1C1F23"}),d.createElement("path",{d:"M37.12 95.07a3.46 3.46 0 0 1-3.53 3.39c-2 0-3.54-1.56-3.54-3.4a3.46 3.46 0 0 1 3.54-3.38c1.99 0 3.53 1.55 3.53 3.39Z",fill:"#1C1F23",stroke:"#1C1F23",strokeWidth:3}),d.createElement("path",{d:"M147.22 155.65c-.1 3.58 1.27 4.88 4.7 6.08",stroke:"#1C1F23"}))},ppe=Object.defineProperty,fpe=Object.getOwnPropertySymbols,mpe=Object.prototype.hasOwnProperty,gpe=Object.prototype.propertyIsEnumerable,ype=(e,t,n)=>t in e?ppe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var vpe=function(e){return d.createElement("svg",((e,t)=>{for(var n in t||(t={}))mpe.call(t,n)&&ype(e,n,t[n]);if(fpe)for(var n of fpe(t))gpe.call(t,n)&&ype(e,n,t[n]);return e})({width:200,height:200,viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,"aria-hidden":!0},e),d.createElement("rect",{width:200,height:200,fill:"transparent"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m123.17 114.66-.2-.18-34.6 27.1.46-.04c10.03-.9 16.71-.38 18.79 0l.1.02 15.45-26.9Z",fill:"#515151"}),d.createElement("rect",{x:67.706,y:73.871,width:55.6333,height:39.8004,fill:"white",stroke:"#515151"}),d.createElement("path",{d:"m49.97 136.5 17.7-22.44h55.44l-17.7 22.45H49.97Z",fill:"#E6E8EA",stroke:"#515151"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M101.67 78.57H75.75v21.45h18.77v6.25h14.6v-13.7h-7.45v-14Z",fill:"#C6CACD"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M76.66 79.43h24.26v13.14h-6.4v6.65H76.66v-19.8Zm17.86 20.62H75.74V78.6h26.01v13.97h7.36v13.7h-14.6v-6.22Zm7.23-6.65h6.54v12.05H95.34v-5.4h6.41V93.4Zm-.83 0v5.82h-5.58V93.4h5.58Z",fill:"white"}),d.createElement("path",{d:"M43.29 174.89H33.5c4.19-1.22 4.04-11.99 3.44-17.22.88 5.73 4.6 13.87 6.34 17.22Z",fill:"#515151",stroke:"black"}),d.createElement("path",{d:"M75.93 40.59a32.78 32.78 0 1 1-65.56 0 32.78 32.78 0 0 1 65.56 0Z",fill:"var(--semi-color-primary-light-default)"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M47.56 25.12a4.4 4.4 0 0 0-8.82 0v11.06H27.68a4.4 4.4 0 0 0 0 8.82h11.06v11.06a4.4 4.4 0 0 0 8.82 0V45h11.06a4.4 4.4 0 0 0 0-8.82H47.56V25.12Z",fill:"var(--semi-color-primary)"}),d.createElement("path",{d:"M63.82 83.33c-4.52-1.84-13.53-7.96-13.38-17.79",stroke:"#515151"}),d.createElement("path",{d:"M52.59 110.23c2.88.1 6.5.91 9.97 4.88 2.48 2.84 4.67 7.21 7.45 14.5a73.53 73.53 0 0 1 4.27-16.32c1.2-3.07 5.29-10.25 9.35-10.52 4.06-.26 4.47 3.57 2.57 4.65-1.9 1.08-3 .96-4.8 3.41-1.77 2.46-2.95 4.95-2 11.34.72-2.94 1.76-4.59 2.77-5.71 1-1.12 8.8-8.06 14.36-8.35 3.86-.2 5.2.7 4.78 1.73a9.27 9.27 0 0 1 4.08-.33c2.08.41 2.78 1.9 1.83 3.18 2.19-.16 4.28.23 5.36 1.84.33.49.24 1.64-.56 2.58-.77.92-2.25 1.64-2.83 1.95-1.2.63-5.94 3.72-7.35 8.1-1.41 4.4-2.73 7.47 3.46 20.83 4.71 10.16 5.64 21.33 1.87 29.6 8.96-.27 16.89-2.14 22.02-5.04 4.39-2.48 8.27-5.5 10.39-10.5-2.33-19.66-2.27-57.26.91-57.43 4.5-.23 1.73 48 0 54.7a19.5 19.5 0 0 1-.91 2.72c.67 5.67 1.54 9.84 2.59 11.2 1.7 2.19 40.44 4.76 50.2 1.59 1.28-.42 2.07-.93 2.2-1.55 1.02-4.54-14.79-8.26-20.87-13.96-4.19-3.91-2.77-32.42-4.97-50.45-2.2-18.04-7.9-36.48-25.26-40.71-13.62-3.33-24.98 1.73-30.14 5.64H85.62c2.71-5.6 10.46-16.06 26.4-19.18 19.26-3.78 36.18 5.19 46.96 17.46 4.95 5.24 7.75 8.71 9.23 8.71 1.48 0 9.22-4.68 17.6-5.22 2.5-.16 2.46 2.64 1.19 6.8a30.8 30.8 0 0 1-2.09 5.07c-2.44 4.94-7.84 14.3-16.18 21.42 2.2 18.04.78 46.55 4.97 50.46 6.08 5.7 21.89 9.42 20.88 13.96-.14.62-.93 1.13-2.2 1.55-9.77 3.17-48.51.6-50.21-1.59-1.05-1.36-1.92-5.53-2.6-11.2-2.1 5.01-5.99 8.03-10.38 10.51-5.13 2.9-13.06 4.77-22.02 5.05a20.37 20.37 0 0 1-5.01 6.87c-9 7.98-28.99 11.67-47.77 1.67-9.57-5.09-14.72-17.62-17.5-30.17v.06c.85 8.92 1.34 14.13-2.18 18.52a49.9 49.9 0 0 1-19.58-1.92c-5.22-1.61-12.91-8.31-8.38-22.61 4.54-14.3 27.98-32.78 30.14-34.21 2.15-1.44 7.96-5.58 15.7-5.58Z",fill:"white"}),d.createElement("path",{d:"M70.01 129.61c-1.78 10.7.14 28.07 3.33 27.29 1-.25 1.57-1.58 1.67-3.9 7.16.34 27.77 7.99 34.47 11.8.15 4.62-.59 9.01-2.31 12.8a20.38 20.38 0 0 1-5.01 6.87c-9 7.98-28.99 11.67-47.77 1.67-9.57-5.09-14.72-17.62-17.5-30.17v.06c.85 8.92 1.34 14.13-2.18 18.52a49.9 49.9 0 0 1-19.58-1.92c-5.22-1.61-12.91-8.31-8.38-22.61 4.54-14.3 27.98-32.78 30.14-34.21 2.15-1.44 7.96-5.58 15.7-5.58 2.88.1 6.5.91 9.97 4.88 2.48 2.84 4.67 7.21 7.45 14.5Z",fill:"#E6E8EA"}),d.createElement("path",{d:"M105.3 148c4.71 10.15 5.64 21.32 1.87 29.6 8.96-.28 16.89-2.15 22.02-5.05 4.39-2.48 8.27-5.5 10.39-10.5-2.33-19.66-2.27-57.26.91-57.43 4.5-.23 1.73 48 0 54.7a19.5 19.5 0 0 1-.91 2.72c.67 5.67 1.54 9.84 2.59 11.2 1.7 2.19 40.44 4.76 50.2 1.59 1.28-.41 2.07-.93 2.2-1.55 1.02-4.54-14.79-8.26-20.87-13.96-4.19-3.91-2.77-32.42-4.97-50.45-2.2-18.04-7.9-36.48-25.26-40.71-13.62-3.33-24.98 1.73-30.14 5.64h10.17v39.9l-16 27.8-4.96-.07a86.47 86.47 0 0 0 2.76 6.56Z",fill:"white",className:""}),d.createElement("path",{d:"M70.01 129.61c5.5 16.51 6.26 26.57 3.33 27.29-3.2.78-5.1-16.59-3.33-27.29Zm0 0c-2.78-7.29-4.97-11.66-7.45-14.5-3.46-3.97-7.09-4.79-9.97-4.88-7.74 0-13.55 4.14-15.7 5.58-2.16 1.43-25.6 19.9-30.14 34.2-4.53 14.3 3.16 21 8.38 22.62 6.19 1.92 12.5 2.54 19.58 1.92 3.53-4.4 3.03-9.62 2.18-18.58M70 129.61a73.5 73.5 0 0 1 4.27-16.32c1.2-3.07 5.29-10.25 9.35-10.52 4.06-.26 4.47 3.57 2.57 4.65-1.9 1.08-3 .96-4.8 3.41-1.77 2.46-2.95 4.95-2 11.34.72-2.94 1.76-4.59 2.77-5.7 1-1.13 8.8-8.07 14.36-8.36 5.57-.29 5.88 1.73 3.28 3.08-2.6 1.34-7.62 2.6-14.34 12.16 0 0-.6-5.24 10-11.04 2.88-1.57 7-3.36 9.92-2.8 3.14.62 3.12 3.7-.94 4.81a15.88 15.88 0 0 0-5.09 2.92 30.45 30.45 0 0 0-5.78 6.54c.43-3.53 4.31-8.52 8.96-10.08 3.21-1.08 8.15-1.98 10.04.83.33.49.24 1.64-.56 2.59-.77.91-2.25 1.63-2.83 1.94-1.2.63-5.94 3.72-7.35 8.1-1.15 3.57-2.23 6.26.7 14.27m-68.88-15.17c.08 5.48.55 17.6 3.23 29.71m0 0c2.78 12.55 7.93 25.09 17.5 30.17 18.78 10 38.78 6.3 47.77-1.67a20.4 20.4 0 0 0 5-6.87m0 0c3.78-8.28 2.85-19.45-1.86-29.6a86.47 86.47 0 0 1-2.76-6.57m4.63 36.17c8.96-.28 16.89-2.15 22.02-5.05 4.39-2.48 8.27-5.5 10.39-10.5m29.15-53.19c2.2 18.04.78 46.55 4.97 50.46 6.08 5.7 21.89 9.42 20.88 13.96-.14.62-.93 1.14-2.2 1.55m-23.65-65.97c-2.2-18.03-7.9-36.47-25.26-40.7-13.62-3.33-24.98 1.73-30.14 5.64m55.4 35.06c8.35-7.12 13.74-16.48 16.18-21.42 1-2 1.57-3.36 2.09-5.07m5.38 92.46c-9.77 3.17-48.51.6-50.21-1.59-1.05-1.36-1.92-5.53-2.6-11.2m52.8 12.79c-.42-2.92-1.24-3.56-4.8-4.6M187 82.37c1.27-4.16 1.3-6.96-1.19-6.8-8.38.54-16.12 5.22-17.6 5.22-1.49 0-4.28-3.46-9.23-8.7-10.78-12.28-27.7-21.25-46.96-17.47-15.94 3.12-23.69 13.58-26.4 19.18h27.7M187 82.37c.01-1 .15-2.07-.43-2.74-1.77-2.02-5.89-2.07-6.46 1.98m-66.79-7.81h10.18v39.9l-16 27.8-4.96-.07m37.04 20.61c-2.33-19.65-2.27-57.25.91-57.42 4.5-.23 1.73 48 0 54.7a19.5 19.5 0 0 1-.91 2.72Z",stroke:"#1C1F23"}),d.createElement("path",{d:"M58.12 104.22A10.5 10.5 0 0 1 47.7 114.8a10.5 10.5 0 0 1-10.43-10.58A10.5 10.5 0 0 1 47.7 93.65a10.5 10.5 0 0 1 10.43 10.57Z",fill:"white",stroke:"#515151"}),d.createElement("mask",{id:"path-16-inside-1",fill:"white"},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.01 93.79c6.18.59 4.56 12.3.6 17.58-2.89 3.82-1.18 7.13.9 11.15a77 77 0 0 1 1.28 2.56 17.5 17.5 0 0 1 3.1 9.92c0 10.25-8.96 18.55-20 18.55S14.9 145.25 14.9 135c0-7.89 5.3-14.63 12.79-17.31 7.3-4.04 9.58-8.08 9.85-15.11.24-6.1 5.3-9.38 11.47-8.79Z"})),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.01 93.79c6.18.59 4.56 12.3.6 17.58-2.89 3.82-1.18 7.13.9 11.15a77 77 0 0 1 1.28 2.56 17.5 17.5 0 0 1 3.1 9.92c0 10.25-8.96 18.55-20 18.55S14.9 145.25 14.9 135c0-7.89 5.3-14.63 12.79-17.31 7.3-4.04 9.58-8.08 9.85-15.11.24-6.1 5.3-9.38 11.47-8.79Z",fill:"#515151"}),d.createElement("path",{d:"m49.6 111.37 2.4 1.8-2.4-1.8Zm-.59-17.58-.28 2.99.28-2.99Zm1.5 28.73 2.67-1.38-2.67 1.38Zm1.28 2.56-2.71 1.28.1.21.13.2 2.48-1.69Zm-24.1-7.4 1.01 2.83.23-.08.2-.12-1.44-2.62Zm9.85-15.1-3-.12 3 .12ZM52 113.18c2.4-3.2 3.97-8.06 4.11-12.25.08-2.1-.2-4.37-1.18-6.27a6.93 6.93 0 0 0-5.63-3.86l-.57 5.98c.4.03.63.16.88.64.32.63.56 1.74.5 3.3-.1 3.13-1.34 6.76-2.9 8.84l4.79 3.61Zm1.18 7.96c-1.1-2.12-1.8-3.53-2.03-4.8-.18-1-.08-1.94.85-3.17l-4.8-3.6a9.65 9.65 0 0 0-1.96 7.83c.43 2.34 1.62 4.6 2.6 6.5l5.34-2.76Zm1.33 2.66c-.45-.94-.91-1.84-1.33-2.66l-5.34 2.76c.43.82.85 1.63 1.24 2.46l5.43-2.56Zm-5.2 2.97a14.51 14.51 0 0 1 2.57 8.23h6a20.5 20.5 0 0 0-3.61-11.61l-4.96 3.38Zm2.57 8.23c0 8.38-7.39 15.55-16.99 15.55v6c12.49 0 23-9.44 23-21.55h-6ZM34.9 150.55c-9.6 0-16.99-7.17-16.99-15.55h-6c0 12.11 10.51 21.55 23 21.55v-6ZM17.9 135c0-6.47 4.36-12.18 10.8-14.49l-2.03-5.65C18.15 117.92 11.9 125.7 11.9 135h6Zm16.64-32.54c-.12 3.22-.7 5.4-1.82 7.2-1.15 1.8-3.07 3.51-6.49 5.4l2.9 5.25c3.9-2.14 6.77-4.47 8.65-7.45 1.9-3 2.61-6.35 2.76-10.17l-6-.23ZM49.3 90.8c-3.67-.34-7.25.43-10.02 2.46a11.64 11.64 0 0 0-4.74 9.2l6 .23a5.65 5.65 0 0 1 2.28-4.59c1.36-1 3.4-1.56 5.91-1.32l.57-5.98Z",fill:"#515151",mask:"url(#path-16-inside-1)"}),d.createElement("path",{d:"M54.1 105.95c0 1.69-1.43 3.1-3.24 3.1-1.81 0-3.24-1.41-3.24-3.1 0-1.7 1.43-3.1 3.24-3.1 1.8 0 3.24 1.4 3.24 3.1Z",fill:"white",stroke:"#515151"}),d.createElement("path",{d:"M37.12 95.07a3.46 3.46 0 0 1-3.53 3.39c-2 0-3.54-1.56-3.54-3.4a3.46 3.46 0 0 1 3.54-3.38c1.99 0 3.53 1.55 3.53 3.39Z",fill:"#515151",stroke:"#515151",strokeWidth:3}),d.createElement("path",{d:"M147.22 155.65c-.1 3.58 1.27 4.88 4.7 6.08",stroke:"#515151"}))};Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function bpe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const r=e.toLowerCase();return t.filter((e=>"function"==typeof n?n(r,e):function(e,t){const n="string"==typeof t.label?t.label:"";if(n.toLowerCase().includes(e))return!0;const r="string"==typeof t.desc?t.desc:"";return r.toLowerCase().includes(e)}(r,e)))}class wpe extends c{constructor(e){super(Object.assign({},e)),this.handleSearch=e=>{this.setState({inputValue:e}),this.updateShowOptions(e)},this.updateShowOptions=g()(((e,t)=>{let n=null!=t?t:this.getState("mode");const{options:r=[],customOptions:i=[],filter:s}=this.getProps();let o=[];o=n===epe.MCP_MODE.INNER?e?bpe(e,r,s):r:e?bpe(e,i,s):i,this.setState({showOptions:o})}),300),this.handleModeChange=e=>{const t=e.target.value;this.setState({mode:t}),this.updateShowOptions(this.getState("inputValue"),t)},this.onConfigureButtonClick=(e,t)=>{this._adapter.notifyConfigureClick(e,t)},this.onEditButtonClick=(e,t)=>{this._adapter.notifyEditClick(e,t)},this.handleStatusChange=(e,t)=>{const{options:n=[],customOptions:r=[]}=this.getProps();let i=[];const s=this.getState("mode");i=s===epe.MCP_MODE.INNER?n.map((n=>n.value===e.value?Object.assign(Object.assign({},n),{active:t}):n)):r.map((n=>n.value===e.value?Object.assign(Object.assign({},n),{active:t}):n)),this._adapter.notifyStatusChange(i,s===epe.MCP_MODE.CUSTOM)},this.handleAddClick=e=>{this._adapter.notifyAddClick(e)}}}const xpe=Que.MCP_CONFIGURE_CONTENT;class Epe extends f{constructor(e){var t,n,r;super(e),this.renderContent=()=>{const{showOptions:e,mode:t}=this.state,{renderItem:n}=this.props;return h().createElement("div",{className:`${xpe}-item-container`},e.map((e=>n?n({custom:t===epe.MCP_MODE.CUSTOM,option:e}):h().createElement("div",{key:e.value,className:`${xpe}-item`},"string"==typeof e.icon?h().createElement("img",{src:e.icon,alt:e.label,className:`${xpe}-item-sign`}):h().createElement("div",{className:`${xpe}-item-sign`},e.icon),h().createElement("div",{className:`${xpe}-item-content`},h().createElement("div",{className:`${xpe}-item-content-label`},e.label),h().createElement("div",{className:`${xpe}-item-content-desc`},e.desc)),e.configure&&h().createElement(vs,{icon:h().createElement(spe,null),className:`${xpe}-item-button ${xpe}-item-button-configure`,onClick:t=>this.foundation.onConfigureButtonClick(t,e)}),t===epe.MCP_MODE.CUSTOM&&h().createElement(vs,{icon:h().createElement(ope,null),className:`${xpe}-item-button ${xpe}-item-button-configure`,onClick:t=>this.foundation.onEditButtonClick(t,e)}),this.renderStatusButton(e)))))},this.renderStatusButton=e=>{const t=h().createElement(vs,{icon:e.active?h().createElement(BR,null):h().createElement(VR,null),theme:e.active?"light":"solid",type:"primary",className:`${xpe}-item-button`,disabled:e.disabled,checked:e.active,onClick:()=>this.foundation.handleStatusChange(e,!e.active)});return e.disabled?h().createElement(Jt,{componentName:"Sidebar"},(e=>h().createElement(_t,{title:e.defaultMcpInfo},t))):t},this.renderSearch=()=>{const{placeholder:e,customOptions:t}=this.props;return this.state.mode===epe.MCP_MODE.INNER?h().createElement(Jt,{componentName:"Sidebar"},(t=>h().createElement(kr,{prefix:h().createElement(WC,null),value:this.state.inputValue,placeholder:null!=e?e:t.searchPlaceholder,onChange:this.foundation.handleSearch,className:`${xpe}-search`}))):null==t||Array.isArray(t)&&0===t.length?h().createElement(Jt,{componentName:"Sidebar"},(e=>h().createElement(Ub,{image:h().createElement(vpe,{style:{width:150,height:150}}),darkModeImage:h().createElement(upe,{style:{width:150,height:150}}),description:e.emptyCustomMcpInfo,className:`${xpe}-custom-empty`},h().createElement(vs,{theme:"solid",type:"primary",icon:h().createElement(VR,null),onClick:this.foundation.handleAddClick},e.newMcpAdd)))):h().createElement("div",{className:`${xpe}-search ${xpe}-search-container`},h().createElement(Jt,{componentName:"Sidebar"},(t=>h().createElement(h().Fragment,null,h().createElement(kr,{prefix:h().createElement(WC,null),value:this.state.inputValue,placeholder:null!=e?e:t.searchPlaceholder,onChange:this.foundation.handleSearch}),h().createElement(vs,{theme:"solid",type:"primary",icon:h().createElement(VR,null),onClick:this.foundation.handleAddClick},t.newMcpAdd)))))},this.state={mode:epe.MCP_MODE.INNER,inputValue:"",showOptions:null!==(t=e.options)&&void 0!==t?t:[],cachedOptions:null!==(n=e.options)&&void 0!==n?n:[],cachedCustomOptions:null!==(r=e.customOptions)&&void 0!==r?r:[]},this.foundation=new wpe(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyConfigureClick:(e,t)=>{var n,r;null===(r=(n=this.props).onConfigureClick)||void 0===r||r.call(n,e,t)},notifyEditClick:(e,t)=>{var n,r;null===(r=(n=this.props).onEditClick)||void 0===r||r.call(n,e,t)},notifyStatusChange:(e,t)=>{var n,r;null===(r=(n=this.props).onStatusChange)||void 0===r||r.call(n,e,t)},notifyAddClick:e=>{var t,n;null===(n=(t=this.props).onAddClick)||void 0===n||n.call(t,e)}})}static getDerivedStateFromProps(e,t){const n={},{options:r=[],customOptions:i=[],filter:s}=e,{cachedOptions:o=[],cachedCustomOptions:a=[]}=t;return r!==o&&(n.cachedOptions=r,t.mode===epe.MCP_MODE.INNER&&(t.inputValue?n.showOptions=bpe(t.inputValue,r,s):n.showOptions=r)),i!==a&&(n.cachedCustomOptions=i,t.mode===epe.MCP_MODE.CUSTOM&&(t.inputValue?n.showOptions=bpe(t.inputValue,i,s):n.showOptions=i)),n}render(){const{options:e=[],customOptions:t=[],className:n,style:r}=this.props,i=e.filter((e=>e.active)).length+t.filter((e=>e.active)).length;return h().createElement("div",{className:w()(xpe,{[n]:n}),style:r},h().createElement(Jt,{componentName:"Sidebar"},(n=>h().createElement("div",{className:`${xpe}-header`},h().createElement($S,{type:"button",value:this.state.mode,onChange:this.foundation.handleModeChange},h().createElement(VS,{value:epe.MCP_MODE.INNER},"MCP Servers"),h().createElement(VS,{value:epe.MCP_MODE.CUSTOM},n.newMcpAdd)),h().createElement("span",{className:`${xpe}-header-count`},n.activeMCPNumber," ",i,"/",e.length+t.length)))),this.renderSearch(),this.renderContent())}}Epe.propTypes={className:E().string,options:E().array,customOptions:E().array,filter:E().func,placeholder:E().string,style:E().object,onStatusChange:E().func,onSearch:E().func,onAddClick:E().func,onConfigureClick:E().func,onEditClick:E().func,renderItem:E().func},Epe.__SemiComponentName__="MCPConfigureContent",Epe.defaultProps={};const Cpe=Epe;class Spe extends f{render(){const e=Gl()(this.props,["title","style","visible","motion","minWidth","maxWidth","onCancel","afterVisibleChange","resizable","defaultSize","children","className"]),t=Gl()(this.props,["options","customOptions","filter","placeholder","onStatusChange","onSearch","onAddClick","onConfigureClick","onEditClick","renderItem"]);return h().createElement(Jt,{componentName:"Sidebar"},(n=>{var r;return h().createElement(ipe,Object.assign({},e,{title:null!==(r=e.title)&&void 0!==r?r:n.mcpConfigure}),h().createElement(Cpe,Object.assign({},t)))}))}}Spe.propTypes=Object.assign(Object.assign({},ipe.propTypes),{options:E().array,customOptions:E().array,onStatusChange:E().func,onSearch:E().func,onAddClick:E().func,renderItem:E().func}),Spe.__SemiComponentName__="Sidebar.MCPConfigure";const _pe=Spe;var kpe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Ope=Que.ANNOTATION_ITEM;function Tpe(e){const{title:t,url:n,logo:r,img:i,duration:s,order:o,onClick:a,siteName:l}=e,c=(0,d.useCallback)((t=>{n&&"undefined"!=typeof window&&window.open(n,"_blank");const{onClick:r}=e,i=kpe(e,["onClick"]);null==r||r(t,i)}),[n,e]);return h().createElement("div",{className:`${Ope} ${Ope}-video`,onClick:c},h().createElement("div",{className:`${Ope}-video-img-wrapper`},i&&h().createElement("img",{className:`${Ope}-video-img`,src:i,alt:t}),h().createElement(DZ,{className:`${Ope}-video-play`}),"number"==typeof s&&h().createElement("span",{className:`${Ope}-video-duration`},IJ(s))),h().createElement("div",{className:`${Ope}-video-content`},h().createElement("div",{className:`${Ope}-title`},t),h().createElement("div",{className:`${Ope}-footer`},h().createElement("img",{className:`${Ope}-footer-logo`,src:r,alt:t}),h().createElement("span",{className:`${Ope}-footer-text`},l),"number"==typeof o&&h().createElement("span",{className:`${Ope}-footer-order`},o))))}function Ppe(e){const{title:t,url:n,detail:r,logo:i,order:s,siteName:o}=e,a=(0,d.useCallback)((t=>{n&&"undefined"!=typeof window&&window.open(n,"_blank");const{onClick:r}=e,i=kpe(e,["onClick"]);null==r||r(t,i)}),[n,e]);return h().createElement("div",{className:`${Ope} ${Ope}-text`,onClick:a},h().createElement("div",{className:`${Ope}-title`},t),h().createElement("div",{className:`${Ope}-text-detail`},r),h().createElement("div",{className:`${Ope}-footer`},i&&h().createElement("img",{className:`${Ope}-footer-logo`,src:i,alt:t}),o&&h().createElement("span",{className:`${Ope}-footer-text`},o),"number"==typeof s&&h().createElement("span",{className:`${Ope}-footer-order`},s)))}const Ipe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 2.5a1 1 0 0 0-1 1v15a1 1 0 0 0 1 1h7a2 2 0 0 1 2 2 1 1 0 1 0 2 0c0-1.1.9-2 2-2h7a1 1 0 0 0 1-1v-15a1 1 0 0 0-1-1h-6a5 5 0 0 0-4 2 5 5 0 0 0-4-2H2Zm9 5a3 3 0 0 0-3-3H3v13h6c.73 0 1.41.2 2 .54V7.5Zm2 10.54a3.98 3.98 0 0 1 2-.54h6v-13h-5a3 3 0 0 0-3 3v10.54Z",fill:"currentColor"}))}),"book_open_stroked"),Mpe=Que.COLLAPSE,Rpe=Que.ANNOTATION,Ape=h().memo((e=>{const{info:t=[],activeKey:n,onChange:r,onClick:i,style:s,className:o,renderItem:a}=e;return h().createElement(Sf,{className:w()(Mpe,{[o]:o}),style:s,onChange:r,activeKey:n,clickHeaderToExpand:!1},t.map((e=>h().createElement(Sf.Panel,{header:h().createElement("div",{className:`${Mpe}-header-content`},h().createElement(Ipe,null),e.header),itemKey:e.key,key:e.key},h().createElement("div",{className:`${Rpe}-content`},e.annotations.map(((e,t)=>a?a(e):"video"===e.type?h().createElement(Tpe,Object.assign({key:`${t}`,onClick:i},e)):h().createElement(Ppe,Object.assign({key:`${t}`,onClick:i},e)))))))))})),Npe=Ape,Dpe=Que.ANNOTATION;class Lpe extends f{render(){const e=Gl()(this.props,["title","style","visible","motion","minWidth","maxWidth","onCancel","afterVisibleChange","resizable","defaultSize","children","className"]),t=Gl()(this.props,["activeKey","info","onChange","onClick","renderItem"]);return h().createElement(Jt,{componentName:"Sidebar"},(n=>{var r;return h().createElement(ipe,Object.assign({},e,{className:w()(Dpe,{[e.className]:e.className}),title:null!==(r=e.title)&&void 0!==r?r:n.annotationTitle}),h().createElement(Npe,Object.assign({},t)))}))}}Lpe.propTypes=Object.assign(Object.assign({},ipe.propTypes),{info:E().array,onChange:E().func,onClick:E().func,activeKey:E().oneOfType([E().string,E().array]),renderItem:E().func}),Lpe.AnnotationContent=Npe,Lpe.__SemiComponentName__="Sidebar.Annotation",Lpe.defaultProps={};const Fpe=Lpe,jpe=Que.OPTIONS,$pe=h().memo((e=>{const{renderOptionItem:t,options:n,onChange:r,activeKey:i}=e;return h().createElement("div",{className:jpe},null==n?void 0:n.map((e=>{const{icon:n,name:s,key:o}=e;return"function"==typeof t?t(e,r):h().createElement(vs,{className:w()(`${jpe}-button`,{[`${jpe}-normal`]:i!==o}),key:o,icon:n,onClick:t=>null==r?void 0:r(t,e.key)},s)})))})),Bpe=$pe;const Vpe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.96 5.27a1 1 0 1 0-1.92-.54l-4 14a1 1 0 1 0 1.92.54l4-14ZM7.71 6.3a1 1 0 0 1 0 1.42L3.4 12l4.3 4.3a1 1 0 1 1-1.42 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.42 0Zm8.58 0a1 1 0 0 1 1.42 0l5 5a1 1 0 0 1 0 1.42l-5 5a1 1 0 0 1-1.42-1.42L20.6 12l-4.3-4.3a1 1 0 0 1 0-1.4Z",fill:"currentColor"}))}),"code_stroked");const zpe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2 11.2a1 1 0 0 1-1.4 0L4 5.42V9a1 1 0 1 1-2 0V3a1 1 0 0 1 .29-.7v-.01A1 1 0 0 1 3 2H9a1 1 0 0 1 0 2H5.41l5.8 5.8a1 1 0 0 1 0 1.4Zm1.6 1.6a1 1 0 0 1 1.4 0l5.8 5.79V15a1 1 0 1 1 2 0v6a1 1 0 0 1-.29.7v.01a1 1 0 0 1-.7.29H15a1 1 0 1 1 0-2h3.59l-5.8-5.8a1 1 0 0 1 0-1.4Z",fill:"currentColor"}))}),"full_screen_stroked"),Hpe=Que.COLLAPSE,Upe=Que.SIDEBAR,Kpe=h().memo((e=>{const{language:t,content:n,isJson:r,jsonViewerProps:i={},codeHighlightProps:s={}}=e;return h().createElement("div",{className:`${Upe}-code-content`},r?h().createElement(MZ,Object.assign({height:"100%",width:"100%",value:n,showSearch:!1,options:epe.JSON_VIEWER_OPTIONS},i)):h().createElement(JK,Object.assign({language:t,code:n},s)))})),Wpe=h().memo((e=>{const{content:t,onExpand:n,mode:r}=e,i=(0,d.useCallback)((e=>{null==n||n(e,t,r)}),[t,n,r]);return h().createElement("div",{className:`${Hpe}-header-content`},"code"===r?h().createElement(Vpe,null):h().createElement(cP,null),h().createElement("span",{className:`${Hpe}-header-text`},t.name),h().createElement(vs,{className:`${Hpe}-header-expand-btn`,theme:"borderless",type:"tertiary",icon:h().createElement(zpe,null),onClick:i}))})),Gpe=h().memo((e=>{const{activeKey:t,codes:n=[],onExpand:r,style:i,className:s,onChange:o}=e;return h().createElement(Sf,{className:w()(Hpe,`${Hpe}-code`,{[s]:s}),style:i,onChange:o,activeKey:t,clickHeaderToExpand:!1},n.map((e=>h().createElement(Sf.Panel,{header:h().createElement(Wpe,{content:e,onExpand:r,mode:"code"}),itemKey:e.key,key:e.key},h().createElement(Kpe,Object.assign({key:e.key},e))))))})),qpe=Gpe;var Xpe=(e,t=0)=>{const n=[];return!e.children.length||t>20||Array.from(e.children).forEach((e=>{"SPAN"===e.tagName?n.push(e):e.children.length&&n.push(...Xpe(e,t+1))})),n},Ype=G9.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!0}),parseHTML(){return[{tag:"span",consuming:!1,getAttrs:e=>!!e.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(e=>{if(!e.children.length)return;const t=Xpe(e);t&&t.forEach((e=>{var t,n;const r=e.getAttribute("style"),i=null==(n=null==(t=e.parentElement)?void 0:t.closest("span"))?void 0:n.getAttribute("style");e.setAttribute("style",`${i};${r}`)}))})(e),{})}]},renderHTML({HTMLAttributes:e}){return["span",Q8(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{const{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}}}}),Zpe=J9.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{var t;const n=e.getAttribute("style");if(n){const e=n.split(";").map((e=>e.trim())).filter(Boolean);for(let t=e.length-1;t>=0;t-=1){const n=e[t].split(":");if(n.length>=2){const e=n[0].trim().toLowerCase(),t=n.slice(1).join(":").trim();if("background-color"===e)return t.replace(/['"]+/g,"")}}}return null==(t=e.style.backgroundColor)?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:e=>({chain:t})=>t().setMark("textStyle",{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()})}),Jpe=J9.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;const n=e.getAttribute("style");if(n){const e=n.split(";").map((e=>e.trim())).filter(Boolean);for(let t=e.length-1;t>=0;t-=1){const n=e[t].split(":");if(n.length>=2){const e=n[0].trim().toLowerCase(),t=n.slice(1).join(":").trim();if("color"===e)return t.replace(/['"]+/g,"")}}}return null==(t=e.style.color)?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),Qpe=J9.create({name:"fontFamily",addOptions:()=>({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:()=>({setFontFamily:e=>({chain:t})=>t().setMark("textStyle",{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()})}),efe=J9.create({name:"fontSize",addOptions:()=>({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:()=>({setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})}),tfe=J9.create({name:"lineHeight",addOptions:()=>({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:()=>({setLineHeight:e=>({chain:t})=>t().setMark("textStyle",{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()})}),nfe=J9.create({name:"textStyleKit",addExtensions(){const e=[];return!1!==this.options.backgroundColor&&e.push(Zpe.configure(this.options.backgroundColor)),!1!==this.options.color&&e.push(Jpe.configure(this.options.color)),!1!==this.options.fontFamily&&e.push(Qpe.configure(this.options.fontFamily)),!1!==this.options.fontSize&&e.push(efe.configure(this.options.fontSize)),!1!==this.options.lineHeight&&e.push(tfe.configure(this.options.lineHeight)),!1!==this.options.textStyle&&e.push(Ype.configure(this.options.textStyle)),e}}),rfe=Object.defineProperty,ife=(e,t)=>{for(var n in t)rfe(e,n,{get:t[n],enumerable:!0})};function sfe(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=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 s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var ofe=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(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(s);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],a=!!e,l=e||i.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return o.push(i),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(l),o.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...s,dispatch:void 0})]))),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:e,editor:r,view:s,state:sfe({state:i,transaction:e}),dispatch:t?()=>{}: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}},afe={};ife(afe,{blur:()=>lfe,clearContent:()=>cfe,clearNodes:()=>dfe,command:()=>hfe,createParagraphNear:()=>ufe,cut:()=>pfe,deleteCurrentNode:()=>ffe,deleteNode:()=>gfe,deleteRange:()=>yfe,deleteSelection:()=>vfe,enter:()=>bfe,exitCode:()=>wfe,extendMarkRange:()=>Ofe,first:()=>Tfe,focus:()=>Nfe,forEach:()=>Dfe,insertContent:()=>Lfe,insertContentAt:()=>Bfe,joinBackward:()=>Hfe,joinDown:()=>zfe,joinForward:()=>Ufe,joinItemBackward:()=>Kfe,joinItemForward:()=>Wfe,joinTextblockBackward:()=>Gfe,joinTextblockForward:()=>qfe,joinUp:()=>Vfe,keyboardShortcut:()=>Yfe,lift:()=>Jfe,liftEmptyBlock:()=>Qfe,liftListItem:()=>eme,newlineInCode:()=>tme,resetAttributes:()=>ime,scrollIntoView:()=>sme,selectAll:()=>ome,selectNodeBackward:()=>ame,selectNodeForward:()=>lme,selectParentNode:()=>cme,selectTextblockEnd:()=>dme,selectTextblockStart:()=>hme,setContent:()=>pme,setMark:()=>Kme,setMeta:()=>Wme,setNode:()=>Gme,setNodeSelection:()=>qme,setTextDirection:()=>Xme,setTextSelection:()=>Yme,sinkListItem:()=>Zme,splitBlock:()=>Qme,splitListItem:()=>ege,toggleList:()=>rge,toggleMark:()=>ige,toggleNode:()=>sge,toggleWrap:()=>oge,undoInputRule:()=>age,unsetAllMarks:()=>lge,unsetMark:()=>cge,unsetTextDirection:()=>dge,updateAttributes:()=>hge,wrapIn:()=>uge,wrapInList:()=>pge});var lfe=()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())})),!0),cfe=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),dfe=()=>({state:e,tr:t,dispatch:n})=>{const{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;const{doc:r,mapping:i}=t,s=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),a=s.blockRange(o);if(!a)return;const l=k2(a);if(e.type.isTextblock){const{defaultType:e}=s.parent.contentMatchAt(s.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},hfe=e=>t=>e(t),ufe=()=>({state:e,dispatch:t})=>B5(e,t),pfe=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const o=r.mapping.map(t);return r.insert(o,s.content),r.setSelection(new n5(r.doc.resolve(Math.max(o-1,0)))),!0},ffe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1){if(i.node(n).type===r.type){if(t){const t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}}return!1};function mfe(e,t){if("string"==typeof e){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 gfe=e=>({tr:t,state:n,dispatch:r})=>{const i=mfe(e,n.schema),s=t.selection.$anchor;for(let e=s.depth;e>0;e-=1){if(s.node(e).type===i){if(r){const n=s.before(e),r=s.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},yfe=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},vfe=()=>({state:e,dispatch:t})=>x5(e,t),bfe=()=>({commands:e})=>e.keyboardShortcut("Enter"),wfe=()=>({state:e,dispatch:t})=>$5(e,t);function xfe(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function Efe(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:xfe(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Cfe(e,t,n={}){return e.find((e=>e.type===t&&Efe(Object.fromEntries(Object.keys(n).map((t=>[t,e.attrs[t]]))),n)))}function Sfe(e,t,n={}){return!!Cfe(e,t,n)}function _fe(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some((e=>e.type===t))||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some((e=>e.type===t)))return;n=n||(null==(r=i.node.marks[0])?void 0:r.attrs);if(!Cfe([...i.node.marks],t,n))return;let s=i.index,o=e.start()+i.offset,a=s+1,l=o+i.node.nodeSize;for(;s>0&&Sfe([...e.parent.child(s-1).marks],t,n);)s-=1,o-=e.parent.child(s).nodeSize;for(;a<e.parent.childCount&&Sfe([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function kfe(e,t){if("string"==typeof e){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 Ofe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const s=kfe(e,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){const e=_fe(l,s,t);if(e&&e.from<=c&&e.to>=d){const t=n5.create(o,e.from,e.to);n.setSelection(t)}}return!0},Tfe=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function Pfe(e){return e instanceof n5}function Ife(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Mfe(e,t=null){if(!t)return null;const n=J2.atStart(e),r=J2.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,s=r.to;return"all"===t?n5.create(e,Ife(0,i,s),Ife(e.content.size,i,s)):n5.create(e,Ife(t,i,s),Ife(t,i,s))}function Rfe(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function Afe(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Nfe=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const o=()=>{(Afe()||Rfe())&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(s&&null===e&&!Pfe(n.state.selection))return o(),!0;const a=Mfe(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Dfe=(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),Lfe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Ffe=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&Ffe(r)}return e};function jfe(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return Ffe(n)}function $fe(e,t,n){if(e instanceof S1||e instanceof e1)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return e1.fromArray(e.map((e=>t.nodeFromJSON(e))));const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),$fe("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,i="";const s=new H1({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="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?K1.fromSchema(s).parseSlice(jfe(e),n.parseOptions):K1.fromSchema(s).parse(jfe(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${i}`)})}const r=K1.fromSchema(t);return n.slice?r.parseSlice(jfe(e),n.parseOptions).content:r.parse(jfe(e),n.parseOptions)}return $fe("",t,n)}var Bfe=(e,t,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){let i;const a=e=>{s.emit("contentError",{editor:s,error:e,disableCollaboration:()=>{"collaboration"in s.storage&&"object"==typeof s.storage.collaboration&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},l={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{$fe(t,s.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(e){a(e)}try{i=$fe(t,s.schema,{parseOptions:l,errorOnInvalidContent:null!=(o=n.errorOnInvalidContent)?o:s.options.enableContentCheck})}catch(e){return a(e),!1}let{from:c,to:d}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},h=!0,u=!0;if(("type"in i?[i]:i).forEach((e=>{e.check(),h=!!h&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),c===d&&u){const{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(c-=1,d+=1)}let p;if(h){if(Array.isArray(t))p=t.map((e=>e.text||"")).join("");else if(t instanceof e1){let e="";t.forEach((t=>{t.text&&(e+=t.text)})),p=e}else p="object"==typeof t&&t&&t.text?t.text:t;r.insertText(p,c,d)}else{p=i;const e=r.doc.resolve(c),t=e.node(),n=0===e.parentOffset,s=t.isText||t.isTextblock,o=t.content.size>0;n&&s&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,d,p)}n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof x2||i instanceof E2))return;const s=e.mapping.maps[r];let o=0;s.forEach(((e,t,n,r)=>{0===o&&(o=r)})),e.setSelection(J2.near(e.doc.resolve(o),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},Vfe=()=>({state:e,dispatch:t})=>N5(e,t),zfe=()=>({state:e,dispatch:t})=>D5(e,t),Hfe=()=>({state:e,dispatch:t})=>C5(e,t),Ufe=()=>({state:e,dispatch:t})=>M5(e,t),Kfe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Wfe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Gfe=()=>({state:e,dispatch:t})=>S5(e,t),qfe=()=>({state:e,dispatch:t})=>_5(e,t);function Xfe(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var Yfe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const s=function(e){const t=e.split(/-(?!$)/);let n,r,i,s,o=t[t.length-1];"Space"===o&&(o=" ");for(let e=0;e<t.length-1;e+=1){const o=t[e];if(/^(cmd|meta|m)$/i.test(o))s=!0;else if(/^a(lt)?$/i.test(o))n=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))i=!0;else{if(!/^mod$/i.test(o))throw new Error(`Unrecognized modifier name: ${o}`);Afe()||Xfe()?s=!0:r=!0}}return n&&(o=`Alt-${o}`),r&&(o=`Ctrl-${o}`),s&&(o=`Meta-${o}`),i&&(o=`Shift-${o}`),o}(e).split(/-(?!$)/),o=s.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===o?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0};function Zfe(e,t,n={}){const{from:r,to:i,empty:s}=e.selection,o=t?mfe(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:s})}));const l=i-r,c=a.filter((e=>!o||o.name===e.node.type.name)).filter((e=>Efe(e.node.attrs,n,{strict:!1})));if(s)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}var Jfe=(e,t={})=>({state:n,dispatch:r})=>!!Zfe(n,mfe(e,n.schema),t)&&L5(n,r),Qfe=()=>({state:e,dispatch:t})=>V5(e,t),eme=e=>({state:t,dispatch:n})=>r3(mfe(e,t.schema))(t,n),tme=()=>({state:e,dispatch:t})=>F5(e,t);function nme(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function rme(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}var ime=(e,t)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=nme("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(s=mfe(e,r.schema)),"mark"===a&&(o=kfe(e,r.schema));let l=!1;return n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{s&&s===e.type&&(l=!0,i&&n.setNodeMarkup(r,void 0,rme(e.attrs,t))),o&&e.marks.length&&e.marks.forEach((s=>{o===s.type&&(l=!0,i&&n.addMark(r,r+e.nodeSize,o.create(rme(s.attrs,t))))}))}))})),l},sme=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),ome=()=>({tr:e,dispatch:t})=>{if(t){const t=new o5(e.doc);e.setSelection(t)}return!0},ame=()=>({state:e,dispatch:t})=>T5(e,t),lme=()=>({state:e,dispatch:t})=>R5(e,t),cme=()=>({state:e,dispatch:t})=>U5(e,t),dme=()=>({state:e,dispatch:t})=>q5(e,t),hme=()=>({state:e,dispatch:t})=>G5(e,t);function ume(e,t,n={},r={}){return $fe(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var pme=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if("full"!==r.preserveWhitespace){const a=ume(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function fme(e,t){const n=kfe(t,e.schema),{from:r,to:i,empty:s}=e.selection,o=[];s?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{o.push(...e.marks)}));const a=o.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function mme(e,t){const n=new Y2(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}function gme(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function yme(e,t,n){if(void 0===e.config[t]&&e.parent)return yme(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?yme(e.parent,t,n):null})}return e.config[t]}function vme(e){return e.map((e=>{const t=yme(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...vme(t())]:e})).flat(10)}function bme(e,t){const n=t2.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function wme(e){return"function"==typeof e}function xme(e,t=void 0,...n){return wme(e)?t?e.bind(t)(...n):e(...n):e}function Eme(e){const t=e.filter((e=>"extension"===e.type)),n=e.filter((e=>"node"===e.type)),r=e.filter((e=>"mark"===e.type));return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function Cme(e){const t=[],{nodeExtensions:n,markExtensions:r}=Eme(e),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=yme(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:i});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...s,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=yme(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...s,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&void 0===(null==i?void 0:i.default)&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function Sme(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],s=r.filter((e=>!i.includes(e)));n[e]=[...i,...s].join(" ")}else if("style"===e){const r=t?t.split(";").map((e=>e.trim())).filter(Boolean):[],i=n[e]?n[e].split(";").map((e=>e.trim())).filter(Boolean):[],s=new Map;i.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),r.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),n[e]=Array.from(s.entries()).map((([e,t])=>`${e}: ${t}`)).join("; ")}else n[e]=t;else n[e]=t})),n}),{})}function _me(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)=>Sme(e,t)),{})}function kme(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function Ome(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function Tme(e){var t,n;const r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),void 0!==(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)&&(r.validate=e.attribute.validate),[e.name,r]}function Pme(e,t){var n;const r=Cme(e),{nodeExtensions:i,markExtensions:s}=Eme(e),o=null==(n=i.find((e=>yme(e,"topNode"))))?void 0:n.name,a=Object.fromEntries(i.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=yme(t,"extendNodeSchema",s);return{...e,...r?r(n):{}}}),{}),a=Ome({...o,content:xme(yme(n,"content",s)),marks:xme(yme(n,"marks",s)),group:xme(yme(n,"group",s)),inline:xme(yme(n,"inline",s)),atom:xme(yme(n,"atom",s)),selectable:xme(yme(n,"selectable",s)),draggable:xme(yme(n,"draggable",s)),code:xme(yme(n,"code",s)),whitespace:xme(yme(n,"whitespace",s)),linebreakReplacement:xme(yme(n,"linebreakReplacement",s)),defining:xme(yme(n,"defining",s)),isolating:xme(yme(n,"isolating",s)),attrs:Object.fromEntries(i.map(Tme))}),l=xme(yme(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>kme(e,i))));const c=yme(n,"renderHTML",s);c&&(a.toDOM=e=>c({node:e,HTMLAttributes:_me(e,i)}));const d=yme(n,"renderText",s);return d&&(a.toText=d),[n.name,a]}))),l=Object.fromEntries(s.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=yme(t,"extendMarkSchema",s);return{...e,...r?r(n):{}}}),{}),a=Ome({...o,inclusive:xme(yme(n,"inclusive",s)),excludes:xme(yme(n,"excludes",s)),group:xme(yme(n,"group",s)),spanning:xme(yme(n,"spanning",s)),code:xme(yme(n,"code",s)),attrs:Object.fromEntries(i.map(Tme))}),l=xme(yme(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>kme(e,i))));const c=yme(n,"renderHTML",s);return c&&(a.toDOM=e=>c({mark:e,HTMLAttributes:_me(e,i)})),[n.name,a]})));return new H1({topNode:o,nodes:a,marks:l})}function Ime(e){return e.sort(((e,t)=>{const n=yme(e,"priority")||100,r=yme(t,"priority")||100;return n>r?-1:n<r?1:0}))}function Mme(e){const t=Ime(vme(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return Array.from(new Set(t))}(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 Rme(e,t,n){const{from:r,to:i}=t,{blockSeparator:s="\n\n",textSerializers:o={}}=n||{};let a="";return e.nodesBetween(r,i,((e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=s);const h=null==o?void 0:o[e.type.name];if(h)return l&&(a+=h({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,i-n))})),a}function Ame(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}function Nme(e,t){const n=nme("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=mfe(t,e.schema),{from:r,to:i}=e.selection,s=[];e.doc.nodesBetween(r,i,(e=>{s.push(e)}));const o=s.reverse().find((e=>e.type.name===n.name));return o?{...o.attrs}:{}}(e,t):"mark"===n?fme(e,t):{}}function Dme(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.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 Lme(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,i)=>{const s=[];if(e.ranges.length)e.forEach(((e,t)=>{s.push({from:e,to:t})}));else{const{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;s.push({from:e,to:t})}s.forEach((({from:e,to:n})=>{const s=t.slice(i).map(e,-1),o=t.slice(i).map(n),a=t.invert().map(s,-1),l=t.invert().map(o);r.push({oldRange:{from:a,to:l},newRange:{from:s,to:o}})}))})),Dme(r)}function Fme(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const i=_fe(n.resolve(e),t.type);i&&r.push({mark:t,...i})})):n.nodesBetween(e,t,((e,t)=>{e&&void 0!==(null==e?void 0:e.nodeSize)&&r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function jme(e,t){return t.nodes[e]||t.marks[e]||null}function $me(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}var Bme=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,i,s)=>{var o,a;const l=(null==(a=(o=e.type.spec).toText)?void 0:a.call(o,{node:e,pos:t,parent:i,index:s}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))})),n};function Vme(e,t,n={}){const{empty:r,ranges:i}=e.selection,s=t?kfe(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!s||s.name===e.type.name)).find((e=>Efe(e.attrs,n,{strict:!1})));let o=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);o+=s-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:s}))))}))})),0===o)return!1;const l=a.filter((e=>!s||s.name===e.mark.type.name)).filter((e=>Efe(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!s||e.mark.type!==s&&e.mark.type.excludes(s))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=o}function zme(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Hme(e,t){const{nodeExtensions:n}=Eme(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=xme(yme(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function Ume(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach((e=>{!1!==r&&(Ume(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))})),r}return!1}var Kme=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=kfe(e,r.schema);if(i)if(o){const e=fme(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,s=e.$to.pos;r.doc.nodesBetween(i,s,((e,r)=>{const o=Math.max(r,i),a=Math.min(r+e.nodeSize,s),c=e.marks.find((e=>e.type===l));c?e.marks.forEach((e=>{l===e.type&&n.addMark(o,a,l.create({...e.attrs,...t}))})):n.addMark(o,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:i}=t;let s=null;if(Pfe(i)&&(s=i.$cursor),s){const t=null!=(r=e.storedMarks)?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some((e=>e.type.excludes(n))))}const{ranges:o}=i;return o.some((({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(i)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),s=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));i=t&&s}return!i})),i}))}(r,n,l)},Wme=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Gme=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const s=mfe(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command((({commands:e})=>!!Y5(s,{...o,...t})(n)||e.clearNodes())).command((({state:e})=>Y5(s,{...o,...t})(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},qme=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=Ife(e,0,n.content.size),i=i5.create(n,r);t.setSelection(i)}return!0},Xme=(e,t)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let o,a;return"number"==typeof t?(o=t,a=t):t&&"from"in t&&"to"in t?(o=t.from,a=t.to):(o=s.from,a=s.to),i&&n.doc.nodesBetween(o,a,((t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})})),!0},Yme=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,s=n5.atStart(n).from,o=n5.atEnd(n).to,a=Ife(r,s,o),l=Ife(i,s,o),c=n5.create(n,a,l);t.setSelection(c)}return!0},Zme=e=>({state:t,dispatch:n})=>i3(mfe(e,t.schema))(t,n);function Jme(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}var Qme=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=t,{$from:a,$to:l}=s,c=$me(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(s instanceof i5&&s.node.isBlock)return!(!a.parentOffset||!M2(o,a.pos))&&(r&&(e&&Jme(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=d&&h?[{type:h,attrs:c}]:void 0,p=M2(t.doc,t.mapping.map(a.pos),1,u);if(u||p||!M2(t.doc,t.mapping.map(a.pos),1,h?[{type:h}]:void 0)||(p=!0,u=h?[{type:h,attrs:c}]:void 0),r){if(p&&(s instanceof n5&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,u),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(a.before()),h)}e&&Jme(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},ege=(e,t={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=mfe(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const h=l.node(-1);if(h.type!==a)return!1;const u=s.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let e=e1.empty;const r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=e1.from(l.node(t).copy(e));const i=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,s={...$me(u,l.node().type.name,l.node().attrs),...t},c=(null==(o=a.contentMatch.defaultType)?void 0:o.createAndFill(s))||void 0;e=e.append(e1.from(a.createAndFill(null,c)||void 0));const d=l.before(l.depth-(r-1));n.replace(d,l.after(-i),new o1(e,4-r,0));let h=-1;n.doc.nodesBetween(d,n.doc.content.size,((e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)})),h>-1&&n.setSelection(n5.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...$me(u,h.type.name,h.attrs),...t},m={...$me(u,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!M2(n.doc,l.pos,2))return!1;if(i){const{selection:e,storedMarks:t}=r,{splittableMarks:o}=s.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!i)return!0;const c=a.filter((e=>o.includes(e.type.name)));n.ensureMarks(c)}return!0},tge=(e,t)=>{const n=gme((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,n.pos)||(e.join(n.pos),!0)},nge=(e,t)=>{const n=gme((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,r)||(e.join(r),!0)},rge=(e,t,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:h,splittableMarks:u}=i.extensionManager,p=mfe(e,o.schema),f=mfe(t,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:v}=m,b=y.blockRange(v),w=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const x=gme((e=>Hme(e.type.name,h)))(m);if(b.depth>=1&&x&&b.depth-x.depth<=1){if(x.node.type===p)return c.liftListItem(f);if(Hme(x.node.type.name,h)&&p.validContent(x.node.content)&&a)return l().command((()=>(s.setNodeMarkup(x.pos,p),!0))).command((()=>tge(s,p))).command((()=>nge(s,p))).run()}return n&&w&&a?l().command((()=>{const e=d().wrapInList(p,r),t=w.filter((e=>u.includes(e.type.name)));return s.ensureMarks(t),!!e||c.clearNodes()})).wrapInList(p,r).command((()=>tge(s,p))).command((()=>nge(s,p))).run():l().command((()=>!!d().wrapInList(p,r)||c.clearNodes())).wrapInList(p,r).command((()=>tge(s,p))).command((()=>nge(s,p))).run()},ige=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=kfe(e,r.schema);return Vme(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,t)},sge=(e,t,n={})=>({state:r,commands:i})=>{const s=mfe(e,r.schema),o=mfe(t,r.schema),a=Zfe(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},oge=(e,t={})=>({state:n,commands:r})=>{const i=mfe(e,n.schema);return Zfe(n,i,t)?r.lift(i):r.wrapIn(i,t)},age=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){const t=e.tr,n=s.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(s.text){const n=t.doc.resolve(s.from).marks();t.replaceWith(s.from,s.to,e.schema.text(s.text,n))}else t.delete(s.from,s.to)}return!0}}return!1},lge=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},cge=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=t,{selection:a}=n,l=kfe(e,r.schema),{$from:c,empty:d,ranges:h}=a;if(!i)return!0;if(d&&o){let{from:e,to:t}=a;const r=null==(s=c.marks().find((e=>e.type===l)))?void 0:s.attrs,i=_fe(c,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else h.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},dge=e=>({tr:t,state:n,dispatch:r})=>{const{selection:i}=n;let s,o;return"number"==typeof e?(s=e,o=e):e&&"from"in e&&"to"in e?(s=e.from,o=e.to):(s=i.from,o=i.to),r&&t.doc.nodesBetween(s,o,((e,n)=>{if(e.isText)return;const r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)})),!0},hge=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=nme("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(s=mfe(e,r.schema)),"mark"===a&&(o=kfe(e,r.schema));let l=!1;return n.selection.ranges.forEach((e=>{const a=e.$from.pos,c=e.$to.pos;let d,h,u,p;n.selection.empty?r.doc.nodesBetween(a,c,((e,t)=>{s&&s===e.type&&(l=!0,u=Math.max(t,a),p=Math.min(t+e.nodeSize,c),d=t,h=e)})):r.doc.nodesBetween(a,c,((e,r)=>{r<a&&s&&s===e.type&&(l=!0,u=Math.max(r,a),p=Math.min(r+e.nodeSize,c),d=r,h=e),r>=a&&r<=c&&(s&&s===e.type&&(l=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach((s=>{if(o===s.type&&(l=!0,i)){const i=Math.max(r,a),l=Math.min(r+e.nodeSize,c);n.addMark(i,l,o.create({...s.attrs,...t}))}})))})),h&&(void 0!==d&&i&&n.setNodeMarkup(d,void 0,{...h.attrs,...t}),o&&h.marks.length&&h.marks.forEach((e=>{o===e.type&&i&&n.addMark(u,p,o.create({...e.attrs,...t}))})))})),l},uge=(e,t={})=>({state:n,dispatch:r})=>X5(mfe(e,n.schema),t)(n,r),pge=(e,t={})=>({state:n,dispatch:r})=>n3(mfe(e,n.schema),t)(n,r),fge=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}},mge=(e,t)=>{if(xfe(t))return t.exec(e);const n=t(e);if(!n)return null;const 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 gge(e){var t;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let d=!1;const h=Bme(c)+s;return o.forEach((e=>{if(d)return;const t=mge(h,e.find);if(!t)return;const o=l.state.tr,c=sfe({state:l.state,transaction:o}),u={from:r-(t[0].length-s.length),to:i},{commands:p,chain:f,can:m}=new ofe({editor:n,state:c});null!==e.handler({state:c,range:u,match:t,commands:p,chain:f,can:m})&&o.steps.length&&(e.undoable&&o.setMeta(a,{transform:o,from:r,to:i,text:s}),l.dispatch(o),d=!0)})),d}function yge(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function vge(e,t){const n={...e};return yge(e)&&yge(t)&&Object.keys(t).forEach((r=>{yge(t[r])&&yge(e[r])?n[r]=vge(e[r],t[r]):n[r]=t[r]})),n}var bge=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{...xme(yme(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...xme(yme(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>vge(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const 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}},wge=class e extends bge{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const i=r.marks();if(!!!i.find((e=>(null==e?void 0:e.type.name)===t.name)))return!1;const s=i.find((e=>(null==e?void 0:e.type.name)===t.name));return s&&n.removeStoredMark(s),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};var xge=class{constructor(e){this.find=e.find,this.handler=e.handler}},Ege=(e,t,n)=>{if(xfe(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map((t=>{const 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})):[]};var Cge=null;function Sge(e){const{editor:t,rules:n}=e;let r,i=null,s=!1,o=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:e,from:n,to:i,rule:s,pasteEvt:o})=>{const l=e.tr,c=sfe({state:e,transaction:l}),d=function(e){const{editor:t,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=e,{commands:l,chain:c,can:d}=new ofe({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,((e,t)=>{var u,p,f,m,g;if((null==(p=null==(u=e.type)?void 0:u.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;const y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,v=Math.max(r,t),b=Math.min(i,t+y);if(v>=b)return;const w=e.isText?e.text||"":e.textBetween(v-t,b-t,void 0,"");Ege(w,s.find,o).forEach((e=>{if(void 0===e.index)return;const t=v+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},u=s.handler({state:n,range:i,match:e,commands:l,chain:c,can:d,pasteEvent:o,dropEvent:a});h.push(u)}))})),h.every((e=>null!==e))}({editor:t,state:c,from:Math.max(n-1,0),to:i.b-1,rule:s,pasteEvent:o,dropEvent:r});if(d&&l.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}},c=n.map((e=>new y5({view(e){const n=n=>{var r;i=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,i&&(Cge=t)},r=()=>{Cge&&(Cge=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(o=i===e.dom.parentElement,r=t,!o){const e=Cge;(null==e?void 0:e.isEditable)&&setTimeout((()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})}),10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,s=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const i=t[0],c="paste"===i.getMeta("uiEvent")&&!s,d="drop"===i.getMeta("uiEvent")&&!o,h=i.getMeta("applyPasteRules"),u=!!h;if(!c&&!d&&!u)return;if(u){let{text:t}=h;"string"==typeof t||(t=bme(e1.from(t),r.schema));const{from:n}=h,i=n+t.length,s=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return l({rule:e,state:r,from:n,to:{b:i},pasteEvt:s})}const p=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof p&&f&&p!==f.b?l({rule:e,state:r,from:p,to:f,pasteEvt:a}):void 0}})));return c}var _ge=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Mme(e),this.schema=Pme(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce(((e,t)=>{const n=yme(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:jme(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=Ime([...this.extensions].reverse()).flatMap((t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:jme(t.name,this.schema)},r=[],i=yme(t,"addKeyboardShortcuts",n);let s={};if("mark"===t.type&&yme(t,"exitable",n)&&(s.ArrowRight=()=>wge.handleExit({editor:e,mark:t})),i){const t=Object.fromEntries(Object.entries(i()).map((([t,n])=>[t,()=>n({editor:e})])));s={...s,...t}}const o=M7(s);r.push(o);const a=yme(t,"addInputRules",n);if(zme(t,e.options.enableInputRules)&&a){const t=a();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new y5({state:{init:()=>null,apply(e,i,s){const o=e.getMeta(r);if(o)return o;const a=e.getMeta("applyInputRules");return!!a&&setTimeout((()=>{let{text:e}=a;"string"==typeof e||(e=bme(e1.from(e),s.schema));const{from:i}=a,o=i+e.length;gge({editor:t,from:i,to:o,text:e,rules:n,plugin:r})})),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,s,o)=>gge({editor:t,from:i,to:s,text:o,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&gge({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:s}=e.state.selection;return!!s&&gge({editor:t,from:s.pos,to:s.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}const l=yme(t,"addPasteRules",n);if(zme(t,e.options.enablePasteRules)&&l){const t=l();if(t&&t.length){const n=Sge({editor:e,rules:t});r.push(...n)}}const c=yme(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r}));return t}get attributes(){return Cme(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Eme(this.extensions);return Object.fromEntries(t.filter((e=>!!yme(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:mfe(t.name,this.schema)},i=yme(t,"addNodeView",r);if(!i)return[];const s=i();if(!s)return[];return[t.name,(r,i,o,a,l)=>{const c=_me(r,n);return s({node:r,view:i,getPos:o,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:c})}]})))}get markViews(){const{editor:e}=this,{markExtensions:t}=Eme(this.extensions);return Object.fromEntries(t.filter((e=>!!yme(e,"addMarkView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:kfe(t.name,this.schema)},i=yme(t,"addMarkView",r);if(!i)return[];return[t.name,(r,s,o)=>{const a=_me(r,n);return i()({mark:r,view:s,inline:o,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{Yge(r,e,t)}})}]})))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map((e=>[e.name,e.storage]))),e.forEach((e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:jme(e.name,this.schema)};if("mark"===e.type){(null==(t=xme(yme(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name)}const r=yme(e,"onBeforeCreate",n),i=yme(e,"onCreate",n),s=yme(e,"onUpdate",n),o=yme(e,"onSelectionUpdate",n),a=yme(e,"onTransaction",n),l=yme(e,"onFocus",n),c=yme(e,"onBlur",n),d=yme(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),s&&this.editor.on("update",s),o&&this.editor.on("selectionUpdate",o),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)}))}};_ge.resolve=Mme,_ge.sort=Ime,_ge.flatten=vme;ife({},{ClipboardTextSerializer:()=>Oge,Commands:()=>Tge,Delete:()=>Pge,Drop:()=>Ige,Editable:()=>Mge,FocusEvents:()=>Age,Keymap:()=>Nge,Paste:()=>Dge,Tabindex:()=>Lge,TextDirection:()=>Fge,focusEventsPluginKey:()=>Rge});var kge=class e extends bge{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},Oge=kge.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new y5({key:new w5("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:s}=i,o=Math.min(...s.map((e=>e.$from.pos))),a=Math.max(...s.map((e=>e.$to.pos))),l=Ame(n);return Rme(r,{from:o,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),Tge=kge.create({name:"commands",addCommands:()=>({...afe})}),Pge=kge.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const s=()=>{var n,r,i,s;if(null!=(s=null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?s:e.getMeta("y-sync$"))return;const o=mme(e.before,[e,...t]);Lme(o).forEach((t=>{o.mapping.mapResult(t.oldRange.from).deletedAfter&&o.mapping.mapResult(t.oldRange.to).deletedBefore&&o.before.nodesBetween(t.oldRange.from,t.oldRange.to,((n,r)=>{const i=r+n.nodeSize-2,s=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:o.mapping.map(r),newTo:o.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!s,editor:this.editor,transaction:e,combinedTransform:o})}))}));const a=o.mapping;o.steps.forEach(((t,n)=>{var r,i;if(t instanceof v2){const s=a.slice(n).map(t.from,-1),l=a.slice(n).map(t.to),c=a.invert().map(s,-1),d=a.invert().map(l),h=null==(r=o.doc.nodeAt(s-1))?void 0:r.marks.some((e=>e.eq(t.mark))),u=null==(i=o.doc.nodeAt(l))?void 0:i.marks.some((e=>e.eq(t.mark)));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:s,to:l},partial:Boolean(u||h),editor:this.editor,transaction:e,combinedTransform:o})}}))};null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||i?setTimeout(s,0):s()}}),Ige=kge.create({name:"drop",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Mge=kge.create({name:"editable",addProseMirrorPlugins(){return[new y5({key:new w5("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Rge=new w5("focusEvents"),Age=kge.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new y5({key:Rge,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Nge=kge.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:s}=n,{pos:o,parent:a}=s,l=s.parent.isTextblock&&o>0?t.doc.resolve(o-1):s,c=l.parent.type.spec.isolating,d=s.pos-s.parentOffset,h=c&&1===l.parent.childCount?d===s.pos:J2.atStart(r).from===o;return!(!i||!a.type.isTextblock||a.textContent.length||!h||h&&"paragraph"===s.parent.type.name)&&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 Afe()||Xfe()?i:r},addProseMirrorPlugins(){return[new y5({key:new w5("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some((e=>e.getMeta("composition"))))return;const r=e.some((e=>e.docChanged))&&!t.doc.eq(n.doc),i=e.some((e=>e.getMeta("preventClearDocument")));if(!r||i)return;const{empty:s,from:o,to:a}=t.selection,l=J2.atStart(t.doc).from,c=J2.atEnd(t.doc).to;if(s||!(o===l&&a===c))return;if(!Ume(n.doc))return;const d=n.tr,h=sfe({state:n,transaction:d}),{commands:u}=new ofe({editor:this.editor,state:h});return u.clearNodes(),d.steps.length?d:void 0}})]}}),Dge=kge.create({name:"paste",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),Lge=kge.create({name:"tabindex",addProseMirrorPlugins(){return[new y5({key:new w5("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Fge=kge.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Eme(this.extensions);return[{types:e.filter((e=>"text"!==e.name)).map((e=>e.name)),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return!t||"ltr"!==t&&"rtl"!==t&&"auto"!==t?this.options.direction:t},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new y5({key:new w5("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}});function jge(e){return new fge({find:e.find,handler:({state:t,range:n,match:r})=>{const i=xme(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:s}=t,o=r[r.length-1],a=r[0];if(o){const r=a.search(/\S/),l=n.from+a.indexOf(o),c=l+o.length,d=Fme(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>l));if(d.length)return null;c<n.to&&s.delete(c,n.to),l>n.from&&s.delete(n.from+r,l);const h=n.from+r+o.length;s.addMark(n.from+r,h,e.type.create(i||{})),s.removeStoredMark(e.type)}},undoable:e.undoable})}function $ge(e){return new fge({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),s=xme(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,s)},undoable:e.undoable})}function Bge(e){return new fge({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const s=xme(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),a=o.doc.resolve(n.from).blockRange(),l=a&&O2(a,e.type,s);if(!l)return null;if(o.wrap(a,l),e.keepMarks&&e.editor){const{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,s=r||n.$to.parentOffset&&n.$from.marks();if(s){const e=s.filter((e=>i.includes(e.type.name)));o.ensureMarks(e)}}if(e.keepAttributes){const t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,s).run()}const c=o.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&R2(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&o.join(n.from-1)},undoable:e.undoable})}function Vge(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,(e=>(n.push(e),`__QUOTED_${n.length-1}__`))),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const e=i.map((e=>e.trim().slice(1)));t.class=e.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(t.id=s[1]);Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach((([,e,r])=>{var i;const s=parseInt((null==(i=r.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10),o=n[s];o&&(t[e]=o.slice(1,-1))}));const 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();if(o){o.split(/\s+/).filter(Boolean).forEach((e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}))}return t}function zge(e){if(!e||0===Object.keys(e).length)return"";const t=[];if(e.class){String(e.class).split(/\s+/).filter(Boolean).forEach((e=>t.push(`.${e}`)))}return e.id&&t.push(`#${e.id}`),Object.entries(e).forEach((([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))})),t.join(" ")}function Hge(e){const{nodeName:t,name:n,parseAttributes:r=Vge,serializeAttributes:i=zge,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=e,l=n||t;return{parseMarkdown:(e,n)=>{const r={...s,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,i){const s=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(s);if(!a)return;const c=a[1]||"",d=r(c),h=o.find((e=>!(e in d)));return h?void 0:{type:t,raw:a[0],attributes:d}}},renderMarkdown:e=>{const t=(e=>{if(!a)return e;const t={};return a.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),n=i(t);return`:::${l}${n?` {${n}}`:""} :::`}}}function Uge(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=Vge,serializeAttributes:s=zge,defaultAttributes:o={},content:a="block",allowedAttributes:l}=e,c=n||t;return{parseMarkdown:(e,n)=>{let i;if(r){const t=r(e);i="string"==typeof t?[{type:"text",text:t}]:t}else i="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const s={...o,...e.attributes};return n.createNode(t,s,i)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var s;const o=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(o);if(!l)return;const[d,h=""]=l,u=i(h);let p=1;const f=d.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(y);if(null===n)break;const i=n.index,o=n[1];if(!(null==(s=n[2])?void 0:s.endsWith(":::")))if(o)p+=1;else if(p-=1,0===p){const s=y.slice(0,i);m=s.trim();const o=e.slice(0,f+i+n[0].length);let l=[];if(m)if("block"===a)for(l=r.blockTokens(s),l.forEach((e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))}));l.length>0;){const e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(m);return{type:t,raw:o,attributes:u,content:m,tokens:l}}}}},renderMarkdown:(e,t)=>{const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),r=s(n),i=r?` {${r}}`:"",o=t.renderChildren(e.content||[],"\n\n");return`:::${c}${i}\n\n${o}\n\n:::`}}}function Kge(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,i,s,o]=r;t[i]=s||o,r=n.exec(e)}return t}function Wge(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}="${t}"`)).join(" ")}function Gge(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=Kge,serializeAttributes:s=Wge,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const i={...o,...e.attributes};if(a)return n.createNode(t,i);const s=r?r(e):e.content||"";return s?n.createNode(t,i,[n.createTextNode(s)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const s=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(s);if(!o)return;let l="",c="";if(a){const[,e]=o;c=e}else{const[,e,t]=o;c=e,l=t||""}const h=i(c.trim());return{type:t,raw:o[0],content:l.trim(),attributes:h}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter((e=>"text"===e.type)).map((e=>e.text)).join(""));const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{const r="string"==typeof n?n:n.name,i="string"==typeof n?void 0:n.skipIfDefault;if(r in e){const n=e[r];if(void 0!==i&&n===i)return;t[r]=n}})),t})(e.attrs||{}),i=s(n),o=i?` ${i}`:"";return a?`[${c}${o}]`:`[${c}${o}]${t}[/${c}]`}}}function qge(e,t,n){var r,i,s,o;const a=e.split("\n"),l=[];let c="",d=0;const h=t.baseIndentSize||2;for(;d<a.length;){const e=a[d],u=e.match(t.itemPattern);if(!u){if(l.length>0)break;if(""===e.trim()){d+=1,c=`${c}${e}\n`;continue}return}const p=t.extractItemData(u),{indentLevel:f,mainContent:m}=p;c=`${c}${e}\n`;const g=[m];for(d+=1;d<a.length;){const e=a[d];if(""===e.trim()){const t=a.slice(d+1).findIndex((e=>""!==e.trim()));if(-1===t)break;if(((null==(i=null==(r=a[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>f){g.push(e),c=`${c}${e}\n`,d+=1;continue}break}if(!(((null==(o=null==(s=e.match(/^(\s*)/))?void 0:s[1])?void 0:o.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,d+=1}let y;const v=g.slice(1);if(v.length>0){const e=v.map((e=>e.slice(f+h))).join("\n");e.trim()&&(y=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const b=t.createToken(p,y);l.push(b)}if(0!==l.length)return{items:l,raw:c}}function Xge(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i="function"==typeof n?n(r):n,[s,...o]=e.content,a=[`${i}${t.renderChildren([s])}`];return o&&o.length>0&&o.forEach((e=>{const n=t.renderChildren([e]);if(n){const e=n.split("\n").map((e=>e?t.indent(e):"")).join("\n");a.push(e)}})),a.join("\n")}function Yge(e,t,n={}){const{state:r}=t,{doc:i,tr:s}=r,o=e;i.descendants(((t,r)=>{const i=s.mapping.map(r),a=s.mapping.map(r)+t.nodeSize;let l=null;if(t.marks.forEach((e=>{if(e!==o)return!1;l=e})),!l)return;let c=!1;if(Object.keys(n).forEach((e=>{n[e]!==l.attrs[e]&&(c=!0)})),c){const t=e.type.create({...e.attrs,...n});s.removeMark(i,a,e.type),s.addMark(i,a,t)}})),s.docChanged&&t.view.dispatch(s)}ife({},{createAtomBlockMarkdownSpec:()=>Hge,createBlockMarkdownSpec:()=>Uge,createInlineMarkdownSpec:()=>Gge,parseAttributes:()=>Vge,parseIndentedBlocks:()=>qge,renderNestedMarkdownContent:()=>Xge,serializeAttributes:()=>zge});var Zge=class e extends bge{constructor(){super(...arguments),this.type="node"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};function Jge(e){return new xge({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const s=xme(e.getAttributes,void 0,r,i);if(!1===s||null===s)return null;const{tr:o}=t,a=r[r.length-1],l=r[0];let c=n.to;if(a){const r=l.search(/\S/),i=n.from+l.indexOf(a),d=i+a.length,h=Fme(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));if(h.length)return null;d<n.to&&o.delete(d,n.to),i>n.from&&o.delete(n.from+r,i),c=n.from+r+a.length,o.addMark(n.from+r,c,e.type.create(s||{})),o.removeStoredMark(e.type)}}})}var Qge=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);const{children:n,...r}=null!=t?t:{};if("svg"===e)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},eye=/^\s*>\s$/,tye=Zge.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return Qge("blockquote",{...Sme(this.options.HTMLAttributes,e),children:Qge("slot",{})})},parseMarkdown:(e,t)=>t.createNode("blockquote",void 0,t.parseChildren(e.tokens||[])),renderMarkdown:(e,t)=>{if(!e.content)return"";const n=[];return e.content.forEach((e=>{const r=t.renderChildren([e]).split("\n").map((e=>""===e.trim()?">":`> ${e}`));n.push(r.join("\n"))})),n.join("\n>\n")},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[Bge({find:eye,type:this.type})]}}),nye=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,rye=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,iye=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,sye=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,oye=wge.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&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 Qge("strong",{...Sme(this.options.HTMLAttributes,e),children:Qge("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),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[jge({find:nye,type:this.type}),jge({find:iye,type:this.type})]},addPasteRules(){return[Jge({find:rye,type:this.type}),Jge({find:sye,type:this.type})]}}),aye=/(^|[^`])`([^`]+)`(?!`)$/,lye=/(^|[^`])`([^`]+)`(?!`)/g,cye=wge.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",Sme(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[jge({find:aye,type:this.type})]},addPasteRules(){return[Jge({find:lye,type:this.type})]}}),dye=/^```([a-z]+)?[\s\n]$/,hye=/^~~~([a-z]+)?[\s\n]$/,uye=Zge.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",Sme(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n;return!1===(null==(n=e.raw)?void 0:n.startsWith("```"))&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const i=(null==(n=e.attrs)?void 0:n.language)||"";if(e.content){r=[`\`\`\`${i}`,t.renderChildren(e.content),"```"].join("\n")}else r=`\`\`\`${i}\n\n\`\`\``;return r},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:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;const a=" ".repeat(n);return o?e.commands.insertContent(a):e.commands.command((({tr:e})=>{const{from:t,to:n}=i,s=r.doc.textBetween(t,n,"\n","\n").split("\n").map((e=>a+e)).join("\n");return e.replaceWith(t,n,r.schema.text(s)),!0}))},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:s,empty:o}=i;return s.parent.type===this.type&&(o?e.commands.command((({tr:e})=>{var t;const{pos:i}=s,o=s.start(),a=s.end(),l=r.doc.textBetween(o,a,"\n","\n").split("\n");let c=0,d=0;const h=i-o;for(let e=0;e<l.length;e+=1){if(d+l[e].length>=h){c=e;break}d+=l[e].length+1}const u=(null==(t=l[c].match(/^ */))?void 0:t[0])||"",p=Math.min(u.length,n);if(0===p)return!0;let f=o;for(let e=0;e<c;e+=1)f+=l[e].length+1;e.delete(f,f+p);return i-f<=p&&e.setSelection(n5.create(e.doc,f)),!0})):e.commands.command((({tr:e})=>{const{from:t,to:s}=i,o=r.doc.textBetween(t,s,"\n","\n").split("\n").map((e=>{var t;const r=(null==(t=e.match(/^ */))?void 0:t[0])||"",i=Math.min(r.length,n);return e.slice(i)})).join("\n");return e.replaceWith(t,s,r.schema.text(o)),!0})))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith("\n\n");return!(!s||!o)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type)return!1;if(!(i.parentOffset===i.parent.nodeSize-2))return!1;const o=i.after();if(void 0===o)return!1;return r.nodeAt(o)?e.commands.command((({tr:e})=>(e.setSelection(J2.near(r.resolve(o))),!0))):e.commands.exitCode()}}},addInputRules(){return[$ge({find:dye,type:this.type,getAttributes:e=>({language:e[1]})}),$ge({find:hye,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new y5({key:new w5("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=null==i?void 0:i.mode;if(!n||!s)return!1;const{tr:o,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(n5.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}}),pye=Zge.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),fye=Zge.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Sme(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>" \n",parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:o}=r.extensionManager,a=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&s){const t=a.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()}}}),mye=Zge.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({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]}`,Sme(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},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=>$ge({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}}),gye=Zge.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",Sme(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof i5){const e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){const e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;i-=1}return!1}(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,i=e();return n instanceof i5?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command((({state:e,tr:t,dispatch:n})=>{if(n){const{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(n5.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(i5.create(t.doc,n.pos)):t.setSelection(n5.create(t.doc,n.pos));else{const i=e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,s=null==i?void 0:i.create();s&&(t.insert(r,s),t.setSelection(n5.create(t.doc,r+1)))}t.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(e={find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type},new fge({find:e.find,handler:({state:t,range:n,match:r})=>{const i=xme(e.getAttributes,void 0,r)||{},{tr:s}=t,o=n.from;let a=n.to;const l=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;const t=r[0][r[0].length-1];s.insertText(t,o+r[0].length-1),s.replaceWith(e,a,l)}else if(r[0]){const t=e.type.isInline?o:o-1;s.insert(t,e.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()},undoable:e.undoable}))];var e}}),yye=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,vye=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,bye=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,wye=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,xye=wge.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Sme(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||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[jge({find:yye,type:this.type}),jge({find:bye,type:this.type})]},addPasteRules(){return[Jge({find:vye,type:this.type}),Jge({find:wye,type:this.type})]}});const Eye="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Cye="ελ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",Sye="numeric",_ye="ascii",kye="alpha",Oye="asciinumeric",Tye="alphanumeric",Pye="domain",Iye="emoji",Mye="scheme",Rye="slashscheme",Aye="whitespace";function Nye(e,t){return e in t||(t[e]=[]),t[e]}function Dye(e,t,n){t[Sye]&&(t[Oye]=!0,t[Tye]=!0),t[_ye]&&(t[Oye]=!0,t[kye]=!0),t[Oye]&&(t[Tye]=!0),t[kye]&&(t[Tye]=!0),t[Tye]&&(t[Pye]=!0),t[Iye]&&(t[Pye]=!0);for(const r in t){const t=Nye(r,n);t.indexOf(e)<0&&t.push(e)}}function Lye(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Lye.groups={},Lye.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){const 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){let i;return r=r||Lye.groups,t&&t.j?i=t:(i=new Lye(t),n&&r&&Dye(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this;const s=e.length;if(!s)return i;for(let t=0;t<s-1;t++)i=i.tt(e[t]);return i.tt(e[s-1],t,n,r)},tt(e,t,n,r){r=r||Lye.groups;const i=this;if(t&&t.j)return i.j[e]=t,t;const s=t;let o,a=i.go(e);if(a?(o=new Lye,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new Lye,s){if(r)if(o.t&&"string"==typeof o.t){const e=Object.assign(function(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(o.t,r),n);Dye(s,e,r)}else n&&Dye(s,n,r);o.t=s}return i.j[e]=o,o}};const Fye=(e,t,n,r,i)=>e.ta(t,n,r,i),jye=(e,t,n,r,i)=>e.tr(t,n,r,i),$ye=(e,t,n,r,i)=>e.ts(t,n,r,i),Bye=(e,t,n,r,i)=>e.tt(t,n,r,i),Vye="WORD",zye="UWORD",Hye="ASCIINUMERICAL",Uye="ALPHANUMERICAL",Kye="LOCALHOST",Wye="TLD",Gye="UTLD",qye="SCHEME",Xye="SLASH_SCHEME",Yye="NUM",Zye="WS",Jye="NL",Qye="OPENBRACE",eve="CLOSEBRACE",tve="OPENBRACKET",nve="CLOSEBRACKET",rve="OPENPAREN",ive="CLOSEPAREN",sve="OPENANGLEBRACKET",ove="CLOSEANGLEBRACKET",ave="FULLWIDTHLEFTPAREN",lve="FULLWIDTHRIGHTPAREN",cve="LEFTCORNERBRACKET",dve="RIGHTCORNERBRACKET",hve="LEFTWHITECORNERBRACKET",uve="RIGHTWHITECORNERBRACKET",pve="FULLWIDTHLESSTHAN",fve="FULLWIDTHGREATERTHAN",mve="AMPERSAND",gve="APOSTROPHE",yve="ASTERISK",vve="AT",bve="BACKSLASH",wve="BACKTICK",xve="CARET",Eve="COLON",Cve="COMMA",Sve="DOLLAR",_ve="DOT",kve="EQUALS",Ove="EXCLAMATION",Tve="HYPHEN",Pve="PERCENT",Ive="PIPE",Mve="PLUS",Rve="POUND",Ave="QUERY",Nve="QUOTE",Dve="FULLWIDTHMIDDLEDOT",Lve="SEMI",Fve="SLASH",jve="TILDE",$ve="UNDERSCORE",Bve="EMOJI",Vve="SYM";var zve=Object.freeze({__proto__:null,ALPHANUMERICAL:Uye,AMPERSAND:mve,APOSTROPHE:gve,ASCIINUMERICAL:Hye,ASTERISK:yve,AT:vve,BACKSLASH:bve,BACKTICK:wve,CARET:xve,CLOSEANGLEBRACKET:ove,CLOSEBRACE:eve,CLOSEBRACKET:nve,CLOSEPAREN:ive,COLON:Eve,COMMA:Cve,DOLLAR:Sve,DOT:_ve,EMOJI:Bve,EQUALS:kve,EXCLAMATION:Ove,FULLWIDTHGREATERTHAN:fve,FULLWIDTHLEFTPAREN:ave,FULLWIDTHLESSTHAN:pve,FULLWIDTHMIDDLEDOT:Dve,FULLWIDTHRIGHTPAREN:lve,HYPHEN:Tve,LEFTCORNERBRACKET:cve,LEFTWHITECORNERBRACKET:hve,LOCALHOST:Kye,NL:Jye,NUM:Yye,OPENANGLEBRACKET:sve,OPENBRACE:Qye,OPENBRACKET:tve,OPENPAREN:rve,PERCENT:Pve,PIPE:Ive,PLUS:Mve,POUND:Rve,QUERY:Ave,QUOTE:Nve,RIGHTCORNERBRACKET:dve,RIGHTWHITECORNERBRACKET:uve,SCHEME:qye,SEMI:Lve,SLASH:Fve,SLASH_SCHEME:Xye,SYM:Vve,TILDE:jve,TLD:Wye,UNDERSCORE:$ve,UTLD:Gye,UWORD:zye,WORD:Vye,WS:Zye});const Hve=/[a-z]/,Uve=/\p{L}/u,Kve=/\p{Emoji}/u,Wve=/\d/,Gve=/\s/;const qve="\r",Xve="\n",Yve="️",Zve="",Jve="";let Qve=null,ebe=null;function tbe(e,t){const n=function(e){const t=[],n=e.length;let r=0;for(;r<n;){let i,s=e.charCodeAt(r),o=s<55296||s>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}(t.replace(/[A-Z]/g,(e=>e.toLowerCase()))),r=n.length,i=[];let s=0,o=0;for(;o<r;){let a=e,l=null,c=0,d=null,h=-1,u=-1;for(;o<r&&(l=a.go(n[o]));)a=l,a.accepts()?(h=0,u=0,d=a):h>=0&&(h+=n[o].length,u++),c+=n[o].length,s+=n[o].length,o++;s-=h,o-=u,c-=h,i.push({t:d.t,v:t.slice(s-c,s),s:s-c,e:s})}return i}function nbe(e,t,n,r,i){let s;const o=t.length;for(let n=0;n<o-1;n++){const o=t[n];e.j[o]?s=e.j[o]:(s=new Lye(r),s.jr=i.slice(),e.j[o]=s),e=s}return s=new Lye(n),s.jr=i.slice(),e.j[t[o-1]]=s,s}function rbe(e){const t=[],n=[];let 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}const ibe={defaultProtocol:"http",events:null,format:obe,formatHref:obe,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function sbe(e,t=null){let n=Object.assign({},ibe);e&&(n=Object.assign(n,e instanceof sbe?e.o:e));const 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}function obe(e){return e}sbe.prototype={o:ibe,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=null!=t;let i=this.o[e];return i?("object"==typeof i?(i=n.t in i?i[n.t]:ibe[e],"function"==typeof i&&r&&(i=i(t,n))):"function"==typeof i&&r&&(i=i(t,n.t,n)),i):i},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function abe(e,t){this.t="token",this.v=e,this.tk=t}function lbe(e,t){class n extends abe{constructor(t,n){super(t,n),this.t=e}}for(const e in t)n.prototype[e]=t[e];return n.t=e,n}abe.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const 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=ibe.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){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),s=this.toFormattedString(e),o={},a=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),d=e.getObj("attributes",n,t),h=e.getObj("events",n,t);return o.href=r,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),d&&Object.assign(o,d),{tagName:i,attributes:o,content:s,eventListeners:h}}};const cbe=lbe("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),dbe=lbe("text"),hbe=lbe("nl"),ube=lbe("url",{isLink:!0,toHref(e=ibe.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Kye&&e[1].t===Eve}});const pbe=e=>new Lye(e);function fbe(e,t,n){const r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}const mbe="undefined"!=typeof console&&console&&console.warn||(()=>{}),gbe="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ybe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function vbe(e,t=!1){if(ybe.initialized&&mbe(`linkifyjs: already initialized - will not register custom scheme "${e}" ${gbe}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');ybe.customSchemes.push([e,t])}function bbe(){ybe.scanner=function(e=[]){const t={};Lye.groups=t;const n=new Lye;null==Qve&&(Qve=rbe(Eye)),null==ebe&&(ebe=rbe(Cye)),Bye(n,"'",gve),Bye(n,"{",Qye),Bye(n,"}",eve),Bye(n,"[",tve),Bye(n,"]",nve),Bye(n,"(",rve),Bye(n,")",ive),Bye(n,"<",sve),Bye(n,">",ove),Bye(n,"(",ave),Bye(n,")",lve),Bye(n,"「",cve),Bye(n,"」",dve),Bye(n,"『",hve),Bye(n,"』",uve),Bye(n,"<",pve),Bye(n,">",fve),Bye(n,"&",mve),Bye(n,"*",yve),Bye(n,"@",vve),Bye(n,"`",wve),Bye(n,"^",xve),Bye(n,":",Eve),Bye(n,",",Cve),Bye(n,"$",Sve),Bye(n,".",_ve),Bye(n,"=",kve),Bye(n,"!",Ove),Bye(n,"-",Tve),Bye(n,"%",Pve),Bye(n,"|",Ive),Bye(n,"+",Mve),Bye(n,"#",Rve),Bye(n,"?",Ave),Bye(n,'"',Nve),Bye(n,"/",Fve),Bye(n,";",Lve),Bye(n,"~",jve),Bye(n,"_",$ve),Bye(n,"\\",bve),Bye(n,"・",Dve);const r=jye(n,Wve,Yye,{[Sye]:!0});jye(r,Wve,r);const i=jye(r,Hve,Hye,{[Oye]:!0}),s=jye(r,Uve,Uye,{[Tye]:!0}),o=jye(n,Hve,Vye,{[_ye]:!0});jye(o,Wve,i),jye(o,Hve,o),jye(i,Wve,i),jye(i,Hve,i);const a=jye(n,Uve,zye,{[kye]:!0});jye(a,Hve),jye(a,Wve,s),jye(a,Uve,a),jye(s,Wve,s),jye(s,Hve),jye(s,Uve,s);const l=Bye(n,Xve,Jye,{[Aye]:!0}),c=Bye(n,qve,Zye,{[Aye]:!0}),d=jye(n,Gve,Zye,{[Aye]:!0});Bye(n,Jve,d),Bye(c,Xve,l),Bye(c,Jve,d),jye(c,Gve,d),Bye(d,qve),Bye(d,Xve),jye(d,Gve,d),Bye(d,Jve,d);const h=jye(n,Kve,Bve,{[Iye]:!0});Bye(h,"#"),jye(h,Kve,h),Bye(h,Yve,h);const u=Bye(h,Zve);Bye(u,"#"),jye(u,Kve,h);const p=[[Hve,o],[Wve,i]],f=[[Hve,null],[Uve,a],[Wve,s]];for(let e=0;e<Qve.length;e++)nbe(n,Qve[e],Wye,Vye,p);for(let e=0;e<ebe.length;e++)nbe(n,ebe[e],Gye,zye,f);Dye(Wye,{tld:!0,ascii:!0},t),Dye(Gye,{utld:!0,alpha:!0},t),nbe(n,"file",qye,Vye,p),nbe(n,"mailto",qye,Vye,p),nbe(n,"http",Xye,Vye,p),nbe(n,"https",Xye,Vye,p),nbe(n,"ftp",Xye,Vye,p),nbe(n,"ftps",Xye,Vye,p),Dye(qye,{scheme:!0,ascii:!0},t),Dye(Xye,{slashscheme:!0,ascii:!0},t),e=e.sort(((e,t)=>e[0]>t[0]?1:-1));for(let t=0;t<e.length;t++){const r=e[t][0],i=e[t][1]?{[Mye]:!0}:{[Rye]:!0};r.indexOf("-")>=0?i[Pye]=!0:Hve.test(r)?Wve.test(r)?i[Oye]=!0:i[_ye]=!0:i[Sye]=!0,$ye(n,r,r,i)}return $ye(n,"localhost",Kye,{ascii:!0}),n.jd=new Lye(Vve),{start:n,tokens:Object.assign({groups:t},zve)}}(ybe.customSchemes);for(let e=0;e<ybe.tokenQueue.length;e++)ybe.tokenQueue[e][1]({scanner:ybe.scanner});ybe.parser=function({groups:e}){const t=e.domain.concat([mve,yve,vve,bve,wve,xve,Sve,kve,Tve,Yye,Pve,Ive,Mve,Rve,Fve,Vve,jve,$ve]),n=[gve,Eve,Cve,_ve,Ove,Pve,Ave,Nve,Lve,sve,ove,Qye,eve,nve,tve,rve,ive,ave,lve,cve,dve,hve,uve,pve,fve],r=[mve,gve,yve,bve,wve,xve,Sve,kve,Tve,Qye,eve,Pve,Ive,Mve,Rve,Ave,Fve,Vve,jve,$ve],i=pbe(),s=Bye(i,jve);Fye(s,r,s),Fye(s,e.domain,s);const o=pbe(),a=pbe(),l=pbe();Fye(i,e.domain,o),Fye(i,e.scheme,a),Fye(i,e.slashscheme,l),Fye(o,r,s),Fye(o,e.domain,o);const c=Bye(o,vve);Bye(s,vve,c),Bye(a,vve,c),Bye(l,vve,c);const d=Bye(s,_ve);Fye(d,r,s),Fye(d,e.domain,s);const h=pbe();Fye(c,e.domain,h),Fye(h,e.domain,h);const u=Bye(h,_ve);Fye(u,e.domain,h);const p=pbe(cbe);Fye(u,e.tld,p),Fye(u,e.utld,p),Bye(c,Kye,p);const f=Bye(h,Tve);Bye(f,Tve,f),Fye(f,e.domain,h),Fye(p,e.domain,h),Bye(p,_ve,u),Bye(p,Tve,f);const m=Bye(p,Eve);Fye(m,e.numeric,cbe);const g=Bye(o,Tve),y=Bye(o,_ve);Bye(g,Tve,g),Fye(g,e.domain,o),Fye(y,r,s),Fye(y,e.domain,o);const v=pbe(ube);Fye(y,e.tld,v),Fye(y,e.utld,v),Fye(v,e.domain,o),Fye(v,r,s),Bye(v,_ve,y),Bye(v,Tve,g),Bye(v,vve,c);const b=Bye(v,Eve),w=pbe(ube);Fye(b,e.numeric,w);const x=pbe(ube),E=pbe();Fye(x,t,x),Fye(x,n,E),Fye(E,t,x),Fye(E,n,E),Bye(v,Fve,x),Bye(w,Fve,x);const C=Bye(a,Eve),S=Bye(l,Eve),_=Bye(S,Fve),k=Bye(_,Fve);Fye(a,e.domain,o),Bye(a,_ve,y),Bye(a,Tve,g),Fye(l,e.domain,o),Bye(l,_ve,y),Bye(l,Tve,g),Fye(C,e.domain,x),Bye(C,Fve,x),Bye(C,Ave,x),Fye(k,e.domain,x),Fye(k,t,x),Bye(k,Fve,x);const O=[[Qye,eve],[tve,nve],[rve,ive],[sve,ove],[ave,lve],[cve,dve],[hve,uve],[pve,fve]];for(let e=0;e<O.length;e++){const[r,i]=O[e],s=Bye(x,r);Bye(E,r,s),Bye(s,i,x);const o=pbe(ube);Fye(s,t,o);const a=pbe();Fye(s,n),Fye(o,t,o),Fye(o,n,a),Fye(a,t,o),Fye(a,n,a),Bye(o,i,x),Bye(a,i,x)}return Bye(i,Kye,v),Bye(i,Jye,hbe),{start:i,tokens:zve}}(ybe.scanner.tokens);for(let e=0;e<ybe.pluginQueue.length;e++)ybe.pluginQueue[e][1]({scanner:ybe.scanner,parser:ybe.parser});return ybe.initialized=!0,ybe}function wbe(e){return ybe.initialized||bbe(),function(e,t,n){let r=n.length,i=0,s=[],o=[];for(;i<r;){let a=e,l=null,c=null,d=0,h=null,u=-1;for(;i<r&&!(l=a.go(n[i].t));)o.push(n[i++]);for(;i<r&&(c=l||a.go(n[i].t));)l=null,a=c,a.accepts()?(u=0,h=a):u>=0&&u++,i++,d++;if(u<0)i-=d,i<r&&(o.push(n[i]),i++);else{o.length>0&&(s.push(fbe(dbe,t,o)),o=[]),i-=u,d-=u;const e=h.t,r=n.slice(i-d,i);s.push(fbe(e,t,r))}}return o.length>0&&s.push(fbe(dbe,t,o)),s}(ybe.parser.start,e,tbe(ybe.scanner.start,e))}function xbe(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new sbe(n),i=wbe(e),s=[];for(let e=0;e<i.length;e++){const n=i[e];!n.isLink||t&&n.t!==t||!r.check(n)||s.push(n.toFormattedObject(r))}return s}wbe.scan=tbe;var Ebe="[\0- -\u2029 ]",Cbe=new RegExp(Ebe),Sbe=new RegExp(`${Ebe}$`),_be=new RegExp(Ebe,"g");function kbe(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach((e=>{const t="string"==typeof e?e:e.scheme;t&&n.push(t)})),!e||e.replace(_be,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Obe=wge.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=>{"string"!=typeof e?vbe(e.scheme,e.optionalSlashes):vbe(e)}))},onDestroy(){Lye.groups={},ybe.scanner=null,ybe.parser=null,ybe.tokenQueue=[],ybe.pluginQueue=[],ybe.customSchemes=[],ybe.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!kbe(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!(!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!kbe(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!kbe(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Sme(this.options.HTMLAttributes,e),0]:["a",Sme(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)=>{var n;const r=(null==(n=e.attrs)?void 0:n.href)||"";return`[${t.renderChildren(e)}](${r})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!kbe(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return!(n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!kbe(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&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[Jge({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,i=xbe(e).filter((e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!kbe(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=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(function(e){return new y5({key:new w5("autolink"),appendTransaction:(t,n,r)=>{const i=t.some((e=>e.docChanged))&&!n.doc.eq(r.doc),s=t.some((e=>e.getMeta("preventAutolink")));if(!i||s)return;const{tr:o}=r;return Lme(mme(n.doc,[...t])).forEach((({newRange:t})=>{const n=function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&r.push({node:e,pos:t})})),r}(r.doc,t,(e=>e.isTextblock));let i,s;if(n.length>1)i=n[0],s=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0," ");else if(n.length){const e=r.doc.textBetween(t.from,t.to," "," ");if(!Sbe.test(e))return;i=n[0],s=r.doc.textBetween(i.pos,t.to,void 0," ")}if(i&&s){const t=s.split(Cbe).filter(Boolean);if(t.length<=0)return!1;const n=t[t.length-1],l=i.pos+s.lastIndexOf(n);if(!n)return!1;const c=wbe(n).map((t=>t.toObject(e.defaultProtocol)));if(!(1===(a=c).length?a[0].isLink:3===a.length&&a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return!1;c.filter((e=>e.isLink)).map((e=>({...e,from:l+e.start+1,to:l+e.end+1}))).filter((e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code))).filter((t=>e.validate(t.value))).filter((t=>e.shouldAutoLink(t.value))).forEach((t=>{Fme(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}))}))}var a})),o.steps.length?o:void 0}})}({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!kbe(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(function(e){return new y5({key:new w5("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,s;if(0!==r.button)return!1;if(!t.editable)return!1;let o=!1;if(e.enableClickSelection&&(o=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=null;if(r.target instanceof HTMLAnchorElement)n=r.target;else{let e=r.target;const t=[];for(;"DIV"!==e.nodeName;)t.push(e),e=e.parentNode;n=t.find((e=>"A"===e.nodeName))}if(!n)return o;const a=Nme(t.state,e.type.name),l=null!=(i=null==n?void 0:n.href)?i:a.href,c=null!=(s=null==n?void 0:n.target)?s:a.target;n&&l&&(window.open(l,c),o=!0)}return o}}})}({type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(function(e){return new y5({key:new w5("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:i}=e,{state:s}=t,{selection:o}=s,{empty:a}=o;if(a)return!1;let l="";r.content.forEach((e=>{l+=e.textContent}));const c=xbe(l,{defaultProtocol:e.defaultProtocol}).find((e=>e.isLink&&e.value===l));return!(!l||!c||void 0!==i&&!i(c.href))&&e.editor.commands.setMark(e.type,{href:c.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),Tbe=Object.defineProperty,Pbe="textStyle",Ibe=/^\s*([-+*])\s$/,Mbe=Zge.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Sme(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(Pbe)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Bge({find:Ibe,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Bge({find:Ibe,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Pbe),editor:this.editor})),[e]}}),Rbe=Zge.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Sme(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{if("list_item"!==e.type)return[];let n=[];if(e.tokens&&e.tokens.length>0){const r=e.tokens.some((e=>"paragraph"===e.type));if(r)n=t.parseChildren(e.tokens);else{const r=e.tokens[0];if(r&&"text"===r.type&&r.tokens&&r.tokens.length>0){if(n=[{type:"paragraph",content:t.parseInline(r.tokens)}],e.tokens.length>1){const r=e.tokens.slice(1),i=t.parseChildren(r);n.push(...i)}}else n=t.parseChildren(e.tokens)}}return 0===n.length&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(e,t,n)=>Xge(e,t,(e=>"bulletList"===e.parentType?"- ":"orderedList"===e.parentType?`${e.index+1}. `:"- "),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)}}});((e,t)=>{for(var n in t)Tbe(e,n,{get:t[n],enumerable:!0})})({},{findListItemPos:()=>Abe,getNextListDepth:()=>Nbe,handleBackspace:()=>jbe,handleDelete:()=>Vbe,hasListBefore:()=>Dbe,hasListItemAfter:()=>zbe,hasListItemBefore:()=>Lbe,listItemHasSubList:()=>Fbe,nextListIsDeeper:()=>$be,nextListIsHigher:()=>Bbe});var Abe=(e,t)=>{const{$from:n}=t.selection,r=mfe(e,t.schema);let i=null,s=n.depth,o=n.pos,a=null;for(;s>0&&null===a;)i=n.node(s),i.type===r?a=s:(s-=1,o-=1);return null===a?null:{$pos:t.doc.resolve(o),depth:a}},Nbe=(e,t)=>{const n=Abe(e,t);if(!n)return!1;const[,r]=((e,t,n,r=20)=>{const i=e.doc.resolve(n);let s=r,o=null;for(;s>0&&null===o;){const e=i.node(s);(null==e?void 0:e.type.name)===t?o=e:s-=1}return[o,s]})(t,e,n.$pos.pos+4);return r},Dbe=(e,t,n)=>{const{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),s=e.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},Lbe=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return 0!==i.index()&&(null==(n=i.nodeBefore)?void 0:n.type.name)===e},Fbe=(e,t,n)=>{if(!n)return!1;const r=mfe(e,t.schema);let i=!1;return n.descendants((e=>{e.type===r&&(i=!0)})),i},jbe=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Zfe(e.state,t)&&Dbe(e.state,t,n)){const{$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})}));const s=i.at(-1);if(!s)return!1;const o=e.state.doc.resolve(r.start()+s.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!Zfe(e.state,t))return!1;if(!(e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)})(e.state))return!1;const r=Abe(t,e.state);if(!r)return!1;const i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=Fbe(t,e.state,i);return Lbe(t,e.state)&&!s?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},$be=(e,t)=>{const n=Nbe(e,t),r=Abe(e,t);return!(!r||!n)&&n>r.depth},Bbe=(e,t)=>{const n=Nbe(e,t),r=Abe(e,t);return!(!r||!n)&&n<r.depth},Vbe=(e,t)=>{if(!Zfe(e.state,t))return!1;if(!((e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const n=gme((e=>e.type.name===t))(e.selection);if(!n)return!1;const r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)})(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!(!n.empty&&r.sameParent(i))&&($be(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Bbe(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},zbe=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return i.index()!==i.parent.childCount-1&&(null==(n=i.nodeAfter)?void 0:n.type.name)===e},Hbe=kge.create({name:"listKeymap",addOptions:()=>({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})=>{void 0!==e.state.schema.nodes[n]&&Vbe(e,n)&&(t=!0)})),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach((({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&Vbe(e,n)&&(t=!0)})),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach((({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&jbe(e,n,r)&&(t=!0)})),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach((({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&jbe(e,n,r)&&(t=!0)})),t}}}}),Ube=/^(\s*)(\d+)\.\s+(.*)$/,Kbe=/^\s/;function Wbe(e,t,n){var r;const i=[];let s=0;for(;s<e.length;){const o=e[s];if(o.indent===t){const a=o.content.split("\n"),l=(null==(r=a[0])?void 0:r.trim())||"",c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=a.slice(1).join("\n").trim();if(d){const e=n.blockTokens(d);c.push(...e)}let h=s+1;const u=[];for(;h<e.length&&e[h].indent>t;)u.push(e[h]),h+=1;if(u.length>0){const e=Math.min(...u.map((e=>e.indent))),t=Wbe(u,e,n);c.push({type:"list",ordered:!0,start:u[0].number,items:t,raw:u.map((e=>e.raw)).join("\n")})}i.push({type:"list_item",raw:o.raw,tokens:c}),s=h}else s+=1}return i}var Gbe="textStyle",qbe=/^(\d+)\.\s$/,Xbe=Zge.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",Sme(this.options.HTMLAttributes,n),0]:["ol",Sme(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if("list"!==e.type||!e.ordered)return[];const n=e.start||1,r=e.items?function(e,t){return e.map((e=>{if("list_item"!==e.type)return t.parseChildren([e])[0];const n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach((e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push(...t.parseChildren([e]));else if("text"===e.type&&e.tokens){const r=t.parseChildren([e]);n.push({type:"paragraph",content:r})}else{const r=t.parseChildren([e]);r.length>0&&n.push(...r)}})),{type:"listItem",content:n}}))}(e.items,t):[];return 1!==n?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=null==t?void 0:t.index;return void 0!==n?n:-1},tokenize:(e,t,n)=>{var r;const i=e.split("\n"),[s,o]=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n],s=i.match(Ube);if(!s)break;const[,o,a,l]=s,c=o.length;let d=l,h=n+1;const u=[i];for(;h<e.length;){const t=e[h];if(t.match(Ube))break;if(""===t.trim())u.push(t),d+="\n",h+=1;else{if(!t.match(Kbe))break;u.push(t),d+=`\n${t.slice(c+2)}`,h+=1}}t.push({indent:c,number:parseInt(a,10),content:d.trim(),raw:u.join("\n")}),r=h,n=h}return[t,r]}(i);if(0===s.length)return;const a=Wbe(s,0,n);if(0===a.length)return;return{type:"list",ordered:!0,start:(null==(r=s[0])?void 0:r.number)||1,items:a,raw:i.slice(0,o).join("\n")}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(Gbe)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Bge({find:qbe,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=Bge({find:qbe,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Gbe)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),Ybe=/^\s*(\[([( |x])?\])\s$/,Zbe=Zge.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Sme(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const 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){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;return Xge(e,t,`- [${(null==(n=e.attrs)?void 0:n.checked)?"x":" "}] `)},addKeyboardShortcuts(){const 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})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=e=>{var t,n;a.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,a.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};return c(e),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",(e=>e.preventDefault())),a.addEventListener("change",(t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked)return void(a.checked=!a.checked);const{checked:i}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command((({tr:e})=>{const t=n();if("number"!=typeof t)return!1;const r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:i}),!0})).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(a.checked=!a.checked))})),Object.entries(this.options.HTMLAttributes).forEach((([e,t])=>{i.setAttribute(e,t)})),i.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,s.append(a,o),i.append(s,l),Object.entries(t).forEach((([e,t])=>{i.setAttribute(e,t)})),{dom:i,contentDOM:l,update:e=>e.type===this.type&&(i.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,c(e),!0)}}},addInputRules(){return[Bge({find:Ybe,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),Jbe=Zge.create({name:"taskList",addOptions:()=>({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",Sme(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,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize(e,t,n){const r=e=>{const t=qge(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),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=qge(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),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()}}}),Qbe=(kge.create({name:"listKit",addExtensions(){const e=[];return!1!==this.options.bulletList&&e.push(Mbe.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(Rbe.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(Hbe.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(Xbe.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(Zbe.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(Jbe.configure(this.options.taskList)),e}}),Zge.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Sme(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];return 1===n.length&&"image"===n[0].type?t.parseChildren([n[0]]):t.createNode("paragraph",void 0,t.parseInline(n))},renderMarkdown:(e,t)=>e&&Array.isArray(e.content)?t.renderChildren(e.content):"",addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})),ewe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,twe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,nwe=wge.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",Sme(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[jge({find:ewe,type:this.type})]},addPasteRules(){return[Jge({find:twe,type:this.type})]}}),rwe=Zge.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),iwe=wge.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",Sme(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>`++${t.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>e.indexOf("++"),tokenize(e,t,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;const 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()}}}),swe=Object.defineProperty,owe=(e,t)=>{for(var n in t)swe(e,n,{get:t[n],enumerable:!0})};function awe(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=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 s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var lwe=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(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(s);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],a=!!e,l=e||i.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return o.push(i),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(l),o.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...s,dispatch:void 0})]))),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:e,editor:r,view:s,state:awe({state:i,transaction:e}),dispatch:t?()=>{}: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}},cwe={};owe(cwe,{blur:()=>dwe,clearContent:()=>hwe,clearNodes:()=>uwe,command:()=>pwe,createParagraphNear:()=>fwe,cut:()=>mwe,deleteCurrentNode:()=>gwe,deleteNode:()=>vwe,deleteRange:()=>bwe,deleteSelection:()=>wwe,enter:()=>xwe,exitCode:()=>Ewe,extendMarkRange:()=>Pwe,first:()=>Iwe,focus:()=>Lwe,forEach:()=>Fwe,insertContent:()=>jwe,insertContentAt:()=>zwe,joinBackward:()=>Kwe,joinDown:()=>Uwe,joinForward:()=>Wwe,joinItemBackward:()=>Gwe,joinItemForward:()=>qwe,joinTextblockBackward:()=>Xwe,joinTextblockForward:()=>Ywe,joinUp:()=>Hwe,keyboardShortcut:()=>Jwe,lift:()=>exe,liftEmptyBlock:()=>txe,liftListItem:()=>nxe,newlineInCode:()=>rxe,resetAttributes:()=>oxe,scrollIntoView:()=>axe,selectAll:()=>lxe,selectNodeBackward:()=>cxe,selectNodeForward:()=>dxe,selectParentNode:()=>hxe,selectTextblockEnd:()=>uxe,selectTextblockStart:()=>pxe,setContent:()=>mxe,setMark:()=>zxe,setMeta:()=>Hxe,setNode:()=>Uxe,setNodeSelection:()=>Kxe,setTextDirection:()=>Wxe,setTextSelection:()=>Gxe,sinkListItem:()=>qxe,splitBlock:()=>Yxe,splitListItem:()=>Zxe,toggleList:()=>eEe,toggleMark:()=>tEe,toggleNode:()=>nEe,toggleWrap:()=>rEe,undoInputRule:()=>iEe,unsetAllMarks:()=>sEe,unsetMark:()=>oEe,unsetTextDirection:()=>aEe,updateAttributes:()=>lEe,wrapIn:()=>cEe,wrapInList:()=>dEe});var dwe=()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())})),!0),hwe=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),uwe=()=>({state:e,tr:t,dispatch:n})=>{const{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;const{doc:r,mapping:i}=t,s=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),a=s.blockRange(o);if(!a)return;const l=k2(a);if(e.type.isTextblock){const{defaultType:e}=s.parent.contentMatchAt(s.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},pwe=e=>t=>e(t),fwe=()=>({state:e,dispatch:t})=>B5(e,t),mwe=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const o=r.mapping.map(t);return r.insert(o,s.content),r.setSelection(new n5(r.doc.resolve(Math.max(o-1,0)))),!0},gwe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1){if(i.node(n).type===r.type){if(t){const t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}}return!1};function ywe(e,t){if("string"==typeof e){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 vwe=e=>({tr:t,state:n,dispatch:r})=>{const i=ywe(e,n.schema),s=t.selection.$anchor;for(let e=s.depth;e>0;e-=1){if(s.node(e).type===i){if(r){const n=s.before(e),r=s.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},bwe=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},wwe=()=>({state:e,dispatch:t})=>x5(e,t),xwe=()=>({commands:e})=>e.keyboardShortcut("Enter"),Ewe=()=>({state:e,dispatch:t})=>$5(e,t);function Cwe(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function Swe(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Cwe(t[r])?t[r].test(e[r]):t[r]===e[r]))}function _we(e,t,n={}){return e.find((e=>e.type===t&&Swe(Object.fromEntries(Object.keys(n).map((t=>[t,e.attrs[t]]))),n)))}function kwe(e,t,n={}){return!!_we(e,t,n)}function Owe(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some((e=>e.type===t))||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some((e=>e.type===t)))return;n=n||(null==(r=i.node.marks[0])?void 0:r.attrs);if(!_we([...i.node.marks],t,n))return;let s=i.index,o=e.start()+i.offset,a=s+1,l=o+i.node.nodeSize;for(;s>0&&kwe([...e.parent.child(s-1).marks],t,n);)s-=1,o-=e.parent.child(s).nodeSize;for(;a<e.parent.childCount&&kwe([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function Twe(e,t){if("string"==typeof e){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 Pwe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const s=Twe(e,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){const e=Owe(l,s,t);if(e&&e.from<=c&&e.to>=d){const t=n5.create(o,e.from,e.to);n.setSelection(t)}}return!0},Iwe=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function Mwe(e){return e instanceof n5}function Rwe(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Awe(e,t=null){if(!t)return null;const n=J2.atStart(e),r=J2.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,s=r.to;return"all"===t?n5.create(e,Rwe(0,i,s),Rwe(e.content.size,i,s)):n5.create(e,Rwe(t,i,s),Rwe(t,i,s))}function Nwe(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function Dwe(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Lwe=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const o=()=>{(Dwe()||Nwe())&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(s&&null===e&&!Mwe(n.state.selection))return o(),!0;const a=Awe(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Fwe=(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),jwe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),$we=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&$we(r)}return e};function Bwe(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return $we(n)}function Vwe(e,t,n){if(e instanceof S1||e instanceof e1)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return e1.fromArray(e.map((e=>t.nodeFromJSON(e))));const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Vwe("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,i="";const s=new H1({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="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?K1.fromSchema(s).parseSlice(Bwe(e),n.parseOptions):K1.fromSchema(s).parse(Bwe(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${i}`)})}const r=K1.fromSchema(t);return n.slice?r.parseSlice(Bwe(e),n.parseOptions).content:r.parse(Bwe(e),n.parseOptions)}return Vwe("",t,n)}var zwe=(e,t,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){let i;const a=e=>{s.emit("contentError",{editor:s,error:e,disableCollaboration:()=>{"collaboration"in s.storage&&"object"==typeof s.storage.collaboration&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},l={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Vwe(t,s.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(e){a(e)}try{i=Vwe(t,s.schema,{parseOptions:l,errorOnInvalidContent:null!=(o=n.errorOnInvalidContent)?o:s.options.enableContentCheck})}catch(e){return a(e),!1}let{from:c,to:d}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},h=!0,u=!0;if(("type"in i?[i]:i).forEach((e=>{e.check(),h=!!h&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),c===d&&u){const{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(c-=1,d+=1)}let p;if(h){if(Array.isArray(t))p=t.map((e=>e.text||"")).join("");else if(t instanceof e1){let e="";t.forEach((t=>{t.text&&(e+=t.text)})),p=e}else p="object"==typeof t&&t&&t.text?t.text:t;r.insertText(p,c,d)}else{p=i;const e=r.doc.resolve(c),t=e.node(),n=0===e.parentOffset,s=t.isText||t.isTextblock,o=t.content.size>0;n&&s&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,d,p)}n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof x2||i instanceof E2))return;const s=e.mapping.maps[r];let o=0;s.forEach(((e,t,n,r)=>{0===o&&(o=r)})),e.setSelection(J2.near(e.doc.resolve(o),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},Hwe=()=>({state:e,dispatch:t})=>N5(e,t),Uwe=()=>({state:e,dispatch:t})=>D5(e,t),Kwe=()=>({state:e,dispatch:t})=>C5(e,t),Wwe=()=>({state:e,dispatch:t})=>M5(e,t),Gwe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},qwe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=N2(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Xwe=()=>({state:e,dispatch:t})=>S5(e,t),Ywe=()=>({state:e,dispatch:t})=>_5(e,t);function Zwe(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var Jwe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const s=function(e){const t=e.split(/-(?!$)/);let n,r,i,s,o=t[t.length-1];"Space"===o&&(o=" ");for(let e=0;e<t.length-1;e+=1){const o=t[e];if(/^(cmd|meta|m)$/i.test(o))s=!0;else if(/^a(lt)?$/i.test(o))n=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))i=!0;else{if(!/^mod$/i.test(o))throw new Error(`Unrecognized modifier name: ${o}`);Dwe()||Zwe()?s=!0:r=!0}}return n&&(o=`Alt-${o}`),r&&(o=`Ctrl-${o}`),s&&(o=`Meta-${o}`),i&&(o=`Shift-${o}`),o}(e).split(/-(?!$)/),o=s.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===o?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0};function Qwe(e,t,n={}){const{from:r,to:i,empty:s}=e.selection,o=t?ywe(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:s})}));const l=i-r,c=a.filter((e=>!o||o.name===e.node.type.name)).filter((e=>Swe(e.node.attrs,n,{strict:!1})));if(s)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}var exe=(e,t={})=>({state:n,dispatch:r})=>!!Qwe(n,ywe(e,n.schema),t)&&L5(n,r),txe=()=>({state:e,dispatch:t})=>V5(e,t),nxe=e=>({state:t,dispatch:n})=>r3(ywe(e,t.schema))(t,n),rxe=()=>({state:e,dispatch:t})=>F5(e,t);function ixe(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function sxe(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}var oxe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=ixe("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(s=ywe(e,r.schema)),"mark"===a&&(o=Twe(e,r.schema));let l=!1;return n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{s&&s===e.type&&(l=!0,i&&n.setNodeMarkup(r,void 0,sxe(e.attrs,t))),o&&e.marks.length&&e.marks.forEach((s=>{o===s.type&&(l=!0,i&&n.addMark(r,r+e.nodeSize,o.create(sxe(s.attrs,t))))}))}))})),l},axe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),lxe=()=>({tr:e,dispatch:t})=>{if(t){const t=new o5(e.doc);e.setSelection(t)}return!0},cxe=()=>({state:e,dispatch:t})=>T5(e,t),dxe=()=>({state:e,dispatch:t})=>R5(e,t),hxe=()=>({state:e,dispatch:t})=>U5(e,t),uxe=()=>({state:e,dispatch:t})=>q5(e,t),pxe=()=>({state:e,dispatch:t})=>G5(e,t);function fxe(e,t,n={},r={}){return Vwe(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var mxe=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if("full"!==r.preserveWhitespace){const a=fxe(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function gxe(e,t){const n=Twe(t,e.schema),{from:r,to:i,empty:s}=e.selection,o=[];s?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{o.push(...e.marks)}));const a=o.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function yxe(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function vxe(e,t,n){if(void 0===e.config[t]&&e.parent)return vxe(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?vxe(e.parent,t,n):null})}return e.config[t]}function bxe(e){return e.map((e=>{const t=vxe(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...bxe(t())]:e})).flat(10)}function wxe(e,t){const n=t2.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function xxe(e){return"function"==typeof e}function Exe(e,t=void 0,...n){return xxe(e)?t?e.bind(t)(...n):e(...n):e}function Cxe(e){const t=e.filter((e=>"extension"===e.type)),n=e.filter((e=>"node"===e.type)),r=e.filter((e=>"mark"===e.type));return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function Sxe(e){const t=[],{nodeExtensions:n,markExtensions:r}=Cxe(e),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=vxe(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:i});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...s,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=vxe(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...s,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&void 0===(null==i?void 0:i.default)&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function _xe(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)=>function(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],s=r.filter((e=>!i.includes(e)));n[e]=[...i,...s].join(" ")}else if("style"===e){const r=t?t.split(";").map((e=>e.trim())).filter(Boolean):[],i=n[e]?n[e].split(";").map((e=>e.trim())).filter(Boolean):[],s=new Map;i.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),r.forEach((e=>{const[t,n]=e.split(":").map((e=>e.trim()));s.set(t,n)})),n[e]=Array.from(s.entries()).map((([e,t])=>`${e}: ${t}`)).join("; ")}else n[e]=t;else n[e]=t})),n}),{})}(e,t)),{})}function kxe(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function Oxe(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function Txe(e){var t,n;const r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),void 0!==(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)&&(r.validate=e.attribute.validate),[e.name,r]}function Pxe(e,t){var n;const r=Sxe(e),{nodeExtensions:i,markExtensions:s}=Cxe(e),o=null==(n=i.find((e=>vxe(e,"topNode"))))?void 0:n.name,a=Object.fromEntries(i.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=vxe(t,"extendNodeSchema",s);return{...e,...r?r(n):{}}}),{}),a=Oxe({...o,content:Exe(vxe(n,"content",s)),marks:Exe(vxe(n,"marks",s)),group:Exe(vxe(n,"group",s)),inline:Exe(vxe(n,"inline",s)),atom:Exe(vxe(n,"atom",s)),selectable:Exe(vxe(n,"selectable",s)),draggable:Exe(vxe(n,"draggable",s)),code:Exe(vxe(n,"code",s)),whitespace:Exe(vxe(n,"whitespace",s)),linebreakReplacement:Exe(vxe(n,"linebreakReplacement",s)),defining:Exe(vxe(n,"defining",s)),isolating:Exe(vxe(n,"isolating",s)),attrs:Object.fromEntries(i.map(Txe))}),l=Exe(vxe(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>kxe(e,i))));const c=vxe(n,"renderHTML",s);c&&(a.toDOM=e=>c({node:e,HTMLAttributes:_xe(e,i)}));const d=vxe(n,"renderText",s);return d&&(a.toText=d),[n.name,a]}))),l=Object.fromEntries(s.map((n=>{const i=r.filter((e=>e.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:t},o=e.reduce(((e,t)=>{const r=vxe(t,"extendMarkSchema",s);return{...e,...r?r(n):{}}}),{}),a=Oxe({...o,inclusive:Exe(vxe(n,"inclusive",s)),excludes:Exe(vxe(n,"excludes",s)),group:Exe(vxe(n,"group",s)),spanning:Exe(vxe(n,"spanning",s)),code:Exe(vxe(n,"code",s)),attrs:Object.fromEntries(i.map(Txe))}),l=Exe(vxe(n,"parseHTML",s));l&&(a.parseDOM=l.map((e=>kxe(e,i))));const c=vxe(n,"renderHTML",s);return c&&(a.toDOM=e=>c({mark:e,HTMLAttributes:_xe(e,i)})),[n.name,a]})));return new H1({topNode:o,nodes:a,marks:l})}function Ixe(e){return e.sort(((e,t)=>{const n=vxe(e,"priority")||100,r=vxe(t,"priority")||100;return n>r?-1:n<r?1:0}))}function Mxe(e){const t=Ixe(bxe(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return Array.from(new Set(t))}(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 Rxe(e,t,n){const{from:r,to:i}=t,{blockSeparator:s="\n\n",textSerializers:o={}}=n||{};let a="";return e.nodesBetween(r,i,((e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=s);const h=null==o?void 0:o[e.type.name];if(h)return l&&(a+=h({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,i-n))})),a}function Axe(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}function Nxe(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.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 Dxe(e,t){return t.nodes[e]||t.marks[e]||null}function Lxe(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}var Fxe=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,i,s)=>{var o,a;const l=(null==(a=(o=e.type.spec).toText)?void 0:a.call(o,{node:e,pos:t,parent:i,index:s}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))})),n};function jxe(e,t,n={}){const{empty:r,ranges:i}=e.selection,s=t?Twe(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!s||s.name===e.type.name)).find((e=>Swe(e.attrs,n,{strict:!1})));let o=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),s=Math.min(i,t+e.nodeSize);o+=s-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:s}))))}))})),0===o)return!1;const l=a.filter((e=>!s||s.name===e.mark.type.name)).filter((e=>Swe(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!s||e.mark.type!==s&&e.mark.type.excludes(s))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=o}function $xe(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Bxe(e,t){const{nodeExtensions:n}=Cxe(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=Exe(vxe(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function Vxe(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach((e=>{!1!==r&&(Vxe(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))})),r}return!1}var zxe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=Twe(e,r.schema);if(i)if(o){const e=gxe(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,s=e.$to.pos;r.doc.nodesBetween(i,s,((e,r)=>{const o=Math.max(r,i),a=Math.min(r+e.nodeSize,s),c=e.marks.find((e=>e.type===l));c?e.marks.forEach((e=>{l===e.type&&n.addMark(o,a,l.create({...e.attrs,...t}))})):n.addMark(o,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:i}=t;let s=null;if(Mwe(i)&&(s=i.$cursor),s){const t=null!=(r=e.storedMarks)?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some((e=>e.type.excludes(n))))}const{ranges:o}=i;return o.some((({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(i)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),s=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));i=t&&s}return!i})),i}))}(r,n,l)},Hxe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Uxe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const s=ywe(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command((({commands:e})=>!!Y5(s,{...o,...t})(n)||e.clearNodes())).command((({state:e})=>Y5(s,{...o,...t})(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Kxe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=Rwe(e,0,n.content.size),i=i5.create(n,r);t.setSelection(i)}return!0},Wxe=(e,t)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let o,a;return"number"==typeof t?(o=t,a=t):t&&"from"in t&&"to"in t?(o=t.from,a=t.to):(o=s.from,a=s.to),i&&n.doc.nodesBetween(o,a,((t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})})),!0},Gxe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,s=n5.atStart(n).from,o=n5.atEnd(n).to,a=Rwe(r,s,o),l=Rwe(i,s,o),c=n5.create(n,a,l);t.setSelection(c)}return!0},qxe=e=>({state:t,dispatch:n})=>i3(ywe(e,t.schema))(t,n);function Xxe(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}var Yxe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=t,{$from:a,$to:l}=s,c=Lxe(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(s instanceof i5&&s.node.isBlock)return!(!a.parentOffset||!M2(o,a.pos))&&(r&&(e&&Xxe(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=d&&h?[{type:h,attrs:c}]:void 0,p=M2(t.doc,t.mapping.map(a.pos),1,u);if(u||p||!M2(t.doc,t.mapping.map(a.pos),1,h?[{type:h}]:void 0)||(p=!0,u=h?[{type:h,attrs:c}]:void 0),r){if(p&&(s instanceof n5&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,u),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(a.before()),h)}e&&Xxe(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},Zxe=(e,t={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=ywe(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const h=l.node(-1);if(h.type!==a)return!1;const u=s.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let e=e1.empty;const r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=e1.from(l.node(t).copy(e));const i=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,s={...Lxe(u,l.node().type.name,l.node().attrs),...t},c=(null==(o=a.contentMatch.defaultType)?void 0:o.createAndFill(s))||void 0;e=e.append(e1.from(a.createAndFill(null,c)||void 0));const d=l.before(l.depth-(r-1));n.replace(d,l.after(-i),new o1(e,4-r,0));let h=-1;n.doc.nodesBetween(d,n.doc.content.size,((e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)})),h>-1&&n.setSelection(n5.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...Lxe(u,h.type.name,h.attrs),...t},m={...Lxe(u,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!M2(n.doc,l.pos,2))return!1;if(i){const{selection:e,storedMarks:t}=r,{splittableMarks:o}=s.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!i)return!0;const c=a.filter((e=>o.includes(e.type.name)));n.ensureMarks(c)}return!0},Jxe=(e,t)=>{const n=yxe((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,n.pos)||(e.join(n.pos),!0)},Qxe=(e,t)=>{const n=yxe((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!R2(e.doc,r)||(e.join(r),!0)},eEe=(e,t,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:h,splittableMarks:u}=i.extensionManager,p=ywe(e,o.schema),f=ywe(t,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:v}=m,b=y.blockRange(v),w=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const x=yxe((e=>Bxe(e.type.name,h)))(m);if(b.depth>=1&&x&&b.depth-x.depth<=1){if(x.node.type===p)return c.liftListItem(f);if(Bxe(x.node.type.name,h)&&p.validContent(x.node.content)&&a)return l().command((()=>(s.setNodeMarkup(x.pos,p),!0))).command((()=>Jxe(s,p))).command((()=>Qxe(s,p))).run()}return n&&w&&a?l().command((()=>{const e=d().wrapInList(p,r),t=w.filter((e=>u.includes(e.type.name)));return s.ensureMarks(t),!!e||c.clearNodes()})).wrapInList(p,r).command((()=>Jxe(s,p))).command((()=>Qxe(s,p))).run():l().command((()=>!!d().wrapInList(p,r)||c.clearNodes())).wrapInList(p,r).command((()=>Jxe(s,p))).command((()=>Qxe(s,p))).run()},tEe=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=Twe(e,r.schema);return jxe(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,t)},nEe=(e,t,n={})=>({state:r,commands:i})=>{const s=ywe(e,r.schema),o=ywe(t,r.schema),a=Qwe(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},rEe=(e,t={})=>({state:n,commands:r})=>{const i=ywe(e,n.schema);return Qwe(n,i,t)?r.lift(i):r.wrapIn(i,t)},iEe=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){const t=e.tr,n=s.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(s.text){const n=t.doc.resolve(s.from).marks();t.replaceWith(s.from,s.to,e.schema.text(s.text,n))}else t.delete(s.from,s.to)}return!0}}return!1},sEe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},oEe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=t,{selection:a}=n,l=Twe(e,r.schema),{$from:c,empty:d,ranges:h}=a;if(!i)return!0;if(d&&o){let{from:e,to:t}=a;const r=null==(s=c.marks().find((e=>e.type===l)))?void 0:s.attrs,i=Owe(c,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else h.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},aEe=e=>({tr:t,state:n,dispatch:r})=>{const{selection:i}=n;let s,o;return"number"==typeof e?(s=e,o=e):e&&"from"in e&&"to"in e?(s=e.from,o=e.to):(s=i.from,o=i.to),r&&t.doc.nodesBetween(s,o,((e,n)=>{if(e.isText)return;const r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)})),!0},lEe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=ixe("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(s=ywe(e,r.schema)),"mark"===a&&(o=Twe(e,r.schema));let l=!1;return n.selection.ranges.forEach((e=>{const a=e.$from.pos,c=e.$to.pos;let d,h,u,p;n.selection.empty?r.doc.nodesBetween(a,c,((e,t)=>{s&&s===e.type&&(l=!0,u=Math.max(t,a),p=Math.min(t+e.nodeSize,c),d=t,h=e)})):r.doc.nodesBetween(a,c,((e,r)=>{r<a&&s&&s===e.type&&(l=!0,u=Math.max(r,a),p=Math.min(r+e.nodeSize,c),d=r,h=e),r>=a&&r<=c&&(s&&s===e.type&&(l=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach((s=>{if(o===s.type&&(l=!0,i)){const i=Math.max(r,a),l=Math.min(r+e.nodeSize,c);n.addMark(i,l,o.create({...s.attrs,...t}))}})))})),h&&(void 0!==d&&i&&n.setNodeMarkup(d,void 0,{...h.attrs,...t}),o&&h.marks.length&&h.marks.forEach((e=>{o===e.type&&i&&n.addMark(u,p,o.create({...e.attrs,...t}))})))})),l},cEe=(e,t={})=>({state:n,dispatch:r})=>X5(ywe(e,n.schema),t)(n,r),dEe=(e,t={})=>({state:n,dispatch:r})=>n3(ywe(e,n.schema),t)(n,r),hEe=(e,t)=>{if(Cwe(t))return t.exec(e);const n=t(e);if(!n)return null;const 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 uEe(e){var t;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let d=!1;const h=Fxe(c)+s;return o.forEach((e=>{if(d)return;const t=hEe(h,e.find);if(!t)return;const o=l.state.tr,c=awe({state:l.state,transaction:o}),u={from:r-(t[0].length-s.length),to:i},{commands:p,chain:f,can:m}=new lwe({editor:n,state:c});null!==e.handler({state:c,range:u,match:t,commands:p,chain:f,can:m})&&o.steps.length&&(e.undoable&&o.setMeta(a,{transform:o,from:r,to:i,text:s}),l.dispatch(o),d=!0)})),d}function pEe(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function fEe(e,t){const n={...e};return pEe(e)&&pEe(t)&&Object.keys(t).forEach((r=>{pEe(t[r])&&pEe(e[r])?n[r]=fEe(e[r],t[r]):n[r]=t[r]})),n}var mEe=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{...Exe(vxe(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Exe(vxe(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>fEe(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const 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}},gEe=class e extends mEe{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const i=r.marks();if(!!!i.find((e=>(null==e?void 0:e.type.name)===t.name)))return!1;const s=i.find((e=>(null==e?void 0:e.type.name)===t.name));return s&&n.removeStoredMark(s),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};var yEe=(e,t,n)=>{if(Cwe(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map((t=>{const 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})):[]};var vEe=null;function bEe(e){const{editor:t,rules:n}=e;let r,i=null,s=!1,o=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:e,from:n,to:i,rule:s,pasteEvt:o})=>{const l=e.tr,c=awe({state:e,transaction:l}),d=function(e){const{editor:t,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=e,{commands:l,chain:c,can:d}=new lwe({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,((e,t)=>{var u,p,f,m,g;if((null==(p=null==(u=e.type)?void 0:u.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;const y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,v=Math.max(r,t),b=Math.min(i,t+y);if(v>=b)return;const w=e.isText?e.text||"":e.textBetween(v-t,b-t,void 0,"");yEe(w,s.find,o).forEach((e=>{if(void 0===e.index)return;const t=v+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},u=s.handler({state:n,range:i,match:e,commands:l,chain:c,can:d,pasteEvent:o,dropEvent:a});h.push(u)}))})),h.every((e=>null!==e))}({editor:t,state:c,from:Math.max(n-1,0),to:i.b-1,rule:s,pasteEvent:o,dropEvent:r});if(d&&l.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}},c=n.map((e=>new y5({view(e){const n=n=>{var r;i=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,i&&(vEe=t)},r=()=>{vEe&&(vEe=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(o=i===e.dom.parentElement,r=t,!o){const e=vEe;(null==e?void 0:e.isEditable)&&setTimeout((()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})}),10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,s=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const i=t[0],c="paste"===i.getMeta("uiEvent")&&!s,d="drop"===i.getMeta("uiEvent")&&!o,h=i.getMeta("applyPasteRules"),u=!!h;if(!c&&!d&&!u)return;if(u){let{text:t}=h;"string"==typeof t||(t=wxe(e1.from(t),r.schema));const{from:n}=h,i=n+t.length,s=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return l({rule:e,state:r,from:n,to:{b:i},pasteEvt:s})}const p=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof p&&f&&p!==f.b?l({rule:e,state:r,from:p,to:f,pasteEvt:a}):void 0}})));return c}var wEe=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Mxe(e),this.schema=Pxe(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce(((e,t)=>{const n=vxe(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Dxe(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=Ixe([...this.extensions].reverse()).flatMap((t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Dxe(t.name,this.schema)},r=[],i=vxe(t,"addKeyboardShortcuts",n);let s={};if("mark"===t.type&&vxe(t,"exitable",n)&&(s.ArrowRight=()=>gEe.handleExit({editor:e,mark:t})),i){const t=Object.fromEntries(Object.entries(i()).map((([t,n])=>[t,()=>n({editor:e})])));s={...s,...t}}const o=M7(s);r.push(o);const a=vxe(t,"addInputRules",n);if($xe(t,e.options.enableInputRules)&&a){const t=a();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new y5({state:{init:()=>null,apply(e,i,s){const o=e.getMeta(r);if(o)return o;const a=e.getMeta("applyInputRules");return!!a&&setTimeout((()=>{let{text:e}=a;"string"==typeof e||(e=wxe(e1.from(e),s.schema));const{from:i}=a,o=i+e.length;uEe({editor:t,from:i,to:o,text:e,rules:n,plugin:r})})),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,s,o)=>uEe({editor:t,from:i,to:s,text:o,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&uEe({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:s}=e.state.selection;return!!s&&uEe({editor:t,from:s.pos,to:s.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}const l=vxe(t,"addPasteRules",n);if($xe(t,e.options.enablePasteRules)&&l){const t=l();if(t&&t.length){const n=bEe({editor:e,rules:t});r.push(...n)}}const c=vxe(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r}));return t}get attributes(){return Sxe(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Cxe(this.extensions);return Object.fromEntries(t.filter((e=>!!vxe(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:ywe(t.name,this.schema)},i=vxe(t,"addNodeView",r);if(!i)return[];const s=i();if(!s)return[];return[t.name,(r,i,o,a,l)=>{const c=_xe(r,n);return s({node:r,view:i,getPos:o,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:c})}]})))}get markViews(){const{editor:e}=this,{markExtensions:t}=Cxe(this.extensions);return Object.fromEntries(t.filter((e=>!!vxe(e,"addMarkView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Twe(t.name,this.schema)},i=vxe(t,"addMarkView",r);if(!i)return[];return[t.name,(r,s,o)=>{const a=_xe(r,n);return i()({mark:r,view:s,inline:o,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{zEe(r,e,t)}})}]})))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map((e=>[e.name,e.storage]))),e.forEach((e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Dxe(e.name,this.schema)};if("mark"===e.type){(null==(t=Exe(vxe(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name)}const r=vxe(e,"onBeforeCreate",n),i=vxe(e,"onCreate",n),s=vxe(e,"onUpdate",n),o=vxe(e,"onSelectionUpdate",n),a=vxe(e,"onTransaction",n),l=vxe(e,"onFocus",n),c=vxe(e,"onBlur",n),d=vxe(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),s&&this.editor.on("update",s),o&&this.editor.on("selectionUpdate",o),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)}))}};wEe.resolve=Mxe,wEe.sort=Ixe,wEe.flatten=bxe;owe({},{ClipboardTextSerializer:()=>EEe,Commands:()=>CEe,Delete:()=>SEe,Drop:()=>_Ee,Editable:()=>kEe,FocusEvents:()=>TEe,Keymap:()=>PEe,Paste:()=>IEe,Tabindex:()=>MEe,TextDirection:()=>REe,focusEventsPluginKey:()=>OEe});var xEe=class e extends mEe{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},EEe=xEe.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new y5({key:new w5("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:s}=i,o=Math.min(...s.map((e=>e.$from.pos))),a=Math.max(...s.map((e=>e.$to.pos))),l=Axe(n);return Rxe(r,{from:o,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),CEe=xEe.create({name:"commands",addCommands:()=>({...cwe})}),SEe=xEe.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const s=()=>{var n,r,i,s;if(null!=(s=null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?s:e.getMeta("y-sync$"))return;const o=function(e,t){const n=new Y2(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(e.before,[e,...t]),a=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,i)=>{const s=[];if(e.ranges.length)e.forEach(((e,t)=>{s.push({from:e,to:t})}));else{const{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;s.push({from:e,to:t})}s.forEach((({from:e,to:n})=>{const s=t.slice(i).map(e,-1),o=t.slice(i).map(n),a=t.invert().map(s,-1),l=t.invert().map(o);r.push({oldRange:{from:a,to:l},newRange:{from:s,to:o}})}))})),Nxe(r)}(o);a.forEach((t=>{o.mapping.mapResult(t.oldRange.from).deletedAfter&&o.mapping.mapResult(t.oldRange.to).deletedBefore&&o.before.nodesBetween(t.oldRange.from,t.oldRange.to,((n,r)=>{const i=r+n.nodeSize-2,s=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:o.mapping.map(r),newTo:o.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!s,editor:this.editor,transaction:e,combinedTransform:o})}))}));const l=o.mapping;o.steps.forEach(((t,n)=>{var r,i;if(t instanceof v2){const s=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),c=l.invert().map(s,-1),d=l.invert().map(a),h=null==(r=o.doc.nodeAt(s-1))?void 0:r.marks.some((e=>e.eq(t.mark))),u=null==(i=o.doc.nodeAt(a))?void 0:i.marks.some((e=>e.eq(t.mark)));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:s,to:a},partial:Boolean(u||h),editor:this.editor,transaction:e,combinedTransform:o})}}))};null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||i?setTimeout(s,0):s()}}),_Ee=xEe.create({name:"drop",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),kEe=xEe.create({name:"editable",addProseMirrorPlugins(){return[new y5({key:new w5("editable"),props:{editable:()=>this.editor.options.editable}})]}}),OEe=new w5("focusEvents"),TEe=xEe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new y5({key:OEe,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),PEe=xEe.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:s}=n,{pos:o,parent:a}=s,l=s.parent.isTextblock&&o>0?t.doc.resolve(o-1):s,c=l.parent.type.spec.isolating,d=s.pos-s.parentOffset,h=c&&1===l.parent.childCount?d===s.pos:J2.atStart(r).from===o;return!(!i||!a.type.isTextblock||a.textContent.length||!h||h&&"paragraph"===s.parent.type.name)&&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 Dwe()||Zwe()?i:r},addProseMirrorPlugins(){return[new y5({key:new w5("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some((e=>e.getMeta("composition"))))return;const r=e.some((e=>e.docChanged))&&!t.doc.eq(n.doc),i=e.some((e=>e.getMeta("preventClearDocument")));if(!r||i)return;const{empty:s,from:o,to:a}=t.selection,l=J2.atStart(t.doc).from,c=J2.atEnd(t.doc).to;if(s||!(o===l&&a===c))return;if(!Vxe(n.doc))return;const d=n.tr,h=awe({state:n,transaction:d}),{commands:u}=new lwe({editor:this.editor,state:h});return u.clearNodes(),d.steps.length?d:void 0}})]}}),IEe=xEe.create({name:"paste",addProseMirrorPlugins(){return[new y5({key:new w5("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),MEe=xEe.create({name:"tabindex",addProseMirrorPlugins(){return[new y5({key:new w5("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),REe=xEe.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Cxe(this.extensions);return[{types:e.filter((e=>"text"!==e.name)).map((e=>e.name)),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return!t||"ltr"!==t&&"rtl"!==t&&"auto"!==t?this.options.direction:t},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new y5({key:new w5("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}});function AEe(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,(e=>(n.push(e),`__QUOTED_${n.length-1}__`))),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const e=i.map((e=>e.trim().slice(1)));t.class=e.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(t.id=s[1]);Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach((([,e,r])=>{var i;const s=parseInt((null==(i=r.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10),o=n[s];o&&(t[e]=o.slice(1,-1))}));const 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();if(o){o.split(/\s+/).filter(Boolean).forEach((e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}))}return t}function NEe(e){if(!e||0===Object.keys(e).length)return"";const t=[];if(e.class){String(e.class).split(/\s+/).filter(Boolean).forEach((e=>t.push(`.${e}`)))}return e.id&&t.push(`#${e.id}`),Object.entries(e).forEach((([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))})),t.join(" ")}function DEe(e){const{nodeName:t,name:n,parseAttributes:r=AEe,serializeAttributes:i=NEe,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=e,l=n||t;return{parseMarkdown:(e,n)=>{const r={...s,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,i){const s=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(s);if(!a)return;const c=a[1]||"",d=r(c),h=o.find((e=>!(e in d)));return h?void 0:{type:t,raw:a[0],attributes:d}}},renderMarkdown:e=>{const t=(e=>{if(!a)return e;const t={};return a.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),n=i(t);return`:::${l}${n?` {${n}}`:""} :::`}}}function LEe(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=AEe,serializeAttributes:s=NEe,defaultAttributes:o={},content:a="block",allowedAttributes:l}=e,c=n||t;return{parseMarkdown:(e,n)=>{let i;if(r){const t=r(e);i="string"==typeof t?[{type:"text",text:t}]:t}else i="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const s={...o,...e.attributes};return n.createNode(t,s,i)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var s;const o=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(o);if(!l)return;const[d,h=""]=l,u=i(h);let p=1;const f=d.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(y);if(null===n)break;const i=n.index,o=n[1];if(!(null==(s=n[2])?void 0:s.endsWith(":::")))if(o)p+=1;else if(p-=1,0===p){const s=y.slice(0,i);m=s.trim();const o=e.slice(0,f+i+n[0].length);let l=[];if(m)if("block"===a)for(l=r.blockTokens(s),l.forEach((e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))}));l.length>0;){const e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(m);return{type:t,raw:o,attributes:u,content:m,tokens:l}}}}},renderMarkdown:(e,t)=>{const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),r=s(n),i=r?` {${r}}`:"",o=t.renderChildren(e.content||[],"\n\n");return`:::${c}${i}\n\n${o}\n\n:::`}}}function FEe(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,i,s,o]=r;t[i]=s||o,r=n.exec(e)}return t}function jEe(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}="${t}"`)).join(" ")}function $Ee(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=FEe,serializeAttributes:s=jEe,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const i={...o,...e.attributes};if(a)return n.createNode(t,i);const s=r?r(e):e.content||"";return s?n.createNode(t,i,[n.createTextNode(s)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const s=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(s);if(!o)return;let l="",c="";if(a){const[,e]=o;c=e}else{const[,e,t]=o;c=e,l=t||""}const h=i(c.trim());return{type:t,raw:o[0],content:l.trim(),attributes:h}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter((e=>"text"===e.type)).map((e=>e.text)).join(""));const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{const r="string"==typeof n?n:n.name,i="string"==typeof n?void 0:n.skipIfDefault;if(r in e){const n=e[r];if(void 0!==i&&n===i)return;t[r]=n}})),t})(e.attrs||{}),i=s(n),o=i?` ${i}`:"";return a?`[${c}${o}]`:`[${c}${o}]${t}[/${c}]`}}}function BEe(e,t,n){var r,i,s,o;const a=e.split("\n"),l=[];let c="",d=0;const h=t.baseIndentSize||2;for(;d<a.length;){const e=a[d],u=e.match(t.itemPattern);if(!u){if(l.length>0)break;if(""===e.trim()){d+=1,c=`${c}${e}\n`;continue}return}const p=t.extractItemData(u),{indentLevel:f,mainContent:m}=p;c=`${c}${e}\n`;const g=[m];for(d+=1;d<a.length;){const e=a[d];if(""===e.trim()){const t=a.slice(d+1).findIndex((e=>""!==e.trim()));if(-1===t)break;if(((null==(i=null==(r=a[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>f){g.push(e),c=`${c}${e}\n`,d+=1;continue}break}if(!(((null==(o=null==(s=e.match(/^(\s*)/))?void 0:s[1])?void 0:o.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,d+=1}let y;const v=g.slice(1);if(v.length>0){const e=v.map((e=>e.slice(f+h))).join("\n");e.trim()&&(y=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const b=t.createToken(p,y);l.push(b)}if(0!==l.length)return{items:l,raw:c}}function VEe(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i="function"==typeof n?n(r):n,[s,...o]=e.content,a=[`${i}${t.renderChildren([s])}`];return o&&o.length>0&&o.forEach((e=>{const n=t.renderChildren([e]);if(n){const e=n.split("\n").map((e=>e?t.indent(e):"")).join("\n");a.push(e)}})),a.join("\n")}function zEe(e,t,n={}){const{state:r}=t,{doc:i,tr:s}=r,o=e;i.descendants(((t,r)=>{const i=s.mapping.map(r),a=s.mapping.map(r)+t.nodeSize;let l=null;if(t.marks.forEach((e=>{if(e!==o)return!1;l=e})),!l)return;let c=!1;if(Object.keys(n).forEach((e=>{n[e]!==l.attrs[e]&&(c=!0)})),c){const t=e.type.create({...e.attrs,...n});s.removeMark(i,a,e.type),s.addMark(i,a,t)}})),s.docChanged&&t.view.dispatch(s)}owe({},{createAtomBlockMarkdownSpec:()=>DEe,createBlockMarkdownSpec:()=>LEe,createInlineMarkdownSpec:()=>$Ee,parseAttributes:()=>AEe,parseIndentedBlocks:()=>BEe,renderNestedMarkdownContent:()=>VEe,serializeAttributes:()=>NEe});xEe.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter((e=>""!==e)).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){const e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new y5({key:new w5("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const i=this.options.limit;if(null==i||0===i)return void(e=!0);const s=this.storage.characters({node:r.doc});if(s>i){const t=0,n=s-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const o=r.tr.deleteRange(t,n);return e=!0,o}e=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n)return!0;if(r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r)return!1;if(!e.getMeta("paste"))return!1;const s=e.selection.$head.pos,o=s-(i-n),a=s;e.deleteRange(o,a);return!(this.storage.characters({node:e.doc})>n)}})]}});var HEe=xEe.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[moe(this.options)]}}),UEe=(xEe.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new y5({key:new w5("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,s=[];if(!n||!r)return U6.create(e,[]);let o=0;"deepest"===this.options.mode&&e.descendants(((e,t)=>{if(e.isText)return;if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}));let a=0;return e.descendants(((e,t)=>{if(e.isText)return!1;if(!(i>=t&&i<=t+e.nodeSize-1))return!1;a+=1;if("deepest"===this.options.mode&&o-a>0||"shallowest"===this.options.mode&&a>1)return"deepest"===this.options.mode;s.push(V6.node(t,t+e.nodeSize,{class:this.options.className}))})),U6.create(e,s)}}})]}}),xEe.create({name:"gapCursor",addProseMirrorPlugins:()=>[boe()],extendNodeSchema(e){var t;return{allowGapCursor:null!=(t=Exe(vxe(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))?t:null}}}));xEe.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new y5({key:new w5("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const s=this.editor.isEmpty;return e.descendants(((e,t)=>{const n=r>=t&&r<=t+e.nodeSize,o=!e.isLeaf&&Vxe(e);if((n||!this.options.showOnlyCurrent)&&o){const r=[this.options.emptyNodeClass];s&&r.push(this.options.emptyEditorClass);const o=V6.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});i.push(o)}return this.options.includeChildren})),U6.create(e,i)}}})]}}),xEe.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new y5({key:new w5("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||n.selection instanceof i5||e.view.dragging?null:U6.create(n.doc,[V6.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});function KEe({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}var WEe=xEe.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;const t=new w5(this.name),n=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map((([,e])=>e)).filter((e=>(this.options.notAfter||[]).concat(n).includes(e.name)));return[new y5({key:t,appendTransaction:(e,r,i)=>{const{doc:s,tr:o,schema:a}=i,l=t.getState(i),c=s.content.size,d=a.nodes[n];if(l)return o.insert(c,d.create())},state:{init:(e,t)=>!KEe({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>{if(!e.docChanged)return t;if(e.getMeta("__uniqueIDTransaction"))return t;return!KEe({node:e.doc.lastChild,types:r})}}})]}}),GEe=xEe.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Hoe(e,t),redo:()=>({state:e,dispatch:t})=>Uoe(e,t)}),addProseMirrorPlugins(){return[Voe(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()}}}),qEe=kge.create({name:"starterKit",addExtensions(){var e,t,n,r;const i=[];return!1!==this.options.bold&&i.push(oye.configure(this.options.bold)),!1!==this.options.blockquote&&i.push(tye.configure(this.options.blockquote)),!1!==this.options.bulletList&&i.push(Mbe.configure(this.options.bulletList)),!1!==this.options.code&&i.push(cye.configure(this.options.code)),!1!==this.options.codeBlock&&i.push(uye.configure(this.options.codeBlock)),!1!==this.options.document&&i.push(pye.configure(this.options.document)),!1!==this.options.dropcursor&&i.push(HEe.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&i.push(UEe.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&i.push(fye.configure(this.options.hardBreak)),!1!==this.options.heading&&i.push(mye.configure(this.options.heading)),!1!==this.options.undoRedo&&i.push(GEe.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&i.push(gye.configure(this.options.horizontalRule)),!1!==this.options.italic&&i.push(xye.configure(this.options.italic)),!1!==this.options.listItem&&i.push(Rbe.configure(this.options.listItem)),!1!==this.options.listKeymap&&i.push(Hbe.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&i.push(Obe.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&i.push(Xbe.configure(this.options.orderedList)),!1!==this.options.paragraph&&i.push(Qbe.configure(this.options.paragraph)),!1!==this.options.strike&&i.push(nwe.configure(this.options.strike)),!1!==this.options.text&&i.push(rwe.configure(this.options.text)),!1!==this.options.underline&&i.push(iwe.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&i.push(WEe.configure(null==(r=this.options)?void 0:r.trailingNode)),i}}),XEe=qEe,YEe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,ZEe=Eee.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",Q8(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,r,i,s,o;const a=null!=(n=null==(t=e.attrs)?void 0:t.src)?n:"",l=null!=(i=null==(r=e.attrs)?void 0:r.alt)?i:"",c=null!=(o=null==(s=e.attrs)?void 0:s.title)?o:"";return c?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"undefined"==typeof document)return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:s,HTMLAttributes:o,editor:a})=>{const l=document.createElement("img");Object.entries(o).forEach((([e,t])=>{if(null!=t)switch(e){case"width":case"height":break;default:l.setAttribute(e,t)}})),l.src=o.src;const c=new hee({element:l,editor:a,node:i,getPos:s,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{const n=s();void 0!==n&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:!0===r}}),d=c.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",l.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},c}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[(e={find:YEe,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}},new V9({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Y8(e.getAttributes,void 0,r)||{},{tr:s}=t,o=n.from;let a=n.to;const l=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;const t=r[0][r[0].length-1];s.insertText(t,o+r[0].length-1),s.replaceWith(e,a,l)}else if(r[0]){const t=e.type.isInline?o:o-1;s.insert(t,e.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()},undoable:e.undoable}))];var e}});const JEe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.56 2.44a1.5 1.5 0 0 1 0 2.12L7.12 7h7.63C18.84 7 22 10.58 22 14.5S18.84 22 14.75 22H11.5a1.5 1.5 0 0 1 0-3h3.25c2.27 0 4.25-2.07 4.25-4.5S17.02 10 14.75 10H7.12l2.44 2.44a1.5 1.5 0 0 1-2.12 2.12l-5-5a1.5 1.5 0 0 1 0-2.12l5-5a1.5 1.5 0 0 1 2.12 0Z",fill:"currentColor"}))}),"undo");const QEe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.44 2.44a1.5 1.5 0 0 0 0 2.12L16.88 7H9.25C5.16 7 2 10.58 2 14.5S5.16 22 9.25 22h3.25a1.5 1.5 0 0 0 0-3H9.25C6.98 19 5 16.93 5 14.5S6.98 10 9.25 10h7.63l-2.44 2.44a1.5 1.5 0 0 0 2.12 2.12l5-5a1.5 1.5 0 0 0 0-2.12l-5-5a1.5 1.5 0 0 0-2.12 0Z",fill:"currentColor"}))}),"redo");const eCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 2.5C4.33 2.5 5 3.17 5 4v6.5h6V4a1.5 1.5 0 0 1 3 0v16a1.5 1.5 0 0 1-3 0v-6.5H5V20a1.5 1.5 0 0 1-3 0V4c0-.83.67-1.5 1.5-1.5Z",fill:"currentColor"}),d.createElement("path",{d:"M19.43 19.59c0 .97.51 1.51 1.43 1.51.91 0 1.42-.54 1.42-1.52v-6.27c0-1.04-.66-1.7-1.67-1.7-.57 0-1.2.18-1.79.54l-.96.58c-.48.29-.73.65-.73 1.06 0 .57.4.96.96.96.28 0 .5-.08.95-.35l.38-.22h.01v5.4Z",fill:"currentColor"}))}),"h1");const tCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 2.5C4.33 2.5 5 3.17 5 4v6.5h6V4a1.5 1.5 0 0 1 3 0v16a1.5 1.5 0 0 1-3 0v-6.5H5V20a1.5 1.5 0 0 1-3 0V4c0-.83.67-1.5 1.5-1.5Z",fill:"currentColor"}),d.createElement("path",{d:"M15.47 19.87c0 .67.5 1.13 1.26 1.13h4.77c.8 0 1.28-.41 1.28-1.1 0-.7-.5-1.11-1.28-1.11h-2.3v-.11l1.62-1.44c1.09-.96 1.62-1.92 1.62-2.93 0-1.6-1.48-2.8-3.47-2.8-1.91 0-3.52 1.18-3.52 2.51 0 .6.47 1.05 1.12 1.05.46 0 .76-.18 1.18-.7.36-.45.66-.62 1.07-.62.53 0 .9.35.9.85 0 .45-.32.89-1.03 1.56l-2.09 1.97c-.84.79-1.13 1.24-1.13 1.74Z",fill:"currentColor"}))}),"h2");const nCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 2.5C4.33 2.5 5 3.17 5 4v6.5h6V4a1.5 1.5 0 0 1 3 0v16a1.5 1.5 0 0 1-3 0v-6.5H5V20a1.5 1.5 0 0 1-3 0V4c0-.83.67-1.5 1.5-1.5Z",fill:"currentColor"}),d.createElement("path",{d:"M15.21 18.96c0 1.24 1.6 2.25 3.59 2.25 2.3 0 3.93-1.2 3.93-2.87 0-1.2-.81-2.11-1.92-2.17v-.2a1.91 1.91 0 0 0 1.68-1.92c0-1.5-1.5-2.54-3.67-2.54-1.94 0-3.57.98-3.57 2.14 0 .6.48 1.03 1.13 1.03.4 0 .75-.14 1.06-.43.5-.47.88-.65 1.34-.65.6 0 1.03.33 1.03.8 0 .46-.43.8-1.03.8h-.37c-.57 0-.97.46-.97 1.04 0 .62.4 1.05.97 1.05h.37c.73 0 1.2.37 1.2.92s-.47.91-1.2.91c-.5 0-.95-.21-1.4-.68-.38-.4-.72-.58-1.1-.58-.62 0-1.07.46-1.07 1.1Z",fill:"currentColor"}))}),"h3");const rCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 2.5C4.33 2.5 5 3.17 5 4v6.5h6V4a1.5 1.5 0 0 1 3 0v16a1.5 1.5 0 0 1-3 0v-6.5H5V20a1.5 1.5 0 0 1-3 0V4c0-.83.67-1.5 1.5-1.5Z",fill:"currentColor"}),d.createElement("path",{d:"M19.08 19.68c0 .87.52 1.42 1.32 1.42.82 0 1.34-.56 1.34-1.42v-.08h.06c.67 0 1.1-.42 1.1-1.08 0-.67-.44-1.14-1.1-1.14h-.06v-4.07c0-1.1-.89-1.8-2.27-1.8-1.07 0-1.72.41-2.56 1.62-.68.98-1.6 2.62-2.07 3.7-.28.64-.36.94-.36 1.33 0 .93.54 1.44 1.5 1.44h3.1v.08Zm-2.07-2.3v-.02c.15-.35 1.64-3.1 1.94-3.6h.13v3.62h-2.07Z",fill:"currentColor"}))}),"h4");const iCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 2.5C4.33 2.5 5 3.17 5 4v6.5h6V4a1.5 1.5 0 0 1 3 0v16a1.5 1.5 0 0 1-3 0v-6.5H5V20a1.5 1.5 0 0 1-3 0V4c0-.83.67-1.5 1.5-1.5Z",fill:"currentColor"}),d.createElement("path",{d:"M15.16 19.06c0 1.18 1.6 2.15 3.52 2.15 2.45 0 3.98-1.34 3.98-3.48 0-1.86-1.21-3.07-3.06-3.07-.81 0-1.52.25-1.86.66h-.15l.1-1.44h3.29c.8 0 1.24-.39 1.24-1.09 0-.71-.44-1.12-1.24-1.12h-3.92c-1 0-1.55.44-1.6 1.3L15.28 16c-.05.78.61 1.35 1.45 1.35.3 0 .6-.08.85-.23.42-.26.86-.41 1.22-.41.67 0 1.16.43 1.16 1.1 0 .69-.51 1.15-1.22 1.15-.5 0-.92-.22-1.45-.7-.3-.3-.61-.41-1-.41-.7 0-1.13.56-1.13 1.2Z",fill:"currentColor"}))}),"h5");const sCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 2.5C4.33 2.5 5 3.17 5 4v6.5h6V4a1.5 1.5 0 0 1 3 0v16a1.5 1.5 0 0 1-3 0v-6.5H5V20a1.5 1.5 0 0 1-3 0V4c0-.83.67-1.5 1.5-1.5Z",fill:"currentColor"}),d.createElement("path",{d:"M14.95 16.3c0 1.49.37 2.76 1.07 3.6.7.86 1.72 1.3 2.96 1.3 2.2 0 3.7-1.35 3.7-3.4 0-1.77-1.18-3-2.87-3-.97 0-1.81.5-2.15 1.3h-.06c0-1.57.53-2.45 1.57-2.45.38 0 .68.1 1.1.37.45.28.72.38 1.07.38.62 0 1.04-.39 1.04-.96 0-.46-.31-.94-.84-1.3a4.35 4.35 0 0 0-2.4-.63c-2.67 0-4.19 1.74-4.19 4.79Zm2.94 1.6c0-.66.46-1.15 1.07-1.15.6 0 1.04.48 1.04 1.15 0 .7-.44 1.18-1.04 1.18-.6 0-1.07-.49-1.07-1.18Z",fill:"currentColor"}))}),"h6");const oCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 2.5C4.33 2.5 5 3.17 5 4v6.5h6V4a1.5 1.5 0 0 1 3 0v16a1.5 1.5 0 0 1-3 0v-6.5H5V20a1.5 1.5 0 0 1-3 0V4c0-.83.67-1.5 1.5-1.5Z",fill:"currentColor"}),d.createElement("path",{d:"M22.38 19.56v-3.33c0-1.73-.86-2.7-2.4-2.7-1 0-1.87.55-2.12 1.34h-.14c-.05-.85-.52-1.3-1.33-1.3-.83 0-1.35.55-1.35 1.46v4.52c0 .99.5 1.52 1.4 1.52.9 0 1.38-.53 1.38-1.52v-2.6c0-.71.36-1.16.9-1.16.55 0 .88.45.88 1.14v2.62c0 .99.49 1.52 1.39 1.52.9 0 1.39-.52 1.39-1.5Z",fill:"currentColor"}))}),"hn");const aCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 4.5C3 3.67 3.67 3 4.5 3h15c.83 0 1.5.67 1.5 1.5v3a1.5 1.5 0 0 1-3 0V6h-4.5v13h2a1.5 1.5 0 0 1 0 3h-7a1.5 1.5 0 0 1 0-3h2V6H6v1.5a1.5 1.5 0 1 1-3 0v-3Z",fill:"currentColor"}))}),"text");const lCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("g",{opacity:.99},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-2-7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-2 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"})))}),"list");const cCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("g",{opacity:.99},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.28 7.6c-.59 0-.91-.34-.91-.97V3.54h-.01l-.25.15c-.29.17-.78.35-.95.35-.26 0-.66-.52-.66-.88 0-.27.16-.5.47-.69l1-.62c.38-.23.79-.35 1.15-.35.65 0 1.07.43 1.07 1.1v4.03c0 .63-.32.98-.9.98ZM9.5 3a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM8 11.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 11.5Zm0 7c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 8 18.5Zm-5.84-4.63c0 .44.33.73.81.73h3.06c.52 0 .83-.26.83-.7 0-.45-.32-.72-.83-.72H4.56v-.07l1.04-.93c.7-.62 1.04-1.23 1.04-1.88 0-1.03-.95-1.8-2.23-1.8-1.23 0-2.26.76-2.26 1.61 0 .4.3.68.72.68.3 0 .49-.12.75-.45.24-.3.43-.4.7-.4.33 0 .57.22.57.55 0 .29-.2.57-.66 1L2.9 12.75c-.54.5-.73.8-.73 1.12Zm2.14 7.86c-1.28 0-2.3-.64-2.3-1.44 0-.41.28-.7.68-.7.24 0 .46.1.7.36.3.3.58.44.9.44.47 0 .78-.23.78-.58s-.3-.6-.77-.6h-.24c-.37 0-.63-.27-.63-.67 0-.37.26-.67.63-.67h.24c.38 0 .66-.22.66-.52 0-.3-.27-.51-.66-.51-.3 0-.55.12-.87.42a.96.96 0 0 1-.68.28c-.42 0-.72-.28-.72-.66 0-.75 1.05-1.38 2.3-1.38 1.39 0 2.35.67 2.35 1.63 0 .64-.47 1.18-1.08 1.24v.12c.72.04 1.23.63 1.23 1.4 0 1.08-1.05 1.84-2.52 1.84Z",fill:"currentColor"})))}),"ordered_list");const dCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.93 4.93c.25.8-.2 1.63-.99 1.88a7.02 7.02 0 0 0-4.08 3.32A5.02 5.02 0 0 1 11 15a5 5 0 0 1-10 0v-1.5a10 10 0 0 1 7.06-9.56c.8-.24 1.63.2 1.87 1Zm12 0c.25.8-.2 1.63-.99 1.88a7.02 7.02 0 0 0-4.08 3.32A5.02 5.02 0 0 1 23 15a5 5 0 0 1-10 0v-1.5a10 10 0 0 1 7.06-9.56c.8-.24 1.63.2 1.87 1Z",fill:"currentColor"}))}),"quote");const hCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 3a1.5 1.5 0 1 0 0 3h17a1.5 1.5 0 0 0 0-3h-17Zm0 5a1.5 1.5 0 1 0 0 3h10a1.5 1.5 0 0 0 0-3h-10ZM2 14.5c0-.83.67-1.5 1.5-1.5h17a1.5 1.5 0 0 1 0 3h-17A1.5 1.5 0 0 1 2 14.5ZM3.5 18a1.5 1.5 0 0 0 0 3h10a1.5 1.5 0 0 0 0-3h-10Z",fill:"currentColor"}))}),"align_left");const uCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 3a1.5 1.5 0 1 0 0 3h17a1.5 1.5 0 0 0 0-3h-17Zm3 5a1.5 1.5 0 1 0 0 3h11a1.5 1.5 0 0 0 0-3h-11ZM2 14.5c0-.83.67-1.5 1.5-1.5h17a1.5 1.5 0 0 1 0 3h-17A1.5 1.5 0 0 1 2 14.5ZM6.5 18a1.5 1.5 0 0 0 0 3h11a1.5 1.5 0 0 0 0-3h-11Z",fill:"currentColor"}))}),"align_center");const pCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 3a1.5 1.5 0 1 0 0 3h17a1.5 1.5 0 0 0 0-3h-17Zm7 5a1.5 1.5 0 1 0 0 3h10a1.5 1.5 0 0 0 0-3h-10ZM2 14.5c0-.83.67-1.5 1.5-1.5h17a1.5 1.5 0 0 1 0 3h-17A1.5 1.5 0 0 1 2 14.5Zm8.5 3.5a1.5 1.5 0 0 0 0 3h10a1.5 1.5 0 0 0 0-3h-10Z",fill:"currentColor"}))}),"align_right");const fCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.36 3C2.61 3 2 3.67 2 4.5S2.61 6 3.36 6h17.28C21.39 6 22 5.33 22 4.5S21.39 3 20.64 3H3.36Zm0 5C2.61 8 2 8.67 2 9.5S2.61 11 3.36 11h17.28c.75 0 1.36-.67 1.36-1.5S21.39 8 20.64 8H3.36ZM2 14.5c0-.83.61-1.5 1.36-1.5h17.28c.75 0 1.36.67 1.36 1.5s-.61 1.5-1.36 1.5H3.36C2.61 16 2 15.33 2 14.5ZM3.36 18C2.61 18 2 18.67 2 19.5S2.61 21 3.36 21h17.28c.75 0 1.36-.67 1.36-1.5s-.61-1.5-1.36-1.5H3.36Z",fill:"currentColor"}))}),"align_justify");const mCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 3a1 1 0 0 1 1-1h5.5c3.23 0 6 2.5 6 5.75 0 1.49-.58 2.82-1.51 3.82a5.64 5.64 0 0 1 2.51 4.68c0 3.26-2.77 5.75-6 5.75H7a1 1 0 0 1-1-1V3Zm7 16c1.74 0 3-1.31 3-2.75s-1.26-2.75-3-2.75H9V19h4Zm-1-8.5c1.74 0 3-1.31 3-2.75S13.74 5 12 5H9v5.5h3Z",fill:"currentColor"}))}),"bold");const gCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3.5c0-.83.67-1.5 1.5-1.5h7a1.5 1.5 0 0 1 0 3h-2L12 19h1.5a1.5 1.5 0 0 1 0 3h-7a1.5 1.5 0 0 1 0-3h2L12 5h-1.5A1.5 1.5 0 0 1 9 3.5Z",fill:"currentColor"}))}),"italic");const yCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5 4.5c-1.79 0-3 1.44-3 2.5 0 1.07.76 2.6 3.72 3.5H6.75A5.54 5.54 0 0 1 5.5 7c0-2.94 2.79-5.5 6-5.5a8.62 8.62 0 0 1 7.2 3.6 1.5 1.5 0 0 1-2.4 1.8 5.63 5.63 0 0 0-4.8-2.4Z",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.72 15.5h3.52c.17.47.26.97.26 1.5 0 1.87-1.03 3.3-2.45 4.2A9.51 9.51 0 0 1 12 22.5c-3.92 0-6.77-2.4-7.46-5.14a1.5 1.5 0 0 1 1.43-1.86h.06a1.5 1.5 0 0 1 1.43 1.14C7.77 17.89 9.3 19.5 12 19.5c1.45 0 2.66-.33 3.44-.83.75-.48 1.06-1.04 1.06-1.67 0-.43-.2-.94-.78-1.5Z",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 10.5h19a1.5 1.5 0 0 1 0 3h-19a1.5 1.5 0 0 1 0-3Z",fill:"currentColor"}))}),"strike_through");const vCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm9-11a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-4.23-2.36a1 1 0 1 0-1.54-1.28l-4.3 5.16-2.22-2.23a1 1 0 0 0-1.42 1.42l3 3a1 1 0 0 0 1.48-.07l5-6Z",fill:"currentColor"}))}),"check_circle_stroked");const bCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.94 2.94a5.74 5.74 0 1 1 8.12 8.12l-2.67 2.67a7.05 7.05 0 0 0-.4-3.85l.95-.94a2.74 2.74 0 1 0-3.88-3.88l-4 4a2.74 2.74 0 0 0 .9 4.48l-2.2 2.2a5.77 5.77 0 0 1-.82-8.8l4-4Zm-10 10 2.67-2.67a7.04 7.04 0 0 0 .4 3.85l-.95.94a2.74 2.74 0 1 0 3.88 3.88l4-4a2.74 2.74 0 0 0-.57-4.31l2.16-2.16a5.74 5.74 0 0 1 .53 8.6l-4 4a5.74 5.74 0 0 1-8.12-8.13Z",fill:"currentColor"}))}),"link");const wCe=nn((function(e){return d.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5Zm5 5.5a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Zm6.7 4.2a1 1 0 0 0-1.4 0L11 16l-1.3-1.3a1 1 0 0 0-1.4 0L5 18v1h14v-5l-2.3-2.3Z",fill:"currentColor"}))}),"image");var xCe=J9.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const 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)),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))}},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")}}}),ECe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const CCe=e=>{const[t,n]=(0,d.useState)(),r=e.extension.options,{onChange:i,onSuccess:s,getUploadImageSrc:o,className:a}=r,l=ECe(r,["onChange","onSuccess","getUploadImageSrc","className"]),c=e=>{const t=e.fileList[0];t&&n(t.status),null==i||i(e)},u=(t,n,r)=>{null==s||s(t,n,r);let i=r[0].src;o?i=o(i):"string"==typeof t?i=t:z()(t)&&t.src&&(i=t.src);const{name:a}=n,l={type:e.extension.options.type,attrs:{src:i,alt:a,title:a}},c=e.getPos();e.editor.chain().focus().deleteRange({from:c,to:c+e.node.nodeSize}).insertContentAt(c,l).run()},p=(e,t)=>"validateFail"===e?t.validateFailInfo:"uploadFail"===e?t.uploadFailInfo:t.uploadImgInfo;return h().createElement(Hee,{className:"tiptap-image-slot",tabIndex:0},h().createElement(Jt,{componentName:"Sidebar"},(e=>h().createElement(MI,Object.assign({},l,{draggable:!0,className:t,dragMainText:p(t,e),onChange:c,onSuccess:u})))))},SCe=Eee.create({name:"imageUpload",group:"block",draggable:!0,selectable:!0,atom:!0,addOptions:()=>({type:"image",accept:"image/*",limit:1,action:void 0,HTMLAttributes:{}}),addAttributes(){return{accept:{default:this.options.accept},limit:{default:this.options.limit},maxSize:{default:this.options.maxSize},action:{default:this.options.action},minSize:{default:this.options.minSize}}},parseHTML:()=>[{tag:'div[data-type="image-upload"]'}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",Q8({"data-type":"image-upload"},t)]},addNodeView:()=>qee(CCe)});var _Ce=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const kCe=Que.COLLAPSE,OCe=Que.FILE,TCe=G9.create({name:"selectionMark",inclusive:!1,parseHTML:()=>[{tag:"span.select"}],renderHTML:()=>["span",{class:"select"},0]}),PCe=h().memo((e=>{const{active:t,className:n}=e,r=_Ce(e,["active","className"]);return h().createElement(vs,Object.assign({},r,{theme:"borderless",type:"tertiary",className:w()(`${OCe}-menu-bar-btn`,{[`${OCe}-menu-bar-btn-active`]:t,[n]:n})}))})),ICe=h().memo((e=>{const{active:t,children:n}=e,r=_Ce(e,["active","children"]);return h().createElement(Ww.Item,Object.assign({className:w()(`${OCe}-menu-bar-dropdown-item`,{[`${OCe}-menu-bar-dropdown-item-active`]:t})},r),n)}));function MCe(e){let{editor:t,className:n}=e;const[r,i]=(0,d.useState)(!1),[s,o]=(0,d.useState)(""),[a,l]=(0,d.useState)(null),c=Nee({editor:t,selector:e=>{var t,n,r,i,s,o,a,l,c,d,h,u,p,f,m,g,y,v,b,w,x,E,C,S,_,k,O,T,P;const{from:I,to:M}=e.editor.state.selection,R=I!==M,A=I===M&&e.editor.isFocused;return{isBold:null!==(t=e.editor.isActive("bold"))&&void 0!==t&&t,canBold:null!==(n=e.editor.can().chain().toggleBold().run())&&void 0!==n&&n,isItalic:null!==(r=e.editor.isActive("italic"))&&void 0!==r&&r,canItalic:null!==(i=e.editor.can().chain().toggleItalic().run())&&void 0!==i&&i,isStrike:null!==(s=e.editor.isActive("strike"))&&void 0!==s&&s,canStrike:null!==(o=e.editor.can().chain().toggleStrike().run())&&void 0!==o&&o,isCode:null!==(a=e.editor.isActive("code"))&&void 0!==a&&a,canCode:null!==(l=e.editor.can().chain().toggleCode().run())&&void 0!==l&&l,canClearMarks:null!==(c=e.editor.can().chain().unsetAllMarks().run())&&void 0!==c&&c,isParagraph:null!==(d=e.editor.isActive("paragraph"))&&void 0!==d&&d,isHeading:null!==(h=e.editor.isActive("heading"))&&void 0!==h&&h,isHeading1:null!==(u=e.editor.isActive("heading",{level:1}))&&void 0!==u&&u,isHeading2:null!==(p=e.editor.isActive("heading",{level:2}))&&void 0!==p&&p,isHeading3:null!==(f=e.editor.isActive("heading",{level:3}))&&void 0!==f&&f,isHeading4:null!==(m=e.editor.isActive("heading",{level:4}))&&void 0!==m&&m,isHeading5:null!==(g=e.editor.isActive("heading",{level:5}))&&void 0!==g&&g,isHeading6:null!==(y=e.editor.isActive("heading",{level:6}))&&void 0!==y&&y,isBulletList:null!==(v=e.editor.isActive("bulletList"))&&void 0!==v&&v,isOrderedList:null!==(b=e.editor.isActive("orderedList"))&&void 0!==b&&b,isCodeBlock:null!==(w=e.editor.isActive("codeBlock"))&&void 0!==w&&w,isBlockquote:null!==(x=e.editor.isActive("blockquote"))&&void 0!==x&&x,isLink:null!==(E=e.editor.isActive("link"))&&void 0!==E&&E,canLink:R||A,canUndo:null!==(C=e.editor.can().chain().undo().run())&&void 0!==C&&C,canRedo:null!==(S=e.editor.can().chain().redo().run())&&void 0!==S&&S,isAlignLeft:null!==(_=e.editor.isActive({textAlign:"left"}))&&void 0!==_&&_,isAlignCenter:null!==(k=e.editor.isActive({textAlign:"center"}))&&void 0!==k&&k,isAlignRight:null!==(O=e.editor.isActive({textAlign:"right"}))&&void 0!==O&&O,isAlignJustify:null!==(T=e.editor.isActive({textAlign:"justify"}))&&void 0!==T&&T,isImage:null!==(P=e.editor.isActive("imageUpload"))&&void 0!==P&&P,canInsertImage:e.editor.can().insertContent({type:"imageUpload"})}}}),u=(0,d.useCallback)((e=>{const n=s.trim();if(!n)return;const{from:r,to:o}=null!=a?a:t.state.selection,c=t.chain().focus();r!==o?c.setTextSelection({from:r,to:o}).extendMarkRange("link").setLink({href:n}).unsetMark("selectionMark").run():c.setTextSelection(r).insertContent({type:"text",text:n,marks:[{type:"link",attrs:{href:n}}]}).unsetMark("selectionMark").run(),rP.success(e.linkAddSuccess),i(!1),l(null)}),[t,s,a]),p=(0,d.useCallback)((e=>{t.chain().focus().unsetLink().unsetMark("selectionMark").run(),rP.success(e.linkRemoveSuccess),i(!1),l(null)}),[t]),f=(0,d.useCallback)(((e,t)=>{"Enter"===e.key&&u(t)}),[u]),m=(0,d.useCallback)((()=>{if(!t)return!1;try{t.chain().focus().insertContent({type:"imageUpload"}).run()}catch(e){return!1}return!0}),[t]);return h().createElement("div",{className:n},h().createElement(PCe,{icon:h().createElement(JEe,null),onClick:()=>t.chain().focus().undo().run(),disabled:!c.canUndo}),h().createElement(PCe,{icon:h().createElement(QEe,null),onClick:()=>t.chain().focus().redo().run(),disabled:!c.canRedo}),h().createElement(Bb,{layout:"vertical"}),h().createElement(Ww,{render:h().createElement(Ww.Menu,null,h().createElement(ICe,{className:c.isHeading1?`${OCe}-menu-bar-dropdown-item-active`:"",onClick:()=>t.chain().focus().toggleHeading({level:1}).run()},h().createElement(eCe,null)),h().createElement(ICe,{className:c.isHeading2?`${OCe}-menu-bar-dropdown-item-active`:"",onClick:()=>t.chain().focus().toggleHeading({level:2}).run()},h().createElement(tCe,null)),h().createElement(ICe,{className:c.isHeading3?`${OCe}-menu-bar-dropdown-item-active`:"",onClick:()=>t.chain().focus().toggleHeading({level:3}).run()},h().createElement(nCe,null)),h().createElement(ICe,{className:c.isHeading4?`${OCe}-menu-bar-dropdown-item-active`:"",onClick:()=>t.chain().focus().toggleHeading({level:4}).run()},h().createElement(rCe,null)),h().createElement(ICe,{className:c.isHeading5?`${OCe}-menu-bar-dropdown-item-active`:"",onClick:()=>t.chain().focus().toggleHeading({level:5}).run()},h().createElement(iCe,null)),h().createElement(ICe,{className:c.isHeading6?`${OCe}-menu-bar-dropdown-item-active`:"",onClick:()=>t.chain().focus().toggleHeading({level:6}).run()},h().createElement(sCe,null)))},h().createElement("span",null,h().createElement(PCe,{icon:h().createElement(oCe,null),active:c.isHeading}))),h().createElement(PCe,{icon:h().createElement(aCe,null),onClick:()=>t.chain().focus().setParagraph().run(),active:c.isParagraph}),h().createElement(PCe,{icon:h().createElement(lCe,null),onClick:()=>t.chain().focus().toggleBulletList().run(),active:c.isBulletList}),h().createElement(PCe,{icon:h().createElement(cCe,null),onClick:()=>t.chain().focus().toggleOrderedList().run(),active:c.isOrderedList}),h().createElement(PCe,{icon:h().createElement(dCe,null),active:c.isBlockquote,onClick:()=>t.chain().focus().setBlockquote().run()}),h().createElement(PCe,{active:c.isCodeBlock,className:`${OCe}-menu-bar-btn-codeblock`,onClick:()=>t.chain().focus().toggleCodeBlock().run()},"CB"),h().createElement(PCe,{icon:h().createElement(BR,null),onClick:()=>t.chain().focus().setHorizontalRule().run()}),h().createElement(Bb,{layout:"vertical"}),h().createElement(PCe,{active:c.isAlignLeft,icon:h().createElement(hCe,null),onClick:()=>t.chain().focus().setTextAlign("left").run()}),h().createElement(PCe,{active:c.isAlignCenter,icon:h().createElement(uCe,null),onClick:()=>t.chain().focus().setTextAlign("center").run()}),h().createElement(PCe,{active:c.isAlignRight,icon:h().createElement(pCe,null),onClick:()=>t.chain().focus().setTextAlign("right").run()}),h().createElement(PCe,{active:c.isAlignJustify,icon:h().createElement(fCe,null),onClick:()=>t.chain().focus().setTextAlign("justify").run()}),h().createElement(Bb,{layout:"vertical"}),h().createElement(PCe,{icon:h().createElement(mCe,null),active:c.isBold,onClick:()=>t.chain().focus().toggleBold().run()}),h().createElement(PCe,{icon:h().createElement(gCe,null),onClick:()=>t.chain().focus().toggleItalic().run(),active:c.isItalic,disabled:!c.canItalic}),h().createElement(PCe,{icon:h().createElement(yCe,null),onClick:()=>t.chain().focus().toggleStrike().run(),active:c.isStrike,disabled:!c.canStrike}),h().createElement(PCe,{icon:h().createElement(kQ,null),onClick:()=>t.chain().focus().toggleCode().run(),active:c.isCode,disabled:!c.canCode}),h().createElement(Ww,{trigger:"click",visible:r,onVisibleChange:e=>{var n;if(i(e),e){const{from:e,to:r}=t.state.selection;l({from:e,to:r}),e!==r&&t.chain().focus().setMark("selectionMark").run();const i=(null===(n=t.getAttributes("link"))||void 0===n?void 0:n.href)||"";o(i)}else t.chain().focus().unsetMark("selectionMark").run(),l(null)},render:h().createElement("div",{className:`${OCe}-menu-bar-link-dropdown`},h().createElement(Jt,{componentName:"Sidebar"},(e=>h().createElement(h().Fragment,null,h().createElement(kr,{size:"small",placeholder:e.enterLinkAddress,value:s,onChange:o,onKeyDown:t=>f(t,e),className:`${OCe}-menu-bar-link-input`}),h().createElement(vs,{size:"small",theme:"borderless",type:"tertiary",icon:h().createElement(vCe,null),onClick:t=>u(e),disabled:!s.trim()}),h().createElement(vs,{size:"small",theme:"borderless",icon:h().createElement(hW,null),onClick:t=>p(e),disabled:!c.isLink})))))},h().createElement("span",null,h().createElement(PCe,{icon:h().createElement(bCe,null),active:c.isLink}))),h().createElement(Bb,{layout:"vertical"}),h().createElement(PCe,{icon:h().createElement(wCe,null),disabled:!c.canInsertImage,onClick:m}))}const RCe=h().memo((e=>{const{editable:t=!0,content:n,onContentChange:r,extensions:i=[],className:s,style:o,imgUploadProps:a}=e,l=(0,d.useMemo)((()=>[nfe,XEe.configure({link:{openOnClick:!1,enableClickSelection:!0}}),ZEe,TCe,xCe.configure({types:["heading","paragraph"]}),SCe.configure(a)]),[a]),c=jee({extensions:(0,d.useMemo)((()=>[...l,...i]),[l,i]),editable:t,content:n,onUpdate:e=>{let{editor:t}=e;null==r||r(t.getHTML())}});return c?h().createElement("div",{className:w()(OCe,{[s]:s}),style:o},t&&h().createElement(MCe,{editor:c,className:`${OCe}-menu-bar`}),h().createElement(Mee,{editor:c,className:`${OCe}-editor`})):null})),ACe=h().memo((e=>{const{activeKey:t,files:n=[],onExpand:r,style:i,className:s,onChange:o}=e;return h().createElement(Sf,{className:w()(kCe,`${kCe}-file`,{[s]:s}),style:i,onChange:o,activeKey:t,clickHeaderToExpand:!1},n.map((e=>h().createElement(Sf.Panel,{header:h().createElement(Wpe,{content:e,onExpand:r,mode:"file"}),itemKey:e.key,key:e.key},h().createElement(RCe,{key:e.key,content:e.content,editable:!1})))))})),NCe=ACe,DCe=Que.SIDEBAR;class LCe extends f{constructor(e){super(e),this.renderOption=()=>{const{activeKey:e,options:t,onActiveOptionChange:n,renderOptionItem:r}=this.props;return h().createElement(Bpe,{options:t,renderOptionItem:r,onChange:n,activeKey:e})},this.renderMain=()=>{const e=this.props.activeKey,{renderMainContent:t}=this.props;return h().createElement("div",{className:`${DCe}-main-content-wrapper`},this.renderOption(),h().createElement("div",{className:`${DCe}-main-content`},null==t?void 0:t(e)))},this.renderDetail=()=>{const{renderDetailContent:e,detailContent:t={},imgUploadProps:n,fileEditable:r,onFileContentChange:i,mode:s}=this.props,o=null==e?void 0:e(s);return o||("code"===s?h().createElement(Kpe,Object.assign({},t,{jsonViewerProps:{height:"100%"}})):"file"===s?h().createElement(RCe,Object.assign({},t,{imgUploadProps:n,editable:null==r||r,onContentChange:i})):null)},this.renderContent=()=>{const{mode:e}=this.props;return e===epe.MODE.MAIN?this.renderMain():this.renderDetail()},this.renderTitle=()=>{const{title:e,mode:t}=this.props;return t===epe.MODE.MAIN?e:null},this.onDetailClose=e=>{const{onBackWard:t}=this.props;null==t||t(e,epe.MODE.MAIN)},this.handleCopyDetailContent=(e,t)=>{const{detailContent:n,mode:r,onDetailContentCopy:i}=this.props,s=n.content,o=Ot()(s);o&&this.ToastInCustomContainer.success({content:t.copySuccess}),null==i||i(e,s,o)},this.renderHeader=()=>{const{renderDetailHeader:e,detailContent:t,mode:n}=this.props,r=null==e?void 0:e(n,t);return r||h().createElement("div",{className:`${DCe}-detail-header`},h().createElement("span",{className:`${DCe}-detail-header-left`},h().createElement(vs,{theme:"borderless",type:"tertiary",icon:h().createElement(Ji,null),onClick:this.onDetailClose}),h().createElement("span",{className:`${DCe}-detail-header-title`},t.name)),h().createElement("span",{className:`${DCe}-detail-header-right`},h().createElement(Jt,{componentName:"Sidebar"},(e=>h().createElement(vs,{theme:"borderless",type:"tertiary",icon:h().createElement(BW,null),onClick:t=>this.handleCopyDetailContent(t,e)})))))},this.containerRef=h().createRef(),this.ToastInCustomContainer=nP.create({getPopupContainer:()=>this.containerRef.current})}render(){const{mode:e}=this.props,t=Gl()(this.props,["title","style","visible","motion","minWidth","maxWidth","onCancel","afterVisibleChange","resizable","defaultSize","children","className","showClose"]);return h().createElement(ipe,Object.assign({},t,{title:this.renderTitle(),containerRef:this.containerRef,className:w()({[t.className]:t.className,[`${DCe}-main`]:e===epe.MODE.MAIN,[`${DCe}-detail`]:e!==epe.MODE.MAIN}),renderHeader:e!==epe.MODE.MAIN?this.renderHeader:void 0}),this.renderContent())}}LCe.propTypes=Object.assign(Object.assign({},ipe.propTypes),{mode:E().string,activeKey:E().string,options:E().array,onActiveOptionChange:E().func,renderMainContent:E().func,renderDetailHeader:E().func,renderDetailContent:E().func,fileEditable:E().bool,onFileContentChange:E().func,onBackWard:E().func}),LCe.FileContent=NCe,LCe.CodeContent=qpe,LCe.FileItem=RCe,LCe.CodeItem=Kpe,LCe.Container=ipe,LCe.defaultProps={mode:epe.MODE.MAIN,fileEditable:!0};const FCe=LCe})(),__webpack_exports__})()));
|
||
//# sourceMappingURL=semi-ui.min.js.map |