@mujian/js-sdk 0.1.0-beta.0 → 0.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/umd/react.js
CHANGED
|
@@ -1,12 +1,48 @@
|
|
|
1
1
|
/*! For license information please see react.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define(["React"],t):"object"==typeof exports?exports.MujianUMD=t(require("React")):e.MujianUMD=t(e.React)}(globalThis,e=>(()=>{var t={"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_Symbol.js":function(e,t,n){e.exports=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_root.js").Symbol},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseGetTag.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_Symbol.js"),i=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_getRawTag.js"),o=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_objectToString.js"),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseTrim.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_trimmedEndIndex.js"),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_freeGlobal.js":function(e,t,n){e.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_getRawTag.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_Symbol.js"),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[u]=n:delete e[u]),i}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_objectToString.js":function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_root.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_freeGlobal.js"),i="object"==typeof self&&self&&self.Object===Object&&self;e.exports=r||i||Function("return this")()},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_trimmedEndIndex.js":function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/debounce.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObject.js"),i=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/now.js"),o=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/toNumber.js"),a=Math.max,u=Math.min;e.exports=function(e,t,n){var s,d,c,l,p,f,h=0,m=!1,_=!1,g=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var n=s,r=d;return s=d=void 0,h=t,l=e.apply(r,n)}function y(e){var n=e-f,r=e-h;return void 0===f||n>=t||n<0||_&&r>=c}function v(){var e,n,r,o=i();if(y(o))return w(o);p=setTimeout(v,(e=o-f,n=o-h,r=t-e,_?u(r,c-n):r))}function w(e){return(p=void 0,g&&s)?b(e):(s=d=void 0,l)}function k(){var e,n=i(),r=y(n);if(s=arguments,d=this,f=n,r){if(void 0===p)return h=e=f,p=setTimeout(v,t),m?b(e):l;if(_)return clearTimeout(p),p=setTimeout(v,t),b(f)}return void 0===p&&(p=setTimeout(v,t)),l}return t=o(t)||0,r(n)&&(m=!!n.leading,c=(_="maxWait"in n)?a(o(n.maxWait)||0,t):c,g="trailing"in n?!!n.trailing:g),k.cancel=function(){void 0!==p&&clearTimeout(p),h=0,s=f=d=p=void 0},k.flush=function(){return void 0===p?l:w(i())},k}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObject.js":function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObjectLike.js":function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isSymbol.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseGetTag.js"),i=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObjectLike.js");e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/now.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_root.js");e.exports=function(){return r.Date.now()}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/throttle.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/debounce.js"),i=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObject.js");e.exports=function(e,t,n){var o=!0,a=!0;if("function"!=typeof e)throw TypeError("Expected a function");return i(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),r(e,t,{leading:o,maxWait:t,trailing:a})}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/toNumber.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseTrim.js"),i=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObject.js"),o=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isSymbol.js"),a=0/0,u=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,d=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return a;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=s.test(e);return n||d.test(e)?c(e.slice(2),n?2:8):u.test(e)?a:+e}},"../../common/temp/node_modules/.pnpm/react-dom@19.1.5_react@19.1.5/node_modules/react-dom/cjs/react-dom.production.js":function(e,t,n){"use strict";var r=n("react");function i(){}var o={d:{f:i,r:function(){throw Error(function(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0},a=(Symbol.for("react.portal"),r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE);t.flushSync=function(e){var t=a.T,n=o.p;try{if(a.T=null,o.p=2,e)return e()}finally{a.T=t,o.p=n,o.d.f()}}},"../../common/temp/node_modules/.pnpm/react-dom@19.1.5_react@19.1.5/node_modules/react-dom/index.js":function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n("../../common/temp/node_modules/.pnpm/react-dom@19.1.5_react@19.1.5/node_modules/react-dom/cjs/react-dom.production.js")},"../../common/temp/node_modules/.pnpm/react@19.1.5/node_modules/react/cjs/react-jsx-runtime.production.js":function(e,t){"use strict";var n=Symbol.for("react.transitional.element");function r(e,t,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==t.key&&(i=""+t.key),"key"in t)for(var o in r={},t)"key"!==o&&(r[o]=t[o]);else r=t;return{$$typeof:n,type:e,key:i,ref:void 0!==(t=r.ref)?t:null,props:r}}t.Fragment=Symbol.for("react.fragment"),t.jsx=r,t.jsxs=r},"../../common/temp/node_modules/.pnpm/react@19.1.5/node_modules/react/jsx-runtime.js":function(e,t,n){"use strict";e.exports=n("../../common/temp/node_modules/.pnpm/react@19.1.5/node_modules/react/cjs/react-jsx-runtime.production.js")},"../../common/temp/node_modules/.pnpm/showdown@2.1.0/node_modules/showdown/dist/showdown.js":function(e){(function(){function t(e){"use strict";var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `\xab\xab\xab` and `\xbb\xbb\xbb` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r].defaultValue);return n}var n={},r={},i={},o=t(!0),a="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:t(!0),allOn:function(){"use strict";var e=t(!0),n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=!0);return n}()};function s(e,t){"use strict";var r=t?"Error in "+t+" extension->":"Error in unnamed extension",i={valid:!0,error:""};n.helper.isArray(e)||(e=[e]);for(var o=0;o<e.length;++o){var a=r+" sub-extension "+o+": ",u=e[o];if("object"!=typeof u){i.valid=!1,i.error=a+"must be an object, but "+typeof u+" given";break}if(!n.helper.isString(u.type)){i.valid=!1,i.error=a+'property "type" must be a string, but '+typeof u.type+" given";break}var s=u.type=u.type.toLowerCase();if("language"===s&&(s=u.type="lang"),"html"===s&&(s=u.type="output"),"lang"!==s&&"output"!==s&&"listener"!==s){i.valid=!1,i.error=a+"type "+s+' is not recognized. Valid values: "lang/language", "output/html" or "listener"';break}if("listener"===s){if(n.helper.isUndefined(u.listeners)){i.valid=!1,i.error=a+'. Extensions of type "listener" must have a property called "listeners"';break}}else if(n.helper.isUndefined(u.filter)&&n.helper.isUndefined(u.regex)){i.valid=!1,i.error=a+s+' extensions must define either a "regex" property or a "filter" method';break}if(u.listeners){if("object"!=typeof u.listeners)return i.valid=!1,i.error=a+'"listeners" property must be an object but '+typeof u.listeners+" given",i;for(var d in u.listeners)if(u.listeners.hasOwnProperty(d)&&"function"!=typeof u.listeners[d])return i.valid=!1,i.error=a+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+d+" must be a function but "+typeof u.listeners[d]+" given",i}if(u.filter){if("function"!=typeof u.filter){i.valid=!1,i.error=a+'"filter" must be a function, but '+typeof u.filter+" given";break}}else if(u.regex){if(n.helper.isString(u.regex)&&(u.regex=RegExp(u.regex,"g")),!(u.regex instanceof RegExp))return i.valid=!1,i.error=a+'"regex" property must either be a string or a RegExp object, but '+typeof u.regex+" given",i;if(n.helper.isUndefined(u.replace)){i.valid=!1,i.error=a+'"regex" extensions must implement a replace string or function';break}}}return i}function d(e,t){return"\xa8E"+t.charCodeAt(0)+"E"}n.helper={},n.extensions={},n.setOption=function(e,t){return o[e]=t,this},n.getOption=function(e){return o[e]},n.getOptions=function(){return o},n.resetOptions=function(){"use strict";o=t(!0)},n.setFlavor=function(e){"use strict";if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");n.resetOptions();var t=u[e];for(var r in a=e,t)t.hasOwnProperty(r)&&(o[r]=t[r])},n.getFlavor=function(){return a},n.getFlavorOptions=function(e){"use strict";if(u.hasOwnProperty(e))return u[e]},n.getDefaultOptions=function(e){return t(e)},n.subParser=function(e,t){"use strict";if(n.helper.isString(e))if(void 0!==t)r[e]=t;else if(r.hasOwnProperty(e))return r[e];else throw Error("SubParser named "+e+" not registered!")},n.extension=function(e,t){"use strict";if(!n.helper.isString(e))throw Error("Extension 'name' must be a string");if(e=n.helper.stdExtName(e),n.helper.isUndefined(t)){if(!i.hasOwnProperty(e))throw Error("Extension named "+e+" is not registered!");return i[e]}"function"==typeof t&&(t=t()),n.helper.isArray(t)||(t=[t]);var r=s(t,e);if(r.valid)i[e]=t;else throw Error(r.error)},n.getAllExtensions=function(){return i},n.removeExtension=function(e){"use strict";delete i[e]},n.resetExtensions=function(){"use strict";i={}},n.validateExtension=function(e){"use strict";var t=s(e,null);return!!t.valid||(console.warn(t.error),!1)},n.hasOwnProperty("helper")||(n.helper={}),n.helper.isString=function(e){return"string"==typeof e||e instanceof String},n.helper.isFunction=function(e){return e&&"[object Function]"===({}).toString.call(e)},n.helper.isArray=function(e){return Array.isArray(e)},n.helper.isUndefined=function(e){return void 0===e},n.helper.forEach=function(e,t){"use strict";if(n.helper.isUndefined(e))throw Error("obj param is required");if(n.helper.isUndefined(t))throw Error("callback param is required");if(!n.helper.isFunction(t))throw Error("callback param must be a function/closure");if("function"==typeof e.forEach)e.forEach(t);else if(n.helper.isArray(e))for(var r=0;r<e.length;r++)t(e[r],r,e);else if("object"==typeof e)for(var i in e)e.hasOwnProperty(i)&&t(e[i],i,e);else throw Error("obj does not seem to be an array or an iterable object")},n.helper.stdExtName=function(e){return e.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()},n.helper.escapeCharactersCallback=d,n.helper.escapeCharacters=function(e,t,n){"use strict";var r="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var i=RegExp(r,"g");return e.replace(i,d)},n.helper.unescapeHTMLEntities=function(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var c=function(e,t,n,r){"use strict";var i,o,a,u,s,d=r||"",c=d.indexOf("g")>-1,l=RegExp(t+"|"+n,"g"+d.replace(/g/g,"")),p=new RegExp(t,d.replace(/g/g,"")),f=[];do for(i=0;a=l.exec(e);)if(p.test(a[0]))i++||(u=(o=l.lastIndex)-a[0].length);else if(i&&!--i){s=a.index+a[0].length;var h={left:{start:u,end:o},match:{start:o,end:a.index},right:{start:a.index,end:s},wholeMatch:{start:u,end:s}};if(f.push(h),!c)return f}while(i&&(l.lastIndex=o));return f};n.helper.matchRecursiveRegExp=function(e,t,n,r){"use strict";for(var i=c(e,t,n,r),o=[],a=0;a<i.length;++a)o.push([e.slice(i[a].wholeMatch.start,i[a].wholeMatch.end),e.slice(i[a].match.start,i[a].match.end),e.slice(i[a].left.start,i[a].left.end),e.slice(i[a].right.start,i[a].right.end)]);return o},n.helper.replaceRecursiveRegExp=function(e,t,r,i,o){"use strict";if(!n.helper.isFunction(t)){var a=t;t=function(){return a}}var u=c(e,r,i,o),s=e,d=u.length;if(d>0){var l=[];0!==u[0].wholeMatch.start&&l.push(e.slice(0,u[0].wholeMatch.start));for(var p=0;p<d;++p)l.push(t(e.slice(u[p].wholeMatch.start,u[p].wholeMatch.end),e.slice(u[p].match.start,u[p].match.end),e.slice(u[p].left.start,u[p].left.end),e.slice(u[p].right.start,u[p].right.end))),p<d-1&&l.push(e.slice(u[p].wholeMatch.end,u[p+1].wholeMatch.start));u[d-1].wholeMatch.end<e.length&&l.push(e.slice(u[d-1].wholeMatch.end)),s=l.join("")}return s},n.helper.regexIndexOf=function(e,t,r){"use strict";if(!n.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(t instanceof RegExp==!1)throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var i=e.substring(r||0).search(t);return i>=0?i+(r||0):i},n.helper.splitAtIndex=function(e,t){"use strict";if(!n.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},n.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e.replace(/./g,function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var n=Math.random();e=n>.9?t[2](e):n>.45?t[1](e):t[0](e)}return e})},n.helper.padEnd=function(e,t,n){return(t|=0,n=String(n||" "),e.length>t)?String(e):((t-=e.length)>n.length&&(n+=n.repeat(t/n.length)),String(e)+n.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),n.helper.regexes={asteriskDashAndColon:/([*_:~])/g},n.helper.emojis={"+1":"\ud83d\udc4d","-1":"\ud83d\udc4e",100:"\ud83d\udcaf",1234:"\ud83d\udd22","1st_place_medal":"\ud83e\udd47","2nd_place_medal":"\ud83e\udd48","3rd_place_medal":"\ud83e\udd49","8ball":"\ud83c\udfb1",a:"\ud83c\udd70️",ab:"\ud83c\udd8e",abc:"\ud83d\udd24",abcd:"\ud83d\udd21",accept:"\ud83c\ude51",aerial_tramway:"\ud83d\udea1",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"\ud83d\udc7d",ambulance:"\ud83d\ude91",amphora:"\ud83c\udffa",anchor:"⚓️",angel:"\ud83d\udc7c",anger:"\ud83d\udca2",angry:"\ud83d\ude20",anguished:"\ud83d\ude27",ant:"\ud83d\udc1c",apple:"\ud83c\udf4e",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"\ud83d\udd3d",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"\ud83d\udd3c",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"\ud83d\udd03",arrows_counterclockwise:"\ud83d\udd04",art:"\ud83c\udfa8",articulated_lorry:"\ud83d\ude9b",artificial_satellite:"\ud83d\udef0",astonished:"\ud83d\ude32",athletic_shoe:"\ud83d\udc5f",atm:"\ud83c\udfe7",atom_symbol:"⚛️",avocado:"\ud83e\udd51",b:"\ud83c\udd71️",baby:"\ud83d\udc76",baby_bottle:"\ud83c\udf7c",baby_chick:"\ud83d\udc24",baby_symbol:"\ud83d\udebc",back:"\ud83d\udd19",bacon:"\ud83e\udd53",badminton:"\ud83c\udff8",baggage_claim:"\ud83d\udec4",baguette_bread:"\ud83e\udd56",balance_scale:"⚖️",balloon:"\ud83c\udf88",ballot_box:"\ud83d\uddf3",ballot_box_with_check:"☑️",bamboo:"\ud83c\udf8d",banana:"\ud83c\udf4c",bangbang:"‼️",bank:"\ud83c\udfe6",bar_chart:"\ud83d\udcca",barber:"\ud83d\udc88",baseball:"⚾️",basketball:"\ud83c\udfc0",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"\ud83e\udd87",bath:"\ud83d\udec0",bathtub:"\ud83d\udec1",battery:"\ud83d\udd0b",beach_umbrella:"\ud83c\udfd6",bear:"\ud83d\udc3b",bed:"\ud83d\udecf",bee:"\ud83d\udc1d",beer:"\ud83c\udf7a",beers:"\ud83c\udf7b",beetle:"\ud83d\udc1e",beginner:"\ud83d\udd30",bell:"\ud83d\udd14",bellhop_bell:"\ud83d\udece",bento:"\ud83c\udf71",biking_man:"\ud83d\udeb4",bike:"\ud83d\udeb2",biking_woman:"\ud83d\udeb4‍♀️",bikini:"\ud83d\udc59",biohazard:"☣️",bird:"\ud83d\udc26",birthday:"\ud83c\udf82",black_circle:"⚫️",black_flag:"\ud83c\udff4",black_heart:"\ud83d\udda4",black_joker:"\ud83c\udccf",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"\ud83d\udd32",blonde_man:"\ud83d\udc71",blonde_woman:"\ud83d\udc71‍♀️",blossom:"\ud83c\udf3c",blowfish:"\ud83d\udc21",blue_book:"\ud83d\udcd8",blue_car:"\ud83d\ude99",blue_heart:"\ud83d\udc99",blush:"\ud83d\ude0a",boar:"\ud83d\udc17",boat:"⛵️",bomb:"\ud83d\udca3",book:"\ud83d\udcd6",bookmark:"\ud83d\udd16",bookmark_tabs:"\ud83d\udcd1",books:"\ud83d\udcda",boom:"\ud83d\udca5",boot:"\ud83d\udc62",bouquet:"\ud83d\udc90",bowing_man:"\ud83d\ude47",bow_and_arrow:"\ud83c\udff9",bowing_woman:"\ud83d\ude47‍♀️",bowling:"\ud83c\udfb3",boxing_glove:"\ud83e\udd4a",boy:"\ud83d\udc66",bread:"\ud83c\udf5e",bride_with_veil:"\ud83d\udc70",bridge_at_night:"\ud83c\udf09",briefcase:"\ud83d\udcbc",broken_heart:"\ud83d\udc94",bug:"\ud83d\udc1b",building_construction:"\ud83c\udfd7",bulb:"\ud83d\udca1",bullettrain_front:"\ud83d\ude85",bullettrain_side:"\ud83d\ude84",burrito:"\ud83c\udf2f",bus:"\ud83d\ude8c",business_suit_levitating:"\ud83d\udd74",busstop:"\ud83d\ude8f",bust_in_silhouette:"\ud83d\udc64",busts_in_silhouette:"\ud83d\udc65",butterfly:"\ud83e\udd8b",cactus:"\ud83c\udf35",cake:"\ud83c\udf70",calendar:"\ud83d\udcc6",call_me_hand:"\ud83e\udd19",calling:"\ud83d\udcf2",camel:"\ud83d\udc2b",camera:"\ud83d\udcf7",camera_flash:"\ud83d\udcf8",camping:"\ud83c\udfd5",cancer:"♋️",candle:"\ud83d\udd6f",candy:"\ud83c\udf6c",canoe:"\ud83d\udef6",capital_abcd:"\ud83d\udd20",capricorn:"♑️",car:"\ud83d\ude97",card_file_box:"\ud83d\uddc3",card_index:"\ud83d\udcc7",card_index_dividers:"\ud83d\uddc2",carousel_horse:"\ud83c\udfa0",carrot:"\ud83e\udd55",cat:"\ud83d\udc31",cat2:"\ud83d\udc08",cd:"\ud83d\udcbf",chains:"⛓",champagne:"\ud83c\udf7e",chart:"\ud83d\udcb9",chart_with_downwards_trend:"\ud83d\udcc9",chart_with_upwards_trend:"\ud83d\udcc8",checkered_flag:"\ud83c\udfc1",cheese:"\ud83e\uddc0",cherries:"\ud83c\udf52",cherry_blossom:"\ud83c\udf38",chestnut:"\ud83c\udf30",chicken:"\ud83d\udc14",children_crossing:"\ud83d\udeb8",chipmunk:"\ud83d\udc3f",chocolate_bar:"\ud83c\udf6b",christmas_tree:"\ud83c\udf84",church:"⛪️",cinema:"\ud83c\udfa6",circus_tent:"\ud83c\udfaa",city_sunrise:"\ud83c\udf07",city_sunset:"\ud83c\udf06",cityscape:"\ud83c\udfd9",cl:"\ud83c\udd91",clamp:"\ud83d\udddc",clap:"\ud83d\udc4f",clapper:"\ud83c\udfac",classical_building:"\ud83c\udfdb",clinking_glasses:"\ud83e\udd42",clipboard:"\ud83d\udccb",clock1:"\ud83d\udd50",clock10:"\ud83d\udd59",clock1030:"\ud83d\udd65",clock11:"\ud83d\udd5a",clock1130:"\ud83d\udd66",clock12:"\ud83d\udd5b",clock1230:"\ud83d\udd67",clock130:"\ud83d\udd5c",clock2:"\ud83d\udd51",clock230:"\ud83d\udd5d",clock3:"\ud83d\udd52",clock330:"\ud83d\udd5e",clock4:"\ud83d\udd53",clock430:"\ud83d\udd5f",clock5:"\ud83d\udd54",clock530:"\ud83d\udd60",clock6:"\ud83d\udd55",clock630:"\ud83d\udd61",clock7:"\ud83d\udd56",clock730:"\ud83d\udd62",clock8:"\ud83d\udd57",clock830:"\ud83d\udd63",clock9:"\ud83d\udd58",clock930:"\ud83d\udd64",closed_book:"\ud83d\udcd5",closed_lock_with_key:"\ud83d\udd10",closed_umbrella:"\ud83c\udf02",cloud:"☁️",cloud_with_lightning:"\ud83c\udf29",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"\ud83c\udf27",cloud_with_snow:"\ud83c\udf28",clown_face:"\ud83e\udd21",clubs:"♣️",cocktail:"\ud83c\udf78",coffee:"☕️",coffin:"⚰️",cold_sweat:"\ud83d\ude30",comet:"☄️",computer:"\ud83d\udcbb",computer_mouse:"\ud83d\uddb1",confetti_ball:"\ud83c\udf8a",confounded:"\ud83d\ude16",confused:"\ud83d\ude15",congratulations:"㊗️",construction:"\ud83d\udea7",construction_worker_man:"\ud83d\udc77",construction_worker_woman:"\ud83d\udc77‍♀️",control_knobs:"\ud83c\udf9b",convenience_store:"\ud83c\udfea",cookie:"\ud83c\udf6a",cool:"\ud83c\udd92",policeman:"\ud83d\udc6e",copyright:"\xa9️",corn:"\ud83c\udf3d",couch_and_lamp:"\ud83d\udecb",couple:"\ud83d\udc6b",couple_with_heart_woman_man:"\ud83d\udc91",couple_with_heart_man_man:"\ud83d\udc68‍❤️‍\ud83d\udc68",couple_with_heart_woman_woman:"\ud83d\udc69‍❤️‍\ud83d\udc69",couplekiss_man_man:"\ud83d\udc68‍❤️‍\ud83d\udc8b‍\ud83d\udc68",couplekiss_man_woman:"\ud83d\udc8f",couplekiss_woman_woman:"\ud83d\udc69‍❤️‍\ud83d\udc8b‍\ud83d\udc69",cow:"\ud83d\udc2e",cow2:"\ud83d\udc04",cowboy_hat_face:"\ud83e\udd20",crab:"\ud83e\udd80",crayon:"\ud83d\udd8d",credit_card:"\ud83d\udcb3",crescent_moon:"\ud83c\udf19",cricket:"\ud83c\udfcf",crocodile:"\ud83d\udc0a",croissant:"\ud83e\udd50",crossed_fingers:"\ud83e\udd1e",crossed_flags:"\ud83c\udf8c",crossed_swords:"⚔️",crown:"\ud83d\udc51",cry:"\ud83d\ude22",crying_cat_face:"\ud83d\ude3f",crystal_ball:"\ud83d\udd2e",cucumber:"\ud83e\udd52",cupid:"\ud83d\udc98",curly_loop:"➰",currency_exchange:"\ud83d\udcb1",curry:"\ud83c\udf5b",custard:"\ud83c\udf6e",customs:"\ud83d\udec3",cyclone:"\ud83c\udf00",dagger:"\ud83d\udde1",dancer:"\ud83d\udc83",dancing_women:"\ud83d\udc6f",dancing_men:"\ud83d\udc6f‍♂️",dango:"\ud83c\udf61",dark_sunglasses:"\ud83d\udd76",dart:"\ud83c\udfaf",dash:"\ud83d\udca8",date:"\ud83d\udcc5",deciduous_tree:"\ud83c\udf33",deer:"\ud83e\udd8c",department_store:"\ud83c\udfec",derelict_house:"\ud83c\udfda",desert:"\ud83c\udfdc",desert_island:"\ud83c\udfdd",desktop_computer:"\ud83d\udda5",male_detective:"\ud83d\udd75️",diamond_shape_with_a_dot_inside:"\ud83d\udca0",diamonds:"♦️",disappointed:"\ud83d\ude1e",disappointed_relieved:"\ud83d\ude25",dizzy:"\ud83d\udcab",dizzy_face:"\ud83d\ude35",do_not_litter:"\ud83d\udeaf",dog:"\ud83d\udc36",dog2:"\ud83d\udc15",dollar:"\ud83d\udcb5",dolls:"\ud83c\udf8e",dolphin:"\ud83d\udc2c",door:"\ud83d\udeaa",doughnut:"\ud83c\udf69",dove:"\ud83d\udd4a",dragon:"\ud83d\udc09",dragon_face:"\ud83d\udc32",dress:"\ud83d\udc57",dromedary_camel:"\ud83d\udc2a",drooling_face:"\ud83e\udd24",droplet:"\ud83d\udca7",drum:"\ud83e\udd41",duck:"\ud83e\udd86",dvd:"\ud83d\udcc0","e-mail":"\ud83d\udce7",eagle:"\ud83e\udd85",ear:"\ud83d\udc42",ear_of_rice:"\ud83c\udf3e",earth_africa:"\ud83c\udf0d",earth_americas:"\ud83c\udf0e",earth_asia:"\ud83c\udf0f",egg:"\ud83e\udd5a",eggplant:"\ud83c\udf46",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"\ud83d\udd0c",elephant:"\ud83d\udc18",email:"✉️",end:"\ud83d\udd1a",envelope_with_arrow:"\ud83d\udce9",euro:"\ud83d\udcb6",european_castle:"\ud83c\udff0",european_post_office:"\ud83c\udfe4",evergreen_tree:"\ud83c\udf32",exclamation:"❗️",expressionless:"\ud83d\ude11",eye:"\ud83d\udc41",eye_speech_bubble:"\ud83d\udc41‍\ud83d\udde8",eyeglasses:"\ud83d\udc53",eyes:"\ud83d\udc40",face_with_head_bandage:"\ud83e\udd15",face_with_thermometer:"\ud83e\udd12",fist_oncoming:"\ud83d\udc4a",factory:"\ud83c\udfed",fallen_leaf:"\ud83c\udf42",family_man_woman_boy:"\ud83d\udc6a",family_man_boy:"\ud83d\udc68‍\ud83d\udc66",family_man_boy_boy:"\ud83d\udc68‍\ud83d\udc66‍\ud83d\udc66",family_man_girl:"\ud83d\udc68‍\ud83d\udc67",family_man_girl_boy:"\ud83d\udc68‍\ud83d\udc67‍\ud83d\udc66",family_man_girl_girl:"\ud83d\udc68‍\ud83d\udc67‍\ud83d\udc67",family_man_man_boy:"\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc66",family_man_man_boy_boy:"\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc66‍\ud83d\udc66",family_man_man_girl:"\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc67",family_man_man_girl_boy:"\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc67‍\ud83d\udc66",family_man_man_girl_girl:"\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc67‍\ud83d\udc67",family_man_woman_boy_boy:"\ud83d\udc68‍\ud83d\udc69‍\ud83d\udc66‍\ud83d\udc66",family_man_woman_girl:"\ud83d\udc68‍\ud83d\udc69‍\ud83d\udc67",family_man_woman_girl_boy:"\ud83d\udc68‍\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc66",family_man_woman_girl_girl:"\ud83d\udc68‍\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc67",family_woman_boy:"\ud83d\udc69‍\ud83d\udc66",family_woman_boy_boy:"\ud83d\udc69‍\ud83d\udc66‍\ud83d\udc66",family_woman_girl:"\ud83d\udc69‍\ud83d\udc67",family_woman_girl_boy:"\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc66",family_woman_girl_girl:"\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc67",family_woman_woman_boy:"\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc66",family_woman_woman_boy_boy:"\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc66‍\ud83d\udc66",family_woman_woman_girl:"\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc67",family_woman_woman_girl_boy:"\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc66",family_woman_woman_girl_girl:"\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc67",fast_forward:"⏩",fax:"\ud83d\udce0",fearful:"\ud83d\ude28",feet:"\ud83d\udc3e",female_detective:"\ud83d\udd75️‍♀️",ferris_wheel:"\ud83c\udfa1",ferry:"⛴",field_hockey:"\ud83c\udfd1",file_cabinet:"\ud83d\uddc4",file_folder:"\ud83d\udcc1",film_projector:"\ud83d\udcfd",film_strip:"\ud83c\udf9e",fire:"\ud83d\udd25",fire_engine:"\ud83d\ude92",fireworks:"\ud83c\udf86",first_quarter_moon:"\ud83c\udf13",first_quarter_moon_with_face:"\ud83c\udf1b",fish:"\ud83d\udc1f",fish_cake:"\ud83c\udf65",fishing_pole_and_fish:"\ud83c\udfa3",fist_raised:"✊",fist_left:"\ud83e\udd1b",fist_right:"\ud83e\udd1c",flags:"\ud83c\udf8f",flashlight:"\ud83d\udd26",fleur_de_lis:"⚜️",flight_arrival:"\ud83d\udeec",flight_departure:"\ud83d\udeeb",floppy_disk:"\ud83d\udcbe",flower_playing_cards:"\ud83c\udfb4",flushed:"\ud83d\ude33",fog:"\ud83c\udf2b",foggy:"\ud83c\udf01",football:"\ud83c\udfc8",footprints:"\ud83d\udc63",fork_and_knife:"\ud83c\udf74",fountain:"⛲️",fountain_pen:"\ud83d\udd8b",four_leaf_clover:"\ud83c\udf40",fox_face:"\ud83e\udd8a",framed_picture:"\ud83d\uddbc",free:"\ud83c\udd93",fried_egg:"\ud83c\udf73",fried_shrimp:"\ud83c\udf64",fries:"\ud83c\udf5f",frog:"\ud83d\udc38",frowning:"\ud83d\ude26",frowning_face:"☹️",frowning_man:"\ud83d\ude4d‍♂️",frowning_woman:"\ud83d\ude4d",middle_finger:"\ud83d\udd95",fuelpump:"⛽️",full_moon:"\ud83c\udf15",full_moon_with_face:"\ud83c\udf1d",funeral_urn:"⚱️",game_die:"\ud83c\udfb2",gear:"⚙️",gem:"\ud83d\udc8e",gemini:"♊️",ghost:"\ud83d\udc7b",gift:"\ud83c\udf81",gift_heart:"\ud83d\udc9d",girl:"\ud83d\udc67",globe_with_meridians:"\ud83c\udf10",goal_net:"\ud83e\udd45",goat:"\ud83d\udc10",golf:"⛳️",golfing_man:"\ud83c\udfcc️",golfing_woman:"\ud83c\udfcc️‍♀️",gorilla:"\ud83e\udd8d",grapes:"\ud83c\udf47",green_apple:"\ud83c\udf4f",green_book:"\ud83d\udcd7",green_heart:"\ud83d\udc9a",green_salad:"\ud83e\udd57",grey_exclamation:"❕",grey_question:"❔",grimacing:"\ud83d\ude2c",grin:"\ud83d\ude01",grinning:"\ud83d\ude00",guardsman:"\ud83d\udc82",guardswoman:"\ud83d\udc82‍♀️",guitar:"\ud83c\udfb8",gun:"\ud83d\udd2b",haircut_woman:"\ud83d\udc87",haircut_man:"\ud83d\udc87‍♂️",hamburger:"\ud83c\udf54",hammer:"\ud83d\udd28",hammer_and_pick:"⚒",hammer_and_wrench:"\ud83d\udee0",hamster:"\ud83d\udc39",hand:"✋",handbag:"\ud83d\udc5c",handshake:"\ud83e\udd1d",hankey:"\ud83d\udca9",hatched_chick:"\ud83d\udc25",hatching_chick:"\ud83d\udc23",headphones:"\ud83c\udfa7",hear_no_evil:"\ud83d\ude49",heart:"❤️",heart_decoration:"\ud83d\udc9f",heart_eyes:"\ud83d\ude0d",heart_eyes_cat:"\ud83d\ude3b",heartbeat:"\ud83d\udc93",heartpulse:"\ud83d\udc97",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"\ud83d\udcb2",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"\ud83d\ude81",herb:"\ud83c\udf3f",hibiscus:"\ud83c\udf3a",high_brightness:"\ud83d\udd06",high_heel:"\ud83d\udc60",hocho:"\ud83d\udd2a",hole:"\ud83d\udd73",honey_pot:"\ud83c\udf6f",horse:"\ud83d\udc34",horse_racing:"\ud83c\udfc7",hospital:"\ud83c\udfe5",hot_pepper:"\ud83c\udf36",hotdog:"\ud83c\udf2d",hotel:"\ud83c\udfe8",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"\ud83c\udfe0",house_with_garden:"\ud83c\udfe1",houses:"\ud83c\udfd8",hugs:"\ud83e\udd17",hushed:"\ud83d\ude2f",ice_cream:"\ud83c\udf68",ice_hockey:"\ud83c\udfd2",ice_skate:"⛸",icecream:"\ud83c\udf66",id:"\ud83c\udd94",ideograph_advantage:"\ud83c\ude50",imp:"\ud83d\udc7f",inbox_tray:"\ud83d\udce5",incoming_envelope:"\ud83d\udce8",tipping_hand_woman:"\ud83d\udc81",information_source:"ℹ️",innocent:"\ud83d\ude07",interrobang:"⁉️",iphone:"\ud83d\udcf1",izakaya_lantern:"\ud83c\udfee",jack_o_lantern:"\ud83c\udf83",japan:"\ud83d\uddfe",japanese_castle:"\ud83c\udfef",japanese_goblin:"\ud83d\udc7a",japanese_ogre:"\ud83d\udc79",jeans:"\ud83d\udc56",joy:"\ud83d\ude02",joy_cat:"\ud83d\ude39",joystick:"\ud83d\udd79",kaaba:"\ud83d\udd4b",key:"\ud83d\udd11",keyboard:"⌨️",keycap_ten:"\ud83d\udd1f",kick_scooter:"\ud83d\udef4",kimono:"\ud83d\udc58",kiss:"\ud83d\udc8b",kissing:"\ud83d\ude17",kissing_cat:"\ud83d\ude3d",kissing_closed_eyes:"\ud83d\ude1a",kissing_heart:"\ud83d\ude18",kissing_smiling_eyes:"\ud83d\ude19",kiwi_fruit:"\ud83e\udd5d",koala:"\ud83d\udc28",koko:"\ud83c\ude01",label:"\ud83c\udff7",large_blue_circle:"\ud83d\udd35",large_blue_diamond:"\ud83d\udd37",large_orange_diamond:"\ud83d\udd36",last_quarter_moon:"\ud83c\udf17",last_quarter_moon_with_face:"\ud83c\udf1c",latin_cross:"✝️",laughing:"\ud83d\ude06",leaves:"\ud83c\udf43",ledger:"\ud83d\udcd2",left_luggage:"\ud83d\udec5",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"\ud83c\udf4b",leo:"♌️",leopard:"\ud83d\udc06",level_slider:"\ud83c\udf9a",libra:"♎️",light_rail:"\ud83d\ude88",link:"\ud83d\udd17",lion:"\ud83e\udd81",lips:"\ud83d\udc44",lipstick:"\ud83d\udc84",lizard:"\ud83e\udd8e",lock:"\ud83d\udd12",lock_with_ink_pen:"\ud83d\udd0f",lollipop:"\ud83c\udf6d",loop:"➿",loud_sound:"\ud83d\udd0a",loudspeaker:"\ud83d\udce2",love_hotel:"\ud83c\udfe9",love_letter:"\ud83d\udc8c",low_brightness:"\ud83d\udd05",lying_face:"\ud83e\udd25",m:"Ⓜ️",mag:"\ud83d\udd0d",mag_right:"\ud83d\udd0e",mahjong:"\ud83c\udc04️",mailbox:"\ud83d\udceb",mailbox_closed:"\ud83d\udcea",mailbox_with_mail:"\ud83d\udcec",mailbox_with_no_mail:"\ud83d\udced",man:"\ud83d\udc68",man_artist:"\ud83d\udc68‍\ud83c\udfa8",man_astronaut:"\ud83d\udc68‍\ud83d\ude80",man_cartwheeling:"\ud83e\udd38‍♂️",man_cook:"\ud83d\udc68‍\ud83c\udf73",man_dancing:"\ud83d\udd7a",man_facepalming:"\ud83e\udd26‍♂️",man_factory_worker:"\ud83d\udc68‍\ud83c\udfed",man_farmer:"\ud83d\udc68‍\ud83c\udf3e",man_firefighter:"\ud83d\udc68‍\ud83d\ude92",man_health_worker:"\ud83d\udc68‍⚕️",man_in_tuxedo:"\ud83e\udd35",man_judge:"\ud83d\udc68‍⚖️",man_juggling:"\ud83e\udd39‍♂️",man_mechanic:"\ud83d\udc68‍\ud83d\udd27",man_office_worker:"\ud83d\udc68‍\ud83d\udcbc",man_pilot:"\ud83d\udc68‍✈️",man_playing_handball:"\ud83e\udd3e‍♂️",man_playing_water_polo:"\ud83e\udd3d‍♂️",man_scientist:"\ud83d\udc68‍\ud83d\udd2c",man_shrugging:"\ud83e\udd37‍♂️",man_singer:"\ud83d\udc68‍\ud83c\udfa4",man_student:"\ud83d\udc68‍\ud83c\udf93",man_teacher:"\ud83d\udc68‍\ud83c\udfeb",man_technologist:"\ud83d\udc68‍\ud83d\udcbb",man_with_gua_pi_mao:"\ud83d\udc72",man_with_turban:"\ud83d\udc73",tangerine:"\ud83c\udf4a",mans_shoe:"\ud83d\udc5e",mantelpiece_clock:"\ud83d\udd70",maple_leaf:"\ud83c\udf41",martial_arts_uniform:"\ud83e\udd4b",mask:"\ud83d\ude37",massage_woman:"\ud83d\udc86",massage_man:"\ud83d\udc86‍♂️",meat_on_bone:"\ud83c\udf56",medal_military:"\ud83c\udf96",medal_sports:"\ud83c\udfc5",mega:"\ud83d\udce3",melon:"\ud83c\udf48",memo:"\ud83d\udcdd",men_wrestling:"\ud83e\udd3c‍♂️",menorah:"\ud83d\udd4e",mens:"\ud83d\udeb9",metal:"\ud83e\udd18",metro:"\ud83d\ude87",microphone:"\ud83c\udfa4",microscope:"\ud83d\udd2c",milk_glass:"\ud83e\udd5b",milky_way:"\ud83c\udf0c",minibus:"\ud83d\ude90",minidisc:"\ud83d\udcbd",mobile_phone_off:"\ud83d\udcf4",money_mouth_face:"\ud83e\udd11",money_with_wings:"\ud83d\udcb8",moneybag:"\ud83d\udcb0",monkey:"\ud83d\udc12",monkey_face:"\ud83d\udc35",monorail:"\ud83d\ude9d",moon:"\ud83c\udf14",mortar_board:"\ud83c\udf93",mosque:"\ud83d\udd4c",motor_boat:"\ud83d\udee5",motor_scooter:"\ud83d\udef5",motorcycle:"\ud83c\udfcd",motorway:"\ud83d\udee3",mount_fuji:"\ud83d\uddfb",mountain:"⛰",mountain_biking_man:"\ud83d\udeb5",mountain_biking_woman:"\ud83d\udeb5‍♀️",mountain_cableway:"\ud83d\udea0",mountain_railway:"\ud83d\ude9e",mountain_snow:"\ud83c\udfd4",mouse:"\ud83d\udc2d",mouse2:"\ud83d\udc01",movie_camera:"\ud83c\udfa5",moyai:"\ud83d\uddff",mrs_claus:"\ud83e\udd36",muscle:"\ud83d\udcaa",mushroom:"\ud83c\udf44",musical_keyboard:"\ud83c\udfb9",musical_note:"\ud83c\udfb5",musical_score:"\ud83c\udfbc",mute:"\ud83d\udd07",nail_care:"\ud83d\udc85",name_badge:"\ud83d\udcdb",national_park:"\ud83c\udfde",nauseated_face:"\ud83e\udd22",necktie:"\ud83d\udc54",negative_squared_cross_mark:"❎",nerd_face:"\ud83e\udd13",neutral_face:"\ud83d\ude10",new:"\ud83c\udd95",new_moon:"\ud83c\udf11",new_moon_with_face:"\ud83c\udf1a",newspaper:"\ud83d\udcf0",newspaper_roll:"\ud83d\uddde",next_track_button:"⏭",ng:"\ud83c\udd96",no_good_man:"\ud83d\ude45‍♂️",no_good_woman:"\ud83d\ude45",night_with_stars:"\ud83c\udf03",no_bell:"\ud83d\udd15",no_bicycles:"\ud83d\udeb3",no_entry:"⛔️",no_entry_sign:"\ud83d\udeab",no_mobile_phones:"\ud83d\udcf5",no_mouth:"\ud83d\ude36",no_pedestrians:"\ud83d\udeb7",no_smoking:"\ud83d\udead","non-potable_water":"\ud83d\udeb1",nose:"\ud83d\udc43",notebook:"\ud83d\udcd3",notebook_with_decorative_cover:"\ud83d\udcd4",notes:"\ud83c\udfb6",nut_and_bolt:"\ud83d\udd29",o:"⭕️",o2:"\ud83c\udd7e️",ocean:"\ud83c\udf0a",octopus:"\ud83d\udc19",oden:"\ud83c\udf62",office:"\ud83c\udfe2",oil_drum:"\ud83d\udee2",ok:"\ud83c\udd97",ok_hand:"\ud83d\udc4c",ok_man:"\ud83d\ude46‍♂️",ok_woman:"\ud83d\ude46",old_key:"\ud83d\udddd",older_man:"\ud83d\udc74",older_woman:"\ud83d\udc75",om:"\ud83d\udd49",on:"\ud83d\udd1b",oncoming_automobile:"\ud83d\ude98",oncoming_bus:"\ud83d\ude8d",oncoming_police_car:"\ud83d\ude94",oncoming_taxi:"\ud83d\ude96",open_file_folder:"\ud83d\udcc2",open_hands:"\ud83d\udc50",open_mouth:"\ud83d\ude2e",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"\ud83d\udcd9",orthodox_cross:"☦️",outbox_tray:"\ud83d\udce4",owl:"\ud83e\udd89",ox:"\ud83d\udc02",package:"\ud83d\udce6",page_facing_up:"\ud83d\udcc4",page_with_curl:"\ud83d\udcc3",pager:"\ud83d\udcdf",paintbrush:"\ud83d\udd8c",palm_tree:"\ud83c\udf34",pancakes:"\ud83e\udd5e",panda_face:"\ud83d\udc3c",paperclip:"\ud83d\udcce",paperclips:"\ud83d\udd87",parasol_on_ground:"⛱",parking:"\ud83c\udd7f️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"\ud83d\udef3",passport_control:"\ud83d\udec2",pause_button:"⏸",peace_symbol:"☮️",peach:"\ud83c\udf51",peanuts:"\ud83e\udd5c",pear:"\ud83c\udf50",pen:"\ud83d\udd8a",pencil2:"✏️",penguin:"\ud83d\udc27",pensive:"\ud83d\ude14",performing_arts:"\ud83c\udfad",persevere:"\ud83d\ude23",person_fencing:"\ud83e\udd3a",pouting_woman:"\ud83d\ude4e",phone:"☎️",pick:"⛏",pig:"\ud83d\udc37",pig2:"\ud83d\udc16",pig_nose:"\ud83d\udc3d",pill:"\ud83d\udc8a",pineapple:"\ud83c\udf4d",ping_pong:"\ud83c\udfd3",pisces:"♓️",pizza:"\ud83c\udf55",place_of_worship:"\ud83d\uded0",plate_with_cutlery:"\ud83c\udf7d",play_or_pause_button:"⏯",point_down:"\ud83d\udc47",point_left:"\ud83d\udc48",point_right:"\ud83d\udc49",point_up:"☝️",point_up_2:"\ud83d\udc46",police_car:"\ud83d\ude93",policewoman:"\ud83d\udc6e‍♀️",poodle:"\ud83d\udc29",popcorn:"\ud83c\udf7f",post_office:"\ud83c\udfe3",postal_horn:"\ud83d\udcef",postbox:"\ud83d\udcee",potable_water:"\ud83d\udeb0",potato:"\ud83e\udd54",pouch:"\ud83d\udc5d",poultry_leg:"\ud83c\udf57",pound:"\ud83d\udcb7",rage:"\ud83d\ude21",pouting_cat:"\ud83d\ude3e",pouting_man:"\ud83d\ude4e‍♂️",pray:"\ud83d\ude4f",prayer_beads:"\ud83d\udcff",pregnant_woman:"\ud83e\udd30",previous_track_button:"⏮",prince:"\ud83e\udd34",princess:"\ud83d\udc78",printer:"\ud83d\udda8",purple_heart:"\ud83d\udc9c",purse:"\ud83d\udc5b",pushpin:"\ud83d\udccc",put_litter_in_its_place:"\ud83d\udeae",question:"❓",rabbit:"\ud83d\udc30",rabbit2:"\ud83d\udc07",racehorse:"\ud83d\udc0e",racing_car:"\ud83c\udfce",radio:"\ud83d\udcfb",radio_button:"\ud83d\udd18",radioactive:"☢️",railway_car:"\ud83d\ude83",railway_track:"\ud83d\udee4",rainbow:"\ud83c\udf08",rainbow_flag:"\ud83c\udff3️‍\ud83c\udf08",raised_back_of_hand:"\ud83e\udd1a",raised_hand_with_fingers_splayed:"\ud83d\udd90",raised_hands:"\ud83d\ude4c",raising_hand_woman:"\ud83d\ude4b",raising_hand_man:"\ud83d\ude4b‍♂️",ram:"\ud83d\udc0f",ramen:"\ud83c\udf5c",rat:"\ud83d\udc00",record_button:"⏺",recycle:"♻️",red_circle:"\ud83d\udd34",registered:"\xae️",relaxed:"☺️",relieved:"\ud83d\ude0c",reminder_ribbon:"\ud83c\udf97",repeat:"\ud83d\udd01",repeat_one:"\ud83d\udd02",rescue_worker_helmet:"⛑",restroom:"\ud83d\udebb",revolving_hearts:"\ud83d\udc9e",rewind:"⏪",rhinoceros:"\ud83e\udd8f",ribbon:"\ud83c\udf80",rice:"\ud83c\udf5a",rice_ball:"\ud83c\udf59",rice_cracker:"\ud83c\udf58",rice_scene:"\ud83c\udf91",right_anger_bubble:"\ud83d\uddef",ring:"\ud83d\udc8d",robot:"\ud83e\udd16",rocket:"\ud83d\ude80",rofl:"\ud83e\udd23",roll_eyes:"\ud83d\ude44",roller_coaster:"\ud83c\udfa2",rooster:"\ud83d\udc13",rose:"\ud83c\udf39",rosette:"\ud83c\udff5",rotating_light:"\ud83d\udea8",round_pushpin:"\ud83d\udccd",rowing_man:"\ud83d\udea3",rowing_woman:"\ud83d\udea3‍♀️",rugby_football:"\ud83c\udfc9",running_man:"\ud83c\udfc3",running_shirt_with_sash:"\ud83c\udfbd",running_woman:"\ud83c\udfc3‍♀️",sa:"\ud83c\ude02️",sagittarius:"♐️",sake:"\ud83c\udf76",sandal:"\ud83d\udc61",santa:"\ud83c\udf85",satellite:"\ud83d\udce1",saxophone:"\ud83c\udfb7",school:"\ud83c\udfeb",school_satchel:"\ud83c\udf92",scissors:"✂️",scorpion:"\ud83e\udd82",scorpius:"♏️",scream:"\ud83d\ude31",scream_cat:"\ud83d\ude40",scroll:"\ud83d\udcdc",seat:"\ud83d\udcba",secret:"㊙️",see_no_evil:"\ud83d\ude48",seedling:"\ud83c\udf31",selfie:"\ud83e\udd33",shallow_pan_of_food:"\ud83e\udd58",shamrock:"☘️",shark:"\ud83e\udd88",shaved_ice:"\ud83c\udf67",sheep:"\ud83d\udc11",shell:"\ud83d\udc1a",shield:"\ud83d\udee1",shinto_shrine:"⛩",ship:"\ud83d\udea2",shirt:"\ud83d\udc55",shopping:"\ud83d\udecd",shopping_cart:"\ud83d\uded2",shower:"\ud83d\udebf",shrimp:"\ud83e\udd90",signal_strength:"\ud83d\udcf6",six_pointed_star:"\ud83d\udd2f",ski:"\ud83c\udfbf",skier:"⛷",skull:"\ud83d\udc80",skull_and_crossbones:"☠️",sleeping:"\ud83d\ude34",sleeping_bed:"\ud83d\udecc",sleepy:"\ud83d\ude2a",slightly_frowning_face:"\ud83d\ude41",slightly_smiling_face:"\ud83d\ude42",slot_machine:"\ud83c\udfb0",small_airplane:"\ud83d\udee9",small_blue_diamond:"\ud83d\udd39",small_orange_diamond:"\ud83d\udd38",small_red_triangle:"\ud83d\udd3a",small_red_triangle_down:"\ud83d\udd3b",smile:"\ud83d\ude04",smile_cat:"\ud83d\ude38",smiley:"\ud83d\ude03",smiley_cat:"\ud83d\ude3a",smiling_imp:"\ud83d\ude08",smirk:"\ud83d\ude0f",smirk_cat:"\ud83d\ude3c",smoking:"\ud83d\udeac",snail:"\ud83d\udc0c",snake:"\ud83d\udc0d",sneezing_face:"\ud83e\udd27",snowboarder:"\ud83c\udfc2",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"\ud83d\ude2d",soccer:"⚽️",soon:"\ud83d\udd1c",sos:"\ud83c\udd98",sound:"\ud83d\udd09",space_invader:"\ud83d\udc7e",spades:"♠️",spaghetti:"\ud83c\udf5d",sparkle:"❇️",sparkler:"\ud83c\udf87",sparkles:"✨",sparkling_heart:"\ud83d\udc96",speak_no_evil:"\ud83d\ude4a",speaker:"\ud83d\udd08",speaking_head:"\ud83d\udde3",speech_balloon:"\ud83d\udcac",speedboat:"\ud83d\udea4",spider:"\ud83d\udd77",spider_web:"\ud83d\udd78",spiral_calendar:"\ud83d\uddd3",spiral_notepad:"\ud83d\uddd2",spoon:"\ud83e\udd44",squid:"\ud83e\udd91",stadium:"\ud83c\udfdf",star:"⭐️",star2:"\ud83c\udf1f",star_and_crescent:"☪️",star_of_david:"✡️",stars:"\ud83c\udf20",station:"\ud83d\ude89",statue_of_liberty:"\ud83d\uddfd",steam_locomotive:"\ud83d\ude82",stew:"\ud83c\udf72",stop_button:"⏹",stop_sign:"\ud83d\uded1",stopwatch:"⏱",straight_ruler:"\ud83d\udccf",strawberry:"\ud83c\udf53",stuck_out_tongue:"\ud83d\ude1b",stuck_out_tongue_closed_eyes:"\ud83d\ude1d",stuck_out_tongue_winking_eye:"\ud83d\ude1c",studio_microphone:"\ud83c\udf99",stuffed_flatbread:"\ud83e\udd59",sun_behind_large_cloud:"\ud83c\udf25",sun_behind_rain_cloud:"\ud83c\udf26",sun_behind_small_cloud:"\ud83c\udf24",sun_with_face:"\ud83c\udf1e",sunflower:"\ud83c\udf3b",sunglasses:"\ud83d\ude0e",sunny:"☀️",sunrise:"\ud83c\udf05",sunrise_over_mountains:"\ud83c\udf04",surfing_man:"\ud83c\udfc4",surfing_woman:"\ud83c\udfc4‍♀️",sushi:"\ud83c\udf63",suspension_railway:"\ud83d\ude9f",sweat:"\ud83d\ude13",sweat_drops:"\ud83d\udca6",sweat_smile:"\ud83d\ude05",sweet_potato:"\ud83c\udf60",swimming_man:"\ud83c\udfca",swimming_woman:"\ud83c\udfca‍♀️",symbols:"\ud83d\udd23",synagogue:"\ud83d\udd4d",syringe:"\ud83d\udc89",taco:"\ud83c\udf2e",tada:"\ud83c\udf89",tanabata_tree:"\ud83c\udf8b",taurus:"♉️",taxi:"\ud83d\ude95",tea:"\ud83c\udf75",telephone_receiver:"\ud83d\udcde",telescope:"\ud83d\udd2d",tennis:"\ud83c\udfbe",tent:"⛺️",thermometer:"\ud83c\udf21",thinking:"\ud83e\udd14",thought_balloon:"\ud83d\udcad",ticket:"\ud83c\udfab",tickets:"\ud83c\udf9f",tiger:"\ud83d\udc2f",tiger2:"\ud83d\udc05",timer_clock:"⏲",tipping_hand_man:"\ud83d\udc81‍♂️",tired_face:"\ud83d\ude2b",tm:"™️",toilet:"\ud83d\udebd",tokyo_tower:"\ud83d\uddfc",tomato:"\ud83c\udf45",tongue:"\ud83d\udc45",top:"\ud83d\udd1d",tophat:"\ud83c\udfa9",tornado:"\ud83c\udf2a",trackball:"\ud83d\uddb2",tractor:"\ud83d\ude9c",traffic_light:"\ud83d\udea5",train:"\ud83d\ude8b",train2:"\ud83d\ude86",tram:"\ud83d\ude8a",triangular_flag_on_post:"\ud83d\udea9",triangular_ruler:"\ud83d\udcd0",trident:"\ud83d\udd31",triumph:"\ud83d\ude24",trolleybus:"\ud83d\ude8e",trophy:"\ud83c\udfc6",tropical_drink:"\ud83c\udf79",tropical_fish:"\ud83d\udc20",truck:"\ud83d\ude9a",trumpet:"\ud83c\udfba",tulip:"\ud83c\udf37",tumbler_glass:"\ud83e\udd43",turkey:"\ud83e\udd83",turtle:"\ud83d\udc22",tv:"\ud83d\udcfa",twisted_rightwards_arrows:"\ud83d\udd00",two_hearts:"\ud83d\udc95",two_men_holding_hands:"\ud83d\udc6c",two_women_holding_hands:"\ud83d\udc6d",u5272:"\ud83c\ude39",u5408:"\ud83c\ude34",u55b6:"\ud83c\ude3a",u6307:"\ud83c\ude2f️",u6708:"\ud83c\ude37️",u6709:"\ud83c\ude36",u6e80:"\ud83c\ude35",u7121:"\ud83c\ude1a️",u7533:"\ud83c\ude38",u7981:"\ud83c\ude32",u7a7a:"\ud83c\ude33",umbrella:"☔️",unamused:"\ud83d\ude12",underage:"\ud83d\udd1e",unicorn:"\ud83e\udd84",unlock:"\ud83d\udd13",up:"\ud83c\udd99",upside_down_face:"\ud83d\ude43",v:"✌️",vertical_traffic_light:"\ud83d\udea6",vhs:"\ud83d\udcfc",vibration_mode:"\ud83d\udcf3",video_camera:"\ud83d\udcf9",video_game:"\ud83c\udfae",violin:"\ud83c\udfbb",virgo:"♍️",volcano:"\ud83c\udf0b",volleyball:"\ud83c\udfd0",vs:"\ud83c\udd9a",vulcan_salute:"\ud83d\udd96",walking_man:"\ud83d\udeb6",walking_woman:"\ud83d\udeb6‍♀️",waning_crescent_moon:"\ud83c\udf18",waning_gibbous_moon:"\ud83c\udf16",warning:"⚠️",wastebasket:"\ud83d\uddd1",watch:"⌚️",water_buffalo:"\ud83d\udc03",watermelon:"\ud83c\udf49",wave:"\ud83d\udc4b",wavy_dash:"〰️",waxing_crescent_moon:"\ud83c\udf12",wc:"\ud83d\udebe",weary:"\ud83d\ude29",wedding:"\ud83d\udc92",weight_lifting_man:"\ud83c\udfcb️",weight_lifting_woman:"\ud83c\udfcb️‍♀️",whale:"\ud83d\udc33",whale2:"\ud83d\udc0b",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"\ud83c\udff3️",white_flower:"\ud83d\udcae",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"\ud83d\udd33",wilted_flower:"\ud83e\udd40",wind_chime:"\ud83c\udf90",wind_face:"\ud83c\udf2c",wine_glass:"\ud83c\udf77",wink:"\ud83d\ude09",wolf:"\ud83d\udc3a",woman:"\ud83d\udc69",woman_artist:"\ud83d\udc69‍\ud83c\udfa8",woman_astronaut:"\ud83d\udc69‍\ud83d\ude80",woman_cartwheeling:"\ud83e\udd38‍♀️",woman_cook:"\ud83d\udc69‍\ud83c\udf73",woman_facepalming:"\ud83e\udd26‍♀️",woman_factory_worker:"\ud83d\udc69‍\ud83c\udfed",woman_farmer:"\ud83d\udc69‍\ud83c\udf3e",woman_firefighter:"\ud83d\udc69‍\ud83d\ude92",woman_health_worker:"\ud83d\udc69‍⚕️",woman_judge:"\ud83d\udc69‍⚖️",woman_juggling:"\ud83e\udd39‍♀️",woman_mechanic:"\ud83d\udc69‍\ud83d\udd27",woman_office_worker:"\ud83d\udc69‍\ud83d\udcbc",woman_pilot:"\ud83d\udc69‍✈️",woman_playing_handball:"\ud83e\udd3e‍♀️",woman_playing_water_polo:"\ud83e\udd3d‍♀️",woman_scientist:"\ud83d\udc69‍\ud83d\udd2c",woman_shrugging:"\ud83e\udd37‍♀️",woman_singer:"\ud83d\udc69‍\ud83c\udfa4",woman_student:"\ud83d\udc69‍\ud83c\udf93",woman_teacher:"\ud83d\udc69‍\ud83c\udfeb",woman_technologist:"\ud83d\udc69‍\ud83d\udcbb",woman_with_turban:"\ud83d\udc73‍♀️",womans_clothes:"\ud83d\udc5a",womans_hat:"\ud83d\udc52",women_wrestling:"\ud83e\udd3c‍♀️",womens:"\ud83d\udeba",world_map:"\ud83d\uddfa",worried:"\ud83d\ude1f",wrench:"\ud83d\udd27",writing_hand:"✍️",x:"❌",yellow_heart:"\ud83d\udc9b",yen:"\ud83d\udcb4",yin_yang:"☯️",yum:"\ud83d\ude0b",zap:"⚡️",zipper_mouth_face:"\ud83e\udd10",zzz:"\ud83d\udca4",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:"<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"},n.Converter=function(e){"use strict";var t={},r=[],d=[],c={},l=a,p={parsed:{},raw:"",format:""};for(var f in e=e||{},o)o.hasOwnProperty(f)&&(t[f]=o[f]);if("object"==typeof e)for(var h in e)e.hasOwnProperty(h)&&(t[h]=e[h]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof e+" was passed instead.");function m(e,t){if(t=t||null,n.helper.isString(e)){if(t=e=n.helper.stdExtName(e),n.extensions[e]){console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),function(e,t){"function"==typeof e&&(e=e(new n.Converter)),n.helper.isArray(e)||(e=[e]);var i=s(e,t);if(!i.valid)throw Error(i.error);for(var o=0;o<e.length;++o)switch(e[o].type){case"lang":r.push(e[o]);break;case"output":d.push(e[o]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}(n.extensions[e],e);return}if(n.helper.isUndefined(i[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=i[e]}"function"==typeof e&&(e=e()),n.helper.isArray(e)||(e=[e]);var o=s(e,t);if(!o.valid)throw Error(o.error);for(var a=0;a<e.length;++a){switch(e[a].type){case"lang":r.push(e[a]);break;case"output":d.push(e[a])}if(e[a].hasOwnProperty("listeners"))for(var u in e[a].listeners)e[a].listeners.hasOwnProperty(u)&&_(u,e[a].listeners[u])}}function _(e,t){if(!n.helper.isString(e))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof e+" given");if("function"!=typeof t)throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof t+" given");c.hasOwnProperty(e)||(c[e]=[]),c[e].push(t)}t.extensions&&n.helper.forEach(t.extensions,m),this._dispatch=function(e,t,n,r){if(c.hasOwnProperty(e))for(var i=0;i<c[e].length;++i){var o=c[e][i](e,t,this,n,r);o&&void 0!==o&&(t=o)}return t},this.listen=function(e,t){return _(e,t),this},this.makeHtml=function(e){if(!e)return e;var i,o,a={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:r,outputModifiers:d,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return e=(e=(e=(e=(e=e.replace(/¨/g,"\xa8T")).replace(/\$/g,"\xa8D")).replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/\u00A0/g," "),t.smartIndentationFix&&(o=RegExp("^\\s{0,"+(i=e).match(/^\s*/)[0].length+"}","gm"),e=i.replace(o,"")),e="\n\n"+e+"\n\n",e=(e=n.subParser("detab")(e,t,a)).replace(/^[ \t]+$/mg,""),n.helper.forEach(r,function(r){e=n.subParser("runExtension")(r,e,t,a)}),e=n.subParser("metadata")(e,t,a),e=n.subParser("hashPreCodeTags")(e,t,a),e=n.subParser("githubCodeBlocks")(e,t,a),e=n.subParser("hashHTMLBlocks")(e,t,a),e=n.subParser("hashCodeTags")(e,t,a),e=n.subParser("stripLinkDefinitions")(e,t,a),e=n.subParser("blockGamut")(e,t,a),e=n.subParser("unhashHTMLSpans")(e,t,a),e=(e=(e=n.subParser("unescapeSpecialChars")(e,t,a)).replace(/¨D/g,"$$")).replace(/¨T/g,"\xa8"),e=n.subParser("completeHTMLDocument")(e,t,a),n.helper.forEach(d,function(r){e=n.subParser("runExtension")(r,e,t,a)}),p=a.metadata,e},this.makeMarkdown=this.makeMd=function(e,t){if(e=(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/>[ \t]+</,">\xa8NBSP;<"),!t)if(window&&window.document)t=window.document;else throw Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var r=t.createElement("div");r.innerHTML=e;var i={preList:function(e){for(var t=e.querySelectorAll("pre"),r=[],i=0;i<t.length;++i)if(1===t[i].childElementCount&&"code"===t[i].firstChild.tagName.toLowerCase()){var o=t[i].firstChild.innerHTML.trim(),a=t[i].firstChild.getAttribute("data-language")||"";if(""===a)for(var u=t[i].firstChild.className.split(" "),s=0;s<u.length;++s){var d=u[s].match(/^language-(.+)$/);if(null!==d){a=d[1];break}}o=n.helper.unescapeHTMLEntities(o),r.push(o),t[i].outerHTML='<precode language="'+a+'" precodenum="'+i.toString()+'"></precode>'}else r.push(t[i].innerHTML),t[i].innerHTML="",t[i].setAttribute("prenum",i.toString());return r}(r)};!function e(t){for(var n=0;n<t.childNodes.length;++n){var r=t.childNodes[n];3===r.nodeType?/\S/.test(r.nodeValue)||/^[ ]+$/.test(r.nodeValue)?(r.nodeValue=r.nodeValue.split("\n").join(" "),r.nodeValue=r.nodeValue.replace(/(\s)+/g,"$1")):(t.removeChild(r),--n):1===r.nodeType&&e(r)}}(r);for(var o=r.childNodes,a="",u=0;u<o.length;u++)a+=n.subParser("makeMarkdown.node")(o[u],i);return a},this.setOption=function(e,n){t[e]=n},this.getOption=function(e){return t[e]},this.getOptions=function(){return t},this.addExtension=function(e,t){m(e,t=t||null)},this.useExtension=function(e){m(e)},this.setFlavor=function(e){if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");var n=u[e];for(var r in l=e,n)n.hasOwnProperty(r)&&(t[r]=n[r])},this.getFlavor=function(){return l},this.removeExtension=function(e){n.helper.isArray(e)||(e=[e]);for(var t=0;t<e.length;++t){for(var i=e[t],o=0;o<r.length;++o)r[o]===i&&r.splice(o,1);for(var a=0;a<d.length;++a)d[a]===i&&d.splice(a,1)}},this.getAllExtensions=function(){return{language:r,output:d}},this.getMetadata=function(e){return e?p.raw:p.parsed},this.getMetadataFormat=function(){return p.format},this._setMetadataPair=function(e,t){p.parsed[e]=t},this._setMetadataFormat=function(e){p.format=e},this._setMetadataRaw=function(e){p.raw=e}},n.subParser("anchors",function(e,t,r){"use strict";e=r.converter._dispatch("anchors.before",e,t,r);var i=function(e,i,o,a,u,s,d){if(n.helper.isUndefined(d)&&(d=""),o=o.toLowerCase(),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)a="";else if(!a){if(o||(o=i.toLowerCase().replace(/ ?\n/g," ")),a="#"+o,n.helper.isUndefined(r.gUrls[o]))return e;a=r.gUrls[o],n.helper.isUndefined(r.gTitles[o])||(d=r.gTitles[o])}var c='<a href="'+(a=a.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback))+'"';return""!==d&&null!==d&&(c+=' title="'+(d=(d=d.replace(/"/g,""")).replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback))+'"'),t.openLinksInNewWindow&&!/^#/.test(a)&&(c+=' rel="noopener noreferrer" target="\xa8E95Eblank"'),c+=">"+i+"</a>"};return e=(e=(e=(e=e.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,i)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,i)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,i)).replace(/\[([^\[\]]+)]()()()()()/g,i),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(e,r,i,o,a){if("\\"===i)return r+o;if(!n.helper.isString(t.ghMentionsLink))throw Error("ghMentionsLink option must be a string");var u=t.ghMentionsLink.replace(/\{u}/g,a),s="";return t.openLinksInNewWindow&&(s=' rel="noopener noreferrer" target="\xa8E95Eblank"'),r+'<a href="'+u+'"'+s+">"+o+"</a>"})),e=r.converter._dispatch("anchors.after",e,t,r)});var l=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,p=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,f=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,h=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,m=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,_=function(e){return function(t,r,i,o,a,u,s){var d=i=i.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback),c="",l="";return/^www\./i.test(i)&&(i=i.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&u&&(c=u),e.openLinksInNewWindow&&(l=' rel="noopener noreferrer" target="\xa8E95Eblank"'),(r||"")+'<a href="'+i+'"'+l+">"+d+"</a>"+c+(s||"")}},g=function(e,t){return function(r,i,o){var a="mailto:";return i=i||"",o=n.subParser("unescapeSpecialChars")(o,e,t),e.encodeEmails?(a=n.helper.encodeEmailAddress(a+o),o=n.helper.encodeEmailAddress(o)):a+=o,i+'<a href="'+a+'">'+o+"</a>"}};n.subParser("autoLinks",function(e,t,n){return e=(e=(e=n.converter._dispatch("autoLinks.before",e,t,n)).replace(f,_(t))).replace(m,g(t,n)),e=n.converter._dispatch("autoLinks.after",e,t,n)}),n.subParser("simplifiedAutoLinks",function(e,t,n){return t.simplifiedAutoLink?(e=n.converter._dispatch("simplifiedAutoLinks.before",e,t,n),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(p,_(t)):e.replace(l,_(t))).replace(h,g(t,n)),e=n.converter._dispatch("simplifiedAutoLinks.after",e,t,n)):e}),n.subParser("blockGamut",function(e,t,r){return e=r.converter._dispatch("blockGamut.before",e,t,r),e=n.subParser("blockQuotes")(e,t,r),e=n.subParser("headers")(e,t,r),e=n.subParser("horizontalRule")(e,t,r),e=n.subParser("lists")(e,t,r),e=n.subParser("codeBlocks")(e,t,r),e=n.subParser("tables")(e,t,r),e=n.subParser("hashHTMLBlocks")(e,t,r),e=n.subParser("paragraphs")(e,t,r),e=r.converter._dispatch("blockGamut.after",e,t,r)}),n.subParser("blockQuotes",function(e,t,r){"use strict";e=r.converter._dispatch("blockQuotes.before",e,t,r)+"\n\n";var i=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(i=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(i,function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=n.subParser("githubCodeBlocks")(e,t,r),e=(e=(e=n.subParser("blockGamut")(e,t,r)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(e,t){var n=t;return(n=n.replace(/^ /mg,"\xa80")).replace(/¨0/g,"")}),n.subParser("hashBlock")("<blockquote>\n"+e+"\n</blockquote>",t,r)}),e=r.converter._dispatch("blockQuotes.after",e,t,r)}),n.subParser("codeBlocks",function(e,t,r){return e=(e=(e=r.converter._dispatch("codeBlocks.before",e,t,r)+"\xa80").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,function(e,i,o){var a=i,u="\n";return a=n.subParser("outdent")(a,t,r),a=n.subParser("encodeCode")(a,t,r),a=(a=(a=n.subParser("detab")(a,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(u=""),a="<pre><code>"+a+u+"</code></pre>",n.subParser("hashBlock")(a,t,r)+o})).replace(/¨0/,""),e=r.converter._dispatch("codeBlocks.after",e,t,r)}),n.subParser("codeSpans",function(e,t,r){return void 0===(e=r.converter._dispatch("codeSpans.before",e,t,r))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,i,o,a){var u=a;return u=(u=u.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),u=i+"<code>"+(u=n.subParser("encodeCode")(u,t,r))+"</code>",u=n.subParser("hashHTMLSpans")(u,t,r)}),e=r.converter._dispatch("codeSpans.after",e,t,r)}),n.subParser("completeHTMLDocument",function(e,t,n){"use strict";if(!t.completeHTMLDocument)return e;e=n.converter._dispatch("completeHTMLDocument.before",e,t,n);var r="html",i="<!DOCTYPE HTML>\n",o="",a='<meta charset="utf-8">\n',u="",s="";for(var d in void 0!==n.metadata.parsed.doctype&&(i="<!DOCTYPE "+n.metadata.parsed.doctype+">\n",("html"===(r=n.metadata.parsed.doctype.toString().toLowerCase())||"html5"===r)&&(a='<meta charset="utf-8">')),n.metadata.parsed)if(n.metadata.parsed.hasOwnProperty(d))switch(d.toLowerCase()){case"doctype":break;case"title":o="<title>"+n.metadata.parsed.title+"</title>\n";break;case"charset":a="html"===r||"html5"===r?'<meta charset="'+n.metadata.parsed.charset+'">\n':'<meta name="charset" content="'+n.metadata.parsed.charset+'">\n';break;case"language":case"lang":u=' lang="'+n.metadata.parsed[d]+'"',s+='<meta name="'+d+'" content="'+n.metadata.parsed[d]+'">\n';break;default:s+='<meta name="'+d+'" content="'+n.metadata.parsed[d]+'">\n'}return e=i+"<html"+u+">\n<head>\n"+o+a+s+"</head>\n<body>\n"+e.trim()+"\n</body>\n</html>",e=n.converter._dispatch("completeHTMLDocument.after",e,t,n)}),n.subParser("detab",function(e,t,n){return e=(e=(e=(e=(e=(e=n.converter._dispatch("detab.before",e,t,n)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"\xa8A\xa8B")).replace(/¨B(.+?)¨A/g,function(e,t){for(var n=t,r=4-n.length%4,i=0;i<r;i++)n+=" ";return n})).replace(/¨A/g," ")).replace(/¨B/g,""),e=n.converter._dispatch("detab.after",e,t,n)}),n.subParser("ellipsis",function(e,t,n){return t.ellipsis?(e=(e=n.converter._dispatch("ellipsis.before",e,t,n)).replace(/\.\.\./g,"…"),e=n.converter._dispatch("ellipsis.after",e,t,n)):e}),n.subParser("emoji",function(e,t,r){return t.emoji?(e=(e=r.converter._dispatch("emoji.before",e,t,r)).replace(/:([\S]+?):/g,function(e,t){return n.helper.emojis.hasOwnProperty(t)?n.helper.emojis[t]:e}),e=r.converter._dispatch("emoji.after",e,t,r)):e}),n.subParser("encodeAmpsAndAngles",function(e,t,n){return e=(e=(e=(e=(e=n.converter._dispatch("encodeAmpsAndAngles.before",e,t,n)).replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&")).replace(/<(?![a-z\/?$!])/gi,"<")).replace(/</g,"<")).replace(/>/g,">"),e=n.converter._dispatch("encodeAmpsAndAngles.after",e,t,n)}),n.subParser("encodeBackslashEscapes",function(e,t,r){return e=(e=(e=r.converter._dispatch("encodeBackslashEscapes.before",e,t,r)).replace(/\\(\\)/g,n.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,n.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeBackslashEscapes.after",e,t,r)}),n.subParser("encodeCode",function(e,t,r){return e=(e=r.converter._dispatch("encodeCode.before",e,t,r)).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/([*_{}\[\]\\=~-])/g,n.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeCode.after",e,t,r)}),n.subParser("escapeSpecialCharsWithinTagAttributes",function(e,t,r){return e=(e=(e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,r)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)})).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,function(e){return e.replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)}),e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,r)}),n.subParser("githubCodeBlocks",function(e,t,r){return t.ghCodeBlocks?(e=(e=(e=r.converter._dispatch("githubCodeBlocks.before",e,t,r)+"\xa80").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(e,i,o,a){var u=t.omitExtraWLInCodeBlocks?"":"\n";return a=n.subParser("encodeCode")(a,t,r),a="<pre><code"+(o?' class="'+o+" language-"+o+'"':"")+">"+(a=(a=(a=n.subParser("detab")(a,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+u+"</code></pre>",a=n.subParser("hashBlock")(a,t,r),"\n\n\xa8G"+(r.ghCodeBlocks.push({text:e,codeblock:a})-1)+"G\n\n"})).replace(/¨0/,""),r.converter._dispatch("githubCodeBlocks.after",e,t,r)):e}),n.subParser("hashBlock",function(e,t,n){return e=(e=n.converter._dispatch("hashBlock.before",e,t,n)).replace(/(^\n+|\n+$)/g,""),e="\n\n\xa8K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n",e=n.converter._dispatch("hashBlock.after",e,t,n)}),n.subParser("hashCodeTags",function(e,t,r){return e=r.converter._dispatch("hashCodeTags.before",e,t,r),e=n.helper.replaceRecursiveRegExp(e,function(e,i,o,a){var u=o+n.subParser("encodeCode")(i,t,r)+a;return"\xa8C"+(r.gHtmlSpans.push(u)-1)+"C"},"<code\\b[^>]*>","</code>","gim"),e=r.converter._dispatch("hashCodeTags.after",e,t,r)}),n.subParser("hashElement",function(e,t,n){return function(e,t){var r=t;return r=(r=(r=r.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),r="\n\n\xa8K"+(n.gHtmlBlocks.push(r)-1)+"K\n\n"}}),n.subParser("hashHTMLBlocks",function(e,t,r){"use strict";e=r.converter._dispatch("hashHTMLBlocks.before",e,t,r);var i=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],o=function(e,t,n,i){var o=e;return -1!==n.search(/\bmarkdown\b/)&&(o=n+r.converter.makeHtml(t)+i),"\n\n\xa8K"+(r.gHtmlBlocks.push(o)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,function(e,t){return"<"+t+">"}));for(var a=0;a<i.length;++a)for(var u,s=RegExp("^ {0,3}(<"+i[a]+"\\b[^>]*>)","im"),d="<"+i[a]+"\\b[^>]*>",c="</"+i[a]+">";-1!==(u=n.helper.regexIndexOf(e,s));){var l=n.helper.splitAtIndex(e,u),p=n.helper.replaceRecursiveRegExp(l[1],o,d,c,"im");if(p===l[1])break;e=l[0].concat(p)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(e,t,r)),e=(e=n.helper.replaceRecursiveRegExp(e,function(e){return"\n\n\xa8K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n"},"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(e,t,r)),e=r.converter._dispatch("hashHTMLBlocks.after",e,t,r)}),n.subParser("hashHTMLSpans",function(e,t,n){"use strict";function r(e){return"\xa8C"+(n.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=n.converter._dispatch("hashHTMLSpans.before",e,t,n)).replace(/<[^>]+?\/>/gi,function(e){return r(e)})).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(e){return r(e)})).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(e){return r(e)})).replace(/<[^>]+?>/gi,function(e){return r(e)}),e=n.converter._dispatch("hashHTMLSpans.after",e,t,n)}),n.subParser("unhashHTMLSpans",function(e,t,n){"use strict";e=n.converter._dispatch("unhashHTMLSpans.before",e,t,n);for(var r=0;r<n.gHtmlSpans.length;++r){for(var i=n.gHtmlSpans[r],o=0;/¨C(\d+)C/.test(i);){var a=RegExp.$1;if(i=i.replace("\xa8C"+a+"C",n.gHtmlSpans[a]),10===o){console.error("maximum nesting of 10 spans reached!!!");break}++o}e=e.replace("\xa8C"+r+"C",i)}return n.converter._dispatch("unhashHTMLSpans.after",e,t,n)}),n.subParser("hashPreCodeTags",function(e,t,r){return e=r.converter._dispatch("hashPreCodeTags.before",e,t,r),e=n.helper.replaceRecursiveRegExp(e,function(e,i,o,a){var u=o+n.subParser("encodeCode")(i,t,r)+a;return"\n\n\xa8G"+(r.ghCodeBlocks.push({text:e,codeblock:u})-1)+"G\n\n"},"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),e=r.converter._dispatch("hashPreCodeTags.after",e,t,r)}),n.subParser("headers",function(e,t,r){"use strict";e=r.converter._dispatch("headers.before",e,t,r);var i=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),o=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,a=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(o,function(e,o){var a=n.subParser("spanGamut")(o,t,r),u="<h"+i+(t.noHeaderId?"":' id="'+s(o)+'"')+">"+a+"</h"+i+">";return n.subParser("hashBlock")(u,t,r)})).replace(a,function(e,o){var a=n.subParser("spanGamut")(o,t,r),u=t.noHeaderId?"":' id="'+s(o)+'"',d=i+1,c="<h"+d+u+">"+a+"</h"+d+">";return n.subParser("hashBlock")(c,t,r)});var u=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function s(e){var i,o;if(t.customizedHeaderId){var a=e.match(/\{([^{]+?)}\s*$/);a&&a[1]&&(e=a[1])}return i=e,o=n.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(i=o+i),i=t.ghCompatibleHeaderId?i.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?i.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"\xa8").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():i.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(i=o+i),r.hashLinkCounts[i]?i=i+"-"+r.hashLinkCounts[i]++:r.hashLinkCounts[i]=1,i}return e=e.replace(u,function(e,o,a){var u=a;t.customizedHeaderId&&(u=a.replace(/\s?\{([^{]+?)}\s*$/,""));var d=n.subParser("spanGamut")(u,t,r),c=t.noHeaderId?"":' id="'+s(a)+'"',l=i-1+o.length,p="<h"+l+c+">"+d+"</h"+l+">";return n.subParser("hashBlock")(p,t,r)}),e=r.converter._dispatch("headers.after",e,t,r)}),n.subParser("horizontalRule",function(e,t,r){"use strict";e=r.converter._dispatch("horizontalRule.before",e,t,r);var i=n.subParser("hashBlock")("<hr />",t,r);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,i)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,i)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,i),e=r.converter._dispatch("horizontalRule.after",e,t,r)}),n.subParser("images",function(e,t,r){"use strict";function i(e,t,i,o,a,u,s,d){var c=r.gUrls,l=r.gTitles,p=r.gDimensions;if(i=i.toLowerCase(),d||(d=""),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)o="";else if(""===o||null===o){if((""===i||null===i)&&(i=t.toLowerCase().replace(/ ?\n/g," ")),o="#"+i,n.helper.isUndefined(c[i]))return e;o=c[i],n.helper.isUndefined(l[i])||(d=l[i]),n.helper.isUndefined(p[i])||(a=p[i].width,u=p[i].height)}t=t.replace(/"/g,""").replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback);var f='<img src="'+(o=o.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback))+'" alt="'+t+'"';return d&&n.helper.isString(d)&&(f+=' title="'+(d=d.replace(/"/g,""").replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback))+'"'),a&&u&&(f+=' width="'+(a="*"===a?"auto":a)+'"'+(' height="'+(u="*"===u?"auto":u))+'"'),f+=" />"}return e=(e=(e=(e=(e=(e=r.converter._dispatch("images.before",e,t,r)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,i)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,function(e,t,n,r,o,a,u,s){return i(e,t,n,r=r.replace(/\s/g,""),o,a,u,s)})).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,i)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,i)).replace(/!\[([^\[\]]+)]()()()()()/g,i),e=r.converter._dispatch("images.after",e,t,r)}),n.subParser("italicsAndBold",function(e,t,n){return e=n.converter._dispatch("italicsAndBold.before",e,t,n),e=t.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,t){return"<strong><em>"+t+"</em></strong>"})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,t){return"<strong>"+t+"</strong>"})).replace(/\b_(\S[\s\S]*?)_\b/g,function(e,t){return"<em>"+t+"</em>"}):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,t){return/\S$/.test(t)?"<strong><em>"+t+"</em></strong>":e})).replace(/__(\S[\s\S]*?)__/g,function(e,t){return/\S$/.test(t)?"<strong>"+t+"</strong>":e})).replace(/_([^\s_][\s\S]*?)_/g,function(e,t){return/\S$/.test(t)?"<em>"+t+"</em>":e}),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(e,t,n){return t+"<strong><em>"+n+"</em></strong>"})).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(e,t,n){return t+"<strong>"+n+"</strong>"})).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(e,t,n){return t+"<em>"+n+"</em>"}):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(e,t){return/\S$/.test(t)?"<strong><em>"+t+"</em></strong>":e})).replace(/\*\*(\S[\s\S]*?)\*\*/g,function(e,t){return/\S$/.test(t)?"<strong>"+t+"</strong>":e})).replace(/\*([^\s*][\s\S]*?)\*/g,function(e,t){return/\S$/.test(t)?"<em>"+t+"</em>":e}),e=n.converter._dispatch("italicsAndBold.after",e,t,n)}),n.subParser("lists",function(e,t,r){"use strict";function i(e,i){r.gListLevel++,e=e.replace(/\n{2,}$/,"\n")+"\xa80";var o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,a=/\n[ \t]*\n(?!¨0)/.test(e);return t.disableForced4SpacesIndentedSublists&&(o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(o,function(e,i,o,u,s,d,c){c=c&&""!==c.trim();var l=n.subParser("outdent")(s,t,r),p="";return d&&t.tasklists&&(p=' class="task-list-item" style="list-style-type: none;"',l=l.replace(/^[ \t]*\[(x|X| )?]/m,function(){var e='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return c&&(e+=" checked"),e+=">"})),l=l.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,function(e){return"\xa8A"+e}),i||l.search(/\n{2,}/)>-1?(l=n.subParser("githubCodeBlocks")(l,t,r),l=n.subParser("blockGamut")(l,t,r)):(l=(l=n.subParser("lists")(l,t,r)).replace(/\n$/,""),l=(l=n.subParser("hashHTMLBlocks")(l,t,r)).replace(/\n\n+/g,"\n\n"),l=a?n.subParser("paragraphs")(l,t,r):n.subParser("spanGamut")(l,t,r)),l="<li"+p+">"+(l=l.replace("\xa8A",""))+"</li>\n"})).replace(/¨0/g,""),r.gListLevel--,i&&(e=e.replace(/\s+$/,"")),e}function o(e,t){if("ol"===t){var n=e.match(/^ *(\d+)\./);if(n&&"1"!==n[1])return' start="'+n[1]+'"'}return""}function a(e,n,r){var a=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,u=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,s="ul"===n?a:u,d="";if(-1!==e.search(s))!function t(c){var l=c.search(s),p=o(e,n);-1!==l?(d+="\n\n<"+n+p+">\n"+i(c.slice(0,l),!!r)+"</"+n+">\n",s="ul"==(n="ul"===n?"ol":"ul")?a:u,t(c.slice(l))):d+="\n\n<"+n+p+">\n"+i(c,!!r)+"</"+n+">\n"}(e);else{var c=o(e,n);d="\n\n<"+n+c+">\n"+i(e,!!r)+"</"+n+">\n"}return d}return e=r.converter._dispatch("lists.before",e,t,r)+"\xa80",e=(e=r.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(e,t,n){return a(t,n.search(/[*+-]/g)>-1?"ul":"ol",!0)}):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(e,t,n,r){return a(n,r.search(/[*+-]/g)>-1?"ul":"ol",!1)})).replace(/¨0/,""),e=r.converter._dispatch("lists.after",e,t,r)}),n.subParser("metadata",function(e,t,n){"use strict";if(!t.metadata)return e;function r(e){n.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,function(e,t,r){return n.metadata.parsed[t]=r,""})}return e=(e=(e=(e=n.converter._dispatch("metadata.before",e,t,n)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(e,t,n){return r(n),"\xa8M"})).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(e,t,i){return t&&(n.metadata.format=t),r(i),"\xa8M"})).replace(/¨M/g,""),e=n.converter._dispatch("metadata.after",e,t,n)}),n.subParser("outdent",function(e,t,n){return e=(e=(e=n.converter._dispatch("outdent.before",e,t,n)).replace(/^(\t|[ ]{1,4})/gm,"\xa80")).replace(/¨0/g,""),e=n.converter._dispatch("outdent.after",e,t,n)}),n.subParser("paragraphs",function(e,t,r){"use strict";for(var i=(e=(e=(e=r.converter._dispatch("paragraphs.before",e,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),o=[],a=i.length,u=0;u<a;u++){var s=i[u];s.search(/¨(K|G)(\d+)\1/g)>=0?o.push(s):s.search(/\S/)>=0&&(s=(s=n.subParser("spanGamut")(s,t,r)).replace(/^([ \t]*)/g,"<p>")+"</p>",o.push(s))}for(u=0,a=o.length;u<a;u++){for(var d="",c=o[u],l=!1;/¨(K|G)(\d+)\1/.test(c);){var p=RegExp.$2;d=(d="K"===RegExp.$1?r.gHtmlBlocks[p]:l?n.subParser("encodeCode")(r.ghCodeBlocks[p].text,t,r):r.ghCodeBlocks[p].codeblock).replace(/\$/g,"$$$$"),c=c.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,d),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(c)&&(l=!0)}o[u]=c}return e=(e=(e=o.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),r.converter._dispatch("paragraphs.after",e,t,r)}),n.subParser("runExtension",function(e,t,n,r){"use strict";if(e.filter)t=e.filter(t,r.converter,n);else if(e.regex){var i=e.regex;i instanceof RegExp||(i=RegExp(i,"g")),t=t.replace(i,e.replace)}return t}),n.subParser("spanGamut",function(e,t,r){return e=r.converter._dispatch("spanGamut.before",e,t,r),e=n.subParser("codeSpans")(e,t,r),e=n.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,r),e=n.subParser("encodeBackslashEscapes")(e,t,r),e=n.subParser("images")(e,t,r),e=n.subParser("anchors")(e,t,r),e=n.subParser("autoLinks")(e,t,r),e=n.subParser("simplifiedAutoLinks")(e,t,r),e=n.subParser("emoji")(e,t,r),e=n.subParser("underline")(e,t,r),e=n.subParser("italicsAndBold")(e,t,r),e=n.subParser("strikethrough")(e,t,r),e=n.subParser("ellipsis")(e,t,r),e=n.subParser("hashHTMLSpans")(e,t,r),e=n.subParser("encodeAmpsAndAngles")(e,t,r),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"<br />\n")):e=e.replace(/ +\n/g,"<br />\n"),e=r.converter._dispatch("spanGamut.after",e,t,r)}),n.subParser("strikethrough",function(e,t,r){return t.strikethrough&&(e=(e=r.converter._dispatch("strikethrough.before",e,t,r)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(e,i){var o;return o=i,t.simplifiedAutoLink&&(o=n.subParser("simplifiedAutoLinks")(o,t,r)),"<del>"+o+"</del>"}),e=r.converter._dispatch("strikethrough.after",e,t,r)),e}),n.subParser("stripLinkDefinitions",function(e,t,r){"use strict";e+="\xa80";var i=function(i,o,a,u,s,d,c){return(o=o.toLowerCase(),e.toLowerCase().split(o).length-1<2)?i:(a.match(/^data:.+?\/.+?;base64,/)?r.gUrls[o]=a.replace(/\s/g,""):r.gUrls[o]=n.subParser("encodeAmpsAndAngles")(a,t,r),d)?d+c:(c&&(r.gTitles[o]=c.replace(/"|'/g,""")),t.parseImgDimensions&&u&&s&&(r.gDimensions[o]={width:u,height:s}),"")};return e=(e=(e=e.replace(/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,i)).replace(/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,i)).replace(/¨0/,"")}),n.subParser("tables",function(e,t,r){"use strict";if(!t.tables)return e;function i(e){var i,o=e.split("\n");for(i=0;i<o.length;++i)/^ {0,3}\|/.test(o[i])&&(o[i]=o[i].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(o[i])&&(o[i]=o[i].replace(/\|[ \t]*$/,"")),o[i]=n.subParser("codeSpans")(o[i],t,r);var a=o[0].split("|").map(function(e){return e.trim()}),u=o[1].split("|").map(function(e){return e.trim()}),s=[],d=[],c=[],l=[];for(o.shift(),o.shift(),i=0;i<o.length;++i)""!==o[i].trim()&&s.push(o[i].split("|").map(function(e){return e.trim()}));if(a.length<u.length)return e;for(i=0;i<u.length;++i){c.push((p=u[i],/^:[ \t]*--*$/.test(p)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(p)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(p)?' style="text-align:center;"':""))}for(i=0;i<a.length;++i)n.helper.isUndefined(c[i])&&(c[i]=""),d.push(function(e,i){var o="";return e=e.trim(),(t.tablesHeaderId||t.tableHeaderId)&&(o=' id="'+e.replace(/ /g,"_").toLowerCase()+'"'),"<th"+o+i+">"+(e=n.subParser("spanGamut")(e,t,r))+"</th>\n"}(a[i],c[i]));for(i=0;i<s.length;++i){for(var p,f,h=[],m=0;m<d.length;++m)n.helper.isUndefined(s[i][m]),h.push((f=s[i][m],"<td"+c[m]+">"+n.subParser("spanGamut")(f,t,r)+"</td>\n"));l.push(h)}for(var _="<table>\n<thead>\n<tr>\n",g=d.length,b=0;b<g;++b)_+=d[b];for(_+="</tr>\n</thead>\n<tbody>\n",b=0;b<l.length;++b){_+="<tr>\n";for(var y=0;y<g;++y)_+=l[b][y];_+="</tr>\n"}return _+"</tbody>\n</table>\n"}return e=(e=(e=(e=r.converter._dispatch("tables.before",e,t,r)).replace(/\\(\|)/g,n.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,i)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,i),e=r.converter._dispatch("tables.after",e,t,r)}),n.subParser("underline",function(e,t,r){return t.underline?(e=r.converter._dispatch("underline.before",e,t,r),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,t){return"<u>"+t+"</u>"})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,t){return"<u>"+t+"</u>"}):(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e})).replace(/__(\S[\s\S]*?)__/g,function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e})).replace(/(_)/g,n.helper.escapeCharactersCallback),e=r.converter._dispatch("underline.after",e,t,r)):e}),n.subParser("unescapeSpecialChars",function(e,t,n){return e=(e=n.converter._dispatch("unescapeSpecialChars.before",e,t,n)).replace(/¨E(\d+)E/g,function(e,t){return String.fromCharCode(parseInt(t))}),e=n.converter._dispatch("unescapeSpecialChars.after",e,t,n)}),n.subParser("makeMarkdown.blockquote",function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var i=e.childNodes,o=i.length,a=0;a<o;++a){var u=n.subParser("makeMarkdown.node")(i[a],t);""!==u&&(r+=u)}return"> "+(r=r.trim()).split("\n").join("\n> ")}),n.subParser("makeMarkdown.codeBlock",function(e,t){"use strict";var n=e.getAttribute("language"),r=e.getAttribute("precodenum");return"```"+n+"\n"+t.preList[r]+"\n```"}),n.subParser("makeMarkdown.codeSpan",function(e){return"`"+e.innerHTML+"`"}),n.subParser("makeMarkdown.emphasis",function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="*";for(var i=e.childNodes,o=i.length,a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t);r+="*"}return r}),n.subParser("makeMarkdown.header",function(e,t,r){"use strict";var i=Array(r+1).join("#"),o="";if(e.hasChildNodes()){o=i+" ";for(var a=e.childNodes,u=a.length,s=0;s<u;++s)o+=n.subParser("makeMarkdown.node")(a[s],t)}return o}),n.subParser("makeMarkdown.hr",function(){return"---"}),n.subParser("makeMarkdown.image",function(e){"use strict";var t="";return e.hasAttribute("src")&&(t+=")+">",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t}),n.subParser("makeMarkdown.links",function(e,t){"use strict";var r="";if(e.hasChildNodes()&&e.hasAttribute("href")){var i=e.childNodes,o=i.length;r="[";for(var a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t);r+="](",r+="<"+e.getAttribute("href")+">",e.hasAttribute("title")&&(r+=' "'+e.getAttribute("title")+'"'),r+=")"}return r}),n.subParser("makeMarkdown.list",function(e,t,r){"use strict";var i="";if(!e.hasChildNodes())return"";for(var o=e.childNodes,a=o.length,u=e.getAttribute("start")||1,s=0;s<a;++s)void 0!==o[s].tagName&&"li"===o[s].tagName.toLowerCase()&&(i+=("ol"===r?u.toString()+". ":"- ")+n.subParser("makeMarkdown.listItem")(o[s],t),++u);return(i+="\n\x3c!-- --\x3e\n").trim()}),n.subParser("makeMarkdown.listItem",function(e,t){"use strict";for(var r="",i=e.childNodes,o=i.length,a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t);return/\n$/.test(r)?r=r.split("\n").join("\n ").replace(/^ {4}$/gm,"").replace(/\n\n+/g,"\n\n"):r+="\n",r}),n.subParser("makeMarkdown.node",function(e,t,r){"use strict";r=r||!1;var i="";if(3===e.nodeType)return n.subParser("makeMarkdown.txt")(e,t);if(8===e.nodeType)return"\x3c!--"+e.data+"--\x3e\n\n";if(1!==e.nodeType)return"";switch(e.tagName.toLowerCase()){case"h1":r||(i=n.subParser("makeMarkdown.header")(e,t,1)+"\n\n");break;case"h2":r||(i=n.subParser("makeMarkdown.header")(e,t,2)+"\n\n");break;case"h3":r||(i=n.subParser("makeMarkdown.header")(e,t,3)+"\n\n");break;case"h4":r||(i=n.subParser("makeMarkdown.header")(e,t,4)+"\n\n");break;case"h5":r||(i=n.subParser("makeMarkdown.header")(e,t,5)+"\n\n");break;case"h6":r||(i=n.subParser("makeMarkdown.header")(e,t,6)+"\n\n");break;case"p":r||(i=n.subParser("makeMarkdown.paragraph")(e,t)+"\n\n");break;case"blockquote":r||(i=n.subParser("makeMarkdown.blockquote")(e,t)+"\n\n");break;case"hr":r||(i=n.subParser("makeMarkdown.hr")(e,t)+"\n\n");break;case"ol":r||(i=n.subParser("makeMarkdown.list")(e,t,"ol")+"\n\n");break;case"ul":r||(i=n.subParser("makeMarkdown.list")(e,t,"ul")+"\n\n");break;case"precode":r||(i=n.subParser("makeMarkdown.codeBlock")(e,t)+"\n\n");break;case"pre":r||(i=n.subParser("makeMarkdown.pre")(e,t)+"\n\n");break;case"table":r||(i=n.subParser("makeMarkdown.table")(e,t)+"\n\n");break;case"code":i=n.subParser("makeMarkdown.codeSpan")(e,t);break;case"em":case"i":i=n.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":i=n.subParser("makeMarkdown.strong")(e,t);break;case"del":i=n.subParser("makeMarkdown.strikethrough")(e,t);break;case"a":i=n.subParser("makeMarkdown.links")(e,t);break;case"img":i=n.subParser("makeMarkdown.image")(e,t);break;default:i=e.outerHTML+"\n\n"}return i}),n.subParser("makeMarkdown.paragraph",function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var i=e.childNodes,o=i.length,a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t);return r.trim()}),n.subParser("makeMarkdown.pre",function(e,t){"use strict";var n=e.getAttribute("prenum");return"<pre>"+t.preList[n]+"</pre>"}),n.subParser("makeMarkdown.strikethrough",function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="~~";for(var i=e.childNodes,o=i.length,a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t);r+="~~"}return r}),n.subParser("makeMarkdown.strong",function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="**";for(var i=e.childNodes,o=i.length,a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t);r+="**"}return r}),n.subParser("makeMarkdown.table",function(e,t){"use strict";var r,i,o="",a=[[],[]],u=e.querySelectorAll("thead>tr>th"),s=e.querySelectorAll("tbody>tr");for(r=0;r<u.length;++r){var d=n.subParser("makeMarkdown.tableCell")(u[r],t),c="---";if(u[r].hasAttribute("style"))switch(u[r].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":c=":---";break;case"text-align:right;":c="---:";break;case"text-align:center;":c=":---:"}a[0][r]=d.trim(),a[1][r]=c}for(r=0;r<s.length;++r){var l=a.push([])-1,p=s[r].getElementsByTagName("td");for(i=0;i<u.length;++i){var f=" ";void 0!==p[i]&&(f=n.subParser("makeMarkdown.tableCell")(p[i],t)),a[l].push(f)}}var h=3;for(r=0;r<a.length;++r)for(i=0;i<a[r].length;++i){var m=a[r][i].length;m>h&&(h=m)}for(r=0;r<a.length;++r){for(i=0;i<a[r].length;++i)1===r?":"===a[r][i].slice(-1)?a[r][i]=n.helper.padEnd(a[r][i].slice(-1),h-1,"-")+":":a[r][i]=n.helper.padEnd(a[r][i],h,"-"):a[r][i]=n.helper.padEnd(a[r][i],h);o+="| "+a[r].join(" | ")+" |\n"}return o.trim()}),n.subParser("makeMarkdown.tableCell",function(e,t){"use strict";var r="";if(!e.hasChildNodes())return"";for(var i=e.childNodes,o=i.length,a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t,!0);return r.trim()}),n.subParser("makeMarkdown.txt",function(e){"use strict";var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),t=(t=(t=(t=(t=(t=(t=(t=(t=n.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}),"function"==typeof define&&define.amd?define(function(){return n}):e.exports?e.exports=n:this.showdown=n}).call(this)},react:function(t){"use strict";t.exports=e}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}};return t[e].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";let e,t,n,o,a,u,s,d,c,l,p;r.r(i),r.d(i,{useMjEngine:()=>rS,Thread:()=>nI,MujianSpinner:()=>nr,useChat:()=>lQ,useMujian:()=>nu,MujianProvider:()=>na,MdRenderer:()=>tI,useChatContext:()=>ns});var f,h,m,_,g,b,y,v,w,k,z,S,E,A={};r.r(A),r.d(A,{base64:()=>oC,base64url:()=>oN,bigint:()=>oV,boolean:()=>oq,browserEmail:()=>oT,cidrv4:()=>o$,cidrv6:()=>oM,cuid:()=>oc,cuid2:()=>ol,date:()=>oU,datetime:()=>oJ,domain:()=>oL,duration:()=>o_,e164:()=>oZ,email:()=>oz,emoji:()=>oj,extendedDuration:()=>og,guid:()=>ob,hex:()=>o0,hostname:()=>oR,html5Email:()=>oS,idnEmail:()=>ox,integer:()=>oG,ipv4:()=>oO,ipv6:()=>oP,ksuid:()=>oh,lowercase:()=>oY,mac:()=>oI,md5_base64:()=>o2,md5_base64url:()=>o6,md5_hex:()=>o1,nanoid:()=>om,null:()=>oK,number:()=>oW,rfc5322Email:()=>oE,sha1_base64:()=>o9,sha1_base64url:()=>o5,sha1_hex:()=>o4,sha256_base64:()=>ae,sha256_base64url:()=>at,sha256_hex:()=>o7,sha384_base64:()=>ar,sha384_base64url:()=>ai,sha384_hex:()=>an,sha512_base64:()=>aa,sha512_base64url:()=>au,sha512_hex:()=>ao,string:()=>oB,time:()=>oH,ulid:()=>op,undefined:()=>oX,unicodeEmail:()=>oA,uppercase:()=>oQ,uuid:()=>oy,uuid4:()=>ov,uuid6:()=>ow,uuid7:()=>ok,xid:()=>of});var x={};r.r(x),r.d(x,{endsWith:()=>sU,gt:()=>sz,gte:()=>sS,includes:()=>sZ,length:()=>sC,lowercase:()=>sR,lt:()=>sw,lte:()=>sk,maxLength:()=>s$,maxSize:()=>sO,mime:()=>sH,minLength:()=>sM,minSize:()=>sP,multipleOf:()=>sj,negative:()=>sA,nonnegative:()=>sT,nonpositive:()=>sx,normalize:()=>sB,overwrite:()=>sJ,positive:()=>sE,property:()=>sF,regex:()=>sN,size:()=>sI,slugify:()=>sq,startsWith:()=>sD,toLowerCase:()=>sG,toUpperCase:()=>sW,trim:()=>sV,uppercase:()=>sL});var T={};r.r(T),r.d(T,{ZodISODate:()=>s9,ZodISODateTime:()=>s6,ZodISODuration:()=>dt,ZodISOTime:()=>s7,date:()=>s5,datetime:()=>s4,duration:()=>dn,time:()=>de});var j={};r.r(j),r.d(j,{ZodAny:()=>cj,ZodArray:()=>cZ,ZodBase64:()=>d6,ZodBase64URL:()=>d9,ZodBigInt:()=>cb,ZodBigIntFormat:()=>cv,ZodBoolean:()=>c_,ZodCIDRv4:()=>d3,ZodCIDRv6:()=>d1,ZodCUID:()=>dZ,ZodCUID2:()=>dU,ZodCatch:()=>lS,ZodCodec:()=>lO,ZodCustom:()=>lF,ZodCustomStringFormat:()=>cr,ZodDate:()=>cR,ZodDefault:()=>l_,ZodDiscriminatedUnion:()=>cK,ZodE164:()=>d7,ZodEmail:()=>dz,ZodEmoji:()=>dC,ZodEnum:()=>le,ZodExactOptional:()=>ll,ZodFile:()=>lo,ZodFunction:()=>lD,ZodGUID:()=>dE,ZodIPv4:()=>dq,ZodIPv6:()=>dQ,ZodIntersection:()=>cY,ZodJWT:()=>ct,ZodKSUID:()=>dG,ZodLazy:()=>lN,ZodLiteral:()=>lr,ZodMAC:()=>dX,ZodMap:()=>c4,ZodNaN:()=>lA,ZodNanoID:()=>dR,ZodNever:()=>c$,ZodNonOptional:()=>lv,ZodNull:()=>cx,ZodNullable:()=>lf,ZodNumber:()=>cs,ZodNumberFormat:()=>cc,ZodObject:()=>cF,ZodOptional:()=>ld,ZodPipe:()=>lT,ZodPrefault:()=>lb,ZodPromise:()=>lL,ZodReadonly:()=>lI,ZodRecord:()=>c8,ZodSet:()=>c5,ZodString:()=>dv,ZodStringFormat:()=>dk,ZodSuccess:()=>lk,ZodSymbol:()=>cz,ZodTemplateLiteral:()=>lM,ZodTransform:()=>lu,ZodTuple:()=>c0,ZodType:()=>db,ZodULID:()=>dH,ZodURL:()=>dI,ZodUUID:()=>dx,ZodUndefined:()=>cE,ZodUnion:()=>cV,ZodUnknown:()=>cP,ZodVoid:()=>cC,ZodXID:()=>dB,ZodXor:()=>cW,_ZodString:()=>dy,_default:()=>lg,_function:()=>lU,any:()=>cO,array:()=>cD,base64:()=>d4,base64url:()=>d5,bigint:()=>cy,boolean:()=>cg,catch:()=>lE,check:()=>lH,cidrv4:()=>d8,cidrv6:()=>d2,codec:()=>lP,cuid:()=>dD,cuid2:()=>dF,custom:()=>lJ,date:()=>cL,describe:()=>lG,discriminatedUnion:()=>cX,e164:()=>ce,email:()=>dS,emoji:()=>dN,enum:()=>lt,exactOptional:()=>lp,file:()=>la,float32:()=>cp,float64:()=>cf,function:()=>lU,guid:()=>dA,hash:()=>cu,hex:()=>ca,hostname:()=>co,httpUrl:()=>dM,instanceof:()=>lq,int:()=>cl,int32:()=>ch,int64:()=>cw,intersection:()=>cQ,ipv4:()=>dK,ipv6:()=>d0,json:()=>lX,jwt:()=>cn,keyof:()=>cU,ksuid:()=>dW,lazy:()=>lR,literal:()=>li,looseObject:()=>cB,looseRecord:()=>c6,mac:()=>dY,map:()=>c9,meta:()=>lW,nan:()=>lx,nanoid:()=>dL,nativeEnum:()=>ln,never:()=>cM,nonoptional:()=>lw,null:()=>cT,nullable:()=>lh,nullish:()=>lm,number:()=>cd,object:()=>cH,optional:()=>lc,partialRecord:()=>c2,pipe:()=>lj,prefault:()=>ly,preprocess:()=>lY,promise:()=>lZ,readonly:()=>l$,record:()=>c1,refine:()=>lB,set:()=>c7,strictObject:()=>cJ,string:()=>dw,stringFormat:()=>ci,stringbool:()=>lK,success:()=>lz,superRefine:()=>lV,symbol:()=>cS,templateLiteral:()=>lC,transform:()=>ls,tuple:()=>c3,uint32:()=>cm,uint64:()=>ck,ulid:()=>dJ,undefined:()=>cA,union:()=>cG,unknown:()=>cI,url:()=>d$,uuid:()=>dT,uuidv4:()=>dj,uuidv6:()=>dO,uuidv7:()=>dP,void:()=>cN,xid:()=>dV,xor:()=>cq});var O=function(){return(O=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function P(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function I(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function u(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,u)}s((r=r.apply(e,t||[])).next())})}function $(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(s){var d=[u,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,d[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&d[0]?r.return:d[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,d[1])).done)return i;switch(r=0,i&&(d=[2&d[0],i.value]),d[0]){case 0:case 1:i=d;break;case 4:return o.label++,{value:d[1],done:!1};case 5:o.label++,r=d[1],d=[0];continue;case 7:d=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===d[0]||2===d[0])){o=0;continue}if(3===d[0]&&(!i||d[1]>i[0]&&d[1]<i[3])){o.label=d[1];break}if(6===d[0]&&o.label<i[1]){o.label=i[1],i=d;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(d);break}i[2]&&o.ops.pop(),o.trys.pop();continue}d=t.call(e,o)}catch(e){d=[6,e],r=0}finally{n=i=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}}function M(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function C(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var N=r("react"),R=r.n(N);let L=function(e){var t=(0,N.useRef)(e);return t.current=e,t};var Z=function(e){return"function"==typeof e},D=!!("undefined"!=typeof window&&window.document&&window.document.createElement);function U(e,t){if(D)return e?Z(e)?e():"current"in e?e.current:e:t}let F=function(e){var t=L(e);(0,N.useEffect)(function(){return function(){t.current()}},[])},H=function(e,t){if(e===t)return!0;for(var n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0};var J=(h=N.useEffect,function(e,t,n){var r=(0,N.useRef)(!1),i=(0,N.useRef)([]),o=(0,N.useRef)([]),a=(0,N.useRef)(void 0);h(function(){var u,s=(Array.isArray(n)?n:[n]).map(function(e){return U(e)});if(!r.current){r.current=!0,i.current=s,o.current=t,a.current=e();return}s.length===i.current.length&&H(i.current,s)&&H(o.current,t)||(null==(u=a.current)||u.call(a),i.current=s,o.current=t,a.current=e())}),F(function(){var e;null==(e=a.current)||e.call(a),r.current=!1})});let B=function(e,t,n){void 0===n&&(n={});var r=n.enable,i=void 0===r||r,o=L(t);J(function(){if(i){var t=U(n.target,window);if(null==t?void 0:t.addEventListener){var r=function(e){return o.current(e)},a=Array.isArray(e)?e:[e];return a.forEach(function(e){t.addEventListener(e,r,{capture:n.capture,once:n.once,passive:n.passive})}),function(){a.forEach(function(e){t.removeEventListener(e,r,{capture:n.capture})})}}}},[e,n.capture,n.once,n.passive,i],n.target)},V=function(e){var t=(0,N.useRef)(e);t.current=(0,N.useMemo)(function(){return e},[e]);var n=(0,N.useRef)(void 0);return n.current||(n.current=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.current.apply(this,e)}),n.current},G=(m=N.useEffect,function(e,t){var n=(0,N.useRef)(!1);m(function(){return function(){n.current=!1}},[]),m(function(){if(n.current)return e();n.current=!0},t)});var W=function(e,t){var n=t.manual,r=t.ready,i=void 0===r||r,o=t.defaultParams,a=void 0===o?[]:o,u=t.refreshDeps,s=t.refreshDepsAction,d=(0,N.useRef)(!1);return d.current=!1,G(function(){!n&&i&&(d.current=!0,e.run.apply(e,C([],M(a),!1)))},[i]),G(function(){!d.current&&(n||(d.current=!0,s?s():e.refresh()))},C([],M(void 0===u?[]:u),!1)),{onBefore:function(){if(!i)return{stopNow:!0}}}};W.onInit=function(e){var t=e.ready;return{loading:!e.manual&&(void 0===t||t)}};let q=function(e,t){var n=(0,N.useRef)({deps:t,obj:void 0,initialized:!1}).current;return!1!==n.initialized&&H(n.deps,t)||(n.deps=t,n.obj=e(),n.initialized=!0),n.obj};var K=new Map,X=function(e,t,n){var r=K.get(e);(null==r?void 0:r.timer)&&clearTimeout(r.timer);var i=void 0;t>-1&&(i=setTimeout(function(){K.delete(e)},t)),K.set(e,O(O({},n),{timer:i}))},Y=new Map,Q=function(e,t){Y.set(e,t),t.then(function(t){return Y.delete(e),t}).catch(function(){Y.delete(e)})},ee={},et=function(e,t){ee[e]&&ee[e].forEach(function(e){return e(t)})},en=function(e,t){return ee[e]||(ee[e]=[]),ee[e].push(t),function(){var n=ee[e].indexOf(t);ee[e].splice(n,1)}};let er=function(e,t){var n=t.cacheKey,r=t.cacheTime,i=void 0===r?3e5:r,o=t.staleTime,a=void 0===o?0:o,u=t.setCache,s=t.getCache,d=(0,N.useRef)(void 0),c=(0,N.useRef)(void 0),l=function(e,t){u?u(t):X(e,i,t),et(e,t.data)},p=function(e,t){return(void 0===t&&(t=[]),s)?s(t):K.get(e)};return(q(function(){if(n){var t=p(n);t&&Object.hasOwnProperty.call(t,"data")&&(e.state.data=t.data,e.state.params=t.params,(-1===a||Date.now()-t.time<=a)&&(e.state.loading=!1)),d.current=en(n,function(t){e.setState({data:t})})}},[]),F(function(){var e;null==(e=d.current)||e.call(d)}),n)?{onBefore:function(e){var t=p(n,e);return t&&Object.hasOwnProperty.call(t,"data")?-1===a||Date.now()-t.time<=a?{loading:!1,data:null==t?void 0:t.data,error:void 0,returnNow:!0}:{data:null==t?void 0:t.data,error:void 0}:{}},onRequest:function(e,t){var r=Y.get(n);return r&&r!==c.current||(c.current=r=e.apply(void 0,C([],M(t),!1)),Q(n,r)),{servicePromise:r}},onSuccess:function(t,r){var i;n&&(null==(i=d.current)||i.call(d),l(n,{data:t,params:r,time:Date.now()}),d.current=en(n,function(t){e.setState({data:t})}))},onMutate:function(t){var r;n&&(null==(r=d.current)||r.call(d),l(n,{data:t,params:e.state.params,time:Date.now()}),d.current=en(n,function(t){e.setState({data:t})}))}}:{}};var ei=r("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/debounce.js"),eo=r.n(ei);let ea=function(e,t){var n=t.debounceWait,r=t.debounceLeading,i=t.debounceTrailing,o=t.debounceMaxWait,a=(0,N.useRef)(void 0),u=(0,N.useMemo)(function(){var e={};return void 0!==r&&(e.leading=r),void 0!==i&&(e.trailing=i),void 0!==o&&(e.maxWait=o),e},[r,i,o]);return((0,N.useEffect)(function(){if(n){var t=e.runAsync.bind(e);return a.current=eo()(function(e){e()},n,u),e.runAsync=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new Promise(function(n,r){var i;null==(i=a.current)||i.call(a,function(){t.apply(void 0,C([],M(e),!1)).then(n).catch(r)})})},function(){var n;null==(n=a.current)||n.cancel(),e.runAsync=t}}},[n,u]),n)?{onCancel:function(){var e;null==(e=a.current)||e.cancel()}}:{}},eu=function(e,t){var n=t.loadingDelay,r=t.ready,i=(0,N.useRef)(void 0);if(!n)return{};var o=function(){i.current&&clearTimeout(i.current)};return{onBefore:function(){return o(),!1!==r&&(i.current=setTimeout(function(){e.setState({loading:!0})},n)),{loading:!1}},onFinally:function(){o()},onCancel:function(){o()}}};function es(){return!D||"hidden"!==document.visibilityState}var ed=new Set;D&&window.addEventListener("visibilitychange",function(){es()&&ed.forEach(function(e){return e()})},!1);let ec=function(e,t){var n=t.pollingInterval,r=t.pollingWhenHidden,i=void 0===r||r,o=t.pollingErrorRetryCount,a=void 0===o?-1:o,u=(0,N.useRef)(void 0),s=(0,N.useRef)(void 0),d=(0,N.useRef)(0),c=function(){var e;u.current&&clearTimeout(u.current),null==(e=s.current)||e.call(s)};return(G(function(){n||c()},[n]),n)?{onBefore:function(){c()},onError:function(){d.current+=1},onSuccess:function(){d.current=0},onFinally:function(){-1===a||-1!==a&&d.current<=a?u.current=setTimeout(function(){if(i||es())e.refresh();else{var t;t=function(){e.refresh()},ed.add(t),s.current=function(){ed.has(t)&&ed.delete(t)}}},n):d.current=0},onCancel:function(){c()}}:{}};var el=new Set;if(D){var ep=function(){es()&&(!D||void 0===navigator.onLine||navigator.onLine)&&el.forEach(function(e){return e()})};window.addEventListener("visibilitychange",ep,!1),window.addEventListener("focus",ep,!1)}let ef=function(e,t){var n=t.refreshOnWindowFocus,r=t.focusTimespan,i=void 0===r?5e3:r,o=(0,N.useRef)(void 0),a=function(){var e;null==(e=o.current)||e.call(o)};return(0,N.useEffect)(function(){if(n){var t,r,u,s=(t=e.refresh.bind(e),r=!1,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,t.apply(void 0,C([],M(e),!1)),setTimeout(function(){r=!1},i))});u=function(){s()},el.add(u),o.current=function(){el.has(u)&&el.delete(u)}}return function(){a()}},[n,i]),F(function(){a()}),{}},eh=function(e,t){var n=t.retryInterval,r=t.retryCount,i=(0,N.useRef)(void 0),o=(0,N.useRef)(0),a=(0,N.useRef)(!1);return r?{onBefore:function(){a.current||(o.current=0),a.current=!1,i.current&&clearTimeout(i.current)},onSuccess:function(){o.current=0},onError:function(){o.current+=1,-1===r||o.current<=r?i.current=setTimeout(function(){a.current=!0,e.refresh()},null!=n?n:Math.min(1e3*Math.pow(2,o.current),3e4)):o.current=0},onCancel:function(){o.current=0,i.current&&clearTimeout(i.current)}}:{}};var em=r("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/throttle.js"),e_=r.n(em);let eg=function(e,t){var n=t.throttleWait,r=t.throttleLeading,i=t.throttleTrailing,o=(0,N.useRef)(void 0),a={};return(void 0!==r&&(a.leading=r),void 0!==i&&(a.trailing=i),(0,N.useEffect)(function(){if(n){var t=e.runAsync.bind(e);return o.current=e_()(function(e){e()},n,a),e.runAsync=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new Promise(function(n,r){var i;null==(i=o.current)||i.call(o,function(){t.apply(void 0,C([],M(e),!1)).then(n).catch(r)})})},function(){var n;e.runAsync=t,null==(n=o.current)||n.cancel()}}},[n,r,i]),n)?{onCancel:function(){var e;null==(e=o.current)||e.cancel()}}:{}},eb=function(e){(0,N.useEffect)(function(){var t=null==e?void 0:e();if(!t||"object"!=typeof t||"function"!=typeof t.then)return t},[])},ey=function(){var e=M((0,N.useState)({}),2)[1];return(0,N.useCallback)(function(){return e({})},[])};var ev=function(){function e(e,t,n,r){void 0===r&&(r={}),this.serviceRef=e,this.options=t,this.subscribe=n,this.initState=r,this.pluginImpls=[],this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=O(O(O({},this.state),{loading:!t.manual}),r)}return e.prototype.setState=function(e){void 0===e&&(e={}),this.state=O(O({},this.state),e),this.subscribe()},e.prototype.runPluginHandler=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.pluginImpls.map(function(n){var r;return null==(r=n[e])?void 0:r.call.apply(r,C([n],M(t),!1))}).filter(Boolean);return Object.assign.apply(Object,C([{}],M(r),!1))},e.prototype.runAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return I(this,void 0,void 0,function(){var t,n,r,i,o,a,u,s,d,c,l,p,f,h,m,_,g,b,y,v,w;return $(this,function(k){switch(k.label){case 0:if(this.count+=1,t=this.count,i=void 0!==(r=(n=this.runPluginHandler("onBefore",e)).stopNow)&&r,a=void 0!==(o=n.returnNow)&&o,u=P(n,["stopNow","returnNow"]),i)return[2,new Promise(function(){})];if(this.setState(O({loading:!0,params:e},u)),a)return[2,Promise.resolve(u.data)];null==(f=(p=this.options).onBefore)||f.call(p,e),k.label=1;case 1:return k.trys.push([1,3,,4]),(s=this.runPluginHandler("onRequest",this.serviceRef.current,e).servicePromise)||(s=(l=this.serviceRef).current.apply(l,C([],M(e),!1))),[4,s];case 2:if(d=k.sent(),t!==this.count)return[2,new Promise(function(){})];return this.setState({data:d,error:void 0,loading:!1}),null==(m=(h=this.options).onSuccess)||m.call(h,d,e),this.runPluginHandler("onSuccess",d,e),null==(g=(_=this.options).onFinally)||g.call(_,e,d,void 0),t===this.count&&this.runPluginHandler("onFinally",e,d,void 0),[2,d];case 3:if(c=k.sent(),t!==this.count)return[2,new Promise(function(){})];throw this.setState({error:c,loading:!1}),null==(y=(b=this.options).onError)||y.call(b,c,e),this.runPluginHandler("onError",c,e),null==(w=(v=this.options).onFinally)||w.call(v,e,void 0,c),t===this.count&&this.runPluginHandler("onFinally",e,void 0,c),c;case 4:return[2]}})})},e.prototype.run=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.runAsync.apply(this,C([],M(t),!1)).catch(function(t){e.options.onError||console.error(t)})},e.prototype.cancel=function(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")},e.prototype.refresh=function(){this.run.apply(this,C([],M(this.state.params||[]),!1))},e.prototype.refreshAsync=function(){return this.runAsync.apply(this,C([],M(this.state.params||[]),!1))},e.prototype.mutate=function(e){var t=Z(e)?e(this.state.data):e;this.runPluginHandler("onMutate",t),this.setState({data:t})},e}();let ew=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n=[]);var r=t.manual,i=void 0!==r&&r,o=t.ready,a=void 0===o||o,u=P(t,["manual","ready"]),s=O({manual:i,ready:a},u),d=L(e),c=ey(),l=q(function(){var e=n.map(function(e){var t;return null==(t=null==e?void 0:e.onInit)?void 0:t.call(e,s)}).filter(Boolean);return new ev(d,s,c,Object.assign.apply(Object,C([{}],M(e),!1)))},[]);return l.options=s,l.pluginImpls=n.map(function(e){return e(l,s)}),eb(function(){if(!i&&a){var e=l.state.params||t.defaultParams||[];l.run.apply(l,C([],M(e),!1))}}),F(function(){l.cancel()}),{loading:l.state.loading,data:l.state.data,error:l.state.error,params:l.state.params||[],cancel:V(l.cancel.bind(l)),refresh:V(l.refresh.bind(l)),refreshAsync:V(l.refreshAsync.bind(l)),run:V(l.run.bind(l)),runAsync:V(l.runAsync.bind(l)),mutate:V(l.mutate.bind(l))}},ek=function(e,t,n){return ew(e,t,C(C([],M(n||[]),!1),[ea,eu,ec,ef,eg,W,er,eh],!1))};var ez=function(e){return e.scrollHeight||Math.max(document.documentElement.scrollHeight,document.body.scrollHeight)};let eS=function(e,t){void 0===t&&(t={});var n=t.target,r=t.isNoMore,i=t.threshold,o=void 0===i?100:i,a=t.direction,u=t.reloadDeps,s=t.manual,d=t.onBefore,c=t.onSuccess,l=t.onError,p=t.onFinally,f=M((0,N.useState)(),2),h=f[0],m=f[1],_=M((0,N.useState)(!1),2),g=_[0],b=_[1],y="top"===(void 0===a?"bottom":a),v=(0,N.useRef)(void 0),w=(0,N.useRef)(0),k=(0,N.useMemo)(function(){return!!r&&r(h)},[h]),z=ek(function(t){return I(void 0,void 0,void 0,function(){return $(this,function(n){switch(n.label){case 0:return[4,e(t)];case 1:return[2,{currentData:n.sent(),lastData:t}]}})})},{manual:s,onFinally:function(e,t,n){b(!1),null==p||p(null==t?void 0:t.currentData,n)},onBefore:function(){return null==d?void 0:d()},onSuccess:function(e){var t,r,i;e.lastData?m(O(O({},e.currentData),{list:y?C(C([],M(e.currentData.list),!1),M(null!=(r=e.lastData.list)?r:[]),!1):C(C([],M(null!=(i=e.lastData.list)?i:[]),!1),M(e.currentData.list),!1)})):m(O(O({},e.currentData),{list:C([],M(null!=(t=e.currentData.list)?t:[]),!1)})),setTimeout(function(){if(y){var e=U(n);if(e=e===document?document.documentElement:e){var t=ez(e);e.scrollTo(0,t-w.current)}}else L()}),null==c||c(e.currentData)},onError:function(e){return null==l?void 0:l(e)}}),S=z.loading,E=z.error,A=z.run,x=z.runAsync,T=z.cancel,j=V(function(){k||(b(!0),A(h))}),P=function(e){return I(void 0,void 0,void 0,function(){return $(this,function(t){switch(t.label){case 0:return[4,x(e)];case 1:return[2,t.sent().currentData]}})})},R=V(function(){return k?Promise.reject():(b(!0),P(h))}),L=function(){var e=U(n);if(e){var t=e===document?document.documentElement:e,r=t===document||t===document.documentElement||t===document.body?Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop):t.scrollTop,i=ez(t),a=t.clientHeight||Math.max(document.documentElement.clientHeight,document.body.clientHeight);y?(void 0!==v.current&&v.current>r&&r<=o&&j(),v.current=r,w.current=i-r):i-r<=a+o&&j()}};return B("scroll",function(){S||g||L()},{target:n}),G(function(){A()},C([],M(void 0===u?[]:u),!1)),{data:h,loading:!g&&S,error:E,loadingMore:g,noMore:k,loadMore:j,loadMoreAsync:R,reload:V(function(){return b(!1),A()}),reloadAsync:V(function(){return b(!1),P()}),mutate:m,cancel:T}};var eE=r("../../common/temp/node_modules/.pnpm/react@19.1.5/node_modules/react/jsx-runtime.js");let eA=`
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define(["React"],t):"object"==typeof exports?exports.MujianUMD=t(require("React")):e.MujianUMD=t(e.React)}(globalThis,e=>(()=>{var t={"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_Symbol.js":function(e,t,n){e.exports=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_root.js").Symbol},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseGetTag.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_Symbol.js"),i=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_getRawTag.js"),o=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_objectToString.js"),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseTrim.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_trimmedEndIndex.js"),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_freeGlobal.js":function(e,t,n){e.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_getRawTag.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_Symbol.js"),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[u]=n:delete e[u]),i}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_objectToString.js":function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_root.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_freeGlobal.js"),i="object"==typeof self&&self&&self.Object===Object&&self;e.exports=r||i||Function("return this")()},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_trimmedEndIndex.js":function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/debounce.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObject.js"),i=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/now.js"),o=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/toNumber.js"),a=Math.max,u=Math.min;e.exports=function(e,t,n){var s,d,c,l,p,f,h=0,m=!1,_=!1,g=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var n=s,r=d;return s=d=void 0,h=t,l=e.apply(r,n)}function y(e){var n=e-f,r=e-h;return void 0===f||n>=t||n<0||_&&r>=c}function v(){var e,n,r,o=i();if(y(o))return w(o);p=setTimeout(v,(e=o-f,n=o-h,r=t-e,_?u(r,c-n):r))}function w(e){return(p=void 0,g&&s)?b(e):(s=d=void 0,l)}function k(){var e,n=i(),r=y(n);if(s=arguments,d=this,f=n,r){if(void 0===p)return h=e=f,p=setTimeout(v,t),m?b(e):l;if(_)return clearTimeout(p),p=setTimeout(v,t),b(f)}return void 0===p&&(p=setTimeout(v,t)),l}return t=o(t)||0,r(n)&&(m=!!n.leading,c=(_="maxWait"in n)?a(o(n.maxWait)||0,t):c,g="trailing"in n?!!n.trailing:g),k.cancel=function(){void 0!==p&&clearTimeout(p),h=0,s=f=d=p=void 0},k.flush=function(){return void 0===p?l:w(i())},k}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObject.js":function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObjectLike.js":function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isSymbol.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseGetTag.js"),i=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObjectLike.js");e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/now.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_root.js");e.exports=function(){return r.Date.now()}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/throttle.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/debounce.js"),i=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObject.js");e.exports=function(e,t,n){var o=!0,a=!0;if("function"!=typeof e)throw TypeError("Expected a function");return i(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),r(e,t,{leading:o,maxWait:t,trailing:a})}},"../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/toNumber.js":function(e,t,n){var r=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseTrim.js"),i=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isObject.js"),o=n("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isSymbol.js"),a=0/0,u=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,d=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return a;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=s.test(e);return n||d.test(e)?c(e.slice(2),n?2:8):u.test(e)?a:+e}},"../../common/temp/node_modules/.pnpm/react-dom@19.1.5_react@19.1.5/node_modules/react-dom/cjs/react-dom.production.js":function(e,t,n){"use strict";var r=n("react");function i(){}var o={d:{f:i,r:function(){throw Error(function(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0},a=(Symbol.for("react.portal"),r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE);t.flushSync=function(e){var t=a.T,n=o.p;try{if(a.T=null,o.p=2,e)return e()}finally{a.T=t,o.p=n,o.d.f()}}},"../../common/temp/node_modules/.pnpm/react-dom@19.1.5_react@19.1.5/node_modules/react-dom/index.js":function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n("../../common/temp/node_modules/.pnpm/react-dom@19.1.5_react@19.1.5/node_modules/react-dom/cjs/react-dom.production.js")},"../../common/temp/node_modules/.pnpm/react@19.1.5/node_modules/react/cjs/react-jsx-runtime.production.js":function(e,t){"use strict";var n=Symbol.for("react.transitional.element");function r(e,t,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==t.key&&(i=""+t.key),"key"in t)for(var o in r={},t)"key"!==o&&(r[o]=t[o]);else r=t;return{$$typeof:n,type:e,key:i,ref:void 0!==(t=r.ref)?t:null,props:r}}t.Fragment=Symbol.for("react.fragment"),t.jsx=r,t.jsxs=r},"../../common/temp/node_modules/.pnpm/react@19.1.5/node_modules/react/jsx-runtime.js":function(e,t,n){"use strict";e.exports=n("../../common/temp/node_modules/.pnpm/react@19.1.5/node_modules/react/cjs/react-jsx-runtime.production.js")},"../../common/temp/node_modules/.pnpm/showdown@2.1.0/node_modules/showdown/dist/showdown.js":function(e){(function(){function t(e){"use strict";var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `\xab\xab\xab` and `\xbb\xbb\xbb` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r].defaultValue);return n}var n={},r={},i={},o=t(!0),a="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:t(!0),allOn:function(){"use strict";var e=t(!0),n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=!0);return n}()};function s(e,t){"use strict";var r=t?"Error in "+t+" extension->":"Error in unnamed extension",i={valid:!0,error:""};n.helper.isArray(e)||(e=[e]);for(var o=0;o<e.length;++o){var a=r+" sub-extension "+o+": ",u=e[o];if("object"!=typeof u){i.valid=!1,i.error=a+"must be an object, but "+typeof u+" given";break}if(!n.helper.isString(u.type)){i.valid=!1,i.error=a+'property "type" must be a string, but '+typeof u.type+" given";break}var s=u.type=u.type.toLowerCase();if("language"===s&&(s=u.type="lang"),"html"===s&&(s=u.type="output"),"lang"!==s&&"output"!==s&&"listener"!==s){i.valid=!1,i.error=a+"type "+s+' is not recognized. Valid values: "lang/language", "output/html" or "listener"';break}if("listener"===s){if(n.helper.isUndefined(u.listeners)){i.valid=!1,i.error=a+'. Extensions of type "listener" must have a property called "listeners"';break}}else if(n.helper.isUndefined(u.filter)&&n.helper.isUndefined(u.regex)){i.valid=!1,i.error=a+s+' extensions must define either a "regex" property or a "filter" method';break}if(u.listeners){if("object"!=typeof u.listeners)return i.valid=!1,i.error=a+'"listeners" property must be an object but '+typeof u.listeners+" given",i;for(var d in u.listeners)if(u.listeners.hasOwnProperty(d)&&"function"!=typeof u.listeners[d])return i.valid=!1,i.error=a+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+d+" must be a function but "+typeof u.listeners[d]+" given",i}if(u.filter){if("function"!=typeof u.filter){i.valid=!1,i.error=a+'"filter" must be a function, but '+typeof u.filter+" given";break}}else if(u.regex){if(n.helper.isString(u.regex)&&(u.regex=RegExp(u.regex,"g")),!(u.regex instanceof RegExp))return i.valid=!1,i.error=a+'"regex" property must either be a string or a RegExp object, but '+typeof u.regex+" given",i;if(n.helper.isUndefined(u.replace)){i.valid=!1,i.error=a+'"regex" extensions must implement a replace string or function';break}}}return i}function d(e,t){return"\xa8E"+t.charCodeAt(0)+"E"}n.helper={},n.extensions={},n.setOption=function(e,t){return o[e]=t,this},n.getOption=function(e){return o[e]},n.getOptions=function(){return o},n.resetOptions=function(){"use strict";o=t(!0)},n.setFlavor=function(e){"use strict";if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");n.resetOptions();var t=u[e];for(var r in a=e,t)t.hasOwnProperty(r)&&(o[r]=t[r])},n.getFlavor=function(){return a},n.getFlavorOptions=function(e){"use strict";if(u.hasOwnProperty(e))return u[e]},n.getDefaultOptions=function(e){return t(e)},n.subParser=function(e,t){"use strict";if(n.helper.isString(e))if(void 0!==t)r[e]=t;else if(r.hasOwnProperty(e))return r[e];else throw Error("SubParser named "+e+" not registered!")},n.extension=function(e,t){"use strict";if(!n.helper.isString(e))throw Error("Extension 'name' must be a string");if(e=n.helper.stdExtName(e),n.helper.isUndefined(t)){if(!i.hasOwnProperty(e))throw Error("Extension named "+e+" is not registered!");return i[e]}"function"==typeof t&&(t=t()),n.helper.isArray(t)||(t=[t]);var r=s(t,e);if(r.valid)i[e]=t;else throw Error(r.error)},n.getAllExtensions=function(){return i},n.removeExtension=function(e){"use strict";delete i[e]},n.resetExtensions=function(){"use strict";i={}},n.validateExtension=function(e){"use strict";var t=s(e,null);return!!t.valid||(console.warn(t.error),!1)},n.hasOwnProperty("helper")||(n.helper={}),n.helper.isString=function(e){return"string"==typeof e||e instanceof String},n.helper.isFunction=function(e){return e&&"[object Function]"===({}).toString.call(e)},n.helper.isArray=function(e){return Array.isArray(e)},n.helper.isUndefined=function(e){return void 0===e},n.helper.forEach=function(e,t){"use strict";if(n.helper.isUndefined(e))throw Error("obj param is required");if(n.helper.isUndefined(t))throw Error("callback param is required");if(!n.helper.isFunction(t))throw Error("callback param must be a function/closure");if("function"==typeof e.forEach)e.forEach(t);else if(n.helper.isArray(e))for(var r=0;r<e.length;r++)t(e[r],r,e);else if("object"==typeof e)for(var i in e)e.hasOwnProperty(i)&&t(e[i],i,e);else throw Error("obj does not seem to be an array or an iterable object")},n.helper.stdExtName=function(e){return e.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()},n.helper.escapeCharactersCallback=d,n.helper.escapeCharacters=function(e,t,n){"use strict";var r="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var i=RegExp(r,"g");return e.replace(i,d)},n.helper.unescapeHTMLEntities=function(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var c=function(e,t,n,r){"use strict";var i,o,a,u,s,d=r||"",c=d.indexOf("g")>-1,l=RegExp(t+"|"+n,"g"+d.replace(/g/g,"")),p=new RegExp(t,d.replace(/g/g,"")),f=[];do for(i=0;a=l.exec(e);)if(p.test(a[0]))i++||(u=(o=l.lastIndex)-a[0].length);else if(i&&!--i){s=a.index+a[0].length;var h={left:{start:u,end:o},match:{start:o,end:a.index},right:{start:a.index,end:s},wholeMatch:{start:u,end:s}};if(f.push(h),!c)return f}while(i&&(l.lastIndex=o));return f};n.helper.matchRecursiveRegExp=function(e,t,n,r){"use strict";for(var i=c(e,t,n,r),o=[],a=0;a<i.length;++a)o.push([e.slice(i[a].wholeMatch.start,i[a].wholeMatch.end),e.slice(i[a].match.start,i[a].match.end),e.slice(i[a].left.start,i[a].left.end),e.slice(i[a].right.start,i[a].right.end)]);return o},n.helper.replaceRecursiveRegExp=function(e,t,r,i,o){"use strict";if(!n.helper.isFunction(t)){var a=t;t=function(){return a}}var u=c(e,r,i,o),s=e,d=u.length;if(d>0){var l=[];0!==u[0].wholeMatch.start&&l.push(e.slice(0,u[0].wholeMatch.start));for(var p=0;p<d;++p)l.push(t(e.slice(u[p].wholeMatch.start,u[p].wholeMatch.end),e.slice(u[p].match.start,u[p].match.end),e.slice(u[p].left.start,u[p].left.end),e.slice(u[p].right.start,u[p].right.end))),p<d-1&&l.push(e.slice(u[p].wholeMatch.end,u[p+1].wholeMatch.start));u[d-1].wholeMatch.end<e.length&&l.push(e.slice(u[d-1].wholeMatch.end)),s=l.join("")}return s},n.helper.regexIndexOf=function(e,t,r){"use strict";if(!n.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(t instanceof RegExp==!1)throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var i=e.substring(r||0).search(t);return i>=0?i+(r||0):i},n.helper.splitAtIndex=function(e,t){"use strict";if(!n.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},n.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e.replace(/./g,function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var n=Math.random();e=n>.9?t[2](e):n>.45?t[1](e):t[0](e)}return e})},n.helper.padEnd=function(e,t,n){return(t|=0,n=String(n||" "),e.length>t)?String(e):((t-=e.length)>n.length&&(n+=n.repeat(t/n.length)),String(e)+n.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),n.helper.regexes={asteriskDashAndColon:/([*_:~])/g},n.helper.emojis={"+1":"\ud83d\udc4d","-1":"\ud83d\udc4e",100:"\ud83d\udcaf",1234:"\ud83d\udd22","1st_place_medal":"\ud83e\udd47","2nd_place_medal":"\ud83e\udd48","3rd_place_medal":"\ud83e\udd49","8ball":"\ud83c\udfb1",a:"\ud83c\udd70️",ab:"\ud83c\udd8e",abc:"\ud83d\udd24",abcd:"\ud83d\udd21",accept:"\ud83c\ude51",aerial_tramway:"\ud83d\udea1",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"\ud83d\udc7d",ambulance:"\ud83d\ude91",amphora:"\ud83c\udffa",anchor:"⚓️",angel:"\ud83d\udc7c",anger:"\ud83d\udca2",angry:"\ud83d\ude20",anguished:"\ud83d\ude27",ant:"\ud83d\udc1c",apple:"\ud83c\udf4e",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"\ud83d\udd3d",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"\ud83d\udd3c",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"\ud83d\udd03",arrows_counterclockwise:"\ud83d\udd04",art:"\ud83c\udfa8",articulated_lorry:"\ud83d\ude9b",artificial_satellite:"\ud83d\udef0",astonished:"\ud83d\ude32",athletic_shoe:"\ud83d\udc5f",atm:"\ud83c\udfe7",atom_symbol:"⚛️",avocado:"\ud83e\udd51",b:"\ud83c\udd71️",baby:"\ud83d\udc76",baby_bottle:"\ud83c\udf7c",baby_chick:"\ud83d\udc24",baby_symbol:"\ud83d\udebc",back:"\ud83d\udd19",bacon:"\ud83e\udd53",badminton:"\ud83c\udff8",baggage_claim:"\ud83d\udec4",baguette_bread:"\ud83e\udd56",balance_scale:"⚖️",balloon:"\ud83c\udf88",ballot_box:"\ud83d\uddf3",ballot_box_with_check:"☑️",bamboo:"\ud83c\udf8d",banana:"\ud83c\udf4c",bangbang:"‼️",bank:"\ud83c\udfe6",bar_chart:"\ud83d\udcca",barber:"\ud83d\udc88",baseball:"⚾️",basketball:"\ud83c\udfc0",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"\ud83e\udd87",bath:"\ud83d\udec0",bathtub:"\ud83d\udec1",battery:"\ud83d\udd0b",beach_umbrella:"\ud83c\udfd6",bear:"\ud83d\udc3b",bed:"\ud83d\udecf",bee:"\ud83d\udc1d",beer:"\ud83c\udf7a",beers:"\ud83c\udf7b",beetle:"\ud83d\udc1e",beginner:"\ud83d\udd30",bell:"\ud83d\udd14",bellhop_bell:"\ud83d\udece",bento:"\ud83c\udf71",biking_man:"\ud83d\udeb4",bike:"\ud83d\udeb2",biking_woman:"\ud83d\udeb4‍♀️",bikini:"\ud83d\udc59",biohazard:"☣️",bird:"\ud83d\udc26",birthday:"\ud83c\udf82",black_circle:"⚫️",black_flag:"\ud83c\udff4",black_heart:"\ud83d\udda4",black_joker:"\ud83c\udccf",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"\ud83d\udd32",blonde_man:"\ud83d\udc71",blonde_woman:"\ud83d\udc71‍♀️",blossom:"\ud83c\udf3c",blowfish:"\ud83d\udc21",blue_book:"\ud83d\udcd8",blue_car:"\ud83d\ude99",blue_heart:"\ud83d\udc99",blush:"\ud83d\ude0a",boar:"\ud83d\udc17",boat:"⛵️",bomb:"\ud83d\udca3",book:"\ud83d\udcd6",bookmark:"\ud83d\udd16",bookmark_tabs:"\ud83d\udcd1",books:"\ud83d\udcda",boom:"\ud83d\udca5",boot:"\ud83d\udc62",bouquet:"\ud83d\udc90",bowing_man:"\ud83d\ude47",bow_and_arrow:"\ud83c\udff9",bowing_woman:"\ud83d\ude47‍♀️",bowling:"\ud83c\udfb3",boxing_glove:"\ud83e\udd4a",boy:"\ud83d\udc66",bread:"\ud83c\udf5e",bride_with_veil:"\ud83d\udc70",bridge_at_night:"\ud83c\udf09",briefcase:"\ud83d\udcbc",broken_heart:"\ud83d\udc94",bug:"\ud83d\udc1b",building_construction:"\ud83c\udfd7",bulb:"\ud83d\udca1",bullettrain_front:"\ud83d\ude85",bullettrain_side:"\ud83d\ude84",burrito:"\ud83c\udf2f",bus:"\ud83d\ude8c",business_suit_levitating:"\ud83d\udd74",busstop:"\ud83d\ude8f",bust_in_silhouette:"\ud83d\udc64",busts_in_silhouette:"\ud83d\udc65",butterfly:"\ud83e\udd8b",cactus:"\ud83c\udf35",cake:"\ud83c\udf70",calendar:"\ud83d\udcc6",call_me_hand:"\ud83e\udd19",calling:"\ud83d\udcf2",camel:"\ud83d\udc2b",camera:"\ud83d\udcf7",camera_flash:"\ud83d\udcf8",camping:"\ud83c\udfd5",cancer:"♋️",candle:"\ud83d\udd6f",candy:"\ud83c\udf6c",canoe:"\ud83d\udef6",capital_abcd:"\ud83d\udd20",capricorn:"♑️",car:"\ud83d\ude97",card_file_box:"\ud83d\uddc3",card_index:"\ud83d\udcc7",card_index_dividers:"\ud83d\uddc2",carousel_horse:"\ud83c\udfa0",carrot:"\ud83e\udd55",cat:"\ud83d\udc31",cat2:"\ud83d\udc08",cd:"\ud83d\udcbf",chains:"⛓",champagne:"\ud83c\udf7e",chart:"\ud83d\udcb9",chart_with_downwards_trend:"\ud83d\udcc9",chart_with_upwards_trend:"\ud83d\udcc8",checkered_flag:"\ud83c\udfc1",cheese:"\ud83e\uddc0",cherries:"\ud83c\udf52",cherry_blossom:"\ud83c\udf38",chestnut:"\ud83c\udf30",chicken:"\ud83d\udc14",children_crossing:"\ud83d\udeb8",chipmunk:"\ud83d\udc3f",chocolate_bar:"\ud83c\udf6b",christmas_tree:"\ud83c\udf84",church:"⛪️",cinema:"\ud83c\udfa6",circus_tent:"\ud83c\udfaa",city_sunrise:"\ud83c\udf07",city_sunset:"\ud83c\udf06",cityscape:"\ud83c\udfd9",cl:"\ud83c\udd91",clamp:"\ud83d\udddc",clap:"\ud83d\udc4f",clapper:"\ud83c\udfac",classical_building:"\ud83c\udfdb",clinking_glasses:"\ud83e\udd42",clipboard:"\ud83d\udccb",clock1:"\ud83d\udd50",clock10:"\ud83d\udd59",clock1030:"\ud83d\udd65",clock11:"\ud83d\udd5a",clock1130:"\ud83d\udd66",clock12:"\ud83d\udd5b",clock1230:"\ud83d\udd67",clock130:"\ud83d\udd5c",clock2:"\ud83d\udd51",clock230:"\ud83d\udd5d",clock3:"\ud83d\udd52",clock330:"\ud83d\udd5e",clock4:"\ud83d\udd53",clock430:"\ud83d\udd5f",clock5:"\ud83d\udd54",clock530:"\ud83d\udd60",clock6:"\ud83d\udd55",clock630:"\ud83d\udd61",clock7:"\ud83d\udd56",clock730:"\ud83d\udd62",clock8:"\ud83d\udd57",clock830:"\ud83d\udd63",clock9:"\ud83d\udd58",clock930:"\ud83d\udd64",closed_book:"\ud83d\udcd5",closed_lock_with_key:"\ud83d\udd10",closed_umbrella:"\ud83c\udf02",cloud:"☁️",cloud_with_lightning:"\ud83c\udf29",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"\ud83c\udf27",cloud_with_snow:"\ud83c\udf28",clown_face:"\ud83e\udd21",clubs:"♣️",cocktail:"\ud83c\udf78",coffee:"☕️",coffin:"⚰️",cold_sweat:"\ud83d\ude30",comet:"☄️",computer:"\ud83d\udcbb",computer_mouse:"\ud83d\uddb1",confetti_ball:"\ud83c\udf8a",confounded:"\ud83d\ude16",confused:"\ud83d\ude15",congratulations:"㊗️",construction:"\ud83d\udea7",construction_worker_man:"\ud83d\udc77",construction_worker_woman:"\ud83d\udc77‍♀️",control_knobs:"\ud83c\udf9b",convenience_store:"\ud83c\udfea",cookie:"\ud83c\udf6a",cool:"\ud83c\udd92",policeman:"\ud83d\udc6e",copyright:"\xa9️",corn:"\ud83c\udf3d",couch_and_lamp:"\ud83d\udecb",couple:"\ud83d\udc6b",couple_with_heart_woman_man:"\ud83d\udc91",couple_with_heart_man_man:"\ud83d\udc68‍❤️‍\ud83d\udc68",couple_with_heart_woman_woman:"\ud83d\udc69‍❤️‍\ud83d\udc69",couplekiss_man_man:"\ud83d\udc68‍❤️‍\ud83d\udc8b‍\ud83d\udc68",couplekiss_man_woman:"\ud83d\udc8f",couplekiss_woman_woman:"\ud83d\udc69‍❤️‍\ud83d\udc8b‍\ud83d\udc69",cow:"\ud83d\udc2e",cow2:"\ud83d\udc04",cowboy_hat_face:"\ud83e\udd20",crab:"\ud83e\udd80",crayon:"\ud83d\udd8d",credit_card:"\ud83d\udcb3",crescent_moon:"\ud83c\udf19",cricket:"\ud83c\udfcf",crocodile:"\ud83d\udc0a",croissant:"\ud83e\udd50",crossed_fingers:"\ud83e\udd1e",crossed_flags:"\ud83c\udf8c",crossed_swords:"⚔️",crown:"\ud83d\udc51",cry:"\ud83d\ude22",crying_cat_face:"\ud83d\ude3f",crystal_ball:"\ud83d\udd2e",cucumber:"\ud83e\udd52",cupid:"\ud83d\udc98",curly_loop:"➰",currency_exchange:"\ud83d\udcb1",curry:"\ud83c\udf5b",custard:"\ud83c\udf6e",customs:"\ud83d\udec3",cyclone:"\ud83c\udf00",dagger:"\ud83d\udde1",dancer:"\ud83d\udc83",dancing_women:"\ud83d\udc6f",dancing_men:"\ud83d\udc6f‍♂️",dango:"\ud83c\udf61",dark_sunglasses:"\ud83d\udd76",dart:"\ud83c\udfaf",dash:"\ud83d\udca8",date:"\ud83d\udcc5",deciduous_tree:"\ud83c\udf33",deer:"\ud83e\udd8c",department_store:"\ud83c\udfec",derelict_house:"\ud83c\udfda",desert:"\ud83c\udfdc",desert_island:"\ud83c\udfdd",desktop_computer:"\ud83d\udda5",male_detective:"\ud83d\udd75️",diamond_shape_with_a_dot_inside:"\ud83d\udca0",diamonds:"♦️",disappointed:"\ud83d\ude1e",disappointed_relieved:"\ud83d\ude25",dizzy:"\ud83d\udcab",dizzy_face:"\ud83d\ude35",do_not_litter:"\ud83d\udeaf",dog:"\ud83d\udc36",dog2:"\ud83d\udc15",dollar:"\ud83d\udcb5",dolls:"\ud83c\udf8e",dolphin:"\ud83d\udc2c",door:"\ud83d\udeaa",doughnut:"\ud83c\udf69",dove:"\ud83d\udd4a",dragon:"\ud83d\udc09",dragon_face:"\ud83d\udc32",dress:"\ud83d\udc57",dromedary_camel:"\ud83d\udc2a",drooling_face:"\ud83e\udd24",droplet:"\ud83d\udca7",drum:"\ud83e\udd41",duck:"\ud83e\udd86",dvd:"\ud83d\udcc0","e-mail":"\ud83d\udce7",eagle:"\ud83e\udd85",ear:"\ud83d\udc42",ear_of_rice:"\ud83c\udf3e",earth_africa:"\ud83c\udf0d",earth_americas:"\ud83c\udf0e",earth_asia:"\ud83c\udf0f",egg:"\ud83e\udd5a",eggplant:"\ud83c\udf46",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"\ud83d\udd0c",elephant:"\ud83d\udc18",email:"✉️",end:"\ud83d\udd1a",envelope_with_arrow:"\ud83d\udce9",euro:"\ud83d\udcb6",european_castle:"\ud83c\udff0",european_post_office:"\ud83c\udfe4",evergreen_tree:"\ud83c\udf32",exclamation:"❗️",expressionless:"\ud83d\ude11",eye:"\ud83d\udc41",eye_speech_bubble:"\ud83d\udc41‍\ud83d\udde8",eyeglasses:"\ud83d\udc53",eyes:"\ud83d\udc40",face_with_head_bandage:"\ud83e\udd15",face_with_thermometer:"\ud83e\udd12",fist_oncoming:"\ud83d\udc4a",factory:"\ud83c\udfed",fallen_leaf:"\ud83c\udf42",family_man_woman_boy:"\ud83d\udc6a",family_man_boy:"\ud83d\udc68‍\ud83d\udc66",family_man_boy_boy:"\ud83d\udc68‍\ud83d\udc66‍\ud83d\udc66",family_man_girl:"\ud83d\udc68‍\ud83d\udc67",family_man_girl_boy:"\ud83d\udc68‍\ud83d\udc67‍\ud83d\udc66",family_man_girl_girl:"\ud83d\udc68‍\ud83d\udc67‍\ud83d\udc67",family_man_man_boy:"\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc66",family_man_man_boy_boy:"\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc66‍\ud83d\udc66",family_man_man_girl:"\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc67",family_man_man_girl_boy:"\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc67‍\ud83d\udc66",family_man_man_girl_girl:"\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc67‍\ud83d\udc67",family_man_woman_boy_boy:"\ud83d\udc68‍\ud83d\udc69‍\ud83d\udc66‍\ud83d\udc66",family_man_woman_girl:"\ud83d\udc68‍\ud83d\udc69‍\ud83d\udc67",family_man_woman_girl_boy:"\ud83d\udc68‍\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc66",family_man_woman_girl_girl:"\ud83d\udc68‍\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc67",family_woman_boy:"\ud83d\udc69‍\ud83d\udc66",family_woman_boy_boy:"\ud83d\udc69‍\ud83d\udc66‍\ud83d\udc66",family_woman_girl:"\ud83d\udc69‍\ud83d\udc67",family_woman_girl_boy:"\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc66",family_woman_girl_girl:"\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc67",family_woman_woman_boy:"\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc66",family_woman_woman_boy_boy:"\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc66‍\ud83d\udc66",family_woman_woman_girl:"\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc67",family_woman_woman_girl_boy:"\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc66",family_woman_woman_girl_girl:"\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc67",fast_forward:"⏩",fax:"\ud83d\udce0",fearful:"\ud83d\ude28",feet:"\ud83d\udc3e",female_detective:"\ud83d\udd75️‍♀️",ferris_wheel:"\ud83c\udfa1",ferry:"⛴",field_hockey:"\ud83c\udfd1",file_cabinet:"\ud83d\uddc4",file_folder:"\ud83d\udcc1",film_projector:"\ud83d\udcfd",film_strip:"\ud83c\udf9e",fire:"\ud83d\udd25",fire_engine:"\ud83d\ude92",fireworks:"\ud83c\udf86",first_quarter_moon:"\ud83c\udf13",first_quarter_moon_with_face:"\ud83c\udf1b",fish:"\ud83d\udc1f",fish_cake:"\ud83c\udf65",fishing_pole_and_fish:"\ud83c\udfa3",fist_raised:"✊",fist_left:"\ud83e\udd1b",fist_right:"\ud83e\udd1c",flags:"\ud83c\udf8f",flashlight:"\ud83d\udd26",fleur_de_lis:"⚜️",flight_arrival:"\ud83d\udeec",flight_departure:"\ud83d\udeeb",floppy_disk:"\ud83d\udcbe",flower_playing_cards:"\ud83c\udfb4",flushed:"\ud83d\ude33",fog:"\ud83c\udf2b",foggy:"\ud83c\udf01",football:"\ud83c\udfc8",footprints:"\ud83d\udc63",fork_and_knife:"\ud83c\udf74",fountain:"⛲️",fountain_pen:"\ud83d\udd8b",four_leaf_clover:"\ud83c\udf40",fox_face:"\ud83e\udd8a",framed_picture:"\ud83d\uddbc",free:"\ud83c\udd93",fried_egg:"\ud83c\udf73",fried_shrimp:"\ud83c\udf64",fries:"\ud83c\udf5f",frog:"\ud83d\udc38",frowning:"\ud83d\ude26",frowning_face:"☹️",frowning_man:"\ud83d\ude4d‍♂️",frowning_woman:"\ud83d\ude4d",middle_finger:"\ud83d\udd95",fuelpump:"⛽️",full_moon:"\ud83c\udf15",full_moon_with_face:"\ud83c\udf1d",funeral_urn:"⚱️",game_die:"\ud83c\udfb2",gear:"⚙️",gem:"\ud83d\udc8e",gemini:"♊️",ghost:"\ud83d\udc7b",gift:"\ud83c\udf81",gift_heart:"\ud83d\udc9d",girl:"\ud83d\udc67",globe_with_meridians:"\ud83c\udf10",goal_net:"\ud83e\udd45",goat:"\ud83d\udc10",golf:"⛳️",golfing_man:"\ud83c\udfcc️",golfing_woman:"\ud83c\udfcc️‍♀️",gorilla:"\ud83e\udd8d",grapes:"\ud83c\udf47",green_apple:"\ud83c\udf4f",green_book:"\ud83d\udcd7",green_heart:"\ud83d\udc9a",green_salad:"\ud83e\udd57",grey_exclamation:"❕",grey_question:"❔",grimacing:"\ud83d\ude2c",grin:"\ud83d\ude01",grinning:"\ud83d\ude00",guardsman:"\ud83d\udc82",guardswoman:"\ud83d\udc82‍♀️",guitar:"\ud83c\udfb8",gun:"\ud83d\udd2b",haircut_woman:"\ud83d\udc87",haircut_man:"\ud83d\udc87‍♂️",hamburger:"\ud83c\udf54",hammer:"\ud83d\udd28",hammer_and_pick:"⚒",hammer_and_wrench:"\ud83d\udee0",hamster:"\ud83d\udc39",hand:"✋",handbag:"\ud83d\udc5c",handshake:"\ud83e\udd1d",hankey:"\ud83d\udca9",hatched_chick:"\ud83d\udc25",hatching_chick:"\ud83d\udc23",headphones:"\ud83c\udfa7",hear_no_evil:"\ud83d\ude49",heart:"❤️",heart_decoration:"\ud83d\udc9f",heart_eyes:"\ud83d\ude0d",heart_eyes_cat:"\ud83d\ude3b",heartbeat:"\ud83d\udc93",heartpulse:"\ud83d\udc97",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"\ud83d\udcb2",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"\ud83d\ude81",herb:"\ud83c\udf3f",hibiscus:"\ud83c\udf3a",high_brightness:"\ud83d\udd06",high_heel:"\ud83d\udc60",hocho:"\ud83d\udd2a",hole:"\ud83d\udd73",honey_pot:"\ud83c\udf6f",horse:"\ud83d\udc34",horse_racing:"\ud83c\udfc7",hospital:"\ud83c\udfe5",hot_pepper:"\ud83c\udf36",hotdog:"\ud83c\udf2d",hotel:"\ud83c\udfe8",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"\ud83c\udfe0",house_with_garden:"\ud83c\udfe1",houses:"\ud83c\udfd8",hugs:"\ud83e\udd17",hushed:"\ud83d\ude2f",ice_cream:"\ud83c\udf68",ice_hockey:"\ud83c\udfd2",ice_skate:"⛸",icecream:"\ud83c\udf66",id:"\ud83c\udd94",ideograph_advantage:"\ud83c\ude50",imp:"\ud83d\udc7f",inbox_tray:"\ud83d\udce5",incoming_envelope:"\ud83d\udce8",tipping_hand_woman:"\ud83d\udc81",information_source:"ℹ️",innocent:"\ud83d\ude07",interrobang:"⁉️",iphone:"\ud83d\udcf1",izakaya_lantern:"\ud83c\udfee",jack_o_lantern:"\ud83c\udf83",japan:"\ud83d\uddfe",japanese_castle:"\ud83c\udfef",japanese_goblin:"\ud83d\udc7a",japanese_ogre:"\ud83d\udc79",jeans:"\ud83d\udc56",joy:"\ud83d\ude02",joy_cat:"\ud83d\ude39",joystick:"\ud83d\udd79",kaaba:"\ud83d\udd4b",key:"\ud83d\udd11",keyboard:"⌨️",keycap_ten:"\ud83d\udd1f",kick_scooter:"\ud83d\udef4",kimono:"\ud83d\udc58",kiss:"\ud83d\udc8b",kissing:"\ud83d\ude17",kissing_cat:"\ud83d\ude3d",kissing_closed_eyes:"\ud83d\ude1a",kissing_heart:"\ud83d\ude18",kissing_smiling_eyes:"\ud83d\ude19",kiwi_fruit:"\ud83e\udd5d",koala:"\ud83d\udc28",koko:"\ud83c\ude01",label:"\ud83c\udff7",large_blue_circle:"\ud83d\udd35",large_blue_diamond:"\ud83d\udd37",large_orange_diamond:"\ud83d\udd36",last_quarter_moon:"\ud83c\udf17",last_quarter_moon_with_face:"\ud83c\udf1c",latin_cross:"✝️",laughing:"\ud83d\ude06",leaves:"\ud83c\udf43",ledger:"\ud83d\udcd2",left_luggage:"\ud83d\udec5",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"\ud83c\udf4b",leo:"♌️",leopard:"\ud83d\udc06",level_slider:"\ud83c\udf9a",libra:"♎️",light_rail:"\ud83d\ude88",link:"\ud83d\udd17",lion:"\ud83e\udd81",lips:"\ud83d\udc44",lipstick:"\ud83d\udc84",lizard:"\ud83e\udd8e",lock:"\ud83d\udd12",lock_with_ink_pen:"\ud83d\udd0f",lollipop:"\ud83c\udf6d",loop:"➿",loud_sound:"\ud83d\udd0a",loudspeaker:"\ud83d\udce2",love_hotel:"\ud83c\udfe9",love_letter:"\ud83d\udc8c",low_brightness:"\ud83d\udd05",lying_face:"\ud83e\udd25",m:"Ⓜ️",mag:"\ud83d\udd0d",mag_right:"\ud83d\udd0e",mahjong:"\ud83c\udc04️",mailbox:"\ud83d\udceb",mailbox_closed:"\ud83d\udcea",mailbox_with_mail:"\ud83d\udcec",mailbox_with_no_mail:"\ud83d\udced",man:"\ud83d\udc68",man_artist:"\ud83d\udc68‍\ud83c\udfa8",man_astronaut:"\ud83d\udc68‍\ud83d\ude80",man_cartwheeling:"\ud83e\udd38‍♂️",man_cook:"\ud83d\udc68‍\ud83c\udf73",man_dancing:"\ud83d\udd7a",man_facepalming:"\ud83e\udd26‍♂️",man_factory_worker:"\ud83d\udc68‍\ud83c\udfed",man_farmer:"\ud83d\udc68‍\ud83c\udf3e",man_firefighter:"\ud83d\udc68‍\ud83d\ude92",man_health_worker:"\ud83d\udc68‍⚕️",man_in_tuxedo:"\ud83e\udd35",man_judge:"\ud83d\udc68‍⚖️",man_juggling:"\ud83e\udd39‍♂️",man_mechanic:"\ud83d\udc68‍\ud83d\udd27",man_office_worker:"\ud83d\udc68‍\ud83d\udcbc",man_pilot:"\ud83d\udc68‍✈️",man_playing_handball:"\ud83e\udd3e‍♂️",man_playing_water_polo:"\ud83e\udd3d‍♂️",man_scientist:"\ud83d\udc68‍\ud83d\udd2c",man_shrugging:"\ud83e\udd37‍♂️",man_singer:"\ud83d\udc68‍\ud83c\udfa4",man_student:"\ud83d\udc68‍\ud83c\udf93",man_teacher:"\ud83d\udc68‍\ud83c\udfeb",man_technologist:"\ud83d\udc68‍\ud83d\udcbb",man_with_gua_pi_mao:"\ud83d\udc72",man_with_turban:"\ud83d\udc73",tangerine:"\ud83c\udf4a",mans_shoe:"\ud83d\udc5e",mantelpiece_clock:"\ud83d\udd70",maple_leaf:"\ud83c\udf41",martial_arts_uniform:"\ud83e\udd4b",mask:"\ud83d\ude37",massage_woman:"\ud83d\udc86",massage_man:"\ud83d\udc86‍♂️",meat_on_bone:"\ud83c\udf56",medal_military:"\ud83c\udf96",medal_sports:"\ud83c\udfc5",mega:"\ud83d\udce3",melon:"\ud83c\udf48",memo:"\ud83d\udcdd",men_wrestling:"\ud83e\udd3c‍♂️",menorah:"\ud83d\udd4e",mens:"\ud83d\udeb9",metal:"\ud83e\udd18",metro:"\ud83d\ude87",microphone:"\ud83c\udfa4",microscope:"\ud83d\udd2c",milk_glass:"\ud83e\udd5b",milky_way:"\ud83c\udf0c",minibus:"\ud83d\ude90",minidisc:"\ud83d\udcbd",mobile_phone_off:"\ud83d\udcf4",money_mouth_face:"\ud83e\udd11",money_with_wings:"\ud83d\udcb8",moneybag:"\ud83d\udcb0",monkey:"\ud83d\udc12",monkey_face:"\ud83d\udc35",monorail:"\ud83d\ude9d",moon:"\ud83c\udf14",mortar_board:"\ud83c\udf93",mosque:"\ud83d\udd4c",motor_boat:"\ud83d\udee5",motor_scooter:"\ud83d\udef5",motorcycle:"\ud83c\udfcd",motorway:"\ud83d\udee3",mount_fuji:"\ud83d\uddfb",mountain:"⛰",mountain_biking_man:"\ud83d\udeb5",mountain_biking_woman:"\ud83d\udeb5‍♀️",mountain_cableway:"\ud83d\udea0",mountain_railway:"\ud83d\ude9e",mountain_snow:"\ud83c\udfd4",mouse:"\ud83d\udc2d",mouse2:"\ud83d\udc01",movie_camera:"\ud83c\udfa5",moyai:"\ud83d\uddff",mrs_claus:"\ud83e\udd36",muscle:"\ud83d\udcaa",mushroom:"\ud83c\udf44",musical_keyboard:"\ud83c\udfb9",musical_note:"\ud83c\udfb5",musical_score:"\ud83c\udfbc",mute:"\ud83d\udd07",nail_care:"\ud83d\udc85",name_badge:"\ud83d\udcdb",national_park:"\ud83c\udfde",nauseated_face:"\ud83e\udd22",necktie:"\ud83d\udc54",negative_squared_cross_mark:"❎",nerd_face:"\ud83e\udd13",neutral_face:"\ud83d\ude10",new:"\ud83c\udd95",new_moon:"\ud83c\udf11",new_moon_with_face:"\ud83c\udf1a",newspaper:"\ud83d\udcf0",newspaper_roll:"\ud83d\uddde",next_track_button:"⏭",ng:"\ud83c\udd96",no_good_man:"\ud83d\ude45‍♂️",no_good_woman:"\ud83d\ude45",night_with_stars:"\ud83c\udf03",no_bell:"\ud83d\udd15",no_bicycles:"\ud83d\udeb3",no_entry:"⛔️",no_entry_sign:"\ud83d\udeab",no_mobile_phones:"\ud83d\udcf5",no_mouth:"\ud83d\ude36",no_pedestrians:"\ud83d\udeb7",no_smoking:"\ud83d\udead","non-potable_water":"\ud83d\udeb1",nose:"\ud83d\udc43",notebook:"\ud83d\udcd3",notebook_with_decorative_cover:"\ud83d\udcd4",notes:"\ud83c\udfb6",nut_and_bolt:"\ud83d\udd29",o:"⭕️",o2:"\ud83c\udd7e️",ocean:"\ud83c\udf0a",octopus:"\ud83d\udc19",oden:"\ud83c\udf62",office:"\ud83c\udfe2",oil_drum:"\ud83d\udee2",ok:"\ud83c\udd97",ok_hand:"\ud83d\udc4c",ok_man:"\ud83d\ude46‍♂️",ok_woman:"\ud83d\ude46",old_key:"\ud83d\udddd",older_man:"\ud83d\udc74",older_woman:"\ud83d\udc75",om:"\ud83d\udd49",on:"\ud83d\udd1b",oncoming_automobile:"\ud83d\ude98",oncoming_bus:"\ud83d\ude8d",oncoming_police_car:"\ud83d\ude94",oncoming_taxi:"\ud83d\ude96",open_file_folder:"\ud83d\udcc2",open_hands:"\ud83d\udc50",open_mouth:"\ud83d\ude2e",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"\ud83d\udcd9",orthodox_cross:"☦️",outbox_tray:"\ud83d\udce4",owl:"\ud83e\udd89",ox:"\ud83d\udc02",package:"\ud83d\udce6",page_facing_up:"\ud83d\udcc4",page_with_curl:"\ud83d\udcc3",pager:"\ud83d\udcdf",paintbrush:"\ud83d\udd8c",palm_tree:"\ud83c\udf34",pancakes:"\ud83e\udd5e",panda_face:"\ud83d\udc3c",paperclip:"\ud83d\udcce",paperclips:"\ud83d\udd87",parasol_on_ground:"⛱",parking:"\ud83c\udd7f️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"\ud83d\udef3",passport_control:"\ud83d\udec2",pause_button:"⏸",peace_symbol:"☮️",peach:"\ud83c\udf51",peanuts:"\ud83e\udd5c",pear:"\ud83c\udf50",pen:"\ud83d\udd8a",pencil2:"✏️",penguin:"\ud83d\udc27",pensive:"\ud83d\ude14",performing_arts:"\ud83c\udfad",persevere:"\ud83d\ude23",person_fencing:"\ud83e\udd3a",pouting_woman:"\ud83d\ude4e",phone:"☎️",pick:"⛏",pig:"\ud83d\udc37",pig2:"\ud83d\udc16",pig_nose:"\ud83d\udc3d",pill:"\ud83d\udc8a",pineapple:"\ud83c\udf4d",ping_pong:"\ud83c\udfd3",pisces:"♓️",pizza:"\ud83c\udf55",place_of_worship:"\ud83d\uded0",plate_with_cutlery:"\ud83c\udf7d",play_or_pause_button:"⏯",point_down:"\ud83d\udc47",point_left:"\ud83d\udc48",point_right:"\ud83d\udc49",point_up:"☝️",point_up_2:"\ud83d\udc46",police_car:"\ud83d\ude93",policewoman:"\ud83d\udc6e‍♀️",poodle:"\ud83d\udc29",popcorn:"\ud83c\udf7f",post_office:"\ud83c\udfe3",postal_horn:"\ud83d\udcef",postbox:"\ud83d\udcee",potable_water:"\ud83d\udeb0",potato:"\ud83e\udd54",pouch:"\ud83d\udc5d",poultry_leg:"\ud83c\udf57",pound:"\ud83d\udcb7",rage:"\ud83d\ude21",pouting_cat:"\ud83d\ude3e",pouting_man:"\ud83d\ude4e‍♂️",pray:"\ud83d\ude4f",prayer_beads:"\ud83d\udcff",pregnant_woman:"\ud83e\udd30",previous_track_button:"⏮",prince:"\ud83e\udd34",princess:"\ud83d\udc78",printer:"\ud83d\udda8",purple_heart:"\ud83d\udc9c",purse:"\ud83d\udc5b",pushpin:"\ud83d\udccc",put_litter_in_its_place:"\ud83d\udeae",question:"❓",rabbit:"\ud83d\udc30",rabbit2:"\ud83d\udc07",racehorse:"\ud83d\udc0e",racing_car:"\ud83c\udfce",radio:"\ud83d\udcfb",radio_button:"\ud83d\udd18",radioactive:"☢️",railway_car:"\ud83d\ude83",railway_track:"\ud83d\udee4",rainbow:"\ud83c\udf08",rainbow_flag:"\ud83c\udff3️‍\ud83c\udf08",raised_back_of_hand:"\ud83e\udd1a",raised_hand_with_fingers_splayed:"\ud83d\udd90",raised_hands:"\ud83d\ude4c",raising_hand_woman:"\ud83d\ude4b",raising_hand_man:"\ud83d\ude4b‍♂️",ram:"\ud83d\udc0f",ramen:"\ud83c\udf5c",rat:"\ud83d\udc00",record_button:"⏺",recycle:"♻️",red_circle:"\ud83d\udd34",registered:"\xae️",relaxed:"☺️",relieved:"\ud83d\ude0c",reminder_ribbon:"\ud83c\udf97",repeat:"\ud83d\udd01",repeat_one:"\ud83d\udd02",rescue_worker_helmet:"⛑",restroom:"\ud83d\udebb",revolving_hearts:"\ud83d\udc9e",rewind:"⏪",rhinoceros:"\ud83e\udd8f",ribbon:"\ud83c\udf80",rice:"\ud83c\udf5a",rice_ball:"\ud83c\udf59",rice_cracker:"\ud83c\udf58",rice_scene:"\ud83c\udf91",right_anger_bubble:"\ud83d\uddef",ring:"\ud83d\udc8d",robot:"\ud83e\udd16",rocket:"\ud83d\ude80",rofl:"\ud83e\udd23",roll_eyes:"\ud83d\ude44",roller_coaster:"\ud83c\udfa2",rooster:"\ud83d\udc13",rose:"\ud83c\udf39",rosette:"\ud83c\udff5",rotating_light:"\ud83d\udea8",round_pushpin:"\ud83d\udccd",rowing_man:"\ud83d\udea3",rowing_woman:"\ud83d\udea3‍♀️",rugby_football:"\ud83c\udfc9",running_man:"\ud83c\udfc3",running_shirt_with_sash:"\ud83c\udfbd",running_woman:"\ud83c\udfc3‍♀️",sa:"\ud83c\ude02️",sagittarius:"♐️",sake:"\ud83c\udf76",sandal:"\ud83d\udc61",santa:"\ud83c\udf85",satellite:"\ud83d\udce1",saxophone:"\ud83c\udfb7",school:"\ud83c\udfeb",school_satchel:"\ud83c\udf92",scissors:"✂️",scorpion:"\ud83e\udd82",scorpius:"♏️",scream:"\ud83d\ude31",scream_cat:"\ud83d\ude40",scroll:"\ud83d\udcdc",seat:"\ud83d\udcba",secret:"㊙️",see_no_evil:"\ud83d\ude48",seedling:"\ud83c\udf31",selfie:"\ud83e\udd33",shallow_pan_of_food:"\ud83e\udd58",shamrock:"☘️",shark:"\ud83e\udd88",shaved_ice:"\ud83c\udf67",sheep:"\ud83d\udc11",shell:"\ud83d\udc1a",shield:"\ud83d\udee1",shinto_shrine:"⛩",ship:"\ud83d\udea2",shirt:"\ud83d\udc55",shopping:"\ud83d\udecd",shopping_cart:"\ud83d\uded2",shower:"\ud83d\udebf",shrimp:"\ud83e\udd90",signal_strength:"\ud83d\udcf6",six_pointed_star:"\ud83d\udd2f",ski:"\ud83c\udfbf",skier:"⛷",skull:"\ud83d\udc80",skull_and_crossbones:"☠️",sleeping:"\ud83d\ude34",sleeping_bed:"\ud83d\udecc",sleepy:"\ud83d\ude2a",slightly_frowning_face:"\ud83d\ude41",slightly_smiling_face:"\ud83d\ude42",slot_machine:"\ud83c\udfb0",small_airplane:"\ud83d\udee9",small_blue_diamond:"\ud83d\udd39",small_orange_diamond:"\ud83d\udd38",small_red_triangle:"\ud83d\udd3a",small_red_triangle_down:"\ud83d\udd3b",smile:"\ud83d\ude04",smile_cat:"\ud83d\ude38",smiley:"\ud83d\ude03",smiley_cat:"\ud83d\ude3a",smiling_imp:"\ud83d\ude08",smirk:"\ud83d\ude0f",smirk_cat:"\ud83d\ude3c",smoking:"\ud83d\udeac",snail:"\ud83d\udc0c",snake:"\ud83d\udc0d",sneezing_face:"\ud83e\udd27",snowboarder:"\ud83c\udfc2",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"\ud83d\ude2d",soccer:"⚽️",soon:"\ud83d\udd1c",sos:"\ud83c\udd98",sound:"\ud83d\udd09",space_invader:"\ud83d\udc7e",spades:"♠️",spaghetti:"\ud83c\udf5d",sparkle:"❇️",sparkler:"\ud83c\udf87",sparkles:"✨",sparkling_heart:"\ud83d\udc96",speak_no_evil:"\ud83d\ude4a",speaker:"\ud83d\udd08",speaking_head:"\ud83d\udde3",speech_balloon:"\ud83d\udcac",speedboat:"\ud83d\udea4",spider:"\ud83d\udd77",spider_web:"\ud83d\udd78",spiral_calendar:"\ud83d\uddd3",spiral_notepad:"\ud83d\uddd2",spoon:"\ud83e\udd44",squid:"\ud83e\udd91",stadium:"\ud83c\udfdf",star:"⭐️",star2:"\ud83c\udf1f",star_and_crescent:"☪️",star_of_david:"✡️",stars:"\ud83c\udf20",station:"\ud83d\ude89",statue_of_liberty:"\ud83d\uddfd",steam_locomotive:"\ud83d\ude82",stew:"\ud83c\udf72",stop_button:"⏹",stop_sign:"\ud83d\uded1",stopwatch:"⏱",straight_ruler:"\ud83d\udccf",strawberry:"\ud83c\udf53",stuck_out_tongue:"\ud83d\ude1b",stuck_out_tongue_closed_eyes:"\ud83d\ude1d",stuck_out_tongue_winking_eye:"\ud83d\ude1c",studio_microphone:"\ud83c\udf99",stuffed_flatbread:"\ud83e\udd59",sun_behind_large_cloud:"\ud83c\udf25",sun_behind_rain_cloud:"\ud83c\udf26",sun_behind_small_cloud:"\ud83c\udf24",sun_with_face:"\ud83c\udf1e",sunflower:"\ud83c\udf3b",sunglasses:"\ud83d\ude0e",sunny:"☀️",sunrise:"\ud83c\udf05",sunrise_over_mountains:"\ud83c\udf04",surfing_man:"\ud83c\udfc4",surfing_woman:"\ud83c\udfc4‍♀️",sushi:"\ud83c\udf63",suspension_railway:"\ud83d\ude9f",sweat:"\ud83d\ude13",sweat_drops:"\ud83d\udca6",sweat_smile:"\ud83d\ude05",sweet_potato:"\ud83c\udf60",swimming_man:"\ud83c\udfca",swimming_woman:"\ud83c\udfca‍♀️",symbols:"\ud83d\udd23",synagogue:"\ud83d\udd4d",syringe:"\ud83d\udc89",taco:"\ud83c\udf2e",tada:"\ud83c\udf89",tanabata_tree:"\ud83c\udf8b",taurus:"♉️",taxi:"\ud83d\ude95",tea:"\ud83c\udf75",telephone_receiver:"\ud83d\udcde",telescope:"\ud83d\udd2d",tennis:"\ud83c\udfbe",tent:"⛺️",thermometer:"\ud83c\udf21",thinking:"\ud83e\udd14",thought_balloon:"\ud83d\udcad",ticket:"\ud83c\udfab",tickets:"\ud83c\udf9f",tiger:"\ud83d\udc2f",tiger2:"\ud83d\udc05",timer_clock:"⏲",tipping_hand_man:"\ud83d\udc81‍♂️",tired_face:"\ud83d\ude2b",tm:"™️",toilet:"\ud83d\udebd",tokyo_tower:"\ud83d\uddfc",tomato:"\ud83c\udf45",tongue:"\ud83d\udc45",top:"\ud83d\udd1d",tophat:"\ud83c\udfa9",tornado:"\ud83c\udf2a",trackball:"\ud83d\uddb2",tractor:"\ud83d\ude9c",traffic_light:"\ud83d\udea5",train:"\ud83d\ude8b",train2:"\ud83d\ude86",tram:"\ud83d\ude8a",triangular_flag_on_post:"\ud83d\udea9",triangular_ruler:"\ud83d\udcd0",trident:"\ud83d\udd31",triumph:"\ud83d\ude24",trolleybus:"\ud83d\ude8e",trophy:"\ud83c\udfc6",tropical_drink:"\ud83c\udf79",tropical_fish:"\ud83d\udc20",truck:"\ud83d\ude9a",trumpet:"\ud83c\udfba",tulip:"\ud83c\udf37",tumbler_glass:"\ud83e\udd43",turkey:"\ud83e\udd83",turtle:"\ud83d\udc22",tv:"\ud83d\udcfa",twisted_rightwards_arrows:"\ud83d\udd00",two_hearts:"\ud83d\udc95",two_men_holding_hands:"\ud83d\udc6c",two_women_holding_hands:"\ud83d\udc6d",u5272:"\ud83c\ude39",u5408:"\ud83c\ude34",u55b6:"\ud83c\ude3a",u6307:"\ud83c\ude2f️",u6708:"\ud83c\ude37️",u6709:"\ud83c\ude36",u6e80:"\ud83c\ude35",u7121:"\ud83c\ude1a️",u7533:"\ud83c\ude38",u7981:"\ud83c\ude32",u7a7a:"\ud83c\ude33",umbrella:"☔️",unamused:"\ud83d\ude12",underage:"\ud83d\udd1e",unicorn:"\ud83e\udd84",unlock:"\ud83d\udd13",up:"\ud83c\udd99",upside_down_face:"\ud83d\ude43",v:"✌️",vertical_traffic_light:"\ud83d\udea6",vhs:"\ud83d\udcfc",vibration_mode:"\ud83d\udcf3",video_camera:"\ud83d\udcf9",video_game:"\ud83c\udfae",violin:"\ud83c\udfbb",virgo:"♍️",volcano:"\ud83c\udf0b",volleyball:"\ud83c\udfd0",vs:"\ud83c\udd9a",vulcan_salute:"\ud83d\udd96",walking_man:"\ud83d\udeb6",walking_woman:"\ud83d\udeb6‍♀️",waning_crescent_moon:"\ud83c\udf18",waning_gibbous_moon:"\ud83c\udf16",warning:"⚠️",wastebasket:"\ud83d\uddd1",watch:"⌚️",water_buffalo:"\ud83d\udc03",watermelon:"\ud83c\udf49",wave:"\ud83d\udc4b",wavy_dash:"〰️",waxing_crescent_moon:"\ud83c\udf12",wc:"\ud83d\udebe",weary:"\ud83d\ude29",wedding:"\ud83d\udc92",weight_lifting_man:"\ud83c\udfcb️",weight_lifting_woman:"\ud83c\udfcb️‍♀️",whale:"\ud83d\udc33",whale2:"\ud83d\udc0b",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"\ud83c\udff3️",white_flower:"\ud83d\udcae",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"\ud83d\udd33",wilted_flower:"\ud83e\udd40",wind_chime:"\ud83c\udf90",wind_face:"\ud83c\udf2c",wine_glass:"\ud83c\udf77",wink:"\ud83d\ude09",wolf:"\ud83d\udc3a",woman:"\ud83d\udc69",woman_artist:"\ud83d\udc69‍\ud83c\udfa8",woman_astronaut:"\ud83d\udc69‍\ud83d\ude80",woman_cartwheeling:"\ud83e\udd38‍♀️",woman_cook:"\ud83d\udc69‍\ud83c\udf73",woman_facepalming:"\ud83e\udd26‍♀️",woman_factory_worker:"\ud83d\udc69‍\ud83c\udfed",woman_farmer:"\ud83d\udc69‍\ud83c\udf3e",woman_firefighter:"\ud83d\udc69‍\ud83d\ude92",woman_health_worker:"\ud83d\udc69‍⚕️",woman_judge:"\ud83d\udc69‍⚖️",woman_juggling:"\ud83e\udd39‍♀️",woman_mechanic:"\ud83d\udc69‍\ud83d\udd27",woman_office_worker:"\ud83d\udc69‍\ud83d\udcbc",woman_pilot:"\ud83d\udc69‍✈️",woman_playing_handball:"\ud83e\udd3e‍♀️",woman_playing_water_polo:"\ud83e\udd3d‍♀️",woman_scientist:"\ud83d\udc69‍\ud83d\udd2c",woman_shrugging:"\ud83e\udd37‍♀️",woman_singer:"\ud83d\udc69‍\ud83c\udfa4",woman_student:"\ud83d\udc69‍\ud83c\udf93",woman_teacher:"\ud83d\udc69‍\ud83c\udfeb",woman_technologist:"\ud83d\udc69‍\ud83d\udcbb",woman_with_turban:"\ud83d\udc73‍♀️",womans_clothes:"\ud83d\udc5a",womans_hat:"\ud83d\udc52",women_wrestling:"\ud83e\udd3c‍♀️",womens:"\ud83d\udeba",world_map:"\ud83d\uddfa",worried:"\ud83d\ude1f",wrench:"\ud83d\udd27",writing_hand:"✍️",x:"❌",yellow_heart:"\ud83d\udc9b",yen:"\ud83d\udcb4",yin_yang:"☯️",yum:"\ud83d\ude0b",zap:"⚡️",zipper_mouth_face:"\ud83e\udd10",zzz:"\ud83d\udca4",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:"<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"},n.Converter=function(e){"use strict";var t={},r=[],d=[],c={},l=a,p={parsed:{},raw:"",format:""};for(var f in e=e||{},o)o.hasOwnProperty(f)&&(t[f]=o[f]);if("object"==typeof e)for(var h in e)e.hasOwnProperty(h)&&(t[h]=e[h]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof e+" was passed instead.");function m(e,t){if(t=t||null,n.helper.isString(e)){if(t=e=n.helper.stdExtName(e),n.extensions[e]){console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),function(e,t){"function"==typeof e&&(e=e(new n.Converter)),n.helper.isArray(e)||(e=[e]);var i=s(e,t);if(!i.valid)throw Error(i.error);for(var o=0;o<e.length;++o)switch(e[o].type){case"lang":r.push(e[o]);break;case"output":d.push(e[o]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}(n.extensions[e],e);return}if(n.helper.isUndefined(i[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=i[e]}"function"==typeof e&&(e=e()),n.helper.isArray(e)||(e=[e]);var o=s(e,t);if(!o.valid)throw Error(o.error);for(var a=0;a<e.length;++a){switch(e[a].type){case"lang":r.push(e[a]);break;case"output":d.push(e[a])}if(e[a].hasOwnProperty("listeners"))for(var u in e[a].listeners)e[a].listeners.hasOwnProperty(u)&&_(u,e[a].listeners[u])}}function _(e,t){if(!n.helper.isString(e))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof e+" given");if("function"!=typeof t)throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof t+" given");c.hasOwnProperty(e)||(c[e]=[]),c[e].push(t)}t.extensions&&n.helper.forEach(t.extensions,m),this._dispatch=function(e,t,n,r){if(c.hasOwnProperty(e))for(var i=0;i<c[e].length;++i){var o=c[e][i](e,t,this,n,r);o&&void 0!==o&&(t=o)}return t},this.listen=function(e,t){return _(e,t),this},this.makeHtml=function(e){if(!e)return e;var i,o,a={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:r,outputModifiers:d,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return e=(e=(e=(e=(e=e.replace(/¨/g,"\xa8T")).replace(/\$/g,"\xa8D")).replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/\u00A0/g," "),t.smartIndentationFix&&(o=RegExp("^\\s{0,"+(i=e).match(/^\s*/)[0].length+"}","gm"),e=i.replace(o,"")),e="\n\n"+e+"\n\n",e=(e=n.subParser("detab")(e,t,a)).replace(/^[ \t]+$/mg,""),n.helper.forEach(r,function(r){e=n.subParser("runExtension")(r,e,t,a)}),e=n.subParser("metadata")(e,t,a),e=n.subParser("hashPreCodeTags")(e,t,a),e=n.subParser("githubCodeBlocks")(e,t,a),e=n.subParser("hashHTMLBlocks")(e,t,a),e=n.subParser("hashCodeTags")(e,t,a),e=n.subParser("stripLinkDefinitions")(e,t,a),e=n.subParser("blockGamut")(e,t,a),e=n.subParser("unhashHTMLSpans")(e,t,a),e=(e=(e=n.subParser("unescapeSpecialChars")(e,t,a)).replace(/¨D/g,"$$")).replace(/¨T/g,"\xa8"),e=n.subParser("completeHTMLDocument")(e,t,a),n.helper.forEach(d,function(r){e=n.subParser("runExtension")(r,e,t,a)}),p=a.metadata,e},this.makeMarkdown=this.makeMd=function(e,t){if(e=(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/>[ \t]+</,">\xa8NBSP;<"),!t)if(window&&window.document)t=window.document;else throw Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var r=t.createElement("div");r.innerHTML=e;var i={preList:function(e){for(var t=e.querySelectorAll("pre"),r=[],i=0;i<t.length;++i)if(1===t[i].childElementCount&&"code"===t[i].firstChild.tagName.toLowerCase()){var o=t[i].firstChild.innerHTML.trim(),a=t[i].firstChild.getAttribute("data-language")||"";if(""===a)for(var u=t[i].firstChild.className.split(" "),s=0;s<u.length;++s){var d=u[s].match(/^language-(.+)$/);if(null!==d){a=d[1];break}}o=n.helper.unescapeHTMLEntities(o),r.push(o),t[i].outerHTML='<precode language="'+a+'" precodenum="'+i.toString()+'"></precode>'}else r.push(t[i].innerHTML),t[i].innerHTML="",t[i].setAttribute("prenum",i.toString());return r}(r)};!function e(t){for(var n=0;n<t.childNodes.length;++n){var r=t.childNodes[n];3===r.nodeType?/\S/.test(r.nodeValue)||/^[ ]+$/.test(r.nodeValue)?(r.nodeValue=r.nodeValue.split("\n").join(" "),r.nodeValue=r.nodeValue.replace(/(\s)+/g,"$1")):(t.removeChild(r),--n):1===r.nodeType&&e(r)}}(r);for(var o=r.childNodes,a="",u=0;u<o.length;u++)a+=n.subParser("makeMarkdown.node")(o[u],i);return a},this.setOption=function(e,n){t[e]=n},this.getOption=function(e){return t[e]},this.getOptions=function(){return t},this.addExtension=function(e,t){m(e,t=t||null)},this.useExtension=function(e){m(e)},this.setFlavor=function(e){if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");var n=u[e];for(var r in l=e,n)n.hasOwnProperty(r)&&(t[r]=n[r])},this.getFlavor=function(){return l},this.removeExtension=function(e){n.helper.isArray(e)||(e=[e]);for(var t=0;t<e.length;++t){for(var i=e[t],o=0;o<r.length;++o)r[o]===i&&r.splice(o,1);for(var a=0;a<d.length;++a)d[a]===i&&d.splice(a,1)}},this.getAllExtensions=function(){return{language:r,output:d}},this.getMetadata=function(e){return e?p.raw:p.parsed},this.getMetadataFormat=function(){return p.format},this._setMetadataPair=function(e,t){p.parsed[e]=t},this._setMetadataFormat=function(e){p.format=e},this._setMetadataRaw=function(e){p.raw=e}},n.subParser("anchors",function(e,t,r){"use strict";e=r.converter._dispatch("anchors.before",e,t,r);var i=function(e,i,o,a,u,s,d){if(n.helper.isUndefined(d)&&(d=""),o=o.toLowerCase(),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)a="";else if(!a){if(o||(o=i.toLowerCase().replace(/ ?\n/g," ")),a="#"+o,n.helper.isUndefined(r.gUrls[o]))return e;a=r.gUrls[o],n.helper.isUndefined(r.gTitles[o])||(d=r.gTitles[o])}var c='<a href="'+(a=a.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback))+'"';return""!==d&&null!==d&&(c+=' title="'+(d=(d=d.replace(/"/g,""")).replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback))+'"'),t.openLinksInNewWindow&&!/^#/.test(a)&&(c+=' rel="noopener noreferrer" target="\xa8E95Eblank"'),c+=">"+i+"</a>"};return e=(e=(e=(e=e.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,i)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,i)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,i)).replace(/\[([^\[\]]+)]()()()()()/g,i),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(e,r,i,o,a){if("\\"===i)return r+o;if(!n.helper.isString(t.ghMentionsLink))throw Error("ghMentionsLink option must be a string");var u=t.ghMentionsLink.replace(/\{u}/g,a),s="";return t.openLinksInNewWindow&&(s=' rel="noopener noreferrer" target="\xa8E95Eblank"'),r+'<a href="'+u+'"'+s+">"+o+"</a>"})),e=r.converter._dispatch("anchors.after",e,t,r)});var l=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,p=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,f=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,h=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,m=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,_=function(e){return function(t,r,i,o,a,u,s){var d=i=i.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback),c="",l="";return/^www\./i.test(i)&&(i=i.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&u&&(c=u),e.openLinksInNewWindow&&(l=' rel="noopener noreferrer" target="\xa8E95Eblank"'),(r||"")+'<a href="'+i+'"'+l+">"+d+"</a>"+c+(s||"")}},g=function(e,t){return function(r,i,o){var a="mailto:";return i=i||"",o=n.subParser("unescapeSpecialChars")(o,e,t),e.encodeEmails?(a=n.helper.encodeEmailAddress(a+o),o=n.helper.encodeEmailAddress(o)):a+=o,i+'<a href="'+a+'">'+o+"</a>"}};n.subParser("autoLinks",function(e,t,n){return e=(e=(e=n.converter._dispatch("autoLinks.before",e,t,n)).replace(f,_(t))).replace(m,g(t,n)),e=n.converter._dispatch("autoLinks.after",e,t,n)}),n.subParser("simplifiedAutoLinks",function(e,t,n){return t.simplifiedAutoLink?(e=n.converter._dispatch("simplifiedAutoLinks.before",e,t,n),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(p,_(t)):e.replace(l,_(t))).replace(h,g(t,n)),e=n.converter._dispatch("simplifiedAutoLinks.after",e,t,n)):e}),n.subParser("blockGamut",function(e,t,r){return e=r.converter._dispatch("blockGamut.before",e,t,r),e=n.subParser("blockQuotes")(e,t,r),e=n.subParser("headers")(e,t,r),e=n.subParser("horizontalRule")(e,t,r),e=n.subParser("lists")(e,t,r),e=n.subParser("codeBlocks")(e,t,r),e=n.subParser("tables")(e,t,r),e=n.subParser("hashHTMLBlocks")(e,t,r),e=n.subParser("paragraphs")(e,t,r),e=r.converter._dispatch("blockGamut.after",e,t,r)}),n.subParser("blockQuotes",function(e,t,r){"use strict";e=r.converter._dispatch("blockQuotes.before",e,t,r)+"\n\n";var i=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(i=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(i,function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=n.subParser("githubCodeBlocks")(e,t,r),e=(e=(e=n.subParser("blockGamut")(e,t,r)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(e,t){var n=t;return(n=n.replace(/^ /mg,"\xa80")).replace(/¨0/g,"")}),n.subParser("hashBlock")("<blockquote>\n"+e+"\n</blockquote>",t,r)}),e=r.converter._dispatch("blockQuotes.after",e,t,r)}),n.subParser("codeBlocks",function(e,t,r){return e=(e=(e=r.converter._dispatch("codeBlocks.before",e,t,r)+"\xa80").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,function(e,i,o){var a=i,u="\n";return a=n.subParser("outdent")(a,t,r),a=n.subParser("encodeCode")(a,t,r),a=(a=(a=n.subParser("detab")(a,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(u=""),a="<pre><code>"+a+u+"</code></pre>",n.subParser("hashBlock")(a,t,r)+o})).replace(/¨0/,""),e=r.converter._dispatch("codeBlocks.after",e,t,r)}),n.subParser("codeSpans",function(e,t,r){return void 0===(e=r.converter._dispatch("codeSpans.before",e,t,r))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,i,o,a){var u=a;return u=(u=u.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),u=i+"<code>"+(u=n.subParser("encodeCode")(u,t,r))+"</code>",u=n.subParser("hashHTMLSpans")(u,t,r)}),e=r.converter._dispatch("codeSpans.after",e,t,r)}),n.subParser("completeHTMLDocument",function(e,t,n){"use strict";if(!t.completeHTMLDocument)return e;e=n.converter._dispatch("completeHTMLDocument.before",e,t,n);var r="html",i="<!DOCTYPE HTML>\n",o="",a='<meta charset="utf-8">\n',u="",s="";for(var d in void 0!==n.metadata.parsed.doctype&&(i="<!DOCTYPE "+n.metadata.parsed.doctype+">\n",("html"===(r=n.metadata.parsed.doctype.toString().toLowerCase())||"html5"===r)&&(a='<meta charset="utf-8">')),n.metadata.parsed)if(n.metadata.parsed.hasOwnProperty(d))switch(d.toLowerCase()){case"doctype":break;case"title":o="<title>"+n.metadata.parsed.title+"</title>\n";break;case"charset":a="html"===r||"html5"===r?'<meta charset="'+n.metadata.parsed.charset+'">\n':'<meta name="charset" content="'+n.metadata.parsed.charset+'">\n';break;case"language":case"lang":u=' lang="'+n.metadata.parsed[d]+'"',s+='<meta name="'+d+'" content="'+n.metadata.parsed[d]+'">\n';break;default:s+='<meta name="'+d+'" content="'+n.metadata.parsed[d]+'">\n'}return e=i+"<html"+u+">\n<head>\n"+o+a+s+"</head>\n<body>\n"+e.trim()+"\n</body>\n</html>",e=n.converter._dispatch("completeHTMLDocument.after",e,t,n)}),n.subParser("detab",function(e,t,n){return e=(e=(e=(e=(e=(e=n.converter._dispatch("detab.before",e,t,n)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"\xa8A\xa8B")).replace(/¨B(.+?)¨A/g,function(e,t){for(var n=t,r=4-n.length%4,i=0;i<r;i++)n+=" ";return n})).replace(/¨A/g," ")).replace(/¨B/g,""),e=n.converter._dispatch("detab.after",e,t,n)}),n.subParser("ellipsis",function(e,t,n){return t.ellipsis?(e=(e=n.converter._dispatch("ellipsis.before",e,t,n)).replace(/\.\.\./g,"…"),e=n.converter._dispatch("ellipsis.after",e,t,n)):e}),n.subParser("emoji",function(e,t,r){return t.emoji?(e=(e=r.converter._dispatch("emoji.before",e,t,r)).replace(/:([\S]+?):/g,function(e,t){return n.helper.emojis.hasOwnProperty(t)?n.helper.emojis[t]:e}),e=r.converter._dispatch("emoji.after",e,t,r)):e}),n.subParser("encodeAmpsAndAngles",function(e,t,n){return e=(e=(e=(e=(e=n.converter._dispatch("encodeAmpsAndAngles.before",e,t,n)).replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&")).replace(/<(?![a-z\/?$!])/gi,"<")).replace(/</g,"<")).replace(/>/g,">"),e=n.converter._dispatch("encodeAmpsAndAngles.after",e,t,n)}),n.subParser("encodeBackslashEscapes",function(e,t,r){return e=(e=(e=r.converter._dispatch("encodeBackslashEscapes.before",e,t,r)).replace(/\\(\\)/g,n.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,n.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeBackslashEscapes.after",e,t,r)}),n.subParser("encodeCode",function(e,t,r){return e=(e=r.converter._dispatch("encodeCode.before",e,t,r)).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/([*_{}\[\]\\=~-])/g,n.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeCode.after",e,t,r)}),n.subParser("escapeSpecialCharsWithinTagAttributes",function(e,t,r){return e=(e=(e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,r)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)})).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,function(e){return e.replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)}),e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,r)}),n.subParser("githubCodeBlocks",function(e,t,r){return t.ghCodeBlocks?(e=(e=(e=r.converter._dispatch("githubCodeBlocks.before",e,t,r)+"\xa80").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(e,i,o,a){var u=t.omitExtraWLInCodeBlocks?"":"\n";return a=n.subParser("encodeCode")(a,t,r),a="<pre><code"+(o?' class="'+o+" language-"+o+'"':"")+">"+(a=(a=(a=n.subParser("detab")(a,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+u+"</code></pre>",a=n.subParser("hashBlock")(a,t,r),"\n\n\xa8G"+(r.ghCodeBlocks.push({text:e,codeblock:a})-1)+"G\n\n"})).replace(/¨0/,""),r.converter._dispatch("githubCodeBlocks.after",e,t,r)):e}),n.subParser("hashBlock",function(e,t,n){return e=(e=n.converter._dispatch("hashBlock.before",e,t,n)).replace(/(^\n+|\n+$)/g,""),e="\n\n\xa8K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n",e=n.converter._dispatch("hashBlock.after",e,t,n)}),n.subParser("hashCodeTags",function(e,t,r){return e=r.converter._dispatch("hashCodeTags.before",e,t,r),e=n.helper.replaceRecursiveRegExp(e,function(e,i,o,a){var u=o+n.subParser("encodeCode")(i,t,r)+a;return"\xa8C"+(r.gHtmlSpans.push(u)-1)+"C"},"<code\\b[^>]*>","</code>","gim"),e=r.converter._dispatch("hashCodeTags.after",e,t,r)}),n.subParser("hashElement",function(e,t,n){return function(e,t){var r=t;return r=(r=(r=r.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),r="\n\n\xa8K"+(n.gHtmlBlocks.push(r)-1)+"K\n\n"}}),n.subParser("hashHTMLBlocks",function(e,t,r){"use strict";e=r.converter._dispatch("hashHTMLBlocks.before",e,t,r);var i=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],o=function(e,t,n,i){var o=e;return -1!==n.search(/\bmarkdown\b/)&&(o=n+r.converter.makeHtml(t)+i),"\n\n\xa8K"+(r.gHtmlBlocks.push(o)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,function(e,t){return"<"+t+">"}));for(var a=0;a<i.length;++a)for(var u,s=RegExp("^ {0,3}(<"+i[a]+"\\b[^>]*>)","im"),d="<"+i[a]+"\\b[^>]*>",c="</"+i[a]+">";-1!==(u=n.helper.regexIndexOf(e,s));){var l=n.helper.splitAtIndex(e,u),p=n.helper.replaceRecursiveRegExp(l[1],o,d,c,"im");if(p===l[1])break;e=l[0].concat(p)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(e,t,r)),e=(e=n.helper.replaceRecursiveRegExp(e,function(e){return"\n\n\xa8K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n"},"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(e,t,r)),e=r.converter._dispatch("hashHTMLBlocks.after",e,t,r)}),n.subParser("hashHTMLSpans",function(e,t,n){"use strict";function r(e){return"\xa8C"+(n.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=n.converter._dispatch("hashHTMLSpans.before",e,t,n)).replace(/<[^>]+?\/>/gi,function(e){return r(e)})).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(e){return r(e)})).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(e){return r(e)})).replace(/<[^>]+?>/gi,function(e){return r(e)}),e=n.converter._dispatch("hashHTMLSpans.after",e,t,n)}),n.subParser("unhashHTMLSpans",function(e,t,n){"use strict";e=n.converter._dispatch("unhashHTMLSpans.before",e,t,n);for(var r=0;r<n.gHtmlSpans.length;++r){for(var i=n.gHtmlSpans[r],o=0;/¨C(\d+)C/.test(i);){var a=RegExp.$1;if(i=i.replace("\xa8C"+a+"C",n.gHtmlSpans[a]),10===o){console.error("maximum nesting of 10 spans reached!!!");break}++o}e=e.replace("\xa8C"+r+"C",i)}return n.converter._dispatch("unhashHTMLSpans.after",e,t,n)}),n.subParser("hashPreCodeTags",function(e,t,r){return e=r.converter._dispatch("hashPreCodeTags.before",e,t,r),e=n.helper.replaceRecursiveRegExp(e,function(e,i,o,a){var u=o+n.subParser("encodeCode")(i,t,r)+a;return"\n\n\xa8G"+(r.ghCodeBlocks.push({text:e,codeblock:u})-1)+"G\n\n"},"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),e=r.converter._dispatch("hashPreCodeTags.after",e,t,r)}),n.subParser("headers",function(e,t,r){"use strict";e=r.converter._dispatch("headers.before",e,t,r);var i=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),o=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,a=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(o,function(e,o){var a=n.subParser("spanGamut")(o,t,r),u="<h"+i+(t.noHeaderId?"":' id="'+s(o)+'"')+">"+a+"</h"+i+">";return n.subParser("hashBlock")(u,t,r)})).replace(a,function(e,o){var a=n.subParser("spanGamut")(o,t,r),u=t.noHeaderId?"":' id="'+s(o)+'"',d=i+1,c="<h"+d+u+">"+a+"</h"+d+">";return n.subParser("hashBlock")(c,t,r)});var u=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function s(e){var i,o;if(t.customizedHeaderId){var a=e.match(/\{([^{]+?)}\s*$/);a&&a[1]&&(e=a[1])}return i=e,o=n.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(i=o+i),i=t.ghCompatibleHeaderId?i.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?i.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"\xa8").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():i.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(i=o+i),r.hashLinkCounts[i]?i=i+"-"+r.hashLinkCounts[i]++:r.hashLinkCounts[i]=1,i}return e=e.replace(u,function(e,o,a){var u=a;t.customizedHeaderId&&(u=a.replace(/\s?\{([^{]+?)}\s*$/,""));var d=n.subParser("spanGamut")(u,t,r),c=t.noHeaderId?"":' id="'+s(a)+'"',l=i-1+o.length,p="<h"+l+c+">"+d+"</h"+l+">";return n.subParser("hashBlock")(p,t,r)}),e=r.converter._dispatch("headers.after",e,t,r)}),n.subParser("horizontalRule",function(e,t,r){"use strict";e=r.converter._dispatch("horizontalRule.before",e,t,r);var i=n.subParser("hashBlock")("<hr />",t,r);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,i)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,i)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,i),e=r.converter._dispatch("horizontalRule.after",e,t,r)}),n.subParser("images",function(e,t,r){"use strict";function i(e,t,i,o,a,u,s,d){var c=r.gUrls,l=r.gTitles,p=r.gDimensions;if(i=i.toLowerCase(),d||(d=""),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)o="";else if(""===o||null===o){if((""===i||null===i)&&(i=t.toLowerCase().replace(/ ?\n/g," ")),o="#"+i,n.helper.isUndefined(c[i]))return e;o=c[i],n.helper.isUndefined(l[i])||(d=l[i]),n.helper.isUndefined(p[i])||(a=p[i].width,u=p[i].height)}t=t.replace(/"/g,""").replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback);var f='<img src="'+(o=o.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback))+'" alt="'+t+'"';return d&&n.helper.isString(d)&&(f+=' title="'+(d=d.replace(/"/g,""").replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback))+'"'),a&&u&&(f+=' width="'+(a="*"===a?"auto":a)+'"'+(' height="'+(u="*"===u?"auto":u))+'"'),f+=" />"}return e=(e=(e=(e=(e=(e=r.converter._dispatch("images.before",e,t,r)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,i)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,function(e,t,n,r,o,a,u,s){return i(e,t,n,r=r.replace(/\s/g,""),o,a,u,s)})).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,i)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,i)).replace(/!\[([^\[\]]+)]()()()()()/g,i),e=r.converter._dispatch("images.after",e,t,r)}),n.subParser("italicsAndBold",function(e,t,n){return e=n.converter._dispatch("italicsAndBold.before",e,t,n),e=t.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,t){return"<strong><em>"+t+"</em></strong>"})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,t){return"<strong>"+t+"</strong>"})).replace(/\b_(\S[\s\S]*?)_\b/g,function(e,t){return"<em>"+t+"</em>"}):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,t){return/\S$/.test(t)?"<strong><em>"+t+"</em></strong>":e})).replace(/__(\S[\s\S]*?)__/g,function(e,t){return/\S$/.test(t)?"<strong>"+t+"</strong>":e})).replace(/_([^\s_][\s\S]*?)_/g,function(e,t){return/\S$/.test(t)?"<em>"+t+"</em>":e}),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(e,t,n){return t+"<strong><em>"+n+"</em></strong>"})).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(e,t,n){return t+"<strong>"+n+"</strong>"})).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(e,t,n){return t+"<em>"+n+"</em>"}):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(e,t){return/\S$/.test(t)?"<strong><em>"+t+"</em></strong>":e})).replace(/\*\*(\S[\s\S]*?)\*\*/g,function(e,t){return/\S$/.test(t)?"<strong>"+t+"</strong>":e})).replace(/\*([^\s*][\s\S]*?)\*/g,function(e,t){return/\S$/.test(t)?"<em>"+t+"</em>":e}),e=n.converter._dispatch("italicsAndBold.after",e,t,n)}),n.subParser("lists",function(e,t,r){"use strict";function i(e,i){r.gListLevel++,e=e.replace(/\n{2,}$/,"\n")+"\xa80";var o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,a=/\n[ \t]*\n(?!¨0)/.test(e);return t.disableForced4SpacesIndentedSublists&&(o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(o,function(e,i,o,u,s,d,c){c=c&&""!==c.trim();var l=n.subParser("outdent")(s,t,r),p="";return d&&t.tasklists&&(p=' class="task-list-item" style="list-style-type: none;"',l=l.replace(/^[ \t]*\[(x|X| )?]/m,function(){var e='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return c&&(e+=" checked"),e+=">"})),l=l.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,function(e){return"\xa8A"+e}),i||l.search(/\n{2,}/)>-1?(l=n.subParser("githubCodeBlocks")(l,t,r),l=n.subParser("blockGamut")(l,t,r)):(l=(l=n.subParser("lists")(l,t,r)).replace(/\n$/,""),l=(l=n.subParser("hashHTMLBlocks")(l,t,r)).replace(/\n\n+/g,"\n\n"),l=a?n.subParser("paragraphs")(l,t,r):n.subParser("spanGamut")(l,t,r)),l="<li"+p+">"+(l=l.replace("\xa8A",""))+"</li>\n"})).replace(/¨0/g,""),r.gListLevel--,i&&(e=e.replace(/\s+$/,"")),e}function o(e,t){if("ol"===t){var n=e.match(/^ *(\d+)\./);if(n&&"1"!==n[1])return' start="'+n[1]+'"'}return""}function a(e,n,r){var a=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,u=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,s="ul"===n?a:u,d="";if(-1!==e.search(s))!function t(c){var l=c.search(s),p=o(e,n);-1!==l?(d+="\n\n<"+n+p+">\n"+i(c.slice(0,l),!!r)+"</"+n+">\n",s="ul"==(n="ul"===n?"ol":"ul")?a:u,t(c.slice(l))):d+="\n\n<"+n+p+">\n"+i(c,!!r)+"</"+n+">\n"}(e);else{var c=o(e,n);d="\n\n<"+n+c+">\n"+i(e,!!r)+"</"+n+">\n"}return d}return e=r.converter._dispatch("lists.before",e,t,r)+"\xa80",e=(e=r.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(e,t,n){return a(t,n.search(/[*+-]/g)>-1?"ul":"ol",!0)}):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(e,t,n,r){return a(n,r.search(/[*+-]/g)>-1?"ul":"ol",!1)})).replace(/¨0/,""),e=r.converter._dispatch("lists.after",e,t,r)}),n.subParser("metadata",function(e,t,n){"use strict";if(!t.metadata)return e;function r(e){n.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,function(e,t,r){return n.metadata.parsed[t]=r,""})}return e=(e=(e=(e=n.converter._dispatch("metadata.before",e,t,n)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(e,t,n){return r(n),"\xa8M"})).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(e,t,i){return t&&(n.metadata.format=t),r(i),"\xa8M"})).replace(/¨M/g,""),e=n.converter._dispatch("metadata.after",e,t,n)}),n.subParser("outdent",function(e,t,n){return e=(e=(e=n.converter._dispatch("outdent.before",e,t,n)).replace(/^(\t|[ ]{1,4})/gm,"\xa80")).replace(/¨0/g,""),e=n.converter._dispatch("outdent.after",e,t,n)}),n.subParser("paragraphs",function(e,t,r){"use strict";for(var i=(e=(e=(e=r.converter._dispatch("paragraphs.before",e,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),o=[],a=i.length,u=0;u<a;u++){var s=i[u];s.search(/¨(K|G)(\d+)\1/g)>=0?o.push(s):s.search(/\S/)>=0&&(s=(s=n.subParser("spanGamut")(s,t,r)).replace(/^([ \t]*)/g,"<p>")+"</p>",o.push(s))}for(u=0,a=o.length;u<a;u++){for(var d="",c=o[u],l=!1;/¨(K|G)(\d+)\1/.test(c);){var p=RegExp.$2;d=(d="K"===RegExp.$1?r.gHtmlBlocks[p]:l?n.subParser("encodeCode")(r.ghCodeBlocks[p].text,t,r):r.ghCodeBlocks[p].codeblock).replace(/\$/g,"$$$$"),c=c.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,d),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(c)&&(l=!0)}o[u]=c}return e=(e=(e=o.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),r.converter._dispatch("paragraphs.after",e,t,r)}),n.subParser("runExtension",function(e,t,n,r){"use strict";if(e.filter)t=e.filter(t,r.converter,n);else if(e.regex){var i=e.regex;i instanceof RegExp||(i=RegExp(i,"g")),t=t.replace(i,e.replace)}return t}),n.subParser("spanGamut",function(e,t,r){return e=r.converter._dispatch("spanGamut.before",e,t,r),e=n.subParser("codeSpans")(e,t,r),e=n.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,r),e=n.subParser("encodeBackslashEscapes")(e,t,r),e=n.subParser("images")(e,t,r),e=n.subParser("anchors")(e,t,r),e=n.subParser("autoLinks")(e,t,r),e=n.subParser("simplifiedAutoLinks")(e,t,r),e=n.subParser("emoji")(e,t,r),e=n.subParser("underline")(e,t,r),e=n.subParser("italicsAndBold")(e,t,r),e=n.subParser("strikethrough")(e,t,r),e=n.subParser("ellipsis")(e,t,r),e=n.subParser("hashHTMLSpans")(e,t,r),e=n.subParser("encodeAmpsAndAngles")(e,t,r),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"<br />\n")):e=e.replace(/ +\n/g,"<br />\n"),e=r.converter._dispatch("spanGamut.after",e,t,r)}),n.subParser("strikethrough",function(e,t,r){return t.strikethrough&&(e=(e=r.converter._dispatch("strikethrough.before",e,t,r)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(e,i){var o;return o=i,t.simplifiedAutoLink&&(o=n.subParser("simplifiedAutoLinks")(o,t,r)),"<del>"+o+"</del>"}),e=r.converter._dispatch("strikethrough.after",e,t,r)),e}),n.subParser("stripLinkDefinitions",function(e,t,r){"use strict";e+="\xa80";var i=function(i,o,a,u,s,d,c){return(o=o.toLowerCase(),e.toLowerCase().split(o).length-1<2)?i:(a.match(/^data:.+?\/.+?;base64,/)?r.gUrls[o]=a.replace(/\s/g,""):r.gUrls[o]=n.subParser("encodeAmpsAndAngles")(a,t,r),d)?d+c:(c&&(r.gTitles[o]=c.replace(/"|'/g,""")),t.parseImgDimensions&&u&&s&&(r.gDimensions[o]={width:u,height:s}),"")};return e=(e=(e=e.replace(/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,i)).replace(/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,i)).replace(/¨0/,"")}),n.subParser("tables",function(e,t,r){"use strict";if(!t.tables)return e;function i(e){var i,o=e.split("\n");for(i=0;i<o.length;++i)/^ {0,3}\|/.test(o[i])&&(o[i]=o[i].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(o[i])&&(o[i]=o[i].replace(/\|[ \t]*$/,"")),o[i]=n.subParser("codeSpans")(o[i],t,r);var a=o[0].split("|").map(function(e){return e.trim()}),u=o[1].split("|").map(function(e){return e.trim()}),s=[],d=[],c=[],l=[];for(o.shift(),o.shift(),i=0;i<o.length;++i)""!==o[i].trim()&&s.push(o[i].split("|").map(function(e){return e.trim()}));if(a.length<u.length)return e;for(i=0;i<u.length;++i){c.push((p=u[i],/^:[ \t]*--*$/.test(p)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(p)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(p)?' style="text-align:center;"':""))}for(i=0;i<a.length;++i)n.helper.isUndefined(c[i])&&(c[i]=""),d.push(function(e,i){var o="";return e=e.trim(),(t.tablesHeaderId||t.tableHeaderId)&&(o=' id="'+e.replace(/ /g,"_").toLowerCase()+'"'),"<th"+o+i+">"+(e=n.subParser("spanGamut")(e,t,r))+"</th>\n"}(a[i],c[i]));for(i=0;i<s.length;++i){for(var p,f,h=[],m=0;m<d.length;++m)n.helper.isUndefined(s[i][m]),h.push((f=s[i][m],"<td"+c[m]+">"+n.subParser("spanGamut")(f,t,r)+"</td>\n"));l.push(h)}for(var _="<table>\n<thead>\n<tr>\n",g=d.length,b=0;b<g;++b)_+=d[b];for(_+="</tr>\n</thead>\n<tbody>\n",b=0;b<l.length;++b){_+="<tr>\n";for(var y=0;y<g;++y)_+=l[b][y];_+="</tr>\n"}return _+"</tbody>\n</table>\n"}return e=(e=(e=(e=r.converter._dispatch("tables.before",e,t,r)).replace(/\\(\|)/g,n.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,i)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,i),e=r.converter._dispatch("tables.after",e,t,r)}),n.subParser("underline",function(e,t,r){return t.underline?(e=r.converter._dispatch("underline.before",e,t,r),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,t){return"<u>"+t+"</u>"})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,t){return"<u>"+t+"</u>"}):(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e})).replace(/__(\S[\s\S]*?)__/g,function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e})).replace(/(_)/g,n.helper.escapeCharactersCallback),e=r.converter._dispatch("underline.after",e,t,r)):e}),n.subParser("unescapeSpecialChars",function(e,t,n){return e=(e=n.converter._dispatch("unescapeSpecialChars.before",e,t,n)).replace(/¨E(\d+)E/g,function(e,t){return String.fromCharCode(parseInt(t))}),e=n.converter._dispatch("unescapeSpecialChars.after",e,t,n)}),n.subParser("makeMarkdown.blockquote",function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var i=e.childNodes,o=i.length,a=0;a<o;++a){var u=n.subParser("makeMarkdown.node")(i[a],t);""!==u&&(r+=u)}return"> "+(r=r.trim()).split("\n").join("\n> ")}),n.subParser("makeMarkdown.codeBlock",function(e,t){"use strict";var n=e.getAttribute("language"),r=e.getAttribute("precodenum");return"```"+n+"\n"+t.preList[r]+"\n```"}),n.subParser("makeMarkdown.codeSpan",function(e){return"`"+e.innerHTML+"`"}),n.subParser("makeMarkdown.emphasis",function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="*";for(var i=e.childNodes,o=i.length,a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t);r+="*"}return r}),n.subParser("makeMarkdown.header",function(e,t,r){"use strict";var i=Array(r+1).join("#"),o="";if(e.hasChildNodes()){o=i+" ";for(var a=e.childNodes,u=a.length,s=0;s<u;++s)o+=n.subParser("makeMarkdown.node")(a[s],t)}return o}),n.subParser("makeMarkdown.hr",function(){return"---"}),n.subParser("makeMarkdown.image",function(e){"use strict";var t="";return e.hasAttribute("src")&&(t+=")+">",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t}),n.subParser("makeMarkdown.links",function(e,t){"use strict";var r="";if(e.hasChildNodes()&&e.hasAttribute("href")){var i=e.childNodes,o=i.length;r="[";for(var a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t);r+="](",r+="<"+e.getAttribute("href")+">",e.hasAttribute("title")&&(r+=' "'+e.getAttribute("title")+'"'),r+=")"}return r}),n.subParser("makeMarkdown.list",function(e,t,r){"use strict";var i="";if(!e.hasChildNodes())return"";for(var o=e.childNodes,a=o.length,u=e.getAttribute("start")||1,s=0;s<a;++s)void 0!==o[s].tagName&&"li"===o[s].tagName.toLowerCase()&&(i+=("ol"===r?u.toString()+". ":"- ")+n.subParser("makeMarkdown.listItem")(o[s],t),++u);return(i+="\n\x3c!-- --\x3e\n").trim()}),n.subParser("makeMarkdown.listItem",function(e,t){"use strict";for(var r="",i=e.childNodes,o=i.length,a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t);return/\n$/.test(r)?r=r.split("\n").join("\n ").replace(/^ {4}$/gm,"").replace(/\n\n+/g,"\n\n"):r+="\n",r}),n.subParser("makeMarkdown.node",function(e,t,r){"use strict";r=r||!1;var i="";if(3===e.nodeType)return n.subParser("makeMarkdown.txt")(e,t);if(8===e.nodeType)return"\x3c!--"+e.data+"--\x3e\n\n";if(1!==e.nodeType)return"";switch(e.tagName.toLowerCase()){case"h1":r||(i=n.subParser("makeMarkdown.header")(e,t,1)+"\n\n");break;case"h2":r||(i=n.subParser("makeMarkdown.header")(e,t,2)+"\n\n");break;case"h3":r||(i=n.subParser("makeMarkdown.header")(e,t,3)+"\n\n");break;case"h4":r||(i=n.subParser("makeMarkdown.header")(e,t,4)+"\n\n");break;case"h5":r||(i=n.subParser("makeMarkdown.header")(e,t,5)+"\n\n");break;case"h6":r||(i=n.subParser("makeMarkdown.header")(e,t,6)+"\n\n");break;case"p":r||(i=n.subParser("makeMarkdown.paragraph")(e,t)+"\n\n");break;case"blockquote":r||(i=n.subParser("makeMarkdown.blockquote")(e,t)+"\n\n");break;case"hr":r||(i=n.subParser("makeMarkdown.hr")(e,t)+"\n\n");break;case"ol":r||(i=n.subParser("makeMarkdown.list")(e,t,"ol")+"\n\n");break;case"ul":r||(i=n.subParser("makeMarkdown.list")(e,t,"ul")+"\n\n");break;case"precode":r||(i=n.subParser("makeMarkdown.codeBlock")(e,t)+"\n\n");break;case"pre":r||(i=n.subParser("makeMarkdown.pre")(e,t)+"\n\n");break;case"table":r||(i=n.subParser("makeMarkdown.table")(e,t)+"\n\n");break;case"code":i=n.subParser("makeMarkdown.codeSpan")(e,t);break;case"em":case"i":i=n.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":i=n.subParser("makeMarkdown.strong")(e,t);break;case"del":i=n.subParser("makeMarkdown.strikethrough")(e,t);break;case"a":i=n.subParser("makeMarkdown.links")(e,t);break;case"img":i=n.subParser("makeMarkdown.image")(e,t);break;default:i=e.outerHTML+"\n\n"}return i}),n.subParser("makeMarkdown.paragraph",function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var i=e.childNodes,o=i.length,a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t);return r.trim()}),n.subParser("makeMarkdown.pre",function(e,t){"use strict";var n=e.getAttribute("prenum");return"<pre>"+t.preList[n]+"</pre>"}),n.subParser("makeMarkdown.strikethrough",function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="~~";for(var i=e.childNodes,o=i.length,a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t);r+="~~"}return r}),n.subParser("makeMarkdown.strong",function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="**";for(var i=e.childNodes,o=i.length,a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t);r+="**"}return r}),n.subParser("makeMarkdown.table",function(e,t){"use strict";var r,i,o="",a=[[],[]],u=e.querySelectorAll("thead>tr>th"),s=e.querySelectorAll("tbody>tr");for(r=0;r<u.length;++r){var d=n.subParser("makeMarkdown.tableCell")(u[r],t),c="---";if(u[r].hasAttribute("style"))switch(u[r].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":c=":---";break;case"text-align:right;":c="---:";break;case"text-align:center;":c=":---:"}a[0][r]=d.trim(),a[1][r]=c}for(r=0;r<s.length;++r){var l=a.push([])-1,p=s[r].getElementsByTagName("td");for(i=0;i<u.length;++i){var f=" ";void 0!==p[i]&&(f=n.subParser("makeMarkdown.tableCell")(p[i],t)),a[l].push(f)}}var h=3;for(r=0;r<a.length;++r)for(i=0;i<a[r].length;++i){var m=a[r][i].length;m>h&&(h=m)}for(r=0;r<a.length;++r){for(i=0;i<a[r].length;++i)1===r?":"===a[r][i].slice(-1)?a[r][i]=n.helper.padEnd(a[r][i].slice(-1),h-1,"-")+":":a[r][i]=n.helper.padEnd(a[r][i],h,"-"):a[r][i]=n.helper.padEnd(a[r][i],h);o+="| "+a[r].join(" | ")+" |\n"}return o.trim()}),n.subParser("makeMarkdown.tableCell",function(e,t){"use strict";var r="";if(!e.hasChildNodes())return"";for(var i=e.childNodes,o=i.length,a=0;a<o;++a)r+=n.subParser("makeMarkdown.node")(i[a],t,!0);return r.trim()}),n.subParser("makeMarkdown.txt",function(e){"use strict";var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),t=(t=(t=(t=(t=(t=(t=(t=(t=n.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}),"function"==typeof define&&define.amd?define(function(){return n}):e.exports?e.exports=n:this.showdown=n}).call(this)},react:function(t){"use strict";t.exports=e}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}};return t[e].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";let e,t,n,o,a,u,s,d,c,l,p;r.r(i),r.d(i,{useMjEngine:()=>cY,Thread:()=>d4,MujianSpinner:()=>dP,useChat:()=>l0,useMujian:()=>dC,MujianProvider:()=>dM,MdRenderer:()=>s6,useChatContext:()=>dN});var f,h,m,_,g,b,y,v,w,k,z,S,E,A={};r.r(A),r.d(A,{base64:()=>t$,base64url:()=>tM,bigint:()=>tJ,boolean:()=>tG,browserEmail:()=>tA,cidrv4:()=>tP,cidrv6:()=>tI,cuid:()=>ts,cuid2:()=>td,date:()=>tZ,datetime:()=>tF,domain:()=>tN,duration:()=>th,e164:()=>tR,email:()=>tw,emoji:()=>tx,extendedDuration:()=>tm,guid:()=>t_,hex:()=>tY,hostname:()=>tC,html5Email:()=>tk,idnEmail:()=>tE,integer:()=>tB,ipv4:()=>tT,ipv6:()=>tj,ksuid:()=>tp,lowercase:()=>tK,mac:()=>tO,md5_base64:()=>t8,md5_base64url:()=>t1,md5_hex:()=>t3,nanoid:()=>tf,null:()=>tW,number:()=>tV,rfc5322Email:()=>tz,sha1_base64:()=>t6,sha1_base64url:()=>t4,sha1_hex:()=>t2,sha256_base64:()=>t5,sha256_base64url:()=>t7,sha256_hex:()=>t9,sha384_base64:()=>nt,sha384_base64url:()=>nn,sha384_hex:()=>ne,sha512_base64:()=>ni,sha512_base64url:()=>no,sha512_hex:()=>nr,string:()=>tH,time:()=>tU,ulid:()=>tc,undefined:()=>tq,unicodeEmail:()=>tS,uppercase:()=>tX,uuid:()=>tg,uuid4:()=>tb,uuid6:()=>ty,uuid7:()=>tv,xid:()=>tl});var x={};r.r(x),r.d(x,{endsWith:()=>iU,gt:()=>iz,gte:()=>iS,includes:()=>iZ,length:()=>iC,lowercase:()=>iR,lt:()=>iw,lte:()=>ik,maxLength:()=>i$,maxSize:()=>iO,mime:()=>iH,minLength:()=>iM,minSize:()=>iP,multipleOf:()=>ij,negative:()=>iA,nonnegative:()=>iT,nonpositive:()=>ix,normalize:()=>iB,overwrite:()=>iJ,positive:()=>iE,property:()=>iF,regex:()=>iN,size:()=>iI,slugify:()=>iq,startsWith:()=>iD,toLowerCase:()=>iG,toUpperCase:()=>iW,trim:()=>iV,uppercase:()=>iL});var T={};r.r(T),r.d(T,{ZodISODate:()=>i9,ZodISODateTime:()=>i6,ZodISODuration:()=>ot,ZodISOTime:()=>i7,date:()=>i5,datetime:()=>i4,duration:()=>on,time:()=>oe});var j={};r.r(j),r.d(j,{ZodAny:()=>aT,ZodArray:()=>aL,ZodBase64:()=>o2,ZodBase64URL:()=>o4,ZodBigInt:()=>ag,ZodBigIntFormat:()=>ay,ZodBoolean:()=>am,ZodCIDRv4:()=>o0,ZodCIDRv6:()=>o8,ZodCUID:()=>oL,ZodCUID2:()=>oD,ZodCatch:()=>uz,ZodCodec:()=>uj,ZodCustom:()=>uU,ZodCustomStringFormat:()=>an,ZodDate:()=>aN,ZodDefault:()=>um,ZodDiscriminatedUnion:()=>aq,ZodE164:()=>o5,ZodEmail:()=>ok,ZodEmoji:()=>oM,ZodEnum:()=>a7,ZodExactOptional:()=>uc,ZodFile:()=>ui,ZodFunction:()=>uZ,ZodGUID:()=>oS,ZodIPv4:()=>oW,ZodIPv6:()=>oY,ZodIntersection:()=>aX,ZodJWT:()=>ae,ZodKSUID:()=>oV,ZodLazy:()=>uC,ZodLiteral:()=>un,ZodMAC:()=>oK,ZodMap:()=>a6,ZodNaN:()=>uE,ZodNanoID:()=>oN,ZodNever:()=>aI,ZodNonOptional:()=>uy,ZodNull:()=>aA,ZodNullable:()=>up,ZodNumber:()=>au,ZodNumberFormat:()=>ad,ZodObject:()=>aU,ZodOptional:()=>us,ZodPipe:()=>ux,ZodPrefault:()=>ug,ZodPromise:()=>uR,ZodReadonly:()=>uP,ZodRecord:()=>a3,ZodSet:()=>a9,ZodString:()=>oy,ZodStringFormat:()=>ow,ZodSuccess:()=>uw,ZodSymbol:()=>ak,ZodTemplateLiteral:()=>u$,ZodTransform:()=>ua,ZodTuple:()=>aQ,ZodType:()=>og,ZodULID:()=>oF,ZodURL:()=>oP,ZodUUID:()=>oA,ZodUndefined:()=>aS,ZodUnion:()=>aB,ZodUnknown:()=>aO,ZodVoid:()=>aM,ZodXID:()=>oJ,ZodXor:()=>aG,_ZodString:()=>ob,_default:()=>u_,_function:()=>uD,any:()=>aj,array:()=>aZ,base64:()=>o6,base64url:()=>o9,bigint:()=>ab,boolean:()=>a_,catch:()=>uS,check:()=>uF,cidrv4:()=>o3,cidrv6:()=>o1,codec:()=>uO,cuid:()=>oZ,cuid2:()=>oU,custom:()=>uH,date:()=>aR,describe:()=>uV,discriminatedUnion:()=>aK,e164:()=>o7,email:()=>oz,emoji:()=>oC,enum:()=>ue,exactOptional:()=>ul,file:()=>uo,float32:()=>al,float64:()=>ap,function:()=>uD,guid:()=>oE,hash:()=>aa,hex:()=>ao,hostname:()=>ai,httpUrl:()=>o$,instanceof:()=>uW,int:()=>ac,int32:()=>af,int64:()=>av,intersection:()=>aY,ipv4:()=>oq,ipv6:()=>oQ,json:()=>uK,jwt:()=>at,keyof:()=>aD,ksuid:()=>oG,lazy:()=>uN,literal:()=>ur,looseObject:()=>aJ,looseRecord:()=>a2,mac:()=>oX,map:()=>a4,meta:()=>uG,nan:()=>uA,nanoid:()=>oR,nativeEnum:()=>ut,never:()=>a$,nonoptional:()=>uv,null:()=>ax,nullable:()=>uf,nullish:()=>uh,number:()=>as,object:()=>aF,optional:()=>ud,partialRecord:()=>a1,pipe:()=>uT,prefault:()=>ub,preprocess:()=>uX,promise:()=>uL,readonly:()=>uI,record:()=>a8,refine:()=>uJ,set:()=>a5,strictObject:()=>aH,string:()=>ov,stringFormat:()=>ar,stringbool:()=>uq,success:()=>uk,superRefine:()=>uB,symbol:()=>az,templateLiteral:()=>uM,transform:()=>uu,tuple:()=>a0,uint32:()=>ah,uint64:()=>aw,ulid:()=>oH,undefined:()=>aE,union:()=>aV,unknown:()=>aP,url:()=>oI,uuid:()=>ox,uuidv4:()=>oT,uuidv6:()=>oj,uuidv7:()=>oO,void:()=>aC,xid:()=>oB,xor:()=>aW});var O=function(){return(O=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function P(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function I(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function u(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,u)}s((r=r.apply(e,t||[])).next())})}function $(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(s){var d=[u,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,d[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&d[0]?r.return:d[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,d[1])).done)return i;switch(r=0,i&&(d=[2&d[0],i.value]),d[0]){case 0:case 1:i=d;break;case 4:return o.label++,{value:d[1],done:!1};case 5:o.label++,r=d[1],d=[0];continue;case 7:d=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===d[0]||2===d[0])){o=0;continue}if(3===d[0]&&(!i||d[1]>i[0]&&d[1]<i[3])){o.label=d[1];break}if(6===d[0]&&o.label<i[1]){o.label=i[1],i=d;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(d);break}i[2]&&o.ops.pop(),o.trys.pop();continue}d=t.call(e,o)}catch(e){d=[6,e],r=0}finally{n=i=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}}function M(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function C(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var N=r("react"),R=r.n(N);let L=function(e){var t=(0,N.useRef)(e);return t.current=e,t};var Z=function(e){return"function"==typeof e},D=!!("undefined"!=typeof window&&window.document&&window.document.createElement);function U(e,t){if(D)return e?Z(e)?e():"current"in e?e.current:e:t}let F=function(e){var t=L(e);(0,N.useEffect)(function(){return function(){t.current()}},[])},H=function(e,t){if(e===t)return!0;for(var n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0};var J=(h=N.useEffect,function(e,t,n){var r=(0,N.useRef)(!1),i=(0,N.useRef)([]),o=(0,N.useRef)([]),a=(0,N.useRef)(void 0);h(function(){var u,s=(Array.isArray(n)?n:[n]).map(function(e){return U(e)});if(!r.current){r.current=!0,i.current=s,o.current=t,a.current=e();return}s.length===i.current.length&&H(i.current,s)&&H(o.current,t)||(null==(u=a.current)||u.call(a),i.current=s,o.current=t,a.current=e())}),F(function(){var e;null==(e=a.current)||e.call(a),r.current=!1})});let B=function(e,t,n){void 0===n&&(n={});var r=n.enable,i=void 0===r||r,o=L(t);J(function(){if(i){var t=U(n.target,window);if(null==t?void 0:t.addEventListener){var r=function(e){return o.current(e)},a=Array.isArray(e)?e:[e];return a.forEach(function(e){t.addEventListener(e,r,{capture:n.capture,once:n.once,passive:n.passive})}),function(){a.forEach(function(e){t.removeEventListener(e,r,{capture:n.capture})})}}}},[e,n.capture,n.once,n.passive,i],n.target)},V=function(e){var t=(0,N.useRef)(e);t.current=(0,N.useMemo)(function(){return e},[e]);var n=(0,N.useRef)(void 0);return n.current||(n.current=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.current.apply(this,e)}),n.current},G=(m=N.useEffect,function(e,t){var n=(0,N.useRef)(!1);m(function(){return function(){n.current=!1}},[]),m(function(){if(n.current)return e();n.current=!0},t)});var W=function(e,t){var n=t.manual,r=t.ready,i=void 0===r||r,o=t.defaultParams,a=void 0===o?[]:o,u=t.refreshDeps,s=t.refreshDepsAction,d=(0,N.useRef)(!1);return d.current=!1,G(function(){!n&&i&&(d.current=!0,e.run.apply(e,C([],M(a),!1)))},[i]),G(function(){!d.current&&(n||(d.current=!0,s?s():e.refresh()))},C([],M(void 0===u?[]:u),!1)),{onBefore:function(){if(!i)return{stopNow:!0}}}};W.onInit=function(e){var t=e.ready;return{loading:!e.manual&&(void 0===t||t)}};let q=function(e,t){var n=(0,N.useRef)({deps:t,obj:void 0,initialized:!1}).current;return!1!==n.initialized&&H(n.deps,t)||(n.deps=t,n.obj=e(),n.initialized=!0),n.obj};var K=new Map,X=function(e,t,n){var r=K.get(e);(null==r?void 0:r.timer)&&clearTimeout(r.timer);var i=void 0;t>-1&&(i=setTimeout(function(){K.delete(e)},t)),K.set(e,O(O({},n),{timer:i}))},Y=new Map,Q=function(e,t){Y.set(e,t),t.then(function(t){return Y.delete(e),t}).catch(function(){Y.delete(e)})},ee={},et=function(e,t){ee[e]&&ee[e].forEach(function(e){return e(t)})},en=function(e,t){return ee[e]||(ee[e]=[]),ee[e].push(t),function(){var n=ee[e].indexOf(t);ee[e].splice(n,1)}};let er=function(e,t){var n=t.cacheKey,r=t.cacheTime,i=void 0===r?3e5:r,o=t.staleTime,a=void 0===o?0:o,u=t.setCache,s=t.getCache,d=(0,N.useRef)(void 0),c=(0,N.useRef)(void 0),l=function(e,t){u?u(t):X(e,i,t),et(e,t.data)},p=function(e,t){return(void 0===t&&(t=[]),s)?s(t):K.get(e)};return(q(function(){if(n){var t=p(n);t&&Object.hasOwnProperty.call(t,"data")&&(e.state.data=t.data,e.state.params=t.params,(-1===a||Date.now()-t.time<=a)&&(e.state.loading=!1)),d.current=en(n,function(t){e.setState({data:t})})}},[]),F(function(){var e;null==(e=d.current)||e.call(d)}),n)?{onBefore:function(e){var t=p(n,e);return t&&Object.hasOwnProperty.call(t,"data")?-1===a||Date.now()-t.time<=a?{loading:!1,data:null==t?void 0:t.data,error:void 0,returnNow:!0}:{data:null==t?void 0:t.data,error:void 0}:{}},onRequest:function(e,t){var r=Y.get(n);return r&&r!==c.current||(c.current=r=e.apply(void 0,C([],M(t),!1)),Q(n,r)),{servicePromise:r}},onSuccess:function(t,r){var i;n&&(null==(i=d.current)||i.call(d),l(n,{data:t,params:r,time:Date.now()}),d.current=en(n,function(t){e.setState({data:t})}))},onMutate:function(t){var r;n&&(null==(r=d.current)||r.call(d),l(n,{data:t,params:e.state.params,time:Date.now()}),d.current=en(n,function(t){e.setState({data:t})}))}}:{}};var ei=r("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/debounce.js"),eo=r.n(ei);let ea=function(e,t){var n=t.debounceWait,r=t.debounceLeading,i=t.debounceTrailing,o=t.debounceMaxWait,a=(0,N.useRef)(void 0),u=(0,N.useMemo)(function(){var e={};return void 0!==r&&(e.leading=r),void 0!==i&&(e.trailing=i),void 0!==o&&(e.maxWait=o),e},[r,i,o]);return((0,N.useEffect)(function(){if(n){var t=e.runAsync.bind(e);return a.current=eo()(function(e){e()},n,u),e.runAsync=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new Promise(function(n,r){var i;null==(i=a.current)||i.call(a,function(){t.apply(void 0,C([],M(e),!1)).then(n).catch(r)})})},function(){var n;null==(n=a.current)||n.cancel(),e.runAsync=t}}},[n,u]),n)?{onCancel:function(){var e;null==(e=a.current)||e.cancel()}}:{}},eu=function(e,t){var n=t.loadingDelay,r=t.ready,i=(0,N.useRef)(void 0);if(!n)return{};var o=function(){i.current&&clearTimeout(i.current)};return{onBefore:function(){return o(),!1!==r&&(i.current=setTimeout(function(){e.setState({loading:!0})},n)),{loading:!1}},onFinally:function(){o()},onCancel:function(){o()}}};function es(){return!D||"hidden"!==document.visibilityState}var ed=new Set;D&&window.addEventListener("visibilitychange",function(){es()&&ed.forEach(function(e){return e()})},!1);let ec=function(e,t){var n=t.pollingInterval,r=t.pollingWhenHidden,i=void 0===r||r,o=t.pollingErrorRetryCount,a=void 0===o?-1:o,u=(0,N.useRef)(void 0),s=(0,N.useRef)(void 0),d=(0,N.useRef)(0),c=function(){var e;u.current&&clearTimeout(u.current),null==(e=s.current)||e.call(s)};return(G(function(){n||c()},[n]),n)?{onBefore:function(){c()},onError:function(){d.current+=1},onSuccess:function(){d.current=0},onFinally:function(){-1===a||-1!==a&&d.current<=a?u.current=setTimeout(function(){if(i||es())e.refresh();else{var t;t=function(){e.refresh()},ed.add(t),s.current=function(){ed.has(t)&&ed.delete(t)}}},n):d.current=0},onCancel:function(){c()}}:{}};var el=new Set;if(D){var ep=function(){es()&&(!D||void 0===navigator.onLine||navigator.onLine)&&el.forEach(function(e){return e()})};window.addEventListener("visibilitychange",ep,!1),window.addEventListener("focus",ep,!1)}let ef=function(e,t){var n=t.refreshOnWindowFocus,r=t.focusTimespan,i=void 0===r?5e3:r,o=(0,N.useRef)(void 0),a=function(){var e;null==(e=o.current)||e.call(o)};return(0,N.useEffect)(function(){if(n){var t,r,u,s=(t=e.refresh.bind(e),r=!1,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,t.apply(void 0,C([],M(e),!1)),setTimeout(function(){r=!1},i))});u=function(){s()},el.add(u),o.current=function(){el.has(u)&&el.delete(u)}}return function(){a()}},[n,i]),F(function(){a()}),{}},eh=function(e,t){var n=t.retryInterval,r=t.retryCount,i=(0,N.useRef)(void 0),o=(0,N.useRef)(0),a=(0,N.useRef)(!1);return r?{onBefore:function(){a.current||(o.current=0),a.current=!1,i.current&&clearTimeout(i.current)},onSuccess:function(){o.current=0},onError:function(){o.current+=1,-1===r||o.current<=r?i.current=setTimeout(function(){a.current=!0,e.refresh()},null!=n?n:Math.min(1e3*Math.pow(2,o.current),3e4)):o.current=0},onCancel:function(){o.current=0,i.current&&clearTimeout(i.current)}}:{}};var em=r("../../common/temp/node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/throttle.js"),e_=r.n(em);let eg=function(e,t){var n=t.throttleWait,r=t.throttleLeading,i=t.throttleTrailing,o=(0,N.useRef)(void 0),a={};return(void 0!==r&&(a.leading=r),void 0!==i&&(a.trailing=i),(0,N.useEffect)(function(){if(n){var t=e.runAsync.bind(e);return o.current=e_()(function(e){e()},n,a),e.runAsync=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new Promise(function(n,r){var i;null==(i=o.current)||i.call(o,function(){t.apply(void 0,C([],M(e),!1)).then(n).catch(r)})})},function(){var n;e.runAsync=t,null==(n=o.current)||n.cancel()}}},[n,r,i]),n)?{onCancel:function(){var e;null==(e=o.current)||e.cancel()}}:{}},eb=function(e){(0,N.useEffect)(function(){var t=null==e?void 0:e();if(!t||"object"!=typeof t||"function"!=typeof t.then)return t},[])},ey=function(){var e=M((0,N.useState)({}),2)[1];return(0,N.useCallback)(function(){return e({})},[])};var ev=function(){function e(e,t,n,r){void 0===r&&(r={}),this.serviceRef=e,this.options=t,this.subscribe=n,this.initState=r,this.pluginImpls=[],this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=O(O(O({},this.state),{loading:!t.manual}),r)}return e.prototype.setState=function(e){void 0===e&&(e={}),this.state=O(O({},this.state),e),this.subscribe()},e.prototype.runPluginHandler=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.pluginImpls.map(function(n){var r;return null==(r=n[e])?void 0:r.call.apply(r,C([n],M(t),!1))}).filter(Boolean);return Object.assign.apply(Object,C([{}],M(r),!1))},e.prototype.runAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return I(this,void 0,void 0,function(){var t,n,r,i,o,a,u,s,d,c,l,p,f,h,m,_,g,b,y,v,w;return $(this,function(k){switch(k.label){case 0:if(this.count+=1,t=this.count,i=void 0!==(r=(n=this.runPluginHandler("onBefore",e)).stopNow)&&r,a=void 0!==(o=n.returnNow)&&o,u=P(n,["stopNow","returnNow"]),i)return[2,new Promise(function(){})];if(this.setState(O({loading:!0,params:e},u)),a)return[2,Promise.resolve(u.data)];null==(f=(p=this.options).onBefore)||f.call(p,e),k.label=1;case 1:return k.trys.push([1,3,,4]),(s=this.runPluginHandler("onRequest",this.serviceRef.current,e).servicePromise)||(s=(l=this.serviceRef).current.apply(l,C([],M(e),!1))),[4,s];case 2:if(d=k.sent(),t!==this.count)return[2,new Promise(function(){})];return this.setState({data:d,error:void 0,loading:!1}),null==(m=(h=this.options).onSuccess)||m.call(h,d,e),this.runPluginHandler("onSuccess",d,e),null==(g=(_=this.options).onFinally)||g.call(_,e,d,void 0),t===this.count&&this.runPluginHandler("onFinally",e,d,void 0),[2,d];case 3:if(c=k.sent(),t!==this.count)return[2,new Promise(function(){})];throw this.setState({error:c,loading:!1}),null==(y=(b=this.options).onError)||y.call(b,c,e),this.runPluginHandler("onError",c,e),null==(w=(v=this.options).onFinally)||w.call(v,e,void 0,c),t===this.count&&this.runPluginHandler("onFinally",e,void 0,c),c;case 4:return[2]}})})},e.prototype.run=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.runAsync.apply(this,C([],M(t),!1)).catch(function(t){e.options.onError||console.error(t)})},e.prototype.cancel=function(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")},e.prototype.refresh=function(){this.run.apply(this,C([],M(this.state.params||[]),!1))},e.prototype.refreshAsync=function(){return this.runAsync.apply(this,C([],M(this.state.params||[]),!1))},e.prototype.mutate=function(e){var t=Z(e)?e(this.state.data):e;this.runPluginHandler("onMutate",t),this.setState({data:t})},e}();let ew=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n=[]);var r=t.manual,i=void 0!==r&&r,o=t.ready,a=void 0===o||o,u=P(t,["manual","ready"]),s=O({manual:i,ready:a},u),d=L(e),c=ey(),l=q(function(){var e=n.map(function(e){var t;return null==(t=null==e?void 0:e.onInit)?void 0:t.call(e,s)}).filter(Boolean);return new ev(d,s,c,Object.assign.apply(Object,C([{}],M(e),!1)))},[]);return l.options=s,l.pluginImpls=n.map(function(e){return e(l,s)}),eb(function(){if(!i&&a){var e=l.state.params||t.defaultParams||[];l.run.apply(l,C([],M(e),!1))}}),F(function(){l.cancel()}),{loading:l.state.loading,data:l.state.data,error:l.state.error,params:l.state.params||[],cancel:V(l.cancel.bind(l)),refresh:V(l.refresh.bind(l)),refreshAsync:V(l.refreshAsync.bind(l)),run:V(l.run.bind(l)),runAsync:V(l.runAsync.bind(l)),mutate:V(l.mutate.bind(l))}},ek=function(e,t,n){return ew(e,t,C(C([],M(n||[]),!1),[ea,eu,ec,ef,eg,W,er,eh],!1))};var ez=function(e){return e.scrollHeight||Math.max(document.documentElement.scrollHeight,document.body.scrollHeight)};let eS=function(e,t){void 0===t&&(t={});var n=t.target,r=t.isNoMore,i=t.threshold,o=void 0===i?100:i,a=t.direction,u=t.reloadDeps,s=t.manual,d=t.onBefore,c=t.onSuccess,l=t.onError,p=t.onFinally,f=M((0,N.useState)(),2),h=f[0],m=f[1],_=M((0,N.useState)(!1),2),g=_[0],b=_[1],y="top"===(void 0===a?"bottom":a),v=(0,N.useRef)(void 0),w=(0,N.useRef)(0),k=(0,N.useMemo)(function(){return!!r&&r(h)},[h]),z=ek(function(t){return I(void 0,void 0,void 0,function(){return $(this,function(n){switch(n.label){case 0:return[4,e(t)];case 1:return[2,{currentData:n.sent(),lastData:t}]}})})},{manual:s,onFinally:function(e,t,n){b(!1),null==p||p(null==t?void 0:t.currentData,n)},onBefore:function(){return null==d?void 0:d()},onSuccess:function(e){var t,r,i;e.lastData?m(O(O({},e.currentData),{list:y?C(C([],M(e.currentData.list),!1),M(null!=(r=e.lastData.list)?r:[]),!1):C(C([],M(null!=(i=e.lastData.list)?i:[]),!1),M(e.currentData.list),!1)})):m(O(O({},e.currentData),{list:C([],M(null!=(t=e.currentData.list)?t:[]),!1)})),setTimeout(function(){if(y){var e=U(n);if(e=e===document?document.documentElement:e){var t=ez(e);e.scrollTo(0,t-w.current)}}else L()}),null==c||c(e.currentData)},onError:function(e){return null==l?void 0:l(e)}}),S=z.loading,E=z.error,A=z.run,x=z.runAsync,T=z.cancel,j=V(function(){k||(b(!0),A(h))}),P=function(e){return I(void 0,void 0,void 0,function(){return $(this,function(t){switch(t.label){case 0:return[4,x(e)];case 1:return[2,t.sent().currentData]}})})},R=V(function(){return k?Promise.reject():(b(!0),P(h))}),L=function(){var e=U(n);if(e){var t=e===document?document.documentElement:e,r=t===document||t===document.documentElement||t===document.body?Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop):t.scrollTop,i=ez(t),a=t.clientHeight||Math.max(document.documentElement.clientHeight,document.body.clientHeight);y?(void 0!==v.current&&v.current>r&&r<=o&&j(),v.current=r,w.current=i-r):i-r<=a+o&&j()}};return B("scroll",function(){S||g||L()},{target:n}),G(function(){A()},C([],M(void 0===u?[]:u),!1)),{data:h,loading:!g&&S,error:E,loadingMore:g,noMore:k,loadMore:j,loadMoreAsync:R,reload:V(function(){return b(!1),A()}),reloadAsync:V(function(){return b(!1),P()}),mutate:m,cancel:T}};function eE(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:a,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=a.prototype,o=Object.keys(i);for(let e=0;e<o.length;e++){let t=o[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class o extends i{}function a(e){var t;let i=n?.Parent?new o:this;for(let n of(r(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))n();return i}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}Object.freeze({status:"aborted"}),Symbol("zod_brand");class eA extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ex extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}let eT={};function ej(e){return e&&Object.assign(eT,e),eT}function eO(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function eP(e,t="|"){return e.map(e=>eX(e)).join(t)}function eI(e,t){return"bigint"==typeof t?t.toString():t}function e$(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function eM(e){return null==e}function eC(e){let t=+!!e.startsWith("^"),n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}let eN=Symbol("evaluating");function eR(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==eN)return void 0===r&&(r=eN,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function eL(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function eZ(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function eD(e){return JSON.stringify(e)}let eU="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eF(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eH=e$(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eJ(e){if(!1===eF(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let n=t.prototype;return!1!==eF(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function eB(e){return eJ(e)?{...e}:Array.isArray(e)?[...e]:e}let eV=new Set(["string","number","symbol"]),eG=new Set(["string","number","bigint","boolean","symbol","undefined"]);function eW(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eq(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function eK(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function eX(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let eY={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eQ={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function e0(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function e3(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function e8(e){return"string"==typeof e?e:e?.message}function e1(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=e8(e.inst?._zod.def?.error?.(e))??e8(t?.error?.(e))??e8(n.customError?.(e))??e8(n.localeError?.(e))??"Invalid input"),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function e2(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function e6(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function e4(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}let e9=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,eI,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},e5=eE("$ZodError",e9),e7=eE("$ZodError",e9,{Parent:Error}),te=e=>(t,n,r,i)=>{let o=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new eA;if(a.issues.length){let t=new(i?.Err??e)(a.issues.map(e=>e1(e,o,ej())));throw eU(t,i?.callee),t}return a.value},tt=te(e7),tn=e=>async(t,n,r,i)=>{let o=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let t=new(i?.Err??e)(a.issues.map(e=>e1(e,o,ej())));throw eU(t,i?.callee),t}return a.value},tr=tn(e7),ti=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new eA;return o.issues.length?{success:!1,error:new(e??e5)(o.issues.map(e=>e1(e,i,ej())))}:{success:!0,data:o.value}},to=ti(e7),ta=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>e1(e,i,ej())))}:{success:!0,data:o.value}},tu=ta(e7),ts=/^[cC][^\s-]{8,}$/,td=/^[0-9a-z]+$/,tc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tl=/^[0-9a-vA-V]{20}$/,tp=/^[A-Za-z0-9]{27}$/,tf=/^[a-zA-Z0-9_-]{21}$/,th=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tm=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,t_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tg=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,tb=tg(4),ty=tg(6),tv=tg(7),tw=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tk=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,tz=/^(([^<>()\[\]\\.,;:\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,}))$/,tS=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,tE=tS,tA=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function tx(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let tT=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tj=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,tO=e=>{let t=eW(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},tP=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,tI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,t$=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tM=/^[A-Za-z0-9_-]*$/,tC=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,tN=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,tR=/^\+[1-9]\d{6,14}$/,tL="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",tZ=RegExp(`^${tL}$`);function tD(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function tU(e){return RegExp(`^${tD(e)}$`)}function tF(e){let t=tD({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${n.join("|")})`;return RegExp(`^${tL}T(?:${r})$`)}let tH=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},tJ=/^-?\d+n?$/,tB=/^-?\d+$/,tV=/^-?\d+(?:\.\d+)?$/,tG=/^(?:true|false)$/i,tW=/^null$/i,tq=/^undefined$/i,tK=/^[^A-Z]*$/,tX=/^[^a-z]*$/,tY=/^[0-9a-fA-F]*$/;function tQ(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function t0(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let t3=/^[0-9a-fA-F]{32}$/,t8=tQ(22,"=="),t1=t0(22),t2=/^[0-9a-fA-F]{40}$/,t6=tQ(27,"="),t4=t0(27),t9=/^[0-9a-fA-F]{64}$/,t5=tQ(43,"="),t7=t0(43),ne=/^[0-9a-fA-F]{96}$/,nt=tQ(64,""),nn=t0(64),nr=/^[0-9a-fA-F]{128}$/,ni=tQ(86,"=="),no=t0(86),na=eE("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),nu={number:"number",bigint:"bigint",object:"date"},ns=eE("$ZodCheckLessThan",(e,t)=>{na.init(e,t);let n=nu[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nd=eE("$ZodCheckGreaterThan",(e,t)=>{na.init(e,t);let n=nu[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nc=eE("$ZodCheckMultipleOf",(e,t)=>{na.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){let n=(e.toString().split(".")[1]||"").length,r=t.toString(),i=(r.split(".")[1]||"").length;if(0===i&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let o=n>i?n:i;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),nl=eE("$ZodCheckNumberFormat",(e,t)=>{na.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[i,o]=eY[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=o,n&&(r.pattern=tB)}),e._zod.check=a=>{let u=a.value;if(n){if(!Number.isInteger(u))return void a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});if(!Number.isSafeInteger(u))return void(u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}u<i&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>o&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),np=eE("$ZodCheckBigIntFormat",(e,t)=>{na.init(e,t);let[n,r]=eQ[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let o=i.value;o<n&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>r&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),nf=eE("$ZodCheckMaxSize",(e,t)=>{var n;na.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!eM(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:e2(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),nh=eE("$ZodCheckMinSize",(e,t)=>{var n;na.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!eM(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:e2(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),nm=eE("$ZodCheckSizeEquals",(e,t)=>{var n;na.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!eM(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let o=i>t.size;n.issues.push({origin:e2(r),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),n_=eE("$ZodCheckMaxLength",(e,t)=>{var n;na.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!eM(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=e6(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ng=eE("$ZodCheckMinLength",(e,t)=>{var n;na.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!eM(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=e6(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),nb=eE("$ZodCheckLengthEquals",(e,t)=>{var n;na.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!eM(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let o=e6(r),a=i>t.length;n.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ny=eE("$ZodCheckStringFormat",(e,t)=>{var n,r;na.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),nv=eE("$ZodCheckRegex",(e,t)=>{ny.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nw=eE("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tK),ny.init(e,t)}),nk=eE("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tX),ny.init(e,t)}),nz=eE("$ZodCheckIncludes",(e,t)=>{na.init(e,t);let n=eW(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),nS=eE("$ZodCheckStartsWith",(e,t)=>{na.init(e,t);let n=RegExp(`^${eW(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),nE=eE("$ZodCheckEndsWith",(e,t)=>{na.init(e,t);let n=RegExp(`.*${eW(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function nA(e,t,n){e.issues.length&&t.issues.push(...e3(n,e.issues))}let nx=eE("$ZodCheckProperty",(e,t)=>{na.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>nA(n,e,t.property));nA(n,e,t.property)}}),nT=eE("$ZodCheckMimeType",(e,t)=>{na.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),nj=eE("$ZodCheckOverwrite",(e,t)=>{na.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class nO{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let nP={major:4,minor:3,patch:6},nI=eE("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nP;let r=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&r.unshift(e),r))for(let n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r,i=e0(e);for(let o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,a=o._zod.check(e);if(a instanceof Promise&&n?.async===!1)throw new eA;if(r||a instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await a,e.issues.length!==t&&(i||(i=e0(e,t)))});else{if(e.issues.length===t)continue;i||(i=e0(e,t))}}return r?r.then(()=>e):e},n=(n,i,o)=>{if(e0(n))return n.aborted=!0,n;let a=t(i,r,o);if(a instanceof Promise){if(!1===o.async)throw new eA;return a.then(t=>e._zod.parse(t,o))}return e._zod.parse(a,o)};e._zod.run=(i,o)=>{if(o.skipChecks)return e._zod.parse(i,o);if("backward"===o.direction){let t=e._zod.parse({value:i.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,o)):n(t,i,o)}let a=e._zod.parse(i,o);if(a instanceof Promise){if(!1===o.async)throw new eA;return a.then(e=>t(e,r,o))}return t(a,r,o)}}eR(e,"~standard",()=>({validate:t=>{try{let n=to(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return tu(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),n$=eE("$ZodString",(e,t)=>{nI.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??tH(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),nM=eE("$ZodStringFormat",(e,t)=>{ny.init(e,t),n$.init(e,t)}),nC=eE("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=t_),nM.init(e,t)}),nN=eE("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tg(e))}else t.pattern??(t.pattern=tg());nM.init(e,t)}),nR=eE("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tw),nM.init(e,t)}),nL=eE("$ZodURL",(e,t)=>{nM.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),nZ=eE("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tx()),nM.init(e,t)}),nD=eE("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=tf),nM.init(e,t)}),nU=eE("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ts),nM.init(e,t)}),nF=eE("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=td),nM.init(e,t)}),nH=eE("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tc),nM.init(e,t)}),nJ=eE("$ZodXID",(e,t)=>{t.pattern??(t.pattern=tl),nM.init(e,t)}),nB=eE("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=tp),nM.init(e,t)}),nV=eE("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tF(t)),nM.init(e,t)}),nG=eE("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tZ),nM.init(e,t)}),nW=eE("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=tU(t)),nM.init(e,t)}),nq=eE("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=th),nM.init(e,t)}),nK=eE("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tT),nM.init(e,t),e._zod.bag.format="ipv4"}),nX=eE("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=tj),nM.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),nY=eE("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=tO(t.delimiter)),nM.init(e,t),e._zod.bag.format="mac"}),nQ=eE("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=tP),nM.init(e,t)}),n0=eE("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=tI),nM.init(e,t),e._zod.check=n=>{let r=n.value.split("/");try{if(2!==r.length)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function n3(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let n8=eE("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=t$),nM.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{n3(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),n1=eE("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=tM),nM.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{!function(e){if(!tM.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return n3(t.padEnd(4*Math.ceil(t.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),n2=eE("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tR),nM.init(e,t)}),n6=eE("$ZodJWT",(e,t)=>{nM.init(e,t),e._zod.check=n=>{!function(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(n.value,t.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),n4=eE("$ZodCustomStringFormat",(e,t)=>{nM.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),n9=eE("$ZodNumber",(e,t)=>{nI.init(e,t),e._zod.pattern=e._zod.bag.pattern??tV,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}let i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;let o="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),n5=eE("$ZodNumberFormat",(e,t)=>{nl.init(e,t),n9.init(e,t)}),n7=eE("$ZodBoolean",(e,t)=>{nI.init(e,t),e._zod.pattern=tG,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),re=eE("$ZodBigInt",(e,t)=>{nI.init(e,t),e._zod.pattern=tJ,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),rt=eE("$ZodBigIntFormat",(e,t)=>{np.init(e,t),re.init(e,t)}),rn=eE("$ZodSymbol",(e,t)=>{nI.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return"symbol"==typeof r||t.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),t}}),rr=eE("$ZodUndefined",(e,t)=>{nI.init(e,t),e._zod.pattern=tq,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{let r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}}),ri=eE("$ZodNull",(e,t)=>{nI.init(e,t),e._zod.pattern=tW,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),ro=eE("$ZodAny",(e,t)=>{nI.init(e,t),e._zod.parse=e=>e}),ra=eE("$ZodUnknown",(e,t)=>{nI.init(e,t),e._zod.parse=e=>e}),ru=eE("$ZodNever",(e,t)=>{nI.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),rs=eE("$ZodVoid",(e,t)=>{nI.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return void 0===r||t.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),t}}),rd=eE("$ZodDate",(e,t)=>{nI.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}let i=n.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),n}});function rc(e,t,n){e.issues.length&&t.issues.push(...e3(n,e.issues)),t.value[n]=e.value}let rl=eE("$ZodArray",(e,t)=>{nI.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);let o=[];for(let e=0;e<i.length;e++){let a=i[e],u=t.element._zod.run({value:a,issues:[]},r);u instanceof Promise?o.push(u.then(t=>rc(t,n,e))):rc(u,n,e)}return o.length?Promise.all(o).then(()=>n):n}});function rp(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...e3(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function rf(e){var t;let n=Object.keys(e.shape);for(let t of n)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${t}": expected a Zod schema`);let r=Object.keys(t=e.shape).filter(e=>"optional"===t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function rh(e,t,n,r,i,o){let a=[],u=i.keySet,s=i.catchall._zod,d=s.def.type,c="optional"===s.optout;for(let i in t){if(u.has(i))continue;if("never"===d){a.push(i);continue}let o=s.run({value:t[i],issues:[]},r);o instanceof Promise?e.push(o.then(e=>rp(e,n,i,t,c))):rp(o,n,i,t,c)}return(a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length)?Promise.all(e).then(()=>n):n}let rm=eE("$ZodObject",(e,t)=>{let n;nI.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape");if(!r?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let i=e$(()=>rf(t));eR(e._zod,"propValues",()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values)for(let e of(n[t]??(n[t]=new Set),r.values))n[t].add(e)}return n});let o=t.catchall;e._zod.parse=(t,r)=>{n??(n=i.value);let a=t.value;if(!eF(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};let u=[],s=n.shape;for(let e of n.keys){let n=s[e],i="optional"===n._zod.optout,o=n._zod.run({value:a[e],issues:[]},r);o instanceof Promise?u.push(o.then(n=>rp(n,t,e,a,i))):rp(o,t,e,a,i)}return o?rh(u,a,t,r,i.value,e):u.length?Promise.all(u).then(()=>t):t}}),r_=eE("$ZodObjectJIT",(e,t)=>{let n,r;rm.init(e,t);let i=e._zod.parse,o=e$(()=>rf(t)),a=!eT.jitless,u=a&&eH.value,s=t.catchall;e._zod.parse=(d,c)=>{r??(r=o.value);let l=d.value;return eF(l)?a&&u&&c?.async===!1&&!0!==c.jitless?(n||(n=(e=>{let t=new nO(["shape","payload","ctx"]),n=o.value,r=e=>{let t=eD(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),a=0;for(let e of n.keys)i[e]=`key_${a++}`;for(let o of(t.write("const newResult = {};"),n.keys)){let n=i[o],a=eD(o),u=e[o],s=u?._zod?.optout==="optional";t.write(`const ${n} = ${r(o)};`),s?t.write(`
|
|
3
|
+
if (${n}.issues.length) {
|
|
4
|
+
if (${a} in input) {
|
|
5
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
6
|
+
...iss,
|
|
7
|
+
path: iss.path ? [${a}, ...iss.path] : [${a}]
|
|
8
|
+
})));
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (${n}.value === undefined) {
|
|
13
|
+
if (${a} in input) {
|
|
14
|
+
newResult[${a}] = undefined;
|
|
15
|
+
}
|
|
16
|
+
} else {
|
|
17
|
+
newResult[${a}] = ${n}.value;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
`):t.write(`
|
|
21
|
+
if (${n}.issues.length) {
|
|
22
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
23
|
+
...iss,
|
|
24
|
+
path: iss.path ? [${a}, ...iss.path] : [${a}]
|
|
25
|
+
})));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (${n}.value === undefined) {
|
|
29
|
+
if (${a} in input) {
|
|
30
|
+
newResult[${a}] = undefined;
|
|
31
|
+
}
|
|
32
|
+
} else {
|
|
33
|
+
newResult[${a}] = ${n}.value;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
`)}t.write("payload.value = newResult;"),t.write("return payload;");let u=t.compile();return(t,n)=>u(e,t,n)})(t.shape)),d=n(d,c),s)?rh([],l,d,c,r,e):d:i(d,c):(d.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),d)}});function rg(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let i=e.filter(e=>!e0(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>e1(e,r,ej())))}),t)}let rb=eE("$ZodUnion",(e,t)=>{nI.init(e,t),eR(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),eR(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eR(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),eR(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>eC(e.source)).join("|")})$`)}});let n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(n)return r(i,o);let a=!1,u=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},o);if(t instanceof Promise)u.push(t),a=!0;else{if(0===t.issues.length)return t;u.push(t)}}return a?Promise.all(u).then(t=>rg(t,i,e,o)):rg(u,i,e,o)}});function ry(e,t,n,r){let i=e.filter(e=>0===e.issues.length);return 1===i.length?t.value=i[0].value:0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>e1(e,r,ej())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t}let rv=eE("$ZodXor",(e,t)=>{rb.init(e,t),t.inclusive=!1;let n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(n)return r(i,o);let a=!1,u=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},o);t instanceof Promise?(u.push(t),a=!0):u.push(t)}return a?Promise.all(u).then(t=>ry(t,i,e,o)):ry(u,i,e,o)}}),rw=eE("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,rb.init(e,t);let n=e._zod.parse;eR(e._zod,"propValues",()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r))for(let r of(e[t]||(e[t]=new Set),n))e[t].add(r)}return e});let r=e$(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,o)=>{let a=i.value;if(!eF(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let u=r.value.get(a?.[t.discriminator]);return u?u._zod.run(i,o):t.unionFallback?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),i)}}),rk=eE("$ZodIntersection",(e,t)=>{nI.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,n])=>rz(e,t,n)):rz(e,i,o)}});function rz(e,t,n){let r,i=new Map;for(let n of t.issues)if("unrecognized_keys"===n.code)for(let e of(r??(r=n),n.keys))i.has(e)||i.set(e,{}),i.get(e).l=!0;else e.issues.push(n);for(let t of n.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)i.has(e)||i.set(e,{}),i.get(e).r=!0;else e.issues.push(t);let o=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&r&&e.issues.push({...r,keys:o}),e0(e))return e;let a=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(eJ(t)&&eJ(n)){let r=Object.keys(n),i=Object.keys(t).filter(e=>-1!==r.indexOf(e)),o={...t,...n};for(let r of i){let i=e(t[r],n[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};o[r]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let o=e(t[i],n[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}let rS=eE("$ZodTuple",(e,t)=>{nI.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let a=[],u=[...n].reverse().findIndex(e=>"optional"!==e._zod.optin),s=-1===u?0:n.length-u;if(!t.rest){let t=o.length>n.length,i=o.length<s-1;if(t||i)return r.issues.push({...t?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:o,inst:e,origin:"array"}),r}let d=-1;for(let e of n){if(++d>=o.length&&d>=s)continue;let t=e._zod.run({value:o[d],issues:[]},i);t instanceof Promise?a.push(t.then(e=>rE(e,r,d))):rE(t,r,d)}if(t.rest)for(let e of o.slice(n.length)){d++;let n=t.rest._zod.run({value:e,issues:[]},i);n instanceof Promise?a.push(n.then(e=>rE(e,r,d))):rE(n,r,d)}return a.length?Promise.all(a).then(()=>r):r}});function rE(e,t,n){e.issues.length&&t.issues.push(...e3(n,e.issues)),t.value[n]=e.value}let rA=eE("$ZodRecord",(e,t)=>{nI.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!eJ(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let o=[],a=t.keyType._zod.values;if(a){let u;n.value={};let s=new Set;for(let e of a)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){s.add("number"==typeof e?e.toString():e);let a=t.valueType._zod.run({value:i[e],issues:[]},r);a instanceof Promise?o.push(a.then(t=>{t.issues.length&&n.issues.push(...e3(e,t.issues)),n.value[e]=t.value})):(a.issues.length&&n.issues.push(...e3(e,a.issues)),n.value[e]=a.value)}for(let e in i)s.has(e)||(u=u??[]).push(e);u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u})}else for(let a of(n.value={},Reflect.ownKeys(i))){if("__proto__"===a)continue;let u=t.keyType._zod.run({value:a,issues:[]},r);if(u instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof a&&tV.test(a)&&u.issues.length){let e=t.keyType._zod.run({value:Number(a),issues:[]},r);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(u=e)}if(u.issues.length){"loose"===t.mode?n.value[a]=i[a]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(e=>e1(e,r,ej())),input:a,path:[a],inst:e});continue}let s=t.valueType._zod.run({value:i[a],issues:[]},r);s instanceof Promise?o.push(s.then(e=>{e.issues.length&&n.issues.push(...e3(a,e.issues)),n.value[u.value]=e.value})):(s.issues.length&&n.issues.push(...e3(a,s.issues)),n.value[u.value]=s.value)}return o.length?Promise.all(o).then(()=>n):n}}),rx=eE("$ZodMap",(e,t)=>{nI.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;let o=[];for(let[a,u]of(n.value=new Map,i)){let s=t.keyType._zod.run({value:a,issues:[]},r),d=t.valueType._zod.run({value:u,issues:[]},r);s instanceof Promise||d instanceof Promise?o.push(Promise.all([s,d]).then(([t,o])=>{rT(t,o,n,a,i,e,r)})):rT(s,d,n,a,i,e,r)}return o.length?Promise.all(o).then(()=>n):n}});function rT(e,t,n,r,i,o,a){e.issues.length&&(eV.has(typeof r)?n.issues.push(...e3(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(e=>e1(e,a,ej()))})),t.issues.length&&(eV.has(typeof r)?n.issues.push(...e3(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:r,issues:t.issues.map(e=>e1(e,a,ej()))})),n.value.set(e.value,t.value)}let rj=eE("$ZodSet",(e,t)=>{nI.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;let o=[];for(let e of(n.value=new Set,i)){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?o.push(i.then(e=>rO(e,n))):rO(i,n)}return o.length?Promise.all(o).then(()=>n):n}});function rO(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}let rP=eE("$ZodEnum",(e,t)=>{nI.init(e,t);let n=eO(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>eV.has(typeof e)).map(e=>"string"==typeof e?eW(e):e.toString()).join("|")})$`),e._zod.parse=(t,i)=>{let o=t.value;return r.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),rI=eE("$ZodLiteral",(e,t)=>{if(nI.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?eW(e):e?eW(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,i)=>{let o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),r$=eE("$ZodFile",(e,t)=>{nI.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),t}}),rM=eE("$ZodTransform",(e,t)=>{nI.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ex(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new eA;return n.value=i,n}});function rC(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}let rN=eE("$ZodOptional",(e,t)=>{nI.init(e,t),e._zod.optin="optional",e._zod.optout="optional",eR(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),eR(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eC(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>rC(t,e.value)):rC(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),rR=eE("$ZodExactOptional",(e,t)=>{rN.init(e,t),eR(e._zod,"values",()=>t.innerType._zod.values),eR(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),rL=eE("$ZodNullable",(e,t)=>{nI.init(e,t),eR(e._zod,"optin",()=>t.innerType._zod.optin),eR(e._zod,"optout",()=>t.innerType._zod.optout),eR(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eC(e.source)}|null)$`):void 0}),eR(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),rZ=eE("$ZodDefault",(e,t)=>{nI.init(e,t),e._zod.optin="optional",eR(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>rD(e,t)):rD(r,t)}});function rD(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let rU=eE("$ZodPrefault",(e,t)=>{nI.init(e,t),e._zod.optin="optional",eR(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),rF=eE("$ZodNonOptional",(e,t)=>{nI.init(e,t),eR(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>rH(t,e)):rH(i,e)}});function rH(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let rJ=eE("$ZodSuccess",(e,t)=>{nI.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new ex("ZodSuccess");let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===r.issues.length,e)}}),rB=eE("$ZodCatch",(e,t)=>{nI.init(e,t),eR(e._zod,"optin",()=>t.innerType._zod.optin),eR(e._zod,"optout",()=>t.innerType._zod.optout),eR(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>e1(e,n,ej()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>e1(e,n,ej()))},input:e.value}),e.issues=[]),e)}}),rV=eE("$ZodNaN",(e,t)=>{nI.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),rG=eE("$ZodPipe",(e,t)=>{nI.init(e,t),eR(e._zod,"values",()=>t.in._zod.values),eR(e._zod,"optin",()=>t.in._zod.optin),eR(e._zod,"optout",()=>t.out._zod.optout),eR(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>rW(e,t.in,n)):rW(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>rW(e,t.out,n)):rW(r,t.out,n)}});function rW(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}let rq=eE("$ZodCodec",(e,t)=>{nI.init(e,t),eR(e._zod,"values",()=>t.in._zod.values),eR(e._zod,"optin",()=>t.in._zod.optin),eR(e._zod,"optout",()=>t.out._zod.optout),eR(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>rK(e,t,n)):rK(r,t,n)}{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>rK(e,t,n)):rK(r,t,n)}}});function rK(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>rX(e,r,t.out,n)):rX(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>rX(e,r,t.in,n)):rX(e,r,t.in,n)}}function rX(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}let rY=eE("$ZodReadonly",(e,t)=>{nI.init(e,t),eR(e._zod,"propValues",()=>t.innerType._zod.propValues),eR(e._zod,"values",()=>t.innerType._zod.values),eR(e._zod,"optin",()=>t.innerType?._zod?.optin),eR(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(rQ):rQ(r)}});function rQ(e){return e.value=Object.freeze(e.value),e}let r0=eE("$ZodTemplateLiteral",(e,t)=>{nI.init(e,t);let n=[];for(let e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith("^"),i=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(r,i))}else if(null===e||eG.has(typeof e))n.push(eW(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>("string"!=typeof n.value?n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),n)}),r3=eE("$ZodFunction",(e,t)=>(nI.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if("function"!=typeof t)throw Error("implement() must be called with a function");return function(...n){let r=Reflect.apply(t,this,e._def.input?tt(e._def.input,n):n);return e._def.output?tt(e._def.output,r):r}},e.implementAsync=t=>{if("function"!=typeof t)throw Error("implementAsync() must be called with a function");return async function(...n){let r=e._def.input?await tr(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await tr(e._def.output,i):i}},e._zod.parse=(t,n)=>("function"!=typeof t.value?t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:e}):e._def.output&&"promise"===e._def.output._zod.def.type?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t),e.input=(...t)=>{let n=e.constructor;return new n(Array.isArray(t[0])?{type:"function",input:new rS({type:"tuple",items:t[0],rest:t[1]}),output:e._def.output}:{type:"function",input:t[0],output:e._def.output})},e.output=t=>new e.constructor({type:"function",input:e._def.input,output:t}),e)),r8=eE("$ZodPromise",(e,t)=>{nI.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),r1=eE("$ZodLazy",(e,t)=>{nI.init(e,t),eR(e._zod,"innerType",()=>t.getter()),eR(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),eR(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),eR(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),eR(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),r2=eE("$ZodCustom",(e,t)=>{na.init(e,t),nI.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>r6(t,n,r,e));r6(i,n,r,e)}});function r6(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(e4(e))}}Symbol("ZodOutput"),Symbol("ZodInput");(k=globalThis).__zod_globalRegistry??(k.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let r4=globalThis.__zod_globalRegistry;function r9(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...eK(t)})}function r5(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...eK(t)})}function r7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...eK(t)})}function ie(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...eK(t)})}function it(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...eK(t)})}function ir(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...eK(t)})}function ii(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...eK(t)})}function io(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...eK(t)})}function ia(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...eK(t)})}function iu(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...eK(t)})}function is(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...eK(t)})}function id(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...eK(t)})}function ic(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...eK(t)})}function il(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...eK(t)})}function ip(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...eK(t)})}function ih(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...eK(t)})}function im(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...eK(t)})}function i_(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...eK(t)})}function ig(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...eK(t)})}function ib(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...eK(t)})}function iy(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...eK(t)})}function iv(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...eK(t)})}function iw(e,t){return new ns({check:"less_than",...eK(t),value:e,inclusive:!1})}function ik(e,t){return new ns({check:"less_than",...eK(t),value:e,inclusive:!0})}function iz(e,t){return new nd({check:"greater_than",...eK(t),value:e,inclusive:!1})}function iS(e,t){return new nd({check:"greater_than",...eK(t),value:e,inclusive:!0})}function iE(e){return iz(0,e)}function iA(e){return iw(0,e)}function ix(e){return ik(0,e)}function iT(e){return iS(0,e)}function ij(e,t){return new nc({check:"multiple_of",...eK(t),value:e})}function iO(e,t){return new nf({check:"max_size",...eK(t),maximum:e})}function iP(e,t){return new nh({check:"min_size",...eK(t),minimum:e})}function iI(e,t){return new nm({check:"size_equals",...eK(t),size:e})}function i$(e,t){return new n_({check:"max_length",...eK(t),maximum:e})}function iM(e,t){return new ng({check:"min_length",...eK(t),minimum:e})}function iC(e,t){return new nb({check:"length_equals",...eK(t),length:e})}function iN(e,t){return new nv({check:"string_format",format:"regex",...eK(t),pattern:e})}function iR(e){return new nw({check:"string_format",format:"lowercase",...eK(e)})}function iL(e){return new nk({check:"string_format",format:"uppercase",...eK(e)})}function iZ(e,t){return new nz({check:"string_format",format:"includes",...eK(t),includes:e})}function iD(e,t){return new nS({check:"string_format",format:"starts_with",...eK(t),prefix:e})}function iU(e,t){return new nE({check:"string_format",format:"ends_with",...eK(t),suffix:e})}function iF(e,t,n){return new nx({check:"property",property:e,schema:t,...eK(n)})}function iH(e,t){return new nT({check:"mime_type",mime:e,...eK(t)})}function iJ(e){return new nj({check:"overwrite",tx:e})}function iB(e){return iJ(t=>t.normalize(e))}function iV(){return iJ(e=>e.trim())}function iG(){return iJ(e=>e.toLowerCase())}function iW(){return iJ(e=>e.toUpperCase())}function iq(){return iJ(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,""))}function iK(e,t,n,r={}){let i=eK(r),o={...eK(r),check:"string_format",type:"string",format:t,fn:"function"==typeof n?n:e=>n.test(e),...i};return n instanceof RegExp&&(o.pattern=n),new e(o)}function iX(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??r4,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function iY(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);let u=e._zod.toJSONSchema?.();if(u)a.schema=u;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,r);else{let n=a.schema,o=t.processors[i.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);o(e,t,n,r)}let o=e._zod.parent;o&&(a.ref||(a.ref=o),iY(o,t,r),t.seen.get(o).isParent=!0)}let s=t.metadataRegistry.get(e);return s&&Object.assign(a.schema,s),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,r);if("set"===i.type)return e(i.valueType,r);if("lazy"===i.type)return e(i.getter(),r);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type)return e(i.innerType,r);if("intersection"===i.type)return e(i.left,r)||e(i.right,r);if("record"===i.type||"map"===i.type)return e(i.keyType,r)||e(i.valueType,r);if("pipe"===i.type)return e(i.in,r)||e(i.out,r);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],r))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,r))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,r))return!0;if(i.rest&&e(i.rest,r))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function iQ(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:i,defId:o}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${i("__shared")}#/${r}/${o}`}}if(t[1]===n)return{ref:"#"};let i=`#/${r}/`,o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:i+o}})(t);r.def={...r.schema},o&&(r.defId=o);let a=r.schema;for(let e in a)delete a[e];a.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
37
|
+
|
|
38
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){i(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&"ref"===e.reused){i(n);continue}}}function i0(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let i=n.def??n.schema,o={...i},a=n.ref;if(n.ref=null,a){r(a);let n=e.seen.get(a),u=n.schema;if(u.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(u)):Object.assign(i,u),Object.assign(i,o),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in o||delete i[e]);if(u.$ref&&n.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let u=t._zod.parent;if(u&&u!==a){r(u);let t=e.seen.get(u);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&("draft-2020-12"===e.target?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:i3(t,"input",e.processors),output:i3(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let i3=(e,t,n={})=>r=>{let{libraryOptions:i,target:o}=r??{},a=iX({...i??{},target:o,io:t,processors:n});return iY(e,a),iQ(a,e),i0(a,e)},i8={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},i1=(e,t,n,r)=>{let i=e._zod.def,o=!1===i.inclusive,a=i.options.map((e,n)=>iY(e,t,{...r,path:[...r.path,o?"oneOf":"anyOf",n]}));o?n.oneOf=a:n.anyOf=a},i2=(e,t,n,r)=>{let i=e._zod.def;iY(i.innerType,t,r),t.seen.get(e).ref=i.innerType},i6=eE("ZodISODateTime",(e,t)=>{nV.init(e,t),ow.init(e,t)});function i4(e){return new i6({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...eK(e)})}let i9=eE("ZodISODate",(e,t)=>{nG.init(e,t),ow.init(e,t)});function i5(e){return new i9({type:"string",format:"date",check:"string_format",...eK(e)})}let i7=eE("ZodISOTime",(e,t)=>{nW.init(e,t),ow.init(e,t)});function oe(e){return new i7({type:"string",format:"time",check:"string_format",precision:null,...eK(e)})}let ot=eE("ZodISODuration",(e,t)=>{nq.init(e,t),ow.init(e,t)});function on(e){return new ot({type:"string",format:"duration",check:"string_format",...eK(e)})}let or=(e,t)=>{e5.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>r({issues:e}));else if("invalid_key"===i.code)r({issues:i.issues});else if("invalid_element"===i.code)r({issues:i.issues});else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,eI,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,eI,2)}},isEmpty:{get:()=>0===e.issues.length}})};eE("ZodError",or);let oi=eE("ZodError",or,{Parent:Error}),oo=te(oi),oa=tn(oi),ou=ti(oi),os=ta(oi),od=(e,t,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return te(oi)(e,t,r)},oc=(e,t,n)=>te(oi)(e,t,n),ol=async(e,t,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return tn(oi)(e,t,r)},op=async(e,t,n)=>tn(oi)(e,t,n),of=(e,t,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ti(oi)(e,t,r)},oh=(e,t,n)=>ti(oi)(e,t,n),om=async(e,t,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ta(oi)(e,t,r)},o_=async(e,t,n)=>ta(oi)(e,t,n),og=eE("ZodType",(e,t)=>(nI.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:i3(e,"input"),output:i3(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{let r=iX({...n,processors:t});return iY(e,r),iQ(r,e),i0(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(eZ(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>eq(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>oo(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ou(e,t,n),e.parseAsync=async(t,n)=>oa(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>os(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>od(e,t,n),e.decode=(t,n)=>oc(e,t,n),e.encodeAsync=async(t,n)=>ol(e,t,n),e.decodeAsync=async(t,n)=>op(e,t,n),e.safeEncode=(t,n)=>of(e,t,n),e.safeDecode=(t,n)=>oh(e,t,n),e.safeEncodeAsync=async(t,n)=>om(e,t,n),e.safeDecodeAsync=async(t,n)=>o_(e,t,n),e.refine=(t,n)=>e.check(uJ(t,n)),e.superRefine=t=>e.check(uB(t)),e.overwrite=t=>e.check(iJ(t)),e.optional=()=>ud(e),e.exactOptional=()=>ul(e),e.nullable=()=>uf(e),e.nullish=()=>ud(uf(e)),e.nonoptional=t=>uv(e,t),e.array=()=>aZ(e),e.or=t=>aV([e,t]),e.and=t=>aY(e,t),e.transform=t=>uT(e,uu(t)),e.default=t=>u_(e,t),e.prefault=t=>ub(e,t),e.catch=t=>uS(e,t),e.pipe=t=>uT(e,t),e.readonly=()=>uI(e),e.describe=t=>{let n=e.clone();return r4.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>r4.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return r4.get(e);let n=e.clone();return r4.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),ob=eE("_ZodString",(e,t)=>{n$.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{n.type="string";let{minimum:i,maximum:o,format:a,patterns:u,contentEncoding:s}=e._zod.bag;if("number"==typeof i&&(n.minLength=i),"number"==typeof o&&(n.maxLength=o),a&&(n.format=i8[a]??a,""===n.format&&delete n.format,"time"===a&&delete n.format),s&&(n.contentEncoding=s),u&&u.size>0){let e=[...u];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n,0);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(iN(...t)),e.includes=(...t)=>e.check(iZ(...t)),e.startsWith=(...t)=>e.check(iD(...t)),e.endsWith=(...t)=>e.check(iU(...t)),e.min=(...t)=>e.check(iM(...t)),e.max=(...t)=>e.check(i$(...t)),e.length=(...t)=>e.check(iC(...t)),e.nonempty=(...t)=>e.check(iM(1,...t)),e.lowercase=t=>e.check(iR(t)),e.uppercase=t=>e.check(iL(t)),e.trim=()=>e.check(iV()),e.normalize=(...t)=>e.check(iB(...t)),e.toLowerCase=()=>e.check(iG()),e.toUpperCase=()=>e.check(iW()),e.slugify=()=>e.check(iq())}),oy=eE("ZodString",(e,t)=>{n$.init(e,t),ob.init(e,t),e.email=t=>e.check(r9(ok,t)),e.url=t=>e.check(ii(oP,t)),e.jwt=t=>e.check(iv(ae,t)),e.emoji=t=>e.check(io(oM,t)),e.guid=t=>e.check(r5(oS,t)),e.uuid=t=>e.check(r7(oA,t)),e.uuidv4=t=>e.check(ie(oA,t)),e.uuidv6=t=>e.check(it(oA,t)),e.uuidv7=t=>e.check(ir(oA,t)),e.nanoid=t=>e.check(ia(oN,t)),e.guid=t=>e.check(r5(oS,t)),e.cuid=t=>e.check(iu(oL,t)),e.cuid2=t=>e.check(is(oD,t)),e.ulid=t=>e.check(id(oF,t)),e.base64=t=>e.check(ig(o2,t)),e.base64url=t=>e.check(ib(o4,t)),e.xid=t=>e.check(ic(oJ,t)),e.ksuid=t=>e.check(il(oV,t)),e.ipv4=t=>e.check(ip(oW,t)),e.ipv6=t=>e.check(ih(oY,t)),e.cidrv4=t=>e.check(im(o0,t)),e.cidrv6=t=>e.check(i_(o8,t)),e.e164=t=>e.check(iy(o5,t)),e.datetime=t=>e.check(i4(t)),e.date=t=>e.check(i5(t)),e.time=t=>e.check(oe(t)),e.duration=t=>e.check(on(t))});function ov(e){return new oy({type:"string",...eK(e)})}let ow=eE("ZodStringFormat",(e,t)=>{nM.init(e,t),ob.init(e,t)}),ok=eE("ZodEmail",(e,t)=>{nR.init(e,t),ow.init(e,t)});function oz(e){return r9(ok,e)}let oS=eE("ZodGUID",(e,t)=>{nC.init(e,t),ow.init(e,t)});function oE(e){return r5(oS,e)}let oA=eE("ZodUUID",(e,t)=>{nN.init(e,t),ow.init(e,t)});function ox(e){return r7(oA,e)}function oT(e){return ie(oA,e)}function oj(e){return it(oA,e)}function oO(e){return ir(oA,e)}let oP=eE("ZodURL",(e,t)=>{nL.init(e,t),ow.init(e,t)});function oI(e){return ii(oP,e)}function o$(e){return ii(oP,{protocol:/^https?$/,hostname:tN,...eK(e)})}let oM=eE("ZodEmoji",(e,t)=>{nZ.init(e,t),ow.init(e,t)});function oC(e){return io(oM,e)}let oN=eE("ZodNanoID",(e,t)=>{nD.init(e,t),ow.init(e,t)});function oR(e){return ia(oN,e)}let oL=eE("ZodCUID",(e,t)=>{nU.init(e,t),ow.init(e,t)});function oZ(e){return iu(oL,e)}let oD=eE("ZodCUID2",(e,t)=>{nF.init(e,t),ow.init(e,t)});function oU(e){return is(oD,e)}let oF=eE("ZodULID",(e,t)=>{nH.init(e,t),ow.init(e,t)});function oH(e){return id(oF,e)}let oJ=eE("ZodXID",(e,t)=>{nJ.init(e,t),ow.init(e,t)});function oB(e){return ic(oJ,e)}let oV=eE("ZodKSUID",(e,t)=>{nB.init(e,t),ow.init(e,t)});function oG(e){return il(oV,e)}let oW=eE("ZodIPv4",(e,t)=>{nK.init(e,t),ow.init(e,t)});function oq(e){return ip(oW,e)}let oK=eE("ZodMAC",(e,t)=>{nY.init(e,t),ow.init(e,t)});function oX(e){return new oK({type:"string",format:"mac",check:"string_format",abort:!1,...eK(e)})}let oY=eE("ZodIPv6",(e,t)=>{nX.init(e,t),ow.init(e,t)});function oQ(e){return ih(oY,e)}let o0=eE("ZodCIDRv4",(e,t)=>{nQ.init(e,t),ow.init(e,t)});function o3(e){return im(o0,e)}let o8=eE("ZodCIDRv6",(e,t)=>{n0.init(e,t),ow.init(e,t)});function o1(e){return i_(o8,e)}let o2=eE("ZodBase64",(e,t)=>{n8.init(e,t),ow.init(e,t)});function o6(e){return ig(o2,e)}let o4=eE("ZodBase64URL",(e,t)=>{n1.init(e,t),ow.init(e,t)});function o9(e){return ib(o4,e)}let o5=eE("ZodE164",(e,t)=>{n2.init(e,t),ow.init(e,t)});function o7(e){return iy(o5,e)}let ae=eE("ZodJWT",(e,t)=>{n6.init(e,t),ow.init(e,t)});function at(e){return iv(ae,e)}let an=eE("ZodCustomStringFormat",(e,t)=>{n4.init(e,t),ow.init(e,t)});function ar(e,t,n={}){return iK(an,e,t,n)}function ai(e){return iK(an,"hostname",tC,e)}function ao(e){return iK(an,"hex",tY,e)}function aa(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,i=A[r];if(!i)throw Error(`Unrecognized hash format: ${r}`);return iK(an,r,i,t)}let au=eE("ZodNumber",(e,t)=>{n9.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let{minimum:i,maximum:o,format:a,multipleOf:u,exclusiveMaximum:s,exclusiveMinimum:d}=e._zod.bag;"string"==typeof a&&a.includes("int")?n.type="integer":n.type="number","number"==typeof d&&("draft-04"===t.target||"openapi-3.0"===t.target?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d),"number"==typeof i&&(n.minimum=i,"number"==typeof d&&"draft-04"!==t.target&&(d>=i?delete n.minimum:delete n.exclusiveMinimum)),"number"==typeof s&&("draft-04"===t.target||"openapi-3.0"===t.target?(n.maximum=s,n.exclusiveMaximum=!0):n.exclusiveMaximum=s),"number"==typeof o&&(n.maximum=o,"number"==typeof s&&"draft-04"!==t.target&&(s<=o?delete n.maximum:delete n.exclusiveMaximum)),"number"==typeof u&&(n.multipleOf=u)})(e,t,n,0),e.gt=(t,n)=>e.check(iz(t,n)),e.gte=(t,n)=>e.check(iS(t,n)),e.min=(t,n)=>e.check(iS(t,n)),e.lt=(t,n)=>e.check(iw(t,n)),e.lte=(t,n)=>e.check(ik(t,n)),e.max=(t,n)=>e.check(ik(t,n)),e.int=t=>e.check(ac(t)),e.safe=t=>e.check(ac(t)),e.positive=t=>e.check(iz(0,t)),e.nonnegative=t=>e.check(iS(0,t)),e.negative=t=>e.check(iw(0,t)),e.nonpositive=t=>e.check(ik(0,t)),e.multipleOf=(t,n)=>e.check(ij(t,n)),e.step=(t,n)=>e.check(ij(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function as(e){return new au({type:"number",checks:[],...eK(e)})}let ad=eE("ZodNumberFormat",(e,t)=>{n5.init(e,t),au.init(e,t)});function ac(e){return new ad({type:"number",check:"number_format",abort:!1,format:"safeint",...eK(e)})}function al(e){return new ad({type:"number",check:"number_format",abort:!1,format:"float32",...eK(e)})}function ap(e){return new ad({type:"number",check:"number_format",abort:!1,format:"float64",...eK(e)})}function af(e){return new ad({type:"number",check:"number_format",abort:!1,format:"int32",...eK(e)})}function ah(e){return new ad({type:"number",check:"number_format",abort:!1,format:"uint32",...eK(e)})}let am=eE("ZodBoolean",(e,t)=>{n7.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function a_(e){return new am({type:"boolean",...eK(e)})}let ag=eE("ZodBigInt",(e,t)=>{re.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")})(0,e,0,0),e.gte=(t,n)=>e.check(iS(t,n)),e.min=(t,n)=>e.check(iS(t,n)),e.gt=(t,n)=>e.check(iz(t,n)),e.gte=(t,n)=>e.check(iS(t,n)),e.min=(t,n)=>e.check(iS(t,n)),e.lt=(t,n)=>e.check(iw(t,n)),e.lte=(t,n)=>e.check(ik(t,n)),e.max=(t,n)=>e.check(ik(t,n)),e.positive=t=>e.check(iz(BigInt(0),t)),e.negative=t=>e.check(iw(BigInt(0),t)),e.nonpositive=t=>e.check(ik(BigInt(0),t)),e.nonnegative=t=>e.check(iS(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(ij(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function ab(e){return new ag({type:"bigint",...eK(e)})}let ay=eE("ZodBigIntFormat",(e,t)=>{rt.init(e,t),ag.init(e,t)});function av(e){return new ay({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...eK(e)})}function aw(e){return new ay({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...eK(e)})}let ak=eE("ZodSymbol",(e,t)=>{rn.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema")})(0,e,0,0)});function az(e){return new ak({type:"symbol",...eK(e)})}let aS=eE("ZodUndefined",(e,t)=>{rr.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema")})(0,e,0,0)});function aE(e){return new aS({type:"undefined",...eK(e)})}let aA=eE("ZodNull",(e,t)=>{ri.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{"openapi-3.0"===e.target?(t.type="string",t.nullable=!0,t.enum=[null]):t.type="null"}});function ax(e){return new aA({type:"null",...eK(e)})}let aT=eE("ZodAny",(e,t)=>{ro.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function aj(){return new aT({type:"any"})}let aO=eE("ZodUnknown",(e,t)=>{ra.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function aP(){return new aO({type:"unknown"})}let aI=eE("ZodNever",(e,t)=>{ru.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}});function a$(e){return new aI({type:"never",...eK(e)})}let aM=eE("ZodVoid",(e,t)=>{rs.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Void cannot be represented in JSON Schema")})(0,e,0,0)});function aC(e){return new aM({type:"void",...eK(e)})}let aN=eE("ZodDate",(e,t)=>{rd.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")})(0,e,0,0),e.min=(t,n)=>e.check(iS(t,n)),e.max=(t,n)=>e.check(ik(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function aR(e){return new aN({type:"date",...eK(e)})}let aL=eE("ZodArray",(e,t)=>{rl.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;"number"==typeof o&&(n.minItems=o),"number"==typeof a&&(n.maxItems=a),n.type="array",n.items=iY(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(iM(t,n)),e.nonempty=t=>e.check(iM(1,t)),e.max=(t,n)=>e.check(i$(t,n)),e.length=(t,n)=>e.check(iC(t,n)),e.unwrap=()=>e.element});function aZ(e,t){return new aL({type:"array",element:e,...eK(t)})}function aD(e){return ue(Object.keys(e._zod.def.shape))}let aU=eE("ZodObject",(e,t)=>{r_.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;n.type="object",n.properties={};let o=i.shape;for(let e in o)n.properties[e]=iY(o[e],t,{...r,path:[...r.path,"properties",e]});let a=new Set([...new Set(Object.keys(o))].filter(e=>{let n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));a.size>0&&(n.required=Array.from(a)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=iY(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),eR(e,"shape",()=>t.shape),e.keyof=()=>ue(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:aP()}),e.loose=()=>e.clone({...e._zod.def,catchall:aP()}),e.strict=()=>e.clone({...e._zod.def,catchall:a$()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>(function(e,t){if(!eJ(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=eZ(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return eL(this,"shape",n),n}});return eq(e,r)})(e,t),e.safeExtend=t=>(function(e,t){if(!eJ(t))throw Error("Invalid input to safeExtend: expected a plain object");let n=eZ(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return eL(this,"shape",n),n}});return eq(e,n)})(e,t),e.merge=t=>{let n;return n=eZ(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return eL(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]}),eq(e,n)},e.pick=t=>(function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=eZ(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return eL(this,"shape",e),e},checks:[]});return eq(e,i)})(e,t),e.omit=t=>(function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=eZ(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return eL(this,"shape",r),r},checks:[]});return eq(e,i)})(e,t),e.partial=(...t)=>(function(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=eZ(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return eL(this,"shape",i),i},checks:[]});return eq(t,i)})(us,e,t[0]),e.required=(...t)=>{var n;let r;return n=t[0],r=eZ(e._zod.def,{get shape(){let t=e._zod.def.shape,r={...t};if(n)for(let e in n){if(!(e in r))throw Error(`Unrecognized key: "${e}"`);n[e]&&(r[e]=new uy({type:"nonoptional",innerType:t[e]}))}else for(let e in t)r[e]=new uy({type:"nonoptional",innerType:t[e]});return eL(this,"shape",r),r}}),eq(e,r)}});function aF(e,t){return new aU({type:"object",shape:e??{},...eK(t)})}function aH(e,t){return new aU({type:"object",shape:e,catchall:a$(),...eK(t)})}function aJ(e,t){return new aU({type:"object",shape:e,catchall:aP(),...eK(t)})}let aB=eE("ZodUnion",(e,t)=>{rb.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>i1(e,t,n,r),e.options=t.options});function aV(e,t){return new aB({type:"union",options:e,...eK(t)})}let aG=eE("ZodXor",(e,t)=>{aB.init(e,t),rv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>i1(e,t,n,r),e.options=t.options});function aW(e,t){return new aG({type:"union",options:e,inclusive:!1,...eK(t)})}let aq=eE("ZodDiscriminatedUnion",(e,t)=>{aB.init(e,t),rw.init(e,t)});function aK(e,t,n){return new aq({type:"union",options:t,discriminator:e,...eK(n)})}let aX=eE("ZodIntersection",(e,t)=>{rk.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a,u;return o=iY((i=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),a=iY(i.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=[...(u=e=>"allOf"in e&&1===Object.keys(e).length)(o)?o.allOf:[o],...u(a)?a.allOf:[a]])}});function aY(e,t){return new aX({type:"intersection",left:e,right:t})}let aQ=eE("ZodTuple",(e,t)=>{rS.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;n.type="array";let o="draft-2020-12"===t.target?"prefixItems":"items",a="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",u=i.items.map((e,n)=>iY(e,t,{...r,path:[...r.path,o,n]})),s=i.rest?iY(i.rest,t,{...r,path:[...r.path,a,..."openapi-3.0"===t.target?[i.items.length]:[]]}):null;"draft-2020-12"===t.target?(n.prefixItems=u,s&&(n.items=s)):"openapi-3.0"===t.target?(n.items={anyOf:u},s&&n.items.anyOf.push(s),n.minItems=u.length,s||(n.maxItems=u.length)):(n.items=u,s&&(n.additionalItems=s));let{minimum:d,maximum:c}=e._zod.bag;"number"==typeof d&&(n.minItems=d),"number"==typeof c&&(n.maxItems=c)})(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function a0(e,t,n){let r=t instanceof nI,i=r?n:t;return new aQ({type:"tuple",items:e,rest:r?t:null,...eK(i)})}let a3=eE("ZodRecord",(e,t)=>{rA.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;n.type="object";let o=i.keyType,a=o._zod.bag,u=a?.patterns;if("loose"===i.mode&&u&&u.size>0){let e=iY(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});for(let t of(n.patternProperties={},u))n.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(n.propertyNames=iY(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=iY(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let s=o._zod.values;if(s){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(n.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function a8(e,t,n){return new a3({type:"record",keyType:e,valueType:t,...eK(n)})}function a1(e,t,n){let r=eq(e);return r._zod.values=void 0,new a3({type:"record",keyType:r,valueType:t,...eK(n)})}function a2(e,t,n){return new a3({type:"record",keyType:e,valueType:t,mode:"loose",...eK(n)})}let a6=eE("ZodMap",(e,t)=>{rx.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Map cannot be represented in JSON Schema")})(0,e,0,0),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(iP(...t)),e.nonempty=t=>e.check(iP(1,t)),e.max=(...t)=>e.check(iO(...t)),e.size=(...t)=>e.check(iI(...t))});function a4(e,t,n){return new a6({type:"map",keyType:e,valueType:t,...eK(n)})}let a9=eE("ZodSet",(e,t)=>{rj.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Set cannot be represented in JSON Schema")})(0,e,0,0),e.min=(...t)=>e.check(iP(...t)),e.nonempty=t=>e.check(iP(1,t)),e.max=(...t)=>e.check(iO(...t)),e.size=(...t)=>e.check(iI(...t))});function a5(e,t){return new a9({type:"set",valueType:e,...eK(t)})}let a7=eE("ZodEnum",(e,t)=>{rP.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;(i=eO(e._zod.def.entries)).every(e=>"number"==typeof e)&&(n.type="number"),i.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=i},e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new a7({...t,checks:[],...eK(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new a7({...t,checks:[],...eK(r),entries:i})}});function ue(e,t){return new a7({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...eK(t)})}function ut(e,t){return new a7({type:"enum",entries:e,...eK(t)})}let un=eE("ZodLiteral",(e,t)=>{rI.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,o=[];for(let e of i.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else o.push(Number(e));else o.push(e);if(0===o.length);else if(1===o.length){let e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(e,t,n,0),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ur(e,t){return new un({type:"literal",values:Array.isArray(e)?e:[e],...eK(t)})}let ui=eE("ZodFile",(e,t)=>{r$.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:a,mime:u}=e._zod.bag;void 0!==o&&(i.minLength=o),void 0!==a&&(i.maxLength=a),u?1===u.length?(i.contentMediaType=u[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=u.map(e=>({contentMediaType:e}))):Object.assign(n,i)})(e,0,n,0),e.min=(t,n)=>e.check(iP(t,n)),e.max=(t,n)=>e.check(iO(t,n)),e.mime=(t,n)=>e.check(iH(Array.isArray(t)?t:[t],n))});function uo(e){return new ui({type:"file",...eK(e)})}let ua=eE("ZodTransform",(e,t)=>{rM.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,e,0,0),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ex(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(e4(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(e4(r)))};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function uu(e){return new ua({type:"transform",transform:e})}let us=eE("ZodOptional",(e,t)=>{rN.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>i2(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ud(e){return new us({type:"optional",innerType:e})}let uc=eE("ZodExactOptional",(e,t)=>{rR.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>i2(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ul(e){return new uc({type:"optional",innerType:e})}let up=eE("ZodNullable",(e,t)=>{rL.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=iY((i=e._zod.def).innerType,t,r),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function uf(e){return new up({type:"nullable",innerType:e})}function uh(e){return ud(uf(e))}let um=eE("ZodDefault",(e,t)=>{rZ.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;iY((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function u_(e,t){return new um({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():eB(t)}})}let ug=eE("ZodPrefault",(e,t)=>{rU.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;iY((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},e.unwrap=()=>e._zod.def.innerType});function ub(e,t){return new ug({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():eB(t)}})}let uy=eE("ZodNonOptional",(e,t)=>{rF.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;iY((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType});function uv(e,t){return new uy({type:"nonoptional",innerType:e,...eK(t)})}let uw=eE("ZodSuccess",(e,t)=>{rJ.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"},e.unwrap=()=>e._zod.def.innerType});function uk(e){return new uw({type:"success",innerType:e})}let uz=eE("ZodCatch",(e,t)=>{rB.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i,o=e._zod.def;iY(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function uS(e,t){return new uz({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}let uE=eE("ZodNaN",(e,t)=>{rV.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("NaN cannot be represented in JSON Schema")})(0,e,0,0)});function uA(e){return new uE({type:"nan",...eK(e)})}let ux=eE("ZodPipe",(e,t)=>{rG.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o;return i=e._zod.def,void(iY(o="input"===t.io?"transform"===i.in._zod.def.type?i.out:i.in:i.out,t,r),t.seen.get(e).ref=o)},e.in=t.in,e.out=t.out});function uT(e,t){return new ux({type:"pipe",in:e,out:t})}let uj=eE("ZodCodec",(e,t)=>{ux.init(e,t),rq.init(e,t)});function uO(e,t,n){return new uj({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}let uP=eE("ZodReadonly",(e,t)=>{rY.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;iY((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType});function uI(e){return new uP({type:"readonly",innerType:e})}let u$=eE("ZodTemplateLiteral",(e,t)=>{r0.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.pattern;if(!i)throw Error("Pattern not found in template literal");n.type="string",n.pattern=i.source})(e,0,n,0)});function uM(e,t){return new u$({type:"template_literal",parts:e,...eK(t)})}let uC=eE("ZodLazy",(e,t)=>{r1.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;iY(i=e._zod.innerType,t,r),t.seen.get(e).ref=i},e.unwrap=()=>e._zod.def.getter()});function uN(e){return new uC({type:"lazy",getter:e})}let uR=eE("ZodPromise",(e,t)=>{r8.init(e,t),og.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;iY((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType});function uL(e){return new uR({type:"promise",innerType:e})}let uZ=eE("ZodFunction",(e,t)=>{r3.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Function types cannot be represented in JSON Schema")})(0,e,0,0)});function uD(e){return new uZ({type:"function",input:Array.isArray(e?.input)?a0(e?.input):e?.input??aZ(aP()),output:e?.output??aP()})}let uU=eE("ZodCustom",(e,t)=>{r2.init(e,t),og.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,e,0,0)});function uF(e){let t=new na({check:"custom"});return t._zod.check=e,t}function uH(e,t){var n;let r;return n=e??(()=>!0),(r=eK(t)).abort??(r.abort=!0),new uU({type:"custom",check:"custom",fn:n,...r})}function uJ(e,t={}){return new uU({type:"custom",check:"custom",fn:e,...eK(t)})}function uB(e){var t;let n,r;return t=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(e4(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(e4(e)))},e(t.value,t)),(r=new na({check:"custom",...eK(void 0)}))._zod.check=t,n=r}let uV=function(e){let t=new na({check:"describe"});return t._zod.onattach=[t=>{let n=r4.get(t)??{};r4.add(t,{...n,description:e})}],t._zod.check=()=>{},t},uG=function(e){let t=new na({check:"meta"});return t._zod.onattach=[t=>{let n=r4.get(t)??{};r4.add(t,{...n,...e})}],t._zod.check=()=>{},t};function uW(e,t={}){let n=new uU({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...eK(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}let uq=(...e)=>(function(e,t){let n=eK(t),r=n.truthy??["true","1","yes","on","y","enabled"],i=n.falsy??["false","0","no","off","n","disabled"];"sensitive"!==n.case&&(r=r.map(e=>"string"==typeof e?e.toLowerCase():e),i=i.map(e=>"string"==typeof e?e.toLowerCase():e));let o=new Set(r),a=new Set(i),u=e.Codec??rq,s=e.Boolean??n7,d=new u({type:"pipe",in:new(e.String??n$)({type:"string",error:n.error}),out:new s({type:"boolean",error:n.error}),transform:(e,t)=>{let r=e;return"sensitive"!==n.case&&(r=r.toLowerCase()),!!o.has(r)||!a.has(r)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:t.value,inst:d,continue:!1}),{})},reverseTransform:(e,t)=>!0===e?r[0]||"true":i[0]||"false",error:n.error});return d})({Codec:uj,Boolean:am,String:oy},...e);function uK(e){let t=uN(()=>aV([ov(e),as(),a_(),ax(),aZ(t),a8(ov(),t)]));return t}function uX(e,t){return uT(uu(e),t)}z||(z={}),ej({localeError:(c={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},l={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},p={nan:"NaN"},e=>{switch(e.code){case"invalid_type":{let t=p[e.expected]??e.expected,n=function(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}(e.input),r=p[n]??n;return`Invalid input: expected ${t}, received ${r}`}case"invalid_value":if(1===e.values.length)return`Invalid input: expected ${eX(e.values[0])}`;return`Invalid option: expected one of ${eP(e.values,"|")}`;case"too_big":{let t=e.inclusive?"<=":"<",n=c[e.origin]??null;if(n)return`Too big: expected ${e.origin??"value"} to have ${t}${e.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${e.origin??"value"} to be ${t}${e.maximum.toString()}`}case"too_small":{let t=e.inclusive?">=":">",n=c[e.origin]??null;if(n)return`Too small: expected ${e.origin} to have ${t}${e.minimum.toString()} ${n.unit}`;return`Too small: expected ${e.origin} to be ${t}${e.minimum.toString()}`}case"invalid_format":if("starts_with"===e.format)return`Invalid string: must start with "${e.prefix}"`;if("ends_with"===e.format)return`Invalid string: must end with "${e.suffix}"`;if("includes"===e.format)return`Invalid string: must include "${e.includes}"`;if("regex"===e.format)return`Invalid string: must match pattern ${e.pattern}`;return`Invalid ${l[e.format]??e.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${eP(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`}})});var uY=r("../../common/temp/node_modules/.pnpm/react@19.1.5/node_modules/react/jsx-runtime.js");let uQ=`
|
|
3
39
|
<script src="https://cdn.jsdmirror.com/npm/@fortawesome/fontawesome-free/js/all.min.js"></script>
|
|
4
40
|
<script src="https://cdn.jsdmirror.com/npm/@tailwindcss/browser/dist/index.global.min.js"></script>
|
|
5
41
|
<script src="https://cdn.jsdmirror.com/npm/jquery/dist/jquery.min.js"></script>
|
|
6
42
|
<script src="https://cdn.jsdmirror.com/npm/jquery-ui/dist/jquery-ui.min.js"></script>
|
|
7
43
|
<link rel="stylesheet" href="https://cdn.jsdmirror.com/npm/jquery-ui/themes/base/theme.min.css" />
|
|
8
44
|
<script src="https://cdn.jsdmirror.com/npm/jquery-ui-touch-punch"></script>
|
|
9
|
-
`;class
|
|
45
|
+
`;class u0 extends Error{reason;filename;line;column;source;constructor(e,t,n,r,i){super(`${e}:${n}:${r}: ${t}`),this.reason=t,this.filename=e,this.line=n,this.column=r,this.source=i}}class u3{start;end;source;constructor(e,t,n){this.start=e,this.end=t,this.source=n}}(_=S||(S={})).stylesheet="stylesheet",_.rule="rule",_.declaration="declaration",_.comment="comment",_.container="container",_.charset="charset",_.document="document",_.customMedia="custom-media",_.fontFace="font-face",_.host="host",_.import="import",_.keyframes="keyframes",_.keyframe="keyframe",_.layer="layer",_.media="media",_.namespace="namespace",_.page="page",_.startingStyle="starting-style",_.supports="supports";let u8=(e,t,n)=>{let r=n,i=1e4;do{let n=t.map(t=>e.indexOf(t,r));n.push(e.indexOf("\\",r));let o=n.filter(e=>-1!==e);if(0===o.length)return -1;let a=Math.min(...o);if("\\"!==e[a])return a;r=a+2,i--}while(i>0);throw Error("Too many escaping")},u1=(e,t,n)=>{let r=n,i=1e4;do{let n=t.map(t=>e.indexOf(t,r));n.push(e.indexOf("(",r)),n.push(e.indexOf('"',r)),n.push(e.indexOf("'",r)),n.push(e.indexOf("\\",r));let o=n.filter(e=>-1!==e);if(0===o.length)return -1;let a=Math.min(...o);switch(e[a]){case"\\":r=a+2;break;case"(":{let t=u1(e,[")"],a+1);if(-1===t)return -1;r=t+1}break;case'"':{let t=u8(e,['"'],a+1);if(-1===t)return -1;r=t+1}break;case"'":{let t=u8(e,["'"],a+1);if(-1===t)return -1;r=t+1}break;default:return a}i--}while(i>0);throw Error("Too many escaping")},u2=/\/\*[^]*?(?:\*\/|$)/g;function u6(e){return e?e.trim():""}class u4{level=0;indentation=" ";compress=!1;constructor(e){"string"==typeof e?.indent&&(this.indentation=e?.indent),e?.compress&&(this.compress=!0)}emit(e,t){return e}indent(e){return this.level=this.level||1,e?(this.level+=e,""):Array(this.level).join(this.indentation)}visit(e){switch(e.type){case S.stylesheet:return this.stylesheet(e);case S.rule:return this.rule(e);case S.declaration:return this.declaration(e);case S.comment:return this.comment(e);case S.container:return this.container(e);case S.charset:return this.charset(e);case S.document:return this.document(e);case S.customMedia:return this.customMedia(e);case S.fontFace:return this.fontFace(e);case S.host:return this.host(e);case S.import:return this.import(e);case S.keyframes:return this.keyframes(e);case S.keyframe:return this.keyframe(e);case S.layer:return this.layer(e);case S.media:return this.media(e);case S.namespace:return this.namespace(e);case S.page:return this.page(e);case S.startingStyle:return this.startingStyle(e);case S.supports:return this.supports(e)}}mapVisit(e,t){let n="";t=t||"";for(let r=0,i=e.length;r<i;r++)n+=this.visit(e[r]),t&&r<i-1&&(n+=this.emit(t));return n}compile(e){return this.compress?e.stylesheet.rules.map(this.visit,this).join(""):this.stylesheet(e)}stylesheet(e){return this.mapVisit(e.stylesheet.rules,"\n\n")}comment(e){return this.compress?this.emit("",e.position):this.emit(`${this.indent()}/*${e.comment}*/`,e.position)}container(e){return this.compress?this.emit(`@container ${e.container}`,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}"):this.emit(`${this.indent()}@container ${e.container}`,e.position)+this.emit(` {
|
|
10
46
|
${this.indent(1)}`)+this.mapVisit(e.rules,"\n\n")+this.emit(`
|
|
11
47
|
${this.indent(-1)}${this.indent()}}`)}layer(e){return this.compress?this.emit(`@layer ${e.layer}`,e.position)+(e.rules?this.emit("{")+this.mapVisit(e.rules)+this.emit("}"):";"):this.emit(`${this.indent()}@layer ${e.layer}`,e.position)+(e.rules?this.emit(` {
|
|
12
48
|
${this.indent(1)}`)+this.mapVisit(e.rules,"\n\n")+this.emit(`
|
|
@@ -25,7 +61,7 @@ ${this.indent()}}
|
|
|
25
61
|
`)}page(e){if(this.compress){let t=e.selectors.length?e.selectors.join(", "):"";return this.emit(`@page ${t}`,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")}let t=e.selectors.length?`${e.selectors.join(", ")} `:"";return this.emit(`@page ${t}`,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")}fontFace(e){return this.compress?this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}"):this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")}host(e){return this.compress?this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}"):this.emit("@host",e.position)+this.emit(` {
|
|
26
62
|
${this.indent(1)}`)+this.mapVisit(e.rules,"\n\n")+this.emit(`${this.indent(-1)}
|
|
27
63
|
}`)}customMedia(e){return this.emit(`@custom-media ${e.name} ${e.media};`,e.position)}rule(e){let t=e.declarations;if(!t.length)return"";if(this.compress)return this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}");let n=this.indent();return this.emit(e.selectors.map(e=>n+e).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1))+this.emit(`
|
|
28
|
-
${this.indent()}}`)}declaration(e){return this.compress?this.emit(`${e.property}:${e.value}`,e.position)+this.emit(";"):"grid-template-areas"===e.property?this.emit(this.indent())+this.emit(e.property+": "+e.value.split("\n").join("\n".padEnd(22)+this.indent()),e.position)+this.emit(";"):this.emit(this.indent())+this.emit(`${e.property}: ${e.value}`,e.position)+this.emit(";")}}let{entries:eM,setPrototypeOf:eC,isFrozen:eN,getPrototypeOf:eR,getOwnPropertyDescriptor:eL}=Object,{freeze:eZ,seal:eD,create:eU}=Object,{apply:eF,construct:eH}="undefined"!=typeof Reflect&&Reflect;eZ||(eZ=function(e){return e}),eD||(eD=function(e){return e}),eF||(eF=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),eH||(eH=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});let eJ=e2(Array.prototype.forEach),eB=e2(Array.prototype.lastIndexOf),eV=e2(Array.prototype.pop),eG=e2(Array.prototype.push),eW=e2(Array.prototype.splice),eq=e2(String.prototype.toLowerCase),eK=e2(String.prototype.toString),eX=e2(String.prototype.match),eY=e2(String.prototype.replace),eQ=e2(String.prototype.indexOf),e0=e2(String.prototype.trim),e3=e2(Object.prototype.hasOwnProperty),e8=e2(RegExp.prototype.test),e1=(f=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return eH(f,t)});function e2(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return eF(e,t,r)}}function e6(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eq;eC&&eC(e,null);let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){let e=n(i);e!==i&&(eN(t)||(t[r]=e),i=e)}e[i]=!0}return e}function e4(e){let t=eU(null);for(let[n,r]of eM(e))e3(e,n)&&(Array.isArray(r)?t[n]=function(e){for(let t=0;t<e.length;t++)e3(e,t)||(e[t]=null);return e}(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=e4(r):t[n]=r);return t}function e9(e,t){for(;null!==e;){let n=eL(e,t);if(n){if(n.get)return e2(n.get);if("function"==typeof n.value)return e2(n.value)}e=eR(e)}return function(){return null}}let e5=eZ(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),e7=eZ(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),te=eZ(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),tt=eZ(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),tn=eZ(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),tr=eZ(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ti=eZ(["#text"]),to=eZ(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ta=eZ(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),tu=eZ(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ts=eZ(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),td=eD(/\{\{[\w\W]*|[\w\W]*\}\}/gm),tc=eD(/<%[\w\W]*|[\w\W]*%>/gm),tl=eD(/\$\{[\w\W]*/gm),tp=eD(/^data-[\-\w.\u00B7-\uFFFF]+$/),tf=eD(/^aria-[\-\w]+$/),th=eD(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),tm=eD(/^(?:\w+script|data):/i),t_=eD(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),tg=eD(/^html$/i);var tb=Object.freeze({__proto__:null,ARIA_ATTR:tf,ATTR_WHITESPACE:t_,CUSTOM_ELEMENT:eD(/^[a-z][.\w]*(-[.\w]+)+$/i),DATA_ATTR:tp,DOCTYPE_NAME:tg,ERB_EXPR:tc,IS_ALLOWED_URI:th,IS_SCRIPT_OR_DATA:tm,MUSTACHE_EXPR:td,TMPLIT_EXPR:tl});let ty=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null,r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}},tv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};var tw=function e(){let t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,r=t=>e(t);if(r.version="3.3.3",r.removed=[],!n||!n.document||9!==n.document.nodeType||!n.Element)return r.isSupported=!1,r;let{document:i}=n,o=i,a=o.currentScript,{DocumentFragment:u,HTMLTemplateElement:s,Node:d,Element:c,NodeFilter:l,NamedNodeMap:p=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:m}=n,_=c.prototype,g=e9(_,"cloneNode"),b=e9(_,"remove"),y=e9(_,"nextSibling"),v=e9(_,"childNodes"),w=e9(_,"parentNode");if("function"==typeof s){let e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let k="",{implementation:z,createNodeIterator:S,createDocumentFragment:E,getElementsByTagName:A}=i,{importNode:x}=o,T=tv();r.isSupported="function"==typeof eM&&"function"==typeof w&&z&&void 0!==z.createHTMLDocument;let{MUSTACHE_EXPR:j,ERB_EXPR:O,TMPLIT_EXPR:P,DATA_ATTR:I,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:C,CUSTOM_ELEMENT:N}=tb,{IS_ALLOWED_URI:R}=tb,L=null,Z=e6({},[...e5,...e7,...te,...tn,...ti]),D=null,U=e6({},[...to,...ta,...tu,...ts]),F=Object.seal(eU(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),H=null,J=null,B=Object.seal(eU(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),V=!0,G=!0,W=!1,q=!0,K=!1,X=!0,Y=!1,Q=!1,ee=!1,et=!1,en=!1,er=!1,ei=!0,eo=!1,ea=!0,eu=!1,es={},ed=null,ec=e6({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),el=null,ep=e6({},["audio","video","img","source","image","track"]),ef=null,eh=e6({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),em="http://www.w3.org/1998/Math/MathML",e_="http://www.w3.org/2000/svg",eg="http://www.w3.org/1999/xhtml",eb=eg,ey=!1,ev=null,ew=e6({},[em,e_,eg],eK),ek=e6({},["mi","mo","mn","ms","mtext"]),ez=e6({},["annotation-xml"]),eS=e6({},["title","style","font","a","script"]),eE=null,eA=["application/xhtml+xml","text/html"],ex=null,eT=null,ej=i.createElement("form"),eO=function(e){return e instanceof RegExp||e instanceof Function},eP=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!eT||eT!==e){if(e&&"object"==typeof e||(e={}),e=e4(e),ex="application/xhtml+xml"===(eE=-1===eA.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?eK:eq,L=e3(e,"ALLOWED_TAGS")?e6({},e.ALLOWED_TAGS,ex):Z,D=e3(e,"ALLOWED_ATTR")?e6({},e.ALLOWED_ATTR,ex):U,ev=e3(e,"ALLOWED_NAMESPACES")?e6({},e.ALLOWED_NAMESPACES,eK):ew,ef=e3(e,"ADD_URI_SAFE_ATTR")?e6(e4(eh),e.ADD_URI_SAFE_ATTR,ex):eh,el=e3(e,"ADD_DATA_URI_TAGS")?e6(e4(ep),e.ADD_DATA_URI_TAGS,ex):ep,ed=e3(e,"FORBID_CONTENTS")?e6({},e.FORBID_CONTENTS,ex):ec,H=e3(e,"FORBID_TAGS")?e6({},e.FORBID_TAGS,ex):e4({}),J=e3(e,"FORBID_ATTR")?e6({},e.FORBID_ATTR,ex):e4({}),es=!!e3(e,"USE_PROFILES")&&e.USE_PROFILES,V=!1!==e.ALLOW_ARIA_ATTR,G=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,q=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,K=e.SAFE_FOR_TEMPLATES||!1,X=!1!==e.SAFE_FOR_XML,Y=e.WHOLE_DOCUMENT||!1,et=e.RETURN_DOM||!1,en=e.RETURN_DOM_FRAGMENT||!1,er=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,ei=!1!==e.SANITIZE_DOM,eo=e.SANITIZE_NAMED_PROPS||!1,ea=!1!==e.KEEP_CONTENT,eu=e.IN_PLACE||!1,R=e.ALLOWED_URI_REGEXP||th,eb=e.NAMESPACE||eg,ek=e.MATHML_TEXT_INTEGRATION_POINTS||ek,ez=e.HTML_INTEGRATION_POINTS||ez,F=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&eO(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(F.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&eO(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(F.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(F.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(G=!1),en&&(et=!0),es&&(L=e6({},ti),D=eU(null),!0===es.html&&(e6(L,e5),e6(D,to)),!0===es.svg&&(e6(L,e7),e6(D,ta),e6(D,ts)),!0===es.svgFilters&&(e6(L,te),e6(D,ta),e6(D,ts)),!0===es.mathMl&&(e6(L,tn),e6(D,tu),e6(D,ts))),e3(e,"ADD_TAGS")||(B.tagCheck=null),e3(e,"ADD_ATTR")||(B.attributeCheck=null),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?B.tagCheck=e.ADD_TAGS:(L===Z&&(L=e4(L)),e6(L,e.ADD_TAGS,ex))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?B.attributeCheck=e.ADD_ATTR:(D===U&&(D=e4(D)),e6(D,e.ADD_ATTR,ex))),e.ADD_URI_SAFE_ATTR&&e6(ef,e.ADD_URI_SAFE_ATTR,ex),e.FORBID_CONTENTS&&(ed===ec&&(ed=e4(ed)),e6(ed,e.FORBID_CONTENTS,ex)),e.ADD_FORBID_CONTENTS&&(ed===ec&&(ed=e4(ed)),e6(ed,e.ADD_FORBID_CONTENTS,ex)),ea&&(L["#text"]=!0),Y&&e6(L,["html","head","body"]),L.table&&(e6(L,["tbody"]),delete H.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw e1('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw e1('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=(t=e.TRUSTED_TYPES_POLICY).createHTML("")}else void 0===t&&(t=ty(m,a)),null!==t&&"string"==typeof k&&(k=t.createHTML(""));eZ&&eZ(e),eT=e}},eI=e6({},[...e7,...te,...tt]),e$=e6({},[...tn,...tr]),eC=function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:eb,tagName:"template"});let n=eq(e.tagName),r=eq(t.tagName);return!!ev[e.namespaceURI]&&(e.namespaceURI===e_?t.namespaceURI===eg?"svg"===n:t.namespaceURI===em?"svg"===n&&("annotation-xml"===r||ek[r]):!!eI[n]:e.namespaceURI===em?t.namespaceURI===eg?"math"===n:t.namespaceURI===e_?"math"===n&&ez[r]:!!e$[n]:e.namespaceURI===eg?(t.namespaceURI!==e_||!!ez[r])&&(t.namespaceURI!==em||!!ek[r])&&!e$[n]&&(eS[n]||!eI[n]):"application/xhtml+xml"===eE&&!!ev[e.namespaceURI])},eN=function(e){eG(r.removed,{element:e});try{w(e).removeChild(e)}catch(t){b(e)}},eR=function(e,t){try{eG(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){eG(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(et||en)try{eN(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},eL=function(e){let n=null,r=null;if(ee)e="<remove></remove>"+e;else{let t=eX(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===eE&&eb===eg&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let o=t?t.createHTML(e):e;if(eb===eg)try{n=new h().parseFromString(o,eE)}catch(e){}if(!n||!n.documentElement){n=z.createDocument(eb,"template",null);try{n.documentElement.innerHTML=ey?k:o}catch(e){}}let a=n.body||n.documentElement;return(e&&r&&a.insertBefore(i.createTextNode(r),a.childNodes[0]||null),eb===eg)?A.call(n,Y?"html":"body")[0]:Y?n.documentElement:a},eD=function(e){return S.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},eF=function(e){return e instanceof f&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof p)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},eH=function(e){return"function"==typeof d&&e instanceof d};function e2(e,t,n){eJ(e,e=>{e.call(r,t,n,eT)})}let td=function(e){let t=null;if(e2(T.beforeSanitizeElements,e,null),eF(e))return eN(e),!0;let n=ex(e.nodeName);if(e2(T.uponSanitizeElement,e,{tagName:n,allowedTags:L}),X&&e.hasChildNodes()&&!eH(e.firstElementChild)&&e8(/<[/\w!]/g,e.innerHTML)&&e8(/<[/\w!]/g,e.textContent)||7===e.nodeType||X&&8===e.nodeType&&e8(/<[/\w]/g,e.data))return eN(e),!0;if(!(B.tagCheck instanceof Function&&B.tagCheck(n))&&(!L[n]||H[n])){if(!H[n]&&tl(n)&&(F.tagNameCheck instanceof RegExp&&e8(F.tagNameCheck,n)||F.tagNameCheck instanceof Function&&F.tagNameCheck(n)))return!1;if(ea&&!ed[n]){let t=w(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=g(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,y(e))}}}return eN(e),!0}return e instanceof c&&!eC(e)||("noscript"===n||"noembed"===n||"noframes"===n)&&e8(/<\/no(script|embed|frames)/i,e.innerHTML)?(eN(e),!0):(K&&3===e.nodeType&&(t=e.textContent,eJ([j,O,P],e=>{t=eY(t,e," ")}),e.textContent!==t&&(eG(r.removed,{element:e.cloneNode()}),e.textContent=t)),e2(T.afterSanitizeElements,e,null),!1)},tc=function(e,t,n){if(J[t]||ei&&("id"===t||"name"===t)&&(n in i||n in ej))return!1;if(G&&!J[t]&&e8(I,t));else if(V&&e8($,t));else if(B.attributeCheck instanceof Function&&B.attributeCheck(t,e));else if(!D[t]||J[t]){if(!(tl(e)&&(F.tagNameCheck instanceof RegExp&&e8(F.tagNameCheck,e)||F.tagNameCheck instanceof Function&&F.tagNameCheck(e))&&(F.attributeNameCheck instanceof RegExp&&e8(F.attributeNameCheck,t)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(t,e))||"is"===t&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&e8(F.tagNameCheck,n)||F.tagNameCheck instanceof Function&&F.tagNameCheck(n))))return!1}else if(ef[t]);else if(e8(R,eY(n,C,"")));else if(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===eQ(n,"data:")&&el[e]);else if(W&&!e8(M,eY(n,C,"")));else if(n)return!1;return!0},tl=function(e){return"annotation-xml"!==e&&eX(e,N)},tp=function(e){e2(T.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||eF(e))return;let i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0},o=n.length;for(;o--;){let{name:a,namespaceURI:u,value:s}=n[o],d=ex(a),c="value"===a?s:e0(s);if(i.attrName=d,i.attrValue=c,i.keepAttr=!0,i.forceKeepAttr=void 0,e2(T.uponSanitizeAttribute,e,i),c=i.attrValue,eo&&("id"===d||"name"===d)&&(eR(a,e),c="user-content-"+c),X&&e8(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,c)||"attributename"===d&&eX(c,"href")){eR(a,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr||!q&&e8(/\/>/i,c)){eR(a,e);continue}K&&eJ([j,O,P],e=>{c=eY(c,e," ")});let l=ex(e.nodeName);if(!tc(l,d,c)){eR(a,e);continue}if(t&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(u);else switch(m.getAttributeType(l,d)){case"TrustedHTML":c=t.createHTML(c);break;case"TrustedScriptURL":c=t.createScriptURL(c)}if(c!==s)try{u?e.setAttributeNS(u,a,c):e.setAttribute(a,c),eF(e)?eN(e):eV(r.removed)}catch(t){eR(a,e)}}e2(T.afterSanitizeAttributes,e,null)},tf=function e(t){let n=null,r=eD(t);for(e2(T.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)e2(T.uponSanitizeShadowNode,n,null),td(n),tp(n),n.content instanceof u&&e(n.content);e2(T.afterSanitizeShadowDOM,t,null)};return r.sanitize=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,a=null,s=null,c=null;if((ey=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!eH(e))if("function"==typeof e.toString){if("string"!=typeof(e=e.toString()))throw e1("dirty is not a string, aborting")}else throw e1("toString is not a function");if(!r.isSupported)return e;if(Q||eP(n),r.removed=[],"string"==typeof e&&(eu=!1),eu){if(e.nodeName){let t=ex(e.nodeName);if(!L[t]||H[t])throw e1("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof d)1===(a=(i=eL("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?i=a:i.appendChild(a);else{if(!et&&!K&&!Y&&-1===e.indexOf("<"))return t&&er?t.createHTML(e):e;if(!(i=eL(e)))return et?null:er?k:""}i&&ee&&eN(i.firstChild);let l=eD(eu?e:i);for(;s=l.nextNode();)td(s),tp(s),s.content instanceof u&&tf(s.content);if(eu)return e;if(et){if(en)for(c=E.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(D.shadowroot||D.shadowrootmode)&&(c=x.call(o,c,!0)),c}let p=Y?i.outerHTML:i.innerHTML;return Y&&L["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&e8(tg,i.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+p),K&&eJ([j,O,P],e=>{p=eY(p,e," ")}),t&&er?t.createHTML(p):p},r.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eP(e),Q=!0},r.clearConfig=function(){eT=null,Q=!1},r.isValidAttribute=function(e,t,n){return eT||eP({}),tc(ex(e),ex(t),n)},r.addHook=function(e,t){"function"==typeof t&&eG(T[e],t)},r.removeHook=function(e,t){if(void 0!==t){let n=eB(T[e],t);return -1===n?void 0:eW(T[e],n,1)[0]}return eV(T[e])},r.removeHooks=function(e){T[e]=[]},r.removeAllHooks=function(){T=tv()},r}(),tk=r("../../common/temp/node_modules/.pnpm/showdown@2.1.0/node_modules/showdown/dist/showdown.js"),tz=r.n(tk);let tS={i(...e){console.log("[MujianSDK] ",...e)},e(...e){console.error("[MujianSDK] ",...e)}};tw.addHook("afterSanitizeAttributes",function(e){"target"in e&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener"))}),tw.addHook("uponSanitizeAttribute",(e,t,n)=>{n.MESSAGE_SANITIZE&&!(n.MESSAGE_ALLOW_SYSTEM_UI&&e.classList.contains("menu_button")&&["BUTTON","DIV"].includes(e.nodeName))&&"class"===t.attrName&&t.attrValue&&(t.attrValue=t.attrValue.split(" ").map(e=>e.startsWith("fa-")||e.startsWith("note-")||"monospace"===e?e:"custom-"+e).join(" "))}),tw.addHook("uponSanitizeElement",(e,t,n)=>{n.MESSAGE_SANITIZE&&e instanceof HTMLUnknownElement&&(e.innerHTML=e.innerHTML.trim().replaceAll("\n","<br>"))});let tE=new(tz()).Converter({emoji:!0,literalMidWordUnderscores:!0,parseImgDimensions:!0,tables:!0,underline:!0,simpleLineBreaks:!0,strikethrough:!0,disableForced4SpacesIndentedSublists:!0,extensions:[(()=>{try{if(!function(){try{return RegExp("(?<!_)"),!0}catch(e){return!1}}())return tS.i("Showdown-underscore extension: Negative lookbehind not supported. Skipping."),[];return[{type:"output",regex:RegExp("(<code(?:\\s+[^>]*)?>[\\s\\S]*?<\\/code>|<style(?:\\s+[^>]*)?>[\\s\\S]*?<\\/style>)|\\b(?<!_)_(?!_)(.*?)(?<!_)_(?!_)\\b","gi"),replace:function(e,t,n){if(t);else if(n)return"<em>"+n+"</em>";return e}}]}catch(e){return console.error("Error in Showdown-underscore extension:",e),[]}})()]}),tA="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),tx=new Uint8Array(16),tT=[];for(let e=0;e<256;++e)tT.push((e+256).toString(16).slice(1));let tj=function(t,n,r){if(tA&&!n&&!t)return tA();var i=t,o=r;let a=(i=i||{}).random??i.rng?.()??function(){if(!e){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");e=crypto.getRandomValues.bind(crypto)}return e(tx)}();if(a.length<16)throw Error("Random bytes length must be >= 16");if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n){if((o=o||0)<0||o+16>n.length)throw RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);for(let e=0;e<16;++e)n[o+e]=a[e];return n}return function(e,t=0){return(tT[e[t+0]]+tT[e[t+1]]+tT[e[t+2]]+tT[e[t+3]]+"-"+tT[e[t+4]]+tT[e[t+5]]+"-"+tT[e[t+6]]+tT[e[t+7]]+"-"+tT[e[t+8]]+tT[e[t+9]]+"-"+tT[e[t+10]]+tT[e[t+11]]+tT[e[t+12]]+tT[e[t+13]]+tT[e[t+14]]+tT[e[t+15]]).toLowerCase()}(a)},tO={"zh-hans":"加载中...","zh-hant":"載入中...",en:"Loading...",ja:"読み込み中...",th:"กำลังโหลด..."},tP=({content:e,unsafe:t=!1,extra:n={},lang:r})=>{let i=(0,N.useRef)(null),[o,a]=(0,N.useState)([]);return(0,N.useEffect)(()=>{let o=function(e,t={}){if(!e)return"";e=(e=(e=(e=(e=e.replace(/<([^>]+)>/g,function(e,t){return"<"+t.replace(/"/g,"")+">"})).replace(/<style>[\s\S]*?<\/style>|```[\s\S]*?```|~~~[\s\S]*?~~~|``[\s\S]*?``|`[\s\S]*?`|(".*?")|(\u201C.*?\u201D)|(\u00AB.*?\u00BB)|(\u300C.*?\u300D)|(\u300E.*?\u300F)|(\uFF02.*?\uFF02)/gim,function(e,t,n,r,i,o,a){if(t)return`<q>"${t.slice(1,-1)}"</q>`;if(n)return`<q>“${n.slice(1,-1)}”</q>`;if(r)return`<q>\xab${r.slice(1,-1)}\xbb</q>`;if(i)return`<q>「${i.slice(1,-1)}」</q>`;if(o)return`<q>『${o.slice(1,-1)}』</q>`;else if(a)return`<q>"${a.slice(1,-1)}"</q>`;else return e})).replace(/\ufffe/g,'"')).replaceAll("\\begin{align*}","$$")).replaceAll("\\end{align*}","$$"),e=(e=(e=(e=(e=tE.makeHtml(e)).replace(/<code(.*)>[\s\S]*?<\/code>/g,function(e){return e.replace(/\n/gm,"\0")})).replace(/\u0000/g,"\n")).trim()).replace(/<code(.*)>[\s\S]*?<\/code>/g,function(e){return e.replace(/&/g,"&")});let n={RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!1,MESSAGE_SANITIZE:!0,ADD_TAGS:["custom-style"],...t};return e=e.replaceAll(/<style>([\s\S]+?)<\/style>/gi,(e,t)=>`<custom-style>${encodeURIComponent(t)}</custom-style>`),e=function(e,{prefix:t}={prefix:".mes_text "}){function n(e){return e.split(/\s+/).map(e=>e.replace(/\.([\w-]+)/g,(e,t)=>t.startsWith("custom-")?e:`.custom-${t}`)).join(" ")}return e.replaceAll(/<custom-style>(.+?)<\/custom-style>/g,(e,r)=>{try{let e,i,o=decodeURIComponent(r).replaceAll(/<br\/>/g,""),a=((e,t)=>{let n;t=t||{};let r=1,i=1;function o(){let e={line:r,column:i};return n=>(n.position=new eT(e,{line:r,column:i},t?.source||""),l(),n)}let a=[];function u(n){let o=new ex(t?.source||"",n,r,i,e);if(!t?.silent)throw o;a.push(o)}function s(){let t=/^{\s*/.exec(e);return!!t&&(c(t),!0)}function d(){let t=/^}/.exec(e);return!!t&&(c(t),!0)}function c(t){let n,o,a=t[0];return(n=a.match(/\n/g))&&(r+=n.length),i=~(o=a.lastIndexOf("\n"))?a.length-o:i+a.length,e=e.slice(a.length),t}function l(){let t=/^\s*/.exec(e);t&&c(t)}function p(e){e=e||[];let t=f();for(;t;)e.push(t),t=f();return e}function f(){let t=o();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=/^\/\*[^]*?\*\//.exec(e);return n?(c(n),t({type:k.comment,comment:n[0].slice(2,-2)})):u("End of comment missing")}function h(){let t=/^([^{]+)/.exec(e);if(t)return c(t),((e,t)=>{let n=[],r=0;for(;r<e.length;){let i=eO(e,t,r);if(-1===i)return n.push(e.substring(r)),n;n.push(e.substring(r,i)),r=i+1}return n})(eI(t[0]).replace(eP,""),[","]).map(e=>eI(e))}function m(){let t=o(),n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);if(!n)return;c(n);let r=eI(n[0]),i=/^:\s*/.exec(e);if(!i)return u("property missing ':'");c(i);let a="",s=eO(e,[";","}"]);-1!==s&&(c([a=e.substring(0,s)]),a=eI(a).replace(eP,""));let d=t({type:k.declaration,property:r.replace(eP,""),value:a}),l=/^[;\s]*/.exec(e);return l&&c(l),d}function _(){let e=[];if(!s())return u("missing '{'");p(e);let t=m();for(;t;)e.push(t),p(e),t=m();return d()?e:u("missing '}'")}function g(){let t=[],n=o(),r=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);for(;r;){let n=c(r);t.push(n[1]);let i=/^,\s*/.exec(e);i&&c(i),r=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e)}if(t.length)return n({type:k.keyframe,values:t,declarations:_()||[]})}let b=w("import"),y=w("charset"),v=w("namespace");function w(t){let n=RegExp("^@"+t+"\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");return()=>{let r=o(),i=n.exec(e);if(!i)return;let a=c(i),u={type:t};return u[t]=a[1].trim(),r(u)}}return function e(t,n){let r=t&&"string"==typeof t.type,i=r?t:n;for(let n in t){let r=t[n];Array.isArray(r)?r.forEach(t=>{e(t,i)}):r&&"object"==typeof r&&e(r,i)}return r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null}),t}((n=function t(){let n,r,i,a=[];for(l(),p(a);e.length&&"}"!==e.charAt(0)&&(i=function(){if("@"===e[0])return function(){let t=o(),n=/^@([-\w]+)?keyframes\s*/.exec(e);if(!n)return;let r=c(n)[1],i=/^([-\w]+)\s*/.exec(e);if(!i)return u("@keyframes missing name");let a=c(i)[1];if(!s())return u("@keyframes missing '{'");let l=p(),f=g();for(;f;)l.push(f),l=l.concat(p()),f=g();return d()?t({type:k.keyframes,name:a,vendor:r,keyframes:l}):u("@keyframes missing '}'")}()||function(){let n=o(),r=/^@media *([^{]+)/.exec(e);if(!r)return;let i=eI(c(r)[1]);if(!s())return u("@media missing '{'");let a=p().concat(t());return d()?n({type:k.media,media:i,rules:a}):u("@media missing '}'")}()||function(){let t=o(),n=/^@custom-media\s+(--\S+)\s+([^{;\s][^{;]*);/.exec(e);if(!n)return;let r=c(n);return t({type:k.customMedia,name:eI(r[1]),media:eI(r[2])})}()||function(){let n=o(),r=/^@supports *([^{]+)/.exec(e);if(!r)return;let i=eI(c(r)[1]);if(!s())return u("@supports missing '{'");let a=p().concat(t());return d()?n({type:k.supports,supports:i,rules:a}):u("@supports missing '}'")}()||b()||y()||v()||function(){let n=o(),r=/^@([-\w]+)?document *([^{]+)/.exec(e);if(!r)return;let i=c(r),a=eI(i[1]),l=eI(i[2]);if(!s())return u("@document missing '{'");let f=p().concat(t());return d()?n({type:k.document,document:l,vendor:a,rules:f}):u("@document missing '}'")}()||function(){let t=o(),n=/^@page */.exec(e);if(!n)return;c(n);let r=h()||[];if(!s())return u("@page missing '{'");let i=p(),a=m();for(;a;)i.push(a),i=i.concat(p()),a=m();return d()?t({type:k.page,selectors:r,declarations:i}):u("@page missing '}'")}()||function(){let n=o(),r=/^@host\s*/.exec(e);if(!r)return;if(c(r),!s())return u("@host missing '{'");let i=p().concat(t());return d()?n({type:k.host,rules:i}):u("@host missing '}'")}()||function(){let t=o(),n=/^@font-face\s*/.exec(e);if(!n)return;if(c(n),!s())return u("@font-face missing '{'");let r=p(),i=m();for(;i;)r.push(i),r=r.concat(p()),i=m();return d()?t({type:k.fontFace,declarations:r}):u("@font-face missing '}'")}()||function(){let n=o(),r=/^@container *([^{]+)/.exec(e);if(!r)return;let i=eI(c(r)[1]);if(!s())return u("@container missing '{'");let a=p().concat(t());return d()?n({type:k.container,container:i,rules:a}):u("@container missing '}'")}()||function(){let n=o(),r=/^@starting-style\s*/.exec(e);if(!r)return;if(c(r),!s())return u("@starting-style missing '{'");let i=p().concat(t());return d()?n({type:k.startingStyle,rules:i}):u("@starting-style missing '}'")}()||function(){let n=o(),r=/^@layer *([^{;@]+)/.exec(e);if(!r)return;let i=eI(c(r)[1]);if(!s()){let t=/^[;\s]*/.exec(e);return t&&c(t),n({type:k.layer,layer:i})}let a=p().concat(t());return d()?n({type:k.layer,layer:i,rules:a}):u("@layer missing '}'")}()}()||(n=o(),(r=h())?(p(),n({type:k.rule,selectors:r,declarations:_()||[]})):u("selector missing")));)a.push(i),p(a);return a}(),{type:k.stylesheet,stylesheet:{source:t?.source,rules:n,parsingErrors:a}}))})(o);return a?.stylesheet&&function e(r){if((Array.isArray(r.selectors)||Array.isArray(r.declarations))&&function(e){if(Array.isArray(e.selectors))for(let r=0;r<e.selectors.length;r++){let i=e.selectors[r];i&&(e.selectors[r]=t+function(e){let t=RegExp(":(has|not|where|is|matches|any)\\(([^)]+)\\)","g");return e=e.replace(t,(e,t,r)=>{let i=n(r);return`:${t}(${i})`}),n(e)}(i))}}(r),Array.isArray(r.rules))for(let t of(r.rules=r.rules.filter(e=>"import"!==e.type),r.rules))e(t)}(a.stylesheet),`<style>${e=a,new e$(i||{}).compile(e)}</style>`}catch(e){return`CSS ERROR: ${e}`}})}(e=tw.sanitize(e,n),{prefix:".mes_text "})}(e);o=o.replace(/<pre><code(.*)>[\s\S]*?<\/code><\/pre>/g,e=>{var i;let o,u;if(!e.includes("<body>")&&!e.includes("</body>"))return e;let s=e.replace(/<pre><code(.*?)>/g,"").replace(/<\/code><\/pre>/g,""),d=tj(),c=`MJ-iframe-container-${d}`,l=`MJ-iframe-${d}`,p=(o={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xa0"},i=s.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,t)=>{if("#"===t[0]){let n=t[1]?.toLowerCase()==="x",r=parseInt(n?t.slice(2):t.slice(1),n?16:10);if(Number.isFinite(r))try{return String.fromCodePoint(r)}catch{}return e}let n=t.toLowerCase();return Object.hasOwn(o,n)?o[n]:e}),i=(e=>{let t=/min-height\s*:\s*[^;{}]*\d+(?:\.\d+)?vh/gi.test(e),n=/style\s*=\s*(["'])[\s\S]*?min-height\s*:\s*[^;]*?\d+(?:\.\d+)?vh[\s\S]*?\1/gi.test(e),r=/(\.style\.minHeight\s*=\s*(["']))([\s\S]*?vh)(\2)/gi.test(e)||/(setProperty\s*\(\s*(["'])min-height\2\s*,\s*(["']))([\s\S]*?vh)(\3\s*\))/gi.test(e);if(!t&&!n&&!r)return e;let i=e=>e.replace(/(\d+(?:\.\d+)?)vh\b/gi,(e,t)=>{let n=parseFloat(t);if(!isFinite(n))return e;let r="var(--MJ-viewport-height)";return 100===n?r:`calc(${r} * ${n/100})`});return(e=(e=(e=e.replace(/(min-height\s*:\s*)([^;{}]*?\d+(?:\.\d+)?vh)(?=\s*[;}])/gi,(e,t,n)=>`${t}${i(n)}`)).replace(/(style\s*=\s*(["']))([^"'"]*?)(\2)/gi,(e,t,n,r,o)=>{if(!/min-height\s*:\s*[^;]*vh/i.test(r))return e;let a=r.replace(/(min-height\s*:\s*)([^;]*?\d+(?:\.\d+)?vh)/gi,(e,t,n)=>`${t}${i(n)}`);return`${t}${a}${o}`})).replace(/(\.style\.minHeight\s*=\s*(["']))([\s\S]*?)(\2)/gi,(e,t,n,r,o)=>{if(!/\b\d+(?:\.\d+)?vh\b/i.test(r))return e;let a=i(r);return`${t}${a}${o}`})).replace(/(setProperty\s*\(\s*(["'])min-height\2\s*,\s*(["']))([\s\S]*?)(\3\s*\))/gi,(e,t,n,r,o,a)=>{if(!/\b\d+(?:\.\d+)?vh\b/i.test(o))return e;let u=i(o);return`${t}${u}${a}`})})(i),`
|
|
64
|
+
${this.indent()}}`)}declaration(e){return this.compress?this.emit(`${e.property}:${e.value}`,e.position)+this.emit(";"):"grid-template-areas"===e.property?this.emit(this.indent())+this.emit(e.property+": "+e.value.split("\n").join("\n".padEnd(22)+this.indent()),e.position)+this.emit(";"):this.emit(this.indent())+this.emit(`${e.property}: ${e.value}`,e.position)+this.emit(";")}}let{entries:u9,setPrototypeOf:u5,isFrozen:u7,getPrototypeOf:se,getOwnPropertyDescriptor:st}=Object,{freeze:sn,seal:sr,create:si}=Object,{apply:so,construct:sa}="undefined"!=typeof Reflect&&Reflect;sn||(sn=function(e){return e}),sr||(sr=function(e){return e}),so||(so=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),sa||(sa=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});let su=sw(Array.prototype.forEach),ss=sw(Array.prototype.lastIndexOf),sd=sw(Array.prototype.pop),sc=sw(Array.prototype.push),sl=sw(Array.prototype.splice),sp=sw(String.prototype.toLowerCase),sf=sw(String.prototype.toString),sh=sw(String.prototype.match),sm=sw(String.prototype.replace),s_=sw(String.prototype.indexOf),sg=sw(String.prototype.trim),sb=sw(Object.prototype.hasOwnProperty),sy=sw(RegExp.prototype.test),sv=(f=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return sa(f,t)});function sw(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return so(e,t,r)}}function sk(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:sp;u5&&u5(e,null);let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){let e=n(i);e!==i&&(u7(t)||(t[r]=e),i=e)}e[i]=!0}return e}function sz(e){let t=si(null);for(let[n,r]of u9(e))sb(e,n)&&(Array.isArray(r)?t[n]=function(e){for(let t=0;t<e.length;t++)sb(e,t)||(e[t]=null);return e}(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=sz(r):t[n]=r);return t}function sS(e,t){for(;null!==e;){let n=st(e,t);if(n){if(n.get)return sw(n.get);if("function"==typeof n.value)return sw(n.value)}e=se(e)}return function(){return null}}let sE=sn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),sA=sn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),sx=sn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sT=sn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),sj=sn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),sO=sn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),sP=sn(["#text"]),sI=sn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),s$=sn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),sM=sn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),sC=sn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sN=sr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),sR=sr(/<%[\w\W]*|[\w\W]*%>/gm),sL=sr(/\$\{[\w\W]*/gm),sZ=sr(/^data-[\-\w.\u00B7-\uFFFF]+$/),sD=sr(/^aria-[\-\w]+$/),sU=sr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sF=sr(/^(?:\w+script|data):/i),sH=sr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sJ=sr(/^html$/i);var sB=Object.freeze({__proto__:null,ARIA_ATTR:sD,ATTR_WHITESPACE:sH,CUSTOM_ELEMENT:sr(/^[a-z][.\w]*(-[.\w]+)+$/i),DATA_ATTR:sZ,DOCTYPE_NAME:sJ,ERB_EXPR:sR,IS_ALLOWED_URI:sU,IS_SCRIPT_OR_DATA:sF,MUSTACHE_EXPR:sN,TMPLIT_EXPR:sL});let sV=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null,r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}},sG=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};var sW=function e(){let t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,r=t=>e(t);if(r.version="3.3.3",r.removed=[],!n||!n.document||9!==n.document.nodeType||!n.Element)return r.isSupported=!1,r;let{document:i}=n,o=i,a=o.currentScript,{DocumentFragment:u,HTMLTemplateElement:s,Node:d,Element:c,NodeFilter:l,NamedNodeMap:p=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:m}=n,_=c.prototype,g=sS(_,"cloneNode"),b=sS(_,"remove"),y=sS(_,"nextSibling"),v=sS(_,"childNodes"),w=sS(_,"parentNode");if("function"==typeof s){let e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let k="",{implementation:z,createNodeIterator:S,createDocumentFragment:E,getElementsByTagName:A}=i,{importNode:x}=o,T=sG();r.isSupported="function"==typeof u9&&"function"==typeof w&&z&&void 0!==z.createHTMLDocument;let{MUSTACHE_EXPR:j,ERB_EXPR:O,TMPLIT_EXPR:P,DATA_ATTR:I,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:C,CUSTOM_ELEMENT:N}=sB,{IS_ALLOWED_URI:R}=sB,L=null,Z=sk({},[...sE,...sA,...sx,...sj,...sP]),D=null,U=sk({},[...sI,...s$,...sM,...sC]),F=Object.seal(si(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),H=null,J=null,B=Object.seal(si(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),V=!0,G=!0,W=!1,q=!0,K=!1,X=!0,Y=!1,Q=!1,ee=!1,et=!1,en=!1,er=!1,ei=!0,eo=!1,ea=!0,eu=!1,es={},ed=null,ec=sk({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),el=null,ep=sk({},["audio","video","img","source","image","track"]),ef=null,eh=sk({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),em="http://www.w3.org/1998/Math/MathML",e_="http://www.w3.org/2000/svg",eg="http://www.w3.org/1999/xhtml",eb=eg,ey=!1,ev=null,ew=sk({},[em,e_,eg],sf),ek=sk({},["mi","mo","mn","ms","mtext"]),ez=sk({},["annotation-xml"]),eS=sk({},["title","style","font","a","script"]),eE=null,eA=["application/xhtml+xml","text/html"],ex=null,eT=null,ej=i.createElement("form"),eO=function(e){return e instanceof RegExp||e instanceof Function},eP=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!eT||eT!==e){if(e&&"object"==typeof e||(e={}),e=sz(e),ex="application/xhtml+xml"===(eE=-1===eA.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?sf:sp,L=sb(e,"ALLOWED_TAGS")?sk({},e.ALLOWED_TAGS,ex):Z,D=sb(e,"ALLOWED_ATTR")?sk({},e.ALLOWED_ATTR,ex):U,ev=sb(e,"ALLOWED_NAMESPACES")?sk({},e.ALLOWED_NAMESPACES,sf):ew,ef=sb(e,"ADD_URI_SAFE_ATTR")?sk(sz(eh),e.ADD_URI_SAFE_ATTR,ex):eh,el=sb(e,"ADD_DATA_URI_TAGS")?sk(sz(ep),e.ADD_DATA_URI_TAGS,ex):ep,ed=sb(e,"FORBID_CONTENTS")?sk({},e.FORBID_CONTENTS,ex):ec,H=sb(e,"FORBID_TAGS")?sk({},e.FORBID_TAGS,ex):sz({}),J=sb(e,"FORBID_ATTR")?sk({},e.FORBID_ATTR,ex):sz({}),es=!!sb(e,"USE_PROFILES")&&e.USE_PROFILES,V=!1!==e.ALLOW_ARIA_ATTR,G=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,q=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,K=e.SAFE_FOR_TEMPLATES||!1,X=!1!==e.SAFE_FOR_XML,Y=e.WHOLE_DOCUMENT||!1,et=e.RETURN_DOM||!1,en=e.RETURN_DOM_FRAGMENT||!1,er=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,ei=!1!==e.SANITIZE_DOM,eo=e.SANITIZE_NAMED_PROPS||!1,ea=!1!==e.KEEP_CONTENT,eu=e.IN_PLACE||!1,R=e.ALLOWED_URI_REGEXP||sU,eb=e.NAMESPACE||eg,ek=e.MATHML_TEXT_INTEGRATION_POINTS||ek,ez=e.HTML_INTEGRATION_POINTS||ez,F=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&eO(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(F.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&eO(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(F.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(F.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(G=!1),en&&(et=!0),es&&(L=sk({},sP),D=si(null),!0===es.html&&(sk(L,sE),sk(D,sI)),!0===es.svg&&(sk(L,sA),sk(D,s$),sk(D,sC)),!0===es.svgFilters&&(sk(L,sx),sk(D,s$),sk(D,sC)),!0===es.mathMl&&(sk(L,sj),sk(D,sM),sk(D,sC))),sb(e,"ADD_TAGS")||(B.tagCheck=null),sb(e,"ADD_ATTR")||(B.attributeCheck=null),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?B.tagCheck=e.ADD_TAGS:(L===Z&&(L=sz(L)),sk(L,e.ADD_TAGS,ex))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?B.attributeCheck=e.ADD_ATTR:(D===U&&(D=sz(D)),sk(D,e.ADD_ATTR,ex))),e.ADD_URI_SAFE_ATTR&&sk(ef,e.ADD_URI_SAFE_ATTR,ex),e.FORBID_CONTENTS&&(ed===ec&&(ed=sz(ed)),sk(ed,e.FORBID_CONTENTS,ex)),e.ADD_FORBID_CONTENTS&&(ed===ec&&(ed=sz(ed)),sk(ed,e.ADD_FORBID_CONTENTS,ex)),ea&&(L["#text"]=!0),Y&&sk(L,["html","head","body"]),L.table&&(sk(L,["tbody"]),delete H.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw sv('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw sv('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=(t=e.TRUSTED_TYPES_POLICY).createHTML("")}else void 0===t&&(t=sV(m,a)),null!==t&&"string"==typeof k&&(k=t.createHTML(""));sn&&sn(e),eT=e}},eI=sk({},[...sA,...sx,...sT]),e$=sk({},[...sj,...sO]),eM=function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:eb,tagName:"template"});let n=sp(e.tagName),r=sp(t.tagName);return!!ev[e.namespaceURI]&&(e.namespaceURI===e_?t.namespaceURI===eg?"svg"===n:t.namespaceURI===em?"svg"===n&&("annotation-xml"===r||ek[r]):!!eI[n]:e.namespaceURI===em?t.namespaceURI===eg?"math"===n:t.namespaceURI===e_?"math"===n&&ez[r]:!!e$[n]:e.namespaceURI===eg?(t.namespaceURI!==e_||!!ez[r])&&(t.namespaceURI!==em||!!ek[r])&&!e$[n]&&(eS[n]||!eI[n]):"application/xhtml+xml"===eE&&!!ev[e.namespaceURI])},eC=function(e){sc(r.removed,{element:e});try{w(e).removeChild(e)}catch(t){b(e)}},eN=function(e,t){try{sc(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){sc(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(et||en)try{eC(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},eR=function(e){let n=null,r=null;if(ee)e="<remove></remove>"+e;else{let t=sh(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===eE&&eb===eg&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let o=t?t.createHTML(e):e;if(eb===eg)try{n=new h().parseFromString(o,eE)}catch(e){}if(!n||!n.documentElement){n=z.createDocument(eb,"template",null);try{n.documentElement.innerHTML=ey?k:o}catch(e){}}let a=n.body||n.documentElement;return(e&&r&&a.insertBefore(i.createTextNode(r),a.childNodes[0]||null),eb===eg)?A.call(n,Y?"html":"body")[0]:Y?n.documentElement:a},eL=function(e){return S.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},eZ=function(e){return e instanceof f&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof p)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},eD=function(e){return"function"==typeof d&&e instanceof d};function eU(e,t,n){su(e,e=>{e.call(r,t,n,eT)})}let eF=function(e){let t=null;if(eU(T.beforeSanitizeElements,e,null),eZ(e))return eC(e),!0;let n=ex(e.nodeName);if(eU(T.uponSanitizeElement,e,{tagName:n,allowedTags:L}),X&&e.hasChildNodes()&&!eD(e.firstElementChild)&&sy(/<[/\w!]/g,e.innerHTML)&&sy(/<[/\w!]/g,e.textContent)||7===e.nodeType||X&&8===e.nodeType&&sy(/<[/\w]/g,e.data))return eC(e),!0;if(!(B.tagCheck instanceof Function&&B.tagCheck(n))&&(!L[n]||H[n])){if(!H[n]&&eJ(n)&&(F.tagNameCheck instanceof RegExp&&sy(F.tagNameCheck,n)||F.tagNameCheck instanceof Function&&F.tagNameCheck(n)))return!1;if(ea&&!ed[n]){let t=w(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=g(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,y(e))}}}return eC(e),!0}return e instanceof c&&!eM(e)||("noscript"===n||"noembed"===n||"noframes"===n)&&sy(/<\/no(script|embed|frames)/i,e.innerHTML)?(eC(e),!0):(K&&3===e.nodeType&&(t=e.textContent,su([j,O,P],e=>{t=sm(t,e," ")}),e.textContent!==t&&(sc(r.removed,{element:e.cloneNode()}),e.textContent=t)),eU(T.afterSanitizeElements,e,null),!1)},eH=function(e,t,n){if(J[t]||ei&&("id"===t||"name"===t)&&(n in i||n in ej))return!1;if(G&&!J[t]&&sy(I,t));else if(V&&sy($,t));else if(B.attributeCheck instanceof Function&&B.attributeCheck(t,e));else if(!D[t]||J[t]){if(!(eJ(e)&&(F.tagNameCheck instanceof RegExp&&sy(F.tagNameCheck,e)||F.tagNameCheck instanceof Function&&F.tagNameCheck(e))&&(F.attributeNameCheck instanceof RegExp&&sy(F.attributeNameCheck,t)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(t,e))||"is"===t&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&sy(F.tagNameCheck,n)||F.tagNameCheck instanceof Function&&F.tagNameCheck(n))))return!1}else if(ef[t]);else if(sy(R,sm(n,C,"")));else if(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===s_(n,"data:")&&el[e]);else if(W&&!sy(M,sm(n,C,"")));else if(n)return!1;return!0},eJ=function(e){return"annotation-xml"!==e&&sh(e,N)},eB=function(e){eU(T.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||eZ(e))return;let i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0},o=n.length;for(;o--;){let{name:a,namespaceURI:u,value:s}=n[o],d=ex(a),c="value"===a?s:sg(s);if(i.attrName=d,i.attrValue=c,i.keepAttr=!0,i.forceKeepAttr=void 0,eU(T.uponSanitizeAttribute,e,i),c=i.attrValue,eo&&("id"===d||"name"===d)&&(eN(a,e),c="user-content-"+c),X&&sy(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,c)||"attributename"===d&&sh(c,"href")){eN(a,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr||!q&&sy(/\/>/i,c)){eN(a,e);continue}K&&su([j,O,P],e=>{c=sm(c,e," ")});let l=ex(e.nodeName);if(!eH(l,d,c)){eN(a,e);continue}if(t&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(u);else switch(m.getAttributeType(l,d)){case"TrustedHTML":c=t.createHTML(c);break;case"TrustedScriptURL":c=t.createScriptURL(c)}if(c!==s)try{u?e.setAttributeNS(u,a,c):e.setAttribute(a,c),eZ(e)?eC(e):sd(r.removed)}catch(t){eN(a,e)}}eU(T.afterSanitizeAttributes,e,null)},eV=function e(t){let n=null,r=eL(t);for(eU(T.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)eU(T.uponSanitizeShadowNode,n,null),eF(n),eB(n),n.content instanceof u&&e(n.content);eU(T.afterSanitizeShadowDOM,t,null)};return r.sanitize=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,a=null,s=null,c=null;if((ey=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!eD(e))if("function"==typeof e.toString){if("string"!=typeof(e=e.toString()))throw sv("dirty is not a string, aborting")}else throw sv("toString is not a function");if(!r.isSupported)return e;if(Q||eP(n),r.removed=[],"string"==typeof e&&(eu=!1),eu){if(e.nodeName){let t=ex(e.nodeName);if(!L[t]||H[t])throw sv("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof d)1===(a=(i=eR("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?i=a:i.appendChild(a);else{if(!et&&!K&&!Y&&-1===e.indexOf("<"))return t&&er?t.createHTML(e):e;if(!(i=eR(e)))return et?null:er?k:""}i&&ee&&eC(i.firstChild);let l=eL(eu?e:i);for(;s=l.nextNode();)eF(s),eB(s),s.content instanceof u&&eV(s.content);if(eu)return e;if(et){if(en)for(c=E.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(D.shadowroot||D.shadowrootmode)&&(c=x.call(o,c,!0)),c}let p=Y?i.outerHTML:i.innerHTML;return Y&&L["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&sy(sJ,i.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+p),K&&su([j,O,P],e=>{p=sm(p,e," ")}),t&&er?t.createHTML(p):p},r.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eP(e),Q=!0},r.clearConfig=function(){eT=null,Q=!1},r.isValidAttribute=function(e,t,n){return eT||eP({}),eH(ex(e),ex(t),n)},r.addHook=function(e,t){"function"==typeof t&&sc(T[e],t)},r.removeHook=function(e,t){if(void 0!==t){let n=ss(T[e],t);return -1===n?void 0:sl(T[e],n,1)[0]}return sd(T[e])},r.removeHooks=function(e){T[e]=[]},r.removeAllHooks=function(){T=sG()},r}(),sq=r("../../common/temp/node_modules/.pnpm/showdown@2.1.0/node_modules/showdown/dist/showdown.js"),sK=r.n(sq);let sX={i(...e){console.log("[MujianSDK] ",...e)},e(...e){console.error("[MujianSDK] ",...e)}};sW.addHook("afterSanitizeAttributes",function(e){"target"in e&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener"))}),sW.addHook("uponSanitizeAttribute",(e,t,n)=>{n.MESSAGE_SANITIZE&&!(n.MESSAGE_ALLOW_SYSTEM_UI&&e.classList.contains("menu_button")&&["BUTTON","DIV"].includes(e.nodeName))&&"class"===t.attrName&&t.attrValue&&(t.attrValue=t.attrValue.split(" ").map(e=>e.startsWith("fa-")||e.startsWith("note-")||"monospace"===e?e:"custom-"+e).join(" "))}),sW.addHook("uponSanitizeElement",(e,t,n)=>{n.MESSAGE_SANITIZE&&e instanceof HTMLUnknownElement&&(e.innerHTML=e.innerHTML.trim().replaceAll("\n","<br>"))});let sY=new(sK()).Converter({emoji:!0,literalMidWordUnderscores:!0,parseImgDimensions:!0,tables:!0,underline:!0,simpleLineBreaks:!0,strikethrough:!0,disableForced4SpacesIndentedSublists:!0,extensions:[(()=>{try{if(!function(){try{return RegExp("(?<!_)"),!0}catch(e){return!1}}())return sX.i("Showdown-underscore extension: Negative lookbehind not supported. Skipping."),[];return[{type:"output",regex:RegExp("(<code(?:\\s+[^>]*)?>[\\s\\S]*?<\\/code>|<style(?:\\s+[^>]*)?>[\\s\\S]*?<\\/style>)|\\b(?<!_)_(?!_)(.*?)(?<!_)_(?!_)\\b","gi"),replace:function(e,t,n){if(t);else if(n)return"<em>"+n+"</em>";return e}}]}catch(e){return console.error("Error in Showdown-underscore extension:",e),[]}})()]}),sQ="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),s0=new Uint8Array(16),s3=[];for(let e=0;e<256;++e)s3.push((e+256).toString(16).slice(1));let s8=function(t,n,r){if(sQ&&!n&&!t)return sQ();var i=t,o=r;let a=(i=i||{}).random??i.rng?.()??function(){if(!e){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");e=crypto.getRandomValues.bind(crypto)}return e(s0)}();if(a.length<16)throw Error("Random bytes length must be >= 16");if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n){if((o=o||0)<0||o+16>n.length)throw RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);for(let e=0;e<16;++e)n[o+e]=a[e];return n}return function(e,t=0){return(s3[e[t+0]]+s3[e[t+1]]+s3[e[t+2]]+s3[e[t+3]]+"-"+s3[e[t+4]]+s3[e[t+5]]+"-"+s3[e[t+6]]+s3[e[t+7]]+"-"+s3[e[t+8]]+s3[e[t+9]]+"-"+s3[e[t+10]]+s3[e[t+11]]+s3[e[t+12]]+s3[e[t+13]]+s3[e[t+14]]+s3[e[t+15]]).toLowerCase()}(a)},s1={"zh-hans":"加载中...","zh-hant":"載入中...",en:"Loading...",ja:"読み込み中...",th:"กำลังโหลด..."},s2=({content:e,unsafe:t=!1,extra:n={},lang:r})=>{let i=(0,N.useRef)(null),[o,a]=(0,N.useState)([]);return(0,N.useEffect)(()=>{let o=function(e,t={}){if(!e)return"";e=(e=(e=(e=(e=e.replace(/<([^>]+)>/g,function(e,t){return"<"+t.replace(/"/g,"")+">"})).replace(/<style>[\s\S]*?<\/style>|```[\s\S]*?```|~~~[\s\S]*?~~~|``[\s\S]*?``|`[\s\S]*?`|(".*?")|(\u201C.*?\u201D)|(\u00AB.*?\u00BB)|(\u300C.*?\u300D)|(\u300E.*?\u300F)|(\uFF02.*?\uFF02)/gim,function(e,t,n,r,i,o,a){if(t)return`<q>"${t.slice(1,-1)}"</q>`;if(n)return`<q>“${n.slice(1,-1)}”</q>`;if(r)return`<q>\xab${r.slice(1,-1)}\xbb</q>`;if(i)return`<q>「${i.slice(1,-1)}」</q>`;if(o)return`<q>『${o.slice(1,-1)}』</q>`;else if(a)return`<q>"${a.slice(1,-1)}"</q>`;else return e})).replace(/\ufffe/g,'"')).replaceAll("\\begin{align*}","$$")).replaceAll("\\end{align*}","$$"),e=(e=(e=(e=(e=sY.makeHtml(e)).replace(/<code(.*)>[\s\S]*?<\/code>/g,function(e){return e.replace(/\n/gm,"\0")})).replace(/\u0000/g,"\n")).trim()).replace(/<code(.*)>[\s\S]*?<\/code>/g,function(e){return e.replace(/&/g,"&")});let n={RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!1,MESSAGE_SANITIZE:!0,ADD_TAGS:["custom-style"],...t};return e=e.replaceAll(/<style>([\s\S]+?)<\/style>/gi,(e,t)=>`<custom-style>${encodeURIComponent(t)}</custom-style>`),e=function(e,{prefix:t}={prefix:".mes_text "}){function n(e){return e.split(/\s+/).map(e=>e.replace(/\.([\w-]+)/g,(e,t)=>t.startsWith("custom-")?e:`.custom-${t}`)).join(" ")}return e.replaceAll(/<custom-style>(.+?)<\/custom-style>/g,(e,r)=>{try{let e,i,o=decodeURIComponent(r).replaceAll(/<br\/>/g,""),a=((e,t)=>{let n;t=t||{};let r=1,i=1;function o(){let e={line:r,column:i};return n=>(n.position=new u3(e,{line:r,column:i},t?.source||""),l(),n)}let a=[];function u(n){let o=new u0(t?.source||"",n,r,i,e);if(!t?.silent)throw o;a.push(o)}function s(){let t=/^{\s*/.exec(e);return!!t&&(c(t),!0)}function d(){let t=/^}/.exec(e);return!!t&&(c(t),!0)}function c(t){let n,o,a=t[0];return(n=a.match(/\n/g))&&(r+=n.length),i=~(o=a.lastIndexOf("\n"))?a.length-o:i+a.length,e=e.slice(a.length),t}function l(){let t=/^\s*/.exec(e);t&&c(t)}function p(e){e=e||[];let t=f();for(;t;)e.push(t),t=f();return e}function f(){let t=o();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=/^\/\*[^]*?\*\//.exec(e);return n?(c(n),t({type:S.comment,comment:n[0].slice(2,-2)})):u("End of comment missing")}function h(){let t=/^([^{]+)/.exec(e);if(t)return c(t),((e,t)=>{let n=[],r=0;for(;r<e.length;){let i=u1(e,t,r);if(-1===i)return n.push(e.substring(r)),n;n.push(e.substring(r,i)),r=i+1}return n})(u6(t[0]).replace(u2,""),[","]).map(e=>u6(e))}function m(){let t=o(),n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);if(!n)return;c(n);let r=u6(n[0]),i=/^:\s*/.exec(e);if(!i)return u("property missing ':'");c(i);let a="",s=u1(e,[";","}"]);-1!==s&&(c([a=e.substring(0,s)]),a=u6(a).replace(u2,""));let d=t({type:S.declaration,property:r.replace(u2,""),value:a}),l=/^[;\s]*/.exec(e);return l&&c(l),d}function _(){let e=[];if(!s())return u("missing '{'");p(e);let t=m();for(;t;)e.push(t),p(e),t=m();return d()?e:u("missing '}'")}function g(){let t=[],n=o(),r=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);for(;r;){let n=c(r);t.push(n[1]);let i=/^,\s*/.exec(e);i&&c(i),r=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e)}if(t.length)return n({type:S.keyframe,values:t,declarations:_()||[]})}let b=w("import"),y=w("charset"),v=w("namespace");function w(t){let n=RegExp("^@"+t+"\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");return()=>{let r=o(),i=n.exec(e);if(!i)return;let a=c(i),u={type:t};return u[t]=a[1].trim(),r(u)}}return function e(t,n){let r=t&&"string"==typeof t.type,i=r?t:n;for(let n in t){let r=t[n];Array.isArray(r)?r.forEach(t=>{e(t,i)}):r&&"object"==typeof r&&e(r,i)}return r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null}),t}((n=function t(){let n,r,i,a=[];for(l(),p(a);e.length&&"}"!==e.charAt(0)&&(i=function(){if("@"===e[0])return function(){let t=o(),n=/^@([-\w]+)?keyframes\s*/.exec(e);if(!n)return;let r=c(n)[1],i=/^([-\w]+)\s*/.exec(e);if(!i)return u("@keyframes missing name");let a=c(i)[1];if(!s())return u("@keyframes missing '{'");let l=p(),f=g();for(;f;)l.push(f),l=l.concat(p()),f=g();return d()?t({type:S.keyframes,name:a,vendor:r,keyframes:l}):u("@keyframes missing '}'")}()||function(){let n=o(),r=/^@media *([^{]+)/.exec(e);if(!r)return;let i=u6(c(r)[1]);if(!s())return u("@media missing '{'");let a=p().concat(t());return d()?n({type:S.media,media:i,rules:a}):u("@media missing '}'")}()||function(){let t=o(),n=/^@custom-media\s+(--\S+)\s+([^{;\s][^{;]*);/.exec(e);if(!n)return;let r=c(n);return t({type:S.customMedia,name:u6(r[1]),media:u6(r[2])})}()||function(){let n=o(),r=/^@supports *([^{]+)/.exec(e);if(!r)return;let i=u6(c(r)[1]);if(!s())return u("@supports missing '{'");let a=p().concat(t());return d()?n({type:S.supports,supports:i,rules:a}):u("@supports missing '}'")}()||b()||y()||v()||function(){let n=o(),r=/^@([-\w]+)?document *([^{]+)/.exec(e);if(!r)return;let i=c(r),a=u6(i[1]),l=u6(i[2]);if(!s())return u("@document missing '{'");let f=p().concat(t());return d()?n({type:S.document,document:l,vendor:a,rules:f}):u("@document missing '}'")}()||function(){let t=o(),n=/^@page */.exec(e);if(!n)return;c(n);let r=h()||[];if(!s())return u("@page missing '{'");let i=p(),a=m();for(;a;)i.push(a),i=i.concat(p()),a=m();return d()?t({type:S.page,selectors:r,declarations:i}):u("@page missing '}'")}()||function(){let n=o(),r=/^@host\s*/.exec(e);if(!r)return;if(c(r),!s())return u("@host missing '{'");let i=p().concat(t());return d()?n({type:S.host,rules:i}):u("@host missing '}'")}()||function(){let t=o(),n=/^@font-face\s*/.exec(e);if(!n)return;if(c(n),!s())return u("@font-face missing '{'");let r=p(),i=m();for(;i;)r.push(i),r=r.concat(p()),i=m();return d()?t({type:S.fontFace,declarations:r}):u("@font-face missing '}'")}()||function(){let n=o(),r=/^@container *([^{]+)/.exec(e);if(!r)return;let i=u6(c(r)[1]);if(!s())return u("@container missing '{'");let a=p().concat(t());return d()?n({type:S.container,container:i,rules:a}):u("@container missing '}'")}()||function(){let n=o(),r=/^@starting-style\s*/.exec(e);if(!r)return;if(c(r),!s())return u("@starting-style missing '{'");let i=p().concat(t());return d()?n({type:S.startingStyle,rules:i}):u("@starting-style missing '}'")}()||function(){let n=o(),r=/^@layer *([^{;@]+)/.exec(e);if(!r)return;let i=u6(c(r)[1]);if(!s()){let t=/^[;\s]*/.exec(e);return t&&c(t),n({type:S.layer,layer:i})}let a=p().concat(t());return d()?n({type:S.layer,layer:i,rules:a}):u("@layer missing '}'")}()}()||(n=o(),(r=h())?(p(),n({type:S.rule,selectors:r,declarations:_()||[]})):u("selector missing")));)a.push(i),p(a);return a}(),{type:S.stylesheet,stylesheet:{source:t?.source,rules:n,parsingErrors:a}}))})(o);return a?.stylesheet&&function e(r){if((Array.isArray(r.selectors)||Array.isArray(r.declarations))&&function(e){if(Array.isArray(e.selectors))for(let r=0;r<e.selectors.length;r++){let i=e.selectors[r];i&&(e.selectors[r]=t+function(e){let t=RegExp(":(has|not|where|is|matches|any)\\(([^)]+)\\)","g");return e=e.replace(t,(e,t,r)=>{let i=n(r);return`:${t}(${i})`}),n(e)}(i))}}(r),Array.isArray(r.rules))for(let t of(r.rules=r.rules.filter(e=>"import"!==e.type),r.rules))e(t)}(a.stylesheet),`<style>${e=a,new u4(i||{}).compile(e)}</style>`}catch(e){return`CSS ERROR: ${e}`}})}(e=sW.sanitize(e,n),{prefix:".mes_text "})}(e);o=o.replace(/<pre><code(.*)>[\s\S]*?<\/code><\/pre>/g,e=>{var i;let o,u;if(!e.includes("<body>")&&!e.includes("</body>"))return e;let s=e.replace(/<pre><code(.*?)>/g,"").replace(/<\/code><\/pre>/g,""),d=s8(),c=`MJ-iframe-container-${d}`,l=`MJ-iframe-${d}`,p=(o={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xa0"},i=s.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,t)=>{if("#"===t[0]){let n=t[1]?.toLowerCase()==="x",r=parseInt(n?t.slice(2):t.slice(1),n?16:10);if(Number.isFinite(r))try{return String.fromCodePoint(r)}catch{}return e}let n=t.toLowerCase();return Object.hasOwn(o,n)?o[n]:e}),i=(e=>{let t=/min-height\s*:\s*[^;{}]*\d+(?:\.\d+)?vh/gi.test(e),n=/style\s*=\s*(["'])[\s\S]*?min-height\s*:\s*[^;]*?\d+(?:\.\d+)?vh[\s\S]*?\1/gi.test(e),r=/(\.style\.minHeight\s*=\s*(["']))([\s\S]*?vh)(\2)/gi.test(e)||/(setProperty\s*\(\s*(["'])min-height\2\s*,\s*(["']))([\s\S]*?vh)(\3\s*\))/gi.test(e);if(!t&&!n&&!r)return e;let i=e=>e.replace(/(\d+(?:\.\d+)?)vh\b/gi,(e,t)=>{let n=parseFloat(t);if(!isFinite(n))return e;let r="var(--MJ-viewport-height)";return 100===n?r:`calc(${r} * ${n/100})`});return(e=(e=(e=e.replace(/(min-height\s*:\s*)([^;{}]*?\d+(?:\.\d+)?vh)(?=\s*[;}])/gi,(e,t,n)=>`${t}${i(n)}`)).replace(/(style\s*=\s*(["']))([^"'"]*?)(\2)/gi,(e,t,n,r,o)=>{if(!/min-height\s*:\s*[^;]*vh/i.test(r))return e;let a=r.replace(/(min-height\s*:\s*)([^;]*?\d+(?:\.\d+)?vh)/gi,(e,t,n)=>`${t}${i(n)}`);return`${t}${a}${o}`})).replace(/(\.style\.minHeight\s*=\s*(["']))([\s\S]*?)(\2)/gi,(e,t,n,r,o)=>{if(!/\b\d+(?:\.\d+)?vh\b/i.test(r))return e;let a=i(r);return`${t}${a}${o}`})).replace(/(setProperty\s*\(\s*(["'])min-height\2\s*,\s*(["']))([\s\S]*?)(\3\s*\))/gi,(e,t,n,r,o,a)=>{if(!/\b\d+(?:\.\d+)?vh\b/i.test(o))return e;let u=i(o);return`${t}${u}${a}`})})(i),`
|
|
29
65
|
<html>
|
|
30
66
|
<head>
|
|
31
67
|
<meta charset="utf-8">
|
|
@@ -34,7 +70,7 @@ ${this.indent()}}`)}declaration(e){return this.compress?this.emit(`${e.property}
|
|
|
34
70
|
*, *::before, *::after { box-sizing: border-box; }
|
|
35
71
|
html,body{margin:0!important;padding:0;overflow:hidden!important;max-width:100%!important;}
|
|
36
72
|
</style>
|
|
37
|
-
${
|
|
73
|
+
${uQ}
|
|
38
74
|
<script>
|
|
39
75
|
${t?"":`
|
|
40
76
|
(async function () {
|
|
@@ -115,7 +151,7 @@ window.addEventListener('message', function (event) {
|
|
|
115
151
|
${i}
|
|
116
152
|
</body>
|
|
117
153
|
</html>
|
|
118
|
-
`);a(e=>[...e,d]);let f=p.replace(/"/g,""").replace(/'/g,"'"),h=
|
|
154
|
+
`);a(e=>[...e,d]);let f=p.replace(/"/g,""").replace(/'/g,"'"),h=s1[r??"zh-hans"]||s1["zh-hans"];return`
|
|
119
155
|
<div class="MJ-iframe-container" id="${c}" style="display:flex;width:100%;height:100%;position:relative;">
|
|
120
156
|
<div class="spin-overlay" id="MJ-spin-${d}" style="width:100%;height:100%;position:absolute;top:0;left:0;z-index:1000;background-color:rgba(0,0,0,0.5);display:flex;justify-content:center;align-items:center;">
|
|
121
157
|
<div class="spin-inner wave-text" style="font-weight:500;font-size:16px;color:white;display:flex;justify-content:center;align-items:center;">
|
|
@@ -125,45 +161,9 @@ ${i}
|
|
|
125
161
|
<iframe id="${l}" class="w-full" sandbox="${t?"allow-scripts":"allow-scripts allow-same-origin"}" loading="lazy"
|
|
126
162
|
referrerpolicy="no-referrer" allowTransparency="true"
|
|
127
163
|
style="color-scheme: none;background-color: transparent;width:100%;;border:none;" srcdoc="`+f+`"></iframe>
|
|
128
|
-
</div>`}),i.current&&(i.current.innerHTML=o)},[e]),(0,N.useEffect)(()=>{window.addEventListener("message",function(e){if(e.data?.type==="MJ_ADJUST_IFRAME_HEIGHT"&&e.data?.iframe_id){let t=i.current?.querySelector("#"+e.data.iframe_id);t&&(t.style.height=`${e.data.height}px`)}}),window.addEventListener("resize",()=>{o.forEach(e=>{let t=i.current?.querySelector("#MJ-iframe-"+e);t&&t.contentWindow?.postMessage({type:"MJ_UPDATE_VIEWPORT_HEIGHT"},"*")})})},[]),(0,N.useEffect)(()=>(o.forEach(e=>{let t=i.current?.querySelector("#MJ-iframe-"+e);if(!t)return;let n=()=>{let n=t.parentElement?.querySelector("#MJ-spin-"+e);n&&n.remove()},r=setTimeout(n,5e3);t.addEventListener("load",()=>{clearTimeout(r),n()})}),()=>{o.forEach(e=>{let t=i.current?.querySelector("#MJ-iframe-"+e);if(!t)return;let n=t.parentElement?.querySelector("#MJ-spin-"+t.id);n&&n.remove(),t.removeEventListener("load",()=>{tS.i("iframe loaded",t.id)})})}),[o]),(0,eE.jsx)("div",{className:"mes_text",ref:i})},tI=R().memo(tP,(e,t)=>e.content===t.content);tP.displayName="MdRenderer",tI.displayName="MdRenderer";var t$="application/x-postmate-v1+json",tM=0,tC=function(e){var t=document.createElement("a");t.href=e;var n=t.protocol.length>4?t.protocol:window.location.protocol,r=t.host.length?"80"===t.port||"443"===t.port?t.hostname:t.host:window.location.host;return t.origin||n+"//"+r},tN={handshake:1,"handshake-reply":1,call:1,emit:1,reply:1,request:1},tR=function(e,t){return("string"!=typeof t||e.origin===t)&&!!e.data&&("object"!=typeof e.data||"postmate"in e.data)&&e.data.type===t$&&!!tN[e.data.postmate]},tL=function(e,t){var n="function"==typeof e[t]?e[t]():e[t];return tU.Promise.resolve(n)},tZ=function(){function e(e){var t=this;this.parent=e.parent,this.frame=e.frame,this.child=e.child,this.childOrigin=e.childOrigin,this.events={},this.listener=function(e){if(!tR(e,t.childOrigin))return!1;var n=((e||{}).data||{}).value||{},r=n.data,i=n.name;"emit"===e.data.postmate&&i in t.events&&t.events[i].call(t,r)},this.parent.addEventListener("message",this.listener,!1)}var t=e.prototype;return t.get=function(e){var t=this;return new tU.Promise(function(n){var r=++tM;t.parent.addEventListener("message",function e(i){i.data.uid===r&&"reply"===i.data.postmate&&(t.parent.removeEventListener("message",e,!1),n(i.data.value))},!1),t.child.postMessage({postmate:"request",type:t$,property:e,uid:r},t.childOrigin)})},t.call=function(e,t){this.child.postMessage({postmate:"call",type:t$,property:e,data:t},this.childOrigin)},t.on=function(e,t){this.events[e]=t},t.destroy=function(){window.removeEventListener("message",this.listener,!1),this.frame.parentNode.removeChild(this.frame)},e}(),tD=function(){function e(e){var t=this;this.model=e.model,this.parent=e.parent,this.parentOrigin=e.parentOrigin,this.child=e.child,this.child.addEventListener("message",function(e){if(tR(e,t.parentOrigin)){var n=e.data,r=n.property,i=n.uid,o=n.data;if("call"===e.data.postmate){r in t.model&&"function"==typeof t.model[r]&&t.model[r](o);return}tL(t.model,r).then(function(t){return e.source.postMessage({property:r,postmate:"reply",type:t$,uid:i,value:t},e.origin)})}})}return e.prototype.emit=function(e,t){this.parent.postMessage({postmate:"emit",type:t$,value:{name:e,data:t}},this.parentOrigin)},e}(),tU=function(){function e(e){var t=e.container,n=void 0===t?void 0!==n?n:document.body:t,r=e.model,i=e.url,o=e.name,a=e.classListArray;return this.parent=window,this.frame=document.createElement("iframe"),this.frame.name=o||"",this.frame.classList.add.apply(this.frame.classList,void 0===a?[]:a),n.appendChild(this.frame),this.child=this.frame.contentWindow||this.frame.contentDocument.parentWindow,this.model=r||{},this.sendHandshake(i)}return e.prototype.sendHandshake=function(t){var n,r=this,i=tC(t),o=0;return new e.Promise(function(e,a){r.parent.addEventListener("message",function t(o){return!!tR(o,i)&&("handshake-reply"===o.data.postmate?(clearInterval(n),r.parent.removeEventListener("message",t,!1),r.childOrigin=o.origin,e(new tZ(r))):a("Failed handshake"))},!1);var u=function(){o++,r.child.postMessage({postmate:"handshake",type:t$,model:r.model},i),5===o&&clearInterval(n)},s=function(){u(),n=setInterval(u,500)};r.frame.attachEvent?r.frame.attachEvent("onload",s):r.frame.onload=s,r.frame.src=t})},e}();tU.debug=!1,tU.Promise=function(){try{return window?window.Promise:Promise}catch(e){return null}}(),tU.Model=function(){function e(e){return this.child=window,this.model=e,this.parent=this.child.parent,this.sendHandshakeReply()}return e.prototype.sendHandshakeReply=function(){var e=this;return new tU.Promise(function(t,n){e.child.addEventListener("message",function r(i){if(i.data.postmate){if("handshake"===i.data.postmate){e.child.removeEventListener("message",r,!1),i.source.postMessage({postmate:"handshake-reply",type:t$},i.origin),e.parentOrigin=i.origin;var o=i.data.model;return o&&Object.keys(o).forEach(function(t){e.model[t]=o[t]}),t(new tD(e))}return n("Handshake Reply Failed")}},!1)})},e}();var tF=((g={}).MUJIAN_INIT="mujian:init",g.MUJIAN_AI_CHAT_STOP="mujian:ai:chat:stop",g.MUJIAN_AI_CHAT_COMPLETE="mujian:ai:chat:complete",g.MUJIAN_AI_CHAT_APPLY_REGEX="mujian:ai:chat:applyRegex",g.MUJIAN_AI_CHAT_RENDER_MESSAGE="mujian:ai:chat:renderMessage",g.MUJIAN_AI_TEXT_GENERATE="mujian:ai:text:generate",g.MUJIAN_AI_OPENAI_COMPLETIONS_CREATE="mujian:ai:openai:completions:create",g.MUJIAN_AI_OPENAI_CHAT_COMPLETIONS_CREATE="mujian:ai:openai:chat:completions:create",g.MUJIAN_AI_OPENAI_RESPONSES_CREATE="mujian:ai:openai:responses:create",g.MUJIAN_AI_CHAT_MESSAGE_GET_ALL="mujian:ai:chat:message:getAll",g.MUJIAN_AI_CHAT_MESSAGE_GET_PAGE="mujian:ai:chat:message:getPage",g.MUJIAN_AI_CHAT_PROJECT_GET_INFO="mujian:ai:chat:project:getInfo",g.MUJIAN_AI_CHAT_V2_COMPLETE="mujian:ai:chat_v2:complete",g.MUJIAN_AI_CHAT_V2_RECOVER="mujian:ai:chat_v2:recover",g.MUJIAN_AI_CHAT_V2_STOP="mujian:ai:chat_v2:stop",g.MUJIAN_AI_CHAT_V2_MESSAGE_GET_PAGE="mujian:ai:chat_v2:message:getPage",g.MUJIAN_AI_CHAT_V2_RENDER_MESSAGE="mujian:ai:chat_v2:renderMessage",g.MUJIAN_AI_SETTINGS_PERSONA_GET_ACTIVE="mujian:ai:settings:persona:getActive",g.MUJIAN_AI_SETTINGS_PERSONA_SET_ACTIVE="mujian:ai:settings:persona:setActive",g.MUJIAN_AI_SETTINGS_MODEL_GET_ALL="mujian:ai:settings:model:getAll",g.MUJIAN_AI_SETTINGS_MODEL_SET_ACTIVE="mujian:ai:settings:model:setActive",g.MUJIAN_AI_SETTINGS_MODEL_GET_ACTIVE="mujian:ai:settings:model:getActive",g.MUJIAN_AI_CHAT_MESSAGE_DELETE_ONE="mujian:ai:chat:message:deleteOne",g.MUJIAN_AI_CHAT_MESSAGE_EDIT_ONE="mujian:ai:chat:message:editOne",g.MUJIAN_AI_CHAT_MESSAGE_SWIPE="mujian:ai:chat:message:swipe",g.MUJIAN_AI_OPENAI_IMAGES_GENERATE="mujian:ai:openai:images:generate",g.MUJIAN_UTILS_CLIPBOARD_WRITE_TEXT="mujian:utils:clipboard:writeText",g.MUJIAN_GET_CONFIG="mujian:getConfig",g);let tH=async function(e,t,n){await this.call(tF.MUJIAN_AI_CHAT_V2_COMPLETE,{content:e,conversationVersion:t},{onData:n})},tJ=async function(e){return await this.call(tF.MUJIAN_AI_CHAT_V2_RENDER_MESSAGE,e)},tB=async function(e,t){return await this.call(tF.MUJIAN_AI_CHAT_V2_COMPLETE,{isContinue:!0,conversationVersion:e},{onData:t})},tV=async function(e,t){return await this.call(tF.MUJIAN_AI_CHAT_V2_COMPLETE,{isRegenerate:!0,conversationVersion:e},{onData:t})},tG=async function(e,t){return await this.call(tF.MUJIAN_AI_CHAT_V2_STOP,{conversationVersion:e,assisMsgId:t})},tW=async function(e,t,n){return await this.call(tF.MUJIAN_AI_CHAT_V2_RECOVER,{conversationVersion:e,assisMsgId:t},{onData:n})},tq=async function(e){return await this.call(tF.MUJIAN_AI_CHAT_MESSAGE_DELETE_ONE,{messageId:e})},tK=async function(e,t){return await this.call(tF.MUJIAN_AI_CHAT_MESSAGE_EDIT_ONE,{messageId:e,content:t})},tX=async function(e,t){return await this.call(tF.MUJIAN_AI_CHAT_MESSAGE_SWIPE,{messageId:e,swipeId:t})};async function tY(e,t){return await this.call(tF.MUJIAN_AI_CHAT_V2_MESSAGE_GET_PAGE,{fromCursor:e,pageSize:t})}let tQ=async function(){return await this.call(tF.MUJIAN_AI_CHAT_PROJECT_GET_INFO)},t0=async function(){return await this.call(tF.MUJIAN_AI_SETTINGS_PERSONA_GET_ACTIVE)},t3=async function(e){return await this.call(ne.EVENT.MUJIAN_AI_TEXT_GENERATE,{content:e})},t8={completions:{create:async function(e,t,n,r){return await this.call(ne.EVENT.MUJIAN_AI_OPENAI_CHAT_COMPLETIONS_CREATE,{params:e,options:t},{onData:n,signal:r})}}},t1={create:async function(e,t,n,r){return await this.call(ne.EVENT.MUJIAN_AI_OPENAI_COMPLETIONS_CREATE,{params:e,options:t},{onData:n,signal:r})}},t2={create:async function(e,t,n,r){return await this.call(ne.EVENT.MUJIAN_AI_OPENAI_RESPONSES_CREATE,{params:e,options:t},{onData:n,signal:r})}},t6={generate:async function(e,t,n,r){return await this.call(ne.EVENT.MUJIAN_AI_OPENAI_IMAGES_GENERATE,{params:e,options:t},{onData:n,signal:r})}};async function t4(){return await this.call(tF.MUJIAN_GET_CONFIG)}let t9=async function(){},t5=async function(){};async function t7(e){return await this.call(tF.MUJIAN_UTILS_CLIPBOARD_WRITE_TEXT,e)}class ne{constructor(){}static EVENT=tF;static getInstance(){return window.$mujian||(window.$mujian=new ne),window.$mujian}parent=null;ready=!1;get isReady(){return this.ready}pendingRequests=new Map;_config;get openapi(){return this._config?.openapi}initPromise=null;async init(){return this.initPromise||(this.initPromise=(async()=>{let e=new tU.Model({reply:({id:e,complete:t,data:n,error:r})=>{let i=this.pendingRequests.get(e);if(i){if(r){i.reject(r),this.pendingRequests.delete(e);return}i.onData?.(n),t&&(i.onComplete?.(),i.resolve(n),this.pendingRequests.delete(e))}}});try{let t=await e;this.ready=!0,this.parent=t,tS.i("mujian sdk client init"),await this.call(tF.MUJIAN_INIT);let n=await this.ai.chat.project.getInfo();if(n.config?.customCss){let e=document.createElement("style");e.setAttribute("type","text/css"),e.setAttribute("id","mujian-custom-css"),e.textContent=n.config.customCss,document.head.appendChild(e)}if(n.config?.customJs){let e=document.createElement("script");e.setAttribute("type","text/javascript"),e.setAttribute("id","mujian-custom-js"),e.textContent=n.config.customJs,document.head.appendChild(e)}let r=await t4.call(this);r&&(this._config=r)}catch(e){tS.e("init error",e)}})()),this.initPromise}emit(e,t){if(!this.ready)throw Error("Mujian is not initialized");this.parent?.emit(e,t)}nextCallId=0;getCallId(){let e=this.nextCallId;return this.nextCallId+=1,e}async call(e,t,n){if(!this.ready)throw Error("Mujian is not initialized");let r=this.getCallId();return new Promise((i,o)=>{this.pendingRequests.set(r,{resolve:i,reject:o,...n}),this.emit(e,{id:r,data:t}),n?.signal?.addEventListener("abort",()=>{this.emit(tF.MUJIAN_AI_CHAT_STOP,{id:r})})})}ai={chat:{project:{getInfo:tQ.bind(this)},settings:{persona:{getActive:t0.bind(this)}},complete:tH.bind(this),renderMessage:tJ.bind(this),continue:tB.bind(this),regenerate:tV.bind(this),stop:tG.bind(this),recover:tW.bind(this),message:{deleteOne:tq.bind(this),editOne:tK.bind(this),swipe:tX.bind(this),getPage:tY.bind(this)}},text:{complete:t3.bind(this)},openai:{completions:{create:t1.create.bind(this)},chat:{completions:{create:t8.completions.create.bind(this)}},responses:{create:t2.create.bind(this)},images:{generate:t6.generate.bind(this)}}};ui={};utils={clipboard:{writeText:t7.bind(this)}};hybrid={};player={};game={assets:()=>{console.log("assets")},saves:{saveGame:t9.bind(this),loadGame:t5.bind(this)},ranking:()=>{console.log("ranking")}}}let nt=`
|
|
164
|
+
</div>`}),i.current&&(i.current.innerHTML=o)},[e]),(0,N.useEffect)(()=>{window.addEventListener("message",function(e){if(e.data?.type==="MJ_ADJUST_IFRAME_HEIGHT"&&e.data?.iframe_id){let t=i.current?.querySelector("#"+e.data.iframe_id);t&&(t.style.height=`${e.data.height}px`)}}),window.addEventListener("resize",()=>{o.forEach(e=>{let t=i.current?.querySelector("#MJ-iframe-"+e);t&&t.contentWindow?.postMessage({type:"MJ_UPDATE_VIEWPORT_HEIGHT"},"*")})})},[]),(0,N.useEffect)(()=>(o.forEach(e=>{let t=i.current?.querySelector("#MJ-iframe-"+e);if(!t)return;let n=()=>{let n=t.parentElement?.querySelector("#MJ-spin-"+e);n&&n.remove()},r=setTimeout(n,5e3);t.addEventListener("load",()=>{clearTimeout(r),n()})}),()=>{o.forEach(e=>{let t=i.current?.querySelector("#MJ-iframe-"+e);if(!t)return;let n=t.parentElement?.querySelector("#MJ-spin-"+t.id);n&&n.remove(),t.removeEventListener("load",()=>{sX.i("iframe loaded",t.id)})})}),[o]),(0,uY.jsx)("div",{className:"mes_text",ref:i})},s6=R().memo(s2,(e,t)=>e.content===t.content);s2.displayName="MdRenderer",s6.displayName="MdRenderer";var s4="application/x-postmate-v1+json",s9=0,s5=function(e){var t=document.createElement("a");t.href=e;var n=t.protocol.length>4?t.protocol:window.location.protocol,r=t.host.length?"80"===t.port||"443"===t.port?t.hostname:t.host:window.location.host;return t.origin||n+"//"+r},s7={handshake:1,"handshake-reply":1,call:1,emit:1,reply:1,request:1},de=function(e,t){return("string"!=typeof t||e.origin===t)&&!!e.data&&("object"!=typeof e.data||"postmate"in e.data)&&e.data.type===s4&&!!s7[e.data.postmate]},dt=function(e,t){var n="function"==typeof e[t]?e[t]():e[t];return di.Promise.resolve(n)},dn=function(){function e(e){var t=this;this.parent=e.parent,this.frame=e.frame,this.child=e.child,this.childOrigin=e.childOrigin,this.events={},this.listener=function(e){if(!de(e,t.childOrigin))return!1;var n=((e||{}).data||{}).value||{},r=n.data,i=n.name;"emit"===e.data.postmate&&i in t.events&&t.events[i].call(t,r)},this.parent.addEventListener("message",this.listener,!1)}var t=e.prototype;return t.get=function(e){var t=this;return new di.Promise(function(n){var r=++s9;t.parent.addEventListener("message",function e(i){i.data.uid===r&&"reply"===i.data.postmate&&(t.parent.removeEventListener("message",e,!1),n(i.data.value))},!1),t.child.postMessage({postmate:"request",type:s4,property:e,uid:r},t.childOrigin)})},t.call=function(e,t){this.child.postMessage({postmate:"call",type:s4,property:e,data:t},this.childOrigin)},t.on=function(e,t){this.events[e]=t},t.destroy=function(){window.removeEventListener("message",this.listener,!1),this.frame.parentNode.removeChild(this.frame)},e}(),dr=function(){function e(e){var t=this;this.model=e.model,this.parent=e.parent,this.parentOrigin=e.parentOrigin,this.child=e.child,this.child.addEventListener("message",function(e){if(de(e,t.parentOrigin)){var n=e.data,r=n.property,i=n.uid,o=n.data;if("call"===e.data.postmate){r in t.model&&"function"==typeof t.model[r]&&t.model[r](o);return}dt(t.model,r).then(function(t){return e.source.postMessage({property:r,postmate:"reply",type:s4,uid:i,value:t},e.origin)})}})}return e.prototype.emit=function(e,t){this.parent.postMessage({postmate:"emit",type:s4,value:{name:e,data:t}},this.parentOrigin)},e}(),di=function(){function e(e){var t=e.container,n=void 0===t?void 0!==n?n:document.body:t,r=e.model,i=e.url,o=e.name,a=e.classListArray;return this.parent=window,this.frame=document.createElement("iframe"),this.frame.name=o||"",this.frame.classList.add.apply(this.frame.classList,void 0===a?[]:a),n.appendChild(this.frame),this.child=this.frame.contentWindow||this.frame.contentDocument.parentWindow,this.model=r||{},this.sendHandshake(i)}return e.prototype.sendHandshake=function(t){var n,r=this,i=s5(t),o=0;return new e.Promise(function(e,a){r.parent.addEventListener("message",function t(o){return!!de(o,i)&&("handshake-reply"===o.data.postmate?(clearInterval(n),r.parent.removeEventListener("message",t,!1),r.childOrigin=o.origin,e(new dn(r))):a("Failed handshake"))},!1);var u=function(){o++,r.child.postMessage({postmate:"handshake",type:s4,model:r.model},i),5===o&&clearInterval(n)},s=function(){u(),n=setInterval(u,500)};r.frame.attachEvent?r.frame.attachEvent("onload",s):r.frame.onload=s,r.frame.src=t})},e}();di.debug=!1,di.Promise=function(){try{return window?window.Promise:Promise}catch(e){return null}}(),di.Model=function(){function e(e){return this.child=window,this.model=e,this.parent=this.child.parent,this.sendHandshakeReply()}return e.prototype.sendHandshakeReply=function(){var e=this;return new di.Promise(function(t,n){e.child.addEventListener("message",function r(i){if(i.data.postmate){if("handshake"===i.data.postmate){e.child.removeEventListener("message",r,!1),i.source.postMessage({postmate:"handshake-reply",type:s4},i.origin),e.parentOrigin=i.origin;var o=i.data.model;return o&&Object.keys(o).forEach(function(t){e.model[t]=o[t]}),t(new dr(e))}return n("Handshake Reply Failed")}},!1)})},e}();var da=((g={}).MUJIAN_INIT="mujian:init",g.MUJIAN_AI_CHAT_STOP="mujian:ai:chat:stop",g.MUJIAN_AI_CHAT_COMPLETE="mujian:ai:chat:complete",g.MUJIAN_AI_CHAT_APPLY_REGEX="mujian:ai:chat:applyRegex",g.MUJIAN_AI_CHAT_RENDER_MESSAGE="mujian:ai:chat:renderMessage",g.MUJIAN_AI_TEXT_GENERATE="mujian:ai:text:generate",g.MUJIAN_AI_OPENAI_COMPLETIONS_CREATE="mujian:ai:openai:completions:create",g.MUJIAN_AI_OPENAI_CHAT_COMPLETIONS_CREATE="mujian:ai:openai:chat:completions:create",g.MUJIAN_AI_OPENAI_RESPONSES_CREATE="mujian:ai:openai:responses:create",g.MUJIAN_AI_CHAT_MESSAGE_GET_ALL="mujian:ai:chat:message:getAll",g.MUJIAN_AI_CHAT_MESSAGE_GET_PAGE="mujian:ai:chat:message:getPage",g.MUJIAN_AI_CHAT_PROJECT_GET_INFO="mujian:ai:chat:project:getInfo",g.MUJIAN_AI_CHAT_V2_COMPLETE="mujian:ai:chat_v2:complete",g.MUJIAN_AI_CHAT_V2_RECOVER="mujian:ai:chat_v2:recover",g.MUJIAN_AI_CHAT_V2_STOP="mujian:ai:chat_v2:stop",g.MUJIAN_AI_CHAT_V2_MESSAGE_GET_PAGE="mujian:ai:chat_v2:message:getPage",g.MUJIAN_AI_CHAT_V2_RENDER_MESSAGE="mujian:ai:chat_v2:renderMessage",g.MUJIAN_AI_SETTINGS_PERSONA_GET_ACTIVE="mujian:ai:settings:persona:getActive",g.MUJIAN_AI_SETTINGS_PERSONA_SET_ACTIVE="mujian:ai:settings:persona:setActive",g.MUJIAN_AI_SETTINGS_MODEL_GET_ALL="mujian:ai:settings:model:getAll",g.MUJIAN_AI_SETTINGS_MODEL_SET_ACTIVE="mujian:ai:settings:model:setActive",g.MUJIAN_AI_SETTINGS_MODEL_GET_ACTIVE="mujian:ai:settings:model:getActive",g.MUJIAN_AI_CHAT_MESSAGE_DELETE_ONE="mujian:ai:chat:message:deleteOne",g.MUJIAN_AI_CHAT_MESSAGE_EDIT_ONE="mujian:ai:chat:message:editOne",g.MUJIAN_AI_CHAT_MESSAGE_SWIPE="mujian:ai:chat:message:swipe",g.MUJIAN_AI_OPENAI_IMAGES_GENERATE="mujian:ai:openai:images:generate",g.MUJIAN_UTILS_CLIPBOARD_WRITE_TEXT="mujian:utils:clipboard:writeText",g.MUJIAN_GET_CONFIG="mujian:getConfig",g);let du=async function(e,t,n){await this.call(da.MUJIAN_AI_CHAT_V2_COMPLETE,{content:e,conversationVersion:t},{onData:n})},ds=async function(e){return await this.call(da.MUJIAN_AI_CHAT_V2_RENDER_MESSAGE,e)},dd=async function(e,t){return await this.call(da.MUJIAN_AI_CHAT_V2_COMPLETE,{isContinue:!0,conversationVersion:e},{onData:t})},dc=async function(e,t){return await this.call(da.MUJIAN_AI_CHAT_V2_COMPLETE,{isRegenerate:!0,conversationVersion:e},{onData:t})},dl=async function(e,t){return await this.call(da.MUJIAN_AI_CHAT_V2_STOP,{conversationVersion:e,assisMsgId:t})},dp=async function(e,t,n){return await this.call(da.MUJIAN_AI_CHAT_V2_RECOVER,{conversationVersion:e,assisMsgId:t},{onData:n})},df=async function(e){return await this.call(da.MUJIAN_AI_CHAT_MESSAGE_DELETE_ONE,{messageId:e})},dh=async function(e,t){return await this.call(da.MUJIAN_AI_CHAT_MESSAGE_EDIT_ONE,{messageId:e,content:t})},dm=async function(e,t){return await this.call(da.MUJIAN_AI_CHAT_MESSAGE_SWIPE,{messageId:e,swipeId:t})};async function d_(e,t){return await this.call(da.MUJIAN_AI_CHAT_V2_MESSAGE_GET_PAGE,{fromCursor:e,pageSize:t})}let dg=async function(){return await this.call(da.MUJIAN_AI_CHAT_PROJECT_GET_INFO)},db=async function(){return await this.call(da.MUJIAN_AI_SETTINGS_PERSONA_GET_ACTIVE)},dy=async function(e){return await this.call(dT.EVENT.MUJIAN_AI_TEXT_GENERATE,{content:e})},dv={completions:{create:async function(e,t,n,r){return await this.call(dT.EVENT.MUJIAN_AI_OPENAI_CHAT_COMPLETIONS_CREATE,{params:e,options:t},{onData:n,signal:r})}}},dw={create:async function(e,t,n,r){return await this.call(dT.EVENT.MUJIAN_AI_OPENAI_COMPLETIONS_CREATE,{params:e,options:t},{onData:n,signal:r})}},dk={create:async function(e,t,n,r){return await this.call(dT.EVENT.MUJIAN_AI_OPENAI_RESPONSES_CREATE,{params:e,options:t},{onData:n,signal:r})}},dz={generate:async function(e,t,n,r){return await this.call(dT.EVENT.MUJIAN_AI_OPENAI_IMAGES_GENERATE,{params:e,options:t},{onData:n,signal:r})}};async function dS(){return await this.call(da.MUJIAN_GET_CONFIG)}let dE=async function(){},dA=async function(){};async function dx(e){return await this.call(da.MUJIAN_UTILS_CLIPBOARD_WRITE_TEXT,e)}class dT{constructor(){}static EVENT=da;static getInstance(){return window.$mujian||(window.$mujian=new dT),window.$mujian}parent=null;ready=!1;get isReady(){return this.ready}pendingRequests=new Map;_config;get openapi(){return this._config?.openapi}initPromise=null;async init(){return this.initPromise||(this.initPromise=(async()=>{let e=new di.Model({reply:({id:e,complete:t,data:n,error:r})=>{let i=this.pendingRequests.get(e);if(i){if(r){i.reject(r),this.pendingRequests.delete(e);return}i.onData?.(n),t&&(i.onComplete?.(),i.resolve(n),this.pendingRequests.delete(e))}}});try{let t=await e;this.ready=!0,this.parent=t,sX.i("mujian sdk client init"),await this.call(da.MUJIAN_INIT);let n=await this.ai.chat.project.getInfo();if(n.config?.customCss){let e=document.createElement("style");e.setAttribute("type","text/css"),e.setAttribute("id","mujian-custom-css"),e.textContent=n.config.customCss,document.head.appendChild(e)}if(n.config?.customJs){let e=document.createElement("script");e.setAttribute("type","text/javascript"),e.setAttribute("id","mujian-custom-js"),e.textContent=n.config.customJs,document.head.appendChild(e)}let r=await dS.call(this);r&&(this._config=r)}catch(e){sX.e("init error",e)}})()),this.initPromise}emit(e,t){if(!this.ready)throw Error("Mujian is not initialized");this.parent?.emit(e,t)}nextCallId=0;getCallId(){let e=this.nextCallId;return this.nextCallId+=1,e}async call(e,t,n){if(!this.ready)throw Error("Mujian is not initialized");let r=this.getCallId();return new Promise((i,o)=>{this.pendingRequests.set(r,{resolve:i,reject:o,...n}),this.emit(e,{id:r,data:t}),n?.signal?.addEventListener("abort",()=>{this.emit(da.MUJIAN_AI_CHAT_STOP,{id:r})})})}ai={chat:{project:{getInfo:dg.bind(this)},settings:{persona:{getActive:db.bind(this)}},complete:du.bind(this),renderMessage:ds.bind(this),continue:dd.bind(this),regenerate:dc.bind(this),stop:dl.bind(this),recover:dp.bind(this),message:{deleteOne:df.bind(this),editOne:dh.bind(this),swipe:dm.bind(this),getPage:d_.bind(this)}},text:{complete:dy.bind(this)},openai:{completions:{create:dw.create.bind(this)},chat:{completions:{create:dv.completions.create.bind(this)}},responses:{create:dk.create.bind(this)},images:{generate:dz.generate.bind(this)}}};ui={};utils={clipboard:{writeText:dx.bind(this)}};hybrid={};player={};game={assets:()=>{console.log("assets")},saves:{saveGame:dE.bind(this),loadGame:dA.bind(this)},ranking:()=>{console.log("ranking")}}}let dj=`
|
|
129
165
|
@keyframes spin {
|
|
130
166
|
0% { transform: rotate(0deg); }
|
|
131
167
|
100% { transform: rotate(360deg); }
|
|
132
168
|
}
|
|
133
|
-
`,nn={width:48,height:48,animation:"spin 1s linear infinite"},nr=({className:e,style:t})=>(0,eE.jsxs)(eE.Fragment,{children:[(0,eE.jsx)("style",{children:nt}),(0,eE.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,style:{...nn,...t},children:(0,eE.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})]}),ni=(0,N.createContext)(null),no=(0,N.createContext)(null),na=({children:e,loadingComponent:t})=>{let[n,r]=(0,N.useState)(null),[i,o]=(0,N.useState)(0);return(0,N.useEffect)(()=>{(async()=>{let e=ne.getInstance();await e.init(),r(e)})()},[]),(0,eE.jsx)(ni.Provider,{value:n,children:(0,eE.jsx)(no.Provider,{value:{messageTypeWritingCount:i,updateMessageTypeWritingCount(e){o(t=>Math.max(t+("add"===e?1:-1),0))}},children:n?e:t??(0,eE.jsx)("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:(0,eE.jsx)(nr,{style:{color:"#EC4342"}})})})})},nu=()=>{let e=(0,N.useContext)(ni);if(!e){let e="Mujian is not initialized. Please check that useMujian is called inside MujianProvider";throw console.error(e),Error(e)}return e},ns=()=>{let e=(0,N.useContext)(no);if(!e){let e="Context is not initialized. Please check that useChatContext is called inside MujianProvider";throw console.error(e),Error(e)}return e};var nd=r("../../common/temp/node_modules/.pnpm/react-dom@19.1.5_react@19.1.5/node_modules/react-dom/index.js"),{min:nc,max:nl,abs:np,floor:nf}=Math,nh=(e,t,n)=>nc(n,nl(t,e)),nm=e=>[...e].sort((e,t)=>e-t),n_=setTimeout,ng=clearTimeout,nb="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)},ny=()=>{let e;return[new Promise(t=>{e=t}),e]},nv="undefined"!=typeof window,nw=(b=()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>0,()=>(b&&(d=b(),b=void 0),d)),nk=(e,t,n,r=0,i=t-1)=>{let o=r;for(;r<=i;){let t=nf((r+i)/2);e(t)<=n?(o=t,r=t+1):i=t-1}return nh(o,0,t-1)},nz=(e,t,n)=>{let r=n?"unshift":"push";for(let n=0;n<t;n++)e[r](-1);return e},nS=(e,t)=>t?-e:e,nE=(e,t)=>{e.V(()=>t)},nA=nv?N.useLayoutEffect:N.useEffect,nx="current",nT=(e,t)=>{if(Array.isArray(e))for(let n of e)nT(n,t);else null==e||"boolean"==typeof e||t.push(e)},nj=e=>{let t=(0,N.useRef)(e);return nA(()=>{t[nx]=e},[e]),t},nO=(0,N.memo)(({N:e,Z:t,ee:n,te:r,ne:i,oe:o,re:a,ie:u})=>{let s=(0,N.useRef)(null);nA(()=>t(s[nx],n),[n]);let d=(0,N.useMemo)(()=>{let e={contain:"layout style",position:i&&u?void 0:"absolute",[a?"height":"width"]:"100%",[a?"top":"left"]:0,[a?"insetInlineStart":"top"]:r,visibility:!i||u?void 0:"hidden"};return a&&(e.display="inline-flex"),e},[r,i,u,a]);return(0,eE.jsx)(o,"string"==typeof o?{ref:s,style:d,children:e}:{ref:s,style:d,index:n,children:e})}),nP=(0,N.forwardRef)(({children:e,data:t,bufferSize:n,itemSize:r,shift:i,horizontal:o,keepMounted:a,cache:u,startMargin:s=0,ssrCount:d,as:c="div",item:l="div",scrollRef:p,onScroll:f,onScrollEnd:h},m)=>{var _;let g,[b,y]=(0,N.useMemo)(()=>{let n;if("function"==typeof e)return[n=>e(t[n],n),t.length];let r=(nT(e,n=[]),n);return[e=>r[e],r.length]},[e,t]),v=(0,N.useRef)(null),w=(0,N.useRef)(!!d),k=nj(f),z=nj(h),[S,E,A,x]=(_=()=>{var e;let t,n,i,a,s,c,l,p,f=!!o,h=(e=y,t=u&&u[1]||r||40,n=-1,i=0,s=(a=u&&u[0])?nz(a.slice(0,nc(e,a.length)),nl(0,e-a.length)):nz([],e),c=nz([],e+1),l=e=>{let n=s[e];return -1===n?t:n},{i:(t,n)=>{let r,o;return p(i=nc(i,e-1))<=t?(o=nk(p,e,n,i),r=nk(p,e,t,i,o)):(r=nk(p,e,t,void 0,i),o=nk(p,e,n,r)),i=r,[r,o]},l:t=>nk(p,e,t),u:p=t=>{if(!e)return 0;if(n>=t)return c[t];n<0&&(c[0]=0,n=0);let r=n,i=c[r];for(;r<t;)i+=l(r),c[++r]=i;return n=t,i},h:l,v:(e,t)=>{let r=-1===s[e];return s[e]=t,n=nc(e,n),r},p:(e,t=-1)=>s[e]===t,t:()=>p(e),S:()=>e,m:(r,i)=>{let o=r-e;return n=i?-1:nc(r-1,n),e=r,o>0?(nz(c,o),nz(s,o,i),t*o):(c.splice(o),(i?s.splice(0,-o):s.splice(o)).reduce((e,n)=>e-(-1===n?t:n),0))},$:r?void 0:e=>{let r=0,i=[];s.forEach((t,n)=>{-1!==t&&(t&&i.push(t),n<e&&r++)}),n=-1;let o=nm(i),a=o.length,u=a/2|0,d=a%2==0?(o[u-1]+o[u])/2:o[u],c=t;return((t=d)-c)*nl(e-r,0)},q:()=>[s.slice(),t]}),m=(({i:e,l:t,u:n,h:r,v:i,p:o,t:a,S:u,m:s,$:d},c=0)=>{let l=!!d,p=!!c,f=1,h=0,m=0,_=0,g=0,b=0,y=0,v=0,w=0,k=null,z=[0,p?nl(c-1,0):-1],S=0,E=!1,A=new Set,x=()=>_-m+b+g,T=e=>n(e)-b,j=e=>{e&&(nw()&&0!==v||k&&1===w?b+=e:g+=e)};return{_:()=>{A.clear()},I:()=>f,i:(t=200)=>{let n,r;if(!E||p)return z;if(y)[n,r]=z;else{let i=nl(0,x()),o=i+h;l||(t=nl(0,t),1!==v&&(i-=t),2!==v&&(o+=t)),[n,r]=z=e(nl(0,i),nl(0,o)),k&&(n=nc(n,k[0]),r=nl(r,k[1]))}return[nl(n,0),nc(r,u()-1)]},k:e=>t(e-m),R:o,u:T,h:r,C:u,T:()=>_,M:()=>0!==v,o:()=>h,O:()=>m,t:a,L:()=>(y=g,g=0,[y,2===w]),H:(e,t)=>{let n=[e,t];return A.add(n),()=>{A.delete(n)}},W:(n,u)=>{let c,z,O=0;switch(n){case 1:{if(u===_&&0===w)break;let e=y;y=0;let t=u-_,n=np(t);e&&n<np(e)+1||0!==w||(v=t<0?2:1),p&&(p=!1),_=u,O=4;let r=_-m;r>=-h&&r<=a()&&(O+=1,z=n>h);break}case 2:O=8,0!==v&&(c=!0,O+=1),v=0,w=0,k=null;break;case 3:{let e=u.filter(([e,t])=>!o(e,t));if(!e.length)break;for(let[t,n]of(j(e.reduce((e,[t,n])=>{let i;if(2===w)i=!0;else if(k&&1===w)i=t<k[0];else{let e=_-m,n=T(t),o=r(t);i=1!==v&&0===w?n+o<=e:n<e&&n+o<e+h}return i&&(e+=n-r(t)),e},0)),e)){let e=r(t),o=i(t,n);l&&(S+=o?n:n-e)}l&&h&&S>h&&(j(d(t(x()))),l=!1),O=3,z=!0;break}case 4:h!==u&&(h||(E=z=!0),h=u,O=3);break;case 5:u[1]?(j(s(u[0],!0)),w=2):s(u[0]),O=1;break;case 6:m=u;break;case 7:w=1;break;case 8:k=e(u,u+h),O=1}O&&(f=1+(0x7fffffff&f),c&&b&&(g+=b,b=0),A.forEach(([e,t])=>{O&e&&t(z)}))}}})(h,d);return[m,h,((e,t)=>{var n,r,i;let o,a,u,s,d=ny(),c=!1,l=t?"scrollLeft":"scrollTop",p=t?"left":"top",f=t?"overflowX":"overflowY",[h,m]=(n=()=>d[0],r=(e,t)=>{u.scrollTo({[p]:nS(e,c),behavior:t?"smooth":"instant"})},[async(t,i)=>{let a,u,s;if(!await n())return;o&&o();let d=o=()=>{a=!0,ng(u),s&&s()},c=()=>{if(!a){if(e.o()&&(ng(u),u=n_(d,150)),i){for(let[t,n]=e.i(0);t<=n;t++)if(e.R(t))return;d()}e.W(7),r(t(),i)}},l=()=>{let t;a||(s=e.H(2,()=>{t||(t=!0,nb(()=>{t=!1,c()}))}),c())};i?(e.W(8,t()),nb(l)):l()},()=>{o&&o()}]),_=t?"width":"height",g=new WeakMap,b=(i=t=>{let n=[];for(let{target:r,contentRect:i}of t)if(r.offsetParent)if(r===u)e.W(4,i[_]);else{let e=g.get(r);null!=e&&n.push([e,i[_]])}n.length&&e.W(3,n)},{A(e){(a||(a=new e.ownerDocument.defaultView.ResizeObserver(i))).observe(e)},B(e){a.unobserve(e)},X(){a&&a.disconnect()}});return{D(n,r=n.parentElement){var i,o;let a,h,_,g,y,v,w,k,z,S,E,A,x;b.A(u=r),t&&(c="rtl"===getComputedStyle(r).direction),i=()=>nS(r[l],c),h=0,_=!1,g=!1,y=!1,v=!1,w=Date.now,k=()=>{_||g?(_=!1,z()):(y=!1,e.W(2))},z=()=>{ng(a),a=n_(k,150)},S=()=>{h=w(),y&&(v=!0),o&&e.W(6,o()),e.W(1,i()),z()},E=n=>{if(_||!e.M()||n.ctrlKey)return;let r=w()-h;150>r&&50<r&&(t?n.deltaX:n.deltaY)&&(_=!0)},A=()=>{g=!0,y=v=!1},x=()=>{g=!1,nw()&&(y=!0)},r.addEventListener("scroll",S),r.addEventListener("wheel",E,{passive:!0}),r.addEventListener("touchstart",A,{passive:!0}),r.addEventListener("touchend",x,{passive:!0}),s={X:()=>{r.removeEventListener("scroll",S),r.removeEventListener("wheel",E),r.removeEventListener("touchstart",A),r.removeEventListener("touchend",x),ng(a)},Y:()=>{let[t,n]=e.L();t&&(((t,n,i)=>{if(i){let e=r.style,t=e[f];e[f]="hidden",n_(()=>{e[f]=t})}let o=e.T()+t;o<=0||o>=e.O()+e.t()-e.o()?r.scrollTo({[p]:nS(o,c),behavior:"instant"}):r.scrollBy({[p]:nS(t,c),behavior:"instant"}),n&&m()})(t,n,v),v=!1,n&&e.o()>e.t()&&e.W(1,i()))}},d[1](!0)},_(){b.X(),s&&s.X(),d[1](!1),d=ny()},P:(e,t)=>(g.set(e,t),b.A(e),()=>{g.delete(e),b.B(e)}),V:h,J(){s&&s.Y()},j:e.O}})(m,f),f]},(g=(0,N.useRef)(null)).current||(g.current=_()));y!==S.C()&&S.W(5,[y,i]),s!==S.O()&&S.W(6,s);let[T,j]=(0,N.useReducer)(S.I,void 0,S.I),O=S.M(),P=S.t(),I=[],$=e=>{let t,n=b(e);return(0,eE.jsx)(nO,{Z:A.P,ee:e,te:S.u(e),ne:S.R(e),oe:l,N:n,re:x,ie:w[nx]},null!=(t=n.key)?t:"_"+e)};if(nA(()=>{w[nx]=!1,S.H(1,e=>{e?(0,nd.flushSync)(j):j()}),S.H(4,()=>{k.current&&k.current(S.T())}),S.H(8,()=>{z.current&&z.current()});let e=v[nx];return p?nb(()=>{p.current&&A.D(e,p[nx])}):A.D(e),()=>{S._(),A._()}},[]),nA(()=>{A.J()},[T]),(0,N.useImperativeHandle)(m,()=>({get cache(){return E.q()},get scrollOffset(){return S.T()},get scrollSize(){return nl(S.t(),S.o())},get viewportSize(){return S.o()},findItemIndex:S.k,getItemOffset:S.u,getItemSize:S.h,scrollToIndex:(e,t)=>((e,t,n,{align:r,smooth:i,offset:o=0}={})=>{if(n=nh(n,0,t.C()-1),"nearest"===r){let e=t.u(n),i=t.T();if(e<i)r="start";else{if(!(e+t.h(n)>i+t.o()))return;r="end"}}e.V(()=>o+e.j()+t.u(n)+("end"===r?t.h(n)-t.o():"center"===r?(t.h(n)-t.o())/2:0),i)})(A,S,e,t),scrollTo:e=>nE(A,e),scrollBy:e=>{nE(A,e+S.T())}}),[]),a){let e=new Set(a);for(let[t,r]=S.i(n);t<=r;t++)e.add(t);nm([...e]).forEach(e=>{I.push($(e))})}else for(let[e,t]=S.i(n);e<=t;e++)I.push($(e));return(0,eE.jsx)(c,{ref:v,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:x?P:"100%",height:x?"100%":P,pointerEvents:O?"none":void 0},children:I})});let nI={MessageItem:e=>{let{message:t,children:n,depth:r,index:i,typingOpts:o={chunkSize:2,delay:40}}=e,a=nu(),{updateMessageTypeWritingCount:u}=ns(),s=L(t),[d,c]=(0,N.useState)(null),l=(0,N.useRef)(null);function p(){l.current&&(clearTimeout(l.current),l.current=null,setTimeout(()=>{u("sub")}))}F(()=>{p()}),(0,N.useEffect)(()=>{if(t.isGenerating){let e;c(t.swipes[t.activeSwipeId].content.length),u("add"),p(),e=Date.now(),l.current=setInterval(()=>{c(t=>{let n,r,i=(r=(n=Date.now())-e,e=n,Math.round(r/o.delay)*o.chunkSize),a=s.current,u=a.swipes[a.activeSwipeId].content.length,d=Math.min((t||0)+i,u);return a.isGenerating||u!==d?d:(p(),null)})},o.delay)}},[t.isGenerating]);let{data:f}=ek(async()=>null!==d?{...t,swipes:t.swipes.map((e,n)=>n!==t.activeSwipeId?e:{...e,content:e.content.slice(0,d)})}:await a.ai.chat.renderMessage({message:t,depth:r,index:i}),{refreshDeps:[t,d]});return n(f||t,t)},MessageList:(0,N.forwardRef)((e,t)=>{let{children:n,messages:r,vListProps:i}=e;return(0,eE.jsx)(nP,{...i,data:r,ref:t,children:(e,t)=>n({message:e,index:t,depth:r.length-1-t})})})};var n$=Array.isArray,nM="object"==typeof global&&global&&global.Object===Object&&global,nC="object"==typeof self&&self&&self.Object===Object&&self,nN=nM||nC||Function("return this")(),nR=nN.Symbol,nL=Object.prototype,nZ=nL.hasOwnProperty,nD=nL.toString,nU=nR?nR.toStringTag:void 0;let nF=function(e){var t=nZ.call(e,nU),n=e[nU];try{e[nU]=void 0;var r=!0}catch(e){}var i=nD.call(e);return r&&(t?e[nU]=n:delete e[nU]),i};var nH=Object.prototype.toString,nJ=nR?nR.toStringTag:void 0;let nB=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":nJ&&nJ in Object(e)?nF(e):nH.call(e)},nV=function(e){return"symbol"==typeof e||null!=e&&"object"==typeof e&&"[object Symbol]"==nB(e)};var nG=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nW=/^\w*$/;let nq=function(e,t){if(n$(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||nV(e))||nW.test(e)||!nG.test(e)||null!=t&&e in Object(t)},nK=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},nX=function(e){if(!nK(e))return!1;var t=nB(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};var nY=nN["__core-js_shared__"],nQ=(y=/[^.]+$/.exec(nY&&nY.keys&&nY.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",n0=Function.prototype.toString;let n3=function(e){if(null!=e){try{return n0.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var n8=/^\[object .+?Constructor\]$/,n1=Object.prototype,n2=Function.prototype.toString,n6=n1.hasOwnProperty,n4=RegExp("^"+n2.call(n6).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");let n9=function(e){return!!nK(e)&&(!nQ||!(nQ in e))&&(nX(e)?n4:n8).test(n3(e))},n5=function(e,t){var n=null==e?void 0:e[t];return n9(n)?n:void 0};var n7=n5(Object,"create"),re=Object.prototype.hasOwnProperty,rt=Object.prototype.hasOwnProperty;function rn(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])}}rn.prototype.clear=function(){this.__data__=n7?n7(null):{},this.size=0},rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},rn.prototype.get=function(e){var t=this.__data__;if(n7){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return re.call(t,e)?t[e]:void 0},rn.prototype.has=function(e){var t=this.__data__;return n7?void 0!==t[e]:rt.call(t,e)},rn.prototype.set=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=n7&&void 0===t?"__lodash_hash_undefined__":t,this};let rr=function(e,t){for(var n,r=e.length;r--;)if((n=e[r][0])===t||n!=n&&t!=t)return r;return -1};var ri=Array.prototype.splice;function ro(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])}}ro.prototype.clear=function(){this.__data__=[],this.size=0},ro.prototype.delete=function(e){var t=this.__data__,n=rr(t,e);return!(n<0)&&(n==t.length-1?t.pop():ri.call(t,n,1),--this.size,!0)},ro.prototype.get=function(e){var t=this.__data__,n=rr(t,e);return n<0?void 0:t[n][1]},ro.prototype.has=function(e){return rr(this.__data__,e)>-1},ro.prototype.set=function(e,t){var n=this.__data__,r=rr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var ra=n5(nN,"Map");let ru=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},rs=function(e,t){var n=e.__data__;return ru(t)?n["string"==typeof t?"string":"hash"]:n.map};function rd(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])}}function rc(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(rc.Cache||rd),n}rd.prototype.clear=function(){this.size=0,this.__data__={hash:new rn,map:new(ra||ro),string:new rn}},rd.prototype.delete=function(e){var t=rs(this,e).delete(e);return this.size-=!!t,t},rd.prototype.get=function(e){return rs(this,e).get(e)},rd.prototype.has=function(e){return rs(this,e).has(e)},rd.prototype.set=function(e,t){var n=rs(this,e),r=n.size;return n.set(e,t),this.size+=+(n.size!=r),this},rc.Cache=rd;var rl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rp=/\\(\\)?/g,rf=(w=(v=rc(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rl,function(e,n,r,i){t.push(r?i.replace(rp,"$1"):n||e)}),t},function(e){return 500===w.size&&w.clear(),e})).cache,v);let rh=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};var rm=1/0,r_=nR?nR.prototype:void 0,rg=r_?r_.toString:void 0;let rb=function e(t){if("string"==typeof t)return t;if(n$(t))return rh(t,e)+"";if(nV(t))return rg?rg.call(t):"";var n=t+"";return"0"==n&&1/t==-rm?"-0":n},ry=function(e,t){return n$(e)?e:nq(e,t)?[e]:rf(null==e?"":rb(e))};var rv=1/0;let rw=function(e){if("string"==typeof e||nV(e))return e;var t=e+"";return"0"==t&&1/e==-rv?"-0":t},rk=function(e,t){t=ry(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[rw(t[n++])];return n&&n==r?e:void 0},rz=function(e,t,n){var r=null==e?void 0:rk(e,t);return void 0===r?n:r};function rS({projectInfo:e,activePersona:r,onSend:i,messages:d,setSwipe:c}){(0,N.useEffect)(()=>{n=e??void 0,o=r??void 0},[e,r]),(0,N.useEffect)(()=>{t=async e=>{await i(e)},a=async e=>{if(d.length>1)throw Error("已有新消息,不允许切换开场白");if(0===d.length)throw Error("断言失败:没有开场消息,无法切换开场白");let t=Math.floor(e)-1,n=d[0].swipes.length;t<0||t>=n||c(d[0].id,t)},s=(e,t)=>d.find(t=>t.id===e)?.swipes[t]?.mjv?.value,u=(e,t,n)=>{let r=s?.(e,t);if(r)return rz(r,n)}},[i,d,c])}window.$mj_engine={ai:{chat:{get complete(){return t},get project(){return n},settings:{get persona(){return o}},get setFirstMesIndex(){return a}}},bind:({messageId:e,swipeId:r})=>({ai:{chat:{mjv:{get:t=>u?.(e,r,t),getAll:()=>s?.(e,r)??{}},get complete(){return t},get project(){return n},settings:{get persona(){return o}},get setFirstMesIndex(){return a}}}})};var rE=Symbol.for("immer-nothing"),rA=Symbol.for("immer-draftable"),rx=Symbol.for("immer-state");function rT(e){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var rj=Object,rO=rj.getPrototypeOf,rP="constructor",rI="prototype",r$="configurable",rM="enumerable",rC="writable",rN="value",rR=e=>!!e&&!!e[rx];function rL(e){return!!e&&(rU(e)||rG(e)||!!e[rA]||!!e[rP]?.[rA]||rW(e)||rq(e))}var rZ=rj[rI][rP].toString(),rD=new WeakMap;function rU(e){if(!e||!rK(e))return!1;let t=rO(e);if(null===t||t===rj[rI])return!0;let n=rj.hasOwnProperty.call(t,rP)&&t[rP];if(n===Object)return!0;if(!rX(n))return!1;let r=rD.get(n);return void 0===r&&(r=Function.toString.call(n),rD.set(n,r)),r===rZ}function rF(e,t,n=!0){0===rH(e)?(n?Reflect.ownKeys(e):rj.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function rH(e){let t=e[rx];return t?t.type_:rG(e)?1:rW(e)?2:3*!!rq(e)}var rJ=(e,t,n=rH(e))=>2===n?e.has(t):rj[rI].hasOwnProperty.call(e,t),rB=(e,t,n=rH(e))=>2===n?e.get(t):e[t],rV=(e,t,n,r=rH(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},rG=Array.isArray,rW=e=>e instanceof Map,rq=e=>e instanceof Set,rK=e=>"object"==typeof e,rX=e=>"function"==typeof e,rY=e=>e.modified_?e.copy_:e.base_;function rQ(e,t){if(rW(e))return new Map(e);if(rq(e))return new Set(e);if(rG(e))return Array[rI].slice.call(e);let n=rU(e);if(!0!==t&&("class_only"!==t||n)){let t=rO(e);if(null!==t&&n)return{...e};let r=rj.create(t);return rj.assign(r,e)}{let t=rj.getOwnPropertyDescriptors(e);delete t[rx];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],o=t[i];!1===o[rC]&&(o[rC]=!0,o[r$]=!0),(o.get||o.set)&&(t[i]={[r$]:!0,[rC]:!0,[rM]:o[rM],[rN]:e[i]})}return rj.create(rO(e),t)}}function r0(e,t=!1){return r8(e)||rR(e)||!rL(e)||(rH(e)>1&&rj.defineProperties(e,{set:r3,add:r3,clear:r3,delete:r3}),rj.freeze(e),t&&rF(e,(e,t)=>{r0(t,!0)},!1)),e}var r3={[rN]:function(){rT(2)}};function r8(e){return!(null!==e&&rK(e))||rj.isFrozen(e)}var r1="MapSet",r2="Patches",r6="ArrayMethods",r4={};function r9(e){let t=r4[e];return t||rT(0,e),t}var r5=e=>!!r4[e];function r7(e,t){t&&(e.patchPlugin_=r9(r2),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ie(e){it(e),e.drafts_.forEach(ii),e.drafts_=null}function it(e){e===z&&(z=e.parent_)}var ir=e=>z={drafts_:[],parent_:z,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:r5(r1)?r9(r1):void 0,arrayMethodsPlugin_:r5(r6)?r9(r6):void 0};function ii(e){let t=e[rx];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function io(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(void 0!==e&&e!==n){n[rx].modified_&&(ie(t),rT(4)),rL(e)&&(e=ia(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[rx].base_,e,t)}else e=ia(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&r0(t,n)}(t,e,!0),ie(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==rE?e:void 0}function ia(e,t){if(r8(t))return t;let n=t[rx];if(!n)return ip(t,e.handledSet_,e);if(!is(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);il(n,e)}return n.copy_}function iu(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var is=(e,t)=>e.scope_===t,id=[];function ic(e,t,n,r){let i=e.copy_||e.base_,o=e.type_;if(void 0!==r&&rB(i,r,o)===t)return void rV(i,r,n,o);if(!e.draftLocations_){let t=e.draftLocations_=new Map;rF(i,(e,n)=>{if(rR(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}for(let r of e.draftLocations_.get(t)??id)rV(i,r,n,o)}function il(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}iu(e)}}function ip(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||rR(e)||t.has(e)||!rL(e)||r8(e)||(t.add(e),rF(e,(r,i)=>{if(rR(i)){let t=i[rx];is(t,n)&&(rV(e,r,rY(t),e.type_),iu(t))}else rL(i)&&ip(i,t,n)})),e}var ih={get(e,t){let n;if(t===rx)return e;let r=e.scope_.arrayMethodsPlugin_,i=1===e.type_&&"string"==typeof t;if(i&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=e.copy_||e.base_;if(!rJ(o,t,e.type_)){var a;let n;return a=e,(n=ig(o,t))?rN in n?n[rN]:n.get?.call(a.draft_):void 0}let u=o[t];if(e.finalized_||!rL(u)||i&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&Number.isInteger(n=+t)&&String(n)===t)return u;if(u===i_(e.base_,t)){iy(e);let n=1===e.type_?+t:t,r=iv(e.scope_,u,e,n);return e.copy_[n]=r}return u},has:(e,t)=>t in(e.copy_||e.base_),ownKeys:e=>Reflect.ownKeys(e.copy_||e.base_),set(e,t,n){let r=ig(e.copy_||e.base_,t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=i_(e.copy_||e.base_,t),i=r?.[rx];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if((n===r?0!==n||1/n==1/r:n!=n&&r!=r)&&(void 0!==n||rJ(e.base_,t,e.type_)))return!0;iy(e),ib(e)}return!!(e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t]))||(e.copy_[t]=n,e.assigned_.set(t,!0),!function(e,t,n){let{scope_:r}=e;if(rR(n)){let i=n[rx];is(i,r)&&i.callbacks_.push(function(){iy(e),ic(e,n,rY(i),t)})}else rL(n)&&e.callbacks_.push(function(){let i=e.copy_||e.base_;3===e.type_?i.has(n)&&ip(n,r.handledSet_,r):rB(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&ip(rB(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n),!0)},deleteProperty:(e,t)=>(iy(e),void 0!==i_(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),ib(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let n=e.copy_||e.base_,r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[rC]:!0,[r$]:1!==e.type_||"length"!==t,[rM]:r[rM],[rN]:n[t]}:r},defineProperty(){rT(11)},getPrototypeOf:e=>rO(e.base_),setPrototypeOf(){rT(12)}},im={};for(let e in ih){let t=ih[e];im[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function i_(e,t){let n=e[rx];return(n?n.copy_||n.base_:e)[t]}function ig(e,t){if(!(t in e))return;let n=rO(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=rO(n)}}function ib(e){!e.modified_&&(e.modified_=!0,e.parent_&&ib(e.parent_))}function iy(e){e.copy_||(e.assigned_=new Map,e.copy_=rQ(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function iv(e,t,n,r){let[i,o]=rW(t)?r9(r1).proxyMap_(t,n):rq(t)?r9(r1).proxySet_(t,n):function(e,t){let n=rG(e),r={type_:+!!n,scope_:t?t.scope_:z,modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,o=ih;n&&(i=[r],o=im);let{revoke:a,proxy:u}=Proxy.revocable(i,o);return r.draft_=u,r.revoke_=a,[u,r]}(t,n);if((n?.scope_??z).drafts_.push(i),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&void 0!==r)n.callbacks_.push(function(e){if(!o||!is(o,e))return;e.mapSetPlugin_?.fixSetContents(o);let t=rY(o);ic(n,o.draft_??o,t,r),il(o,e)});else o.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(o);let{patchPlugin_:t}=e;o.modified_&&t&&t.generatePatches_(o,[],e)});return i}im.deleteProperty=function(e,t){return im.set.call(this,e,t,void 0)},im.set=function(e,t,n){return ih.set.call(this,e[0],t,n,e[0])};var iw=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{let r;if(rX(e)&&!rX(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}if(rX(t)||rT(6),void 0===n||rX(n)||rT(7),rL(e)){let i=ir(this),o=iv(i,e,void 0),a=!0;try{r=t(o),a=!1}finally{a?ie(i):it(i)}return r7(i,n),io(r,i)}if(e&&rK(e))rT(1,e);else{if(void 0===(r=t(e))&&(r=e),r===rE&&(r=void 0),this.autoFreeze_&&r0(r,!0),n){let t=[],i=[];r9(r2).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}},this.produceWithPatches=(e,t)=>{let n,r;return rX(e)?(t,...n)=>this.produceWithPatches(t,t=>e(t,...n)):[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),"boolean"==typeof e?.useStrictIteration&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;rL(e)||rT(8),rR(e)&&(rR(t=e)||rT(10,t),e=function e(t){let n;if(!rL(t)||r8(t))return t;let r=t[rx],i=!0;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=rQ(t,r.scope_.immer_.useStrictShallowCopy_),i=r.scope_.immer_.shouldUseStrictIteration()}else n=rQ(t,!0);return rF(n,(t,r)=>{rV(n,t,e(r))},i),r&&(r.finalized_=!1),n}(t));let n=ir(this),r=iv(n,e,void 0);return r[rx].isManual_=!0,it(n),r}finishDraft(e,t){let n=e&&e[rx];n&&n.isManual_||rT(9);let{scope_:r}=n;return r7(r,t),io(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=r9(r2).applyPatches_;return rR(e)?r(e,t):this.produce(e,e=>r(e,t))}}().produce;let ik=["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","Load failed","Failed to fetch"];function iz(e){return ik.some(t=>e.includes(t))}class iS extends Error{constructor(e,t){super(e),this.name=this.constructor.name,this.cause=t}}async function*iE(e,t,n="generate",r,i){let o=[],a=null,u=!1,s=null;try{let d=e=>{!s&&(o.push(e),a&&(a(),a=null))},c=()=>{u=!0,a&&(a(),a=null)},l=e=>{s=e,a&&(a(),a=null)};if("generate"===n)e.ai.chat.complete(t,r,d).then(c).catch(l);else if("regenerate"===n)e.ai.chat.regenerate(r,d).then(c).catch(l);else if("continue"===n)e.ai.chat.continue(r,d).then(c).catch(l);else{if(!i)throw Error("call recover without assisMsgId");e.ai.chat.recover(r,i,d).then(c).catch(l)}}catch(e){s=e,u=!0}for(;;)if(o.length>0)yield o.shift();else if(u)break;else if(s)throw s;else await new Promise(e=>{a=e})}let iA="not_saved";function ix(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:a,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=a.prototype,o=Object.keys(i);for(let e=0;e<o.length;e++){let t=o[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class o extends i{}function a(e){var t;let i=n?.Parent?new o:this;for(let n of(r(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))n();return i}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}Object.freeze({status:"aborted"}),Symbol("zod_brand");class iT extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ij extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}let iO={};function iP(e){return e&&Object.assign(iO,e),iO}function iI(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function i$(e,t="|"){return e.map(e=>iQ(e)).join(t)}function iM(e,t){return"bigint"==typeof t?t.toString():t}function iC(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function iN(e){return null==e}function iR(e){let t=+!!e.startsWith("^"),n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}let iL=Symbol("evaluating");function iZ(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==iL)return void 0===r&&(r=iL,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function iD(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function iU(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function iF(e){return JSON.stringify(e)}let iH="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function iJ(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let iB=iC(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function iV(e){if(!1===iJ(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let n=t.prototype;return!1!==iJ(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function iG(e){return iV(e)?{...e}:Array.isArray(e)?[...e]:e}let iW=new Set(["string","number","symbol"]),iq=new Set(["string","number","bigint","boolean","symbol","undefined"]);function iK(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function iX(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function iY(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function iQ(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let i0={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},i3={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function i8(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function i1(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function i2(e){return"string"==typeof e?e:e?.message}function i6(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=i2(e.inst?._zod.def?.error?.(e))??i2(t?.error?.(e))??i2(n.customError?.(e))??i2(n.localeError?.(e))??"Invalid input"),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function i4(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function i9(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function i5(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}let i7=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,iM,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},oe=ix("$ZodError",i7),ot=ix("$ZodError",i7,{Parent:Error}),on=e=>(t,n,r,i)=>{let o=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new iT;if(a.issues.length){let t=new(i?.Err??e)(a.issues.map(e=>i6(e,o,iP())));throw iH(t,i?.callee),t}return a.value},or=on(ot),oi=e=>async(t,n,r,i)=>{let o=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let t=new(i?.Err??e)(a.issues.map(e=>i6(e,o,iP())));throw iH(t,i?.callee),t}return a.value},oo=oi(ot),oa=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new iT;return o.issues.length?{success:!1,error:new(e??oe)(o.issues.map(e=>i6(e,i,iP())))}:{success:!0,data:o.value}},ou=oa(ot),os=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>i6(e,i,iP())))}:{success:!0,data:o.value}},od=os(ot),oc=/^[cC][^\s-]{8,}$/,ol=/^[0-9a-z]+$/,op=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,of=/^[0-9a-vA-V]{20}$/,oh=/^[A-Za-z0-9]{27}$/,om=/^[a-zA-Z0-9_-]{21}$/,o_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,og=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ob=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,oy=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ov=oy(4),ow=oy(6),ok=oy(7),oz=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,oS=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,oE=/^(([^<>()\[\]\\.,;:\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,}))$/,oA=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ox=oA,oT=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function oj(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let oO=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,oI=e=>{let t=iK(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},o$=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,oM=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oC=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,oN=/^[A-Za-z0-9_-]*$/,oR=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,oL=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,oZ=/^\+[1-9]\d{6,14}$/,oD="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",oU=RegExp(`^${oD}$`);function oF(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function oH(e){return RegExp(`^${oF(e)}$`)}function oJ(e){let t=oF({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${n.join("|")})`;return RegExp(`^${oD}T(?:${r})$`)}let oB=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},oV=/^-?\d+n?$/,oG=/^-?\d+$/,oW=/^-?\d+(?:\.\d+)?$/,oq=/^(?:true|false)$/i,oK=/^null$/i,oX=/^undefined$/i,oY=/^[^A-Z]*$/,oQ=/^[^a-z]*$/,o0=/^[0-9a-fA-F]*$/;function o3(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function o8(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let o1=/^[0-9a-fA-F]{32}$/,o2=o3(22,"=="),o6=o8(22),o4=/^[0-9a-fA-F]{40}$/,o9=o3(27,"="),o5=o8(27),o7=/^[0-9a-fA-F]{64}$/,ae=o3(43,"="),at=o8(43),an=/^[0-9a-fA-F]{96}$/,ar=o3(64,""),ai=o8(64),ao=/^[0-9a-fA-F]{128}$/,aa=o3(86,"=="),au=o8(86),as=ix("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ad={number:"number",bigint:"bigint",object:"date"},ac=ix("$ZodCheckLessThan",(e,t)=>{as.init(e,t);let n=ad[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),al=ix("$ZodCheckGreaterThan",(e,t)=>{as.init(e,t);let n=ad[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ap=ix("$ZodCheckMultipleOf",(e,t)=>{as.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){let n=(e.toString().split(".")[1]||"").length,r=t.toString(),i=(r.split(".")[1]||"").length;if(0===i&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let o=n>i?n:i;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),af=ix("$ZodCheckNumberFormat",(e,t)=>{as.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[i,o]=i0[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=o,n&&(r.pattern=oG)}),e._zod.check=a=>{let u=a.value;if(n){if(!Number.isInteger(u))return void a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});if(!Number.isSafeInteger(u))return void(u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}u<i&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>o&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),ah=ix("$ZodCheckBigIntFormat",(e,t)=>{as.init(e,t);let[n,r]=i3[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let o=i.value;o<n&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>r&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),am=ix("$ZodCheckMaxSize",(e,t)=>{var n;as.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!iN(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:i4(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),a_=ix("$ZodCheckMinSize",(e,t)=>{var n;as.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!iN(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:i4(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ag=ix("$ZodCheckSizeEquals",(e,t)=>{var n;as.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!iN(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let o=i>t.size;n.issues.push({origin:i4(r),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ab=ix("$ZodCheckMaxLength",(e,t)=>{var n;as.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!iN(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=i9(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ay=ix("$ZodCheckMinLength",(e,t)=>{var n;as.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!iN(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=i9(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),av=ix("$ZodCheckLengthEquals",(e,t)=>{var n;as.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!iN(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let o=i9(r),a=i>t.length;n.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),aw=ix("$ZodCheckStringFormat",(e,t)=>{var n,r;as.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ak=ix("$ZodCheckRegex",(e,t)=>{aw.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),az=ix("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=oY),aw.init(e,t)}),aS=ix("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=oQ),aw.init(e,t)}),aE=ix("$ZodCheckIncludes",(e,t)=>{as.init(e,t);let n=iK(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),aA=ix("$ZodCheckStartsWith",(e,t)=>{as.init(e,t);let n=RegExp(`^${iK(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ax=ix("$ZodCheckEndsWith",(e,t)=>{as.init(e,t);let n=RegExp(`.*${iK(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function aT(e,t,n){e.issues.length&&t.issues.push(...i1(n,e.issues))}let aj=ix("$ZodCheckProperty",(e,t)=>{as.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>aT(n,e,t.property));aT(n,e,t.property)}}),aO=ix("$ZodCheckMimeType",(e,t)=>{as.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),aP=ix("$ZodCheckOverwrite",(e,t)=>{as.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class aI{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let a$={major:4,minor:3,patch:6},aM=ix("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=a$;let r=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&r.unshift(e),r))for(let n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r,i=i8(e);for(let o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,a=o._zod.check(e);if(a instanceof Promise&&n?.async===!1)throw new iT;if(r||a instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await a,e.issues.length!==t&&(i||(i=i8(e,t)))});else{if(e.issues.length===t)continue;i||(i=i8(e,t))}}return r?r.then(()=>e):e},n=(n,i,o)=>{if(i8(n))return n.aborted=!0,n;let a=t(i,r,o);if(a instanceof Promise){if(!1===o.async)throw new iT;return a.then(t=>e._zod.parse(t,o))}return e._zod.parse(a,o)};e._zod.run=(i,o)=>{if(o.skipChecks)return e._zod.parse(i,o);if("backward"===o.direction){let t=e._zod.parse({value:i.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,o)):n(t,i,o)}let a=e._zod.parse(i,o);if(a instanceof Promise){if(!1===o.async)throw new iT;return a.then(e=>t(e,r,o))}return t(a,r,o)}}iZ(e,"~standard",()=>({validate:t=>{try{let n=ou(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return od(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),aC=ix("$ZodString",(e,t)=>{aM.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??oB(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),aN=ix("$ZodStringFormat",(e,t)=>{aw.init(e,t),aC.init(e,t)}),aR=ix("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ob),aN.init(e,t)}),aL=ix("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=oy(e))}else t.pattern??(t.pattern=oy());aN.init(e,t)}),aZ=ix("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=oz),aN.init(e,t)}),aD=ix("$ZodURL",(e,t)=>{aN.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),aU=ix("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=oj()),aN.init(e,t)}),aF=ix("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=om),aN.init(e,t)}),aH=ix("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=oc),aN.init(e,t)}),aJ=ix("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ol),aN.init(e,t)}),aB=ix("$ZodULID",(e,t)=>{t.pattern??(t.pattern=op),aN.init(e,t)}),aV=ix("$ZodXID",(e,t)=>{t.pattern??(t.pattern=of),aN.init(e,t)}),aG=ix("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=oh),aN.init(e,t)}),aW=ix("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=oJ(t)),aN.init(e,t)}),aq=ix("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=oU),aN.init(e,t)}),aK=ix("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=oH(t)),aN.init(e,t)}),aX=ix("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=o_),aN.init(e,t)}),aY=ix("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=oO),aN.init(e,t),e._zod.bag.format="ipv4"}),aQ=ix("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=oP),aN.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),a0=ix("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=oI(t.delimiter)),aN.init(e,t),e._zod.bag.format="mac"}),a3=ix("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=o$),aN.init(e,t)}),a8=ix("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=oM),aN.init(e,t),e._zod.check=n=>{let r=n.value.split("/");try{if(2!==r.length)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function a1(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let a2=ix("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=oC),aN.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{a1(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),a6=ix("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=oN),aN.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{!function(e){if(!oN.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return a1(t.padEnd(4*Math.ceil(t.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),a4=ix("$ZodE164",(e,t)=>{t.pattern??(t.pattern=oZ),aN.init(e,t)}),a9=ix("$ZodJWT",(e,t)=>{aN.init(e,t),e._zod.check=n=>{!function(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(n.value,t.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),a5=ix("$ZodCustomStringFormat",(e,t)=>{aN.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),a7=ix("$ZodNumber",(e,t)=>{aM.init(e,t),e._zod.pattern=e._zod.bag.pattern??oW,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}let i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;let o="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),ue=ix("$ZodNumberFormat",(e,t)=>{af.init(e,t),a7.init(e,t)}),ut=ix("$ZodBoolean",(e,t)=>{aM.init(e,t),e._zod.pattern=oq,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),un=ix("$ZodBigInt",(e,t)=>{aM.init(e,t),e._zod.pattern=oV,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),ur=ix("$ZodBigIntFormat",(e,t)=>{ah.init(e,t),un.init(e,t)}),ui=ix("$ZodSymbol",(e,t)=>{aM.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return"symbol"==typeof r||t.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),t}}),uo=ix("$ZodUndefined",(e,t)=>{aM.init(e,t),e._zod.pattern=oX,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{let r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}}),ua=ix("$ZodNull",(e,t)=>{aM.init(e,t),e._zod.pattern=oK,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),uu=ix("$ZodAny",(e,t)=>{aM.init(e,t),e._zod.parse=e=>e}),us=ix("$ZodUnknown",(e,t)=>{aM.init(e,t),e._zod.parse=e=>e}),ud=ix("$ZodNever",(e,t)=>{aM.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),uc=ix("$ZodVoid",(e,t)=>{aM.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return void 0===r||t.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),t}}),ul=ix("$ZodDate",(e,t)=>{aM.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}let i=n.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),n}});function up(e,t,n){e.issues.length&&t.issues.push(...i1(n,e.issues)),t.value[n]=e.value}let uf=ix("$ZodArray",(e,t)=>{aM.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);let o=[];for(let e=0;e<i.length;e++){let a=i[e],u=t.element._zod.run({value:a,issues:[]},r);u instanceof Promise?o.push(u.then(t=>up(t,n,e))):up(u,n,e)}return o.length?Promise.all(o).then(()=>n):n}});function uh(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...i1(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function um(e){var t;let n=Object.keys(e.shape);for(let t of n)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${t}": expected a Zod schema`);let r=Object.keys(t=e.shape).filter(e=>"optional"===t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function u_(e,t,n,r,i,o){let a=[],u=i.keySet,s=i.catchall._zod,d=s.def.type,c="optional"===s.optout;for(let i in t){if(u.has(i))continue;if("never"===d){a.push(i);continue}let o=s.run({value:t[i],issues:[]},r);o instanceof Promise?e.push(o.then(e=>uh(e,n,i,t,c))):uh(o,n,i,t,c)}return(a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length)?Promise.all(e).then(()=>n):n}let ug=ix("$ZodObject",(e,t)=>{let n;aM.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape");if(!r?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let i=iC(()=>um(t));iZ(e._zod,"propValues",()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values)for(let e of(n[t]??(n[t]=new Set),r.values))n[t].add(e)}return n});let o=t.catchall;e._zod.parse=(t,r)=>{n??(n=i.value);let a=t.value;if(!iJ(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};let u=[],s=n.shape;for(let e of n.keys){let n=s[e],i="optional"===n._zod.optout,o=n._zod.run({value:a[e],issues:[]},r);o instanceof Promise?u.push(o.then(n=>uh(n,t,e,a,i))):uh(o,t,e,a,i)}return o?u_(u,a,t,r,i.value,e):u.length?Promise.all(u).then(()=>t):t}}),ub=ix("$ZodObjectJIT",(e,t)=>{let n,r;ug.init(e,t);let i=e._zod.parse,o=iC(()=>um(t)),a=!iO.jitless,u=a&&iB.value,s=t.catchall;e._zod.parse=(d,c)=>{r??(r=o.value);let l=d.value;return iJ(l)?a&&u&&c?.async===!1&&!0!==c.jitless?(n||(n=(e=>{let t=new aI(["shape","payload","ctx"]),n=o.value,r=e=>{let t=iF(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),a=0;for(let e of n.keys)i[e]=`key_${a++}`;for(let o of(t.write("const newResult = {};"),n.keys)){let n=i[o],a=iF(o),u=e[o],s=u?._zod?.optout==="optional";t.write(`const ${n} = ${r(o)};`),s?t.write(`
|
|
134
|
-
if (${n}.issues.length) {
|
|
135
|
-
if (${a} in input) {
|
|
136
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
137
|
-
...iss,
|
|
138
|
-
path: iss.path ? [${a}, ...iss.path] : [${a}]
|
|
139
|
-
})));
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (${n}.value === undefined) {
|
|
144
|
-
if (${a} in input) {
|
|
145
|
-
newResult[${a}] = undefined;
|
|
146
|
-
}
|
|
147
|
-
} else {
|
|
148
|
-
newResult[${a}] = ${n}.value;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
`):t.write(`
|
|
152
|
-
if (${n}.issues.length) {
|
|
153
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
154
|
-
...iss,
|
|
155
|
-
path: iss.path ? [${a}, ...iss.path] : [${a}]
|
|
156
|
-
})));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
if (${n}.value === undefined) {
|
|
160
|
-
if (${a} in input) {
|
|
161
|
-
newResult[${a}] = undefined;
|
|
162
|
-
}
|
|
163
|
-
} else {
|
|
164
|
-
newResult[${a}] = ${n}.value;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
`)}t.write("payload.value = newResult;"),t.write("return payload;");let u=t.compile();return(t,n)=>u(e,t,n)})(t.shape)),d=n(d,c),s)?u_([],l,d,c,r,e):d:i(d,c):(d.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),d)}});function uy(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let i=e.filter(e=>!i8(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>i6(e,r,iP())))}),t)}let uv=ix("$ZodUnion",(e,t)=>{aM.init(e,t),iZ(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),iZ(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),iZ(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),iZ(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>iR(e.source)).join("|")})$`)}});let n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(n)return r(i,o);let a=!1,u=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},o);if(t instanceof Promise)u.push(t),a=!0;else{if(0===t.issues.length)return t;u.push(t)}}return a?Promise.all(u).then(t=>uy(t,i,e,o)):uy(u,i,e,o)}});function uw(e,t,n,r){let i=e.filter(e=>0===e.issues.length);return 1===i.length?t.value=i[0].value:0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>i6(e,r,iP())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t}let uk=ix("$ZodXor",(e,t)=>{uv.init(e,t),t.inclusive=!1;let n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(n)return r(i,o);let a=!1,u=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},o);t instanceof Promise?(u.push(t),a=!0):u.push(t)}return a?Promise.all(u).then(t=>uw(t,i,e,o)):uw(u,i,e,o)}}),uz=ix("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,uv.init(e,t);let n=e._zod.parse;iZ(e._zod,"propValues",()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r))for(let r of(e[t]||(e[t]=new Set),n))e[t].add(r)}return e});let r=iC(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,o)=>{let a=i.value;if(!iJ(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let u=r.value.get(a?.[t.discriminator]);return u?u._zod.run(i,o):t.unionFallback?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),i)}}),uS=ix("$ZodIntersection",(e,t)=>{aM.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,n])=>uE(e,t,n)):uE(e,i,o)}});function uE(e,t,n){let r,i=new Map;for(let n of t.issues)if("unrecognized_keys"===n.code)for(let e of(r??(r=n),n.keys))i.has(e)||i.set(e,{}),i.get(e).l=!0;else e.issues.push(n);for(let t of n.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)i.has(e)||i.set(e,{}),i.get(e).r=!0;else e.issues.push(t);let o=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&r&&e.issues.push({...r,keys:o}),i8(e))return e;let a=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(iV(t)&&iV(n)){let r=Object.keys(n),i=Object.keys(t).filter(e=>-1!==r.indexOf(e)),o={...t,...n};for(let r of i){let i=e(t[r],n[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};o[r]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let o=e(t[i],n[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}let uA=ix("$ZodTuple",(e,t)=>{aM.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let a=[],u=[...n].reverse().findIndex(e=>"optional"!==e._zod.optin),s=-1===u?0:n.length-u;if(!t.rest){let t=o.length>n.length,i=o.length<s-1;if(t||i)return r.issues.push({...t?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:o,inst:e,origin:"array"}),r}let d=-1;for(let e of n){if(++d>=o.length&&d>=s)continue;let t=e._zod.run({value:o[d],issues:[]},i);t instanceof Promise?a.push(t.then(e=>ux(e,r,d))):ux(t,r,d)}if(t.rest)for(let e of o.slice(n.length)){d++;let n=t.rest._zod.run({value:e,issues:[]},i);n instanceof Promise?a.push(n.then(e=>ux(e,r,d))):ux(n,r,d)}return a.length?Promise.all(a).then(()=>r):r}});function ux(e,t,n){e.issues.length&&t.issues.push(...i1(n,e.issues)),t.value[n]=e.value}let uT=ix("$ZodRecord",(e,t)=>{aM.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!iV(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let o=[],a=t.keyType._zod.values;if(a){let u;n.value={};let s=new Set;for(let e of a)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){s.add("number"==typeof e?e.toString():e);let a=t.valueType._zod.run({value:i[e],issues:[]},r);a instanceof Promise?o.push(a.then(t=>{t.issues.length&&n.issues.push(...i1(e,t.issues)),n.value[e]=t.value})):(a.issues.length&&n.issues.push(...i1(e,a.issues)),n.value[e]=a.value)}for(let e in i)s.has(e)||(u=u??[]).push(e);u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u})}else for(let a of(n.value={},Reflect.ownKeys(i))){if("__proto__"===a)continue;let u=t.keyType._zod.run({value:a,issues:[]},r);if(u instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof a&&oW.test(a)&&u.issues.length){let e=t.keyType._zod.run({value:Number(a),issues:[]},r);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(u=e)}if(u.issues.length){"loose"===t.mode?n.value[a]=i[a]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(e=>i6(e,r,iP())),input:a,path:[a],inst:e});continue}let s=t.valueType._zod.run({value:i[a],issues:[]},r);s instanceof Promise?o.push(s.then(e=>{e.issues.length&&n.issues.push(...i1(a,e.issues)),n.value[u.value]=e.value})):(s.issues.length&&n.issues.push(...i1(a,s.issues)),n.value[u.value]=s.value)}return o.length?Promise.all(o).then(()=>n):n}}),uj=ix("$ZodMap",(e,t)=>{aM.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;let o=[];for(let[a,u]of(n.value=new Map,i)){let s=t.keyType._zod.run({value:a,issues:[]},r),d=t.valueType._zod.run({value:u,issues:[]},r);s instanceof Promise||d instanceof Promise?o.push(Promise.all([s,d]).then(([t,o])=>{uO(t,o,n,a,i,e,r)})):uO(s,d,n,a,i,e,r)}return o.length?Promise.all(o).then(()=>n):n}});function uO(e,t,n,r,i,o,a){e.issues.length&&(iW.has(typeof r)?n.issues.push(...i1(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(e=>i6(e,a,iP()))})),t.issues.length&&(iW.has(typeof r)?n.issues.push(...i1(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:r,issues:t.issues.map(e=>i6(e,a,iP()))})),n.value.set(e.value,t.value)}let uP=ix("$ZodSet",(e,t)=>{aM.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;let o=[];for(let e of(n.value=new Set,i)){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?o.push(i.then(e=>uI(e,n))):uI(i,n)}return o.length?Promise.all(o).then(()=>n):n}});function uI(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}let u$=ix("$ZodEnum",(e,t)=>{aM.init(e,t);let n=iI(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>iW.has(typeof e)).map(e=>"string"==typeof e?iK(e):e.toString()).join("|")})$`),e._zod.parse=(t,i)=>{let o=t.value;return r.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),uM=ix("$ZodLiteral",(e,t)=>{if(aM.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?iK(e):e?iK(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,i)=>{let o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),uC=ix("$ZodFile",(e,t)=>{aM.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),t}}),uN=ix("$ZodTransform",(e,t)=>{aM.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ij(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new iT;return n.value=i,n}});function uR(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}let uL=ix("$ZodOptional",(e,t)=>{aM.init(e,t),e._zod.optin="optional",e._zod.optout="optional",iZ(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),iZ(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${iR(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>uR(t,e.value)):uR(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),uZ=ix("$ZodExactOptional",(e,t)=>{uL.init(e,t),iZ(e._zod,"values",()=>t.innerType._zod.values),iZ(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),uD=ix("$ZodNullable",(e,t)=>{aM.init(e,t),iZ(e._zod,"optin",()=>t.innerType._zod.optin),iZ(e._zod,"optout",()=>t.innerType._zod.optout),iZ(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${iR(e.source)}|null)$`):void 0}),iZ(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),uU=ix("$ZodDefault",(e,t)=>{aM.init(e,t),e._zod.optin="optional",iZ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>uF(e,t)):uF(r,t)}});function uF(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let uH=ix("$ZodPrefault",(e,t)=>{aM.init(e,t),e._zod.optin="optional",iZ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),uJ=ix("$ZodNonOptional",(e,t)=>{aM.init(e,t),iZ(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>uB(t,e)):uB(i,e)}});function uB(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let uV=ix("$ZodSuccess",(e,t)=>{aM.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new ij("ZodSuccess");let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===r.issues.length,e)}}),uG=ix("$ZodCatch",(e,t)=>{aM.init(e,t),iZ(e._zod,"optin",()=>t.innerType._zod.optin),iZ(e._zod,"optout",()=>t.innerType._zod.optout),iZ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>i6(e,n,iP()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>i6(e,n,iP()))},input:e.value}),e.issues=[]),e)}}),uW=ix("$ZodNaN",(e,t)=>{aM.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),uq=ix("$ZodPipe",(e,t)=>{aM.init(e,t),iZ(e._zod,"values",()=>t.in._zod.values),iZ(e._zod,"optin",()=>t.in._zod.optin),iZ(e._zod,"optout",()=>t.out._zod.optout),iZ(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>uK(e,t.in,n)):uK(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>uK(e,t.out,n)):uK(r,t.out,n)}});function uK(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}let uX=ix("$ZodCodec",(e,t)=>{aM.init(e,t),iZ(e._zod,"values",()=>t.in._zod.values),iZ(e._zod,"optin",()=>t.in._zod.optin),iZ(e._zod,"optout",()=>t.out._zod.optout),iZ(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>uY(e,t,n)):uY(r,t,n)}{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>uY(e,t,n)):uY(r,t,n)}}});function uY(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>uQ(e,r,t.out,n)):uQ(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>uQ(e,r,t.in,n)):uQ(e,r,t.in,n)}}function uQ(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}let u0=ix("$ZodReadonly",(e,t)=>{aM.init(e,t),iZ(e._zod,"propValues",()=>t.innerType._zod.propValues),iZ(e._zod,"values",()=>t.innerType._zod.values),iZ(e._zod,"optin",()=>t.innerType?._zod?.optin),iZ(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(u3):u3(r)}});function u3(e){return e.value=Object.freeze(e.value),e}let u8=ix("$ZodTemplateLiteral",(e,t)=>{aM.init(e,t);let n=[];for(let e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith("^"),i=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(r,i))}else if(null===e||iq.has(typeof e))n.push(iK(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>("string"!=typeof n.value?n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),n)}),u1=ix("$ZodFunction",(e,t)=>(aM.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if("function"!=typeof t)throw Error("implement() must be called with a function");return function(...n){let r=Reflect.apply(t,this,e._def.input?or(e._def.input,n):n);return e._def.output?or(e._def.output,r):r}},e.implementAsync=t=>{if("function"!=typeof t)throw Error("implementAsync() must be called with a function");return async function(...n){let r=e._def.input?await oo(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await oo(e._def.output,i):i}},e._zod.parse=(t,n)=>("function"!=typeof t.value?t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:e}):e._def.output&&"promise"===e._def.output._zod.def.type?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t),e.input=(...t)=>{let n=e.constructor;return new n(Array.isArray(t[0])?{type:"function",input:new uA({type:"tuple",items:t[0],rest:t[1]}),output:e._def.output}:{type:"function",input:t[0],output:e._def.output})},e.output=t=>new e.constructor({type:"function",input:e._def.input,output:t}),e)),u2=ix("$ZodPromise",(e,t)=>{aM.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),u6=ix("$ZodLazy",(e,t)=>{aM.init(e,t),iZ(e._zod,"innerType",()=>t.getter()),iZ(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),iZ(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),iZ(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),iZ(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),u4=ix("$ZodCustom",(e,t)=>{as.init(e,t),aM.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>u9(t,n,r,e));u9(i,n,r,e)}});function u9(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(i5(e))}}Symbol("ZodOutput"),Symbol("ZodInput");(S=globalThis).__zod_globalRegistry??(S.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let u5=globalThis.__zod_globalRegistry;function u7(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...iY(t)})}function se(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...iY(t)})}function st(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...iY(t)})}function sn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...iY(t)})}function sr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...iY(t)})}function si(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...iY(t)})}function so(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...iY(t)})}function sa(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...iY(t)})}function su(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...iY(t)})}function ss(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...iY(t)})}function sd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...iY(t)})}function sc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...iY(t)})}function sl(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...iY(t)})}function sp(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...iY(t)})}function sf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...iY(t)})}function sh(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...iY(t)})}function sm(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...iY(t)})}function s_(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...iY(t)})}function sg(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...iY(t)})}function sb(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...iY(t)})}function sy(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...iY(t)})}function sv(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...iY(t)})}function sw(e,t){return new ac({check:"less_than",...iY(t),value:e,inclusive:!1})}function sk(e,t){return new ac({check:"less_than",...iY(t),value:e,inclusive:!0})}function sz(e,t){return new al({check:"greater_than",...iY(t),value:e,inclusive:!1})}function sS(e,t){return new al({check:"greater_than",...iY(t),value:e,inclusive:!0})}function sE(e){return sz(0,e)}function sA(e){return sw(0,e)}function sx(e){return sk(0,e)}function sT(e){return sS(0,e)}function sj(e,t){return new ap({check:"multiple_of",...iY(t),value:e})}function sO(e,t){return new am({check:"max_size",...iY(t),maximum:e})}function sP(e,t){return new a_({check:"min_size",...iY(t),minimum:e})}function sI(e,t){return new ag({check:"size_equals",...iY(t),size:e})}function s$(e,t){return new ab({check:"max_length",...iY(t),maximum:e})}function sM(e,t){return new ay({check:"min_length",...iY(t),minimum:e})}function sC(e,t){return new av({check:"length_equals",...iY(t),length:e})}function sN(e,t){return new ak({check:"string_format",format:"regex",...iY(t),pattern:e})}function sR(e){return new az({check:"string_format",format:"lowercase",...iY(e)})}function sL(e){return new aS({check:"string_format",format:"uppercase",...iY(e)})}function sZ(e,t){return new aE({check:"string_format",format:"includes",...iY(t),includes:e})}function sD(e,t){return new aA({check:"string_format",format:"starts_with",...iY(t),prefix:e})}function sU(e,t){return new ax({check:"string_format",format:"ends_with",...iY(t),suffix:e})}function sF(e,t,n){return new aj({check:"property",property:e,schema:t,...iY(n)})}function sH(e,t){return new aO({check:"mime_type",mime:e,...iY(t)})}function sJ(e){return new aP({check:"overwrite",tx:e})}function sB(e){return sJ(t=>t.normalize(e))}function sV(){return sJ(e=>e.trim())}function sG(){return sJ(e=>e.toLowerCase())}function sW(){return sJ(e=>e.toUpperCase())}function sq(){return sJ(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,""))}function sK(e,t,n,r={}){let i=iY(r),o={...iY(r),check:"string_format",type:"string",format:t,fn:"function"==typeof n?n:e=>n.test(e),...i};return n instanceof RegExp&&(o.pattern=n),new e(o)}function sX(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??u5,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function sY(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);let u=e._zod.toJSONSchema?.();if(u)a.schema=u;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,r);else{let n=a.schema,o=t.processors[i.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);o(e,t,n,r)}let o=e._zod.parent;o&&(a.ref||(a.ref=o),sY(o,t,r),t.seen.get(o).isParent=!0)}let s=t.metadataRegistry.get(e);return s&&Object.assign(a.schema,s),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,r);if("set"===i.type)return e(i.valueType,r);if("lazy"===i.type)return e(i.getter(),r);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type)return e(i.innerType,r);if("intersection"===i.type)return e(i.left,r)||e(i.right,r);if("record"===i.type||"map"===i.type)return e(i.keyType,r)||e(i.valueType,r);if("pipe"===i.type)return e(i.in,r)||e(i.out,r);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],r))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,r))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,r))return!0;if(i.rest&&e(i.rest,r))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function sQ(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:i,defId:o}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${i("__shared")}#/${r}/${o}`}}if(t[1]===n)return{ref:"#"};let i=`#/${r}/`,o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:i+o}})(t);r.def={...r.schema},o&&(r.defId=o);let a=r.schema;for(let e in a)delete a[e];a.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
168
|
-
|
|
169
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){i(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&"ref"===e.reused){i(n);continue}}}function s0(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let i=n.def??n.schema,o={...i},a=n.ref;if(n.ref=null,a){r(a);let n=e.seen.get(a),u=n.schema;if(u.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(u)):Object.assign(i,u),Object.assign(i,o),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in o||delete i[e]);if(u.$ref&&n.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let u=t._zod.parent;if(u&&u!==a){r(u);let t=e.seen.get(u);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&("draft-2020-12"===e.target?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:s3(t,"input",e.processors),output:s3(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let s3=(e,t,n={})=>r=>{let{libraryOptions:i,target:o}=r??{},a=sX({...i??{},target:o,io:t,processors:n});return sY(e,a),sQ(a,e),s0(a,e)},s8={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s1=(e,t,n,r)=>{let i=e._zod.def,o=!1===i.inclusive,a=i.options.map((e,n)=>sY(e,t,{...r,path:[...r.path,o?"oneOf":"anyOf",n]}));o?n.oneOf=a:n.anyOf=a},s2=(e,t,n,r)=>{let i=e._zod.def;sY(i.innerType,t,r),t.seen.get(e).ref=i.innerType},s6=ix("ZodISODateTime",(e,t)=>{aW.init(e,t),dk.init(e,t)});function s4(e){return new s6({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...iY(e)})}let s9=ix("ZodISODate",(e,t)=>{aq.init(e,t),dk.init(e,t)});function s5(e){return new s9({type:"string",format:"date",check:"string_format",...iY(e)})}let s7=ix("ZodISOTime",(e,t)=>{aK.init(e,t),dk.init(e,t)});function de(e){return new s7({type:"string",format:"time",check:"string_format",precision:null,...iY(e)})}let dt=ix("ZodISODuration",(e,t)=>{aX.init(e,t),dk.init(e,t)});function dn(e){return new dt({type:"string",format:"duration",check:"string_format",...iY(e)})}let dr=(e,t)=>{oe.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>r({issues:e}));else if("invalid_key"===i.code)r({issues:i.issues});else if("invalid_element"===i.code)r({issues:i.issues});else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,iM,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,iM,2)}},isEmpty:{get:()=>0===e.issues.length}})};ix("ZodError",dr);let di=ix("ZodError",dr,{Parent:Error}),da=on(di),du=oi(di),ds=oa(di),dd=os(di),dc=(e,t,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return on(di)(e,t,r)},dl=(e,t,n)=>on(di)(e,t,n),dp=async(e,t,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return oi(di)(e,t,r)},df=async(e,t,n)=>oi(di)(e,t,n),dh=(e,t,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return oa(di)(e,t,r)},dm=(e,t,n)=>oa(di)(e,t,n),d_=async(e,t,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return os(di)(e,t,r)},dg=async(e,t,n)=>os(di)(e,t,n),db=ix("ZodType",(e,t)=>(aM.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:s3(e,"input"),output:s3(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{let r=sX({...n,processors:t});return sY(e,r),sQ(r,e),s0(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(iU(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>iX(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>da(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ds(e,t,n),e.parseAsync=async(t,n)=>du(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>dd(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>dc(e,t,n),e.decode=(t,n)=>dl(e,t,n),e.encodeAsync=async(t,n)=>dp(e,t,n),e.decodeAsync=async(t,n)=>df(e,t,n),e.safeEncode=(t,n)=>dh(e,t,n),e.safeDecode=(t,n)=>dm(e,t,n),e.safeEncodeAsync=async(t,n)=>d_(e,t,n),e.safeDecodeAsync=async(t,n)=>dg(e,t,n),e.refine=(t,n)=>e.check(lB(t,n)),e.superRefine=t=>e.check(lV(t)),e.overwrite=t=>e.check(sJ(t)),e.optional=()=>lc(e),e.exactOptional=()=>lp(e),e.nullable=()=>lh(e),e.nullish=()=>lc(lh(e)),e.nonoptional=t=>lw(e,t),e.array=()=>cD(e),e.or=t=>cG([e,t]),e.and=t=>cQ(e,t),e.transform=t=>lj(e,ls(t)),e.default=t=>lg(e,t),e.prefault=t=>ly(e,t),e.catch=t=>lE(e,t),e.pipe=t=>lj(e,t),e.readonly=()=>l$(e),e.describe=t=>{let n=e.clone();return u5.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>u5.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return u5.get(e);let n=e.clone();return u5.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),dy=ix("_ZodString",(e,t)=>{aC.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{n.type="string";let{minimum:i,maximum:o,format:a,patterns:u,contentEncoding:s}=e._zod.bag;if("number"==typeof i&&(n.minLength=i),"number"==typeof o&&(n.maxLength=o),a&&(n.format=s8[a]??a,""===n.format&&delete n.format,"time"===a&&delete n.format),s&&(n.contentEncoding=s),u&&u.size>0){let e=[...u];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n,0);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(sN(...t)),e.includes=(...t)=>e.check(sZ(...t)),e.startsWith=(...t)=>e.check(sD(...t)),e.endsWith=(...t)=>e.check(sU(...t)),e.min=(...t)=>e.check(sM(...t)),e.max=(...t)=>e.check(s$(...t)),e.length=(...t)=>e.check(sC(...t)),e.nonempty=(...t)=>e.check(sM(1,...t)),e.lowercase=t=>e.check(sR(t)),e.uppercase=t=>e.check(sL(t)),e.trim=()=>e.check(sV()),e.normalize=(...t)=>e.check(sB(...t)),e.toLowerCase=()=>e.check(sG()),e.toUpperCase=()=>e.check(sW()),e.slugify=()=>e.check(sq())}),dv=ix("ZodString",(e,t)=>{aC.init(e,t),dy.init(e,t),e.email=t=>e.check(u7(dz,t)),e.url=t=>e.check(so(dI,t)),e.jwt=t=>e.check(sv(ct,t)),e.emoji=t=>e.check(sa(dC,t)),e.guid=t=>e.check(se(dE,t)),e.uuid=t=>e.check(st(dx,t)),e.uuidv4=t=>e.check(sn(dx,t)),e.uuidv6=t=>e.check(sr(dx,t)),e.uuidv7=t=>e.check(si(dx,t)),e.nanoid=t=>e.check(su(dR,t)),e.guid=t=>e.check(se(dE,t)),e.cuid=t=>e.check(ss(dZ,t)),e.cuid2=t=>e.check(sd(dU,t)),e.ulid=t=>e.check(sc(dH,t)),e.base64=t=>e.check(sg(d6,t)),e.base64url=t=>e.check(sb(d9,t)),e.xid=t=>e.check(sl(dB,t)),e.ksuid=t=>e.check(sp(dG,t)),e.ipv4=t=>e.check(sf(dq,t)),e.ipv6=t=>e.check(sh(dQ,t)),e.cidrv4=t=>e.check(sm(d3,t)),e.cidrv6=t=>e.check(s_(d1,t)),e.e164=t=>e.check(sy(d7,t)),e.datetime=t=>e.check(s4(t)),e.date=t=>e.check(s5(t)),e.time=t=>e.check(de(t)),e.duration=t=>e.check(dn(t))});function dw(e){return new dv({type:"string",...iY(e)})}let dk=ix("ZodStringFormat",(e,t)=>{aN.init(e,t),dy.init(e,t)}),dz=ix("ZodEmail",(e,t)=>{aZ.init(e,t),dk.init(e,t)});function dS(e){return u7(dz,e)}let dE=ix("ZodGUID",(e,t)=>{aR.init(e,t),dk.init(e,t)});function dA(e){return se(dE,e)}let dx=ix("ZodUUID",(e,t)=>{aL.init(e,t),dk.init(e,t)});function dT(e){return st(dx,e)}function dj(e){return sn(dx,e)}function dO(e){return sr(dx,e)}function dP(e){return si(dx,e)}let dI=ix("ZodURL",(e,t)=>{aD.init(e,t),dk.init(e,t)});function d$(e){return so(dI,e)}function dM(e){return so(dI,{protocol:/^https?$/,hostname:oL,...iY(e)})}let dC=ix("ZodEmoji",(e,t)=>{aU.init(e,t),dk.init(e,t)});function dN(e){return sa(dC,e)}let dR=ix("ZodNanoID",(e,t)=>{aF.init(e,t),dk.init(e,t)});function dL(e){return su(dR,e)}let dZ=ix("ZodCUID",(e,t)=>{aH.init(e,t),dk.init(e,t)});function dD(e){return ss(dZ,e)}let dU=ix("ZodCUID2",(e,t)=>{aJ.init(e,t),dk.init(e,t)});function dF(e){return sd(dU,e)}let dH=ix("ZodULID",(e,t)=>{aB.init(e,t),dk.init(e,t)});function dJ(e){return sc(dH,e)}let dB=ix("ZodXID",(e,t)=>{aV.init(e,t),dk.init(e,t)});function dV(e){return sl(dB,e)}let dG=ix("ZodKSUID",(e,t)=>{aG.init(e,t),dk.init(e,t)});function dW(e){return sp(dG,e)}let dq=ix("ZodIPv4",(e,t)=>{aY.init(e,t),dk.init(e,t)});function dK(e){return sf(dq,e)}let dX=ix("ZodMAC",(e,t)=>{a0.init(e,t),dk.init(e,t)});function dY(e){return new dX({type:"string",format:"mac",check:"string_format",abort:!1,...iY(e)})}let dQ=ix("ZodIPv6",(e,t)=>{aQ.init(e,t),dk.init(e,t)});function d0(e){return sh(dQ,e)}let d3=ix("ZodCIDRv4",(e,t)=>{a3.init(e,t),dk.init(e,t)});function d8(e){return sm(d3,e)}let d1=ix("ZodCIDRv6",(e,t)=>{a8.init(e,t),dk.init(e,t)});function d2(e){return s_(d1,e)}let d6=ix("ZodBase64",(e,t)=>{a2.init(e,t),dk.init(e,t)});function d4(e){return sg(d6,e)}let d9=ix("ZodBase64URL",(e,t)=>{a6.init(e,t),dk.init(e,t)});function d5(e){return sb(d9,e)}let d7=ix("ZodE164",(e,t)=>{a4.init(e,t),dk.init(e,t)});function ce(e){return sy(d7,e)}let ct=ix("ZodJWT",(e,t)=>{a9.init(e,t),dk.init(e,t)});function cn(e){return sv(ct,e)}let cr=ix("ZodCustomStringFormat",(e,t)=>{a5.init(e,t),dk.init(e,t)});function ci(e,t,n={}){return sK(cr,e,t,n)}function co(e){return sK(cr,"hostname",oR,e)}function ca(e){return sK(cr,"hex",o0,e)}function cu(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,i=A[r];if(!i)throw Error(`Unrecognized hash format: ${r}`);return sK(cr,r,i,t)}let cs=ix("ZodNumber",(e,t)=>{a7.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let{minimum:i,maximum:o,format:a,multipleOf:u,exclusiveMaximum:s,exclusiveMinimum:d}=e._zod.bag;"string"==typeof a&&a.includes("int")?n.type="integer":n.type="number","number"==typeof d&&("draft-04"===t.target||"openapi-3.0"===t.target?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d),"number"==typeof i&&(n.minimum=i,"number"==typeof d&&"draft-04"!==t.target&&(d>=i?delete n.minimum:delete n.exclusiveMinimum)),"number"==typeof s&&("draft-04"===t.target||"openapi-3.0"===t.target?(n.maximum=s,n.exclusiveMaximum=!0):n.exclusiveMaximum=s),"number"==typeof o&&(n.maximum=o,"number"==typeof s&&"draft-04"!==t.target&&(s<=o?delete n.maximum:delete n.exclusiveMaximum)),"number"==typeof u&&(n.multipleOf=u)})(e,t,n,0),e.gt=(t,n)=>e.check(sz(t,n)),e.gte=(t,n)=>e.check(sS(t,n)),e.min=(t,n)=>e.check(sS(t,n)),e.lt=(t,n)=>e.check(sw(t,n)),e.lte=(t,n)=>e.check(sk(t,n)),e.max=(t,n)=>e.check(sk(t,n)),e.int=t=>e.check(cl(t)),e.safe=t=>e.check(cl(t)),e.positive=t=>e.check(sz(0,t)),e.nonnegative=t=>e.check(sS(0,t)),e.negative=t=>e.check(sw(0,t)),e.nonpositive=t=>e.check(sk(0,t)),e.multipleOf=(t,n)=>e.check(sj(t,n)),e.step=(t,n)=>e.check(sj(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function cd(e){return new cs({type:"number",checks:[],...iY(e)})}let cc=ix("ZodNumberFormat",(e,t)=>{ue.init(e,t),cs.init(e,t)});function cl(e){return new cc({type:"number",check:"number_format",abort:!1,format:"safeint",...iY(e)})}function cp(e){return new cc({type:"number",check:"number_format",abort:!1,format:"float32",...iY(e)})}function cf(e){return new cc({type:"number",check:"number_format",abort:!1,format:"float64",...iY(e)})}function ch(e){return new cc({type:"number",check:"number_format",abort:!1,format:"int32",...iY(e)})}function cm(e){return new cc({type:"number",check:"number_format",abort:!1,format:"uint32",...iY(e)})}let c_=ix("ZodBoolean",(e,t)=>{ut.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function cg(e){return new c_({type:"boolean",...iY(e)})}let cb=ix("ZodBigInt",(e,t)=>{un.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")})(0,e,0,0),e.gte=(t,n)=>e.check(sS(t,n)),e.min=(t,n)=>e.check(sS(t,n)),e.gt=(t,n)=>e.check(sz(t,n)),e.gte=(t,n)=>e.check(sS(t,n)),e.min=(t,n)=>e.check(sS(t,n)),e.lt=(t,n)=>e.check(sw(t,n)),e.lte=(t,n)=>e.check(sk(t,n)),e.max=(t,n)=>e.check(sk(t,n)),e.positive=t=>e.check(sz(BigInt(0),t)),e.negative=t=>e.check(sw(BigInt(0),t)),e.nonpositive=t=>e.check(sk(BigInt(0),t)),e.nonnegative=t=>e.check(sS(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(sj(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function cy(e){return new cb({type:"bigint",...iY(e)})}let cv=ix("ZodBigIntFormat",(e,t)=>{ur.init(e,t),cb.init(e,t)});function cw(e){return new cv({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...iY(e)})}function ck(e){return new cv({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...iY(e)})}let cz=ix("ZodSymbol",(e,t)=>{ui.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema")})(0,e,0,0)});function cS(e){return new cz({type:"symbol",...iY(e)})}let cE=ix("ZodUndefined",(e,t)=>{uo.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema")})(0,e,0,0)});function cA(e){return new cE({type:"undefined",...iY(e)})}let cx=ix("ZodNull",(e,t)=>{ua.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{"openapi-3.0"===e.target?(t.type="string",t.nullable=!0,t.enum=[null]):t.type="null"}});function cT(e){return new cx({type:"null",...iY(e)})}let cj=ix("ZodAny",(e,t)=>{uu.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function cO(){return new cj({type:"any"})}let cP=ix("ZodUnknown",(e,t)=>{us.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function cI(){return new cP({type:"unknown"})}let c$=ix("ZodNever",(e,t)=>{ud.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}});function cM(e){return new c$({type:"never",...iY(e)})}let cC=ix("ZodVoid",(e,t)=>{uc.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Void cannot be represented in JSON Schema")})(0,e,0,0)});function cN(e){return new cC({type:"void",...iY(e)})}let cR=ix("ZodDate",(e,t)=>{ul.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")})(0,e,0,0),e.min=(t,n)=>e.check(sS(t,n)),e.max=(t,n)=>e.check(sk(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function cL(e){return new cR({type:"date",...iY(e)})}let cZ=ix("ZodArray",(e,t)=>{uf.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;"number"==typeof o&&(n.minItems=o),"number"==typeof a&&(n.maxItems=a),n.type="array",n.items=sY(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(sM(t,n)),e.nonempty=t=>e.check(sM(1,t)),e.max=(t,n)=>e.check(s$(t,n)),e.length=(t,n)=>e.check(sC(t,n)),e.unwrap=()=>e.element});function cD(e,t){return new cZ({type:"array",element:e,...iY(t)})}function cU(e){return lt(Object.keys(e._zod.def.shape))}let cF=ix("ZodObject",(e,t)=>{ub.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;n.type="object",n.properties={};let o=i.shape;for(let e in o)n.properties[e]=sY(o[e],t,{...r,path:[...r.path,"properties",e]});let a=new Set([...new Set(Object.keys(o))].filter(e=>{let n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));a.size>0&&(n.required=Array.from(a)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=sY(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),iZ(e,"shape",()=>t.shape),e.keyof=()=>lt(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:cI()}),e.loose=()=>e.clone({...e._zod.def,catchall:cI()}),e.strict=()=>e.clone({...e._zod.def,catchall:cM()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>(function(e,t){if(!iV(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=iU(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return iD(this,"shape",n),n}});return iX(e,r)})(e,t),e.safeExtend=t=>(function(e,t){if(!iV(t))throw Error("Invalid input to safeExtend: expected a plain object");let n=iU(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return iD(this,"shape",n),n}});return iX(e,n)})(e,t),e.merge=t=>{let n;return n=iU(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return iD(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]}),iX(e,n)},e.pick=t=>(function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=iU(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return iD(this,"shape",e),e},checks:[]});return iX(e,i)})(e,t),e.omit=t=>(function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=iU(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return iD(this,"shape",r),r},checks:[]});return iX(e,i)})(e,t),e.partial=(...t)=>(function(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=iU(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return iD(this,"shape",i),i},checks:[]});return iX(t,i)})(ld,e,t[0]),e.required=(...t)=>{var n;let r;return n=t[0],r=iU(e._zod.def,{get shape(){let t=e._zod.def.shape,r={...t};if(n)for(let e in n){if(!(e in r))throw Error(`Unrecognized key: "${e}"`);n[e]&&(r[e]=new lv({type:"nonoptional",innerType:t[e]}))}else for(let e in t)r[e]=new lv({type:"nonoptional",innerType:t[e]});return iD(this,"shape",r),r}}),iX(e,r)}});function cH(e,t){return new cF({type:"object",shape:e??{},...iY(t)})}function cJ(e,t){return new cF({type:"object",shape:e,catchall:cM(),...iY(t)})}function cB(e,t){return new cF({type:"object",shape:e,catchall:cI(),...iY(t)})}let cV=ix("ZodUnion",(e,t)=>{uv.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>s1(e,t,n,r),e.options=t.options});function cG(e,t){return new cV({type:"union",options:e,...iY(t)})}let cW=ix("ZodXor",(e,t)=>{cV.init(e,t),uk.init(e,t),e._zod.processJSONSchema=(t,n,r)=>s1(e,t,n,r),e.options=t.options});function cq(e,t){return new cW({type:"union",options:e,inclusive:!1,...iY(t)})}let cK=ix("ZodDiscriminatedUnion",(e,t)=>{cV.init(e,t),uz.init(e,t)});function cX(e,t,n){return new cK({type:"union",options:t,discriminator:e,...iY(n)})}let cY=ix("ZodIntersection",(e,t)=>{uS.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a,u;return o=sY((i=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),a=sY(i.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=[...(u=e=>"allOf"in e&&1===Object.keys(e).length)(o)?o.allOf:[o],...u(a)?a.allOf:[a]])}});function cQ(e,t){return new cY({type:"intersection",left:e,right:t})}let c0=ix("ZodTuple",(e,t)=>{uA.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;n.type="array";let o="draft-2020-12"===t.target?"prefixItems":"items",a="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",u=i.items.map((e,n)=>sY(e,t,{...r,path:[...r.path,o,n]})),s=i.rest?sY(i.rest,t,{...r,path:[...r.path,a,..."openapi-3.0"===t.target?[i.items.length]:[]]}):null;"draft-2020-12"===t.target?(n.prefixItems=u,s&&(n.items=s)):"openapi-3.0"===t.target?(n.items={anyOf:u},s&&n.items.anyOf.push(s),n.minItems=u.length,s||(n.maxItems=u.length)):(n.items=u,s&&(n.additionalItems=s));let{minimum:d,maximum:c}=e._zod.bag;"number"==typeof d&&(n.minItems=d),"number"==typeof c&&(n.maxItems=c)})(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function c3(e,t,n){let r=t instanceof aM,i=r?n:t;return new c0({type:"tuple",items:e,rest:r?t:null,...iY(i)})}let c8=ix("ZodRecord",(e,t)=>{uT.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;n.type="object";let o=i.keyType,a=o._zod.bag,u=a?.patterns;if("loose"===i.mode&&u&&u.size>0){let e=sY(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});for(let t of(n.patternProperties={},u))n.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(n.propertyNames=sY(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=sY(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let s=o._zod.values;if(s){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(n.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function c1(e,t,n){return new c8({type:"record",keyType:e,valueType:t,...iY(n)})}function c2(e,t,n){let r=iX(e);return r._zod.values=void 0,new c8({type:"record",keyType:r,valueType:t,...iY(n)})}function c6(e,t,n){return new c8({type:"record",keyType:e,valueType:t,mode:"loose",...iY(n)})}let c4=ix("ZodMap",(e,t)=>{uj.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Map cannot be represented in JSON Schema")})(0,e,0,0),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(sP(...t)),e.nonempty=t=>e.check(sP(1,t)),e.max=(...t)=>e.check(sO(...t)),e.size=(...t)=>e.check(sI(...t))});function c9(e,t,n){return new c4({type:"map",keyType:e,valueType:t,...iY(n)})}let c5=ix("ZodSet",(e,t)=>{uP.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Set cannot be represented in JSON Schema")})(0,e,0,0),e.min=(...t)=>e.check(sP(...t)),e.nonempty=t=>e.check(sP(1,t)),e.max=(...t)=>e.check(sO(...t)),e.size=(...t)=>e.check(sI(...t))});function c7(e,t){return new c5({type:"set",valueType:e,...iY(t)})}let le=ix("ZodEnum",(e,t)=>{u$.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;(i=iI(e._zod.def.entries)).every(e=>"number"==typeof e)&&(n.type="number"),i.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=i},e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new le({...t,checks:[],...iY(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new le({...t,checks:[],...iY(r),entries:i})}});function lt(e,t){return new le({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...iY(t)})}function ln(e,t){return new le({type:"enum",entries:e,...iY(t)})}let lr=ix("ZodLiteral",(e,t)=>{uM.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,o=[];for(let e of i.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else o.push(Number(e));else o.push(e);if(0===o.length);else if(1===o.length){let e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(e,t,n,0),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function li(e,t){return new lr({type:"literal",values:Array.isArray(e)?e:[e],...iY(t)})}let lo=ix("ZodFile",(e,t)=>{uC.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:a,mime:u}=e._zod.bag;void 0!==o&&(i.minLength=o),void 0!==a&&(i.maxLength=a),u?1===u.length?(i.contentMediaType=u[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=u.map(e=>({contentMediaType:e}))):Object.assign(n,i)})(e,0,n,0),e.min=(t,n)=>e.check(sP(t,n)),e.max=(t,n)=>e.check(sO(t,n)),e.mime=(t,n)=>e.check(sH(Array.isArray(t)?t:[t],n))});function la(e){return new lo({type:"file",...iY(e)})}let lu=ix("ZodTransform",(e,t)=>{uN.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,e,0,0),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ij(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(i5(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(i5(r)))};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function ls(e){return new lu({type:"transform",transform:e})}let ld=ix("ZodOptional",(e,t)=>{uL.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>s2(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lc(e){return new ld({type:"optional",innerType:e})}let ll=ix("ZodExactOptional",(e,t)=>{uZ.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>s2(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lp(e){return new ll({type:"optional",innerType:e})}let lf=ix("ZodNullable",(e,t)=>{uD.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=sY((i=e._zod.def).innerType,t,r),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function lh(e){return new lf({type:"nullable",innerType:e})}function lm(e){return lc(lh(e))}let l_=ix("ZodDefault",(e,t)=>{uU.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;sY((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function lg(e,t){return new l_({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():iG(t)}})}let lb=ix("ZodPrefault",(e,t)=>{uH.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;sY((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},e.unwrap=()=>e._zod.def.innerType});function ly(e,t){return new lb({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():iG(t)}})}let lv=ix("ZodNonOptional",(e,t)=>{uJ.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;sY((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType});function lw(e,t){return new lv({type:"nonoptional",innerType:e,...iY(t)})}let lk=ix("ZodSuccess",(e,t)=>{uV.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"},e.unwrap=()=>e._zod.def.innerType});function lz(e){return new lk({type:"success",innerType:e})}let lS=ix("ZodCatch",(e,t)=>{uG.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i,o=e._zod.def;sY(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lE(e,t){return new lS({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}let lA=ix("ZodNaN",(e,t)=>{uW.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("NaN cannot be represented in JSON Schema")})(0,e,0,0)});function lx(e){return new lA({type:"nan",...iY(e)})}let lT=ix("ZodPipe",(e,t)=>{uq.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o;return i=e._zod.def,void(sY(o="input"===t.io?"transform"===i.in._zod.def.type?i.out:i.in:i.out,t,r),t.seen.get(e).ref=o)},e.in=t.in,e.out=t.out});function lj(e,t){return new lT({type:"pipe",in:e,out:t})}let lO=ix("ZodCodec",(e,t)=>{lT.init(e,t),uX.init(e,t)});function lP(e,t,n){return new lO({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}let lI=ix("ZodReadonly",(e,t)=>{u0.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;sY((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType});function l$(e){return new lI({type:"readonly",innerType:e})}let lM=ix("ZodTemplateLiteral",(e,t)=>{u8.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.pattern;if(!i)throw Error("Pattern not found in template literal");n.type="string",n.pattern=i.source})(e,0,n,0)});function lC(e,t){return new lM({type:"template_literal",parts:e,...iY(t)})}let lN=ix("ZodLazy",(e,t)=>{u6.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;sY(i=e._zod.innerType,t,r),t.seen.get(e).ref=i},e.unwrap=()=>e._zod.def.getter()});function lR(e){return new lN({type:"lazy",getter:e})}let lL=ix("ZodPromise",(e,t)=>{u2.init(e,t),db.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;sY((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType});function lZ(e){return new lL({type:"promise",innerType:e})}let lD=ix("ZodFunction",(e,t)=>{u1.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Function types cannot be represented in JSON Schema")})(0,e,0,0)});function lU(e){return new lD({type:"function",input:Array.isArray(e?.input)?c3(e?.input):e?.input??cD(cI()),output:e?.output??cI()})}let lF=ix("ZodCustom",(e,t)=>{u4.init(e,t),db.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,e,0,0)});function lH(e){let t=new as({check:"custom"});return t._zod.check=e,t}function lJ(e,t){var n;let r;return n=e??(()=>!0),(r=iY(t)).abort??(r.abort=!0),new lF({type:"custom",check:"custom",fn:n,...r})}function lB(e,t={}){return new lF({type:"custom",check:"custom",fn:e,...iY(t)})}function lV(e){var t;let n,r;return t=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(i5(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(i5(e)))},e(t.value,t)),(r=new as({check:"custom",...iY(void 0)}))._zod.check=t,n=r}let lG=function(e){let t=new as({check:"describe"});return t._zod.onattach=[t=>{let n=u5.get(t)??{};u5.add(t,{...n,description:e})}],t._zod.check=()=>{},t},lW=function(e){let t=new as({check:"meta"});return t._zod.onattach=[t=>{let n=u5.get(t)??{};u5.add(t,{...n,...e})}],t._zod.check=()=>{},t};function lq(e,t={}){let n=new lF({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...iY(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}let lK=(...e)=>(function(e,t){let n=iY(t),r=n.truthy??["true","1","yes","on","y","enabled"],i=n.falsy??["false","0","no","off","n","disabled"];"sensitive"!==n.case&&(r=r.map(e=>"string"==typeof e?e.toLowerCase():e),i=i.map(e=>"string"==typeof e?e.toLowerCase():e));let o=new Set(r),a=new Set(i),u=e.Codec??uX,s=e.Boolean??ut,d=new u({type:"pipe",in:new(e.String??aC)({type:"string",error:n.error}),out:new s({type:"boolean",error:n.error}),transform:(e,t)=>{let r=e;return"sensitive"!==n.case&&(r=r.toLowerCase()),!!o.has(r)||!a.has(r)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:t.value,inst:d,continue:!1}),{})},reverseTransform:(e,t)=>!0===e?r[0]||"true":i[0]||"false",error:n.error});return d})({Codec:lO,Boolean:c_,String:dv},...e);function lX(e){let t=lR(()=>cG([dw(e),cd(),cg(),cT(),cD(t),c1(dw(),t)]));return t}function lY(e,t){return lj(ls(e),t)}E||(E={}),iP({localeError:(c={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},l={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},p={nan:"NaN"},e=>{switch(e.code){case"invalid_type":{let t=p[e.expected]??e.expected,n=function(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}(e.input),r=p[n]??n;return`Invalid input: expected ${t}, received ${r}`}case"invalid_value":if(1===e.values.length)return`Invalid input: expected ${iQ(e.values[0])}`;return`Invalid option: expected one of ${i$(e.values,"|")}`;case"too_big":{let t=e.inclusive?"<=":"<",n=c[e.origin]??null;if(n)return`Too big: expected ${e.origin??"value"} to have ${t}${e.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${e.origin??"value"} to be ${t}${e.maximum.toString()}`}case"too_small":{let t=e.inclusive?">=":">",n=c[e.origin]??null;if(n)return`Too small: expected ${e.origin} to have ${t}${e.minimum.toString()} ${n.unit}`;return`Too small: expected ${e.origin} to be ${t}${e.minimum.toString()}`}case"invalid_format":if("starts_with"===e.format)return`Invalid string: must start with "${e.prefix}"`;if("ends_with"===e.format)return`Invalid string: must end with "${e.suffix}"`;if("includes"===e.format)return`Invalid string: must include "${e.includes}"`;if("regex"===e.format)return`Invalid string: must match pattern ${e.pattern}`;return`Invalid ${l[e.format]??e.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${i$(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`}})});let lQ=({body:e,onError:t,onFinish:n,pageSize:r=10})=>{let[i,o]=(0,N.useState)(),[a,u]=(0,N.useState)(""),s=(0,N.useRef)(0),d=nu(),c=e=>{o(e),e&&t?.(e)},l=(0,N.useRef)(!1),{data:p,loadMoreAsync:f,loadingMore:h,loading:m,mutate:_,error:g}=eS(async e=>{if(l.current=!0,e?.noMore)return{noMore:!0,list:[]};try{let t=await d.ai.chat.message.getPage(e?.cursor,r);s.current=t.conversationVersion;let n=t.messages.at(-1);return console.log(n),n?.isGenerating&&E(n.id,s.current),{cursor:t.nextCursor,list:t.messages,noMore:!t.nextCursor}}finally{l.current=!1}},{direction:"top"}),b=async()=>{if(!l.current)try{l.current=!0,await f()}finally{l.current=!1}},y=p?.list??[],v=L(p),w=(0,N.useRef)(y);w.current=y;let k=e=>{let t;t="function"==typeof e?e(w.current):e,w.current=t,_({...v.current,list:t})},{chatStreaming:z,isStreaming:S,recoverStreaming:E}=(({common:e,setError:t,setMessages:n,getMessages:r,setInput:i,mujian:o,conversationVersion:a})=>{let{body:u}=e,[s,d]=(0,N.useState)(!1);return{chatStreaming:(0,N.useCallback)(async({query:e,regenerate:u,is_continue:s,conversationVersion:c})=>{try{t(void 0),d(!0);let l=r(),p={id:`${iA}_user_${Date.now()}`,isUser:!0,swipes:[{content:e??""}],activeSwipeId:0,isGenerating:!1},f={id:`${iA}_assistant_${Date.now()}`,isUser:!1,swipes:[{content:""}],activeSwipeId:0,isGenerating:!0};u?n(iw(e=>{let t=e[e.length-1];t.activeSwipeId=t.swipes.length,t.swipes.push({content:""}),t.isGenerating=!0})):s?n(e=>[...e,f]):n(e=>[...e,p,f]);let h=iE(o,e||"",s?"continue":u?"regenerate":"generate",c);try{for await(let e of h){if(!e)return;"meta"===e.type?(u||n(iw(t=>{s||(t[t.length-2].id=e.userMsgId),t[t.length-1].id=e.assisMsgId})),a.current=e.newConversationVersion):"data"===e.type&&(n(iw(t=>{let n=t[t.length-1];n.swipes[n.activeSwipeId]={content:e.content,mjv:e.mjv},e.finishReason&&(n.finishReason=e.finishReason),e.error&&(n.error=e.error)})),await new Promise(e=>setTimeout(e,10)))}}catch(r){tS.e("Stream error",r),"object"==typeof r&&r&&"message"in r&&"string"==typeof r.message?"code"in r&&0x77dde1f1===r.code?(n(l),u||s||!e||i(e)):iz(r.message)?t(new iS("E_NETWORK_ERROR")):t(new iS(r.message)):t(r)}finally{n(iw(e=>{e[e.length-1].isGenerating=!1}))}}catch(e){console.error("Error:",e),t(new iS("Send message failed",e)),n(e=>e.slice(0,-1))}finally{d(!1)}},[u,o]),isStreaming:s,recoverStreaming:(0,N.useCallback)(async(e,r)=>{let i=iE(o,"","recover",r,e);try{for await(let t of i){if(!t)return;"data"===t.type&&n(iw(n=>{let r=n.find(t=>t.id===e);r&&(r.swipes[r.activeSwipeId]={content:t.content,mjv:t.mjv},t.finishReason&&(r.finishReason=t.finishReason),t.error&&(r.error=t.error))}))}}catch(e){tS.e("Stream error",e),"object"==typeof e&&e&&"message"in e&&"string"==typeof e.message?iz(e.message)?t(new iS("E_NETWORK_ERROR")):t(new iS(e.message)):t(e)}finally{console.log("finally"),n(iw(t=>{let n=t.find(t=>t.id===e);console.log("finally",n),n&&(n.isGenerating=!1)}))}},[o])}})({common:{body:e},setError:c,setMessages:k,getMessages:(0,N.useCallback)(()=>w.current,[w]),setInput:u,mujian:d,conversationVersion:s});G(()=>{if(!S){let e=y[y.length-1];n?.(e)}},[S]);let A=(0,N.useCallback)(async e=>{if(S)throw Error("useChat is streaming already.");try{await z({query:e,conversationVersion:s.current})}catch(e){throw c(e),e}},[S,z]),x=(0,N.useCallback)(async()=>{if(S)throw Error("useChat is streaming already.");let e=y.findLast(e=>e.isUser);try{let t=e?e.swipes[e.activeSwipeId].content:"";await z({query:t,regenerate:!0,conversationVersion:s.current})}catch(e){throw c(e),e}},[S,y,z]),T=(0,N.useCallback)(async()=>{if(S)throw Error("useChat is streaming already.");try{await z({query:"",is_continue:!0,conversationVersion:s.current})}catch(e){throw c(e),e}},[S,z]),j=async(e,t)=>{if(t<0)return;k(n=>n.map(n=>n.id===e&&t<n.swipes.length?{...n,activeSwipeId:t}:n));let n=await d.ai.chat.message.swipe(e,t),{data:r,success:i}=cH({newConversationVersion:cd()}).safeParse(n);i&&r.newConversationVersion&&(s.current=r.newConversationVersion)},O=async(e,t)=>{let n=await d.ai.chat.message.editOne(e,t),{data:r,success:i}=cH({newConversationVersion:cd()}).safeParse(n);i&&r.newConversationVersion&&(s.current=r.newConversationVersion),k(n=>n.map(n=>{let r;return n.id===e?((r={...n,content:t}).isUser||(r.swipes=[...r.swipes],r.swipes[r.activeSwipeId].content=t),r):n}))},P=async e=>{if(!e.startsWith(iA))try{let t=await d.ai.chat.message.deleteOne(e),{data:n,success:r}=cH({newConversationVersion:cd()}).safeParse(t);r&&n.newConversationVersion&&(s.current=n.newConversationVersion)}catch(e){if(e?.code!==0x77dde1f4)throw e}k(t=>t.filter(t=>t.id!==e))};return{append:A,regenerate:x,continueGenerate:T,stop:()=>{let e=y.at(-1)?.id;e&&d.ai.chat.stop(s.current,e)},messages:y,status:i?"error":S?"streaming":"ready",error:i,setMessages:k,input:a,setInput:u,handleSubmit:()=>{A(a)},setSwipe:j,editMessage:O,deleteMessage:P,loadMoreMessage:b,messagesStatus:g?"error":h||m?"loading":p?.noMore?"all-loaded":"has-more"}}})(),i})());
|
|
169
|
+
`,dO={width:48,height:48,animation:"spin 1s linear infinite"},dP=({className:e,style:t})=>(0,uY.jsxs)(uY.Fragment,{children:[(0,uY.jsx)("style",{children:dj}),(0,uY.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,style:{...dO,...t},children:(0,uY.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})]}),dI=(0,N.createContext)(null),d$=(0,N.createContext)(null),dM=({children:e,loadingComponent:t})=>{let[n,r]=(0,N.useState)(null),[i,o]=(0,N.useState)(0);return(0,N.useEffect)(()=>{(async()=>{let e=dT.getInstance();await e.init(),r(e)})()},[]),(0,uY.jsx)(dI.Provider,{value:n,children:(0,uY.jsx)(d$.Provider,{value:{messageTypeWritingCount:i,updateMessageTypeWritingCount(e){o(t=>Math.max(t+("add"===e?1:-1),0))}},children:n?e:t??(0,uY.jsx)("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:(0,uY.jsx)(dP,{style:{color:"#EC4342"}})})})})},dC=()=>{let e=(0,N.useContext)(dI);if(!e){let e="Mujian is not initialized. Please check that useMujian is called inside MujianProvider";throw console.error(e),Error(e)}return e},dN=()=>{let e=(0,N.useContext)(d$);if(!e){let e="Context is not initialized. Please check that useChatContext is called inside MujianProvider";throw console.error(e),Error(e)}return e};var dR=r("../../common/temp/node_modules/.pnpm/react-dom@19.1.5_react@19.1.5/node_modules/react-dom/index.js"),{min:dL,max:dZ,abs:dD,floor:dU}=Math,dF=(e,t,n)=>dL(n,dZ(t,e)),dH=e=>[...e].sort((e,t)=>e-t),dJ=setTimeout,dB=clearTimeout,dV="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)},dG=()=>{let e;return[new Promise(t=>{e=t}),e]},dW="undefined"!=typeof window,dq=(b=()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>0,()=>(b&&(d=b(),b=void 0),d)),dK=(e,t,n,r=0,i=t-1)=>{let o=r;for(;r<=i;){let t=dU((r+i)/2);e(t)<=n?(o=t,r=t+1):i=t-1}return dF(o,0,t-1)},dX=(e,t,n)=>{let r=n?"unshift":"push";for(let n=0;n<t;n++)e[r](-1);return e},dY=(e,t)=>t?-e:e,dQ=(e,t)=>{e.V(()=>t)},d0=dW?N.useLayoutEffect:N.useEffect,d3="current",d8=(e,t)=>{if(Array.isArray(e))for(let n of e)d8(n,t);else null==e||"boolean"==typeof e||t.push(e)},d1=e=>{let t=(0,N.useRef)(e);return d0(()=>{t[d3]=e},[e]),t},d2=(0,N.memo)(({N:e,Z:t,ee:n,te:r,ne:i,oe:o,re:a,ie:u})=>{let s=(0,N.useRef)(null);d0(()=>t(s[d3],n),[n]);let d=(0,N.useMemo)(()=>{let e={contain:"layout style",position:i&&u?void 0:"absolute",[a?"height":"width"]:"100%",[a?"top":"left"]:0,[a?"insetInlineStart":"top"]:r,visibility:!i||u?void 0:"hidden"};return a&&(e.display="inline-flex"),e},[r,i,u,a]);return(0,uY.jsx)(o,"string"==typeof o?{ref:s,style:d,children:e}:{ref:s,style:d,index:n,children:e})}),d6=(0,N.forwardRef)(({children:e,data:t,bufferSize:n,itemSize:r,shift:i,horizontal:o,keepMounted:a,cache:u,startMargin:s=0,ssrCount:d,as:c="div",item:l="div",scrollRef:p,onScroll:f,onScrollEnd:h},m)=>{var _;let g,[b,y]=(0,N.useMemo)(()=>{let n;if("function"==typeof e)return[n=>e(t[n],n),t.length];let r=(d8(e,n=[]),n);return[e=>r[e],r.length]},[e,t]),v=(0,N.useRef)(null),w=(0,N.useRef)(!!d),k=d1(f),z=d1(h),[S,E,A,x]=(_=()=>{var e;let t,n,i,a,s,c,l,p,f=!!o,h=(e=y,t=u&&u[1]||r||40,n=-1,i=0,s=(a=u&&u[0])?dX(a.slice(0,dL(e,a.length)),dZ(0,e-a.length)):dX([],e),c=dX([],e+1),l=e=>{let n=s[e];return -1===n?t:n},{i:(t,n)=>{let r,o;return p(i=dL(i,e-1))<=t?(o=dK(p,e,n,i),r=dK(p,e,t,i,o)):(r=dK(p,e,t,void 0,i),o=dK(p,e,n,r)),i=r,[r,o]},l:t=>dK(p,e,t),u:p=t=>{if(!e)return 0;if(n>=t)return c[t];n<0&&(c[0]=0,n=0);let r=n,i=c[r];for(;r<t;)i+=l(r),c[++r]=i;return n=t,i},h:l,v:(e,t)=>{let r=-1===s[e];return s[e]=t,n=dL(e,n),r},p:(e,t=-1)=>s[e]===t,t:()=>p(e),S:()=>e,m:(r,i)=>{let o=r-e;return n=i?-1:dL(r-1,n),e=r,o>0?(dX(c,o),dX(s,o,i),t*o):(c.splice(o),(i?s.splice(0,-o):s.splice(o)).reduce((e,n)=>e-(-1===n?t:n),0))},$:r?void 0:e=>{let r=0,i=[];s.forEach((t,n)=>{-1!==t&&(t&&i.push(t),n<e&&r++)}),n=-1;let o=dH(i),a=o.length,u=a/2|0,d=a%2==0?(o[u-1]+o[u])/2:o[u],c=t;return((t=d)-c)*dZ(e-r,0)},q:()=>[s.slice(),t]}),m=(({i:e,l:t,u:n,h:r,v:i,p:o,t:a,S:u,m:s,$:d},c=0)=>{let l=!!d,p=!!c,f=1,h=0,m=0,_=0,g=0,b=0,y=0,v=0,w=0,k=null,z=[0,p?dZ(c-1,0):-1],S=0,E=!1,A=new Set,x=()=>_-m+b+g,T=e=>n(e)-b,j=e=>{e&&(dq()&&0!==v||k&&1===w?b+=e:g+=e)};return{_:()=>{A.clear()},I:()=>f,i:(t=200)=>{let n,r;if(!E||p)return z;if(y)[n,r]=z;else{let i=dZ(0,x()),o=i+h;l||(t=dZ(0,t),1!==v&&(i-=t),2!==v&&(o+=t)),[n,r]=z=e(dZ(0,i),dZ(0,o)),k&&(n=dL(n,k[0]),r=dZ(r,k[1]))}return[dZ(n,0),dL(r,u()-1)]},k:e=>t(e-m),R:o,u:T,h:r,C:u,T:()=>_,M:()=>0!==v,o:()=>h,O:()=>m,t:a,L:()=>(y=g,g=0,[y,2===w]),H:(e,t)=>{let n=[e,t];return A.add(n),()=>{A.delete(n)}},W:(n,u)=>{let c,z,O=0;switch(n){case 1:{if(u===_&&0===w)break;let e=y;y=0;let t=u-_,n=dD(t);e&&n<dD(e)+1||0!==w||(v=t<0?2:1),p&&(p=!1),_=u,O=4;let r=_-m;r>=-h&&r<=a()&&(O+=1,z=n>h);break}case 2:O=8,0!==v&&(c=!0,O+=1),v=0,w=0,k=null;break;case 3:{let e=u.filter(([e,t])=>!o(e,t));if(!e.length)break;for(let[t,n]of(j(e.reduce((e,[t,n])=>{let i;if(2===w)i=!0;else if(k&&1===w)i=t<k[0];else{let e=_-m,n=T(t),o=r(t);i=1!==v&&0===w?n+o<=e:n<e&&n+o<e+h}return i&&(e+=n-r(t)),e},0)),e)){let e=r(t),o=i(t,n);l&&(S+=o?n:n-e)}l&&h&&S>h&&(j(d(t(x()))),l=!1),O=3,z=!0;break}case 4:h!==u&&(h||(E=z=!0),h=u,O=3);break;case 5:u[1]?(j(s(u[0],!0)),w=2):s(u[0]),O=1;break;case 6:m=u;break;case 7:w=1;break;case 8:k=e(u,u+h),O=1}O&&(f=1+(0x7fffffff&f),c&&b&&(g+=b,b=0),A.forEach(([e,t])=>{O&e&&t(z)}))}}})(h,d);return[m,h,((e,t)=>{var n,r,i;let o,a,u,s,d=dG(),c=!1,l=t?"scrollLeft":"scrollTop",p=t?"left":"top",f=t?"overflowX":"overflowY",[h,m]=(n=()=>d[0],r=(e,t)=>{u.scrollTo({[p]:dY(e,c),behavior:t?"smooth":"instant"})},[async(t,i)=>{let a,u,s;if(!await n())return;o&&o();let d=o=()=>{a=!0,dB(u),s&&s()},c=()=>{if(!a){if(e.o()&&(dB(u),u=dJ(d,150)),i){for(let[t,n]=e.i(0);t<=n;t++)if(e.R(t))return;d()}e.W(7),r(t(),i)}},l=()=>{let t;a||(s=e.H(2,()=>{t||(t=!0,dV(()=>{t=!1,c()}))}),c())};i?(e.W(8,t()),dV(l)):l()},()=>{o&&o()}]),_=t?"width":"height",g=new WeakMap,b=(i=t=>{let n=[];for(let{target:r,contentRect:i}of t)if(r.offsetParent)if(r===u)e.W(4,i[_]);else{let e=g.get(r);null!=e&&n.push([e,i[_]])}n.length&&e.W(3,n)},{A(e){(a||(a=new e.ownerDocument.defaultView.ResizeObserver(i))).observe(e)},B(e){a.unobserve(e)},X(){a&&a.disconnect()}});return{D(n,r=n.parentElement){var i,o;let a,h,_,g,y,v,w,k,z,S,E,A,x;b.A(u=r),t&&(c="rtl"===getComputedStyle(r).direction),i=()=>dY(r[l],c),h=0,_=!1,g=!1,y=!1,v=!1,w=Date.now,k=()=>{_||g?(_=!1,z()):(y=!1,e.W(2))},z=()=>{dB(a),a=dJ(k,150)},S=()=>{h=w(),y&&(v=!0),o&&e.W(6,o()),e.W(1,i()),z()},E=n=>{if(_||!e.M()||n.ctrlKey)return;let r=w()-h;150>r&&50<r&&(t?n.deltaX:n.deltaY)&&(_=!0)},A=()=>{g=!0,y=v=!1},x=()=>{g=!1,dq()&&(y=!0)},r.addEventListener("scroll",S),r.addEventListener("wheel",E,{passive:!0}),r.addEventListener("touchstart",A,{passive:!0}),r.addEventListener("touchend",x,{passive:!0}),s={X:()=>{r.removeEventListener("scroll",S),r.removeEventListener("wheel",E),r.removeEventListener("touchstart",A),r.removeEventListener("touchend",x),dB(a)},Y:()=>{let[t,n]=e.L();t&&(((t,n,i)=>{if(i){let e=r.style,t=e[f];e[f]="hidden",dJ(()=>{e[f]=t})}let o=e.T()+t;o<=0||o>=e.O()+e.t()-e.o()?r.scrollTo({[p]:dY(o,c),behavior:"instant"}):r.scrollBy({[p]:dY(t,c),behavior:"instant"}),n&&m()})(t,n,v),v=!1,n&&e.o()>e.t()&&e.W(1,i()))}},d[1](!0)},_(){b.X(),s&&s.X(),d[1](!1),d=dG()},P:(e,t)=>(g.set(e,t),b.A(e),()=>{g.delete(e),b.B(e)}),V:h,J(){s&&s.Y()},j:e.O}})(m,f),f]},(g=(0,N.useRef)(null)).current||(g.current=_()));y!==S.C()&&S.W(5,[y,i]),s!==S.O()&&S.W(6,s);let[T,j]=(0,N.useReducer)(S.I,void 0,S.I),O=S.M(),P=S.t(),I=[],$=e=>{let t,n=b(e);return(0,uY.jsx)(d2,{Z:A.P,ee:e,te:S.u(e),ne:S.R(e),oe:l,N:n,re:x,ie:w[d3]},null!=(t=n.key)?t:"_"+e)};if(d0(()=>{w[d3]=!1,S.H(1,e=>{e?(0,dR.flushSync)(j):j()}),S.H(4,()=>{k.current&&k.current(S.T())}),S.H(8,()=>{z.current&&z.current()});let e=v[d3];return p?dV(()=>{p.current&&A.D(e,p[d3])}):A.D(e),()=>{S._(),A._()}},[]),d0(()=>{A.J()},[T]),(0,N.useImperativeHandle)(m,()=>({get cache(){return E.q()},get scrollOffset(){return S.T()},get scrollSize(){return dZ(S.t(),S.o())},get viewportSize(){return S.o()},findItemIndex:S.k,getItemOffset:S.u,getItemSize:S.h,scrollToIndex:(e,t)=>((e,t,n,{align:r,smooth:i,offset:o=0}={})=>{if(n=dF(n,0,t.C()-1),"nearest"===r){let e=t.u(n),i=t.T();if(e<i)r="start";else{if(!(e+t.h(n)>i+t.o()))return;r="end"}}e.V(()=>o+e.j()+t.u(n)+("end"===r?t.h(n)-t.o():"center"===r?(t.h(n)-t.o())/2:0),i)})(A,S,e,t),scrollTo:e=>dQ(A,e),scrollBy:e=>{dQ(A,e+S.T())}}),[]),a){let e=new Set(a);for(let[t,r]=S.i(n);t<=r;t++)e.add(t);dH([...e]).forEach(e=>{I.push($(e))})}else for(let[e,t]=S.i(n);e<=t;e++)I.push($(e));return(0,uY.jsx)(c,{ref:v,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:x?P:"100%",height:x?"100%":P,pointerEvents:O?"none":void 0},children:I})});let d4={MessageItem:e=>{let{message:t,children:n,depth:r,index:i,typingOpts:o={chunkSize:2,delay:40}}=e,a=dC(),{updateMessageTypeWritingCount:u}=dN(),s=L(t),[d,c]=(0,N.useState)(null),l=(0,N.useRef)(null);function p(){l.current&&(clearTimeout(l.current),l.current=null,setTimeout(()=>{u("sub")}))}F(()=>{p()}),(0,N.useEffect)(()=>{if(t.isGenerating){let e;c(t.swipes[t.activeSwipeId].content.length),u("add"),p(),e=Date.now(),l.current=setInterval(()=>{c(t=>{let n,r,i=(r=(n=Date.now())-e,e=n,Math.round(r/o.delay)*o.chunkSize),a=s.current,u=a.swipes[a.activeSwipeId].content.length,d=Math.min((t||0)+i,u);return a.isGenerating||u!==d?d:(p(),null)})},o.delay)}},[t.isGenerating]);let{data:f}=ek(async()=>null!==d?{...t,swipes:t.swipes.map((e,n)=>n!==t.activeSwipeId?e:{...e,content:e.content.slice(0,d)})}:await a.ai.chat.renderMessage({message:t,depth:r,index:i}),{refreshDeps:[t,d]});return n(f||t,t)},MessageList:(0,N.forwardRef)((e,t)=>{let{children:n,messages:r,vListProps:i}=e;return(0,uY.jsx)(d6,{...i,data:r,ref:t,children:(e,t)=>n({message:e,index:t,depth:r.length-1-t})})})};var d9=Array.isArray,d5="object"==typeof global&&global&&global.Object===Object&&global,d7="object"==typeof self&&self&&self.Object===Object&&self,ce=d5||d7||Function("return this")(),ct=ce.Symbol,cn=Object.prototype,cr=cn.hasOwnProperty,ci=cn.toString,co=ct?ct.toStringTag:void 0;let ca=function(e){var t=cr.call(e,co),n=e[co];try{e[co]=void 0;var r=!0}catch(e){}var i=ci.call(e);return r&&(t?e[co]=n:delete e[co]),i};var cu=Object.prototype.toString,cs=ct?ct.toStringTag:void 0;let cd=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":cs&&cs in Object(e)?ca(e):cu.call(e)},cc=function(e){return"symbol"==typeof e||null!=e&&"object"==typeof e&&"[object Symbol]"==cd(e)};var cl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cp=/^\w*$/;let cf=function(e,t){if(d9(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||cc(e))||cp.test(e)||!cl.test(e)||null!=t&&e in Object(t)},ch=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},cm=function(e){if(!ch(e))return!1;var t=cd(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};var c_=ce["__core-js_shared__"],cg=(y=/[^.]+$/.exec(c_&&c_.keys&&c_.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",cb=Function.prototype.toString;let cy=function(e){if(null!=e){try{return cb.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var cv=/^\[object .+?Constructor\]$/,cw=Object.prototype,ck=Function.prototype.toString,cz=cw.hasOwnProperty,cS=RegExp("^"+ck.call(cz).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");let cE=function(e){return!!ch(e)&&(!cg||!(cg in e))&&(cm(e)?cS:cv).test(cy(e))},cA=function(e,t){var n=null==e?void 0:e[t];return cE(n)?n:void 0};var cx=cA(Object,"create"),cT=Object.prototype.hasOwnProperty,cj=Object.prototype.hasOwnProperty;function cO(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])}}cO.prototype.clear=function(){this.__data__=cx?cx(null):{},this.size=0},cO.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},cO.prototype.get=function(e){var t=this.__data__;if(cx){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return cT.call(t,e)?t[e]:void 0},cO.prototype.has=function(e){var t=this.__data__;return cx?void 0!==t[e]:cj.call(t,e)},cO.prototype.set=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=cx&&void 0===t?"__lodash_hash_undefined__":t,this};let cP=function(e,t){for(var n,r=e.length;r--;)if((n=e[r][0])===t||n!=n&&t!=t)return r;return -1};var cI=Array.prototype.splice;function c$(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])}}c$.prototype.clear=function(){this.__data__=[],this.size=0},c$.prototype.delete=function(e){var t=this.__data__,n=cP(t,e);return!(n<0)&&(n==t.length-1?t.pop():cI.call(t,n,1),--this.size,!0)},c$.prototype.get=function(e){var t=this.__data__,n=cP(t,e);return n<0?void 0:t[n][1]},c$.prototype.has=function(e){return cP(this.__data__,e)>-1},c$.prototype.set=function(e,t){var n=this.__data__,r=cP(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var cM=cA(ce,"Map");let cC=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},cN=function(e,t){var n=e.__data__;return cC(t)?n["string"==typeof t?"string":"hash"]:n.map};function cR(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])}}function cL(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(cL.Cache||cR),n}cR.prototype.clear=function(){this.size=0,this.__data__={hash:new cO,map:new(cM||c$),string:new cO}},cR.prototype.delete=function(e){var t=cN(this,e).delete(e);return this.size-=!!t,t},cR.prototype.get=function(e){return cN(this,e).get(e)},cR.prototype.has=function(e){return cN(this,e).has(e)},cR.prototype.set=function(e,t){var n=cN(this,e),r=n.size;return n.set(e,t),this.size+=+(n.size!=r),this},cL.Cache=cR;var cZ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cD=/\\(\\)?/g,cU=(w=(v=cL(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(cZ,function(e,n,r,i){t.push(r?i.replace(cD,"$1"):n||e)}),t},function(e){return 500===w.size&&w.clear(),e})).cache,v);let cF=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};var cH=1/0,cJ=ct?ct.prototype:void 0,cB=cJ?cJ.toString:void 0;let cV=function e(t){if("string"==typeof t)return t;if(d9(t))return cF(t,e)+"";if(cc(t))return cB?cB.call(t):"";var n=t+"";return"0"==n&&1/t==-cH?"-0":n},cG=function(e,t){return d9(e)?e:cf(e,t)?[e]:cU(null==e?"":cV(e))};var cW=1/0;let cq=function(e){if("string"==typeof e||cc(e))return e;var t=e+"";return"0"==t&&1/e==-cW?"-0":t},cK=function(e,t){t=cG(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[cq(t[n++])];return n&&n==r?e:void 0},cX=function(e,t,n){var r=null==e?void 0:cK(e,t);return void 0===r?n:r};function cY({projectInfo:e,activePersona:r,onSend:i,messages:d,setSwipe:c}){(0,N.useEffect)(()=>{n=e??void 0,o=r??void 0},[e,r]),(0,N.useEffect)(()=>{t=async e=>{await i(e)},a=async e=>{if(d.length>1)throw Error("已有新消息,不允许切换开场白");if(0===d.length)throw Error("断言失败:没有开场消息,无法切换开场白");let t=Math.floor(e)-1,n=d[0].swipes.length;t<0||t>=n||c(d[0].id,t)},s=(e,t)=>d.find(t=>t.id===e)?.swipes[t]?.mjv?.value,u=(e,t,n)=>{let r=s?.(e,t);if(r)return cX(r,n)}},[i,d,c])}window.$mj_engine={ai:{chat:{get complete(){return t},get project(){return n},settings:{get persona(){return o}},get setFirstMesIndex(){return a}}},bind:({messageId:e,swipeId:r})=>({ai:{chat:{mjv:{get:t=>u?.(e,r,t),getAll:()=>s?.(e,r)??{}},get complete(){return t},get project(){return n},settings:{get persona(){return o}},get setFirstMesIndex(){return a}}}})};var cQ=Symbol.for("immer-nothing"),c0=Symbol.for("immer-draftable"),c3=Symbol.for("immer-state");function c8(e){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var c1=Object,c2=c1.getPrototypeOf,c6="constructor",c4="prototype",c9="configurable",c5="enumerable",c7="writable",le="value",lt=e=>!!e&&!!e[c3];function ln(e){return!!e&&(lo(e)||ll(e)||!!e[c0]||!!e[c6]?.[c0]||lp(e)||lf(e))}var lr=c1[c4][c6].toString(),li=new WeakMap;function lo(e){if(!e||!lh(e))return!1;let t=c2(e);if(null===t||t===c1[c4])return!0;let n=c1.hasOwnProperty.call(t,c6)&&t[c6];if(n===Object)return!0;if(!lm(n))return!1;let r=li.get(n);return void 0===r&&(r=Function.toString.call(n),li.set(n,r)),r===lr}function la(e,t,n=!0){0===lu(e)?(n?Reflect.ownKeys(e):c1.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function lu(e){let t=e[c3];return t?t.type_:ll(e)?1:lp(e)?2:3*!!lf(e)}var ls=(e,t,n=lu(e))=>2===n?e.has(t):c1[c4].hasOwnProperty.call(e,t),ld=(e,t,n=lu(e))=>2===n?e.get(t):e[t],lc=(e,t,n,r=lu(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},ll=Array.isArray,lp=e=>e instanceof Map,lf=e=>e instanceof Set,lh=e=>"object"==typeof e,lm=e=>"function"==typeof e,l_=e=>e.modified_?e.copy_:e.base_;function lg(e,t){if(lp(e))return new Map(e);if(lf(e))return new Set(e);if(ll(e))return Array[c4].slice.call(e);let n=lo(e);if(!0!==t&&("class_only"!==t||n)){let t=c2(e);if(null!==t&&n)return{...e};let r=c1.create(t);return c1.assign(r,e)}{let t=c1.getOwnPropertyDescriptors(e);delete t[c3];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],o=t[i];!1===o[c7]&&(o[c7]=!0,o[c9]=!0),(o.get||o.set)&&(t[i]={[c9]:!0,[c7]:!0,[c5]:o[c5],[le]:e[i]})}return c1.create(c2(e),t)}}function lb(e,t=!1){return lv(e)||lt(e)||!ln(e)||(lu(e)>1&&c1.defineProperties(e,{set:ly,add:ly,clear:ly,delete:ly}),c1.freeze(e),t&&la(e,(e,t)=>{lb(t,!0)},!1)),e}var ly={[le]:function(){c8(2)}};function lv(e){return!(null!==e&&lh(e))||c1.isFrozen(e)}var lw="MapSet",lk="Patches",lz="ArrayMethods",lS={};function lE(e){let t=lS[e];return t||c8(0,e),t}var lA=e=>!!lS[e];function lx(e,t){t&&(e.patchPlugin_=lE(lk),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function lT(e){lj(e),e.drafts_.forEach(lP),e.drafts_=null}function lj(e){e===E&&(E=e.parent_)}var lO=e=>E={drafts_:[],parent_:E,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:lA(lw)?lE(lw):void 0,arrayMethodsPlugin_:lA(lz)?lE(lz):void 0};function lP(e){let t=e[c3];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function lI(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(void 0!==e&&e!==n){n[c3].modified_&&(lT(t),c8(4)),ln(e)&&(e=l$(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[c3].base_,e,t)}else e=l$(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&lb(t,n)}(t,e,!0),lT(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==cQ?e:void 0}function l$(e,t){if(lv(t))return t;let n=t[c3];if(!n)return lZ(t,e.handledSet_,e);if(!lC(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);lL(n,e)}return n.copy_}function lM(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var lC=(e,t)=>e.scope_===t,lN=[];function lR(e,t,n,r){let i=e.copy_||e.base_,o=e.type_;if(void 0!==r&&ld(i,r,o)===t)return void lc(i,r,n,o);if(!e.draftLocations_){let t=e.draftLocations_=new Map;la(i,(e,n)=>{if(lt(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}for(let r of e.draftLocations_.get(t)??lN)lc(i,r,n,o)}function lL(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}lM(e)}}function lZ(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||lt(e)||t.has(e)||!ln(e)||lv(e)||(t.add(e),la(e,(r,i)=>{if(lt(i)){let t=i[c3];lC(t,n)&&(lc(e,r,l_(t),e.type_),lM(t))}else ln(i)&&lZ(i,t,n)})),e}var lD={get(e,t){let n;if(t===c3)return e;let r=e.scope_.arrayMethodsPlugin_,i=1===e.type_&&"string"==typeof t;if(i&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=e.copy_||e.base_;if(!ls(o,t,e.type_)){var a;let n;return a=e,(n=lH(o,t))?le in n?n[le]:n.get?.call(a.draft_):void 0}let u=o[t];if(e.finalized_||!ln(u)||i&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&Number.isInteger(n=+t)&&String(n)===t)return u;if(u===lF(e.base_,t)){lB(e);let n=1===e.type_?+t:t,r=lV(e.scope_,u,e,n);return e.copy_[n]=r}return u},has:(e,t)=>t in(e.copy_||e.base_),ownKeys:e=>Reflect.ownKeys(e.copy_||e.base_),set(e,t,n){let r=lH(e.copy_||e.base_,t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=lF(e.copy_||e.base_,t),i=r?.[c3];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if((n===r?0!==n||1/n==1/r:n!=n&&r!=r)&&(void 0!==n||ls(e.base_,t,e.type_)))return!0;lB(e),lJ(e)}return!!(e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t]))||(e.copy_[t]=n,e.assigned_.set(t,!0),!function(e,t,n){let{scope_:r}=e;if(lt(n)){let i=n[c3];lC(i,r)&&i.callbacks_.push(function(){lB(e),lR(e,n,l_(i),t)})}else ln(n)&&e.callbacks_.push(function(){let i=e.copy_||e.base_;3===e.type_?i.has(n)&&lZ(n,r.handledSet_,r):ld(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&lZ(ld(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n),!0)},deleteProperty:(e,t)=>(lB(e),void 0!==lF(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),lJ(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let n=e.copy_||e.base_,r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[c7]:!0,[c9]:1!==e.type_||"length"!==t,[c5]:r[c5],[le]:n[t]}:r},defineProperty(){c8(11)},getPrototypeOf:e=>c2(e.base_),setPrototypeOf(){c8(12)}},lU={};for(let e in lD){let t=lD[e];lU[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function lF(e,t){let n=e[c3];return(n?n.copy_||n.base_:e)[t]}function lH(e,t){if(!(t in e))return;let n=c2(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=c2(n)}}function lJ(e){!e.modified_&&(e.modified_=!0,e.parent_&&lJ(e.parent_))}function lB(e){e.copy_||(e.assigned_=new Map,e.copy_=lg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function lV(e,t,n,r){let[i,o]=lp(t)?lE(lw).proxyMap_(t,n):lf(t)?lE(lw).proxySet_(t,n):function(e,t){let n=ll(e),r={type_:+!!n,scope_:t?t.scope_:E,modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,o=lD;n&&(i=[r],o=lU);let{revoke:a,proxy:u}=Proxy.revocable(i,o);return r.draft_=u,r.revoke_=a,[u,r]}(t,n);if((n?.scope_??E).drafts_.push(i),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&void 0!==r)n.callbacks_.push(function(e){if(!o||!lC(o,e))return;e.mapSetPlugin_?.fixSetContents(o);let t=l_(o);lR(n,o.draft_??o,t,r),lL(o,e)});else o.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(o);let{patchPlugin_:t}=e;o.modified_&&t&&t.generatePatches_(o,[],e)});return i}lU.deleteProperty=function(e,t){return lU.set.call(this,e,t,void 0)},lU.set=function(e,t,n){return lD.set.call(this,e[0],t,n,e[0])};var lG=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{let r;if(lm(e)&&!lm(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}if(lm(t)||c8(6),void 0===n||lm(n)||c8(7),ln(e)){let i=lO(this),o=lV(i,e,void 0),a=!0;try{r=t(o),a=!1}finally{a?lT(i):lj(i)}return lx(i,n),lI(r,i)}if(e&&lh(e))c8(1,e);else{if(void 0===(r=t(e))&&(r=e),r===cQ&&(r=void 0),this.autoFreeze_&&lb(r,!0),n){let t=[],i=[];lE(lk).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}},this.produceWithPatches=(e,t)=>{let n,r;return lm(e)?(t,...n)=>this.produceWithPatches(t,t=>e(t,...n)):[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),"boolean"==typeof e?.useStrictIteration&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;ln(e)||c8(8),lt(e)&&(lt(t=e)||c8(10,t),e=function e(t){let n;if(!ln(t)||lv(t))return t;let r=t[c3],i=!0;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=lg(t,r.scope_.immer_.useStrictShallowCopy_),i=r.scope_.immer_.shouldUseStrictIteration()}else n=lg(t,!0);return la(n,(t,r)=>{lc(n,t,e(r))},i),r&&(r.finalized_=!1),n}(t));let n=lO(this),r=lV(n,e,void 0);return r[c3].isManual_=!0,lj(n),r}finishDraft(e,t){let n=e&&e[c3];n&&n.isManual_||c8(9);let{scope_:r}=n;return lx(r,t),lI(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=lE(lk).applyPatches_;return lt(e)?r(e,t):this.produce(e,e=>r(e,t))}}().produce;let lW=["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","Load failed","Failed to fetch"];function lq(e){return lW.some(t=>e.includes(t))}async function*lK(e,t,n="generate",r,i){let o=[],a=null,u=!1,s=null;try{let d=e=>{!s&&(o.push(e),a&&(a(),a=null))},c=()=>{u=!0,a&&(a(),a=null)},l=e=>{s=e,a&&(a(),a=null)};if("generate"===n)e.ai.chat.complete(t,r,d).then(c).catch(l);else if("regenerate"===n)e.ai.chat.regenerate(r,d).then(c).catch(l);else if("continue"===n)e.ai.chat.continue(r,d).then(c).catch(l);else{if(!i)throw Error("call recover without assisMsgId");e.ai.chat.recover(r,i,d).then(c).catch(l)}}catch(e){s=e,u=!0}for(;;)if(o.length>0)yield o.shift();else if(u)break;else if(s)throw s;else await new Promise(e=>{a=e})}let lX=aF({message:ov()});function lY(e){let{success:t}=lX.safeParse(e);return t}let lQ="not_saved",l0=({body:e,onFinish:t,pageSize:n=10})=>{let[r,i]=(0,N.useState)(""),o=(0,N.useRef)(0),a=dC(),u=(0,N.useRef)(!1),{data:s,loadMoreAsync:d,loadingMore:c,loading:l,mutate:p,error:f,reloadAsync:h}=eS(async e=>{if(u.current=!0,e?.noMore)return{noMore:!0,list:[]};try{let t=await a.ai.chat.message.getPage(e?.cursor,n);o.current=t.conversationVersion;let r=t.messages.at(-1);return r?.isGenerating&&z(r.id,o.current),{cursor:t.nextCursor,list:t.messages,noMore:!t.nextCursor}}finally{u.current=!1}},{direction:"top"}),m=async()=>{await h()},_=async()=>{if(!u.current)try{u.current=!0,await d()}finally{u.current=!1}},g=s?.list??[],b=L(s),y=(0,N.useRef)(g);y.current=g;let v=e=>{let t;t="function"==typeof e?e(y.current):e,y.current=t,p({...b.current,list:t})},{chatStreaming:w,isStreaming:k,recoverStreaming:z}=(({common:e,setMessages:t,getMessages:n,setInput:r,mujian:i,conversationVersion:o})=>{let{body:a}=e,[u,s]=(0,N.useState)(!1);return{chatStreaming:(0,N.useCallback)(async({query:e,regenerate:a,is_continue:u,conversationVersion:d})=>{let c=n();try{s(!0);let n={id:`${lQ}_user_${Date.now()}`,isUser:!0,swipes:[{content:e??""}],activeSwipeId:0,isGenerating:!1},r={id:`${lQ}_assistant_${Date.now()}`,isUser:!1,swipes:[{content:""}],activeSwipeId:0,isGenerating:!0};for await(let s of(a?t(lG(e=>{let t=e.at(-1);t.activeSwipeId=t.swipes.length,t.swipes.push({content:""}),t.isGenerating=!0,t.finishReason=void 0,t.error=void 0})):u?t(e=>[...e,r]):t(e=>[...e,n,r]),lK(i,e||"",u?"continue":a?"regenerate":"generate",d))){if(!s)return;"meta"===s.type?(a||t(lG(e=>{u||(e[e.length-2].id=s.userMsgId),e[e.length-1].id=s.assisMsgId})),o.current=s.newConversationVersion):"data"===s.type&&(t(lG(e=>{let t=e.at(-1);t.swipes[t.activeSwipeId]={content:s.content,mjv:s.mjv},s.finishReason&&(t.finishReason=s.finishReason),s.error&&(t.error=s.error)})),await new Promise(e=>setTimeout(e,10)))}}catch(e){sX.e("Stream error",e),t(lG(t=>{let n=t.at(-1);lY(e)&&lq(e.message)?n.error={code:-1e4,message:"E_NETWORK_ERROR"}:n.error={code:0x3b9aca05,message:String(e)}}))}finally{t(lG(n=>{let i=n[n.length-1];if(i.isGenerating=!1,i.error?.code===0x77dde1f9){let e=c.find(e=>e.id===i.id);e?(i.swipes=e.swipes,i.activeSwipeId=e.activeSwipeId):(i.activeSwipeId-=1,i.swipes.length=i.swipes.length-1)}else i.error?.code===0x77dde1f1&&(t(c),e&&r(e))})),s(!1)}},[a,i]),isStreaming:u,recoverStreaming:(0,N.useCallback)(async(e,n)=>{let r=lK(i,"","recover",n,e);try{for await(let n of r){if(!n)return;"data"===n.type&&t(lG(t=>{let r=t.find(t=>t.id===e);r&&(r.swipes[r.activeSwipeId]={content:n.content,mjv:n.mjv},n.finishReason&&(r.finishReason=n.finishReason),n.error&&(r.error=n.error))}))}}catch(e){sX.e("Stream error",e),t(lG(t=>{let n=t.at(-1);lY(e)&&lq(e.message)?n.error={code:-1e4,message:"E_NETWORK_ERROR"}:n.error={code:0x3b9aca05,message:String(e)}}))}finally{t(lG(t=>{let n=t.find(t=>t.id===e);n&&(n.isGenerating=!1)}))}},[i])}})({common:{body:e},setMessages:v,getMessages:(0,N.useCallback)(()=>y.current,[y]),setInput:i,mujian:a,conversationVersion:o});G(()=>{if(!k){let e=g[g.length-1];t?.(e)}},[k]);let S=(0,N.useCallback)(async e=>{if(k)throw Error("useChat is streaming already.");await w({query:e,conversationVersion:o.current})},[k,w]),E=(0,N.useCallback)(async()=>{if(k)throw Error("useChat is streaming already.");let e=g.findLast(e=>e.isUser),t=e?e.swipes[e.activeSwipeId].content:"";await w({query:t,regenerate:!0,conversationVersion:o.current})},[k,g,w]),A=(0,N.useCallback)(async()=>{if(k)throw Error("useChat is streaming already.");await w({query:"",is_continue:!0,conversationVersion:o.current})},[k,w]),x=async(e,t)=>{if(t<0)return;v(lG(n=>{let r=n.find(t=>t.id===e);r&&(r.activeSwipeId=t)}));let n=await a.ai.chat.message.swipe(e,t),{data:r,success:i}=aF({newConversationVersion:as()}).safeParse(n);i&&r.newConversationVersion&&(o.current=r.newConversationVersion)},T=async(e,t)=>{let n=await a.ai.chat.message.editOne(e,t),{data:r,success:i}=aF({newConversationVersion:as()}).safeParse(n);i&&r.newConversationVersion&&(o.current=r.newConversationVersion),v(lG(n=>{let r=n.find(t=>t.id===e);r&&(r.swipes[r.activeSwipeId].content=t)}))},j=async e=>{if(!e.startsWith(lQ))try{let t=await a.ai.chat.message.deleteOne(e),{data:n,success:r}=aF({newConversationVersion:as()}).safeParse(t);r&&n.newConversationVersion&&(o.current=n.newConversationVersion)}catch(e){if(e?.code!==0x77dde1f4)throw e}v(t=>t.filter(t=>t.id!==e))};return{append:S,regenerate:E,continueGenerate:A,stop:()=>{let e=g.at(-1)?.id;e&&a.ai.chat.stop(o.current,e)},messages:g,status:k?"streaming":"ready",setMessages:v,input:r,setInput:i,handleSubmit:()=>{S(r)},setSwipe:x,editMessage:T,deleteMessage:j,loadMoreMessage:_,messagesStatus:f?"error":c||l?"loading":s?.noMore?"all-loaded":"has-more",refresh:m}}})(),i})());
|