@wangeditor-next/yjs-for-react 0.1.1-beta.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import t,{createContext as e,useContext as n,useReducer as r,useRef as o,useEffect as i,useCallback as u,useState as c,useLayoutEffect as a,useMemo as f}from"react";import{CursorEditor as s,relativeRangeToSlateRange as l}from"@wangeditor-next/yjs";import{Range as v,Editor as p,Text as d,Path as h}from"slate";import{DomEditor as y}from"@wangeditor-next/editor";var g=e(null),b=function(){var t=n(g);return t||console.warn("The `useEditorStatic` hook must be used inside the <EditorContext> component's context."),t},m=function(){return m=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},m.apply(this,arguments)};function S(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function w(t){var e={exports:{}};return t(e,e.exports),e.exports
1
+ import t,{createContext as e,useContext as n,useReducer as r,useRef as o,useEffect as i,useCallback as u,useState as c,useLayoutEffect as a,useMemo as f}from"react";import{CursorEditor as s,relativeRangeToSlateRange as l}from"@wangeditor-next/yjs";import{Range as v,Editor as p,Text as h,Path as y}from"slate";import{DomEditor as d}from"@wangeditor-next/editor";var g=e(null),b=function(){var t=n(g);return t||console.warn("The `useEditorStatic` hook must be used inside the <EditorContext> component's context."),t},m=function(){return m=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},m.apply(this,arguments)};function w(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function S(t){var e={exports:{}};return t(e,e.exports),e.exports
2
2
  /**
3
3
  * @license React
4
4
  * use-sync-external-store-shim.production.min.js
@@ -7,7 +7,7 @@ import t,{createContext as e,useContext as n,useReducer as r,useRef as o,useEffe
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */}var E="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},j=t.useState,x=t.useEffect,A=t.useLayoutEffect,T=t.useDebugValue;function P(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!E(t,n)}catch(t){return!0}}var R="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=j({inst:{value:n,getSnapshot:e}}),o=r[0].inst,i=r[1];return A((function(){o.value=n,o.getSnapshot=e,P(o)&&i({inst:o})}),[t,n,e]),x((function(){return P(o)&&i({inst:o}),t((function(){P(o)&&i({inst:o})}))}),[t]),T(n),n},k={useSyncExternalStore:void 0!==t.useSyncExternalStore?t.useSyncExternalStore:R};
10
+ */}var j="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},E=t.useState,x=t.useEffect,A=t.useLayoutEffect,P=t.useDebugValue;function R(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!j(t,n)}catch(t){return!0}}var T="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=E({inst:{value:n,getSnapshot:e}}),o=r[0].inst,i=r[1];return A((function(){o.value=n,o.getSnapshot=e,R(o)&&i({inst:o})}),[t,n,e]),x((function(){return R(o)&&i({inst:o}),t((function(){R(o)&&i({inst:o})}))}),[t]),P(n),n},k={useSyncExternalStore:void 0!==t.useSyncExternalStore?t.useSyncExternalStore:T};
11
11
  /**
12
12
  * @license React
13
13
  * use-sync-external-store-shim.development.js
@@ -17,7 +17,7 @@ import t,{createContext as e,useContext as n,useReducer as r,useRef as o,useEffe
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
19
  */
20
- w((function(t,e){}));var z=w((function(t){t.exports=k}));
20
+ S((function(t,e){}));var z=S((function(t){t.exports=k}));
21
21
  /**
22
22
  * @license React
23
23
  * use-sync-external-store-shim/with-selector.production.min.js
@@ -36,5 +36,5 @@ w((function(t,e){}));var z=w((function(t){t.exports=k}));
36
36
  * This source code is licensed under the MIT license found in the
37
37
  * LICENSE file in the root directory of this source tree.
38
38
  */
