var xR=Object.defineProperty;var AR=(e,t,n)=>t in e?xR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qt=(e,t,n)=>(AR(e,typeof t!="symbol"?t+"":t,n),n);import{h as Wn,y as Dr,r as Cr,j as fo,F as Hu,B as Ul,p as z,M as ge,N as ne,q as te,o as We,l as pe,V as Ze,a4 as we,a2 as js,k as W,T as $t,U as xr,ae as A3,$ as md,n as gl,t as de,W as Do,a6 as hn,a7 as Ou,A as OR,Z as _R,i as O3,af as gw,I as L_,H as kR,_ as TR,ag as Qn,m as j_,am as FR,aj as M_,an as Bv,ao as bo,ap as z_,a0 as BR,ad as PR,aq as IR,ar as V_,J as NR,ac as RR,O as LR,as as jR,at as MR,au as zR}from"./vue-a39e6937.js";import{o as VR,R as SS,T as HR,U as UR,V as WR,_ as Ro,g as el,W as zf,X as qR,d as H_,Y as yi,Z as vw,f as _3,z as Vf,$ as ug,a0 as GR,a1 as KR,a2 as Dm,x as YR,a3 as DS,j as XR,a4 as JR,a5 as ZR,a6 as QR}from"./index-ba596ae9.js";import{r as eL}from"./controllerUrls-941681c3.js";import{p as tL}from"./index-7e56a0fa.js";const nL={class:"icon-selector-box"},rL={class:"selector-header"},oL={class:"selector-title"},iL={class:"selector-tab"},aL=["title"],uL=["title"],sL=["title"],lL=["title"],cL={class:"selector-body"},fL={key:0},dL=["title","onClick"],pL={class:"icon-prepend"},hL={key:0,class:"name"},gL=Wn({__name:"iconSelector",props:{size:{default:"default"},disabled:{type:Boolean,default:!1},title:{default:""},type:{default:"ele"},placement:{default:"bottom"},modelValue:{default:""},showIconName:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=Dr(),o=Dr(),i=Cr({iconType:n.type,selectorWidth:0,popoverVisible:!1,inputFocus:!1,iconSelectorMouseover:!1,fontIconNames:[],inputValue:"",prependIcon:n.modelValue,defaultModelValue:n.modelValue||"el-icon-Minus",iconKey:0}),a=()=>{i.inputFocus=i.popoverVisible=!0},u=()=>{i.inputFocus=!1,i.popoverVisible=i.iconSelectorMouseover},s=()=>{i.iconKey++,i.prependIcon=i.defaultModelValue,i.inputValue="",t("update:modelValue",i.defaultModelValue),t("change",i.defaultModelValue)},l=g=>{i.iconType=g,i.fontIconNames=[],g=="ele"?SS().then(v=>{i.fontIconNames=v}):g=="awe"?HR().then(v=>{i.fontIconNames=v.map(h=>`fa ${h}`)}):g=="ali"?UR().then(v=>{i.fontIconNames=v.map(h=>`iconfont ${h}`)}):g=="local"&&WR().then(v=>{i.fontIconNames=v})},c=g=>{i.iconSelectorMouseover=i.popoverVisible=!1,i.iconKey++,i.prependIcon=g,i.inputValue="",t("update:modelValue",g),t("change",g),gl(()=>{r.value.blur()})},f=fo(()=>{if(!i.inputValue)return i.fontIconNames;let g=i.inputValue.trim().toLowerCase();return i.fontIconNames.filter(v=>{if(v.toLowerCase().indexOf(g)!==-1)return v})}),d=()=>{gl(()=>{i.selectorWidth=r.value.$el.offsetWidth<260?260:r.value.$el.offsetWidth})},p=()=>{i.popoverVisible=!!(i.inputFocus||i.iconSelectorMouseover)};return Hu(()=>n.modelValue,()=>{i.iconKey++,n.modelValue!=i.prependIcon&&(i.defaultModelValue=n.modelValue),n.modelValue==""&&(i.defaultModelValue="el-icon-Minus"),i.prependIcon=n.modelValue}),Ul(()=>{d(),VR(document,"click",p),SS().then(g=>{i.fontIconNames=g})}),(g,v)=>{const h=de("Icon"),y=de("el-scrollbar"),b=de("el-input"),m=de("el-popover");return z(),ge(m,{placement:e.placement,trigger:"focus","hide-after":0,width:i.selectorWidth,visible:i.popoverVisible},{reference:ne(()=>[te(b,{modelValue:i.inputValue,"onUpdate:modelValue":v[6]||(v[6]=$=>i.inputValue=$),size:e.size,disabled:e.disabled,placeholder:g.$t("search")+g.$t("utils.Icon"),ref_key:"selectorInput",ref:r,onFocus:a,onBlur:u,class:js("size-"+e.size)},{prepend:ne(()=>[We("div",pL,[(z(),ge(h,{key:"icon"+i.iconKey,name:i.prependIcon?i.prependIcon:i.defaultModelValue},null,8,["name"])),e.showIconName?(z(),pe("div",hL,Ze(i.prependIcon?i.prependIcon:i.defaultModelValue),1)):we("",!0)])]),append:ne(()=>[te(h,{onClick:s,name:"el-icon-RefreshRight"})]),_:1},8,["modelValue","size","disabled","placeholder","class"])]),default:ne(()=>[We("div",{onMouseover:v[4]||(v[4]=md($=>i.iconSelectorMouseover=!0,["stop"])),onMouseout:v[5]||(v[5]=md($=>i.iconSelectorMouseover=!1,["stop"])),class:"icon-selector"},[te(A3,{name:"el-zoom-in-center"},{default:ne(()=>[We("div",nL,[We("div",rL,[We("div",oL,Ze(e.title?e.title:g.$t("utils.Please select an icon")),1),We("div",iL,[We("span",{title:"Element Puls "+g.$t("utils.Icon"),onClick:v[0]||(v[0]=$=>l("ele")),class:js(i.iconType=="ele"?"active":"")},"ele",10,aL),We("span",{title:"Font Awesome "+g.$t("utils.Icon"),onClick:v[1]||(v[1]=$=>l("awe")),class:js(i.iconType=="awe"?"active":"")},"awe",10,uL),We("span",{title:g.$t("utils.Ali iconcont Icon"),onClick:v[2]||(v[2]=$=>l("ali")),class:js(i.iconType=="ali"?"active":"")},"ali",10,sL),We("span",{title:g.$t("utils.Local icon title"),onClick:v[3]||(v[3]=$=>l("local")),class:js(i.iconType=="local"?"active":"")},"local",10,lL)])]),We("div",cL,[te(y,{ref_key:"selectorScrollbarRef",ref:o},{default:ne(()=>[W(f).length>0?(z(),pe("div",fL,[(z(!0),pe($t,null,xr(W(f),($,E)=>(z(),pe("div",{class:"icon-selector-item",title:$,onClick:S=>c($),key:E},[te(h,{name:$},null,8,["name"])],8,dL))),128))])):we("",!0)]),_:1},512)])])]),_:1})],32)]),_:1},8,["placement","width","visible"])}}});const vL=Ro(gL,[["__scopeId","data-v-72558dee"]]),mL=["string","password","number","radio","checkbox","switch","textarea","array","datetime","year","date","time","select","selects","remoteSelect","editor","city","image","images","file","files","icon","color"],yL=Wn({__name:"array",props:{modelValue:{default:()=>[]}},setup(e){const t=e,n=Cr({value:t.modelValue}),r=()=>{n.value.push({key:"",value:""})},o=i=>{n.value.splice(i,1)};return Hu(()=>t.modelValue,i=>{n.value=i}),(i,a)=>{const u=de("el-col"),s=de("el-row"),l=de("el-input"),c=de("el-button"),f=Ou("blur");return z(),pe("div",null,[te(s,{gutter:10},{default:ne(()=>[te(u,{span:10,class:"ba-array-key"},{default:ne(()=>[Do("键名")]),_:1}),te(u,{span:10,class:"ba-array-value"},{default:ne(()=>[Do("键值")]),_:1})]),_:1}),(z(!0),pe($t,null,xr(n.value,(d,p)=>(z(),ge(s,{class:"ba-array-item",gutter:10,key:p},{default:ne(()=>[te(u,{span:10},{default:ne(()=>[te(l,{modelValue:d.key,"onUpdate:modelValue":g=>d.key=g},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),te(u,{span:10},{default:ne(()=>[te(l,{modelValue:d.value,"onUpdate:modelValue":g=>d.value=g},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),te(u,{span:4},{default:ne(()=>[te(c,{onClick:g=>o(p),size:"small",icon:"el-icon-Delete",circle:""},null,8,["onClick"])]),_:2},1024)]),_:2},1024))),128)),te(s,{gutter:10},{default:ne(()=>[te(u,{span:10,offset:10},{default:ne(()=>[hn((z(),ge(c,{class:"ba-add-array-item",onClick:r,icon:"el-icon-Plus"},{default:ne(()=>[Do("添加")]),_:1})),[[f]])]),_:1})]),_:1})])}}});const bL=Ro(yL,[["__scopeId","data-v-db2a0da1"]]),wL=Wn({__name:"remoteSelect",props:{pk:{default:"id"},field:{default:"name"},params:{default:()=>({})},multiple:{type:Boolean,default:!1},remoteUrl:{default:""},modelValue:{default:""},labelFormatter:null,tooltipParams:{default:()=>({})}},emits:["update:modelValue","row"],setup(e,{expose:t,emit:n}){const r=e,o=Dr(),i=Cr({primaryKey:r.pk,options:[],loading:!1,total:0,currentPage:1,pageSize:10,params:r.params,keyword:"",value:r.modelValue?r.modelValue:"",selectKey:el(),initializeData:!1,accidentBlur:!1});let a=null;const u=OR(),s=m=>{var $;if(n("update:modelValue",m),typeof(($=u==null?void 0:u.vnode.props)==null?void 0:$.onRow)=="function")if(typeof m=="number"||typeof m=="string"){const E=zf(i.options,r.pk,m.toString());n("row",E?gw(i.options[E]):{})}else{const E=[];for(const S in m){let x=zf(i.options,r.pk,m[S].toString());x&&E.push(gw(i.options[x]))}n("row",E)}},l=m=>{m||gl(()=>{var $;($=o.value)==null||$.blur()})},c=()=>{var m;((m=o.value)==null?void 0:m.query)!=i.keyword&&(i.keyword="",i.initializeData=!1,i.accidentBlur=!0),i.initializeData||p()},f=()=>{i.keyword="",i.initializeData=!1},d=m=>{i.keyword=m,p()},p=(m="")=>{i.loading=!0,i.params.page=i.currentPage,i.params.initKey=r.pk,i.params.initValue=m,qR(r.remoteUrl,i.keyword,i.params).then($=>{let E=!0,S=$.data.options?$.data.options:$.data.list;if(typeof r.labelFormatter=="function")for(const x in S)S[x][r.field]=r.labelFormatter(S[x],x);i.options=S,i.total=$.data.total??0,m&&(i.selectKey=el(),E=!1),i.loading=!1,i.initializeData=E,i.accidentBlur&&gl(()=>{var B;const x=(B=o.value)==null?void 0:B.$el.querySelector(".el-select__tags .el-select__input");x&&x.focus(),i.accidentBlur=!1})}).catch(()=>{i.loading=!1})},g=m=>{i.currentPage=m,p()},v=()=>{if(i.value){if(typeof i.value=="object")for(const m in i.value)i.value[m]=i.value[m].toString();else typeof i.value=="number"&&(i.value=i.value.toString());p(i.value)}};return Ul(()=>{if(r.pk.indexOf(".")>0){let m=r.pk.split(".");i.primaryKey=m[1]?m[1]:m[0]}v(),setTimeout(()=>{var m;window!=null&&window.IntersectionObserver&&(a=new IntersectionObserver($=>{var E;for(const S in $)$[S].isIntersecting||(E=o.value)==null||E.blur()}),a.observe((m=o.value)==null?void 0:m.$el))},500)}),_R(()=>{a==null||a.disconnect()}),Hu(()=>r.modelValue,m=>{String(i.value)!=String(m)&&(i.value=m||"",v())}),t({blur:()=>{var m;(m=o.value)==null||m.blur()},focus:()=>{var m;(m=o.value)==null||m.focus()},getSelectRef:()=>o.value}),(m,$)=>{const E=de("el-tooltip"),S=de("el-option"),x=de("el-pagination"),B=de("el-select");return z(),ge(B,{ref_key:"selectRef",ref:o,onFocus:c,class:"remote-select",loading:i.loading||i.accidentBlur,filterable:!0,remote:!0,clearable:"","remote-show-suffix":"","remote-method":d,modelValue:i.value,"onUpdate:modelValue":$[0]||($[0]=I=>i.value=I),onChange:s,multiple:e.multiple,key:i.selectKey,onClear:f,onVisibleChange:l},{default:ne(()=>[(z(!0),pe($t,null,xr(i.options,I=>(z(),ge(S,{class:"remote-select-option",label:I[e.field],value:I[i.primaryKey].toString(),key:I[i.primaryKey]},{default:ne(()=>[W(O3)(e.tooltipParams)?we("",!0):(z(),ge(E,{key:0,placement:"right",effect:"light"},{content:ne(()=>[(z(!0),pe($t,null,xr(e.tooltipParams,(H,G)=>(z(),pe("p",{key:G},Ze(G)+": "+Ze(I[H]),1))),128))]),default:ne(()=>[We("div",null,Ze(I[e.field]),1)]),_:2},1024))]),_:2},1032,["label","value"]))),128)),i.total?(z(),ge(x,{key:0,currentPage:i.currentPage,"page-size":i.pageSize,class:"select-pagination",layout:"->, prev, next",total:i.total,onCurrentChange:g},null,8,["currentPage","page-size","total"])):we("",!0)]),_:1},8,["loading","modelValue","multiple"])}}});const $L=Ro(wL,[["__scopeId","data-v-b0045602"]]);var Cm;if(typeof global>"u"){if("ActiveXObject"in window){var CS="抱歉,wangEditor V5+ 版本开始,不在支持 IE 浏览器";CS+=` Sorry, wangEditor V5+ versions do not support IE browser.`,console.error(CS)}xS(),AS()}else global&&(!((Cm=global.navigator)===null||Cm===void 0)&&Cm.userAgent.match("QQBrowser"))&&(xS(),AS());function xS(){typeof globalThis>"u"&&(window.globalThis=window)}function AS(){typeof AggregateError>"u"&&(window.AggregateError=function(e,t){var n=new Error(t);return n.errors=e,n})}if(typeof global=="object"){var EL=Object.getOwnPropertyDescriptor(global,"window");(!global.window||EL.set)&&(global.window=global,global.requestAnimationFrame=function(){},global.navigator={userAgent:""},global.location={hostname:"0.0.0.0",port:0,protocol:"http:"},global.btoa=function(){},global.crypto={getRandomValues:function(e){return nodeCrypto.randomFillSync(e)}})}/*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */function OS(e){return Object.prototype.toString.call(e)==="[object Object]"}function xn(e){var t,n;return OS(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(OS(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}function gn(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:k3(e)?2:T3(e)?3:0}function mw(e,t){return Wl(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function SL(e,t){return Wl(e)===2?e.get(t):e[t]}function U_(e,t,n){var r=Wl(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function DL(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function k3(e){return OL&&e instanceof Map}function T3(e){return _L&&e instanceof Set}function Xa(e){return e.o||e.t}function F3(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=FL(e);delete t[ir];for(var n=N3(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=CL),Object.freeze(e),t&&yd(e,function(n,r){return B3(r,!0)},!0)),e}function CL(){gn(2)}function P3(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function ti(e){var t=BL[e];return t||gn(18,e),t}function _S(){return vl||gn(0),vl}function xm(e,t){t&&(ti("Patches"),e.u=[],e.s=[],e.v=t)}function Mg(e){yw(e),e.p.forEach(xL),e.p=null}function yw(e){e===vl&&(vl=e.l)}function kS(e){return vl={p:[],l:vl,h:e,m:!0,_:0}}function xL(e){var t=e[ir];t.i===0||t.i===1?t.j():t.O=!0}function Am(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||ti("ES5").S(t,e,r),r?(n[ir].P&&(Mg(t),gn(4)),ku(e)&&(e=zg(t,e),t.l||Vg(t,e)),t.u&&ti("Patches").M(n[ir],e,t.u,t.s)):e=zg(t,n,[]),Mg(t),t.u&&t.v(t.u,t.s),e!==W_?e:void 0}function zg(e,t,n){if(P3(t))return t;var r=t[ir];if(!r)return yd(t,function(i,a){return TS(e,r,t,i,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Vg(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=r.i===4||r.i===5?r.o=F3(r.k):r.o;yd(r.i===3?new Set(o):o,function(i,a){return TS(e,r,o,i,a,n)}),Vg(e,o,!1),n&&e.u&&ti("Patches").R(r,n,e.u,e.s)}return r.o}function TS(e,t,n,r,o,i){if(o===n&&gn(5),_u(o)){var a=zg(e,o,i&&t&&t.i!==3&&!mw(t.D,r)?i.concat(r):void 0);if(U_(n,r,a),!_u(a))return;e.m=!1}if(ku(o)&&!P3(o)){if(!e.h.F&&e._<1)return;zg(e,o),t&&t.A.l||Vg(e,o)}}function Vg(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&B3(t,n)}function Om(e,t){var n=e[ir];return(n?Xa(n):e)[t]}function FS(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function bw(e){e.P||(e.P=!0,e.l&&bw(e.l))}function _m(e){e.o||(e.o=F3(e.t))}function ww(e,t,n){var r=k3(t)?ti("MapSet").N(t,n):T3(t)?ti("MapSet").T(t,n):e.g?function(o,i){var a=Array.isArray(o),u={i:a?1:0,A:i?i.A:_S(),P:!1,I:!1,D:{},l:i,t:o,k:null,o:null,j:null,C:!1},s=u,l=sg;a&&(s=[u],l=lg);var c=Proxy.revocable(s,l),f=c.revoke,d=c.proxy;return u.k=d,u.j=f,d}(t,n):ti("ES5").J(t,n);return(n?n.A:_S()).p.push(r),r}function AL(e){return _u(e)||gn(22,e),function t(n){if(!ku(n))return n;var r,o=n[ir],i=Wl(n);if(o){if(!o.P&&(o.i<4||!ti("ES5").K(o)))return o.t;o.I=!0,r=BS(n,i),o.I=!1}else r=BS(n,i);return yd(r,function(a,u){o&&SL(o.t,a)===u||U_(r,a,t(u))}),i===3?new Set(r):r}(e)}function BS(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return F3(e)}var PS,vl,I3=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",OL=typeof Map<"u",_L=typeof Set<"u",IS=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",W_=I3?Symbol.for("immer-nothing"):((PS={})["immer-nothing"]=!0,PS),NS=I3?Symbol.for("immer-draftable"):"__$immer_draftable",ir=I3?Symbol.for("immer-state"):"__$immer_state",kL={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},TL=""+Object.prototype.constructor,N3=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,FL=Object.getOwnPropertyDescriptors||function(e){var t={};return N3(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},BL={},sg={get:function(e,t){if(t===ir)return e;var n=Xa(e);if(!mw(n,t))return function(o,i,a){var u,s=FS(i,a);return s?"value"in s?s.value:(u=s.get)===null||u===void 0?void 0:u.call(o.k):void 0}(e,n,t);var r=n[t];return e.I||!ku(r)?r:r===Om(e.t,t)?(_m(e),e.o[t]=ww(e.A.h,r,e)):r},has:function(e,t){return t in Xa(e)},ownKeys:function(e){return Reflect.ownKeys(Xa(e))},set:function(e,t,n){var r=FS(Xa(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Om(Xa(e),t),i=o==null?void 0:o[ir];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(DL(n,o)&&(n!==void 0||mw(e.t,t)))return!0;_m(e),bw(e)}return e.o[t]===n&&typeof n!="number"&&(n!==void 0||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return Om(e.t,t)!==void 0||t in e.t?(e.D[t]=!1,_m(e),bw(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Xa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){gn(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){gn(12)}},lg={};yd(sg,function(e,t){lg[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),lg.deleteProperty=function(e,t){return isNaN(parseInt(t))&&gn(13),sg.deleteProperty.call(this,e[0],t)},lg.set=function(e,t,n){return t!=="length"&&isNaN(parseInt(t))&&gn(14),sg.set.call(this,e[0],t,n,e[0])};var PL=function(){function e(n){var r=this;this.g=IS,this.F=!0,this.produce=function(o,i,a){if(typeof o=="function"&&typeof i!="function"){var u=i;i=o;var s=r;return function(p){var g=this;p===void 0&&(p=u);for(var v=arguments.length,h=Array(v>1?v-1:0),y=1;y1?l-1:0),f=1;f=0;o--){var i=r[o];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}o>-1&&(r=r.slice(o+1));var a=ti("Patches").$;return _u(n)?a(n,r):this.produce(n,function(u){return a(u,r)})},e}(),ar=new PL,Pv=ar.produce;ar.produceWithPatches.bind(ar);ar.setAutoFreeze.bind(ar);ar.setUseProxies.bind(ar);ar.applyPatches.bind(ar);var RS=ar.createDraft.bind(ar),LS=ar.finishDraft.bind(ar);function Lo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hg=new WeakMap,bc=new WeakMap,jS=new WeakMap,MS=new WeakMap,zS=new WeakMap,VS=new WeakMap;function HS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ah(e){for(var t=1;t{var e={children:[],operations:[],selection:null,marks:null,isInline:()=>!1,isVoid:()=>!1,onChange:()=>{},apply:t=>{for(var n of D.pathRefs(e))dj.transform(n,t);for(var r of D.pointRefs(e))pj.transform(r,t);for(var o of D.rangeRefs(e))vj.transform(o,t);var i=new Set,a=[],u=p=>{if(p){var g=p.join(",");i.has(g)||(i.add(g),a.push(p))}},s=Hg.get(e)||[],l=NL(t);for(var c of s){var f=P.transform(c,t);u(f)}for(var d of l)u(d);Hg.set(e,a),N.transform(e,t),e.operations.push(t),D.normalize(e),t.type==="set_selection"&&(e.marks=null),bc.get(e)||(bc.set(e,!0),Promise.resolve().then(()=>{bc.set(e,!1),e.onChange(),e.operations=[]}))},addMark:(t,n)=>{var{selection:r}=e;if(r)if(L.isExpanded(r))N.setNodes(e,{[t]:n},{match:oe.isText,split:!0});else{var o=ah(ah({},D.marks(e)||{}),{},{[t]:n});e.marks=o,bc.get(e)||e.onChange()}},deleteBackward:t=>{var{selection:n}=e;n&&L.isCollapsed(n)&&N.delete(e,{unit:t,reverse:!0})},deleteForward:t=>{var{selection:n}=e;n&&L.isCollapsed(n)&&N.delete(e,{unit:t})},deleteFragment:t=>{var{selection:n}=e;n&&L.isExpanded(n)&&N.delete(e,{reverse:t==="backward"})},getFragment:()=>{var{selection:t}=e;return t?X.fragment(e,t):[]},insertBreak:()=>{N.splitNodes(e,{always:!0})},insertFragment:t=>{N.insertFragment(e,t)},insertNode:t=>{N.insertNodes(e,t)},insertText:t=>{var{selection:n,marks:r}=e;if(n){if(r){var o=ah({text:t},r);N.insertNodes(e,o)}else N.insertText(e,t);e.marks=null}},normalizeNode:t=>{var[n,r]=t;if(!oe.isText(n)){if(se.isElement(n)&&n.children.length===0){var o={text:""};N.insertNodes(e,o,{at:r.concat(0),voids:!0});return}for(var i=D.isEditor(n)?!1:se.isElement(n)&&(e.isInline(n)||n.children.length===0||oe.isText(n.children[0])||e.isInline(n.children[0])),a=0,u=0;u{var{selection:n}=e;if(n)if(L.isExpanded(n))N.unsetNodes(e,t,{match:oe.isText,split:!0});else{var r=ah({},D.marks(e)||{});delete r[t],e.marks=r,bc.get(e)||e.onChange()}}};return e},NL=e=>{switch(e.type){case"insert_text":case"remove_text":case"set_node":{var{path:t}=e;return P.levels(t)}case"insert_node":{var{node:n,path:r}=e,o=P.levels(r),i=oe.isText(n)?[]:Array.from(X.nodes(n),I=>{var[,H]=I;return r.concat(H)});return[...o,...i]}case"merge_node":{var{path:a}=e,u=P.ancestors(a),s=P.previous(a);return[...u,s]}case"move_node":{var{path:l,newPath:c}=e;if(P.equals(l,c))return[];var f=[],d=[];for(var p of P.ancestors(l)){var g=P.transform(p,e);f.push(g)}for(var v of P.ancestors(c)){var h=P.transform(v,e);d.push(h)}var y=d[d.length-1],b=c[c.length-1],m=y.concat(b);return[...f,...d,m]}case"remove_node":{var{path:$}=e,E=P.ancestors($);return[...E]}case"split_node":{var{path:S}=e,x=P.levels(S),B=P.next(S);return[...x,B]}default:return[]}};function RL(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function ii(e,t){if(e==null)return{};var n=RL(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var R3=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=!n,o=n?HL(t):t,i=Ae.None,a=Ae.None,u=0,s=null,l=null;for(var c of o){var f=c.codePointAt(0);if(!f)break;var d=tj(c,f);if([i,a]=r?[a,d]:[d,i],Gs(i,Ae.ZWJ)&&Gs(a,Ae.ExtPict)&&(r?s=US(t.substring(0,u)):s=US(t.substring(0,t.length-u)),!s)||Gs(i,Ae.RI)&&Gs(a,Ae.RI)&&(l!==null?l=!l:r?l=!0:l=aj(t.substring(0,t.length-u)),!l)||i!==Ae.None&&a!==Ae.None&&rj(i,a))break;u+=c.length}return u||1},LL=/\s/,jL=/[\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,ML=/['\u2018\u2019]/,zL=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0,o=!1;t.length>0;){var i=R3(t,n),[a,u]=L3(t,i,n);if(VL(a,u,n))o=!0,r+=i;else if(!o)r+=i;else break;t=u}return r},L3=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},VL=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(LL.test(t))return!1;if(ML.test(t)){var o=R3(n,r),[i,a]=L3(n,o,r);if(e(i,a,r))return!0}return!jL.test(t)},HL=function*(t){for(var n=t.length-1,r=0;re>=55296&&e<=56319,WL=e=>e>=56320&&e<=57343,Ae;(function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"})(Ae||(Ae={}));var qL=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1AC0\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,GL=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,KL=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,YL=/^[\u1100-\u115F\uA960-\uA97C]$/,XL=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,JL=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,ZL=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,QL=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,ej=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,tj=(e,t)=>{var n=Ae.Any;return e.search(qL)!==-1&&(n|=Ae.Extend),t===8205&&(n|=Ae.ZWJ),t>=127462&&t<=127487&&(n|=Ae.RI),e.search(GL)!==-1&&(n|=Ae.Prepend),e.search(KL)!==-1&&(n|=Ae.SpacingMark),e.search(YL)!==-1&&(n|=Ae.L),e.search(XL)!==-1&&(n|=Ae.V),e.search(JL)!==-1&&(n|=Ae.T),e.search(ZL)!==-1&&(n|=Ae.LV),e.search(QL)!==-1&&(n|=Ae.LVT),e.search(ej)!==-1&&(n|=Ae.ExtPict),n};function Gs(e,t){return(e&t)!==0}var nj=[[Ae.L,Ae.L|Ae.V|Ae.LV|Ae.LVT],[Ae.LV|Ae.V,Ae.V|Ae.T],[Ae.LVT|Ae.T,Ae.T],[Ae.Any,Ae.Extend|Ae.ZWJ],[Ae.Any,Ae.SpacingMark],[Ae.Prepend,Ae.Any],[Ae.ZWJ,Ae.ExtPict],[Ae.RI,Ae.RI]];function rj(e,t){return nj.findIndex(n=>Gs(e,n[0])&&Gs(t,n[1]))===-1}var oj=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1AC0\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,US=e=>e.search(oj)!==-1,ij=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,aj=e=>{var t=e.match(ij);if(t===null)return!1;var n=t[0].length/2;return n%2===1},WS=e=>xn(e)&&X.isNodeList(e.children)&&!D.isEditor(e),se={isAncestor(e){return xn(e)&&X.isNodeList(e.children)},isElement:WS,isElementList(e){return Array.isArray(e)&&e.every(t=>se.isElement(t))},isElementProps(e){return e.children!==void 0},isElementType:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"type";return WS(t)&&t[r]===n},matches(e,t){for(var n in t)if(n!=="children"&&e[n]!==t[n])return!1;return!0}},uj=["text"],sj=["text"];function qS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function us(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},{voids:n=!1,mode:r="lowest",at:o=e.selection,match:i}=t;if(o){var a=D.path(e,o),u=r==="lowest";for(var[s,l]of D.levels(e,{at:a,voids:n,match:i,reverse:u}))if(!oe.isText(s)&&!P.equals(a,l))return[s,l]}},addMark(e,t,n){e.addMark(t,n)},after(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=D.point(e,t,{edge:"end"}),o=D.end(e,[]),i={anchor:r,focus:o},{distance:a=1}=n,u=0,s;for(var l of D.positions(e,us(us({},n),{},{at:i}))){if(u>a)break;u!==0&&(s=l),u++}return s},before(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=D.start(e,[]),o=D.point(e,t,{edge:"start"}),i={anchor:r,focus:o},{distance:a=1}=n,u=0,s;for(var l of D.positions(e,us(us({},n),{},{at:i,reverse:!0}))){if(u>a)break;u!==0&&(s=l),u++}return s},deleteBackward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{direction:n="forward"}=t;e.deleteFragment(n)},edges(e,t){return[D.start(e,t),D.end(e,t)]},end(e,t){return D.point(e,t,{edge:"end"})},first(e,t){var n=D.path(e,t,{edge:"start"});return D.node(e,n)},fragment(e,t){var n=D.range(e,t),r=X.fragment(e,n);return r},hasBlocks(e,t){return t.children.some(n=>D.isBlock(e,n))},hasInlines(e,t){return t.children.some(n=>oe.isText(n)||D.isInline(e,n))},hasTexts(e,t){return t.children.every(n=>oe.isText(n))},insertBreak(e){e.insertBreak()},insertFragment(e,t){e.insertFragment(t)},insertNode(e,t){e.insertNode(t)},insertText(e,t){e.insertText(t)},isBlock(e,t){return se.isElement(t)&&!e.isInline(t)},isEditor(e){if(!xn(e))return!1;var t=GS.get(e);if(t!==void 0)return t;var n=typeof e.addMark=="function"&&typeof e.apply=="function"&&typeof e.deleteBackward=="function"&&typeof e.deleteForward=="function"&&typeof e.deleteFragment=="function"&&typeof e.insertBreak=="function"&&typeof e.insertFragment=="function"&&typeof e.insertNode=="function"&&typeof e.insertText=="function"&&typeof e.isInline=="function"&&typeof e.isVoid=="function"&&typeof e.normalizeNode=="function"&&typeof e.onChange=="function"&&typeof e.removeMark=="function"&&(e.marks===null||xn(e.marks))&&(e.selection===null||L.isRange(e.selection))&&X.isNodeList(e.children)&&qi.isOperationList(e.operations);return GS.set(e,n),n},isEnd(e,t,n){var r=D.end(e,n);return Be.equals(t,r)},isEdge(e,t,n){return D.isStart(e,t,n)||D.isEnd(e,t,n)},isEmpty(e,t){var{children:n}=t,[r]=n;return n.length===0||n.length===1&&oe.isText(r)&&r.text===""&&!e.isVoid(t)},isInline(e,t){return se.isElement(t)&&e.isInline(t)},isNormalizing(e){var t=jS.get(e);return t===void 0?!0:t},isStart(e,t,n){if(t.offset!==0)return!1;var r=D.start(e,n);return Be.equals(t,r)},isVoid(e,t){return se.isElement(t)&&e.isVoid(t)},last(e,t){var n=D.path(e,t,{edge:"end"});return D.node(e,n)},leaf(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=D.path(e,t,n),o=X.leaf(e,r);return[o,r]},*levels(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:n=e.selection,reverse:r=!1,voids:o=!1}=t,{match:i}=t;if(i==null&&(i=()=>!0),!!n){var a=[],u=D.path(e,n);for(var[s,l]of X.levels(e,u))if(i(s,l)&&(a.push([s,l]),!o&&D.isVoid(e,s)))break;r&&a.reverse(),yield*a}},marks(e){var{marks:t,selection:n}=e;if(!n)return null;if(t)return t;if(L.isExpanded(n)){var[r]=D.nodes(e,{match:oe.isText});if(r){var[o]=r,i=ii(o,uj);return i}else return{}}var{anchor:a}=n,{path:u}=a,[s]=D.leaf(e,u);if(a.offset===0){var l=D.previous(e,{at:u,match:oe.isText}),c=D.above(e,{match:v=>D.isBlock(e,v)});if(l&&c){var[f,d]=l,[,p]=c;P.isAncestor(p,d)&&(s=f)}}var g=ii(s,sj);return g},next(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=D.after(e,i,{voids:r});if(a){var[,u]=D.last(e,[]),s=[a.path,u];if(P.isPath(i)&&i.length===0)throw new Error("Cannot get the next node from the root node!");if(o==null)if(P.isPath(i)){var[l]=D.parent(e,i);o=f=>l.children.includes(f)}else o=()=>!0;var[c]=D.nodes(e,{at:s,match:o,mode:n,voids:r});return c}}},node(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=D.path(e,t,n),o=X.get(e,r);return[o,r]},*nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:n=e.selection,mode:r="all",universal:o=!1,reverse:i=!1,voids:a=!1}=t,{match:u}=t;if(u||(u=()=>!0),!!n){var s,l;if(lj.isSpan(n))s=n[0],l=n[1];else{var c=D.path(e,n,{edge:"start"}),f=D.path(e,n,{edge:"end"});s=i?f:c,l=i?c:f}var d=X.nodes(e,{reverse:i,from:s,to:l,pass:m=>{var[$]=m;return a?!1:D.isVoid(e,$)}}),p=[],g;for(var[v,h]of d){var y=g&&P.compare(h,g[1])===0;if(!(r==="highest"&&y)){if(!u(v,h)){if(o&&!y&&oe.isText(v))return;continue}if(r==="lowest"&&y){g=[v,h];continue}var b=r==="lowest"?g:[v,h];b&&(o?p.push(b):yield b),g=[v,h]}}r==="lowest"&&g&&(o?p.push(g):yield g),o&&(yield*p)}},normalize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:n=!1}=t,r=i=>Hg.get(i)||[];if(D.isNormalizing(e)){if(n){var o=Array.from(X.nodes(e),i=>{var[,a]=i;return a});Hg.set(e,o)}r(e).length!==0&&D.withoutNormalizing(e,()=>{for(var i of r(e))if(X.has(e,i)){var a=D.node(e,i),[u,s]=a;se.isElement(u)&&u.children.length===0&&e.normalizeNode(a)}for(var l=r(e).length*42,c=0;r(e).length!==0;){if(c>l)throw new Error(` Could not completely normalize the editor after `.concat(l,` iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state. `));var f=r(e).pop();if(X.has(e,f)){var d=D.node(e,f);e.normalizeNode(d)}c++}})}},parent(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=D.path(e,t,n),o=P.parent(r),i=D.node(e,o);return i},path(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:r,edge:o}=n;if(P.isPath(t)){if(o==="start"){var[,i]=X.first(e,t);t=i}else if(o==="end"){var[,a]=X.last(e,t);t=a}}return L.isRange(t)&&(o==="start"?t=L.start(t):o==="end"?t=L.end(t):t=P.common(t.anchor.path,t.focus.path)),Be.isPoint(t)&&(t=t.path),r!=null&&(t=t.slice(0,r)),t},hasPath(e,t){return X.has(e,t)},pathRef(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:a}=o,u=D.pathRefs(e);return u.delete(o),o.current=null,a}},i=D.pathRefs(e);return i.add(o),o},pathRefs(e){var t=MS.get(e);return t||(t=new Set,MS.set(e,t)),t},point(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:r="start"}=n;if(P.isPath(t)){var o;if(r==="end"){var[,i]=X.last(e,t);o=i}else{var[,a]=X.first(e,t);o=a}var u=X.get(e,o);if(!oe.isText(u))throw new Error("Cannot get the ".concat(r," point in the node at path [").concat(t,"] because it has no ").concat(r," text node."));return{path:o,offset:r==="end"?u.text.length:0}}if(L.isRange(t)){var[s,l]=L.edges(t);return r==="start"?s:l}return t},pointRef(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:a}=o,u=D.pointRefs(e);return u.delete(o),o.current=null,a}},i=D.pointRefs(e);return i.add(o),o},pointRefs(e){var t=zS.get(e);return t||(t=new Set,zS.set(e,t)),t},*positions(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:n=e.selection,unit:r="offset",reverse:o=!1,voids:i=!1}=t;if(!n)return;var a=D.range(e,n),[u,s]=L.edges(a),l=o?s:u,c=!1,f="",d=0,p=0,g=0;for(var[v,h]of D.nodes(e,{at:n,reverse:o,voids:i})){if(se.isElement(v)){if(!i&&e.isVoid(v)){yield D.start(e,h);continue}if(e.isInline(v))continue;if(D.hasInlines(e,v)){var y=P.isAncestor(h,s.path)?s:D.end(e,h),b=P.isAncestor(h,u.path)?u:D.start(e,h);f=D.string(e,{anchor:b,focus:y},{voids:i}),c=!0}}if(oe.isText(v)){var m=P.equals(h,l.path);for(m?(p=o?l.offset:v.text.length-l.offset,g=l.offset):(p=v.text.length,g=o?p:0),(m||c||r==="offset")&&(yield{path:h,offset:g},c=!1);;){if(d===0){if(f==="")break;d=$(f,r,o),f=L3(f,d,o)[1]}if(g=o?g-d:g+d,p=p-d,p<0){d=-p;break}d=0,yield{path:h,offset:g}}}}function $(E,S,x){return S==="character"?R3(E,x):S==="word"?zL(E,x):S==="line"||S==="block"?E.length:1}},previous(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=D.before(e,i,{voids:r});if(a){var[,u]=D.first(e,[]),s=[a.path,u];if(P.isPath(i)&&i.length===0)throw new Error("Cannot get the previous node from the root node!");if(o==null)if(P.isPath(i)){var[l]=D.parent(e,i);o=f=>l.children.includes(f)}else o=()=>!0;var[c]=D.nodes(e,{reverse:!0,at:s,match:o,mode:n,voids:r});return c}}},range(e,t,n){if(L.isRange(t)&&!n)return t;var r=D.start(e,t),o=D.end(e,n||t);return{anchor:r,focus:o}},rangeRef(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:a}=o,u=D.rangeRefs(e);return u.delete(o),o.current=null,a}},i=D.rangeRefs(e);return i.add(o),o},rangeRefs(e){var t=VS.get(e);return t||(t=new Set,VS.set(e,t)),t},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){jS.set(e,t)},start(e,t){return D.point(e,t,{edge:"start"})},string(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:r=!1}=n,o=D.range(e,t),[i,a]=L.edges(o),u="";for(var[s,l]of D.nodes(e,{at:o,match:oe.isText,voids:r})){var c=s.text;P.equals(l,a.path)&&(c=c.slice(0,a.offset)),P.equals(l,i.path)&&(c=c.slice(i.offset)),u+=c}return u},unhangRange(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:r=!1}=n,[o,i]=L.edges(t);if(o.offset!==0||i.offset!==0||L.isCollapsed(t))return t;var a=D.above(e,{at:i,match:p=>D.isBlock(e,p)}),u=a?a[1]:[],s=D.start(e,[]),l={anchor:s,focus:i},c=!0;for(var[f,d]of D.nodes(e,{at:l,match:oe.isText,reverse:!0,voids:r})){if(c){c=!1;continue}if(f.text!==""||P.isBefore(d,u)){i={path:d,offset:f.text.length};break}}return{anchor:o,focus:i}},void(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return D.above(e,us(us({},t),{},{match:n=>D.isVoid(e,n)}))},withoutNormalizing(e,t){var n=D.isNormalizing(e);D.setNormalizing(e,!1);try{t()}finally{D.setNormalizing(e,n)}D.normalize(e)}},lj={isSpan(e){return Array.isArray(e)&&e.length===2&&e.every(P.isPath)}},cj=["children"],fj=["text"],KS=new WeakMap,X={ancestor(e,t){var n=X.get(e,t);if(oe.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(n));return n},*ancestors(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};for(var r of P.ancestors(t,n)){var o=X.ancestor(e,r),i=[o,r];yield i}},child(e,t){if(oe.isText(e))throw new Error("Cannot get the child of a text node: ".concat(JSON.stringify(e)));var n=e.children[t];if(n==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(JSON.stringify(e)));return n},*children(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{reverse:r=!1}=n,o=X.ancestor(e,t),{children:i}=o,a=r?i.length-1:0;r?a>=0:a1&&arguments[1]!==void 0?arguments[1]:{};for(var[n,r]of X.nodes(e,t))r.length!==0&&(yield[n,r])},*elements(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[n,r]of X.nodes(e,t))se.isElement(n)&&(yield[n,r])},extractProps(e){if(se.isAncestor(e)){var t=ii(e,cj);return t}else{var t=ii(e,fj);return t}},first(e,t){for(var n=t.slice(),r=X.get(e,n);r&&!(oe.isText(r)||r.children.length===0);)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){if(oe.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(JSON.stringify(e)));var n=Pv({children:e.children},r=>{var[o,i]=L.edges(t),a=X.nodes(r,{reverse:!0,pass:d=>{var[,p]=d;return!L.includes(t,p)}});for(var[,u]of a){if(!L.includes(t,u)){var s=X.parent(r,u),l=u[u.length-1];s.children.splice(l,1)}if(P.equals(u,i.path)){var c=X.leaf(r,u);c.text=c.text.slice(0,i.offset)}if(P.equals(u,o.path)){var f=X.leaf(r,u);f.text=f.text.slice(o.offset)}}D.isEditor(r)&&(r.selection=null)});return n.children},get(e,t){for(var n=e,r=0;rX.isNode(r));return KS.set(e,n),n},last(e,t){for(var n=t.slice(),r=X.get(e,n);r&&!(oe.isText(r)||r.children.length===0);){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=X.get(e,t);if(!oe.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(n));return n},*levels(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};for(var r of P.levels(t,n)){var o=X.get(e,r);yield[o,r]}},matches(e,t){return se.isElement(e)&&se.isElementProps(t)&&se.matches(e,t)||oe.isText(e)&&oe.isTextProps(t)&&oe.matches(e,t)},*nodes(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{pass:n,reverse:r=!1}=t,{from:o=[],to:i}=t,a=new Set,u=[],s=e;!(i&&(r?P.isBefore(u,i):P.isAfter(u,i)));){if(a.has(s)||(yield[s,u]),!a.has(s)&&!oe.isText(s)&&s.children.length!==0&&(n==null||n([s,u])===!1)){a.add(s);var l=r?s.children.length-1:0;P.isAncestor(u,o)&&(l=o[u.length]),u=u.concat(l),s=X.get(e,u);continue}if(u.length===0)break;if(!r){var c=P.next(u);if(X.has(e,c)){u=c,s=X.get(e,u);continue}}if(r&&u[u.length-1]!==0){var f=P.previous(u);u=f,s=X.get(e,u);continue}u=P.parent(u),s=X.get(e,u),a.add(s)}},parent(e,t){var n=P.parent(t),r=X.get(e,n);if(oe.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string(e){return oe.isText(e)?e.text:e.children.map(X.string).join("")},*texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[n,r]of X.nodes(e,t))oe.isText(n)&&(yield[n,r])}};function YS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function yt(e){for(var t=1;tqi.isOperation(t))},isSelectionOperation(e){return qi.isOperation(e)&&e.type.endsWith("_selection")},isTextOperation(e){return qi.isOperation(e)&&e.type.endsWith("_text")},inverse(e){switch(e.type){case"insert_node":return yt(yt({},e),{},{type:"remove_node"});case"insert_text":return yt(yt({},e),{},{type:"remove_text"});case"merge_node":return yt(yt({},e),{},{type:"split_node",path:P.previous(e.path)});case"move_node":{var{newPath:t,path:n}=e;if(P.equals(t,n))return e;if(P.isSibling(n,t))return yt(yt({},e),{},{path:t,newPath:n});var r=P.transform(n,e),o=P.transform(P.next(n),e);return yt(yt({},e),{},{path:r,newPath:o})}case"remove_node":return yt(yt({},e),{},{type:"insert_node"});case"remove_text":return yt(yt({},e),{},{type:"insert_text"});case"set_node":{var{properties:i,newProperties:a}=e;return yt(yt({},e),{},{properties:a,newProperties:i})}case"set_selection":{var{properties:u,newProperties:s}=e;return u==null?yt(yt({},e),{},{properties:s,newProperties:null}):s==null?yt(yt({},e),{},{properties:null,newProperties:u}):yt(yt({},e),{},{properties:s,newProperties:u})}case"split_node":return yt(yt({},e),{},{type:"merge_node",path:P.next(e.path)})}}},P={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=P.levels(e,t);return n?r=r.slice(1):r=r.slice(0,-1),r},common(e,t){for(var n=[],r=0;rt[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return P.equals(r,o)&&i>a},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return P.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return P.equals(r,o)&&in===t[r])},hasPrevious(e){return e[e.length-1]>0},isAfter(e,t){return P.compare(e,t)===1},isAncestor(e,t){return e.lengtht.length&&P.compare(e,t)===0},isParent(e,t){return e.length+1===t.length&&P.compare(e,t)===0},isPath(e){return Array.isArray(e)&&(e.length===0||typeof e[0]=="number")},isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1),o=e[e.length-1],i=t[t.length-1];return o!==i&&P.equals(n,r)},levels(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next(e){if(e.length===0)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},parent(e){if(e.length===0)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(e.length===0)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!P.isAncestor(t,e)&&!P.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Pv(e,r=>{var{affinity:o="forward"}=n;if(!(!e||(e==null?void 0:e.length)===0)){if(r===null)return null;switch(t.type){case"insert_node":{var{path:i}=t;(P.equals(i,r)||P.endsBefore(i,r)||P.isAncestor(i,r))&&(r[i.length-1]+=1);break}case"remove_node":{var{path:a}=t;if(P.equals(a,r)||P.isAncestor(a,r))return null;P.endsBefore(a,r)&&(r[a.length-1]-=1);break}case"merge_node":{var{path:u,position:s}=t;P.equals(u,r)||P.endsBefore(u,r)?r[u.length-1]-=1:P.isAncestor(u,r)&&(r[u.length-1]-=1,r[u.length]+=s);break}case"split_node":{var{path:l,position:c}=t;if(P.equals(l,r)){if(o==="forward")r[r.length-1]+=1;else if(o!=="backward")return null}else P.endsBefore(l,r)?r[l.length-1]+=1:P.isAncestor(l,r)&&e[l.length]>=c&&(r[l.length-1]+=1,r[l.length]-=c);break}case"move_node":{var{path:f,newPath:d}=t;if(P.equals(f,d))return;if(P.isAncestor(f,r)||P.equals(f,r)){var p=d.slice();return P.endsBefore(f,d)&&f.lengtht.offset?1:0:n},isAfter(e,t){return Be.compare(e,t)===1},isBefore(e,t){return Be.compare(e,t)===-1},equals(e,t){return e.offset===t.offset&&P.equals(e.path,t.path)},isPoint(e){return xn(e)&&typeof e.offset=="number"&&P.isPath(e.path)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Pv(e,r=>{if(r===null)return null;var{affinity:o="forward"}=n,{path:i,offset:a}=r;switch(t.type){case"insert_node":case"move_node":{r.path=P.transform(i,t,n);break}case"insert_text":{P.equals(t.path,i)&&t.offset<=a&&(r.offset+=t.text.length);break}case"merge_node":{P.equals(t.path,i)&&(r.offset+=t.position),r.path=P.transform(i,t,n);break}case"remove_text":{P.equals(t.path,i)&&t.offset<=a&&(r.offset-=Math.min(a-t.offset,t.text.length));break}case"remove_node":{if(P.equals(t.path,i)||P.isAncestor(t.path,i))return null;r.path=P.transform(i,t,n);break}case"split_node":{if(P.equals(t.path,i)){if(t.position===a&&o==null)return null;(t.position1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return L.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=L.edges(e);return t},equals(e,t){return Be.equals(e.anchor,t.anchor)&&Be.equals(e.focus,t.focus)},includes(e,t){if(L.isRange(t)){if(L.includes(e,t.anchor)||L.includes(e,t.focus))return!0;var[n,r]=L.edges(e),[o,i]=L.edges(t);return Be.isBefore(n,o)&&Be.isAfter(r,i)}var[a,u]=L.edges(e),s=!1,l=!1;return Be.isPoint(t)?(s=Be.compare(t,a)>=0,l=Be.compare(t,u)<=0):(s=P.compare(t,a.path)>=0,l=P.compare(t,u.path)<=0),s&&l},intersection(e,t){var n=ii(e,hj),[r,o]=L.edges(e),[i,a]=L.edges(t),u=Be.isBefore(r,i)?i:r,s=Be.isBefore(o,a)?o:a;return Be.isBefore(s,u)?null:gj({anchor:u,focus:s},n)},isBackward(e){var{anchor:t,focus:n}=e;return Be.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return Be.equals(t,n)},isExpanded(e){return!L.isCollapsed(e)},isForward(e){return!L.isBackward(e)},isRange(e){return xn(e)&&Be.isPoint(e.anchor)&&Be.isPoint(e.focus)},*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=L.edges(e);return t},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Pv(e,r=>{if(r===null)return null;var{affinity:o="inward"}=n,i,a;if(o==="inward"){var u=L.isCollapsed(r);L.isForward(r)?(i="forward",a=u?i:"backward"):(i="backward",a=u?i:"forward")}else o==="outward"?L.isForward(r)?(i="backward",a="forward"):(i="forward",a="backward"):(i=o,a=o);var s=Be.transform(r.anchor,t,{affinity:i}),l=Be.transform(r.focus,t,{affinity:a});if(!s||!l)return null;r.anchor=s,r.focus=l})}},vj={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var o=L.transform(n,t,{affinity:r});e.current=o,o==null&&e.unref()}}},q_=(e,t)=>{for(var n in e){var r=e[n],o=t[n];if(xn(r)&&xn(o)){if(!q_(r,o))return!1}else if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var i=0;i2&&arguments[2]!==void 0?arguments[2]:{},{loose:r=!1}=n;function o(i){var a=ii(i,mj);return a}return q_(r?o(e):e,r?o(t):t)},isText(e){return xn(e)&&typeof e.text=="string"},isTextList(e){return Array.isArray(e)&&e.every(t=>oe.isText(t))},isTextProps(e){return e.text!==void 0},matches(e,t){for(var n in t)if(n!=="text"&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[Go({},e)];for(var r of t){var o=ii(r,yj),[i,a]=L.edges(r),u=[],s=0;for(var l of n){var{length:c}=l.text,f=s;if(s+=c,i.offset<=f&&a.offset>=s){Object.assign(l,o),u.push(l);continue}if(i.offset!==a.offset&&(i.offset===s||a.offset===f)||i.offset>s||a.offsetf){var h=i.offset-f;p=Go(Go({},d),{},{text:d.text.slice(0,h)}),d=Go(Go({},d),{},{text:d.text.slice(h)})}Object.assign(d,o),p&&u.push(p),u.push(d),g&&u.push(g)}n=u}return n}};function eD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function wc(e){for(var t=1;t{switch(n.type){case"insert_node":{var{path:r,node:o}=n,i=X.parent(e,r),a=r[r.length-1];if(a>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));if(i.children.splice(a,0,o),t)for(var[u,s]of L.points(t))t[s]=Be.transform(u,n);break}case"insert_text":{var{path:l,offset:c,text:f}=n;if(f.length===0)break;var d=X.leaf(e,l),p=d.text.slice(0,c),g=d.text.slice(c);if(d.text=p+f+g,t)for(var[v,h]of L.points(t))t[h]=Be.transform(v,n);break}case"merge_node":{var{path:y}=n,b=X.get(e,y),m=P.previous(y),$=X.get(e,m),E=X.parent(e,y),S=y[y.length-1];if(oe.isText(b)&&oe.isText($))$.text+=b.text;else if(!oe.isText(b)&&!oe.isText($))$.children.push(...b.children);else throw new Error('Cannot apply a "merge_node" operation at path ['.concat(y,"] to nodes of different interfaces: ").concat(b," ").concat($));if(E.children.splice(S,1),t)for(var[x,B]of L.points(t))t[B]=Be.transform(x,n);break}case"move_node":{var{path:I,newPath:H}=n;if(P.isAncestor(I,H))throw new Error("Cannot move a path [".concat(I,"] to new path [").concat(H,"] because the destination is inside itself."));var G=X.get(e,I),Y=X.parent(e,I),U=I[I.length-1];Y.children.splice(U,1);var ie=P.transform(I,n),re=X.get(e,P.parent(ie)),ae=ie[ie.length-1];if(re.children.splice(ae,0,G),t)for(var[me,De]of L.points(t))t[De]=Be.transform(me,n);break}case"remove_node":{var{path:$e}=n,le=$e[$e.length-1],Me=X.parent(e,$e);if(Me.children.splice(le,1),t)for(var[T,_]of L.points(t)){var F=Be.transform(T,n);if(t!=null&&F!=null)t[_]=F;else{var R=void 0,q=void 0;for(var[j,ue]of X.texts(e))if(P.compare(ue,$e)===-1)R=[j,ue];else{q=[j,ue];break}var be=!1;R&&q&&(P.equals(q[1],$e)?be=!P.hasPrevious(q[1]):be=P.common(R[1],$e).length2&&arguments[2]!==void 0?arguments[2]:{};D.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1,mode:i="lowest"}=n,{at:a,match:u,select:s}=n;if(X.isNode(t)&&(t=[t]),t.length!==0){var[l]=t;if(a||(e.selection?a=e.selection:e.children.length>0?a=D.end(e,[]):a=[0],s=!0),s==null&&(s=!1),L.isRange(a))if(r||(a=D.unhangRange(e,a)),L.isCollapsed(a))a=a.anchor;else{var[,c]=L.edges(a),f=D.pointRef(e,c);N.delete(e,{at:a}),a=f.unref()}if(Be.isPoint(a)){u==null&&(oe.isText(l)?u=S=>oe.isText(S):e.isInline(l)?u=S=>oe.isText(S)||D.isInline(e,S):u=S=>D.isBlock(e,S));var[d]=D.nodes(e,{at:a.path,match:u,mode:i,voids:o});if(d){var[,p]=d,g=D.pathRef(e,p),v=D.isEnd(e,a,p);N.splitNodes(e,{at:a,match:u,mode:i,voids:o});var h=g.unref();a=v?P.next(h):h}else return}var y=P.parent(a),b=a[a.length-1];if(!(!o&&D.void(e,{at:y}))){for(var m of t){var $=y.concat(b);b++,e.apply({type:"insert_node",path:$,node:m}),a=P.next(a)}if(a=P.previous(a),s){var E=D.end(e,a);E&&N.select(e,E)}}}})},liftNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};D.withoutNormalizing(e,()=>{var{at:n=e.selection,mode:r="lowest",voids:o=!1}=t,{match:i}=t;if(i==null&&(i=P.isPath(n)?ss(e,n):m=>D.isBlock(e,m)),!!n){var a=D.nodes(e,{at:n,match:i,mode:r,voids:o}),u=Array.from(a,m=>{var[,$]=m;return D.pathRef(e,$)});for(var s of u){var l=s.unref();if(l.length<2)throw new Error("Cannot lift node at a path [".concat(l,"] because it has a depth of less than `2`."));var c=D.node(e,P.parent(l)),[f,d]=c,p=l[l.length-1],{length:g}=f.children;if(g===1){var v=P.next(d);N.moveNodes(e,{at:l,to:v,voids:o}),N.removeNodes(e,{at:d,voids:o})}else if(p===0)N.moveNodes(e,{at:l,to:d,voids:o});else if(p===g-1){var h=P.next(d);N.moveNodes(e,{at:l,to:h,voids:o})}else{var y=P.next(l),b=P.next(d);N.splitNodes(e,{at:y,voids:o}),N.moveNodes(e,{at:l,to:b,voids:o})}}}})},mergeNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};D.withoutNormalizing(e,()=>{var{match:n,at:r=e.selection}=t,{hanging:o=!1,voids:i=!1,mode:a="lowest"}=t;if(r){if(n==null)if(P.isPath(r)){var[u]=D.parent(e,r);n=I=>u.children.includes(I)}else n=I=>D.isBlock(e,I);if(!o&&L.isRange(r)&&(r=D.unhangRange(e,r)),L.isRange(r))if(L.isCollapsed(r))r=r.anchor;else{var[,s]=L.edges(r),l=D.pointRef(e,s);N.delete(e,{at:r}),r=l.unref(),t.at==null&&N.select(e,r)}var[c]=D.nodes(e,{at:r,match:n,voids:i,mode:a}),f=D.previous(e,{at:r,match:n,voids:i,mode:a});if(!(!c||!f)){var[d,p]=c,[g,v]=f;if(!(p.length===0||v.length===0)){var h=P.next(v),y=P.common(p,v),b=P.isSibling(p,v),m=Array.from(D.levels(e,{at:p}),I=>{var[H]=I;return H}).slice(y.length).slice(0,-1),$=D.above(e,{at:p,mode:"highest",match:I=>m.includes(I)&&G_(e,I)}),E=$&&D.pathRef(e,$[1]),S,x;if(oe.isText(d)&&oe.isText(g)){var B=ii(d,$j);x=g.text.length,S=B}else if(se.isElement(d)&&se.isElement(g)){var B=ii(d,Ej);x=g.children.length,S=B}else throw new Error("Cannot merge the node at path [".concat(p,"] with the previous sibling because it is not the same kind: ").concat(JSON.stringify(d)," ").concat(JSON.stringify(g)));b||N.moveNodes(e,{at:p,to:h,voids:i}),E&&N.removeNodes(e,{at:E.current,voids:i}),se.isElement(g)&&D.isEmpty(e,g)||oe.isText(g)&&g.text===""&&v[v.length-1]!==0?N.removeNodes(e,{at:v,voids:i}):e.apply({type:"merge_node",path:h,position:x,properties:S}),E&&E.unref()}}}})},moveNodes(e,t){D.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:o="lowest",voids:i=!1}=t,{match:a}=t;if(r){a==null&&(a=P.isPath(r)?ss(e,r):p=>D.isBlock(e,p));var u=D.pathRef(e,n),s=D.nodes(e,{at:r,match:a,mode:o,voids:i}),l=Array.from(s,p=>{var[,g]=p;return D.pathRef(e,g)});for(var c of l){var f=c.unref(),d=u.current;f.length!==0&&e.apply({type:"move_node",path:f,newPath:d}),u.current&&P.isSibling(d,f)&&P.isAfter(d,f)&&(u.current=P.next(u.current))}u.unref()}})},removeNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};D.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:r=!1,mode:o="lowest"}=t,{at:i=e.selection,match:a}=t;if(i){a==null&&(a=P.isPath(i)?ss(e,i):d=>D.isBlock(e,d)),!n&&L.isRange(i)&&(i=D.unhangRange(e,i));var u=D.nodes(e,{at:i,match:a,mode:o,voids:r}),s=Array.from(u,d=>{var[,p]=d;return D.pathRef(e,p)});for(var l of s){var c=l.unref();if(c){var[f]=D.node(e,c);e.apply({type:"remove_node",path:c,node:f})}}}})},setNodes(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};D.withoutNormalizing(e,()=>{var{match:r,at:o=e.selection}=n,{hanging:i=!1,mode:a="lowest",split:u=!1,voids:s=!1}=n;if(o){if(r==null&&(r=P.isPath(o)?ss(e,o):E=>D.isBlock(e,E)),!i&&L.isRange(o)&&(o=D.unhangRange(e,o)),u&&L.isRange(o)){if(L.isCollapsed(o)&&D.leaf(e,o.anchor)[0].text.length>0)return;var l=D.rangeRef(e,o,{affinity:"inward"}),[c,f]=L.edges(o),d=a==="lowest"?"lowest":"highest",p=D.isEnd(e,f,f.path);N.splitNodes(e,{at:f,match:r,mode:d,voids:s,always:!p});var g=D.isStart(e,c,c.path);N.splitNodes(e,{at:c,match:r,mode:d,voids:s,always:!g}),o=l.unref(),n.at==null&&N.select(e,o)}for(var[v,h]of D.nodes(e,{at:o,match:r,mode:a,voids:s})){var y={},b={};if(h.length!==0){var m=!1;for(var $ in t)$==="children"||$==="text"||t[$]!==v[$]&&(m=!0,v.hasOwnProperty($)&&(y[$]=v[$]),t[$]!=null&&(b[$]=t[$]));m&&e.apply({type:"set_node",path:h,properties:y,newProperties:b})}}}})},splitNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};D.withoutNormalizing(e,()=>{var{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection,height:a=0,always:u=!1}=t;if(o==null&&(o=me=>D.isBlock(e,me)),L.isRange(i)&&(i=Dj(e,i)),P.isPath(i)){var s=i,l=D.point(e,s),[c]=D.parent(e,s);o=me=>me===c,a=l.path.length-s.length+1,i=l,u=!0}if(i){var f=D.pointRef(e,i,{affinity:"backward"}),[d]=D.nodes(e,{at:i,match:o,mode:n,voids:r});if(d){var p=D.void(e,{at:i,mode:"highest"}),g=0;if(!r&&p){var[v,h]=p;if(se.isElement(v)&&e.isInline(v)){var y=D.after(e,h);if(!y){var b={text:""},m=P.next(h);N.insertNodes(e,b,{at:m,voids:r}),y=D.point(e,m)}i=y,u=!0}var $=i.path.length-h.length;a=$+1,u=!0}var E=D.pointRef(e,i),S=i.path.length-a,[,x]=d,B=i.path.slice(0,S),I=a===0?i.offset:i.path[S]+g;for(var[H,G]of D.levels(e,{at:B,reverse:!0,voids:r})){var Y=!1;if(G.length2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(t)||(t=[t]);var r={};for(var o of t)r[o]=null;N.setNodes(e,r,n)},unwrapNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};D.withoutNormalizing(e,()=>{var{mode:n="lowest",split:r=!1,voids:o=!1}=t,{at:i=e.selection,match:a}=t;if(i){a==null&&(a=P.isPath(i)?ss(e,i):d=>D.isBlock(e,d)),P.isPath(i)&&(i=D.range(e,i));var u=L.isRange(i)?D.rangeRef(e,i):null,s=D.nodes(e,{at:i,match:a,mode:n,voids:o}),l=Array.from(s,d=>{var[,p]=d;return D.pathRef(e,p)}).reverse(),c=function(p){var g=p.unref(),[v]=D.node(e,g),h=D.range(e,g);r&&u&&(h=L.intersection(u.current,h)),N.liftNodes(e,{at:h,match:y=>se.isAncestor(v)&&v.children.includes(y),voids:o})};for(var f of l)c(f);u&&u.unref()}})},wrapNodes(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};D.withoutNormalizing(e,()=>{var{mode:r="lowest",split:o=!1,voids:i=!1}=n,{match:a,at:u=e.selection}=n;if(u){if(a==null&&(P.isPath(u)?a=ss(e,u):e.isInline(t)?a=h=>D.isInline(e,h)||oe.isText(h):a=h=>D.isBlock(e,h)),o&&L.isRange(u)){var[s,l]=L.edges(u),c=D.rangeRef(e,u,{affinity:"inward"});N.splitNodes(e,{at:l,match:a,voids:i}),N.splitNodes(e,{at:s,match:a,voids:i}),u=c.unref(),n.at==null&&N.select(e,u)}var f=Array.from(D.nodes(e,{at:u,match:e.isInline(t)?h=>D.isBlock(e,h):h=>D.isEditor(h),mode:"lowest",voids:i}));for(var[,d]of f){var p=L.isRange(u)?L.intersection(u,D.range(e,d)):u;if(p){var g=Array.from(D.nodes(e,{at:p,match:a,mode:r,voids:i}));if(g.length>0){var v=function(){var[h]=g,y=g[g.length-1],[,b]=h,[,m]=y;if(b.length===0&&m.length===0)return"continue";var $=P.equals(b,m)?P.parent(b):P.common(b,m),E=D.range(e,b,m),S=D.node(e,$),[x]=S,B=$.length+1,I=P.next(m.slice(0,B)),H=nD(nD({},t),{},{children:[]});N.insertNodes(e,H,{at:I,voids:i}),N.moveNodes(e,{at:E,match:G=>se.isAncestor(x)&&x.children.includes(G),to:I.concat(0),voids:i})}();if(v==="continue")continue}}}}})}},G_=(e,t)=>{if(se.isElement(t)){var n=t;return D.isVoid(e,t)?!0:n.children.length===1?G_(e,n.children[0]):!1}else return!D.isEditor(t)},Dj=(e,t)=>{if(L.isCollapsed(t))return t.anchor;var[,n]=L.edges(t),r=D.pointRef(e,n);return N.delete(e,{at:t}),r.unref()},ss=(e,t)=>{var[n]=D.node(e,t);return r=>r===n};function rD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function oD(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},{edge:n="anchor"}=t,{selection:r}=e;if(r){if(n==="anchor")N.select(e,r.anchor);else if(n==="focus")N.select(e,r.focus);else if(n==="start"){var[o]=L.edges(r);N.select(e,o)}else if(n==="end"){var[,i]=L.edges(r);N.select(e,i)}}else return},deselect(e){var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},move(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:n}=e,{distance:r=1,unit:o="character",reverse:i=!1}=t,{edge:a=null}=t;if(n){a==="start"&&(a=L.isBackward(n)?"focus":"anchor"),a==="end"&&(a=L.isBackward(n)?"anchor":"focus");var{anchor:u,focus:s}=n,l={distance:r,unit:o},c={};if(a==null||a==="anchor"){var f=i?D.before(e,u,l):D.after(e,u,l);f&&(c.anchor=f)}if(a==null||a==="focus"){var d=i?D.before(e,s,l):D.after(e,s,l);d&&(c.focus=d)}N.setSelection(e,c)}},select(e,t){var{selection:n}=e;if(t=D.range(e,t),n){N.setSelection(e,t);return}if(!L.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(JSON.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})},setPoint(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:r}=e,{edge:o="both"}=n;if(r){o==="start"&&(o=L.isBackward(r)?"focus":"anchor"),o==="end"&&(o=L.isBackward(r)?"anchor":"focus");var{anchor:i,focus:a}=r,u=o==="anchor"?i:a;N.setSelection(e,{[o==="anchor"?"anchor":"focus"]:oD(oD({},u),t)})}},setSelection(e,t){var{selection:n}=e,r={},o={};if(n){for(var i in t)(i==="anchor"&&t.anchor!=null&&!Be.equals(t.anchor,n.anchor)||i==="focus"&&t.focus!=null&&!Be.equals(t.focus,n.focus)||i!=="anchor"&&i!=="focus"&&t[i]!==n[i])&&(r[i]=n[i],o[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:o})}}},xj={delete(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};D.withoutNormalizing(e,()=>{var{reverse:n=!1,unit:r="character",distance:o=1,voids:i=!1}=t,{at:a=e.selection,hanging:u=!1}=t;if(a){if(L.isRange(a)&&L.isCollapsed(a)&&(a=a.anchor),Be.isPoint(a)){var s=D.void(e,{at:a,mode:"highest"});if(!i&&s){var[,l]=s;a=l}else{var c={unit:r,distance:o},f=n?D.before(e,a,c)||D.start(e,[]):D.after(e,a,c)||D.end(e,[]);a={anchor:a,focus:f},u=!0}}if(P.isPath(a)){N.removeNodes(e,{at:a,voids:i});return}if(!L.isCollapsed(a)){if(!u){var[,d]=L.edges(a),p=D.end(e,[]);Be.equals(d,p)||(a=D.unhangRange(e,a,{voids:i}))}var[g,v]=L.edges(a),h=D.above(e,{match:be=>D.isBlock(e,be),at:g,voids:i}),y=D.above(e,{match:be=>D.isBlock(e,be),at:v,voids:i}),b=h&&y&&!P.equals(h[1],y[1]),m=P.equals(g.path,v.path),$=i?null:D.void(e,{at:g,mode:"highest"}),E=i?null:D.void(e,{at:v,mode:"highest"});if($){var S=D.before(e,g);S&&h&&P.isAncestor(h[1],S.path)&&(g=S)}if(E){var x=D.after(e,v);x&&y&&P.isAncestor(y[1],x.path)&&(v=x)}var B=[],I;for(var H of D.nodes(e,{at:a,voids:i})){var[G,Y]=H;I&&P.compare(Y,I)===0||(!i&&D.isVoid(e,G)||!P.isCommon(Y,g.path)&&!P.isCommon(Y,v.path))&&(B.push(H),I=Y)}var U=Array.from(B,be=>{var[,Pe]=be;return D.pathRef(e,Pe)}),ie=D.pointRef(e,g),re=D.pointRef(e,v);if(!m&&!$){var ae=ie.current,[me]=D.leaf(e,ae),{path:De}=ae,{offset:$e}=g,le=me.text.slice($e);le.length>0&&e.apply({type:"remove_text",path:De,offset:$e,text:le})}for(var Me of U){var T=Me.unref();N.removeNodes(e,{at:T,voids:i})}if(!E){var _=re.current,[F]=D.leaf(e,_),{path:R}=_,q=m?g.offset:0,j=F.text.slice(q,v.offset);j.length>0&&e.apply({type:"remove_text",path:R,offset:q,text:j})}!m&&b&&re.current&&ie.current&&N.mergeNodes(e,{at:re.current,hanging:!0,voids:i});var ue=n?ie.unref()||re.unref():re.unref()||ie.unref();t.at==null&&ue&&N.select(e,ue)}}})},insertFragment(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};D.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1}=n,{at:i=e.selection}=n;if(t.length){if(i)if(L.isRange(i))if(r||(i=D.unhangRange(e,i)),L.isCollapsed(i))i=i.anchor;else{var[,a]=L.edges(i);if(!o&&D.void(e,{at:a}))return;var u=D.pointRef(e,a);N.delete(e,{at:i}),i=u.unref()}else P.isPath(i)&&(i=D.start(e,i));else return;if(!(!o&&D.void(e,{at:i}))){var s=D.above(e,{at:i,match:F=>D.isInline(e,F),mode:"highest",voids:o});if(s){var[,l]=s;if(D.isEnd(e,i,l)){var c=D.after(e,l);i=c}else if(D.isStart(e,i,l)){var f=D.before(e,l);i=f}}var d=D.above(e,{match:F=>D.isBlock(e,F),at:i,voids:o}),[,p]=d,g=D.isStart(e,i,p),v=D.isEnd(e,i,p),h=g&&v,y=!g||g&&v,b=!v,[,m]=X.first({children:t},[]),[,$]=X.last({children:t},[]),E=[],S=F=>{var[R,q]=F,j=q.length===0;return j?!1:h?!0:!(y&&P.isAncestor(q,m)&&se.isElement(R)&&!e.isVoid(R)&&!e.isInline(R)||b&&P.isAncestor(q,$)&&se.isElement(R)&&!e.isVoid(R)&&!e.isInline(R))};for(var x of X.nodes({children:t},{pass:S}))S(x)&&E.push(x);var B=[],I=[],H=[],G=!0,Y=!1;for(var[U]of E)se.isElement(U)&&!e.isInline(U)?(G=!1,Y=!0,I.push(U)):G?B.push(U):H.push(U);var[ie]=D.nodes(e,{at:i,match:F=>oe.isText(F)||D.isInline(e,F),mode:"highest",voids:o}),[,re]=ie,ae=D.isStart(e,i,re),me=D.isEnd(e,i,re),De=D.pathRef(e,v?P.next(p):p),$e=D.pathRef(e,me?P.next(re):re),le=D.pathRef(e,p);N.splitNodes(e,{at:i,match:F=>Y?D.isBlock(e,F):oe.isText(F)||D.isInline(e,F),mode:Y?"lowest":"highest",voids:o});var Me=D.pathRef(e,!ae||ae&&me?P.next(re):re);if(N.insertNodes(e,B,{at:Me.current,match:F=>oe.isText(F)||D.isInline(e,F),mode:"highest",voids:o}),h&&I.length&&N.delete(e,{at:le.unref(),voids:o}),N.insertNodes(e,I,{at:De.current,match:F=>D.isBlock(e,F),mode:"lowest",voids:o}),N.insertNodes(e,H,{at:$e.current,match:F=>oe.isText(F)||D.isInline(e,F),mode:"highest",voids:o}),!n.at){var T;H.length>0?T=P.previous($e.current):I.length>0?T=P.previous(De.current):T=P.previous(Me.current);var _=D.end(e,T);N.select(e,_)}Me.unref(),De.unref(),$e.unref()}}})},insertText(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};D.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:o=e.selection}=n;if(o){if(P.isPath(o)&&(o=D.range(e,o)),L.isRange(o))if(L.isCollapsed(o))o=o.anchor;else{var i=L.end(o);if(!r&&D.void(e,{at:i}))return;var a=D.pointRef(e,i);N.delete(e,{at:o,voids:r}),o=a.unref(),N.setSelection(e,{anchor:o,focus:o})}if(!(!r&&D.void(e,{at:o}))){var{path:u,offset:s}=o;t.length>0&&e.apply({type:"insert_text",path:u,offset:s,text:t})}}})}};function iD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function uh(e){for(var t=1;t-1&&e%1==0&&e-1&&e%1==0&&e<=K_}function uk(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function sk(e){return!!e&&typeof e=="object"}function SM(e){return typeof e=="string"||!ik(e)&&sk(e)&&cp.call(e)==Tj}function DM(e){if(!e)return[];if(z3(e))return SM(e)?tM(e):vM(e);if(Tm&&e[Tm])return Jj(e[Tm]());var t=Ja(e),n=t==$w?Zj:t==Ew?eM:xM;return n(e)}function CM(e){return z3(e)?dM(e):gM(e)}function xM(e){return e?Gj(e,CM(e)):[]}var fD=DM;function dD(e){return e!==null&&typeof e=="object"&&"constructor"in e&&e.constructor===Object}function V3(e,t){e===void 0&&(e={}),t===void 0&&(t={}),Object.keys(t).forEach(function(n){typeof e[n]>"u"?e[n]=t[n]:dD(t[n])&&dD(e[n])&&Object.keys(t[n]).length>0&&V3(e[n],t[n])})}var lk={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function dp(){var e=typeof document<"u"?document:{};return V3(e,lk),e}var AM={document:lk,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame:function(e){typeof setTimeout>"u"||clearTimeout(e)}};function qu(){var e=typeof window<"u"?window:{};return V3(e,AM),e}function OM(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function kw(e){return kw=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},kw(e)}function Ug(e,t){return Ug=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},Ug(e,t)}function _M(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function cg(e,t,n){return _M()?cg=Reflect.construct:cg=function(o,i,a){var u=[null];u.push.apply(u,i);var s=Function.bind.apply(o,u),l=new s;return a&&Ug(l,a.prototype),l},cg.apply(null,arguments)}function kM(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Tw(e){var t=typeof Map=="function"?new Map:void 0;return Tw=function(r){if(r===null||!kM(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,o)}function o(){return cg(r,arguments,kw(this).constructor)}return o.prototype=Object.create(r.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Ug(o,r)},Tw(e)}function TM(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FM(e){var t=e.__proto__;Object.defineProperty(e,"__proto__",{get:function(){return t},set:function(r){t.__proto__=r}})}var Gi=function(e){OM(t,e);function t(n){var r;return r=e.call.apply(e,[this].concat(n))||this,FM(TM(r)),r}return t}(Tw(Array));function Rv(e){e===void 0&&(e=[]);var t=[];return e.forEach(function(n){Array.isArray(n)?t.push.apply(t,Rv(n)):t.push(n)}),t}function ck(e,t){return Array.prototype.filter.call(e,t)}function BM(e){for(var t=[],n=0;n=0&&i.indexOf(">")>=0){var a="div";i.indexOf("0}).length>0}function Oo(e,t){if(arguments.length===1&&typeof e=="string")return this[0]?this[0].getAttribute(e):void 0;for(var n=0;n=0&&(t[PM(o.name.split("data-")[1])]=o.value)}for(var i in t)t[i]==="false"?t[i]=!1:t[i]==="true"?t[i]=!0:parseFloat(t[i])===t[i]*1&&(t[i]*=1);return t}}function _o(e){if(typeof e>"u"){var t=this[0];if(!t)return;if(t.multiple&&t.nodeName.toLowerCase()==="select"){for(var n=[],r=0;r=0;else i.value=e}return this}function ko(){for(var e=arguments.length,t=new Array(e),n=0;n=0;p-=1){var g=d[p];i&&g.listener===i||i&&g.listener&&g.listener.dom7proxy&&g.listener.dom7proxy===i?(f.removeEventListener(l,g.proxyListener,a),d.splice(p,1)):i||(f.removeEventListener(l,g.proxyListener,a),d.splice(p,1))}}return this}function qg(){var e=qu();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null}function Gg(){var e=qu();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null}function hD(){if(this.length>0){var e=qu(),t=dp(),n=this[0],r=n.getBoundingClientRect(),o=t.body,i=n.clientTop||o.clientTop||0,a=n.clientLeft||o.clientLeft||0,u=n===e?e.scrollY:n.scrollTop,s=n===e?e.scrollX:n.scrollLeft;return{top:r.top+u-i,left:r.left+s-a}}return null}function $l(){for(var e=0;e"u")return this[0]?this[0].innerHTML:null;for(var t=0;t"u")return this[0]?this[0].textContent.trim():null;for(var t=0;t"u")return!1;if(typeof e=="string"){if(r.matches)return r.matches(e);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(r.msMatchesSelector)return r.msMatchesSelector(e);for(o=O(e),i=0;i=0;r-=1)this[n].insertBefore(o.childNodes[r],this[n].childNodes[0])}else if(e instanceof Gi)for(r=0;r"u"){for(var i=0;i-1&&e%1==0&&e-1&&e%1==0&&e<=dk}function az(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function uz(e){return!!e&&typeof e=="object"}function sz(e){return U3(e)?qM(e):XM(e)}function lz(e){return e}var W3=tz;{if(typeof navigator<"u"&&navigator.product==="ReactNative"&&typeof crypto>"u")throw new Error("React Native does not have a built-in secure random generator. If you don’t need unpredictable IDs use `nanoid/non-secure`. For secure IDs, import `react-native-get-random-values` before Nano ID.");if(typeof msCrypto<"u"&&typeof crypto>"u")throw new Error("Import file with `if (!window.crypto) window.crypto = window.msCrypto` before importing Nano ID to fix IE 11 support");if(typeof crypto>"u")throw new Error("Your browser does not have secure random generator. If you don’t need unpredictable IDs, you can use nanoid/non-secure.")}let gk=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=n[e]&63;r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r<63?t+="_":t+="-"}return t};var vk="Expected a function",bD=0/0,cz="[object Symbol]",fz=/^\s+|\s+$/g,dz=/^[-+]0x[0-9a-f]+$/i,pz=/^0b[01]+$/i,hz=/^0o[0-7]+$/i,gz=parseInt,vz=typeof St=="object"&&St&&St.Object===Object&&St,mz=typeof self=="object"&&self&&self.Object===Object&&self,yz=vz||mz||Function("return this")(),bz=Object.prototype,wz=bz.toString,$z=Math.max,Ez=Math.min,Fm=function(){return yz.Date.now()};function Sz(e,t,n){var r,o,i,a,u,s,l=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(vk);t=wD(t)||0,e0(n)&&(c=!!n.leading,f="maxWait"in n,i=f?$z(wD(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function p(S){var x=r,B=o;return r=o=void 0,l=S,a=e.apply(B,x),a}function g(S){return l=S,u=setTimeout(y,t),c?p(S):a}function v(S){var x=S-s,B=S-l,I=t-x;return f?Ez(I,i-B):I}function h(S){var x=S-s,B=S-l;return s===void 0||x>=t||x<0||f&&B>=i}function y(){var S=Fm();if(h(S))return b(S);u=setTimeout(y,v(S))}function b(S){return u=void 0,d&&r?p(S):(r=o=void 0,a)}function m(){u!==void 0&&clearTimeout(u),l=0,r=s=o=u=void 0}function $(){return u===void 0?a:b(Fm())}function E(){var S=Fm(),x=h(S);if(r=arguments,o=this,s=S,x){if(u===void 0)return g(s);if(f)return u=setTimeout(y,t),p(s)}return u===void 0&&(u=setTimeout(y,t)),a}return E.cancel=m,E.flush=$,E}function Dz(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(vk);return e0(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Sz(e,t,{leading:r,maxWait:t,trailing:o})}function e0(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Cz(e){return!!e&&typeof e=="object"}function xz(e){return typeof e=="symbol"||Cz(e)&&wz.call(e)==cz}function wD(e){if(typeof e=="number")return e;if(xz(e))return bD;if(e0(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=e0(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(fz,"");var n=pz.test(e);return n||hz.test(e)?gz(e.slice(2),n?2:8):dz.test(e)?bD:+e}var Tu=Dz;function Az(e,t){return document.createElement(e,t)}function Oz(e,t,n){return document.createElementNS(e,t,n)}function _z(e){return document.createTextNode(e)}function kz(e){return document.createComment(e)}function Tz(e,t,n){e.insertBefore(t,n)}function Fz(e,t){e.removeChild(t)}function Bz(e,t){e.appendChild(t)}function Pz(e){return e.parentNode}function Iz(e){return e.nextSibling}function Nz(e){return e.tagName}function Rz(e,t){e.textContent=t}function Lz(e){return e.textContent}function jz(e){return e.nodeType===1}function Mz(e){return e.nodeType===3}function zz(e){return e.nodeType===8}const Vz={createElement:Az,createElementNS:Oz,createTextNode:_z,createComment:kz,insertBefore:Tz,removeChild:Fz,appendChild:Bz,parentNode:Pz,nextSibling:Iz,tagName:Nz,setTextContent:Rz,getTextContent:Lz,isElement:jz,isText:Mz,isComment:zz};function bd(e,t,n,r,o){const i=t===void 0?void 0:t.key;return{sel:e,data:t,children:n,text:r,elm:o,key:i}}const Fw=Array.isArray;function fg(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Bm(e){return e===void 0}function Xn(e){return e!==void 0}const $D=bd("",{},[],void 0,void 0);function $c(e,t){var n,r;const o=e.key===t.key,i=((n=e.data)===null||n===void 0?void 0:n.is)===((r=t.data)===null||r===void 0?void 0:r.is);return e.sel===t.sel&&o&&i}function Hz(e){return e.sel!==void 0}function Uz(e,t,n){var r;const o={};for(let i=t;i<=n;++i){const a=(r=e[i])===null||r===void 0?void 0:r.key;a!==void 0&&(o[a]=i)}return o}const Wz=["create","update","remove","destroy","pre","post"];function qz(e,t){const n={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},r=t!==void 0?t:Vz;for(const d of Wz)for(const p of e){const g=p[d];g!==void 0&&n[d].push(g)}function o(d){const p=d.id?"#"+d.id:"",g=d.getAttribute("class"),v=g?"."+g.split(" ").join("."):"";return bd(r.tagName(d).toLowerCase()+p+v,{},[],void 0,d)}function i(d,p){return function(){if(--p===0){const v=r.parentNode(d);r.removeChild(v,d)}}}function a(d,p){var g,v;let h,y=d.data;if(y!==void 0){const $=(g=y.hook)===null||g===void 0?void 0:g.init;Xn($)&&($(d),y=d.data)}const b=d.children,m=d.sel;if(m==="!")Bm(d.text)&&(d.text=""),d.elm=r.createComment(d.text);else if(m!==void 0){const $=m.indexOf("#"),E=m.indexOf(".",$),S=$>0?$:m.length,x=E>0?E:m.length,B=$!==-1||E!==-1?m.slice(0,Math.min(S,x)):m,I=d.elm=Xn(y)&&Xn(h=y.ns)?r.createElementNS(h,B,y):r.createElement(B,y);for(S0&&I.setAttribute("class",m.slice(x+1).replace(/\./g," ")),h=0;hb?(G=g[E+1]==null?null:g[E+1].elm,u(d,G,g,y,E,v)):l(d,p,h,b))}function f(d,p,g){var v,h,y,b,m;const $=(v=p.data)===null||v===void 0?void 0:v.hook;(h=$==null?void 0:$.prepatch)===null||h===void 0||h.call($,d,p);const E=p.elm=d.elm,S=d.children,x=p.children;if(d!==p){if(p.data!==void 0){for(let B=0;Bo?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r=r?e:zV(e,t,n)}function UV(e){return function(t){t=Mv(t);var n=Ik(t)?NV(t):void 0,r=n?n[0]:t.charAt(0),o=n?HV(n,1).join(""):t.slice(1);return r[e]()+o}}function WV(e){return function(t){return kV(ZV(XV(t).replace(wV,"")),e,"")}}function qV(e){return!!e&&typeof e=="object"}function GV(e){return typeof e=="symbol"||qV(e)&&MV.call(e)==aV}function Mv(e){return e==null?"":VV(e)}var KV=WV(function(e,t,n){return t=t.toLowerCase(),e+(n?YV(t):t)});function YV(e){return JV(Mv(e).toLowerCase())}function XV(e){return e=Mv(e),e&&e.replace(sV,PV).replace($V,"")}var JV=UV("toUpperCase");function ZV(e,t,n){return e=Mv(e),t=n?void 0:t,t===void 0?IV(e)?LV(e):FV(e):e.match(t)||[]}var QV=KV,eH=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Im={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Nk={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:eH?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Y3={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222};for(var sh=1;sh<20;sh++)Y3["f"+sh]=111+sh;function Rk(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(a){return nH(a,t)}),o=function(u){return r.some(function(s){return rH(s,u)})},i=n==null?o:o(n);return i}function tH(e,t){return Rk(e,{byKey:!0},t)}function nH(e,t){var n=t&&t.byKey,r={};e=e.replace("++","+add");var o=e.split("+"),i=o.length;for(var a in Im)r[Im[a]]=!1;var u=!0,s=!1,l=void 0;try{for(var c=o[Symbol.iterator](),f;!(u=(f=c.next()).done);u=!0){var d=f.value,p=d.endsWith("?")&&d.length>1;p&&(d=d.slice(0,-1));var g=Lk(d),v=Im[g];if(d.length>1&&!v&&!Nk[d]&&!Y3[g])throw new TypeError('Unknown modifier: "'+d+'"');(i===1||!v)&&(n?r.key=g:r.which=oH(d)),v&&(r[v]=p?null:!0)}}catch(h){s=!0,l=h}finally{try{!u&&c.return&&c.return()}finally{if(s)throw l}}return r}function rH(e,t){for(var n in e){var r=e[n],o=void 0;if(r!=null&&(n==="key"&&t.key!=null?o=t.key.toLowerCase():n==="which"?o=r===91&&t.which===93?91:t.which:o=t[n],!(o==null&&r===!1)&&o!==r))return!1}return!0}function oH(e){e=Lk(e);var t=Y3[e]||e.toUpperCase().charCodeAt(0);return t}function Lk(e){return e=e.toLowerCase(),e=Nk[e]||e,e}var iH=Rk,Nm=tH,aH="Expected a function",ID=0/0,uH="[object Symbol]",sH=/^\s+|\s+$/g,lH=/^[-+]0x[0-9a-f]+$/i,cH=/^0b[01]+$/i,fH=/^0o[0-7]+$/i,dH=parseInt,pH=typeof St=="object"&&St&&St.Object===Object&&St,hH=typeof self=="object"&&self&&self.Object===Object&&self,gH=pH||hH||Function("return this")(),vH=Object.prototype,mH=vH.toString,yH=Math.max,bH=Math.min,Rm=function(){return gH.Date.now()};function wH(e,t,n){var r,o,i,a,u,s,l=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(aH);t=ND(t)||0,Iw(n)&&(c=!!n.leading,f="maxWait"in n,i=f?yH(ND(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function p(S){var x=r,B=o;return r=o=void 0,l=S,a=e.apply(B,x),a}function g(S){return l=S,u=setTimeout(y,t),c?p(S):a}function v(S){var x=S-s,B=S-l,I=t-x;return f?bH(I,i-B):I}function h(S){var x=S-s,B=S-l;return s===void 0||x>=t||x<0||f&&B>=i}function y(){var S=Rm();if(h(S))return b(S);u=setTimeout(y,v(S))}function b(S){return u=void 0,d&&r?p(S):(r=o=void 0,a)}function m(){u!==void 0&&clearTimeout(u),l=0,r=s=o=u=void 0}function $(){return u===void 0?a:b(Rm())}function E(){var S=Rm(),x=h(S);if(r=arguments,o=this,s=S,x){if(u===void 0)return g(s);if(f)return u=setTimeout(y,t),p(s)}return u===void 0&&(u=setTimeout(y,t)),a}return E.cancel=m,E.flush=$,E}function Iw(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function $H(e){return!!e&&typeof e=="object"}function EH(e){return typeof e=="symbol"||$H(e)&&mH.call(e)==uH}function ND(e){if(typeof e=="number")return e;if(EH(e))return ID;if(Iw(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Iw(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(sH,"");var n=cH.test(e);return n||fH.test(e)?dH(e.slice(2),n?2:8):lH.test(e)?ID:+e}var jk=wH,Mk=j3(function(e,t){var n=200,r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Array]",u="[object Boolean]",s="[object Date]",l="[object Error]",c="[object Function]",f="[object GeneratorFunction]",d="[object Map]",p="[object Number]",g="[object Object]",v="[object Promise]",h="[object RegExp]",y="[object Set]",b="[object String]",m="[object Symbol]",$="[object WeakMap]",E="[object ArrayBuffer]",S="[object DataView]",x="[object Float32Array]",B="[object Float64Array]",I="[object Int8Array]",H="[object Int16Array]",G="[object Int32Array]",Y="[object Uint8Array]",U="[object Uint8ClampedArray]",ie="[object Uint16Array]",re="[object Uint32Array]",ae=/[\\^$.*+?()[\]{}|]/g,me=/\w*$/,De=/^\[object .+?Constructor\]$/,$e=/^(?:0|[1-9]\d*)$/,le={};le[i]=le[a]=le[E]=le[S]=le[u]=le[s]=le[x]=le[B]=le[I]=le[H]=le[G]=le[d]=le[p]=le[g]=le[h]=le[y]=le[b]=le[m]=le[Y]=le[U]=le[ie]=le[re]=!0,le[l]=le[c]=le[$]=!1;var Me=typeof St=="object"&&St&&St.Object===Object&&St,T=typeof self=="object"&&self&&self.Object===Object&&self,_=Me||T||Function("return this")(),F=t&&!t.nodeType&&t,R=F&&!0&&e&&!e.nodeType&&e,q=R&&R.exports===F;function j(w,C){return w.set(C[0],C[1]),w}function ue(w,C){return w.add(C),w}function be(w,C){for(var k=-1,M=w?w.length:0;++k-1}function K1(w,C){var k=this.__data__,M=rs(k,w);return M<0?k.push([w,C]):k[M][1]=C,this}cn.prototype.clear=U1,cn.prototype.delete=W1,cn.prototype.get=q1,cn.prototype.has=G1,cn.prototype.set=K1;function $n(w){var C=-1,k=w?w.length:0;for(this.clear();++C-1&&w%1==0&&w-1&&w%1==0&&w<=o}function io(w){var C=typeof w;return!!w&&(C=="object"||C=="function")}function rh(w){return!!w&&typeof w=="object"}function yc(w){return as(w)?ns(w):lm(w)}function Em(){return[]}function Sm(){return!1}e.exports=Qp}),SH=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},ls;function RD(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var DH=0;function CH(e){return"__private_"+DH+++"_"+e}function xH(e,t,n){const r=[];return e.forEach(o=>typeof o!="string"?r.push(o):t[Symbol.split](o).forEach((i,a,u)=>{i!==""&&r.push(i),a"u")throw new Error("React Native does not have a built-in secure random generator. If you don’t need unpredictable IDs use `nanoid/non-secure`. For secure IDs, import `react-native-get-random-values` before Nano ID.");if(typeof msCrypto<"u"&&typeof crypto>"u")throw new Error("Import file with `if (!window.crypto) window.crypto = window.msCrypto` before importing Nano ID to fix IE 11 support");if(typeof crypto>"u")throw new Error("Your browser does not have secure random generator. If you don’t need unpredictable IDs, you can use nanoid/non-secure.")}let Hk=e=>crypto.getRandomValues(new Uint8Array(e)),Uk=(e,t,n)=>{let r=(2<{let i="";for(;;){let a=n(o),u=o;for(;u--;)if(i+=e[a[u]&r]||"",i.length===t)return i}}},TH=(e,t)=>Uk(e,t,Hk),FH=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=n[e]&63;r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r<63?t+="_":t+="-"}return t};var BH={nanoid:FH,customAlphabet:TH,customRandom:Uk,urlAlphabet:kH,random:Hk},Lm=function(t){if(typeof t!="number"||isNaN(t))throw new TypeError("Expected a number, got "+typeof t);var n=t<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(n&&(t=-t),t<1)return(n?"-":"")+t+" B";var o=Math.min(Math.floor(Math.log(t)/Math.log(1024)),r.length-1);t=Number(t/Math.pow(1024,o));var i=r[o];return t>=10||t%1===0?(n?"-":"")+t.toFixed(0)+" "+i:(n?"-":"")+t.toFixed(1)+" "+i};function Wk(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}Wk.prototype.match=function(e){var t=!0,n=this.parts,r,o=n.length,i;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(i=(e||"").split(this.separator),r=0;t&&r=2}return t?n(t.split(";")[0]):n};function RH(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var LH=0;function jH(e){return"__private_"+LH+++"_"+e}var jm=jH("publish");class qk{constructor(){Object.defineProperty(this,jm,{value:MH}),this.state={},this.callbacks=[]}getState(){return this.state}setState(t){const n={...this.state},r={...this.state,...t};this.state=r,RH(this,jm)[jm](n,r,t)}subscribe(t){return this.callbacks.push(t),()=>{this.callbacks.splice(this.callbacks.indexOf(t),1)}}}function MH(){for(var e=arguments.length,t=new Array(e),n=0;n{r(...t)})}qk.VERSION="2.0.3";var zH=function(){return new qk},Gk=function(t){const n=t.lastIndexOf(".");return n===-1||n===t.length-1?{name:t,extension:void 0}:{name:t.slice(0,n),extension:t.slice(n+1)}},jD={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"},VH=function(t){var n;if(t.type)return t.type;const r=t.name?(n=Gk(t.name).extension)==null?void 0:n.toLowerCase():null;return r&&r in jD?jD[r]:"application/octet-stream"};function HH(e){return e.charCodeAt(0).toString(32)}function MD(e){let t="";return e.replace(/[^A-Z0-9]/ig,n=>(t+=`-${HH(n)}`,"/"))+t}var UH=function(t){let n="uppy";return typeof t.name=="string"&&(n+=`-${MD(t.name.toLowerCase())}`),t.type!==void 0&&(n+=`-${t.type}`),t.meta&&typeof t.meta.relativePath=="string"&&(n+=`-${MD(t.meta.relativePath.toLowerCase())}`),t.data.size!==void 0&&(n+=`-${t.data.size}`),t.data.lastModified!==void 0&&(n+=`-${t.data.lastModified}`),n},WH=function(t){if(t==null&&(t=typeof navigator<"u"?navigator.userAgent:null),!t)return!0;const n=/Edge\/(\d+\.\d+)/.exec(t);if(!n)return!0;const r=n[1];let[o,i]=r.split(".");return o=parseInt(o,10),i=parseInt(i,10),o<15||o===15&&i<15063||o>18||o===18&&i>=18218},qH=function(t,n){return n.name?n.name:t.split("/")[0]==="image"?`${t.split("/")[0]}.${t.split("/")[1]}`:"noname"};function Mm(e){return e<10?`0${e}`:e.toString()}var dg=function(){const t=new Date,n=Mm(t.getHours()),r=Mm(t.getMinutes()),o=Mm(t.getSeconds());return`${n}:${r}:${o}`};const GH={debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n"u"&&(globalThis.AggregateError=class extends Error{constructor(t,n){super(n),this.errors=t}});class eU extends AggregateError{constructor(){super(...arguments),this.isRestriction=!0}}var dn=Jt("plugins"),Ec=Jt("storeUnsubscribe"),Ko=Jt("emitter"),nu=Jt("preProcessors"),ru=Jt("uploaders"),Zo=Jt("postProcessors"),Hf=Jt("checkRestrictions"),zm=Jt("checkMinNumberOfFiles"),wd=Jt("checkRequiredMetaFieldsOnFile"),Vm=Jt("checkRequiredMetaFields"),tn=Jt("showOrLogErrorAndThrow"),Sc=Jt("assertNewUploadAllowed"),Dc=Jt("checkAndCreateFileStateObject"),Cc=Jt("startIfAutoProceed"),Hm=Jt("addListeners"),zr=Jt("updateOnlineStatus"),Yo=Jt("createUpload"),Um=Jt("getUpload"),uu=Jt("removeUpload"),Xo=Jt("runUpload");Xk=Symbol.for("uppy test: getPlugins");Jk=Symbol.for("uppy test: createUpload");class Zk{constructor(t){Object.defineProperty(this,Xo,{value:pU}),Object.defineProperty(this,uu,{value:dU}),Object.defineProperty(this,Um,{value:fU}),Object.defineProperty(this,Yo,{value:cU}),Object.defineProperty(this,Hm,{value:lU}),Object.defineProperty(this,Cc,{value:sU}),Object.defineProperty(this,Dc,{value:uU}),Object.defineProperty(this,Sc,{value:aU}),Object.defineProperty(this,tn,{value:iU}),Object.defineProperty(this,Vm,{value:oU}),Object.defineProperty(this,wd,{value:rU}),Object.defineProperty(this,zm,{value:nU}),Object.defineProperty(this,Hf,{value:tU}),Object.defineProperty(this,dn,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,Ec,{writable:!0,value:void 0}),Object.defineProperty(this,Ko,{writable:!0,value:Vk()}),Object.defineProperty(this,nu,{writable:!0,value:new Set}),Object.defineProperty(this,ru,{writable:!0,value:new Set}),Object.defineProperty(this,Zo,{writable:!0,value:new Set}),Object.defineProperty(this,zr,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=YH;const n={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:{maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},meta:{},onBeforeFileAdded:r=>r,onBeforeUpload:r=>r,store:zH(),logger:ZH,infoTimeout:5e3};if(this.opts={...n,...t,restrictions:{...n.restrictions,...t&&t.restrictions}},t&&t.logger&&t.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):t&&t.debug&&(this.opts.logger=QH),this.log(`Using Core v${this.constructor.VERSION}`),this.opts.restrictions.allowedFileTypes&&this.opts.restrictions.allowedFileTypes!==null&&!Array.isArray(this.opts.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");this.i18nInit(),this.calculateProgress=Tu(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:WH(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),ce(this,Ec)[Ec]=this.store.subscribe((r,o,i)=>{this.emit("state-update",r,o,i),this.updateAll(o)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),ce(this,Hm)[Hm]()}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{n.update(t)})}setState(t){this.store.setState(t)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(t,n){if(!this.getState().files[t])throw new Error(`Can’t set state for ${t} (the file could have been removed)`);this.setState({files:{...this.getState().files,[t]:{...this.getState().files[t],...n}}})}i18nInit(){const t=new zk([this.defaultLocale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(t){this.opts={...this.opts,...t,restrictions:{...this.opts.restrictions,...t&&t.restrictions}},t.meta&&this.setMeta(t.meta),this.i18nInit(),t.locale&&this.iteratePlugins(n=>{n.setOptions()}),this.setState()}resetProgress(){const t={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},n={...this.getState().files},r={};Object.keys(n).forEach(o=>{const i={...n[o]};i.progress={...i.progress,...t},r[o]=i}),this.setState({files:r,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(t){ce(this,nu)[nu].add(t)}removePreProcessor(t){return ce(this,nu)[nu].delete(t)}addPostProcessor(t){ce(this,Zo)[Zo].add(t)}removePostProcessor(t){return ce(this,Zo)[Zo].delete(t)}addUploader(t){ce(this,ru)[ru].add(t)}removeUploader(t){return ce(this,ru)[ru].delete(t)}setMeta(t){const n={...this.getState().meta,...t},r={...this.getState().files};Object.keys(r).forEach(o=>{r[o]={...r[o],meta:{...r[o].meta,...t}}}),this.log("Adding metadata:"),this.log(t),this.setState({meta:n,files:r})}setFileMeta(t,n){const r={...this.getState().files};if(!r[t]){this.log("Was trying to set metadata for a file that has been removed: ",t);return}const o={...r[t].meta,...n};r[t]={...r[t],meta:o},this.setState({files:r})}getFile(t){return this.getState().files[t]}getFiles(){const{files:t}=this.getState();return Object.values(t)}getObjectOfFilesPerState(){const{files:t,totalProgress:n,error:r}=this.getState(),o=Object.values(t),i=o.filter(g=>{let{progress:v}=g;return!v.uploadComplete&&v.uploadStarted}),a=o.filter(g=>!g.progress.uploadStarted),u=o.filter(g=>g.progress.uploadStarted||g.progress.preprocess||g.progress.postprocess),s=o.filter(g=>g.progress.uploadStarted),l=o.filter(g=>g.isPaused),c=o.filter(g=>g.progress.uploadComplete),f=o.filter(g=>g.error),d=i.filter(g=>!g.isPaused),p=o.filter(g=>g.progress.preprocess||g.progress.postprocess);return{newFiles:a,startedFiles:u,uploadStartedFiles:s,pausedFiles:l,completeFiles:c,erroredFiles:f,inProgressFiles:i,inProgressNotPausedFiles:d,processingFiles:p,isUploadStarted:s.length>0,isAllComplete:n===100&&c.length===o.length&&p.length===0,isAllErrored:!!r&&f.length===o.length,isAllPaused:i.length!==0&&l.length===i.length,isUploadInProgress:i.length>0,isSomeGhost:o.some(g=>g.isGhost)}}validateRestrictions(t,n){try{return ce(this,Hf)[Hf](t,n),{result:!0}}catch(r){return{result:!1,reason:r.message}}}checkIfFileAlreadyExists(t){const{files:n}=this.getState();return!!(n[t]&&!n[t].isGhost)}addFile(t){ce(this,Sc)[Sc](t);const{files:n}=this.getState();let r=ce(this,Dc)[Dc](n,t);return n[r.id]&&n[r.id].isGhost&&(r={...n[r.id],data:t.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${r.name}, ${r.id}`)),this.setState({files:{...n,[r.id]:r}}),this.emit("file-added",r),this.emit("files-added",[r]),this.log(`Added file: ${r.name}, ${r.id}, mime type: ${r.type}`),ce(this,Cc)[Cc](),r.id}addFiles(t){ce(this,Sc)[Sc]();const n={...this.getState().files},r=[],o=[];for(let i=0;i{this.emit("file-added",i)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.keys(r).forEach(i=>{this.log(`Added file: ${r[i].name} id: ${r[i].id} type: ${r[i].type}`)}),r.length>0&&ce(this,Cc)[Cc](),o.length>0){let i=`Multiple errors occurred while adding files: `;if(o.forEach(a=>{i+=` * ${a.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:i},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(o,i);{const a=new Error(i);throw a.errors=o,a}}}removeFiles(t,n){const{files:r,currentUploads:o}=this.getState(),i={...r},a={...o},u=Object.create(null);t.forEach(f=>{r[f]&&(u[f]=r[f],delete i[f])});function s(f){return u[f]===void 0}Object.keys(a).forEach(f=>{const d=o[f].fileIDs.filter(s);if(d.length===0){delete a[f];return}a[f]={...o[f],fileIDs:d}});const l={currentUploads:a,files:i};Object.keys(i).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.calculateTotalProgress();const c=Object.keys(u);c.forEach(f=>{this.emit("file-removed",u[f],n)}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(t,n){n===void 0&&(n=null),this.removeFiles([t],n)}pauseResume(t){if(!this.getState().capabilities.resumableUploads||this.getFile(t).uploadComplete)return;const r=!(this.getFile(t).isPaused||!1);return this.setFileState(t,{isPaused:r}),this.emit("upload-pause",t,r),r}pauseAll(){const t={...this.getState().files};Object.keys(t).filter(r=>!t[r].progress.uploadComplete&&t[r].progress.uploadStarted).forEach(r=>{const o={...t[r],isPaused:!0};t[r]=o}),this.setState({files:t}),this.emit("pause-all")}resumeAll(){const t={...this.getState().files};Object.keys(t).filter(r=>!t[r].progress.uploadComplete&&t[r].progress.uploadStarted).forEach(r=>{const o={...t[r],isPaused:!1,error:null};t[r]=o}),this.setState({files:t}),this.emit("resume-all")}retryAll(){const t={...this.getState().files},n=Object.keys(t).filter(o=>t[o].error);if(n.forEach(o=>{const i={...t[o],isPaused:!1,error:null};t[o]=i}),this.setState({files:t,error:null}),this.emit("retry-all",n),n.length===0)return Promise.resolve({successful:[],failed:[]});const r=ce(this,Yo)[Yo](n,{forceAllowNewUpload:!0});return ce(this,Xo)[Xo](r)}cancelAll(){this.emit("cancel-all");const{files:t}=this.getState(),n=Object.keys(t);n.length&&this.removeFiles(n,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}retryUpload(t){this.setFileState(t,{error:null,isPaused:!1}),this.emit("upload-retry",t);const n=ce(this,Yo)[Yo]([t],{forceAllowNewUpload:!0});return ce(this,Xo)[Xo](n)}reset(){this.cancelAll()}logout(){this.iteratePlugins(t=>{t.provider&&t.provider.logout&&t.provider.logout()})}calculateProgress(t,n){if(!this.getFile(t.id)){this.log(`Not setting progress for a file that has been removed: ${t.id}`);return}const r=Number.isFinite(n.bytesTotal)&&n.bytesTotal>0;this.setFileState(t.id,{progress:{...this.getFile(t.id).progress,bytesUploaded:n.bytesUploaded,bytesTotal:n.bytesTotal,percentage:r?Math.round(n.bytesUploaded/n.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const n=this.getFiles().filter(l=>l.progress.uploadStarted||l.progress.preprocess||l.progress.postprocess);if(n.length===0){this.emit("progress",0),this.setState({totalProgress:0});return}const r=n.filter(l=>l.progress.bytesTotal!=null),o=n.filter(l=>l.progress.bytesTotal==null);if(r.length===0){const l=n.length*100,c=o.reduce((d,p)=>d+p.progress.percentage,0),f=Math.round(c/l*100);this.setState({totalProgress:f});return}let i=r.reduce((l,c)=>l+c.progress.bytesTotal,0);const a=i/r.length;i+=a*o.length;let u=0;r.forEach(l=>{u+=l.progress.bytesUploaded}),o.forEach(l=>{u+=a*(l.progress.percentage||0)/100});let s=i===0?0:Math.round(u/i*100);s>100&&(s=100),this.setState({totalProgress:s}),this.emit("progress",s)}updateOnlineStatus(){(typeof window.navigator.onLine<"u"?window.navigator.onLine:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(t,n){if(typeof t!="function"){const a=`Expected a plugin class, but got ${t===null?"null":typeof t}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(a)}const r=new t(this,n),o=r.id;if(!o)throw new Error("Your plugin must have an id");if(!r.type)throw new Error("Your plugin must have a type");const i=this.getPlugin(o);if(i){const a=`Already found a plugin named '${i.id}'. Tried to use: '${o}'. Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(a)}return t.VERSION&&this.log(`Using ${o} v${t.VERSION}`),r.type in ce(this,dn)[dn]?ce(this,dn)[dn][r.type].push(r):ce(this,dn)[dn][r.type]=[r],r.install(),this}getPlugin(t){for(const n of Object.values(ce(this,dn)[dn])){const r=n.find(o=>o.id===t);if(r!=null)return r}}[Xk](t){return ce(this,dn)[dn][t]}iteratePlugins(t){Object.values(ce(this,dn)[dn]).flat(1).forEach(t)}removePlugin(t){this.log(`Removing plugin ${t.id}`),this.emit("plugin-remove",t),t.uninstall&&t.uninstall();const n=ce(this,dn)[dn][t.type],r=n.findIndex(a=>a.id===t.id);r!==-1&&n.splice(r,1);const i={plugins:{...this.getState().plugins,[t.id]:void 0}};this.setState(i)}close(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.reset(),ce(this,Ec)[Ec](),this.iteratePlugins(t=>{this.removePlugin(t)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",ce(this,zr)[zr]),window.removeEventListener("offline",ce(this,zr)[zr]))}hideInfo(){const{info:t}=this.getState();this.setState({info:t.slice(1)}),this.emit("info-hidden")}info(t,n,r){n===void 0&&(n="info"),r===void 0&&(r=3e3);const o=typeof t=="object";this.setState({info:[...this.getState().info,{type:n,message:o?t.message:t,details:o?t.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(t,n){const{logger:r}=this.opts;switch(n){case"error":r.error(t);break;case"warning":r.warn(t);break;default:r.debug(t);break}}restore(t){return this.log(`Core: attempting to restore upload "${t}"`),this.getState().currentUploads[t]?ce(this,Xo)[Xo](t):(ce(this,uu)[uu](t),Promise.reject(new Error("Nonexistent upload")))}[Jk](){return ce(this,Yo)[Yo](...arguments)}addResultData(t,n){if(!ce(this,Um)[Um](t)){this.log(`Not setting result for an upload that has been removed: ${t}`);return}const{currentUploads:r}=this.getState(),o={...r[t],result:{...r[t].result,...n}};this.setState({currentUploads:{...r,[t]:o}})}upload(){var t;(t=ce(this,dn)[dn].uploader)!=null&&t.length||this.log("No uploader type plugins are used","warning");let{files:n}=this.getState();const r=this.opts.onBeforeUpload(n);return r===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&typeof r=="object"&&(n=r,this.setState({files:n})),Promise.resolve().then(()=>{ce(this,zm)[zm](n),ce(this,Vm)[Vm](n)}).catch(o=>{ce(this,tn)[tn](o)}).then(()=>{const{currentUploads:o}=this.getState(),i=Object.values(o).flatMap(s=>s.fileIDs),a=[];Object.keys(n).forEach(s=>{const l=this.getFile(s);!l.progress.uploadStarted&&i.indexOf(s)===-1&&a.push(l.id)});const u=ce(this,Yo)[Yo](a);return ce(this,Xo)[Xo](u)}).catch(o=>{ce(this,tn)[tn](o,{showInformer:!1})}))}}function tU(e,t){t===void 0&&(t=this.getFiles());const{maxFileSize:n,minFileSize:r,maxTotalFileSize:o,maxNumberOfFiles:i,allowedFileTypes:a}=this.opts.restrictions;if(i&&t.length+1>i)throw new yo(`${this.i18n("youCanOnlyUploadX",{smart_count:i})}`);if(a&&!a.some(s=>s.indexOf("/")>-1?e.type?NH(e.type.replace(/;.*?$/,""),s):!1:s[0]==="."&&e.extension?e.extension.toLowerCase()===s.substr(1).toLowerCase():!1)){const s=a.join(", ");throw new yo(this.i18n("youCanOnlyUploadFileTypes",{types:s}))}if(o&&e.size!=null){let u=0;if(u+=e.size,t.forEach(s=>{u+=s.size}),u>o)throw new yo(this.i18n("exceedsSize",{size:Lm(o),file:e.name}))}if(n&&e.size!=null&&e.size>n)throw new yo(this.i18n("exceedsSize",{size:Lm(n),file:e.name}));if(r&&e.size!=null&&e.size{const r=this.getFile(n);return ce(this,wd)[wd](r)});if(t.length)throw new eU(t,`${this.i18n("missingRequiredMetaField")}`)}function iU(e,t){let{showInformer:n=!0,file:r=null,throwErr:o=!0}=t===void 0?{}:t;const i=typeof e=="object"?e.message:e,a=typeof e=="object"&&e.details?e.details:"";let u=i;if(a&&(u+=` ${a}`),e.isRestriction?(this.log(u),this.emit("restriction-failed",r,e)):this.log(u,"error"),n&&this.info({message:i,details:a},"error",this.opts.infoTimeout),o)throw typeof e=="object"?e:new Error(e)}function aU(e){const{allowNewUpload:t}=this.getState();t===!1&&ce(this,tn)[tn](new yo(this.i18n("noMoreFilesAllowed")),{file:e})}function uU(e,t){const n=VH(t),r=qH(n,t),o=Gk(r).extension,i=!!t.isRemote,a=UH({...t,type:n});if(this.checkIfFileAlreadyExists(a)){const f=new yo(this.i18n("noDuplicates",{fileName:r}));ce(this,tn)[tn](f,{file:t})}const u=t.meta||{};u.name=r,u.type=n;const s=Number.isFinite(t.data.size)?t.data.size:null;let l={source:t.source||"",id:a,name:r,extension:o||"",meta:{...this.getState().meta,...u},type:n,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:s,uploadComplete:!1,uploadStarted:null},size:s,isRemote:i,remote:t.remote||"",preview:t.preview};const c=this.opts.onBeforeFileAdded(l,e);c===!1?ce(this,tn)[tn](new yo("Cannot add the file because onBeforeFileAdded returned false."),{showInformer:!1,fileDescriptor:t}):typeof c=="object"&&c!==null&&(l=c);try{const f=Object.keys(e).map(d=>e[d]);ce(this,Hf)[Hf](l,f)}catch(f){ce(this,tn)[tn](f,{file:l})}return l}function sU(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}function lU(){const e=(t,n,r)=>{let o=t.message||"Unknown error";t.details&&(o+=` ${t.details}`),this.setState({error:o}),n!=null&&n.id in this.getState().files&&this.setFileState(n.id,{error:o,response:r})};this.on("error",e),this.on("upload-error",(t,n,r)=>{if(e(n,t,r),typeof n=="object"&&n.message){const o=new Error(n.message);o.details=n.message,n.details&&(o.details+=` ${n.details}`),o.message=this.i18n("failedToUpload",{file:t.name}),ce(this,tn)[tn](o,{throwErr:!1})}else ce(this,tn)[tn](n,{throwErr:!1})}),this.on("upload",()=>{this.setState({error:null})}),this.on("upload-started",t=>{if(!this.getFile(t.id)){this.log(`Not setting progress for a file that has been removed: ${t.id}`);return}this.setFileState(t.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:t.size}})}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(t,n)=>{if(!this.getFile(t.id)){this.log(`Not setting progress for a file that has been removed: ${t.id}`);return}const r=this.getFile(t.id).progress;this.setFileState(t.id,{progress:{...r,postprocess:ce(this,Zo)[Zo].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:r.bytesTotal},response:n,uploadURL:n.uploadURL,isPaused:!1}),t.size==null&&this.setFileState(t.id,{size:n.bytesUploaded||r.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(t,n)=>{if(!this.getFile(t.id)){this.log(`Not setting progress for a file that has been removed: ${t.id}`);return}this.setFileState(t.id,{progress:{...this.getFile(t.id).progress,preprocess:n}})}),this.on("preprocess-complete",t=>{if(!this.getFile(t.id)){this.log(`Not setting progress for a file that has been removed: ${t.id}`);return}const n={...this.getState().files};n[t.id]={...n[t.id],progress:{...n[t.id].progress}},delete n[t.id].progress.preprocess,this.setState({files:n})}),this.on("postprocess-progress",(t,n)=>{if(!this.getFile(t.id)){this.log(`Not setting progress for a file that has been removed: ${t.id}`);return}this.setFileState(t.id,{progress:{...this.getState().files[t.id].progress,postprocess:n}})}),this.on("postprocess-complete",t=>{if(!this.getFile(t.id)){this.log(`Not setting progress for a file that has been removed: ${t.id}`);return}const n={...this.getState().files};n[t.id]={...n[t.id],progress:{...n[t.id].progress}},delete n[t.id].progress.postprocess,this.setState({files:n})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",t=>{t&&ce(this,wd)[wd](t)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",ce(this,zr)[zr]),window.addEventListener("offline",ce(this,zr)[zr]),setTimeout(ce(this,zr)[zr],3e3))}function cU(e,t){t===void 0&&(t={});const{forceAllowNewUpload:n=!1}=t,{allowNewUpload:r,currentUploads:o}=this.getState();if(!r&&!n)throw new Error("Cannot create a new upload: already uploading.");const i=JH();return this.emit("upload",{id:i,fileIDs:e}),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...o,[i]:{fileIDs:e,step:0,result:{}}}}),i}function fU(e){const{currentUploads:t}=this.getState();return t[e]}function dU(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function pU(e){let{currentUploads:t}=this.getState(),n=t[e];const r=n.step||0,o=[...ce(this,nu)[nu],...ce(this,ru)[ru],...ce(this,Zo)[Zo]];try{for(let a=r;a{const c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});const a=n.fileIDs.map(l=>this.getFile(l)),u=a.filter(l=>!l.error),s=a.filter(l=>l.error);await this.addResultData(e,{successful:u,failed:s,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let i;return n&&(i=n.result,this.emit("complete",i),ce(this,uu)[uu](e)),i==null&&this.log(`Not setting result for an upload that has been removed: ${e}`),i}Zk.VERSION="2.1.3";var Qk=Zk,hU=j3(function(e,t){var n,r,o,i,a,u,s,l,c={},f=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function p(T,_){for(var F in _)T[F]=_[F];return T}function g(T){var _=T.parentNode;_&&_.removeChild(T)}function v(T,_,F){var R,q,j,ue={};for(j in _)j=="key"?R=_[j]:j=="ref"?q=_[j]:ue[j]=_[j];if(arguments.length>2&&(ue.children=arguments.length>3?n.call(arguments,2):F),typeof T=="function"&&T.defaultProps!=null)for(j in T.defaultProps)ue[j]===void 0&&(ue[j]=T.defaultProps[j]);return h(T,ue,R,q,null)}function h(T,_,F,R,q){var j={type:T,props:_,key:F,ref:R,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:q??++o};return q==null&&r.vnode!=null&&r.vnode(j),j}function y(T){return T.children}function b(T,_){this.props=T,this.context=_}function m(T,_){if(_==null)return T.__?m(T.__,T.__.__k.indexOf(T)+1):null;for(var F;_0?h(ve.type,ve.props,ve.key,null,ve.__v):ve)!=null){if(ve.__=F,ve.__b=F.__b+1,(ke=At[V])===null||ke&&ve.key==ke.key&&ve.type===ke.type)At[V]=void 0;else for(rt=0;rt2&&(ue.children=arguments.length>3?n.call(arguments,2):F),h(T.type,ue,R||T.key,q||T.ref,null)},t.createContext=function(T,_){var F={__c:_="__cC"+l++,__:T,Consumer:function(R,q){return R.children(q)},Provider:function(R){var q,j;return this.getChildContext||(q=[],(j={})[_]=this,this.getChildContext=function(){return j},this.shouldComponentUpdate=function(ue){this.props.value!==ue.value&&q.some(E)},this.sub=function(ue){q.push(ue);var be=ue.componentWillUnmount;ue.componentWillUnmount=function(){q.splice(q.indexOf(ue),1),be&&be.call(ue)}}),R.children}};return F.Provider.__=F.Consumer.contextType=F},t.createElement=v,t.createRef=function(){return{current:null}},t.h=v,t.hydrate=function T(_,F){Me(_,F,T)},t.isValidElement=i,t.options=r,t.render=Me,t.toChildArray=function T(_,F){return F=F||[],_==null||typeof _=="boolean"||(Array.isArray(_)?_.some(function(R){T(R,F)}):F.push(_)),F}}),gU=function(t){return(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE},vU=function(t,n){return n===void 0&&(n=document),typeof t=="string"?n.querySelector(t):gU(t)?t:null},X3=class{constructor(t,n){n===void 0&&(n={}),this.uppy=t,this.opts=n}getPluginState(){const{plugins:t}=this.uppy.getState();return t[this.id]||{}}setPluginState(t){const{plugins:n}=this.uppy.getState();this.uppy.setState({plugins:{...n,[this.id]:{...n[this.id],...t}}})}setOptions(t){this.opts={...this.opts,...t},this.setPluginState(),this.i18nInit()}i18nInit(){const t=new zk([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}};function zD(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var mU=0;function yU(e){return"__private_"+mU+++"_"+e}const{render:VD}=hU;function bU(e){let t=null,n=null;return function(){for(var r=arguments.length,o=new Array(r),i=0;i(t=null,e(...n)))),t}}var xc=yU("updateUI");class J3 extends X3{constructor(){super(...arguments),Object.defineProperty(this,xc,{writable:!0,value:void 0})}mount(t,n){const r=n.id,o=vU(t);if(o){this.isTargetDOMEl=!0;const u=document.createDocumentFragment();return zD(this,xc)[xc]=bU(s=>{this.uppy.getPlugin(this.id)&&(VD(this.render(s),u),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${t}'`),this.opts.replaceTargetContent&&(o.innerHTML=""),VD(this.render(this.uppy.getState()),u),this.el=u.firstElementChild,o.appendChild(u),this.onMount(),this.el}let i;if(typeof t=="object"&&t instanceof J3)i=t;else if(typeof t=="function"){const u=t;this.uppy.iteratePlugins(s=>{if(s instanceof u)return i=s,!1})}if(i)return this.uppy.log(`Installing ${r} to ${i.id}`),this.parent=i,this.el=i.addTarget(n),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let a=`Invalid target option given to ${r}.`;throw typeof t=="function"?a+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":a+="If you meant to target an HTML element, please make sure that the element exists. Check that the