1"use strict";(self["webpackChunkwsxc_album"]=self["webpackChunkwsxc_album"]||[]).push([[513],{91423:function(e,t,n){ 2/** 3 * @license React 4 * use-sync-external-store-shim.production.js 5 * 6 * Copyright (c) Meta Platforms, Inc. and affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */ 11var r=n(41594);function o(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t}var i="function"===typeof Object.is?Object.is:o,a=r.useState,u=r.useEffect,s=r.useLayoutEffect,l=r.useDebugValue;function c(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return s(function(){o.value=n,o.getSnapshot=t,d(o)&&i({inst:o})},[e,n,t]),u(function(){return d(o)&&i({inst:o}),e(function(){d(o)&&i({inst:o})})},[e]),l(n),n}function d(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(r){return!0}}function f(e,t){return t()}var p="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?f:c;t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:p},94255:function(e,t,n){ 12/** 13 * @license React 14 * use-sync-external-store-shim/with-selector.production.js 15 * 16 * Copyright (c) Meta Platforms, Inc. and affiliates. 17 * 18 * This source code is licensed under the MIT license found in the 19 * LICENSE file in the root directory of this source tree. 20 */ 21var r=n(41594),o=n(12519);function i(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t}var a="function"===typeof Object.is?Object.is:i,u=o.useSyncExternalStore,s=r.useRef,l=r.useEffect,c=r.useMemo,d=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=s(null);if(null===i.current){var f={hasValue:!1,value:null};i.current=f}else f=i.current;i=c(function(){function e(e){if(!s){if(s=!0,i=e,e=r(e),void 0!==o&&f.hasValue){var t=f.value;if(o(t,e))return u=t}return u=e}if(t=u,a(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(i=e,t):(i=e,u=n)}var i,u,s=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,n,r,o]);var p=u(e,i[0],i[1]);return l(function(){f.hasValue=!0,f.value=p},[p]),d(p),p}},12519:function(e,t,n){e.exports=n(91423)},10165:function(e,t,n){e.exports=n(94255)},30503:function(e,t,n){n.d(t,{w:function(){return k}});var r=n(10020),o=n(34293),i=n(98681),a=n(85592),u=n(47785),s=n(25471),l=n(84315),c=n(18819),d=n(49455);function f(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof u?r:u,l=Object.create(s.prototype);return p(l,"_invoke",function(n,r,o){var i,u,s,l=0,c=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,u=0,s=e,f.n=n,a}};function p(n,r){for(u=n,s=r,t=0;!d&&l&&!o&&t<c.length;t++){var o,i=c[t],p=f.p,h=i[2];n>3?(o=h===r)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(u=0,f.v=r,f.n=i[1]):p<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,f.n=h,u=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,h){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,h),u=c,s=h;(t=u<2?e:s)||!d;){i||(u?u<3?(u>1&&(f.n=-1),p(u,s)):f.n=s:f.v=s);try{if(l=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==a)break}catch(t){i=e,u=1,s=t}finally{l=1}}return{value:t,done:d}}}(n,o,i),!0),l}var a={};function u(){}function s(){}function l(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(p(t={},r,function(){return this}),t),d=l.prototype=u.prototype=Object.create(c);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,p(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=l,p(d,"constructor",l),p(l,"constructor",s),s.displayName="GeneratorFunction",p(l,o,"GeneratorFunction"),p(d),p(d,o,"Generator"),p(d,r,function(){return this}),p(d,"toString",function(){return"[object Generator]"}),(f=function(){return{w:i,m:h}})()}function p(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}p=function(e,t,n,r){function i(t,n){p(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},p(e,t,n,r)}var h={},m=window,v=m.openWeb,g=m.appShare,y=wgoo,b=y.$toast;function w(e,t){return A.apply(this,arguments)}function A(){return A=(0,i.A)(f().m(function e(t,n){var r,i,u,l,c,d;return f().w(function(e){while(1)switch(e.p=e.n){case 0:if(e.p=0,t&&n){e.n=1;break}return e.a(2);case 1:if(!a.YB){e.n=6;break}if(!h[n]){e.n=2;break}r=h[n],e.n=5;break;case 2:return e.n=3,(0,s.Ee)({shopId:t,goodsId:n});case 3:if(i=e.v,u=i.errcode,l=i.errmsg,c=i.result,0===u){e.n=4;break}return b({title:l}),e.a(2);case 4:r=c.commodity,h[n]=r;case 5:r?(d={shopId:t,goodsId:n,goods:(0,o.A)({},r)},g(323,d)):b({title:"产åä¸åå¨"}),e.n=7;break;case 6:v("#/theme_detail/".concat(t,"/").concat(n));case 7:e.n=9;break;case 8:e.p=8,e.v;case 9:return e.a(2)}},e,null,[[0,8]])})),A.apply(this,arguments)}function k(e){return C.apply(this,arguments)}function C(){return C=(0,i.A)(f().m(function e(t){var n,o,i,s,p,h,m,y,A,k,C,D,x,E,M,S,T,P,_,I,N,O,F,L,B,R=arguments;return f().w(function(e){while(1)switch(e.p=e.n){case 0:if(n=R.length>1&&void 0!==R[1]?R[1]:{},o=R.length>2&&void 0!==R[2]&&R[2],i=R.length>3&&void 0!==R[3]?R[3]:"",e.p=1,s=n.resType,p=n.subType,h=n.resId,m=n.resName,n.resIcon,y=n.resLink,A=n.level,k=void 0===A?1:A,t&&h){e.n=2;break}return e.a(2);case 2:B=s,e.n=B===d.kq.TYPE_GOODS?3:B===d.kq.TYPE_TAG?4:B===d.kq.TYPE_GROUP?5:B===d.kq.TYPE_TIME?6:B===d.kq.TYPE_ACTIVITY?7:B===d.kq.TYPE_FRIEND?8:B===d.kq.TYPE_LINK?9:B===d.kq.TYPE_NOTE?15:B===d.kq.TYPE_NOTE_COLLECTION?16:B===d.kq.TYPE_NOTE_TIME?17:18;break;case 3:return w(t,h),e.a(3,19);case 4:return v((0,u.TE)("#/goods_list/".concat(t,"?tagId=").concat(h))),e.a(3,19);case 5:return v((0,u.TE)("#/goods_list/".concat(t,"?groupId=").concat(h))),e.a(3,19);case 6:return C=(0,c.uo)(h),D=(0,r.A)(C,2),x=D[0],E=D[1],v((0,u.TE)("#/goods_list/".concat(t,"?startDate=").concat(encodeURIComponent(x),"&endDate=").concat(encodeURIComponent(E)))),e.a(3,19);case 7:return"sub_activity"===p?v((0,u.TE)("#/biz/activity_detail/".concat(h,"?fromPage=noteDetail"))):"sub_coupon"===p?v((0,u.TE)("#/biz/coupon_detail/".concat(h,"?fromPage=noteDetail"))):"sub_seckill"===p&&(a.YB?window.location.href="?t=".concat(Date.now(),"&navigatorType=2#/biz/seckill/landing/").concat(h,"?fromPage=noteDetail"):v((0,u.TE)("#/biz/seckill/landing/".concat(h,"?fromPage=noteDetail")))),e.a(3,19);case 8:return a.YB?window.location.href="?t=".concat(Date.now(),"¤tType=note#/shop_detail/").concat(h):(M="".concat((0,a.z7)(),"/kuikly_static/index.html?page_name=personal_album_page&shopId=").concat(h,"¤tType=note&referrerTitle=").concat(i||"å ¶ä»"),v(M)),e.a(3,19);case 9:if(!y.startsWith("http")){e.n=10;break}a.YB,v(y),e.n=14;break;case 10:if(!y.includes("/pages/")){e.n=14;break}if(a.YB){e.n=11;break}return b({title:"请å¨APP䏿å¼"}),e.a(2);case 11:return e.n=12,(0,l.nf)();case 12:if(S=e.v,S){e.n=13;break}return b({title:"æ°æ®é误ï¼è¯·ç¨ååè¯"}),e.a(2);case 13:T=y,T.startsWith("/")&&(T=T.substring(1)),g(48,{share:{miniappName:S,path:T}});case 14:return e.a(3,19);case 15:return P="?t=".concat(Date.now(),"&navigatorType=2&referrer_title=").concat(i,"#/album/note/note_detail/").concat(t,"/").concat(h,"?referrer_title=").concat(i),o&&!a.YB&&(P+="&isFromEdit=1"),a.vE?v(P):window.location.href=P,e.a(3,19);case 16:return _="#/album/noteList/".concat(t,"?collectionId=").concat(h,"&level=").concat(k),window.location.href="?navigatorType=2&t=".concat(Date.now()).concat(_),e.a(3,19);case 17:return I=(0,c.uo)(h),N=(0,r.A)(I,2),O=N[0],F=N[1],L="#/album/noteList/".concat(t,"?startDate=").concat(O,"&endDate=").concat(F,"&routeTitle=").concat(m),window.location.href="?navigatorType=2&t=".concat(Date.now()).concat(L),e.a(3,19);case 18:return e.a(3,19);case 19:e.n=21;break;case 20:e.p=20,e.v;case 21:return e.a(2)}},e,null,[[1,20]])})),C.apply(this,arguments)}},51707:function(e,t,n){n.d(t,{$Q:function(){return f},DS:function(){return g},NQ:function(){return c},RD:function(){return d},RN:function(){return p},Ue:function(){return m},jq:function(){return h},ls:function(){return l},sH:function(){return v}});var r=n(34293),o=n(23238),i=n.n(o),a=n(85592);function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{i().track(e,t,function(){"track note event:".concat(e," params:")})}catch(n){}}function s(){return a.YB?"app":a.vE?"PC客æ·ç«¯":"PCç½é¡µ"}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u("note_publish_view",(0,r.A)((0,r.A)({},e),{},{platform_type:s()}))}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u("note_publish_click",(0,r.A)((0,r.A)({},e),{},{platform_type:s()}))}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u("note_sp_view",(0,r.A)((0,r.A)({},e),{},{platform_type:s()}))}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u("note_error",(0,r.A)((0,r.A)({},e),{},{platform_type:s()}))}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u("note_details_view",(0,r.A)((0,r.A)({},e),{},{platform_type:s()}))}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u("note_details_click",(0,r.A)((0,r.A)({},e),{},{platform_type:s()}))}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u("note_guide_pv",(0,r.A)((0,r.A)({},e),{},{platform_type:s()}))}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u("note_guide_click",(0,r.A)((0,r.A)({},e),{},{platform_type:s()}))}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u("note_selecttags_view",(0,r.A)((0,r.A)({},e),{},{platform_type:s()}))}},70513:function(e,t,n){n.d(t,{Uw:function(){return M},dH:function(){return B},Mh:function(){return te}});var r=n(10020),o=n(41594),i=n.n(o),a=n(4715),u=n(84315),s=n(45157),l=n(34293),c=n(34328),d=n(85072),f=n.n(d),p=n(32691),h={insert:"head",singleton:!1},m=(f()(p.A,h),p.A.locals||{}),v=n(18809),g=wgoo,y=g.Button;function b(e){var t=e.className,n=void 0===t?"":t,r=e.outerStyle,o=void 0===r?{}:r,i=e.style,a=void 0===i?{}:i,s=e.title,d=void 0===s?"":s,f=e.onCancel,p=void 0===f?u.lQ:f,h=e.onSave,g=void 0===h?u.lQ:h;return(0,v.jsx)(c.A,{className:n,style:(0,l.A)((0,l.A)({},a),{},{zIndex:100}),outerStyle:o,children:(0,v.jsxs)("div",{className:m.wegoPermissionNavbar,children:[(0,v.jsx)("div",{className:m.cancel,onClick:p,children:"åæ¶"}),!!d&&(0,v.jsx)("div",{className:m.title,children:d}),(0,v.jsx)(y,{className:m.save,onClick:g,children:"宿"})]})})}var w=(0,o.memo)(b),A=n(45033),k={insert:"head",singleton:!1},C=(f()(A.A,k),A.A.locals||{}),D=wgoo,x=D.Dialog;function E(e){var t=e.visible,n=void 0!==t&&t,i=e.relations,l=void 0===i?[]:i,c=e.permissionConfig,d=void 0===c?{}:c,f=e.onHistory,p=void 0===f?function(){}:f,h=e.onSuccess,m=void 0===h?function(){}:h,g=(0,a.l$)(),y=g.navBarHeight,b=(0,o.useState)(!1),A=(0,r.A)(b,2),k=A[0],D=A[1],E=(0,o.useRef)(null);(0,o.useEffect)(function(){D(n)},[n]);var M=(0,o.useCallback)(function(){D(!1),setTimeout(function(){(0,u.AZ)()},300)},[]),S=(0,o.useCallback)(function(){try{E.current.submit(function(e){M(),null===m||void 0===m||m(e)})}catch(e){}},[M,m]);return n&&(0,v.jsx)(x,{visible:k,height:"100%",mode:"headless",className:C.noteEditPermissionDialog,children:(0,v.jsxs)("div",{className:C.noteEditPermissionframe,children:[!!(0,u.hB)()&&(0,v.jsx)(w,{style:{backgroundColor:"#EDEDED"},title:"è°å¯ä»¥ç",onCancel:M,onSave:S}),(0,v.jsx)("div",{className:C.noteEditPermissionContent,style:{height:"calc(100vh - ".concat(y,"px)")},children:(0,v.jsx)(s.mJ,{ref:E,style:{minHeight:"calc(100vh - ".concat(y,"px)")},relations:l,permissionConfig:d,onHistory:p})})]})})}var M=E,S=n(1290),T=n(84583),P=n.n(T),_=n(1162),I=n(57279),N=n(30490),O={insert:"head",singleton:!1},F=(f()(N.A,O),N.A.locals||{});function L(e){var t=e.className,n=void 0===t?"":t,r=e.style,o=void 0===r?{}:r,i=e.editorContent,a=void 0===i?{}:i,u=e.onEditorCreated,s=void 0===u?function(){}:u,l=(0,_.hG)({editable:!1,extensions:(0,S.A)((0,I.O4)()),content:a,onCreate:function(e){var t=e.editor;s(t)}});return(0,v.jsx)("div",{className:P()(F.WegoNoteEditorDetail,n),style:o,children:(0,v.jsx)(_.$Z,{editor:l})})}var B=(0,o.memo)(L),R=n(85592),z=n(28641),j={insert:"head",singleton:!1},H=(f()(z.A,j),z.A.locals||{}),V=n(5522),Y={insert:"head",singleton:!1},W=(f()(V.A,Y),V.A.locals||{}),G=wgoo,U=G.Button;function q(e){var t=e.className,n=void 0===t?"":t,r=e.outerStyle,o=void 0===r?{}:r,i=e.style,a=void 0===i?{}:i,s=e.title,d=void 0===s?"":s,f=e.onCancel,p=void 0===f?u.lQ:f,h=e.onSave,m=void 0===h?u.lQ:h;return(0,v.jsx)(c.A,{className:n,style:(0,l.A)((0,l.A)({},a),{},{zIndex:100,backgroundColor:"#fff"}),outerStyle:o,children:(0,v.jsxs)("div",{className:W.wegoPermissionNavbar,children:[(0,v.jsx)("div",{className:W.cancel,onClick:function(){return p()},children:"åæ¶"}),!!d&&(0,v.jsx)("div",{className:W.title,children:d}),(0,v.jsx)(U,{className:W.save,onClick:m,children:"宿"})]})})}var $=(0,o.memo)(q),K=n(70367),J=n.n(K),X=J().GoodsFromAdd,Z=wgoo,Q=Z.Dialog;function ee(e){var t=e.visible,n=void 0!==t&&t,u=e.from,s=void 0===u?{}:u,c=e.onSuccess,d=void 0===c?function(){}:c,f=e.onCancel,p=void 0===f?function(){}:f,h=(0,a.l$)(),m=h.navBarHeight,g=(0,o.useState)(!1),y=(0,r.A)(g,2),b=y[0],w=y[1],A=(0,o.useRef)(null);(0,o.useEffect)(function(){if(n)try{C&&C.length>0?localStorage.setItem("save_theme_from",JSON.stringify(C)):localStorage.removeItem("save_theme_from")}catch(e){}w(n)},[n]);var k=s.sources,C=void 0===k?[]:k,D=s.parent_album_id,x=void 0===D?"":D,E=s.parent_album_name,M=void 0===E?"":E,S=s.SourceBlank,T=s.customSource;if(S)C=[];else if(T&&T.sourceId&&0==C.length)C=[{tagId:T.sourceId,tagName:T.sourceName}];else if(x&&0==C.length)C=[{sourceParentAlbumId:x,sourceParentAlbumName:M,supplierType:"followFriends"}];else if(0!==C.length){var P=C[0],_=P.sourceParentAlbumId,I=P.sourceParentAlbumName,N=P.tagId,O=P.tagName,F=P.supplierType;C="followFriends"===F||_?[{sourceParentAlbumId:_||N,sourceParentAlbumName:I||O,supplierType:"followFriends"}]:[{tagId:N,tagName:O}]}else 0==C.length&&(C=[]);var L=function(){if(A.current){var e,t,n=A.current._getFilterTag(),r=function(){d(A.current),p(n)};if(n)null===(e=(t=A.current)._clearAndAddTag)||void 0===e||e.call(t,{value:n},r);else A.current._onSave(null,r)}},B={htmlTitle:"",params:{},currTags:C,usePropsCurrFroms:!0,onClick:L,height:R.YB?"calc(100vh - ".concat(m,"px)"):"100vh"};return(0,v.jsx)(Q,{visible:b,height:"100%",mode:"headless",className:H.container,children:(0,v.jsxs)("div",{className:H.frame,children:[!R.YB&&(0,v.jsx)("i",{className:"wego-iconfont-s
21icon-fanhui w48 h48 absolute c-black1 f24 zi101 flexcenter",style:{top:0,left:0},onClick:p}),R.YB&&(0,v.jsx)($,{style:{backgroundColor:"#EDEDED"},title:"éæ©æ¥æº",onCancel:p,onSave:L}),(0,v.jsx)(i().Suspense,{fallback:(0,v.jsx)(v.Fragment,{}),children:(0,v.jsx)(X,(0,l.A)((0,l.A)({},B),{},{ref:A}))})]})})}var te=ee},1033:function(e,t,n){var r,o,i,a,u,s,l,c,d,f,p,h,m,v,g,y,b,w,A,k,C,D,x,E,M,S,T,P,_,I=n(1290),N=n(98681),O=n(34293),F=n(51237),L=n(95627),B=n(63887),R=n(3846),z=n(60738),j=n(52100),H=n(83763),V=n(56107),Y=n(6279),W=n(35181),G=n(85592),U=n(84315),q=n(49455),K=n(34252),J=n(92445),X=n(12843),Z=n(96166),Q=n(78255),ee=n(74716),te=n(68730);function ne(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof u?r:u,l=Object.create(s.prototype);return re(l,"_invoke",function(n,r,o){var i,u,s,l=0,c=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,u=0,s=e,f.n=n,a}};function p(n,r){for(u=n,s=r,t=0;!d&&l&&!o&&t<c.length;t++){var o,i=c[t],p=f.p,h=i[2];n>3?(o=h===r)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(u=0,f.v=r,f.n=i[1]):p<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,f.n=h,u=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,h){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,h),u=c,s=h;(t=u<2?e:s)||!d;){i||(u?u<3?(u>1&&(f.n=-1),p(u,s)):f.n=s:f.v=s);try{if(l=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==a)break}catch(t){i=e,u=1,s=t}finally{l=1}}return{value:t,done:d}}}(n,o,i),!0),l}var a={};function u(){}function s(){}function l(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(re(t={},r,function(){return this}),t),d=l.prototype=u.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,re(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=l,re(d,"constructor",l),re(l,"constructor",s),s.displayName="GeneratorFunction",re(l,o,"GeneratorFunction"),re(d),re(d,o,"Generator"),re(d,r,function(){return this}),re(d,"toString",function(){return"[object Generator]"}),(ne=function(){return{w:i,m:f}})()}function re(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}re=function(e,t,n,r){function i(t,n){re(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},re(e,t,n,r)}function oe(e,t,n){return t=(0,j.A)(t),(0,R.A)(e,(0,z.A)()?Reflect.construct(t,n||[],(0,j.A)(e).constructor):t.apply(e,n))}var ie=(r=function(e){function t(){var e;(0,L.A)(this,t);for(var n=arguments.length,r=new Array(n),B=0;B<n;B++)r[B]=arguments[B];return e=oe(this,t,[].concat(r)),(0,F.A)(e,"showLoading",o,e),(0,F.A)(e,"showError",i,e),(0,F.A)(e,"loaded",a,e),(0,F.A)(e,"errCode",u,e),(0,F.A)(e,"errMsg",s,e),(0,F.A)(e,"showNavBar",l,e),e.isInit=!1,(0,F.A)(e,"albumId",c,e),(0,F.A)(e,"noteId",d,e),(0,F.A)(e,"myAlbumId",f,e),(0,F.A)(e,"noteType",p,e),(0,F.A)(e,"noteEditType",h,e),(0,F.A)(e,"imgSpace",m,e),(0,F.A)(e,"note",v,e),(0,F.A)(e,"nextNote",g,e),(0,F.A)(e,"editorText",y,e),(0,F.A)(e,"editorContent",b,e),(0,F.A)(e,"productContent",w,e),(0,F.A)(e,"attributes",A,e),(0,F.A)(e,"album",k,e),(0,F.A)(e,"targetAlbum",C,e),(0,F.A)(e,"wegoNoteConfig",D,e),(0,F.A)(e,"productMap",x,e),(0,F.A)(e,"noteMap",E,e),(0,F.A)(e,"useWegoShopNote",M,e),(0,F.A)(e,"webPreviewConfig",S,e),(0,F.A)(e,"referrer_title",T,e),e.scrollTop=0,e.handleScrollToHistory=function(){e.scrollTop<=0||($("html, body").animate({scrollTop:e.scrollTop},0),document.body.scrollTop=e.scrollTop)},e.generateFromData=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e)return{parent_album_id:t.albumId,parent_album_name:t.albumName,parent_note_id:n};if(r){if(2===r.type)return{parent_album_id:r.parentAlbumId,parent_album_name:r.parentAlbumName,parent_note_id:r.parentNoteId};if(3===r.type)return{parent_note_id:r.parentNoteId,customSource:{sourceId:r.customerSourceId,sourceName:r.customerSourceName}}}return{}},e.handleResolveNoteDetailData=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r={};try{var o=t.note,i=t.album,a=t.targetAlbum,u=o.isMyAlbum,s=o.noteType,l=o.title,c=void 0===l?"":l,d=o.mediaList,f=void 0===d?[]:d,p=o.plainText,h=void 0===p?"":p,m=o.richText,v=void 0===m?"":m,g=o.refProductId,y=void 0===g?[]:g,b=o.visibilityType,w=void 0===b?0:b,A=o.visibilityConfig,k=void 0===A?[]:A,C=o.scheduleConfig,D=void 0===C?{}:C,x=o.anonymousState,E=void 0===x?1:x,M=o.collectionList,S=void 0===M?[]:M,T=o.from,P=void 0===T?{}:T,_=o.staffInfo,I=o.noteId,N=o.imgSpace,F=void 0===N?1:N;r.album=i,r.targetAlbum=a,r.noteType=1===s?q.GR.TYPE_NOTE:q.GR.TYPE_PRODUCT,r.note=o,r.originNoteData=o,r.imgSpace=F,r.attributes=(0,O.A)({permissionConfig:u?(0,ee.fU)(w,k,D):{},products:y&&y.length>0?y.map(function(e){return{goods_id:e,title:"",commodityCover:""}}):[],collection:{data:S,cacheCollections:!u&&S.length>0?[{collectionType:"forward",collections:S.map(function(e){return(0,O.A)((0,O.A)({},e),{},{collectionId:""})})}]:[]},anonymous:1===E,fromData:e.generateFromData(u,a,I,P)},_&&{staffInfo:_}),P&&u&&(2===P.type?r.supplierSource=P.parentAlbumId:3===P.type&&(r.customSource={sourceName:P.customerSourceName,sourceId:P.customerSourceId})),u||(r.supplierSource=a.albumId),r.noteType===q.GR.TYPE_PRODUCT?r.productC
21ontent={title:c,content:h,medias:f}:(r.editorText=h,r.editorContent=(0,ee.DG)(JSON.parse(v),f),r.note=(0,O.A)((0,O.A)({},o),{},{richText:JSON.stringify(r.editorContent)})),r.noteEditType=n,n===q.Bh.TYPE_FORWARD&&u&&(r.noteEditType=q.Bh.TYPE_EDIT),r.noteType===q.GR.TYPE_NOTE&&r.noteEditType===q.Bh.TYPE_FORWARD&&(r.editorContent=(0,Z.Go)(r.editorContent)),u||r.noteEditType!==q.Bh.TYPE_FORWARD||(r.attributes.anonymous=!1,r.attributes.products=[],r.attributes.collection.data=[]),r.noteType===q.GR.TYPE_NOTE&&(r.editorContent=(0,O.A)((0,O.A)({},r.editorContent),{},{content:(r.editorContent.content||[]).filter(Boolean).map(function(e){return"paragraph"===e.type&&e.content&&e.content.length>0?(0,O.A)((0,O.A)({},e),{},{content:e.content.filter(Boolean)}):(0,Q.zi)(e)&&K.Oh.includes(e.type)?(0,O.A)((0,O.A)({},e),{},{attrs:(0,O.A)((0,O.A)({},e.attrs),{},{data:(e.attrs.data||[]).filter(Boolean)})}):e})}))}catch(L){}finally{return r}},e.handleEditorUpdateContent=(0,N.A)(ne().m(function t(){var n,r,o=arguments;return ne().w(function(t){while(1)switch(t.p=t.n){case 0:return n=o.length>0&&void 0!==o[0]&&o[0],t.p=1,t.n=2,Promise.all([e.handleEditorUpdateProductContent(n),e.handleEditorUpdateNoteContent(n)]);case 2:if(!e.isProductNote){t.n=3;break}return t.a(2);case 3:r=(0,ee.Zq)((0,Y.toJS)(e.editorContent),!0),r.forEach(function(t){return e.handleEditorGetNoteContentDetail(t,n)}),t.n=5;break;case 4:t.p=4,t.v;case 5:return t.a(2)}},t,null,[[1,4]])})),e.handleEditorGetNoteContentDetail=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{if(!t)return;var r=e.noteMap[t];if(!r)return;var o=r.editorContent,i=r.richText,a=void 0===i?"":i,u="string"===typeof a?JSON.parse(a):a,s=(0,ee.wY)((0,Y.toJS)(o||u)),l=(0,ee.Zq)((0,Y.toJS)(o||u));e.handleUpdateProductDetail(s,n),e.handleUpdateNoteDetail(l,n)}catch(c){}},e.handleEditorUpdateProductContent=(0,N.A)(ne().m(function t(){var n,r,o,i,a,u,s,l,c,d,f=arguments;return ne().w(function(t){while(1)switch(t.n){case 0:if(n=f.length>0&&void 0!==f[0]&&f[0],r=e,o=r.isProductNote,i=r.editorContent,a=r.attributes,u=[],o||(s=(0,ee.wY)((0,Y.toJS)(i)),s&&s.length>0&&u.push.apply(u,(0,I.A)(s))),l=a.products,c=void 0===l?[]:l,c&&c.length>0&&(d=c.map(function(e){return e.goods_id}),d.forEach(function(e){u.includes(e)||u.push(e)})),u&&0!==u.length){t.n=1;break}return t.a(2);case 1:return t.n=2,e.handleUpdateProductDetail(u,n);case 2:return t.a(2)}},t)})),e.handleEditorUpdateNoteContent=(0,N.A)(ne().m(function t(){var n,r,o,i,a,u=arguments;return ne().w(function(t){while(1)switch(t.n){case 0:if(n=u.length>0&&void 0!==u[0]&&u[0],r=e,o=r.isProductNote,i=r.editorContent,!o){t.n=1;break}return t.a(2);case 1:if(a=(0,ee.Zq)((0,Y.toJS)(i)),a&&0!==a.length){t.n=2;break}return t.a(2);case 2:return t.n=3,e.handleUpdateNoteDetail(a,n);case 3:return t.a(2)}},t)})),(0,F.A)(e,"handleUpdateProductDetail",P,e),(0,F.A)(e,"handleUpdateNoteDetail",_,e),e.handleGetProductDetailFromCache=function(t){if(t){var n=e,r=n.productMap,o=r[t];o&&requestAnimationFrame(function(){window.dispatchEvent(new CustomEvent(X.Lm,{detail:{type:"update",list:[o]}}))})}},e.handleGetNoteDetailFromCache=function(t){if(t){var n=e,r=n.noteMap,o=r[t];o&&requestAnimationFrame(function(){window.dispatchEvent(new CustomEvent(X.e,{detail:{type:"update",list:[o]}}))})}},e.handleNoteTimeAction=function(){(0,Z.Ne)();var t=e.note||{},n=t.updateTimestamp;window.location.href="?t=".concat(Date.now(),"&navigatorType=2#/album/noteList/").concat(e.albumId,"?timestamp=").concat(n)},e.handleNoteFromAction=function(){try{(0,Z.Ne)();var t=e,n=t.from,r=void 0===n?{}:n,o=r||{},i=o.type;switch(i){case 1:var a=r||{},u=a.myAlbumId,s=a.myNoteId;window.location.href="?t=".concat(Date.now(),"&navigatorType=2#/album/note/note_detail/").concat(u,"/").concat(s);break;case 2:var l=r||{},c=l.parentAlbumId,d=l.parentNoteId;window.location.href="?t=".concat(Date.now(),"&navigatorType=2#/album/note/note_detail/").concat(c,"/").concat(d);break;case 3:var f=r||{},p=f.customerSourceId;window.location.href="?t=".concat(Date.now(),"&navigatorType=2#/album/noteList/").concat(e.albumId,"?sourceId=").concat(p);break;default:break}}catch(h){}},e.handleNoteCollectionAction=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t||{},r=n.collectionId;r&&((0,Z.Ne)(),window.location.href="?t=".concat(Date.now(),"&navigatorType=2#/album/noteList/").concat(e.albumId,"?collectionId=").concat(r))},e.handleGetNoteTitle=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.note;return t?t.title:""},e.handleShowPCWebPreview=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.pluginId,r=t.index,o=t.editorContent,i=void 0===o?{}:o;try{var a=(0,ee.XR)({editorContent:i,pluginId:n,index:r}),u=a.index,s=a.medias,l=(0,ee.Ys)(i);e.setState({webPreviewConfig:{initialIndex:u,medias:s,mediaList:(0,J.iP)(l||[])}})}catch(c){}},e.handleClosePCWebPreview=function(){e.setState({webPreviewConfig:{}})},e.handleWegoProductMediaPreview=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];
21try{var r=e.productContent,o=r.title,i=r.medias;if(!i||0===i.length)return;if(G.YB){var a=e,u=a.albumId,s=a.noteId,l=a.isMyAlbum,c=a.allowDownload,d=i[t];if(!d||!d.mediaUrl)return void wgoo.$toast({title:"èµæºä¸ä¼ ä¸ï¼è¯·ç¨ååè¯"});appShare(375,{scene:n?"edit":"",shopId:u,noteId:s,title:o||"",isMyAlbum:l,currentIndex:t,isAllowDownLoad:n||c?1:0,mediaList:(0,J.iP)((0,Y.toJS)(i))})}else{var f=(0,J.iP)(i).map(function(e){return{type:4===e.mediaType?"live":2===e.mediaType?"video":"image",url:e.mediaUrl,cover:e.mediaCoverUrl}});e.setState({webPreviewConfig:{initialIndex:t,medias:f,mediaList:(0,J.iP)(i)}})}}catch(p){}},e.handlePluginPreviewMediaMessage=function(t){try{var n=t.detail||{},r=n.pluginId,o=(n.pluginName,n.index),i=n.isEdit,a=n.noteId,u=void 0===a?"":a,s=n.readOnly,l=void 0!==s&&s,c=e,d=c.albumId,f=c.noteId,p=c.isMyAlbum,h=c.allowDownload,m=c.editorContent,v=c.noteMap,g=void 0===v?{}:v,y=e.handleGetNoteTitle();if(u&&u!==f){var b=g[u];if(!b)return void wgoo.$toast({title:"æ°æ®ç¼ºå¤±ï¼è¯·ç¨ååè¯"});f=b.noteId,y=b.title||"",h=p||b.forwardDown,m=b.richText?"string"===typeof b.richText?JSON.parse(b.richText):b.richText:{}}if(G.YB){var w=(0,ee.uE)(m,r,o),A=(0,ee.Ys)(m);(0,Y.toJS)(A),appShare(375,{scene:l?"read":i?"edit":"",shopId:d,noteId:f,isMyAlbum:p,title:y||"",currentIndex:w,isAllowDownLoad:h?1:0,mediaList:(0,J.iP)((0,Y.toJS)(A))})}else e.handleShowPCWebPreview({pluginId:r,index:o,editorContent:(0,Y.toJS)(m)})}catch(k){}},e.handlePluginProductPreviewMediaMessage=function(t){try{var n=t.detail||{},r=n.index,o=n.isEdit,i=n.noteId,a=void 0===i?"":i,u=n.readOnly,s=void 0!==u&&u,l=e,c=l.albumId,d=l.noteId,f=l.isMyAlbum,p=l.allowDownload,h=l.productContent,m=l.noteMap,v=void 0===m?{}:m,g=h.title||"",y=h.medias||[];if(a&&a!==d){var b=v[a];if(!b)return void wgoo.$toast({title:"æ°æ®ç¼ºå¤±ï¼è¯·ç¨ååè¯"});d=b.noteId,g=b.title||"",p=f||b.forwardDown,y=b.mediaList}if(!y||!y.length)return void wgoo.$toast({title:"åªä½èµæºæ°æ®ç¼ºå¤±ï¼è¯·ç¨ååè¯"});if(y=(0,J.iP)(y),G.YB)appShare(375,{scene:s?"read":o?"edit":"",shopId:c,noteId:d,isMyAlbum:f,title:g||"",currentIndex:r,isAllowDownLoad:p?1:0,mediaList:(0,Y.toJS)(y)});else{var w=y.map(function(e){return{type:4===e.mediaType?"live":2===e.mediaType?"video":"image",url:e.mediaUrl,cover:e.mediaCoverUrl}});e.setState({webPreviewConfig:{initialIndex:r,medias:w,mediaList:y}})}}catch(A){}},e.handlePluginGetDetailMessage=function(t){try{var n=t.detail||{},r=n.type,o=void 0===r?"":r,i=n.resId,a=void 0===i?"":i;switch(o){case"product":e.handleGetProductDetailFromCache(a);break;case"note":e.handleGetNoteDetailFromCache(a);break;default:break}}catch(u){}},e.handleBaseRegisterWindowMessage=function(){window.addEventListener(X.MA,e.handlePluginPreviewMediaMessage,!1),window.addEventListener(X.Mm,e.handlePluginProductPreviewMediaMessage,!1),window.addEventListener(X.YO,e.handlePluginGetDetailMessage,!1)},e.handleBaseUnregisterWindowMessage=function(){window.removeEventListener(X.MA,e.handlePluginPreviewMediaMessage,!1),window.removeEventListener(X.Mm,e.handlePluginProductPreviewMediaMessage,!1),window.removeEventListener(X.YO,e.handlePluginGetDetailMessage,!1)},e}return(0,H.A)(t,e),(0,B.A)(t,[{key:"selfAlbumId",get:function(){var e=this.myAlbumId,t=this.album,n=void 0===t?{}:t;return e||(null===n||void 0===n?void 0:n.albumId)}},{key:"isMyAlbum",get:function(){var e,t=this.note,n=void 0===t?{}:t;return null===(e=null===n||void 0===n?void 0:n.isMyAlbum)||void 0===e||e}},{key:"from",get:function(){var e,t=this.note,n=void 0===t?{}:t;return null!==(e=null===n||void 0===n?void 0:n.from)&&void 0!==e?e:{}}},{key:"isAnonymous",get:function(){var e=this.note,t=void 0===e?{}:e;return 1===(null===t||void 0===t?void 0:t.anonymousState)}},{key:"isProductNote",get:function(){return this.noteType===q.GR.TYPE_PRODUCT}},{key:"allowDownload",get:function(){var e=this.isMyAlbum,t=this.note,n=void 0===t?{}:t;return e||n.forwardDown}},{key:"allowForward",get:function(){var e=this.allowDownload,t=this.useWegoShopNote;return e&&t}},{key:"isPublish",get:function(){return this.noteEditType===q.Bh.TYPE_PUBLISH}},{key:"isForward",get:function(){return this.noteEditType===q.Bh.TYPE_FORWARD}},{key:"isEdit",get:function(){return this.noteEditType===q.Bh.TYPE_EDIT}},{key:"isCopy",get:function(){return this.noteEditType===q.Bh.TYPE_COPY}},{key:"isImport",get:function(){return this.noteEditType===q.Bh.TYPE_IMPORT}},{key:"publishText",get:function(){var e=this.isPublish,t=this.isForward,n=(this.isCopy,this.isImport);this.isEdit;return e||n?"åå¸":t?"转å":"ä¿å"}}])}(W.A),o=(0,V.A)(r.prototype,"showLoading",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),i=(0,V.A)(r.prototype,"showError",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),a=(0,V.A)(r.prototype,"loaded",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),u=(0,V.A)(r.prototype,"errCode",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),s=(0,V.A)(r.prototype,"errMsg",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),l=(0,V.A)(r.prototype,"showNavBar",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return(0,U.hB)()&&G.YB}}),c=(0,V.A)(r.prototype,"albumId",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),d=(0,V.A)(r.prototype,"noteId",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),f=(0,V.A)(r.prototype,"myAlbumId",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),p=(0,V.A)(r.prototype,"noteType",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return q.GR.TYPE_NOTE}}),h=(0,V.A)(r.prototype,"noteEditType",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return q.Bh.TYPE_PUBLISH}}),m=(0,V.A)(r.prototype,"imgSpace",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),v=(0,V.A)(r.prototype,"note",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),g=(0,V.A)(r.prototype,"nextNote",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),y=(0,V.A)(r.prototype,"editorText",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),b=(0,V.A)(r.prototype,"editorContent",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{type:"doc",content:[]}}}
21),w=(0,V.A)(r.prototype,"productContent",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{title:"",content:"",medias:[]}}}),A=(0,V.A)(r.prototype,"attributes",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{collections:[],products:[]}}}),k=(0,V.A)(r.prototype,"album",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),C=(0,V.A)(r.prototype,"targetAlbum",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),D=(0,V.A)(r.prototype,"wegoNoteConfig",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{maxImageCount:180,maxVideoCount:20,maxTextLength:2e5,draftInterval:1e3,maxHDGifSize:20971520,maxHDVideoSize:209715200,supportImageScale:!1,placeholder:"è®°å½äº§åæ
äºãåç¹ãç¾å¾",fontColorConfig:["#1E2028","#6E7382","#B7BEC5","#03C160","#FF6045","#FA9D3B","#208BF1","#6367F0","#285B9A","#C79A56"]}}}),(0,V.A)(r.prototype,"selfAlbumId",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"selfAlbumId"),r.prototype),(0,V.A)(r.prototype,"isMyAlbum",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"isMyAlbum"),r.prototype),(0,V.A)(r.prototype,"from",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"from"),r.prototype),x=(0,V.A)(r.prototype,"productMap",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),E=(0,V.A)(r.prototype,"noteMap",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),M=(0,V.A)(r.prototype,"useWegoShopNote",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),S=(0,V.A)(r.prototype,"webPreviewConfig",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{initialIndex:[],medias:[],mediaList:[]}}}),T=(0,V.A)(r.prototype,"referrer_title",[Y.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),(0,V.A)(r.prototype,"isAnonymous",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"isAnonymous"),r.prototype),(0,V.A)(r.prototype,"isProductNote",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"isProductNote"),r.prototype),(0,V.A)(r.prototype,"allowDownload",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"allowDownload"),r.prototype),(0,V.A)(r.prototype,"allowForward",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"allowForward"),r.prototype),(0,V.A)(r.prototype,"isPublish",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"isPublish"),r.prototype),(0,V.A)(r.prototype,"isForward",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"isForward"),r.prototype),(0,V.A)(r.prototype,"isEdit",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"isEdit"),r.prototype),(0,V.A)(r.prototype,"isCopy",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"isCopy"),r.prototype),(0,V.A)(r.prototype,"isImport",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"isImport"),r.prototype),(0,V.A)(r.prototype,"publishText",[Y.computed],Object.getOwnPropertyDescriptor(r.prototype,"publishText"),r.prototype),P=(0,V.A)(r.prototype,"handleUpdateProductDetail",[Y.action],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return(0,N.A)(ne().m(function t(){var n,r,o,i,a,u,s,l,c,d,f,p,h,m,v,g,y=arguments;return ne().w(function(t){while(1)switch(t.p=t.n){case 0:if(n=y.length>0&&void 0!==y[0]?y[0]:[],r=y.length>1&&void 0!==y[1]&&y[1],t.p=1,n&&0!==n.length){t.n=2;break}return t.a(2);case 2:if(o=e.productMap,r||!n.every(function(e){return o[e]})){t.n=3;break}i=n.map(function(e){return o[e]}),requestAnimationFrame(function(){window.dispatchEvent(new CustomEvent(X.Lm,{detail:{type:"update",list:i}}))}),a=e.attributes,u=a.products.filter(function(e){return o[e.goods_id]}).map(function(e){var t,n,r=o[e.goods_id];return{goods_id:r.goods_id,title:r.title,commodityCover:(null===(t=r.imgs)||void 0===t?void 0:t[0])||(null===(n=r.imgsSrc)||void 0===n?void 0:n[0])}}),e.setState({attributes:(0,O.A)((0,O.A)({},a),{},{products:u})}),t.n=5;break;case 3:return s=e.albumId,l=e.selfAlbumId,c=e.isForward,t.n=4,(0,te.a7)(c?l:s,n);case 4:d=t.v,f=(0,U.o8)(o||{}),d.forEach(function(e){return f[e.goods_id]=e}),p=n.filter(function(e){return!d.some(function(t){return t.goods_id===e})}),p.length>0&&p.forEach(function(e){return delete f[e]}),e.setState({productMap:f}),h=n.map(function(e){return f[e]}
21).filter(Boolean),h&&h.length>0&&window.dispatchEvent(new CustomEvent(X.Lm,{detail:{type:"update",list:h}})),m=n.filter(function(e){return!f[e]}),m&&window.dispatchEvent(new CustomEvent(X.Lm,{detail:{type:"delete",deletedIds:m}})),v=e.attributes,g=v.products.filter(function(e){return f[e.goods_id]}).map(function(e){var t,n,r=f[e.goods_id];return{goods_id:r.goods_id,title:r.title,commodityCover:(null===(t=r.imgs)||void 0===t?void 0:t[0])||(null===(n=r.imgsSrc)||void 0===n?void 0:n[0])}}),e.setState({attributes:(0,O.A)((0,O.A)({},v),{},{products:g})});case 5:t.n=7;break;case 6:t.p=6,t.v;case 7:return t.a(2)}},t,null,[[1,6]])}))}}),_=(0,V.A)(r.prototype,"handleUpdateNoteDetail",[Y.action],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return(0,N.A)(ne().m(function t(){var n,r,o,i,a,u,s,l,c,d,f,p,h=arguments;return ne().w(function(t){while(1)switch(t.p=t.n){case 0:if(n=h.length>0&&void 0!==h[0]?h[0]:[],r=h.length>1&&void 0!==h[1]&&h[1],t.p=1,n&&0!==n.length){t.n=2;break}return t.a(2);case 2:if(o=e.noteMap,r||!n.every(function(e){return o[e]})){t.n=3;break}i=n.map(function(e){return n[e]}),requestAnimationFrame(function(){window.dispatchEvent(new CustomEvent(X.e,{detail:{type:"update",list:i}}))}),t.n=5;break;case 3:return a=e.albumId,u=e.selfAlbumId,s=e.isForward,t.n=4,(0,te.B2)(s?u:a,n);case 4:l=t.v,c=(0,U.o8)(o||{}),l.forEach(function(e){return c[e.noteId]=e}),d=n.filter(function(e){return!l.some(function(t){return t.noteId===e})}),d.length>0&&d.forEach(function(e){return delete c[e]}),e.setState({noteMap:c}),f=n.map(function(e){return c[e]}).filter(Boolean),f&&f.length>0&&window.dispatchEvent(new CustomEvent(X.e,{detail:{type:"update",list:f}})),p=n.filter(function(e){return!c[e]}),p&&window.dispatchEvent(new CustomEvent(X.e,{detail:{type:"delete",deletedIds:p}}));case 5:t.n=7;break;case 6:t.p=6,t.v;case 7:return t.a(2)}},t,null,[[1,6]])}))}}),r);t.A=ie},74716:function(e,t,n){n.d(t,{BJ:function(){return h},Cj:function(){return F},DG:function(){return w},GA:function(){return g},Gv:function(){return b},Pv:function(){return D},XR:function(){return O},Ys:function(){return S},ZI:function(){return y},Zq:function(){return M},_M:function(){return v},bV:function(){return x},cj:function(){return B},f3:function(){return A},fU:function(){return m},mq:function(){return C},o5:function(){return R},qq:function(){return P},rb:function(){return k},uE:function(){return _},wY:function(){return E},x$:function(){return I},z9:function(){return T},zj:function(){return N}});var r=n(1290),o=n(85567),i=n(34293),a=n(6279),u=n(84315),s=(n(39525),n(11759)),l=n(96166),c=n(34252),d=n(12843),f=n(92445),p=n(78255);function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.permission,n=void 0===t?0:t,r=e.schedule,o=void 0===r?{}:r;return 1!==n?{}:{operateType:0===n?1:0,timeType:o.value,operateTime:3===o.value?o.operateTime:""}}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return n.operateTime?(r.value=3,r.operateTime=n.operateTime):(r.value=4,r.operateTime=""),{permission:e,schedule:1===e?r:{},tags:t&&t.length>0?t:[]}}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.Vj.MODE_PREVIEW,n=(0,u.o8)(e);try{n.content.forEach(function(e){(0,p.zi)(e)&&(e.attrs.mode=t)})}catch(r){}finally{return n}}function g(e,t){try{if(!e||!t)return 0;var n=e.content;return n.filter(function(e){return e.type===t}).length}catch(r){return 0}}function y(e,t){try{if(!e||!t)return!1;var n=(0,p.d)(t),r=e.content,o=r.filter(function(e){return e.type===t}).length;return o>=n}catch(i){return!1}}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:180,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20;switch(e){case c.zM.TYPE_PRODUCT:return"æå¤æ·»å ".concat(c.gO[e].maxCount,"个产å");case c.zM.TYPE_NOTE:return"æå¤æ·»å ".concat(c.gO[e].maxCount,"ç¯ç¬è®°");case c.zM.TYPE_LINK:return"æå¤æ·»å ".concat(c.gO[e].maxCount,"个æå龿¥");case c.zM.TYPE_DIVIDER:return"æå¤æ·»å ".concat(c.gO[e].maxCount,"个åå²çº¿");case c.zM.TYPE_IMAGE:case c.zM.TYPE_GRID:return"æå¤æ·»å ".concat(t,"å¼ å¾ç").concat(n,"个è§é¢");case c.zM.TYPE_SLIDE:return"æå¤æ·»å ".concat(t,"å¼ å¾ç")}}function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,u.o8)(e);try{var r=new Set;n.content.forEach(function(e){if((0,p.zi)(e)&&c.c9.includes(e.type)){var n=e.attrs||{},o=n.data;if(Array.isArray(o))e.attrs.data=o.map(function(e){var n=(0,l._W)(e.mediaUrl),o=t.find(function(e){return e.mediaUrl.includes(n)&&!r.has(e.mediaId)});return o&&r.add(o.mediaId),o?(0,i.A)((0,i.A)({},e),o):e});else{var a=(0,l._W)(o.mediaUrl),u=t.find(function(e){return e.mediaUrl.includes(a)&&!r.has(e.mediaId)});if(!u)return;r.add(u.mediaId),e.attrs.data=(0,i.A)((0,i.A)({},o),u)}}})}catch(o){}finally{return n}}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,u.o8)(e);try{n.content.forEach(function(e){if((0,p.zi)(e)&&c.c9.includes(e.type)){var n=e.attrs||{},r=n.data;if(Array.isArray(r))e.attrs.data=r.map(function(e){var n=t.find(function(t){return t.mediaId===e.mediaId});return n?(0,i.A)((0,i.A)({},e),n):e});else{var o=t.find(function(e){return r.mediaId===e.mediaId});if(!o)return;e.attrs.data=(0,i.A)((0,i.A)({},r),o)}}})}catch(r){}finally{return n}}function k(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="";try{if(!e)return;var n=e.content,r=void 0===n?[]:n;if(!r||0===r.length)return;var o=["heading","paragraph"],i=["bulletList","orderedList"],a=r.find(function(e){var t=e.content;if(i.includes(e.type)){var n=t.some(function(e){var t,n=null===(t=e.content)||void 0===t?void 0:t.some(function(e){var t;return"paragraph"===e.type&&(null===(t=e.content)||void 0===t?void 0:t.some(function(e){return!!e.text}))});return!!n});return n}return!!o.includes(e.type)&&(!!t&&t.some(function(e){return!!e.text}))});if(!a)return;if(o.includes(a.type))t=a.content.map(function(e){return e.text}).join("");else{var u=a.content.find(function(e){var t,n=null===(t=e.content)||void 0===t?void 0:t.some(function(e){var t;return"paragraph"===e.type&&(null===(t=e.content)||void 0===t?void 0:t.some(function(e){return!!e.text}))});return!!n}),s=u.content.find(function(e){return"paragraph"===e.type});t=s.content.map(function(e){return e.text}).join("")}t&&(t=t.trim().split("\n").filter(function(e){return!!e})[0]||""),t.length>
21100&&(t=t.slice(0,100))}catch(l){}finally{return t}}function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};try{if(!e)return;var n=e.content,r=void 0===n?[]:n;if(!r||0===r.length)return;var o=r.find(function(e){return c.c9.includes(e.type)});if(!o)return;t.pluginId=o.attrs.pluginId,t.index=0;var i=o.attrs.data,a="";if(Array.isArray(i)&&i.length>0){var u=(0,f.iZ)(i[0]);a=u.mediaCoverUrl||u.mediaUrl}else{var s=(0,f.iZ)(i);a=s.mediaCoverUrl||s.mediaUrl}t.value=a}catch(l){}finally{return t}}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n={pluginId:"",index:0,media:{}};try{if(!e)return;var r=e.content,i=void 0===r?[]:r;if(!i||0===i.length)return;var a=i.filter(function(e){return c.c9.includes(e.type)});if(!a||a.length<=0)return;var u,s=(0,o.A)(a);try{for(s.s();!(u=s.n()).done;){var l=u.value,d=l.attrs.data;if(Array.isArray(d)){var f=d.findIndex(function(e){return e.mediaId===t});if(f>=0){n.pluginId=l.attrs.pluginId,n.index=f,n.media=d[f];break}}else if(d.mediaId===t){n.pluginId=l.attrs.pluginId,n.media=d;break}}}catch(p){s.e(p)}finally{s.f()}}catch(h){}finally{return n}}function x(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=[];try{if(!e)return;var r=e.content,i=void 0===r?[]:r;if(!i||0===i.length)return;var a=i.filter(function(e){return c.c9.includes(e.type)});if(!a||a.length<=0)return;var u,s=(0,o.A)(a);try{for(s.s();!(u=s.n()).done;){var l=u.value,d=l.attrs.data;if(Array.isArray(d)){var f=d.findIndex(function(e){return t.includes(e.mediaId)});f>=0&&n.push({pluginId:l.attrs.pluginId,index:f,media:d[f]})}else if(t.includes(d.mediaId)){n.push({pluginId:l.attrs.pluginId,index:0,media:d});break}}}catch(p){s.e(p)}finally{s.f()}}catch(h){}finally{return n}}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[];try{if(!e)return;var n=e.content,r=void 0===n?[]:n;if(!r||0===r.length)return;var o=r.filter(function(e){return e.type===c.zM.TYPE_PRODUCT});if(!o||o.length<=0)return;o.forEach(function(e){t.push(e.attrs.data.resId)})}catch(i){}finally{return t}}function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];try{if(!e)return;var r=e.content,o=void 0===r?[]:r;if(!o||0===o.length)return;var i=o.filter(function(e){return e.type===c.zM.TYPE_NOTE&&(!t||e.attrs.data.expand===t)});if(!i||i.length<=0)return;i.forEach(function(e){n.push(e.attrs.data.resId)})}catch(a){}finally{return n}}function S(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[];try{var n=e.content,o=void 0===n?[]:n,u=o.filter(function(e){return c.c9.includes(e.type)});u.forEach(function(e){var n=(e||{}).attrs||{},o=n.data,u=void 0===o?{}:o;(0,a.isArrayLike)(u)?t.push.apply(t,(0,r.A)(u.map(function(e){return(0,i.A)({},e)}))):t.push((0,i.A)({},u))})}catch(s){}finally{return t}}function T(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[];try{if(e.content.length<=0||!t||t.length<=0)return;var o=e.content.filter(function(e){return t.includes(e.type)});n.push.apply(n,(0,r.A)(o))}catch(i){}finally{return n}}function P(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[];try{if(e.content.length<=0||!t)return;var o=e.content.filter(function(e){return e.type===t});n.push.apply(n,(0,r.A)(o))}catch(i){}finally{return n}}function _(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;try{var r,i=0,u=e.content,s=void 0===u?[]:u,l=s.filter(function(e){return c.c9.includes(e.type)}),d=(0,o.A)(l);try{for(d.s();!(r=d.n()).done;){var f=r.value,p=f.attrs||{},h=p.pluginId,m=p.data;if(t===h){i+=n;break}(0,a.isArrayLike)(m)?i+=m.length:i++}}catch(v){d.e(v)}finally{d.f()}return i}catch(g){return 0}}function I(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0;try{var n=S(e);t=n.filter(function(e){return e.mediaType!==s.Ap.TYPE_VIDEO}).length}catch(r){}finally{return t}}function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0;try{var n=S(e);t=n.filter(function(e){return e.mediaType===s.Ap.TYPE_VIDEO}).length}catch(r){}finally{return t}}function O(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.editorContent,n=void 0===t?{}:t,o=e.pluginId,i=void 0===o?"":o,a=e.index,u=void 0===a?0:a,s={index:0,medias:[]};try{if(!n)return;var l=n.content,d=void 0===l?[]:l;if(!d||0===d.length)return;var f=d.filter(function(e){return c.c9.includes(e.type)});if(!f||f.length<=0)return;var p=!1;f.forEach(function(e){var t,n=e.attrs.data;(e.attrs.pluginId===i?(s.index+=u,p=!0):p||(Array.isArray(n)&&n.length>0?s.index+=n.length:s.index+=1),Array.isArray(n)&&n.length>0)?(t=s.medias).push.apply(t,(0,r.A)(n.map(function(e){return{type:4===e.mediaType?"live":2===e.mediaType?"video":"image",url:e.mediaUrl,cover:[2,4].includes(e.mediaType)?e.mediaCoverUrl||"".concat(e.mediaUrl).concat(c.KW):""}}))):s.medias.push({type:4===n.mediaType?"live":2===n.mediaType?"video":"image",url:n.mediaUrl,cover:[2,4].includes(n.mediaType)?n.mediaCoverUrl||"".concat(n.mediaUrl).concat(c.KW):""})})}catch(h){}finally{return s}}function F(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,u.o8)(e);try{var n=[c.zM.TYPE_NOTE,c.zM.TYPE_PRODUCT];t.content=t.content.filter(function(e){if(!n.includes(e.type))return!0;var t=e.attrs.data,r=void 0===t?{}:t;return r.exist})}catch(r){}finally{return t}}function L(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{if(e.attrs.pluginId!==t.attrs.pluginId)return!0;switch(e.type){case c.zM.TYPE_NOTE:var n=e.attrs.data,r=void 0===n?{}:n,o=t.attrs.data,i=void 0===o?{}:o;return r.resType!==i.resType||r.resId!==i.resId||r.expand!==i.expand||r.exist!==i.exist;case c.zM.TYPE_PRODUCT:var a=e.attrs.data,u=void 0===a?{}:a,s=t.attrs.data,d=void 0===s?{}:s;return u.resType!==d.resType||u.resId!==d.resId||u.exist!==d.exist;case c.zM.TYPE_SLIDE:case c.zM.TYPE_GRID:var f=e.attrs.data,p=void 0===f?[]:f,h=t.attrs.data,m=void 0===h?[]:h;return p.length!==m.length||p.some(function(e,t){var n=m[t],r=e.mediaUrl,o=n.mediaUrl,i=(0,l._W)(r.length>
21o?o:r),a=!(r.length>o?r:o).includes(i);return e.resType!==n.resType||e.resId!==n.resId||a});case c.zM.TYPE_IMAGE:var v=e.attrs.data,g=void 0===v?{}:v,y=t.attrs.data,b=void 0===y?{}:y,w=g.mediaUrl,A=b.mediaUrl,k=(0,l._W)(w.length>A?A:w),C=!(w.length>A?w:A).includes(k);return g.resType!==b.resType||g.resId!==b.resId||C;case c.zM.TYPE_LINK:var D=e.attrs.data,x=void 0===D?{}:D,E=t.attrs.data,M=void 0===E?{}:E;return x.resType!==M.resType||x.resId!==M.resId||x.customName!==M.customName;default:break}return!1}catch(S){return!0}}function B(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{if(!e||!t)return!0;if(e.content.length!==t.content.length)return!0;for(var n=0;n<e.content.length;n++){var r=e.content[n],o=t.content[n];if(r.type!==o.type)return!0;if((0,p.zi)(r)){if(r.type!==c.zM.TYPE_DIVIDER){var i=L(r,o);if(i)return!0}}else if(JSON.stringify(r)!==JSON.stringify(o))return!0}return!1}catch(a){return!0}}function R(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.editor,n=e.pluginName,r=void 0===n?"":n,o=e.pluginId,a=void 0===o?"":o,u=e.medias,s=void 0===u?[]:u;try{if(!t||!r)return;var l=s;if(l.length>0)switch(r){case c.zM.TYPE_IMAGE:l.forEach(function(e,n){(0,p.dW)({editor:t,pluginName:r,data:(0,i.A)({resType:c.kq.TYPE_NONE,resId:c.kq.TYPE_NONE,resName:"",resIcon:e.mediaCoverUrl||e.mediaUrl},e),insertParagraph:n===l.length-1})});break;case c.zM.TYPE_GRID:case c.zM.TYPE_SLIDE:a?window.dispatchEvent(new CustomEvent(d.E7,{detail:{pluginId:a,data:l.map(function(e){return(0,i.A)({resIcon:e.mediaCoverUrl||e.mediaUrl},e)})}})):(0,p.dW)({editor:t,pluginName:r,data:l.map(function(e){return(0,i.A)({resType:c.kq.TYPE_NONE,resId:c.kq.TYPE_NONE,resName:"",resIcon:e.mediaCoverUrl||e.mediaUrl},e)})});break;default:break}}catch(f){}}},57279:function(e,t,n){n.d(t,{O4:function(){return xa},QE:function(){return Sa},ug:function(){return _a},nx:function(){return Pa},xv:function(){return Ta},om:function(){return Ia}});var r=n(1290),o=n(94560),i=n(18761),a=n(34293),u=n(62704),s=["children"];var l=function(e,t){if("slot"===e)return 0;if(e instanceof Function)return e(t);var n=null!=t?t:{},r=n.children,o=(0,u.A)(n,s);if("svg"===e)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,o,r]},c=/^\s*>\s$/,d=i.bP.create({name:"blockquote",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML:function(){return[{tag:"blockquote"}]},renderHTML:function(e){var t=e.HTMLAttributes;return l("blockquote",(0,a.A)((0,a.A)({},(0,i.KV)(this.options.HTMLAttributes,t)),{},{children:l("slot",{})}))},parseMarkdown:function(e,t){var n,r=null!=(n=t.parseBlockChildren)?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:function(e,t){if(!e.content)return"";var n=">",r=[];return e.content.forEach(function(e,o){var i,a,u=null!=(a=null==(i=t.renderChild)?void 0:i.call(t,e,o))?a:t.renderChildren([e]),s=u.split("\n"),l=s.map(function(e){return""===e.trim()?n:"".concat(n," ").concat(e)});r.push(l.join("\n"))}),r.join("\n".concat(n,"\n"))},addCommands:function(){var e=this;return{setBlockquote:function(){return function(t){var n=t.commands;return n.wrapIn(e.name)}},toggleBlockquote:function(){return function(t){var n=t.commands;return n.toggleWrap(e.name)}},unsetBlockquote:function(){return function(t){var n=t.commands;return n.lift(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-b":function(){return e.editor.commands.toggleBlockquote()}}}
21,addInputRules:function(){return[(0,i.tG)({find:c,type:this.type})]}}),f=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,p=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,h=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,m=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,v=i.CU.create({name:"bold",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){var e=this;return[{tag:"strong"},{tag:"b",getAttrs:function(e){return"normal"!==e.style.fontWeight&&null}},{style:"font-weight=400",clearMark:function(t){return t.type.name===e.name}},{style:"font-weight",getAttrs:function(e){return/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}}]},renderHTML:function(e){var t=e.HTMLAttributes;return l("strong",(0,a.A)((0,a.A)({},(0,i.KV)(this.options.HTMLAttributes,t)),{},{children:l("slot",{})}))},markdownTokenName:"strong",parseMarkdown:function(e,t){return t.applyMark("bold",t.parseInline(e.tokens||[]))},markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:function(e,t){return"**".concat(t.renderChildren(e),"**")},addCommands:function(){var e=this;return{setBold:function(){return function(t){var n=t.commands;return n.setMark(e.name)}},toggleBold:function(){return function(t){var n=t.commands;return n.toggleMark(e.name)}},unsetBold:function(){return function(t){var n=t.commands;return n.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-b":function(){return e.editor.commands.toggleBold()},"Mod-B":function(){return e.editor.commands.toggleBold()}}},addInputRules:function(){return[(0,i.OX)({find:f,type:this.type}
21),(0,i.OX)({find:h,type:this.type})]},addPasteRules:function(){return[(0,i.Zc)({find:p,type:this.type}),(0,i.Zc)({find:m,type:this.type})]}}),g=/(^|[^`])`([^`]+)`(?!`)$/,y=/(^|[^`])`([^`]+)`(?!`)/g,b=i.CU.create({name:"code",addOptions:function(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML:function(){return[{tag:"code"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["code",(0,i.KV)(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:function(e,t){return t.applyMark("code",[{type:"text",text:e.text||""}])},renderMarkdown:function(e,t){return e.content?"`".concat(t.renderChildren(e.content),"`"):""},addCommands:function(){var e=this;return{setCode:function(){return function(t){var n=t.commands;return n.setMark(e.name)}},toggleCode:function(){return function(t){var n=t.commands;return n.toggleMark(e.name)}},unsetCode:function(){return function(t){var n=t.commands;return n.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-e":function(){return e.editor.commands.toggleCode()}}},addInputRules:function(){return[(0,i.OX)({find:g,type:this.type})]}
21,addPasteRules:function(){return[(0,i.Zc)({find:y,type:this.type})]}}),w=n(88688),A=4,k=/^```([a-z]+)?[\s\n]$/,C=/^~~~([a-z]+)?[\s\n]$/,D=i.bP.create({name:"codeBlock",addOptions:function(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:A,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes:function(){var e=this;return{language:{default:this.options.defaultLanguage,parseHTML:function(t){var n,o=e.options.languageClassPrefix;if(!o)return null;var i=(0,r.A)((null==(n=t.firstElementChild)?void 0:n.classList)||[]),a=i.filter(function(e){return e.startsWith(o)}).map(function(e){return e.replace(o,"")}),u=a[0];return u||null},rendered:!1}}},parseHTML:function(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return["pre",(0,i.KV)(this.options.HTMLAttributes,n),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:function(e,t){var n,r;return!1===(null==(n=e.raw)?void 0:n.startsWith("```"))&&!1===(null==(r=e.raw)?void 0:r.startsWith("~~~"))&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:function(e,t){var n,r="",o=(null==(n=e.attrs)?void 0:n.language)||"";if(e.content){var i=["```".concat(o),t.renderChildren(e.content),"```"];r=i.join("\n")}else r="```".concat(o,"\n\n```");return r},addCommands:function(){var e=this;return{setCodeBlock:function(t){return function(n){var r=n.commands;return r.setNode(e.name,t)}},toggleCodeBlock:function(t){return function(n){var r=n.commands;return r.toggleNode(e.name,"paragraph",t)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-c":function(){return e.editor.commands.toggleCodeBlock()},Backspace:function(){var t=e.editor.state.selection,n=t.empty,r=t.$anchor,o=1===r.pos;return!(!n||r.parent.type.name!==e.name)&&(!(!o&&r.parent.textContent.length)&&e.editor.commands.clearNodes())},Tab:function(t){var n,r=t.editor;if(!e.options.enableTabIndentation)return!1;var o=null!=(n=e.options.tabSize)?n:A,i=r.state,a=i.selection,u=a.$from,s=a.empty;if(u.parent.type!==e.type)return!1;var l=" ".repeat(o);return s?r.commands.insertContent(l):r.commands.command(function(e){var t=e.tr,n=a.from,r=a.to,o=i.doc.textBetween(n,r,"\n","\n"),u=o.split("\n"),s=u.map(function(e){return l+e}).join("\n");return t.replaceWith(n,r,i.schema.text(s)),!0})},"Shift-Tab":function(t){var n,r=t.editor;if(!e.options.enableTabIndentation)return!1;var o=null!=(n=e.options.tabSize)?n:A,i=r.state,a=i.selection,u=a.$from,s=a.empty;return u.parent.type===e.type&&(s?r.commands.command(function(e){for(var t,n=e.tr,r=u.pos,a=u.start(),s=u.end(),l=i.doc.textBetween(a,s,"\n","\n"),c=l.split("\n"),d=0,f=0,p=r-a,h=0;h<c.length;h+=1){if(f+c[h].length>=p){d=h;break}f+=c[h].length+1}var m=c[d],v=(null==(t=m.match(/^ */))?void 0:t[0])||"",g=Math.min(v.length,o);if(0===g)return!0;for(var y=a,b=0;b<d;b+=1)y+=c[b].length+1;n.delete(y,y+g);var A=r-y;return A<=g&&n.setSelection(w.U3.create(n.doc,y)),!0}):r.commands.command(function(e){var t=e.tr,n=a.from,r=a.to,u=i.doc.textBetween(n,r,"\n","\n"),s=u.split("\n"),l=s.map(function(e){var t,n=(null==(t=e.match(/^ */))?void 0:t[0])||"",r=Math.min(n.length,o);return e.slice(r)}).join("\n");return t.replaceWith(n,r,i.schema.text(l)),!0}))},Enter:function(t){var n=t.editor;if(!e.options.exitOnTripleEnter)return!1;var r=n.state,o=r.selection,i=o.$from,a=o.empty;if(!a||i.parent.type!==e.type)return!1;var u=i.parentOffset===i.parent.nodeSize-2,s=i.parent.textContent.endsWith("\n\n");return!(!u||!s)&&n.chain().command(function(e){var t=e.tr;return t.delete(i.pos-2,i.pos),!0}).exitCode().run()},ArrowDown:function(t){var n=t.editor;if(!e.options.exitOnArrowDown)return!1;var r=n.state,o=r.selection,i=r.doc,a=o.$from,u=o.empty;if(!u||a.parent.type!==e.type)return!1;var s=a.parentOffset===a.parent.nodeSize-2;if(!s)return!1;var l=a.after();if(void 0===l)return!1;var c=i.nodeAt(l);return c?n.commands.command(function(e){var t=e.tr;return t.setSelection(w.LN.near(i.resolve(l))),!0}):n.commands.exitCode()}}}
21,addInputRules:function(){return[(0,i.JJ)({find:k,type:this.type,getAttributes:function(e){return{language:e[1]}}}),(0,i.JJ)({find:C,type:this.type,getAttributes:function(e){return{language:e[1]}}})]},addProseMirrorPlugins:function(){var e=this;return[new w.k_({key:new w.hs("codeBlockVSCodeHandler"),props:{handlePaste:function(t,n){if(!n.clipboardData)return!1;if(e.editor.isActive(e.type.name))return!1;var r=n.clipboardData.getData("text/plain"),o=n.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,a=null==i?void 0:i.mode;if(!r||!a)return!1;var u=t.state,s=u.tr,l=u.schema,c=l.text(r.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(e.type.create({language:a},c)),s.selection.$from.parent.type!==e.type&&s.setSelection(w.U3.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),x=i.bP.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:function(e,t){return e.content?t.renderChildren(e.content,"\n\n"):""}}),E=i.bP.create({name:"hardBreak",markdownTokenName:"br",addOptions:function(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:function(){return[{tag:"br"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["br",(0,i.KV)(this.options.HTMLAttributes,t)]},renderText:function(){return"\n"},renderMarkdown:function(){return" \n"},parseMarkdown:function(){return{type:"hardBreak"}},addCommands:function(){var e=this;return{setHardBreak:function(){return function(t){var n=t.commands,r=t.chain,o=t.state,i=t.editor;return n.first([function(){return n.exitCode()},function(){return n.command(function(){var t=o.selection,n=o.storedMarks;if(t.$from.parent.type.spec.isolating)return!1;var a=e.options.keepMarks,u=i.extensionManager.splittableMarks,s=n||t.$to.parentOffset&&t.$from.marks();return r().insertContent({type:e.name}).command(function(e){var t=e.tr,n=e.dispatch;if(n&&s&&a){var r=s.filter(function(e){return u.includes(e.type.name)});t.ensureMarks(r)}return!0}).run()})}])}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Enter":function(){return e.editor.commands.setHardBreak()},"Shift-Enter":function(){return e.editor.commands.setHardBreak()}}}}),M=n(74337),S=i.bP.create({name:"heading",addOptions:function(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes:function(){return{level:{default:1,rendered:!1}}},parseHTML:function(){return this.options.levels.map(function(e){return{tag:"h".concat(e),attrs:{level:e}}})},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes,r=this.options.levels.includes(t.attrs.level),o=r?t.attrs.level:this.options.levels[0];return["h".concat(o),(0,i.KV)(this.options.HTMLAttributes,n),0]},parseMarkdown:function(e,t){return t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[]))},renderMarkdown:function(e,t){var n,r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,o="#".repeat(r);return e.content?"".concat(o," ").concat(t.renderChildren(e.content)):""},addCommands:function(){var e=this;return{setHeading:function(t){return function(n){var r=n.commands;return!!e.options.levels.includes(t.level)&&r.setNode(e.name,t)}},toggleHeading:function(t){return function(n){var r=n.commands;return!!e.options.levels.includes(t.level)&&r.toggleNode(e.name,"paragraph",t)}}}},addKeyboardShortcuts:function(){var e=this;return this.options.levels.reduce(function(t,n){return(0,a.A)((0,a.A)({},t),(0,M.A)({},"Mod-Alt-".concat(n),function(){return e.editor.commands.toggleHeading({level:n})}))},{})},addInputRules:function(){var e=this;return this.options.levels.map(function(t){return(0,i.JJ)({find:new RegExp("^(#{".concat(Math.min.apply(Math,(0,r.A)(e.options.levels)),",").concat(t,"})\\s$")),type:e.type,getAttributes:{level:t}})})}}),T=i.bP.create({name:"horizontalRule",addOptions:function(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML:function(){return[{tag:"hr"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["hr",(0,i.KV)(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:function(e,t){return t.createNode("horizontalRule")},renderMarkdown:function(){return"---"},addCommands:function(){var e=this;return{setHorizontalRule:function(){return function(t){var n=t.chain,r=t.state;if(!(0,i.AB)(r,r.schema.nodes[e.name]))return!1;var o=r.selection,a=o.$to,u=n();return(0,i.BQ)(o)?u.insertContentAt(a.pos,{type:e.name}):u.insertContent({type:e.name}),u.command(function(t){var n=t.state,r=t.tr,o=t.dispatch;if(o){var i=r.selection.$to,a=i.end();if(i.nodeAfter)i.nodeAfter.isTextblock?r.setSelection(w.U3.create(r.doc,i.pos+1)):i.nodeAfter.isBlock?r.setSelection(w.nh.create(r.doc,i.pos)):r.setSelection(w.U3.create(r.doc,i.pos));else{var u=n.schema.nodes[e.options.nextNodeType]||i.parent.type.contentMatch.defaultType,s=null==u?void 0:u.create();s&&(r.insert(a,s),r.setSelection(w.U3.create(r.doc,a+1)))}r.scrollIntoView()}return!0}).run()}}}},addInputRules:function(){return[(0,i.Ce)({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
21ype})]}}),P=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,_=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,I=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,N=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,O=i.CU.create({name:"italic",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){var e=this;return[{tag:"em"},{tag:"i",getAttrs:function(e){return"normal"!==e.style.fontStyle&&null}},{style:"font-style=normal",clearMark:function(t){return t.type.name===e.name}},{style:"font-style=italic"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["em",(0,i.KV)(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setItalic:function(){return function(t){var n=t.commands;return n.setMark(e.name)}},toggleItalic:function(){return function(t){var n=t.commands;return n.toggleMark(e.name)}},unsetItalic:function(){return function(t){var n=t.commands;return n.unsetMark(e.name)}}}},markdownTokenName:"em",parseMarkdown:function(e,t){return t.applyMark("italic",t.parseInline(e.tokens||[]))},markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:function(e,t){return"*".concat(t.renderChildren(e),"*")},addKeyboardShortcuts:function(){var e=this;return{"Mod-i":function(){return e.editor.commands.toggleItalic()},"Mod-I":function(){return e.editor.commands.toggleItalic()}}},addInputRules:function(){return[(0,i.OX)({find:P,type:this.type}
21),(0,i.OX)({find:I,type:this.type})]},addPasteRules:function(){return[(0,i.Zc)({find:_,type:this.type}),(0,i.Zc)({find:N,type:this.type})]}}),F=n(10020),L=n(63887),B=n(95627),R=n(3846),z=n(60738),j=n(52100),H=n(83763);function V(e,t,n){return t=(0,j.A)(t),(0,R.A)(e,(0,z.A)()?Reflect.construct(t,n||[],(0,j.A)(e).constructor):t.apply(e,n))}var Y="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yac
21hts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",W="ελ1Ï
2бг1ел3деÑи4еÑ2каÑолик6ом3мкд2он1Ñква6онлайн5Ñг3ÑÑÑ2Ñ2ÑайÑ3Ñб3ÑкÑ3Òаз3Õ°Õ¡Õµ3×שר××5×§××3Ø§Ø¨ÙØ¸Ø¨Ù5راÙ
ÙÙ5ÙØ§Ø±Ø¯Ù4Ø¨ØØ±ÙÙ5جزائر5Ø³Ø¹ÙØ¯ÙØ©6عÙÙØ§Ù5Ù
غرب5Ù
ارات5ÛØ±Ø§Ù5بارت2زار4ÙØªÙ3ھارت5تÙÙØ³4Ø³ÙØ¯Ø§Ù3Ø±ÙØ©5Ø´Ø¨ÙØ©4عراÙ2ب2Ù
اÙ4ÙÙØ³Ø·ÙÙ6ÙØ·Ø±3ÙØ§Ø«ÙÙÙÙ6ÙÙ
3Ù
صر2ÙÙØ³Ùا5ÙØ±ÙتاÙÙØ§7ÙØ¹4ÙÙ
راÙ5پاکستاÙ7ÚØ§Ø±Øª4à¤à¥à¤®3नà¥à¤3à¤à¤¾à¤°à¤¤0मà¥3à¥à¤¤5सà¤à¤à¤ न5বাà¦à¦²à¦¾5à¦à¦¾à¦°à¦¤2ৰত4à¨à¨¾à¨°à¨¤4àªàª¾àª°àª¤4à¬à¬¾à¬°à¬¤4à®à®¨à¯à®¤à®¿à®¯à®¾6லà®à¯à®à¯6à®à®¿à®à¯à®à®ªà¯à®ªà¯à®°à¯11à°à°¾à°°à°¤à±5à²à²¾à²°à²¤4à´à´¾à´°à´¤à´5à¶½à¶à¶à·4à¸à¸à¸¡3à¹à¸à¸¢3ລາວ3áá2ã¿ããª3ã¢ãã¾ã³4ã¯ã©ã¦ã4ã°ã¼ã°ã«4ã³ã 2ã¹ãã¢3ã»ã¼ã«3ãã¡ãã·ã§ã³6ãã¤ã³ã4ä¸ç2ä¸ä¿¡1å½1å1æç½3äºé©¬é3ä¼ä¸2ä½å±±2ä¿¡æ¯2å¥åº·2å
«å¦2å
¬å¸1ç2å°æ¹¾1ç£2åå1åº1æ 2åé0大é
åº5å¨çº¿2大æ¿2天主æ3娱ä¹2å®¶é»2广ä¸2å¾®å2æ
å2æç±ä½ 3ææº2æè2æ¿å¡1åº2æ°å å¡2é»2æ¶å°2æ¸ç±2æºæ2淡马é¡3游æ2æ¾³é2ç¹ç2ç§»å¨2ç»ç»æºæ4ç½å1åº1ç«1ç»2èé2è°·æ2è´ç©2é販2éå¢2é»è¨çç§4é£å©æµ¦3é£å2é¤å
2馿 ¼éæ3港2ë·ë·1ì»´2ì¼ì±2íêµ2",G="numeric",U="ascii",q="alpha",$="asciinumeric",K="alphanumeric",J="domain",X="emoji",Z="scheme",Q="slashscheme",ee="whitespace";function te(e,t){return e in t||(t[e]=[]),t[e]}function ne(e,t,n){for(var r in t[G]&&(t[$]=!0,t[K]=!0),t[U]&&(t[$]=!0,t[q]=!0),t[$]&&(t[K]=!0),t[q]&&(t[K]=!0),t[K]&&(t[J]=!0),t[X]&&(t[J]=!0),t){var o=te(r,n);o.indexOf(e)<0&&o.push(e)}}function re(e,t){var n={};for(var r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.j={},this.jr=[],this.jd=null,this.t=e}oe.groups={},oe.prototype={accepts:function(){return!!this.t},go:function(e){var t=this,n=t.j[e];if(n)return n;for(var r=0;r<t.jr.length;r++){var o=t.jr[r][0],i=t.jr[r][1];if(i&&o.test(e))return i}return t.jd},has:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?e in this.j:!!this.go(e)},ta:function(e,t,n,r){for(var o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr:function(e,t,n,r){var o;return r=r||oe.groups,t&&t.j?o=t:(o=new oe(t),n&&r&&ne(t,n,r)),this.jr.push([e,o]),o},ts:function(e,t,n,r){var o=this,i=e.length;if(!i)return o;for(var a=0;a<i-1;a++)o=o.tt(e[a]);return o.tt(e[i-1],t,n,r)},tt:function(e,t,n,r){r=r||oe.groups;var o=this;if(t&&t.j)return o.j[e]=t,t;var i,a=t,u=o.go(e);if(u?(i=new oe,Object.assign(i.j,u.j),i.jr.push.apply(i.jr,u.jr),i.jd=u.jd,i.t=u.t):i=new oe,a){if(r)if(i.t&&"string"===typeof i.t){var s=Object.assign(re(i.t,r),n);ne(a,s,r)}else n&&ne(a,n,r);i.t=a}return o.j[e]=i,i}};var ie=function(e,t,n,r,o){return e.ta(t,n,r,o)},ae=function(e,t,n,r,o){return e.tr(t,n,r,o)},ue=function(e,t,n,r,o){return e.ts(t,n,r,o)},se=function(e,t,n,r,o){return e.tt(t,n,r,o)},le="WORD",ce="UWORD",de="ASCIINUMERICAL",fe="ALPHANUMERICAL",pe="LOCALHOST",he="TLD",me="UTLD",ve="SCHEME",ge="SLASH_SCHEME",ye="NUM",be="WS",we="NL",Ae="OPENBRACE",ke="CLOSEBRACE",Ce="OPENBRACKET",De="CLOSEBRACKET",xe="OPENPAREN",Ee="CLOSEPAREN",Me="OPENANGLEBRACKET",Se="CLOSEANGLEBRACKET",Te="FULLWIDTHLEFTPAREN",Pe="FULLWIDTHRIGHTPAREN",_e="LEFTCORNERBRACKET",Ie="RIGHTCORNERBRACKET",Ne="LEFTWHITECORNERBRACKET",Oe="RIGHTWHITECORNERBRACKET",Fe="FULLWIDTHLESSTHAN",Le="FULLWIDTHGREATERTHAN",Be="AMPERSAND",Re="APOSTROPHE",ze="ASTERISK",je="AT",He="BACKSLASH",Ve="BACKTICK",Ye="CARET",We="COLON",Ge="COMMA",Ue="DOLLAR",qe="DOT",$e="EQUALS",Ke="EXCLAMATION",Je="HYPHEN",Xe="PERCENT",Ze="PIPE",Qe="PLUS",et="POUND",tt="QUERY",nt="QUOTE",rt="FULLWIDTHMIDDLEDOT",ot="SEMI",it="SLASH",at="TILDE",ut="UNDERSCORE",st="EMOJI",lt="SYM",ct=Object.freeze({__proto__:null,ALPHANUMERICAL:fe,AMPERSAND:Be,APOSTROPHE:Re,ASCIINUMERICAL:de,ASTERISK:ze,AT:je,BACKSLASH:He,BACKTICK:Ve,CARET:Ye,CLOSEANGLEBRACKET:Se,CLOSEBRACE:ke,CLOSEBRACKET:De,CLOSEPAREN:Ee,COLON:We,COMMA:Ge,DOLLAR:Ue,DOT:qe,EMOJI:st,EQUALS:$e,EXCLAMATION:Ke,FULLWIDTHGREATERTHAN:Le,FULLWIDTHLEFTPAREN:Te,FULLWIDTHLESSTHAN:Fe,FULLWIDTHMIDDLEDOT:rt,FULLWIDTHRIGHTPAREN:Pe,HYPHEN:Je,LEFTCORNERBRACKET:_e,LEFTWHITECORNERBRACKET:Ne,LOCALHOST:pe,NL:we,NUM:ye,OPENANGLEBRACKET:Me,OPENBRACE:Ae,OPENBRACKET:Ce,OPENPAREN:xe,PERCENT:Xe,PIPE:Ze,PLUS:Qe,POUND:et,QUERY:tt,QUOTE:nt,RIGHTCORNERBRACKET:Ie,RIGHTWHITECORNERBRACKET:Oe,SCHEME:ve,SEMI:ot,SLASH:it,SLASH_SCHEME:ge,SYM:lt,TILDE:at,TLD:he,UNDERSCORE:ut,UTLD:me,UWORD:ce,WORD:le,WS:be}),dt=/[a-z]/,ft=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u
210EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE4
210-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])/,pt=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED8\uDEDC-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8])/,ht=/\d/,mt=/\s/,vt="\r",gt="\n",yt="ï¸",bt="â",wt="",At=null,kt=null;function Ct(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={};oe.groups=t;var n=new oe;null==At&&(At=Mt(Y)),null==kt&&(kt=Mt(W)),se(n,"'",Re),se(n,"{",Ae),se(n,"}",ke),se(n,"[",Ce),se(n,"]",De),se(n,"(",xe),se(n,")",Ee),se(n,"<",Me),se(n,">",Se),se(n,"ï¼",Te),se(n,"ï¼",Pe),se(n,"ã",_e),se(n,"ã",Ie),se(n,"ã",Ne),se(n,"ã",Oe),se(n,"ï¼",Fe),se(n,"ï¼",Le),se(n,"&",Be),se(n,"*",ze),se(n,"@",je),se(n,"`",Ve),se(n,"^",Ye),se(n,":",We),se(n,",",Ge),se(n,"$",Ue),se(n,".",qe),se(n,"=",$e),se(n,"!",Ke),se(n,"-",Je),se(n,"%",Xe),se(n,"|",Ze),se(n,"+",Qe),se(n,"#",et),se(n,"?",tt),se(n,'"',nt),se(n,"/",it),se(n,";",ot),se(n,"~",at),se(n,"_",ut),se(n,"\\",He),se(n,"ã»",rt);var r=ae(n,ht,ye,(0,M.A)({},G,!0));ae(r,ht,r);var o=ae(r,dt,de,(0,M.A)({},$,!0)),i=ae(r,ft,fe,(0,M.A)({},K,!0)),a=ae(n,dt,le,(0,M.A)({},U,!0));ae(a,ht,o),ae(a,dt,a),ae(o,ht,o),ae(o,dt,o);var u=ae(n,ft,ce,(0,M.A)({},q,!0));ae(u,dt),ae(u,ht,i),ae(u,ft,u),ae(i,ht,i),ae(i,dt),ae(i,ft,i);var s=se(n,gt,we,(0,M.A)({},ee,!0)),l=se(n,vt,be,(0,M.A)({},ee,!0)),c=ae(n,mt,be,(0,M.A)({},ee,!0));se(n,wt,c),se(l,gt,s),se(l,wt,c),ae(l,mt,c),se(c,vt),se(c,gt),ae(c,mt,c),se(c,wt,c);var d=ae(n,pt,st,(0,M.A)({},X,!0));se(d,"#"),ae(d,pt,d),se(d,yt,d);var f=se(d,bt);
21se(f,"#"),ae(f,pt,d);for(var p=[[dt,a],[ht,o]],h=[[dt,null],[ft,u],[ht,i]],m=0;m<At.length;m++)Et(n,At[m],he,le,p);for(var v=0;v<kt.length;v++)Et(n,kt[v],me,ce,h);ne(he,{tld:!0,ascii:!0},t),ne(me,{utld:!0,alpha:!0},t),Et(n,"file",ve,le,p),Et(n,"mailto",ve,le,p),Et(n,"http",ge,le,p),Et(n,"https",ge,le,p),Et(n,"ftp",ge,le,p),Et(n,"ftps",ge,le,p),ne(ve,{scheme:!0,ascii:!0},t),ne(ge,{slashscheme:!0,ascii:!0},t),e=e.sort(function(e,t){return e[0]>t[0]?1:-1});for(var g=0;g<e.length;g++){var y=e[g][0],b=e[g][1],w=b?(0,M.A)({},Z,!0):(0,M.A)({},Q,!0);y.indexOf("-")>=0?w[J]=!0:dt.test(y)?ht.test(y)?w[$]=!0:w[U]=!0:w[G]=!0,ue(n,y,y,w)}return ue(n,"localhost",pe,{ascii:!0}),n.jd=new oe(lt),{start:n,tokens:Object.assign({groups:t},ct)}}function Dt(e,t){var n=xt(t.replace(/[A-Z]/g,function(e){return e.toLowerCase()})),r=n.length,o=[],i=0,a=0;while(a<r){var u=e,s=null,l=0,c=null,d=-1,f=-1;while(a<r&&(s=u.go(n[a])))u=s,u.accepts()?(d=0,f=0,c=u):d>=0&&(d+=n[a].length,f++),l+=n[a].length,i+=n[a].length,a++;i-=d,a-=f,l-=d,o.push({t:c.t,v:t.slice(i-l,i),s:i-l,e:i})}return o}function xt(e){var t=[],n=e.length,r=0;while(r<n){var o=e.charCodeAt(r),i=void 0,a=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(a),r+=a.length}return t}function Et(e,t,n,r,o){for(var i,a=t.length,u=0;u<a-1;u++){var s=t[u];
21e.j[s]?i=e.j[s]:(i=new oe(r),i.jr=o.slice(),e.j[s]=i),e=i}return i=new oe(n),i.jr=o.slice(),e.j[t[a-1]]=i,i}function Mt(e){var t=[],n=[],r=0,o="0123456789";while(r<e.length){var i=0;while(o.indexOf(e[r+i])>=0)i++;if(i>0){t.push(n.join(""));for(var a=parseInt(e.substring(r,r+i),10);a>0;a--)n.pop();r+=i}else n.push(e[r]),r++}return t}var St={defaultProtocol:"http",events:null,format:Pt,formatHref:Pt,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Tt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Object.assign({},St);e&&(n=Object.assign(n,e instanceof Tt?e.o:e));for(var r=n.ignoreTags,o=[],i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function Pt(e){return e}Tt.prototype={o:St,ignoreTags:[],defaultRender:function(e){return e},check:function(e){return this.get("validate",e.toString(),e)},get:function(e,t,n){var r=null!=t,o=this.o[e];return o?("object"===typeof o?(o=n.t in o?o[n.t]:St[e],"function"===typeof o&&r&&(o=o(t,n))):"function"===typeof o&&r&&(o=o(t,n.t,n)),o):o},getObj:function(e,t,n){var r=this.o[e];return"function"===typeof r&&null!=t&&(r=r(t,n.t,n)),r},render:function(e){var t=e.render(this),n=this.get("render",null,e)||this.defaultRender;return n(t,e.t,e)}};function _t(e,t){this.t="token",this.v=e,this.tk=t}function It(e,t){var n=function(t){function n(t,r){var o;return(0,B.A)(this,n),o=V(this,n,[t,r]),o.t=e,o}return(0,H.A)(n,t),(0,L.A)(n)}(_t);for(var r in t)n.prototype[r]=t[r];return n.t=e,n}_t.prototype={isLink:!1,toString:function(){return this.v},toHref:function(e){return this.toString()},toFormattedString:function(e){var t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"â¦":r},toFormattedHref:function(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:St.defaultProtocol;return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject:function(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate:function(e){return e.get("validate",this.toString(),this)},render:function(e){var t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),a={},u=e.get("className",n,t),s=e.get("target",n,t),l=e.get("rel",n,t),c=e.getObj("attributes",n,t),d=e.getObj("events",n,t);return a.href=r,u&&(a.class=u),s&&(a.target=s),l&&(a.rel=l),c&&Object.assign(a,c),{tagName:o,attributes:a,content:i,eventListeners:d}}};var Nt=It("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),Ot=It("text"),Ft=It("nl"),Lt=It("url",{isLink:!0,toHref:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:St.defaultProtocol;return this.hasProtocol()?this.v:"".concat(e,"://").concat(this.v)},hasProtocol:function(){var e=this.tk;return e.length>=2&&e[0].t!==pe&&e[1].t===We}}),Bt=function(e){return new oe(e)};function Rt(e){var t=e.groups,n=t.domain.concat([Be,ze,je,He,Ve,Ye,Ue,$e,Je,ye,Xe,Ze,Qe,et,it,lt,at,ut]),r=[Re,We,Ge,qe,Ke,Xe,tt,nt,ot,Me,Se,Ae,ke,De,Ce,xe,Ee,Te,Pe,_e,Ie,Ne,Oe,Fe,Le],o=[Be,Re,ze,He,Ve,Ye,Ue,$e,Je,Ae,ke,Xe,Ze,Qe,et,tt,it,lt,at,ut],i=Bt(),a=se(i,at);ie(a,o,a),ie(a,t.domain,a);var u=Bt(),s=Bt(),l=Bt();ie(i,t.domain,u),ie(i,t.scheme,s),ie(i,t.slashscheme,l),ie(u,o,a),ie(u,t.domain,u);var c=se(u,je);se(a,je,c),se(s,je,c),se(l,je,c);var d=se(a,qe);ie(d,o,a),ie(d,t.domain,a);var f=Bt();ie(c,t.domain,f),ie(f,t.domain,f);var p=se(f,qe);ie(p,t.domain,f);var h=Bt(Nt);ie(p,t.tld,h),ie(p,t.utld,h),se(c,pe,h);var m=se(f,Je);se(m,Je,m),ie(m,t.domain,f),ie(h,t.domain,f),se(h,qe,p),se(h,Je,m);var v=se(u,Je),g=se(u,qe);se(v,Je,v),ie(v,t.domain,u),ie(g,o,a),ie(g,t.domain,u);var y=Bt(Lt);ie(g,t.tld,y),ie(g,t.utld,y),ie(y,t.domain,u),ie(y,o,a),se(y,qe,g),se(y,Je,v),se(y,je,c);var b=se(y,We),w=Bt(Lt);ie(b,t.numeric,w);var A=Bt(Lt),k=Bt();ie(A,n,A),ie(A,r,k),ie(k,n,A),ie(k,r,k),se(y,it,A),se(w,it,A);var C=se(s,We),D=se(l,We),x=se(D,it),E=se(x,it);ie(s,t.domain,u),se(s,qe,g),se(s,Je,v),ie(l,t.domain,u),se(l,qe,g),se(l,Je,v),ie(C,t.domain,A),se(C,it,A),se(C,tt,A),ie(E,t.domain,A),ie(E,n,A),se(E,it,A);for(var M=[[Ae,ke],[Ce,De],[xe,Ee],[Me,Se],[Te,Pe],[_e,Ie],[Ne,Oe],[Fe,Le]],S=0;S<M.length;S++){var T=(0,F.A)(M[S],2),P=T[0],_=T[1],I=se(A,P);se(k,P,I);var N=Bt(Lt);ie(I,n,N);var O=Bt();ie(I,r,O),se(I,_,A),ie(N,n,N),ie(N,r,O),ie(O,n,N),ie(O,r,O),se(N,_,A),se(O,_,A)}return se(i,pe,y),se(i,we,Ft),{start:i,tokens:ct}}function zt(e,t,n){var r=n.length,o=0,i=[],a=[];while(o<r){var u=e,s=null,l=null,c=0,d=null,f=-1;while(o<r&&!(s=u.go(n[o].t)))a.push(n[o++]);while(o<r&&(l=s||u.go(n[o].t)))s=null,u=l,u.accepts()?(f=0,d=u):f>
21=0&&f++,o++,c++;if(f<0)o-=c,o<r&&(a.push(n[o]),o++);else{a.length>0&&(i.push(jt(Ot,t,a)),a=[]),o-=f,c-=f;var p=d.t,h=n.slice(o-c,o);i.push(jt(p,t,h))}}return a.length>0&&i.push(jt(Ot,t,a)),i}function jt(e,t,n){var r=n[0].s,o=n[n.length-1].e,i=t.slice(r,o);return new e(i,n)}var Ht="undefined"!==typeof console&&console&&console.warn||function(){},Vt="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Yt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Wt(){return oe.groups={},Yt.scanner=null,Yt.parser=null,Yt.tokenQueue=[],Yt.pluginQueue=[],Yt.customSchemes=[],Yt.initialized=!1,Yt}function Gt(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Yt.initialized&&Ht('linkifyjs: already initialized - will not register custom scheme "'.concat(e,'" ').concat(Vt)),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');Yt.customSchemes.push([e,t])}function Ut(){Yt.scanner=Ct(Yt.customSchemes);for(var e=0;e<Yt.tokenQueue.length;e++)Yt.tokenQueue[e][1]({scanner:Yt.scanner});Yt.parser=Rt(Yt.scanner.tokens);for(var t=0;t<Yt.pluginQueue.length;t++)Yt.pluginQueue[t][1]({scanner:Yt.scanner,parser:Yt.parser});return Yt.initialized=!0,Yt}function qt(e){return Yt.initialized||Ut(),zt(Yt.parser.start,e,Dt(Yt.scanner.start,e))}function $t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"===typeof t){if(n)throw Error("linkifyjs: Invalid link type ".concat(t,"; must be a string"));n=t,t=null}for(var r=new Tt(n),o=qt(e),i=[],a=0;a<o.length;a++){var u=o[a];!u.isLink||t&&u.t!==t||!r.check(u)||i.push(u.toFormattedObject(r))}return i}qt.scan=Dt;var Kt="[\0- Â áá â-\u2029âã]",Jt=new RegExp(Kt),Xt=new RegExp("".concat(Kt,"$")),Zt=new RegExp(Kt,"g");function Qt(e){return 1===e.length?e[0].isLink:!(3!==e.length||!e[1].isLink)&&["()","[]"].includes(e[0].value+e[2].value)}function en(e){return new w.k_({key:new w.hs("autolink"),appendTransaction:function(t,n,o){var u=t.some(function(e){return e.docChanged})&&!n.doc.eq(o.doc),s=t.some(function(e){return e.getMeta("preventAutolink")});if(u&&!s){var l=o.tr,c=(0,i.T7)(n.doc,(0,r.A)(t)),d=(0,i.FF)(c);if(d.forEach(function(t){var n,r,u=t.newRange,s=(0,i.Nx)(o.doc,u,function(e){return e.isTextblock});if(s.length>1)n=s[0],r=o.doc.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," ");else if(s.length){var c=o.doc.textBetween(u.from,u.to," "," ");if(!Xt.test(c))return;n=s[0],r=o.doc.textBetween(n.pos,u.to,void 0," ")}if(n&&r){var d=r.split(Jt).filter(Boolean);if(d.length<=0)return!1;var f=d[d.length-1],p=n.pos+r.lastIndexOf(f);if(!f)return!1;var h=qt(f).map(function(t){return t.toObject(e.defaultProtocol)});if(!Qt(h))return!1;h.filter(function(e){return e.isLink}).map(function(e){return(0,a.A)((0,a.A)({},e),{},{from:p+e.start+1,to:p+e.end+1})}).filter(function(e){return!o.schema.marks.code||!o.doc.rangeHasMark(e.from,e.to,o.schema.marks.code)}).filter(function(t){return e.validate(t.value)}).filter(function(t){return e.shouldAutoLink(t.value)}).forEach(function(t){(0,i.hO)(t.from,t.to,o.doc).some(function(t){return t.mark.type===e.type})||l.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),l.steps.length)return l}}})}function tn(e){return new w.k_({key:new w.hs("handleClickLink"),props:{handleClick:function(t,n,r){var o,a;if(0!==r.button)return!1;if(!t.editable)return!1;var u=null;if(r.target instanceof HTMLAnchorElement)u=r.target;else{var s=r.target;if(!s)return!1;var l=e.editor.view.dom;u=s.closest("a"),u&&!l.contains(u)&&(u=null)}if(!u)return!1;var c=!1;if(e.enableClickSelection){var d=e.editor.commands.extendMarkRange(e.type.name);c=d}if(e.openOnClick){var f=(0,i.gu)(t.state,e.type.name),p=null!=(o=u.href)?o:f.href,h=null!=(a=u.target)?a:f.target;p&&(window.open(p,h),c=!0)}return c}}})}function nn(e){return new w.k_({key:new w.hs("handlePasteLink"),props:{handlePaste:function(t,n,r){var o=e.shouldAutoLink,i=t.state,a=i.selection,u=a.empty;if(u)return!1;var s="";r.content.forEach(function(e){s+=e.textContent});var l=$t(s,{defaultProtocol:e.defaultProtocol}).find(function(e){return e.isLink&&e.value===s});return!(!s||!l||void 0!==o&&!o(l.value))&&e.editor.commands.setMark(e.type,{href:l.href})}}})}function rn(e,t){var n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(function(e){var t="string"===typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(Zt,"").match(new RegExp("^(?:(?:".concat(n.join("|"),"):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))"),"i"))}var on=i.CU.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate:function(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate),this.options.protocols.forEac
21h(function(e){"string"!==typeof e?Gt(e.scheme,e.optionalSlashes):Gt(e)})},onDestroy:function(){Wt()},inclusive:function(){return this.options.autolink},addOptions:function(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:function(e,t){return!!rn(e,t.protocols)},validate:function(e){return!!e},shouldAutoLink:function(e){var t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;var r=e.includes("@")?e.split("@").pop():e,o=r.split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(o)&&!!/\./.test(o)}}},addAttributes:function(){return{href:{default:null,parseHTML:function(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML:function(){var e=this;return[{tag:"a[href]",getAttrs:function(t){var n=t.getAttribute("href");return!(!n||!e.options.isAllowedUri(n,{defaultValidate:function(t){return!!rn(t,e.options.protocols)},protocols:e.options.protocols,defaultProtocol:e.options.defaultProtocol}))&&null}}]},renderHTML:function(e){var t=this,n=e.HTMLAttributes;return this.options.isAllowedUri(n.href,{defaultValidate:function(e){return!!rn(e,t.options.protocols)},protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,i.KV)(this.options.HTMLAttributes,n),0]:["a",(0,i.KV)(this.options.HTMLAttributes,(0,a.A)((0,a.A)({},n),{},{href:""})),0]},markdownTokenName:"link",parseMarkdown:function(e,t){return t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null})},renderMarkdown:function(e,t){var n,r,o,i,a=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",u=null!=(i=null==(o=e.attrs)?void 0:o.title)?i:"",s=t.renderChildren(e);return u?"[".concat(s,"](").concat(a,' "').concat(u,'")'):"[".concat(s,"](").concat(a,")")},addCommands:function(){var e=this;return{setLink:function(t){return function(n){var r=n.chain,o=t.href;return!!e.options.isAllowedUri(o,{defaultValidate:function(t){return!!rn(t,e.options.protocols)},protocols:e.options.protocols,defaultProtocol:e.options.defaultProtocol})&&r().setMark(e.name,t).setMeta("preventAutolink",!0).run()}},toggleLink:function(t){return function(n){var r=n.chain,o=t||{},i=o.href;return!(i&&!e.options.isAllowedUri(i,{defaultValidate:function(t){return!!rn(t,e.options.protocols)},protocols:e.options.protocols,defaultProtocol:e.options.defaultProtocol}))&&r().toggleMark(e.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},unsetLink:function(){return function(t){var n=t.chain;return n().unsetMark(e.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}},addPasteRules:function(){var e=this;return[(0,i.Zc)({find:function(t){var n=[];if(t){var r=e.options,o=r.protocols,i=r.defaultProtocol,a=$t(t).filter(function(t){return t.isLink&&e.options.isAllowedUri(t.value,{defaultValidate:function(e){return!!rn(e,o)},protocols:o,defaultProtocol:i})});a.length&&a.forEach(function(t){e.options.shouldAutoLink(t.value)&&n.push({text:t.value,data:{href:t.href},index:t.start})})}return n}
21,type:this.type,getAttributes:function(e){var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins:function(){var e=this,t=[],n=this.options,r=n.protocols,o=n.defaultProtocol;return this.options.autolink&&t.push(en({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:function(t){return e.options.isAllowedUri(t,{defaultValidate:function(e){return!!rn(e,r)},protocols:r,defaultProtocol:o})},shouldAutoLink:this.options.shouldAutoLink})),t.push(tn({type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(nn({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),an=["start"],un=Object.defineProperty,sn=function(e,t){for(var n in t)un(e,n,{get:t[n],enumerable:!0})},ln="listItem",cn="textStyle",dn=/^\s*([-+*])\s$/,fn=i.bP.create({name:"bulletList",addOptions:function(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content:function(){return"".concat(this.options.itemTypeName,"+")},parseHTML:function(){return[{tag:"ul"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",(0,i.KV)(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:function(e,t){return"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]}},renderMarkdown:function(e,t){return e.content?t.renderChildren(e.content,"\n"):""},markdownOptions:{indentsContent:!0},addCommands:function(){var e=this;return{toggleBulletList:function(){return function(t){var n=t.commands,r=t.chain;return e.options.keepAttributes?r().toggleList(e.name,e.options.itemTypeName,e.options.keepMarks).updateAttributes(ln,e.editor.getAttributes(cn)).run():n.toggleList(e.name,e.options.itemTypeName,e.options.keepMarks)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-8":function(){return e.editor.commands.toggleBulletList()}}},addInputRules:function(){var e=this,t=(0,i.tG)({find:dn,type:this.t
21ype});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,i.tG)({find:dn,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:function(){return e.editor.getAttributes(cn)},editor:this.editor})),[t]}});function pn(e){var t,n,r=null==(t=e.tokens)?void 0:t[0];return Boolean(e.text&&1===(null==(n=e.tokens)?void 0:n.length)&&"list"===(null==r?void 0:r.type)&&r.ordered&&r.raw===e.text)}function hn(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:"text",raw:e,text:e}])}var mn=i.bP.create({name:"listItem",addOptions:function(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML:function(){return[{tag:"li"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["li",(0,i.KV)(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:function(e,t){var n;if("list_item"!==e.type)return[];var o=null!=(n=t.parseBlockChildren)?n:t.parseChildren,i=[];if(e.tokens&&e.tokens.length>0){if(pn(e))return{type:"listItem",content:[{type:"paragraph",content:hn(e.text||"",t)}]};var a=e.tokens.some(function(e){return"paragraph"===e.type});if(a)i=o(e.tokens);else{var u=e.tokens[0];if(u&&"text"===u.type&&u.tokens&&u.tokens.length>0){var s=t.parseInline(u.tokens);if(i=[{type:"paragraph",content:s}],e.tokens.length>1){var l,c=e.tokens.slice(1),d=o(c);(l=i).push.apply(l,(0,r.A)(d))}}else i=o(e.tokens)}}return 0===i.length&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:function(e,t,n){return(0,i.kj)(e,t,function(e){var t,n;if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){var r=(null==(n=null==(t=e.meta)?void 0:t.parentAttrs)?void 0:n.start)||1;return"".concat(r+e.index,". ")}return"- "},n)},addKeyboardShortcuts:function(){var e=this;return{Enter:function(){return e.editor.commands.splitListItem(e.name)},Tab:function(){return e.editor.commands.sinkListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)}}}}),vn={};sn(vn,{findListItemPos:function(){return gn},getNextListDepth:function(){return yn},handleBackspace:function(){return kn},handleDelete:function(){return xn},hasListBefore:function(){return bn},hasListItemAfter:function(){return En},hasListItemBefore:function(){return wn},listItemHasSubList:function(){return An},nextListIsDeeper:function(){return Cn},nextListIsHigher:function(){return Dn}});var gn=function(e,t){var n=t.selection.$from,r=(0,i.Pg)(e,t.schema),o=null,a=n.depth,u=n.pos,s=null;while(a>0&&null===s)o=n.node(a),o.type===r?s=a:(a-=1,u-=1);return null===s?null:{$pos:t.doc.resolve(u),depth:s}},yn=function(e,t){var n=gn(e,t);if(!n)return!1;var r=(0,i.fl)(t,e,n.$pos.pos+4),o=(0,F.A)(r,2),a=o[1];return a},bn=function(e,t,n){var r=e.selection.$anchor,o=Math.max(0,r.pos-2),i=e.doc.resolve(o).node();return!(!i||!n.includes(i.type.name))},wn=function(e,t){var n,r=t.selection.$anchor,o=t.doc.resolve(r.pos-2);return 0!==o.index()&&(null==(n=o.nodeBefore)?void 0:n.type.name)===e},An=function(e,t,n){if(!n)return!1;var r=(0,i.Pg)(e,t.schema),o=!1;return n.descendants(function(e){e.type===r&&(o=!0)}),o},kn=function(e,t,n){if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!(0,i.rU)(e.state,t)&&bn(e.state,t,n)){var r=e.state.selection.$anchor,o=e.state.doc.resolve(r.before()-1),a=[];o.node().descendants(function(e,n){e.type.name===t&&a.push({node:e,pos:n})});var u=a.at(-1);if(!u)return!1;var s=e.state.doc.resolve(o.start()+u.pos+1);return e.chain().cut({from:r.start()-1,to:r.end()+1},s.end()).joinForward().run()}if(!(0,i.rU)(e.state,t))return!1;if(!(0,i.J_)(e.state))return!1;var l=gn(t,e.state);if(!l)return!1;var c=e.state.doc.resolve(l.$pos.pos-2),d=c.node(l.depth),f=An(t,e.state,d);return wn(t,e.state)&&!f?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},Cn=function(e,t){var n=yn(e,t),r=gn(e,t);return!(!r||!n)&&n>r.depth},Dn=function(e,t){var n=yn(e,t),r=gn(e,t);return!(!r||!n)&&n<r.depth},xn=function(e,t){if(!(0,i.rU)(e.state,t))return!1;if(!(0,i.QN)(e.state,t))return!1;var n=e.state.selection,r=n.$from,o=n.$to;return!(!n.empty&&r.sameParent(o))&&(Cn(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Dn(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},En=function(e,t){var n,r=t.selection.$anchor,o=t.doc.resolve(r.pos-r.parentOffset-2);return o.index()!==o.parent.childCount-1&&(null==(n=o.nodeAfter)?void 0:n.type.name)===e},Mn=i.YY.create({name:"listKeymap",addOptions:function(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts:function(){var e=this;return{Delete:function(t){var n=t.editor,r=!1;
21return e.options.listTypes.forEach(function(e){var t=e.itemName;void 0!==n.state.schema.nodes[t]&&xn(n,t)&&(r=!0)}),r},"Mod-Delete":function(t){var n=t.editor,r=!1;return e.options.listTypes.forEach(function(e){var t=e.itemName;void 0!==n.state.schema.nodes[t]&&xn(n,t)&&(r=!0)}),r},Backspace:function(t){var n=t.editor,r=!1;return e.options.listTypes.forEach(function(e){var t=e.itemName,o=e.wrapperNames;void 0!==n.state.schema.nodes[t]&&kn(n,t,o)&&(r=!0)}),r},"Mod-Backspace":function(t){var n=t.editor,r=!1;return e.options.listTypes.forEach(function(e){var t=e.itemName,o=e.wrapperNames;void 0!==n.state.schema.nodes[t]&&kn(n,t,o)&&(r=!0)}),r}}}}),Sn=/^(\s*)(\d+)\.\s+(.*)$/,Tn=/^\s/;function Pn(e){var t=e.trimStart();return/^[-+*]\s+/.test(t)||/^\d+\.\s+/.test(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}function _n(e){var t=[],n=[],r=!1;return e.forEach(function(e){if(!r)return""===e.trim()||t.length>0&&Pn(e)?(r=!0,void n.push(e)):void t.push(e);n.push(e)}),{paragraphLines:t,blockLines:n}}function In(e){var t=[],n=0,r=0;while(n<e.length){var o=e[n],i=o.match(Sn);if(!i)break;var a=(0,F.A)(i,4),u=a[1],s=a[2],l=a[3],c=u.length,d=[l],f=n+1,p=[o],h=!1;while(f<e.length){var m=e[f],v=m.match(Sn);if(v)break;if(""===m.trim())p.push(m),d.push(""),h=!0,f+=1;else if(m.match(Tn))p.push(m),d.push(m.slice(c+2)),f+=1;else{if(h)break;p.push(m),d.push(m),f+=1}}t.push({indent:c,number:parseInt(s,10),content:d.join("\n").trim(),contentLines:d,raw:p.join("\n")}),r=f,n=f}return[t,r]}function Nn(e,t,n){var o=[],i=0;while(i<e.length){var a=e[i];if(a.indent===t){var u=_n(a.contentLines),s=u.paragraphLines,l=u.blockLines,c=s.join("\n").trim(),d=[];c&&d.push({type:"paragraph",raw:c,tokens:n.inlineTokens(c)});var f=l.join("\n").trim();if(f){var p=n.blockTokens(f);d.push.apply(d,(0,r.A)(p))}var h=i+1,m=[];while(h<e.length&&e[h].indent>t)m.push(e[h]),h+=1;if(m.length>0){var v=Math.min.apply(Math,(0,r.A)(m.map(function(e){return e.indent}))),g=Nn(m,v,n);d.push({type:"list",ordered:!0,start:m[0].number,items:g,raw:m.map(function(e){return e.raw}).join("\n")})}o.push({type:"list_item",raw:a.raw,tokens:d}),i=h}else i+=1}return o}function On(e,t){return e.map(function(e){if("list_item"!==e.type)return t.parseChildren([e])[0];var n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(function(e){if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push.apply(n,(0,r.A)(t.parseChildren([e])));else if("text"===e.type&&e.tokens){var o=t.parseChildren([e]);n.push({type:"paragraph",content:o})}else{var i=t.parseChildren([e]);i.length>0&&n.push.apply(n,(0,r.A)(i))}}),{type:"listItem",content:n}})}var Fn="listItem",Ln="textStyle",Bn=/^(\d+)\.\s$/,Rn=i.bP.create({name:"orderedList",addOptions:function(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content:function(){return"".concat(this.options.itemTypeName,"+")},addAttributes:function(){return{start:{default:1,parseHTML:function(e){return e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}},type:{default:null,parseHTML:function(e){return e.getAttribute("type")}}}},parseHTML:function(){return[{tag:"ol"}]},renderHTML:function(e){var t=e.HTMLAttributes,n=t.start,r=(0,u.A)(t,an);return 1===n?["ol",(0,i.KV)(this.options.HTMLAttributes,r),0]:["ol",(0,i.KV)(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:function(e,t){if("list"!==e.type||!e.ordered)return[];var n=e.start||1,r=e.items?On(e.items,t):[];return 1!==n?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:function(e,t){return e.content?t.renderChildren(e.content,"\n"):""},markdownTokenizer:{name:"orderedList",level:"block",start:function(e){var t=e.match(/^(\s*)(\d+)\.\s+/),n=null==t?void 0:t.index;return void 0!==n?n:-1},tokenize:function(e,t,n){var r,o=e.split("\n"),i=In(o),a=(0,F.A)(i,2),u=a[0],s=a[1];if(0!==u.length){var l=Nn(u,0,n);if(0!==l.length){var c=(null==(r=u[0])?void 0:r.number)||1;return{type:"list",ordered:!0,start:c,items:l,raw:o.slice(0,s).join("\n")}}}}},markdownOptions:{indentsContent:!0},addCommands:function(){var e=this;return{toggleOrderedList:function(){return function(t){var n=t.commands,r=t.chain;return e.options.keepAttributes?r().toggleList(e.name,e.options.itemTypeName,e.options.keepMarks).updateAttributes(Fn,e.editor.getAttributes(Ln)).run():n.toggleList(e.name,e.options.itemTypeName,e.options.keepMarks)}}}},addKeyboardShortcuts:function(){var e=this;
21return{"Mod-Shift-7":function(){return e.editor.commands.toggleOrderedList()}}},addInputRules:function(){var e=this,t=(0,i.tG)({find:Bn,type:this.type,getAttributes:function(e){return{start:+e[1]}},joinPredicate:function(e,t){return t.childCount+t.attrs.start===+e[1]}});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,i.tG)({find:Bn,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:function(t){return(0,a.A)({start:+t[1]},e.editor.getAttributes(Ln))},joinPredicate:function(e,t){return t.childCount+t.attrs.start===+e[1]},editor:this.editor})),[t]}}),zn=/^\s*(\[([( |x])?\])\s$/,jn=i.bP.create({name:"taskItem",addOptions:function(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content:function(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:function(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:function(e){var t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:function(e){return{"data-checked":e.checked}}}}},parseHTML:function(){return[{tag:'li[data-type="'.concat(this.name,'"]'),priority:51}]},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return["li",(0,i.KV)(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:function(e,t){var n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){var o=t.parseChildren(e.nestedTokens);n.push.apply(n,(0,r.A)(o))}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:function(e,t){var n,r=(null==(n=e.attrs)?void 0:n.checked)?"x":" ",o="- [".concat(r,"] ");return(0,i.kj)(e,t,o)},addKeyboardShortcuts:function(){var e=this,t={Enter:function(){return e.editor.commands.splitListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)}};return this.options.nested?(0,a.A)((0,a.A)({},t),{},{Tab:function(){return e.editor.commands.sinkListItem(e.name)}}):t},addNodeView:function(){var e=this;return function(t){var n=t.node,r=t.HTMLAttributes,o=t.getPos,u=t.editor,s=document.createElement("li"),l=document.createElement("label"),c=document.createElement("span"),d=document.createElement("input"),f=document.createElement("div"),p=function(t){var n,r;d.ariaLabel=(null==(r=null==(n=e.options.a11y)?void 0:n.checkboxLabel)?void 0:r.call(n,t,d.checked))||"Task item checkbox for ".concat(t.textContent||"empty task item")};p(n),l.contentEditable="false",d.type="checkbox",d.addEventListener("mousedown",function(e){return e.preventDefault()}),d.addEventListener("change",function(t){if(u.isEditable||e.options.onReadOnlyChecked){var r=t.target.checked;u.isEditable&&"function"===typeof o&&u.chain().focus(void 0,{scrollIntoView:!1}).command(function(e){var t=e.tr,n=o();if("number"!==typeof n)return!1;var i=t.doc.nodeAt(n);return t.setNodeMarkup(n,void 0,(0,a.A)((0,a.A)({},null==i?void 0:i.attrs),{},{checked:r})),!0}).run(),!u.isEditable&&e.options.onReadOnlyChecked&&(e.options.onReadOnlyChecked(n,r)||(d.checked=!d.checked))}else d.checked=!d.checked}),Object.entries(e.options.HTMLAttributes).forEach(function(e){var t=(0,F.A)(e,2),n=t[0],r=t[1];s.setAttribute(n,r)}),s.dataset.checked=n.attrs.checked,d.checked=n.attrs.checked,l.append(d,c),s.append(l,f),Object.entries(r).forEach(function(e){var t=(0,F.A)(e,2),n=t[0],r=t[1];s.setAttribute(n,r)});var h=new Set(Object.keys(r));return{dom:s,contentDOM:f,update:function(t){if(t.type!==e.type)return!1;s.dataset.checked=t.attrs.checked,d.checked=t.attrs.checked,p(t);var n=u.extensionManager.attributes,r=(0,i.zU)(t,n),o=new Set(Object.keys(r)),a=e.options.HTMLAttributes;return h.forEach(function(e){o.has(e)||(e in a?s.setAttribute(e,a[e]):s.removeAttribute(e))}),Object.entries(r).forEach(function(e){var t=(0,F.A)(e,2),n=t[0],r=t[1];null===r||void 0===r?n in a?s.setAttribute(n,a[n]):s.removeAttribute(n):s.setAttribute(n,r)}),h=o,!0}}}}
21,addInputRules:function(){return[(0,i.tG)({find:zn,type:this.type,getAttributes:function(e){return{checked:"x"===e[e.length-1]}}})]}}),Hn=i.bP.create({name:"taskList",addOptions:function(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content:function(){return"".concat(this.options.itemTypeName,"+")},parseHTML:function(){return[{tag:'ul[data-type="'.concat(this.name,'"]'),priority:51}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",(0,i.KV)(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:function(e,t){return t.createNode("taskList",{},t.parseChildren(e.items||[]))},renderMarkdown:function(e,t){return e.content?t.renderChildren(e.content,"\n"):""},markdownTokenizer:{name:"taskList",level:"block",start:function(e){var t,n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize:function(e,t,n){var r=function(e){var t=(0,i.Dd)(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:function(e){return{indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}},createToken:function(e,t){return{type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}},customNestedParser:r},n);return t?[{type:"taskList",raw:t.raw,items:t.items}]:n.blockTokens(e)},o=(0,i.Dd)(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:function(e){return{indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}},createToken:function(e,t){return{type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}},customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands:function(){var e=this;return{toggleTaskList:function(){return function(t){var n=t.commands;return n.toggleList(e.name,e.options.itemTypeName)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-9":function(){return e.editor.commands.toggleTaskList()}}}}),Vn=(i.YY.create({name:"listKit",addExtensions:function(){var e=[];return!1!==this.options.bulletList&&e.push(fn.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(mn.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(Mn.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(Rn.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(jn.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(Hn.configure(this.options.taskList)),e}})," "),Yn="Â ",Wn=i.bP.create({name:"paragraph",priority:1e3,addOptions:function(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML:function(){return[{tag:"p"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["p",(0,i.KV)(this.options.HTMLAttributes,t),0]},parseMarkdown:function(e,t){var n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);var r=t.parseInline(n),o=1===n.length&&"text"===n[0].type&&(n[0].raw===Vn||n[0].text===Vn||n[0].raw===Yn||n[0].text===Yn);return!o||1!==r.length||"text"!==r[0].type||r[0].text!==Vn&&r[0].text!==Yn?t.createNode("paragraph",void 0,r):t.createNode("paragraph",void 0,[])},renderMarkdown:function(e,t,n){var r,o;if(!e)return"";var i=Array.isArray(e.content)?e.content:[];if(0===i.length){var a=Array.isArray(null==(r=null==n?void 0:n.previousNode)?void 0:r.content)?n.previousNode.content:[],u="paragraph"===(null==(o=null==n?void 0:n.previousNode)?void 0:o.type)&&0===a.length;return u?Vn:""}return t.renderChildren(i)},addCommands:function(){var e=this;return{setParagraph:function(){return function(t){var n=t.commands;return n.setNode(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-0":function(){return e.editor.commands.setParagraph()}}}}),Gn=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Un=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,qn=i.CU.create({name:"strike",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:function(e){return!!e.includes("line-through")&&{}}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["s",(0,i.KV)(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:function(e,t){return t.applyM
21ark("strike",t.parseInline(e.tokens||[]))},renderMarkdown:function(e,t){return"~~".concat(t.renderChildren(e),"~~")},addCommands:function(){var e=this;return{setStrike:function(){return function(t){var n=t.commands;return n.setMark(e.name)}},toggleStrike:function(){return function(t){var n=t.commands;return n.toggleMark(e.name)}},unsetStrike:function(){return function(t){var n=t.commands;return n.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-s":function(){return e.editor.commands.toggleStrike()}}},addInputRules:function(){return[(0,i.OX)({find:Gn,type:this.type})]},addPasteRules:function(){return[(0,i.Zc)({find:Un,type:this.type})]}}),$n=i.bP.create({name:"text",group:"inline",parseMarkdown:function(e){return{type:"text",text:e.text||""}},renderMarkdown:function(e){return e.text||""}}),Kn=i.CU.create({name:"underline",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:function(e){return!!e.includes("underline")&&{}}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["u",(0,i.KV)(this.options.HTMLAttributes,t),0]},parseMarkdown:function(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:function(e,t){return"++".concat(t.renderChildren(e),"++")},markdownTokenizer:{name:"underline",level:"inline",start:function(e){return e.indexOf("++")},tokenize:function(e,t,n){var r=/^(\+\+)([\s\S]+?)(\+\+)/,o=r.exec(e);if(o){var i=o[2].trim();return{type:"underline",raw:o[0],text:i,tokens:n.inlineTokens(i)}}}},addCommands:function(){var e=this;return{setUnderline:function(){return function(t){var n=t.commands;return n.setMark(e.name)}},toggleUnderline:function(){return function(t){var n=t.commands;return n.toggleMark(e.name)}},unsetUnderline:function(){return function(t){var n=t.commands;return n.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-u":function(){return e.editor.commands.toggleUnderline()},"Mod-U":function(){return e.editor.commands.toggleUnderline()}}}}),Jn=n(1635);function Xn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new w.k_({view:function(t){return new Zn(t,e)}})}var Zn=function(){function e(t,n){var r,o=this;(0,B.A)(this,e),this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(r=n.width)&&void 0!==r?r:1,this.color=!1===n.color?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(function(e){var n=function(t){o[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}})}return(0,L.A)(e,[{key:"destroy",value:function(){var e=this;this.handlers.forEach(function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)})}},{key:"update",value:function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}},{key:"setCursor",value:function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}},{key:"updateOverlay",value:function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,a=o.height/r.offsetHeight;if(n){var u=t.nodeBefore,s=t.nodeAfter;if(u||s){var l=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(l){var c=l.getBoundingClientRect(),d=u?c.bottom:c.top;u&&s&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);var f=this.width/2*a;e={left:c.left,right:c.right,top:d-f,bottom:d+f}}}}if(!e){var p=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*i;e={left:p.left-h,right:p.left+h,top:p.top,bottom:p.bottom}}var m,v,g=this.editorView.dom.offsetParent;if(this.element||(this.element=g.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!g||g==document.body&&"static"==getComputedStyle(g).position)m=-pageXOffset,v=-pageYOffset;else{var y=g.getBoundingClientRect(),b=y.width/g.offsetWidth,w=y.height/g.offsetHeight;m=y.left-g.scrollLeft*b,v=y.top-g.scrollTop*w}this.element.style.left=(e.left-m)/i+"px",this.element.style.top=(e.top-v)/a+"px",this.element.style.width=(e.right-e.left)/i+"px",this.element.style.height=(e.bottom-e.top)/a+"px"}},{key:"scheduleRemoval",value:function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){return t.setCursor(null)},e)}},{key:"dragover",value:function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){var i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){var a=(0,Jn.Um)(this.editorView.state.doc,i,this.editorView.dragging.slice);null!=a&&(i=a)}this.setCursor(i),this.scheduleRemoval(5e3)}}}},{key:"dragend",value:function(){this.scheduleRemoval(20)}},{key:"drop",value:function(){this.scheduleRemoval(20)}},{key:"dragleave",value:function(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}])}(),Qn=n(35316),er=n(63555);function tr(e,t,n){return t=(0,j.A)(t),(0,R.A)(e,(0,z.A)()?Reflect.construct(t,n||[],(0,j.A)(e).constructor):t.apply(e,n))}var nr=function(e){function t(e){return(0,B.A)(this,t),tr(this,t,[e,e])}return(0,H.A)(t,e),(0,L.A)(t,[{key:"map",value:function(e,n){var r=e.resolve(n.map(this.head));return t.valid(r)?new t(r):w.LN.near(r)}},{key:"content",value:function(){return o.Ji.empty}},{key:"eq",value:function(e){return e instanceof t&&e.head==this.head}},{key:"toJSON",value:function(){return{type:"gapcursor",pos:this.head}}},{key:"getBookmark",value:function(){return new rr(this.anchor)}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))}},{key:"valid",value:function(e){var t=e.parent;if(t.inlineContent||!ir(e)||!ar(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}},{key:"findGapCursorFrom",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e:for(;;){if(!r&&t.valid(e))return e;for(var o=e.pos,i=null,a=e.depth;;a--){var u=e.node(a);if(n>0?e.indexAfter(a)<u.childCount:e.index(a)>0){i=u.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;o+=n;var s=e.doc.resolve(o);if(t.valid(s))return s}for(;;){var l=n>0?i.firstChild:i.lastChild;if(!l){if(i.isAtom&&!i.isText&&!w.nh.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=l,o+=n;var c=e.doc.resolve(o);if(t.valid(c))return c}return null}}}])}(w.LN);nr.prototype.visible=!1,nr.findFrom=nr.findGapCursorFrom,w.LN.jsonID("gapcursor",nr);var rr=function(){function e(t){(0,B.A)(this,e),this.pos=t}return(0,L.A)(e,[{key:"map",value:function(t){return new e(t.map(this.pos))}},{key:"resolve",value:function(e){var t=e.resolve(this.pos);return nr.valid(t)?new nr(t):w.LN.near(t)}}])}();function or(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function ir(e){for(var t=e.depth;t>=0;t--){var n=e.index(t),r=e.node(t);if(0!=n)for(var o=r.child(n-1);;o=o.lastChild){if(0==o.childCount&&!o.inlineContent||or(o.type))return!0;
21if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}function ar(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||or(o.type))return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}function ur(){return new w.k_({props:{decorations:fr,createSelectionBetween:function(e,t,n){return t.pos==n.pos&&nr.valid(n)?new nr(n):null},handleClick:cr,handleKeyDown:sr,handleDOMEvents:{beforeinput:dr}}})}var sr=(0,er.K)({ArrowLeft:lr("horiz",-1),ArrowRight:lr("horiz",1),ArrowUp:lr("vert",-1),ArrowDown:lr("vert",1)});function lr(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){var i=e.selection,a=t>0?i.$to:i.$from,u=i.empty;if(i instanceof w.U3){if(!o.endOfTextblock(n)||0==a.depth)return!1;u=!1,a=e.doc.resolve(t>0?a.after():a.before())}var s=nr.findGapCursorFrom(a,t,u);return!!s&&(r&&r(e.tr.setSelection(new nr(s))),!0)}}function cr(e,t,n){if(!e||!e.editable)return!1;var r=e.state.doc.resolve(t);if(!nr.valid(r))return!1;var o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&w.nh.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new nr(r))),!0)}function dr(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof nr))return!1;var n=e.state.selection.$from,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;for(var i=o.FK.empty,a=r.length-1;a>=0;a--)i=o.FK.from(r[a].createAndFill(null,i));var u=e.state.tr.replace(n.pos,n.pos,new o.Ji(i,0,0));return u.setSelection(w.U3.near(u.doc.resolve(n.pos+1))),e.dispatch(u),!1}function fr(e){if(!(e.selection instanceof nr))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Qn.zF.create(e.doc,[Qn.NZ.widget(e.selection.head,t,{key:"gapcursor"})])}var pr=200,hr=function(){};hr.prototype.append=function(e){return e.length?(e=hr.from(e),!this.length&&e||e.length<pr&&this.leafAppend(e)||this.length<pr&&e.leafPrepend(this)||this.appendInner(e)):this},hr.prototype.prepend=function(e){return e.length?hr.from(e).append(this):this},hr.prototype.appendInner=function(e){return new vr(this,e)},hr.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?hr.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},hr.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},hr.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},hr.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},hr.from=function(e){return e instanceof hr?e:e&&e.length?new mr(e):hr.empty};var mr=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=pr)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=pr)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(hr);hr.empty=new mr([]);var vr=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(hr),gr=hr,yr=500,br=function(){function e(t,n){(0,B.A)(this,e),this.items=t,this.eventCount=n}return(0,L.A)(e,[{key:"popEvent",value:function(t,n){var r=this;if(0==this.eventCount)return null;for(var o,i,a=this.items.length;;a--){var u=this.items.get(a-1);if(u.selection){--a;break}}n&&(o=this.remapping(a,this.items.length),i=o.maps.length);var s,l,c=t.tr,d=[],f=[];
21return this.items.forEach(function(t,n){if(!t.step)return o||(o=r.remapping(a,n+1),i=o.maps.length),i--,void f.push(t);if(o){f.push(new Ar(t.map));var u,p=t.step.map(o.slice(i));p&&c.maybeStep(p).doc&&(u=c.mapping.maps[c.mapping.maps.length-1],d.push(new Ar(u,void 0,void 0,d.length+f.length))),i--,u&&o.appendMap(u,i)}else c.maybeStep(t.step);return t.selection?(s=o?t.selection.map(o.slice(i)):t.selection,l=new e(r.items.slice(0,a).append(f.reverse().concat(d)),r.eventCount-1),!1):void 0},this.items.length,0),{remaining:l,transform:c,selection:s}}},{key:"addTransform",value:function(t,n,r,o){for(var i=[],a=this.eventCount,u=this.items,s=!o&&u.length?u.get(u.length-1):null,l=0;l<t.steps.length;l++){var c=t.steps[l].invert(t.docs[l]),d=new Ar(t.mapping.maps[l],c,n),f=void 0;(f=s&&s.merge(d))&&(d=f,l?i.pop():u=u.slice(0,u.length-1)),i.push(d),n&&(a++,n=void 0),o||(s=d)}var p=a-r.depth;return p>Cr&&(u=wr(u,p),a-=p),new e(u.append(i),a)}},{key:"remapping",value:function(e,t){var n=new Jn.X9;return this.items.forEach(function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)},e,t),n}},{key:"addMaps",value:function(t){return 0==this.eventCount?this:new e(this.items.append(t.map(function(e){return new Ar(e)})),this.eventCount)}},{key:"rebased",value:function(t,n){if(!this.eventCount)return this;var r=[],o=Math.max(0,this.items.length-n),i=t.mapping,a=t.steps.length,u=this.eventCount;this.items.forEach(function(e){e.selection&&u--},o);var s=n;this.items.forEach(function(e){var n=i.getMirror(--s);if(null!=n){a=Math.min(a,n);var o=i.maps[n];if(e.step){var l=t.steps[n].invert(t.docs[n]),c=e.selection&&e.selection.map(i.slice(s+1,n));c&&u++,r.push(new Ar(o,l,c))}else r.push(new Ar(o))}},o);for(var l=[],c=n;c<a;c++)l.push(new Ar(i.maps[c]));var d=this.items.slice(0,o).append(l).append(r),f=new e(d,u);return f.emptyItemCount()>yr&&(f=f.compress(this.items.length-r.length)),f}},{key:"emptyItemCount",value:function(){var e=0;return this.items.forEach(function(t){t.step||e++}),e}},{key:"compress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,n=this.remapping(0,t),r=n.maps.length,o=[],i=0;return this.items.forEach(function(e,a){if(a>=t)o.push(e),e.selection&&i++;else if(e.step){var u=e.step.map(n.slice(r)),s=u&&u.getMap();if(r--,s&&n.appendMap(s,r),u){var l=e.selection&&e.selection.map(n.slice(r));l&&i++;var c,d=new Ar(s.invert(),u,l),f=o.length-1;(c=o.length&&o[f].merge(d))?o[f]=c:o.push(d)}}else e.map&&r--},this.items.length,0),new e(gr.from(o.reverse()),i)}}])}();function wr(e,t){var n;return e.forEach(function(e,r){if(e.selection&&0==t--)return n=r,!1}),e.slice(n)}br.empty=new br(gr.empty,0);var Ar=function(){function e(t,n,r,o){(0,B.A)(this,e),this.map=t,this.step=n,this.selection=r,this.mirrorOffset=o}return(0,L.A)(e,[{key:"merge",value:function(t){if(this.step&&t.step&&!t.selection){var n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}}])}(),kr=(0,L.A)(function e(t,n,r,o,i){(0,B.A)(this,e),this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}),Cr=20;function Dr(e,t,n,r){var o,i=n.getMeta(Ir);if(i)return i.historyState;n.getMeta(Nr)&&(e=new kr(e.done,e.undone,null,0,-1));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(Ir))return a.getMeta(Ir).redo?new kr(e.done.addTransform(n,void 0,r,_r(t)),e.undone,Er(n.mapping.maps),e.prevTime,e.prevComposition):new kr(e.done,e.undone.addTransform(n,void 0,r,_r(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new kr(e.done.rebased(n,o),e.undone.rebased(n,o),Mr(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new kr(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Mr(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);var u=n.getMeta("composition"),s=0==e.prevTime||!a&&e.prevComposition!=u&&(e.prevTime<(n.time||0)-r.newGroupDelay||!xr(n,e.prevRanges)),l=a?Mr(e.prevRanges,n.mapping):Er(n.mapping.maps);return new kr(e.done.addTransform(n,s?t.selection.getBookmark():void 0,r,_r(t)),br.empty,l,n.time,null==u?e.prevComposition:u)}function xr(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;
21return e.mapping.maps[0].forEach(function(e,r){for(var o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)}),n}function Er(e){for(var t=[],n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(function(e,n,r,o){return t.push(r,o)});return t}function Mr(e,t){if(!e)return null;for(var n=[],r=0;r<e.length;r+=2){var o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function Sr(e,t,n){var r=_r(t),o=Ir.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;var a=i.selection.resolve(i.transform.doc),u=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),s=new kr(n?u:i.remaining,n?i.remaining:u,null,0,-1);return i.transform.setSelection(a).setMeta(Ir,{redo:n,historyState:s})}var Tr=!1,Pr=null;function _r(e){var t=e.plugins;if(Pr!=t){Tr=!1,Pr=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Tr=!0;break}}return Tr}var Ir=new w.hs("history"),Nr=new w.hs("closeHistory");function Or(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new w.k_({key:Ir,state:{init:function(){return new kr(br.empty,br.empty,null,0,-1)},apply:function(t,n,r){return Dr(n,r,t,e)}}
21,config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n=t.inputType,r="historyUndo"==n?Lr:"historyRedo"==n?Br:null;return!(!r||!e.editable)&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Fr(e,t){return function(n,r){var o=Ir.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){var i=Sr(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}var Lr=Fr(!1,!0),Br=Fr(!0,!0);Fr(!1,!1),Fr(!0,!1);i.YY.create({name:"characterCount",addOptions:function(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:function(e){return e.length},wordCounter:function(e){return e.split(" ").filter(function(e){return""!==e}).length}}},addStorage:function(){return{characters:function(){return 0},words:function(){return 0}}},onBeforeCreate:function(){var e=this;this.storage.characters=function(t){var n=(null==t?void 0:t.node)||e.editor.state.doc,r=(null==t?void 0:t.mode)||e.options.mode;if("textSize"===r){var o=n.textBetween(0,n.content.size,void 0," ");return e.options.textCounter(o)}return n.nodeSize},this.storage.words=function(t){var n=(null==t?void 0:t.node)||e.editor.state.doc,r=n.textBetween(0,n.content.size," "," ");return e.options.wordCounter(r)}},addProseMirrorPlugins:function(){var e=this,t=!1;return[new w.k_({key:new w.hs("characterCount"),appendTransaction:function(n,r,o){if(!t){var i=e.options.limit,a=e.options.autoTrim;if(null!==i&&void 0!==i&&0!==i&&!1!==a){var u=e.storage.characters({node:o.doc});if(u>i){var s=u-i,l=0,c=s;"[CharacterCount] Initial content exceeded limit of ".concat(i," characters. Content was automatically trimmed.");var d=o.tr.deleteRange(l,c);return t=!0,d}t=!0}else t=!0}},filterTransaction:function(t,n){var r=e.options.limit;if(!t.docChanged||0===r||null===r||void 0===r)return!0;var o=e.storage.characters({node:n.doc}),i=e.storage.characters({node:t.doc});if(i<=r)return!0;if(o>r&&i>r&&i<=o)return!0;if(o>r&&i>r&&i>o)return!1;var a=t.getMeta("paste");if(!a)return!1;var u=t.selection.$head.pos,s=i-r,l=u-s,c=u;t.deleteRange(l,c);var d=e.storage.characters({node:t.doc});return!(d>r)}})]}});var Rr=i.YY.create({name:"dropCursor",addOptions:function(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins:function(){return[Xn(this.options)]}}),zr=(i.YY.create({name:"focus",addOptions:function(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins:function(){var e=this;return[new w.k_({key:new w.hs("focus"),props:{decorations:function(t){var n=t.doc,r=t.selection,o=e.editor,i=o.isEditable,a=o.isFocused,u=r.anchor,s=[];if(!i||!a)return Qn.zF.create(n,[]);var l=0;"deepest"===e.options.mode&&n.descendants(function(e,t){if(!e.isText){var n=u>=t&&u<=t+e.nodeSize-1;if(!n)return!1;l+=1}});var c=0;return n.descendants(function(t,n){if(t.isText)return!1;var r=u>=n&&u<=n+t.nodeSize-1;if(!r)return!1;c+=1;var o="deepest"===e.options.mode&&l-c>0||"shallowest"===e.options.mode&&c>1;if(o)return"deepest"===e.options.mode;s.push(Qn.NZ.node(n,n+t.nodeSize,{class:e.options.className}))}),Qn.zF.create(n,s)}}})]}}),i.YY.create({name:"gapCursor",addProseMirrorPlugins:function(){return[ur()]},extendNodeSchema:function(e){var t,n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=(0,i.gk)((0,i.iI)(e,"allowGapCursor",n)))?t:null}}}));function jr(e){var t=e.editor,n=e.placeholder,r=e.dataAttribute,o=e.pos,i=e.node,a=e.isEmptyDoc,u=e.hasAnchor,s=e.classes,l=s.emptyNode,c=s.emptyEditor,d=[l];return a&&d.push(c),Qn.NZ.node(o,o+i.nodeSize,(0,M.A)({class:d.join(" ")},r,"function"===typeof n?n({editor:t,node:i,pos:o,hasAnchor:u}):n))}function Hr(e){var t=getComputedStyle(e),n="".concat(t.overflow," ").concat(t.overflowY," ").concat(t.overflowX);return/auto|scroll|overlay/.test(n)}function Vr(e){var t=e;while(t){if(Hr(t))return t;var n=t.parentElement;if(!n){var r=t.getRootNode();if(r instanceof ShadowRoot){t=r.host;continue}return window}t=n}return window}function Yr(e){return e===window?{top:0,bottom:window.innerHeight}:e.getBoundingClientRect()}
21function Wr(e){var t=e.doc,n=e.view,r=e.scrollContainer,o=n.dom.getBoundingClientRect(),i=r?Yr(r):{top:0,bottom:window.innerHeight},a=Math.max(o.top,i.top),u=Math.min(o.bottom,i.bottom);if(a>=u)return{top:0,bottom:t.content.size};var s="rtl"===getComputedStyle(n.dom).direction,l=s?Math.max(o.right-2,o.left+2):o.left+2,c=n.posAtCoords({left:l,top:a+2}),d=n.posAtCoords({left:l,top:u-2});return{top:c?c.pos:0,bottom:d?d.pos:t.content.size}}function Gr(e,t){var n=null,r=function(){n||(e.apply(void 0,arguments),n=setTimeout(function(){n=null},t))},o=function(){n&&(clearTimeout(n),n=null)};return{call:r,cancel:o}}var Ur="placeholder";function qr(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var $r=new w.hs("tiptap__placeholder"),Kr=i.YY.create({name:"placeholder",addOptions:function(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Ur,placeholder:"Write something â¦",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this,t=this.options.dataAttribute?"data-".concat(qr(this.options.dataAttribute)):"data-".concat(Ur);return[new w.k_({state:{init:function(){return{topPos:null,bottomPos:null}},apply:function(e,t){var n=e.getMeta($r);return(null==n?void 0:n.positions)?{topPos:n.positions.top,bottomPos:n.positions.bottom}:e.docChanged?{topPos:null!==t.topPos?e.mapping.map(t.topPos):null,bottomPos:null!==t.bottomPos?e.mapping.map(t.bottomPos):null}:t}},key:$r,view:function(e){var t=Vr(e.dom),n=function(){var n=Wr({view:e,doc:e.state.doc,scrollContainer:t}),r=$r.getState(e.state);if(r.topPos!==n.top||r.bottomPos!==n.bottom){var o=e.state.tr.setMeta($r,{positions:n}).setMeta("tiptap__viewportUpdate",!0);e.dispatch(o)}},r=Gr(n,250),o=r.call,i=r.cancel,a=t;return a.addEventListener("scroll",o,{passive:!0}),n(),{update:function(t,r){e.state.doc.content.size!==r.doc.content.size&&n()},destroy:function(){i(),a.removeEventListener("scroll",o)}}},props:{decorations:function(n){var r,o,a=n.doc,u=n.selection,s=e.editor.isEditable||!e.options.showOnlyWhenEditable;if(!s)return null;var l=u.anchor,c=[],d=e.editor.isEmpty,f=e.options.showOnlyCurrent&&!e.options.includeChildren;if(f){var p=a.resolve(l);if(p.depth>0){var h=p.node(1),m=p.before(1);if(h.type.isTextblock&&(0,i.Op)(h)){var v=l>=m&&l<=m+h.nodeSize,g=jr({node:h,dataAttribute:t,hasAnchor:v,placeholder:e.options.placeholder,classes:{emptyEditor:e.options.emptyEditorClass,emptyNode:e.options.emptyNodeClass},editor:e.editor,isEmptyDoc:d,pos:p.before(1)});c.push(g)}}}else{var y=$r.getState(e.editor.state),b=null!=(r=y.topPos)?r:0,w=null!=(o=y.bottomPos)?o:a.content.size;a.nodesBetween(b,w,function(n,r){var o=l>=r&&l<=r+n.nodeSize,a=!n.isLeaf&&(0,i.Op)(n);if(!n.type.isTextblock)return e.options.includeChildren;if((o||!e.options.showOnlyCurrent)&&a){var u=jr({classes:{emptyEditor:e.options.emptyEditorClass,emptyNode:e.options.emptyNodeClass},editor:e.editor,isEmptyDoc:d,dataAttribute:t,hasAnchor:o,placeholder:e.options.placeholder,node:n,pos:r});c.push(u)}return e.options.includeChildren})}return Qn.zF.create(a,c)}}})]}}),Jr=i.YY.create({name:"selection",addOptions:function(){return{className:"selection"}},addProseMirrorPlugins:function(){var e=this.editor,t=this.options;return[new w.k_({key:new w.hs("selection"),props:{decorations:function(n){return n.selection.empty||e.isFocused||!e.isEditable||(0,i.BQ)(n.selection)||e.view.dragging?null:Qn.zF.create(n.doc,[Qn.NZ.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}}),Xr="skipTrailingNode";function Zr(e){var t=e.types,n=e.node;return n&&Array.isArray(t)&&t.includes(n.type)||(null==n?void 0:n.type)===t}var Qr=i.YY.create({name:"trailingNode",addOptions:function(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins:function(){var e,t=this,n=new w.hs(this.name),r=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",o=Object.entries(this.editor.schema.nodes).map(function(e){var t=(0,F.A)(e,2),n=t[1];return n}).filter(function(e){return(t.options.notAfter||[]).concat(r).includes(e.name)});return[new w.k_({key:n,appendTransaction:function(e,t,o){var i=o.doc,a=o.tr,u=o.schema,s=n.getState(o),l=i.content.size,c=u.nodes[r];if(!e.some(function(e){return e.getMeta(Xr)}
21)&&s)return a.insert(l,c.create())},state:{init:function(e,t){var n=t.tr.doc.lastChild;return!Zr({node:n,types:o})},apply:function(e,t){if(!e.docChanged)return t;if(e.getMeta("__uniqueIDTransaction"))return t;var n=e.doc.lastChild;return!Zr({node:n,types:o})}}})]}}),eo=i.YY.create({name:"undoRedo",addOptions:function(){return{depth:100,newGroupDelay:500}},addCommands:function(){return{undo:function(){return function(e){var t=e.state,n=e.dispatch;return Lr(t,n)}},redo:function(){return function(e){var t=e.state,n=e.dispatch;return Br(t,n)}}}},addProseMirrorPlugins:function(){return[Or(this.options)]},addKeyboardShortcuts:function(){var e=this;return{"Mod-z":function(){return e.editor.commands.undo()},"Shift-Mod-z":function(){return e.editor.commands.redo()},"Mod-y":function(){return e.editor.commands.redo()},"Mod-Ñ":function(){return e.editor.commands.undo()},"Shift-Mod-Ñ":function(){return e.editor.commands.redo()}}}}),to=i.YY.create({name:"starterKit",addExtensions:function(){var e,t,n,r,o=[];return!1!==this.options.bold&&o.push(v.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(d.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(fn.configure(this.options.bulletList)),!1!==this.options.code&&o.push(b.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(D.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(x.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(Rr.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(zr.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(E.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(S.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(eo.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(T.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(O.configure(this.options.italic)),!1!==this.options.listItem&&o.push(mn.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(Mn.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&o.push(on.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&o.push(Rn.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(Wn.configure(this.options.paragraph)),!1!==this.options.strike&&o.push(qn.configure(this.options.strike)),!1!==this.options.text&&o.push($n.configure(this.options.text)),!1!==this.options.underline&&o.push(Kn.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(Qr.configure(null==(r=this.options)?void 0:r.trailingNode)),o}}),no=to,ro=Kr,oo=i.YY.create({name:"textAlign",addOptions:function(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes:function(){var e=this;return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:function(t){var n=t.style.textAlign;return e.options.alignments.includes(n)?n:e.options.defaultAlignment},renderHTML:function(e){return e.textAlign?{style:"text-align: ".concat(e.textAlign)}:{}}}}}]},addCommands:function(){var e=this;return{setTextAlign:function(t){return function(n){var r=n.commands;return!!e.options.alignments.includes(t)&&e.options.types.map(function(e){return r.updateAttributes(e,{textAlign:t})}).some(function(e){return e})}},unsetTextAlign:function(){return function(t){var n=t.commands;return e.options.types.map(function(e){return n.resetAttributes(e,"textAlign")}).some(function(e){return e})}},toggleTextAlign:function(t){return function(n){var r=n.editor,o=n.commands;return!!e.options.alignments.includes(t)&&(r.isActive({textAlign:t})?o.unsetTextAlign():o.setTextAlign(t))}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-l":function(){return e.editor.commands.setTextAlign("left")},"Mod-Shift-e":function(){return e.editor.commands.setTextAlign("center")},"Mod-Shift-r":function(){return e.editor.commands.setTextAlign("right")},"Mod-Shift-j":function(){return e.editor.commands.setTextAlign("justify")}}}}),io=oo,ao=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,uo=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,so=i.CU.create({name:"highlight",addOptions:function(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes:function(){return this.options.multicolor?{color:{default:null,parseHTML:function(e){return e.getAttribute("data-color")||(0,i.hs)(e,"background-color")||e.style.backgroundColor},renderHTML:function(e){return e.color?{"data-color":e.color,style:"background-color: ".concat(e.color,"; color: inherit")}:{}}}}:{}},parseHTML:function(){return[{tag:"mark"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["mark",(0,i.KV)(this.options.HTMLAttributes,t),0]},renderMarkdown:function(e,t){return"==".concat(t.renderChildren(e),"==")}
21,parseMarkdown:function(e,t){return t.applyMark("highlight",t.parseInline(e.tokens||[]))},markdownTokenizer:{name:"highlight",level:"inline",start:function(e){return e.indexOf("==")},tokenize:function(e,t,n){var r=/^(==)([^=]+)(==)/,o=r.exec(e);if(o){var i=o[2].trim(),a=n.inlineTokens(i);return{type:"highlight",raw:o[0],text:i,tokens:a}}}},addCommands:function(){var e=this;return{setHighlight:function(t){return function(n){var r=n.commands;return r.setMark(e.name,t)}},toggleHighlight:function(t){return function(n){var r=n.commands;return r.toggleMark(e.name,t)}},unsetHighlight:function(){return function(t){var n=t.commands;return n.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-h":function(){return e.editor.commands.toggleHighlight()}}},addInputRules:function(){return[(0,i.OX)({find:ao,type:this.type})]},addPasteRules:function(){return[(0,i.Zc)({find:uo,type:this.type})]}}),lo=so,co=20,fo=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];return!e.children.length||t>co||Array.from(e.children).forEach(function(e){"SPAN"===e.tagName?n.push(e):e.children.length&&n.push.apply(n,(0,r.A)(fo(e,t+1)))}),n},po=function(e){if(e.children.length){var t=fo(e);t&&t.forEach(function(e){var t,n,r=e.getAttribute("style"),o=null==(n=null==(t=e.parentElement)?void 0:t.closest("span"))?void 0:n.getAttribute("style");e.setAttribute("style","".concat(o,";").concat(r))})}},ho=i.CU.create({name:"textStyle",priority:101,addOptions:function(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML:function(){var e=this;return[{tag:"span",consuming:!1,getAttrs:function(t){var n=t.hasAttribute("style");return!!n&&(e.options.mergeNestedSpanStyles&&po(t),{})}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["span",(0,i.KV)(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{toggleTextStyle:function(t){return function(n){var r=n.commands;return r.toggleMark(e.name,t)}},removeEmptyTextStyle:function(){return function(t){var n=t.tr,r=n.selection;return n.doc.nodesBetween(r.from,r.to,function(t,r){if(t.isTextblock)return!0;t.marks.filter(function(t){return t.type===e.type}).some(function(e){return Object.values(e.attrs).some(function(e){return!!e})})||n.removeMark(r,r+t.nodeSize,e.type)}),!0}}}}}),mo=i.YY.create({name:"backgroundColor",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:function(e){var t,n=null!=(t=(0,i.hs)(e,"background-color"))?t:e.style.backgroundColor;return null==n?void 0:n.replace(/['"]+/g,"")},renderHTML:function(e){return e.backgroundColor?{style:"background-color: ".concat(e.backgroundColor)}:{}}}}}]},addCommands:function(){return{setBackgroundColor:function(e){return function(t){var n=t.chain;return n().setMark("textStyle",{backgroundColor:e}).run()}},unsetBackgroundColor:function(){return function(e){var t=e.chain;return t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}}}),vo=i.YY.create({name:"color",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:function(e){var t,n=null!=(t=(0,i.hs)(e,"color"))?t:e.style.color;return null==n?void 0:n.replace(/['"]+/g,"")},renderHTML:function(e){return e.color?{style:"color: ".concat(e.color)}:{}}}}}]},addCommands:function(){return{setColor:function(e){return function(t){var n=t.chain;return n().setMark("textStyle",{color:e}).run()}},unsetColor:function(){return function(e){var t=e.chain;return t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}}}),go=i.YY.create({name:"fontFamily",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:function(e){var t;return null!=(t=(0,i.hs)(e,"font-family"))?t:e.style.fontFamily},renderHTML:function(e){return e.fontFamily?{style:"font-family: ".concat(e.fontFamily)}:{}}}}}]},addCommands:function(){return{setFontFamily:function(e){return function(t){var n=t.chain;return n().setMark("textStyle",{fontFamily:e}).run()}},unsetFontFamily:function(){return function(e){var t=e.chain;return t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}}}),yo=i.YY.create({name:"fontSize",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:function(e){var t;return null!=(t=(0,i.hs)(e,"font-size"))?t:e.style.fontSize},renderHTML:function(e){return e.fontSize?{style:"font-size: ".concat(e.fontSize)}:{}}}}}]},addCommands:function(){return{setFontSize:function(e){return function(t){var n=t.chain;return n().setMark("textStyle",{fontSize:e}).run()}},unsetFontSize:function(){return function(e){var t=e.chain;return t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}}),bo=i.YY.create({name:"lineHeight",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:function(e){var t;return null!=(t=(0,i.hs)(e,"line-height"))?t:e.style.lineHeight},renderHTML:function(e){return e.lineHeight?{style:"line-height: ".concat(e.lineHeight)}:{}}}}}]},addCommands:function(){return{setLineHeight:function(e){return function(t){var n=t.chain;return n().setMark("textStyle",{lineHeight:e}).run()}},unsetLineHeight:function(){return function(e){var t=e.chain;return t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}}}}),wo=i.YY.create({name:"textStyleKit",addExtensions:function(){var e=[];return!1!==this.options.backgroundColor&&e.push(mo.configure(this.options.backgroundColor)),!1!==this.options.color&&e.push(vo.configure(this.options.color)),!1!==this.options.fontFamily&&e.push(go.configure(this.options.fontFamily)),!1!==this.options.fontSize&&e.push(yo.configure(this.options.fontSize)),!1!==this.options.lineHeight&&e.push(bo.configure(this.options.lineHeight)),!1!==this.options.textStyle&&e.push(ho.configure(this.options.textStyle)),e}}),Ao=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,ko=i.bP.create({name:"image",addOptions:function(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML:function(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML:function(e){var t=e.HTMLAttributes;return["img",(0,i.KV)(this.options.HTMLAttributes,t)]},parseMarkdown:function(e,t){return t.createNode("image",{src:e.href,title:e.title,alt:e.text})},renderMarkdown:function(e){var t,n,r,o,i,a,u=null!=(n=null==(t=e.attrs)?void 0:t.src)?n:"",s=null!=(o=null==(r=e.attrs)?void 0:r.alt)?o:"",l=null!=(a=null==(i=e.attrs)?void 0:i.title)?a:"";return l?".concat(u,' "').concat(l,'")'):".concat(u,")")},addNodeView:function(){var e=this;if(!this.options.resize||!this.options.resize.enabled||"undefined"===typeof document)return null;var t=this.options.resize,n=t.directions,r=t.minWidth,o=t.minHeight,a=t.alwaysPreserveAspectRatio;return function(t){var u=t.node,s=t.getPos,l=t.HTMLAttributes,c=t.editor,d=document.createElement("img");Object.entries(l).forEach(function(e){var t=(0,F.A)(e,2),n=t[0],r=t[1];if(null!=r)switch(n){case"width":case"height":break;default:d.setAttribute(n,r);break}}),d.src=l.src;var f=new i.Nz({element:d,editor:c,node:u,getPos:s,onResize:function(e,t){d.style.width="".concat(e,"px"),d.style.height="".concat(t,"px")},onCommit:function(t,n){var r=s();void 0!==r&&e.editor.chain().setNodeSelection(r).updateAttributes(e.name,{width:t,height:n}).run()},onUpdate:function(e,t,n){return e.type===u.type},options:{directions:n,min:{width:r,height:o},preserveAspectRatio:!0===a}}),p=f.dom;return p.style.visibility="hidden",p.style.pointerEvents="none",d.onload=function(){p.style.visibility="",p.style.pointerEvents=""},f}},addCommands:function(){var e=this;return{setImage:function(t){return function(n){var r=n.commands;return r.insertContent({type:e.name,attrs:t})}}}}
21,addInputRules:function(){return[(0,i.Ce)({find:Ao,type:this.type,getAttributes:function(e){var t=(0,F.A)(e,5),n=t[2],r=t[3],o=t[4];return{src:r,alt:n,title:o}}})]}}),Co=ko,Do=n(85592),xo=n(23067),Eo=n(34252),Mo=n(1162),So=n(78255);function To(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return{};var o={name:e,group:"block",atom:!0,defining:!0,selectable:!0,draggable:!1,addAttributes:function(){return{pluginId:{default:""},mode:{default:Eo.Vj.MODE_EDIT},data:{default:{resType:"",resId:"",resName:"",resIcon:""}}}},parseHTML:function(){return[{tag:"div[".concat(Eo.mm,"=").concat((0,So._0)(e),"]"),getAttrs:function(e){return{pluginId:e.getAttribute("data-plugin-id"),mode:e.getAttribute("data-mode"),data:JSON.parse(e.getAttribute("data-data"))}}}]},renderHTML:function(t){var n=t.HTMLAttributes,o=n.data;return["div",(0,M.A)((0,M.A)((0,M.A)((0,M.A)({contenteditable:"false",draggable:"false"},Eo.mm,(0,So._0)(e)),"data-plugin-id",n.pluginId),"data-mode",n.mode),"data-data",JSON.stringify(n.data))].concat((0,r.A)(o&&Array.isArray(o)?(Array.isArray(o)&&o.map(function(t){return 2!==t.mediaType?["img",(0,M.A)((0,M.A)({},Eo.qX,(0,So._0)(e)),"src",t.mediaUrl)]:["video",(0,M.A)((0,M.A)({},Eo.i8,(0,So._0)(e)),"src",t.mediaUrl)]})||[]).filter(Boolean):[!(null===o||void 0===o||!o.resName)&&["span",(0,M.A)({},Eo.g1,(0,So._0)(e)),null===o||void 0===o?void 0:o.resName],2!==!(null===o||void 0===o||!o.mediaType)&&["img",(0,M.A)((0,M.A)({},Eo.qX,(0,So._0)(e)),"src",null===o||void 0===o?void 0:o.mediaUrl)],2===(null===o||void 0===o?void 0:o.mediaType)&&["video",(0,M.A)((0,M.A)({},Eo.i8,(0,So._0)(e)),"src",null===o||void 0===o?void 0:o.mediaUrl)]])).filter(Boolean)},addCommands:function(){return(0,M.A)({},(0,So.qQ)(e),function(t){return(0,So.VA)(e,t)})}};return t&&(o.addNodeView=function(){return(0,Mo.gu)(t,(0,a.A)((0,a.A)({},n),{},{trackNodeViewPosition:!0}))}),o}var Po=n(41594),_o=n(84583),Io=n.n(_o),No=n(75117),Oo=n(4715),Fo=n(12843),Lo=n(51400),Bo=n(98681),Ro=n(46184),zo=n(51195),jo=n(85567);function Ho(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof u?r:u,l=Object.create(s.prototype);return Vo(l,"_invoke",function(n,r,o){var i,u,s,l=0,c=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,u=0,s=e,f.n=n,a}};function p(n,r){for(u=n,s=r,t=0;!d&&l&&!o&&t<c.length;t++){var o,i=c[t],p=f.p,h=i[2];n>3?(o=h===r)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(u=0,f.v=r,f.n=i[1]):p<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,f.n=h,u=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,h){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,h),u=c,s=h;(t=u<2?e:s)||!d;){i||(u?u<3?(u>1&&(f.n=-1),p(u,s)):f.n=s:f.v=s);try{if(l=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==a)break}catch(t){i=e,u=1,s=t}finally{l=1}}return{value:t,done:d}}}(n,o,i),!0),l}var a={};function u(){}function s(){}function l(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Vo(t={},r,function(){return this}),t),d=l.prototype=u.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,Vo(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=l,Vo(d,"constructor",l),Vo(l,"constructor",s),s.displayName="GeneratorFunction",Vo(l,o,"GeneratorFunction"),Vo(d),Vo(d,o,"Generator"),Vo(d,r,function(){return this}),Vo(d,"toString",function(){return"[object Generator]"}),(Ho=function(){return{w:i,m:f}})()}function Vo(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Vo=function(e,t,n,r){function i(t,n){Vo(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Vo(e,t,n,r)}function Yo(e){try{if(!e)return;e.innerHTML;var t=function(n){n.preventDefault();var r=document.createElement("div");r.appendChild(e.cloneNode(!0)),r.innerHTML,n.clipboardData.setData("text/html",r.innerHTML),n.clipboardData.setData("text/plain",r.textContent||""),wgoo.$toast({title:"å¤å¶æå"}),document.removeEventListener("copy",t)};document.addEventListener("copy",t),document.execCommand("copy")}catch(n){wgoo.$toast({title:"å¤å¶å¤±è´¥"})}}function Wo(e){return Go.apply(this,arguments)}function Go(){return Go=(0,Bo.A)(Ho().m(function e(t){var n;return Ho().w(function(e){while(1)switch(e.p=e.n){case 0:if(e.p=0,!Do.n2){e.n=1;break}
21t.innerHTML,appShare(379,{html:t.innerHTML,painText:""}),wgoo.$toast({title:"å¤å¶æå"}),e.n=3;break;case 1:return n=t.innerHTML,e.n=2,navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([n],{type:"text/html"}),"text/plain":new Blob([""],{type:"text/plain"})})]);case 2:wgoo.$toast({title:"å¤å¶æå"});case 3:e.n=5;break;case 4:e.p=4,e.v,Yo(t);case 5:return e.a(2)}},e,null,[[0,4]])})),Go.apply(this,arguments)}function Uo(e){try{var t=e.state.selection,n=t.$from,r=t.$to,o=e.state.doc;return 0===n.pos&&r.pos===o.content.size}catch(i){return!1}}function qo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.editor,n=e.pos,r=e.nodeSize;try{var i=t.state.doc.resolve(n),a=t.state.doc.resolve(n+r),u=t.state,s=u.doc,l=s.slice(i.pos,a.pos),c=o.ZF.fromSchema(t.schema),d=c.serializeFragment(l.content),f=document.createElement("div");f.appendChild(d.cloneNode(!0)),f.querySelectorAll("*").forEach(function(e){var t=e.hasAttribute(Eo.mm);if(t){var n=(0,So.A7)();e.setAttribute("data-plugin-id",n)}}),Wo(f)}catch(p){wgoo.$toast({title:"å¤å¶å¤±è´¥"})}}function $o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{var n,r=document.createElement("div");r.setAttribute("contenteditable","false"),r.setAttribute("draggable","false"),r.setAttribute(Eo.mm,(0,So._0)(Eo.zM.TYPE_IMAGE)),r.setAttribute("data-plugin-id",(0,So.A7)()),r.setAttribute("data-mode",Eo.Vj.MODE_EDIT),r.setAttribute("data-data",JSON.stringify((0,a.A)((0,a.A)({},e),{},{mediaId:(0,So.Cz)()}
21))),null!=t&&t&&r.setAttribute("data-scale",String(t)),2===e.mediaType?(n=document.createElement("video"),n.setAttribute(Eo.i8,(0,So._0)(Eo.zM.TYPE_IMAGE))):(n=document.createElement("img"),n.setAttribute(Eo.qX,(0,So._0)(Eo.zM.TYPE_IMAGE))),n.setAttribute("src",e.mediaUrl),r.appendChild(n);var o=document.createElement("div");o.appendChild(r),Wo(o)}catch(i){wgoo.$toast({title:"å¤å¶å¤±è´¥"})}}function Ko(e){return Jo.apply(this,arguments)}function Jo(){return Jo=(0,Bo.A)(Ho().m(function e(t){return Ho().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([t.getHTML()],{type:"text/html"}),"text/plain":new Blob([t.getText({blockSeparator:"\n"})],{type:"text/plain"})})]);case 1:wgoo.$toast({title:"å¤å¶æå"}),e.n=3;break;case 2:e.p=2,e.v,wgoo.$toast({title:"å¤å¶å¤±è´¥"});case 3:return e.a(2)}},e,null,[[0,2]])})),Jo.apply(this,arguments)}function Xo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.editor,n=e.pos,r=e.nodeSize;try{Uo(t)?Ko(t):qo({editor:t,pos:n,nodeSize:r})}catch(o){}}function Zo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.editor,n=e.pos,r=e.nodeSize,o=e.deleteNode,i=void 0===o?function(){}:o;try{Uo(t)?(Ko(t),t.commands.clearContent(),t.commands.focus()):(qo({editor:t,pos:n,nodeSize:r}),i(),t.commands.focus())}catch(a){}}function Qo(e,t){return ei.apply(this,arguments)}function ei(){return ei=(0,Bo.A)(Ho().m(function e(t,n){var r,o,i,a,u,s,l,c;return Ho().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,navigator.clipboard.read();case 1:r=e.v,o=(0,jo.A)(r),e.p=2,o.s();case 3:if((i=o.n()).done){e.n=7;break}if(a=i.value,!a.types.includes("text/html")){e.n=6;break}return e.n=4,a.getType("text/html");case 4:return u=e.v,e.n=5,u.text();case 5:return s=e.v,t.commands.insertContentAt(n,s),e.a(2,!0);case 6:e.n=3;break;case 7:e.n=9;break;case 8:e.p=8,c=e.v,o.e(c);case 9:return e.p=9,o.f(),e.f(9);case 10:return e.n=11,navigator.clipboard.readText();case 11:if(l=e.v,!l.trim()){e.n=12;break}return t.commands.insertContentAt(n,{type:"paragraph",attrs:{content:l}}),e.a(2,!0);case 12:return e.a(2,!1);case 13:return e.p=13,e.v,e.a(2,!1)}},e,null,[[2,8,9,10],[0,13]])})),ei.apply(this,arguments)}var ti=n(43792);function ni(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof u?r:u,l=Object.create(s.prototype);return ri(l,"_invoke",function(n,r,o){var i,u,s,l=0,c=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,u=0,s=e,f.n=n,a}};function p(n,r){for(u=n,s=r,t=0;!d&&l&&!o&&t<c.length;t++){var o,i=c[t],p=f.p,h=i[2];n>3?(o=h===r)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(u=0,f.v=r,f.n=i[1]):p<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,f.n=h,u=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,h){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,h),u=c,s=h;(t=u<2?e:s)||!d;){i||(u?u<3?(u>1&&(f.n=-1),p(u,s)):f.n=s:f.v=s);try{if(l=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==a)break}catch(t){i=e,u=1,s=t}finally{l=1}}return{value:t,done:d}}}(n,o,i),!0),l}var a={};function u(){}function s(){}function l(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(ri(t={},r,function(){return this}),t),d=l.prototype=u.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,ri(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=l,ri(d,"constructor",l),ri(l,"constructor",s),s.displayName="GeneratorFunction",ri(l,o,"GeneratorFunction"),ri(d),ri(d,o,"Generator"),ri(d,r,function(){return this}),ri(d,"toString",function(){return"[object Generator]"}),(ni=function(){return{w:i,m:f}})()}function ri(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ri=function(e,t,n,r){function i(t,n){ri(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},ri(e,t,n,r)}var oi=wgoo,ii=oi.$toast;function ai(e){var t=e.node,n=void 0===t?{}:t,o=e.editor,i=e.selected,u=void 0!==i&&i,s=e.readOnly,l=void 0!==s&&s,c=e.noteId,d=void 0===c?"":c,f=e.inlineEdit,p=void 0!==f&&f,h=e.getPos,m=void 0===h?function(){}:h,v=e.deleteNode,g=void 0===v?function(){}:v,y=e.updateAttributes,b=void 0===y?function(){}:y,w=(null===n||void 0===n?void 0:n.attrs)||{},A=w.pluginId,k=w.mode,C=w.data,D=void 0===C?{}:C,x=(null===n||void 0===n?void 0:n.type)||{},E=x.name,M=(0,ti.c)(),S=M.navBarHeight,T=(0,Ro.A)(),P=T.isMyAlbum,_=T.cover,I=T.editorFocus,N=T.wegoNoteConfig,O=T.isMediaOverMaxCount,L=T.isImageMediaOverMaxCount,B=T.useAssociatedNoteExpand,R=T.handleUpdateImageSpace,z=(0,zo.A)(),j=z.imgSpace,H=z.currentPluginId,V=z.handleUpdate
21CurrentPluginId,Y=z.handleChangeImageSpace,W=(0,Po.useState)(!1),G=(0,F.A)(W,2),U=G[0],q=G[1],$=(0,Po.useState)(!1),K=(0,F.A)($,2),J=K[0],X=K[1],Z=(0,Po.useState)(!1),Q=(0,F.A)(Z,2),ee=Q[0],te=Q[1],ne=(0,Po.useState)(!1),re=(0,F.A)(ne,2),oe=re[0],ie=re[1],ae=(0,Po.useState)(!1),ue=(0,F.A)(ae,2),se=ue[0],le=(ue[1],(0,Po.useState)({top:0,left:0,arrowLeft:0,reverse:!1})),ce=(0,F.A)(le,2),de=ce[0],fe=ce[1],pe=(0,Po.useMemo)(function(){var e=null===o||void 0===o?void 0:o.isEditable;return e||k===Eo.Vj.MODE_EDIT},[k,o]),he=(0,Po.useMemo)(function(){return k===Eo.Vj.MODE_SHARE},[k]),me=(0,Po.useMemo)(function(){return k===Eo.Vj.MODE_PREVIEW},[k]),ve=(0,Po.useMemo)(function(){var e={visible:!1,index:0};try{if(!pe)return;var t=_||{},n=t.pluginId,r=t.custom,o=t.index;if(r)return;e.visible=A===n,e.index=o}catch(i){}finally{return e}},[A,_,pe]),ge=(0,Po.useMemo)(function(){return!!pe&&!!I&&Do.du},[pe,I]);(0,Po.useEffect)(function(){!u&&Do.YB&&te(!1)},[u]);var ye=(0,Po.useCallback)((0,Bo.A)(ni().m(function e(){return ni().w(function(e){while(1)switch(e.n){case 0:case 1:return e.a(2)}},e)})),[]),be=(0,Po.useCallback)(function(e){try{var t,n;if(!pe)return;null===e||void 0===e||null===(t=e.preventDefault)||void 0===t||t.call(e),null===e||void 0===e||null===(n=e.stopPropagation)||void 0===n||n.call(e),o.commands.setNodeSelection(m()),!I&&Do.du&&o.commands.blur()}catch(r){}},[o,pe,I,m]),we=(0,Po.useCallback)(function(e){try{var t;null===e||void 0===e||null===(t=e.stopPropagation)||void 0===t||t.call(e),g(),(0,So.vk)(A)}catch(n){}},[o,A,g]),Ae=(0,Po.useCallback)(function(e,t){try{if(!e||e!==A)return;b({data:t})}catch(n){}},[A,b]),ke=(0,Po.useCallback)(function(e,t){try{var n;if(!e||e!==A)return;var r=m(),i=o.state.doc.nodeAt(r);if(!i||(null===(n=i.attrs)||void 0===n?void 0:n.pluginId)!==A)return;o.view.dispatch(o.state.tr.setNodeMarkup(r,void 0,(0,a.A)((0,a.A)({},i.attrs),{},{data:t})).setMeta("addToHistory",!1))}catch(u){}},[A,o,m]),Ce=(0,Po.useCallback)(function(e){try{e.stopPropagation(),Do.YB&&te(!1),Zo({editor:o,pos:m(),nodeSize:n.nodeSize,deleteNode:we})}catch(t){}},[n,o,m,we]),De=(0,Po.useCallback)(function(e){try{e.stopPropagation(),te(!1),Xo({editor:o,pos:m(),nodeSize:n.nodeSize})}catch(t){}},[n,o,m]),xe=(0,Po.useCallback)(function(){var e=(0,Bo.A)(ni().m(function e(t){var n;return ni().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,t.stopPropagation(),e.n=1,Qo(o,m());case 1:n=e.v,n?(we(),o.commands.focus()):ii({title:"ç²è´´å¤±è´¥"}),e.n=3;break;case 2:e.p=2,e.v;case 3:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),[o,m,we]),Ee=(0,Po.useCallback)(function(){try{var e=m();q(0===e)}catch(t){}},[m]),Me=(0,Po.useCallback)(function(e){try{null===e||void 0===e||e.stopPropagation(),Do.YB&&te(!1);var t=m();o.chain().focus().insertContentAt(t,{type:"paragraph",attrs:{}}).scrollIntoView().run()}catch(n){}},[o,m]),Se=(0,Po.useCallback)(function(e){try{null===e||void 0===e||e.stopPropagation(),Do.YB&&te(!1);var t=m()+1;o.chain().focus().insertContentAt(t,{type:"paragraph",attrs:{}}).scrollIntoView().run()}catch(n){}},[o,m]),Te=(0,Po.useCallback)(function(e){try{e.stopPropagation(),o.chain().focus().selectAll().run(),te(!1)}catch(t){}},[o]),Pe=(0,Po.useCallback)(function(e){try{e.stopPropagation(),Uo(o)?o.commands.clearContent():we()}catch(t){}},[o,we]),_e=(0,Po.useCallback)(function(e){try{te(!1),e.stopPropagation(),window.dispatchEvent(new CustomEvent(Fo.wU,{detail:{pluginId:A,pluginName:E}})),o.commands.blur()}catch(t){}},[o,A,E]),Ie=(0,Po.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e.stopPropagation(),window.dispatchEvent(new CustomEvent(Fo.vr,{detail:{pluginId:A,pluginName:E,index:t,resource:n}}))},[A,E]),Ne=(0,Po.useCallback)(function(e){e&&appShare(374,{scene:"edit",mediaInfo:e})},[]),Oe=(0,Po.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e.stopPropagation(),Do.YB&&te(!1),window.dispatchEvent(new CustomEvent(Fo.xp,{detail:{pluginId:A,pluginName:E,index:t,resource:n}}))},[A,E]),Fe=(0,Po.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e.stopPropagation(),me||p||(Do.YB&&o.commands.blur(),window.dispatchEvent(new CustomEvent(Fo.MA,{detail:{pluginId:A,pluginName:E,index:t,isEdit:pe,resource:n,noteId:d,readOnly:l}})))},[o,A,E,pe,me,l,d,p]),Le=(0,Po.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{if(null===e||void 0===e||e.stopPropagation(),Do.YB&&te(!1),me||p)return;window.dispatchEvent(new CustomEvent(Fo.eY,{detail:{resource:t,pluginName:E}}))}catch(n){}},[E,me,p]),Be=(0,Po.useCallback)(function(e,t){try{if(e.preventDefault(),e.stopPropagation(),!Array.isArray(D))return;if(Do.YB&&(o.commands.blur(),te(!1)),1===D.length)return void we(e);var n=JSON.parse(JSON.stringify(D));n.splice(t,1),b({data:n}),window.dispatchEvent(new CustomEvent(Fo.HM,{detail:{pluginId:A,index:t}}))}catch(r){}},[o,A,D,b,we]),Re=(0,Po.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;try{var n=e.current.getBoundingClientRect(),r=0,o=16+64*Math.ceil(t/Eo.Wd)+6;r=Do.YB?S+o/2+10:130;var i=0;i=Do.YB?16+56*Math.min(t,5):12+40*t+6*(t-1);var a=n.x,u=n.width,s=a+u/2,l="50%";i>u&&(s=i/2+a,l="".concat(u/2,"px"));var c=n.y;Do.YB&&(c-=o/2);var d=!1;if(c<0&&Math.abs(c)>=n.height-r&&!Do.YB)c=0,ie(!0);else if(c>window.innerHeight)c=window.innerHeight,ie(!0);else if(c<r)if(Do.YB){var f=n.height,p=Math.abs(r-c);c=r,p>f&&(d=!0,c+=n.height/2)}else c=r,ie(!1);else ie(!1);fe({left:s,arrowLeft:l,top:d?n.y+n.height/2+o/2:c,reverse:d})}catch(h){}},[S,fe,ie]),ze=(0,Po.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;try{Re(e,t),requestAnimationFrame(function(){te(!0)})}catch(n){}},[Re,te]),je=(0,Po.useCallback)(function(e,t){try{if(!pe||Do.YB||J)return;Ee(),ze(e,t),V(A)}catch(n){}},[A,pe,J,Ee,ze,V]),He=(0,Po.useCallback)(function(){te(!1),V()},[te,V]),Ve=(0,Po.useCallback)(function(e){try{null===e||void 0===e||e.stopPropagation(),Do.YB&&te(!1),R(1===j?0:1),Y(1===j?0:1)}catch(t){}},[j,R,Y]);return(0,Po.useEffect)(function(){function e(e){try{var t=(null===e||void 0===e?void 0:e.detail)||{},n=t.pluginId,o=void 0===n?"":n,i=t.index,u=t.resource,s=void 0===u?{}
21:u,l=t.modifyIcon,c=void 0!==l&&l;if(!o||A!==o)return;var d={};if(Array.isArray(D)){if(D.length<=i)return;var f=D[i].resIcon;d=[].concat((0,r.A)(D.slice(0,i)),[(0,a.A)((0,a.A)((0,a.A)({},D[i]),s),!c&&{resIcon:f})],(0,r.A)(D.slice(i+1)))}else{var p=D.resIcon;d=(0,a.A)((0,a.A)((0,a.A)({},D),s),!c&&{resIcon:p})}Ae(A,d)}catch(h){}}return window.addEventListener(Fo.RF,e,!1),function(){window.removeEventListener(Fo.RF,e,!1)}},[A,E,D,Ae]),(0,Po.useEffect)(function(){if(Eo.Oh.includes(E))return window.addEventListener(Fo.E7,e,!1),function(){window.removeEventListener(Fo.E7,e,!1)};function e(e){var t=e.detail||{},n=t.pluginId,o=t.data,i=void 0===o?[]:o;if(n&&n===A&&Array.isArray(i)){var u=i.map(function(e){return(0,a.A)({resType:Eo.kq.TYPE_NONE,resId:Eo.uj.TYPE_IMAGE,resName:""},e)}),s=[].concat((0,r.A)(D),(0,r.A)(u));s.length,Ae(A,s)}}},[A,E,D,Ae]),(0,Po.useEffect)(function(){if(Eo.c9.includes(E))return window.addEventListener(Fo.nQ,e,!1),function(){window.removeEventListener(Fo.nQ,e,!1)};function e(e){try{var t=e.detail||{},n=t.medias,r=void 0===n?[]:n,o=t.useHistory,i=void 0!==o&&o;if(!r||!r.length)return;if(!Eo.c9.includes(E))return;if(Array.isArray(D)){var u=r.filter(function(e){return D.some(function(t){return t.mediaId===e.mediaId})});if(!u||!u.length)return;var s=D.map(function(e){var t=u.find(function(t){return t.mediaId===e.mediaId});return t?(0,a.A)((0,a.A)({},e),t):e});s.length,i?Ae(A,s):ke(A,s)}else{var l=r.find(function(e){return e.mediaId===D.mediaId});if(!l)return;i?Ae(A,(0,a.A)((0,a.A)({},D),l)):ke(A,(0,a.A)((0,a.A)({},D),l))}}catch(c){}}},[A,E,D,Ae,ke]),(0,Po.useEffect)(function(){if(E===Eo.zM.TYPE_IMAGE)return window.addEventListener(Fo.P$,e,!1),function(){window.removeEventListener(Fo.P$,e,!1)};function e(e){try{var t=e.detail||{},n=t.medias,r=void 0===n?[]:n;if(!r||!r.length)return;var o=r.find(function(e){return e.mediaId===D.mediaId});if(!o)return;ke(A,(0,a.A)((0,a.A)({},D),{},{mediaUrl:"",mediaError:!0}))}catch(i){}}},[A,E,D,Ae,ke]),(0,Po.useEffect)(function(){var e=[Eo.zM.TYPE_IMAGE,Eo.zM.TYPE_GRID,Eo.zM.TYPE_SLIDE,Eo.zM.TYPE_NOTE,Eo.zM.TYPE_PRODUCT,Eo.zM.TYPE_LINK];if(e.includes(E))return window.addEventListener(Fo.yN,t,!1),function(){window.removeEventListener(Fo.yN,t,!1)};function t(e){try{var t=(null===e||void 0===e?void 0:e.detail)||{},n=t.all,r=void 0!==n&&n;X(r),r&&te(!1)}catch(o){}}},[E]),(0,Po.useEffect)(function(){function e(e){try{if(!ee)return;Do.YB&&ee&&te(!1)}catch(t){}}return window.addEventListener(Fo._,e,!1),function(){window.removeEventListener(Fo._,e,!1)}},[ee]),{isMyAlbum:P,isEditMode:pe,isShareMode:he,editorFocus:I,navBarHeight:S,isPreviewMode:me,coverConfig:ve,allSelected:J,showOperateMenu:ee,overflowWebMenu:oe,menuPosition:de,isMediaOverMaxCount:O,isImageMediaOverMaxCount:L,isClipboardHasContent:se,useIOSpecialEvent:ge,useAssociatedNoteExpand:B,imgSpace:j,currentPluginId:H,isFirstPosition:U,isSupportImageScale:N.supportImageScale,setShowOperateMenu:te,setOverflowWebMenu:ie,setMenuPosition:fe,handleShowOperateMenu:ze,handleDeletePlugin:we,handleUpdateDataNoHistory:ke,handlePluginSetSelection:be,handlePluginCutNode:Ce,handlePluginCopyNode:De,handlePluginPasteContent:xe,handlePluginFirstPosition:Ee,handlePluginInsertUp:Me,handlePluginInsertDown:Se,handlePluginSelectAll:Te,handlePluginExtendedDelete:Pe,handlePluginAddNewMedia:_e,handlePluginModifyResource:Ie,handlePluginEditMedia:Ne,handlePluginChangeCover:Oe,handlePluginRemoveItem:Be,handlePluginPreviewMedia:Fe,handlePluginResourceEvent:Le,handlePluginClipboardHasContent:ye,handlePluginMouseEnter:je,handlePluginMouseLeave:He,handlePluginChangeImgSpace:Ve,handleCalcWebMenuPosition:Re,handleUpdateCurrentPluginId:V}}var ui=n(85072),si=n.n(ui),li=n(43711),ci={insert:"head",singleton:!1},di=(si()(li.A,ci),li.A.locals,n(38431)),fi={insert:"head",singleton:!1},pi=(si()(di.A,fi),di.A.locals||{}),hi=n(18809);function mi(e){var t=e.node,n=e.editor,r=e.selected,o=void 0!==r&&r,i=e.extension,u=void 0===i?{}:i,s=e.getPos,l=void 0===s?function(){}:s,c=e.deleteNode,d=void 0===c?function(){}:c,f=e.updateAttributes,p=void 0===f?function(){}:f,h=(null===t||void 0===t?void 0:t.attrs)||{},m=h.pluginId,v=h.data,g=void 0===v?{}:v,y=(null===t||void 0===t?void 0:t.type)||{},b=y.name,w=g||{},A=w.resId,k=void 0===A?"":A,C=w.exist,D=void 0===C||C,x=(null===u||void 0===u?void 0:u.options)||{},E=x.noteId,S=void 0===E?"":E,T=x.inlineEdit,P=x.readOnly,_=void 0!==P&&P,I=(0,Po.useState)(null),N=(0,F.A)(I,2),O=N[0],L=N[1],B=(0,Po.useRef)(),R=(0,Po.useRef)(g);R.current=g;var z=(0,Po.useRef)(k);z.current=k;var j=(0,Po.useState)(k),H=(0,F.A)(j,2),V=H[0],Y=H[1];V!==k&&(Y(k),L(null));var W=(0,Oo._g)(),G=W.throttle,U=ai({node:t,editor:n,selected:o,noteId:S,inlineEdit:T,readOnly:_,getPos:l,deleteNode:d,updateAttributes:p}),q=U.isEditMode,$=U.isShareMode,K=U.editorFocus,J=U.showOperateMenu,X=U.overflowWebMenu,Z=U.menuPosition,Q=U.useIOSpecialEvent,ee=U.currentPluginId,te=U.isFirstPosition,ne=U.setShowOperateMenu,re=U.handleShowOperateMenu,oe=U.handleUpdateDataNoHistory,ie=U.handlePluginSetSelection,ae=U.handlePluginFirstPosition,ue=U.handlePluginInsertUp,se=U.handlePluginInsertDown,le=U.handlePluginSelectAll,ce=U.handlePluginResourceEvent,de=U.handlePluginExtendedDelete,fe=U.handleCalcWebMenuPosition,pe=U.handlePluginMouseEnter,he=U.handlePluginMouseLeave,me=(0,Po.useMemo)(function(){return!D&&!O},[D,O]);(0,Po.useEffect)(function(){k&&window.dispatchEvent(new CustomEvent(Fo.YO,{detail:{type:"product",resId:k}}
21))},[k]),(0,Po.useEffect)(function(){if(k)return window.addEventListener(Fo.Lm,e),function(){window.removeEventListener(Fo.Lm,e)};function e(e){try{var t=e.detail||{},n=t.type,r=t.list,o=void 0===r?[]:r,i=t.deletedIds,u=void 0===i?[]:i,s=z.current;if("update"===n){var l=o.find(function(e){return e.goods_id===s});if(l){L(l);var c=l.title,d=l.subTitle,f=l.imgsSrc,p=void 0===f?[]:f;oe(m,(0,a.A)((0,a.A)({},R.current),{},{title:d||c,resIcon:p&&p.length>0?p[0]:"",exist:!0}))}}else u.includes(s)&&(L(null),oe(m,(0,a.A)((0,a.A)({},R.current),{},{exist:!1})))}catch(h){}}},[m,k,oe]);var ve=(0,Po.useCallback)(function(e){try{e.stopPropagation(),window.dispatchEvent(new CustomEvent(Fo.TM,{detail:{pluginId:m,pluginName:b,resource:g}})),requestAnimationFrame(function(){n.commands.blur()}),ne(!1)}catch(t){}},[m,b,g,n,ne]),ge=function(e){try{q?we():(window.dispatchEvent(new CustomEvent(Fo.GS,{detail:{pluginId:m,pluginName:b,type:e,resource:g}})),n.commands.blur())}catch(t){}},ye=(0,Po.useMemo)(function(){return[Do.YB&&D&&{type:"plugin-menu-edit",icon:"icon-bianji",label:"ç¼è¾",onClick:ve},te&&{type:"plugin-menu-insert-up",icon:"icon-shangyi",label:"å䏿å
¥",onClick:ue},{type:"plugin-menu-insert-down",icon:"icon-xiayi",label:"å䏿å
¥",onClick:se},{type:"plugin-menu-all",icon:"icon-piliang_jiu",label:"å
¨é",onClick:le},{type:"plugin-menu-delete",icon:"icon-shanchu",label:"å é¤",onClick:de}].filter(Boolean)},[D,te,ve,ue,se,le,de]),be=G(function(){Do.YB||fe(B,ye.length)},50);(0,Po.useEffect)(function(){if(J)return window.addEventListener("scroll",be),function(){window.removeEventListener("scroll",be)}},[J,be]);var we=(0,Po.useCallback)(function(e){try{if(null===e||void 0===e||e.stopPropagation(),null===e||void 0===e||e.preventDefault(),Do.YB&&n.commands.blur(),q&&Do.YB&&!J)return ae(),void(K?setTimeout(function(){re(B,ye.length)},500):re(B,ye.length));me?wgoo.$toast({title:"产åä¸åå¨"}):ce(e,g)}catch(t){}},[n,q,K,me,J,g,ye,re,ce,ae]);return(0,hi.jsxs)(Mo.VR,{ref:B,className:Io()(pi.WegoPluginComponentProduct,"wego-editor-custom-plugin",(0,M.A)({},pi.empty,!q&&me)),onMouseEnter:function(){pe(B,ye.length)},onMouseLeave:he,onClick:we,onPointerUp:Q?we:void 0,onMouseDown:ie,onTouchStart:ie,children:[!(!q&&me)&&(0,hi.jsxs)(hi.Fragment,{children:[(0,hi.jsx)(Lo.hO,{resource:g,product:O,usePrice:!$,useIOSpecialEvent:Q,onPurchase:ge}),me&&(0,hi.jsx)(Lo.MS,{text:"产åä¸åå¨"}),(0,hi.jsx)(Lo.Cp,{visible:Do.YB?!!J:!!J&&ee===m,selected:o,menuPosition:Z,offset:8,menus:ye,overflowWebMenu:X,reverseAppMenu:Z.reverse})]}),o&&q&&(0,hi.jsx)(Lo.yN,{style:{borderRadius:"8px"}})]})}var vi=(0,No.observer)(mi),gi=i.bP.create((0,a.A)({},To(Eo.zM.TYPE_PRODUCT,vi,{ignoreMutation:function(){return!0},stopEvent:function(e){var t;return["touchstart","mousedown","click","dragstart","dragenter","dragover","drop","dragend"].includes(null===e||void 0===e||null===(t=e.event)||void 0===t?void 0:t.type)}}))),yi=n(27246),bi={insert:"head",singleton:!1},wi=(si()(yi.A,bi),yi.A.locals||{});function Ai(e){var t,n=e.node,r=e.editor,o=e.selected,i=void 0!==o&&o,a=e.extension,u=void 0===a?{}:a,s=e.getPos,l=void 0===s?function(){}:s,c=e.deleteNode,d=void 0===c?function(){}:c,f=e.updateAttributes,p=void 0===f?function(){}:f,h=(null===n||void 0===n?void 0:n.attrs)||{},m=h.pluginId,v=h.data,g=void 0===v?{}:v,y=(null===n||void 0===n?void 0:n.type)||{},b=y.name,w=g||{},A=w.resType,k=void 0===A?"":A,C=w.resName,D=void 0===C?"":C,x=w.customName,E=void 0===x?"":x,M=(null===u||void 0===u?void 0:u.options)||{},S=M.noteId,T=void 0===S?"":S,P=M.inlineEdit,_=M.readOnly,I=void 0!==_&&_,N=(0,Po.useRef)(),O=(0,Oo._g)(),F=O.throttle,L=ai({node:n,editor:r,selected:i,noteId:T,inlineEdit:P,readOnly:I,getPos:l,deleteNode:d,updateAttributes:p}),B=L.isEditMode,R=L.editorFocus,z=L.showOperateMenu,j=L.overflowWebMenu,H=L.menuPosition,V=L.useIOSpecialEvent,Y=L.currentPluginId,W=L.isFirstPosition,G=L.setShowOperateMenu,U=L.handleShowOperateMenu,q=L.handlePluginSetSelection,$=L.handlePluginFirstPosition,K=L.handlePluginInsertUp,J=L.handlePluginInsertDown,X=L.handlePluginSelectAll,Z=L.handlePluginResourceEvent,Q=L.handlePluginExtendedDelete,ee=L.handleCalcWebMenuPosition,te=L.handlePluginMouseEnter,ne=L.handlePluginMouseLeave,re=(0,Po.useMemo)(function(){try{return D?D.split("\n")[0]:""}catch(e){return D}},[D]),oe=(0,Po.useCallback)(function(e){try{e.stopPropagation(),window.dispatchEvent(new CustomEvent(Fo.Pf,{detail:{pluginId:m,pluginName:b,resource:g}})),requestAnimationFrame(function(){r.commands.blur()}),G(!1)}catch(t){}},[m,b,g,r,G]),ie=(0,Po.useMemo)(function(){return[{type:"plugin-menu-edit",icon:"icon-bianji",label:"ç¼è¾",onClick:oe},W&&{type:"plugin-menu-insert-up",icon:"icon-shangyi",label:"å䏿å
¥",onClick:K},{type:"plugin-menu-insert-down",icon:"icon-xiayi",label:"å䏿å
¥",onClick:J},{type:"plugin-menu-all",icon:"icon-piliang_jiu",label:"å
¨é",onClick:X},{type:"plugin-menu-delete",icon:"icon-shanchu",label:"å é¤",onClick:Q}
21].filter(Boolean)},[W,oe,K,J,X,Q]),ae=F(function(){Do.YB&&z?G(!1):ee(N,ie.length)},50);(0,Po.useEffect)(function(){if(z)return window.addEventListener("scroll",ae),function(){window.removeEventListener("scroll",ae)}},[z,ae]);var ue=(0,Po.useCallback)(function(e){try{if(null===e||void 0===e||e.stopPropagation(),null===e||void 0===e||e.preventDefault(),Do.YB&&r.commands.blur(),B&&Do.YB&&!z)return $(),void(R?setTimeout(function(){U(N,ie.length)},500):U(N,ie.length));Z(e,g)}catch(t){}},[r,B,R,z,g,ie,U,Z,$]);return(0,hi.jsxs)(Mo.VR,{className:Io()(wi.WegoPluginComponentLink,"wego-editor-custom-plugin word-break"),onMouseEnter:function(){return te(N,ie.length)},onMouseLeave:ne,onClick:ue,onPointerUp:V?ue:void 0,onMouseDown:q,onTouchStart:q,children:[(0,hi.jsxs)("div",{ref:N,className:wi.wegoPluginLinkContent,children:[(0,hi.jsx)("i",{className:Io()(wi.pluginLinkIcon,"wego-iconfont-s",null===(t=Eo.Iw[k])||void 0===t?void 0:t.icon)}),E||re||"ç¹å»æ¥ç详æ
"]}),(0,hi.jsx)(Lo.Cp,{visible:Do.YB?!!z:!!z&&Y===m,style:{left:"".concat(H.left,"px")},arrowStyle:{left:H.arrowLeft},selected:i,menuPosition:H,offset:10,menus:ie,overflowWebMenu:j,reverseAppMenu:H.reverse}),i&&B&&(0,hi.jsx)(Lo.yN,{style:{borderRadius:"8px"}})]})}var ki=(0,No.observer)(Ai),Ci=i.bP.create((0,a.A)({},To(Eo.zM.TYPE_LINK,ki,{ignoreMutation:function(){return!0},stopEvent:function(e){var t;return["touchstart","mousedown","click","dragstart","dragenter","dragover","drop","dragend"].includes(null===e||void 0===e||null===(t=e.event)||void 0===t?void 0:t.type)}}))),Di=n(22004),xi=n(84315),Ei=n(39525),Mi=n(45061),Si={insert:"head",singleton:!1},Ti=(si()(Mi.A,Si),Mi.A.locals||{}),Pi=(0,Di.Nf)("https://static.szwego.com/etc/miniapp/default_goods_cover.png");function _i(e){var t=e.note,n=e.resource,r=void 0===n?{}:n,o=t||{},i=o.mediaList,a=void 0===i?[]:i,u=(0,Po.useMemo)(function(){return{title:(null===t||void 0===t?void 0:t.title)||r.resName,icon:(0,xi.yN)((null===t||void 0===t?void 0:t.cover)||r.resIcon)||Pi}},[t,r]),s=u.title,l=u.icon;return(0,hi.jsxs)("div",{className:Ti.editorNoteCommonContent,children:[(0,hi.jsxs)("div",{className:Ti.mediaTitle,children:[(0,hi.jsx)(Ei.gy,{className:Ti.title,row:2,children:s}),(0,hi.jsxs)("div",{className:Ti.mark,children:[(0,hi.jsx)("i",{className:Io()(Ti.markIcon,"wego-iconfont-s icon-biji")}),(0,hi.jsx)("div",{className:Ti.markText,children:"ç¬è®°"})]})]}),(0,hi.jsxs)("div",{className:Ti.mediaIcon,children:[(0,hi.jsx)("img",{src:l}),!!a&&a.length>0&&(0,hi.jsx)("div",{className:Ti.meidaCountframe,children:(0,hi.jsx)("div",{className:Ti.meidaCount,children:a.length})})]})]})}var Ii=(0,Po.memo)(_i);function Ni(e){var t=e.note,n=void 0===t?{}:t,r=e.inlineEdit,o=void 0!==r&&r,i=e.isShareMode,a=void 0!==i&&i,u=(0,Po.useMemo)(function(){var e=n||{},t=e.richText,r=void 0===t?{}:t,o="string"===typeof r?JSON.parse(r):r;return o=(0,xi.o8)(o),o.content.forEach(function(e){(0,So.zi)(e)&&(e.attrs.mode=a?"share":"product")}),o},[n,a]),s=(0,Mo.hG)({extensions:[no.configure({hardBreak:!0}),lo.configure({multicolor:!0}),io.configure({types:["paragraph","heading"]}),wo,Co.configure({inline:!0,allowBase64:!0}),gi.configure({noteId:n.noteId,inlineEdit:o}),Ci.configure({noteId:n.noteId,inlineEdit:o}),Hi.configure({supportExpand:!1,noteId:n.noteId,inlineEdit:o}),Ki.configure({readOnly:!0,noteId:n.noteId,imgSpace:n.imgSpace,inlineEdit:o}),oa.configure({readOnly:!0,noteId:n.noteId,imgSpace:n.imgSpace,inlineEdit:o}),ca.configure({readOnly:!0,noteId:n.noteId,imgSpace:n.imgSpace,inlineEdit:o}),va],editable:!1,content:u});return(0,hi.jsx)(Mo.$Z,{editor:s})}var Oi=Ni,Fi=n(56394),Li={insert:"head",singleton:!1},Bi=(si()(Fi.A,Li),Fi.A.locals||{}),Ri="wego_note_share_page_height";function zi(e){var t=e.node,n=e.editor,r=e.selected,o=void 0!==r&&r,i=e.extension,u=e.getPos,s=void 0===u?function(){}:u,l=e.deleteNode,c=void 0===l?function(){}:l,d=e.updateAttributes,f=void 0===d?function(){}:d,p=(null===t||void 0===t?void 0:t.attrs)||{},h=p.pluginId,m=p.data,v=void 0===m?{}:m,g=(null===t||void 0===t?void 0:t.type)||{},y=g.name,b=(null===i||void 0===i?void 0:i.options)||{},w=b.supportExpand,A=void 0===w||w,k=b.noteId,C=void 0===k?"":k,D=b.
21inlineEdit,x=b.readOnly,E=void 0!==x&&x,S=v||{},T=S.resId,P=void 0===T?"":T,_=S.exist,I=void 0===_||_,N=S.expand,O=void 0!==N&&N,L=(0,Po.useState)(),B=(0,F.A)(L,2),R=B[0],z=B[1],j=(0,Po.useRef)(),H=(0,Po.useRef)(v);H.current=v;var V=(0,Po.useState)(P),Y=(0,F.A)(V,2),W=Y[0],G=Y[1];W!==P&&(G(P),z(null));var U=(0,Oo._g)(),q=U.throttle,$=ai({node:t,editor:n,selected:o,noteId:C,inlineEdit:D,readOnly:E,getPos:s,deleteNode:c,updateAttributes:f}),K=$.isEditMode,J=$.isShareMode,X=$.editorFocus,Z=$.showOperateMenu,Q=$.overflowWebMenu,ee=$.menuPosition,te=$.useIOSpecialEvent,ne=$.useAssociatedNoteExpand,re=$.currentPluginId,oe=$.isFirstPosition,ie=$.setShowOperateMenu,ae=$.handleShowOperateMenu,ue=$.handleUpdateDataNoHistory,se=$.handlePluginSetSelection,le=$.handlePluginFirstPosition,ce=$.handlePluginInsertUp,de=$.handlePluginInsertDown,fe=$.handlePluginSelectAll,pe=$.handlePluginResourceEvent,he=$.handlePluginExtendedDelete,me=$.handleCalcWebMenuPosition,ve=$.handlePluginMouseEnter,ge=$.handlePluginMouseLeave,ye=(0,Po.useState)(localStorage.getItem(Ri)||window.innerHeight),be=(0,F.A)(ye,1),we=be[0],Ae=(0,Po.useMemo)(function(){return!I&&!R},[I,R]),ke=(0,Po.useMemo)(function(){return O&&A&&R},[O,A,R]);(0,Po.useEffect)(function(){P&&window.dispatchEvent(new CustomEvent(Fo.YO,{detail:{type:"note",resId:P}}))},[P]),(0,Po.useEffect)(function(){if(P)return window.addEventListener(Fo.e,e),function(){window.removeEventListener(Fo.e,e)};function e(e){try{var t=e.detail||{},n=t.type,r=t.list,o=void 0===r?[]:r,i=t.deletedIds,u=void 0===i?[]:i;if("update"===n){var s=o.find(function(e){return e.noteId===P});if(s){z(s);var l=s.title,c=s.cover;ue(h,(0,a.A)((0,a.A)({},H.current),{},{title:l,resIcon:c||"",exist:!0}))}}else u.includes(P)&&(z(null),ue(h,(0,a.A)((0,a.A)({},H.current),{},{exist:!1})))}catch(d){}}},[h,P,ue]);
21var Ce=(0,Po.useCallback)(function(e){try{e.stopPropagation(),window.dispatchEvent(new CustomEvent(Fo.s5,{detail:{pluginId:h,pluginName:y,resource:v}})),requestAnimationFrame(function(){n.commands.blur()}),ie(!1)}catch(t){}},[h,y,v,n,ie]),De=(0,Po.useCallback)(function(e){try{e.stopPropagation(),f({data:(0,a.A)((0,a.A)({},v),{},{expand:!O})}),ie(!1),O||window.dispatchEvent(new CustomEvent(Fo.G_,{detail:{pluginId:h,pluginName:y,resource:v}}))}catch(t){}},[O,h,y,v,f,ie]),xe=(0,Po.useCallback)(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{return[Do.YB&&I&&{type:"plugin-menu-edit",icon:"icon-bianji",label:"ç¼è¾",onClick:Ce},ne&&I&&{type:"plugin-menu-expand",icon:O?"icon-bijizhedie":"icon-bijizhankai",label:O?"æå ç¬è®°":"å¹³éºç¬è®°",onClick:De},e&&{type:"plugin-menu-insert-up",icon:"icon-shangyi",label:"å䏿å
¥",onClick:ce},{type:"plugin-menu-insert-down",icon:"icon-xiayi",label:"å䏿å
¥",onClick:de},{type:"plugin-menu-all",icon:"icon-piliang_jiu",label:"å
¨é",onClick:fe},{type:"plugin-menu-delete",icon:"icon-shanchu",label:"å é¤",onClick:he}].filter(Boolean)}catch(t){return[]}},[I,O,ne,Ce,De,ce,de,fe,he]),Ee=(0,Po.useMemo)(function(){return xe(oe)},[oe,xe]),Me=q(function(){Do.YB&&Z?ie(!1):me(j,Ee.length)},50);(0,Po.useEffect)(function(){if(Z)return window.addEventListener("scroll",Me),function(){window.removeEventListener("scroll",Me)}},[Z,Me]);var Se=function(e){try{if(null===e||void 0===e||e.stopPropagation(),null===e||void 0===e||e.preventDefault(),Do.YB&&n.commands.blur(),K&&Do.YB&&!Z){le();var t=s(),r=xe(0===t).length;return void(X?setTimeout(function(){ae(j,r)},500):ae(j,r))}if(ke&&!K)return;Ae?wgoo.$toast({title:"ç¬è®°ä¸åå¨"}):pe(e,v)}catch(o){}},Te=function(e){try{if(K)return void Se();var t=R||{},n=t.noteId;window.dispatchEvent(new CustomEvent(Fo.Mm,{detail:{index:e,isEdit:K,noteId:n,readOnly:E}}))}catch(r){}};function Pe(){return K&&ke&&(0,hi.jsx)("div",{className:Bi.noteContentMask,children:(0,hi.jsxs)("div",{className:Bi.noteContentMark,children:[(0,hi.jsxs)("div",{className:"f-flex f-vc",children:[(0,hi.jsx)("i",{className:Io()(Bi.noteMarkIcon,"wego-iconfont-s icon-biji")}),(0,hi.jsx)("div",{className:Bi.noteMarkText,children:"ç¬è®°"})]}),(0,hi.jsx)("div",{className:Bi.noteMarkText,children:"é¢è§å¯ç宿´å
容"})]})})}return(0,hi.jsxs)(Mo.VR,{ref:j,className:Io()(Bi.WegoPluginComponentNote,"wego-editor-custom-plugin",(0,M.A)((0,M.A)((0,M.A)({},Bi.commonNoteContainer,!ke),Bi.empty,!K&&Ae),Bi.showEmpty,Ae)),style:K||!ke?{}:{padding:"0px",backgroundColor:"transparent"},onMouseEnter:D?void 0:function(){return ve(j,Ee.length)},onMouseLeave:D?void 0:ge,onClick:Se,onPointerUp:te?Se:void 0,onMouseDown:se,onTouchStart:se,children:[(0,hi.jsx)("div",{className:Bi.pluginComponentNoteContent,style:K||!ke?{}:{padding:"0px",backgroundColor:"transparent"},children:!(!K&&Ae)&&(0,hi.jsxs)(hi.Fragment,{children:[ke?(0,hi.jsx)("div",{className:Io()(Bi.pluginContentframe,(0,M.A)({},Bi.editModeContainer,K)),children:1===(null===R||void 0===R?void 0:R.noteType)?(0,hi.jsx)(Oi,{note:R,inlineEdit:K,isShareMode:J}):(0,hi.jsxs)(hi.Fragment,{children:[(0,hi.jsx)(Lo.Hg,{isMyAlbum:R.isMyAlbum,medias:R.mediaList,specialScreenHeight:Do.n2?we:0,useIOSpecialEvent:te,onPreview:Te}),(0,hi.jsx)(Lo.fK,{title:null===R||void 0===R?void 0:R.title,content:null===R||void 0===R?void 0:R.content})]})}):(0,hi.jsx)(Ii,{note:R,resource:v}),Pe(),Ae&&(0,hi.jsx)(Lo.MS,{text:"ç¬è®°ä¸åå¨"}),(0,hi.jsx)(Lo.Cp,{visible:Do.YB||ke?!!Z:!!Z&&re===h,selected:o,menuPosition:ee,offset:8,menus:Ee,overflowWebMenu:Q,reverseAppMenu:ee.reverse})]})}),o&&K&&(0,hi.jsx)(Lo.yN,{style:{borderRadius:"8px"}})]})}var ji=(0,No.observer)(zi),Hi=i.bP.create((0,a.A)((0,a.A)({},To(Eo.zM.TYPE_NOTE,ji,{ignoreMutation:function(){return!0},stopEvent:function(e){var t;return["touchstart","mousedown","click","dragstart","dragenter","dragover","drop","dragend"].includes(null===e||void 0===e||null===(t=e.event)||void 0===t?void 0:t.type)}})),{},{addStorage:function(){return{options:this.options}}})),Vi=n(92445),Yi=n(32021),Wi={insert:"head",singleton:!1},Gi=(si()(Yi.A,Wi),Yi.A.locals||{});function Ui(e){var t=e.node,n=e.editor,r=e.selected,o=void 0!==r&&r,i=e.extension,u=e.getPos,s=void 0===u?function(){}:u,l=e.deleteNode,c=void 0===l?function(){}:l,d=e.updateAttributes,f=void 0===d?function(){}:d,p=(null===t||void 0===t?void 0:t.attrs)||{},h=p.pluginId,m=p.data,v=void 0===m?{}:m,g=p.scale,y=void 0===g?null:g,b=(0,Po.useMemo)(function(){return(0,Vi.iZ)(v)},[v]),w=b.resType,A=void 0===w?"":w,k=b.mediaError,C=void 0!==k&&k,D=b.mediaType,x=void 0===D?1:D,E=b.mediaCoverUrl,S=void 0===E?"":E,T=b.mediaUrl,P=void 0===T?"":T,_=b.mediaWidth,I=void 0===_?0:_,N=b.mediaHeight,O=void 0===N?0:N,F=(null===i||void 0===i?void 0:i.options)||{},L=F.noteId,B=void 0===L?"":L,R=F.inlineEdit,z=F.readOnly,j=void 0!==z&&z,H=F.imgSpace,V=(0,Oo._g)(),Y=V.throttle,W=(0,Po.useRef)(),G=(0,Po.useRef)({active:!1,dir:null,centerX:0,top:0,aspect:1,baseWidth:0,rafId:0,latestPct:100}),U=(0,Po.useRef)({pinching:!1,startDist:0,startWidth:100,rafId:0,latestPct:100}),q=(0,Po.useRef)(!1),$=ai({node:t,editor:n,selected:o,noteId:B,inlineEdit:R,readOnly:j,getPos:s,deleteNode:c,updateAttributes:f}),K=$.isEditMode,J=$.isShareMode,X=$.imgSpace,Z=void 0===X?1:X,Q=$.editorFocus,ee=$.coverConfig,te=$.showOperateMenu,ne=$.overflowWebMenu,re=$.menuPosition,oe=$.useIOSpecialEvent,ie=$.currentPluginId,ae=$.isFirstPosition,ue=$.isSupportImageScale,se=$.setShowOperateMenu,le=$.handleShowOperateMenu,ce=$.handleDeletePlugin,de=$.handleCalcWebMenuPosition,fe=$.handlePluginSetSelection,pe=$.handlePluginEditMedia,he=$.handlePluginFirstPosition,me=$.handlePluginInsertUp,ve=$.handlePluginInsertDown,ge=$.handlePluginSelectAll,ye=$.handlePluginExtendedDelete,be=$.handlePluginChangeCover,we=$.handlePluginModifyResource,Ae=$.handlePluginPreviewMedia,ke=$.handlePluginResourceEvent,Ce=$.handlePluginMouseEnter,De=$.handlePluginMouseLeave,xe=$.handlePluginChangeImgSpace,Ee=(0,Po.useMemo)(function(){return B?H:Z},[B,H,Z]),Me=K&&!R&&!j&&ue,Se=(0,Po.useMemo)(function(){return[{type:"plugin-menu-cut",icon:"icon-jianqie",label:"åªå",onClick:function(e){try{e.stopPropagation(),se(!1),$o(v,y),ce(e)}catch(t){}}},{type:"plugin-menu-copy",icon:"icon-fuzhi",label:"å¤å¶",onClick:function(e){try{e.stopPropagation(),se(!1),$o(v,y)}catch(t){}}},{type:"plugin-menu-switch",icon:"icon-tuji",label:"å为å°å¾",onClick:function(e){e.stopPropagation();
21try{n.commands.insertContentAt(s(),{type:Eo.zM.TYPE_GRID,attrs:{pluginId:(0,So.A7)(),mode:Eo.Vj.MODE_EDIT,data:[(0,a.A)({},v)]}}),ce()}catch(t){}}},!!Do.YB&&[1,4].includes(x)&&{type:"plugin-menu-edit",icon:"icon-bianji",label:"ç¼è¾",onClick:function(e){e.stopPropagation(),se(!1),requestAnimationFrame(function(){pe(v)})}},!ee.visible&&{type:"plugin-menu-cover",icon:"icon-tupian",label:"设为å°é¢",onClick:function(e){be(e,0,v)}},{type:"plugin-menu-link",icon:"icon-lianjie",label:"".concat((0,Vi.st)(A)?"æ´æ¢":"æ·»å ","跳转"),onClick:function(e){var t;null===e||void 0===e||null===(t=e.stopPropagation)||void 0===t||t.call(e),se(!1),requestAnimationFrame(function(){we(e,0,v)})}},{type:"plugin-menu-img-space",icon:"icon-qiehuan",label:1===Z?"æ é´è·":"æé´è·",onClick:xe},ae&&{type:"plugin-menu-insert-up",icon:"icon-shangyi",label:"å䏿å
¥",onClick:me},{type:"plugin-menu-insert-down",icon:"icon-xiayi",label:"å䏿å
¥",onClick:ve},{type:"plugin-menu-all",icon:"icon-piliang_jiu",label:"å
¨é",onClick:ge},{type:"plugin-menu-delete",icon:"icon-shanchu",label:"å é¤",onClick:ye}].filter(Boolean)},[n,v,y,A,x,ee,ae,Z,s,se,pe,ce,me,ve,ge,ye,be,we,xe]),Te=Y(function(){Do.YB&&te?se(!1):de(W,Se.length)},50);(0,Po.useEffect)(function(){if(te)return window.addEventListener("scroll",Te),function(){window.removeEventListener("scroll",Te)}},[te,Te]);var Pe=(0,Po.useCallback)(function(e){var t=W.current;if(t){var n=null==e||e>=Eo.p2;n?(t.style.width="",t.style.marginLeft="",t.style.marginRight=""):(t.style.width="".concat(e,"%"),t.style.marginLeft="auto",t.style.marginRight="auto"),0===Ee?(t.style.marginTop="-1px",t.style.marginBottom="0"):(t.style.marginTop="",t.style.marginBottom="")}},[Ee]);(0,Po.useLayoutEffect)(function(){Pe(null==y?Eo.p2:y)},[y,Pe]);var _e=(0,Po.useCallback)(function(e){var t=G.current;if(t.active){var n="ne"===t.dir||"se"===t.dir,r="sw"===t.dir||"se"===t.dir,o=2*(n?1:-1)*(e.clientX-t.centerX);if(r&&t.aspect>0){var i=(e.clientY-t.top)/t.aspect;o=Math.max(o,i)}var a=Math.max(Eo.xz,80/t.baseWidth*100),u=Math.min(Eo.p2,Math.max(a,o/t.baseWidth*100));t.latestPct=u,t.rafId||(t.rafId=requestAnimationFrame(function(){t.rafId=0,Pe(t.latestPct)}))}},[Pe]),Ie=(0,Po.useCallback)(function(){var e=G.current;window.removeEventListener("pointermove",_e),e.rafId&&(cancelAnimationFrame(e.rafId),e.rafId=0);var t=e.active,r=e.latestPct;if(e.active=!1,e.dir=null,t)try{var o,i=s(),a=n.state.doc.nodeAt(i);a&&(null===(o=a.attrs)||void 0===o?void 0:o.pluginId)===h&&f({scale:Math.round(10*r)/10})}catch(u){}},[_e,f,n,s,h]),Ne=(0,Po.useCallback)(function(e,r){var o;if(Me){e.stopPropagation(),e.preventDefault(),n.commands.setNodeSelection(s());var i=null===(o=e.currentTarget.closest(".".concat(Gi.WegoPluginComponentImage)))||void 0===o?void 0:o.getBoundingClientRect();if(i&&!(i.width<=0)){var a=G.current,u=null==t.attrs.scale?Eo.p2:t.attrs.scale;Object.assign(a,{active:!0,dir:r,centerX:i.left+i.width/2,top:i.top,aspect:i.height>0?i.height/i.width:1,baseWidth:100*i.width/u,latestPct:u}),window.addEventListener("pointermove",_e),window.addEventListener("pointerup",Ie,{once:!0}),window.addEventListener("pointercancel",Ie,{once:!0})}}},[Me,n,s,t.attrs.scale,Gi.WegoPluginComponentImage,_e,Ie]);(0,Po.useEffect)(function(){return function(){var e=G.current;e.rafId&&cancelAnimationFrame(e.rafId),window.removeEventListener("pointermove",_e)}},[_e]);var Oe=(0,Po.useCallback)(function(e){var t=U.current;if(t.pinching&&e.touches&&!(e.touches.length<2)){var n=Math.hypot(e.touches[0].clientX-e.touches[1].clientX,e.touches[0].clientY-e.touches[1].clientY);if(!(t.startDist<=0)){var r=Math.min(Eo.p2,Math.max(Eo.xz,t.startWidth*(n/t.startDist)));t.latestPct=r,e.cancelable&&e.preventDefault(),t.rafId||(t.rafId=requestAnimationFrame(function(){t.rafId=0,Pe(t.latestPct)}))}}},[Pe]),Fe=(0,Po.useCallback)(function(e){var t=U.current;if(!(e&&e.touches&&e.touches.length>=2)&&(window.removeEventListener("touchmove",Oe),window.removeEventListener("touchend",Fe),window.removeEventListener("touchcancel",Fe),t.pinching)){t.pinching=!1,t.rafId&&(cancelAnimationFrame(t.rafId),t.rafId=0);try{var r,o=s(),i=n.state.doc.nodeAt(o);i&&(null===(r=i.attrs)||void 0===r?void 0:r.pluginId)===h&&f({scale:Math.round(10*t.latestPct)/10})}catch(a){}}},[Oe,f,n,s,h]),Le=(0,Po.useCallback)(function(e){if(e.touches&&!(e.touches.length<2)){e.cancelable&&e.preventDefault(),e.stopPropagation(),n.commands.setNodeSelection(s());var r=Math.hypot(e.touches[0].clientX-e.touches[1].clientX,e.touches[0].clientY-e.touches[1].clientY);if(!(r<=0)){var o=U.current,i=null==t.attrs.scale?Eo.p2:t.attrs.scale;o.pinching=!0,o.startDist=r,o.startWidth=i,o.latestPct=i,window.addEventListener("touchmove",Oe,{passive:!1}),window.addEventListener("touchend",Fe),window.addEventListener("touchcancel",Fe)}}},[n,s,t.attrs.scale,Oe,Fe]);(0,Po.useEffect)(function(){return function(){var e=U.current;e.rafId&&cancelAnimationFrame(e.rafId),window.removeEventListener("touchmove",Oe),window.removeEventListener("touchend",Fe),window.removeEventListener("touchcancel",Fe)}},[Oe,Fe]);var Be=(0,Po.useCallback)(function(e){q.current=o,fe(e)},[o,fe]),Re=(0,Po.useCallback)(function(e){Do.YB&&Me&&e.touches&&e.touches.length>=2?Le(e):Be(e)},[Me,Le,Be]),ze=function(e){try{if(null===e||void 0===e||e.stopPropagation(),K){if
21(Do.YB&&n.commands.blur(),Do.YB&&!te)return he(),void(Q?setTimeout(function(){le(W,Se.length)},500):le(W,Se.length));if(!Do.YB&&!q.current)return;se(!1),requestAnimationFrame(function(){Ae(e,0,v)})}else(0,Vi.st)(A)?ke(e,v):Ae(e,0,v)}catch(t){}};return(0,hi.jsxs)(Mo.VR,{ref:W,className:Io()(Gi.WegoPluginComponentImage,"wego-editor-custom-plugin",(0,M.A)((0,M.A)((0,M.A)({},Gi.wgImagePluginActive,o&&K),Gi.selected,o&&K),Gi.editMode,K)),onMouseEnter:function(){return Ce(W,Se.length)},onMouseLeave:De,onClick:ze,onPointerUp:oe?ze:void 0,onMouseDown:Be,onTouchStart:Re,children:[I>0&&O>0?(0,hi.jsx)("div",{className:Gi.editorImageContentframe,style:{paddingBottom:"".concat(O/I*100,"%")},children:(0,hi.jsx)(Lo.qd,{className:Gi.editorInnerContentframe,style:Do.YB&&Me?{touchAction:"pan-y"}:void 0,imageStyle:{pointerEvents:K?"none":"auto"},media:v,mediaSize:800,mediaError:C,lazyload:!0,useHDUrl:!1,draggable:!K,displayDirectly:J})}):(0,hi.jsx)(Lo.qd,{style:(0,a.A)({height:S||P?"auto":"300px"},Do.YB&&Me?{touchAction:"pan-y"}:{}),imageStyle:{height:"auto"},media:v,mediaSize:800,mediaError:C,lazyload:!0,useHDUrl:!1,draggable:!K,displayDirectly:J}),Me&&o&&(0,hi.jsx)("div",{className:Gi.resizeHandleLayer,children:["nw","ne","sw","se"].map(function(e){return(0,hi.jsx)("div",{className:Io()(Gi.resizeHandle,Gi["resizeHandle_".concat(e)]),onPointerDown:function(t){return Ne(t,e)},onPointerUp:oe?function(e){return e.stopPropagation()}:void 0},e)})}),2===x&&(0,hi.jsx)(Lo._V,{style:{width:"56px",height:"56px"}}),4===x&&(0,hi.jsx)(Lo.s,{}),!(null===ee||void 0===ee||!ee.visible)&&(0,hi.jsx)(Lo.Wn,{}),(0,hi.jsx)(Lo.P0,{isEditMode:K,resType:A,useIOSpecialEvent:oe,onDelete:function(e){return ce(e)}}),(0,hi.jsx)(Lo.Cp,{visible:Do.YB?!!te:!!te&&ie===h,selected:o,menuPosition:re,menus:Se,overflowWebMenu:ne,reverseAppMenu:re.reverse}),o&&K&&(0,hi.jsx)(Lo.yN,{})]})}var qi=(0,No.observer)(Ui),$i=To(Eo.zM.TYPE_IMAGE,qi,{ignoreMutation:function(){return!0},stopEvent:function(e){var t;return["touchstart","mousedown","click","dragstart","dragenter","dragover","drop","dragend"].includes(null===e||void 0===e||null===(t=e.event)||void 0===t?void 0:t.type)}}),Ki=i.bP.create((0,a.A)((0,a.A)({},$i),{},{draggable:!1,addAttributes:function(){return(0,a.A)((0,a.A)({},$i.addAttributes()),{},{scale:{default:null}})},parseHTML:function(){var e=$i.parseHTML()[0];return[(0,a.A)((0,a.A)({},e),{},{getAttrs:function(t){var n=e.getAttrs(t),r=t.getAttribute("data-scale"),o=null==r||""===r?null:Number(r);return(0,a.A)((0,a.A)({},n),{},{scale:Number.isFinite(o)?o:null})}})]},renderHTML:function(e){var t=e.HTMLAttributes,n=$i.renderHTML({HTMLAttributes:t});return null!=t.scale&&n[1]&&(n[1]["data-scale"]=String(t.scale)),n}})),Ji=n(75206),Xi=n.n(Ji),Zi=n(65026),Qi=n(51918),ea={insert:"head",singleton:!1},ta=(si()(Qi.A,ea),Qi.A.locals||{});function na(e){var t=e.node,n=e.editor,r=e.selected,o=void 0!==r&&r,i=e.extension,u=e.getPos,s=void 0===u?function(){}:u,l=e.deleteNode,c=void 0===l?function(){}:l,d=e.updateAttributes,f=void 0===d?function(){}:d,p=(null===t||void 0===t?void 0:t.attrs)||{},h=(p.pluginId,p.data),m=void 0===h?[]:h,v=(null===i||void 0===i?void 0:i.options)||{},g=v.noteId,y=void 0===g?"":g,b=v.inlineEdit,w=v.readOnly,A=void 0!==w&&w,k=v.imgSpace,C=(0,Oo._g)(),D=C.throttle,x=(0,Po.useRef)(null),E=(0,Po.useState)(3),S=(0,F.A)(E,2),T=S[0],P=(S[1],(0,Po.useState)(-1)),_=(0,F.A)(P,2),I=_[0],N=_[1],O=(0,Po.useRef)(0),L=ai({node:t,editor:n,selected:o,noteId:y,inlineEdit:b,readOnly:A,getPos:s,deleteNode:c,updateAttributes:f}),B=L.isEditMode,R=L.isShareMode,z=L.editorFocus,j=L.navBarHeight,H=L.coverConfig,V=L.allSelected,Y=L.showOperateMenu,W=L.overflowWebMenu,G=L.menuPosition,U=L.isMediaOverMaxCount,q=L.useIOSpecialEvent,$=L.isFirstPosition,K=L.imgSpace,J=L.setShowOperateMenu,X=L.setOverflowWebMenu,Z=L.setMenuPosition,Q=L.handlePluginSetSelection,ee=L.handlePluginEditMedia,te=L.handleDeletePlugin,ne=L.handlePluginFirstPosition,re=L.handlePluginInsertUp,oe=L.handlePluginInsertDown,ie=L.handlePluginSelectAll,ae=L.handlePluginChangeCover,ue=L.handlePluginAddNewMedia,se=L.handlePluginModifyResource,le=L.handlePluginRemoveItem,ce=L.handlePluginPreviewMedia,de=L.handlePluginResourceEvent,fe=L.handlePluginChangeImgSpace,pe=(0,Po.useMemo)(function(){return y?k:K},[y,k,K]),he=(0,Po.useMemo)(function(){return m&&0!==m.length?(0,Vi.iP)(m).filter(
21Boolean).map(function(e){return(0,a.A)((0,a.A)({},e),{},{key:e.mediaId||"".concat(Math.random())})}):[]},[m]),me=(0,Po.useMemo)(function(){return!Do.YB||!!m&&m.every(function(e){return!!e.mediaUrl})},[m]),ve=(0,Po.useCallback)(function(e){var t,r=m[e]||{},o=r.mediaType;return[{type:"plugin-menu-cut",icon:"icon-jianqie",label:"åªå",onClick:function(t){try{t.stopPropagation(),J(!1),$o(m[e]),le(t,e)}catch(n){}}},{type:"plugin-menu-copy",icon:"icon-fuzhi",label:"å¤å¶",onClick:function(t){try{t.stopPropagation(),J(!1),$o(m[e])}catch(n){}}},{type:"plugin-menu-switch",icon:"icon-datu",label:"å为大å¾",onClick:function(e){e.stopPropagation();try{var t=s();te(),m.forEach(function(e,r){n.commands.insertContentAt(t+r,{type:Eo.zM.TYPE_IMAGE,attrs:{pluginId:(0,So.A7)(),mode:Eo.Vj.MODE_EDIT,data:(0,a.A)({},e)}})})}catch(r){}}},!!Do.YB&&[1,4].includes(o)&&{type:"plugin-menu-edit",icon:"icon-bianji",label:"ç¼è¾",onClick:function(t){try{t.stopPropagation(),J(!1),requestAnimationFrame(function(){ee(m[e])})}catch(n){}}},(!H.visible||H.index!==e)&&{type:"plugin-menu-cover",icon:"icon-tupian",label:"设为å°é¢",onClick:function(t){ae(t,e,m[e])}},{type:"plugin-menu-link",icon:"icon-lianjie",label:"".concat((0,Vi.st)(null===(t=m[e])||void 0===t?void 0:t.resType)?"æ´æ¢":"æ·»å ","跳转"),onClick:function(t){try{var n;null===t||void 0===t||null===(n=t.stopPropagation)||void 0===n||n.call(t),J(!1),requestAnimationFrame(function(){se(t,e,m[e])})}catch(r){}}},{type:"plugin-menu-img-space",icon:"icon-qiehuan",label:1===K?"æ é´è·":"æé´è·",onClick:fe},$&&{type:"plugin-menu-insert-up",icon:"icon-shangyi",label:"å䏿å
¥",onClick:re},{type:"plugin-menu-insert-down",icon:"icon-xiayi",label:"å䏿å
¥",onClick:oe},{type:"plugin-menu-all",icon:"icon-piliang_jiu",label:"å
¨é",onClick:ie},{type:"plugin-menu-delete",icon:"icon-shanchu",label:"å é¤",onClick:function(t){le(t,e)}}].filter(Boolean)},[n,m,H,$,K,s,J,ee,te,le,re,oe,ie,ae,se,fe]),ge=(0,Po.useMemo)(function(){return ve(I)},[I,ve]),ye=(0,Po.useMemo)(function(){try{if(I<0)return{};var e=I%T;if(e===(T-1)/2)return{};var t=x.current.getBoundingClientRect(),n=t.width,r=(n-4*(T-1))/T,o=0;o=Do.YB?8+56*Math.min(ge.length,5):12+40*ge.length+6*(ge.length-1);var i=(n-o)/2,a={adjust:!0,left:0===e?"calc(50% - ".concat(i,"px)"):"calc(50% + ".concat(i,"px)"),arrowLeft:0===e?"".concat(r/2,"px"):"calc(50% + ".concat(r/2,"px)")};return a}catch(u){}},[I,ge,T]),be=function(e){return e.stopPropagation(),e.preventDefault(),!0},we=function(e,t){try{if(!B||Do.YB||V)return;N(t),ne(),requestAnimationFrame(function(){ke(t,ge.length),J(!0)})}catch(n){}},Ae=(0,Po.useCallback)(function(){J(!1),N(-1)},[J]),ke=(0,Po.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;try{var n=x.current.getBoundingClientRect(),r=m.length+(U?0:1),o=Math.ceil(r/T),i=(n.height-4*(o-1))/o,a=16+64*Math.ceil(t/Eo.Wd),u=138;Do.YB&&(u=j+a/2);var s=Math.floor(e/T),l=n.y+i*s+4*(s+1),c=l;Do.YB&&(c-=a/2);var d=!1;c<0?(c=0,X(!0)):c>window.innerHeight?(c=window.innerHeight,X(!0)):c<u?(c=u,X(!1),Do.YB&&(d=!0)):X(!1),Z({top:d?l+.66*i+a/2:c,reverse:d})}catch(f){}},[m,j,U,T,X,Z]),Ce=D(function(){Do.YB&&Y?J(!1):ke(I,ge.length)},50);(0,Po.useEffect)(function(){if(Y&&!(I<0))return window.addEventListener("scroll",Ce),function(){window.removeEventListener("scroll",Ce)}},[j,Y,I,U,m,T,ge,Ce]);var De=(0,Po.useCallback)(function(e,t){if(null===e||void 0===e||e.stopPropagation(),B){if(Q(e),Do.YB&&n.commands.blur(),Do.YB&&!Y)return ne(),N(t),void requestAnimationFrame(function(){var e=ve(t);z?setTimeout(function(){ke(t,e.length),J(!0)},500):(ke(t,e.length),J(!0))});J(!1),requestAnimationFrame(function(){ce(e,t,m[t])})}else{var r=m[t]||{},o=r.resType;(0,Vi.st)(o)?de(e,m[t]):ce(e,t,m[t])}},[n,m,B,z,Y,J,ve,ke,ce,de,Q,ne]),xe=(0,Po.useCallback)(function(e){try{e.stopPropagation(),e.preventDefault(),Q(e),Do.YB&&n.commands.blur()}catch(t){}},[n,Q]),Ee=(0,Po.useCallback)(function(){var e=Date.now();return e-O.current<200||(q&&(O.current=e),!1)},[q]),Me=(0,Po.useCallback)(function(e,t){Ee()||(Do.YB||Q(e),De(e,t))},[Q,De,Ee]),Se=(0,Po.useCallback)(function(e,t){Ee()||(Do.YB||Q(e),le(e,t))},[Q,le,Ee]),Te=(0,Po.useCallback)(function(e){Ee()||(Do.YB||Q(e),ue(e))},[Q,ue,Ee]),Pe=(0,Po.useRef)(null),_e=function(e){try{var t=(0,xi.o8)(m);t.splice(e.newIndex,0,t.splice(e.oldIndex,1)[0]),Pe.current=t}catch(n){}},Ie=function(e){try{var t,n;return null===(t=e.related)||void 0===t||null===(n=t.querySelector)||void 0===n||!n.call(t,".plugin-grid-media-add")}catch(r){return!0}},Ne=function(){try{document.querySelectorAll(".sortable-fallback").forEach(function(e){return e.remove()}),Do.YB||Q(),Pe.current&&f({data:Pe.current})}catch(e){}finally{Pe.current=null}};return(0,hi.jsxs)(Mo.VR,{ref:x,className:Io()(ta.WegoPluginComponentGrid,"wego-editor-custom-plugin",(0,M.A)({},ta.editMode,B)),"data-cols":T,draggable:!1,onDragStart:be,onDragOver:be,onDrop:be,onClick:xe,onPointerUp:q?xe:void 0,onMouseDown:Do.YB?Q:void 0,onTouchStart:Do.YB?Q:void 0,children:[(0,hi.jsxs)(Zi.bH,{className:Io()(ta.WegoPluginGridContent,""),options:{filter:".plugin-grid-media-add",chosenClass:"".concat(ta.wegoPluginGridChosen),ghostClass:"".concat(ta.wegoPluginGridGhost),disabled:!B||!me,delay:Do.YB?120:0,animation:150,bubbleScroll:!0,forceFallback:Do.YB,fallbackTolerance:3,touchStartThreshold:3,removeCloneOnHide:!0,onUpdate:_e,onChoose:function(){Do.YB&&appShare(225)},onStart:function(e){},onChange:function(e){Do.YB&&appShare(225)},onMove:Ie,onEnd:Ne},children:[!!he&&Array.isArray(he)&&he.map(function(e,t){return(0,hi.jsx)("div",{"data-media-id":e.mediaId,className:Io()(ta.wegoPluginGridItem,{"sortable-handle":B}),style:0===pe?{margin:0,width:"".concat(100/T,"%")}:{},children:(0,hi.jsxs)("div",{className:Io()(ta.itemContent,(0,M.A)({},ta.normal,!0)),onMouseEnter:function(e){return we(e,t)},onMouseLeave:Ae,onClick:function(e){return Me(e,t)},onPointerUp:q?function(e){return Me(e,t)}:void 0,children:[(0,hi.jsx)(Lo.qd,{className:ta.itemImag,style:{pointerEvents:B?"none":"auto"},imageStyle:{pointerEvents:B?"none":"auto"},media:e,draggable:!B,displayDirectly:R}),2===e.mediaType&&(0,hi.jsx)(Lo._V,{}),4===e.mediaType&&(0,hi.jsx)(Lo.s,{}),!!H.visible&&H.index===t&&(0,hi.jsx)(Lo.Wn,{}),(0,hi.jsx)(Lo.P0,{isEditMode:B,resType:e.resType,useIOSpecialEvent:q,onDelete:function(e){return Se(e,t)}}),B&&!!Y&&t===I&&(0,hi.jsx)(Lo.yN,{}),!Do.YB&&Xi().createPortal((0,hi.jsx)(Lo.lH,{visible:!!Y&&t===I,style:(0,a.A)({top:"".concat(G.top,"px")},ye.adjust&&{left:ye.left}),arrowStyle:(0,a.A)({},ye.adjust&&{left:ye.arrowLeft}),menus:ge,overflowWebMenu:W}),document.body),!!Do.YB&&Xi().createPortal((0,hi.jsx)(Lo.M8,{visible:!!Y&&o&&t===I,style:(0,a.A)({top:"".concat(G.top,"px")},ye.adjust&&{left:ye.left}),arrowStyle:(0,a.A)({},ye.adjust&&{left:ye.arrowLeft}),menus:ge,reverse:G.reverse}),document.body)]})},e.key||"".concat(Math.random()))}),B&&!U&&(0,hi.jsx)("div",{className:ta.wegoPluginGridItem,style:0===pe?{margin:0,width:"".concat(100/T,"%")}:{},onClick:q?void 0:Te,onPointerDown:q?Te:void 0,children:(0,hi.jsx)("div",{className:Io()(ta.itemContent,(0,M.A)((0,M.A)({},ta.more,!0),"plugin-grid-media-add",!0)),children:(0,hi.jsxs)("div",{className:ta.add,children:[(0,hi.jsx)("i",{className:Io()(ta.addIcon,"wego-iconfont-s
21icon-shangchuantupian")}),(0,hi.jsx)("div",{className:ta.addText,children:"æ·»å å¾ç"})]})},"plugin-grid-media-add")})]}),o&&B&&(0,hi.jsx)(Lo.yN,{})]})}var ra=(0,No.observer)(na),oa=i.bP.create((0,a.A)({},To(Eo.zM.TYPE_GRID,ra,{ignoreMutation:function(){return!0},stopEvent:function(e){var t;return["touchstart","mousedown","click","dragstart","dragenter","dragover","drop","dragend"].includes(null===e||void 0===e||null===(t=e.event)||void 0===t?void 0:t.type)}}))),ia=n(865),aa={insert:"head",singleton:!1},ua=(si()(ia.A,aa),ia.A.locals||{});function sa(e){var t=e.node,n=e.editor,r=e.selected,o=void 0!==r&&r,i=e.extension,u=e.getPos,s=void 0===u?function(){}:u,l=e.deleteNode,c=void 0===l?function(){}:l,d=e.updateAttributes,f=void 0===d?function(){}:d,p=(null===t||void 0===t?void 0:t.attrs)||{},h=p.pluginId,m=p.data,v=void 0===m?[]:m,g=(null===i||void 0===i?void 0:i.options)||{},y=g.noteId,b=void 0===y?"":y,w=g.inlineEdit,A=g.readOnly,k=void 0!==A&&A,C=g.imgSpace,D=(0,Po.useRef)(),x=(0,Oo._g)(),E=x.throttle,S=(0,Po.useState)(!1),T=(0,F.A)(S,2),P=T[0],_=T[1],I=(0,Po.useState)(-1),N=(0,F.A)(I,2),O=N[0],L=N[1],B=(0,Po.useState)({}),R=(0,F.A)(B,2),z=R[0],j=R[1],H=(0,Po.useState)(!1),V=(0,F.A)(H,2),Y=V[0],W=V[1],G=ai({node:t,editor:n,selected:o,noteId:b,inline
21Edit:w,readOnly:k,getPos:s,deleteNode:c,updateAttributes:f}),U=G.isEditMode,q=G.isShareMode,$=G.editorFocus,K=G.coverConfig,J=G.allSelected,X=G.showOperateMenu,Z=G.overflowWebMenu,Q=G.menuPosition,ee=G.isImageMediaOverMaxCount,te=G.useIOSpecialEvent,ne=G.isFirstPosition,re=G.imgSpace,oe=G.setShowOperateMenu,ie=G.handlePluginSetSelection,ae=G.handlePluginEditMedia,ue=G.handlePluginFirstPosition,se=G.handlePluginInsertUp,le=G.handlePluginInsertDown,ce=G.handlePluginSelectAll,de=G.handlePluginChangeCover,fe=G.handlePluginAddNewMedia,pe=G.handlePluginModifyResource,he=G.handlePluginRemoveItem,me=G.handlePluginPreviewMedia,ve=G.handlePluginResourceEvent,ge=G.handlePluginChangeImgSpace,ye=G.handleCalcWebMenuPosition;(0,Po.useEffect)(function(){setTimeout(function(){_(!0)},200)},[U]);var be=(0,Po.useMemo)(function(){return b?C:re},[b,C,re]),we=(0,Po.useMemo)(function(){return U&&!ee&&v.length<Eo.Bn},[U,v,ee]),Ae=(0,Po.useCallback)(function(e){try{var t,n=v[e]||{},r=n.mediaType;return[{type:"plugin-menu-cut",icon:"icon-jianqie",label:"åªå",onClick:function(t){try{t.stopPropagation(),oe(!1),$o(v[e]),he(t,e)}catch(n){}}},{type:"plugin-menu-copy",icon:"icon-fuzhi",label:"å¤å¶",onClick:function(t){try{t.stopPropagation(),oe(!1),$o(v[e])}catch(n){}}},!!Do.YB&&[1,4].includes(r)&&{type:"plugin-menu-edit",icon:"icon-bianji",label:"ç¼è¾",onClick:function(t){try{t.stopPropagation(),oe(!1),requestAnimationFrame(function(){ae(v[e])})}catch(n){}}},(!K.visible||K.index!==e)&&{type:"plugin-menu-cover",icon:"icon-tupian",label:"设为å°é¢",onClick:function(t){de(t,e,v[e])}},{type:"plugin-menu-link",icon:"icon-lianjie",label:"".concat((0,Vi.st)(null===(t=v[e])||void 0===t?void 0:t.resType)?"æ´æ¢":"æ·»å ","跳转"),onClick:function(t){try{var n;null===t||void 0===t||null===(n=t.stopPropagation)||void 0===n||n.call(t),oe(!1),requestAnimationFrame(function(){pe(t,e,v[e])})}catch(r){}}},{type:"plugin-menu-img-space",icon:"icon-qiehuan",label:1===re?"æ é´è·":"æé´è·",onClick:ge},ne&&{type:"plugin-menu-insert-up",icon:"icon-shangyi",label:"å䏿å
¥",onClick:se},{type:"plugin-menu-insert-down",icon:"icon-xiayi",label:"å䏿å
¥",onClick:le},{type:"plugin-menu-all",icon:"icon-piliang_jiu",label:"å
¨é",onClick:ce},{type:"plugin-menu-delete",icon:"icon-shanchu",label:"å é¤",onClick:function(t){he(t,e)}}].filter(Boolean)}catch(o){return[]}},[v,re,K,ne,oe,ae,se,le,ce,he,de,pe,ge]),ke=(0,Po.useMemo)(function(){return Ae(O)},[O,Ae]),Ce=(0,Po.useCallback)(function(e){try{if(e<0)return{};var t=document.getElementById("".concat(h,"-").concat(e)),n=t.getBoundingClientRect(),r=n.left,o=n.width,i=r<14?14:r,a=Ae(e),u=0;u=Do.YB?16+56*Math.min(a.length,5):12+40*a.length+6*(a.length-1);var s={adjust:!0,left:"".concat(i+u/2,"px"),arrowLeft:"".concat(r<14?(o-Math.abs(r))/2:o/2,"px")};if(Do.YB)i+u>window.innerWidth-14&&(s.left="auto",s.right="-".concat(u/2-14,"px"),s.arrowLeft="".concat(u-(window.innerWidth-r)/2,"px"));else{var l=Math.min(window.innerWidth,760),c=window.innerWidth-(window.innerWidth-l)/2,d=(window.innerWidth-l)/2;i<d?s.left="".concat(d+u/2,"px"):i+u>c-14&&(s.left="auto",s.right="".concat((window.innerWidth-l)/2-u/2,"px"),s.arrowLeft="".concat(u/2,"px"))}return s}catch(f){}},[h,Ae]),De=E(function(){Do.YB&&X?oe(!1):ye(D,ke.length)},50);(0,Po.useEffect)(function(){if(X&&!(O<0))return window.addEventListener("scroll",De),function(){window.removeEventListener("scroll",De)}},[X,O,ee,v,De]);var xe=(0,Po.useCallback)(function(e,t){if(null===e||void 0===e||e.stopPropagation(),U){if(Do.YB&&n.commands.blur(),Do.YB&&!X)return L(t),ue(),j(Ce(t)),void requestAnimationFrame(function(){$?setTimeout(function(){ye(D,ke.length),oe(!0)},500):(ye(D,ke.length),oe(!0))});oe(!1),requestAnimationFrame(function(){me(e,t,v[t])})}else{var r=v[t]||{},o=r.resType;(0,Vi.st)(o)?ve(e,v[t]):me(e,t,v[t])}},[n,v,U,$,ke,X,oe,Ce,ye,me,ve,ue]),Ee=(0,Po.useCallback)(function(e,t){try{if(!U||Do.YB||J)return;L(t),ue(),j(Ce(t)),requestAnimationFrame(function(){ye(D,ke.length),oe(!0)})}catch(n){}},[U,J,ke,ue,oe,Ce,ye]),Me=(0,Po.useCallback)(function(){oe(!1),L(-1)},[oe]),Se=(0,Po.useCallback)(function(e){try{e.stopPropagation(),e.preventDefault(),Do.YB&&n.commands.blur()}catch(t){}},[n]),Te=(0,Po.useCallback)(function(){W(function(e){return!e})},[]);return(0,hi.jsxs)(Mo.VR,{ref:D,className:Io()(ua.WegoPluginComponentSlide,"wego-editor-custom-plugin",(0,M.A)({},ua.editMode,U)),onClick:Se,onMouseDown:ie,onTouchStart:ie,children:[!!Y&&(0,hi.jsx)("div",{className:"slideRefreshElement"}),(0,hi.jsx)("div",{className:ua.slideSwiperframe,children:!!P&&(0,hi.jsx)(Zi.RC,{className:ua.slideSwiperContent,options:{className:"".concat(h,"-swi
21per"),grabCursor:!1,slidesPerView:"auto",centeredSlides:!1,initialSlide:0,freeMode:!0,observer:!0,observeParents:!0,on:{slideChangeTransitionStart:function(){oe(!1)}}},onClick:function(e){e.stopPropagation()},children:(0,Vi.iP)(v).map(function(e,t){return(0,hi.jsxs)(Zi.qr,{id:"".concat(h,"-").concat(t),className:ua.slideItem,style:(0,a.A)((0,a.A)({},0===be&&{marginLeft:t>0?"-1px":"0px"}),e.mediaWidth>0&&e.mediaHeight>0&&{width:"".concat(e.mediaWidth/e.mediaHeight*320+1,"px")}),onMouseEnter:function(e){return Ee(e,t)},onMouseLeave:Me,onClick:function(e){return xe(e,t)},onPointerUp:te?function(e){return xe(e,t)}:void 0,children:[(0,hi.jsx)(Lo.qd,{className:ua.slideItemImg,style:{width:e.mediaWidth>0&&e.mediaHeight>0?"100%":e.mediaCoverUrl||e.mediaUrl?"auto":"200px"},imageStyle:{width:e.mediaWidth>0&&e.mediaHeight>0?"100%":"auto",height:"100%",objectFit:e.mediaWidth>0&&e.mediaHeight>0?"cover":"fill",pointerEvents:U?"none":"auto"},media:e,mediaSize:640,draggable:!1,displayDirectly:q,onLoad:Te}),2===e.mediaType&&(0,hi.jsx)(Lo._V,{}),4===e.mediaType&&(0,hi.jsx)(Lo.s,{}),!!K.visible&&K.index===t&&(0,hi.jsx)(Lo.Wn,{}),(0,hi.jsx)(Lo.P0,{isEditMode:U,resType:e.resType,useIOSpecialEvent:te,onDelete:function(e){return he(e,t)}}),U&&!!X&&t===O&&(0,hi.jsx)(Lo.yN,{}),!Do.YB&&Xi().createPortal((0,hi.jsx)(Lo.lH,{visible:!!X&&t===O,style:(0,a.A)({top:"".concat(Q.top+16,"px")},z.adjust&&(0,a.A)({left:z.left},!!z.right&&{right:z.right})),arrowStyle:(0,a.A)({},z.adjust&&{left:z.arrowLeft}),menus:ke,overflowWebMenu:Z}),document.body),!!Do.YB&&Xi().createPortal((0,hi.jsx)(Lo.M8,{visible:!!X&&o&&t===O,style:(0,a.A)({top:"".concat(Q.top+16,"px")},z.adjust&&(0,a.A)({left:z.left},!!z.right&&{right:z.right})),arrowStyle:(0,a.A)({},z.adjust&&{left:z.arrowLeft}),menus:ke}),document.body)]},e.mediaId||"".concat(h,"-").concat(t))})})}),!!we&&(0,hi.jsxs)("div",{className:ua.slideAddNewMedia,onClick:fe,onPointerUp:te?fe:void 0,children:[(0,hi.jsx)("i",{className:Io()(ua.icon,"wego-iconfont-s icon-shangchuantupian")}),(0,hi.jsx)("div",{className:ua.text,children:"æ·»å å¾ç"})]}),o&&U&&(0,hi.jsx)(Lo.yN,{})]})}var la=(0,No.observer)(sa),ca=i.bP.create((0,a.A)({},To(Eo.zM.TYPE_SLIDE,la,{ignoreMutation:function(){return!0},stopEvent:function(e){var t;return["touchstart","mousedown","click","dragstart","dragenter","dragover","drop","dragend"].includes(null===e||void 0===e||null===(t=e.event)||void 0===t?void 0:t.type)}}))),da=n(68493),fa={insert:"head",singleton:!1},pa=(si()(da.A,fa),da.A.locals||{});function ha(e){var t=e.node,n=(e.editor,e.selected),r=void 0!==n&&n,o=(e.getPos,e.deleteNode,e.updateAttributes,(null===t||void 0===t?void 0:t.attrs)||{}),i=o.mode,a=(0,Po.useMemo)(function(){return i===Eo.Vj.MODE_EDIT},[i]);return(0,hi.jsxs)(Mo.VR,{className:pa.WegoPluginComponentDivider,children:[(0,hi.jsx)("div",{className:pa.pluginDividerLine}),r&&a&&(0,hi.jsx)(Lo.yN,{})]})}var ma=ha,va=i.bP.create((0,a.A)((0,a.A)({},To(Eo.zM.TYPE_DIVIDER,ma)),{},{renderHTML:function(e){var t=e.HTMLAttributes;return["div",(0,M.A)((0,M.A)((0,M.A)((0,M.A)({contenteditable:"false"},Eo.mm,(0,So._0)(Eo.zM.TYPE_DIVIDER)),"data-plugin-id",t.pluginId),"data-mode",t.mode),"data-data",JSON.stringify(t.data)),["hr",(0,M.A)({},Eo.qh,(0,So._0)(Eo.zM.TYPE_DIVIDER))]]},addKeyboardShortcuts:function(){var e=this;return{"Mod-h":function(){var t=(0,So.dW)({editor:e.editor,pluginName:Eo.zM.TYPE_DIVIDER});return!!t}}},addInputRules:function(){var e=this;return[{find:/^(?:---|___)\s?$/,handler:function(t){var n=t.state,r=t.range,o=n.tr,i=r.from,a=n.doc.resolve(i),u=a.start()-1,s=a.end();o.replaceWith(u,s,e.type.create({pluginId:(0,So.A7)(),mode:Eo.Vj.MODE_EDIT,data:{}}));var l=u+1,c=n.schema.nodes.paragraph.create();o.insert(l,c);var d=l+1;return o.setSelection(new w.U3(o.doc.resolve(d))),o.scrollIntoView()}}]}})),ga=i.YY.create({name:"extension-text-length",addOptions:function(){return{maxLength:2e4}},addProseMirrorPlugins:function(){var e=this.editor,t=this.options.maxLength,n=Object.values(Eo.zM);return[new w.k_({key:new w.hs("plugin-key-text-length"),filterTransaction:function(r){try{if(!r.docChanged)return!0;var o=e.getText().length,i=ya(e.state.doc,e,n),a=ya(r.doc,e,n);if(a<i)return!0;var u=Math.max(o,a),s=u>=t&&a>i;return s&&wgoo.$toast({title:"æå¤è¾å
¥".concat(t,"å符"),position:Do.du?"top":"bottom"}),!s}catch(l){return!0}}})]}});function ya(e,t,n){try{var r="";
21return e.nodesBetween(0,e.content.size,function(e){return!n.includes(e.type.name)&&(e.isText?r+=e.text:(e.isBlock||"hardBreak"===e.type.name)&&(r+="\n"),!0)}),r.replace(/\n+$/,"").length}catch(o){return t.getText().length}}var ba=i.YY.create({name:"extension-back-space",priority:100,addKeyboardShortcuts:function(){return{Backspace:function(e){var t=e.editor;try{var n=t.state,r=n.doc,o=n.selection,i=o.$anchor;if(!o.empty)return!1;var a=i.index(0),u=i.node(0);if(0===a){var s=u.child(0);if("paragraph"===s.type.name&&0===s.content.size&&u.childCount>=2){var l=u.child(1);if((0,So.zi)({type:l.type.name}))return t.chain().command(function(e){var t=e.tr;t.delete(0,2);var n=t.doc.resolve(1);return t.setSelection(w.nh.near(n,-1)),!0}).focus().run()}return!1}if("paragraph"===i.parent.type.name&&0===i.parent.content.size)return!1;if(0!==i.parentOffset)return!1;var c=i.index(0);if(0===c)return!1;var d=i.node(0).child(c-1);if(!d||!(0,So.zi)({type:d.type.name}))return!1;var f=i.pos-2;return!(o instanceof w.nh&&o.from===f)&&(t.chain().command(function(e){var t=e.tr;return t.setSelection(w.nh.create(r,f)),!0}).focus().run(),!0)}catch(p){return console.error("handleBackspace error:",p),!1}}}}}),wa=i.YY.create({name:"extension-select-all",addStorage:function(){return{handler:function(e){}}},onCreate:function(){var e=this.editor,t=this.storage;t.handler=function(t){try{var n=(t.ctrlKey||t.metaKey)&&"a"===t.key.toLowerCase();if(!n)return;if(e.isFocused||!e.isEditable)return;if(["INPUT","TEXTAREA"].includes(t.target.tagName))return;var r=e.view.dom;if(!r.isConnected||0===r.getClientRects().length)return;t.preventDefault(),t.stopPropagation(),e.chain().focus().selectAll().run()}catch(o){}},document.addEventListener("keydown",t.handler,!0)},onDestroy:function(){this.storage.handler&&document.removeEventListener("keydown",this.storage.handler,!0)}}),Aa=i.YY.create({name:"extension-ios-selection",priority:100,addProseMirrorPlugins:function(){return[new w.k_({key:new w.hs("plugin-key-ios-selection"),props:{handleDOMEvents:{click:function(e,t){try{var n=e.state,r=e.dispatch,o=(n.selection,e.posAtCoords({left:t.clientX,top:t.clientY}));if(!o)return!1;var i=n.doc.resolve(o.pos),a=!1,u=t.target;while(u&&u!==(null===e||void 0===e?void 0:e.dom)){var s,l,c;if(null!==(s=u.classList)&&void 0!==s&&s.contains("wego-editor-custom-plugin")||null!==(l=(c=u).getAttribute)&&void 0!==l&&l.call(c,"data-plugin-id")){a=!0;break}u=u.parentElement}if(a)return!1;var d=n.storedMarks,f=n.tr;return f.setSelection(w.U3.near(i,-1)),d&&d.length>0&&f.setStoredMarks(d),r(f),!0}catch(p){return!1}}}}})]}}),ka=i.YY.create({name:"extension-ios-composition",priority:100,addProseMirrorPlugins:function(){var e=null,t=-1,n=-1,r=!1;return[new w.k_({key:new w.hs("plugin-key-ios-composition"),props:{handleDOMEvents:{compositionstart:function(o){try{e=null,t=-1,n=-1,r=!1;var i=o.state,a=i.storedMarks,u=i.selection,s=u.$from;e=a||(s?s.marks():[]),t=u.from}catch(l){}return!1},compositionend:function(){try{e&&e.length>0?r=!0:e=null}catch(t){}return!1}}},appendTransaction:function(o,i,a){if(e&&e.length>0&&t>=0)try{var u=a.selection;if(u.empty){var s=u.from;if(s>t&&s!==n){var l,c=a.tr,d=(0,jo.A)(e);try{for(d.s();!(l=d.n()).done;){var f=l.value;c.addMark(t,s,f)}}catch(p){d.e(p)}finally{d.f()}return n=s,r&&(e=null,t=-1,n=-1,r=!1),c}}r&&(e=null,t=-1,n=-1,r=!1)}catch(h){}return null}})]}}),Ca=n(49455),Da=n(74716);function xa(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"è®°å½äº§åæ
äºãåç¹ãç¾å¾";return[wo,Jr.configure({className:"wego-editor-selection"}),no.configure({hardBreak:!0}),lo.configure({multicolor:!0}),io.configure({types:["paragraph","heading"]}),ro.configure({placeholder:e||"è®°å½äº§åæ
äºãåç¹ãç¾å¾",emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty"}),Co.configure({inline:!1,allowBase64:!0}),gi,Ci,Hi,Ki,oa,ca,va,ga,ba,!Do.YB&&wa,!!Do.du&&Aa,!!Do.du&&ka].filter(Boolean)}function Ea(e){var t="";try{if(!e)return;var n=e.state,r=n.selection,i=n.doc,a=r.from,u=r.to,s=r.empty;if(s)return;var l=i.slice(a,u),c=o.ZF.fromSchema(e.schema);t=c.serializeFragment(l.content)}catch(d){}finally{return t}}function Ma(e){var t="";try{if(!e)return;var n=Ea(e),r=document.createElement("div");r.appendChild(n.cloneNode(!0)),t=r.innerHTML,t=t.replace(/<!--\s*StartFragment\s*-->/gi,"").replace(/<!--\s*EndFragment\s*-->/gi,"").trim()}catch(o){}finally{return t}}
21function Sa(e){var t={nodes:[],from:0,to:0,fromPos:null,toPos:null,empty:!0,imageNodes:[],html:"",allSelected:!1,noSelected:!1};try{var n,o;if(!e)return;var i=e.state,a=i.selection,u=i.doc,s=a.from,l=a.to,c=a.empty;t.from=s,t.to=l,t.fromPos=e.view.coordsAtPos(s),t.toPos=e.view.coordsAtPos(l),t.empty=c,u.nodesBetween(s,l,function(e){t.nodes.push(e)});var d,f=t.nodes.filter(function(e){return"paragraph"!==e.type.name});if(f.every(function(e){return e.type.name===Eo.zM.TYPE_IMAGE}))(d=t.imageNodes).push.apply(d,(0,r.A)(f));t.html=Ma(e),t.allSelected=0===s&&l===u.content.size,t.noSelected=c||1===t.nodes.length&&(0,So.zi)({type:null===(n=t.nodes[0])||void 0===n||null===(o=n.type)||void 0===o?void 0:o.name})}catch(p){}finally{return t}}function Ta(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:180,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:20;try{var o=function(e){var t=e.getAttribute(Eo.mm);if(!p.includes(t))return!1;var n=e.getAttribute("data-data");if(!n)return!1;n=JSON.parse(n);var r=0,o=0;return Array.isArray(n)?(r=n.filter(function(e){return 2!==e.mediaType}).length,o=n.filter(function(e){return 2===e.mediaType}).length):(r=2!==n.mediaType?1:0,o=2===n.mediaType?1:0),r+c.image.currentCount>c.image.maxCount||o+c.video.currentCount>c.video.maxCount},i=function(e){if(!e||!e.hasAttribute(Eo.mm))return!1;var t=e.getAttribute(Eo.mm),n=f[t],r=n.currentCount>=n.maxCount||o(e);return r?d=!0:n.currentCount+=1,r},a=function(e){return!!e&&e.startsWith("http")};if(!e)return e;var u=new DOMParser,s=e.replace(/<!--\s*StartFragment\s*-->/gi,"").replace(/<!--\s*EndFragment\s*-->/gi,"").trim(),l=u.parseFromString(s,"text/html"),c={image:{currentCount:(0,Da.x$)(t),maxCount:n},video:{currentCount:(0,Da.zj)(t),maxCount:r}},d=!1,f={};Object.values(Eo.zM).forEach(function(e){f[(0,So._0)(e)]={pluginName:e,pluginTag:(0,So._0)(e),maxCount:(0,So.d)(e),currentCount:(0,Da.qq)(t,e).length}});var p=[(0,So._0)(Eo.zM.TYPE_IMAGE),(0,So._0)(Eo.zM.TYPE_GRID),(0,So._0)(Eo.zM.TYPE_SLIDE)];l.querySelectorAll("*").forEach(function(e){var t=e.hasAttribute(Eo.mm);if(t)if(i(e))e.remove();else{var n=(0,So.A7)();e.setAttribute("data-plugin-id",n);var r=e.getAttribute(Eo.mm);if(p.includes(r)){var o=e.getAttribute("data-data");o&&(o=JSON.parse(o),Array.isArray(o)?o.forEach(function(e){e.mediaId=(0,xo.Cz)()}):o.mediaId=(0,xo.Cz)(),e.setAttribute("data-data",JSON.stringify(o)))}}}),d&&wgoo.$toast({title:"模åè¶
åºä¸éï¼æ æ³ç²è´´",position:Do.du?"top":"bottom"});var h=!1,m=[],v=l.querySelectorAll("img");v.forEach(function(e){if(a(e.src)){var t=e.hasAttribute(Eo.qX);if(!t){if(c.image.currentCount>=c.image.maxCount)return h=!0,void e.remove();c.image.currentCount+=1;var n=(0,So.A7)(),r=(0,xo.Cz)();m.push({pluginName:Eo.zM.TYPE_IMAGE,pluginId:n,mediaId:r,mediaType:1,mediaUrl:e.src});var o=l.createElement("div");o.setAttribute(Eo.mm,(0,So._0)(Eo.zM.TYPE_IMAGE)),o.setAttribute("data-plugin-id",n),o.setAttribute("data-mode","edit"),o.setAttribute("data-data",JSON.stringify({resType:Ca.kq.TYPE_NONE,resId:Ca.uj.TYPE_IMAGE,resName:"",resIcon:e.src,loading:!0,mediaId:r,mediaType:1,mediaUrl:e.src,qualityType:1})),e.replaceWith(o)}}else e.remove()});var g=l.querySelectorAll("video");g.forEach(function(e){var t=e.getAttribute("src");if(!t){var n=e.querySelector("source");n&&(t=n.getAttribute("src"))}if(a(t)){var r=e.hasAttribute(Eo.i8);if(!r){if(c.video.currentCount>=c.video.maxCount)return h=!0,void e.remove();c.video.currentCount+=1;var o=(0,So.A7)(),i=(0,xo.Cz)();m.push({pluginName:Eo.zM.TYPE_IMAGE,pluginId:o,mediaId:i,mediaType:2,mediaUrl:e.src});var u=l.createElement("div");u.setAttribute(Eo.mm,(0,So._0)(Eo.zM.TYPE_IMAGE)),u.setAttribute("data-plugin-id",o),u.setAttribute("data-mode","edit"),u.setAttribute("data-data",JSON.stringify({resType:Ca.kq.TYPE_NONE,resId:Ca.uj.TYPE_IMAGE,resName:"",resIcon:e.src,loading:!0,mediaId:i,mediaType:2,mediaUrl:e.src,qualityType:1})),e.replaceWith(u)}}else e.remove()}),h&&wgoo.$toast({title:"åªä½èµæºè¶
åºéå¶ï¼æ æ³ç²è´´",position:Do.du?"top":"bottom"});var y=l.querySelectorAll("hr");
21y.forEach(function(e){var t=e.hasAttribute(Eo.qh);if(!t){var n=l.createElement("div");n.setAttribute(Eo.mm,(0,So._0)(Eo.zM.TYPE_DIVIDER)),n.setAttribute("data-plugin-id",(0,So.A7)()),n.setAttribute("data-mode","edit"),n.setAttribute("data-data",JSON.stringify({})),e.replaceWith(n)}});var b=l.querySelectorAll("a");b.forEach(function(e){e.removeAttribute("href")}),m&&m.length>0&&window.dispatchEvent(new CustomEvent(Ca.W5,{detail:m})),l.querySelectorAll("div, section, article, span, li").forEach(function(e){var t=e.childNodes;if(1===t.length&&"BR"===t[0].tagName){var n=l.createElement("p");n.appendChild(l.createElement("br")),e.replaceWith(n)}});var w=Array.from(l.body.childNodes).map(function(e){return e.outerHTML||e.textContent}).join("");return w}catch(A){return e}}function Pa(e){try{if(!e)return!1;var t=e.clipboardData.items;if(t&&t.length>0){for(var n=[],r=0;r<t.length;r++){var o=t[r];"file"===o.kind&&n.push(o.getAsFile())}if(n.length>0)return window.dispatchEvent(new CustomEvent(Ca.s9,{detail:n})),!0}}catch(i){return!1}}function _a(e){try{var t;if(!e)return;var n=null===(t=e.view)||void 0===t?void 0:t.dom;n.addEventListener("click",function(t){var n,r,o=t.target,i=!1;while(o&&o!==(null===(a=e.view)||void 0===a?void 0:a.dom)){var a,u,s,l;if(null!==(u=o.classList)&&void 0!==u&&u.contains("wego-editor-custom-plugin")||null!==(s=(l=o).getAttribute)&&void 0!==s&&s.call(l,"data-plugin-id")){i=!0;break}o=o.parentElement}if(!i){var c=e.state,d=e.view,f=c.schema,p=c.doc,h=c.tr,m=d.posAtCoords({left:t.clientX,top:t.clientY});if(m){var v=p.resolve(m.pos),g=v.nodeBefore,y=v.nodeAfter;if((0,So.zi)({type:null===g||void 0===g||null===(n=g.type)||void 0===n?void 0:n.name})&&(0,So.zi)({type:null===y||void 0===y||null===(r=y.type)||void 0===r?void 0:r.name})){var b=f.nodes.paragraph.create();h.insert(m.pos,b),d.dispatch(h),setTimeout(function(){e.commands.focus(m.pos+1)},0)}}}})}catch(r){}}function Ia(e){try{var t=Do.YB?48:64,n=20,r=e.view,o=e.state,i=o.doc,a=o.selection,u=a.from,s=a.to,l=a.head;if(u!==s){var c,d,f=[];if(i.nodesBetween(u,s,function(e){f.push(e)}),1===f.length&&(0,So.zi)({type:null===(c=f[0])||void 0===c||null===(d=c.type)||void 0===d?void 0:d.name}))return}var p=r.coordsAtPos(l),h=window.scrollY,m=window.innerHeight,v=p.bottom+h,g=h+m-(t+n);if(v>g){var y=v-g;return void window.scrollBy({top:y,behavior:"smooth"})}var b=102,w=p.top+h,A=h+b;if(w<A){var k=A-w;window.scrollBy({top:-k,behavior:"smooth"})}}catch(C){}}},46184:function(e,t,n){n.d(t,{A:function(){return Ze}});var r=n(75117),o=n(1290),i=n(10020),a=n(98681),u=n(34293),s=n(51237),l=n(95627),c=n(63887),d=n(3846),f=n(60738),p=n(52100),h=n(83763),m=n(56107),v=n(6279),g=n(54451),y=n.n(g),b=(n(39525),n(85592)),w=n(25471),A=n(34808),k=n(51553),C=n(94693),D=n(84315),x=n(47785),E=n(60374),M=n.n(E),S=n(14779),T=n(46260),P=n(35843),_=n(11759),I=n(49455),N=n(24912),O=n(60573),F=n(34252),L=n(12843),B=n(96166),R=n(92445),z=n(78255),j=n(30503),H=n(59126),V=n(51707),Y=n(35248),W=n(74716);function G(e,t){if(0===t.length)return!0;if(0===e.length)return!1;var n=0,r=0;while(n<e.length&&r<t.length)e[n]===t[r]&&r++,n++;return r===t.length}function U(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isMyAlbum,n=void 0!==t&&t,r=e.cover,o=void 0===r?"":r,i=e.originCover,a=void 0===i?"":i,u=e.editorContent,s=void 0===u?{}:u,l=e.originEditorContent,c=void 0===l?{}:l;try{if(o!==a)return!0;var d=(0,z.u_)(c),f=(0,z.u_)((0,v.toJS)(s));if(f&&f.length>0&&f.some(function(e){return!d.includes(e)}))return!0;if(!n&&f.length>0&&!G(d,f))return!0;var p=(0,W.Ys)(c),h=(0,W.Ys)((0,v.toJS)(s));if(!h.every(function(e){return p.some(function(t){return t.mediaId===e.mediaId})}))return!0;var m=(0,W.z9)(s,F.c9),g=(0,W.z9)(c,F.c9),y=m.some(function(e){var t=g.find(function(t){return t.attrs.pluginId===e.attrs.pluginId}),n=e.attrs.data,r=t.attrs.data;return(0,v.isArrayLike)(n)?n.some(function(e){var t=r.find(function(t){return e.mediaId===t.mediaId});return!t||!(!e.resType||e.resType===I.kq.TYPE_NONE)&&(e.resType!==t.resType||e.resId!==t.resId)}):!(!n.resType||n.resType===I.kq.TYPE_NONE)&&(n.resType!==r.resType||n.resId!==r.resId)});if(y)return!0;var b=(0,W.qq)(c,F.zM.TYPE_LINK),w=(0,W.qq)((0,v.toJS)(s),F.zM.TYPE_LINK);if(w&&w.length>0){var A=!1;if(A=n?w.some(function(e){var t=b.find(function(t){return t.attrs.pluginId===e.attrs.pluginId});return!(!e.attrs.data.resType||e.attrs.data.resType===I.kq.TYPE_NONE)&&e.attrs.data.resId!==t.attrs.data.resId}):w.some(function(e){return!(!e.attrs.data.resType||e.attrs.data.resType===I.kq.TYPE_NONE)&&e.attrs.data.resType!==I.kq.TYPE_NONE}),A)return!0}var k=(0,W.qq)(c,F.zM.TYPE_GRID),C=(0,W.qq)((0,v.toJS)(s),F.zM.TYPE_GRID);if(C&&C.length>0){var D=C.some(function(e){var t=k.find(function(t){return t.attrs.pluginId===e.attrs.pluginId}),n=e.attrs.data.map(function(e){return e.mediaId}),r=t.attrs.data.map(function(e){return e.mediaId});return!G(r,n)});if(D)return!0}var x=(0,W.qq)(c,F.zM.TYPE_IMAGE),E=(0,W.qq)((0,v.toJS)(s),F.zM.TYPE_IMAGE);if(E&&E.length>0){var M=E.some(function(e){var t=x.find(function(t){return t.attrs.pluginId===e.attrs.pluginId});return e.attrs.scale!==t.attrs.scale});if(M)return!0}return!1}catch(S){return!0}}var q,$,K,J,X,Z,Q,ee,te,ne,re,oe,ie,ae,ue,se,le,ce,de,fe,pe,he,me,ve,ge,ye,be,we,Ae,ke,Ce,De,xe,Ee,Me,Se,Te,Pe,_e,Ie,
21Ne,Oe,Fe,Le=n(68730),Be=n(1033);function Re(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof u?r:u,l=Object.create(s.prototype);return ze(l,"_invoke",function(n,r,o){var i,u,s,l=0,c=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,u=0,s=e,f.n=n,a}};function p(n,r){for(u=n,s=r,t=0;!d&&l&&!o&&t<c.length;t++){var o,i=c[t],p=f.p,h=i[2];n>3?(o=h===r)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(u=0,f.v=r,f.n=i[1]):p<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,f.n=h,u=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,h){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,h),u=c,s=h;(t=u<2?e:s)||!d;){i||(u?u<3?(u>1&&(f.n=-1),p(u,s)):f.n=s:f.v=s);try{if(l=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==a)break}catch(t){i=e,u=1,s=t}finally{l=1}}return{value:t,done:d}}}(n,o,i),!0),l}var a={};function u(){}function s(){}function l(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(ze(t={},r,function(){return this}),t),d=l.prototype=u.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,ze(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=l,ze(d,"constructor",l),ze(l,"constructor",s),s.displayName="GeneratorFunction",ze(l,o,"GeneratorFunction"),ze(d),ze(d,o,"Generator"),ze(d,r,function(){return this}),ze(d,"toString",function(){return"[object Generator]"}),(Re=function(){return{w:i,m:f}})()}function ze(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ze=function(e,t,n,r){function i(t,n){ze(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},ze(e,t,n,r)}function je(e,t,n){return t=(0,p.A)(t),(0,d.A)(e,(0,f.A)()?Reflect.construct(t,n||[],(0,p.A)(e).constructor):t.apply(e,n))}
21var He=y().$VipPopup,Ve=window,Ye=(Ve.pcAction,window),We=Ye.openWeb,Ge=Ye.appShare,Ue=P.R.WEB_SHOP_NOTE_EDIT_CACHE,qe="CommodityCombination",$e="PermissionBelongToStaff",Ke=(q=v.action.bound,$=D.Kj.withGetStorage({key:Ue}),K=v.action.bound,J=D.Kj.withGetStorage({key:Ue}),X=v.action.bound,Z=D.Kj.withSetStorage({key:Ue}),Fe=function(e){function t(){var e;(0,l.A)(this,t);for(var n=arguments.length,r=new Array(n),c=0;c<n;c++)r[c]=arguments[c];return e=je(this,t,[].concat(r)),(0,s.A)(e,"isHD",ee,e),(0,s.A)(e,"sceneId",te,e),(0,s.A)(e,"keyboardHeight",ne,e),(0,s.A)(e,"extraframeType",re,e),(0,s.A)(e,"showLinkDialog",oe,e),(0,s.A)(e,"showAppMoreDialog",ie,e),(0,s.A)(e,"isMasterAccount",ae,e),(0,s.A)(e,"isTeamAccount",ue,e),(0,s.A)(e,"showFromFrame",se,e),e.editorContext=null,(0,s.A)(e,"editorFocus",le,e),(0,s.A)(e,"editorAlreadyFocused",ce,e),(0,s.A)(e,"originNoteData",de,e),(0,s.A)(e,"mediaList",fe,e),(0,s.A)(e,"title",pe,e),(0,s.A)(e,"cover",he,e),(0,s.A)(e,"supplierSource",me,e),(0,s.A)(e,"customSource",ve,e),(0,s.A)(e,"lastAnonymous",ge,e),(0,s.A)(e,"showLevelSelectDialog",ye,e),(0,s.A)(e,"relations",be,e),e.importConfig={albumId:"",productId:"",sourceId:""},(0,s.A)(e,"pluginOperateConfig",we,e),e.pluginAddMediaConfig={pluginName:"",pluginId:""},(0,s.A)(e,"showCloudDriveIntercept",Ae,e),(0,s.A)(e,"cloudDriveInfo",ke,e),(0,s.A)(e,"isVip",Ce,e),(0,s.A)(e,"vipStatus",De,e),(0,s.A)(e,"layoutLevel",xe,e),(0,s.A)(e,"useLinkDecorate",Ee,e),(0,s.A)(e,"useAssociatedNoteExpand",Me,e),e.productDetailMap={},e.fromPage="",e.isSaveExit=!1,e.onResume=function(){try{(0,x.Mi)($e,function(t){if(t){var n=JSON.parse(t),r=n.staffInfoVOList,o=void 0===r?[]:r,i=(n.fromPage,(null===o||void 0===o?void 0:o[0])||{}),a=i.staffIcon,u=i.staffId,s=i.staffNick;e.handleUpdateAttributes({staffInfo:{staffIcon:a,staffId:u,staffNick:s}}),(0,x.qF)($e)}})}catch(t){}try{(0,x.Mi)(qe,function(t){if(t){var n=JSON.parse(t);e.handleUpdateAttributes({products:n}),e.handleUpdateProductDetail(n.map(function(e){return e.goods_id})),(0,x.qF)(qe)}})}catch(t){}try{(0,x.Mi)("collectionSelectedData",function(n){try{if(n=n?JSON.parse(n):null,n&&Array.isArray(n)){var r=e.attributes||{},o=r.collection;e.handleUpdateAttributes({collection:(0,u.A)((0,u.A)({},o),{},{data:n})}),(0,x.qF)("collectionSelectedData")}}catch(t){}})}catch(t){}},e.clean=function(){e.handleUnregisterWindowMessage()},e.destroy=function(){e.clean()},e.initRouterParams=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={albumId:"",noteId:"",noteType:I.GR.TYPE_NOTE,noteEditType:I.Bh.TYPE_PUBLISH,referrer_title:"",importConfig:{}};try{var r=t||{},o=r.params,i=void 0===o?{}:o,a=r.location,u=void 0===a?{}:a,s=i||{},l=s.albumId,c=void 0===l?"":l,d=s.noteId,f=void 0===d?"":d,p=(u||{}).query||{},h=p.action,m=p.noteType,v=void 0===m?I.GR.TYPE_NOTE:m,g=p.referrerTitle,y=void 0===g?"":g,b=p.referrer_title,w=void 0===b?"":b,A=p.albumId,k=void 0===A?"":A,C=p.productId,D=void 0===C?"":C,x=p.sourceId,E=void 0===x?"":x,M=p.sceneId,S=void 0===M?"":M,T=p.fromPage,P=void 0===T?"other":T;n.albumId=c,n.noteId=f,n.noteType=v,n.noteEditType=h||I.Bh.TYPE_PUBLISH,n.referrer_title=getPar("referrer_title")||w||y,n.sceneId=S||(0,B.ze)(),n.fromPage=P||"other",f&&!h&&(n.noteEditType=I.Bh.TYPE_FORWARD),n.noteEditType===I.Bh.TYPE_IMPORT&&(n.importConfig.albumId=k,n.importConfig.productId=D,n.importConfig.sourceId=E&&"null"!==E&&"undefined"!==E?E:"")}catch(_){}finally{e.setState(n)}},e.getStaffInfo=(0,a.A)(Re().m(function e(){var t,n,r,o,i;return Re().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,wgoo.$http.get("/team/api/v3/account/staff/getStaffInfo",{},{handleError:!1});case 1:if(t=e.v,n=t.errcode,r=t.result,o=void 0===r?{}:r,0===n){e.n=2;break}return e.a(2);case 2:return e.a(2,o);case 3:e.p=3,i=e.v,console.error(i);case 4:return e.a(2)}},e,null,[[0,3]])})),e.initAccountInfo=(0,a.A)(Re().m(function t(){var n,r,o,i,a,s,l,c,d,f,p,h,m,v;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:return n=!1,r=!1,t.p=1,t.n=2,e.getStaffInfo();case 2:a=t.v,s=a.staffNick,l=void 0===s?"":s,c=a.staffIcon,d=void 0===c?"":c,f=a.staffId,p=void 0===f?"":f,h=M().utils.resovleJwt()||{},m=h.masterAccount,v=void 0!==m&&m,n=!!p,r=v,!(e.isPublish||e.isForward||e.isImport)||null!==(o=e.attributes)&&void 0!==o&&null!==(i=o.staffInfo)&&void 0!==i&&i.staffId||e.setState({attributes:(0,u.A)((0,u.A)({},e.attributes),{},{staffInfo:{staffId:p,staffNick:l,staffIcon:d}})}),e.isPublish||e.isForward||e.isImport,t.n=4;break;case 3:t.p=3,t.v;case 4:e.setState({isTeamAccount:n,isMasterAccount:r});case 5:return t.a(2)}},t,null,[[1,3]])}
21)),e.initExtraConfigs=(0,a.A)(Re().m(function t(){var n,r,o,a,s,l,c,d,f,p,h,m,v;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:return t.p=0,t.n=1,Promise.all([(0,Le.BA)(),(0,Le.G6)(),(0,Y.Nc)()]);case 1:n=t.v,r=(0,i.A)(n,3),o=r[0],a=void 0===o?{}:o,s=r[1],l=void 0===s?{}:s,c=r[2],d=void 0!==c&&c,e.setState((0,u.A)((0,u.A)({},a),{},{wegoNoteConfig:(0,u.A)((0,u.A)({},e.wegoNoteConfig),l),lastAnonymous:d})),f=e,p=f.wegoNoteConfig,h=void 0===p?{}:p,m=h.draftInterval,v=void 0===m?1e3:m,e.handleSaveNoteEditDraft=(0,S.A)(function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e.isSaveExit||e.handleEditorDraft(t,n,r)},v),t.n=3;break;case 2:t.p=2,t.v;case 3:return t.a(2)}},t,null,[[0,2]])})),e.initCloudDriveInfo=(0,a.A)(Re().m(function e(){var t,n,r,o,i,a,u;return Re().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,(0,A.j)();case 1:return t=e.v,n=t||{},r=n.isGrayUser,o=void 0!==r&&r,i=n.usedRate,a=void 0!==i&&i,e.n=2,(0,D.s)("TimeForCapacityPopUp");case 2:return u=e.v,t.isCapacityOverflow=o&&a>=100,(!u||Number(u)<(new Date).getTime())&&(t.isCapacityLimit=o&&a>90&&a<100),e.a(2,t);case 3:return e.p=3,e.v,e.a(2,{})}},e,null,[[0,3]])})),e.initVipStatus=(0,a.A)(Re().m(function e(){var t,n,r,o;return Re().w(function(e){while(1)switch(e.p=e.n){case 0:return t={isVip:!1,vipStatus:0},e.p=1,e.n=2,wgoo.$http.get(k.W.getUserSvipInfoData,{},{handleError:!1});case 2:n=e.v,r=n.result,o=void 0===r?{}:r,t.isVip=[1,2,5,7].includes(o.vipStatus),t.vipStatus=o.vipStatus,e.n=4;break;case 3:e.p=3,e.v;case 4:return e.p=4,e.a(2,t);case 5:return e.a(2)}},e,null,[[1,3,4,5]])})),e.initLayoutLevel=(0,a.A)(Re().m(function t(){var n,r,o,i,a,u,s;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:if(t.p=0,n=e.selfAlbumId||"",n){t.n=1;break}return t.a(2,1);case 1:return t.n=2,wgoo.$http.post("/shop/api/v3/generalConfig/queryShopGeneralConfig",{parentKey:"NOTE_COLLECTION_LEVEL",shopId:n},{handleError:!1,throttle:!1});case 2:if(r=t.v,0!==r.errcode||!r.result||!r.result.configValue){t.n=4;break}if(o=r.result,i=o.configValue,a=o.defaultValueFlag,u=parseInt(i,10),!a){t.n=3;break}return t.a(2,0);case 3:if(!(u>=1&&u<=3)){t.n=4;break}return t.a(2,u);case 4:t.n=6;break;case 5:t.p=5,s=t.v,console.error("è·åå¸å±å±çº§é
置失败:",s);case 6:return t.a(2,1)}},t,null,[[0,5]])})),e.isExtraLoaded=!1,e.initExtraData=(0,a.A)(Re().m(function t(){var n,r,o,a,s,l,c,d,f,p,h,m,v,g=arguments;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:return n=g.length>0&&void 0!==g[0]&&g[0],r={isExtraLoaded:!0},t.p=1,t.n=2,Promise.all([(0,Le.yl)(),(0,Le.Fq)(),e.initCloudDriveInfo(),e.initVipStatus(),e.initLayoutLevel()]);case 2:o=t.v,a=(0,i.A)(o,5),s=a[0],l=void 0!==s&&s,c=a[1],d=void 0===c?[]:c,f=a[2],p=a[3],h=p.isVip,m=p.vipStatus,v=a[4],r=(0,u.A)((0,u.A)({},r),{},{isHD:l,relations:(d||[]).filter(function(e){return e.tagId>12}),cloudDriveInfo:f,isVip:h,vipStatus:m,layoutLevel:v}),t.n=4;break;case 3:t.p=3,t.v;case 4:return t.p=4,e.setState(r),n&&e.handleWegoNoteEditPV(),t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])})),e.initUserInfo=(0,a.A)(Re().m(function t(){var n,r,o,i,a,u,s,l;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:return t.p=0,t.n=1,(0,w.ug)();case 1:n=t.v,r=n.shop_id,o=n.shop_name,i=n.user_icon,a={},u=e,s=u.isPublish,l=u.isImport,e.albumId||(a.albumId=r),(s||l)&&(a.album={albumId:r,albumName:o,albumIcon:i},a.targetAlbum=a.album),a.myAlbumId=r,e.setState(a),t.n=3;break;case 2:t.p=2,t.v;case 3:return t.a(2)}},t,null,[[0,2]])})),e.initCollectionCacheData=(0,a.A)(Re().m(function t(){var n,r,i,a,s,l,c,d,f,p,h;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:return t.p=0,n=e,r=n.selfAlbumId,i=n.attributes,t.n=1,(0,O.cN)(r);case 1:if(a=t.v,a&&0!==a.length){t.n=2;break}return t.a(2);case 2:if(s=i||{},l=s.collection,c=void 0===l?{}:l,d=c||{},f=d.cacheCollections,p=void 0===f?[]:f,h=p.some(function(e){return"cache"===e.collectionType}),!h){t.n=3;break}return t.a(2);case 3:e.setState({attributes:(0,u.A)((0,u.A)({},i),{},{collection:(0,u.A)((0,u.A)({},c),{},{cacheCollections:[].concat((0,o.A)(p),[{collectionType:"cache",collections:a}])})})}),t.n=5;break;case 4:t.p=4,t.v;case 5:return t.a(2)}},t,null,[[0,4]])})),e.initAttributesAnonymous=function(){try{var t=e,n=t.isEdit,r=t.isCopy,o=t.lastAnonymous,i=t.attributes,a=i||{},s=a.anonymous,l=void 0!==s&&s;if(n||r)return;e.setState({attributes:(0,u.A)((0,u.A)({},i),{},{anonymous:o||l})})}catch(c){}},e.initNoteImageSpace=(0,a.A)(Re().m(function t(){var n,r,o,i;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:if(t.p=0,n=e,r=n.isPublish,o=n.isImport,r||o){t.n=1;break}return t.a(2);case 1:return t.n=2,(0,O.YO)();
21case 2:i=t.v,e.setState({imgSpace:i}),t.n=4;break;case 3:t.p=3,t.v;case 4:return t.a(2)}},t,null,[[0,3]])})),e.initNessaryExtraData=(0,a.A)(Re().m(function t(){return Re().w(function(t){while(1)switch(t.p=t.n){case 0:return t.p=0,e.initAttributesAnonymous(),t.n=1,e.initUserInfo();case 1:e.initCollectionCacheData(),t.n=3;break;case 2:t.p=2,t.v;case 3:return t.a(2)}},t,null,[[0,2]])})),e.handleGetNoteTitle=function(){var t=e,n=t.title;return n?n.value:""},e.getNoteEditTrackParams=function(){var t=e,n=t.vipStatus,r=t.referrer_title,o=t.trackNoteType;return{style:o,referrer_title:r,vip_status:"".concat(n)}},e.handleWegoNoteEditPV=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=e,r=n.showLoading,o=n.showError,i=n.isExtraLoaded,a=n.isProductNote;if(!r&&!o&&i){var s=t;t||(s=a?"å徿":"åç¬è®°ç¬¬1æ¥"),(0,V.ls)((0,u.A)({page_name:s},e.getNoteEditTrackParams()))}},e.handleWegoNoteEdiTrackEvent=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";t&&n&&(0,V.NQ)((0,u.A)({page_name:t,element_name:n},e.getNoteEditTrackParams()))},e.handleNotePublishErrorTrack=function(){var t=e,n=t.albumId,r=t.noteId,o=t.imageMediaCount,i=t.videoMediaCount,a=t.trackNoteType;(0,V.$Q)({style:a,img_num:o,video_num:i,note_status:"åå¸å¤±è´¥",note_id:r,shop_id:n})},e.handleEditResumeData=(0,a.A)(Re().m(function t(){var n,r,o,a,u,s,l;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:return t.p=0,t.n=1,Promise.all([e.initVipStatus(),(0,Le.Fq)()]);case 1:n=t.v,r=(0,i.A)(n,2),o=r[0],a=o.isVip,u=o.vipStatus,s=r[1],l=void 0===s?[]:s,e.setState({isVip:a,vipStatus:u,relations:(l||[]).filter(function(e){return e.tagId>12})}),t.n=3;break;case 2:t.p=2,t.v;case 3:return t.a(2)}},t,null,[[0,2]])})),e.handleEditorContext=function(t){try{e.editorContext=t}catch(n){}},(0,s.A)(e,"handleAppAddUploadMedias",Se,e),(0,s.A)(e,"handleAppUpdateUploadMedias",Te,e),e.handleAppUpdateEditorContent=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];try{if(!t||!t.length)return;var n=t.filter(function(t){return e.mediaList.some(function(e){return e.mediaId===t.mediaId})}).filter(function(e){return!!e.mediaUrl});if(!n||!n.length)return;var r=window.location.hash;if(r.includes("album/note/note_edit/"))setTimeout(function(){window.dispatchEvent(new CustomEvent(L.nQ,{detail:{medias:n}}))},300);else{var o=e,i=o.editorContent,a=(0,W.f3)((0,v.toJS)(i),n);e.setState({editorContent:a})}}catch(u){}},e.handleInitEditorTitleData=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{if(!t)return;var r=n.title,o=n.customTitle;e.setState({title:{value:r||"",custom:1==o}})}catch(i){}},e.handleInitEditorCoverData=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{if(!t)return;var r=n.cover,o=n.customCover;if(!r)return;if(1==o)return void e.setState({cover:{value:r,custom:!0}});var i=(0,H.lg)((0,v.toJS)(t),r),a=i.pluginId,u=i.index;if(a&&u>=0){var s=(0,W.mq)(t);e.setState({cover:{pluginId:a,index:u,value:r,custom:!1,pluginCustom:a!==s.pluginId||u>0}})}else e.setState({cover:{value:r,custom:!0}})}catch(l){}},e.handleEditorContentUpdate=function(t,n){e.setState({editorContent:t,editorText:n});var r=e,o=r.albumId,i=r.isPublish,a=r.cover,u=r.attributes;e.handleEditorChangeNoteTitle((0,W.rb)((0,v.toJS)(t)));var s=(0,W.Ys)(t);s&&s.length?e.isEditorContentContainCover()&&(a.pluginCustom||a.custom)?e.handleCalibrationNoteCover():e.handleEditorChangeNoteCover((0,W.mq)((0,v.toJS)(t))):e.handleEditorChangeNoteCover({pluginId:"",index:0,value:""}),i&&e.handleSaveNoteEditDraft(o,I.GR.TYPE_NOTE,{content:t,editorText:n,title:e.title,cover:e.cover,attributes:u})},e.handleGetUnUploadedMedias=function(){var t=[];try{var n=e,r=n.sceneId,o=n.isPublish,i=n.isProductNote,a=n.editorContent,s=n.productContent;if(!b.YB||!o)return;if(t=i?(0,v.toJS)(s.medias||[]):(0,W.Ys)(a),!t||!t.length)return;t=t.filter(function(e){return!e.mediaUrl}).map(function(e){return(0,u.A)((0,u.A)({},e),{},{sceneId:r})})}catch(l){}finally{return t}},e.handleImportNoteFromWegoProducts=(0,a.A)(Re().m(function t(){var n,r,o,i,a,s,l,c,d,f,p,h,m,v,g,y,b,w,A,k,C,D,x,E,M,S,T,_,N,O;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:if(n={showLoading:!1,noteType:I.GR.TYPE_NOTE,noteEditType:I.Bh.TYPE_IMPORT},t.p=1,r=e,o=r.albumId,i=r.importConfig,a=[],i.productId?(o=i.albumId,a=[i.productId]):(a=localStorage.getItem(P.R.WEB_SHOP_NOTE_IMPORT_CACHE),localStorage.removeItem(P.R.WEB_SHOP_NOTE_IMPORT_CACHE)),a){t.n=2;break}return n.noteEditType=I.Bh.TYPE_PUBLISH,n.showError=!0,n.errMsg="ç¬è®°ä¸åå¨",t.a(2);case 2:return s="string"===typeof a?JSON.parse(a):a,t.n=3,(0,Y.pQ)(o,s);case 3:if(l=t.v,l&&0!==l.length){t.n=4;break}return n.noteEditType=I.Bh.TYPE_PUBLISH,n.showError=!0,n.errMsg="ç¬è®°ä¸åå¨",t.a(2);case 4:c=e,d=c.wegoNoteConfig,f=d.maxImageCount,p=d.maxVideoCount,h=d.maxTextLength,m=(0,H.i1)({list:l,maxImageCount:f,maxVideoCount:p,maxTextLength:h-1e3,sourceId:i.sourceId}),v=m.editorTitle,g=m.editorContent,y=m.editorText,b=m.visibilityType,w=void 0===b?0:b,A=m.supplierSource,k=void 0===A?"":A,C=m.customSource,D=void 0===C?{}:C,x=m.fromData,E=void 0===x?{}:x,M=m.products,S=void 0===M?[]:M,T=m.isOverflowText,_=m.isOverflowImage,N=m.isOverflowVideo,n.editorContent=g,n.editorText=y,n.supplierSource=k,n.customSource=D,n.attributes={permissionConfig:{permission:w},products:S.map(function(e){return{goods_id:e,title:"",commodityCover:""}}),fromData:E},v&&(n.title={value:v,custom:!1}),O=(0,W.mq)(g),O&&O.value&&(n.cover=(0,u.A)((0,u.A)({},O),{},{custom:!1})),_||N?wgoo.$toast({title:"æå¤æ·»å ".concat(_?"".concat(f,"å¼ å¾ç"):"").concat(N?"".concat(p,"个è§é¢"):"")}):T&&wgoo.$toast({title:"æå¤è¾å
¥".concat(h,"å符")}),t.n=6;break;case 5:t.p=5,t.v;case 6:return t.p=6,e.setState(n),t.f(6);case 7:return t.a(2)}},t,null,[[1,5,6,7]])})),e.handleEditorFocusFirstEnd=function(){try{var t=e,n=t.editorAlreadyFocused,r=t.editorContext;if(n)return;r.commands.focus("end")}catch(o){}},e.handleEditorFocusChange=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t&&e.setState({editorAlreadyFocused:!0}),e.setState({editorFocus:t})},e.handleChangeEditorCover=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;try{if(!t||n<0)return;var r=e,o=r.cover,i=o||{},a=i.custom,s=i.pluginId,l=i.index;if(a||t!==s)return;if(n>l)return;n===l?e.setState({cover:{pluginId:"",index:0,value:"",custom:!1}}):n<l&&e.setState({cover:(0,u.A)((0,u.A)({},o),{},{index:l-1})})}catch(c){}},e.handleShowPluginModifyResource=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.pluginId,r=void 0===n?"":n,o=t.pluginName,i=void 0===o?"":o,a=t.index,u=void 0===a?0:a,s=t.resource,l=void 0===s?{}:s;try{var c,d;if(e.setState({pluginOperateConfig:{pluginId:r,pluginName:i,index:u,resource:l}}),window.history.pushState(null,"",window.location.href),e.handleChangeExtraframeType(I.Il.TYPE_RESOURCE),b.YB&&e.editorContext)null===(c=e.editorContext.commands)||void 0===c||null===(d=c.blur)||void 0===d||d.call(c)}catch(f){}},e.handleShowProductSelection=function(){window.history.pushState(null,"",window.location.href),e.handleChangeExtraframeType(I.Il.TYPE_PRODUCT)},e.handleShowNoteSelection=function(){window.history.pushState(null,"",window.location.href),e.handleChangeExtraframeType(I.Il.TYPE_NOTE)},e.handleUpdatePluginOperateConfig=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setState({pluginOperateConfig:(0,u.A)((0,u.A)({},e.pluginOperateConfig),t)})},e.handleResetPluginOperateConfig=function(){e.setState({pluginOperateConfig:{pluginId:"",pluginName:"",index:0,resource:{}}})},e.handleSavePluginAddMediaConfig=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";e.setState({pluginAddMediaConfig:{pluginName:t,pluginId:n}})},e.handleResetPluginAddMediaConfig=function(){e.setState({pluginAddMediaConfig:{pluginName:"",pluginId:""}})},e.handleShowLinkResourceDialog=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.pluginId,r=void 0===n?"":n,o=t.pluginName,i=void 0===o?F.zM.TYPE_LINK:o,a=t.index,u=void 0===a?0:a,s=t.resource,l=void 0===s?{}:s;try{if(e.showLinkDialog)return;e.setState({showLinkDialog:!0,pluginOperateConfig:{pluginId:r,pluginName:i,index:u,resource:l}});var c,d,f=e,p=f.editorFocus;if(b.YB&&e.editorContext&&p)null===(c=e.editorContext.commands)||void 0===c||null===(d=c.blur)||void 0===d||d.call(c)}catch(h){}},e.handleShowPermissionSelection=function(){window.history.pushState(null,"",window.location.href),e.handleChangeExtraframeType(I.Il.TYPE_PERMISSION)},e.handleHideLinkResourceDialog=function(){e.setState({showLinkDialog:!1})},e.handleShowAppMoreDialog=function(){e.setState({showAppMoreDialog:!0})},e.handleHideAppMoreDialog=function(){e.setState({showAppMoreDialog:!1})},e.handleHideCloudDriveIntercept=function(){var t=e,n=t.showCloudDriveIntercept;
21n&&e.setState({showCloudDriveIntercept:!1,cloudDriveInfo:(0,u.A)((0,u.A)({},e.cloudDriveInfo),{},{isCapacityLimit:!1})})},e.handleChangeExtraframeType=function(t){e.extraframeType!==t&&e.setState({extraframeType:t})},e.handleResetExtraframeType=function(){e.handleChangeExtraframeType(I.Il.TYPE_NONE)},e.handleEditorChangeNoteTitle=function(t){var n=e.title,r=n.value,o=n.custom;r&&o||e.setState({title:{value:t,custom:!1}})},e.isEditorContentContainCover=function(){try{var t=e,n=t.editorContent,r=t.cover;return!(null===r||void 0===r||!r.custom)||!!r.pluginId&&n.content.some(function(e){return!!(0,z.zi)(e)&&e.attrs.pluginId===r.pluginId})}catch(o){return!1}},e.handleCalibrationNoteCover=function(){try{var t=e,n=t.editorContent,r=t.cover,o=r.custom,i=r.pluginId,a=r.index,u=r.value;if(o||!i)return;var s=n.content.find(function(e){return e.attrs.pluginId===i});if(!s)return;var l=s.attrs.data;if(!u){var c="";if((0,v.isArrayLike)(l)){if(l.length>a){var d=(0,R.iZ)(l[a]);c=d.mediaCoverUrl||d.mediaUrl}}else{var f=(0,R.iZ)(l);c=f.mediaCoverUrl||f.mediaUrl}c&&e.handleEditorChangeNoteCover({pluginId:i,index:a,value:c})}if(!(0,v.isArrayLike)(l)||0===l.length)return;var p=e.cover.value,h=(0,B._W)(p),m=(0,R.iZ)(l[a]),g=m.mediaCoverUrl||m.mediaUrl;if(p&&g.includes(h))return;var y=l.findIndex(function(e){var t=(0,R.iZ)(e),n=t.mediaCoverUrl||t.mediaUrl;return n===p});e.handleEditorChangeNoteCover({pluginId:i,index:y})}catch(b){}},e.handleEditorChangeNoteCover=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.cover,o=r.value,i=r.custom;o&&i&&!n||e.setState({cover:(0,u.A)((0,u.A)((0,u.A)({},e.cover),t),{},{custom:!1})})},e.handleEditorMediaEditCoverChange=function(t){try{var n=(0,W.Pv)((0,v.toJS)(e.editorContent),t.mediaId),r=n.pluginId,o=n.index;if(!r||o<0)return;var i=e.cover,a=i.pluginId,s=i.index,l=i.custom;if(l)return;if(a!==r||s!==o)return;var c=t.mediaCoverUrl||t.mediaUrl;e.setState({cover:(0,u.A)((0,u.A)({},e.cover),{},{value:c})})}catch(d){}},e.handleEditorAppMediaReceiveChange=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];try{if(!t||!t.length)return;var n=e.cover,r=n.pluginId,o=n.index,i=n.custom;if(i)return;var a=t.filter(function(e){return!!e.mediaUrl}),s=(0,W.bV)((0,v.toJS)(e.editorContent),a.map(function(e){return e.mediaId})),l=s.find(function(e){return e.pluginId===r&&e.index===o});if(!l||!l.media)return;var c=a.find(function(e){return e.mediaId===l.media.mediaId});e.setState({cover:(0,u.A)((0,u.A)({},e.cover),{},{value:c.mediaCoverUrl||c.mediaUrl,custom:!1})})}catch(d){}},e.handleChangeNoteTitle=function(t){e.setState({title:{value:t,custom:!0}}),e.isPublish&&e.handleSaveNoteEditDraft(e.albumId,I.GR.TYPE_NOTE,{content:e.editorContent,editorText:e.editorText,title:e.title,cover:e.cover,attributes:e.attributes})},e.handleChangeNoteCover=function(t){t&&(e.setState({cover:{pluginId:"",index:0,value:t,custom:!0,pluginCustom:!1}}),e.isPublish&&e.handleSaveNoteEditDraft(e.albumId,I.GR.TYPE_NOTE,{content:e.editorContent,editorText:e.editorText,title:e.title,cover:e.cover,attributes:e.attributes}))},e.handleEditorDraft=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{var o=e,i=o.hasContent;i?(0,O.nQ)(t,n,r):(0,O.t4)(t,n)}catch(a){}},e.handleSaveNoteEditDraft=(0,S.A)(function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e.isSaveExit||e.handleEditorDraft(t,n,r)},1e3),e.handleUpdateProductContent=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setState({productContent:(0,u.A)((0,u.A)({},e.productContent),t)});var n=e,r=n.isPublish,o=n.albumId,i=n.noteType,a=n.productContent,s=void 0===a?{}:a,l=n.title,c=n.cover,d=n.attributes;r&&e.handleSaveNoteEditDraft(o,i,{content:s,title:l,cover:c,attributes:d})},e.handleUpdateAttributes=function(t){if(t){e.setState({attributes:(0,u.A)((0,u.A)({},e.attributes),t)});var n=e,r=n.isPublish,o=n.isProductNote,i=n.albumId,a=n.noteType,s=n.editorText,l=n.editorContent,c=n.productContent,d=void 0===c?{}:c,f=n.title,p=n.cover,h=n.attributes;r&&e.handleSaveNoteEditDraft(i,a,o?{content:d,attributes:h}:{content:l,editorText:s,title:f,cover:p,attributes:h})}},e.handleGetCanUploadMediaCount=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r={imageCount:1,videoCount:0,maxImageCount:180,maxVideoCount:20};try{var o=e,i=o.imageMediaCount,a=o.videoMediaCount,u=o.isMediaOverMaxCount,s=o.editorContent,l=o.wegoNoteConfig,c=o.isProductNote,d=l||{},f=d.maxImageCount,p=void 0===f?180:f,h=d.maxVideoCount,m=void 0===h?20:h;if(r.maxImageCount=p,r.maxVideoCount=m,u)return void(r.imageCount=0);var v=p-i,g=m-a;if(c)r.imageCount=v,r.videoCount=g;else{if(t===F.zM.TYPE_SLIDE&&(r.maxImageCount=v>=F.Bn?F.Bn:p,r.maxVideoCount=0),!t||!F.c9.includes(t))return void(r.imageCount=0);if(n&&t===F.zM.TYPE_SLIDE){var y=s.content.find(function(e){var t;return(null===(t=e.attrs)||void 0===t?void 0:t.pluginId)===n});if(!y)return void(r.imageCount=0);r.imageCount=Math.min(F.Bn-y.attrs.data.length,v)}else t===F.zM.TYPE_SLIDE?r.imageCount=Math.min(F.Bn,v):(r.imageCount=v,r.videoCount=g)}}catch(b){}finally{return r}},e.handleWegoNoteEditPreviewAction=function(){window.location.href="#/album/note/note_edit_preview"},e.handleUpdateImageSpace=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t!==e.imgSpace&&e.setState({imgSpace:t})},e.handleProducts=function(){var t=e,n=t.attributes,r=void 0===n?{}:n,o=t.selfAlbumId,i=t.noteEditType,a=(t.isProductNote,r.products),u=void 0===a?[]:a;(0,x.OI)(qe,JSON.stringify(u)),e.saveSessionStorage();var s=i===I.Bh.TYPE_PUBLISH?"åå¸":i===I.Bh.TYPE_EDIT?"ç¼è¾":"转å",l="?t=".concat(Date.now(),"&navigatorType=2#/album/bundle_purchase/").concat(o,"?referrer_title=").concat(s,"&maxSelectCount=30&title=éæ©äº§å"),c=isMobile.AppIOS()?"":"/",d="".concat(c,"static/index.html").concat(l);b.YB?Ge(84,{url:d,preNavStyle:{backButton:{type:"image",name:"e625"},navStype:"pop"}}):window.location.href=l},e.handleFromData=function(){e.setState({showFromFrame:!0}),history.pushState(null,"",location.href)},(0,s.A)(e,"handleChangeLevel",Pe,e),(0,s.A)(e,"handleCollection",_e,e),e.handleCollectionSelected=function(){var t=e,n=t.selfAlbumId,r=t.attributes,o=void 0===r?{}:r,i=t.trackNoteType,a=o.collection,u=void 0===a?{}:a,s=o.collections,l=void 0===s?{}:s,c=l.data&&l.data.length>0?l.data:u.data||[];if(c&&c.length>0&&(0,x.OI)("collectionSelectedData",JSON.stringify(c)),e.saveSessionStorage(),b.vE)We("?referrer_title=".concat(i,"#/album/collection/").concat(n,"?referrer_title=").concat(i));else{var d="?t=".concat(Date.now(),"&navigatorType=2&referrer_title=").concat(i,"#/album/collection/").concat(n,"?referrer_title=").concat(i,"&createNoteNewEntry=false");if(b.YB){var f=isMobile.AppIOS()?"":"/",p="".concat(f,"static/index.html").concat(d);Ge(84,{url:p,preNavStyle:{backButton:{type:"image",name:"e625"},navStype:"pop"}})}else window.location.href=d}},(0,s.A)(e,"handleShowLevelSelectDialog",Ie,e),(0,s.A)(e,"handleCloseLevelSelectDialog",Ne,e),(0,s.A)(e,"handleConfirmLevelSelect",Oe,e),e.handleDelProducts=function(t){e.setState({attributes:(0,u.A)((0,u.A)({},e.attributes),{},{products:t})});var n=e,r=n.isPublish,o=n.isProductNote,i=n.albumId,a=n.noteType,s=n.editorText,l=n.editorContent,c=n.productC
21ontent,d=void 0===c?{}:c,f=n.title,p=n.cover,h=n.attributes;r&&e.handleSaveNoteEditDraft(i,a,o?{content:d,editorText:s,title:f,cover:p,attributes:(0,u.A)((0,u.A)({},h),{},{products:t})}:{content:l,title:f,cover:p,attributes:(0,u.A)((0,u.A)({},h),{},{products:t})})},e.handleEmployee=function(){var t=e,n=t.attributes,r=void 0===n?{}:n,o=(t.albumId,t.noteEditType),i=r.staffInfo,a=void 0===i?{}:i,u=a.staffId,s=o===I.Bh.TYPE_PUBLISH?"åå¸":o===I.Bh.TYPE_EDIT?"ç¼è¾":"转å";if(e.isMasterAccount)e.getToStaff();else if(e.isTeamAccount)0;else{0;var l="?navigatorType=2#/team/member/list?referrer_function=teamManagement&referrer_title=".concat(s),c=isMobile.AppIOS()?"":"/",d="".concat(c,"static/index.html").concat(l);isMobile.WegoAlbumPC()?We("#/team/member/list?referrer_function=teamManagement&referrer_title=".concat(s)):b.YB?(e.saveSessionStorage(),Ge(84,{url:d,preNavStyle:{backButton:{type:"image",name:"e625"},navStype:"pop"}})):(e.saveSessionStorage(),window.location.href=l)}},e.getToStaff=function(){var t=e,n=t.attributes,r=void 0===n?{}:n,o=(t.noteEditType,r.staffInfo),i=void 0===o?{}:o,a=i.staffId,u=i.staffNick,s=i.staffIcon,l={staffInfoVOList:[{staffIcon:s,staffId:a,staffNick:u}],fromPage:"note_edit"},c="#/customer/choice-staff?selectType=single&cacheKey=".concat($e);a&&(0,x.OI)($e,JSON.stringify(l)),isMobile.WegoAlbumPC()?We(c):(e.saveSessionStorage(),window.location.href=c)},e.handleKeyboardHeightChange=(0,S.A)(function(t){try{if(!b.du)return;var n=t.detail||{},r=n.keyboardHeight;e.setState({keyboardHeight:r})}catch(o){}},200),e.handleSimulateKeyboardHeight=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:365;b.du&&e.setState({keyboardHeight:t})},e.handleWegoAttributeBubbleAction=function(t,n){switch(t){case"collection":var r=e,o=r.attributes,i=void 0===o?{}:o,a=i||{},s=a.collection,l=void 0===s?{}:s;e.setState({attributes:(0,u.A)((0,u.A)({},i),{},{collection:(0,u.A)((0,u.A)({},l),{},{data:n.collections})})});break;default:break}},e.handleWegoAttributeBubbleClose=function(t){switch(t){case"collection":var n=e,r=n.selfAlbumId,o=n.attributes,i=void 0===o?{}:o,a=i||{},s=a.collection,l=void 0===s?{}:s;e.handleUpdateAttributes({collection:(0,u.A)((0,u.A)({},l),{},{cacheCollections:[]})}),(0,O.St)(r);break;default:break}},e.handleNotePageResume=function(){var n=e,r=n.pluginOperateConfig,o=void 0===r?{}:r,i=o||{},a=i.event,u=i.resource,s=void 0===u?{}:u,l=s||{},c=l.resId,d=void 0===c?"":c;if(d)switch(a){case t.SPECIAL_EVENT_TYPE.EVENT_EDIT_PRODUCT:setTimeout(function(){e.handleUpdateProductDetail([d],!0)},1e3),e.handleResetPluginOperateConfig();break;case t.SPECIAL_EVENT_TYPE.EVENT_EDIT_NOTE:setTimeout(function(){e.handleUpdateNoteDetail([d],!0)},1e3),e.handleResetPluginOperateConfig();break;default:break}},e.handlePCClientSyncData=function(e){try{var t=e.type,n=(e.dataType,e.content);if(!t||!n)return;switch(t){case"update":break;case"delete":break}}catch(r){}},e.handleEditorAddMediaTrack=function(t){try{var n="æ·»å 大å¾";switch(t){case F.zM.TYPE_IMAGE:break;case F.zM.TYPE_GRID:n="æ·»å å°å¾";break;case F.zM.TYPE_SLIDE:n="æ·»å æ»å¨å¾";break;default:break}e.handleWegoNoteEdiTrackEvent("åç¬è®°ç¬¬1æ¥",n)}catch(r){}},e.handleEditorAddNewMedias=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];try{var n=e,r=n.editorContext,o=n.pluginAddMediaConfig,i=void 0===o?{}:o,a=n.handleEditorFocusFirstEnd;if(t.length,!t||!t.length)return;var u=i||{},s=u.pluginName,l=u.pluginId;if(!r||!s)return;a(),l||e.handleEditorAddMediaTrack(s),(0,W.o5)({editor:r,pluginName:s,pluginId:l,medias:t}),e.handleResetPluginAddMediaConfig()}catch(c){}},e.handleEditorCopyHtmlUrlMedias=(0,a.A)(Re().m(function t(){var n,r,o,i,a,s,l,c,d,f,p,h,m,g,y,b,w,A,k,C,D,x,E=arguments;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:if(n=E.length>0&&void 0!==E[0]?E[0]:[],r=E.length>1&&void 0!==E[1]?E[1]:[],t.p=1,r&&r.length>0&&(s=e,l=s.editorContent,c=(0,u.A)((0,u.A)({},l),{},{content:l.content.filter(function(e){return!r.some(function(t){return t.pluginId===e.attrs.pluginId})})}),e.setState({editorContent:c}),null===(o=e.editorContext)||void 0===o||null===(i=o.commands)||void 0===i||null===(a=i.setContent)||void 0===a||a.call(i,(0,v.toJS)(e.editorContent)),wgoo.$toast({title:"éæ©æä»¶è¶
åºæ°éï¼è¶
åºé¨åå°æ·»å 失败"})),!(n&&n.length>0)){t.n=8;break}d=[],f=[],p=0;case 2:if(!(p<n.length)){t.n=7;break}if(wgoo.$loading.show({title:"æ£å¨ä¸ä¼ ".concat(p+1,"/").concat(n.length)}),h=n[p],m=h.mediaUrl,m&&m.includes("http")){t.n=3;break}return t.a(3,6);case 3:return t.n=4,(0,Le.Fd)(m);case 4:if(g=t.v,y=g.result,b=g.errmsg,w=g.mediaInfo,y){t.n=5;break}return wgoo.$toast({title:b}),f.push(h),t.a(3,6);case 5:A=w||{},k=A.width,C=A.height,D=A.size,x=A.url,d.push((0,u.A)({mediaType:h.mediaType,mediaId:h.mediaId,mediaWidth:k,mediaHeight:C,mediaSize:D,mediaUrl:x},h.mediaType===_.Ap.TYPE_VIDEO&&{mediaCoverUrl:x+_.KW}));case 6:p++,t.n=2;break;case 7:d&&d.length>0&&window.dispatchEvent(new CustomEvent(L.nQ,{detail:{medias:d}})),f&&f.length>0&&window.dispatchEvent(new CustomEvent(L.P$,{detail:{medias:f}}));case 8:t.n=10;break;case 9:t.p=9,t.v;case 10:return t.p=10,wgoo.$loading.hide(),t.f(10);case 11:return t.a(2)}},t,null,[[1,9,10,11]])})),e.handleAppNoteTypeReceiveMediaEdit=function(t){try{t.detail;var n=t.detail;if(!n)return;n&&"string"===typeof n&&(n=JSON.parse(n));var r=n,o=r.mediaInfo;if(!o||!o.mediaId)return;o.mediaType===_.Ap.TYPE_IMAGE&&(o.mediaCoverUrl=""),e.handleEditorMediaEditCoverChange(o),window.dispatchEvent(new CustomEvent(L.nQ,{detail:{medias:[o],useHistory:!0}})),Ge(376,{isSuccess:1,errorInfo:"",mediaInfo:(0,u.A)({},o)})}catch(i){}},e.handleAppProducTypeReceiveMediaEdit=function(t){try{var n=t.detail;if(!n)return;n&&"string"===typeof n&&(n=JSON.parse(n));var r=n,o=r.mediaInfo;if(!o||!o.mediaId)return;o.mediaType===_.Ap.TYPE_IMAGE&&(o.mediaCoverUrl="");
21var i=e.productContent||{},a=i.medias;if(!a||!a.length)return;var s=(0,D.o8)(a),l=s.find(function(e){return e.mediaId===o.mediaId});if(!l)return;e.handleUpdateProductContent({medias:s.map(function(e){return e.mediaId===o.mediaId?(0,u.A)((0,u.A)({},e),o):e})}),Ge(376,{isSuccess:1,errorInfo:"",mediaInfo:(0,u.A)({},o)})}catch(c){}},e.handleAppNoteTypeReceiveMedias=function(t){try{t.detail;var n=e,r=n.mediaList,o=void 0===r?[]:r,i=t.detail||{},a=i.mediaList;if(!a||!a.length)return;var u=a.filter(function(e){return!o.some(function(t){return t.mediaId===e.mediaId})}),s=a.filter(function(e){var t=o.find(function(t){return t.mediaId===e.mediaId});if(!t)return!1;var n=[_.Ap.TYPE_VIDEO,_.Ap.TYPE_LIVE];return n.includes(t.mediaType)&&!t.mediaCoverUrl||!t.mediaUrl});u&&u.length>0&&(u.length,e.handleAppAddUploadMedias(u),e.handleEditorAddNewMedias(u)),s&&s.length&&(s.length,e.handleEditorAppMediaReceiveChange(s),e.handleAppUpdateUploadMedias(s),e.handleAppUpdateEditorContent(s))}catch(l){}},e.handleAppProducTypeReceiveMedias=function(t){try{t.detail;var n=t.detail||{},r=n.mediaList;if(!r||!r.length)return;var i,a=e,s=a.mediaList,l=a.productContent,c=l||{},d=c.medias,f=s&&s.length?s:d,p=r.filter(function(e){return!f.some(function(t){return t.mediaId===e.mediaId})}),h=r.filter(function(e){var t=f.find(function(t){return t.mediaId===e.mediaId});if(!t)return!1;var n=[_.Ap.TYPE_VIDEO,_.Ap.TYPE_LIVE];return n.includes(!t.mediaType)&&!t.mediaCoverUrl||!t.mediaUrl}),m=(0,D.o8)(d);if(p&&p.length>0)(i=m).push.apply(i,(0,o.A)(p.map(function(e){return(0,u.A)({},e)}))),e.handleAppAddUploadMedias(p);h&&h.length&&(e.handleAppUpdateUploadMedias(h),m=m.map(function(e){var t=h.find(function(t){return t.mediaId===e.mediaId});return!t||t.mediaUrl,(0,u.A)((0,u.A)({},e),t)})),e.handleUpdateProductContent({medias:m})}catch(v){}},e.handleCommonWindowMessage=function(t){try{var n=t.data,r=n.type,o=n.data;switch(r){case"onPageResume":e.handleNotePageResume(),e.handleEditResumeData();break;case"sync_data":e.handlePCClientSyncData(o);break}}catch(i){}},e.handlePopStateMessage=function(){e.handleResetExtraframeType(),e.setState({showFromFrame:!1})},e.handleSaveFrom=function(t){try{var n,r,o,i=t||(null===(n=window.fromComponent)||void 0===n?void 0:n._onSave())||[],a=i[0]||{},u=a.tagId,s=void 0===u?"":u,l=a.tagName,c=void 0===l?"":l,d=a.sourceParentAlbumId,f=void 0===d?"":d,p=a.sourceParentAlbumName,h=void 0===p?"":p,m=a.supplierType,v="followFriends"===m||f,g=!!c&&!v,y={sources:i,parent_album_id:f||(null===(r=i[0])||void 0===r?void 0:r.tagId),parent_album_name:h||(null===(o=i[0])||void 0===o?void 0:o.tagName),customSource:g?{sourceId:s,sourceName:c}:void 0};e.handleUpdateAttributes({fromData:y}),e.setState({supplierSource:f,customSource:g?{sourceId:s,sourceName:c}:{},showFromFrame:!1}),!b.YB&&history.back()}catch(w){e.setState({showFromFrame:!1})}},e.handleCloseFromFrame=function(t){try{e.setState({showFromFrame:!1}),!t&&history.back()}catch(n){}},e.handlePluginDeleteItemMessage=function(t){try{t.detail;var n=t.detail||{},r=n.pluginId,o=void 0===r?"":r,i=n.index,a=void 0===i?0:i;e.handleChangeEditorCover(o,a)}catch(u){}},e.handlePluginSwapItemMessage=function(t){try{var n=t.detail||{},r=n.pluginId,o=void 0===r?"":r,i=n.fromIndex,a=void 0===i?0:i,s=n.toIndex,l=void 0===s?0:s,c=e,d=c.cover;if(d.custom||o!==d.pluginId)return;if(a<0||l<0||a===l)return;d.index===a?e.setState({cover:(0,u.A)((0,u.A)({},d),{},{index:l})}):d.index===l&&e.setState({cover:(0,u.A)((0,u.A)({},d),{},{index:a})})}catch(f){}},e.handlePluginModifyResourceMessage=function(t){try{t.detail;var n=t.detail||{},r=n.pluginId,o=void 0===r?"":r,i=n.pluginName,a=void 0===i?"":i,u=n.index,s=void 0===u?0:u,l=n.resource,c=void 0===l?{}:l;if(!o||!a)return;e.handleShowPluginModifyResource({pluginId:o,pluginName:a,index:s,resource:c})}catch(d){}},e.handlePluginModifyLinkMessage=function(t){try{t.detail;var n=t.detail||{},r=n.pluginId,o=void 0===r?"":r,i=n.pluginName,a=void 0===i?"":i,u=n.index,s=void 0===u?0:u,l=n.resource,c=void 0===l?{}:l;if(!o||!a)return;e.handleShowLinkResourceDialog({pluginId:o,pluginName:a,index:s,resource:c})}catch(d){}},e.handlePluginChangeCoverMessage=function(t){try{t.detail;var n=t.detail||{},r=n.pluginId,o=void 0===r?"":r,i=n.pluginName,a=void 0===i?"":i,u=n.index,s=void 0===u?0:u,l=n.resource,c=void 0===l?{}:l;if(!o||!a)return;var d=(0,R.iZ)(c);e.setState({cover:{pluginId:o,pluginName:a,index:s,value:d.mediaCoverUrl||d.mediaUrl,pluginCustom:!0}}
21),e.isPublish&&e.handleSaveNoteEditDraft(e.albumId,I.GR.TYPE_NOTE,{content:e.editorContent,editorText:e.editorText,title:e.title,cover:e.cover,attributes:e.attributes})}catch(f){}},e.handlePluginResourceEventMessage=function(t){try{var n=t.detail||{},r=n.resource,o=void 0===r?{}:r;e.saveSessionStorage(),(0,j.w)(e.myAlbumId,o,!0,"ç¬è®°ç¼è¾é¡µ")}catch(i){}},e.handlePluginEditProductMessage=function(){var n=(0,a.A)(Re().m(function n(r){var o,i,a,s,l,c,d,f,p,h;return Re().w(function(n){while(1)switch(n.p=n.n){case 0:return n.p=0,o=r.detail||{},i=o.pluginId,a=void 0===i?"":i,s=o.pluginName,l=void 0===s?"":s,c=o.resource,d=void 0===c?{}:c,e.setState({pluginOperateConfig:{event:t.SPECIAL_EVENT_TYPE.EVENT_EDIT_PRODUCT,pluginId:a,pluginName:l,resource:d}}),n.n=1,(0,Le.uz)(e.selfAlbumId,d.resId);case 1:if(f=n.v,!f){n.n=3;break}if(p=f||{},h=p.distributionAgentMark,!h){n.n=2;break}return wgoo.$toast({title:"å½å帮åååï¼æä¸æ¯æç¼è¾"}),n.a(2);case 2:if(2===f.status){n.n=3;break}return Ge(18,(0,u.A)((0,u.A)({},f),{},{referrerTitle:"ç¬è®°ç¼è¾"})),n.a(2);case 3:wgoo.$toast({title:"产åä¸åå¨"}),window.dispatchEvent(new CustomEvent(L.Lm,{detail:{type:"delete",deletedIds:[d.resId]}})),n.n=5;break;case 4:n.p=4,n.v;case 5:return n.a(2)}},n,null,[[0,4]])}));return function(e){return n.apply(this,arguments)}}(),e.handlePluginEditNoteMessage=function(n){try{var r=n.detail||{},o=r.pluginId,i=void 0===o?"":o,a=r.pluginName,u=void 0===a?"":a,s=r.resource,l=void 0===s?{}:s;e.setState({pluginOperateConfig:{event:t.SPECIAL_EVENT_TYPE.EVENT_EDIT_NOTE,pluginId:i,pluginName:u,resource:l}}),window.location.href="?t=".concat(Date.now(),"&navigatorType=2#/album/note/note_edit/").concat(e.albumId,"/").concat(l.resId)}catch(c){}},e.handlePluginExpandNoteMessage=function(t){try{var n=t.detail||{},r=(n.pluginId,n.pluginName,n.resource),o=void 0===r?{}:r;e.handleEditorGetNoteContentDetail(o.resId)}catch(i){}},e.handleAppMediaEditReceiveMessage=function(t){try{var n=e,r=n.isProductNote;r?e.handleAppProducTypeReceiveMediaEdit(t):e.handleAppNoteTypeReceiveMediaEdit(t)}catch(o){}},e.handleAppMediaReceiveMessage=(0,S.A)(function(t){try{var n=e,r=n.isProductNote;r?e.handleAppProducTypeReceiveMedias(t):e.handleAppNoteTypeReceiveMedias(t)}catch(o){}},200),e.handleRegisterWindowMessage=function(){e.handleBaseRegisterWindowMessage(),window.addEventListener("message",e.handleCommonWindowMessage,!1),window.addEventListener("popstate",e.handlePopStateMessage,!1),window.addEventListener("onKeyboardHeightChange",e.handleKeyboardHeightChange,!1),window.addEventListener(L.HM,e.handlePluginDeleteItemMessage,!1),window.addEventListener(L.vr,e.handlePluginModifyResourceMessage,!1),window.addEventListener(L.Pf,e.handlePluginModifyLinkMessage,!1),window.addEventListener(L.xp,e.handlePluginChangeCoverMessage,!1),window.addEventListener(L.eY,e.handlePluginResourceEventMessage,!1),window.addEventListener(L.TM,e.handlePluginEditProductMessage,!1),window.addEventListener(L.s5,e.handlePluginEditNoteMessage,!1),window.addEventListener(L.G_,e.handlePluginExpandNoteMessage,!1),window.addEventListener(_.a2,e.handleAppMediaReceiveMessage,!1),window.addEventListener(I.SV,e.handleAppMediaEditReceiveMessage,!1)},e.handleUnregisterWindowMessage=function(){e.handleBaseUnregisterWindowMessage(),window.removeEventListener("message",e.handleCommonWindowMessage,!1),window.removeEventListener("popstate",e.handlePopStateMessage,!1),window.removeEventListener("onKeyboardHeightChange",e.handleKeyboardHeightChange,!1),window.removeEventListener(L.HM,e.handlePluginDeleteItemMessage,!1),window.removeEventListener(L.vr,e.handlePluginModifyResourceMessage,!1),window.removeEventListener(L.Pf,e.handlePluginModifyLinkMessage,!1),window.removeEventListener(L.xp,e.handlePluginChangeCoverMessage,!1),window.removeEventListener(L.eY,e.handlePluginResourceEventMessage,!1),window.removeEventListener(L.TM,e.handlePluginEditProductMessage,!1),window.removeEventListener(L.s5,e.handlePluginEditNoteMessage,!1),window.removeEventListener(L.G_,e.handlePluginExpandNoteMessage,!1),window.removeEventListener(_.a2,e.handleAppMediaReceiveMessage,!1),window.removeEventListener(I.SV,e.handleAppMediaEditReceiveMessage,!1)},e.createSubmitMedia=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set;if(!t)return{};var r=e,o=r.originNoteData,i=void 0===o?{}:o,a=i||{},s=a.mediaList,l=void 0===s?[]:s,c=(0,B._W)(t.mediaUrl),d=l.find(function(e){return e.mediaUrl.includes(c)&&!n.has(e.mediaId)});return d?(0,u.A)({},d):{mediaId:"",mediaUrl:t.mediaUrl,mediaCoverUrl:t.mediaCoverUrl,mediaType:t.mediaType,mediaWidth:t.mediaWidth||t.width,mediaHeight:t.mediaHeight||t.height,mediaSize:t.mediaSize||t.size,qualityType:t.qualityType,mediaStatus:2}},e.handleGetSubmitMediaList=function(){var t=[];
21try{var n=e,r=n.isProductNote,i=n.editorContent,a=n.productContent;if(r){var u=a||{},s=u.medias,l=void 0===s?[]:s;if(!l||l.length<=0)return;t.push.apply(t,(0,o.A)(l.map(function(t){return e.createSubmitMedia(t)})))}else{var c=i||{},d=c.content,f=void 0===d?[]:d,p=f.filter(function(e){return!!(0,z.zi)(e)&&F.c9.includes(e.type)});if(!p||p.length<=0)return;var h=new Set;p.forEach(function(n){var r=n.attrs||{},o=r.data;if((0,v.isArrayLike)(o))o.forEach(function(n){var r=e.createSubmitMedia(n,h);r&&t.push(r),r.mediaId&&h.add(r.mediaId)});else{var i=e.createSubmitMedia(o,h);i&&(i.mediaId&&h.add(i.mediaId),t.push(i))}})}}catch(m){}finally{return t}},e.handleGetSubmitParams=function(){var t,n=e,r=n.isEdit,o=n.isForward,i=n.isPublish,a=n.isImport,u=n.isProductNote,s=n.albumId,l=n.noteId,c=n.supplierSource,d=n.customSource,f=n.attributes,p=n.title,h=n.cover,m=n.editorText,g=n.editorContent,y=n.productContent,b=n.originNoteData,w=n.imgSpace,A=void 0===w?1:w,k=n.referrer_title,C=f.permissionConfig,D=void 0===C?{}:C,x=f.anonymous,E=void 0===x||x,M=f.staffInfo,S=void 0===M?{}:M,T=f.collection,P=void 0===T?{}:T,_=f.collections,I=void 0===_?{}:_,N=f.products,O=void 0===N?[]:N,L=I||{},B=L.data,z=void 0===B?[]:B,j=P||{},H=j.data,V=void 0===H?[]:H,Y=z.length>0?z:V,G=Y.map(function(e){return{collectionId:e.collectionId,name:e.name}}),U=y||{},q=U.title,$=void 0===q?"":q,K=U.content,J=void 0===K?"":K,X=U.medias,Z=(0,R.iZ)(X&&X.length>0?X[0]:null),Q=Z?Z.mediaCoverUrl||Z.mediaUrl:"",ee=D||{},te=ee.permission,ne=void 0===te?0:te,re=ee.tags,oe=void 0===re?[]:re,ie=e.isEditorContentChanged(),ae={noteId:r?l:"",parentAlbumId:o?s:"",parentNoteId:o?l:"",supplierSource:c,changeContentFlag:i||a||ie,noteType:u?2:1,customSource:(0,v.toJS)(d),belongStaffId:null!==(t=null===S||void 0===S?void 0:S.staffId)&&void 0!==t?t:"",visibilityType:ne,visibilityConfig:(0,v.toJS)(oe),anonymousState:E?1:0,collectionList:G,refItemList:O&&O.length>0?O.map(function(e){return e.goods_id}):[],isDetailEdit:!0,title:u?$:p.value?p.value:"",cover:u?Q:h.value?h.value:"",customTitle:u||p.custom?1:0,customCover:u||h.custom?1:0,scheduleConfig:1===ne?(0,W.BJ)((0,v.toJS)(D)):{},imgSpace:A,referrerTitle:k};if(ae.changeContentFlag)ae.plainText=u?J:m,ae.richText=u?"":JSON.stringify((0,W._M)((0,W.Cj)(g),F.Vj.MODE_PRODUCT)),ae.mediaList=e.handleGetSubmitMediaList();else{var ue=b||{},se=ue.mediaList,le=void 0===se?[]:se,ce=ue.plainText,de=void 0===ce?"":ce,fe=ue.richText,pe=void 0===fe?"":fe;ae.plainText=de,ae.richText=u?"":pe,ae.mediaList=(0,v.toJS)(le)}return ae},e.handleWegoNoteEditPublishCleaningWork=(0,a.A)(Re().m(function t(){var n,r,o,i,a,u,s,l,c,d,f,p;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:if(t.p=0,n=e,r=n.isPublish,o=n.selfAlbumId,i=n.noteType,a=n.attributes,!r){t.n=2;break}return e.isSaveExit=!0,t.n=1,(0,O.t4)(o,i);case 1:if(!b.YB){t.n=2;break}return t.n=2,(0,C.A)(500);case 2:u=a||{},s=u.anonymous,l=u.collection,c=void 0===l?{}:l,(0,Y.AM)(s),(0,O.DF)(e.imgSpace),d=c||{},f=d.data,p=void 0===f?[]:f,!p||p.length<=0||(0,O.LI)(o,p),t.n=4;break;case 3:t.p=3,t.v;case 4:return t.a(2)}},t,null,[[0,3]])})),e.handleWegoNotePublishToast=(0,a.A)(Re().m(function t(){var n,r,o,i,a,u,s,l,c,d,f,p,h,m,v,g,y,w,A;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:if(t.p=0,b.YB){t.n=1;break}return t.a(2);case 1:if(n=e,r=n.noteType,o=n.myAlbumId,i=n.fromPage,a=n.isPublish,u=n.isImport,s=n.isCopy,l=n.isEdit,c=n.isForward,d=n.referrer_title,f="",a||u?["myTab","myShop"].includes(i)?("myTab"===i&&(0,B.Nm)(N.T1,{}),Ge(313,{title:"å叿å",imageIcon:"https://static.szwego.com/etc/h5/ic_toast.png",toastTime:3e3,buttons:[{buttonTitle:"åå䏿¡",buttonColor:"#03C160",buttonType:"typeTitleButton",buttonJumpMode:"createNote",jumpHtmlUrl:"?t=".concat(Date.now(),"&navigatorType=2&referrer_title=").concat(d,"#/album/note/note_edit/").concat(o,"?noteType=").concat(r,"&referrer_title=").concat(d,"&fromPage=").concat(i)}]})):f="publish-detail":s||l?Ge(313,{title:"ä¿åæå"}):c&&(f="forward-detail"),!f){t.n=3;break}return t.n=2,(0,Y.mj)(f);case 2:p=t.v,h=p.result,m=p.toastInfo,h&&m&&(v=m.imageIcon,g=m.title,y=m.toastTime,w=m.buttons,A=void 0===w?[]:w,Ge(313,{imageIcon:v,title:g,toastTime:y,buttons:A}));case 3:t.n=5;break;case 4:t.p=4,t.v;case 5:return t.a(2)}},t,null,[[0,4]])})),e.checkMediaUploadTask=null,e.checkMediaUploadResolve=null,e.handleCheckMediaUploadTask=function(){var t=e;return new Promise(function(e){function n(){var e=t.isProductNote,n=t.editorContent,r=t.productC
21ontent;return e?r.medias||[]:(0,W.Ys)(n)}b.YB||e(!0),t.checkMediaUploadResolve=e;var r=n(),o=!r||r.length<=0||r.every(function(e){return!!e.mediaUrl});o&&e(!0);var i=0;(0,B.Cs)("èµæºä¸ä¼ ä¸"),t.checkMediaUploadTask=setInterval(function(){i++;var r=n(),o=!r||r.length<=0||r.every(function(e){return!!e.mediaUrl});(o||i>30)&&(clearInterval(t.checkMediaUploadTask),e(o))},1e3)})},e.handleDestroyMediaCheckTask=function(){try{var t=e,n=t.checkMediaUploadTask,r=t.checkMediaUploadResolve;n&&(clearInterval(n),e.checkMediaUploadTask=null),r&&(r(!1),e.checkMediaUploadResolve=null)}catch(o){}},e.handleClearMediaCheckTask=function(){e.checkMediaUploadResolve=null,e.checkMediaUploadTask=null},e.isProductEditorContentChanged=function(){try{var t=e,n=t.note,r=t.productContent,o=r.title,i=r.content,a=r.medias,u=n.title,s=n.plainText,l=n.mediaList,c=void 0===l?[]:l,d=o===u,f=i===s,p=a.length===c.length&&a.every(function(e,t){return e.mediaUrl===c[t].mediaUrl});return!(d&&f&&p)}catch(h){return!0}},e.isNoteEditorContentChanged=function(){try{var t=e,n=t.note,r=t.editorText,o=t.editorContent,i=n.plainText,a=n.richText,u=r===i,s=!(0,W.cj)(JSON.parse(a),(0,v.toJS)(o));return!(u&&s)}catch(l){return!0}},e.isEditorContentChanged=function(){try{var t=e,n=t.isProductNote;return n?e.isProductEditorContentChanged():e.isNoteEditorContentChanged()}catch(r){return!0}},e.handleCheckEditorNoteChanged=function(){try{var t=e,n=t.isMyAlbum,r=t.cover,o=t.note,i=t.editorContent,a=void 0===i?{}:i,u=t.attributes,s=o||{},l=s.richText,c=void 0===l?"":l,d=s.cover,f=s.refProductId,p=void 0===f?[]:f,h=u||{},m=h.products,g=void 0===m?[]:m,y=JSON.parse(c),b=U({isMyAlbum:n,cover:r.value||"",originCover:d||"",editorContent:(0,v.toJS)(a),originEditorContent:y,productIds:g.map(function(e){return e.goods_id}),originProductIds:p});return b}catch(w){return!0}},e.handleCheckProductNoteChanged=function(){try{var t=e,n=t.originNoteData,r=t.productContent,o=void 0===r?{}:r,i=n||{},a=i.mediaList,u=void 0===a?[]:a,s=o.medias,l=void 0===s?[]:s;return!l.every(function(e){return!!e.mediaId&&u.some(function(t){return t.mediaId===e.mediaId})})}catch(c){return!0}},e.handeCheckForwardEditNoteChanged=function(){try{var t=e,n=t.isMyAlbum,r=t.isPublish,o=t.isImport,i=t.isCopy,a=t.isProductNote,u=t.originNoteData,s=t.attributes,l=void 0===s?{}:s;if(r||o||i)return!0;var c=u||{},d=c.refProductId,f=void 0===d?[]:d,p=l||{},h=p.products,m=void 0===h?[]:h,v=m.map(function(e){return e.goods_id}),g=!1;if(n){if(v&&v.length>0){if(v.length!==f.length)return!0;g=v.some(function(e){return!f.includes(e)})}}else g=v.length>0;return!!g||(a?e.handleCheckProductNoteChanged():e.handleCheckEditorNoteChanged())}catch(y){return!0}},e.handleWegoNoteEditPublishAction=(0,T.k)((0,a.A)(Re().m(function t(){var n,r,o,i,a,s,l,c,d,f,p,h,m,v,g,y,w,A,k,C,D,x,E,M,S,T,_,I,O,F,L,R,z,j,H,V,W,G,U,q,$,K,J,X;return Re().w(function(t){while(1)switch(t.p=t.n){case 0:if(n={result:!1,toast:!1,resultData:{}},t.p=1,r=e,o=r.isEdit,i=r.isMyAlbum,a=r.isPublish,s=r.isCopy,l=r.isImport,c=r.title,d=r.cover,f=r.isProductNote,p=r.productContent,h=void 0===p?{}:p,m=r.isVip,v=r.vipReferrerTitle,g=r.referrer_title,y=r.cloudDriveInfo,w=f?!h.title&&(!h.medias||0===h.medias.length):!c.value&&!d.value,!w){t.n=2;break}return wgoo.$toast({title:"请å
æ·»å ç¬è®°æ 颿å°é¢",icon:"none"}),t.a(2);case 2:if(A=e.handeCheckForwardEditNoteChanged(),m||!A){t.n=3;break}return He({vipUIKey:"post_note",referrerTitle:g,referrerFunction:v,onClose:function(t){"close"!==t&&e.saveSessionStorage()}}),t.a(2);case 3:if(k=y||{},C=k.isCapacityLimit,!C){t.n=4;break}return e.setState({showCloudDriveIntercept:!0}),t.a(2);case 4:if(!b.YB){t.n=6;break}return t.n=5,e.handleCheckMediaUploadTask();case 5:if(D=t.v,e.handleClearMediaCheckTask(),D){t.n=6;break}return wgoo.$toast({title:"èµæºä¸ä¼ ä¸ï¼è¯·ç¨ååè¯"}),e.handleNotePublishErrorTrack(),t.a(2);case 6:return(0,B.Cs)("æ£å¨åå¸"),x=e.handleGetSubmitParams(),E=a||o||s||l||i,M=E?(0,Y.zm)(x):(0,Y.l0)(x),t.n=7,M;case 7:if(S=t.v,T=S.errcode,_=S.errmsg,I=S.result,0!==T){t.n=8;break}n.result=!0,n.resultData=I,t.n=10;break;case 8:if(2707022!==T){t.n=9;break}return e.setState({showCloudDriveIntercept:!0}),t.a(2);case 9:wgoo.$toast({title:_});case 10:if(!n.result){t.n=11;break}return t.n=11,e.handleWegoNoteEditPublishCleaningWork();case 11:t.n=13;break;case 12:t.p=12,t.v;case 13:if(t.p=13,e.handleClearMediaCheckTask(),!n.result){t.n=14;break}return e.isMyAlbum?(O=e.attributes||{},F=O.permissionConfig,L=void 0===F?{}:F,R=L||{},z=R.permission,j=void 0===z?0:z,(0,B.Nm)(N.hN,(0,u.A)((0,u.A)({},n.resultData.note),{},{noteType:e.isProductNote?2:1,visibilityType:j,isMyAlbum:!0,isPublish:e.isPublish}))):(H=e,V=H.isForward,W=H.targetAlbum,G=H.supplierSource,U=H.customSource,q=void 0===U?{}:U,$=!0,V&&(K=W.albumId,J=q||{}
21,X=J.sourceId,(G!==K||X)&&($=!1)),$&&(0,B.Nm)(N.hN,{noteId:e.noteId,isMyAlbum:!1,forwardTime:"1åéå",forwardShareStatus:1})),b.YB?Ge(372,{mode:"public"}):localStorage.removeItem(P.R.WEB_SHOP_NOTE_DETAIL_CACHE),t.n=14,e.handleWegoNotePublishToast();case 14:return(0,B.RZ)(),t.a(2,n);case 15:return t.a(2)}},t,null,[[1,12,13,15]])})),500),e}return(0,h.A)(t,e),(0,c.A)(t,[{key:"hasTitleCover",get:function(){var e=this.title,t=this.cover;return!!e.value||!!t.value}},{key:"isSvip",get:function(){return 5===this.vipStatus}},{key:"imageMediaCount",get:function(){var e=this.isProductNote,t=this.editorContent,n=void 0===t?{}:t,r=this.productContent,o=void 0===r?{}:r;if(e){var i=o.medias,a=void 0===i?[]:i;return a.filter(function(e){return 2!==e.mediaType}).length}return(0,W.x$)(n)}},{key:"videoMediaCount",get:function(){var e=this.isProductNote,t=this.editorContent,n=void 0===t?{}:t,r=this.productContent,o=void 0===r?{}:r;if(e){var i=o.medias,a=void 0===i?[]:i;return a.filter(function(e){return 2===e.mediaType}).length}return(0,W.zj)(n)}},{key:"isImageMediaOverMaxCount",get:function(){var e=this.wegoNoteConfig,t=void 0===e?{}:e,n=this.imageMediaCount,r=t.maxImageCount,o=void 0===r?180:r;return n>=o}},{key:"isMediaOverMaxCount",get:function(){var e=this.isProductNote,t=this.productContent,n=void 0===t?{}:t,r=this.wegoNoteConfig,o=void 0===r?{}:r,i=this.imageMediaCount,a=this.videoMediaCount,u=o.maxImageCount,s=o.maxVideoCount,l=u+s;if(e){var c=n.medias,d=void 0===c?[]:c;return d.length>=l}return i+a>=l}},{key:"optionalProductCount",get:function(){var e=this.isProductNote,t=this.editorContent,n=void 0===t?{}:t;return e?0:(0,z.d)(F.zM.TYPE_PRODUCT)-(0,W.GA)(n,F.zM.TYPE_PRODUCT)}},{key:"optionalNoteCount",get:function(){var e=this.isProductNote,t=this.editorContent,n=void 0===t?{}:t;return e?0:(0,z.d)(F.zM.TYPE_NOTE)-(0,W.GA)(n,F.zM.TYPE_NOTE)}},{key:"hasContent",get:function(){var e=this.isProductNote,t=this.editorContent,n=void 0===t?{}:t,r=this.editorText,o=void 0===r?"":r,i=this.productContent;if(e){var a=i||{},u=a.title,s=void 0===u?"":u,l=a.content,c=void 0===l?"":l,d=a.medias,f=void 0===d?[]:d;return!!s||!!c||!!f&&f.length>0}var p=n.content,h=void 0===p?[]:p;return!/^\s*$/.test(o)||(0,z.iw)((0,v.toJS)(h))}},{key:"trackNoteType",get:function(){var e=this.isPublish,t=this.isEdit,n=this.isForward,r=this.isCopy,o=this.isImport;return e||o||r?"åå¸":n?"转å":t?"ç¼è¾":void 0}},{key:"vipReferrerTitle",get:function(){var e=this.trackNoteType;return"".concat(e,"ç¬è®°")}},{key:"cloudDriveReferrerTitle",get:function(){var e=this.isPublish,t=this.isEdit,n=this.isForward,r=this.isCopy,o=this.isImport;return e||r?"åå¸ç¬è®°":n?"转åç¬è®°":t?"ç¼è¾ç¬è®°":o?"导å
¥ç¬è®°":"åå¸ç¬è®°"}},{key:"init",value:function(){var e=(0,a.A)(Re().m(function e(t){var n,r,o,i,a,s,l,c,d,f,p,h,m,v,g=arguments;return Re().w(function(e){while(1)switch(e.p=e.n){case 0:if(n=g.length>1&&void 0!==g[1]?g[1]:{},r=g.length>2?g[2]:void 0,e.p=1,this.handleRegisterWindowMessage(),!t||this.noteId&&(!this.noteId||this.noteId!==t.noteId)){e.n=2;break}return this.setState((0,u.A)({},t)),requestAnimationFrame(this.handleScrollToHistory),"function"===typeof r&&r(this),e.a(2);case 2:if(!this.isInit){e.n=3;break}return e.a(2);case 3:return this.isInit=!0,this.initRouterParams(n),this.initExtraData(!0),e.n=4,this.initExtraConfigs();case 4:if(!this.isImport){e.n=8;break}return e.n=5,this.handleImportNoteFromWegoProducts();case 5:return this.initAccountInfo(),this.handleWegoNoteEditPV(),e.n=6,this.initNoteImageSpace();case 6:return"function"===typeof r&&r(this),e.n=7,this.initNessaryExtraData();case 7:return this.handleEditorUpdateContent(),e.a(2);case 8:if(o={errCode:0,errMsg:"",showLoading:!1,showError:!1},this.isPublish){e.n=10;break}return e.n=9,(0,Y.hq)(this.albumId,this.noteId);case 9:i=e.v,a=i.errCode,s=i.errMsg,l=i.result,o.errCode=a,o.errMsg=s,o.showError=0!==a,c=this.handleResolveNoteDetailData(l,this.noteEditType),o=(0,u.A)((0,u.A)({},o),c),o.noteType===I.GR.TYPE_NOTE&&(o.editorContent=(0,W._M)(o.editorContent,F.Vj.MODE_EDIT),this.handleInitEditorTitleData(o.editorContent,o.note),this.handleInitEditorCoverData(o.editorContent,o.note)),e.n=13;break;case 10:return e.n=11,(0,O.ws)(this.albumId,this.noteType);case 11:return d=e.v,f=d.content,p=d.title,h=d.cover,m=d.editorText,v=d.attributes,this.isProductNote,f&&(this.isProductNote?(o.productC
21ontent=(0,u.A)((0,u.A)({},f),{},{medias:(f.medias||[]).filter(Boolean)}),o.attributes=v):(o.editorContent=(0,u.A)((0,u.A)({},f),{},{content:(f.content||[]).filter(Boolean).map(function(e){return"paragraph"===e.type&&e.content&&e.content.length>0?(0,u.A)((0,u.A)({},e),{},{content:e.content.filter(Boolean)}):(0,z.zi)(e)&&F.Oh.includes(e.type)?(0,u.A)((0,u.A)({},e),{},{attrs:(0,u.A)((0,u.A)({},e.attrs),{},{data:(e.attrs.data||[]).filter(Boolean)})}):e})}),o.title=p||{},o.cover=h||{},o.editorText=m||"",o.attributes=v||{})),e.n=12,(0,O.YO)();case 12:o.imgSpace=e.v;case 13:return this.setState(o),"function"===typeof r&&r(this),this.handleWegoNoteEditPV(),this.initAccountInfo(),e.n=14,this.initNessaryExtraData();case 14:this.handleEditorUpdateContent(),e.n=16;break;case 15:e.p=15,e.v;case 16:return e.a(2)}},e,this,[[1,15]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:"reload",value:function(e){try{e&&this.setState((0,u.A)({},e)),this.initExtraData()}catch(t){}}},{key:"saveSessionStorage",value:function(){b.YB||(this.editorContext=null),this.setState({showCloudDriveIntercept:!1}),this.scrollTop=window.getPageScrollTop()}}])}(Be.A),Fe.SPECIAL_EVENT_TYPE={EVENT_NONE:"none",EVENT_EDIT_PRODUCT:"editProduct",EVENT_EDIT_NOTE:"editNote",EVENT_EDIT_IMAGE:"editImage"},Q=Fe,ee=(0,m.A)(Q.prototype,"isHD",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),te=(0,m.A)(Q.prototype,"sceneId",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),ne=(0,m.A)(Q.prototype,"keyboardHeight",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),re=(0,m.A)(Q.prototype,"extraframeType",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return I.Il.TYPE_NONE}}),oe=(0,m.A)(Q.prototype,"showLinkDialog",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ie=(0,m.A)(Q.prototype,"showAppMoreDialog",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ae=(0,m.A)(Q.prototype,"isMasterAccount",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ue=(0,m.A)(Q.prototype,"isTeamAccount",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),se=(0,m.A)(Q.prototype,"showFromFrame",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),le=(0,m.A)(Q.prototype,"editorFocus",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ce=(0,m.A)(Q.prototype,"editorAlreadyFocused",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),de=(0,m.A)(Q.prototype,"originNoteData",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),fe=(0,m.A)(Q.prototype,"mediaList",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),pe=(0,m.A)(Q.prototype,"title",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{value:"",custom:!1}}}),he=(0,m.A)(Q.prototype,"cover",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{pluginId:"",index:0,width:0,height:0,value:"",custom:!1,pluginCustom:!1}}}),(0,m.A)(Q.prototype,"hasTitleCover",[v.computed],Object.getOwnPropertyDescriptor(Q.prototype,"hasTitleCover"),Q.prototype),me=(0,m.A)(Q.prototype,"supplierSource",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),ve=(0,m.A)(Q.prototype,"customSource",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),ge=(0,m.A)(Q.prototype,"lastAnonymous",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ye=(0,m.A)(Q.prototype,"showLevelSelectDialog",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),be=(0,m.A)(Q.prototype,"relations",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),we=(0,m.A)(Q.prototype,"pluginOperateConfig",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{event:Ke.SPECIAL_EVENT_TYPE.EVENT_NONE,pluginId:"",pluginName:"",index:0,resource:{}}}}),Ae=(0,m.A)(Q.prototype,"showCloudDriveIntercept",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ke=(0,m.A)(Q.prototype,"cloudDriveInfo",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),Ce=(0,m.A)(Q.prototype,"isVip",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),De=(0,m.A)(Q.prototype,"vipStatus",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),(0,m.A)(Q.prototype,"isSvip",[v.computed],Object.getOwnPropertyDescriptor(Q.prototype,"isSvip"),Q.prototype),xe=(0,m.A)(Q.prototype,"layoutLevel",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Ee=(0,m.A)(Q.prototype,"useLinkDecorate",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Me=(0,m.A)(Q.prototype,"useAssociatedNoteExpand",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),(0,m.A)(Q.prototype,"imageMediaCount",[v.computed],Object.getOwnPropertyDescriptor(Q.prototype,"imageMediaCount"),Q.prototype),(0,m.A)(Q.prototype,"videoMediaCount",[v.computed],Object.getOwnPropertyDescriptor(Q.prototype,"videoMediaCount"),Q.prototype),(0,m.A)(Q.prototype,"isImageMediaOverMaxCount",[v.computed],Object.getOwnPropertyDescriptor(Q.prototype,"isImageMediaOverMaxCount"),Q.prototype),(0,m.A)(Q.prototype,"isMediaOverMaxCount",[v.computed],Object.getOwnPropertyDescriptor(Q.prototype,"isMediaOverMaxCount"),Q.prototype),(0,m.A)(Q.prototype,"optionalProductCount",[v.computed],Object.getOwnPropertyDescriptor(Q.prototype,"optionalProductCount"),Q.prototype),(0,m.A)(Q.prototype,"optionalNoteCount",[v.computed],Object.getOwnPropertyDescriptor(Q.prototype,"optionalNoteCount"),Q.prototype),(0,m.A)(Q.prototype,"hasContent",[v.computed],Object.getOwnPropertyDescriptor(Q.prototype,"hasContent"),Q.prototype),(0,m.A)(Q.prototype,"trackNoteType",[v.computed],Object.getOwnPropertyDescriptor(Q.prototype,"trackNoteType"),Q.prototype),(0,m.A)(Q.prototype,"vipReferrerTitle",[v.computed],Object.getOwnPropertyDescriptor(Q.prototype,"vipReferrerTitle"),Q.prototype),(0,m.A)(Q.prototype,"cloudDriveReferrerTitle",[v.computed],Object.getOwnPropertyDescriptor(Q.prototype,"cloudDriveReferrerTitle"),Q.prototype),(0,m.A)(Q.prototype,"init",[q,$],Object.getOwnPropertyDescriptor(Q.prototype,"init"),Q.prototype),(0,m.A)(Q.prototype,"reload",[K,J],Object.getOwnPropertyDescriptor(Q.prototype,"reload"),Q.prototype),(0,m.A)(Q.prototype,"saveSessionStorage",[X,Z],Object.getOwnPropertyDescriptor(Q.prototype,"saveSessionStorage"),Q.prototype),Se=(0,m.A)(Q.prototype,"handleAppAddUploadMedias",[v.action],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(n&&n.length){var r=n.filter(function(t){return!e.mediaList.some(function(e){return e.mediaId===t.mediaId})});r&&r.length&&(t=e.mediaList).push.apply(t,(0,o.A)(r))}}}}),Te=(0,m.A)(Q.prototype,"handleAppUpdateUploadMedias",[v.action],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(t&&t.length){var n=t.filter(function(t){return e.mediaList.some(function(e){return e.mediaId===t.mediaId})}).filter(function(e){return!!e.mediaUrl});n&&n.length&&e.mediaList.forEach(function(t,r){var o=n.find(function(e){return e.mediaId===t.mediaId});o&&(e.mediaList[r]=(0,u.A)((0,u.A)({},t),o))})}}}}),Pe=(0,m.A)(Q.prototype,"handleChangeLevel",[v.action],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showLevelSelectDialog=!0}}}),_e=(0,m.A)(Q.prototype,"handleCollection",[v.action],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){try{e.layoutLevel>=1&&e.layoutLevel<=3?e.handleCollectionSelected():e.handleChangeLevel()}catch(t){console.error("æ£æ¥å¸å±å±çº§å¤±è´¥:",t)}}}}),Ie=(0,m.A)(Q.prototype,"handleShowLevelSelectDialog",[v.action],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showLevelSelectDialog=!0}}}),Ne=(0,m.A)(Q.prototype,"handleCloseLevelSelectDialog",[v.action],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showLevelSelectDialog=!1}}}),Oe=(0,m.A)(Q.prototype,"handleConfirmLevelSelect",[v.action],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=(0,a.A)(Re().m(function t(n){return Re().w(function(t){while(1)switch(t.n){case 0:return t.n=1,setTimeout(function(){e.handleCloseLevelSelectDialog(),e.setState({layoutLevel:n})},200);case 1:e.handleCollectionSelected();case 2:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()}}),Q);function Je(){var e;return function(){return e=e||new Ke,e}}var Xe=Je();function Ze(){var e=(0,r.useLocalStore)(Xe);return e}},43792:function(e,t,n){n.d(t,{M:function(){return s},c:function(){return l}});var r=n(41594),o=n(18809),i={},a=function(){}
21,u=(0,r.createContext)({navBarHeight:0,isMyAlbum:!1,cover:i,editorFocus:!1,imgSpace:1,productMap:i,noteMap:i,isMediaOverMaxCount:!1,isImageMediaOverMaxCount:!1,useAssociatedNoteExpand:!1,handleUpdateImageSpace:a});function s(e){var t=e.children,n=e.data,s=void 0===n?{}:n,l=s||{},c=l.navBarHeight,d=void 0===c?0:c,f=l.isMyAlbum,p=void 0!==f&&f,h=l.cover,m=void 0===h?i:h,v=l.editorFocus,g=void 0!==v&&v,y=l.imgSpace,b=void 0===y?1:y,w=l.productMap,A=void 0===w?i:w,k=l.noteMap,C=void 0===k?i:k,D=l.isMediaOverMaxCount,x=void 0!==D&&D,E=l.isImageMediaOverMaxCount,M=void 0!==E&&E,S=l.useAssociatedNoteExpand,T=void 0!==S&&S,P=l.handleUpdateImageSpace,_=void 0===P?a:P,I=(0,r.useMemo)(function(){return{navBarHeight:d,isMyAlbum:p,cover:m,editorFocus:g,imgSpace:b,productMap:A,noteMap:C,isMediaOverMaxCount:x,isImageMediaOverMaxCount:M,useAssociatedNoteExpand:T,handleUpdateImageSpace:_}},[d,p,m,g,b,A,C,x,M,T,_]);return(0,o.jsx)(u.Provider,{value:I,children:t})}function l(){return(0,r.useContext)(u)}},51195:function(e,t,n){n.d(t,{A:function(){return C}});var r,o,i,a,u=n(75117),s=n(51237),l=n(63887),c=n(95627),d=n(3846),f=n(60738),p=n(52100),h=n(83763),m=n(56107),v=n(6279),g=n(85592),y=n(35181);function b(e,t,n){return t=(0,p.A)(t),(0,d.A)(e,(0,f.A)()?Reflect.construct(t,n||[],(0,p.A)(e).constructor):t.apply(e,n))}var w=(r=function(e){function t(){var e;(0,c.A)(this,t);for(var n=arguments.length,r=new Array(n),u=0;u<n;u++)r[u]=arguments[u];return e=b(this,t,[].concat(r)),(0,s.A)(e,"imgSpace",o,e),(0,s.A)(e,"currentPluginId",i,e),(0,s.A)(e,"init",a,e),e.handleUpdateCurrentPluginId=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";g.YB||e.currentPluginId!==t&&e.setState({currentPluginId:t})},e.handleChangeImageSpace=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t!==e.imgSpace&&e.setState({imgSpace:t})},e}return(0,h.A)(t,e),(0,l.A)(t)}(y.A),o=(0,m.A)(r.prototype,"imgSpace",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),i=(0,m.A)(r.prototype,"currentPluginId",[v.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),a=(0,m.A)(r.prototype,"init",[v.action],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.setState({currentPluginId:""})}}}),r);function A(){var e;return function(){return e=e||new w,e}}var k=A();function C(){var e=(0,u.useLocalStore)(k);return e}},28641:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});i.push([e.id,".index-module_container_bdKDt{border-radius:0!important;width:100%!important}@media screen and (min-width:1024px){.index-module_container_bdKDt .index-module_wgoo-drawer_Yiz2M{left:calc(50% - 20.9375rem);width:100%!important;max-width:100%!important;border-radius:0!important}}",""]),i.locals={container:"index-module_container_bdKDt","wgoo-drawer":"index-module_wgoo-drawer_Yiz2M"},t.A=i},5522:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});i.push([e.id,".index-module_wegoPermissionNavbar_B-3yI{position:relative;padding-right:16px;width:100%;height:44px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between}.index-module_wegoPermissionNavbar_B-3yI .index-module_cancel_oXNOD{height:100%;padding:0 16px;display:flex;align-items:center;justify-content:center;color:#1e2028;font-size:16px;font-weight:400;line-height:24px;cursor:pointer}.index-module_wegoPermissionNavbar_B-3yI .index-module_cancel_oXNOD:active{opacity:.6}.index-module_wegoPermissionNavbar_B-3yI .index-module_cancel_oXNOD:hover{opacity:.8}.index-module_wegoPermissionNavbar_B-3yI .index-module_title_350GU{position:absolute;left:50%;top:50%;-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#1e2028;text-align:center;font-size:18px;font-weight:500;line-height:27px}.index-module_wegoPermissionNavbar_B-3yI .index-module_save_qP\\+JT{padding-left:12px;padding-right:12px;font-weight:500}",""]),i.locals={wegoPermissionNavbar:"index-module_wegoPermissionNavbar_B-3yI",cancel:"index-module_cancel_oXNOD",title:"index-module_title_350GU",save:"index-module_save_qP+JT"},t.A=i},30490:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});
21i.push([e.id,"",""]),i.locals={},t.A=i},45033:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});i.push([e.id,".index-module_noteEditPermissionDialog_BTWYs{border-radius:0!important;background-color:#ededed}.index-module_noteEditPermissionframe_vLsq0{width:100%;height:100vh;display:flex;flex-direction:column;background-color:#ededed}.index-module_noteEditPermissionframe_vLsq0 .index-module_noteEditPermissionContent_p98vS{flex:1;background-color:#ededed}",""]),i.locals={noteEditPermissionDialog:"index-module_noteEditPermissionDialog_BTWYs",noteEditPermissionframe:"index-module_noteEditPermissionframe_vLsq0",noteEditPermissionContent:"index-module_noteEditPermissionContent_p98vS"},t.A=i},32691:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});i.push([e.id,".index-module_wegoPermissionNavbar_jqlbw{position:relative;padding-right:16px;width:100%;height:44px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between}.index-module_wegoPermissionNavbar_jqlbw .index-module_cancel_oy4PQ{height:100%;padding:0 16px;display:flex;align-items:center;justify-content:center;color:#1e2028;font-size:16px;font-weight:400;line-height:24px;cursor:pointer}.index-module_wegoPermissionNavbar_jqlbw .index-module_cancel_oy4PQ:active{opacity:.6}.index-module_wegoPermissionNavbar_jqlbw .index-module_cancel_oy4PQ:hover{opacity:.8}.index-module_wegoPermissionNavbar_jqlbw .index-module_title_zMXOa{position:absolute;left:50%;top:50%;-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#1e2028;text-align:center;font-size:18px;font-weight:500;line-height:27px}.index-module_wegoPermissionNavbar_jqlbw .index-module_save_NepHG{padding-left:12px;padding-right:12px;font-weight:500}",""]),i.locals={wegoPermissionNavbar:"index-module_wegoPermissionNavbar_jqlbw",cancel:"index-module_cancel_oy4PQ",title:"index-module_title_zMXOa",save:"index-module_save_NepHG"},t.A=i},68493:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});i.push([e.id,".index-module_WegoPluginComponentDivider_w3N5e{position:relative;padding:12px 0;width:100%;box-sizing:border-box;display:flex;align-items:center;cursor:pointer}.index-module_WegoPluginComponentDivider_w3N5e .index-module_pluginDividerLine_8nZ9M{width:100%;height:1px;background-color:rgba(32,47,100,.16);-ms-transform:scaleY(.5);transform:scaleY(.5)}",""]),i.locals={WegoPluginComponentDivider:"index-module_WegoPluginComponentDivider_w3N5e",pluginDividerLine:"index-module_pluginDividerLine_8nZ9M"},t.A=i},51918:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});i.push([e.id,'.index-module_WegoPluginComponentGrid_YR6tG{position:relative;box-sizing:border-box;cursor:pointer;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.index-module_WegoPluginComponentGrid_YR6tG,.index-module_WegoPluginComponentGrid_YR6tG .index-module_WegoPluginGridContent_tvFbJ{width:100%;display:flex;flex-wrap:wrap}.index-module_WegoPluginComponentGrid_YR6tG.index-module_editMode_lBNn7 .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_normal_GX3qL:active:after{display:none}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG{position:relative;margin-top:4px;margin-left:4px;width:calc(33.33333% - 2.66667px);box-sizing:border-box;cursor:pointer;-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG:nth-child(-n+3){margin-top:0}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG:nth-child(3n+1){margin-left:0}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop{position:relative;padding-bottom:100%;background-color:#fff;-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_active_cJoOq{border:1px solid #49c167}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_more_QBhAd{background-color:rgba(32,47,100,.03)}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_more_QBhAd:hover{background-color:rgba(32,47,100,.06)}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_more_QBhAd:active{opacity:1;background-color:rgba(32,47,100,.1)!important}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_itemImag_6nfJ-{position:absolute;
21left:0;top:0;width:100%;height:100%;object-fit:cover}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_itemLiveVideoFrame_\\+1CLE{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#1e2028}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_itemLiveVideo_v2rIo{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:contain}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_add_pd5-L{position:absolute;left:0;top:0;width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_add_pd5-L .index-module_addIcon_3KeLV{font-size:24px;line-height:24px;color:#6e7382}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="3"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_add_pd5-L .index-module_addText_1bw4i{margin-top:4px;color:#6e7382;font-size:14px;line-height:21px}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG{position:relative;margin-top:4px;margin-left:4px;width:calc(25% - 3px);box-sizing:border-box;cursor:pointer;-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG:nth-child(-n+4){margin-top:0}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG:nth-child(4n+1){margin-left:0}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop{position:relative;padding-bottom:100%;background-color:#fff;-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_active_cJoOq{border:1px solid #49c167}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_more_QBhAd{background-color:rgba(32,47,100,.03)}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_more_QBhAd:hover{background-color:rgba(32,47,100,.06)}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_more_QBhAd:active{opacity:1;background-color:rgba(32,47,100,.1)!important}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_itemImag_6nfJ-{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_itemLiveVideoFrame_\\+1CLE{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#1e2028}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_itemLiveVideo_v2rIo{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:contain}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_add_pd5-L{position:absolute;left:0;top:0;width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_add_pd5-L .index-module_addIcon_3KeLV{font-size:24px;line-height:24px;color:#6e7382}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="4"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_add_pd5-L .index-module_addText_1bw4i{margin-top:4px;color:#6e7382;font-size:14px;line-height:21px}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG{position:relative;margin-top:4px;margin-left:4px;width:calc(20% - 3.2px);box-sizing:border-box;
21cursor:pointer;-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG:nth-child(-n+5){margin-top:0}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG:nth-child(5n+1){margin-left:0}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop{position:relative;padding-bottom:100%;background-color:#fff;-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_active_cJoOq{border:1px solid #49c167}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_more_QBhAd{background-color:rgba(32,47,100,.03)}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_more_QBhAd:hover{background-color:rgba(32,47,100,.06)}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop.index-module_more_QBhAd:active{opacity:1;background-color:rgba(32,47,100,.1)!important}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_itemImag_6nfJ-{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_itemLiveVideoFrame_\\+1CLE{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#1e2028}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_itemLiveVideo_v2rIo{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:contain}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_add_pd5-L{position:absolute;left:0;top:0;width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_add_pd5-L .index-module_addIcon_3KeLV{font-size:24px;line-height:24px;color:#6e7382}.index-module_WegoPluginComponentGrid_YR6tG[data-cols="5"] .index-module_wegoPluginGridItem_vq5NG .index-module_itemContent_TTsop .index-module_add_pd5-L .index-module_addText_1bw4i{margin-top:4px;color:#6e7382;font-size:14px;line-height:21px}.index-module_WegoPluginComponentGrid_YR6tG .index-module_pluginGridMenu_MskKz{padding:0 8px;position:absolute;top:0;left:50%;background-color:rgba(30,32,40,.8);border-radius:4px;color:#fff;display:flex;align-items:center;-ms-transform:translateX(-50%);transform:translateX(-50%)}.index-module_WegoPluginComponentGrid_YR6tG .index-module_pluginGridMenu_MskKz .index-module_item_90Fhh{position:relative;padding:4px;color:#fff}.index-module_WegoPluginComponentGrid_YR6tG .index-module_pluginGridMenu_MskKz .index-module_item_90Fhh:not(:first-child):before{content:"";position:absolute;left:0;top:50%;-ms-transform:translateY(-50%);transform:translateY(-50%);width:1px;height:12px;background-color:#fff}.index-module_wegoPluginGridChosen_Gx5oZ{opacity:1!important}.index-module_wegoPluginGridGhost_dGIqW{opacity:0!important}',""]),i.locals={WegoPluginComponentGrid:"index-module_WegoPluginComponentGrid_YR6tG",WegoPluginGridContent:"index-module_WegoPluginGridContent_tvFbJ",editMode:"index-module_editMode_lBNn7",wegoPluginGridItem:"index-module_wegoPluginGridItem_vq5NG",itemContent:"index-module_itemContent_TTsop",normal:"index-module_normal_GX3qL",active:"index-module_active_cJoOq",more:"index-module_more_QBhAd",itemImag:"index-module_itemImag_6nfJ-",itemLiveVideoFrame:"index-module_itemLiveVideoFrame_+1CLE",itemLiveVideo:"index-module_itemLiveVideo_v2rIo",add:"index-module_add_pd5-L",addIcon:"index-module_addIcon_3KeLV",addText:"index-module_addText_1bw4i",pluginGridMenu:"index-module_pluginGridMenu_MskKz",item:"index-module_item_90Fhh",wegoPluginGridChosen:"index-module_wegoPluginGridChosen_Gx5oZ",wegoPluginGridGhost:"index-module_wegoPluginGridGhost_dGIqW"},t.A=i},32021:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});
21i.push([e.id,'.index-module_WegoPluginComponentImage_n6LXq{position:relative;box-sizing:border-box;transition:none!important;cursor:pointer}.index-module_WegoPluginComponentImage_n6LXq.index-module_selected_oGbkE{cursor:zoom-in}.index-module_WegoPluginComponentImage_n6LXq.index-module_editMode_PNsNc:active:after{display:none}.index-module_WegoPluginComponentImage_n6LXq .index-module_editorImageContentframe_HYWkn{position:relative;left:0;top:0;width:100%}.index-module_WegoPluginComponentImage_n6LXq .index-module_editorImageContentframe_HYWkn .index-module_editorInnerContentframe_dd\\+QI,.index-module_WegoPluginComponentImage_n6LXq .index-module_resizeHandleLayer_Jt9vB{position:absolute;left:0;top:0;width:100%;height:100%}.index-module_WegoPluginComponentImage_n6LXq .index-module_resizeHandleLayer_Jt9vB{pointer-events:none;z-index:5}.index-module_WegoPluginComponentImage_n6LXq .index-module_resizeHandle_XKbPm{position:absolute;width:12px;height:12px;background-color:#fff;border:2px solid #49c167;pointer-events:auto;touch-action:none;box-sizing:border-box}.index-module_WegoPluginComponentImage_n6LXq .index-module_resizeHandle_XKbPm:after{content:"";position:absolute;left:50%;top:50%;width:32px;height:32px;-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.index-module_WegoPluginComponentImage_n6LXq .index-module_resizeHandle_nw_IUf9u{left:-5px;top:-5px;cursor:nwse-resize}.index-module_WegoPluginComponentImage_n6LXq .index-module_resizeHandle_ne_ppQeZ{right:-5px;top:-5px;cursor:nesw-resize}.index-module_WegoPluginComponentImage_n6LXq .index-module_resizeHandle_sw_4IbJ\\+{left:-5px;bottom:-5px;cursor:nesw-resize}.index-module_WegoPluginComponentImage_n6LXq .index-module_resizeHandle_se_bRXVd{right:-5px;bottom:-5px;cursor:nwse-resize}.index-module_WegoPluginComponentImage_n6LXq .index-module_editorContentImage_ol\\+pA{margin:0 auto;display:block;width:100%;height:auto;object-fit:cover}.index-module_WegoPluginComponentImage_n6LXq .index-module_itemLiveVideoFrame_T7pik{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#1e2028;z-index:2}.index-module_WegoPluginComponentImage_n6LXq .index-module_itemLiveVideo_6WrWE{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:contain;z-index:3}',""]),i.locals={WegoPluginComponentImage:"index-module_WegoPluginComponentImage_n6LXq",selected:"index-module_selected_oGbkE",editMode:"index-module_editMode_PNsNc",editorImageContentframe:"index-module_editorImageContentframe_HYWkn",editorInnerContentframe:"index-module_editorInnerContentframe_dd+QI",resizeHandleLayer:"index-module_resizeHandleLayer_Jt9vB",resizeHandle:"index-module_resizeHandle_XKbPm",resizeHandle_nw:"index-module_resizeHandle_nw_IUf9u",resizeHandle_ne:"index-module_resizeHandle_ne_ppQeZ",resizeHandle_sw:"index-module_resizeHandle_sw_4IbJ+",resizeHandle_se:"index-module_resizeHandle_se_bRXVd",editorContentImage:"index-module_editorContentImage_ol+pA",itemLiveVideoFrame:"index-module_itemLiveVideoFrame_T7pik",itemLiveVideo:"index-module_itemLiveVideo_6WrWE"},t.A=i},27246:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});i.push([e.id,".index-module_WegoPluginComponentLink_nGppn{position:relative;display:flex;width:100%;box-sizing:border-box;white-space:pre-wrap;font-size:15px;line-height:24px;color:#285b9a;border-radius:8px;cursor:pointer}.index-module_WegoPluginComponentLink_nGppn:active{opacity:.6}.index-module_WegoPluginComponentLink_nGppn .index-module_wegoPluginLinkContent_w3pkD{white-space:pre-wrap}.index-module_WegoPluginComponentLink_nGppn .index-module_pluginLinkIcon_3aiFv{font-size:18px;line-height:18px;color:#285b9a}.index-module_WegoPluginComponentLink_nGppn .index-module_pluginLinkText_gW2TI{font-size:15px;line-height:24px;color:#285b9a}",""]),i.locals={WegoPluginComponentLink:"index-module_WegoPluginComponentLink_nGppn",wegoPluginLinkContent:"index-module_wegoPluginLinkContent_w3pkD",pluginLinkIcon:"index-module_pluginLinkIcon_3aiFv",pluginLinkText:"index-module_pluginLinkText_gW2TI"},t.A=i},56394:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});
21i.push([e.id,".index-module_WegoPluginComponentNote_NRVbY{position:relative;border-radius:8px;overflow:hidden;cursor:pointer}.index-module_WegoPluginComponentNote_NRVbY .ProseMirror{min-height:20px!important}.index-module_WegoPluginComponentNote_NRVbY .index-module_pluginComponentNoteContent_131pc{position:relative;padding:12px;border-radius:8px;background-color:rgba(32,47,100,.03)}.index-module_WegoPluginComponentNote_NRVbY.index-module_empty_ku5CP{display:none!important;padding:0!important;margin:0!important}.index-module_WegoPluginComponentNote_NRVbY.index-module_showEmpty_-Guaz{overflow:visible}.index-module_WegoPluginComponentNote_NRVbY.index-module_commonNoteContainer_7-bdt:active{background-color:rgba(32,47,100,.1)}.index-module_WegoPluginComponentNote_NRVbY .index-module_pluginContentframe_sN7Vz{position:relative;width:100%}.index-module_WegoPluginComponentNote_NRVbY .index-module_pluginContentframe_sN7Vz.index-module_editModeContainer_GOCeT{min-height:120px;max-height:400px}.index-module_WegoPluginComponentNote_NRVbY .index-module_noteContentMask_WnopP{position:absolute;left:-2px;right:-2px;bottom:0;height:100px;box-sizing:border-box;background:linear-gradient(180deg,rgba(30,32,40,0),rgba(30,32,40,.8));border-radius:0 0 8px 8px;z-index:1;cursor:pointer}.index-module_WegoPluginComponentNote_NRVbY .index-module_noteContentMask_WnopP .index-module_noteContentMark_DE-5Y{position:absolute;left:0;right:0;bottom:0;padding:12px;color:#fff;display:flex;align-items:center;justify-content:space-between}.index-module_WegoPluginComponentNote_NRVbY .index-module_noteContentMask_WnopP .index-module_noteContentMark_DE-5Y .index-module_noteMarkIcon_WiGWO{font-size:14px;line-height:14px}.index-module_WegoPluginComponentNote_NRVbY .index-module_noteContentMask_WnopP .index-module_noteContentMark_DE-5Y .index-module_noteMarkText_X4V3w{margin-left:4px;color:hsla(0,0%,100%,.8);font-size:12px;font-weight:400;line-height:18px}",""]),i.locals={WegoPluginComponentNote:"index-module_WegoPluginComponentNote_NRVbY",pluginComponentNoteContent:"index-module_pluginComponentNoteContent_131pc",empty:"index-module_empty_ku5CP",showEmpty:"index-module_showEmpty_-Guaz",commonNoteContainer:"index-module_commonNoteContainer_7-bdt",pluginContentframe:"index-module_pluginContentframe_sN7Vz",editModeContainer:"index-module_editModeContainer_GOCeT",noteContentMask:"index-module_noteContentMask_WnopP",noteContentMark:"index-module_noteContentMark_DE-5Y",noteMarkIcon:"index-module_noteMarkIcon_WiGWO",noteMarkText:"index-module_noteMarkText_X4V3w"},t.A=i},45061:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});i.push([e.id,".index-module_editorNoteCommonContent_mIwi-{display:flex;align-items:stretch}.index-module_editorNoteCommonContent_mIwi- .index-module_mediaTitle_eV3Wg{flex:1;display:flex;flex-direction:column;justify-content:space-between}.index-module_editorNoteCommonContent_mIwi- .index-module_mediaTitle_eV3Wg .index-module_title_rf2H1{color:#1e2028;font-size:14px;line-height:21px}.index-module_editorNoteCommonContent_mIwi- .index-module_mediaTitle_eV3Wg .index-module_mark_ZjRNG{display:flex;align-items:center;color:#6e7382}.index-module_editorNoteCommonContent_mIwi- .index-module_mediaTitle_eV3Wg .index-module_mark_ZjRNG .index-module_markIcon_vmb-q{font-size:14px;line-height:14px}.index-module_editorNoteCommonContent_mIwi- .index-module_mediaTitle_eV3Wg .index-module_mark_ZjRNG .index-module_markText_vmwip{margin-left:4px;font-size:12px;line-height:18px}.index-module_editorNoteCommonContent_mIwi- .index-module_mediaIcon_q3qOx{position:relative;flex:none;margin-left:16px}.index-module_editorNoteCommonContent_mIwi- .index-module_mediaIcon_q3qOx img{display:block;width:68px;height:68px;border-radius:6px;object-fit:cover}.index-module_editorNoteCommonContent_mIwi- .index-module_mediaIcon_q3qOx .index-module_meidaCountframe_Py8C\\+{position:absolute;left:0;bottom:0;width:100%;height:28px;background:linear-gradient(180deg,rgba(30,32,40,0) 21.43%,rgba(30,32,40,.3));border-radius:0 0 6px 6px;z-index:2}.index-module_editorNoteCommonContent_mIwi- .index-module_mediaIcon_q3qOx .index-module_meidaCount_17gE9{position:absolute;
21left:4px;bottom:4px;color:#fff;font-family:WegoKeyboard N9;font-size:12px;font-weight:500;line-height:12px}",""]),i.locals={editorNoteCommonContent:"index-module_editorNoteCommonContent_mIwi-",mediaTitle:"index-module_mediaTitle_eV3Wg",title:"index-module_title_rf2H1",mark:"index-module_mark_ZjRNG",markIcon:"index-module_markIcon_vmb-q",markText:"index-module_markText_vmwip",mediaIcon:"index-module_mediaIcon_q3qOx",meidaCountframe:"index-module_meidaCountframe_Py8C+",meidaCount:"index-module_meidaCount_17gE9"},t.A=i},38431:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});i.push([e.id,".index-module_WegoPluginComponentProduct_d8R8d{position:relative;width:100%;box-sizing:border-box;border-radius:8px;display:flex;align-items:stretch;cursor:pointer;-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}.index-module_WegoPluginComponentProduct_d8R8d.index-module_empty_O90kl{display:none!important;padding:0!important;margin:0!important}",""]),i.locals={WegoPluginComponentProduct:"index-module_WegoPluginComponentProduct_d8R8d",empty:"index-module_empty_O90kl"},t.A=i},865:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});i.push([e.id,".index-module_WegoPluginComponentSlide_kgPu5{position:relative;width:100%;box-sizing:border-box}.index-module_WegoPluginComponentSlide_kgPu5.index-module_editMode_82ggE .index-module_slideSwiperContent_HpG\\+c .index-module_slideItem_4R\\+g7:active:after{display:none}.index-module_WegoPluginComponentSlide_kgPu5 .index-module_slideRefreshElement_6\\+u6p{position:absolute;top:0;left:-100%;width:1px;height:1px;pointer-events:none}.index-module_WegoPluginComponentSlide_kgPu5 .index-module_slideSwiperframe_9NaWt{width:100%;height:320px}.index-module_WegoPluginComponentSlide_kgPu5 .index-module_slideSwiperContent_HpG\\+c{width:100%;height:320px;display:flex;overflow:hidden}.index-module_WegoPluginComponentSlide_kgPu5 .index-module_slideSwiperContent_HpG\\+c .index-module_slideItem_4R\\+g7{position:relative;width:auto;height:320px;cursor:pointer}.index-module_WegoPluginComponentSlide_kgPu5 .index-module_slideSwiperContent_HpG\\+c .index-module_slideItem_4R\\+g7:not(:first-child){margin-left:4px}.index-module_WegoPluginComponentSlide_kgPu5 .index-module_slideSwiperContent_HpG\\+c .index-module_slideItem_4R\\+g7 .index-module_slideItemImg_REEFV{display:block;width:auto;height:100%;object-fit:fill}.index-module_WegoPluginComponentSlide_kgPu5 .index-module_slideSwiperContent_HpG\\+c .index-module_slideItem_4R\\+g7 .index-module_itemLiveVideoFrame_juSF2{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#1e2028}.index-module_WegoPluginComponentSlide_kgPu5 .index-module_slideSwiperContent_HpG\\+c .index-module_slideItem_4R\\+g7 .index-module_itemLiveVideo_GA6T9{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:contain}.index-module_WegoPluginComponentSlide_kgPu5 .index-module_slideAddNewMedia_T5ZBW{display:flex;padding:4px 12px;justify-content:center;align-items:center;border-radius:32px;background:rgba(30,32,40,.4);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);position:absolute;left:50%;bottom:8px;-ms-transform:translateX(-50%);transform:translateX(-50%);z-index:2;cursor:pointer}.index-module_WegoPluginComponentSlide_kgPu5 .index-module_slideAddNewMedia_T5ZBW .index-module_icon_VD9vZ{margin-right:4px;font-size:16px;line-height:16px;color:#fff}.index-module_WegoPluginComponentSlide_kgPu5 .index-module_slideAddNewMedia_T5ZBW .index-module_text_KyW1m{color:#fff;font-size:14px;font-weight:400;line-height:21px}",""]),i.locals={WegoPluginComponentSlide:"index-module_WegoPluginComponentSlide_kgPu5",editMode:"index-module_editMode_82ggE",slideSwiperContent:"index-module_slideSwiperContent_HpG+c",slideItem:"index-module_slideItem_4R+g7",slideRefreshElement:"index-module_slideRefreshElement_6+u6p",slideSwiperframe:"index-module_slideSwiperframe_9NaWt",slideItemImg:"index-module_slideItemImg_REEFV",itemLiveVideoFrame:"index-module_itemLiveVideoFrame_juSF2",itemLiveVideo:"index-module_itemLiveVideo_GA6T9",slideAddNewMedia:"index-module_slideAddNewMedia_T5ZBW",icon:"index-module_icon_VD9vZ",text:"index-module_text_KyW1m"},t.A=i},43711:function(e,t,n){var r=n(69267),o=n.n(r),i=o()(function(e){return e[1]});
21i.push([e.id,".wego-editor-custom-plugin{position:relative;margin:8px 0;box-sizing:border-box;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}",""]),t.A=i},18761:function(e,t,n){n.d(t,{KE:function(){return zr},YY:function(){return Dr},CU:function(){return hr},bP:function(){return io},Yv:function(){return ao},Nz:function(){return Gr},gk:function(){return Ut},AB:function(){return Ur},T7:function(){return Bt},Nx:function(){return zt},gu:function(){return pn},FF:function(){return vn},iI:function(){return Vt},hO:function(){return gn},fl:function(){return yn},Pg:function(){return Pe},zU:function(){return Qt},hs:function(){return qr},QN:function(){return Dn},J_:function(){return xn},rU:function(){return bt},Op:function(){return Sn},BQ:function(){return Tn},FA:function(){return Pn},OX:function(){return jr},Zc:function(){return uo},KV:function(){return Zt},Ce:function(){return Hr},Dd:function(){return no},kj:function(){return ro},JJ:function(){return Vr},tG:function(){return Yr}});var r=n(47459),o=n(89575),i=n(86215),a=n(31694),u=n(4412);function s(e){return(0,o.A)(e)||(0,i.A)(e)||(0,a.A)(e)||(0,u.A)()}var l=n(3846),c=n(60738),d=n(52100),f=n(76880),p=n(83763),h=n(74337),m=n(1290),v=n(10020),g=n(95627),y=n(63887),b=n(34293),w=n(1635),A=n(94560),k=n(88688),C=function(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)};function D(e,t){var n=e.selection.$cursor;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}var x=function(e,t,n){var r=D(e,n);if(!r)return!1;var o=_(r);if(!o){var i=r.blockRange(),a=i&&(0,w.jP)(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}var u=o.nodeBefore;if(K(e,o,t,-1))return!0;if(0==r.parent.content.size&&(T(u,"end")||k.nh.isSelectable(u)))for(var s=r.depth;;s--){var l=(0,w.$L)(e.doc,r.before(s),r.after(s),A.Ji.empty);if(l&&l.slice.size<l.to-l.from){if(t){var c=e.tr.step(l);c.setSelection(T(u,"end")?k.LN.findFrom(c.doc.resolve(c.mapping.map(o.pos,-1)),-1):k.nh.create(c.doc,o.pos-u.nodeSize)),t(c.scrollIntoView())}return!0}if(1==s||r.node(s-1).childCount>1)break}return!(!u.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos-u.nodeSize,o.pos).scrollIntoView()),!0)},E=function(e,t,n){var r=D(e,n);if(!r)return!1;var o=_(r);return!!o&&S(e,o,t)},M=function(e,t,n){var r=I(e,n);if(!r)return!1;var o=F(r);return!!o&&S(e,o,t)};function S(e,t,n){for(var r=t.nodeBefore,o=r,i=t.pos-1;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;var a=o.lastChild;if(!a)return!1;o=a}for(var u=t.nodeAfter,s=u,l=t.pos+1;!s.isTextblock;l++){if(s.type.spec.isolating)return!1;var c=s.firstChild;if(!c)return!1;s=c}var d=(0,w.$L)(e.doc,i,l,A.Ji.empty);if(!d||d.from!=i||d instanceof w.Ln&&d.slice.size>=l-i)return!1;if(n){var f=e.tr.step(d);f.setSelection(k.U3.create(f.doc,i)),n(f.scrollIntoView())}return!0}function T(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}var P=function(e,t,n){var r=e.selection,o=r.$head,i=r.empty,a=o;if(!i)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;a=_(o)}var u=a&&a.nodeBefore;return!(!u||!k.nh.isSelectable(u))&&(t&&t(e.tr.setSelection(k.nh.create(e.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)};function _(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function I(e,t){var n=e.selection.$cursor;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}var N=function(e,t,n){var r=I(e,n);if(!r)return!1;var o=F(r);if(!o)return!1;var i=o.nodeAfter;if(K(e,o,t,1))return!0;if(0==r.parent.content.size&&(T(i,"start")||k.nh.isSelectable(i))){var a=(0,w.$L)(e.doc,r.before(),r.after(),A.Ji.empty);if(a&&a.slice.size<a.to-a.from){if(t){var u=e.tr.step(a);u.setSelection(T(i,"start")?k.LN.findFrom(u.doc.resolve(u.mapping.map(o.pos)),1):k.nh.create(u.doc,u.mapping.map(o.pos))),t(u.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)}
21,O=function(e,t,n){var r=e.selection,o=r.$head,i=r.empty,a=o;if(!i)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):o.parentOffset<o.parent.content.size)return!1;a=F(o)}var u=a&&a.nodeAfter;return!(!u||!k.nh.isSelectable(u))&&(t&&t(e.tr.setSelection(k.nh.create(e.doc,a.pos)).scrollIntoView()),!0)};function F(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var L=function(e,t){var n,r=e.selection,o=r instanceof k.nh;if(o){if(r.node.isTextblock||!(0,w.n9)(e.doc,r.from))return!1;n=r.from}else if(n=(0,w.N0)(e.doc,r.from,-1),null==n)return!1;if(t){var i=e.tr.join(n);o&&i.setSelection(k.nh.create(i.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(i.scrollIntoView())}return!0},B=function(e,t){var n,r=e.selection;if(r instanceof k.nh){if(r.node.isTextblock||!(0,w.n9)(e.doc,r.to))return!1;n=r.to}else if(n=(0,w.N0)(e.doc,r.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0},R=function(e,t){var n=e.selection,r=n.$from,o=n.$to,i=r.blockRange(o),a=i&&(0,w.jP)(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},z=function(e,t){var n=e.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function j(e){for(var t=0;t<e.edgeCount;t++){var n=e.edge(t),r=n.type;if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}var H=function(e,t){var n=e.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var i=r.node(-1),a=r.indexAfter(-1),u=j(i.contentMatchAt(a));if(!u||!i.canReplaceWith(a,a,u))return!1;if(t){var s=r.after(),l=e.tr.replaceWith(s,s,u.createAndFill());l.setSelection(k.LN.near(l.doc.resolve(s),1)),t(l.scrollIntoView())}return!0},V=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(n instanceof k.i5||r.parent.inlineContent||o.parent.inlineContent)return!1;var i=j(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){var a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,u=e.tr.insert(a,i.createAndFill());u.setSelection(k.U3.create(u.doc,a+1)),t(u.scrollIntoView())}return!0},Y=function(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var r=n.before();if((0,w.zy)(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&(0,w.jP)(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)};function W(e){return function(t,n){var r=t.selection,o=r.$from,i=r.$to;if(t.selection instanceof k.nh&&t.selection.node.isBlock)return!(!o.parentOffset||!(0,w.zy)(t.doc,o.pos))&&(n&&n(t.tr.split(o.pos).scrollIntoView()),!0);if(!o.depth)return!1;for(var a,u,s=[],l=!1,c=!1,d=o.depth;;d--){var f=o.node(d);if(f.isBlock){l=o.end(d)==o.pos+(o.depth-d),c=o.start(d)==o.pos-(o.depth-d),u=j(o.node(d-1).contentMatchAt(o.indexAfter(d-1)));var p=e&&e(i.parent,l,o);s.unshift(p||(l&&u?{type:u}:null)),a=d;break}if(1==d)return!1;s.unshift(null)}var h=t.tr;(t.selection instanceof k.U3||t.selection instanceof k.i5)&&h.deleteSelection();var m=h.mapping.map(o.pos),v=(0,w.zy)(h.doc,m,s.length,s);if(v||(s[0]=u?{type:u}:null,v=(0,w.zy)(h.doc,m,s.length,s)),!v)return!1;if(h.split(m,s.length,s),!l&&c&&o.node(a).type!=u){var g=h.mapping.map(o.before(a)),y=h.doc.resolve(g);u&&o.node(a-1).canReplaceWith(y.index(),y.index()+1,u)&&h.setNodeMarkup(h.mapping.map(o.before(a)),u)}return n&&n(h.scrollIntoView()),!0}}var G=W(),U=function(e,t){var n,r=e.selection,o=r.$from,i=r.to,a=o.sharedDepth(i);return 0!=a&&(n=o.before(a),t&&t(e.tr.setSelection(k.nh.create(e.doc,n))),!0)},q=function(e,t){return t&&t(e.tr.setSelection(new k.i5(e.doc))),!0};function $(e,t,n){var r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!!(r&&o&&r.type.compatibleContent(o.type))&&(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(i,i+1)||!o.isTextblock&&!(0,w.n9)(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))}function K(e,t,n,r){var o,i,a=t.nodeBefore,u=t.nodeAfter,s=a.type.spec.isolating||u.type.spec.isolating;if(!s&&$(e,t,n))return!0;var l=!s&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(i=a.contentMatchAt(a.childCount)).findWrapping(u.type))&&i.matchType(o[0]||u.type).validEnd){if(n){for(var c=t.pos+u.nodeSize,d=A.FK.empty,f=o.length-1;f>=0;f--)d=A.FK.from(o[f].create(null,d));d=A.FK.from(a.copy(d));var p=e.tr.step(new w.Wg(t.pos-1,c,t.pos,c,new A.Ji(d,1,0),o.length,!0)),h=p.doc.resolve(c+2*o.length);h.nodeAfter&&h.nodeAfter.type==a.type&&(0,w.n9)(p.doc,h.pos)&&p.join(h.pos),n(p.scrollIntoView())}return!0}var m=u.type.spec.isolating||r>0&&s?null:k.LN.findFrom(t,1),v=m&&m.$from.blockRange(m.$to),g=v&&(0,w.jP)(v);if(null!=g&&g>=t.depth)return n&&n(e.tr.lift(v,g).scrollIntoView()),!0;if(l&&T(u,"start",!0)&&T(a,"end")){for(var y=a,b=[];;){if(b.push(y),y.isTextblock)break;y=y.lastChild}for(var C=u,D=1;!C.isTextblock;C=C.firstChild)D++;if(y.canReplace(y.childCount,y.childCount,C.content)){if(n){for(var x=A.FK.empty,E=b.length-1;E>=0;E--)x=A.FK.from(b[E].copy(x));var M=e.tr.step(new w.Wg(t.pos-b.length,t.pos+u.nodeSize,t.pos+D,t.pos+u.nodeSize-D,new A.Ji(x,b.length,0),0,!0));n(M.scrollIntoView())}return!0}}return!1}function J(e){return function(t,n){var r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;while(o.node(i).isInline){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(k.U3.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}var X=J(-1),Z=J(1);function Q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.$from,a=o.$to,u=i.blockRange(a),s=u&&(0,w.oM)(u,e,t);return!!s&&(r&&r(n.tr.wrap(u,s).scrollIntoView()),!0)}}function ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){for(var o=!1,i=0;i<n.selection.ranges.length&&!o;i++){var a=n.selection.ranges[i],u=a.$from.pos,s=a.$to.pos;n.doc.nodesBetween(u,s,function(r,i){if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{var a=n.doc.resolve(i),u=a.index();o=a.parent.canReplaceWith(u,u+1,e)}})}if(!o)return!1;if(r){for(var l=n.tr,c=0;c<n.selection.ranges.length;c++){var d=n.selection.ranges[c],f=d.$from.pos,p=d.$to.pos;l.setBlockType(f,p,e,t)}r(l.scrollIntoView())}return!0}}function te(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n,r){for(var o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var ne=te(C,x,P),re=te(C,N,O),oe={Enter:te(z,V,Y,G),"Mod-Enter":H,Backspace:ne,"Mod-Backspace":ne,"Shift-Backspace":ne,Delete:re,"Mod-Delete":re,"Mod-a":q},ie={"Ctrl-h":oe["Backspace"],"Alt-Backspace":oe["Mod-Backspace"],"Ctrl-d":oe["Delete"],"Ctrl-Alt-Backspace":oe["Mod-Delete"],"Alt-Delete":oe["Mod-Delete"],"Alt-d":oe["Mod-Delete"],"Ctrl-a":X,"Ctrl-e":Z};for(var ae in oe)ie[ae]=oe[ae];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&os.platform();function ue(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.$from,a=o.$to,u=i.blockRange(a);if(!u)return!1;var s=r?n.tr:null;return!!se(s,u,e,t)&&(r&&r(s.scrollIntoView()),!0)}}function se(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=!1,i=t,a=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){
21if(0==t.$from.index(t.depth-1))return!1;var u=a.resolve(t.start-2);i=new A.u$(u,u,t.depth),t.endIndex<t.parent.childCount&&(t=new A.u$(t.$from,a.resolve(t.$to.end(t.depth)),t.depth)),o=!0}var s=(0,w.oM)(i,n,r,t);return!!s&&(e&&le(e,t,s,o,n),!0)}function le(e,t,n,r,o){for(var i=A.FK.empty,a=n.length-1;a>=0;a--)i=A.FK.from(n[a].type.create(n[a].attrs,i));e.step(new w.Wg(t.start-(r?2:0),t.end,t.start,t.end,new A.Ji(i,0,0),n.length,!0));for(var u=0,s=0;s<n.length;s++)n[s].type==o&&(u=s+1);for(var l=n.length-u,c=t.start+n.length-(r?2:0),d=t.parent,f=t.startIndex,p=t.endIndex,h=!0;f<p;f++,h=!1)!h&&(0,w.zy)(e.doc,c,l)&&(e.split(c,l),c+=2*l),c+=d.child(f).nodeSize;return e}function ce(e){return function(t,n){var r=t.selection,o=r.$from,i=r.$to,a=o.blockRange(i,function(t){return t.childCount>0&&t.firstChild.type==e});return!!a&&(!n||(o.node(a.depth-1).type==e?de(t,n,e,a):fe(t,n,a)))}}function de(e,t,n,r){var o=e.tr,i=r.end,a=r.$to.end(r.depth);i<a&&(o.step(new w.Wg(i-1,a,i,a,new A.Ji(A.FK.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new A.u$(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));var u=(0,w.jP)(r);if(null==u)return!1;o.lift(r,u);var s=o.doc.resolve(o.mapping.map(i,-1)-1);return(0,w.n9)(o.doc,s.pos)&&s.nodeBefore.type==s.nodeAfter.type&&o.join(s.pos),t(o.scrollIntoView()),!0}function fe(e,t,n){for(var r=e.tr,o=n.parent,i=n.end,a=n.endIndex-1,u=n.startIndex;a>u;a--)i-=o.child(a).nodeSize,r.delete(i-1,i+1);var s=r.doc.resolve(n.start),l=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;var c=0==n.startIndex,d=n.endIndex==o.childCount,f=s.node(-1),p=s.index(-1);if(!f.canReplace(p+(c?0:1),p+1,l.content.append(d?A.FK.empty:A.FK.from(o))))return!1;var h=s.pos,m=h+l.nodeSize;return r.step(new w.Wg(h-(c?1:0),m+(d?1:0),h+1,m-1,new A.Ji((c?A.FK.empty:A.FK.from(o.copy(A.FK.empty))).append(d?A.FK.empty:A.FK.from(o.copy(A.FK.empty))),c?0:1,d?0:1),c?0:1)),t(r.scrollIntoView()),!0}function pe(e){return function(t,n){var r=t.selection,o=r.$from,i=r.$to,a=o.blockRange(i,function(t){return t.childCount>0&&t.firstChild.type==e});if(!a)return!1;var u=a.startIndex;if(0==u)return!1;var s=a.parent,l=s.child(u-1);if(l.type!=e)return!1;if(n){var c=l.lastChild&&l.lastChild.type==s.type,d=A.FK.from(c?e.create():null),f=new A.Ji(A.FK.from(e.create(null,A.FK.from(s.type.create(null,d)))),c?3:1,0),p=a.start,h=a.end;n(t.tr.step(new w.Wg(p-(c?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0}}var he=n(35316),me=n(63555);function ve(e,t,n){return t=(0,d.A)(t),(0,l.A)(e,(0,c.A)()?Reflect.construct(t,n||[],(0,d.A)(e).constructor):t.apply(e,n))}function ge(e,t,n,r){var o=(0,f.A)((0,d.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}var ye=Object.defineProperty,be=function(e,t){for(var n in t)ye(e,n,{get:t[n],enumerable:!0})};function we(e){var t=e.state,n=e.transaction,r=n.selection,o=n.doc,i=n.storedMarks;return(0,b.A)((0,b.A)({},t),{},{apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}})}var Ae=function(){function e(t){(0,g.A)(this,e),this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}return(0,y.A)(e,[{key:"hasCustomState",get:function(){return!!this.customState}},{key:"state",get:function(){return this.customState||this.editor.state}},{key:"commands",get:function(){var e=this,t=this.rawCommands,n=this.editor,r=this.state,o=n.view,i=r.tr,a=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(function(t){var n=(0,v.A)(t,2),r=n[0],u=n[1],s=function(){var t=u.apply(void 0,arguments)(a);return i.getMeta("preventDispatch")||e.hasCustomState||o.dispatch(i),t};return[r,s]}))}},{key:"chain",get:function(){var e=this;return function(){return e.createChain()}}},{key:"can",get:function(){var e=this;return function(){return e.createCan()}}},{key:"createChain",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,i=this.state,a=o.view,u=[],s=!!e,l=e||i.tr,c=function(){return s||!n||l.getMeta("preventDispatch")||t.hasCu
21stomState||a.dispatch(l),u.every(function(e){return!0===e})},d=(0,b.A)((0,b.A)({},Object.fromEntries(Object.entries(r).map(function(e){var r=(0,v.A)(e,2),o=r[0],i=r[1],a=function(){var e=t.buildProps(l,n),r=i.apply(void 0,arguments)(e);return u.push(r),d};return[o,a]}))),{},{run:c});return d}},{key:"createCan",value:function(e){var t=this,n=this.rawCommands,r=this.state,o=!1,i=e||r.tr,a=this.buildProps(i,o),u=Object.fromEntries(Object.entries(n).map(function(e){var t=(0,v.A)(e,2),n=t[0],r=t[1];return[n,function(){return r.apply(void 0,arguments)((0,b.A)((0,b.A)({},a),{},{dispatch:void 0}))}]}));return(0,b.A)((0,b.A)({},u),{},{chain:function(){return t.createChain(i,o)}})}},{key:"buildProps",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,i=this.state,a=o.view,u={tr:e,editor:o,view:a,state:we({state:i,transaction:e}),dispatch:n?function(){}:void 0,chain:function(){return t.createChain(e,n)},can:function(){return t.createCan(e)},get commands(){return Object.fromEntries(Object.entries(r).map(function(e){var t=(0,v.A)(e,2),n=t[0],r=t[1];return[n,function(){return r.apply(void 0,arguments)(u)}]}))}};return u}}])}(),ke={};be(ke,{blur:function(){return Ce},clearContent:function(){return De},clearNodes:function(){return xe},command:function(){return Ee},createParagraphNear:function(){return Me},cut:function(){return Se},deleteCurrentNode:function(){return Te},deleteNode:function(){return _e},deleteRange:function(){return Ie},deleteSelection:function(){return Le},enter:function(){return Be},exitCode:function(){return Re},extendMarkRange:function(){return Ge},first:function(){return Ue},focus:function(){return Qe},forEach:function(){return et},insertContent:function(){return tt},insertContentAt:function(){return ut},joinBackward:function(){return ct},joinDown:function(){return lt},joinForward:function(){return dt},joinItemBackward:function(){return ft},joinItemForward:function(){return pt},joinTextblockBackward:function(){return ht},joinTextblockForward:function(){return mt},joinUp:function(){return st},keyboardShortcut:function(){return yt},lift:function(){return wt},liftEmptyBlock:function(){return At},liftListItem:function(){return kt},newlineInCode:function(){return Ct},resetAttributes:function(){return Et},scrollIntoView:function(){return Mt},selectAll:function(){return St},selectNodeBackward:function(){return Tt},selectNodeForward:function(){return Pt},selectParentNode:function(){return _t},selectTextblockEnd:function(){return It},selectTextblockStart:function(){return Nt},setContent:function(){return Ft},setMark:function(){return Fn},setMeta:function(){return Ln},setNode:function(){return Bn},setNodeSelection:function(){return Rn},setTextDirection:function(){return zn},setTextSelection:function(){return jn},sinkListItem:function(){return Hn},splitBlock:function(){return Yn},splitListItem:function(){return Wn},toggleList:function(){return $n},toggleMark:function(){return Kn},toggleNode:function(){return Jn},toggleWrap:function(){return Xn},undoInputRule:function(){return Zn},unsetAllMarks:function(){return Qn},unsetMark:function(){return er},unsetTextDirection:function(){return tr},updateAttributes:function(){return nr},wrapIn:function(){return rr},wrapInList:function(){return or}});var Ce=function(){return function(e){var t=e.editor,n=e.view;return requestAnimationFrame(function(){var e;t.isDestroyed||(n.dom.blur(),null==(e=null==window?void 0:window.getSelection())||e.removeAllRanges())}),!0}},De=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=t.commands;return n.setContent("",{emitUpdate:e})}}
21,xe=function(){return function(e){var t=e.state,n=e.tr,r=e.dispatch,o=n.selection,i=o.ranges;return!r||(i.forEach(function(e){var r=e.$from,o=e.$to;t.doc.nodesBetween(r.pos,o.pos,function(e,t){if(!e.type.isText){var r=n.doc,o=n.mapping,i=r.resolve(o.map(t)),a=r.resolve(o.map(t+e.nodeSize)),u=i.blockRange(a);if(u){var s=(0,w.jP)(u);if(e.type.isTextblock){var l=i.parent.contentMatchAt(i.index()),c=l.defaultType;n.setNodeMarkup(u.start,c)}(s||0===s)&&n.lift(u,s)}}})}),!0)}},Ee=function(e){return function(t){return e(t)}},Me=function(){return function(e){var t=e.state,n=e.dispatch;return V(t,n)}},Se=function(e,t){return function(n){var r=n.editor,o=n.tr,i=r.state,a=i.doc.slice(e.from,e.to);o.deleteRange(e.from,e.to);var u=o.mapping.map(t);return o.insert(u,a.content),o.setSelection(new k.U3(o.doc.resolve(Math.max(u-1,0)))),!0}},Te=function(){return function(e){var t=e.tr,n=e.dispatch,r=t.selection,o=r.$anchor.node();if(o.content.size>0)return!1;for(var i=t.selection.$anchor,a=i.depth;a>0;a-=1){var u=i.node(a);if(u.type===o.type){if(n){var s=i.before(a),l=i.after(a);t.delete(s,l).scrollIntoView()}return!0}}return!1}};function Pe(e,t){if("string"===typeof e){if(!t.nodes[e])throw Error("There is no node type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.nodes[e]}return e}var _e=function(e){return function(t){for(var n=t.tr,r=t.state,o=t.dispatch,i=Pe(e,r.schema),a=n.selection.$anchor,u=a.depth;u>0;u-=1){var s=a.node(u);if(s.type===i){if(o){var l=a.before(u),c=a.after(u);n.delete(l,c).scrollIntoView()}return!0}}return!1}},Ie=function(e){return function(t){var n=t.tr,r=t.dispatch,o=e.from,i=e.to;return r&&n.delete(o,i),!0}},Ne=function(e){if(!e.content)return!1;var t=/^text(\*|\+)/;return t.test(e.content)},Oe=function(e,t,n){if(!e.parent.isInline)return e.pos;if("left"===n&&e.pos>e.start()||"right"===n&&e.pos<e.end())return e.pos;var r=t.nodes[e.parent.type.name].spec;return Ne(r)?"left"===n?e.start()-1:e.end()+1:e.pos},Fe=function(e,t,n){var r=Oe(e,n,"left"),o=Oe(t,n,"right");return{from:r,to:o}},Le=function(){return function(e){var t=e.state,n=e.dispatch,r=t.selection,o=r.$from,i=r.$to;if(t.selection.empty)return!1;var a=Fe(o,i,t.schema),u=a.from,s=a.to;return n&&(t.tr.deleteRange(u,s).scrollIntoView(),n(t.tr)),!0}},Be=function(){return function(e){var t=e.commands;return t.keyboardShortcut("Enter")}},Re=function(){return function(e){var t=e.state,n=e.dispatch;return H(t,n)}};function ze(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function je(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{strict:!0},r=Object.keys(t);return!r.length||r.every(function(r){return n.strict?t[r]===e[r]:ze(t[r])?t[r].test(e[r]):t[r]===e[r]})}function He(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.find(function(e){return e.type===t&&je(Object.fromEntries(Object.keys(n).map(function(t){return[t,e.attrs[t]]})),n)})}function Ve(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!!He(e,t,n)}function Ye(e,t,n){if(e&&t){var r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some(function(e){return e.type===t})||(r=e.parent.childBefore(e.parentOffset)),r.node&&r.node.marks.some(function(e){return e.type===t})){if(!n){var o=r.node.marks.find(function(e){return e.type===t});o&&(n=o.attrs)}var i=He((0,m.A)(r.node.marks),t,n);if(i){var a=r.index,u=e.start()+r.offset,s=a+1,l=u+r.node.nodeSize;while(a>0&&Ve((0,m.A)(e.parent.child(a-1).marks),t,n))a-=1,u-=e.parent.child(a).nodeSize;while(s<e.parent.childCount&&Ve((0,m.A)(e.parent.child(s).marks),t,n))l+=e.parent.child(s).nodeSize,s+=1;return{from:u,to:l}}}}}function We(e,t){if("string"===typeof e){if(!t.marks[e])throw Error("There is no mark type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.marks[e]}return e}var Ge=function(e,t){return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=We(e,o.schema),u=r.doc,s=r.selection,l=s.$from,c=s.from,d=s.to;if(i){var f=Ye(l,a,t);if(f&&f.from<=c&&f.to>=d){var p=k.U3.create(u,f.from,f.to);r.setSelection(p)}}return!0}},Ue=function(e){return function(t){for(var n="function"===typeof e?e(t):e,r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1}};function qe(e){return e instanceof k.U3}function $e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.min(Math.max(e,t),n)}function Ke(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;var n=k.LN.atStart(e),r=k.LN.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;var o=n.from,i=r.to;return"all"===t?k.U3.create(e,$e(0,o,i),$e(e.content.size,o,i)):k.U3.create(e,$e(t,o,i),$e(t,o,i))}function Je(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function Xe(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ze(){return"undefined"!==typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var Qe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.editor,o=n.view,i=n.tr,a=n.dispatch;t=(0,b.A)({scrollIntoView:!0},t);var u=function(){(Xe()||Je())&&o.dom.focus(),!Ze()||Xe()||Je()||o.dom.focus({preventScroll:!0}),requestAnimationFrame(function(){r.isDestroyed||(o.focus(),(null==t?void 0:t.scrollIntoView)&&r.commands.scrollIntoView())})};try{if(o.hasFocus()&&null===e||!1===e)return!0}catch(c){return!1}if(a&&null===e&&!qe(r.state.selection))return u(),!0;var s=Ke(i.doc,e)||r.state.selection,l=r.state.selection.eq(s);return a&&(l||i.setSelection(s),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),u()),!0}},et=function(e,t){return function(n){return e.every(function(e,r){return t(e,(0,b.A)((0,b.A)({},n),{},{index:r}))})}},tt=function(e,t){return function(n){var r=n.tr,o=n.commands;return o.insertContentAt({from:r.selection.from,to:r.selection.to},e,t)}},nt=function(e){for(var t=e.childNodes,n=t.length-1;n>=0;n-=1){var r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&nt(r)}return e};function rt(e){if("undefined"===typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");var t="<body>".concat(e,"</body>"),n=(new window.DOMParser).parseFromString(t,"text/html").body;return nt(n)}function ot(e,t,n){if(e instanceof A.bP||e instanceof A.FK)return e;n=(0,b.A)({slice:!0,parseOptions:{}},n);
21var r="object"===typeof e&&null!==e,o="string"===typeof e;if(r)try{var i=Array.isArray(e)&&e.length>0;if(i)return A.FK.fromArray(e.map(function(e){return t.nodeFromJSON(e)}));var a=t.nodeFromJSON(e);return n.errorOnInvalidContent&&a.check(),a}catch(d){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:d});return ot("",t,n)}if(o){if(n.errorOnInvalidContent){var u=!1,s="",l=new A.Sj({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:function(e){return u=!0,s="string"===typeof e?e:e.outerHTML,null}}]}})});if(n.slice?A.S4.fromSchema(l).parseSlice(rt(e),n.parseOptions):A.S4.fromSchema(l).parse(rt(e),n.parseOptions),n.errorOnInvalidContent&&u)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error("Invalid element found: ".concat(s))})}var c=A.S4.fromSchema(t);return n.slice?c.parseSlice(rt(e),n.parseOptions).content:c.parse(rt(e),n.parseOptions)}return ot("",t,n)}function it(e,t,n){var r=e.steps.length-1;if(!(r<t)){var o=e.steps[r];if(o instanceof w.Ln||o instanceof w.Wg){var i=e.mapping.maps[r],a=0;i.forEach(function(e,t,n,r){0===a&&(a=r)}),e.setSelection(k.LN.near(e.doc.resolve(a),n))}}}var at=function(e){return!("type"in e)},ut=function(e,t,n){return function(r){var o,i=r.tr,a=r.dispatch,u=r.editor;if(a){var s;n=(0,b.A)({parseOptions:u.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1},n);var l=function(e){u.emit("contentError",{editor:u,error:e,disableCollaboration:function(){"collaboration"in u.storage&&"object"===typeof u.storage.collaboration&&u.storage.collaboration&&(u.storage.collaboration.isDisabled=!0)}})},c=(0,b.A)({preserveWhitespace:"full"},n.parseOptions);if(!n.errorOnInvalidContent&&!u.options.enableContentCheck&&u.options.emitContentError)try{ot(t,u.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(T){l(T)}try{s=ot(t,u.schema,{parseOptions:c,errorOnInvalidContent:null!=(o=n.errorOnInvalidContent)?o:u.options.enableContentCheck})}catch(T){return l(T),!1}var d,f="number"===typeof e?{from:e,to:e}:{from:e.from,to:e.to},p=f.from,h=f.to,m=!0,v=!0,g=at(s)?s:[s];if(g.forEach(function(e){e.check(),m=!!m&&(e.isText&&0===e.marks.length),v=!!v&&e.isBlock}),p===h&&v){var y=i.doc.resolve(p),w=y.parent,k=w.isTextblock&&!w.type.spec.code&&!w.childCount;k&&(p-=1,h+=1)}if(m){if(Array.isArray(t))d=t.map(function(e){return e.text||""}).join("");else if(t instanceof A.FK){var C="";t.forEach(function(e){e.text&&(C+=e.text)}),d=C}else d="object"===typeof t&&t&&t.text?t.text:t;i.insertText(d,p,h)}else{d=s;var D=i.doc.resolve(p),x=D.node(),E=0===D.parentOffset,M=x.isText||x.isTextblock,S=x.content.size>0;E&&M&&S&&v&&(p=Math.max(0,p-1)),i.replaceWith(p,h,d)}n.updateSelection&&it(i,i.steps.length-1,-1),n.applyInputRules&&i.setMeta("applyInputRules",{from:p,text:d}),n.applyPasteRules&&i.setMeta("applyPasteRules",{from:p,text:d})}return!0}},st=function(){return function(e){var t=e.state,n=e.dispatch;return L(t,n)}},lt=function(){return function(e){var t=e.state,n=e.dispatch;return B(t,n)}},ct=function(){return function(e){var t=e.state,n=e.dispatch;return x(t,n)}},dt=function(){return function(e){var t=e.state,n=e.dispatch;return N(t,n)}},ft=function(){return function(e){var t=e.state,n=e.dispatch,r=e.tr;try{var o=(0,w.N0)(t.doc,t.selection.$from.pos,-1);return null!==o&&void 0!==o&&(r.join(o,2),n&&n(r),!0)}catch(i){return!1}}},pt=function(){return function(e){var t=e.state,n=e.dispatch,r=e.tr;try{var o=(0,w.N0)(t.doc,t.selection.$from.pos,1);return null!==o&&void 0!==o&&(r.join(o,2),n&&n(r),!0)}catch(i){return!1}}},ht=function(){return function(e){var t=e.state,n=e.dispatch;return E(t,n)}},mt=function(){return function(e){var t=e.state,n=e.dispatch;return M(t,n)}};function vt(){return"undefined"!==typeof navigator&&/Mac/.test(navigator.platform)}function gt(e){var t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"===a&&(a=" ");for(var u=0;u<i.length-1;u+=1){var s=i[u];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: ".concat(s));Xe()||vt()?o=!0:n=!0}}return t&&(a="Alt-".concat(a)),n&&(a="Ctrl-".concat(a)),o&&(a="Meta-".concat(a)),r&&(a="Shift-".concat(a)),a}var yt=function(e){return function(t){var n=t.editor,r=t.view,o=t.tr,i=t.dispatch,a=gt(e).split(/-(?!$)/),u=a.find(function(e){return!["Alt","Ctrl","Meta","Shift"].includes(e)}
21),s=new KeyboardEvent("keydown",{key:"Space"===u?" ":u,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),l=n.captureTransaction(function(){r.someProp("handleKeyDown",function(e){return e(r,s)})});return null==l||l.steps.forEach(function(e){var t=e.map(o.mapping);t&&i&&o.maybeStep(t)}),!0}};function bt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.from,i=r.to,a=r.empty,u=t?Pe(t,e.schema):null,s=[];e.doc.nodesBetween(o,i,function(e,t){if(!e.isText){var n=Math.max(o,t),r=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:r})}});var l=i-o,c=s.filter(function(e){return!u||u.name===e.node.type.name}).filter(function(e){return je(e.node.attrs,n,{strict:!1})});if(a)return!!c.length;var d=c.reduce(function(e,t){return e+t.to-t.from},0);return d>=l}var wt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch,i=Pe(e,r.schema),a=bt(r,i,t);return!!a&&R(r,o)}},At=function(){return function(e){var t=e.state,n=e.dispatch;return Y(t,n)}},kt=function(e){return function(t){var n=t.state,r=t.dispatch,o=Pe(e,n.schema);return ce(o)(n,r)}},Ct=function(){return function(e){var t=e.state,n=e.dispatch;return z(t,n)}};function Dt(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function xt(e,t){var n="string"===typeof t?[t]:t;return Object.keys(e).reduce(function(t,r){return n.includes(r)||(t[r]=e[r]),t},{})}var Et=function(e,t){return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,u=null,s=Dt("string"===typeof e?e:e.name,o.schema);if(!s)return!1;"node"===s&&(a=Pe(e,o.schema)),"mark"===s&&(u=We(e,o.schema));var l=!1;return r.selection.ranges.forEach(function(e){o.doc.nodesBetween(e.$from.pos,e.$to.pos,function(e,n){a&&a===e.type&&(l=!0,i&&r.setNodeMarkup(n,void 0,xt(e.attrs,t))),u&&e.marks.length&&e.marks.forEach(function(o){u===o.type&&(l=!0,i&&r.addMark(n,n+e.nodeSize,u.create(xt(o.attrs,t))))})})}),l}},Mt=function(){return function(e){var t=e.tr,n=e.dispatch;return n&&t.scrollIntoView(),!0}},St=function(){return function(e){var t=e.tr,n=e.dispatch;if(n){var r=new k.i5(t.doc);t.setSelection(r)}return!0}},Tt=function(){return function(e){var t=e.state,n=e.dispatch;return P(t,n)}},Pt=function(){return function(e){var t=e.state,n=e.dispatch;return O(t,n)}},_t=function(){return function(e){var t=e.state,n=e.dispatch;return U(t,n)}},It=function(){return function(e){var t=e.state,n=e.dispatch;return Z(t,n)}},Nt=function(){return function(e){var t=e.state,n=e.dispatch;return X(t,n)}};function Ot(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return ot(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Ft=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errorOnInvalidContent,r=t.emitUpdate,o=void 0===r||r,i=t.parseOptions,a=void 0===i?{}:i;return function(t){var r=t.editor,i=t.tr,u=t.dispatch,s=t.commands,l=i.doc;if("full"!==a.preserveWhitespace){var c=Ot(e,r.schema,a,{errorOnInvalidContent:null!=n?n:r.options.enableContentCheck});return u&&i.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!o),!0}return u&&i.setMeta("preventUpdate",!o),s.insertContentAt({from:0,to:l.content.size},e,{parseOptions:a,errorOnInvalidContent:null!=n?n:r.options.enableContentCheck})}};function Lt(e,t){var n=We(t,e.schema),r=e.selection,o=r.from,i=r.to,a=r.empty,u=[];a?(e.storedMarks&&u.push.apply(u,(0,m.A)(e.storedMarks)),u.push.apply(u,(0,m.A)(e.selection.$head.marks()))):e.doc.nodesBetween(o,i,function(e){u.push.apply(u,(0,m.A)(e.marks))});var s=u.find(function(e){return e.type.name===n.name});return s?(0,b.A)({},s.attrs):{}}function Bt(e,t){var n=new w.dL(e);return t.forEach(function(e){e.steps.forEach(function(e){n.step(e)})}),n}function Rt(e){for(var t=0;t<e.edgeCount;t+=1){var n=e.edge(t),r=n.type;if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}function zt(e,t,n){var r=[];return e.nodesBetween(t.from,t.to,function(e,t){n(e)&&r.push({node:e,pos:t})}),r}function jt(e,t){for(var n=e.depth;n>0;n-=1){var r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function Ht(e){return function(t){return jt(t.$from,e)}}function Vt(e,t,n){if(void 0===e.config[t]&&e.parent)return Vt(e.parent,t,n);if("function"===typeof e.config[t]){var r=e.config[t].bind((0,b.A)((0,b.A)({},n),{},{parent:e.parent?Vt(e.parent,t,n):null}));return r}return e.config[t]}function Yt(e){return e.map(function(e){var t={name:e.name,options:e.options,storage:e.storage},n=Vt(e,"addExtensions",t);return n?[e].concat((0,m.A)(Yt(n()))):e}).flat(10)}function Wt(e,t){var n=A.ZF.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument(),o=r.createElement("div");return o.appendChild(n),o.innerHTML}function Gt(e){return"function"===typeof e}function Ut(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(Gt(e)){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t?e.bind(t).apply(void 0,r):e.apply(void 0,r)}return e}function qt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.keys(e).length&&e.constructor===Object}function $t(e){var t=e.filter(function(e){return"extension"===e.type}),n=e.filter(function(e){return"node"===e.type}),r=e.filter(function(e){return"mark"===e.type});return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function Kt(e){var t=[],n=$t(e),r=n.nodeExtensions,o=n.markExtensions,i=[].concat((0,m.A)(r),(0,m.A)(o)),a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},u=r.filter(function(e){return"text"!==e.name}).map(function(e){return e.name}),s=o.map(function(e){return e.name}),l=[].concat((0,m.A)(u),(0,m.A)(s));return e.forEach(function(e){var n={name:e.name,options:e.options,storage:e.storage,extensions:i},r=Vt(e,"addGlobalAttributes",n);if(r){var o=r();o.forEach(function(e){var n;n=Array.isArray(e.types)?e.types:"*"===e.types?l:"nodes"===e.types?u:"marks"===e.types?s:[],n.forEac
21h(function(n){Object.entries(e.attributes).forEach(function(e){var r=(0,v.A)(e,2),o=r[0],i=r[1];t.push({type:n,name:o,attribute:(0,b.A)((0,b.A)({},a),i)})})})})}}),i.forEach(function(e){var n={name:e.name,options:e.options,storage:e.storage},r=Vt(e,"addAttributes",n);if(r){var o=r();Object.entries(o).forEach(function(n){var r=(0,v.A)(n,2),o=r[0],i=r[1],u=(0,b.A)((0,b.A)({},a),i);"function"===typeof(null==u?void 0:u.default)&&(u.default=u.default()),(null==u?void 0:u.isRequired)&&void 0===(null==u?void 0:u.default)&&delete u.default,t.push({type:e.name,name:o,attribute:u})})}}),t}function Jt(e){for(var t=[],n="",r=!1,o=!1,i=0,a=e.length,u=0;u<a;u+=1){var s=e[u];if("'"!==s||o)if('"'!==s||r){if(!r&&!o){if("("===s){i+=1,n+=s;continue}if(")"===s&&i>0){i-=1,n+=s;continue}if(";"===s&&0===i){t.push(n),n="";continue}}n+=s}else o=!o,n+=s;else r=!r,n+=s}return n&&t.push(n),t}function Xt(e){for(var t=[],n=Jt(e||""),r=n.length,o=0;o<r;o+=1){var i=n[o],a=i.indexOf(":");if(-1!==a){var u=i.slice(0,a).trim(),s=i.slice(a+1).trim();u&&s&&t.push([u,s])}}return t}function Zt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return!!e}).reduce(function(e,t){var n=(0,b.A)({},e);return Object.entries(t).forEach(function(e){var t=(0,v.A)(e,2),r=t[0],o=t[1],i=n[r];if(i)if("class"===r){var a=o?String(o).split(" "):[],u=n[r]?n[r].split(" "):[],s=a.filter(function(e){return!u.includes(e)});n[r]=[].concat((0,m.A)(u),(0,m.A)(s)).join(" ")}else if("style"===r){var l=new Map([].concat((0,m.A)(Xt(n[r])),(0,m.A)(Xt(o))));n[r]=Array.from(l.entries()).map(function(e){var t=(0,v.A)(e,2),n=t[0],r=t[1];return"".concat(n,": ").concat(r)}).join("; ")}else n[r]=o;else n[r]=o}),n},{})}function Qt(e,t){return t.filter(function(t){return t.type===e.type.name}).filter(function(e){return e.attribute.rendered}).map(function(t){return t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:(0,h.A)({},t.name,e.attrs[t.name])}).reduce(function(e,t){return Zt(e,t)},{})}function en(e){return"string"!==typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}function tn(e,t){return"style"in e?e:(0,b.A)((0,b.A)({},e),{},{getAttrs:function(n){var r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;var o=t.reduce(function(e,t){var r=t.attribute.parseHTML?t.attribute.parseHTML(n):en(n.getAttribute(t.name));return null===r||void 0===r?e:(0,b.A)((0,b.A)({},e),{},(0,h.A)({},t.name,r))},{});return(0,b.A)((0,b.A)({},r),o)}})}function nn(e){return Object.fromEntries(Object.entries(e).filter(function(e){var t=(0,v.A)(e,2),n=t[0],r=t[1];return("attrs"!==n||!qt(r))&&(null!==r&&void 0!==r)}))}function rn(e){var t,n,r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),void 0!==(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)&&(r.validate=e.attribute.validate),[e.name,r]}function on(e,t){var n,r=Kt(e),o=$t(e),i=o.nodeExtensions,a=o.markExtensions,u=null==(n=i.find(function(e){return Vt(e,"topNode")}))?void 0:n.name,s=Object.fromEntries(i.map(function(n){var o=r.filter(function(e){return e.type===n.name}),i={name:n.name,options:n.options,storage:n.storage,editor:t},a=e.reduce(function(e,t){var r=Vt(t,"extendNodeSchema",i);return(0,b.A)((0,b.A)({},e),r?r(n):{})},{}),u=nn((0,b.A)((0,b.A)({},a),{},{content:Ut(Vt(n,"content",i)),marks:Ut(Vt(n,"marks",i)),group:Ut(Vt(n,"group",i)),inline:Ut(Vt(n,"inline",i)),atom:Ut(Vt(n,"atom",i)),selectable:Ut(Vt(n,"selectable",i)),draggable:Ut(Vt(n,"draggable",i)),code:Ut(Vt(n,"code",i)),whitespace:Ut(Vt(n,"whitespace",i)),linebreakReplacement:Ut(Vt(n,"linebreakReplacement",i)),defining:Ut(Vt(n,"defining",i)),isolating:Ut(Vt(n,"isolating",i)),attrs:Object.fromEntries(o.map(rn))})),s=Ut(Vt(n,"parseHTML",i));s&&(u.parseDOM=s.map(function(e){return tn(e,o)}));var l=Vt(n,"renderHTML",i);l&&(u.toDOM=function(e){return l({node:e,HTMLAttributes:Qt(e,o)})});var c=Vt(n,"renderText",i);return c&&(u.toText=c),[n.name,u]})),l=Object.fromEntries(a.map(function(n){var o=r.filter(function(e){return e.type===n.name}),i={name:n.name,options:n.options,storage:n.storage,editor:t},a=e.reduce(function(e,t){var r=Vt(t,"extendMarkSchema",i);return(0,b.A)((0,b.A)({},e),r?r(n):{})},{}),u=nn((0,b.A)((0,b.A)({},a),{},{inclusive:Ut(Vt(n,"inclusive",i)),excludes:Ut(Vt(n,"excludes",i)),group:Ut(Vt(n,"group",i)),spanning:Ut(Vt(n,"spanning",i)),code:Ut(Vt(n,"code",i)),attrs:Object.fromEntries(o.map(rn))})),s=Ut(Vt(n,"parseHTML",i));s&&(u.parseDOM=s.map(function(e){return tn(e,o)}));var l=Vt(n,"renderHTML",i);return l&&(u.toDOM=function(e){return l({mark:e,HTMLAttributes:Qt(e,o)})}),[n.name,u]}));return new A.Sj({topNode:u,nodes:s,marks:l})}function an(e){var t=e.filter(function(t,n){return e.indexOf(t)!==n});return Array.from(new Set(t))}function un(e){var t=100;return e.sort(function(e,n){var r=Vt(e,"priority")||t,o=Vt(n,"priority")||t;return r>o?-1:r<o?1:0})}function sn(e){var t=un(Yt(e)),n=an(t.map(function(e){return e.name}));return n.length&&"[tiptap warn]: Duplicate extension names found: [".concat(n.map(function(e){return"'".concat(e,"'")}).join(", "),"]. This can lead to issues."),t}
21function ln(e,t,n){var r=t.from,o=t.to,i=n||{},a=i.blockSeparator,u=void 0===a?"\n\n":a,s=i.textSerializers,l=void 0===s?{}:s,c="";return e.nodesBetween(r,o,function(e,n,i,a){var s;e.isBlock&&n>r&&(c+=u);var d=null==l?void 0:l[e.type.name];if(d)return i&&(c+=d({node:e,pos:n,parent:i,index:a,range:t})),!1;e.isText&&(c+=null==(s=null==e?void 0:e.text)?void 0:s.slice(Math.max(r,n)-n,o-n))}),c}function cn(e,t){var n={from:0,to:e.content.size};return ln(e,n,t)}function dn(e){return Object.fromEntries(Object.entries(e.nodes).filter(function(e){var t=(0,v.A)(e,2),n=t[1];return n.spec.toText}).map(function(e){var t=(0,v.A)(e,2),n=t[0],r=t[1];return[n,r.spec.toText]}))}function fn(e,t){var n=Pe(t,e.schema),r=e.selection,o=r.from,i=r.to,a=[];e.doc.nodesBetween(o,i,function(e){a.push(e)});var u=a.reverse().find(function(e){return e.type.name===n.name});return u?(0,b.A)({},u.attrs):{}}function pn(e,t){var n=Dt("string"===typeof t?t:t.name,e.schema);return"node"===n?fn(e,t):"mark"===n?Lt(e,t):{}}function hn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify,n={};return e.filter(function(e){var r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}function mn(e){var t=hn(e);return 1===t.length?t:t.filter(function(e,n){var r=t.filter(function(e,t){return t!==n});return!r.some(function(t){return e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to})})}function vn(e){var t=e.mapping,n=e.steps,r=[];return t.maps.forEach(function(e,o){var i=[];if(e.ranges.length)e.forEach(function(e,t){i.push({from:e,to:t})});else{var a=n[o],u=a.from,s=a.to;if(void 0===u||void 0===s)return;i.push({from:u,to:s})}i.forEach(function(e){var n=e.from,i=e.to,a=t.slice(o).map(n,-1),u=t.slice(o).map(i),s=t.invert().map(a,-1),l=t.invert().map(u);r.push({oldRange:{from:s,to:l},newRange:{from:a,to:u}})})}),mn(r)}function gn(e,t,n){var r=[];return e===t?n.resolve(e).marks().forEach(function(t){var o=n.resolve(e),i=Ye(o,t.type);i&&r.push((0,b.A)({mark:t},i))}):n.nodesBetween(e,t,function(e,t){e&&void 0!==(null==e?void 0:e.nodeSize)&&r.push.apply(r,(0,m.A)(e.marks.map(function(n){return{from:t,to:t+e.nodeSize,mark:n}})))}),r}var yn=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:20,o=e.doc.resolve(n),i=r,a=null;while(i>0&&null===a){var u=o.node(i);(null==u?void 0:u.type.name)===t?a=u:i-=1}return[a,i]};function bn(e,t){return t.nodes[e]||t.marks[e]||null}function wn(e,t,n){return Object.fromEntries(Object.entries(n).filter(function(n){var r=(0,v.A)(n,1),o=r[0],i=e.find(function(e){return e.type===t&&e.name===o});return!!i&&i.attribute.keepOnSplit}))}var An=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,function(e,t,o,i){var a,u,s=(null==(u=(a=e.type.spec).toText)?void 0:u.call(a,{node:e,pos:t,parent:o,index:i}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function kn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.empty,i=r.ranges,a=t?We(t,e.schema):null;if(o)return!!(e.storedMarks||e.selection.$from.marks()).filter(function(e){return!a||a.name===e.type.name}).find(function(e){return je(e.attrs,n,{strict:!1})});var u=0,s=[];if(i.forEach(function(t){var n=t.$from,r=t.$to,o=n.pos,i=r.pos;e.doc.nodesBetween(o,i,function(e,t){if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(e.isText||e.marks.length){var n=Math.max(o,t),r=Math.min(i,t+e.nodeSize),l=r-n;u+=l,s.push.apply(s,(0,m.A)(e.marks.map(function(e){return{mark:e,from:n,to:r}})))}})}),0===u)return!1;var l=s.filter(function(e){return!a||a.name===e.mark.type.name}).filter(function(e){return je(e.mark.attrs,n,{strict:!1})}).reduce(function(e,t){return e+t.to-t.from},0),c=s.filter(function(e){return!a||e.mark.type!==a&&e.mark.type.excludes(a)}).reduce(function(e,t){return e+t.to-t.from},0),d=l>0?l+c:l;return d>=u}function Cn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return bt(e,null,n)||kn(e,null,n);var r=Dt(t,e.schema);return"node"===r?bt(e,t,n):"mark"===r&&kn(e,t,n)}var Dn=function(e,t){var n=e.selection,r=n.$from,o=n.$to,i=n.$anchor;if(t){var a=Ht(function(e){return e.type.name===t})(e.selection);if(!a)return!1;var u=e.doc.resolve(a.pos+1);return i.pos+1===u.end()}return!(o.parentOffset<o.parent.nodeSize-2||r.pos!==o.pos)},xn=function(e){var t=e.selection,n=t.$from,r=t.$to;return!(n.parentOffset>0||n.pos!==r.pos)};function En(e,t){return Array.isArray(t)?t.some(function(t){var n="string"===typeof t?t:t.name;return n===e.name}):t}function Mn(e,t){var n=$t(t),r=n.nodeExtensions,o=r.find(function(t){return t.name===e});if(!o)return!1;var i={name:o.name,options:o.options,storage:o.storage},a=Ut(Vt(o,"group",i));return"string"===typeof a&&a.split(" ").includes("list")}function Sn(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.checkChildren,o=void 0===r||r,i=n.ignoreWhitespace,a=void 0!==i&&i;
21if(a){if("hardBreak"===e.type.name)return!0;if(e.isText)return!/\S/.test(null!=(t=e.text)?t:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(o){var u=!0;return e.content.forEach(function(e){!1!==u&&(Sn(e,{ignoreWhitespace:a,checkChildren:o})||(u=!1))}),u}return!1}function Tn(e){return e instanceof k.nh}function Pn(e){var t=e.selection,n=e.pos,r=e.nodeSize,o=e.selectedOnTextSelection,i=void 0!==o&&o,a=t.from,u=t.to;return a<=n&&u>=n+r||!!(i&&qe(t)&&a>n&&u<n+r)}var _n=function(){function e(t){(0,g.A)(this,e),this.position=t}return(0,y.A)(e,[{key:"toJSON",value:function(){return{position:this.position}}}],[{key:"fromJSON",value:function(t){return new e(t.position)}}])}();function In(e,t){var n=t.mapping.mapResult(e.position);return{position:new _n(n.pos),mapResult:n}}function Nn(e){return new _n(e)}function On(e,t,n){var r,o=t.selection,i=null;if(qe(o)&&(i=o.$cursor),i){var a=null!=(r=e.storedMarks)?r:i.marks(),u=i.parent.type.allowsMarkType(n);return u&&(!!n.isInSet(a)||!a.some(function(e){return e.type.excludes(n)}))}var s=o.ranges;return s.some(function(t){var r=t.$from,o=t.$to,i=0===r.depth&&(e.doc.inlineContent&&e.doc.type.allowsMarkType(n));return e.doc.nodesBetween(r.pos,o.pos,function(e,t,r){if(i)return!1;if(e.isInline){var o=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(function(e){return e.type.excludes(n)});i=o&&a}return!i}),i})}var Fn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=r.selection,u=a.empty,s=a.ranges,l=We(e,o.schema);if(i)if(u){var c=Lt(o,l);r.addStoredMark(l.create((0,b.A)((0,b.A)({},c),t)))}else s.forEach(function(e){var n=e.$from.pos,i=e.$to.pos;o.doc.nodesBetween(n,i,function(e,o){var a=Math.max(o,n),u=Math.min(o+e.nodeSize,i),s=e.marks.find(function(e){return e.type===l});s?e.marks.forEach(function(e){l===e.type&&r.addMark(a,u,l.create((0,b.A)((0,b.A)({},e.attrs),t)))}):r.addMark(a,u,l.create(t))})});return On(o,r,l)}},Ln=function(e,t){return function(n){var r=n.tr;return r.setMeta(e,t),!0}},Bn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r,o=n.state,i=n.dispatch,a=n.chain,u=Pe(e,o.schema);return o.selection.$anchor.sameParent(o.selection.$head)&&(r=o.selection.$anchor.parent.attrs),!!u.isTextblock&&a().command(function(e){var n=e.commands,i=ee(u,(0,b.A)((0,b.A)({},r),t))(o);return!!i||n.clearNodes()}).command(function(e){var n=e.state;return ee(u,(0,b.A)((0,b.A)({},r),t))(n,i)}).run()}},Rn=function(e){return function(t){var n=t.tr,r=t.dispatch;if(r){var o=n.doc,i=$e(e,0,o.content.size),a=k.nh.create(o,i);n.setSelection(a)}return!0}},zn=function(e,t){return function(n){var r,o,i=n.tr,a=n.state,u=n.dispatch,s=a.selection;return"number"===typeof t?(r=t,o=t):t&&"from"in t&&"to"in t?(r=t.from,o=t.to):(r=s.from,o=s.to),u&&i.doc.nodesBetween(r,o,function(t,n){t.isText||i.setNodeMarkup(n,void 0,(0,b.A)((0,b.A)({},t.attrs),{},{dir:e}))}),!0}},jn=function(e){return function(t){var n=t.tr,r=t.dispatch;if(r){var o=n.doc,i="number"===typeof e?{from:e,to:e}:e,a=i.from,u=i.to,s=k.U3.atStart(o).from,l=k.U3.atEnd(o).to,c=$e(a,s,l),d=$e(u,s,l),f=k.U3.create(o,c,d);n.setSelection(f)}return!0}},Hn=function(e){return function(t){var n=t.state,r=t.dispatch,o=Pe(e,n.schema);return pe(o)(n,r)}};function Vn(e,t){var n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){var r=n.filter(function(e){return null==t?void 0:t.includes(e.type.name)});e.tr.ensureMarks(r)}}var Yn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.keepMarks,n=void 0===t||t;return function(e){var t=e.tr,r=e.state,o=e.dispatch,i=e.editor,a=t.selection,u=t.doc,s=a.$from,l=a.$to,c=i.extensionManager.attributes,d=wn(c,s.node().type.name,s.node().attrs);if(a instanceof k.nh&&a.node.isBlock)return!(!s.parentOffset||!(0,w.zy)(u,s.pos))&&(o&&(n&&Vn(r,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;var f=l.parentOffset===l.parent.content.size,p=0===s.depth?void 0:Rt(s.node(-1).contentMatchAt(s.indexAfter(-1))),h=f&&p?[{type:p,attrs:d}]:void 0,m=(0,w.zy)(t.doc,t.mapping.map(s.pos),1,h);if(h||m||!(0,w.zy)(t.doc,t.mapping.map(s.pos),1,p?[{type:p}]:void 0)||(m=!0,h=p?[{type:p,attrs:d}]:void 0),o){if(m&&(a instanceof k.U3&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,h),p&&!f&&!s.parentOffset&&s.parent.type!==p)){var v=t.mapping.map(s.before()),g=t.doc.resolve(v);
21s.node(-1).canReplaceWith(g.index(),g.index()+1,p)&&t.setNodeMarkup(t.mapping.map(s.before()),p)}n&&Vn(r,i.extensionManager.splittableMarks),t.scrollIntoView()}return m}},Wn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r,o=n.tr,i=n.state,a=n.dispatch,u=n.editor,s=Pe(e,i.schema),l=i.selection,c=l.$from,d=l.$to,f=i.selection.node;if(f&&f.isBlock||c.depth<2||!c.sameParent(d))return!1;var p=c.node(-1);if(p.type!==s)return!1;var h=u.extensionManager.attributes;if(0===c.parent.content.size&&c.node(-1).childCount===c.indexAfter(-1)){if(2===c.depth||c.node(-3).type!==s||c.index(-2)!==c.node(-2).childCount-1)return!1;if(a){for(var m=A.FK.empty,v=c.index(-1)?1:c.index(-2)?2:3,g=c.depth-v;g>=c.depth-3;g-=1)m=A.FK.from(c.node(g).copy(m));var y=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,C=(0,b.A)((0,b.A)({},wn(h,c.node().type.name,c.node().attrs)),t),D=(null==(r=s.contentMatch.defaultType)?void 0:r.createAndFill(C))||void 0;m=m.append(A.FK.from(s.createAndFill(null,D)||void 0));var x=c.before(c.depth-(v-1));o.replace(x,c.after(-y),new A.Ji(m,4-v,0));var E=-1;o.doc.nodesBetween(x,o.doc.content.size,function(e,t){if(E>-1)return!1;e.isTextblock&&0===e.content.size&&(E=t+1)}),E>-1&&o.setSelection(k.U3.near(o.doc.resolve(E))),o.scrollIntoView()}return!0}var M=d.pos===c.end()?p.contentMatchAt(0).defaultType:null,S=(0,b.A)((0,b.A)({},wn(h,p.type.name,p.attrs)),t),T=(0,b.A)((0,b.A)({},wn(h,c.node().type.name,c.node().attrs)),t);o.delete(c.pos,d.pos);var P=M?[{type:s,attrs:S},{type:M,attrs:T}]:[{type:s,attrs:S}];if(!(0,w.zy)(o.doc,c.pos,2))return!1;if(a){var _=i.selection,I=i.storedMarks,N=u.extensionManager.splittableMarks,O=I||_.$to.parentOffset&&_.$from.marks();if(o.split(c.pos,2,P).scrollIntoView(),!O||!a)return!0;var F=O.filter(function(e){return N.includes(e.type.name)});o.ensureMarks(F)}return!0}},Gn=function(e,t){var n=Ht(function(e){return e.type===t})(e.selection);if(!n)return!0;var r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;var o=e.doc.nodeAt(r),i=n.node.type===(null==o?void 0:o.type)&&(0,w.n9)(e.doc,n.pos);return!i||(e.join(n.pos),!0)},Un=function(e,t){var n=Ht(function(e){return e.type===t})(e.selection);if(!n)return!0;var r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;var o=e.doc.nodeAt(r),i=n.node.type===(null==o?void 0:o.type)&&(0,w.n9)(e.doc,r);return!i||(e.join(r),!0)};function qn(e){var t=e.doc,n=t.firstChild;if(!n)return null;var r=t.resolve(1),o=t.resolve(n.nodeSize-1);return k.U3.between(r,o)}var $n=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return function(o){var i=o.editor,a=o.tr,u=o.state,s=o.dispatch,l=o.chain,c=o.commands,d=o.can,f=i.extensionManager,p=f.extensions,h=f.splittableMarks,m=Pe(e,u.schema),v=Pe(t,u.schema),g=u.selection,y=u.storedMarks,b=g.$from,w=g.$to,A=b.blockRange(w),k=y||g.$to.parentOffset&&g.$from.marks();if(!A)return!1;var C=Ht(function(e){return Mn(e.type.name,p)})(g),D=0===g.from&&g.to===u.doc.content.size,x=u.doc.content.content,E=1===x.length?x[0]:null,M=D&&E&&Mn(E.type.name,p)?{node:E,pos:0,depth:0}:null,S=null!=C?C:M,T=!!C&&A.depth>=1&&A.depth-C.depth<=1,P=!!M;if((T||P)&&S){if(S.node.type===m)return D&&P?l().command(function(e){var t=e.tr,n=e.dispatch,r=qn(t);return!!r&&(t.setSelection(r),n&&n(t),!0)}).liftListItem(v).run():c.liftListItem(v);if(Mn(S.node.type.name,p)&&m.validContent(S.node.content))return l().command(function(){return a.setNodeMarkup(S.pos,m),!0}).command(function(){return Gn(a,m)}).command(function(){return Un(a,m)}).run()}return n&&k&&s?l().command(function(){var e=d().wrapInList(m,r),t=k.filter(function(e){return h.includes(e.type.name)});return a.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(m,r).command(function(){return Gn(a,m)}).command(function(){return Un(a,m)}).run():l().command(function(){var e=d().wrapInList(m,r);return!!e||c.clearNodes()}).wrapInList(m,r).command(function(){return Gn(a,m)}).command(function(){return Un(a,m)}).run()}},Kn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.state,i=r.commands,a=n.extendEmptyMarkRange,u=void 0!==a&&a,s=We(e,o.schema),l=kn(o,s,t);return l?i.unsetMark(s,{extendEmptyMarkRange:u}):i.setMark(s,t)}},Jn=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o,i=r.state,a=r.commands,u=Pe(e,i.schema),s=Pe(t,i.schema),l=bt(i,u,n);return i.selection.$anchor.sameParent(i.selection.$head)&&(o=i.selection.$anchor.parent.attrs),l?a.setNode(s,o):a.setNode(u,(0,b.A)((0,b.A)({},o),n))}},Xn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.commands,i=Pe(e,r.schema),a=bt(r,i,t);return a?o.lift(i):o.wrapIn(i,t)}},Zn=function(){return function(e){for(var t=e.state,n=e.dispatch,r=t.plugins,o=0;o<r.length;o+=1){var i=r[o],a=void 0;
21if(i.spec.isInputRules&&(a=i.getState(t))){if(n){for(var u=t.tr,s=a.transform,l=s.steps.length-1;l>=0;l-=1)u.step(s.steps[l].invert(s.docs[l]));if(a.text){var c=u.doc.resolve(a.from).marks();u.replaceWith(a.from,a.to,t.schema.text(a.text,c))}else u.delete(a.from,a.to)}return!0}}return!1}},Qn=function(){return function(e){var t=e.tr,n=e.dispatch,r=t.selection,o=r.empty,i=r.ranges;return o||n&&i.forEach(function(e){t.removeMark(e.$from.pos,e.$to.pos)}),!0}},er=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r,o=n.tr,i=n.state,a=n.dispatch,u=t.extendEmptyMarkRange,s=void 0!==u&&u,l=o.selection,c=We(e,i.schema),d=l.$from,f=l.empty,p=l.ranges;if(!a)return!0;if(f&&s){var h=l.from,m=l.to,v=null==(r=d.marks().find(function(e){return e.type===c}))?void 0:r.attrs,g=Ye(d,c,v);g&&(h=g.from,m=g.to),o.removeMark(h,m,c)}else p.forEach(function(e){o.removeMark(e.$from.pos,e.$to.pos,c)});return o.removeStoredMark(c),!0}},tr=function(e){return function(t){var n,r,o=t.tr,i=t.state,a=t.dispatch,u=i.selection;return"number"===typeof e?(n=e,r=e):e&&"from"in e&&"to"in e?(n=e.from,r=e.to):(n=u.from,r=u.to),a&&o.doc.nodesBetween(n,r,function(e,t){if(!e.isText){var n=(0,b.A)({},e.attrs);delete n.dir,o.setNodeMarkup(t,void 0,n)}}),!0}},nr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,u=null,s=Dt("string"===typeof e?e:e.name,o.schema);if(!s)return!1;"node"===s&&(a=Pe(e,o.schema)),"mark"===s&&(u=We(e,o.schema));var l=!1;return r.selection.ranges.forEach(function(e){var n,s,c,d,f=e.$from.pos,p=e.$to.pos;r.selection.empty?o.doc.nodesBetween(f,p,function(e,t){a&&a===e.type&&(l=!0,c=Math.max(t,f),d=Math.min(t+e.nodeSize,p),n=t,s=e)}):o.doc.nodesBetween(f,p,function(e,o){o<f&&a&&a===e.type&&(l=!0,c=Math.max(o,f),d=Math.min(o+e.nodeSize,p),n=o,s=e),o>=f&&o<=p&&(a&&a===e.type&&(l=!0,i&&r.setNodeMarkup(o,void 0,(0,b.A)((0,b.A)({},e.attrs),t))),u&&e.marks.length&&e.marks.forEach(function(n){if(u===n.type&&(l=!0,i)){var a=Math.max(o,f),s=Math.min(o+e.nodeSize,p);r.addMark(a,s,u.create((0,b.A)((0,b.A)({},n.attrs),t)))}}))}),s&&(void 0!==n&&i&&r.setNodeMarkup(n,void 0,(0,b.A)((0,b.A)({},s.attrs),t)),u&&s.marks.length&&s.marks.forEach(function(e){u===e.type&&i&&r.addMark(c,d,u.create((0,b.A)((0,b.A)({},e.attrs),t)))}))}),l}},rr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch,i=Pe(e,r.schema);return Q(i,t)(r,o)}},or=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch,i=Pe(e,r.schema);return ue(i,t)(r,o)}},ir=function(){function e(){(0,g.A)(this,e),this.callbacks={}}return(0,y.A)(e,[{key:"on",value:function(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=this.callbacks[e];return i&&i.forEach(function(e){return e.apply(t,r)}),this}},{key:"off",value:function(e,t){var n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(function(e){return e!==t}):delete this.callbacks[e]),this}},{key:"once",value:function(e,t){var n=this,r=function(){n.off(e,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];t.apply(n,i)};return this.on(e,r)}},{key:"removeAllListeners",value:function(){this.callbacks={}}}])}(),ar=(0,y.A)(function e(t){var n;(0,g.A)(this,e),this.find=t.find,this.handler=t.handler,this.undoable=null==(n=t.undoable)||n}),ur=function(e,t){if(ze(t))return t.exec(e);var n=t(e);if(!n)return null;var r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith),r.push(n.replaceWith)),r};function sr(e){var t,n=e.editor,r=e.from,o=e.to,i=e.text,a=e.rules,u=e.plugin,s=n.view;if(s.composing)return!1;var l=s.state.doc.resolve(r);if(l.parent.type.spec.code||(null==(t=l.nodeBefore||l.nodeAfter)?void 0:t.marks.find(function(e){return e.type.spec.code})))return!1;var c=!1,d=An(l)+i;return a.forEach(function(e){if(!c){var t=ur(d,e.find);if(t){var a=s.state.tr,l=we({state:s.state,transaction:a}),f={from:r-(t[0].length-i.length),to:o},p=new Ae({editor:n,state:l}),h=p.commands,m=p.chain,v=p.can,g=e.handler({state:l,range:f,match:t,commands:h,chain:m,can:v});null!==g&&a.steps.length&&(e.undoable&&a.setMeta(u,{transform:a,from:r,to:o,text:i}),s.dispatch(a),c=!0)}}}),c}function lr(e){var t=e.editor,n=e.rules,r=new k.k_({state:{init:function(){return null},apply:function(e,o,i){var a=e.getMeta(r);if(a)return a;var u=e.getMeta("applyInputRules"),s=!!u;return s&&setTimeout(function(){var e=u.text;"string"===typeof e||(e=Wt(A.FK.from(e),i.schema));var o=u.from,a=o+e.length;sr({editor:t,from:o,to:a,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:function(e,o,i,a){return sr({editor:t,from:o,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:function(e){return setTimeout(function(){var o=e.state.selection.$cursor;o&&sr({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1}},handleKeyDown:function(e,o){if("Enter"!==o.key)return!1;var i=e.state.selection.$cursor;return!!i&&sr({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}function cr(e){return Object.prototype.toString.call(e).slice(8,-1)}function dr(e){return"Object"===cr(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function fr(e,t){var n=(0,b.A)({},e);return dr(e)&&dr(t)&&Object.keys(t).forEach(function(r){dr(t[r])&&dr(e[r])?n[r]=fr(e[r],t[r]):n[r]=t[r]}),n}var pr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,g.A)(this,e),this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config=(0,b.A)((0,b.A)({},this.config),t),this.name=this.config.name}return(0,y.A)(e,[{key:"options",get:function(){return(0,b.A)({},Ut(Vt(this,"addOptions",{name:this.name}))||{})}},{key:"storage",get:function(){return(0,b.A)({},Ut(Vt(this,"addStorage",{name:this.name,options:this.options}))||{})}},{key:"configure",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.extend((0,b.A)((0,b.A)({},this.config),{},{addOptions:function(){return fr(e.options,t)}}));return n.name=this.name,n.parent=this.parent,this.child=null,n}},{key:"extend",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new this.constructor((0,b.A)((0,b.A)({},this.config),e));return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}}])}(),hr=function(e){function t(){var e;return(0,g.A)(this,t),e=ve(this,t,arguments),e.type="mark",e}
21return(0,p.A)(t,e),(0,y.A)(t,[{key:"configure",value:function(e){return ge(t,"configure",this,3)([e])}},{key:"extend",value:function(e){var n="function"===typeof e?e():e;return ge(t,"extend",this,3)([n])}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="function"===typeof e?e():e;return new t(n)}},{key:"handleExit",value:function(e){var t=e.editor,n=e.mark,r=t.state.tr,o=t.state.selection.$from,i=o.pos===o.end();if(i){var a=o.marks(),u=!!a.find(function(e){return(null==e?void 0:e.type.name)===n.name});if(!u)return!1;var s=a.find(function(e){return(null==e?void 0:e.type.name)===n.name});return s&&r.removeStoredMark(s),r.insertText(" ",o.pos),t.view.dispatch(r),!0}return!1}}])}(pr);function mr(e){return"number"===typeof e}var vr=(0,y.A)(function e(t){(0,g.A)(this,e),this.find=t.find,this.handler=t.handler}),gr=function(e,t,n){if(ze(t))return(0,m.A)(e.matchAll(t));var r=t(e,n);return r?r.map(function(t){var n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith),n.push(t.replaceWith)),n}):[]};function yr(e){var t=e.editor,n=e.state,r=e.from,o=e.to,i=e.rule,a=e.pasteEvent,u=e.dropEvent,s=new Ae({editor:t,state:n}),l=s.commands,c=s.chain,d=s.can,f=[];n.doc.nodesBetween(r,o,function(e,t){var s,p,h,m,v;if(!(null==(p=null==(s=e.type)?void 0:s.spec)?void 0:p.code)&&(e.isText||e.isTextblock||e.isInline)){var g=null!=(v=null!=(m=null==(h=e.content)?void 0:h.size)?m:e.nodeSize)?v:0,y=Math.max(r,t),b=Math.min(o,t+g);if(!(y>=b)){var w=e.isText?e.text||"":e.textBetween(y-t,b-t,void 0,""),A=gr(w,i.find,a);A.forEach(function(e){if(void 0!==e.index){var t=y+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},s=i.handler({state:n,range:o,match:e,commands:l,chain:c,can:d,pasteEvent:a,dropEvent:u});f.push(s)}})}}});var p=f.every(function(e){return null!==e});return p}var br=null,wr=function(e){var t,n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n};function Ar(e){var t,n=e.editor,r=e.rules,o=null,i=!1,a=!1,u="undefined"!==typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="undefined"!==typeof DragEvent?new DragEvent("drop"):null}catch(c){t=null}var s=function(e){var r=e.state,o=e.from,i=e.to,a=e.rule,s=e.pasteEvt,l=r.tr,c=we({state:r,transaction:l}),d=yr({editor:n,state:c,from:Math.max(o-1,0),to:i.b-1,rule:a,pasteEvent:s,dropEvent:t});if(d&&l.steps.length){try{t="undefined"!==typeof DragEvent?new DragEvent("drop"):null}catch(f){t=null}return u="undefined"!==typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}},l=r.map(function(e){return new k.k_({view:function(e){var t=function(t){var r;o=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null,o&&(br=n)},r=function(){br&&(br=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",r),{destroy:function(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:function(e,n){if(a=o===e.dom.parentElement,t=n,!a){var r=br;(null==r?void 0:r.isEditable)&&setTimeout(function(){var e=r.state.selection;e&&r.commands.deleteRange({from:e.from,to:e.to})},10)}return!1},paste:function(e,t){var n,r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return u=t,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:function(t,n,r){var o=t[0],l="paste"===o.getMeta("uiEvent")&&!i,c="drop"===o.getMeta("uiEvent")&&!a,d=o.getMeta("applyPasteRules"),f=!!d;if(l||c||f){if(f){var p=d.text;"string"===typeof p||(p=Wt(A.FK.from(p),r.schema));var h=d.from,m=h+p.length,v=wr(p);return s({rule:e,state:r,from:h,to:{b:m},pasteEvt:v})}var g=n.doc.content.findDiffStart(r.doc.content),y=n.doc.content.findDiffEnd(r.doc.content);if(mr(g)&&y&&g!==y.b)return s({rule:e,state:r,from:g,to:y,pasteEvt:u})}}})});return l}var kr=function(){function e(t,n){(0,g.A)(this,e),this.splittableMarks=[],this.editor=n,this.baseExtensions=t,this.extensions=sn(t),this.schema=on(this.extensions,n),this.setupExtensions()}
21return(0,y.A)(e,[{key:"commands",get:function(){var e=this;return this.extensions.reduce(function(t,n){var r={name:n.name,options:n.options,storage:e.editor.extensionStorage[n.name],editor:e.editor,type:bn(n.name,e.schema)},o=Vt(n,"addCommands",r);return o?(0,b.A)((0,b.A)({},t),o()):t},{})}},{key:"plugins",get:function(){var e=this,t=this.editor,n=un((0,m.A)(this.extensions).reverse()),r=n.flatMap(function(n){var r={name:n.name,options:n.options,storage:e.editor.extensionStorage[n.name],editor:t,type:bn(n.name,e.schema)},o=[],i=Vt(n,"addKeyboardShortcuts",r),a={};if("mark"===n.type&&Vt(n,"exitable",r)&&(a.ArrowRight=function(){return hr.handleExit({editor:t,mark:n})}),i){var u=Object.fromEntries(Object.entries(i()).map(function(e){var n=(0,v.A)(e,2),r=n[0],o=n[1];return[r,function(){return o({editor:t})}]}));a=(0,b.A)((0,b.A)({},a),u)}var s=(0,me.w)(a);o.push(s);var l=Vt(n,"addInputRules",r);if(En(n,t.options.enableInputRules)&&l){var c=l();if(c&&c.length){var d=lr({editor:t,rules:c}),f=Array.isArray(d)?d:[d];o.push.apply(o,(0,m.A)(f))}}var p=Vt(n,"addPasteRules",r);if(En(n,t.options.enablePasteRules)&&p){var h=p();if(h&&h.length){var g=Ar({editor:t,rules:h});o.push.apply(o,(0,m.A)(g))}}var y=Vt(n,"addProseMirrorPlugins",r);if(y){var w=y();o.push.apply(o,(0,m.A)(w))}return o});return r}},{key:"attributes",get:function(){return Kt(this.extensions)}},{key:"nodeViews",get:function(){var e=this,t=this.editor,n=$t(this.extensions),r=n.nodeExtensions;return Object.fromEntries(r.filter(function(e){return!!Vt(e,"addNodeView")}).map(function(n){var r=e.attributes.filter(function(e){return e.type===n.name}),o={name:n.name,options:n.options,storage:e.editor.extensionStorage[n.name],editor:t,type:Pe(n.name,e.schema)},i=Vt(n,"addNodeView",o);if(!i)return[];var a=i();if(!a)return[];var u=function(e,o,i,u,s){var l=Qt(e,r);return a({node:e,view:o,getPos:i,decorations:u,innerDecorations:s,editor:t,extension:n,HTMLAttributes:l})};return[n.name,u]}))}},{key:"dispatchTransaction",value:function(e){var t=this,n=this.editor,r=un((0,m.A)(this.extensions).reverse());return r.reduceRight(function(e,r){var o={name:r.name,options:r.options,storage:t.editor.extensionStorage[r.name],editor:n,type:bn(r.name,t.schema)},i=Vt(r,"dispatchTransaction",o);return i?function(t){i.call(o,{transaction:t,next:e})}:e},e)}},{key:"transformPastedHTML",value:function(e){var t=this,n=this.editor,r=un((0,m.A)(this.extensions));return r.reduce(function(e,r){var o={name:r.name,options:r.options,storage:t.editor.extensionStorage[r.name],editor:n,type:bn(r.name,t.schema)},i=Vt(r,"transformPastedHTML",o);return i?function(t,n){var r=e(t,n);return i.call(o,r)}:e},e||function(e){return e})}},{key:"markViews",get:function(){var e=this,t=this.editor,n=$t(this.extensions),r=n.markExtensions;return Object.fromEntries(r.filter(function(e){return!!Vt(e,"addMarkView")}).map(function(n){var r=e.attributes.filter(function(e){return e.type===n.name}),o={name:n.name,options:n.options,storage:e.editor.extensionStorage[n.name],editor:t,type:We(n.name,e.schema)},i=Vt(n,"addMarkView",o);if(!i)return[];var a=function(e,o,a){var u=Qt(e,r);return i()({mark:e,view:o,inline:a,editor:t,extension:n,HTMLAttributes:u,updateAttributes:function(n){oo(e,t,n)}})};return[n.name,a]}))}},{key:"destroy",value:function(){this.extensions.forEach(function(e){var t=e;while(t.parent){var n=t.parent;n.child===t&&(n.child=null),t=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}},{key:"setupExtensions",value:function(){var e=this,t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(function(e){return[e.name,e.storage]})),t.forEach(function(t){var n,r={name:t.name,options:t.options,storage:e.editor.extensionStorage[t.name],editor:e.editor,type:bn(t.name,e.schema)};if("mark"===t.type){var o=null==(n=Ut(Vt(t,"keepOnSplit",r)))||n;o&&e.splittableMarks.push(t.name)}var i=Vt(t,"onBeforeCreate",r),a=Vt(t,"onCreate",r),u=Vt(t,"onUpdate",r),s=Vt(t,"onSelectionUpdate",r),l=Vt(t,"onTransaction",r),c=Vt(t,"onFocus",r),d=Vt(t,"onBlur",r),f=Vt(t,"onDestroy",r);i&&e.editor.on("beforeCreate",i),a&&e.editor.on("create",a),u&&e.editor.on("update",u),s&&e.editor.on("selectionUpdate",s),l&&e.editor.on("transaction",l),c&&e.editor.on("focus",c),d&&e.editor.on("blur",d),f&&e.editor.on("destroy",f)})}}])}();kr.resolve=sn,kr.sort=un,kr.flatten=Yt;var Cr={};
21be(Cr,{ClipboardTextSerializer:function(){return xr},Commands:function(){return Er},Delete:function(){return Mr},Drop:function(){return Sr},Editable:function(){return Tr},FocusEvents:function(){return _r},Keymap:function(){return Ir},Paste:function(){return Nr},Tabindex:function(){return Or},TextDirection:function(){return Fr},focusEventsPluginKey:function(){return Pr}});var Dr=function(e){function t(){var e;return(0,g.A)(this,t),e=ve(this,t,arguments),e.type="extension",e}return(0,p.A)(t,e),(0,y.A)(t,[{key:"configure",value:function(e){return ge(t,"configure",this,3)([e])}},{key:"extend",value:function(e){var n="function"===typeof e?e():e;return ge(t,"extend",this,3)([n])}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="function"===typeof e?e():e;return new t(n)}}])}(pr),xr=Dr.create({name:"clipboardTextSerializer",addOptions:function(){return{blockSeparator:void 0}},addProseMirrorPlugins:function(){var e=this;return[new k.k_({key:new k.hs("clipboardTextSerializer"),props:{clipboardTextSerializer:function(){var t=e.editor,n=t.state,r=t.schema,o=n.doc,i=n.selection,a=i.ranges,u=Math.min.apply(Math,(0,m.A)(a.map(function(e){return e.$from.pos}))),s=Math.max.apply(Math,(0,m.A)(a.map(function(e){return e.$to.pos}))),l=dn(r),c={from:u,to:s};return ln(o,c,(0,b.A)((0,b.A)({},void 0!==e.options.blockSeparator?{blockSeparator:e.options.blockSeparator}:{}),{},{textSerializers:l}))}}})]}}),Er=Dr.create({name:"commands",addCommands:function(){return(0,b.A)({},ke)}}),Mr=Dr.create({name:"delete",onUpdate:function(e){var t,n,r,o=this,i=e.transaction,a=e.appendedTransactions,u=function(){var e,t,n,r;if(!(null!=(r=null==(n=null==(t=null==(e=o.editor.options.coreExtensionOptions)?void 0:e.delete)?void 0:t.filterTransaction)?void 0:n.call(t,i))?r:i.getMeta("y-sync$"))){var u=Bt(i.before,[i].concat((0,m.A)(a))),s=vn(u);s.forEach(function(e){u.mapping.mapResult(e.oldRange.from).deletedAfter&&u.mapping.mapResult(e.oldRange.to).deletedBefore&&u.before.nodesBetween(e.oldRange.from,e.oldRange.to,function(t,n){var r=n+t.nodeSize-2,a=e.oldRange.from<=n&&r<=e.oldRange.to;o.editor.emit("delete",{type:"node",node:t,from:n,to:r,newFrom:u.mapping.map(n),newTo:u.mapping.map(r),deletedRange:e.oldRange,newRange:e.newRange,partial:!a,editor:o.editor,transaction:i,combinedTransform:u})})});var l=u.mapping;u.steps.forEach(function(e,t){var n,r;if(e instanceof w.Ys){var a=l.slice(t).map(e.from,-1),s=l.slice(t).map(e.to),c=l.invert().map(a,-1),d=l.invert().map(s),f=a>0&&(null==(n=u.doc.nodeAt(a-1))?void 0:n.marks.some(function(t){return t.eq(e.mark)})),p=null==(r=u.doc.nodeAt(s))?void 0:r.marks.some(function(t){return t.eq(e.mark)});o.editor.emit("delete",{type:"mark",mark:e.mark,from:e.from,to:e.to,deletedRange:{from:c,to:d},newRange:{from:a,to:s},partial:Boolean(p||f),editor:o.editor,transaction:i,combinedTransform:u})}})}};null==(r=null==(n=null==(t=this.editor.options.coreExtensionOptions)?void 0:t.delete)?void 0:n.async)||r?setTimeout(u,0):u()}}),Sr=Dr.create({name:"drop",addProseMirrorPlugins:function(){var e=this;return[new k.k_({key:new k.hs("tiptapDrop"),props:{handleDrop:function(t,n,r,o){e.editor.emit("drop",{editor:e.editor,event:n,slice:r,moved:o})}}})]}}),Tr=Dr.create({name:"editable",addProseMirrorPlugins:function(){var e=this;return[new k.k_({key:new k.hs("editable"),props:{editable:function(){return e.editor.options.editable}}})]}}),Pr=new k.hs("focusEvents"),_r=Dr.create({name:"focusEvents",addProseMirrorPlugins:function(){var e=this.editor;return[new k.k_({key:Pr,props:{handleDOMEvents:{focus:function(t,n){e.isFocused=!0;var r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:function(t,n){e.isFocused=!1;var r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Ir=Dr.create({name:"keymap",addKeyboardShortcuts:function(){var e=this,t=function(){return e.editor.commands.first(function(e){var t=e.commands;return[function(){return t.undoInputRule()},function(){return t.command(function(e){var n=e.tr,r=n.selection,o=n.doc,i=r.empty,a=r.$anchor,u=a.pos,s=a.parent,l=a.parent.isTextblock&&u>0?n.doc.resolve(u-1):a,c=l.parent.type.spec.isolating,d=a.pos-a.parentOffset,f=c&&1===l.parent.childCount?d===a.pos:k.LN.atStart(o).from===u;return!(!i||!s.type.isTextblock||s.textContent.length||!f||f&&"paragraph"===a.parent.type.name)&&t.clearNodes()})},function(){return t.deleteSelection()},function(){return t.joinBackward()},function(){return t.selectNodeBackward()}]})},n=function(){return e.editor.commands.first(function(e){var t=e.commands;return[function(){return t.deleteSelection()},function(){return t.deleteCurrentNode()},function(){return t.joinForward()},function(){return t.selectNodeForward()}]})},r=function(){return e.editor.commands.first(function(e){var t=e.commands;return[function(){return t.newlineInCode()},function(){return t.createParagraphNear()},function(){return t.liftEmptyBlock()},function(){return t.splitBlock()}]})},o={Enter:r,"Mod-Enter":function(){return e.editor.commands.exitCode()},Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":function(){return e.editor.commands.selectAll()}},i=(0,b.A)({},o),a=(0,b.A)((0,b.A)({},o),{},{"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":function(){return e.editor.commands.selectTextblockStart()},"Ctrl-e":function(){return e.editor.commands.selectTextblockEnd()}});return Xe()||vt()?a:i},addProseMirrorPlugins:function(){var e=this;return[new k.k_({key:new k.hs("clearDocument"),appendTransaction:function(t,n,r){if(!t.some(function(e){return e.getMeta("composition")})){var o=t.some(function(e){return e.docChanged})&&!n.doc.eq(r.doc),i=t.some(function(e){return e.getMeta("preventClearDocument")});if(o&&!i){var a=n.selection,u=a.empty,s=a.from,l=a.to,c=k.LN.atStart(n.doc).from,d=k.LN.atEnd(n.doc).to,f=s===c&&l===d;if(!u&&f){var p=Sn(r.doc);if(p){var h=r.tr,m=we({state:r,transaction:h}),v=new Ae({editor:e.editor,state:m}),g=v.commands;if(g.clearNodes(),h.steps.length)return h}}}}}})]}}),Nr=Dr.create({name:"paste",addProseMirrorPlugins:function(){var e=this;return[new k.k_({key:new k.hs("tiptapPaste"),props:{handlePaste:function(t,n,r){e.editor.emit("paste",{editor:e.editor,event:n,slice:r})}}})]}}),Or=Dr.create({name:"tabindex",addOptions:function(){return{value:void 0}},addProseMirrorPlugins:function(){var e=this;return[new k.k_({key:new k.hs("tabindex"),props:{attributes:function(){var t;return e.editor.isEditable||void 0!==e.options.value?{tabindex:null!=(t=e.options.value)?t:"0"}:{}}}})]}}),Fr=Dr.create({name:"textDirection",addOptions:function(){return{direction:void 0}},addGlobalAttributes:function(){var e=this;if(!this.options.direction)return[];var t=$t(this.extensions),n=t.nodeExtensions;return[{types:n.filter(function(e){return"text"!==e.name}).map(function(e){return e.name}),attributes:{dir:{default:this.options.direction,parseHTML:function(t){var n=t.getAttribute("dir");return!n||"ltr"!==n&&"rtl"!==n&&"auto"!==n?e.options.direction:n},renderHTML:function(e){return e.dir?{dir:e.dir}:{}}}}}]},addProseMirrorPlugins:function(){var e=this;return[new k.k_({key:new k.hs("textDirection"),props:{attributes:function(){var t=e.options.direction;return t?{dir:t}:{}}}})]}}),Lr=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;(0,g.A)(this,e),this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=o}return(0,y.A)(e,[{key:"name",get:function(){return this.node.type.n
21ame}},{key:"node",get:function(){return this.currentNode||this.resolvedPos.node()}},{key:"element",get:function(){return this.editor.view.domAtPos(this.pos).node}},{key:"depth",get:function(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}},{key:"pos",get:function(){return this.resolvedPos.pos}},{key:"content",get:function(){return this.node.content},set:function(e){var t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error("You canât set content on a block node. Tried to set content on ".concat(this.name," at ").concat(this.pos));t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}},{key:"attributes",get:function(){return this.node.attrs}},{key:"textContent",get:function(){return this.node.textContent}},{key:"size",get:function(){return this.node.nodeSize}},{key:"from",get:function(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}},{key:"range",get:function(){return{from:this.from,to:this.to}}},{key:"to",get:function(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}},{key:"parent",get:function(){if(0===this.depth)return null;var t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}},{key:"before",get:function(){var t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}},{key:"after",get:function(){var t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}},{key:"children",get:function(){var t=this,n=[];return this.node.content.forEach(function(r,o){var i=r.isBlock&&!r.isTextblock,a=r.isAtom&&!r.isText,u=r.isInline,s=t.pos+o+(a?0:1);if(!(s<0||s>t.resolvedPos.doc.nodeSize-2)){var l=t.resolvedPos.doc.resolve(s);if(i||u||!(l.depth<=t.depth)){var c=new e(l,t.editor,i,i||u?r:null);i&&(c.actualDepth=t.depth+1),n.push(c)}}}),n}},{key:"firstChild",get:function(){return this.children[0]||null}},{key:"lastChild",get:function(){var e=this.children;return e[e.length-1]||null}},{key:"closest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=this.parent;while(r&&!n){if(r.node.type.name===e)if(Object.keys(t).length>0)for(var o=r.node.attrs,i=Object.keys(t),a=0;a<i.length;a+=1){var u=i[a];if(o[u]!==t[u])break}else n=r;r=r.parent}return n}},{key:"querySelector",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.querySelectorAll(e,t,!0)[0]||null}},{key:"querySelectorAll",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[];if(!this.children||0===this.children.length)return r;var o=Object.keys(t);return this.children.forEach(function(i){if(!(n&&r.length>0)){if(i.node.type.name===e){var a=o.every(function(e){return t[e]===i.node.attrs[e]});a&&r.push(i)}n&&r.length>0||(r=r.concat(i.querySelectorAll(e,t,n)))}}),r}},{key:"setAttribute",value:function(e){var t=this.editor.state.tr;t.setNodeMarkup(this.from,void 0,(0,b.A)((0,b.A)({},this.node.attrs),e)),this.editor.view.dispatch(t)}}])}(),Br='.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}
21\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}';function Rr(e,t,n){var r=document.querySelector("style[data-tiptap-style".concat(n?"-".concat(n):"","]"));if(null!==r)return r;var o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute("data-tiptap-style".concat(n?"-".concat(n):""),""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}var zr=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,g.A)(this,t),e=ve(this,t),e.css=null,e.className="tiptap",e.editorView=null,e.isFocused=!1,e.destroyed=!1,e.isInitialized=!1,e.extensionStorage={},e.instanceId=Math.random().toString(36).slice(2,9),e.options={element:"undefined"!==typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:function(){return null},onCreate:function(){return null},onMount:function(){return null},onUnmount:function(){return null},onUpdate:function(){return null},onSelectionUpdate:function(){return null},onTransaction:function(){return null},onFocus:function(){return null},onBlur:function(){return null},onDestroy:function(){return null},onContentError:function(e){var t=e.error;throw t},onPaste:function(){return null},onDrop:function(){return null},onDelete:function(){return null},enableExtensionDispatchTransaction:!0},e.isCapturingTransaction=!1,e.capturedTransaction=null,e.utils={getUpdatedPosition:In,createMappablePosition:Nn},e.setOptions(n),e.createExtensionManager(),e.createCommandManager(),e.createSchema(),e.on("beforeCreate",e.options.onBeforeCreate),e.emit("beforeCreate",{editor:e}),e.on("mount",e.options.onMount),e.on("unmount",e.options.onUnmount),e.on("contentError",e.options.onContentError),e.on("create",e.options.onCreate),e.on("update",e.options.onUpdate),e.on("selectionUpdate",e.options.onSelectionUpdate),e.on("transaction",e.options.onTransaction),e.on("focus",e.options.onFocus),e.on("blur",e.options.onBlur),e.on("destroy",e.options.onDestroy),e.on("drop",function(t){var n=t.event,r=t.slice,o=t.moved;return e.options.onDrop(n,r,o)}),e.on("paste",function(t){var n=t.event,r=t.slice;return e.options.onPaste(n,r)}),e.on("delete",e.options.onDelete);var r=e.createDoc(),o=Ke(r,e.options.autofocus);return e.editorState=k.$t.create({doc:r,schema:e.schema,selection:o||void 0}),e.options.element&&e.mount(e.options.element),e}return(0,p.A)(t,e),(0,y.A)(t,[{key:"mount",value:function(e){var t=this;if("undefined"===typeof document)throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(function(){t.isDestroyed||(!1!==t.options.autofocus&&null!==t.options.autofocus&&t.commands.focus(t.options.autofocus),t.emit("create",{editor:t}),t.isInitialized=!0)},0)}},{key:"unmount",value:function(){if(this.editorView){var e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(".".concat(this.className)).length)try{"function"===typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){}
21this.css=null,this.emit("unmount",{editor:this})}},{key:"storage",get:function(){return this.extensionStorage}},{key:"commands",get:function(){return this.commandManager.commands}},{key:"chain",value:function(){return this.commandManager.chain()}},{key:"can",value:function(){return this.commandManager.can()}},{key:"injectCSS",value:function(){this.options.injectCSS&&"undefined"!==typeof document&&(this.css=Rr(Br,this.options.injectNonce))}},{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=(0,b.A)((0,b.A)({},this.options),e),this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}},{key:"setEditable",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}},{key:"isEditable",get:function(){return this.options.editable&&this.view&&this.view.editable}},{key:"view",get:function(){var e=this;return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:function(t){e.editorState=t},dispatch:function(t){e.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:function(t,n){if(e.editorView)return e.editorView[n];if("state"===n)return e.editorState;if(n in t)return Reflect.get(t,n);throw new Error("[tiptap error]: The editor view is not available. Cannot access view['".concat(n,"']. The editor may not be mounted yet."))}})}},{key:"state",get:function(){return this.editorView&&(this.editorState=this.view.state),this.editorState}},{key:"registerPlugin",value:function(e,t){var n=Gt(t)?t(e,(0,m.A)(this.state.plugins)):[].concat((0,m.A)(this.state.plugins),[e]),r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}},{key:"unregisterPlugin",value:function(e){if(!this.isDestroyed){var t=this.state.plugins,n=t;if([].concat(e).forEach(function(e){var t="string"===typeof e?"".concat(e,"$"):e.ke
21y;n=n.filter(function(e){return!e.key.startsWith(t)})}),t.length!==n.length){var r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}}}},{key:"createExtensionManager",value:function(){var e,t,n,r,o=this,i=this.options.enableCoreExtensions?[Tr,xr.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),Er,_r,Ir,Or.configure({value:null==(r=null==(n=this.options.coreExtensionOptions)?void 0:n.tabindex)?void 0:r.value}),Sr,Nr,Mr,Fr.configure({direction:this.options.textDirection})].filter(function(e){return"object"!==typeof o.options.enableCoreExtensions||!1!==o.options.enableCoreExtensions[e.name]}):[],a=[].concat((0,m.A)(i),(0,m.A)(this.options.extensions)).filter(function(e){return["extension","node","mark"].includes(null==e?void 0:e.type)});this.extensionManager=new kr(a,this)}},{key:"createCommandManager",value:function(){this.commandManager=new Ae({editor:this})}},{key:"createSchema",value:function(){this.schema=this.extensionManager.schema}},{key:"createDoc",value:function(){var e,t=this;try{e=Ot(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(n){if(!(n instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(n.message))throw n;this.emit("contentError",{editor:this,error:n,disableCollaboration:function(){"collaboration"in t.storage&&"object"===typeof t.storage.collaboration&&t.storage.collaboration&&(t.storage.collaboration.isDisabled=!0),t.options.extensions=t.options.extensions.filter(function(e){return"collaboration"!==e.name}),t.createExtensionManager()}}),e=Ot(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}},{key:"createView",value:function(e){var t=this.options,n=t.editorProps,r=t.enableExtensionDispatchTransaction,o=n.dispatchTransaction||this.dispatchTransaction.bind(this),i=r?this.extensionManager.dispatchTransaction(o):o,a=n.transformPastedHTML,u=this.extensionManager.transformPastedHTML(a);this.editorView=new he.Lz(e,(0,b.A)((0,b.A)({},n),{},{attributes:(0,b.A)({role:"textbox"},null==n?void 0:n.attributes),dispatchTransaction:i,transformPastedHTML:u,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews}));var s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();var l=this.view.dom;l.editor=this}},{key:"createNodeViews",value:function(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}},{key:"prependClass",value:function(){this.view.dom.className="".concat(this.className," ").concat(this.view.dom.className)}},{key:"captureTransaction",value:function(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;var t=this.capturedTransaction;return this.capturedTransaction=null,t}},{key:"dispatchTransaction",value:function(e){var t=this;if(!this.view.isDestroyed){if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach(function(e){var n;return null==(n=t.capturedTransaction)?void 0:n.step(e)}):void(this.capturedTransaction=e);var n=this.state.applyTransaction(e),r=n.state,o=n.transactions,i=!this.state.selection.eq(r.selection),a=o.includes(e),u=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:r}),a){this.view.updateState(r),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:o.slice(1)}),i&&this.emit("selectionUpdate",{editor:this,transaction:e});var s=o.findLast(function(e){return e.getMeta("focus")||e.getMeta("blur")}),l=null==s?void 0:s.getMeta("focus"),c=null==s?void 0:s.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),c&&this.emit("blur",{editor:this,event:c.event,transaction:s}),e.getMeta("preventUpdate")||!o.some(function(e){return e.docChanged})||u.doc.eq(r.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:o.slice(1)})}}}},{key:"getAttributes",value:function(e){return pn(this.state,e)}},{key:"isActive",value:function(e,t){var n="string"===typeof e?e:null,r="string"===typeof e?t:e;return Cn(this.state,n,r)}},{key:"getJSON",value:function(){return this.state.doc.toJSON()}}
21,{key:"getHTML",value:function(){return Wt(this.state.doc.content,this.schema)}},{key:"getText",value:function(e){var t=e||{},n=t.blockSeparator,r=void 0===n?"\n\n":n,o=t.textSerializers,i=void 0===o?{}:o;return cn(this.state.doc,{blockSeparator:r,textSerializers:(0,b.A)((0,b.A)({},dn(this.schema)),i)})}},{key:"isEmpty",get:function(){return Sn(this.state.doc)}},{key:"destroy",value:function(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}},{key:"isDestroyed",get:function(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}},{key:"$node",value:function(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}},{key:"$nodes",value:function(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}},{key:"$pos",value:function(e){var t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText?t.nodeAfter:null;return new Lr(t,this,!1,n)}},{key:"$doc",get:function(){return this.$pos(0)}}])}(ir);function jr(e){return new ar({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Ut(e.getAttributes,void 0,o);if(!1===i||null===i)return null;var a=n.tr,u=o[o.length-1],s=o[0];if(u){var l=s.search(/\S/),c=r.from+s.indexOf(u),d=c+u.length,f=gn(r.from,r.to,n.doc).filter(function(t){var n=t.mark.type.excluded;return n.find(function(n){return n===e.type&&n!==t.mark.type})}).filter(function(e){return e.to>c});if(f.length)return null;
21d<r.to&&a.delete(d,r.to),c>r.from&&a.delete(r.from+l,c);var p=r.from+l+u.length;a.addMark(r.from+l,p,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function Hr(e){return new ar({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Ut(e.getAttributes,void 0,o)||{},a=n.tr,u=r.from,s=r.to,l=e.type.create(i);if(o[1]){var c=o[0].lastIndexOf(o[1]),d=u+c;d>s?d=s:s=d+o[1].length;var f=o[0][o[0].length-1];a.insertText(f,u+o[0].length-1),a.replaceWith(d,s,l)}else if(o[0]){var p=e.type.isInline?u:u-1;a.insert(p,e.type.create(i)).delete(a.mapping.map(u),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function Vr(e){return new ar({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=n.doc.resolve(r.from),a=Ut(e.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,e.type,a)},undoable:e.undoable})}function Yr(e){return new ar({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=t.chain,a=Ut(e.getAttributes,void 0,o)||{},u=n.tr.delete(r.from,r.to),s=u.doc.resolve(r.from),l=s.blockRange(),c=l&&(0,w.oM)(l,e.type,a);if(!c)return null;if(u.wrap(l,c),e.keepMarks&&e.editor){var d=n.selection,f=n.storedMarks,p=e.editor.extensionManager.splittableMarks,h=f||d.$to.parentOffset&&d.$from.marks();if(h){var m=h.filter(function(e){return p.includes(e.type.name)});u.ensureMarks(m)}}if(e.keepAttributes){var v="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(v,a).run()}var g=u.doc.resolve(r.from-1).nodeBefore;g&&g.type===e.type&&(0,w.n9)(u.doc,r.from-1)&&(!e.joinPredicate||e.joinPredicate(o,g))&&u.join(r.from-1)},undoable:e.undoable})}var Wr=function(e){return"touches"in e},Gr=function(){function e(t){var n,r,o,i,a,u,s=this;(0,g.A)(this,e),this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=function(e){if(s.isResizing&&s.activeHandle){var t=e.clientX-s.startX,n=e.clientY-s.startY;s.handleResize(t,n)}},this.handleTouchMove=function(e){if(s.isResizing&&s.activeHandle){var t=e.touches[0];if(t){var n=t.clientX-s.startX,r=t.clientY-s.startY;s.handleResize(n,r)}}},this.handleMouseUp=function(){if(s.isResizing){var e=s.element.offsetWidth,t=s.element.offsetHeight;s.onCommit(e,t),s.isResizing=!1,s.activeHandle=null,s.container.dataset.resizeState="false",s.classNames.resizing&&s.container.classList.remove(s.classNames.resizing),document.removeEventListener("mousemove",s.handleMouseMove),document.removeEventListener("mouseup",s.handleMouseUp),document.removeEventListener("keydown",s.handleKeyDown),document.removeEventListener("keyup",s.handleKeyUp)}},this.handleKeyDown=function(e){"Shift"===e.key&&(s.isShiftKeyPressed=!0)},this.handleKeyUp=function(e){"Shift"===e.key&&(s.isShiftKeyPressed=!1)},this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(null==(n=t.options)?void 0:n.min)&&(this.minSize=(0,b.A)((0,b.A)({},this.minSize),t.options.min)),(null==(r=t.options)?void 0:r.max)&&(this.maxSize=t.options.max),(null==(o=null==t?void 0:t.options)?void 0:o.directions)&&(this.directions=t.options.directions),(null==(i=t.options)?void 0:i.preserveAspectRatio)&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(null==(a=t.options)?void 0:a.className)&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(null==(u=t.options)?void 0:u.createCustomHandle)&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}return(0,y.A)(e,[{key:"dom",get:function(){return this.container}}
21,{key:"contentDOM",get:function(){var e;return null!=(e=this.contentElement)?e:null}},{key:"handleEditorUpdate",value:function(){var e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&0===this.handleMap.size&&this.attachHandles():this.removeHandles())}},{key:"update",value:function(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}},{key:"destroy",value:function(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}},{key:"createContainer",value:function(){var e=document.createElement("div");return e.dataset.resizeContainer="",e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}},{key:"createWrapper",value:function(){var e=document.createElement("div");return e.style.position="relative",e.style.display="block",e.dataset.resizeWrapper="",this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}},{key:"createHandle",value:function(e){var t=document.createElement("div");return t.dataset.resizeHandle=e,t.style.position="absolute",this.classNames.handle&&(t.className=this.classNames.handle),t}},{key:"positionHandle",value:function(e,t){var n=t.includes("top"),r=t.includes("bottom"),o=t.includes("left"),i=t.includes("right");n&&(e.style.top="0"),r&&(e.style.bottom="0"),o&&(e.style.left="0"),i&&(e.style.right="0"),"top"!==t&&"bottom"!==t||(e.style.left="0",e.style.right="0"),"left"!==t&&"right"!==t||(e.style.top="0",e.style.bottom="0")}},{key:"attachHandles",value:function(){var e=this;this.directions.forEach(function(t){var n;n=e.createCustomHandle?e.createCustomHandle(t):e.createHandle(t),n instanceof HTMLElement||('[ResizableNodeView] createCustomHandle("'.concat(t,'") did not return an HTMLElement. Falling back to default handle.'),n=e.createHandle(t)),e.createCustomHandle||e.positionHandle(n,t),n.addEventListener("mousedown",function(n){return e.handleResizeStart(n,t)}),n.addEventListener("touchstart",function(n){return e.handleResizeStart(n,t)}),e.handleMap.set(t,n),e.wrapper.appendChild(n)})}},{key:"removeHandles",value:function(){this.handleMap.forEach(function(e){return e.remove()}),this.handleMap.clear()}},{key:"applyInitialSize",value:function(){var e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width="".concat(e,"px"),this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height="".concat(t,"px"),this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}},{key:"handleResizeStart",value:function(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,Wr(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight);this.getPos();this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}},{key:"handleResize",value:function(e,t){if(this.activeHandle){var n=this.preserveAspectRatio||this.isShiftKeyPressed,r=this.calculateNewDimensions(this.activeHandle,e,t),o=r.width,i=r.height,a=this.applyConstraints(o,i,n);this.element.style.width="".concat(a.width,"px"),this.element.style.height="".concat(a.height,"px"),this.onResize&&this.onResize(a.width,a.height)}}},{key:"calculateNewDimensions",value:function(e,t,n){var r=this.startWidth,o=this.startHeight,i=e.includes("right"),a=e.includes("left"),u=e.includes("bottom"),s=e.includes("top");i?r=this.startWidth+t:a&&(r=this.startWidth-t),u?o=this.startHeight+n:s&&(o=this.startHeight-n),"right"!==e&&"left"!==e||(r=this.startWidth+(i?t:-t)),"top"!==e&&"bottom"!==e||(o=this.startHeight+(u?n:-n));var l=this.preserveAspectRatio||this.isShiftKeyPressed;return l?this.applyAspectRatio(r,o,e):{width:r,height:o}}},{key:"applyConstraints",value:function(e,t,n){var r,o,i,a;if(!n){var u=Math.max(this.minSize.width,e),s=Math.max(this.minSize.height,t);return(null==(r=this.maxSize)?void 0:r.width)&&(u=Math.min(this.maxSize.width,u)),(null==(o=this.maxSize)?void 0:o.height)&&(s=Math.min(this.maxSize.height,s)),{width:u,height:s}}var l=e,c=t;return l<this.minSize.width&&(l=this.minSize.width,c=l/this.aspectRatio),c<this.minSize.height&&(c=this.minSize.height,l=c*this.aspectRatio),(null==(i=this.maxSize)?void 0:i.width)&&l>this.maxSize.width&&(l=this.maxSize.width,c=l/this.aspectRatio),(null==(a=this.maxSize)?void 0:a.height)&&c>this.maxSize.height&&(c=this.maxSize.height,l=c*this.aspectRatio),{width:l,height:c}}},{key:"applyAspectRatio",value:function(e,t,n){var r="left"===n||"right"===n,o="top"===n||"bottom"===n;return r?{width:e,height:e/this.aspectRatio}:o?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}}])}();function Ur(e,t){var n=e.selection,r=n.$from;if(n instanceof k.nh){var o=r.index(),i=r.parent;return i.canReplaceWith(o,o+1,t)}var a=r.depth;while(a>=0){var u=r.index(a),s=r.node(a),l=s.contentMatchAt(u);
21if(l.matchType(t))return!0;a-=1}return!1}function qr(e,t){var n=e.getAttribute("style");if(!n)return null;for(var r=n.split(";").map(function(e){return e.trim()}).filter(Boolean),o=t.toLowerCase(),i=r.length-1;i>=0;i-=1){var a=r[i],u=a.indexOf(":");if(-1!==u){var s=a.slice(0,u).trim().toLowerCase();if(s===o)return a.slice(u+1).trim()}}return null}var $r={};function Kr(e){if(!(null==e?void 0:e.trim()))return{};var t={},n=[],r=e.replace(/["']([^"']*)["']/g,function(e){return n.push(e),"__QUOTED_".concat(n.length-1,"__")}),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){var i=o.map(function(e){return e.trim().slice(1)});t.class=i.join(" ")}var a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]);var u=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g,s=Array.from(r.matchAll(u));s.forEach(function(e){var r,o=(0,v.A)(e,3),i=o[1],a=o[2],u=parseInt((null==(r=a.match(/__QUOTED_(\d+)__/))?void 0:r[1])||"0",10),s=n[u];s&&(t[i]=s.slice(1,-1))});var l=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();if(l){var c=l.split(/\s+/).filter(Boolean);
21c.forEach(function(e){e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)})}return t}function Jr(e){if(!e||0===Object.keys(e).length)return"";var t=[];if(e.class){var n=String(e.class).split(/\s+/).filter(Boolean);n.forEach(function(e){return t.push(".".concat(e))})}return e.id&&t.push("#".concat(e.id)),Object.entries(e).forEach(function(e){var n=(0,v.A)(e,2),r=n[0],o=n[1];"class"!==r&&"id"!==r&&(!0===o?t.push(r):!1!==o&&null!=o&&t.push("".concat(r,'="').concat(String(o),'"')))}),t.join(" ")}function Xr(e){var t=e.nodeName,n=e.name,r=e.parseAttributes,o=void 0===r?Kr:r,i=e.serializeAttributes,a=void 0===i?Jr:i,u=e.defaultAttributes,s=void 0===u?{}:u,l=e.requiredAttributes,c=void 0===l?[]:l,d=e.allowedAttributes,f=n||t,p=function(e){if(!d)return e;var t={};return d.forEach(function(n){n in e&&(t[n]=e[n])}),t};return{parseMarkdown:function(e,n){var r=(0,b.A)((0,b.A)({},s),e.attributes);return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start:function(e){var t,n=new RegExp("^:::".concat(f,"(?:\\s|$)"),"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize:function(e,n,r){var i=new RegExp("^:::".concat(f,"(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)")),a=e.match(i);if(a){var u=a[1]||"",s=o(u),l=c.find(function(e){return!(e in s)});if(!l)return{type:t,raw:a[0],attributes:s}}}},renderMarkdown:function(e){var t=p(e.attrs||{}),n=a(t),r=n?" {".concat(n,"}"):"";return":::".concat(f).concat(r," :::")}}}function Zr(e){var t=e.nodeName,n=e.name,r=e.getContent,o=e.parseAttributes,i=void 0===o?Kr:o,a=e.serializeAttributes,u=void 0===a?Jr:a,s=e.defaultAttributes,l=void 0===s?{}:s,c=e.content,d=void 0===c?"block":c,f=e.allowedAttributes,p=n||t,h=function(e){if(!f)return e;var t={};return f.forEach(function(n){n in e&&(t[n]=e[n])}),t};return{parseMarkdown:function(e,n){var o;if(r){var i=r(e);o="string"===typeof i?[{type:"text",text:i}]:i}else o="block"===d?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);var a=(0,b.A)((0,b.A)({},l),e.attributes);return n.createNode(t,a,o)},markdownTokenizer:{name:t,level:"block",start:function(e){var t,n=new RegExp("^:::".concat(p),"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize:function(e,n,r){var o,a=new RegExp("^:::".concat(p,"(?:\\s+\\{([^}]*)\\})?\\s*\\n")),u=e.match(a);if(u){var s=(0,v.A)(u,2),l=s[0],c=s[1],f=void 0===c?"":c,h=i(f),m=1,g=l.length,y="",b=/^:::([\w-]*)(\s.*)?/gm,w=e.slice(g);for(b.lastIndex=0;;){var A=b.exec(w);if(null===A)break;var k=A.index,C=A[1];if(!(null==(o=A[2])?void 0:o.endsWith(":::")))if(C)m+=1;else if(m-=1,0===m){var D=w.slice(0,k);y=D.trim();var x=e.slice(0,g+k+A[0].length),E=[];if(y)if("block"===d){E=r.blockTokens(D),E.forEach(function(e){!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))});while(E.length>0){var M=E[E.length-1];if("paragraph"!==M.type||M.text&&""!==M.text.trim())break;E.pop()}}else E=r.inlineTokens(y);return{type:t,raw:x,attributes:h,content:y,tokens:E}}}}}},renderMarkdown:function(e,t){var n=h(e.attrs||{}),r=u(n),o=r?" {".concat(r,"}"):"",i=t.renderChildren(e.content||[],"\n\n");return":::".concat(p).concat(o,"\n\n").concat(i,"\n\n:::")}}}function Qr(e){if(!e.trim())return{};var t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);while(null!==r){var o=r,i=(0,v.A)(o,4),a=i[1],u=i[2],s=i[3];t[a]=u||s,r=n.exec(e)}return t}function eo(e){return Object.entries(e).filter(function(e){var t=(0,v.A)(e,2),n=t[1];return void 0!==n&&null!==n}).map(function(e){var t=(0,v.A)(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')}).join(" ")}function to(e){var t=e.nodeName,n=e.name,r=e.getContent,o=e.parseAttributes,i=void 0===o?Qr:o,a=e.serializeAttributes,u=void 0===a?eo:a,s=e.defaultAttributes,l=void 0===s?{}:s,c=e.selfClosing,d=void 0!==c&&c,f=e.allowedAttributes,p=n||t,h=function(e){if(!f)return e;var t={};return f.forEach(function(n){var r="string"===typeof n?n:n.name,o="string"===typeof n?void 0:n.skipIfDefault;if(r in e){var i=e[r];if(void 0!==o&&i===o)return;t[r]=i}}),t},m=p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:function(e,n){var o=(0,b.A)((0,b.A)({},l),e.attributes);if(d)return n.createNode(t,o);var i=r?r(e):e.content||"";return i?n.createNode(t,o,[n.createTextNode(i)]):n.createNode(t,o,[])},markdownTokenizer:{name:t,level:"inline",start:function(e){var t=d?new RegExp("\\[".concat(m,"\\s*[^\\]]*\\]")):new RegExp("\\[".concat(m,"\\s*[^\\]]*\\][\\s\\S]*?\\[\\/").concat(m,"\\]")),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1}
21,tokenize:function(e,n,r){var o=d?new RegExp("^\\[".concat(m,"\\s*([^\\]]*)\\]")):new RegExp("^\\[".concat(m,"\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/").concat(m,"\\]")),a=e.match(o);if(a){var u="",s="";if(d){var l=(0,v.A)(a,2),c=l[1];s=c}else{var f=(0,v.A)(a,3),p=f[1],h=f[2];s=p,u=h||""}var g=i(s.trim());return{type:t,raw:a[0],content:u.trim(),attributes:g}}}},renderMarkdown:function(e){var t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(function(e){return"text"===e.type}).map(function(e){return e.text}).join(""));var n=h(e.attrs||{}),o=u(n),i=o?" ".concat(o):"";return d?"[".concat(p).concat(i,"]"):"[".concat(p).concat(i,"]").concat(t,"[/").concat(p,"]")}}}function no(e,t,n){var r,o,i,a,u,s=e.split("\n"),l=[],c="",d=0,f=t.baseIndentSize||2,p=function(){var e=s[d],u=e.match(t.itemPattern);if(!u)return l.length>0?0:""===e.trim()?(d+=1,c="".concat(c).concat(e,"\n"),1):{v:void 0};var p=t.extractItemData(u),h=p.indentLevel,m=p.mainContent;c="".concat(c).concat(e,"\n");var v,g=[m];d+=1;while(d<s.length){var y=s[d];if(""===y.trim()){var b=s.slice(d+1).findIndex(function(e){return""!==e.trim()});if(-1===b)break;var w=s[d+1+b],A=(null==(o=null==(r=w.match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0;if(A>h){g.push(y),c="".concat(c).concat(y,"\n"),d+=1;continue}break}var k=(null==(a=null==(i=y.match(/^(\s*)/))?void 0:i[1])?void 0:a.length)||0;if(!(k>h))break;g.push(y),c="".concat(c).concat(y,"\n"),d+=1}var C=g.slice(1);if(C.length>0){var D=C.map(function(e){return e.slice(h+f)}).join("\n");D.trim()&&(v=t.customNestedParser?t.customNestedParser(D):n.blockTokens(D))}var x=t.createToken(p,v);l.push(x)};while(d<s.length){if(u=p(),0===u)break;if(1!==u&&u)return u.v}if(0!==l.length)return{items:l,raw:c}}function ro(e,t,n,o){if(!e||!Array.isArray(e.content))return"";var i="function"===typeof n?n(o):n,a=s(e.content),u=a[0],l=(0,r.A)(a).slice(1),c=t.renderChildren([u]),d="".concat(i).concat(c);return l&&l.length>0&&l.forEach(function(e,n){var r,o,i=null!=(o=null==(r=t.renderChild)?void 0:r.call(t,e,n+1))?o:t.renderChildren([e]);if(void 0!==i&&null!==i){var a=i.split("\n").map(function(e){return e?t.indent(e):t.indent("")}).join("\n");d+="paragraph"===e.type?"\n\n".concat(a):"\n".concat(a)}}),d}function oo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.state,o=r.doc,i=r.tr,a=e;o.descendants(function(t,r){var o=i.mapping.map(r),u=i.mapping.map(r)+t.nodeSize,s=null;if(t.marks.forEach(function(e){if(e!==a)return!1;s=e}),s){var l=!1;if(Object.keys(n).forEach(function(e){n[e]!==s.attrs[e]&&(l=!0)}),l){var c=e.type.create((0,b.A)((0,b.A)({},e.attrs),n));i.removeMark(o,u,e.type),i.addMark(o,u,c)}}}),i.docChanged&&t.view.dispatch(i)}be($r,{createAtomBlockMarkdownSpec:function(){return Xr},createBlockMarkdownSpec:function(){return Zr},createInlineMarkdownSpec:function(){return to},parseAttributes:function(){return Kr},parseIndentedBlocks:function(){return no},renderNestedMarkdownContent:function(){return ro},serializeAttributes:function(){return Jr}});var io=function(e){function t(){var e;return(0,g.A)(this,t),e=ve(this,t,arguments),e.type="node",e}
21return(0,p.A)(t,e),(0,y.A)(t,[{key:"configure",value:function(e){return ge(t,"configure",this,3)([e])}},{key:"extend",value:function(e){var n="function"===typeof e?e():e;return ge(t,"extend",this,3)([n])}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="function"===typeof e?e():e;return new t(n)}}])}(pr),ao=function(){function e(t,n,r){(0,g.A)(this,e),this.isDragging=!1,this.component=t,this.editor=n.editor,this.options=(0,b.A)({stopEvent:null,ignoreMutation:null},r),this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}return(0,y.A)(e,[{key:"mount",value:function(){}},{key:"dom",get:function(){return this.editor.view.dom}},{key:"contentDOM",get:function(){return null}},{key:"onDragStart",value:function(e){var t,n,r,o,i,a,u,s=this.editor.view,l=e.target,c=3===l.nodeType?null==(t=l.parentElement)?void 0:t.closest("[data-drag-handle]"):l.closest("[data-drag-handle]");if(this.dom&&!(null==(n=this.contentDOM)?void 0:n.contains(l))&&c){var d=0,f=0;if(this.dom!==c){var p=this.dom.getBoundingClientRect(),h=c.getBoundingClientRect(),m=null!=(o=e.offsetX)?o:null==(r=e.nativeEvent)?void 0:r.offsetX,v=null!=(a=e.offsetY)?a:null==(i=e.nativeEvent)?void 0:i.offsetY;d=h.x-p.x+m,f=h.y-p.y+v}var g=this.dom.cloneNode(!0);try{var y=this.dom.getBoundingClientRect();g.style.width="".concat(Math.round(y.width),"px"),g.style.height="".concat(Math.round(y.height),"px"),g.style.boxSizing="border-box",g.style.pointerEvents="none"}catch(D){}var b=null;try{b=document.createElement("div"),b.style.position="absolute",b.style.top="-9999px",b.style.left="-9999px",b.style.pointerEvents="none",b.appendChild(g),document.body.appendChild(b),null==(u=e.dataTransfer)||u.setDragImage(g,d,f)}finally{b&&setTimeout(function(){try{null==b||b.remove()}catch(e){}},0)}var w=this.getPos();if("number"===typeof w){var A=k.nh.create(s.state.doc,w),C=s.state.tr.setSelection(A);s.dispatch(C)}}}},{key:"stopEvent",value:function(e){var t,n=this;if(!this.dom)return!1;if("function"===typeof this.options.stopEvent)return this.options.stopEvent({event:e});var r=e.target,o=this.dom.contains(r)&&!(null==(t=this.contentDOM)?void 0:t.contains(r));if(!o)return!1;var i=e.type.startsWith("drag"),a="dragover"===e.type||"dragenter"===e.type,u="drop"===e.type,s=["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable;if(s&&!u&&!i)return!0;var l=this.editor.isEditable,c=this.isDragging,d=!!this.node.type.spec.draggable,f=k.nh.isSelectable(this.node),p="copy"===e.type,h="paste"===e.type,m="cut"===e.type,v="mousedown"===e.type;if(!d&&f&&i&&e.target===this.dom&&e.preventDefault(),d&&i&&!c&&e.target===this.dom)return e.preventDefault(),!1;if(d&&l&&!c&&v){var g=r.closest("[data-drag-handle]"),y=g&&(this.dom===g||this.dom.contains(g));y&&(this.isDragging=!0,document.addEventListener("dragend",function(){n.isDragging=!1},{once:!0}),document.addEventListener("drop",function(){n.isDragging=!1},{once:!0}),document.addEventListener("mouseup",function(){n.isDragging=!1},{once:!0}))}return!(c||a||u||p||h||m||v&&f)}},{key:"ignoreMutation",value:function(e){if(!this.dom||!this.contentDOM)return!0;if("function"===typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&(Xe()||Je())&&this.editor.isFocused){var t=[].concat((0,m.A)(Array.from(e.addedNodes)),(0,m.A)(Array.from(e.removedNodes)));if(t.every(function(e){return e.isContentEditable}))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}},{key:"updateAttributes",value:function(e){var t=this;this.editor.commands.command(function(n){var r=n.tr,o=t.getPos();return"number"===typeof o&&(r.setNodeMarkup(o,void 0,(0,b.A)((0,b.A)({},t.node.attrs),e)),!0)})}},{key:"deleteNode",value:function(){var e=this.getPos();if("number"===typeof e){var t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}}])}();function uo(e){return new vr({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=t.pasteEvent,a=Ut(e.getAttributes,void 0,o,i);if(!1===a||null===a)return null;var u=n.tr,s=o[o.length-1],l=o[0],c=r.to;
21if(s){var d=l.search(/\S/),f=r.from+l.indexOf(s),p=f+s.length,h=gn(r.from,r.to,n.doc).filter(function(t){var n=t.mark.type.excluded;return n.find(function(n){return n===e.type&&n!==t.mark.type})}).filter(function(e){return e.to>f});if(h.length)return null;p<r.to&&u.delete(p,r.to),f>r.from&&u.delete(r.from+d,f),c=r.from+d+s.length,u.addMark(r.from+d,c,e.type.create(a||{}));var m=void 0!==o.index&&void 0!==o.input&&o.index+o[0].length>=o.input.length;m||u.removeStoredMark(e.type)}}})}},1162:function(e,t,n){n.d(t,{$Z:function(){return xe},VR:function(){return Le},gu:function(){return We},hG:function(){return Ie},er:function(){return Se}});var r=n(25032),o=n(10020),i=n(62704),a=n(1290),u=n(95627),s=n(63887),l=n(3846),c=n(60738),d=n(52100),f=n(83763),p=n(74337),h=n(34293),m=n(41594),v=n(75206),g=n(12519),y=n(18809),b=n(18761),w=Object.getOwnPropertyNames,A=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty;function C(e,t){return function(n,r,o){return e(n,r,o)&&t(n,r,o)}}function D(e){return function(t,n,r){if(!t||!n||"object"!==typeof t||"object"!==typeof n)return e(t,n,r);var o=r.cache,i=o.get(t),a=o.get(n);if(i&&a)return i===n&&a===t;o.set(t,n),o.set(n,t);var u=e(t,n,r);return o.delete(t),o.delete(n),u}}function x(e){return null!=e?e[Symbol.toStringTag]:void 0}function E(e){return w(e).concat(A(e))}var M=Object.hasOwn||function(e,t){return k.call(e,t)};function S(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var T="__v",P="__o",_="_owner",I=Object.getOwnPropertyDescriptor,N=Object.keys;function O(e,t){return e.byteLength===t.byteLength&&q(new Uint8Array(e),new Uint8Array(t))}function F(e,t,n){var r=e.length;if(t.length!==r)return!1;while(r-- >0)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function L(e,t){return e.byteLength===t.byteLength&&q(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function B(e,t){return S(e.getTime(),t.getTime())}function R(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function z(e,t){return e===t}function j(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;var o,i,a=new Array(r),u=e.entries(),s=0;while(o=u.next()){if(o.done)break;var l=t.entries(),c=!1,d=0;while(i=l.next()){if(i.done)break;if(a[d])d++;else{var f=o.value,p=i.value;if(n.equals(f[0],p[0],s,d,e,t,n)&&n.equals(f[1],p[1],f[0],p[0],e,t,n)){c=a[d]=!0;break}d++}}if(!c)return!1;s++}return!0}var H=S;function V(e,t,n){var r=N(e),o=r.length;if(N(t).length!==o)return!1;while(o-- >0)if(!K(e,t,n,r[o]))return!1;return!0}function Y(e,t,n){var r,o,i,a=E(e),u=a.length;if(E(t).length!==u)return!1;while(u-- >0){if(r=a[u],!K(e,t,n,r))return!1;if(o=I(e,r),i=I(t,r),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function W(e,t){return S(e.valueOf(),t.valueOf())}function G(e,t){return e.source===t.source&&e.flags===t.flags}function U(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;var o,i,a=new Array(r),u=e.values();while(o=u.next()){if(o.done)break;var s=t.values(),l=!1,c=0;while(i=s.next()){if(i.done)break;if(!a[c]&&n.equals(o.value,i.value,o.value,i.value,e,t,n)){l=a[c]=!0;break}c++}if(!l)return!1}return!0}function q(e,t){var n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;while(n-- >0)if(e[n]!==t[n])return!1;return!0}function $(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function K(e,t,n,r){return!(r!==_&&r!==P&&r!==T||!e.$$typeof&&!t.$$typeof)||M(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var J="[object ArrayBuffer]",X="[object Arguments]",Z="[object Boolean]",Q="[object DataView]",ee="[object Date]",te="[object Error]",ne="[object Map]",re="[object Number]",oe="[object Object]",ie="[object RegExp]",ae
21="[object Set]",ue="[object String]",se={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},le="[object URL]",ce=Object.prototype.toString;function de(e){var t=e.areArrayBuffersEqual,n=e.areArraysEqual,r=e.areDataViewsEqual,o=e.areDatesEqual,i=e.areErrorsEqual,a=e.areFunctionsEqual,u=e.areMapsEqual,s=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,d=e.areRegExpsEqual,f=e.areSetsEqual,p=e.areTypedArraysEqual,h=e.areUrlsEqual,m=e.unknownTagComparators;return function(e,v,g){if(e===v)return!0;if(null==e||null==v)return!1;var y=typeof e;if(y!==typeof v)return!1;if("object"!==y)return"number"===y?s(e,v,g):"function"===y&&a(e,v,g);var b=e.constructor;if(b!==v.constructor)return!1;if(b===Object)return l(e,v,g);if(Array.isArray(e))return n(e,v,g);if(b===Date)return o(e,v,g);if(b===RegExp)return d(e,v,g);if(b===Map)return u(e,v,g);if(b===Set)return f(e,v,g);var w=ce.call(e);if(w===ee)return o(e,v,g);if(w===ie)return d(e,v,g);if(w===ne)return u(e,v,g);if(w===ae)return f(e,v,g);if(w===oe)return"function"!==typeof e.then&&"function"!==typeof v.then&&l(e,v,g);if(w===le)return h(e,v,g);if(w===te)return i(e,v,g);if(w===X)return l(e,v,g);if(se[w])return p(e,v,g);if(w===J)return t(e,v,g);if(w===Q)return r(e,v,g);if(w===Z||w===re||w===ue)return c(e,v,g);if(m){var A=m[w];if(!A){var k=x(e);k&&(A=m[k])}if(A)return A(e,v,g)}return!1}}function fe(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,o={areArrayBuffersEqual:O,areArraysEqual:r?Y:F,areDataViewsEqual:L,areDatesEqual:B,areErrorsEqual:R,areFunctionsEqual:z,areMapsEqual:r?C(j,Y):j,areNumbersEqual:H,areObjectsEqual:r?Y:V,arePrimitiveWrappersEqual:W,areRegExpsEqual:G,areSetsEqual:r?C(U,Y):U,areTypedArraysEqual:r?C(q,Y):q,areUrlsEqual:$,unknownTagComparators:void 0};if(n&&(o=Object.assign({},o,n(o))),t){var i=D(o.areArraysEqual),a=D(o.areMapsEqual),u=D(o.areObjectsEqual),s=D(o.areSetsEqual);o=Object.assign({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:u,areSetsEqual:s})}return o}function pe(e){return function(t,n,r,o,i,a,u){return e(t,n,u)}}function he(e){var t=e.circular,n=e.comparator,r=e.createState,o=e.equals,i=e.strict;if(r)return function(e,a){var u=r(),s=u.cache,l=void 0===s?t?new WeakMap:void 0:s,c=u.meta;return n(e,a,{cache:l,equals:o,meta:c,strict:i})};if(t)return function(e,t){return n(e,t,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(e,t){return n(e,t,a)}}var me=ve();ve({strict:!0}),ve({circular:!0}),ve({circular:!0,strict:!0}),ve({createInternalComparator:function(){return S}}),ve({strict:!0,createInternalComparator:function(){return S}}),ve({circular:!0,createInternalComparator:function(){return S}}),ve({circular:!0,createInternalComparator:function(){return S},strict:!0});function ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.circular,n=void 0!==t&&t,r=e.createInternalComparator,o=e.createState,i=e.strict,a=void 0!==i&&i,u=fe(e),s=de(u),l=r?r(s):pe(s);return he({circular:n,comparator:s,createState:o,equals:l,strict:a})}var ge=n(10165),ye=["editor","innerRef"];function be(e,t,n){return t=(0,d.A)(t),(0,l.A)(e,(0,c.A)()?Reflect.construct(t,n||[],(0,d.A)(e).constructor):t.apply(e,n))}var we=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach(function(t){"function"===typeof t?t(e):t&&(t.current=e)})}},Ae=function(e){var t=e.contentComponent,n=(0,g.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot);return(0,y.jsx)(y.Fragment,{children:Object.values(n)})};function ke(){var e=new Set,t={};return{subscribe:function(t){return e.add(t),function(){e.delete(t)}},getSnapshot:function(){return t},getServerSnapshot:function(){return t},setRenderer:function(n,r){t=(0,h.A)((0,h.A)({},t),{},(0,p.A)({},n,v.createPortal(r.reactElement,r.element,n))),e.forEach(function(e){return e()})},removeRenderer:function(n){var r=(0,h.A)({},t);delete r[n],t=r,e.forEach(function(e){return e()})}}}var Ce=function(e){function t(e){var n;return(0,u.A)(this,t),n=be(this,t,[e]),n.editorContentRef=m.createRef(),n}
21return(0,f.A)(t,e),(0,s.A)(t,[{key:"componentDidMount",value:function(){this.init()}},{key:"componentDidUpdate",value:function(){this.init()}},{key:"init",value:function(){var e,t=this.props.editor;if(t&&!t.isDestroyed&&(null==(e=t.view.dom)?void 0:e.parentNode)){if(t.contentComponent)return;var n=this.editorContentRef.current;n.append.apply(n,(0,a.A)(t.view.dom.parentNode.childNodes)),t.setOptions({element:n}),t.contentComponent=ke(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}},{key:"componentWillUnmount",value:function(){var e,t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.parentNode))return;var n=document.createElement("div");n.append.apply(n,(0,a.A)(t.view.dom.parentNode.childNodes)),t.setOptions({element:n})}catch(r){}}}},{key:"render",value:function(){var e=this.props,t=e.editor,n=e.innerRef,r=(0,i.A)(e,ye);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",(0,h.A)({ref:we(n,this.editorContentRef)},r)),(null==t?void 0:t.contentComponent)&&(0,y.jsx)(Ae,{contentComponent:t.contentComponent})]})}}])}(m.Component),De=(0,m.forwardRef)(function(e,t){var n=m.useMemo(function(){return Math.floor(4294967295*Math.random()).toString()},[e.editor]);return m.createElement(Ce,(0,h.A)({key:n,innerRef:t},e))}),xe=m.memo(De),Ee="undefined"!==typeof window?m.useLayoutEffect:m.useEffect,Me=function(){function e(t){(0,u.A)(this,e),this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}return(0,s.A)(e,[{key:"getSnapshot",value:function(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}},{key:"getServerSnapshot",value:function(){return{editor:null,transactionNumber:0}}},{key:"subscribe",value:function(e){var t=this;return this.subscribers.add(e),function(){t.subscribers.delete(e)}}},{key:"watch",value:function(e){var t=this;if(this.editor=e,this.editor){var n=function(){t.transactionNumber+=1,t.subscribers.forEach(function(e){return e()})},r=this.editor;return r.on("transaction",n),function(){r.off("transaction",n)}}}}])}();function Se(e){var t,n=(0,m.useState)(function(){return new Me(e.editor)}),r=(0,o.A)(n,1),i=r[0],a=(0,ge.useSyncExternalStoreWithSelector)(i.subscribe,i.getSnapshot,i.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:me);return Ee(function(){return i.watch(e.editor)},[e.editor,i]),(0,m.useDebugValue)(a),a}var Te="undefined"===typeof window,Pe=Te||Boolean("undefined"!==typeof window&&window.next),_e=function(){function e(t){(0,u.A)(this,e),this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}return(0,s.A)(e,[{key:"setEditor",value:function(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(function(e){return e()})}},{key:"getInitialEditor",value:function(){var e=this.options.current.immediatelyRender,t=null==e||e;return(Te||Pe&&void 0===e)&&(t=!1),t?this.createEditor():null}},{key:"createEditor",value:function(){var e=this,t=(0,h.A)((0,h.A)({},this.options.current),{},{onBeforeCreate:function(){for(var t,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=e.options.current).onBeforeCreate)?void 0:(t=r).call.apply(t,[n].concat(i))},onBlur:function(){for(var t,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=e.options.current).onBlur)?void 0:(t=r).call.apply(t,[n].concat(i))},onCreate:function(){for(var t,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=e.options.current).onCreate)?void 0:(t=r).call.apply(t,[n].concat(i))},onDestroy:function(){for(var t,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=e.options.current).onDestroy)?void 0:(t=r).call.apply(t,[n].concat(i))},onFocus:function(){for(var t,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=e.options.current).onFocus)?void 0:(t=r).call.apply(t,[n].concat(i))},onSelectionUpdate:function(){for(var t,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=e.options.current).onSelectionUpdate)?void 0:(t=r).call.apply(t,[n].concat(i))},onTransaction:function(){for(var t,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=e.options.current).onTransaction)?void 0:(t=r).call.apply(t,[n].concat(i))},onUpdate:function(){for(var t,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=e.options.current).onUpdate)?void 0:(t=r).call.apply(t,[n].concat(i))},onContentError:function(){for(var t,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=e.options.current).onContentError)?void 0:(t=r).call.apply(t,[n].concat(i))},onDrop:function(){for(var t,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=e.options.current).onDrop)?void 0:(t=r).call.apply(t,[n].concat(i))},onPaste:function(){for(var t,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=e.options.current).onPaste)?void 0:(t=r).call.apply(t,[n].concat(i))},onDelete:function(){for(var t,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=e.options.current).onDelete)?void 0:(t=r).call.apply(t,[n].concat(i))}}),n=new b.KE(t);return n}},{key:"getEditor",value:function(){return this.editor}},{key:"getServerSnapshot",value:function(){return null}},{key:"subscribe",value:function(e){var t=this;return this.subscriptions.add(e),function(){t.subscriptions.delete(e)}}},{key:"onRender",value:function(t){var n=this;return function(){return n.isComponentMounted=!0,clearTimeout(n.scheduledDestructionTimeout),n.editor&&!n.editor.isDestroyed&&0===t.length?e.compareOptions(n.options.current,n.editor.options)||n.editor.setOptions((0,h.A)((0,h.A)({},n.options.current),{},{editable:n.editor.isEditable})):n.refreshEditorInstance(t),function(){n.isComponentMounted=!1,n.scheduleDestroy()}}}},{key:"refreshEditorInstance",value:function(e){if(this.editor&&!this.editor.isDestroyed){
21if(null===this.previousDeps)return void(this.previousDeps=e);var t=this.previousDeps.length===e.length&&this.previousDeps.every(function(t,n){return t===e[n]});if(t)return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}},{key:"scheduleDestroy",value:function(){var e=this,t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(function(){e.isComponentMounted&&e.instanceId===t?n&&n.setOptions(e.options.current):n&&!n.isDestroyed&&(n.destroy(),e.instanceId===t&&e.setEditor(null))},1)}}],[{key:"compareOptions",value:function(e,t){return Object.keys(e).every(function(n){return!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every(function(e,n){var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n])})}}])}();function Ie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,m.useRef)(e);n.current=e;var r=(0,m.useState)(function(){return new _e(n)}),i=(0,o.A)(r,1),a=i[0],u=(0,g.useSyncExternalStore)(a.subscribe,a.getEditor,a.getServerSnapshot);return(0,m.useDebugValue)(u),(0,m.useEffect)(a.onRender(t)),Se({editor:u,selector:function(t){var n=t.transactionNumber;return!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===n?0:n+1}}),u}var Ne=(0,m.createContext)({editor:null});Ne.Consumer;var Oe=(0,m.createContext)({onDragStart:function(){},nodeViewContentChildren:void 0,nodeViewContentRef:function(){}}),Fe=function(){return(0,m.useContext)(Oe)};var Le=m.forwardRef(function(e,t){var n=Fe(),r=n.onDragStart,o=e.as||"div";return(0,y.jsx)(o,(0,h.A)((0,h.A)({},e),{},{ref:t,"data-node-view-wrapper":"",onDragStart:r,style:(0,h.A)({whiteSpace:"normal"},e.style)}))});function Be(e){return!("function"!==typeof e||!e.prototype||!e.prototype.isReactComponent)}function Re(e){return!("object"!==typeof e||!e.$$typeof||"Symbol(react.forward_ref)"!==e.$$typeof.toString()&&"react.forward_ref"!==e.$$typeof.description)}function ze(e){return!("object"!==typeof e||!e.$$typeof||"Symbol(react.memo)"!==e.$$typeof.toString()&&"react.memo"!==e.$$typeof.description)}function je(e){if(Be(e))return!0;if(Re(e))return!0;if(ze(e)){var t=e.type;if(t)return Be(t)||Re(t)}return!1}function He(){try{if(m.version){var e=parseInt(m.version.split(".")[0],10);return e>=19}}catch(t){}return!1}var Ve=function(){function e(t,n){var r,o=this,i=n.editor,s=n.props,l=void 0===s?{}:s,c=n.as,d=void 0===c?"div":c,f=n.className,p=void 0===f?"":f;((0,u.A)(this,e),this.ref=null,this.destroyed=!1,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=t,this.editor=i,this.props=l,this.element=document.createElement(d),this.element.classList.add("react-renderer"),p)&&(r=this.element.classList).add.apply(r,(0,a.A)(p.split(" ")));this.editor.isEditorContentInitialized?(0,v.flushSync)(function(){o.render()}):queueMicrotask(function(){o.destroyed||o.render()})}return(0,s.A)(e,[{key:"render",value:function(){var e,t=this;if(!this.destroyed){var n=this.component,r=this.props,o=this.editor,i=He(),a=je(n),u=(0,h.A)({},r);!u.ref||i||a||delete u.ref,u.ref||!i&&!a||(u.ref=function(e){t.ref=e}),this.reactElement=(0,y.jsx)(n,(0,h.A)({},u)),null==(e=null==o?void 0:o.contentComponent)||e.setRenderer(this.id,this)}}},{key:"updateProps",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.destroyed){for(var t=!1,n=Object.keys(e),r=0;r<n.length;r+=1){var o=n[r];if(e[o]!==this.props[o]){t=!0;break}}t&&(this.props=(0,h.A)((0,h.A)({},this.props),e),this.render())}}},{key:"destroy",value:function(){var e;this.destroyed=!0;var t=this.editor;null==(e=null==t?void 0:t.contentComponent)||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch(n){}}},{key:"updateAttributes",value:function(e){var t=this;Object.keys(e).forEach(function(n){t.element.setAttribute(n,e[n])})}}])}();var Ye=function(e){function t(e,n,r){var o;if((0,u.A)(this,t),o=be(this,t,[e,n,r]),o.selectionRafId=null,o.handlePositionUpdate=function(){var e=o.getPos();"number"===typeof e&&e!==o.currentPos&&(o.currentPos=e,o.renderer.updateProps({getPos:function(){return o.getPos()}}),"function"===typeof o.options.attrs&&o.updateElementAttributes())},o.cachedExtensionWithSyncedStorage=null,!o.node.isLeaf){o.options.contentDOMElementTag?o.contentDOMElement=document.createElement(o.options.contentDOMElementTag):o.contentDOMElement=document.createElement(o.node.isInline?"span":"div"),o.contentDOMElement.dataset.nodeViewContentReact="",o.contentDOMElement.dataset.nodeViewWrapper="",o.
21contentDOMElement.style.whiteSpace="inherit";var i=o.dom.querySelector("[data-node-view-content]");if(!i)return(0,l.A)(o);i.appendChild(o.contentDOMElement)}return o.options.trackNodeViewPosition&&o.editor.on("update",o.handlePositionUpdate),o}return(0,f.A)(t,e),(0,s.A)(t,[{key:"extensionWithSyncedStorage",get:function(){if(!this.cachedExtensionWithSyncedStorage){var e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get:function(n,r,o){var i;return"storage"===r?null!=(i=e.storage[t.name])?i:{}:Reflect.get(n,r,o)}})}return this.cachedExtensionWithSyncedStorage}},{key:"mount",value:function(){var e=this,t={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:function(){return e.getPos()},updateAttributes:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.updateAttributes(t)},deleteNode:function(){return e.deleteNode()},ref:(0,m.createRef)()},n=t;if(!this.component.displayName){var r=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};this.component.displayName=r(this.extension.name)}var o=this.onDragStart.bind(this),i=function(t){t&&e.contentDOMElement&&t.firstChild!==e.contentDOMElement&&(t.hasAttribute("data-node-view-wrapper")&&t.removeAttribute("data-node-view-wrapper"),t.appendChild(e.contentDOMElement))},a={onDragStart:o,nodeViewContentRef:i},u=this.component,s=(0,m.memo)(function(e){return(0,y.jsx)(Oe.Provider,{value:a,children:(0,m.createElement)(u,e)})});s.displayName="ReactNodeView";var l=this.node.isInline?"span":"div";this.options.as&&(l=this.options.as);var c=this.options.className,d=void 0===c?"":c;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new Ve(s,{editor:this.editor,props:n,as:l,className:"node-".concat(this.node.type.name," ").concat(d).trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos()}},{key:"dom",get:function(){var e;if(this.renderer.element.firstElementChild&&!(null==(e=this.renderer.element.firstElementChild)?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}},{key:"contentDOM",get:function(){return this.node.isLeaf?null:this.contentDOMElement}},{key:"handleSelectionUpdate",value:function(){var e=this;this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(function(){e.selectionRafId=null;var t=e.currentPos;if("number"===typeof t){var n=(0,b.FA)({selection:e.editor.state.selection,pos:t,nodeSize:e.node.nodeSize,selectedOnTextSelection:e.options.selectedOnTextSelection});if(n){if(e.renderer.props.selected)return;e.selectNode()}else{if(!e.renderer.props.selected)return;e.deselectNode()}}})}},{key:"update",value:function(e,t,n){var r=this,o=function(e){r.renderer.updateProps(e),"function"===typeof r.options.attrs&&r.updateElementAttributes()};if(e.type!==this.node.type)return!1;if("function"===typeof this.options.update){var i=this.node,a=this.decorations,u=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:u,innerDecorations:n,updateProps:function(){return o({node:e,decorations:t,innerDecorations:n,extension:r.extensionWithSyncedStorage})}})}var s=e!==this.node;if(!s)return this.node=e,this.decorations=t,this.innerDecorations=n,!0;var l=this.getPos();this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=l;var c={node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(c.getPos=function(){return r.getPos()}),o(c),!0}},{key:"selectNode",value:function(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}},{key:"deselectNode",value:function(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}},{key:"destroy",value:function(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.options.trackNodeViewPosition&&this.editor.off("update",this.handlePositionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}},{key:"updateElementAttributes",value:function(){if(this.options.attrs){var e={};if("function"===typeof this.options.attrs){var t=this.editor.extensionManager.attributes,n=(0,b.zU)(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n}
21)}else e=this.options.attrs;this.renderer.updateAttributes(e)}}}])}(b.Yv);function We(e,t){return function(n){return n.editor.contentComponent?new Ye(e,n,t):{}}}var Ge=(0,m.createContext)({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Ge.displayName="TiptapContext";var Ue=function(){return(0,m.useContext)(Ge)};function qe(e){var t=e.editor,n=e.instance,r=e.children,o=null!=t?t:n;if(!o)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");var i=(0,m.useMemo)(function(){return{editor:o}},[o]),a=(0,m.useMemo)(function(){return{editor:o}},[o]);return(0,y.jsx)(Ne.Provider,{value:a,children:(0,y.jsx)(Ge.Provider,{value:i,children:r})})}function $e(e){var t=Object.assign({},((0,r.A)(e),e)),n=Ue(),o=n.editor;return(0,y.jsx)(xe,(0,h.A)({editor:o},t))}qe.displayName="Tiptap",$e.displayName="Tiptap.Content";Object.assign(qe,{Content:$e})},63555:function(e,t,n){n.d(t,{K:function(){return g},w:function(){return v}});for(var r={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),a="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),u=0;u<10;u++)r[48+u]=r[96+u]=String(u);for(u=1;u<=24;u++)r[u+111]="F"+u;for(u=65;u<=90;u++)r[u]=String.fromCharCode(u+32),o[u]=String.fromCharCode(u);for(var s in r)o.hasOwnProperty(s)||(o[s]=r[s]);function l(e){var t=i&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||a&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key,n=!t&&e.key||(e.shiftKey?o:r)[e.keyCode]||e.key||"Unidentified";return"Esc"==n&&(n="Escape"),"Del"==n&&(n="Delete"),"Left"==n&&(n="ArrowLeft"),"Up"==n&&(n="ArrowUp"),"Right"==n&&(n="ArrowRight"),"Down"==n&&(n="ArrowDown"),n}var c=n(88688),d="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),f="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function p(e){var t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"==a&&(a=" ");for(var u=0;u<i.length-1;u++){var s=i[u];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);d?o=!0:n=!0}}return t&&(a="Alt-"+a),n&&(a="Ctrl-"+a),o&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function h(e){var t=Object.create(null);for(var n in e)t[p(n)]=e[n];return t}function m(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function v(e){return new c.k_({props:{handleKeyDown:g(e)}})}function g(e){var t=h(e);return function(e,n){var o,i=l(n),a=t[m(i,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){var u=t[m(i,n,!1)];if(u&&u(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(f&&n.ctrlKey&&n.altKey)&&(o=r[n.keyCode])&&o!=i){var s=t[m(o,n)];if(s&&s(e.state,e.dispatch,e))return!0}}return!1}}},88688:function(e,t,n){n.d(t,{$t:function(){return F},LN:function(){return m},U3:function(){return b},hs:function(){return j},i5:function(){return C},k_:function(){return B},nh:function(){return A}});var r=n(3846),o=n(60738),i=n(52100),a=n(76880),u=n(83763),s=n(95627),l=n(63887),c=n(94560),d=n(1635);function f(e,t,n){return t=(0,i.A)(t),(0,r.A)(e,(0,o.A)()?Reflect.construct(t,n||[],(0,i.A)(e).constructor):t.apply(e,n))}function p(e,t,n,r){var o=(0,a.A)((0,i.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}var h=Object.create(null),m=function(){function e(t,n,r){(0,s.A)(this,e),this.$anchor=t,this.$head=n,this.ranges=r||[new v(t.min(n),t.max(n))]}return(0,l.A)(e,[{key:"anchor",get:function(){return this.$anchor.pos}},{key:"head",get:function(){return this.$head.pos}},{key:"from",get:function(){return this.$from.pos}},{key:"to",get:function(){return this.$to.pos}},{key:"$from",get:function(){return this.ranges[0].$from}},{key:"$to",get:function(){return this.ranges[0].$to}},{key:"empty",get:function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}},{key:"content",value:function(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.Ji.empty,n=t.content.lastChild,r=null,o=0;o<t.openEnd;o++)r=n,n=n.lastChild;for(var i=e.steps.length,a=this.ranges,u=0;u<a.length;u++){var s=a[u],l=s.$from,d=s.$to,f=e.mapping.slice(i);e.replaceRange(f.map(l.pos),f.map(d.pos),u?c.Ji.empty:t),0==u&&E(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}},{key:"replaceWith",value:function(e,t){for(var n=e.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],a=i.$from,u=i.$to,s=e.mapping.slice(n),l=s.map(a.pos),c=s.map(u.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),E(e,n,t.isInline?-1:1))}}},{key:"getBookmark",value:function(){return b.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.parent.inlineContent?new b(e):x(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var o=e.depth-1;o>=0;o--){var i=t<0?x(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):x(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}return null}},{key:"near",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;
21return this.findFrom(e,t)||this.findFrom(e,-t)||new C(e.node(0))}},{key:"atStart",value:function(e){return x(e,e,0,0,1)||new C(e)}},{key:"atEnd",value:function(e){return x(e,e,e.content.size,e.childCount,-1)||new C(e)}},{key:"fromJSON",value:function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=h[t.type];if(!n)throw new RangeError("No selection type ".concat(t.type," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in h)throw new RangeError("Duplicate use of selection JSON ID "+e);return h[e]=t,t.prototype.jsonID=e,t}}])}();m.prototype.visible=!0;var v=(0,l.A)(function e(t,n){(0,s.A)(this,e),this.$from=t,this.$to=n}),g=!1;function y(e){g||e.parent.inlineContent||(g=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var b=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return(0,s.A)(this,t),y(e),y(n),f(this,t,[e,n])}return(0,u.A)(t,e),(0,l.A)(t,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(e,n){var r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return m.near(r);var o=e.resolve(n.map(this.anchor));return new t(o.parent.inlineContent?o:r,r)}},{key:"replace",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.Ji.empty;if(p(t,"replace",this,3)([e,n]),n==c.Ji.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}},{key:"eq",value:function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}},{key:"getBookmark",value:function(){return new w(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))}},{key:"create",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}},{key:"between",value:function(e,n,r){var o=e.pos-n.pos;if(r&&!o||(r=o>=0?1:-1),!n.parent.inlineContent){var i=m.findFrom(n,r,!0)||m.findFrom(n,-r,!0);if(!i)return m.near(n,r);n=i.$head}return e.parent.inlineContent||(0==o?e=n:(e=(m.findFrom(e,-r,!0)||m.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new t(e,n)}}])}(m);m.jsonID("text",b);var w=function(){function e(t,n){(0,s.A)(this,e),this.anchor=t,this.head=n}return(0,l.A)(e,[{key:"map",value:function(t){return new e(t.map(this.anchor),t.map(this.head))}},{key:"resolve",value:function(e){return b.between(e.resolve(this.anchor),e.resolve(this.head))}}])}(),A=function(e){function t(e){var n;(0,s.A)(this,t);var r=e.nodeAfter,o=e.node(0).resolve(e.pos+r.nodeSize);return n=f(this,t,[e,o]),n.node=r,n}return(0,u.A)(t,e),(0,l.A)(t,[{key:"map",value:function(e,n){var r=n.mapResult(this.anchor),o=r.deleted,i=r.pos,a=e.resolve(i);return o?m.near(a):new t(a)}},{key:"content",value:function(){return new c.Ji(c.FK.from(this.node),0,0)}},{key:"eq",value:function(e){return e instanceof t&&e.anchor==this.anchor}},{key:"toJSON",value:function(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function(){return new k(this.anchor)}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))}},{key:"create",value:function(e,n){return new t(e.resolve(n))}},{key:"isSelectable",value:function(e){return!e.isText&&!1!==e.type.spec.selectable}}])}(m);A.prototype.visible=!1,m.jsonID("node",A);var k=function(){function e(t){(0,s.A)(this,e),this.anchor=t}return(0,l.A)(e,[{key:"map",value:function(t){var n=t.mapResult(this.anchor),r=n.deleted,o=n.pos;return r?new w(o,o):new e(o)}},{key:"resolve",value:function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&A.isSelectable(n)?new A(t):m.near(t)}}])}(),C=function(e){function t(e){return(0,s.A)(this,t),f(this,t,[e.resolve(0),e.resolve(e.content.size)])}return(0,u.A)(t,e),(0,l.A)(t,[{key:"replace",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.Ji.empty;if(n==c.Ji.empty){e.delete(0,e.doc.content.size);var r=m.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else p(t,"replace",this,3)([e,n])}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(e){return new t(e)}},{key:"eq",value:function(e){return e instanceof t}},{key:"getBookmark",value:function(){return D}}],[{key:"fromJSON",value:function(e){return new t(e)}}])}(m);m.jsonID("all",C);var D={map:function(){return this},resolve:function(e){return new C(e)}};function x(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t.inlineContent)return b.create(e,n);for(var a=r-(o>0?0:1);o>0?a<t.childCount:a>=0;a+=o){var u=t.child(a);if(u.isAtom){if(!i&&A.isSelectable(u))return A.create(e,n-(o<0?u.nodeSize:0))}else{var s=x(e,u,n+o,o<0?u.childCount:0,o,i);if(s)return s}n+=u.nodeSize*o}return null}function E(e,t,n){var r=e.steps.length-1;if(!(r<t)){var o=e.steps[r];if(o instanceof d.Ln||o instanceof d.Wg){var i,a=e.mapping.maps[r];a.forEach(function(e,t,n,r){null==i&&(i=r)}),e.setSelection(m.near(e.doc.resolve(i),n))}}}var M=1,S=2,T=4,P=function(e){function t(e){var n;return(0,s.A)(this,t),n=f(this,t,[e.doc]),n.curSelectionFor=0,n.updated=0,n.meta=Object.create(null),n.time=Date.now(),n.curSelection=e.selection,n.storedMarks=e.storedMarks,n}return(0,u.A)(t,e),(0,l.A)(t,[{key:"selection",get:function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}},{key:"setSelection",value:function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|M)&~S,this.storedMarks=null,this}},{key:"selectionSet",get:function(){return(this.updated&M)>0}},{key:"setStoredMarks",value:function(e){return this.storedMarks=e,this.updated|=S,this}},{key:"ensureMarks",value:function(e){return c.CU.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}},{key:"addStoredMark",value:function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(this.updated&S)>0}},{key:"addStep",value:function(e,n){p(t,"addStep",this,3)([e,n]),this.updated=this.updated&~S,this.storedMarks=null}},{key:"setTime",value:function(e){return this.time=e,this}},{key:"replaceSelection",value:function(e){return this.selection.replace(this,e),this}},{key:"replaceSelectionWith",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||c.CU.none))),n.replaceWith(this,e),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(e,t,n){var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(null==n&&(n=t),!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(m.near(this.selection.$to)),this}},{key:"setMeta",value:function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}},{key:"getMeta",value:function(e){return this.meta["string"==typeof e?e:e.key]}},{key:"isGeneric",get:function(){for(var e in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function(){return this.updated|=T,this}},{key:"scrolledIntoView",get:function(){return(this.updated&T)>0}}])}(d.dL);function _(e,t){return t&&e?e.bind(t):e}var I=(0,l.A)(function e(t,n,r){(0,s.A)(this,e),this.name=t,this.init=_(n.init,r),this.apply=_(n.apply,r)}),N=[new I("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new I("selection",{init:function(e,t){return e.selection||m.atStart(t.doc)},apply:function(e){return e.selection}}),new I("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new I("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}}
21)],O=(0,l.A)(function e(t,n){var r=this;(0,s.A)(this,e),this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=N.slice(),n&&n.forEach(function(e){if(r.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");r.plugins.push(e),r.pluginsByKey[e.key]=e,e.spec.state&&r.fields.push(new I(e.key,e.spec.state,e))})}),F=function(){function e(t){(0,s.A)(this,e),this.config=t}return(0,l.A)(e,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(e){return this.applyTransaction(e).state}},{key:"filterTransaction",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n<this.config.plugins.length;n++)if(n!=t){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0}},{key:"applyTransaction",value:function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),r=null;;){for(var o=!1,i=0;i<this.config.plugins.length;i++){var a=this.config.plugins[i];if(a.spec.appendTransaction){var u=r?r[i].n:0,s=r?r[i].state:this,l=u<t.length&&a.spec.appendTransaction.call(a,u?t.slice(u):t,s,n);if(l&&n.filterTransaction(l,i)){if(l.setMeta("appendedTransaction",e),!r){r=[];for(var c=0;c<this.config.plugins.length;c++)r.push(c<i?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}},{key:"applyInner",value:function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var n=new e(this.config),r=this.config.fields,o=0;o<r.length;o++){var i=r[o];n[i.name]=i.apply(t,this[i.name],this,n)}return n}},{key:"tr",get:function(){return new P(this)}},{key:"reconfigure",value:function(t){for(var n=new O(this.schema,t.plugins),r=n.fields,o=new e(n),i=0;i<r.length;i++){var a=r[i].name;o[a]=this.hasOwnProperty(a)?this[a]:r[i].init(t,o)}return o}},{key:"toJSON",value:function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(function(e){return e.toJSON()})),e&&"object"==typeof e)for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}}],[{key:"create",value:function(t){for(var n=new O(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n),o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(t,r);return r}},{key:"fromJSON",value:function(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var o=new O(t.schema,t.plugins),i=new e(o);return o.fields.forEach(function(e){if("doc"==e.name)i.doc=c.bP.fromJSON(t.schema,n.doc);else if("selection"==e.name)i.selection=m.fromJSON(i.doc,n.selection);else if("storedMarks"==e.name)n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(var o in r){var a=r[o],u=a.spec.state;if(a.key==e.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,o))return void(i[e.name]=u.fromJSON.call(a,t,n[o],i))}i[e.name]=e.init(t,i)}}),i}}])}();function L(e,t,n){for(var r in e){var o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=L(o,t,{})),n[r]=o}return n}var B=function(){function e(t){(0,s.A)(this,e),this.spec=t,this.props={},t.props&&L(t.props,this,this.props),this.key=t.key?t.key.key:z("plugin")}return(0,l.A)(e,[{key:"getState",value:function(e){return e[this.key]}}])}(),R=Object.create(null);function z(e){return e in R?e+"$"+ ++R[e]:(R[e]=0,e+"$")}var j=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";(0,s.A)(this,e),this.key=z(t)}return(0,l.A)(e,[{key:"get",value:function(e){return e.config.pluginsByKey[this.key]}},{key:"getState",value:function(e){return e[this.key]}}])}()},35316:function(e,t,n){n.d(t,{Lz:function(){return Or},NZ:function(){return Xn},zF:function(){return er}});var r=n(10020),o=n(85567),i=n(3846),a=n(60738),u=n(52100),s=n(76880),l=n(83763),c=n(95627),d=n(63887),f=n(88688),p=n(94560),h=n(1635);function m(e,t,n){return t=(0,u.A)(t),(0,i.A)(e,(0,a.A)()?Reflect.construct(t,n||[],(0,u.A)(e).constructor):t.apply(e,n))}function v(e,t,n,r){var o=(0,s.A)((0,u.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}var g=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},y=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},b=null,w=function(e,t,n){var r=b||(b=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},A=function(){b=null},k=function(e,t,n,r){return n&&(D(e,t,n,r,-1)||D(e,t,n,r,1))},C=/^(img|br|input|textarea|hr)$/i;function D(e,t,n,r,o){for(var i;;){if(e==n&&t==r)return!0;
21if(t==(o<0?0:x(e))){var a=e.parentNode;if(!a||1!=a.nodeType||T(e)||C.test(e.nodeName)||"false"==e.contentEditable)return!1;t=g(e)+(o<0?0:1),e=a}else{if(1!=e.nodeType)return!1;var u=e.childNodes[t+(o<0?-1:0)];if(1==u.nodeType&&"false"==u.contentEditable){if(!(null===(i=u.pmViewDesc)||void 0===i?void 0:i.ignoreForSelection))return!1;t+=o}else e=u,t=o<0?x(e):0}}}function x(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function E(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;e=e.childNodes[t-1],t=x(e)}else{if(!e.parentNode||T(e))return null;t=g(e),e=e.parentNode}}}function M(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||T(e))return null;t=g(e)+1,e=e.parentNode}}}function S(e,t,n){for(var r=0==t,o=t==x(e);r||o;){if(e==n)return!0;var i=g(e);if(e=e.parentNode,!e)return!1;r=r&&0==i,o=o&&i==x(e)}}function T(e){for(var t,n=e;n;n=n.parentNode)if(t=n.pmViewDesc)break;return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var P=function(e){return e.focusNode&&k(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function _(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function I(e){var t=e.activeElement;while(t&&t.shadowRoot)t=t.shadowRoot.activeElement;return t}function N(e,t,n){if(e.caretPositionFromPoint)try{var r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(x(r.offsetNode),r.offset)}}catch(i){}if(e.caretRangeFromPoint){var o=e.caretRangeFromPoint(t,n);if(o)return{node:o.startContainer,offset:Math.min(x(o.startContainer),o.startOffset)}}}var O="undefined"!=typeof navigator?navigator:null,F="undefined"!=typeof document?document:null,L=O&&O.userAgent||"",B=/Edge\/(\d+)/.exec(L),R=/MSIE \d/.exec(L),z=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(L),j=!!(R||z||B),H=R?document.documentMode:z?+z[1]:B?+B[1]:0,V=!j&&/gecko\/(\d+)/i.test(L);V&&(/Firefox\/(\d+)/.exec(L)||[0,0])[1];var Y=!j&&/Chrome\/(\d+)/.exec(L),W=!!Y,G=Y?+Y[1]:0,U=!j&&!!O&&/Apple Computer/.test(O.vendor),q=U&&(/Mobile\/\w+/.test(L)||!!O&&O.maxTouchPoints>2),$=q||!!O&&/Mac/.test(O.platform),K=!!O&&/Win/.test(O.platform),J=/Android \d/.test(L),X=!!F&&"webkitFontSmoothing"in F.documentElement.style,Z=X?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Q(e){var t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function ee(e,t){return"number"==typeof e?e:e[t]}function te(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function ne(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,a=n||e.dom;;){if(!a)break;if(1==a.nodeType){var u=a,s=u==i.body,l=s?Q(i):te(u),c=0,d=0;if(t.top<l.top+ee(r,"top")?d=-(l.top-t.top+ee(o,"top")):t.bottom>l.bottom-ee(r,"bottom")&&(d=t.bottom-t.top>l.bottom-l.top?t.top+ee(o,"top")-l.top:t.bottom-l.bottom+ee(o,"bottom")),t.left<l.left+ee(r,"left")?c=-(l.left-t.left+ee(o,"left")):t.right>l.right-ee(r,"right")&&(c=t.right-l.right+ee(o,"right")),c||d)if(s)i.defaultView.scrollBy(c,d);else{var f=u.scrollLeft,p=u.scrollTop;d&&(u.scrollTop+=d),c&&(u.scrollLeft+=c);var h=u.scrollLeft-f,m=u.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}var v=s?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(v))break;a="absolute"==v?a.offsetParent:y(a)}else a=y(a)}}function re(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,a=o+1;a<Math.min(innerHeight,r.bottom);a+=5){var u=e.root.elementFromPoint(i,a);if(u&&u!=e.dom&&e.dom.contains(u)){var s=u.getBoundingClientRect();if(s.top>=o-20){t=u,n=s.top;break}}}return{refDOM:t,refTop:n,stack:oe(e.dom)}}function oe(e){for(var t=[],n=e.ownerDocument,r=e;r;r=y(r))if(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e==n)break;return t}function ie(e){var t=e.refDOM,n=e.refTop,r=e.stack,o=t?t.getBoundingClientRect().top:0;ae(r,0==o?0:o-n)}function ae(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=r.dom,i=r.top,a=r.left;o.scrollTop!=i+t&&(o.scrollTop=i+t),o.scrollLeft!=a&&(o.scrollLeft=a)}}var ue=null;function se(e){if(e.setActive)return e.setActive();if(ue)return e.focus(ue);var t=oe(e);e.focus(null==ue?{get preventScroll(){return ue={preventScroll:!0},!0}}:void 0),ue||(ue=!1,ae(t,0))}function le(e,t){for(var n,r,o,i,a=2e8,u=0,s=t.top,l=t.top,c=e.firstChild,d=0;c;c=c.nextSibling,d++){var f=void 0;if(1==c.nodeType)f=c.getClientRects();else{if(3!=c.nodeType)continue;f=w(c).getClientRects()}for(var p=0;p<f.length;p++){var h=f[p];if(h.top<=s&&h.bottom>=l){s=Math.max(h.bottom,s),l=Math.min(h.top,l);var m=h.left>t.left?h.left-t.left:h.right<t.left?t.left-h.right:0;if(m<a){n=c,a=m,r=m&&3==n.nodeType?{left:h.right<t.left?h.right:h.left,top:t.top}:t,1==c.nodeType&&m&&(u=d+(t.left>=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!o&&h.left<=t.left&&h.right>=t.left&&(o=c,i={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(u=d+1)}}return!n&&o&&(n=o,r=i,a=0),n&&3==n.nodeType?ce(n,r):!n||a&&1==n.nodeType?{node:e,offset:u}:le(n,r)}function ce(e,t){for(var n,r=e.nodeValue.length,o=document.createRange(),i=0;i<r;i++){o.setEnd(e,i+1),o.setStart(e,i);var a=ye(o,1);if(a.top!=a.bottom&&de(t,a)){n={node:e,offset:i+(t.left>=(a.left+a.right)/2?1:0)};break}}return o.detach(),n||{node:e,offset:0}}function de(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>
21=t.top-1&&e.top<=t.bottom+1}function fe(e,t){var n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function pe(e,t,n){var r=le(t,n),o=r.node,i=r.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var u=o.getBoundingClientRect();a=u.left!=u.right&&n.left>(u.left+u.right)/2?1:-1}return e.docView.posFromDOM(o,i,a)}function he(e,t,n,r){for(var o=-1,i=t,a=!1;;){if(i==e.dom)break;var u=e.docView.nearestDesc(i,!0),s=void 0;if(!u)return null;if(1==u.dom.nodeType&&(u.node.isBlock&&u.parent||!u.contentDOM)&&((s=u.dom.getBoundingClientRect()).width||s.height)&&(u.node.isBlock&&u.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(u.dom.nodeName)&&(!a&&s.left>r.left||s.top>r.top?o=u.posBefore:(!a&&s.right<r.left||s.bottom<r.top)&&(o=u.posAfter),a=!0),!u.contentDOM&&o<0&&!u.node.isText)){var l=u.node.isBlock?r.top<(s.top+s.bottom)/2:r.left<(s.left+s.right)/2;return l?u.posBefore:u.posAfter}i=u.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}function me(e,t,n){var r=e.childNodes.length;if(r&&n.top<n.bottom)for(var o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){var a=e.childNodes[i];if(1==a.nodeType)for(var u=a.getClientRects(),s=0;s<u.length;s++){var l=u[s];if(de(t,l))return me(a,t,l)}if((i=(i+1)%r)==o)break}return e}function ve(e,t){var n,r=e.dom.ownerDocument,o=0,i=N(r,t.left,t.top);i&&(n=i.node,o=i.offset);var a,u=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!u||!e.dom.contains(1!=u.nodeType?u.parentNode:u)){var s=e.dom.getBoundingClientRect();if(!de(t,s))return null;if(u=me(e.dom,t,s),!u)return null}if(U)for(var l=u;n&&l;l=y(l))l.draggable&&(n=void 0);if(u=fe(u,t),n){if(V&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){var c,d=n.childNodes[o];"IMG"==d.nodeName&&(c=d.getBoundingClientRect()).right<=t.left&&c.bottom>t.top&&o++}var f;X&&o&&1==n.nodeType&&1==(f=n.childNodes[o-1]).nodeType&&"false"==f.contentEditable&&f.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(a=he(e,n,o,t))}null==a&&(a=pe(e,u,t));var p=e.docView.nearestDesc(u,!0);return{pos:a,inside:p?p.posAtStart-p.border:-1}}function ge(e){return e.top<e.bottom||e.left<e.right}function ye(e,t){var n=e.getClientRects();if(n.length){var r=n[t<0?0:n.length-1];if(ge(r))return r}return Array.prototype.find.call(n,ge)||e.getBoundingClientRect()}var be=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function we(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),o=r.node,i=r.offset,a=r.atom,u=X||V;if(3==o.nodeType){if(!u||!be.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var s=i,l=i,c=n<0?1:-1;return n<0&&!i?(l++,c=-1):n>=0&&i==o.nodeValue.length?(s--,c=1):n<0?s--:l++,Ae(ye(w(o,s,l),c),c<0)}var d=ye(w(o,i,i),n);if(V&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){var f=ye(w(o,i-1,i-1),-1);if(f.top==d.top){var p=ye(w(o,i,i+1),-1);if(p.top!=d.top)return Ae(p,p.left<f.left)}}return d}var h=e.state.doc.resolve(t-(a||0));if(!h.parent.inlineContent){if(null==a&&i&&(n<0||i==x(o))){var m=o.childNodes[i-1];if(1==m.nodeType)return ke(m.getBoundingClientRect(),!1)}if(null==a&&i<x(o)){var v=o.childNodes[i];if(1==v.nodeType)return ke(v.getBoundingClientRect(),!0)}return ke(o.getBoundingClientRect(),n>=0)}if(null==a&&i&&(n<0||i==x(o))){var g=o.childNodes[i-1],y=3==g.nodeType?w(g,x(g)-(u?0:1)):1!=g.nodeType||"BR"==g.nodeName&&g.nextSibling?null:g;if(y)return Ae(ye(y,1),!1)}if(null==a&&i<x(o)){var b=o.childNodes[i];while(b.pmViewDesc&&b.pmViewDesc.ignoreForCoords)b=b.nextSibling;var A=b?3==b.nodeType?w(b,0,u?0:1):1==b.nodeType?b:null:null;if(A)return Ae(ye(A,-1),!0)}return Ae(ye(3==o.nodeType?w(o):o,-n),n>=0)}function Ae(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function ke(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Ce(e,t,n){var r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}function De(e,t,n){var r=t.selection,o="up"==n?r.$from:r.$to;return Ce(e,t,function(){for(var t=e.docView.domFromPos(o.pos,"up"==n?-1:1),r=t.no
21de;;){var i=e.docView.nearestDesc(r,!0);if(!i)break;if(i.node.isBlock){r=i.contentDOM||i.dom;break}r=i.dom.parentNode}for(var a=we(e,o.pos,1),u=r.firstChild;u;u=u.nextSibling){var s=void 0;if(1==u.nodeType)s=u.getClientRects();else{if(3!=u.nodeType)continue;s=w(u,0,u.nodeValue.length).getClientRects()}for(var l=0;l<s.length;l++){var c=s[l];if(c.bottom>c.top+1&&("up"==n?a.top-c.top>2*(c.bottom-a.top):c.bottom-a.bottom>2*(a.bottom-c.top)))return!1}}return!0})}var xe=/[\u0590-\u08ac]/;function Ee(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,a=o==r.parent.content.size,u=e.domSelection();return u?xe.test(r.parent.textContent)&&u.modify?Ce(e,t,function(){var t=e.domSelectionRange(),o=t.focusNode,i=t.focusOffset,a=t.anchorNode,s=t.anchorOffset,l=u.caretBidiLevel;u.modify("move",n,"character");var c=r.depth?e.docView.domAfterPos(r.before()):e.dom,d=e.domSelectionRange(),f=d.focusNode,p=d.focusOffset,h=f&&!c.contains(1==f.nodeType?f:f.parentNode)||o==f&&i==p;try{u.collapse(a,s),o&&(o!=a||i!=s)&&u.extend&&u.extend(o,i)}catch(m){}return null!=l&&(u.caretBidiLevel=l),h}):"left"==n||"backward"==n?i:a:r.pos==r.start()||r.pos==r.end()}var Me=null,Se=null,Te=!1;function Pe(e,t,n){return Me==t&&Se==n?Te:(Me=t,Se=n,Te="up"==n||"down"==n?De(e,t,n):Ee(e,t,n))}var _e=0,Ie=1,Ne=2,Oe=3,Fe=function(){function e(t,n,r,o){(0,c.A)(this,e),this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=_e,r.pmViewDesc=this}return(0,d.A)(e,[{key:"matchesWidget",value:function(e){return!1}},{key:"matchesMark",value:function(e){return!1}},{key:"matchesNode",value:function(e,t,n){return!1}},{key:"matchesHack",value:function(e){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(e){return!1}},{key:"size",get:function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e}},{key:"border",get:function(){return 0}},{key:"destroy",value:function(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(var e=0;e<this.children.length;e++)this.children[e].destroy()}},{key:"posBeforeChild",value:function(e){for(var t=0,n=this.posAtStart;;t++){var r=this.children[t];if(r==e)return n;n+=r.size}}},{key:"posBefore",get:function(){return this.parent.posBeforeChild(this)}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}},{key:"posAfter",get:function(){return this.posBefore+this.size}},{key:"posAtEnd",get:function(){return this.posAtStart+this.size-2*this.border}},{key:"localPosFromDOM",value:function(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){var r,o;if(e==this.contentDOM)r=e.childNodes[t-1];else{while(e.parentNode!=this.contentDOM)e=e.parentNode;r=e.previousSibling}while(r&&(!(o=r.pmViewDesc)||o.parent!=this))r=r.previousSibling;return r?this.posBeforeChild(o)+o.size:this.posAtStart}var i,a;if(e==this.contentDOM)i=e.childNodes[t];else{while(e.parentNode!=this.contentDOM)e=e.parentNode;i=e.nextSibling}while(i&&(!(a=i.pmViewDesc)||a.parent!=this))i=i.nextSibling;return i?this.posBeforeChild(a):this.posAtEnd}var u;if(e==this.dom&&this.contentDOM)u=t>g(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))u=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var s=e;;s=s.parentNode){if(s==this.dom){u=!1;break}if(s.previousSibling)break}if(null==u&&t==e.childNodes.length)for(var l=e;;l=l.parentNode){if(l==this.dom){u=!0;break}if(l.nextSibling)break}}return(null==u?n>0:u)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r),i=void 0;if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}},{key:"getDesc",value:function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t}},{key:"posFromDOM",value:function(e,t,n){for(var r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}},{key:"descAt",value:function(e){for(var t=0,n=0;t<this.children.length;t++){var r=this.children[t],o=n+r.size;if(n==e&&o!=n){while(!r.border&&r.children.length)for(var i=0;i<r.children.length;i++){var a=r.children[i];if(a.size){r=a;break}}return r}if(e<o)return r.descAt(e-n-r.border);n=o}}},{key:"domFromPos",value:function(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};for(var n,r=0,o=0,i=0;r<this.children.length;r++){var a=this.children[r],u=i+a.size;if(u>e||a instanceof Ve){o=e-i;break}i=u}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Le&&n.side>=0;r--);if(t<=0){for(var s,l=!0;;r--,l=!1)if(s=r?this.children[r-1]:null,!s||s.dom.parentNode==this.contentDOM)break;return s&&t&&l&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?g(s.dom)+1:0}}for(var c,d=!0;;r++,d=!1)if(c=r<this.children.length?this.children[r]:null,!c||c.dom.parentNode==this.contentDOM)break;return c&&d&&!c.border&&!c.domAtom?c.domFromPos(0,t):{node:this.contentDOM,offset:c?g(c.dom):this.contentDOM.childNodes.length}}},{key:"parseRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,a=0;;a++){var u=this.children[a],s=i+u.size;if(-1==r&&e<=s){var l=i+u.border;if(e>=l&&t<=s-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,t,l);e=i;for(var c=a;c>0;c--){var d=this.children[c-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){r=g(d.dom)+1;break}e-=d.size}-1==r&&(r=0)}if(r>-1&&(s>t||a==this.children.length-1)){t=s;for(var f=a+1;f<this.children.length;f++){var p=this.children[f];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){o=g(p.dom);break}t+=p.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}},{key:"emptyChildAt",value:function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}},{key:"domAfterPos",value:function(e){var t=this.domFromPos(e,0),n=t.node,r=t.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}},{key:"setSelection",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=Math.min(e,t),i=Math.max(e,t),a=0,u=0;a<this.children.length;a++){var s=this.children[a],l=u+s.size;if(o>u&&i<l)return s.setSelection(e-u-s.border,t-u-s.border,n,r);u=l}var c=this.domFromPos(e,e?-1:1),d=t==e?c:this.domFromPos(t,t?-1:1),f=n.root.getSelection(),p=n.domSelectionRange(),h=!1;if((V||U)&&e==t){var m=c,v=m.node,y=m.offset;if(3==v.nodeType){if(h=!(!y||"\n"!=v.nodeValue[y-1]),h&&y==v.nodeValue.length)for(var b,w=v;w;w=w.parentNode){if(b=w.nextSibling){"BR"==b.nodeName&&(c=d={node:b.parentNode,offset:g(b)+1});break}var A=w.pmViewDesc;if(A&&A.node&&A.node.isBlock)break}}else{var C=v.childNodes[y-1];h=C&&("BR"==C.nodeName||"false"==C.contentEditable)}}if(V&&p.focusNode&&p.focusNode!=d.node&&1==p.focusNode.nodeType){var D=p.focusNode.childNodes[p.focusOffset];D&&"false"==D.contentEditable&&(r=!0)}
21if(r||h&&U||!k(c.node,c.offset,p.anchorNode,p.anchorOffset)||!k(d.node,d.offset,p.focusNode,p.focusOffset)){var x=!1;if((f.extend||e==t)&&(!h||!V)){f.collapse(c.node,c.offset);try{e!=t&&f.extend(d.node,d.offset),x=!0}catch(S){}}if(!x){if(e>t){var E=c;c=d,d=E}var M=document.createRange();M.setEnd(d.node,d.offset),M.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(M)}}}},{key:"ignoreMutation",value:function(e){return!this.contentDOM&&"selection"!=e.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(e,t){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){var a=n+o.border,u=i-o.border;if(e>=a&&t<=u)return this.dirty=e==n||t==i?Ne:Ie,void(e!=a||t!=u||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=Oe);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?Oe:Ne}n=i}this.dirty=Ne}},{key:"markParentsDirty",value:function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?Ne:Ie;t.dirty<n&&(t.dirty=n)}}},{key:"domAtom",get:function(){return!1}},{key:"ignoreForCoords",get:function(){return!1}},{key:"ignoreForSelection",get:function(){return!1}},{key:"isText",value:function(e){return!1}}])}(),Le=function(e){function t(e,n,r,o){var i;(0,c.A)(this,t);var a,u=n.type.toDOM;if("function"==typeof u&&(u=u(r,function(){return a?a.parent?a.parent.posBeforeChild(a):void 0:o})),!n.type.spec.raw){if(1!=u.nodeType){var s=document.createElement("span");s.appendChild(u),u=s}u.contentEditable="false",u.classList.add("ProseMirror-widget")}return i=m(this,t,[e,[],u,null]),i.widget=n,i.widget=n,a=i,i}return(0,l.A)(t,e),(0,d.A)(t,[{key:"matchesWidget",value:function(e){return this.dirty==_e&&e.type.eq(this.widget.type)}},{key:"parseRule",value:function(){return{ignore:!0}}},{key:"stopEvent",value:function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)}},{key:"ignoreMutation",value:function(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}},{key:"destroy",value:function(){this.widget.type.destroy(this.dom),v(t,"destroy",this,3)([])}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForSelection",get:function(){return!!this.widget.type.spec.relaxedSide}},{key:"side",get:function(){return this.widget.type.side}}])}(Fe),Be=function(e){function t(e,n,r,o){var i;return(0,c.A)(this,t),i=m(this,t,[e,[],n,null]),i.textDOM=r,i.text=o,i}return(0,l.A)(t,e),(0,d.A)(t,[{key:"size",get:function(){return this.text.length}},{key:"localPosFromDOM",value:function(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}},{key:"domFromPos",value:function(e){return{node:this.textDOM,offset:e}}},{key:"ignoreMutation",value:function(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}])}(Fe),Re=function(e){function t(e,n,r,o,i){var a;return(0,c.A)(this,t),a=m(this,t,[e,[],r,o]),a.mark=n,a.spec=i,a}return(0,l.A)(t,e),(0,d.A)(t,[{key:"parseRule",value:function(){return this.dirty&Oe||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}},{key:"matchesMark",value:function(e){return this.dirty!=Oe&&this.mark.eq(e)}},{key:"markDirty",value:function(e,n){if(v(t,"markDirty",this,3)([e,n]),this.dirty!=_e){var r=this.parent;while(!r.node)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=_e}}},{key:"slice",value:function(e,n,r){var o=t.create(this.parent,this.mark,!0,r),i=this.children,a=this.size;n<a&&(i=it(i,n,a,r)),e>0&&(i=it(i,0,e,r));for(var u=0;u<i.length;u++)i[u].parent=o;return o.children=i,o}},{key:"ignoreMutation",value:function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):v(t,"ignoreMutation",this,3)([e])}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),v(t,"destroy",this,3)([])}}],[{key:"create",value:function(e,n,r,o){var i=o.nodeViews[n.type.name],a=i&&i(n,o,r);return a&&a.dom||(a=p.ZF.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,a.dom,a.contentDOM||a.dom,a)}}])}(Fe),ze=function(e){function t(e,n,r,o,i,a,u,s,l){var d;
21return(0,c.A)(this,t),d=m(this,t,[e,[],i,a]),d.node=n,d.outerDeco=r,d.innerDeco=o,d.nodeDOM=u,d}return(0,l.A)(t,e),(0,d.A)(t,[{key:"parseRule",value:function(){var e=this;if(this.node.type.spec.reparseInView)return null;var t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(var n=this.children.length-1;n>=0;n--){var r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=function(){return p.FK.empty})}else t.contentElement=this.contentDOM;else t.getContent=function(){return e.node.content};return t}},{key:"matchesNode",value:function(e,t,n){return this.dirty==_e&&e.eq(this.node)&&Xe(t,this.outerDeco)&&n.eq(this.innerDeco)}},{key:"size",get:function(){return this.node.nodeSize}},{key:"border",get:function(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function(e,t){var n=this,r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,u=i&&i.pos<0,s=new Qe(this,a&&a.node,e);nt(this.node,this.innerDeco,function(t,i,a){t.spec.marks?s.syncToMarks(t.spec.marks,r,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==n.node.childCount?p.CU.none:n.node.child(i).marks,r,e,i),s.placeWidget(t,e,o)},function(t,n,a,l){var c;s.syncToMarks(t.marks,r,e,l),s.findNodeMatch(t,n,a,l)||u&&e.state.selection.from>o&&e.state.selection.to<o+t.nodeSize&&(c=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,n,a,c,e)||s.updateNextNode(t,n,a,e,l,o)||s.addNode(t,n,a,e,o),o+=t.nodeSize}),s.syncToMarks([],r,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Ne)&&(a&&this.protectLocalComposition(e,a),We(this.contentDOM,this.children,e),q&&rt(this.dom))}},{key:"localCompositionInfo",value:function(e,t){var n=e.state.selection,r=n.from,o=n.to;if(!(e.state.selection instanceof f.U3)||r<t||o>t+this.node.content.size)return null;var i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){var a=i.nodeValue,u=ot(this.node.content,a,r-t,o-t);return u<0?null:{node:i,pos:u,text:a}}return{node:i,pos:-1,text:""}}},{key:"protectLocalComposition",value:function(e,t){var n=t.node,r=t.pos,o=t.text;if(!this.getDesc(n)){for(var i=n;;i=i.parentNode){if(i.parentNode==this.contentDOM)break;while(i.previousSibling)i.parentNode.removeChild(i.previousSibling);while(i.nextSibling)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}var a=new Be(this,i,n,o);e.input.compositionNodes.push(a),this.children=it(this.children,r,r+o.length,e,a)}}},{key:"update",value:function(e,t,n,r){return!(this.dirty==Oe||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}},{key:"updateInner",value:function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=_e}},{key:"updateOuterDeco",value:function(e){if(!Xe(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=$e(this.dom,this.nodeDOM,qe(this.outerDeco,this.node,t),qe(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}}},{key:"selectNode",value:function(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}},{key:"deselectNode",value:function(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}},{key:"domAtom",get:function(){return this.node.isAtom}}],[{key:"create",value:function(e,n,r,o,i,a){var u,s=i.nodeViews[n.type.name],l=s&&s(n,i,function(){return u?u.parent?u.parent.posBeforeChild(u):void 0:a},r,o),c=l&&l.dom,d=l&&l.contentDOM;if(n.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(n.text);else if(!c){var f=p.ZF.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);c=f.dom,d=f.contentDOM}d||n.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));var h=c;return c=Je(c,r,n),l?u=new Ye(e,n,r,o,c,d||null,h,l,i,a+1):n.isText?new He(e,n,r,o,c,h,i):new t(e,n,r,o,c,d||null,h,i,a+1)}}])}(Fe);function je(e,t,n,r,o){Je(r,t,e);var i=new ze(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}
21var He=function(e){function t(e,n,r,o,i,a,u){return(0,c.A)(this,t),m(this,t,[e,n,r,o,i,null,a,u,0])}return(0,l.A)(t,e),(0,d.A)(t,[{key:"parseRule",value:function(){var e=this.nodeDOM.parentNode;while(e&&e!=this.dom&&!e.pmIsDeco)e=e.parentNode;return{skip:e||!0}}},{key:"update",value:function(e,t,n,r){return!(this.dirty==Oe||this.dirty!=_e&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==_e&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=_e,!0)}},{key:"inParent",value:function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}},{key:"domFromPos",value:function(e){return{node:this.nodeDOM,offset:e}}},{key:"localPosFromDOM",value:function(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):v(t,"localPosFromDOM",this,3)([e,n,r])}},{key:"ignoreMutation",value:function(e){return"characterData"!=e.type&&"selection"!=e.type}},{key:"slice",value:function(e,n,r){var o=this.node.cut(e,n),i=document.createTextNode(o.text);return new t(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}},{key:"markDirty",value:function(e,n){v(t,"markDirty",this,3)([e,n]),this.dom==this.nodeDOM||0!=e&&n!=this.nodeDOM.nodeValue.length||(this.dirty=Oe)}},{key:"domAtom",get:function(){return!1}},{key:"isText",value:function(e){return this.node.text==e}}])}(ze),Ve=function(e){function t(){return(0,c.A)(this,t),m(this,t,arguments)}return(0,l.A)(t,e),(0,d.A)(t,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(e){return this.dirty==_e&&this.dom.nodeName==e}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}])}(Fe),Ye=function(e){function t(e,n,r,o,i,a,u,s,l,d){var f;return(0,c.A)(this,t),f=m(this,t,[e,n,r,o,i,a,u,l,d]),f.spec=s,f}return(0,l.A)(t,e),(0,d.A)(t,[{key:"update",value:function(e,n,r,o){if(this.dirty==Oe)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){var i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&v(t,"update",this,3)([e,n,r,o])}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():v(t,"selectNode",this,3)([])}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():v(t,"deselectNode",this,3)([])}},{key:"setSelection",value:function(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):v(t,"setSelection",this,3)([e,n,r,o])}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),v(t,"destroy",this,3)([])}},{key:"stopEvent",value:function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}},{key:"ignoreMutation",value:function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):v(t,"ignoreMutation",this,3)([e])}}])}(ze);function We(e,t,n){for(var r=e.firstChild,o=!1,i=0;i<t.length;i++){var a=t[i],u=a.dom;if(u.parentNode==e){while(u!=r)r=Ze(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(u,r);if(a instanceof Re){var s=r?r.previousSibling:e.lastChild;We(a.contentDOM,a.children,n),r=s?s.nextSibling:e.firstChild}}while(r)r=Ze(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}var Ge=function(e){e&&(this.nodeName=e)};Ge.prototype=Object.create(null);var Ue=[new Ge];function qe(e,t,n){if(0==e.length)return Ue;for(var r=n?Ue[0]:new Ge,o=[r],i=0;i<e.length;i++){var a=e[i].type.attrs;if(a)for(var u in a.nodeName&&o.push(r=new Ge(a.nodeName)),a){var s=a[u];null!=s&&(n&&1==o.length&&o.push(r=new Ge(t.isInline?"span":"div")),"class"==u?r.class=(r.class?r.class+" ":"")+s:"style"==u?r.style=(r.style?r.style+";":"")+s:"nodeName"!=u&&(r[u]=s))}}return o}function $e(e,t,n,r){if(n==Ue&&r==Ue)return t;for(var o=t,i=0;i<r.length;i++){var a=r[i],u=n[i];if(i){var s=void 0;u&&u.nodeName==a.nodeName&&o!=e&&(s=o.parentNode)&&s.nodeName.toLowerCase()==a.nodeName||(s=document.createElement(a.nodeName),s.pmIsDeco=!0,s.appendChild(o),u=Ue[0]),o=s}Ke(o,u||Ue[0],a)}return o}function Ke(e,t,n){for(var r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){for(var i=t.class?t.class.split(" ").filter(
21Boolean):[],a=n.class?n.class.split(" ").filter(Boolean):[],u=0;u<i.length;u++)-1==a.indexOf(i[u])&&e.classList.remove(i[u]);for(var s=0;s<a.length;s++)-1==i.indexOf(a[s])&&e.classList.add(a[s]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){var l,c=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;while(l=c.exec(t.style))e.style.removeProperty(l[1])}n.style&&(e.style.cssText+=n.style)}}function Je(e,t,n){return $e(e,e,Ue,qe(t,n,1!=e.nodeType))}function Xe(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Ze(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var Qe=function(){function e(t,n,r){(0,c.A)(this,e),this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=et(t.node.content,t)}return(0,d.A)(e,[{key:"destroyBetween",value:function(e,t){if(e!=t){for(var n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}},{key:"destroyRest",value:function(){this.destroyBetween(this.index,this.top.children.length)}},{key:"syncToMarks",value:function(e,t,n,r){var o=0,i=this.stack.length>>1,a=Math.min(i,e.length);while(o<a&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&!1!==e[o].type.spec.spanning)o++;while(o<i)this.destroyRest(),this.top.dirty=_e,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;while(i<e.length){this.stack.push(this.top,this.index+1);var u=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(var l=this.index;l<s;l++){var c=this.top.children[l];if(c.matchesMark(e[i])&&!this.isLocked(c.dom)){u=l;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{var d=Re.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,i++}}},{key:"findNodeMatch",value:function(e,t,n,r){var o,i=-1;
21if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(var a=this.index,u=Math.min(this.top.children.length,a+5);a<u;a++){var s=this.top.children[a];if(s.matchesNode(e,t,n)&&!this.preMatch.matched.has(s)){i=a;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}},{key:"updateNodeAt",value:function(e,t,n,r,o){var i=this.top.children[r];return i.dirty==Oe&&i.dom==i.contentDOM&&(i.dirty=Ne),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}},{key:"findIndexWithChild",value:function(e){for(;;){var t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){var n=e.pmViewDesc;if(n)for(var r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==n)return r;return-1}e=t}}},{key:"updateNextNode",value:function(e,t,n,r,o,i){for(var a=this.index;a<this.top.children.length;a++){var u=this.top.children[a];if(u instanceof ze){var s=this.preMatch.matched.get(u);if(null!=s&&s!=o)return!1;var l=u.dom,c=void 0,d=this.isLocked(l)&&!(e.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==e.text&&u.dirty!=Oe&&Xe(t,u.outerDeco));if(!d&&u.update(e,t,n,r))return this.destroyBetween(this.index,a),u.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(c=this.recreateWrapper(u,e,t,n,r,i)))return this.destroyBetween(this.index,a),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=Ne,c.updateChildren(r,i+1),c.dirty=_e),this.changed=!0,this.index++,!0;break}}return!1}},{key:"recreateWrapper",value:function(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Xe(n,e.outerDeco)||!r.eq(e.innerDeco))return null;var u=ze.create(this.top,t,n,r,i,a);if(u.contentDOM){u.children=e.children,e.children=[];var s,l=(0,o.A)(u.children);try{for(l.s();!(s=l.n()).done;){var c=s.value;c.parent=u}}catch(d){l.e(d)}finally{l.f()}}return e.destroy(),u}},{key:"addNode",value:function(e,t,n,r,o){var i=ze.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}},{key:"placeWidget",value:function(e,t,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){var o=new Le(this.top,e,t,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++}},{key:"addTextblockHacks",value:function(){var e=this.top.children[this.index-1],t=this.top;while(e instanceof Re)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof He)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((U||W)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}},{key:"addHackNode",value:function(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{var n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");var r=new Ve(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}},{key:"isLocked",value:function(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}])}();function et(e,t){var n=t,r=n.children.length,o=e.childCount,i=new Map,a=[];e:while(o>0){for(var u=void 0;;)if(r){var s=n.children[r-1];if(!(s instanceof Re)){u=s,r--;break}n=s,r=s.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}var l=u.node;if(l){if(l!=e.child(o-1))break;--o,i.set(u,o),a.push(u)}}return{index:o,matched:i,matches:a.reverse()}}function tt(e,t){return e.type.side-t.type.side}function nt(e,t,n,r){var o=t.locals(e),i=0;if(0!=o.length)for(var a=0,u=[],s=null,l=0;;){var c=void 0,d=void 0;while(a<o.length&&o[a].to==i){var f=o[a++];f.widget&&(c?(d||(d=[c])).push(f):c=f)}if(c)if(d){d.sort(tt);for(var p=0;p<d.length;p++)n(d[p],l,!!s)}else n(c,l,!!s);var h=void 0,m=void 0;if(s)m=-1,h=s,s=null;else{if(!(l<e.childCount))break;m=l,h=e.child(l++)}for(var v=0;v<u.length;v++)u[v].to<=i&&u.splice(v--,1);while(a<o.length&&o[a].from<=i&&o[a].to>i)u.push(o[a++]);var g=i+h.nodeSize;if(h.isText){var y=g;a<o.length&&o[a].from<y&&(y=o[a].from);for(var b=0;b<u.length;b++)u[b].to<y&&(y=u[b].to);y<g&&(s=h.cut(y-i),h=h.cut(0,y-i),g=y,m=-1)}else while(a<o.length&&o[a].to<g)a++;var w=h.isInline&&!h.isLeaf?u.filter(function(e){return!e.inline}):u.slice();r(h,w,t.forChild(i,h),m),i=g}else for(var A=0;A<e.childCount;A++){var k=e.child(A);r(k,o,t.forChild(i,k),A),i+=k.nodeSize}}function rt(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function ot(e,t,n,r){for(var o=0,i=0;o<e.childCount&&i<=r;){var a=e.child(o++),u=i;if(i+=a.nodeSize,a.isText){var s=a.text;while(o<e.childCount){var l=e.child(o++);if(i+=l.nodeSize,!l.isText)break;s+=l.text}if(i>=n){if(i>=r&&s.slice(r-t.length-u,r-u)==t)return r-t.length;var c=u<r?s.lastIndexOf(t,r-u-1):-1;if(c>=0&&c+t.length+u>=n)return u+c;if(n==r&&s.length>=r+t.length-u&&s.slice(r-u,r-u+t.length)==t)return r}}}return-1}function it(e,t,n,r,o){for(var i=[],a=0,u=0;a<e.length;a++){var s=e[a],l=u,c=u+=s.size;l>=n||c<=t?i.push(s):(l<t&&i.push(s.slice(0,t-l,r)),o&&(i.push(o),o=void 0),c>n&&i.push(s.slice(n-l,s.size,r)))}return i}function at(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.domSelectionRange(),o=e.state.doc;if(!n.focusNode)return null;var i=e.docView.nearestDesc(n.focusNode),a=i&&0==i.size,u=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(u<0)return null;var s,l,c=o.resolve(u);if(P(n)){s=u;while(i&&!i.node)i=i.parent;var d=i.node;if(i&&d.isAtom&&f.nh.isSelectable(d)&&i.parent&&(!d.isInline||!S(n.focusNode,n.focusOffset,i.dom))){var p=i.posBefore;l=new f.nh(u==p?c:o.resolve(p))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){for(var h=u,m=u,v=0;v<n.rangeCount;v++){var g=n.getRangeAt(v);h=Math.min(h,e.docView.posFromDOM(g.startContainer,g.startOffset,1)),m=Math.max(m,e.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(h<0)return null;var y=m==e.state.selection.anchor?[m,h]:[h,m],b=(0,r.A)(y,2);s=b[0],u=b[1],c=o.resolve(u)}else s=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(s<0)return null}var w=o.resolve(s);if(!l){var A="pointer"==t||e.state.selection.head<c.pos&&!a?1:-1;l=gt(e,w,c,A)}return l}function ut(e){return e.editable?e.hasFocus():bt(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function st(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if(mt(e,n),ut(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&W){var r=e.domSelectionRange(),o=e.domObserver.currentSelection;
21if(r.anchorNode&&o.anchorNode&&k(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)ht(e);else{var i,a,u=n.anchor,s=n.head;!lt||n instanceof f.U3||(n.$from.parent.inlineContent||(i=ct(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=ct(e,n.to))),e.docView.setSelection(u,s,e,t),lt&&(i&&ft(i),a&&ft(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&pt(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var lt=U||W&&G<63;function ct(e,t){var n=e.docView.domFromPos(t,0),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,a=o?r.childNodes[o-1]:null;if(U&&i&&"false"==i.contentEditable)return dt(i);if((!i||"false"==i.contentEditable)&&(!a||"false"==a.contentEditable)){if(i)return dt(i);if(a)return dt(a)}}function dt(e){return e.contentEditable="true",U&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function ft(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function pt(e){var t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);var n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(function(){ut(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}function ht(e){var t=e.domSelection();if(t){var n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,g(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&j&&H<=11&&(n.disabled=!0,n.disabled=!1)}}function mt(e,t){if(t instanceof f.nh){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(vt(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else vt(e)}function vt(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function gt(e,t,n,r){return e.someProp("createSelectionBetween",function(r){return r(e,t,n)})||f.U3.between(t,n,r)}function yt(e){return!(e.editable&&!e.hasFocus())&&bt(e)}function bt(e){var t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function wt(e){var t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return k(t.node,t.offset,n.anchorNode,n.anchorOffset)}function At(e,t){var n=e.selection,r=n.$anchor,o=n.$head,i=t>0?r.max(o):r.min(o),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&f.LN.findFrom(a,t)}function kt(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ct(e,t,n){var r=e.state.selection;if(!(r instanceof f.U3)){if(r instanceof f.nh&&r.node.isInline)return kt(e,new f.U3(t>0?r.$to:r.$from));var o=At(e.state,t);return!!o&&kt(e,o)}if(n.indexOf("s")>-1){var i=r.$head,a=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;var u=e.state.doc.resolve(i.pos+a.nodeSize*(t<0?-1:1));return kt(e,new f.U3(r.$anchor,u))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){var s=At(e.state,t);return!!(s&&s instanceof f.nh)&&kt(e,s)}if(!($&&n.indexOf("m")>-1)){var l,c=r.$head,d=c.textOffset?null:t<0?c.nodeBefore:c.nodeAfter;if(!d||d.isText)return!1;var p=t<0?c.pos-d.nodeSize:c.pos;
21return!!(d.isAtom||(l=e.docView.descAt(p))&&!l.contentDOM)&&(f.nh.isSelectable(d)?kt(e,new f.nh(t<0?e.state.doc.resolve(c.pos-d.nodeSize):c)):!!X&&kt(e,new f.U3(e.state.doc.resolve(t<0?p:p+d.nodeSize))))}}function Dt(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function xt(e,t){var n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function Et(e,t){return t<0?Mt(e):St(e)}function Mt(e){var t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(V&&1==n.nodeType&&r<Dt(n)&&xt(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var u=n.childNodes[r-1];if(xt(u,-1))o=n,i=--r;else{if(3!=u.nodeType)break;n=u,r=n.nodeValue.length}}else{if(Tt(n))break;var s=n.previousSibling;while(s&&xt(s,-1))o=n.parentNode,i=g(s),s=s.previousSibling;if(s)n=s,r=Dt(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}a?It(e,n,r):o&&It(e,o,i)}}function St(e){var t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,a=Dt(n);;)if(r<a){if(1!=n.nodeType)break;var u=n.childNodes[r];if(!xt(u,1))break;o=n,i=++r}else{if(Tt(n))break;var s=n.nextSibling;while(s&&xt(s,1))o=s.parentNode,i=g(s)+1,s=s.nextSibling;if(s)n=s,r=0,a=Dt(n);else{if(n=n.parentNode,n==e.dom)break;r=a=0}}o&&It(e,o,i)}}function Tt(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Pt(e,t){while(e&&t==e.childNodes.length&&!T(e))t=g(e)+1,e=e.parentNode;while(e&&t<e.childNodes.length){var n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}function _t(e,t){while(e&&!t&&!T(e))t=g(e),e=e.parentNode;while(e&&t){var n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=e.childNodes.length}}function It(e,t,n){var r,o;3!=t.nodeType&&((o=Pt(t,n))?(t=o,n=0):(r=_t(t,n))&&(t=r,n=r.nodeValue.length));var i=e.domSelection();if(i){if(P(i)){var a=document.createRange();a.setEnd(t,n),a.setStart(t,n),i.removeAllRanges(),i.addRange(a)}else i.extend&&i.extend(t,n);e.domObserver.setCurSelection();var u=e.state;setTimeout(function(){e.state==u&&st(e)},50)}}function Nt(e,t){var n=e.state.doc.resolve(t);if(!W&&!K&&n.parent.inlineContent){var r=e.coordsAtPos(t);if(t>n.start()){var o=e.coordsAtPos(t-1),i=(o.top+o.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(o.left-r.left)>1)return o.left<r.left?"ltr":"rtl"}if(t<n.end()){var a=e.coordsAtPos(t+1),u=(a.top+a.bottom)/2;if(u>r.top&&u<r.bottom&&Math.abs(a.left-r.left)>1)return a.left>r.left?"ltr":"rtl"}}var s=getComputedStyle(e.dom).direction;return"rtl"==s?"rtl":"ltr"}function Ot(e,t,n){var r=e.state.selection;if(r instanceof f.U3&&!r.empty||n.indexOf("s")>-1)return!1;if($&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var a=At(e.state,t);if(a&&a instanceof f.nh)return kt(e,a)}if(!o.parent.inlineContent){var u=t<0?o:i,s=r instanceof f.i5?f.LN.near(u,t):f.LN.findFrom(u,t);return!!s&&kt(e,s)}return!1}function Ft(e,t){if(!(e.state.selection instanceof f.U3))return!0;var n=e.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var u=e.state.tr;return t<0?u.delete(r.pos-a.nodeSize,r.pos):u.delete(r.pos,r.pos+a.nodeSize),e.dispatch(u),!0}return!1}function Lt(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Bt(e){if(!U||e.state.selection.$head.parentOffset>0)return!1;var t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;Lt(e,o,"true"),setTimeout(function(){return Lt(e,o,"false")},20)}return!1}function Rt(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function zt(e,t){var n=t.keyCode,r=Rt(t);if(8==n||$&&72==n&&"c"==r)return Ft(e,-1)||Et(e,-1);if(46==n&&!t.shiftKey||$&&68==n&&"c"==r)return Ft(e,1)||Et(e,1);if(13==n||27==n)return!0;if(37==n||$&&66==n&&"c"==r){var o=37==n?"ltr"==Nt(e,e.state.selection.from)?-1:1:-1;return Ct(e,o,r)||Et(e,o)}if(39==n||$&&70==n&&"c"==r){var i=39==n?"ltr"==Nt(e,e.state.selection.from)?1:-1:1;return Ct(e,i,r)||Et(e,i)}return 38==n||$&&80==n&&"c"==r?Ot(e,-1,r)||Et(e,-1):40==n||$&&78==n&&"c"==r?Bt(e)||Ot(e,1,r)||Et(e,1):r==($?"m":"c")&&(66==n||73==n||89==n||90==n)}function jt(e,t){e.someProp("transformCopied",function(n){t=n(t,e)});var n=[],r=t,o=r.content,i=r.openStart,a=r.openEnd;while(i>1&&a>1&&1==o.childCount&&1==o.firstChild.childCount){i--,a--;var u=o.firstChild;
21n.push(u.type.name,u.attrs!=u.type.defaultAttrs?u.attrs:null),o=u.content}var s=e.someProp("clipboardSerializer")||p.ZF.fromSchema(e.state.schema),l=Xt(),c=l.createElement("div");c.appendChild(s.serializeFragment(o,{document:l}));var d,f=c.firstChild,h=0;while(f&&1==f.nodeType&&(d=Kt[f.nodeName.toLowerCase()])){for(var m=d.length-1;m>=0;m--){var v=l.createElement(d[m]);while(c.firstChild)v.appendChild(c.firstChild);c.appendChild(v),h++}f=c.firstChild}f&&1==f.nodeType&&f.setAttribute("data-pm-slice","".concat(i," ").concat(a).concat(h?" -".concat(h):""," ").concat(JSON.stringify(n)));var g=e.someProp("clipboardTextSerializer",function(n){return n(t,e)})||t.content.textBetween(0,t.content.size,"\n\n");return{dom:c,text:g,slice:t}}function Ht(e,t,n,r,o){var i,a,u=o.parent.type.spec.code;if(!n&&!t)return null;var s=!!t&&(r||u||!n);if(s){if(e.someProp("transformPastedText",function(n){t=n(t,u||r,e)}),u)return a=new p.Ji(p.FK.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",function(t){a=t(a,e,!0)}),a;var l=e.someProp("clipboardTextParser",function(n){return n(t,o,r,e)});if(l)a=l;else{var c=o.marks(),d=e.state.schema,f=p.ZF.fromSchema(d);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(function(e){var t=i.appendChild(document.createElement("p"));e&&t.appendChild(f.serializeNode(d.text(e,c)))})}}else e.someProp("transformPastedHTML",function(t){n=t(n,e)}),i=en(n),X&&tn(i);var h=i&&i.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(m&&m[3])for(var v=+m[3];v>0;v--){var g=i.firstChild;while(g&&1!=g.nodeType)g=g.nextSibling;if(!g)break;i=g}if(!a){var y=e.someProp("clipboardParser")||e.someProp("domParser")||p.S4.fromSchema(e.state.schema);a=y.parseSlice(i,{preserveWhitespace:!(!s&&!m),context:o,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Vt.test(e.parentNode.nodeName)?null:{ignore:!0}}})}if(m)a=nn($t(a,+m[1],+m[2]),m[4]);else if(a=p.Ji.maxOpen(Yt(a.content,o),!0),a.openStart||a.openEnd){for(var b=0,w=0,A=a.content.firstChild;b<a.openStart&&!A.type.spec.isolating;b++,A=A.firstChild);for(var k=a.content.lastChild;w<a.openEnd&&!k.type.spec.isolating;w++,k=k.lastChild);a=$t(a,b,w)}return e.someProp("transformPasted",function(t){a=t(a,e,s)}),a}var Vt=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Yt(e,t){if(e.childCount<2)return e;for(var n,r=function(){var n,r=t.node(o),i=r.contentMatchAt(t.index(o)),a=[];if(e.forEach(function(e){if(a){var t,r=i.findWrapping(e.type);if(!r)return a=null;if(t=a.length&&n.length&&Gt(r,n,e,a[a.length-1],0))a[a.length-1]=t;else{a.length&&(a[a.length-1]=Ut(a[a.length-1],n.length));var o=Wt(e,r);a.push(o),i=i.matchType(o.type),n=r}}}),a)return{v:p.FK.from(a)}},o=t.depth;o>=0;o--)if(n=r(),n)return n.v;return e}function Wt(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.length-1;r>=n;r--)e=t[r].create(null,p.FK.from(e));return e}function Gt(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){var i=Gt(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));var a=r.contentMatchAt(r.childCount);if(a.matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(p.FK.from(Wt(n,e,o+1))))}}function Ut(e,t){if(0==t)return e;var n=e.content.replaceChild(e.childCount-1,Ut(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(p.FK.empty,!0);return e.copy(n.append(r))}function qt(e,t,n,r,o,i){var a=t<0?e.firstChild:e.lastChild,u=a.content;return e.childCount>1&&(i=0),o<r-1&&(u=qt(u,t,n,r,o+1,i)),o>=n&&(u=t<0?a.contentMatchAt(0).fillBefore(u,i<=o).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(p.FK.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(u))}function $t(e,t,n){return t<e.openStart&&(e=new p.Ji(qt(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new p.Ji(qt(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Kt={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Jt=null;function Xt(){return Jt||(Jt=document.implementation.createHTMLDocument("title"))}var Zt=null;function Qt(e){var t=window.trustedTypes;return t?(Zt||(Zt=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:function(e){return e}})),Zt.createHTML(e)):e}function en(e){var t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=Xt().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);if((n=o&&Kt[o[1].toLowerCase()])&&(e=n.map(function(e){return"<"+e+">"}).join("")+e+n.map(function(e){return"</"+e+">"}).reverse().join("")),r.innerHTML=Qt(e),n)for(var i=0;i<n.length;i++)r=r.querySelector(n[i])||r;return r}function tn(e){for(var t=e.querySelectorAll(W?"span:not([class]):not
21([style])":"span.Apple-converted-space"),n=0;n<t.length;n++){var r=t[n];1==r.childNodes.length&&"Â "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function nn(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(l){return e}for(var o=e.content,i=e.openStart,a=e.openEnd,u=n.length-2;u>=0;u-=2){var s=r.nodes[n[u]];if(!s||s.hasRequiredAttrs())break;o=p.FK.from(s.create(n[u+1],o)),i++,a++}return new p.Ji(o,i,a)}var rn={},on={},an={touchstart:!0,touchmove:!0},un=(0,d.A)(function e(){(0,c.A)(this,e),this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null});function sn(e){var t=function(){var t=rn[n];e.dom.addEventListener(n,e.input.eventHandlers[n]=function(n){!pn(e,n)||fn(e,n)||!e.editable&&n.type in on||t(e,n)},an[n]?{passive:!0}:void 0)};for(var n in rn)t();U&&e.dom.addEventListener("input",function(){return null}),dn(e)}function ln(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function cn(e){for(var t in e.domObserver.stop(),e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function dn(e){e.someProp("handleDOMEvents",function(t){for(var n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=function(t){return fn(e,t)})})}function fn(e,t){return e.someProp("handleDOMEvents",function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function pn(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function hn(e,t){fn(e,t)||!rn[t.type]||!e.editable&&t.type in on||rn[t.type](e,t)}function mn(e){return{left:e.clientX,top:e.clientY}}function vn(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function gn(e,t,n,r,o){if(-1==r)return!1;for(var i,a=e.state.doc.resolve(r),u=function(r){if(e.someProp(t,function(t){return r>a.depth?t(e,n,a.nodeAfter,a.before(r),o,!0):t(e,n,a.node(r),a.before(r),o,!1)}))return{v:!0}},s=a.depth+1;s>0;s--)if(i=u(s),i)return i.v;return!1}function yn(e,t,n){if(e.focused||e.focus(),!e.state.selection.eq(t)){var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}}function bn(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&f.nh.isSelectable(r))&&(yn(e,new f.nh(n),"pointer"),!0)}function wn(e,t){if(-1==t)return!1;var n,r,o=e.state.selection;o instanceof f.nh&&(n=o.node);for(var i=e.state.doc.resolve(t),a=i.depth+1;a>0;a--){var u=a>i.depth?i.nodeAfter:i.node(a);if(f.nh.isSelectable(u)){r=n&&o.$from.depth>0&&a>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(a);break}}return null!=r&&(yn(e,f.nh.create(e.state.doc,r),"pointer"),!0)}function An(e,t,n,r,o){return gn(e,"handleClickOn",t,n,r)||e.someProp("handleClick",function(n){return n(e,t,r)})||(o?wn(e,n):bn(e,n))}function kn(e,t,n,r){return gn(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",function(n){return n(e,t,r)})}function Cn(e,t,n,r){return gn(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",function(n){return n(e,t,r)})||Dn(e,n,r)}function Dn(e,t,n){if(0!=n.button)return!1;var r=e.state.doc;if(-1==t)return!!r.inlineContent&&(yn(e,f.U3.create(r,0,r.content.size),"pointer"),!0);for(var o=r.resolve(t),i=o.depth+1;i>0;i--){var a=i>o.depth?o.nodeAfter:o.node(i),u=o.before(i);if(a.inlineContent)yn(e,f.U3.create(r,u+1,u+1+a.content.size),"pointer");else{if(!f.nh.isSelectable(a))continue;yn(e,f.nh.create(r,u),"pointer")}return!0}}function xn(e){return Fn(e)}on.keydown=function(e,t){var n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Sn(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!J||!W||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!q||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",function(t){return t(e,n)})||zt(e,n)?n.preventDefault():ln(e,"key");else{var r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(function(){e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",function(t){return t(e,_(13,"Enter"))}),e.input.lastIOSEnter=0)},200)}},on.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},on.keypress=function(e,t){var n=t;if(!(Sn(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||$&&n.metaKey))if(e.someProp("handleKeyPress",function(t){return t(e,n)}))n.preventDefault();else{var r=e.state.selection;if(!(r instanceof f.U3)||!r.$from.sameParent(r.$to)){var o=String.fromCharCode(n.charCode),i=function(){return e.state.tr.insertText(o).scrollIntoView()};/[\r\n]/.test(o)||e.someProp("handleTextInput",function(t){return t(e,r.$from.pos,r.$to.pos,o,i)})||e.dispatch(i()),n.preventDefault()}}};var En=$?"metaKey":"ctrlKey";rn.mousedown=function(e,t){var n=t;e.input.shiftKey=n.shiftKey;var r=xn(e),o=Date.now(),i="singleClick";
21o-e.input.lastClick.time<500&&vn(n,e.input.lastClick)&&!n[En]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button};var a=e.posAtCoords(mn(n));a&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Mn(e,a,n,!!r)):("doubleClick"==i?kn:Cn)(e,a.pos,a.inside,n)?n.preventDefault():ln(e,"pointer"))};var Mn=function(){function e(t,n,r,o){var i,a,u=this;if((0,c.A)(this,e),this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[En],this.allowDefault=r.shiftKey,n.inside>-1)i=t.state.doc.nodeAt(n.inside),a=n.inside;else{var s=t.state.doc.resolve(n.pos);i=s.parent,a=s.depth?s.before():0}var l=o?null:r.target,d=l?t.docView.nearestDesc(l,!0):null;this.target=d&&1==d.nodeDOM.nodeType?d.nodeDOM:null;var p=t.state.selection;0==r.button&&(i.type.spec.draggable&&!1!==i.type.spec.selectable||p instanceof f.nh&&p.from<=a&&p.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!V||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(function(){u.view.input.mouseDown==u&&u.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),ln(t,"pointer")}return(0,d.A)(e,[{key:"done",value:function(){var e=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(function(){return st(e.view)}),this.view.input.mouseDown=null}},{key:"up",value:function(e){if(this.done(),this.view.dom.contains(e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(mn(e))),this.updateAllowDefault(e),this.allowDefault||!t?ln(this.view,"pointer"):An(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||U&&this.mightDrag&&!this.mightDrag.node.isAtom||W&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(yn(this.view,f.LN.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):ln(this.view,"pointer")}}},{key:"move",value:function(e){this.updateAllowDefault(e),ln(this.view,"pointer"),0==e.buttons&&this.done()}},{key:"updateAllowDefault",value:function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}])}();function Sn(e,t){return!!e.composing||!!(U&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}rn.touchstart=function(e){e.input.lastTouch=Date.now(),xn(e),ln(e,"pointer")},rn.touchmove=function(e){e.input.lastTouch=Date.now(),ln(e,"pointer")},rn.contextmenu=function(e){return xn(e)};var Tn=J?5e3:-1;function Pn(e){var t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n||1!=n.nodeType||r>=n.childNodes.length)return!1;var o=n.childNodes[r];return 1==o.nodeType&&"false"==o.contentEditable}function _n(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(function(){return Fn(e)},t))}function In(e){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=On());while(e.input.compositionNodes.length>0)e.input.compositionNodes.pop().markParentsDirty()}function Nn(e){var t=e.domSelectionRange();if(!t.focusNode)return null;var n=E(t.focusNode,t.focusOffset),r=M(t.focusNode,t.focusOffset);
21if(n&&r&&n!=r){var o=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(e.input.compositionNode==r){var a=n.pmViewDesc;if(a&&a.isText(n.nodeValue))return r}}return n||r}function On(){var e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Fn(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(J&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),In(e),t||e.docView&&e.docView.dirty){var n=at(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}function Ln(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}}on.compositionstart=on.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$to;if(t.selection instanceof f.U3&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(function(e){return!1===e.type.spec.inclusive})||W&&K&&Pn(e)))e.markCursor=e.state.storedMarks||n.marks(),Fn(e,!0),e.markCursor=null;else if(Fn(e,!t.selection.empty),V&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.domSelectionRange(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){var u=e.domSelection();u&&u.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.input.composing=!0}_n(e,Tn)},on.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(function(){return e.domObserver.flush()}),e.input.compositionID++,_n(e,20))};var Bn=j&&H<15||q&&Z<604;function Rn(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}function zn(e,t){if(e.dom.parentNode){var n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();var o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?jn(e,r.value,null,o,t):jn(e,r.textContent,r.innerHTML,o,t)},50)}}function jn(e,t,n,r,o){var i=Ht(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",function(t){return t(e,o,i||p.Ji.empty)}))return!0;if(!i)return!1;var a=Rn(i),u=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(i);return e.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Hn(e){var t=e.getData("text/plain")||e.getData("Text");if(t)return t;var n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}rn.copy=on.cut=function(e,t){var n=t,r=e.state.selection,o="cut"==n.type;if(!r.empty){var i=Bn?null:n.clipboardData,a=r.content(),u=jt(e,a),s=u.dom,l=u.text;i?(n.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",l)):Ln(e,s),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},on.paste=function(e,t){var n=t;if(!e.composing||J){var r=Bn?null:n.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&jn(e,Hn(r),r.getData("text/html"),o,n)?n.preventDefault():zn(e,n)}};var Vn=(0,d.A)(function e(t,n,r){(0,c.A)(this,e),this.slice=t,this.move=n,this.node=r}),Yn=$?"altKey":"ctrlKey";function Wn(e,t){var n;return e.someProp("dragCopies",function(e){n=n||e(t)}),null!=n?!n:!t[Yn]}function Gn(e,t,n){if(t.dataTransfer){var r=e.posAtCoords(mn(t));if(r){var o=e.state.doc.resolve(r.pos),i=n&&n.slice;i?e.someProp("transformPasted",function(t){i=t(i,e,!1)}):i=Ht(e,Hn(t.dataTransfer),Bn?null:t.dataTransfer.getData("text/html"),!1,o);var a=!(!n||!Wn(e,t));if(e.someProp("handleDrop",function(n){return n(e,t,i||p.Ji.empty,a)}))t.preventDefault();else if(i){t.preventDefault();var u=i?(0,h.Um)(e.state.doc,o.pos,i):o.pos;null==u&&(u=o.pos);var s=e.state.tr;if(a){var l=n.node;l?l.replace(s):s.deleteSelection()}var c=s.mapping.map(u),d=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,m=s.doc;if(d?s.replaceRangeWith(c,c,i.content.firstChild):s.replaceRange(c,c,i),!s.doc.eq(m)){var v=s.doc.resolve(c);if(d&&f.nh.isSelectable(i.content.firstChild)&&v.nodeAfter&&v.nodeAfter.sameMarkup(i.content.firstChild))s.setSelection(new f.nh(v));else{var g=s.mapping.map(u);
21s.mapping.maps[s.mapping.maps.length-1].forEach(function(e,t,n,r){return g=r}),s.setSelection(gt(e,v,s.doc.resolve(g)))}e.focus(),e.dispatch(s.setMeta("uiEvent","drop"))}}}}}for(var Un in rn.dragstart=function(e,t){var n=t,r=e.input.mouseDown;if(r&&r.done(),n.dataTransfer){var o,i=e.state.selection,a=i.empty?null:e.posAtCoords(mn(n));if(a&&a.pos>=i.from&&a.pos<=(i instanceof f.nh?i.to-1:i.to));else if(r&&r.mightDrag)o=f.nh.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){var u=e.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=e.docView&&(o=f.nh.create(e.state.doc,u.posBefore))}var s=(o||e.state.selection).content(),l=jt(e,s),c=l.dom,d=l.text,p=l.slice;(!n.dataTransfer.files.length||!W||G>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Bn?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",Bn||n.dataTransfer.setData("text/plain",d),e.dragging=new Vn(p,Wn(e,n),o)}},rn.dragend=function(e){var t=e.dragging;window.setTimeout(function(){e.dragging==t&&(e.dragging=null)},50)},on.dragover=on.dragenter=function(e,t){return t.preventDefault()},on.drop=function(e,t){try{Gn(e,t,e.dragging)}finally{e.dragging=null}},rn.focus=function(e){e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&st(e)},20))},rn.blur=function(e,t){var n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},rn.beforeinput=function(e,t){var n=t;if(W&&J&&"deleteContentBackward"==n.inputType){e.domObserver.flushSoon();var r=e.input.domChangeCount;setTimeout(function(){if(e.input.domChangeCount==r&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",function(t){return t(e,_(8,"Backspace"))}))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}},50)}},on)rn[Un]=on[Un];function qn(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var $n=function(){function e(t,n){(0,c.A)(this,e),this.toDOM=t,this.spec=n||Qn,this.side=this.spec.side||0}return(0,d.A)(e,[{key:"map",value:function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos,a=o.deleted;return a?null:new Xn(i-n,i-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&qn(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}])}(),Kn=function(){function e(t,n){(0,c.A)(this,e),this.attrs=t,this.spec=n||Qn}return(0,d.A)(e,[{key:"map",value:function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Xn(o,i,this)}},{key:"valid",value:function(e,t){return t.from<t.to}},{key:"eq",value:function(t){return this==t||t instanceof e&&qn(this.attrs,t.attrs)&&qn(this.spec,t.spec)}},{key:"destroy",value:function(){}}],[{key:"is",value:function(t){return t.type instanceof e}}])}(),Jn=function(){function e(t,n){(0,c.A)(this,e),this.attrs=t,this.spec=n||Qn}return(0,d.A)(e,[{key:"map",value:function(e,t,n,r){var o=e.mapResult(t.from+r,1);if(o.deleted)return null;var i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new Xn(o.pos-n,i.pos-n,this)}},{key:"valid",value:function(e,t){var n,r=e.content.findIndex(t.from),o=r.index,i=r.offset;return i==t.from&&!(n=e.child(o)).isText&&i+n.nodeSize==t.to}},{key:"eq",value:function(t){return this==t||t instanceof e&&qn(this.attrs,t.attrs)&&qn(this.spec,t.spec)}},{key:"destroy",value:function(){}}])}(),Xn=function(){function e(t,n,r){(0,c.A)(this,e),this.from=t,this.to=n,this.type=r}return(0,d.A)(e,[{key:"copy",value:function(t,n){return new e(t,n,this.type)}},{key:"eq",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}},{key:"map",value:function(e,t,n){return this.type.map(e,this,t,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof Kn}},{key:"widget",get:function(){return this.type instanceof $n}}],[{key:"widget",value:function(t,n,r){return new e(t,t,new $n(n,r))}},{key:"inline",value:function(t,n,r,o){return new e(t,n,new Kn(r,o))}},{key:"node",value:function(t,n,r,o){return new e(t,n,new Jn(r,o))}}])}(),Zn=[],Qn={},er=function(){function e(t,n){(0,c.A)(this,e),this.local=t.length?t:Zn,this.children=n.length?n:Zn}return(0,d.A)(e,[{key:"find",value:function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}},{key:"findInner",value:function(e,t,n,r,o){for(var i=0;i<this.local.length;i++){var a=this.local[i];a.from<=t&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var u=0;u<this.children.length;u+=3)if(this.children[u]<t&&this.children[u+1]>e){var s=this.children[u]+1;this.children[u+2].findInner(e-s,t-s,n,r+s,o)}}},{key:"map",value:function(e,t,n){return this==tr||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Qn)}},{key:"mapInner",value:function(t,n,r,o,i){for(var a,u=0;u<this.local.length;u++){var s=this.local[u].map(t,r,o);s&&s.type.valid(n,s)?(a||(a=[])).push(s):i.onRemove&&i.onRemove(this.local[u].spec)}return this.children.length?rr(this.children,a||[],t,n,r,o,i):a?new e(a.sort(lr),Zn):tr}},{key:"add",value:function(t,n){return n.length?this==tr?e.create(t,n):this.addInner(t,n,0):this}},{key:"addInner",value:function(t,n,r){var o,i=this,a=0;t.forEach(function(e,t){var u,s=t+r;if(u=ar(n,e,s)){o||(o=i.children.slice());while(a<o.length&&o[a]<t)a+=3;o[a]==t?o[a+2]=o[a+2].addInner(e,u,s+1):o.splice(a,0,t,t+e.nodeSize,sr(u,e,s+1,Qn)),a+=3}});for(var u=or(a?ur(n):n,-r),s=0;s<u.length;s++)u[s].type.valid(t,u[s])||u.splice(s--,1);return new e(u.length?this.local.concat(u).sort(lr):this.local,o||this.children)}},{key:"remove",value:function(e){return 0==e.length||this==tr?this:this.removeInner(e,0)}},{key:"removeInner",value:function(t,n){for(var r=this.children,o=this.local,i=0;i<r.length;i+=3){for(var a,u=void 0,s=r[i]+n,l=r[i+1]+n,c=0;c<t.length;c++)(a=t[c])&&a.from>s&&a.to<l&&(t[c]=null,(u||(u=[])).push(a));if(u){r==this.children&&(r=this.children.slice());var d=r[i+2].removeInner(u,s+1);d!=tr?r[i+2]=d:(r.splice(i,3),i-=3)}}if(o.length)for(var f,p=0;p<t.length;p++)if(f=t[p])for(var h=0;h<o.length;h++)o[h].eq(f,n)&&(o==this.local&&(o=this.local.slice()),o.splice(h--,1));return r==this.children&&o==this.local?this:o.length||r.length?new e(o,r):tr}},{key:"forChild",value:function(t,n){if(this==tr)return this;if(n.isLeaf)return e.empty;for(var r,o,i=0;i<this.children.length;i+=3)if(this.children[i]>=t){this.children[i]==t&&(r=this.children[i+2]);break}for(var a=t+1,u=a+n.content.size,s=0;s<this.local.length;s++){var l=this.local[s];if(l.from<u&&l.to>a&&l.type instanceof Kn){var c=Math.max(a,l.from)-a,d=Math.min(u,l.to)-a;c<d&&(o||(o=[])).push(l.copy(c,d))}}if(o){var f=new e(o.sort(lr),Zn);return r?new nr([f,r]):f}return r||tr}},{key:"eq",value:function(t){if(this==t)return!0;
21if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(var r=0;r<this.children.length;r+=3)if(this.children[r]!=t.children[r]||this.children[r+1]!=t.children[r+1]||!this.children[r+2].eq(t.children[r+2]))return!1;return!0}},{key:"locals",value:function(e){return cr(this.localsInner(e))}},{key:"localsInner",value:function(e){if(this==tr)return Zn;if(e.inlineContent||!this.local.some(Kn.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof Kn||t.push(this.local[n]);return t}},{key:"forEachSet",value:function(e){e(this)}}],[{key:"create",value:function(e,t){return t.length?sr(t,e,0,Qn):tr}}])}();er.empty=new er([],[]),er.removeOverlap=cr;var tr=er.empty,nr=function(){function e(t){(0,c.A)(this,e),this.members=t}return(0,d.A)(e,[{key:"map",value:function(t,n){var r=this.members.map(function(e){return e.map(t,n,Qn)});return e.from(r)}},{key:"forChild",value:function(t,n){if(n.isLeaf)return er.empty;for(var r=[],o=0;o<this.members.length;o++){var i=this.members[o].forChild(t,n);i!=tr&&(i instanceof e?r=r.concat(i.members):r.push(i))}return e.from(r)}},{key:"eq",value:function(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(var n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}},{key:"locals",value:function(e){for(var t,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(var i=0;i<o.length;i++)t.push(o[i])}else t=o}return t?cr(n?t:t.sort(lr)):Zn}},{key:"forEachSet",value:function(e){for(var t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}],[{key:"from",value:function(t){switch(t.length){case 0:return tr;case 1:return t[0];default:return new e(t.every(function(e){return e instanceof er})?t:t.reduce(function(e,t){return e.concat(t instanceof er?t:t.members)},[]))}}}])}();function rr(e,t,n,r,o,i,a){for(var u=e.slice(),s=function(e){var t=0;n.maps[l].forEach(function(n,r,o,i){for(var a=i-o-(r-n),s=0;s<u.length;s+=3){var l=u[s+1];if(!(l<0||n>l+e-t)){var c=u[s]+e-t;r>=c?u[s+1]=n<=c?-2:-1:n>=e&&a&&(u[s]+=a,u[s+1]+=a)}}t+=a}),e=n.maps[l].map(e,-1),c=e},l=0,c=i;l<n.maps.length;l++)s(c);for(var d=!1,f=0;f<u.length;f+=3)if(u[f+1]<0){if(-2==u[f+1]){d=!0,u[f+1]=-1;continue}var p=n.map(e[f]+i),h=p-o;if(h<0||h>=r.content.size){d=!0;continue}var m=n.map(e[f+1]+i,-1),v=m-o,g=r.content.findIndex(h),y=g.index,b=g.offset,w=r.maybeChild(y);if(w&&b==h&&b+w.nodeSize==v){var A=u[f+2].mapInner(n,w,p+1,e[f]+i+1,a);A!=tr?(u[f]=h,u[f+1]=v,u[f+2]=A):(u[f+1]=-2,d=!0)}else d=!0}if(d){var k=ir(u,e,t,n,o,i,a),C=sr(k,r,0,a);t=C.local;for(var D=0;D<u.length;D+=3)u[D+1]<0&&(u.splice(D,3),D-=3);for(var x=0,E=0;x<C.children.length;x+=3){var M=C.children[x];while(E<u.length&&u[E]<M)E+=3;u.splice(E,0,C.children[x],C.children[x+1],C.children[x+2])}}return new er(t.sort(lr),u)}function or(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var o=e[r];n.push(new Xn(o.from+t,o.to+t,o.type))}return n}function ir(e,t,n,r,o,i,a){function u(e,t){for(var i=0;i<e.local.length;i++){var s=e.local[i].map(r,o,t);s?n.push(s):a.onRemove&&a.onRemove(e.local[i].spec)}for(var l=0;l<e.children.length;l+=3)u(e.children[l+2],e.children[l]+t+1)}for(var s=0;s<e.length;s+=3)-1==e[s+1]&&u(e[s+2],t[s]+i+1);return n}function ar(e,t,n){if(t.isLeaf)return null;for(var r,o=n+t.nodeSize,i=null,a=0;a<e.length;a++)(r=e[a])&&r.from>n&&r.to<o&&((i||(i=[])).push(r),e[a]=null);return i}function ur(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function sr(e,t,n,r){var o=[],i=!1;t.forEach(function(t,a){var u=ar(e,t,a+n);if(u){i=!0;var s=sr(u,t,n+a+1,r);s!=tr&&o.push(a,a+t.nodeSize,s)}});for(var a=or(i?ur(e):e,-n).sort(lr),u=0;u<a.length;u++)a[u].type.valid(t,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||o.length?new er(a,o):tr}function lr(e,t){return e.from-t.from||e.to-t.to}function cr(e){for(var t=e,n=0;n<t.length-1;n++){var r=t[n];if(r.from!=r.to)for(var o=n+1;o<t.length;o++){var i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),dr(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),dr(t,o+1,i.copy(r.to,i.to)))}}return t}function dr(e,t,n){while(t<e.length&&lr(n,e[t])>0)t++;e.splice(t,0,n)}function fr(e){var t=[];return e.someProp("decorations",function(n){var r=n(e.state);r&&r!=tr&&t.push(r)}),e.cursorWrapper&&t.push(er.create(e.state.doc,[e.cursorWrapper.deco])),nr.from(t)}var pr={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},hr=j&&H<=11,mr=function(){function e(){(0,c.A)(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return(0,d.A)(e,[{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}])}(),vr=function(){function e(t,n){var r=this;(0,c.A)(this,e),this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new mr,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(function(e){for(var n=0;n<e.length;n++)r.queue.push(e[n]);j&&H<=11&&e.some(function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length})?r.flushSoon():U&&t.composing&&e.some(function(e){return"childList"==e.type&&"TR"==e.target.nodeName})?(t.input.badSafariComposition=!0,r.flushSoon()):r.flush()}),hr&&(this.onCharData=function(e){r.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}return(0,d.A)(e,[{key:"flushSoon",value:function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){e.flushingSoon=-1,e.flush()},20))}},{key:"forceFlush",value:function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,pr)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(function(){return e.flush()},20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}},{key:"connectSelection",value:function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}},{key:"disconnectSelection",value:function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"suppressSelectionUpdates",value:function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout(function(){return e.suppressingSelectionUpdates=!1},50)}},{key:"onSelectionChange",value:function(){if(yt(this.view)){if(this.suppressingSelectionUpdates)return st(this.view);if(j&&H<=11&&!this.view.state.selection.empty){var e=this.view.domSelectionRange();if(e.focusNode&&k(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}},{key:"setCurSelection",value:function(){this.currentSelection.set(this.view.domSelectionRange())}},{key:"ignoreSelectionChange",value:function(e){if(!e.focusNode)return!0;for(var t,n=new Set,r=e.focusNode;r;r=y(r))n.add(r);for(var o=e.anchorNode;o;o=y(o))if(n.has(o)){t=o;break}var i=t&&this.view.docView.nearestDesc(t);return i&&i.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}},{key:"pendingRecords",value:function(){if(this.observer){var e,t=(0,o.A)(this.observer.takeRecords());try{for(t.s();!(e=t.n()).done;){var n=e.value;this.queue.push(n)}}catch(r){t.e(r)}finally{t.f()}}return this.queue}},{key:"flush",value:function(){var e=this.view;if(e.docView&&!(this.flushingSoon>-1)){var t=this.pendingRecords();t.length&&(this.queue=[]);var n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&yt(e)&&!this.ignoreSelectionChange(n),a=-1,u=-1,s=!1,l=[];
21if(e.editable)for(var c=0;c<t.length;c++){var d=this.registerMutation(t[c],l);d&&(a=a<0?d.from:Math.min(d.from,a),u=u<0?d.to:Math.max(d.to,u),d.typeOver&&(s=!0))}if(!l.some(function(e){return"BR"==e.nodeName})||8!=e.input.lastKeyCode&&46!=e.input.lastKeyCode){if(V&&l.length){var p=l.filter(function(e){return"BR"==e.nodeName});if(2==p.length){var h=(0,r.A)(p,2),m=h[0],v=h[1];m.parentNode&&m.parentNode.parentNode==v.parentNode?v.remove():m.remove()}else{var g,y=this.currentSelection.focusNode,b=(0,o.A)(p);try{for(b.s();!(g=b.n()).done;){var w=g.value,A=w.parentNode;!A||"LI"!=A.nodeName||y&&kr(e,y)==A||w.remove()}}catch(M){b.e(M)}finally{b.f()}}}}else{var k,C=(0,o.A)(l);try{for(C.s();!(k=C.n()).done;){var D=k.value;if("BR"==D.nodeName&&D.parentNode){var x=D.nextSibling;while(x&&1==x.nodeType){if("false"==x.contentEditable){D.parentNode.removeChild(D);break}x=x.firstChild}}}}catch(M){C.e(M)}finally{C.f()}}var E=null;a<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&P(n)&&(E=at(e))&&E.eq(f.LN.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,st(e),this.currentSelection.set(n),e.scrollToSelection()):(a>-1||i)&&(a>-1&&(e.docView.markDirty(a,u),br(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Cr(e,l)),this.handleDOMChange(a,u,s,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||st(e),this.currentSelection.set(n))}}},{key:"registerMutation",value:function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(var r=0;r<e.addedNodes.length;r++){var o=e.addedNodes[r];t.push(o),3==o.nodeType&&(this.lastChangedTextNode=o)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};var i=e.previousSibling,a=e.nextSibling;if(j&&H<=11&&e.addedNodes.length)for(var u=0;u<e.addedNodes.length;u++){var s=e.addedNodes[u],l=s.previousSibling,c=s.nextSibling;(!l||Array.prototype.indexOf.call(e.addedNodes,l)<0)&&(i=l),(!c||Array.prototype.indexOf.call(e.addedNodes,c)<0)&&(a=c)}var d=i&&i.parentNode==e.target?g(i)+1:0,f=n.localPosFromDOM(e.target,d,-1),p=a&&a.parentNode==e.target?g(a):e.target.childNodes.length,h=n.localPosFromDOM(e.target,p,1);return{from:f,to:h}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}])}(),gr=new WeakMap,yr=!1;function br(e){if(!gr.has(e)&&(gr.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=V,yr)return;console["warn"]("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),yr=!0}}function wr(e,t){var n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,a=e.domAtPos(e.state.selection.anchor);if(k(a.node,a.offset,o,i)){var u=[o,i,n,r];n=u[0],r=u[1],o=u[2],i=u[3]}return{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function Ar(e,t){if(t.getComposedRanges){var n=t.getComposedRanges(e.root)[0];if(n)return wr(e,n)}var r;function o(e){e.preventDefault(),e.stopImmediatePropagation(),r=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",o,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",o,!0),r?wr(e,r):null}function kr(e,t){for(var n=t.parentNode;n&&n!=e.dom;n=n.parentNode){var r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function Cr(e,t){var n,r,i=e.domSelectionRange(),a=i.focusNode,u=i.focusOffset,s=(0,o.A)(t);try{for(s.s();!(r=s.n()).done;){var l=r.value;if("TR"==(null===(n=l.parentNode)||void 0===n?void 0:n.nodeName)){var c=l.nextSibling;while(c&&"TD"!=c.nodeName&&"TH"!=c.nodeName)c=c.nextSibling;if(c){for(var d=c;;){var f=d.firstChild;if(!f||1!=f.nodeType||"false"==f.contentEditable||/^(BR|IMG)$/.test(f.nodeName))break;d=f}d.insertBefore(l,d.firstChild),a==l&&e.domSelection().collapse(l,u)}else l.parentNode.removeChild(l)}}}
21catch(p){s.e(p)}finally{s.f()}}function Dr(e,t,n){var r,o=e.docView.parseRange(t,n),i=o.node,a=o.fromOffset,u=o.toOffset,s=o.from,l=o.to,c=e.domSelectionRange(),d=c.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:c.anchorOffset}],P(c)||r.push({node:c.focusNode,offset:c.focusOffset})),W&&8===e.input.lastKeyCode)for(var f=u;f>a;f--){var h=i.childNodes[f-1],m=h.pmViewDesc;if("BR"==h.nodeName&&!m){u=f;break}if(!m||m.size)break}var v=e.state.doc,g=e.someProp("domParser")||p.S4.fromSchema(e.state.schema),y=v.resolve(s),b=null,w=g.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:a,to:u,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:r,ruleFromNode:xr,context:y});if(r&&null!=r[0].pos){var A=r[0].pos,k=r[1]&&r[1].pos;null==k&&(k=A),b={anchor:A+s,head:k+s}}return{doc:w,sel:b,from:s,to:l}}function xr(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(U&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(e.parentNode.lastChild==e||U&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}var Er=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Mr(e,t,n,r,o){var i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){var a=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,u=at(e,a);if(u&&!e.state.selection.eq(u)){if(W&&J&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",function(t){return t(e,_(13,"Enter"))}))return;var s=e.state.tr.setSelection(u);"pointer"==a?s.setMeta("pointer",!0):"key"==a&&s.scrollIntoView(),i&&s.setMeta("composition",i),e.dispatch(s)}}else{var l=e.state.doc.resolve(t),c=l.sharedDepth(n);t=l.before(c+1),n=e.state.doc.resolve(n).after(c+1);var d,p,h=e.state.selection,m=Dr(e,t,n),v=e.state.doc,g=v.slice(m.from,m.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(d=e.state.selection.to,p="end"):(d=e.state.selection.from,p="start"),e.input.lastKeyCode=null;var y=Ir(g.content,m.doc.content,m.from,d,p);if(y&&e.input.domChangeCount++,(q&&e.input.lastIOSEnter>Date.now()-225||J)&&o.some(function(e){return 1==e.nodeType&&!Er.test(e.nodeName)})&&(!y||y.endA>=y.endB)&&e.someProp("handleKeyDown",function(t){return t(e,_(13,"Enter"))}))e.input.lastIOSEnter=0;else{if(!y){if(!(r&&h instanceof f.U3&&!h.empty&&h.$head.sameParent(h.$anchor))||e.composing||m.sel&&m.sel.anchor!=m.sel.head){if(m.sel){var b=Sr(e,e.state.doc,m.sel);if(b&&!b.eq(e.state.selection)){var w=e.state.tr.setSelection(b);i&&w.setMeta("composition",i),e.dispatch(w)}}return}y={start:h.from,endA:h.to,endB:h.to}}e.state.selection.from<e.state.selection.to&&y.start==y.endB&&e.state.selection instanceof f.U3&&(y.start>e.state.selection.from&&y.start<=e.state.selection.from+2&&e.state.selection.from>=m.from?y.start=e.state.selection.from:y.endA<e.state.selection.to&&y.endA>=e.state.selection.to-2&&e.state.selection.to<=m.to&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),j&&H<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>m.from&&" Â "==m.doc.textBetween(y.start-m.from-1,y.start-m.from+1)&&(y.start--,y.endA--,y.endB--);var A=m.doc.resolveNoCache(y.start-m.from),k=m.doc.resolveNoCache(y.endB-m.from),C=v.resolve(y.start),D=A.sameParent(k)&&A.parent.inlineContent&&C.end()>=y.endA;if((q&&e.input.lastIOSEnter>Date.now()-225&&(!D||o.some(function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))||!D&&A.pos<m.doc.content.size&&(!A.sameParent(k)||!A.parent.inlineContent)&&A.pos<k.pos&&!/\S/.test(m.doc.textBetween(A.pos,k.pos,"","")))&&e.someProp("handleKeyDown",function(t){return t(e,_(13,"Enter"))}))e.input.lastIOSEnter=0;else if(e.state.selection.anchor>y.start&&Pr(v,y.start,y.endA,A,k)&&e.someProp("handleKeyDown",function(t){return t(e,_(8,"Backspace"))}))J&&W&&e.domObserver.suppressSelectionUpdates();
21else{W&&y.endB==y.start&&(e.input.lastChromeDelete=Date.now()),J&&!D&&A.start()!=k.start()&&0==k.parentOffset&&A.depth==k.depth&&m.sel&&m.sel.anchor==m.sel.head&&m.sel.head==y.endA&&(y.endB-=2,k=m.doc.resolveNoCache(y.endB-m.from),setTimeout(function(){e.someProp("handleKeyDown",function(t){return t(e,_(13,"Enter"))})},20));var x,E=y.start,M=y.endA,S=function(t){var n=t||e.state.tr.replace(E,M,m.doc.slice(y.start-m.from,y.endB-m.from));if(m.sel){var r=Sr(e,n.doc,m.sel);r&&!(W&&e.composing&&r.empty&&(y.start!=y.endB||e.input.lastChromeDelete<Date.now()-100)&&(r.head==E||r.head==n.mapping.map(M)-1)||j&&r.empty&&r.head==E)&&n.setSelection(r)}return i&&n.setMeta("composition",i),n.scrollIntoView()};if(D)if(A.pos==k.pos){j&&H<=11&&0==A.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(function(){return st(e)},20));var T=S(e.state.tr.delete(E,M)),P=v.resolve(y.start).marksAcross(v.resolve(y.endA));P&&T.ensureMarks(P),e.dispatch(T)}else if(y.endA==y.endB&&(x=Tr(A.parent.content.cut(A.parentOffset,k.parentOffset),C.parent.content.cut(C.parentOffset,y.endA-C.start())))){var I=S(e.state.tr);"add"==x.type?I.addMark(E,M,x.mark):I.removeMark(E,M,x.mark),e.dispatch(I)}else if(A.parent.child(A.index()).isText&&A.index()==k.index()-(k.textOffset?0:1)){var N=A.parent.textBetween(A.parentOffset,k.parentOffset),O=function(){return S(e.state.tr.insertText(N,E,M))};e.someProp("handleTextInput",function(t){return t(e,E,M,N,O)})||e.dispatch(O())}else e.dispatch(S());else e.dispatch(S())}}}}function Sr(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:gt(e,t.resolve(n.anchor),t.resolve(n.head))}function Tr(e,t){for(var n,r,o,i=e.firstChild.marks,a=t.firstChild.marks,u=i,s=a,l=0;l<a.length;l++)u=a[l].removeFromSet(u);for(var c=0;c<i.length;c++)s=i[c].removeFromSet(s);if(1==u.length&&0==s.length)r=u[0],n="add",o=function(e){return e.mark(r.addToSet(e.marks))};else{if(0!=u.length||1!=s.length)return null;r=s[0],n="remove",o=function(e){return e.mark(r.removeFromSet(e.marks))}}for(var d=[],f=0;f<t.childCount;f++)d.push(o(t.child(f)));if(p.FK.from(d).eq(e))return{mark:r,type:n}}function Pr(e,t,n,r,o){if(n-t<=o.pos-r.pos||_r(r,!0,!1)<o.pos)return!1;var i=e.resolve(t);if(!r.parent.isTextblock){var a=i.nodeAfter;return null!=a&&n==t+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var u=e.resolve(_r(i,!0,!0));return!(!u.parent.isTextblock||u.pos>n||_r(u,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(u.parent.content)}function _r(e,t,n){var r=e.depth,o=t?e.end():e.pos;while(r>0&&(t||e.indexAfter(r)==e.node(r).childCount))r--,o++,t=!1;if(n){var i=e.node(r).maybeChild(e.indexAfter(r));while(i&&!i.isLeaf)i=i.firstChild,o++}return o}function Ir(e,t,n,r,o){var i=e.findDiffStart(t,n);if(null==i)return null;var a=e.findDiffEnd(t,n+e.size,n+t.size),u=a.a,s=a.b;if("end"==o){var l=Math.max(0,i-Math.min(u,s));r-=u+l-i}if(u<i&&e.size<t.size){var c=r<=i&&r>=u?i-r:0;i-=c,i&&i<t.size&&Nr(t.textBetween(i-1,i+1))&&(i+=c?1:-1),s=i+(s-u),u=i}else if(s<i){var d=r<=i&&r>=s?i-r:0;i-=d,i&&i<e.size&&Nr(e.textBetween(i-1,i+1))&&(i+=d?1:-1),u=i+(u-s),s=i}return{start:i,endA:u,endB:s}}function Nr(e){if(2!=e.length)return!1;var t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var Or=function(){function e(t,n){var r=this;(0,c.A)(this,e),this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new un,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Hr),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Br(this),Lr(this),this.nodeViews=zr(this),this.docView=je(this.state.doc,Fr(this),fr(this),this.dom,this),this.domObserver=new vr(this,function(e,t,n,o){return Mr(r,e,t,n,o)}),this.domObserver.start(),sn(this),this.updatePluginViews()}
21return(0,d.A)(e,[{key:"composing",get:function(){return this.input.composing}},{key:"props",get:function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}},{key:"update",value:function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&dn(this);var t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Hr),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}},{key:"setProps",value:function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)}},{key:"updateState",value:function(e){this.updateStateInner(e,this._props)}},{key:"updateStateInner",value:function(e,t){var n,r=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&(In(this),i=!0),this.state=e;var a=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){var u=zr(this);jr(u,this.nodeViews)&&(this.nodeViews=u,o=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&dn(this),this.editable=Br(this),Lr(this);var s=fr(this),l=Fr(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(e.doc,l,s);!d&&e.selection.eq(r.selection)||(i=!0);var f="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&re(this);if(i){this.domObserver.stop();var p=d&&(j||W)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&Rr(r.selection,e.selection);if(d){var h=W?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Nn(this)),!o&&this.docView.update(e.doc,l,s,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=je(e.doc,l,s,this.dom,this)),!h||this.trackWrites&&this.dom.contains(this.trackWrites)||(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&wt(this))?st(this,p):(mt(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():f&&ie(f)}},{key:"scrollToSelection",value:function(){var e=this,t=this.domSelectionRange().focusNode;if(t&&this.dom.contains(1==t.nodeType?t:t.parentNode))if(this.someProp("handleScrollToSelection",function(t){return t(e)}));else if(this.state.selection instanceof f.nh){var n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&ne(this,n.getBoundingClientRect(),t)}else ne(this,this.coordsAtPos(this.state.selection.head,1),t);else;}},{key:"destroyPluginViews",value:function(){var e;while(e=this.pluginViews.pop())e.destroy&&e.destroy()}},{key:"updatePluginViews",value:function(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var t=0;t<this.pluginViews.length;t++){var n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var r=0;r<this.directPlugins.length;r++){var o=this.directPlugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(var i=0;i<this.state.plugins.length;i++){var a=this.state.plugins[i];a.spec.view&&this.pluginViews.push(a.spec.view(this))}}}},{key:"updateDraggedNode",value:function(e,t){var n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{var o=n.from+(this.state.doc.content.size-t.doc.content.size),i=o>0&&o<this.state.doc.content.size&&this.state.doc.nodeAt(o);i==n.node&&(r=o)}this.dragging=new Vn(e.slice,e.move,r<0?void 0:f.nh.create(this.state.doc,r))}},{key:"someProp",value:function(e,t){var n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(var o=0;o<this.directPlugins.length;o++){var i=this.directPlugins[o].props[e];if(null!=i&&(n=t?t(i):i))return n}var a=this.state.plugins;if(a)for(var u=0;u<a.length;u++){var s=a[u].props[e];if(null!=s&&(n=t?t(s):s))return n}}},{key:"hasFocus",value:function(){if(j){var e=this.root.activeElement;if(e==this.dom)return!0;
21if(!e||!this.dom.contains(e))return!1;while(e&&this.dom!=e&&this.dom.contains(e)){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}},{key:"focus",value:function(){this.domObserver.stop(),this.editable&&se(this.dom),st(this),this.domObserver.start()}},{key:"root",get:function(){var e=this,t=this._root;if(null==t)for(var n,r=function(t){if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=function(){return t.ownerDocument.getSelection()}),{v:e._root=t}},o=this.dom.parentNode;o;o=o.parentNode)if(n=r(o),n)return n.v;return t||document}},{key:"updateRoot",value:function(){this._root=null}},{key:"posAtCoords",value:function(e){return ve(this,e)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return we(this,e,t)}},{key:"domAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(e,t)}},{key:"nodeDOM",value:function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null}},{key:"posAtDOM",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}},{key:"endOfTextblock",value:function(e,t){return Pe(this,t||this.state,e)}},{key:"pasteHTML",value:function(e,t){return jn(this,"",e,!1,t||new ClipboardEvent("paste"))}},{key:"pasteText",value:function(e,t){return jn(this,e,null,!0,t||new ClipboardEvent("paste"))}},{key:"serializeForClipboard",value:function(e){return jt(this,e)}},{key:"destroy",value:function(){this.docView&&(cn(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],fr(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,A())}},{key:"isDestroyed",get:function(){return null==this.docView}},{key:"dispatchEvent",value:function(e){return hn(this,e)}},{key:"domSelectionRange",value:function(){var e=this.domSelection();return e?U&&11===this.root.nodeType&&I(this.dom.ownerDocument)==this.dom&&Ar(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}},{key:"domSelection",value:function(){return this.root.getSelection()}}])}();function Fr(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r?t.class+=" "+n[r]:"style"==r?t.style=(t.style?t.style+";":"")+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Xn.node(0,e.state.doc.content.size,t)]}function Lr(e){if(e.markCursor){var t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Xn.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Br(e){return!e.someProp("editable",function(t){return!1===t(e.state)})}function Rr(e,t){var n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function zr(e){var t=Object.create(null);function n(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function jr(e,t){var n=0,r=0;for(var o in e){if(e[o]!=t[o])return!0;n++}for(var i in t)r++;return n!=r}function Hr(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}Or.prototype.dispatch=function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.