39
- w((function(t,e){}));var N,G,W=w((function(t){t.exports=D})),V=function(t){return t&&t.Math==Math&&t},B=V("object"==typeof globalThis&&globalThis)||V("object"==typeof window&&window)||V("object"==typeof self&&self)||V("object"==typeof O&&O)||function(){return this}()||Function("return this")(),U=Function.prototype,q=U.bind,H=U.call,X=q&&q.bind(H),K=q?function(t){return t&&X(H,t)}:function(t){return t&&function(){return H.apply(t,arguments)}},Y=function(t){try{return!!t()}catch(t){return!0}},$=K({}.toString),J=K("".slice),Q=function(t){return J($(t),8,-1)},Z=B.Object,tt=K("".split),et=Y((function(){return!Z("z").propertyIsEnumerable(0)}))?function(t){return"String"==Q(t)?tt(t,""):Z(t)}:Z,nt=B.TypeError,rt=function(t){if(null==t)throw nt("Can't call method on "+t);return t},ot=function(t){return et(rt(t))},it=Object.defineProperty,ut=function(t,e){try{it(B,t,{value:e,configurable:!0,writable:!0})}catch(n){B[t]=e}return e},ct="__core-js_shared__",at=B[ct]||ut(ct,{}),ft=w((function(t){(t.exports=function(t,e){return at[t]||(at[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),st=B.Object,lt=function(t){return st(rt(t))},vt=K({}.hasOwnProperty),pt=Object.hasOwn||function(t,e){return vt(lt(t),e)},dt=0,ht=Math.random(),yt=K(1..toString),gt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+yt(++dt+ht,36)},bt=function(t){return"function"==typeof t},mt=function(t,e){return arguments.length<2?(n=B[t],bt(n)?n:void 0):B[t]&&B[t][e];var n},St=mt("navigator","userAgent")||"",Ot=B.process,wt=B.Deno,Et=Ot&&Ot.versions||wt&&wt.version,jt=Et&&Et.v8;jt&&(G=(N=jt.split("."))[0]>0&&N[0]<4?1:+(N[0]+N[1])),!G&&St&&(!(N=St.match(/Edge\/(\d+)/))||N[1]>=74)&&(N=St.match(/Chrome\/(\d+)/))&&(G=+N[1]);var xt,At=G,Tt=!!Object.getOwnPropertySymbols&&!Y((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&At&&At<41})),Pt=Tt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Rt=ft("wks"),kt=B.Symbol,zt=kt&&kt.for,It=Pt?kt:kt&&kt.withoutSetter||gt,Lt=function(t){if(!pt(Rt,t)||!Tt&&"string"!=typeof Rt[t]){var e="Symbol."+t;Tt&&pt(kt,t)?Rt[t]=kt[t]:Rt[t]=Pt&&zt?zt(e):It(e)}return Rt[t]},Ct=function(t){return"object"==typeof t?null!==t:bt(t)},Mt=B.String,Ft=B.TypeError,_t=function(t){if(Ct(t))return t;throw Ft(Mt(t)+" is not an object")},Dt=!Y((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Nt=B.document,Gt=Ct(Nt)&&Ct(Nt.createElement),Wt=function(t){return Gt?Nt.createElement(t):{}},Vt=!Dt&&!Y((function(){return 7!=Object.defineProperty(Wt("div"),"a",{get:function(){return 7}}).a})),Bt=Function.prototype.call,Ut=Bt.bind?Bt.bind(Bt):function(){return Bt.apply(Bt,arguments)},qt=K({}.isPrototypeOf),Ht=B.Object,Xt=Pt?function(t){return"symbol"==typeof t}:function(t){var e=mt("Symbol");return bt(e)&&qt(e.prototype,Ht(t))},Kt=B.String,Yt=function(t){try{return Kt(t)}catch(t){return"Object"}},$t=B.TypeError,Jt=function(t){if(bt(t))return t;throw $t(Yt(t)+" is not a function")},Qt=function(t,e){var n=t[e];return null==n?void 0:Jt(n)},Zt=B.TypeError,te=B.TypeError,ee=Lt("toPrimitive"),ne=function(t,e){if(!Ct(t)||Xt(t))return t;var n,r=Qt(t,ee);if(r){if(void 0===e&&(e="default"),n=Ut(r,t,e),!Ct(n)||Xt(n))return n;throw te("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var n,r;if("string"===e&&bt(n=t.toString)&&!Ct(r=Ut(n,t)))return r;if(bt(n=t.valueOf)&&!Ct(r=Ut(n,t)))return r;if("string"!==e&&bt(n=t.toString)&&!Ct(r=Ut(n,t)))return r;throw Zt("Can't convert object to primitive value")}(t,e)},re=function(t){var e=ne(t,"string");return Xt(e)?e:e+""},oe=B.TypeError,ie=Object.defineProperty,ue={f:Dt?ie:function(t,e,n){if(_t(t),e=re(e),_t(n),Vt)try{return ie(t,e,n)}catch(t){}if("get"in n||"set"in n)throw oe("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},ce=Math.ceil,ae=Math.floor,fe=function(t){var e=+t;return e!=e||0===e?0:(e>0?ae:ce)(e)},se=Math.max,le=Math.min,ve=function(t,e){var n=fe(t);return n<0?se(n+e,0):le(n,e)},pe=Math.min,de=function(t){return(e=t.length)>0?pe(fe(e),9007199254740991):0;var e},he=function(t){return function(e,n,r){var o,i=ot(e),u=de(i),c=ve(r,u);if(t&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},ye={includes:he(!0),indexOf:he(!1)},ge={},be=ye.indexOf,me=K([].push),Se=function(t,e){var n,r=ot(t),o=0,i=[];for(n in r)!pt(ge,n)&&pt(r,n)&&me(i,n);for(;e.length>o;)pt(r,n=e[o++])&&(~be(i,n)||me(i,n));return i},Oe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],we=Object.keys||function(t){return Se(t,Oe)},Ee=Dt?Object.defineProperties:function(t,e){_t(t);for(var n,r=ot(e),o=we(e),i=o.length,u=0;i>u;)ue.f(t,n=o[u++],r[n]);return t},je=mt("document","documentElement"),xe=ft("keys"),Ae=function(t){return xe[t]||(xe[t]=gt(t))},Te="prototype",Pe="script",Re=Ae("IE_PROTO"),ke=function(){},ze=function(t){return"<"+Pe+">"+t+"</"+Pe+">"},Ie=function(t){t.write(ze("")),t.close();var e=t.parentWindow.Object;return t=null,e},Le=function(){try{xt=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;Le="undefined"!=typeof document?document.domain&&xt?Ie(xt):(e=Wt("iframe"),n="java"+Pe+":",e.style.display="none",je.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(ze("document.F=Object")),t.close(),t.F):Ie(xt);for(var r=Oe.length;r--;)delete Le[Te][Oe[r]];return Le()};ge[Re]=!0;var Ce=Object.create||function(t,e){var n;return null!==t?(ke[Te]=_t(t),n=new ke,ke[Te]=null,n[Re]=t):n=Le(),void 0===e?n:Ee(n,e)},Me=Lt("unscopables"),Fe=Array.prototype;null==Fe[Me]&&ue.f(Fe,Me,{configurable:!0,value:Ce(null)});var _e=function(t){Fe[Me][t]=!0},De={},Ne=K(Function.toString);bt(at.inspectSource)||(at.inspectSource=function(t){return Ne(t)});var Ge,We,Ve,Be=at.inspectSource,Ue=B.WeakMap,qe=bt(Ue)&&/native code/.test(Be(Ue)),He=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},Xe=Dt?function(t,e,n){return ue.f(t,e,He(1,n))}:function(t,e,n){return t[e]=n,t},Ke="Object already initialized",Ye=B.TypeError,$e=B.WeakMap;if(qe||at.state){var Je=at.state||(at.state=new $e),Qe=K(Je.get),Ze=K(Je.has),tn=K(Je.set);Ge=function(t,e){if(Ze(Je,t))throw new Ye(Ke);return e.facade=t,tn(Je,t,e),e},We=function(t){return Qe(Je,t)||{}},Ve=function(t){return Ze(Je,t)}}else{var en=Ae("state");ge[en]=!0,Ge=function(t,e){if(pt(t,en))throw new Ye(Ke);return e.facade=t,Xe(t,en,e),e},We=function(t){return pt(t,en)?t[en]:{}},Ve=function(t){return pt(t,en)}}var nn,rn,on,un={set:Ge,get:We,has:Ve,enforce:function(t){return Ve(t)?We(t):Ge(t,{})},getterFor:function(t){return function(e){var n;if(!Ct(e)||(n=We(e)).type!==t)throw Ye("Incompatible receiver, "+t+" required");return n}}},cn={}.propertyIsEnumerable,an=Object.getOwnPropertyDescriptor,fn={f:an&&!cn.call({1:2},1)?function(t){var e=an(this,t);return!!e&&e.enumerable}:cn},sn=Object.getOwnPropertyDescriptor,ln={f:Dt?sn:function(t,e){if(t=ot(t),e=re(e),Vt)try{return sn(t,e)}catch(t){}if(pt(t,e))return He(!Ut(fn.f,t,e),t[e])}},vn=Function.prototype,pn=Dt&&Object.getOwnPropertyDescriptor,dn=pt(vn,"name"),hn={EXISTS:dn,PROPER:dn&&"something"===function(){}.name,CONFIGURABLE:dn&&(!Dt||Dt&&pn(vn,"name").configurable)},yn=w((function(t){var e=hn.CONFIGURABLE,n=un.get,r=un.enforce,o=String(String).split("String");(t.exports=function(t,n,i,u){var c,a=!!u&&!!u.unsafe,f=!!u&&!!u.enumerable,s=!!u&&!!u.noTargetGet,l=u&&void 0!==u.name?u.name:n;bt(i)&&("Symbol("===String(l).slice(0,7)&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!pt(i,"name")||e&&i.name!==l)&&Xe(i,"name",l),(c=r(i)).source||(c.source=o.join("string"==typeof l?l:""))),t!==B?(a?!s&&t[n]&&(f=!0):delete t[n],f?t[n]=i:Xe(t,n,i)):f?t[n]=i:ut(n,i)})(Function.prototype,"toString",(function(){return bt(this)&&n(this).source||Be(this)}))})),gn=Oe.concat("length","prototype"),bn={f:Object.getOwnPropertyNames||function(t){return Se(t,gn)}},mn={f:Object.getOwnPropertySymbols},Sn=K([].concat),On=mt("Reflect","ownKeys")||function(t){var e=bn.f(_t(t)),n=mn.f;return n?Sn(e,n(t)):e},wn=function(t,e){for(var n=On(e),r=ue.f,o=ln.f,i=0;i<n.length;i++){var u=n[i];pt(t,u)||r(t,u,o(e,u))}},En=/#|\.prototype\./,jn=function(t,e){var n=An[xn(t)];return n==Pn||n!=Tn&&(bt(e)?Y(e):!!e)},xn=jn.normalize=function(t){return String(t).replace(En,".").toLowerCase()},An=jn.data={},Tn=jn.NATIVE="N",Pn=jn.POLYFILL="P",Rn=jn,kn=ln.f,zn=function(t,e){var n,r,o,i,u,c=t.target,a=t.global,f=t.stat;if(n=a?B:f?B[c]||ut(c,{}):(B[c]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(u=kn(n,r))&&u.value:n[r],!Rn(a?r:c+(f?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;wn(i,o)}(t.sham||o&&o.sham)&&Xe(i,"sham",!0),yn(n,r,i,t)}},In=!Y((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Ln=Ae("IE_PROTO"),Cn=B.Object,Mn=Cn.prototype,Fn=In?Cn.getPrototypeOf:function(t){var e=lt(t);if(pt(e,Ln))return e[Ln];var n=e.constructor;return bt(n)&&e instanceof n?n.prototype:e instanceof Cn?Mn:null},_n=Lt("iterator"),Dn=!1;[].keys&&("next"in(on=[].keys())?(rn=Fn(Fn(on)))!==Object.prototype&&(nn=rn):Dn=!0);var Nn=null==nn||Y((function(){var t={};return nn[_n].call(t)!==t}));Nn&&(nn={}),bt(nn[_n])||yn(nn,_n,(function(){return this}));var Gn={IteratorPrototype:nn,BUGGY_SAFARI_ITERATORS:Dn},Wn=ue.f,Vn=Lt("toStringTag"),Bn=function(t,e,n){t&&!pt(t=n?t:t.prototype,Vn)&&Wn(t,Vn,{configurable:!0,value:e})},Un=Gn.IteratorPrototype,qn=function(){return this},Hn=B.String,Xn=B.TypeError,Kn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=K(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return _t(n),function(t){if("object"==typeof t||bt(t))return t;throw Xn("Can't set "+Hn(t)+" as a prototype")}(r),e?t(n,r):n.__proto__=r,n}}():void 0),Yn=hn.PROPER,$n=hn.CONFIGURABLE,Jn=Gn.IteratorPrototype,Qn=Gn.BUGGY_SAFARI_ITERATORS,Zn=Lt("iterator"),tr="keys",er="values",nr="entries",rr=function(){return this},or=function(t,e,n,r,o,i,u){!function(t,e,n,r){var o=e+" Iterator";t.prototype=Ce(Un,{next:He(+!r,n)}),Bn(t,o,!1),De[o]=qn}(n,e,r);var c,a,f,s=function(t){if(t===o&&h)return h;if(!Qn&&t in p)return p[t];switch(t){case tr:case er:case nr:return function(){return new n(this,t)}}return function(){return new n(this)}},l=e+" Iterator",v=!1,p=t.prototype,d=p[Zn]||p["@@iterator"]||o&&p[o],h=!Qn&&d||s(o),y="Array"==e&&p.entries||d;if(y&&(c=Fn(y.call(new t)))!==Object.prototype&&c.next&&(Fn(c)!==Jn&&(Kn?Kn(c,Jn):bt(c[Zn])||yn(c,Zn,rr)),Bn(c,l,!0)),Yn&&o==er&&d&&d.name!==er&&($n?Xe(p,"name",er):(v=!0,h=function(){return Ut(d,this)})),o)if(a={values:s(er),keys:i?h:s(tr),entries:s(nr)},u)for(f in a)(Qn||v||!(f in p))&&yn(p,f,a[f]);else zn({target:e,proto:!0,forced:Qn||v},a);return p[Zn]!==h&&yn(p,Zn,h,{name:o}),De[e]=h,a},ir="Array Iterator",ur=un.set,cr=un.getterFor(ir),ar=or(Array,"Array",(function(t,e){ur(this,{type:ir,target:ot(t),index:0,kind:e})}),(function(){var t=cr(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values");De.Arguments=De.Array,_e("keys"),_e("values"),_e("entries");var fr={};fr[Lt("toStringTag")]="z";var sr="[object z]"===String(fr),lr=Lt("toStringTag"),vr=B.Object,pr="Arguments"==Q(function(){return arguments}()),dr=sr?Q:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=vr(t),lr))?n:pr?Q(e):"Object"==(r=Q(e))&&bt(e.callee)?"Arguments":r},hr=sr?{}.toString:function(){return"[object "+dr(this)+"]"};sr||yn(Object.prototype,"toString",hr,{unsafe:!0});var yr=B.String,gr=function(t){if("Symbol"===dr(t))throw TypeError("Cannot convert a Symbol value to a string");return yr(t)},br=hn.PROPER,mr="toString",Sr=RegExp.prototype,Or=Sr[mr],wr=K((function(){var t=_t(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e})),Er=Y((function(){return"/a/b"!=Or.call({source:"a",flags:"b"})})),jr=br&&Or.name!=mr;(Er||jr)&&yn(RegExp.prototype,mr,(function(){var t=_t(this),e=gr(t.source),n=t.flags;return"/"+e+"/"+gr(void 0===n&&qt(Sr,t)&&!("flags"in Sr)?wr(t):n)}),{unsafe:!0});var xr=function(t,e,n){var r=re(e);r in t?ue.f(t,r,He(0,n)):t[r]=n},Ar=B.Array,Tr=Math.max,Pr=bn.f,Rr="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],kr=function(t){try{return Pr(t)}catch(t){return function(t,e,n){for(var r=de(t),o=ve(e,r),i=ve(void 0===n?r:n,r),u=Ar(Tr(i-o,0)),c=0;o<i;o++,c++)xr(u,c,t[o]);return u.length=c,u}(Rr)}},zr={f:function(t){return Rr&&"Window"==Q(t)?kr(t):Pr(ot(t))}},Ir=Y((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Lr=Object.isExtensible,Cr=Y((function(){Lr(1)}))||Ir?function(t){return!!Ct(t)&&((!Ir||"ArrayBuffer"!=Q(t))&&(!Lr||Lr(t)))}:Lr,Mr=!Y((function(){return Object.isExtensible(Object.preventExtensions({}))})),Fr=w((function(t){var e=ue.f,n=!1,r=gt("meta"),o=0,i=function(t){e(t,r,{value:{objectID:"O"+o++,weakData:{}}})},u=t.exports={enable:function(){u.enable=function(){},n=!0;var t=bn.f,e=K([].splice),o={};o[r]=1,t(o).length&&(bn.f=function(n){for(var o=t(n),i=0,u=o.length;i<u;i++)if(o[i]===r){e(o,i,1);break}return o},zn({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:zr.f}))},fastKey:function(t,e){if(!Ct(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!pt(t,r)){if(!Cr(t))return"F";if(!e)return"E";i(t)}return t[r].objectID},getWeakData:function(t,e){if(!pt(t,r)){if(!Cr(t))return!0;if(!e)return!1;i(t)}return t[r].weakData},onFreeze:function(t){return Mr&&n&&Cr(t)&&!pt(t,r)&&i(t),t}};ge[r]=!0})),_r=K(K.bind),Dr=function(t,e){return Jt(t),void 0===e?t:_r?_r(t,e):function(){return t.apply(e,arguments)}},Nr=Lt("iterator"),Gr=Array.prototype,Wr=Lt("iterator"),Vr=function(t){if(null!=t)return Qt(t,Wr)||Qt(t,"@@iterator")||De[dr(t)]},Br=B.TypeError,Ur=function(t,e,n){var r,o;_t(t);try{if(!(r=Qt(t,"return"))){if("throw"===e)throw n;return n}r=Ut(r,t)}catch(t){o=!0,r=t}if("throw"===e)throw n;if(o)throw r;return _t(r),n},qr=B.TypeError,Hr=function(t,e){this.stopped=t,this.result=e},Xr=Hr.prototype,Kr=function(t,e,n){var r,o,i,u,c,a,f,s,l=n&&n.that,v=!(!n||!n.AS_ENTRIES),p=!(!n||!n.IS_ITERATOR),d=!(!n||!n.INTERRUPTED),h=Dr(e,l),y=function(t){return r&&Ur(r,"normal",t),new Hr(!0,t)},g=function(t){return v?(_t(t),d?h(t[0],t[1],y):h(t[0],t[1])):d?h(t,y):h(t)};if(p)r=t;else{if(!(o=Vr(t)))throw qr(Yt(t)+" is not iterable");if(void 0!==(s=o)&&(De.Array===s||Gr[Nr]===s)){for(i=0,u=de(t);u>i;i++)if((c=g(t[i]))&&qt(Xr,c))return c;return new Hr(!1)}r=function(t,e){var n=arguments.length<2?Vr(t):e;if(Jt(n))return _t(Ut(n,t));throw Br(Yt(t)+" is not iterable")}(t,o)}for(a=r.next;!(f=Ut(a,r)).done;){try{c=g(f.value)}catch(t){Ur(r,"throw",t)}if("object"==typeof c&&c&&qt(Xr,c))return c}return new Hr(!1)},Yr=B.TypeError,$r=function(t,e){if(qt(e,t))return t;throw Yr("Incorrect invocation")},Jr=Lt("iterator"),Qr=!1;try{var Zr=0,to={next:function(){return{done:!!Zr++}},return:function(){Qr=!0}};to[Jr]=function(){return this},Array.from(to,(function(){throw 2}))}catch(t){}var eo=function(t,e,n){var r=-1!==t.indexOf("Map"),o=-1!==t.indexOf("Weak"),i=r?"set":"add",u=B[t],c=u&&u.prototype,a=u,f={},s=function(t){var e=K(c[t]);yn(c,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(o&&!Ct(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return o&&!Ct(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(o&&!Ct(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})};if(Rn(t,!bt(u)||!(o||c.forEach&&!Y((function(){(new u).entries().next()})))))a=n.getConstructor(e,t,r,i),Fr.enable();else if(Rn(t,!0)){var l=new a,v=l[i](o?{}:-0,1)!=l,p=Y((function(){l.has(1)})),d=function(t,e){if(!e&&!Qr)return!1;var n=!1;try{var r={};r[Jr]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){new u(t)})),h=!o&&Y((function(){for(var t=new u,e=5;e--;)t[i](e,e);return!t.has(-0)}));d||((a=e((function(t,e){$r(t,c);var n=function(t,e,n){var r,o;return Kn&&bt(r=e.constructor)&&r!==n&&Ct(o=r.prototype)&&o!==n.prototype&&Kn(t,o),t}(new u,t,a);return null!=e&&Kr(e,n[i],{that:n,AS_ENTRIES:r}),n}))).prototype=c,c.constructor=a),(p||h)&&(s("delete"),s("has"),r&&s("get")),(h||v)&&s(i),o&&c.clear&&delete c.clear}return f[t]=a,zn({global:!0,forced:a!=u},f),Bn(a,t),o||n.setStrong(a,t,r),a},no=function(t,e,n){for(var r in e)yn(t,r,e[r],n);return t},ro=Lt("species"),oo=ue.f,io=Fr.fastKey,uo=un.set,co=un.getterFor,ao={getConstructor:function(t,e,n,r){var o=t((function(t,o){$r(t,i),uo(t,{type:e,index:Ce(null),first:void 0,last:void 0,size:0}),Dt||(t.size=0),null!=o&&Kr(o,t[r],{that:t,AS_ENTRIES:n})})),i=o.prototype,u=co(e),c=function(t,e,n){var r,o,i=u(t),c=a(t,e);return c?c.value=n:(i.last=c={index:o=io(e,!0),key:e,value:n,previous:r=i.last,next:void 0,removed:!1},i.first||(i.first=c),r&&(r.next=c),Dt?i.size++:t.size++,"F"!==o&&(i.index[o]=c)),t},a=function(t,e){var n,r=u(t),o=io(e);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key==e)return n};return no(i,{clear:function(){for(var t=u(this),e=t.index,n=t.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete e[n.index],n=n.next;t.first=t.last=void 0,Dt?t.size=0:this.size=0},delete:function(t){var e=this,n=u(e),r=a(e,t);if(r){var o=r.next,i=r.previous;delete n.index[r.index],r.removed=!0,i&&(i.next=o),o&&(o.previous=i),n.first==r&&(n.first=o),n.last==r&&(n.last=i),Dt?n.size--:e.size--}return!!r},forEach:function(t){for(var e,n=u(this),r=Dr(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!a(this,t)}}),no(i,n?{get:function(t){var e=a(this,t);return e&&e.value},set:function(t,e){return c(this,0===t?0:t,e)}}:{add:function(t){return c(this,t=0===t?0:t,t)}}),Dt&&oo(i,"size",{get:function(){return u(this).size}}),o},setStrong:function(t,e,n){var r=e+" Iterator",o=co(e),i=co(r);or(t,e,(function(t,e){uo(this,{type:r,target:t,state:o(t),kind:e,last:void 0})}),(function(){for(var t=i(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?"keys"==e?{value:n.key,done:!1}:"values"==e?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),function(t){var e=mt(t),n=ue.f;Dt&&e&&!e[ro]&&n(e,ro,{configurable:!0,get:function(){return this}})}(e)}};eo("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),ao);var fo=K("".charAt),so=K("".charCodeAt),lo=K("".slice),vo=function(t){return function(e,n){var r,o,i=gr(rt(e)),u=fe(n),c=i.length;return u<0||u>=c?t?"":void 0:(r=so(i,u))<55296||r>56319||u+1===c||(o=so(i,u+1))<56320||o>57343?t?fo(i,u):r:t?lo(i,u,u+2):o-56320+(r-55296<<10)+65536}},po={codeAt:vo(!1),charAt:vo(!0)}.charAt,ho="String Iterator",yo=un.set,go=un.getterFor(ho);or(String,"String",(function(t){yo(this,{type:ho,string:gr(t),index:0})}),(function(){var t,e=go(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=po(n,r),e.index+=t.length,{value:t,done:!1})}));var bo=Array.isArray||function(t){return"Array"==Q(t)},mo=function(){},So=[],Oo=mt("Reflect","construct"),wo=/^\s*(?:class|function)\b/,Eo=K(wo.exec),jo=!wo.exec(mo),xo=function(t){if(!bt(t))return!1;try{return Oo(mo,So,t),!0}catch(t){return!1}},Ao=!Oo||Y((function(){var t;return xo(xo.call)||!xo(Object)||!xo((function(){t=!0}))||t}))?function(t){if(!bt(t))return!1;switch(dr(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return jo||!!Eo(wo,Be(t))}:xo,To=Lt("species"),Po=B.Array,Ro=function(t,e){return new(function(t){var e;return bo(t)&&(e=t.constructor,(Ao(e)&&(e===Po||bo(e.prototype))||Ct(e)&&null===(e=e[To]))&&(e=void 0)),void 0===e?Po:e}(t))(0===e?0:e)},ko=K([].push),zo=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,u=7==t,c=5==t||i;return function(a,f,s,l){for(var v,p,d=lt(a),h=et(d),y=Dr(f,s),g=de(h),b=0,m=l||Ro,S=e?m(a,g):n||u?m(a,0):void 0;g>b;b++)if((c||b in h)&&(p=y(v=h[b],b,d),t))if(e)S[b]=p;else if(p)switch(t){case 3:return!0;case 5:return v;case 6:return b;case 2:ko(S,v)}else switch(t){case 4:return!1;case 7:ko(S,v)}return i?-1:r||o?o:S}},Io={forEach:zo(0),map:zo(1),filter:zo(2),some:zo(3),every:zo(4),find:zo(5),findIndex:zo(6),filterReject:zo(7)},Lo=Fr.getWeakData,Co=un.set,Mo=un.getterFor,Fo=Io.find,_o=Io.findIndex,Do=K([].splice),No=0,Go=function(t){return t.frozen||(t.frozen=new Wo)},Wo=function(){this.entries=[]},Vo=function(t,e){return Fo(t.entries,(function(t){return t[0]===e}))};Wo.prototype={get:function(t){var e=Vo(this,t);if(e)return e[1]},has:function(t){return!!Vo(this,t)},set:function(t,e){var n=Vo(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=_o(this.entries,(function(e){return e[0]===t}));return~e&&Do(this.entries,e,1),!!~e}};var Bo,Uo={getConstructor:function(t,e,n,r){var o=t((function(t,o){$r(t,i),Co(t,{type:e,id:No++,frozen:void 0}),null!=o&&Kr(o,t[r],{that:t,AS_ENTRIES:n})})),i=o.prototype,u=Mo(e),c=function(t,e,n){var r=u(t),o=Lo(_t(e),!0);return!0===o?Go(r).set(e,n):o[r.id]=n,t};return no(i,{delete:function(t){var e=u(this);if(!Ct(t))return!1;var n=Lo(t);return!0===n?Go(e).delete(t):n&&pt(n,e.id)&&delete n[e.id]},has:function(t){var e=u(this);if(!Ct(t))return!1;var n=Lo(t);return!0===n?Go(e).has(t):n&&pt(n,e.id)}}),no(i,n?{get:function(t){var e=u(this);if(Ct(t)){var n=Lo(t);return!0===n?Go(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return c(this,t,e)}}:{add:function(t){return c(this,t,!0)}}),o}},qo=un.enforce,Ho=!B.ActiveXObject&&"ActiveXObject"in B,Xo=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Ko=eo("WeakMap",Xo,Uo);if(qe&&Ho){Bo=Uo.getConstructor(Xo,"WeakMap",!0),Fr.enable();var Yo=Ko.prototype,$o=K(Yo.delete),Jo=K(Yo.has),Qo=K(Yo.get),Zo=K(Yo.set);no(Yo,{delete:function(t){if(Ct(t)&&!Cr(t)){var e=qo(this);return e.frozen||(e.frozen=new Bo),$o(this,t)||e.frozen.delete(t)}return $o(this,t)},has:function(t){if(Ct(t)&&!Cr(t)){var e=qo(this);return e.frozen||(e.frozen=new Bo),Jo(this,t)||e.frozen.has(t)}return Jo(this,t)},get:function(t){if(Ct(t)&&!Cr(t)){var e=qo(this);return e.frozen||(e.frozen=new Bo),Jo(this,t)?Qo(this,t):e.frozen.get(t)}return Qo(this,t)},set:function(t,e){if(Ct(t)&&!Cr(t)){var n=qo(this);n.frozen||(n.frozen=new Bo),Jo(this,t)?Zo(this,t,e):n.frozen.set(t,e)}else Zo(this,t,e);return this}})}var ti,ei,ni={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},ri=Wt("span").classList,oi=ri&&ri.constructor&&ri.constructor.prototype,ii=oi===Object.prototype?void 0:oi,ui=Io.forEach,ci=!!(ei=[]["forEach"])&&Y((function(){ei.call(null,ti||function(){throw 1},1)}))?[].forEach:function(t){return ui(this,t,arguments.length>1?arguments[1]:void 0)},ai=function(t){if(t&&t.forEach!==ci)try{Xe(t,"forEach",ci)}catch(e){t.forEach=ci}};for(var fi in ni)ni[fi]&&ai(B[fi]&&B[fi].prototype);ai(ii);var si=Lt("iterator"),li=Lt("toStringTag"),vi=ar.values,pi=function(t,e){if(t){if(t[si]!==vi)try{Xe(t,si,vi)}catch(e){t[si]=vi}if(t[li]||Xe(t,li,e),ni[e])for(var n in ar)if(t[n]!==ar[n])try{Xe(t,n,ar[n])}catch(e){t[n]=ar[n]}}};for(var di in ni)pi(B[di]&&B[di].prototype,di);function hi(){var t=b();return s.isCursorEditor(t)||console.warn("Cannot use useSyncExternalStore outside the context of a RemoteCursorEditor"),t}pi(ii,"DOMTokenList");var yi=new WeakMap;function gi(t){var e=yi.get(t);if(e)return e;var n=function(t){var e={},n=new Set,r=n.add.bind(n),o=new Set,i=null;return[function(e){return o.add(e),i||(i=function(t){t.added.forEach(r),t.removed.forEach(r),t.updated.forEach(r),o.forEach((function(t){return t()}))},s.on(t,"change",i)),function(){o.delete(e),i&&0===o.size&&(s.off(t,"change",i),i=null)}},function(){return 0===n.size?e:(n.forEach((function(n){var r=s.cursorState(t,n);null!==r?e[n]=r:delete e[n.toString()]})),n.clear(),e=m({},e))}]}(t);return t&&yi.set(t,n),n}function bi(){return gi(hi())}function mi(){var t=S(bi(),2),e=t[0],n=t[1];return z.useSyncExternalStore(e,n)}function Si(t,e){var n=S(bi(),2),r=n[0],o=n[1];return W.useSyncExternalStoreWithSelector(r,o,null,t,e)}var Oi=new WeakMap;function wi(t,e){if(!e.relativeSelection)return null;var n=Oi.get(t.children);n||(n=new WeakMap,Oi.set(t.children,n));var r=n.get(e);if(void 0===r)try{r=l(t.sharedRoot,t,e.relativeSelection),n.set(e,r)}catch(t){return null}return r}var Ei=Lt("species"),ji=Io.map,xi=function(t){return At>=51||!Y((function(){var e=[];return(e.constructor={})[Ei]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}("map");zn({target:"Array",proto:!0,forced:!xi},{map:function(t){return ji(this,t,arguments.length>1?arguments[1]:void 0)}});var Ai=K(fn.f),Ti=K([].push),Pi=function(t){return function(e){for(var n,r=ot(e),o=we(r),i=o.length,u=0,c=[];i>u;)n=o[u++],Dt&&!Ai(r,n)||Ti(c,t?[n,r[n]]:r[n]);return c}},Ri={entries:Pi(!0),values:Pi(!1)}.entries;zn({target:"Object",stat:!0},{entries:function(t){return Ri(t)}});var ki=Fr.onFreeze,zi=Object.freeze,Ii=Y((function(){zi(1)}));zn({target:"Object",stat:!0,forced:Ii,sham:!Mr},{freeze:function(t){return zi&&Ct(t)?zi(ki(t)):t}}),zn({target:"Object",stat:!0},{fromEntries:function(t){var e={};return Kr(t,(function(t,n){xr(e,t,n)}),{AS_ENTRIES:!0}),e}});var Li=Y((function(){we(1)}));function Ci(t,e,n){var r,o,i=n.yOffset,u=n.xOffset,c=n.shouldGenerateOverlay,a=S(v.edges(e),2),f=a[0],s=a[1],l=function(t,e){try{return y.toDOMRange(t,e)}catch(t){return null}}(t,e);if(!l)return{caretPosition:null,selectionRects:[]};var g=[],b=p.nodes(t,{at:e,match:function(t,e){return d.isText(t)&&(!c||c(t,e))}}),m=null,O=v.isBackward(e);try{for(var w=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(b),E=w.next();!E.done;E=w.next()){var j=S(E.value,2),x=j[0],A=j[1],T=y.toDOMNode(t,x),P=h.equals(A,f.path),R=h.equals(A,s.path),k=null;if(P||R){var z=document.createRange();z.selectNode(T),P&&z.setStart(l.startContainer,l.startOffset),R&&z.setEnd(l.endContainer,l.endOffset),k=z.getClientRects()}else k=T.getClientRects();for(var I=O?P:R,L=0;L<k.length;L++){var C=k.item(L);if(C){var M=I&&(O?0===L:L===k.length-1),F=C.top-i,_=C.left-u;M&&(m={height:C.height,top:F,left:_+(O||v.isCollapsed(e)?0:C.width)}),g.push({width:C.width,height:C.height,top:F,left:_})}}}}catch(t){r={error:t}}finally{try{E&&!E.done&&(o=w.return)&&o.call(w)}finally{if(r)throw r.error}}return{selectionRects:g,caretPosition:m}}zn({target:"Object",stat:!0,forced:Li},{keys:function(t){return we(lt(t))}});var Mi=Object.freeze([]);function Fi(t){var e;void 0===t&&(t={});var n,s,l,v=t.containerRef,p=t.shouldGenerateOverlay,d=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["containerRef","shouldGenerateOverlay"]),h=hi(),y=mi(),g=(n=S(r((function(t){return t+1}),0),2)[1],s=o(null),i(l=function(){s.current&&(cancelAnimationFrame(s.current),s.current=0)}),i((function(){return l}),[]),u((function(t){void 0===t&&(t=!1),t?n():s.current||(s.current=requestAnimationFrame(n))}),[])),b=o(new WeakMap),O=S(c({}),2),w=O[0],E=O[1],j=!("refreshOnResize"in d)||(null===(e=d.refreshOnResize)||void 0===e||e);!function(t,e){var n=o(e);n.current=e;var r=S(c((function(){return new ResizeObserver((function(){n.current()}))})),1)[0];i((function(){if(null==t?void 0:t.current){var e=t.current;return r.observe(e),function(){return r.unobserve(e)}}}),[r,t])}(j?v:void 0,(function(){b.current=new WeakMap,g("debounced"!==j)})),a((function(){var t,e,n;if(!v||v.current){var r=null===(t=null==v?void 0:v.current)||void 0===t?void 0:t.getBoundingClientRect(),o=null!==(e=null==r?void 0:r.x)&&void 0!==e?e:0,i=null!==(n=null==r?void 0:r.y)&&void 0!==n?n:0,u=Object.keys(w).length!==Object.keys(y).length,c=Object.fromEntries(Object.entries(y).map((function(t){var e=S(t,2),n=e[0],r=e[1],c=r.relativeSelection&&wi(h,r);if(!c)return[n,Mi];var a=b.current.get(c);if(a)return[n,a];var f=Ci(h,c,{xOffset:o,yOffset:i,shouldGenerateOverlay:p});return u=!0,b.current.set(c,f),[n,f]})));u&&E(c)}}));var x=f((function(){return Object.entries(y).map((function(t){var e,n,r=S(t,2),o=r[0],i=r[1],u=i.relativeSelection&&wi(h,i),c=w[o];return m(m({},i),{range:u,caretPosition:null!==(e=null==c?void 0:c.caretPosition)&&void 0!==e?e:null,selectionRects:null!==(n=null==c?void 0:c.selectionRects)&&void 0!==n?n:Mi})}))}),[y,h,w]);return[x,u((function(){b.current=new WeakMap,g(!0)}),[g])]}export{g as EditorContext,wi as getCursorRange,b as useEditorStatic,Fi as useRemoteCursorOverlayPositions,mi as useRemoteCursorStates,Si as useRemoteCursorStatesSelector};
39
+ S((function(t,e){}));var N,G,W=S((function(t){t.exports=D})),V=function(t){try{return!!t()}catch(t){return!0}},B=!V((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),U=Function.prototype,q=U.call,H=B&&U.bind.bind(q,q),X=B?H:function(t){return function(){return q.apply(t,arguments)}},K=X({}.toString),Y=X("".slice),$=function(t){return Y(K(t),8,-1)},J=Object,Q=X("".split),Z=V((function(){return!J("z").propertyIsEnumerable(0)}))?function(t){return"String"===$(t)?Q(t,""):J(t)}:J,tt=function(t){return null==t},et=TypeError,nt=function(t){if(tt(t))throw new et("Can't call method on "+t);return t},rt=function(t){return Z(nt(t))},ot=function(t){return t&&t.Math===Math&&t},it=ot("object"==typeof globalThis&&globalThis)||ot("object"==typeof window&&window)||ot("object"==typeof self&&self)||ot("object"==typeof O&&O)||ot("object"==typeof O&&O)||function(){return this}()||Function("return this")(),ut=Object.defineProperty,ct=function(t,e){try{ut(it,t,{value:e,configurable:!0,writable:!0})}catch(n){it[t]=e}return e},at=S((function(t){var e="__core-js_shared__",n=t.exports=it[e]||ct(e,{});(n.versions||(n.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"})})),ft=function(t,e){return at[t]||(at[t]=e||{})},st=Object,lt=function(t){return st(nt(t))},vt=X({}.hasOwnProperty),pt=Object.hasOwn||function(t,e){return vt(lt(t),e)},ht=0,yt=Math.random(),dt=X(1..toString),gt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+dt(++ht+yt,36)},bt=it.navigator,mt=bt&&bt.userAgent,wt=mt?String(mt):"",Ot=it.process,St=it.Deno,jt=Ot&&Ot.versions||St&&St.version,Et=jt&&jt.v8;Et&&(G=(N=Et.split("."))[0]>0&&N[0]<4?1:+(N[0]+N[1])),!G&&wt&&(!(N=wt.match(/Edge\/(\d+)/))||N[1]>=74)&&(N=wt.match(/Chrome\/(\d+)/))&&(G=+N[1]);var xt,At=G,Pt=it.String,Rt=!!Object.getOwnPropertySymbols&&!V((function(){var t=Symbol("symbol detection");return!Pt(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&At&&At<41})),Tt=Rt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,kt=it.Symbol,zt=ft("wks"),It=Tt?kt.for||kt:kt&&kt.withoutSetter||gt,Lt=function(t){return pt(zt,t)||(zt[t]=Rt&&pt(kt,t)?kt[t]:It("Symbol."+t)),zt[t]},Ct="object"==typeof document&&document.all,Mt=void 0===Ct&&void 0!==Ct?function(t){return"function"==typeof t||t===Ct}:function(t){return"function"==typeof t},Ft=function(t){return"object"==typeof t?null!==t:Mt(t)},_t=String,Dt=TypeError,Nt=function(t){if(Ft(t))return t;throw new Dt(_t(t)+" is not an object")},Gt=!V((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),Wt=Gt&&V((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Vt=it.document,Bt=Ft(Vt)&&Ft(Vt.createElement),Ut=function(t){return Bt?Vt.createElement(t):{}},qt=!Gt&&!V((function(){return 7!==Object.defineProperty(Ut("div"),"a",{get:function(){return 7}}).a})),Ht=Function.prototype.call,Xt=B?Ht.bind(Ht):function(){return Ht.apply(Ht,arguments)},Kt=function(t,e){return arguments.length<2?(n=it[t],Mt(n)?n:void 0):it[t]&&it[t][e];var n},Yt=X({}.isPrototypeOf),$t=Object,Jt=Tt?function(t){return"symbol"==typeof t}:function(t){var e=Kt("Symbol");return Mt(e)&&Yt(e.prototype,$t(t))},Qt=String,Zt=function(t){try{return Qt(t)}catch(t){return"Object"}},te=TypeError,ee=function(t){if(Mt(t))return t;throw new te(Zt(t)+" is not a function")},ne=function(t,e){var n=t[e];return tt(n)?void 0:ee(n)},re=TypeError,oe=TypeError,ie=Lt("toPrimitive"),ue=function(t,e){if(!Ft(t)||Jt(t))return t;var n,r=ne(t,ie);if(r){if(void 0===e&&(e="default"),n=Xt(r,t,e),!Ft(n)||Jt(n))return n;throw new oe("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var n,r;if("string"===e&&Mt(n=t.toString)&&!Ft(r=Xt(n,t)))return r;if(Mt(n=t.valueOf)&&!Ft(r=Xt(n,t)))return r;if("string"!==e&&Mt(n=t.toString)&&!Ft(r=Xt(n,t)))return r;throw new re("Can't convert object to primitive value")}(t,e)},ce=function(t){var e=ue(t,"string");return Jt(e)?e:e+""},ae=TypeError,fe=Object.defineProperty,se=Object.getOwnPropertyDescriptor,le="enumerable",ve="configurable",pe="writable",he={f:Gt?Wt?function(t,e,n){if(Nt(t),e=ce(e),Nt(n),"function"==typeof t&&"prototype"===e&&"value"in n&&pe in n&&!n[pe]){var r=se(t,e);r&&r[pe]&&(t[e]=n.value,n={configurable:ve in n?n[ve]:r[ve],enumerable:le in n?n[le]:r[le],writable:!1})}return fe(t,e,n)}:fe:function(t,e,n){if(Nt(t),e=ce(e),Nt(n),qt)try{return fe(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new ae("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},ye=Math.ceil,de=Math.floor,ge=Math.trunc||function(t){var e=+t;return(e>0?de:ye)(e)},be=function(t){var e=+t;return e!=e||0===e?0:ge(e)},me=Math.max,we=Math.min,Oe=Math.min,Se=function(t){return e=t.length,(n=be(e))>0?Oe(n,9007199254740991):0;var e,n},je=function(t){return function(e,n,r){var o=rt(e),i=Se(o);if(0===i)return!t&&-1;var u,c=function(t,e){var n=be(t);return n<0?me(n+e,0):we(n,e)}(r,i);if(t&&n!=n){for(;i>c;)if((u=o[c++])!=u)return!0}else for(;i>c;c++)if((t||c in o)&&o[c]===n)return t||c||0;return!t&&-1}},Ee={includes:je(!0),indexOf:je(!1)},xe={},Ae=Ee.indexOf,Pe=X([].push),Re=function(t,e){var n,r=rt(t),o=0,i=[];for(n in r)!pt(xe,n)&&pt(r,n)&&Pe(i,n);for(;e.length>o;)pt(r,n=e[o++])&&(~Ae(i,n)||Pe(i,n));return i},Te=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ke=Object.keys||function(t){return Re(t,Te)},ze=Gt&&!Wt?Object.defineProperties:function(t,e){Nt(t);for(var n,r=rt(e),o=ke(e),i=o.length,u=0;i>u;)he.f(t,n=o[u++],r[n]);return t},Ie={f:ze},Le=Kt("document","documentElement"),Ce=ft("keys"),Me=function(t){return Ce[t]||(Ce[t]=gt(t))},Fe="prototype",_e="script",De=Me("IE_PROTO"),Ne=function(){},Ge=function(t){return"<"+_e+">"+t+"</"+_e+">"},We=function(t){t.write(Ge("")),t.close();var e=t.parentWindow.Object;return t=null,e},Ve=function(){try{xt=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;Ve="undefined"!=typeof document?document.domain&&xt?We(xt):(e=Ut("iframe"),n="java"+_e+":",e.style.display="none",Le.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(Ge("document.F=Object")),t.close(),t.F):We(xt);for(var r=Te.length;r--;)delete Ve[Fe][Te[r]];return Ve()};xe[De]=!0;var Be=Object.create||function(t,e){var n;return null!==t?(Ne[Fe]=Nt(t),n=new Ne,Ne[Fe]=null,n[De]=t):n=Ve(),void 0===e?n:Ie.f(n,e)},Ue=he.f,qe=Lt("unscopables"),He=Array.prototype;void 0===He[qe]&&Ue(He,qe,{configurable:!0,value:Be(null)});var Xe,Ke,Ye,$e=function(t){He[qe][t]=!0},Je={},Qe=it.WeakMap,Ze=Mt(Qe)&&/native code/.test(String(Qe)),tn=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},en=Gt?function(t,e,n){return he.f(t,e,tn(1,n))}:function(t,e,n){return t[e]=n,t},nn="Object already initialized",rn=it.TypeError,on=it.WeakMap;if(Ze||at.state){var un=at.state||(at.state=new on);un.get=un.get,un.has=un.has,un.set=un.set,Xe=function(t,e){if(un.has(t))throw new rn(nn);return e.facade=t,un.set(t,e),e},Ke=function(t){return un.get(t)||{}},Ye=function(t){return un.has(t)}}else{var cn=Me("state");xe[cn]=!0,Xe=function(t,e){if(pt(t,cn))throw new rn(nn);return e.facade=t,en(t,cn,e),e},Ke=function(t){return pt(t,cn)?t[cn]:{}},Ye=function(t){return pt(t,cn)}}var an={set:Xe,get:Ke,has:Ye,enforce:function(t){return Ye(t)?Ke(t):Xe(t,{})},getterFor:function(t){return function(e){var n;if(!Ft(e)||(n=Ke(e)).type!==t)throw new rn("Incompatible receiver, "+t+" required");return n}}},fn={}.propertyIsEnumerable,sn=Object.getOwnPropertyDescriptor,ln={f:sn&&!fn.call({1:2},1)?function(t){var e=sn(this,t);return!!e&&e.enumerable}:fn},vn=Object.getOwnPropertyDescriptor,pn={f:Gt?vn:function(t,e){if(t=rt(t),e=ce(e),qt)try{return vn(t,e)}catch(t){}if(pt(t,e))return tn(!Xt(ln.f,t,e),t[e])}},hn=Function.prototype,yn=Gt&&Object.getOwnPropertyDescriptor,dn=pt(hn,"name"),gn={EXISTS:dn,PROPER:dn&&"something"===function(){}.name,CONFIGURABLE:dn&&(!Gt||Gt&&yn(hn,"name").configurable)},bn=X(Function.toString);Mt(at.inspectSource)||(at.inspectSource=function(t){return bn(t)});var mn,wn,On,Sn=at.inspectSource,jn=S((function(t){var e=gn.CONFIGURABLE,n=an.enforce,r=an.get,o=String,i=Object.defineProperty,u=X("".slice),c=X("".replace),a=X([].join),f=Gt&&!V((function(){return 8!==i((function(){}),"length",{value:8}).length})),s=String(String).split("String"),l=t.exports=function(t,r,l){"Symbol("===u(o(r),0,7)&&(r="["+c(o(r),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),l&&l.getter&&(r="get "+r),l&&l.setter&&(r="set "+r),(!pt(t,"name")||e&&t.name!==r)&&(Gt?i(t,"name",{value:r,configurable:!0}):t.name=r),f&&l&&pt(l,"arity")&&t.length!==l.arity&&i(t,"length",{value:l.arity});try{l&&pt(l,"constructor")&&l.constructor?Gt&&i(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var v=n(t);return pt(v,"source")||(v.source=a(s,"string"==typeof r?r:"")),t};Function.prototype.toString=l((function(){return Mt(this)&&r(this).source||Sn(this)}),"toString")})),En=function(t,e,n,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:e;if(Mt(n)&&jn(n,i,r),r.global)o?t[e]=n:ct(e,n);else{try{r.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=n:he.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},xn=Te.concat("length","prototype"),An={f:Object.getOwnPropertyNames||function(t){return Re(t,xn)}},Pn={f:Object.getOwnPropertySymbols},Rn=X([].concat),Tn=Kt("Reflect","ownKeys")||function(t){var e=An.f(Nt(t)),n=Pn.f;return n?Rn(e,n(t)):e},kn=function(t,e,n){for(var r=Tn(e),o=he.f,i=pn.f,u=0;u<r.length;u++){var c=r[u];pt(t,c)||n&&pt(n,c)||o(t,c,i(e,c))}},zn=/#|\.prototype\./,In=function(t,e){var n=Cn[Ln(t)];return n===Fn||n!==Mn&&(Mt(e)?V(e):!!e)},Ln=In.normalize=function(t){return String(t).replace(zn,".").toLowerCase()},Cn=In.data={},Mn=In.NATIVE="N",Fn=In.POLYFILL="P",_n=In,Dn=pn.f,Nn=function(t,e){var n,r,o,i,u,c=t.target,a=t.global,f=t.stat;if(n=a?it:f?it[c]||ct(c,{}):it[c]&&it[c].prototype)for(r in e){if(i=e[r],o=t.dontCallGetSet?(u=Dn(n,r))&&u.value:n[r],!_n(a?r:c+(f?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;kn(i,o)}(t.sham||o&&o.sham)&&en(i,"sham",!0),En(n,r,i,t)}},Gn=!V((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Wn=Me("IE_PROTO"),Vn=Object,Bn=Vn.prototype,Un=Gn?Vn.getPrototypeOf:function(t){var e=lt(t);if(pt(e,Wn))return e[Wn];var n=e.constructor;return Mt(n)&&e instanceof n?n.prototype:e instanceof Vn?Bn:null},qn=Lt("iterator"),Hn=!1;[].keys&&("next"in(On=[].keys())?(wn=Un(Un(On)))!==Object.prototype&&(mn=wn):Hn=!0);var Xn=!Ft(mn)||V((function(){var t={};return mn[qn].call(t)!==t}));Xn&&(mn={}),Mt(mn[qn])||En(mn,qn,(function(){return this}));var Kn={IteratorPrototype:mn,BUGGY_SAFARI_ITERATORS:Hn},Yn=he.f,$n=Lt("toStringTag"),Jn=function(t,e,n){t&&!n&&(t=t.prototype),t&&!pt(t,$n)&&Yn(t,$n,{configurable:!0,value:e})},Qn=Kn.IteratorPrototype,Zn=function(){return this},tr=String,er=TypeError,nr=function(t){if(function(t){return Ft(t)||null===t}(t))return t;throw new er("Can't set "+tr(t)+" as a prototype")},rr=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=function(t,e,n){try{return X(ee(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return nt(n),nr(r),Ft(n)?(e?t(n,r):n.__proto__=r,n):n}}():void 0),or=gn.PROPER,ir=gn.CONFIGURABLE,ur=Kn.IteratorPrototype,cr=Kn.BUGGY_SAFARI_ITERATORS,ar=Lt("iterator"),fr="keys",sr="values",lr="entries",vr=function(){return this},pr=function(t,e,n,r,o,i,u){!function(t,e,n,r){var o=e+" Iterator";t.prototype=Be(Qn,{next:tn(+!r,n)}),Jn(t,o,!1),Je[o]=Zn}(n,e,r);var c,a,f,s=function(t){if(t===o&&y)return y;if(!cr&&t&&t in p)return p[t];switch(t){case fr:case sr:case lr:return function(){return new n(this,t)}}return function(){return new n(this)}},l=e+" Iterator",v=!1,p=t.prototype,h=p[ar]||p["@@iterator"]||o&&p[o],y=!cr&&h||s(o),d="Array"===e&&p.entries||h;if(d&&(c=Un(d.call(new t)))!==Object.prototype&&c.next&&(Un(c)!==ur&&(rr?rr(c,ur):Mt(c[ar])||En(c,ar,vr)),Jn(c,l,!0)),or&&o===sr&&h&&h.name!==sr&&(ir?en(p,"name",sr):(v=!0,y=function(){return Xt(h,this)})),o)if(a={values:s(sr),keys:i?y:s(fr),entries:s(lr)},u)for(f in a)(cr||v||!(f in p))&&En(p,f,a[f]);else Nn({target:e,proto:!0,forced:cr||v},a);return p[ar]!==y&&En(p,ar,y,{name:o}),Je[e]=y,a},hr=function(t,e){return{value:t,done:e}},yr=he.f,dr="Array Iterator",gr=an.set,br=an.getterFor(dr),mr=pr(Array,"Array",(function(t,e){gr(this,{type:dr,target:rt(t),index:0,kind:e})}),(function(){var t=br(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=null,hr(void 0,!0);switch(t.kind){case"keys":return hr(n,!1);case"values":return hr(e[n],!1)}return hr([n,e[n]],!1)}),"values"),wr=Je.Arguments=Je.Array;if($e("keys"),$e("values"),$e("entries"),Gt&&"values"!==wr.name)try{yr(wr,"name",{value:"values"})}catch(t){}var Or={};Or[Lt("toStringTag")]="z";var Sr="[object z]"===String(Or),jr=Lt("toStringTag"),Er=Object,xr="Arguments"===$(function(){return arguments}()),Ar=Sr?$:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Er(t),jr))?n:xr?$(e):"Object"===(r=$(e))&&Mt(e.callee)?"Arguments":r},Pr=Sr?{}.toString:function(){return"[object "+Ar(this)+"]"};Sr||En(Object.prototype,"toString",Pr,{unsafe:!0});var Rr=String,Tr=function(t){if("Symbol"===Ar(t))throw new TypeError("Cannot convert a Symbol value to a string");return Rr(t)},kr=function(){var t=Nt(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},zr=RegExp.prototype,Ir=gn.PROPER,Lr="toString",Cr=RegExp.prototype,Mr=Cr[Lr],Fr=V((function(){return"/a/b"!==Mr.call({source:"a",flags:"b"})})),_r=Ir&&Mr.name!==Lr;(Fr||_r)&&En(Cr,Lr,(function(){var t=Nt(this),e=Tr(t.source),n=Tr(function(t){var e=t.flags;return void 0!==e||"flags"in zr||pt(t,"flags")||!Yt(zr,t)?e:Xt(kr,t)}(t));return"/"+e+"/"+n}),{unsafe:!0});var Dr=X([].slice),Nr=An.f,Gr="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Wr={f:function(t){return Gr&&"Window"===$(t)?function(t){try{return Nr(t)}catch(t){return Dr(Gr)}}(t):Nr(rt(t))}},Vr=V((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Br=Object.isExtensible,Ur=V((function(){Br(1)}))||Vr?function(t){return!!Ft(t)&&((!Vr||"ArrayBuffer"!==$(t))&&(!Br||Br(t)))}:Br,qr=!V((function(){return Object.isExtensible(Object.preventExtensions({}))})),Hr=S((function(t){var e=he.f,n=!1,r=gt("meta"),o=0,i=function(t){e(t,r,{value:{objectID:"O"+o++,weakData:{}}})},u=t.exports={enable:function(){u.enable=function(){},n=!0;var t=An.f,e=X([].splice),o={};o[r]=1,t(o).length&&(An.f=function(n){for(var o=t(n),i=0,u=o.length;i<u;i++)if(o[i]===r){e(o,i,1);break}return o},Nn({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Wr.f}))},fastKey:function(t,e){if(!Ft(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!pt(t,r)){if(!Ur(t))return"F";if(!e)return"E";i(t)}return t[r].objectID},getWeakData:function(t,e){if(!pt(t,r)){if(!Ur(t))return!0;if(!e)return!1;i(t)}return t[r].weakData},onFreeze:function(t){return qr&&n&&Ur(t)&&!pt(t,r)&&i(t),t}};xe[r]=!0})),Xr=function(t){if("Function"===$(t))return X(t)},Kr=Xr(Xr.bind),Yr=function(t,e){return ee(t),void 0===e?t:B?Kr(t,e):function(){return t.apply(e,arguments)}},$r=Lt("iterator"),Jr=Array.prototype,Qr=Lt("iterator"),Zr=function(t){if(!tt(t))return ne(t,Qr)||ne(t,"@@iterator")||Je[Ar(t)]},to=TypeError,eo=function(t,e,n){var r,o;Nt(t);try{if(!(r=ne(t,"return"))){if("throw"===e)throw n;return n}r=Xt(r,t)}catch(t){o=!0,r=t}if("throw"===e)throw n;if(o)throw r;return Nt(r),n},no=TypeError,ro=function(t,e){this.stopped=t,this.result=e},oo=ro.prototype,io=function(t,e,n){var r,o,i,u,c,a,f,s,l=n&&n.that,v=!(!n||!n.AS_ENTRIES),p=!(!n||!n.IS_RECORD),h=!(!n||!n.IS_ITERATOR),y=!(!n||!n.INTERRUPTED),d=Yr(e,l),g=function(t){return r&&eo(r,"normal",t),new ro(!0,t)},b=function(t){return v?(Nt(t),y?d(t[0],t[1],g):d(t[0],t[1])):y?d(t,g):d(t)};if(p)r=t.iterator;else if(h)r=t;else{if(!(o=Zr(t)))throw new no(Zt(t)+" is not iterable");if(void 0!==(s=o)&&(Je.Array===s||Jr[$r]===s)){for(i=0,u=Se(t);u>i;i++)if((c=b(t[i]))&&Yt(oo,c))return c;return new ro(!1)}r=function(t,e){var n=arguments.length<2?Zr(t):e;if(ee(n))return Nt(Xt(n,t));throw new to(Zt(t)+" is not iterable")}(t,o)}for(a=p?t.next:r.next;!(f=Xt(a,r)).done;){try{c=b(f.value)}catch(t){eo(r,"throw",t)}if("object"==typeof c&&c&&Yt(oo,c))return c}return new ro(!1)},uo=TypeError,co=function(t,e){if(Yt(e,t))return t;throw new uo("Incorrect invocation")},ao=Lt("iterator"),fo=!1;try{var so=0,lo={next:function(){return{done:!!so++}},return:function(){fo=!0}};lo[ao]=function(){return this},Array.from(lo,(function(){throw 2}))}catch(t){}var vo=function(t,e,n){var r=-1!==t.indexOf("Map"),o=-1!==t.indexOf("Weak"),i=r?"set":"add",u=it[t],c=u&&u.prototype,a=u,f={},s=function(t){var e=X(c[t]);En(c,t,"add"===t?function(t){return e(this,0===t?0:t),this}:"delete"===t?function(t){return!(o&&!Ft(t))&&e(this,0===t?0:t)}:"get"===t?function(t){return o&&!Ft(t)?void 0:e(this,0===t?0:t)}:"has"===t?function(t){return!(o&&!Ft(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})};if(_n(t,!Mt(u)||!(o||c.forEach&&!V((function(){(new u).entries().next()})))))a=n.getConstructor(e,t,r,i),Hr.enable();else if(_n(t,!0)){var l=new a,v=l[i](o?{}:-0,1)!==l,p=V((function(){l.has(1)})),h=function(t,e){try{if(!e&&!fo)return!1}catch(t){return!1}var n=!1;try{var r={};r[ao]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){new u(t)})),y=!o&&V((function(){for(var t=new u,e=5;e--;)t[i](e,e);return!t.has(-0)}));h||((a=e((function(t,e){co(t,c);var n=function(t,e,n){var r,o;return rr&&Mt(r=e.constructor)&&r!==n&&Ft(o=r.prototype)&&o!==n.prototype&&rr(t,o),t}(new u,t,a);return tt(e)||io(e,n[i],{that:n,AS_ENTRIES:r}),n}))).prototype=c,c.constructor=a),(p||y)&&(s("delete"),s("has"),r&&s("get")),(y||v)&&s(i),o&&c.clear&&delete c.clear}return f[t]=a,Nn({global:!0,constructor:!0,forced:a!==u},f),Jn(a,t),o||n.setStrong(a,t,r),a},po=function(t,e,n){return n.get&&jn(n.get,e,{getter:!0}),n.set&&jn(n.set,e,{setter:!0}),he.f(t,e,n)},ho=function(t,e,n){for(var r in e)En(t,r,e[r],n);return t},yo=Lt("species"),go=Hr.fastKey,bo=an.set,mo=an.getterFor,wo={getConstructor:function(t,e,n,r){var o=t((function(t,o){co(t,i),bo(t,{type:e,index:Be(null),first:null,last:null,size:0}),Gt||(t.size=0),tt(o)||io(o,t[r],{that:t,AS_ENTRIES:n})})),i=o.prototype,u=mo(e),c=function(t,e,n){var r,o,i=u(t),c=a(t,e);return c?c.value=n:(i.last=c={index:o=go(e,!0),key:e,value:n,previous:r=i.last,next:null,removed:!1},i.first||(i.first=c),r&&(r.next=c),Gt?i.size++:t.size++,"F"!==o&&(i.index[o]=c)),t},a=function(t,e){var n,r=u(t),o=go(e);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key===e)return n};return ho(i,{clear:function(){for(var t=u(this),e=t.first;e;)e.removed=!0,e.previous&&(e.previous=e.previous.next=null),e=e.next;t.first=t.last=null,t.index=Be(null),Gt?t.size=0:this.size=0},delete:function(t){var e=this,n=u(e),r=a(e,t);if(r){var o=r.next,i=r.previous;delete n.index[r.index],r.removed=!0,i&&(i.next=o),o&&(o.previous=i),n.first===r&&(n.first=o),n.last===r&&(n.last=i),Gt?n.size--:e.size--}return!!r},forEach:function(t){for(var e,n=u(this),r=Yr(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!a(this,t)}}),ho(i,n?{get:function(t){var e=a(this,t);return e&&e.value},set:function(t,e){return c(this,0===t?0:t,e)}}:{add:function(t){return c(this,t=0===t?0:t,t)}}),Gt&&po(i,"size",{configurable:!0,get:function(){return u(this).size}}),o},setStrong:function(t,e,n){var r=e+" Iterator",o=mo(e),i=mo(r);pr(t,e,(function(t,e){bo(this,{type:r,target:t,state:o(t),kind:e,last:null})}),(function(){for(var t=i(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?hr("keys"===e?n.key:"values"===e?n.value:[n.key,n.value],!1):(t.target=null,hr(void 0,!0))}),n?"entries":"values",!n,!0),function(t){var e=Kt(t);Gt&&e&&!e[yo]&&po(e,yo,{configurable:!0,get:function(){return this}})}(e)}};vo("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),wo);var Oo=X("".charAt),So=X("".charCodeAt),jo=X("".slice),Eo=function(t){return function(e,n){var r,o,i=Tr(nt(e)),u=be(n),c=i.length;return u<0||u>=c?t?"":void 0:(r=So(i,u))<55296||r>56319||u+1===c||(o=So(i,u+1))<56320||o>57343?t?Oo(i,u):r:t?jo(i,u,u+2):o-56320+(r-55296<<10)+65536}},xo={codeAt:Eo(!1),charAt:Eo(!0)}.charAt,Ao="String Iterator",Po=an.set,Ro=an.getterFor(Ao);pr(String,"String",(function(t){Po(this,{type:Ao,string:Tr(t),index:0})}),(function(){var t,e=Ro(this),n=e.string,r=e.index;return r>=n.length?hr(void 0,!0):(t=xo(n,r),e.index+=t.length,hr(t,!1))}));var To=Array.isArray||function(t){return"Array"===$(t)},ko=function(){},zo=Kt("Reflect","construct"),Io=/^\s*(?:class|function)\b/,Lo=X(Io.exec),Co=!Io.test(ko),Mo=function(t){if(!Mt(t))return!1;try{return zo(ko,[],t),!0}catch(t){return!1}},Fo=function(t){if(!Mt(t))return!1;switch(Ar(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Co||!!Lo(Io,Sn(t))}catch(t){return!0}};Fo.sham=!0;var _o=!zo||V((function(){var t;return Mo(Mo.call)||!Mo(Object)||!Mo((function(){t=!0}))||t}))?Fo:Mo,Do=Lt("species"),No=Array,Go=function(t,e){return new(function(t){var e;return To(t)&&(e=t.constructor,(_o(e)&&(e===No||To(e.prototype))||Ft(e)&&null===(e=e[Do]))&&(e=void 0)),void 0===e?No:e}(t))(0===e?0:e)},Wo=X([].push),Vo=function(t){var e=1===t,n=2===t,r=3===t,o=4===t,i=6===t,u=7===t,c=5===t||i;return function(a,f,s,l){for(var v,p,h=lt(a),y=Z(h),d=Se(y),g=Yr(f,s),b=0,m=l||Go,w=e?m(a,d):n||u?m(a,0):void 0;d>b;b++)if((c||b in y)&&(p=g(v=y[b],b,h),t))if(e)w[b]=p;else if(p)switch(t){case 3:return!0;case 5:return v;case 6:return b;case 2:Wo(w,v)}else switch(t){case 4:return!1;case 7:Wo(w,v)}return i?-1:r||o?o:w}},Bo={forEach:Vo(0),map:Vo(1),filter:Vo(2),some:Vo(3),every:Vo(4),find:Vo(5),findIndex:Vo(6),filterReject:Vo(7)},Uo=Hr.getWeakData,qo=an.set,Ho=an.getterFor,Xo=Bo.find,Ko=Bo.findIndex,Yo=X([].splice),$o=0,Jo=function(t){return t.frozen||(t.frozen=new Qo)},Qo=function(){this.entries=[]},Zo=function(t,e){return Xo(t.entries,(function(t){return t[0]===e}))};Qo.prototype={get:function(t){var e=Zo(this,t);if(e)return e[1]},has:function(t){return!!Zo(this,t)},set:function(t,e){var n=Zo(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=Ko(this.entries,(function(e){return e[0]===t}));return~e&&Yo(this.entries,e,1),!!~e}};var ti,ei={getConstructor:function(t,e,n,r){var o=t((function(t,o){co(t,i),qo(t,{type:e,id:$o++,frozen:null}),tt(o)||io(o,t[r],{that:t,AS_ENTRIES:n})})),i=o.prototype,u=Ho(e),c=function(t,e,n){var r=u(t),o=Uo(Nt(e),!0);return!0===o?Jo(r).set(e,n):o[r.id]=n,t};return ho(i,{delete:function(t){var e=u(this);if(!Ft(t))return!1;var n=Uo(t);return!0===n?Jo(e).delete(t):n&&pt(n,e.id)&&delete n[e.id]},has:function(t){var e=u(this);if(!Ft(t))return!1;var n=Uo(t);return!0===n?Jo(e).has(t):n&&pt(n,e.id)}}),ho(i,n?{get:function(t){var e=u(this);if(Ft(t)){var n=Uo(t);if(!0===n)return Jo(e).get(t);if(n)return n[e.id]}},set:function(t,e){return c(this,t,e)}}:{add:function(t){return c(this,t,!0)}}),o}},ni=an.enforce,ri=Object,oi=Array.isArray,ii=ri.isExtensible,ui=ri.isFrozen,ci=ri.isSealed,ai=ri.freeze,fi=ri.seal,si=!it.ActiveXObject&&"ActiveXObject"in it,li=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},vi=vo("WeakMap",li,ei),pi=vi.prototype,hi=X(pi.set);if(Ze)if(si){ti=ei.getConstructor(li,"WeakMap",!0),Hr.enable();var yi=X(pi.delete),di=X(pi.has),gi=X(pi.get);ho(pi,{delete:function(t){if(Ft(t)&&!ii(t)){var e=ni(this);return e.frozen||(e.frozen=new ti),yi(this,t)||e.frozen.delete(t)}return yi(this,t)},has:function(t){if(Ft(t)&&!ii(t)){var e=ni(this);return e.frozen||(e.frozen=new ti),di(this,t)||e.frozen.has(t)}return di(this,t)},get:function(t){if(Ft(t)&&!ii(t)){var e=ni(this);return e.frozen||(e.frozen=new ti),di(this,t)?gi(this,t):e.frozen.get(t)}return gi(this,t)},set:function(t,e){if(Ft(t)&&!ii(t)){var n=ni(this);n.frozen||(n.frozen=new ti),di(this,t)?hi(this,t,e):n.frozen.set(t,e)}else hi(this,t,e);return this}})}else qr&&V((function(){var t=ai([]);return hi(new vi,t,1),!ui(t)}))&&ho(pi,{set:function(t,e){var n;return oi(t)&&(ui(t)?n=ai:ci(t)&&(n=fi)),hi(this,t,e),n&&n(t),this}});var bi,mi,wi={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Oi=Ut("span").classList,Si=Oi&&Oi.constructor&&Oi.constructor.prototype,ji=Si===Object.prototype?void 0:Si,Ei=Bo.forEach,xi=!!(mi=[]["forEach"])&&V((function(){mi.call(null,bi||function(){return 1},1)}))?[].forEach:function(t){return Ei(this,t,arguments.length>1?arguments[1]:void 0)},Ai=function(t){if(t&&t.forEach!==xi)try{en(t,"forEach",xi)}catch(e){t.forEach=xi}};for(var Pi in wi)wi[Pi]&&Ai(it[Pi]&&it[Pi].prototype);Ai(ji);var Ri=Lt("iterator"),Ti=mr.values,ki=function(t,e){if(t){if(t[Ri]!==Ti)try{en(t,Ri,Ti)}catch(e){t[Ri]=Ti}if(Jn(t,e,!0),wi[e])for(var n in mr)if(t[n]!==mr[n])try{en(t,n,mr[n])}catch(e){t[n]=mr[n]}}};for(var zi in wi)ki(it[zi]&&it[zi].prototype,zi);function Ii(){var t=b();return s.isCursorEditor(t)||console.warn("Cannot use useSyncExternalStore outside the context of a RemoteCursorEditor"),t}ki(ji,"DOMTokenList");var Li=new WeakMap;function Ci(t){var e=Li.get(t);if(e)return e;var n=function(t){var e={},n=new Set,r=n.add.bind(n),o=new Set,i=null;return[function(e){return o.add(e),i||(i=function(t){t.added.forEach(r),t.removed.forEach(r),t.updated.forEach(r),o.forEach((function(t){return t()}))},s.on(t,"change",i)),function(){o.delete(e),i&&0===o.size&&(s.off(t,"change",i),i=null)}},function(){return 0===n.size?e:(n.forEach((function(n){var r=s.cursorState(t,n);null!==r?e[n]=r:delete e[n.toString()]})),n.clear(),e=m({},e))}]}(t);return t&&Li.set(t,n),n}function Mi(){return Ci(Ii())}function Fi(){var t=w(Mi(),2),e=t[0],n=t[1];return z.useSyncExternalStore(e,n)}function _i(t,e){var n=w(Mi(),2),r=n[0],o=n[1];return W.useSyncExternalStoreWithSelector(r,o,null,t,e)}var Di=new WeakMap;function Ni(t,e){if(!e.relativeSelection)return null;var n=Di.get(t.children);n||(n=new WeakMap,Di.set(t.children,n));var r=n.get(e);if(void 0===r)try{r=l(t.sharedRoot,t,e.relativeSelection),n.set(e,r)}catch(t){return null}return r}var Gi=Lt("species"),Wi=Bo.map,Vi=function(t){return At>=51||!V((function(){var e=[];return(e.constructor={})[Gi]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}("map");Nn({target:"Array",proto:!0,forced:!Vi},{map:function(t){return Wi(this,t,arguments.length>1?arguments[1]:void 0)}});var Bi=X(ln.f),Ui=X([].push),qi=Gt&&V((function(){var t=Object.create(null);return t[2]=2,!Bi(t,2)})),Hi=function(t){return function(e){for(var n,r=rt(e),o=ke(r),i=qi&&null===Un(r),u=o.length,c=0,a=[];u>c;)n=o[c++],Gt&&!(i?n in r:Bi(r,n))||Ui(a,t?[n,r[n]]:r[n]);return a}},Xi={entries:Hi(!0),values:Hi(!1)}.entries;Nn({target:"Object",stat:!0},{entries:function(t){return Xi(t)}});var Ki=Hr.onFreeze,Yi=Object.freeze,$i=V((function(){Yi(1)}));Nn({target:"Object",stat:!0,forced:$i,sham:!qr},{freeze:function(t){return Yi&&Ft(t)?Yi(Ki(t)):t}});Nn({target:"Object",stat:!0},{fromEntries:function(t){var e={};return io(t,(function(t,n){var r,o,i;r=e,o=t,i=n,Gt?he.f(r,o,tn(0,i)):r[o]=i}),{AS_ENTRIES:!0}),e}});var Ji=V((function(){ke(1)}));function Qi(t,e,n){var r,o,i=n.yOffset,u=n.xOffset,c=n.shouldGenerateOverlay,a=w(v.edges(e),2),f=a[0],s=a[1],l=function(t,e){try{return d.toDOMRange(t,e)}catch(t){return null}}(t,e);if(!l)return{caretPosition:null,selectionRects:[]};var g=[],b=p.nodes(t,{at:e,match:function(t,e){return h.isText(t)&&(!c||c(t,e))}}),m=null,O=v.isBackward(e);try{for(var S=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(b),j=S.next();!j.done;j=S.next()){var E=w(j.value,2),x=E[0],A=E[1],P=d.toDOMNode(t,x),R=y.equals(A,f.path),T=y.equals(A,s.path),k=null;if(R||T){var z=document.createRange();z.selectNode(P),R&&z.setStart(l.startContainer,l.startOffset),T&&z.setEnd(l.endContainer,l.endOffset),k=z.getClientRects()}else k=P.getClientRects();for(var I=O?R:T,L=0;L<k.length;L++){var C=k.item(L);if(C){var M=I&&(O?0===L:L===k.length-1),F=C.top-i,_=C.left-u;M&&(m={height:C.height,top:F,left:_+(O||v.isCollapsed(e)?0:C.width)}),g.push({width:C.width,height:C.height,top:F,left:_})}}}}catch(t){r={error:t}}finally{try{j&&!j.done&&(o=S.return)&&o.call(S)}finally{if(r)throw r.error}}return{selectionRects:g,caretPosition:m}}Nn({target:"Object",stat:!0,forced:Ji},{keys:function(t){return ke(lt(t))}});var Zi=Object.freeze([]);function tu(t){var e;void 0===t&&(t={});var n,s,l,v=t.containerRef,p=t.shouldGenerateOverlay,h=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["containerRef","shouldGenerateOverlay"]),y=Ii(),d=Fi(),g=(n=w(r((function(t){return t+1}),0),2)[1],s=o(null),i(l=function(){s.current&&(cancelAnimationFrame(s.current),s.current=0)}),i((function(){return l}),[]),u((function(t){void 0===t&&(t=!1),t?n():s.current||(s.current=requestAnimationFrame(n))}),[])),b=o(new WeakMap),O=w(c({}),2),S=O[0],j=O[1],E=!("refreshOnResize"in h)||(null===(e=h.refreshOnResize)||void 0===e||e);!function(t,e){var n=o(e);n.current=e;var r=w(c((function(){return new ResizeObserver((function(){n.current()}))})),1)[0];i((function(){if(null==t?void 0:t.current){var e=t.current;return r.observe(e),function(){return r.unobserve(e)}}}),[r,t])}(E?v:void 0,(function(){b.current=new WeakMap,g("debounced"!==E)})),a((function(){var t,e,n;if(!v||v.current){var r=null===(t=null==v?void 0:v.current)||void 0===t?void 0:t.getBoundingClientRect(),o=null!==(e=null==r?void 0:r.x)&&void 0!==e?e:0,i=null!==(n=null==r?void 0:r.y)&&void 0!==n?n:0,u=Object.keys(S).length!==Object.keys(d).length,c=Object.fromEntries(Object.entries(d).map((function(t){var e=w(t,2),n=e[0],r=e[1],c=r.relativeSelection&&Ni(y,r);if(!c)return[n,Zi];var a=b.current.get(c);if(a)return[n,a];var f=Qi(y,c,{xOffset:o,yOffset:i,shouldGenerateOverlay:p});return u=!0,b.current.set(c,f),[n,f]})));u&&j(c)}}));var x=f((function(){return Object.entries(d).map((function(t){var e,n,r=w(t,2),o=r[0],i=r[1],u=i.relativeSelection&&Ni(y,i),c=S[o];return m(m({},i),{range:u,caretPosition:null!==(e=null==c?void 0:c.caretPosition)&&void 0!==e?e:null,selectionRects:null!==(n=null==c?void 0:c.selectionRects)&&void 0!==n?n:Zi})}))}),[d,y,S]);return[x,u((function(){b.current=new WeakMap,g(!0)}),[g])]}export{g as EditorContext,Ni as getCursorRange,b as useEditorStatic,tu as useRemoteCursorOverlayPositions,Fi as useRemoteCursorStates,_i as useRemoteCursorStatesSelector};
40
40
  //# sourceMappingURL=index.esm.js.map