(this.webpackJsonp=this.webpackJsonp||[]).push([[13],{10382:function(e,t,n){var r=n(10383);e.exports=function(e){if(t=e,t&&t.window===t)return e;var t;var n=r(e);if(o){n.parentWindow.execScript("document._parentWindow = window;","Javascript");var i=n._parentWindow;return n._parentWindow=null,i}return n.defaultView||n.parentWindow};var o=n(10384)},10383:function(e,t){e.exports=function e(t){if(n(t))return t;if(n(t.ownerDocument))return t.ownerDocument;if(n(t.document))return t.document;if(t.parentNode)return e(t.parentNode);if(t.commonAncestorContainer)return e(t.commonAncestorContainer);if(t.startContainer)return e(t.startContainer);if(t.anchorNode)return e(t.anchorNode)};function n(e){return e&&9===e.nodeType}},10384:function(e,t){e.exports=!!document.attachEvent&&window!==document.parentWindow},10385:function(e,t){e.exports=function(e){var t=e.anchorNode,n=e.anchorOffset,r=e.focusNode,o=e.focusOffset,i=t.compareDocumentPosition(r);return!(4===i||0===i&&n=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(10387)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(103))},10387:function(e,t,n){"use strict";e.exports=function(e){function t(e){for(var t=0,n=0;n1;g&&(v=v.slice(0,-1));var m=d(v),y=o[m];1!==a&&y||(n?r.key=m:r.which=f(v)),y&&(r[y]=!g||null)}}catch(e){l=!0,c=e}finally{try{!u&&p.return&&p.return()}finally{if(l)throw c}}return r}function c(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function f(e){return e=d(e),a[e]||e.toUpperCase().charCodeAt(0)}function d(e){return e=e.toLowerCase(),e=i[e]||e}t.default=u,t.isHotkey=u,t.isCodeHotkey=function(e,t){return u(e,t)},t.isKeyHotkey=function(e,t){return u(e,{byKey:!0},t)},t.parseHotkey=l,t.compareHotkey=c,t.toKeyCode=f,t.toKeyName=d},10389:function(e,t,n){"use strict";t.atob=self.atob.bind(self),t.btoa=self.btoa.bind(self)},10397:function(e,t,n){var r=n(1101),o=n(10398);e.exports=function(e){return o(r(e).toLowerCase())}},10398:function(e,t,n){var r=n(10399)("toUpperCase");e.exports=r},10399:function(e,t,n){var r=n(10400),o=n(9604),i=n(10401),a=n(1101);e.exports=function(e){return function(t){t=a(t);var n=o(t)?i(t):void 0,s=n?n[0]:t.charAt(0),u=n?r(n,1).join(""):t.slice(1);return s[e]()+u}}},10400:function(e,t,n){var r=n(9597);e.exports=function(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:r(e,t,n)}},10401:function(e,t,n){var r=n(10402),o=n(9604),i=n(10403);e.exports=function(e){return o(e)?i(e):r(e)}},10402:function(e,t){e.exports=function(e){return e.split("")}},10403:function(e,t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+r+"|"+o+")"+"?",l="[\\ufe0e\\ufe0f]?"+u+("(?:\\u200d(?:"+[i,a,s].join("|")+")[\\ufe0e\\ufe0f]?"+u+")*"),c="(?:"+[i+r+"?",r,a,s,n].join("|")+")",f=RegExp(o+"(?="+o+")|"+c+l,"g");e.exports=function(e){return e.match(f)||[]}},10404:function(e,t,n){var r=n(10405),o=n(10406),i=n(10409),a=RegExp("['’]","g");e.exports=function(e){return function(t){return r(i(o(t).replace(a,"")),e,"")}}},10405:function(e,t){e.exports=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o1e3&&this.dataPoints_.shift()},isVisible:function(){return this.isVisible_},show:function(e){this.isVisible_=e},getColor:function(){return this.color_},setColor:function(e){this.color_=e},getCount:function(){return this.dataPoints_.length},getValues:function(e,t,n){return this.cacheStartTime_==e&&this.cacheStepSize_==t&&this.cacheValues_.length==n||(this.cacheValues_=this.getValuesInternal_(e,t,n),this.cacheStartTime_=e,this.cacheStepSize_=t),this.cacheValues_},getValuesInternal_:function(e,t,n){for(var r=[],o=0,i=0,a=e,s=0;st&&(e=!0),this.scrollbar_.range_=t,e&&(this.scrollbar_.position_=t,this.repaint())},setDateRange:function(e,t){this.startTime_=e.getTime(),this.endTime_=t.getTime(),this.endTime_<=this.startTime_&&(this.startTime_=this.endTime_-1),this.updateScrollbarRange_(!0)},updateEndDate:function(e){this.endTime_=e||(new Date).getTime(),this.updateScrollbarRange_(this.graphScrolledToRightEdge_())},getStartDate:function(){return new Date(this.startTime_)},setDataSeries:function(e){this.graph_=new t;for(var n=0;nt||e<50)){n.save(),n.translate(.5,.5);var i=this.scrollbar_.position_;0==this.scrollbar_.range_&&(i=this.getLength_()-this.canvas_.width);var a=this.startTime_+i*this.scale_,s=t;t-=o+4,this.drawTimeLabels(n,e,t,s,a),n.strokeStyle=this.gridColor,n.strokeRect(0,0,e-1,t-1),this.graph_&&(this.graph_.layout(e,t,o,a,this.scale_),this.graph_.drawTicks(n),this.graph_.drawLines(n),this.graph_.drawLabels(n)),n.restore()}}},drawTimeLabels:function(e,t,n,r,o){var i=6e4*Math.ceil(o/6e4);for(e.textBaseline="bottom",e.textAlign="center",e.fillStyle=this.textColor,e.strokeStyle=this.gridColor;;){var a=Math.round((i-o)/this.scale_);if(a>=t)break;var s=new Date(i).toLocaleTimeString(this.timeLocales,this.timeOptions);e.fillText(s,a,r),e.beginPath(),e.lineTo(a,0),e.lineTo(a,n),e.stroke(),i+=6e4}},getDataSeriesCount:function(){return this.graph_?this.graph_.dataSeries_.length:0},hasDataSeries:function(e){return!!this.graph_&&this.graph_.hasDataSeries(e)}};var t=function(){function e(){this.dataSeries_=[],this.width_=0,this.height_=0,this.fontHeight_=0,this.startTime_=0,this.scale_=0,this.min_=0,this.max_=0,this.labels_=[]}return e.prototype={addDataSeries:function(e){this.dataSeries_.push(e)},hasDataSeries:function(e){for(var t=0;ti?i=u[l]:u[l]=1024;)e/=1024,t/=1024,++r;this.layoutLabelsBasic_(e,t,2);for(var o=0;o6&&(i=6);for(var a=Math.pow(10,-n),s=n;!(Math.ceil(r/a)+1<=i);){if(Math.ceil(r/(2*a))+1<=i){a*=2;break}if(Math.ceil(r/(5*a))+1<=i){a*=5;break}a*=10,s>0&&--s}this.max_=Math.ceil(t/a)*a,this.min_=Math.floor(e/a)*a;for(var u=this.max_;u>=this.min_;u-=a)this.labels_.push(u.toFixed(s))}else this.min_=this.max_=t},drawTicks:function(e){var t,n;t=this.width_-1,n=this.width_-1-10,e.fillStyle=this.gridColor,e.beginPath();for(var r=1;r=0;--r){var o=this.getValues(this.dataSeries_[r]);if(o){e.strokeStyle=this.dataSeries_[r].getColor(),e.beginPath();for(var i=0;i=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!o;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,o="/"===a.charAt(0))}return(o?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!o).join("/"))||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===o(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!i).join("/"))||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var o=r(e.split("/")),i=r(n.split("/")),a=Math.min(o.length,i.length),s=a,u=0;u=1;--i)if(47===(t=e.charCodeAt(i))){if(!o){r=i;break}}else o=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,o=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!o){n=t+1;break}}else-1===r&&(o=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,o=!0,i=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===r&&(o=!1,r=a+1),46===s?-1===t?t=a:1!==i&&(i=1):-1!==t&&(i=-1);else if(!o){n=a+1;break}}return-1===t||-1===r||0===i||1===i&&t===r-1&&t===n+1?"":e.slice(t,r)};var o="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(103))},9603:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.truncateAndLocalizeNumber=void 0;var r,o=(r=n(690))&&r.__esModule?r:{default:r};t.truncateAndLocalizeNumber=function(e,t){var n=Math.round(10*e)/10;if(e<1e6)return new Intl.NumberFormat(t,{maximumFractionDigits:n%1==0?0:1}).format(e);var r=Math.round(e/1e6*10)/10,i=new Intl.NumberFormat(t,{maximumFractionDigits:r%1==0?0:1}).format(e/1e6);return o.default.Messages.NumberAbbreviations.MILLION.format({num:i})}},9604:function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},9605:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timing=h,t.spring=p,t.parallel=v,t.sequence=g,t.default=t.SequenceAnimation=t.ParallelAnimation=t.SingleAnimation=void 0;var r,o=(r=n(265))&&r.__esModule?r:{default:r};function i(){return(i=Object.assign||function(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1){for(var s=new Array(a),u=0;u=0||(o[n]=e[n]);return o}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,v(e,t)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var g={beginDrag:function(e,t,n){var r=e.dragId,o=n.context,i=o.onDragStart,a=o.onHover,s=o.onDrop;return i(r),{dragId:r,onDragStart:i,onHover:a,onDrop:s}},endDrag:function(e,t){(0,t.getItem().onDrop)(t.getDropResult())}},m={drop:function(e){return{dragId:e.dragId}},hover:function(e,t){var n=e.dragId;(0,t.getItem().onHover)(n)}};function y(e,t){return{connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()}}function E(e,t){return{connectDropTarget:e.dropTarget()}}},9607:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateGuildPermissionSpec=function(e,t){var n=function(e,t){var n;return(n={})[r.Permissions.VIEW_CHANNEL.toString()]={title:e.ROLE_PERMISSIONS_VIEW_CHANNEL,description:e.ROLE_PERMISSIONS_VIEW_CHANNEL_DESCRIPTION,flag:r.Permissions.VIEW_CHANNEL},n[r.Permissions.MANAGE_CHANNELS.toString()]={title:e.MANAGE_CHANNELS,description:e.ROLE_PERMISSIONS_MANAGE_CHANNELS_DESCRIPTION,flag:r.Permissions.MANAGE_CHANNELS},n[r.Permissions.MANAGE_ROLES.toString()]={title:e.MANAGE_ROLES,description:e.ROLE_PERMISSIONS_MANAGE_ROLES_DESCRIPTION,flag:r.Permissions.MANAGE_ROLES},n[r.Permissions.MANAGE_EMOJIS.toString()]={title:e.MANAGE_EMOJIS,description:e.ROLE_PERMISSIONS_MANAGE_EMOJIS_DESCRIPTION,flag:r.Permissions.MANAGE_EMOJIS},n[r.Permissions.VIEW_AUDIT_LOG.toString()]={title:e.VIEW_AUDIT_LOG,description:e.ROLE_PERMISSIONS_VIEW_AUDIT_LOG_DESCRIPTION,flag:r.Permissions.VIEW_AUDIT_LOG},n[r.Permissions.VIEW_GUILD_ANALYTICS.toString()]={title:e.VIEW_GUILD_ANALYTICS,description:e.ROLE_PERMISSIONS_VIEW_GUILD_ANALYTICS_DESCRIPTION,flag:r.Permissions.VIEW_GUILD_ANALYTICS},n[r.Permissions.MANAGE_WEBHOOKS.toString()]={title:e.MANAGE_WEBHOOKS,description:e.ROLE_PERMISSIONS_MANAGE_WEBHOOKS_DESCRIPTION,flag:r.Permissions.MANAGE_WEBHOOKS},n[r.Permissions.MANAGE_GUILD.toString()]={title:e.MANAGE_SERVER,description:e.ROLE_PERMISSIONS_MANAGE_SERVER_DESCRIPTION,flag:r.Permissions.MANAGE_GUILD},n[r.Permissions.CREATE_INSTANT_INVITE.toString()]={title:e.CREATE_INSTANT_INVITE,description:e.ROLE_PERMISSIONS_CREATE_INSTANT_INVITE_DESCRIPTION,flag:r.Permissions.CREATE_INSTANT_INVITE},n[r.Permissions.CHANGE_NICKNAME.toString()]={title:e.CHANGE_NICKNAME,description:e.ROLE_PERMISSIONS_CHANGE_NICKNAME_DESCRIPTION,flag:r.Permissions.CHANGE_NICKNAME},n[r.Permissions.MANAGE_NICKNAMES.toString()]={title:e.MANAGE_NICKNAMES,description:e.ROLE_PERMISSIONS_MANAGE_NICKNAMES_DESCRIPTION,flag:r.Permissions.MANAGE_NICKNAMES},n[r.Permissions.KICK_MEMBERS.toString()]={title:e.KICK_MEMBERS,description:e.ROLE_PERMISSIONS_KICK_MEMBERS_DESCRIPTION,flag:r.Permissions.KICK_MEMBERS},n[r.Permissions.BAN_MEMBERS.toString()]={title:e.BAN_MEMBERS,description:e.ROLE_PERMISSIONS_BAN_MEMBERS_DESCRIPTION,flag:r.Permissions.BAN_MEMBERS},n[r.Permissions.SEND_MESSAGES.toString()]={title:e.SEND_MESSAGES,description:e.ROLE_PERMISSIONS_SEND_MESSAGES_DESCRIPTION,flag:r.Permissions.SEND_MESSAGES},n[r.Permissions.EMBED_LINKS.toString()]={title:e.EMBED_LINKS,description:e.ROLE_PERMISSIONS_EMBED_LINKS_DESCRIPTION,flag:r.Permissions.EMBED_LINKS},n[r.Permissions.ATTACH_FILES.toString()]={title:e.ATTACH_FILES,description:e.ROLE_PERMISSIONS_ATTACH_FILES_DESCRIPTION,flag:r.Permissions.ATTACH_FILES},n[r.Permissions.ADD_REACTIONS.toString()]={title:e.ADD_REACTIONS,description:e.ROLE_PERMISSIONS_ADD_REACTIONS_DESCRIPTION,flag:r.Permissions.ADD_REACTIONS},n[r.Permissions.USE_EXTERNAL_EMOJIS.toString()]={title:e.ROLE_PERMISSIONS_USE_EXTERNAL_EMOJIS,description:e.ROLE_PERMISSIONS_USE_EXTERNAL_EMOJIS_DESCRIPTION,flag:r.Permissions.USE_EXTERNAL_EMOJIS},n[r.Permissions.MENTION_EVERYONE.toString()]={title:e.MENTION_EVERYONE,description:e.ROLE_PERMISSIONS_MENTION_EVERYONE_DESCRIPTION,flag:r.Permissions.MENTION_EVERYONE},n[r.Permissions.MANAGE_MESSAGES.toString()]={title:e.MANAGE_MESSAGES,description:e.ROLE_PERMISSIONS_MANAGE_MESSAGES_DESCRIPTION,flag:r.Permissions.MANAGE_MESSAGES},n[r.Permissions.READ_MESSAGE_HISTORY.toString()]={title:e.READ_MESSAGE_HISTORY,description:e.ROLE_PERMISSIONS_READ_MESSAGE_HISTORY_DESCRIPTION,flag:r.Permissions.READ_MESSAGE_HISTORY},n[r.Permissions.SEND_TTS_MESSAGES.toString()]={title:e.ROLE_PERMISSIONS_SEND_TTS_MESSAGES,description:e.ROLE_PERMISSIONS_SEND_TTS_MESSAGES_DESCRIPTION,flag:r.Permissions.SEND_TTS_MESSAGES},n[r.Permissions.USE_APPLICATION_COMMANDS.toString()]={title:e.ROLE_PERMISSIONS_USE_APPLICATION_COMMANDS,description:e.ROLE_PERMISSIONS_USE_APPLICATION_COMMANDS_GUILD_DESCRIPTION,flag:r.Permissions.USE_APPLICATION_COMMANDS},n[r.Permissions.CONNECT.toString()]={title:e.CONNECT,description:e.ROLE_PERMISSIONS_CONNECT_DESCRIPTION,flag:r.Permissions.CONNECT},n[r.Permissions.SPEAK.toString()]={title:e.SPEAK,description:e.ROLE_PERMISSIONS_SPEAK_DESCRIPTION,flag:r.Permissions.SPEAK},n[r.Permissions.STREAM.toString()]={title:e.VIDEO,description:e.ROLE_PERMISSIONS_STREAM_DESCRIPTION,flag:r.Permissions.STREAM},n[r.Permissions.USE_VAD.toString()]={title:e.USE_VAD,description:e.ROLE_PERMISSIONS_USE_VAD_DESCRIPTION,flag:r.Permissions.USE_VAD},n[r.Permissions.PRIORITY_SPEAKER.toString()]={title:e.PRIORITY_SPEAKER,description:(null==t?void 0:t.PRIORITY_SPEAKER_DESCRIPTION)||e.ROLE_PERMISSIONS_PRIORITY_SPEAKER_DESCRIPTION,flag:r.Permissions.PRIORITY_SPEAKER},n[r.Permissions.MUTE_MEMBERS.toString()]={title:e.MUTE_MEMBERS,description:e.ROLE_PERMISSIONS_MUTE_MEMBERS_DESCRIPTION,flag:r.Permissions.MUTE_MEMBERS},n[r.Permissions.DEAFEN_MEMBERS.toString()]={title:e.DEAFEN_MEMBERS,description:e.ROLE_PERMISSIONS_DEAFEN_MEMBERS_DESCRIPTION,flag:r.Permissions.DEAFEN_MEMBERS},n[r.Permissions.MOVE_MEMBERS.toString()]={title:e.MOVE_MEMBERS,description:e.ROLE_PERMISSIONS_MOVE_MEMBERS_DESCRIPTION,flag:r.Permissions.MOVE_MEMBERS},n[r.Permissions.REQUEST_TO_SPEAK.toString()]={title:e.REQUEST_TO_SPEAK,description:e.ROLE_PERMISSIONS_REQUEST_TO_SPEAK_DESCRIPTION,flag:r.Permissions.REQUEST_TO_SPEAK,isExperimental:!0},n[r.Permissions.ADMINISTRATOR.toString()]={title:e.ADMINISTRATOR,description:"string"==typeof e.ROLE_PERMISSIONS_ADMINISTRATOR_DESCRIPTION?e.ROLE_PERMISSIONS_ADMINISTRATOR_DESCRIPTION:e.ROLE_PERMISSIONS_ADMINISTRATOR_DESCRIPTION.format(),flag:r.Permissions.ADMINISTRATOR},n}(e,t);if(t.showStageChannelPermissions)return[a(n,e),s(n,e),u(n,e),l(n,e),c(n,e,t),f(n,e)];return[a(n,e),s(n,e),u(n,e),l(n,e),f(n,e)]},t.generateChannelGeneralSection=function(e,t,n){var o;void 0===n&&(n={showManageWebhooks:!0});return{title:t,permissions:i((null===(o=n)||void 0===o?void 0:o.showManageWebhooks)?[r.Permissions.VIEW_CHANNEL,r.Permissions.MANAGE_CHANNELS,r.Permissions.MANAGE_ROLES,r.Permissions.MANAGE_WEBHOOKS]:[r.Permissions.VIEW_CHANNEL,r.Permissions.MANAGE_CHANNELS,r.Permissions.MANAGE_ROLES],e)}},t.generateChannelMembershipSection=function(e,t){return{title:t,permissions:i([r.Permissions.CREATE_INSTANT_INVITE],e)}},t.generateChannelTextSection=function(e,t){return{title:t,permissions:i([r.Permissions.SEND_MESSAGES,r.Permissions.EMBED_LINKS,r.Permissions.ATTACH_FILES,r.Permissions.ADD_REACTIONS,r.Permissions.USE_EXTERNAL_EMOJIS,r.Permissions.MENTION_EVERYONE,r.Permissions.MANAGE_MESSAGES,r.Permissions.READ_MESSAGE_HISTORY,r.Permissions.SEND_TTS_MESSAGES,r.Permissions.USE_APPLICATION_COMMANDS],e)}},t.generateChannelVoiceSection=function(e,t){return{title:t,permissions:i([r.Permissions.CONNECT,r.Permissions.SPEAK,r.Permissions.STREAM,r.Permissions.USE_VAD,r.Permissions.PRIORITY_SPEAKER,r.Permissions.MUTE_MEMBERS,r.Permissions.DEAFEN_MEMBERS,r.Permissions.MOVE_MEMBERS],e)}},t.generateChannelStageVoiceSection=function(e,t){return{title:t,permissions:i([r.Permissions.CONNECT,r.Permissions.USE_VAD,r.Permissions.MUTE_MEMBERS,r.Permissions.MOVE_MEMBERS],e)}},t.generateChannelStageSection=function(e,t){return{title:t,permissions:i([r.Permissions.REQUEST_TO_SPEAK],e)}};var r=n(109);function o(e,t){return void 0===t&&(t=!1),t||(e.permissions=e.permissions.filter((function(e){return!e.isExperimental}))),e}function i(e,t){return e.map((function(e){return t[e.toString()]}))}function a(e,t){return o({title:t.ROLE_PERMISSIONS_SECTION_GENERAL_GUILD,permissions:i([r.Permissions.VIEW_CHANNEL,r.Permissions.MANAGE_CHANNELS,r.Permissions.MANAGE_ROLES,r.Permissions.MANAGE_EMOJIS,r.Permissions.VIEW_AUDIT_LOG,r.Permissions.VIEW_GUILD_ANALYTICS,r.Permissions.MANAGE_WEBHOOKS,r.Permissions.MANAGE_GUILD],e)})}function s(e,t){return o({title:t.ROLE_PERMISSIONS_SECTION_MEMBERSHIP,permissions:i([r.Permissions.CREATE_INSTANT_INVITE,r.Permissions.CHANGE_NICKNAME,r.Permissions.MANAGE_NICKNAMES,r.Permissions.KICK_MEMBERS,r.Permissions.BAN_MEMBERS],e)})}function u(e,t){return o({title:t.ROLE_PERMISSIONS_SECTION_TEXT,permissions:i([r.Permissions.SEND_MESSAGES,r.Permissions.EMBED_LINKS,r.Permissions.ATTACH_FILES,r.Permissions.ADD_REACTIONS,r.Permissions.USE_EXTERNAL_EMOJIS,r.Permissions.MENTION_EVERYONE,r.Permissions.MANAGE_MESSAGES,r.Permissions.READ_MESSAGE_HISTORY,r.Permissions.SEND_TTS_MESSAGES,r.Permissions.USE_APPLICATION_COMMANDS],e)})}function l(e,t){return o({title:t.ROLE_PERMISSIONS_SECTION_VOICE,permissions:i([r.Permissions.CONNECT,r.Permissions.SPEAK,r.Permissions.STREAM,r.Permissions.USE_VAD,r.Permissions.PRIORITY_SPEAKER,r.Permissions.MUTE_MEMBERS,r.Permissions.DEAFEN_MEMBERS,r.Permissions.MOVE_MEMBERS],e)})}function c(e,t,n){return o({title:t.ROLE_PERMISSIONS_SECTION_STAGE,permissions:i([r.Permissions.REQUEST_TO_SPEAK],e)},n.showExperimental)}function f(e,t){return o({title:t.ROLE_PERMISSIONS_SECTION_ADVANCED,permissions:i([r.Permissions.ADMINISTRATOR],e)})}},9611:function(e,t,n){!function(e){"use strict";function t(e){return 10===e||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&Ne.indexOf(e)>=0}function n(e){return e>=48&&e<=57}function r(e){return e>=48&&e<=57||43===e||45===e||46===e}function o(e){this.index=0,this.path=e,this.max=e.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function i(e){for(;e.index=i)e.err="SvgPath: missed param (at pos "+o+")";else if(43!==(t=e.path.charCodeAt(o))&&45!==t||(t=++o2&&(e.result.push([t,r[0],r[1]]),r=r.slice(2),n="l",t="m"===t?"l":"L"),"r"===n)e.result.push([t].concat(r));else for(;r.length>=Ae[n]&&(e.result.push([t].concat(r.splice(0,Ae[n]))),Ae[n]););}function u(e){var t,n,o,u=e.max;if(e.segmentStart=e.index,function(e){switch(32|e){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(e.path.charCodeAt(e.index)))if(n=Ae[e.path[e.index].toLowerCase()],e.index++,i(e),e.data=[],n){for(t=!1;;){for(o=n;o>0;o--){if(a(e),e.err.length)return;e.data.push(e.param),i(e),t=!1,e.index=e.max)break;if(!r(e.path.charCodeAt(e.index)))break}}s(e)}else s(e);else e.err="SvgPath: bad command "+e.path[e.index]+" (at pos "+e.index+")"}function l(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function c(){if(!(this instanceof c))return new c;this.queue=[],this.cache=null}function f(e,t,n,r){var o=e*r-t*n<0?-1:1,i=(e*n+t*r)/(Math.sqrt(e*e+t*t)*Math.sqrt(e*e+t*t));return i>1&&(i=1),i<-1&&(i=-1),o*Math.acos(i)}function d(e,t,n,r,o,i,a,s,u,l){var c=l*(e-n)/2+u*(t-r)/2,d=-u*(e-n)/2+l*(t-r)/2,h=a*a,p=s*s,v=c*c,g=d*d,m=h*p-h*g-p*v;m<0&&(m=0),m/=h*g+p*v;var y=(m=Math.sqrt(m)*(o===i?-1:1))*a/s*d,E=m*-s/a*c,S=l*y-u*E+(e+n)/2,_=u*y+l*E+(t+r)/2,x=(c-y)/a,A=(d-E)/s,N=(-c-y)/a,w=(-d-E)/s,C=f(1,0,x,A),b=f(x,A,N,w);return 0===i&&b>0&&(b-=Ie),1===i&&b<0&&(b+=Ie),[S,_,C,b]}function h(e,t){var n=4/3*Math.tan(t/4),r=Math.cos(e),o=Math.sin(e),i=Math.cos(e+t),a=Math.sin(e+t);return[r,o,r-o*n,o+r*n,i+a*n,a-i*n,i,a]}function p(e,t,n){if(!(this instanceof p))return new p(e,t,n);this.rx=e,this.ry=t,this.ax=n}function v(e){if(!(this instanceof v))return new v(e);var t=we(e);this.segments=t.segments,this.err=t.err,this.__stack=[]}function g(e,t,n,r,o,i,a,s){this.a={x:e,y:t},this.b={x:n,y:r},this.c={x:o,y:i},this.d={x:a,y:s},null!=a&&null!=s?(this.getArcLength=C,this.getPoint=_,this.getDerivative=y):(this.getArcLength=x,this.getPoint=S,this.getDerivative=m),this.init()}function m(e,t,n){return{x:2*(1-n)*(e[1]-e[0])+2*n*(e[2]-e[1]),y:2*(1-n)*(t[1]-t[0])+2*n*(t[2]-t[1])}}function y(e,t,n){return S([3*(e[1]-e[0]),3*(e[2]-e[1]),3*(e[3]-e[2])],[3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],n)}function E(e,t,n,r,o){for(var i=1,a=e/t,s=(e-n(r,o,a))/t;i>.001;){var u=n(r,o,a+s),l=n(r,o,a-s),c=Math.abs(e-u)/t,f=Math.abs(e-l)/t;c1&&(o=1),o<-1&&(o=-1),(e*r-t*n<0?-1:1)*Math.acos(o)}function O(e,t){var n=4/3*Math.tan(t/4),r=Math.cos(e),o=Math.sin(e),i=Math.cos(e+t),a=Math.sin(e+t);return[r,o,r-o*n,o+r*n,i+a*n,a-i*n,i,a]}function M(e,t,n,r,o,i,a,s,u){var l=0,c=[],f=[];Ke(e,t,n,r,o,i,a,s,u).forEach((function(e){var t=new Be(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),n=t.getTotalLength();l+=n,c.push(n),f.push(t)})),this.length=l,this.partialLengths=c,this.curves=f}function I(e,t,n,r){this.x0=e,this.x1=t,this.y0=n,this.y1=r}function T(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}function P(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function R(e,t,n){var r=e.map((function(e,n){return function(e,t){return function(n){return e.map((function(e,r){return e+n*(t[r]-e)}))}}(e,t[n])}));return function(e){var t=r.map((function(t){return t(e)}));return n?B(t):t}}function k(e){return"number"==typeof e&&isFinite(e)}function D(e){return function(e){for(var t=0;t0&&(a=Math.max(a,Math.ceil(n/t)));for(var s=0;s=2&&k(e[0])&&k(e[1])}))}(n=e.slice(0)))throw new TypeError(He);return n.length>1&&function(e,t){return T(e,t)<1e-9}(n[0],n[n.length-1])&&n.pop(),Se(n)>0&&n.reverse(),!r&&t&&k(t)&&t>0&&function(e,t){void 0===t&&(t=1/0);for(var n=0;nt;)o=P(r,o,.5),e.splice(n+1,0,o)}(n,t),n}function j(e,t,n){var r;return V(e,(r=e.length-t.length)<0?-1*r:0),V(t,r>0?r:0),Ze(e,t),R(e,t,n)}function K(e,t,n){n=n||2;var r,o,i,a,s,u,l,c=t&&t.length,f=c?t[0]*n:e.length,d=W(e,0,f,n,!0),h=[];if(!d)return h;if(c&&(d=function(e,t,n,r){var o,i,a,s,u,l=[];for(o=0,i=t.length;o80*n){r=i=e[0],o=a=e[1];for(var p=n;pi&&(i=s),u>a&&(a=u);l=Math.max(i-r,a-o)}return z(d,h,n,r,o,l),h}function W(e,t,n,r,o){var i,a;if(o===fe(e,t,n,r)>0)for(i=t;i=t;i-=r)a=ue(i,e[i],e[i+1],a);return a&&oe(a,a.next)&&(le(a),a=a.next),a}function q(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!oe(r,r.next)&&0!==re(r.prev,r,r.next))r=r.next;else{if(le(r),(r=t=r.prev)===r.next)return null;n=!0}}while(n||r!==t);return t}function z(e,t,n,r,o,i,a){if(e){!a&&i&&function(e,t,n,r){var o=e;do{null===o.z&&(o.z=Q(o.x,o.y,t,n,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var t,n,r,o,i,a,s,u,l=1;do{for(n=e,e=null,i=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||u>0&&r;)0===s?(o=r,r=r.nextZ,u--):0!==u&&r?n.z<=r.z?(o=n,n=n.nextZ,s--):(o=r,r=r.nextZ,u--):(o=n,n=n.nextZ,s--),i?i.nextZ=o:e=o,o.prevZ=i,i=o;n=r}i.nextZ=null,l*=2}while(a>1)}(o)}(e,r,o,i);for(var s,u,l=e;e.prev!==e.next;)if(s=e.prev,u=e.next,i?J(e,r,o,i):H(e))t.push(s.i/n),t.push(e.i/n),t.push(u.i/n),le(e),e=u.next,l=u.next;else if((e=u)===l){a?1===a?z(e=Z(e,t,n),t,n,r,o,i,2):2===a&&Y(e,t,n,r,o,i):z(q(e),t,n,r,o,i,1);break}}}function H(e){var t=e.prev,n=e,r=e.next;if(re(t,n,r)>=0)return!1;for(var o=e.next.next;o!==e.prev;){if(te(t.x,t.y,n.x,n.y,r.x,r.y,o.x,o.y)&&re(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function J(e,t,n,r){var o=e.prev,i=e,a=e.next;if(re(o,i,a)>=0)return!1;for(var s=o.xi.x?o.x>a.x?o.x:a.x:i.x>a.x?i.x:a.x,c=o.y>i.y?o.y>a.y?o.y:a.y:i.y>a.y?i.y:a.y,f=Q(s,u,t,n,r),d=Q(l,c,t,n,r),h=e.nextZ;h&&h.z<=d;){if(h!==e.prev&&h!==e.next&&te(o.x,o.y,i.x,i.y,a.x,a.y,h.x,h.y)&&re(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(h=e.prevZ;h&&h.z>=f;){if(h!==e.prev&&h!==e.next&&te(o.x,o.y,i.x,i.y,a.x,a.y,h.x,h.y)&&re(h.prev,h,h.next)>=0)return!1;h=h.prevZ}return!0}function Z(e,t,n){var r=e;do{var o=r.prev,i=r.next.next;!oe(o,i)&&ie(o,r,r.next,i)&&ae(o,i)&&ae(i,o)&&(t.push(o.i/n),t.push(r.i/n),t.push(i.i/n),le(r),le(r.next),r=e=i),r=r.next}while(r!==e);return r}function Y(e,t,n,r,o,i){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ne(a,s)){var u=se(a,s);return a=q(a,a.next),u=q(u,u.next),z(a,t,n,r,o,i),void z(u,t,n,r,o,i)}s=s.next}a=a.next}while(a!==e)}function X(e,t){return e.x-t.x}function $(e,t){if(t=function(e,t){var n,r=t,o=e.x,i=e.y,a=-1/0;do{if(i<=r.y&&i>=r.next.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=o&&s>a){if(a=s,s===o){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x=r.x&&r.x>=c&&te(in.x)&&ae(r,e)&&(n=r,d=u),r=r.next;return n}(e,t)){var n=se(t,e);q(n,n.next)}}function Q(e,t,n,r,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/o)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)/o)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function ee(e){var t=e,n=e;do{t.x=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(i-s)-(o-a)*(r-s)>=0}function ne(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&ie(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&ae(e,t)&&ae(t,e)&&function(e,t){var n=e,r=!1,o=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&o<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function re(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function oe(e,t){return e.x===t.x&&e.y===t.y}function ie(e,t,n,r){return!!(oe(e,t)&&oe(n,r)||oe(e,r)&&oe(n,t))||re(e,t,n)>0!=re(e,t,r)>0&&re(n,r,e)>0!=re(n,r,t)>0}function ae(e,t){return re(e.prev,e,e.next)<0?re(e,t,e.next)>=0&&re(e,e.prev,t)>=0:re(e,t,e.prev)<0||re(e,e.next,t)<0}function se(e,t){var n=new ce(e.i,e.x,e.y),r=new ce(t.i,t.x,t.y),o=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function ue(e,t,n,r){var o=new ce(e,t,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function le(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function ce(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function fe(e,t,n,r){for(var o=0,i=t,a=n-r;i1)for(var a,s,u=1,l=r(i[0]);ul&&(s=i[0],i[0]=i[u],i[u]=s,l=a);return i}))}}function ve(e,t,n){void 0===n&&(n={});var r=n.maxSegmentLength;void 0===r&&(r=10);var o=n.string;void 0===o&&(o=!0);var i=n.single;void 0===i&&(i=!1);var a=U(e,r);a.lengthMath.abs(l-i)?(l-o)/u:u/(l-i))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(l),this.ry=Math.sqrt(c)):(this.ax+=90,this.rx=Math.sqrt(c),this.ry=Math.sqrt(l)),this},p.prototype.isDegenerate=function(){return this.rx<1e-10*this.ry||this.ry<1e-10*this.rx};var Pe=p;v.prototype.__matrix=function(e){var t,n=this;e.queue.length&&this.iterate((function(r,o,i,a){var s,u,l,c;switch(r[0]){case"v":u=0===(s=e.calc(0,r[1],!0))[0]?["v",s[1]]:["l",s[0],s[1]];break;case"V":u=(s=e.calc(i,r[1],!1))[0]===e.calc(i,a,!1)[0]?["V",s[1]]:["L",s[0],s[1]];break;case"h":u=0===(s=e.calc(r[1],0,!0))[1]?["h",s[0]]:["l",s[0],s[1]];break;case"H":u=(s=e.calc(r[1],a,!1))[1]===e.calc(i,a,!1)[1]?["H",s[0]]:["L",s[0],s[1]];break;case"a":case"A":var f=e.toArray(),d=Pe(r[1],r[2],r[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(r[5]=r[5]?"0":"1"),s=e.calc(r[6],r[7],"a"===r[0]),"A"===r[0]&&r[6]===i&&r[7]===a||"a"===r[0]&&0===r[6]&&0===r[7]){u=["a"===r[0]?"l":"L",s[0],s[1]];break}u=d.isDegenerate()?["a"===r[0]?"l":"L",s[0],s[1]]:[r[0],d.rx,d.ry,d.ax,r[4],r[5],s[0],s[1]];break;case"m":c=o>0,u=["m",(s=e.calc(r[1],r[2],c))[0],s[1]];break;default:for(u=[l=r[0]],c=l.toLowerCase()===l,t=1;t=0;)e.matrix(this.__stack[t].toArray());this.__matrix(e),this.__stack=[]}},v.prototype.toString=function(){var e,t,n=this,r=[];this.__evaluateStack();for(var o=0;o0&&"m"!==t&&"M"!==t&&t===n.segments[o-1][0],r=r.concat(e?n.segments[o].slice(1):n.segments[o]);return r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")},v.prototype.translate=function(e,t){return this.__stack.push(Ce().translate(e,t||0)),this},v.prototype.scale=function(e,t){return this.__stack.push(Ce().scale(e,t||0===t?t:e)),this},v.prototype.rotate=function(e,t,n){return this.__stack.push(Ce().rotate(e,t||0,n||0)),this},v.prototype.skewX=function(e){return this.__stack.push(Ce().skewX(e)),this},v.prototype.skewY=function(e){return this.__stack.push(Ce().skewY(e)),this},v.prototype.matrix=function(e){return this.__stack.push(Ce().matrix(e)),this},v.prototype.transform=function(e){return e.trim()?(this.__stack.push(function(e){var t,n,r=new Ce;return e.split(Oe).forEach((function(e){if(e.length){if(void 0!==be[e])return void(t=e);switch(n=e.split(Me).map((function(e){return+e||0})),t){case"matrix":return void(6===n.length&&r.matrix(n));case"scale":return void(1===n.length?r.scale(n[0],n[0]):2===n.length&&r.scale(n[0],n[1]));case"rotate":return void(1===n.length?r.rotate(n[0],0,0):3===n.length&&r.rotate(n[0],n[1],n[2]));case"translate":return void(1===n.length?r.translate(n[0],0):2===n.length&&r.translate(n[0],n[1]));case"skewX":return void(1===n.length&&r.skewX(n[0]));case"skewY":return void(1===n.length&&r.skewY(n[0]))}}})),r}(e)),this):this},v.prototype.round=function(e){var t,n=0,r=0,o=0,i=0;return e=e||0,this.__evaluateStack(),this.segments.forEach((function(a){var s=a[0].toLowerCase()===a[0];switch(a[0]){case"H":case"h":return s&&(a[1]+=o),o=a[1]-a[1].toFixed(e),void(a[1]=+a[1].toFixed(e));case"V":case"v":return s&&(a[1]+=i),i=a[1]-a[1].toFixed(e),void(a[1]=+a[1].toFixed(e));case"Z":case"z":return o=n,void(i=r);case"M":case"m":return s&&(a[1]+=o,a[2]+=i),o=a[1]-a[1].toFixed(e),i=a[2]-a[2].toFixed(e),n=o,r=i,a[1]=+a[1].toFixed(e),void(a[2]=+a[2].toFixed(e));case"A":case"a":return s&&(a[6]+=o,a[7]+=i),o=a[6]-a[6].toFixed(e),i=a[7]-a[7].toFixed(e),a[1]=+a[1].toFixed(e),a[2]=+a[2].toFixed(e),a[3]=+a[3].toFixed(e+2),a[6]=+a[6].toFixed(e),void(a[7]=+a[7].toFixed(e));default:return t=a.length,s&&(a[t-2]+=o,a[t-1]+=i),o=a[t-2]-a[t-2].toFixed(e),i=a[t-1]-a[t-1].toFixed(e),void a.forEach((function(t,n){n&&(a[n]=+a[n].toFixed(e))}))}})),this},v.prototype.iterate=function(e,t){var n,r,o,i=this.segments,a={},s=!1,u=0,l=0,c=0,f=0;if(t||this.__evaluateStack(),i.forEach((function(t,n){var r=e(t,n,u,l);Array.isArray(r)&&(a[n]=r,s=!0);var o=t[0]===t[0].toLowerCase();switch(t[0]){case"m":case"M":return u=t[1]+(o?u:0),l=t[2]+(o?l:0),c=u,void(f=l);case"h":case"H":return void(u=t[1]+(o?u:0));case"v":case"V":return void(l=t[1]+(o?l:0));case"z":case"Z":return u=c,void(l=f);default:u=t[t.length-2]+(o?u:0),l=t[t.length-1]+(o?l:0)}})),!s)return this;for(o=[],n=0;n1&&(a*=Math.sqrt(v),s*=Math.sqrt(v));var g=d(e,t,n,r,o,i,a,s,l,c),m=[],y=g[2],E=g[3],S=Math.max(Math.ceil(Math.abs(E)/(Ie/4)),1);E/=S;for(var _=0;_2&&(t.push([n].concat(r.splice(0,2))),o="l",n="m"===n?"l":"L");r.length>=0;){if(r.length===ke[o])return r.unshift(n),t.push(r);if(r.length0?{x:n.x/r,y:n.y/r}:{x:0,y:0}},getPropertiesAtLength:function(e){var t,n=E(e,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),r=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],n),o=Math.sqrt(r.x*r.x+r.y*r.y);t=o>0?{x:r.x/o,y:r.y/o}:{x:0,y:0};var i=this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],n);return{x:i.x,y:i.y,tangentX:t.x,tangentY:t.y}}};var Ge=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],Ve=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],Ue=[[1],[1,1],[1,2,1],[1,3,3,1]],je=2*Math.PI,Ke=function(e,t,n,r,o,i,a,s,u){var l=Math.sin(o*je/360),c=Math.cos(o*je/360),f=c*(e-s)/2+l*(t-u)/2,d=-l*(e-s)/2+c*(t-u)/2;if(0===f&&0===d)return[];if(0===n||0===r)return[];n=Math.abs(n),r=Math.abs(r);var h=f*f/(n*n)+d*d/(r*r);h>1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));var p=function(e,t,n,r,o,i,a,s,u,l){var c=l*(e-n)/2+u*(t-r)/2,f=-u*(e-n)/2+l*(t-r)/2,d=a*a,h=s*s,p=c*c,v=f*f,g=d*h-d*v-h*p;g<0&&(g=0),g/=d*v+h*p;var m=(g=Math.sqrt(g)*(o===i?-1:1))*a/s*f,y=g*-s/a*c,E=l*m-u*y+(e+n)/2,S=u*m+l*y+(t+r)/2,_=(c-m)/a,x=(f-y)/s,A=(-c-m)/a,N=(-f-y)/s,w=b(1,0,_,x),C=b(_,x,A,N);return 0===i&&C>0&&(C-=je),1===i&&C<0&&(C+=je),[E,S,w,C]}(e,t,s,u,i,a,n,r,l,c),v=[],g=p[2],m=p[3],y=Math.max(Math.ceil(Math.abs(m)/(je/4)),1);m/=y;for(var E=0;Ethis.length&&(e=this.length);for(var t=this.partialLengths.length-1;this.partialLengths[t]>=e&&this.partialLengths[t]>0;)t--;tthis.length&&(e=this.length);for(var t=this.partialLengths.length-1;this.partialLengths[t]>=e&&this.partialLengths[t]>0;)t--;t0&&["C","c","S","s"].indexOf(a[l-1][0])>-1?new Be(s[0],s[1],2*s[0]-a[l-1][a[l-1].length-4],2*s[1]-a[l-1][a[l-1].length-3],a[l][1],a[l][2],a[l][3],a[l][4]):new Be(s[0],s[1],s[0],s[1],a[l][1],a[l][2],a[l][3],a[l][4]),n+=i.getTotalLength(),s=[a[l][3],a[l][4]],o.push(i)):"s"===a[l][0]?(i=l>0&&["C","c","S","s"].indexOf(a[l-1][0])>-1?new Be(s[0],s[1],s[0]+i.d.x-i.c.x,s[1]+i.d.y-i.c.y,s[0]+a[l][1],s[1]+a[l][2],s[0]+a[l][3],s[1]+a[l][4]):new Be(s[0],s[1],s[0],s[1],s[0]+a[l][1],s[1]+a[l][2],s[0]+a[l][3],s[1]+a[l][4]),n+=i.getTotalLength(),s=[a[l][3]+s[0],a[l][4]+s[1]],o.push(i)):"Q"===a[l][0]?(i=new Be(s[0],s[1],a[l][1],a[l][2],a[l][3],a[l][4]),n+=i.getTotalLength(),o.push(i),s=[a[l][3],a[l][4]],u=[a[l][1],a[l][2]]):"q"===a[l][0]?(i=new Be(s[0],s[1],s[0]+a[l][1],s[1]+a[l][2],s[0]+a[l][3],s[1]+a[l][4]),n+=i.getTotalLength(),u=[s[0]+a[l][1],s[1]+a[l][2]],s=[a[l][3]+s[0],a[l][4]+s[1]],o.push(i)):"T"===a[l][0]?(i=l>0&&["Q","q","T","t"].indexOf(a[l-1][0])>-1?new Be(s[0],s[1],2*s[0]-u[0],2*s[1]-u[1],a[l][1],a[l][2]):new qe(s[0],a[l][1],s[1],a[l][2]),o.push(i),n+=i.getTotalLength(),u=[2*s[0]-u[0],2*s[1]-u[1]],s=[a[l][1],a[l][2]]):"t"===a[l][0]?(i=l>0&&["Q","q","T","t"].indexOf(a[l-1][0])>-1?new Be(s[0],s[1],2*s[0]-u[0],2*s[1]-u[1],s[0]+a[l][1],s[1]+a[l][2]):new qe(s[0],s[0]+a[l][1],s[1],s[1]+a[l][2]),n+=i.getTotalLength(),u=[2*s[0]-u[0],2*s[1]-u[1]],s=[a[l][1]+s[0],a[l][2]+s[0]],o.push(i)):"A"===a[l][0]?(i=new We(s[0],s[1],a[l][1],a[l][2],a[l][3],a[l][4],a[l][5],a[l][6],a[l][7]),n+=i.getTotalLength(),s=[a[l][6],a[l][7]],o.push(i)):"a"===a[l][0]&&(i=new We(s[0],s[1],a[l][1],a[l][2],a[l][3],a[l][4],a[l][5],s[0]+a[l][6],s[1]+a[l][7]),n+=i.getTotalLength(),s=[s[0]+a[l][6],s[1]+a[l][7]],o.push(i)),r.push(n);return t}var n=0,r=[],o=[];t.getTotalLength=function(){return n},t.getPointAtLength=function(e){var t=i(e);return o[t.i].getPointAtLength(t.fraction)},t.getTangentAtLength=function(e){var t=i(e);return o[t.i].getTangentAtLength(t.fraction)},t.getPropertiesAtLength=function(e){var t=i(e);return o[t.i].getPropertiesAtLength(t.fraction)};var i=function(e){e<0?e=0:e>n&&(e=n);for(var t=r.length-1;r[t]>=e&&r[t]>0;)t--;return t++,{fraction:e-r[t-1],i:t}};return t(e)},He='All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).\nExample valid ways of supplying a shape would be:\n[[0, 0], [10, 0], [10, 10]]\n"M0,0 L10,0 L10,10Z"\n',Je="flubber.all() expects two arrays of equal length as arguments. Each element in both arrays should be an array of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).",Ze=function(e,t){for(var n,r,o,i=e.length,a=1/0,s=0;s0&&(r+=e[o-1].length,n.holes.push(r))}return n};var Xe=function(e){return e},$e=function(e){if(null==e)return Xe;var t,n,r=e.scale[0],o=e.scale[1],i=e.translate[0],a=e.translate[1];return function(e,s){s||(t=n=0);var u=2,l=e.length,c=new Array(l);for(c[0]=(t+=e[0])*r+i,c[1]=(n+=e[1])*o+a;u>>1;e[o]t?1:e>=t?0:NaN},it=function(e){return 1===e.length&&(e=function(e){return function(t,n){return ot(e(t),n)}}(e)),{left:function(t,n,r,o){for(null==r&&(r=0),null==o&&(o=t.length);r>>1;e(t[i],n)<0?r=i+1:o=i}return r},right:function(t,n,r,o){for(null==r&&(r=0),null==o&&(o=t.length);r>>1;e(t[i],n)>0?o=i:r=i+1}return r}}},at=(it(ot).right,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2),function(e,t){return function(e,t){for(var n=e.objects.triangles.geometries,r=it((function(e){return e.area})).left;n.length>t;)!function(){var t=n[0],o=rt(n)[0][0],i=n[o],a=pe(e,[t,i]);a.area=t.area+i.area,a.type="Polygon",a.arcs=a.arcs[0],n.splice(o,1),n.shift(),n.splice(r(n,a.area),0,a)}();if(t>n.length)throw new RangeError("Can't collapse topology into "+t+" pieces.");return et(e,e.objects.triangles).features.map((function(e){return e.geometry.coordinates[0].pop(),e.geometry.coordinates[0]}))}(function(e,t){var n={},r={type:"Topology",objects:{triangles:{type:"GeometryCollection",geometries:[]}},arcs:[]};return e.forEach((function(e){var o=[];e.forEach((function(e,i){var a=e[0]8)return e.map((function(e,t){return t}));var n=e.map((function(e){return t.map((function(t){return function(e,t){var n=T(D(e),D(t));return n*n}(e,t)}))}));return function(e,t,n){var r=1/0,o=e.map((function(e,t){return t}));return function e(t,i,a){void 0===i&&(i=[]),void 0===a&&(a=0);for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{},t=Ae++,n=e.placeholder,r=e.when,i=e.style,a=void 0===i?{}:i;function s(e,n,o){if(!n.query(r,e))return o();var i=o(),a=e.texts(),s=_e(a,1)[0],u=e.texts({direction:"backward"}),l=_e(u,1)[0],c=_e(s,2),f=c[0],d=c[1],h=_e(l,2),p=h[0],v=h[1],g={type:"placeholder",data:{key:t},anchor:{key:f.key,offset:0,path:d},focus:{key:p.key,offset:p.text.length,path:v}};return[].concat(xe(i),[g])}function u(e,r,i){var s=e.children,u=e.decoration;if("placeholder"===u.type&&u.data.get("key")===t){var l=Se({pointerEvents:"none",display:"inline-block",width:"0",maxWidth:"100%",whiteSpace:"nowrap",opacity:"0.333",verticalAlign:"text-top"},a);return o.a.createElement("span",null,o.a.createElement("span",{contentEditable:!1,style:l},n),s)}return i()}return Ee("string"==typeof n,"You must pass `SlateReactPlaceholder` an `options.placeholder` string."),Ee("string"==typeof r||"function"==typeof r,"You must pass `SlateReactPlaceholder` an `options.when` query."),{decorateNode:s,renderDecoration:u}};function we(e,t){function n(n,r,o,i,a){var s=r[o];return null!=s||n?null==s&&n?new Error("The "+a+" `"+o+"` is marked as required in `"+i+"`, but it was not supplied."):t(s)?null:new Error("Invalid "+a+" `"+o+"` supplied to `"+i+"`, expected a Slate `"+e+"` but received: "+s):null}function r(){for(var e=arguments.length,t=Array(e),r=0;r",(function(e){return q.Block.isBlockList(e)})),change:we("Change",(function(e){return q.Change.isChange(e)})),data:we("Data",(function(e){return q.Data.isData(e)})),document:we("Document",(function(e){return q.Document.isDocument(e)})),inline:we("Inline",(function(e){return q.Inline.isInline(e)})),inlines:we("Inline",(function(e){return q.Inline.isInlineList(e)})),leaf:we("Leaf",(function(e){return q.Leaf.isLeaf(e)})),leaves:we("List",(function(e){return q.Leaf.isLeafList(e)})),mark:we("Mark",(function(e){return q.Mark.isMark(e)})),marks:we("Set",(function(e){return q.Mark.isMarkSet(e)})),node:we("Node",(function(e){return q.Node.isNode(e)})),nodes:we("List",(function(e){return q.Node.isNodeList(e)})),range:we("Range",(function(e){return q.Range.isRange(e)})),ranges:we("List",(function(e){return q.Range.isRangeList(e)})),selection:we("Selection",(function(e){return q.Selection.isSelection(e)})),value:we("Value",(function(e){return q.Value.isValue(e)})),text:we("Text",(function(e){return q.Text.isText(e)})),texts:we("List",(function(e){return q.Text.isTextList(e)}))},be=function(e,t){return e===t};var Oe=function(e,t){var n;void 0===t&&(t=be);var r,o=[],i=!1,a=function(e,n){return t(e,o[n],n)};return function(){for(var t=arguments.length,s=new Array(t),u=0;u1||1===a.nodes.size&&" "!==a.nodes.first().text){var c=function(e){var r=l.length,s=function(e){e?n.tmp.nodeRefs[r]=e:delete n.tmp.nodeRefs[r]};if("inline"===e.object)l.push(o.a.createElement(t,{ref:s,key:e.key,editor:i,node:e,parent:a}));else{var c=u.map((function(e){return tt(a,r,e)})).filter((function(e){return e}));l.push(o.a.createElement($e,{ref:s,key:e.key,editor:i,node:e,parent:a,decorations:c}))}},f=!0,d=!1,h=void 0;try{for(var p,v=a.nodes[Symbol.iterator]();!(f=(p=v.next()).done);f=!0){c(p.value)}}catch(e){d=!0,h=e}finally{try{!f&&v.return&&v.return()}finally{if(d)throw h}}}var g=(Ke(e={},De,a.object),Ke(e,Pe,a.key),Ke(e,"ref",this.ref),e);return i.run("renderInline",{attributes:g,children:l,editor:i,node:a,parent:s})}}]),t}(o.a.Component),et=function(e){function t(){var e,n,r;Ue(this,t);for(var i=arguments.length,a=Array(i),s=0;sc+s&&(D=k+p+y-s),Rl+u&&(L=R+h+g+a.height-u),r?t.scrollTo(D,L):(n.scrollTop=L,n.scrollLeft=D)}}function at(e){if(B){var t=window.document.body.createTextRange();t.collapse(),t.select()}else e.removeAllRanges()}var st=/Permission denied to access property "nodeType"/,ut=X()("slate:content");ut.update=X()("slate:update");var lt=function(e){function t(){var e,n,r;Ue(this,t);for(var i=arguments.length,a=Array(i),s=0;s0&&void 0!==arguments[0]?arguments[0]:{},t=ft.reduce((function(t,n){return n in e&&(t[n]=e[n]),t}),{});return t}function ht(){return{decorateNode:function(){return[]},renderAnnotation:function(e){var t=e.attributes,n=e.children;return o.a.createElement("span",t,n)},renderBlock:function(e){var t=e.attributes,n=e.children;return o.a.createElement("div",We({},t,{style:{position:"relative"}}),n)},renderDecoration:function(e){var t=e.attributes,n=e.children;return o.a.createElement("span",t,n)},renderDocument:function(e){return e.children},renderEditor:function(e){return e.children},renderInline:function(e){var t=e.attributes,n=e.children;return o.a.createElement("span",We({},t,{style:{position:"relative"}}),n)},renderMark:function(e){var t=e.attributes,n=e.children;return o.a.createElement("span",t,n)}}}function pt(e){return null==e?null:(null==e.closest&&(e=e.parentElement),e.hasAttribute(Ve.KEY)?e:e.closest(Ve.KEY))}function vt(e,t,n){try{return{failed:!1,value:n()}}catch(n){console.warn("Safely handling caught error, reconciling dom",n);var r=pt(t);if(null==r)return{failed:!0};var o=r.getAttribute(Pe),i=e.value.document.getNode(o);if(null==i)return{failed:!0};var a="block"===i.object?i:e.value.document.getClosestBlock(i.key);if(null==a)return{failed:!0};var s=e.value.document.nodes.indexOf(a),u=window.getSelection();if(null!=u&&u.isCollapsed&&a===i&&s>=0&&"DIV"===r.tagName&&1===r.childNodes.length&&(r.childNodes[0]===u.anchorNode||r===u.anchorNode)){console.log(" replacing entire line via dom text"),e.replaceNodeByKey(a.key,q.Block.create({type:"line",nodes:[q.Text.create({text:r.textContent})]}));var l={key:e.value.document.nodes.get(s).nodes.first().key,offset:u.anchorOffset};e.select(q.Range.create({anchor:l,focus:l}))}else console.log(" replacing entire line"),e.replaceNodeByKey(a.key,q.Block.create(a.toJSON()));return{failed:!0}}}function gt(e,t){var n=e.value,r=n.document,o=n.selection,i=r.getPath(t.key),a=e.findDOMNode(i),s=r.getClosestBlock(i),u=t.text,l=a.textContent,c=s.nodes.last()===t,f=l.charAt(l.length-1);if(c&&"\n"===f&&(l=l.slice(0,-1)),u.replace(/[\uFEFF\b]/g,"")!==l.replace(/[\uFEFF\b]/g,"")){var d=o.moveAnchorTo(i,0).moveFocusTo(i,u.length);d=r.resolveRange(d),console.warn("!! Forced to reconcile dom node :(("),e.insertTextAtRange(d,l.replace(/[\uFEFF\b]/g,""),t.marks)}}function mt(e,t){return vt(e,t,(function(){var n=t.parentElement.closest("[data-key]"),r=e.findNode(n);gt(e,r)})).value}function yt(){return{commands:{reconcileNode:gt,reconcileDOMNode:mt}}}function Et(){function e(e,t){t=q.PathUtils.create(t);var n=e.tmp.contentRef.current;if(!n)return null;if(!t.size)return n.ref.current||null;return function e(t,n){if(!t)return null;if(!n.size)return t.ref?t.ref.current||null:t||null;var r=n.first(),o=n.rest();return e(t.tmp.nodeRefs[r],o)}(n.tmp.nodeRef.current,t)}function t(t,n){var r=e(t,n.path),o=0;if(!r)return null;var i=Array.from(r.querySelectorAll(Ve.STRING+", "+Ve.ZERO_WIDTH)),a=!0,s=!1,u=void 0;try{for(var l,c=i[Symbol.iterator]();!(a=(l=c.next()).done);a=!0){var f=l.value,d=f.childNodes[0],h=d.textContent.length,p=h;f.hasAttribute(ke)&&(p=parseInt(f.getAttribute(ke),10));var v=o+p;if(n.offset<=v)return{node:d,offset:Math.min(h,Math.max(0,n.offset-o))};o=v}}catch(e){s=!0,u=e}finally{try{!a&&c.return&&c.return()}finally{if(s)throw u}}return null}function n(e,t){var n=e.tmp.contentRef.current,r=t;r.hasAttribute(Pe)||(r=r.closest(Ve.KEY));var o=null==r?null:r.getAttribute(Pe);if(!r||!o)return null;if(r===n.ref.current)return q.PathUtils.create([]);var i=e.value.document.getPath(o);if(i)return i;var a=function e(t,n){if(r===t)return n;if(!t.ref)return null;if(r===t.ref.current)return n;if(!t.tmp)return null;var o=t.tmp.nodeRefs,i=Object.keys(o),a=!0,s=!1,u=void 0;try{for(var l,c=i[Symbol.iterator]();!(a=(l=c.next()).done);a=!0){var f=l.value,d=o[f],h=parseInt(f,10),p=e(d,[].concat(Je(n),[h]));if(p)return p}}catch(e){s=!0,u=e}finally{try{!a&&c.return&&c.return()}finally{if(s)throw u}}return null}(n.tmp.nodeRef.current,[]);return a?q.PathUtils.create(a):null}function r(e,t,r){var o=function(e,t){if(1===e.nodeType&&e.childNodes.length){var n=0===t,r=n?"forward":"backward";for(e=St(e,n?t:t-1,r);1===e.nodeType&&e.childNodes.length;){var o=n?0:e.childNodes.length-1;e=St(e,o,r)}t=n?0:e.textContent.length}return{node:e,offset:t}}(t,r),i=o.node,a=o.offset,s=H()(t),u=i.parentNode,l=u.closest(Ve.LEAF),c=void 0,f=void 0,d=void 0;if(l){c=l.closest(Ve.TEXT);var h=s.document.createRange();h.setStart(c,0),h.setEnd(i,a);var p=h.cloneContents(),v=p.querySelectorAll(Ve.ZERO_WIDTH);Array.from(v).forEach((function(e){e.parentNode.removeChild(e)})),f=p.textContent.length,d=c}else{var g=u.closest(Ve.VOID);if(!g)return null;if(!(l=g.querySelector(Ve.LEAF)))return null;c=l.closest(Ve.TEXT),f=(d=l).textContent.length}f===d.textContent.length&&u.hasAttribute(Ge)&&f--;var m=n(e,c);return m?e.value.document.createPoint({path:m,offset:f}):null}function o(e,t){var n=t.anchorNode||t.startContainer;if(!n)return null;var o=H()(n);(t instanceof o.Range||o.StaticRange&&t instanceof o.StaticRange)&&(t={anchorNode:t.startContainer,anchorOffset:t.startOffset,focusNode:t.endContainer,focusOffset:t.endOffset});var i=t,a=i.anchorNode,s=i.anchorOffset,u=i.focusNode,l=i.focusOffset,c=i.isCollapsed,f=e.value,d=r(e,a,s),h=c?d:r(e,u,l);return d&&h?f.document.createRange({anchor:d,focus:h}):null}return{queries:{findDOMNode:e,findDOMPoint:t,findDOMRange:function(e,n){var r=n.anchor,o=n.focus,i=n.isBackward,a=n.isCollapsed,s=t(e,r),u=a?s:t(e,o);if(!s||!u)return null;var l=H()(s.node).document.createRange(),c=i?u:s,f=i?s:u;return l.setStart(c.node,c.offset),l.setEnd(f.node,f.offset),l},findEventRange:function(e,t){t.nativeEvent&&(t=t.nativeEvent);var r=t,i=r.clientX,a=r.clientY,s=r.target;if(null==i||null==a)return null;var u=e.value.document,l=n(e,t.target);if(!l)return null;var c=u.getNode(l);if(e.isVoid(c)){var f=s.getBoundingClientRect(),d="inline"===c.object?i-f.left=r.length?(a=!0,i=t-1,n="backward"):i<0?(s=!0,i=t+1,n="forward"):(o=r[i],"forward"===n&&i++,"backward"===n&&i--);return o||null}var _t={FRAGMENT:"application/x-slate-fragment",HTML:"text/html",NODE:"application/x-slate-node",RICH:"text/rtf",TEXT:"text/plain"},xt=_t.FRAGMENT,At=_t.HTML,Nt=_t.TEXT;function wt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};Object(ye.default)(!q.Value.isValue(t),"As of Slate 0.42.0, the `cloneFragment` utility takes an `editor` instead of a `value`.");var r=H()(e.target),o=r.getSelection(),i=t.value,a=i.document,s=i.fragment,u=i.selection,l=u.start,c=u.end,f=a.getClosestVoid(l.path,t),d=a.getClosestVoid(c.path,t);if(!o.isCollapsed||f){var h=ge.serializeNode(s),p=o.getRangeAt(0),v=p.cloneContents(),g=v.childNodes[0];if(v.childNodes.forEach((function(e){e.textContent&&""!==e.textContent.trim()&&(g=e)})),d){var m=p.cloneRange(),y=a.getPath(d.key);if(y){var E=t.findDOMNode(y);m.setEndAfter(E),v=m.cloneContents()}}if(f&&(g=v.childNodes[0].childNodes[1].firstChild),[].slice.call(v.querySelectorAll(Ve.ZERO_WIDTH)).forEach((function(e){var t="n"===e.getAttribute(Ge);e.textContent=t?"\n":""})),3===g.nodeType){var S=r.document.createElement("span");S.style.whiteSpace="pre",S.appendChild(g),v.appendChild(S),g=S}g.setAttribute(Te,h);var _=q.Value.create({document:s}),x=me.default.serialize(_),A=r.document.createElement("div");if(A.appendChild(v),e.clipboardData&&e.clipboardData.setData&&!B)return e.preventDefault(),e.clipboardData.setData(Nt,x),e.clipboardData.setData(xt,h),e.clipboardData.setData(At,A.innerHTML),void n();var N=e.target.closest(Ve.EDITOR);A.setAttribute("contenteditable",!0),A.style.position="absolute",A.style.left="-9999px",N.appendChild(A),o.selectAllChildren(A),r.requestAnimationFrame((function(){N.removeChild(A),at(o),o.addRange(p),n()}))}}var Ct=_t.FRAGMENT,bt=_t.HTML,Ot=_t.NODE,Mt=_t.RICH,It=_t.TEXT,Tt=/ data-slate-fragment="([^\s"]+)"/;function Pt(e){!B&&e.nativeEvent&&(e=e.nativeEvent);var t=e.dataTransfer||e.clipboardData,n=Rt(t,Ct),r=Rt(t,Ot),o=Rt(t,bt),i=Rt(t,Mt),a=Rt(t,It),s=void 0;if(!n&&o&&~o.indexOf(" "+Te+'="')){var u=Tt.exec(o),l=He(u,2),c=(l[0],l[1]);c&&(n=c)}if(a){var f=function(e){var t="SLATE-DATA-EMBED::";if(e.substring(0,t.length)!==t)return{TEXT:e};try{return JSON.parse(e.substring(t.length))}catch(e){throw new Error("Unable to parse custom Slate drag event data.")}}(a);f[Ct]&&(n=f[Ct]),f[Ot]&&(r=f[Ot]),f[It]&&(a=f[It])}n&&(n=ge.deserializeNode(n)),r&&(r=ge.deserializeNode(r));try{t.items&&t.items.length?s=Array.from(t.items).map((function(e){return"file"===e.kind?e.getAsFile():null})).filter((function(e){return e})):t.files&&t.files.length&&(s=Array.from(t.files))}catch(e){t.files&&t.files.length&&(s=Array.from(t.files))}var d={files:s,fragment:n,html:o,node:r,rich:i,text:a};return d.type=function(e){return e.fragment?"fragment":e.node?"node":e.rich&&e.html?"html":e.rich&&e.text?"text":e.files&&e.files.length?"files":e.html?"html":e.text?"text":"unknown"}(d),d}function Rt(e,t){return e.types&&e.types.length?-1!==Array.from(e.types).indexOf(t)&&e.getData(t)||null:t===It&&e.getData("Text")||null}var kt=_t.TEXT;function Dt(e,t,n){var r=_t[t.toUpperCase()];if(!r)throw new Error('Cannot set unknown transfer type "'+r+'".');e.nativeEvent&&(e=e.nativeEvent);var o=e.dataTransfer||e.clipboardData;try{o.setData(r,n),o.setData("text",o.getData("text"))}catch(e){var i="SLATE-DATA-EMBED::",a=o.getData(kt),s={};if(a.substring(0,i.length)===i)try{s=JSON.parse(a.substring(i.length))}catch(e){throw new Error("Failed to parse Slate data from `DataTransfer` object.")}else s[kt]=a;s[r]=n;var u=""+i+JSON.stringify(s);o.setData(kt,u)}}var Lt=X()("slate:after");function Ft(){var e=null,t=!1;return{onBeforeInput:function(e,t,n){var r=t.value,o=e.getTargetRanges(),i=He(o,1)[0];if(!i)return n();Lt("onBeforeInput",{event:e}),e.preventDefault();var a=r.document,s=r.selection,u=t.findRange(i);switch(e.inputType){case"deleteByDrag":case"deleteByCut":case"deleteContent":case"deleteContentBackward":case"deleteContentForward":t.deleteAtRange(u);break;case"deleteWordBackward":t.deleteWordBackwardAtRange(u);break;case"deleteWordForward":t.deleteWordForwardAtRange(u);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":t.deleteLineBackwardAtRange(u);break;case"deleteSoftLineForward":case"deleteHardLineForward":t.deleteLineForwardAtRange(u);break;case"insertLineBreak":case"insertParagraph":a.hasVoidParent(s.start.path,t)?t.moveToStartOfNextText():t.splitBlockAtRange(u);break;case"insertFromYank":case"insertReplacementText":case"insertText":var l=null==e.data?e.dataTransfer.getData("text/plain"):e.data;if(null==l)break;t.insertTextAtRange(u,l,s.marks),s.marks&&r.document!==t.value.document&&t.select({marks:null})}n()},onBlur:function(e,t,n){Lt("onBlur",{event:e}),t.blur(),n()},onClick:function(e,t,n){if(t.readOnly)return n();var r=t.value.document,o=t.findPath(e.target);if(!o)return n();Lt("onClick",{event:e});var i=r.getNode(o),a=r.getAncestors(o);i&&(t.isVoid(i)||a.some((function(e){return t.isVoid(e)})))&&t.focus().moveToEndOfNode(i),n()},onCopy:function(e,t,n){Lt("onCopy",{event:e}),wt(e,t),n()},onCut:function(e,t,n){Lt("onCut",{event:e}),wt(e,t,(function(){var e=t.value,n=e.document,r=e.selection,o=r.end,i=void 0;if(r.isCollapsed){var a=!0,s=!1,u=void 0;try{for(var l,c=n.ancestors(o.path)[Symbol.iterator]();!(a=(l=c.next()).done);a=!0){var f=l.value,d=He(f,2),h=d[0],p=d[1];if(t.isVoid(h)){i=p;break}}}catch(e){s=!0,u=e}finally{try{!a&&c.return&&c.return()}finally{if(s)throw u}}}i?t.removeNodeByKey(i):t.delete()})),n()},onDragEnd:function(t,n,r){Lt("onDragEnd",{event:t}),e=null,r()},onDragStart:function(t,n,r){Lt("onDragStart",{event:t}),e=!0;var o=n.value,i=o.document,a=n.findPath(t.target),s=i.getNode(a),u=i.getAncestors(a),l=s&&(n.isVoid(s)||u.some((function(e){return n.isVoid(e)}))),c=o.blocks.some((function(e){return e===s}));l&&!c&&n.moveToRangeOfNode(s);var f=n.value.fragment;Dt(t,"fragment",ge.serializeNode(f)),r()},onDrop:function(t,n,r){var o=n.value,i=o.document,a=o.selection,s=H()(t.target),u=n.findEventRange(t);if(!u)return r();Lt("onDrop",{event:t});var l=Pt(t),c=l.type,f=l.fragment,d=l.text;n.focus();var h=n.findDOMNode(u.focus.path);h&&h.dispatchEvent(new MouseEvent("mouseup",{view:s,bubbles:!0,cancelable:!0}));var p=a;if(n.select(u),e&&n.deleteAtRange(p),"text"===c||"html"===c){var v=u.anchor,g=i.hasVoidParent(v.path,n);if(g){for(var m=v.path,y=i.getNode(v.path);g;){var E=i.texts({path:m}),S=He(E,1)[0];if(!S)break;var _=He(S,2);y=_[0],m=_[1],g=i.hasVoidParent(m,n)}y&&n.moveToStartOfNode(y)}d&&d.split("\n").forEach((function(e,t){t>0&&n.splitBlock(),n.insertText(e)}))}"fragment"===c&&n.insertFragment(f),r()},onFocus:function(e,n,r){Lt("onFocus",{event:e}),!t||B||G?n.focus():n.deselect().focus(),r()},onInput:function(e,t,n){Lt("onInput");var r=H()(e.target),o=r.getSelection(),i=t.findSelection(o);i?t.select(i):t.blur(),r.ENABLE_SLATE_LOGGING&&console.log(" flush selAfterOnInput:",JSON.stringify(t.value.selection.toJSON()));var a=o.anchorNode;t.reconcileDOMNode(a),r.ENABLE_SLATE_LOGGING&&console.log(" flush selAfterReconci:",JSON.stringify(t.value.selection.toJSON())),r.ENABLE_SLATE_LOGGING&&console.log(" editor: len: "+t.value.document.text.length+" selSlate: "+t.value.selection.anchor.offset+" selNative: "+r.getSelection().anchorOffset+" document: "+JSON.stringify(t.value.document.toJSON())),n()},onKeyDown:function(e,t,n){Lt("onKeyDown",{event:e});var r=t.value,o=r.document,i=r.selection,a=i.start,s=o.getClosestBlock(a.path),u=null!=s&&"rtl"===s.getTextDirection();return de.isDeleteBackward(e)&&!U?t.deleteCharBackward():de.isDeleteForward(e)&&!U?t.deleteCharForward():de.isDeleteLineBackward(e)?t.deleteLineBackward():de.isDeleteLineForward(e)?t.deleteLineForward():de.isDeleteWordBackward(e)?t.deleteWordBackward():de.isDeleteWordForward(e)?t.deleteWordForward():de.isRedo(e)?t.redo():de.isUndo(e)?t.undo():de.isMoveLineBackward(e)?(e.preventDefault(),u?t.moveToEndOfBlock():t.moveToStartOfBlock()):de.isMoveLineForward(e)?(e.preventDefault(),u?t.moveToStartOfBlock():t.moveToEndOfBlock()):de.isExtendLineBackward(e)?(e.preventDefault(),u?t.moveFocusToEndOfBlock():t.moveFocusToStartOfBlock()):de.isExtendLineForward(e)?(e.preventDefault(),u?t.moveFocusToStartOfBlock():t.moveFocusToEndOfBlock()):de.isMoveBackward(e)?(e.preventDefault(),i.isCollapsed?u?t.moveForward():t.moveBackward():u?t.moveToEnd():t.moveToStart()):de.isMoveForward(e)?(e.preventDefault(),i.isCollapsed?u?t.moveBackward():t.moveForward():u?t.moveToStart():t.moveToEnd()):de.isMoveWordBackward(e)?(e.preventDefault(),u?t.moveWordForward():t.moveWordBackward()):de.isMoveWordForward(e)?(e.preventDefault(),u?t.moveWordBackward():t.moveWordForward()):!u&&de.isExtendBackward(e)||u&&de.isExtendForward(e)?(e.preventDefault(),t.moveFocusBackward()):!u&&de.isExtendForward(e)||u&&de.isExtendBackward(e)?(e.preventDefault(),t.moveFocusForward()):void n()},onMouseDown:function(e,n,r){Lt("onMouseDown",{event:e}),t=!0,r()},onMouseUp:function(e,n,r){Lt("onMouseUp",{event:e}),t=!1,r()},onPaste:function(e,t,n){Lt("onPaste",{event:e});var r=t.value,o=Pt(e),i=o.type,a=o.fragment,s=o.text;if("fragment"===i&&t.insertFragment(a),"text"===i||"html"===i){if(!s)return n();var u=r.document,l=r.selection,c=r.startBlock;if(t.isVoid(c))return n();var f=c,d=u.getInsertMarksAtRange(l),h=me.default.deserialize(s,{defaultBlock:f,defaultMarks:d}).document;t.insertFragment(h)}n()},onSelect:function(e,n,r){Lt("onSelect",{event:e});var o=H()(e.target),i=o.getSelection(),a=n.findSelection(i);o.ENABLE_SLATE_LOGGING&&i&&n.value.selection.anchor&&a&&a.anchor&&console.log("!! onSelect domOffset:"+i.anchorOffset+" oldSlate: "+n.value.selection.anchor.offset+" newSlate: "+a.anchor.offset),a?n.select(a):n.blur(),t=!1,r()}}}function Bt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;q.Node.isNode(e)&&(e=e.key);var n=t.document.querySelector("["+Pe+'="'+e+'"]');if(!n)throw new Error('Unable to find a DOM node for "'+e+'". This is often because of forgetting to add `props.attributes` to a custom component.');return n}var Gt=X()("slate:before");function Vt(){var e=null,t=!1,n=!1,r=!1,o=!1,i=null,a=null;function s(e){window.ENABLE_SLATE_LOGGING&&console.log("!! syncDomToSlateAst");var t=i||[];if(i=null,f(e,t),0===t.length)return!1;var n=window.getSelection(),r=n.anchorNode,o=n.anchorOffset;window.ENABLE_SLATE_LOGGING&&console.log(" textNode: "+r.textContent+" "+r.textContent.length);var a=!1,s=function(t){vt(e,t,(function(){return function(e,t){var n=t.getAttribute(Pe);t=Bt(n);var r=e.value.document.getPath(n),o=e.value.document.getNode(n);(function(e,t){var n=t.querySelectorAll(Ve.STRING+", "+Ve.ZERO_WIDTH),r=!0,o=!1,i=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value,l=u.hasAttribute(Be),c=u.hasAttribute(Ge);if(l||c){var f=u.textContent.indexOf("\ufeff")>=0;(l&&f||c&&"\ufeff"!==u.textContent)&&(window.ENABLE_SLATE_LOGGING&&console.log(" REPLACING "+u.childNodes.length),function e(t,n){var r=!0,o=!1,i=void 0;try{for(var a,s=t.childNodes[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value;1===u.nodeType?e(u,n):3===u.nodeType&&n(u)}}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}}(u,(function(e){for(;;){var t=e.textContent.indexOf("\ufeff");if(-1===t)break;e.deleteData(t,1)}})),u.removeAttribute(Ge),u.removeAttribute(ke))}}}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}})(0,t),window.ENABLE_SLATE_LOGGING&&console.log(" slateDomSpan: "+t.textContent+" "+t.textContent.length);window.ENABLE_SLATE_LOGGING&&console.log(" slateAstNode: "+o.text+" "+o.text.length);window.ENABLE_SLATE_LOGGING&&console.log(" flush selBeforeInsert:",JSON.stringify(e.value.selection.toJSON()));window.ENABLE_SLATE_LOGGING&&console.log(" editor: len: "+e.value.document.text.length+" selSlate: "+e.value.selection.anchor.offset+" selNative: "+window.getSelection().anchorOffset+" document: "+JSON.stringify(e.value.document.toJSON()));var i=t.textContent.replace(/[\uFEFF\b]/g,"");!function(e,t,n,r){var o=t.text;if(r===o)return;var i=t.key,a=function(e,t){for(var n=0;n=0;if(i&&!s)u(t);else if(e.preventDefault(),s){var l=a.split("\n");l.map((function(e,n){0!==e.length&&(window.ENABLE_SLATE_LOGGING&&console.log(" insert: |"+JSON.stringify(e)+"|"),t.insertText(e,null,!1)),n!==l.length-1&&(window.ENABLE_SLATE_LOGGING&&console.log(" inserting line break"),t.splitBlock())}))}else t.insertText(e.data,null,!1)}else Gt("onBeforeInput",{event:e}),n()}},onBlur:function(t,r,o){if(!n&&!r.readOnly){var i=t.relatedTarget,a=t.target,s=H()(a);if(e!==s.document.activeElement){if(i){var u=r.findDOMNode([]);if(i===u)return;if(i.hasAttribute(Fe))return;var l=r.findNode(i);if(null!=u&&u.contains(i)&&l&&!r.isVoid(l))return}Gt("onBlur",{event:t}),o()}}},onClick:function(e,t,n){Gt("onClick",{event:e}),o=!0,n()},onCompositionEnd:function(e,n,r){window.ENABLE_SLATE_LOGGING&&console.log("!! onCompositionEnd isComposing:"+t),o=!0,t=!1,l(),u(n),s(n),Gt("onCompositionEnd",{event:e}),r()},onCompositionUpdate:function(){window.ENABLE_SLATE_LOGGING&&console.log("!! onCompositionUpdate isComposing:"+t),t=!0,l()},onCompositionStart:function(e,n,r){n.ensureSelection(),window.ENABLE_SLATE_LOGGING&&console.log("!! onCompositionStart isComposing:"+t+" isCollapsed:"+n.value.selection.isCollapsed),t=!0;var i=n.value.selection;o=!0,i.isCollapsed||n.delete(),l(),u(n),Gt("onCompositionStart",{event:e}),r()},onCopy:function(e,t,r){var o=H()(e.target);n=!0,o.requestAnimationFrame((function(){return n=!1})),Gt("onCopy",{event:e}),r()},onCut:function(e,t,r){if(!t.readOnly){var o=H()(e.target);n=!0,o.requestAnimationFrame((function(){return n=!1})),Gt("onCut",{event:e}),r()}},onDragEnd:function(e,t,n){r=!1,Gt("onDragEnd",{event:e}),n()},onDragEnter:function(e,t,n){Gt("onDragEnter",{event:e}),n()},onDragExit:function(e,t,n){Gt("onDragExit",{event:e}),n()},onDragLeave:function(e,t,n){Gt("onDragLeave",{event:e}),n()},onDragOver:function(e,t,n){var o=t.findNode(e.target);o&&!t.isVoid(o)||e.preventDefault(),B&&e.preventDefault(),r||(r=!0,B||(e.nativeEvent.dataTransfer.dropEffect="move")),Gt("onDragOver",{event:e}),n()},onDragStart:function(e,t,n){r=!0,Gt("onDragStart",{event:e}),n()},onDrop:function(e,t,n){t.readOnly||(o=!0,e.preventDefault(),Gt("onDrop",{event:e}),n())},onFocus:function(t,r,o){if(!n&&!r.readOnly){var i=r.findDOMNode([]),a=H()(t.target);e=a.document.activeElement,L&&null!=t&&null!=i&&t.target!==i?i.focus():(Gt("onFocus",{event:t}),o())}},onInput:function(e,n,r){if(n.ensureSelection(),window.ENABLE_SLATE_LOGGING&&console.log("!! onInput isComposing:"+t+" hasOp:"+!!i),c()){if(W)return;return u(n),void s(n)}s(n)||n.value.selection.isBlurred||(o=!0,Gt("onInput",{event:e}),r())},onKeyDown:function(e,n,r){if(!n.readOnly)if(n.ensureSelection(),window.ENABLE_SLATE_LOGGING&&console.log("!! onKeyDown isComposing:"+t+" hasOp:"+!!i+" mods:"+(e.ctrlKey?"ctrl-":"")+(e.altKey?"alt-":"")+(e.shiftKey?"shift-":"")+(e.metaKey?"meta-":"")+" key:"+e.key+" which:"+e.which),c())de.isCompose(e)&&e.preventDefault();else{if(!(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||null==e.key))switch(e.key.toLowerCase()){case"arrowdown":case"arrowleft":case"arrowright":case"arrowup":case"pageup":case"pagedown":case"backspace":case"delete":case"insert":case"home":case"end":case"enter":case"tab":case"space":break;default:return}!U&&(de.isBold(e)||de.isDeleteBackward(e)||de.isDeleteForward(e)||de.isDeleteLineBackward(e)||de.isDeleteLineForward(e)||de.isDeleteWordBackward(e)||de.isDeleteWordForward(e)||de.isItalic(e)||de.isRedo(e)||de.isTransposeCharacter(e)||de.isUndo(e))&&e.preventDefault(),o=!0,Gt("onKeyDown",{event:e}),r()}},onPaste:function(e,t,n){t.readOnly||(o=!0,e.preventDefault(),Gt("onPaste",{event:e}),n())},onSelect:function(t,r,i){if(!n&&!(r.readOnly||c()&&W)){var a=H()(t.target);e=a.document.activeElement,o=!0,Gt("onSelect",{event:t}),i()}},queries:{userActionPerformed:function(){return o},isComposing:c},commands:{clearUserActionPerformed:function(){return o=!1,null}}}}function Ut(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.plugins,n=void 0===t?[]:t;return[Vt()].concat(Je(n),[Ft()])}function jt(e){var t=e.nativeEvent||e;switch(t.type){case"keydown":return t.type+" "+JSON.stringify(t.key);case"input":case"beforeinput":case"textInput":return t.type+":"+t.inputType+" "+JSON.stringify(t.data);default:return t.type}}var Kt=X()("slate:events");function Wt(){var e={},t=!0,n=!1,r=void 0;try{for(var o,i=Me[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){e[o.value]=function(e,t,n){var r=jt(e);Kt(r),n()}}}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}return e}var qt=X()("slate:batch-events");function zt(){var e=null,t=null,n=[];function r(){qt("\n"+n.join("\n")),n.length=0}function o(o){0===n.length&&(e=new Date);var i=jt(o),a=new Date;n.push("- "+(a-e)+" - "+i),clearTimeout(t),t=setTimeout(r,2e3)}var i={},a=!0,s=!1,u=void 0;try{for(var l,c=Me[Symbol.iterator]();!(a=(l=c.next()).done);a=!0){i[l.value]=function(e,t,n){o(e),n()}}}catch(e){s=!0,u=e}finally{try{!a&&c.return&&c.return()}finally{if(s)throw u}}return i}var Ht=X()("slate:mutations"),Jt=["type","oldValue","target","addedNodes","removedNodes","attributeName","attributeNamespace","nextSibling","previousSibling"];function Zt(e){if(e.nodeType===window.Node.TEXT_NODE)return e.textContent;if(e.nodeType===window.Node.ELEMENT_NODE){var t=e.outerHTML,n=e.innerHTML;return null==t?JSON.stringify(e.textContent):t.slice(0,t.indexOf(n))}return"Node(type="+e.nodeType}function Yt(){var e=new window.MutationObserver((function(e){var t=Array.from(e).map((function(e){var t={};return Jt.forEach((function(n){var r=e[n];if(null!=r)if(r instanceof window.NodeList){if(0===r.length)return;t[n]=Array.from(r).map(Zt).join(", ")}else r instanceof window.Node&&(r=Zt(r)),t[n]=r})),t}));Ht.apply(void 0,[t.length+" Mutations"].concat(Je(t)))})),t=null;function n(n,r,o){var i=r.findDOMNode([]);if(i===t)return o();Ht("start"),e.observe(i,{childList:!0,characterData:!0,attributes:!0,subtree:!0,characterDataOldValue:!0}),t=i,o()}return{onComponentDidMount:n,onComponentDidUpdate:n,onComponentWillUnmount:function(n,r,o){Ht("stop"),e.disconnect(),t=null,o()}}}function Xt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.placeholder,n=void 0===t?"":t,r=X.a.enabled("slate:events")?Wt():null,o=X.a.enabled("slate:batch-events")?zt():null,i=X.a.enabled("slate:mutations")?Yt():null,a=ht(),s=yt(),u=Et(),l=dt(e),c=Ut(e),f={commands:{restoreDOM:function(e){var t=e.tmp.contentRef.current.tmp;t.contentKey=t.contentKey+1}}},d=V||null===n?null:Ne({placeholder:n,when:function(e,t){return"document"===t.object&&""===t.text&&1===t.nodes.size&&1===Array.from(t.texts()).length}});return[r,o,i,l,c,f,d,a,s,u]}var $t=X()("slate:editor"),Qt=function(e){function t(){var e,n,r;Ue(this,t);for(var i=arguments.length,a=Array(i),s=0;s component is re-resolving the `plugins`, `schema`, `commands`, `queries` or `placeholder` prop on each update, which leads to poor performance. This is often due to passing in a new references for these props with each render by declaring them inline in your render function. Do not do this! Declare them outside your render function, or memoize them instead."),r.tmp.resolves++;var t=e(We({},r.props,{editor:r,value:r.props.value||r.state.value})),n=function(e){r.tmp.mounted?r.handleChange(e):r.tmp.change=e};r.controller=new q.Editor({plugins:[t],onChange:n},{controller:r,construct:!1}),r.controller.run("onConstruct")})),ze(r,n)}return qe(t,e),je(t,[{key:"componentDidMount",value:function(){this.tmp.mounted=!0,this.tmp.updates++,this.props.autoFocus&&this.focus(),this.tmp.change&&(this.handleChange(this.tmp.change),this.tmp.change=null)}},{key:"componentDidUpdate",value:function(){this.tmp.updates++,this.tmp.change&&(this.handleChange(this.tmp.change),this.tmp.change=null)}},{key:"componentWillUnmount",value:function(){this.tmp.mounted=!1}},{key:"render",value:function(){var e=this;$t("render",this);var n=this.props,r=n.commands,i=n.placeholder,a=n.plugins,s=n.queries,u=n.schema;this.resolveController(a,u,r,s,i,Xt);var l=this.props,c=l.options,f=l.readOnly,d=l.value,h=this.state.value,p=d||h,v=this.state.contentKey;this.controller.setReadOnly(f),this.controller.setValue(p,c);var g=this.props,m=g.autoCorrect,y=g.className,E=g.id,S=g.role,_=g.spellCheck,x=g.tabIndex,A=g.style,N=g.tagName,w=g.onContextMenu,C=oe()(this.props,Object.keys(t.__propTypes)),b=o.a.createElement(lt,We({},C,{ref:this.tmp.contentRef,autoCorrect:m,className:y,contentKey:v,editor:this,id:E,onContextMenu:w,onEvent:function(t,n){return e.run(t,n)},readOnly:f,role:S,spellCheck:_,style:A,tabIndex:x,tagName:N}));return this.controller.run("renderEditor",We({},this.props,{editor:this,children:b}))}},{key:"handleChange",value:function(e){var t=this.props.onChange;this.state.value&&this.setState({value:e.value}),t(e)}},{key:"applyOperation",value:function(){var e;return(e=this.controller).applyOperation.apply(e,arguments)}},{key:"command",value:function(){var e;return(e=this.controller).command.apply(e,arguments)}},{key:"hasCommand",value:function(){var e;return(e=this.controller).hasCommand.apply(e,arguments)}},{key:"hasQuery",value:function(){var e;return(e=this.controller).hasQuery.apply(e,arguments)}},{key:"normalize",value:function(){var e;return(e=this.controller).normalize.apply(e,arguments)}},{key:"query",value:function(){var e;return(e=this.controller).query.apply(e,arguments)}},{key:"registerCommand",value:function(){var e;return(e=this.controller).registerCommand.apply(e,arguments)}},{key:"registerQuery",value:function(){var e;return(e=this.controller).registerQuery.apply(e,arguments)}},{key:"run",value:function(){var e;return(e=this.controller).run.apply(e,arguments)}},{key:"withoutNormalizing",value:function(){var e;return(e=this.controller).withoutNormalizing.apply(e,arguments)}},{key:"call",value:function(){var e;return(e=this.controller).call.apply(e,arguments)}},{key:"change",value:function(){var e;return(e=this.controller).change.apply(e,arguments)}},{key:"onChange",value:function(){var e;return(e=this.controller).onChange.apply(e,arguments)}},{key:"applyOperations",value:function(){var e;return(e=this.controller).applyOperations.apply(e,arguments)}},{key:"setOperationFlag",value:function(){var e;return(e=this.controller).setOperationFlag.apply(e,arguments)}},{key:"getFlag",value:function(){var e;return(e=this.controller).getFlag.apply(e,arguments)}},{key:"unsetOperationFlag",value:function(){var e;return(e=this.controller).unsetOperationFlag.apply(e,arguments)}},{key:"withoutNormalization",value:function(){var e;return(e=this.controller).withoutNormalization.apply(e,arguments)}},{key:"operations",get:function(){return this.controller.operations}},{key:"readOnly",get:function(){return this.controller.readOnly}},{key:"value",get:function(){return this.controller.value}},{key:"editor",get:function(){return this.controller.editor}},{key:"schema",get:function(){Object(ye.default)(!1,"As of Slate 0.42, the `editor.schema` property no longer exists, and its functionality has been folded into the editor itself. Use the `editor` instead.")}},{key:"stack",get:function(){Object(ye.default)(!1,"As of Slate 0.42, the `editor.stack` property no longer exists, and its functionality has been folded into the editor itself. Use the `editor` instead.")}}]),t}(o.a.Component);function en(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;ee(!1,"As of slate-react@0.22 the `findDOMPoint(point)` helper is deprecated in favor of `editor.findDOMPoint(point)`.");var n=Bt(e.key,t),r=0,o=Array.from(n.querySelectorAll(Ve.STRING+", "+Ve.ZERO_WIDTH)),i=!0,a=!1,s=void 0;try{for(var u,l=o[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var c=u.value,f=c.childNodes[0],d=f.textContent.length,h=d;c.hasAttribute(ke)&&(h=parseInt(c.getAttribute(ke),10));var p=r+h;if(e.offset<=p){var v=Math.min(d,Math.max(0,e.offset-r));return{node:f,offset:v}}r=p}}catch(e){a=!0,s=e}finally{try{!i&&l.return&&l.return()}finally{if(a)throw s}}return null}function tn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;ee(!1,"As of slate-react@0.22 the `findDOMRange(range)` helper is deprecated in favor of `editor.findDOMRange(range)`.");var n=e.anchor,r=e.focus,o=e.isBackward,i=e.isCollapsed,a=en(n,t),s=i?a:en(r,t);if(!a||!s)return null;var u=t.document.createRange(),l=o?s:a,c=o?a:s;return u.setStart(l.node,l.offset),u.setEnd(c.node,c.offset),u}function nn(e,t){ee(!1,"As of slate-react@0.22 the `findNode(element)` helper is deprecated in favor of `editor.findNode(element)`."),Object(ye.default)(!q.Value.isValue(t),"As of Slate 0.42.0, the `findNode` utility takes an `editor` instead of a `value`.");var n=e.closest(Ve.KEY);if(!n)return null;var r=n.getAttribute(Pe);return r&&t.value.document.getNode(r)||null}function rn(e,t){ee(!1,"As of slate-react@0.22 the `findPath(element)` helper is deprecated in favor of `editor.findPath(element)`.");var n=nn(e,t);return n?t.value.document.getPath(n):null}function on(e,t,n){ee(!1,"As of slate-react@0.22 the `findPoint(node, offset)` helper is deprecated in favor of `editor.findPoint(node, offset)`."),Object(ye.default)(!q.Value.isValue(n),"As of Slate 0.42.0, the `findPoint` utility takes an `editor` instead of a `value`.");var r=function(e,t){if(1===e.nodeType&&e.childNodes.length){var n=t===e.childNodes.length,r=n?"backward":"forward";for(e=an(e,n?t-1:t,r);1===e.nodeType&&e.childNodes.length;){var o=n?e.childNodes.length-1:0;e=an(e,o,r)}t=n?e.textContent.length:0}return{node:e,offset:t}}(e,t),o=r.node,i=r.offset,a=H()(e),s=o.parentNode,u=s.closest(Ve.LEAF),l=void 0,c=void 0;if(u){var f=a.document.createRange(),d=u.closest(Ve.TEXT);f.setStart(d,0),f.setEnd(o,i),c=d;var h=f.cloneContents(),p=h.querySelectorAll("["+Ge+"]");l=h.textContent.length-p.length}else{var v=s.closest(Ve.VOID);if(!v)return null;if(!(u=v.querySelector(Ve.LEAF)))return null;l=(c=u).textContent.length}l===c.textContent.length&&s.hasAttribute(Ge)&&l--;var g=u.getAttribute(Le);if(!g)return null;var m=Ye.parse(g).key,y=n.value;return y.document.hasDescendant(m)?y.document.createPoint({key:m,offset:l}):null}function an(e,t,n){for(var r=e.childNodes,o=r[t],i=t,a=!1,s=!1;(8===o.nodeType||1===o.nodeType&&0===o.childNodes.length||1===o.nodeType&&"false"===o.getAttribute("contenteditable"))&&(!a||!s);)i>=r.length?(a=!0,i=t-1,n="backward"):i<0?(s=!0,i=t+1,n="forward"):(o=r[i],"forward"===n&&i++,"backward"===n&&i--);return o||null}function sn(e,t){ee(!1,"As of slate-react@0.22 the `findRange(selection)` helper is deprecated in favor of `editor.findRange(selection)`."),Object(ye.default)(!q.Value.isValue(t),"As of Slate 0.42.0, the `findNode` utility takes an `editor` instead of a `value`.");var n=e.anchorNode||e.startContainer;if(!n)return null;var r=H()(n);(e instanceof r.Range||r.StaticRange&&e instanceof r.StaticRange)&&(e={anchorNode:e.startContainer,anchorOffset:e.startOffset,focusNode:e.endContainer,focusOffset:e.endOffset});var o=e,i=o.anchorNode,a=o.anchorOffset,s=o.focusNode,u=o.focusOffset,l=o.isCollapsed,c=t.value,f=on(i,a,t),d=l?f:on(s,u,t);return f&&d?c.document.createRange({anchor:f,focus:d}):null}function un(e,t){ee(!1,"As of slate-react@0.22 the `getEventRange(event, editor)` helper is deprecated in favor of `editor.findEventRange(event)`."),Object(ye.default)(!q.Value.isValue(t),"As of Slate 0.42.0, the `findNode` utility takes an `editor` instead of a `value`."),e.nativeEvent&&(e=e.nativeEvent);var n=e,r=n.clientX,o=n.clientY,i=n.target;if(null==r||null==o)return null;var a=t.value.document,s=rn(e.target,t);if(!s)return null;var u=a.getNode(s);if(t.isVoid(u)){var l=i.getBoundingClientRect(),c="inline"===u.object?r-l.left