@talkjs/react-components 0.0.34 → 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/default.cjs +46 -46
  2. package/default.js +1109 -1100
  3. package/package.json +1 -1
package/default.cjs CHANGED
@@ -1,11 +1,11 @@
1
- "use client";"use strict";var Iu=n=>{throw TypeError(n)};var Nu=(n,e,t)=>e.has(n)||Iu("Cannot "+t);var Le=(n,e,t)=>(Nu(n,e,"read from private field"),t?t.call(n):e.get(n)),xr=(n,e,t)=>e.has(n)?Iu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),Ls=(n,e,t,r)=>(Nu(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react/jsx-runtime"),T=require("react"),sE=require("@talkjs/core"),lo=require("react-dom");function Dh(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const ae=Dh(T),aE=Dh(lo);var Cl=Object.prototype.hasOwnProperty;function De(n){return Array.isArray(n)}function vt(n){return!(!n||typeof n!="object"||n instanceof Date||De(n))}function J(n){return typeof n=="function"}function ze(n){const e=typeof n;return n!==void 0&&(Ia(n)||e!=="object"&&e!=="function")}function Ia(n){return n instanceof Date}function Oh(n){return typeof n=="boolean"}function Nt(n){return n instanceof Promise}function Re(n){return n instanceof Map||n instanceof WeakMap}function Kt(n){return n instanceof Set||n instanceof WeakSet}function Io(n){if(!n)return!1;if(De(n))return n.length===0;if(Re(n)||Kt(n))return n.size===0;for(const e in n)if(Cl.call(n,e))return!1;return!0}var lE=new Set(["boolean","string","number"]);function rs(n){return!!n.parent}var uE=Symbol.toPrimitive,cE=Symbol.iterator,fr=Symbol("getNode"),is=Symbol("delete"),_h=Symbol("opaque"),dE=Symbol("plain"),Il=Symbol("optimized"),Ai=Symbol("linked"),Ae={pendingNodes:new Map,dirtyNodes:new Set};function gi(n){return n&&(n[_h]||n.$$typeof)}function Sh(n){return n&&n[dE]}function Th(n){return De(n)?"array":Re(n)?"map":n instanceof Set?"set":"object"}function hE(n,e){return Re(e)?{__LSType:"Map",value:Array.from(e.entries())}:e instanceof Set?{__LSType:"Set",value:Array.from(e)}:(Ae.replacer&&(e=Ae.replacer(n,e)),e)}var pE=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/;function fE(n,e){if(e){if(typeof e=="string"&&pE.test(e))return new Date(e);if(typeof e=="object"){if(e.__LSType==="Map")return new Map(e.value);if(e.__LSType==="Set")return new Set(e.value)}Ae.reviver&&(e=Ae.reviver(n,e))}return e}function Rh(n){return n&&JSON.stringify(n,hE)}function Ch(n){return n&&JSON.parse(n,fE)}function Ih(n){return Ch(Rh(n))}function fe(n){return!!n&&!!n[fr]}function Fi(n){return n&&n[fr]}function Nh(n,e,t,r,i){return r?n.add(t):i?n.set(e,t):n[e]=t,t}function Yt(n,e){var t;const r=(t=n.parent)!=null?t:n,i=n.parent?n.key:"_",o=e===is;o&&(e=void 0);const s=n.parent?Nl(r):r.root,a=Kt(s),l=Re(s),u=a?i:l?s.get(i):s[i],c=J(e);if((e=r.isAssigning||!c||J(u)?e:e(u))!==u)try{r.isSetting=(r.isSetting||0)+1,o?l||a?s.delete(i):delete s[i]:Nh(s,i,e,a,l)}finally{r.isSetting--}return{prevValue:u,newValue:e,parentValue:s}}var vu=[];function oe(n){let e=0,t=n;for(;rs(t);)vu[e++]=t.key,t=t.parent;let r=n.root._;for(let i=e-1;r&&i>=0;i--){const o=vu[i];r=o!=="size"&&Re(r)?r.get(o):r[o]}return r}function At(n,e,t){var r,i;let o=(r=n.children)==null?void 0:r.get(e);return o||(o={root:n.root,parent:n,key:e,lazy:!0,numListenersRecursive:0},((i=n.lazyFn)==null?void 0:i.length)===1&&(t=n.lazyFn.bind(n,e)),J(t)&&(o=Object.assign(()=>{},o),o.lazyFn=t),n.children||(n.children=new Map),n.children.set(e,o)),o}function Nl(n){let e=oe(n);if(!e||J(e))if(rs(n)){const t=Nl(n.parent),r=Kt(t),i=Re(t);e=Nh(t,n.key,{},r,i)}else e=n.root._={};return e}function vh(n,e){var t,r;let i=fe(n)?void 0:vt(n)?"id"in n?"id":"key"in n?"key":"_id"in n?"_id":"__id"in n?"__id":void 0:void 0;if(!i&&e.parent){const o=e.key+"_keyExtractor",s=(r=(t=e.functions)==null?void 0:t.get(o))!=null?r:oe(e.parent)[e.key+"_keyExtractor"];s&&J(s)&&(i=s)}return i}function yu(n,e,t){n.functions||(n.functions=new Map),n.functions.set(e,t)}function yh(n,e){return n===e||Ia(n)&&Ia(e)&&+n==+e}function Na(n,e,t,r){return e?void 0:n?r?Array.from(n):t?Array.from(n.keys()):Object.keys(n):[]}function mE(n,e){return n&&Object.defineProperty(n,e,{value:!0,enumerable:!1,writable:!0,configurable:!0}),n}var bu=function(n){return mE(n,_h)};function bh(n,e){var t;n.isPlain||!((t=n.parent)!=null&&t.isPlain)&&!Sh(e)||(n.isPlain=!0)}function Gt(n,e,t,r){let i=n;return!fe(i)&&J(i)&&(i=t?i(t):i()),fe(i)&&!r?i.get(e):i}var ai,EE=(n,e)=>n&&n[e];function Lh(n,e,t,r,i,o,s){let a,l=n;if(e.length>0){let u=o;for(let c=0;c<e.length;c++){a=e[c];const d=Re(l);let h=l?d?l.get(a):l[a]:void 0;const p=u?d?u.get(a):u[a]:void 0;if(h===is)return u&&(d?l.set(a,p):l[a]=p,s==null||s(e.slice(0,c+1),p)),n;if(h===void 0&&r===void 0&&c===e.length-1)return n;c<e.length-1&&h==null&&(h=vl(t[c]),Re(l)?l.set(a,h):l[a]=h),c<e.length-1&&(l=h,u&&(u=p))}}return a===void 0?n=i==="merge"?No(n,r):r:i==="merge"?l[a]=No(l[a],r):Re(l)?l.set(a,r):l[a]=r,n}function Lu(n,e,t){let r=t;for(let i=0;i<n.length;i++){const o=n[i];r=r?r[o]:vl(e[i])}return r}function ku(n){return!(!n||(vt(n)||De(n))&&Io(n))}function vl(n){switch(n){case"array":return[];case"map":return new Map;case"set":return new Set;default:return{}}}function AE(n,e,t){const{path:r,valueAtPath:i,prevAtPath:o,pathTypes:s}=e;return Lh(n,r,s,o)}function No(n,...e){if(ze(n))return e[e.length-1];let t=De(n)?[...n]:{...n};for(let i=0;i<e.length;i++){const o=e[i];if(vt(r=o)&&r.constructor===Object||De(o)){const s=o;for(const a in s)Cl.call(s,a)&&(s[a]instanceof Object&&!fe(s[a])&&Object.keys(s[a]).length>0?t[a]=No(t[a]||(De(s[a])?[]:{}),s[a]):t[a]=s[a])}else t=o}var r;return t}var vo=0,ks=!1,ws=!1,or=new Map;function gE(){or.size>0&&Nr(!0)}function kh(n,e){for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function DE(n,e){try{return function(t,r){for(let i=0;i<r.length;i++)t=AE(t,r[i]);return t}(n?Ih(n):{},e)}catch(t){return}}function yl(n,e){return function(){return DE(n,e)}}function Di(n,e,t,r,i){const o=new Map;yo(o,n,!!Ae.isLoadingLocal,!!Ae.isLoadingRemote,e,[],[],e,t,!0,r,i);const s=or.get(n);s?s.prev===e?or.delete(n):s.value=e:or.set(n,{value:e,prev:t,level:r,whenOptimizedOnlyIf:i,isFromSync:!!Ae.isLoadingRemote,isFromPersist:!!Ae.isLoadingLocal}),o.size&&wh(o,!0),vo<=0&&Mh()}function yo(n,e,t,r,i,o,s,a,l,u,c,d){if(e.numListenersRecursive>0&&(function(h,p,f,m,E,A,D,_,S,R,v,I){if(R?p.listenersImmediate:p.listeners){const L={path:A,pathTypes:D,valueAtPath:_,prevAtPath:S},g=h.get(p);if(g&&A.length>0){const{changes:O}=g;kh(O[0].path,L.path)||(O.push(L),g.level=Math.min(g.level,v),g.whenOptimizedOnlyIf||(g.whenOptimizedOnlyIf=I))}else h.set(p,{level:v,value:E,isFromSync:m,isFromPersist:f,whenOptimizedOnlyIf:I,changes:[L]})}}(n,e,t,r,i,o,s,a,l,u,c,d),e.linkedFromNodes))for(const h of e.linkedFromNodes)yo(n,OE(h,o),t,r,a,[],[],a,l,u,0,d);if(e.parent){const h=e.parent;h&&yo(n,h,t,r,oe(h),[e.key].concat(o),[Th(i)].concat(s),a,l,u,c+1,d)}}function wh(n,e){const t=new Set;n.forEach(({changes:r,level:i,value:o,isFromPersist:s,isFromSync:a,whenOptimizedOnlyIf:l},u)=>{const c=e?u.listenersImmediate:u.listeners;if(c){let d;const h=Array.from(c);for(let p=0;p<h.length;p++){const f=h[p],{track:m,noArgs:E,listener:A}=f;t.has(A)||(m===!0?i<=0:m!==Il||l&&i<=0)&&(E||d||(d={value:o,isFromPersist:s,isFromSync:a,getPrevious:yl(o,r),changes:r}),m||t.add(A),A(d))}}})}function Mh(){const n=Array.from(Ae.dirtyNodes);Ae.dirtyNodes.clear(),n.forEach(r=>{const i=r.dirtyFn;i&&(r.dirtyFn=void 0,i())});const e=or;or=new Map;const t=new Map;e.forEach(({value:r,prev:i,level:o,isFromPersist:s,isFromSync:a,whenOptimizedOnlyIf:l},u)=>{yo(t,u,s,a,r,[],[],r,i,!1,o,l)}),t.size&&wh(t,!1)}function mr(n){ss();try{n()}finally{Nr()}}function ss(){vo++,ai||(ai=setTimeout(gE,0))}function Nr(n){(--vo<=0||n)&&(ks?ws=!0:(ai&&(clearTimeout(ai),ai=void 0),vo=0,ks=!0,Mh(),ks=!1,ws&&(ws=!1,Nr(!0))))}function OE(n,e){let t=n;for(let r=0;r<e.length;r++)t=At(t,e[r]);return t}function bl(n,e,t,r,i){if(fe(n))return n;const o=Nt(n);let s={root:{_:n},lazy:!0,numListenersRecursive:0};J(n)&&(s=Object.assign(()=>{},s),s.lazyFn=n);var a;const l=(a=n,lE.has(typeof a)?new i(s):r(s));return o&&(Yt(s,void 0),t(s,n)),l}var Zn=new WeakMap,Fh=[],xh=[],Ph=[],Qn=0,va=!1;function Ms(n,e,t){const r=Zn.get(n);if(!r||!r.has(t))return;const i=r.get(t);i&&i.size!==0&&(Fh[Qn]=n,xh[Qn]=e,Ph[Qn]=t,Qn++,va||(va=!0,queueMicrotask(_E)))}var Pr={type:"listener-added",node:null,listener:void 0,timestamp:0};function _E(){va=!1;const n=typeof performance!="undefined"?performance.now():Date.now();Pr.timestamp=n;for(let e=0;e<Qn;e++){const t=Fh[e],r=xh[e],i=Ph[e],o=Zn.get(t);if(!o)continue;const s=o.get(i);if(!s||s.size===0)continue;const a=t.listeners,l=t.listenersImmediate;if(!a&&!l)continue;let u=!1;if(u=i==="listener-added"?!!(a!=null&&a.has(r))||!!(l!=null&&l.has(r)):i==="listener-removed"?!(a!=null&&a.has(r))&&!(l!=null&&l.has(r)):!(a!=null&&a.size)&&!(l!=null&&l.size),u){Pr.type=i,Pr.node=t,Pr.listener=r;const c=Array.from(s);for(let d=0;d<c.length;d++)try{c[d](Pr)}catch(h){console.error(`Error in middleware handler for ${i}:`,h)}}}Qn=0}function cn(n,e,t={},r){var i;const{initial:o,immediate:s,noArgs:a}=t,{trackingType:l}=t;let u=s?n.listenersImmediate:n.listeners;u||(u=new Set,s?n.listenersImmediate=u:n.listeners=u);const c={listener:e,track:l,noArgs:a};if(u.add(c),o){const m=oe(n);e({value:m,isFromPersist:!0,isFromSync:!1,changes:[{path:[],pathTypes:[],prevAtPath:m,valueAtPath:m}],getPrevious:()=>{}})}let d;function h(m,E=e,A){if(!(r!=null&&r.has(m))){r||(r=new Set),r.add(A||n),E||(E=e);const D={trackingType:!0,...t};d=[...d||[],cn(m,E,D,r)]}}n.linkedToNode&&h(n.linkedToNode),(i=n.linkedFromNodes)==null||i.forEach(m=>h(m)),n.numListenersRecursive++;let p=n.parent,f=[n.key];for(;p;){if(p.linkedFromNodes)for(const m of p.linkedFromNodes)r!=null&&r.has(m)||h(m,SE(m,f,e),p);p.numListenersRecursive++,f=[p.key,...f],p=p.parent}return Ms(n,c,"listener-added"),()=>{u.delete(c),d==null||d.forEach(E=>E());let m=n;for(;m;)m.numListenersRecursive--,m=m.parent;Ms(n,c,"listener-removed"),u.size===0&&Ms(n,void 0,"listeners-cleared")}}function SE(n,e,t){let r=Lu(e,[],oe(n));return function({value:i,isFromPersist:o,isFromSync:s}){const a=Lu(e,[],i);a!==r&&t({value:a,isFromPersist:o,isFromSync:s,changes:[{path:[],pathTypes:[],prevAtPath:r,valueAtPath:a}],getPrevious:()=>r}),r=a}}function wu(n,e,t,r){let i=[];return n==null||n.forEach(o=>{const{node:s,track:a}=o;i.push(cn(s,e,{trackingType:a,immediate:r,noArgs:t}))}),()=>{if(i){for(let o=0;o<i.length;o++)i[o]();i=void 0}}}var uo=0,Mu=[],er={current:void 0};function co(n,e){if(uo){const t=er.current;if(t){t.nodes||(t.nodes=new Map);const r=t.nodes.get(n);r?(r.track=r.track||e,r.num++):t.nodes.set(n,{node:n,track:e,num:1})}}}function Bh(n,e,t,r,i,o){let s,a,l=e;Mu.push(er.current),uo++,er.current={};const u=n&&Gt(n,t,r,i==null?void 0:i.fromComputed),c=er.current.nodes;return--uo<0&&(uo=0),er.current=Mu.pop(),r!=null&&r.cancel||(s=wu(c,l,!1,i==null?void 0:i.immediate),a=o?()=>(s==null||s(),s=wu(c,l),s):void 0),{nodes:c,value:u,dispose:s,resubscribe:a}}function Oi(n,e,t){let r,i;J(e)?r=e:t=e;let o=!1;const s={num:0},a=function(){if(o)return;s.onCleanup&&(s.onCleanup(),s.onCleanup=void 0),o=!0,ss(),delete s.value,i==null||i();const{dispose:l,value:u,nodes:c}=Bh(n,a,void 0,s,t);var d,h;i=l,s.value=u,s.nodes=c,s.refresh=a,s.onCleanupReaction&&(s.onCleanupReaction(),s.onCleanupReaction=void 0),Nr(),o=!1,!r||!(t!=null&&t.fromComputed)&&(!(s.num>0)&&(d=n)&&((h=d[fr])!=null&&h.isEvent)||s.previous===s.value&&typeof s.value!="object")||r(s),s.previous=s.value,s.num++};return a(),()=>{var l,u;(l=s.onCleanup)==null||l.call(s),s.onCleanup=void 0,(u=s.onCleanupReaction)==null||u.call(s),s.onCleanupReaction=void 0,i==null||i()}}function Hh(n,e,t){if(Nt(n))return e?n.then(e):n;const r=De(n);let i,o;return Oi(function(s){const a=r?n.map(l=>Gt(l)):Gt(n);if(!Nt(a)){{let l=!0;if(De(a))for(let u=0;u<a.length;u++){let c=a[u];fe(c)?c=Gt(c):J(c)&&(c=c()),l=l&&!!(t?ku(c):c)}else l=t?ku(a):a;l&&(i=a,s.cancel=!0)}return i}i=a},function(){o=e==null?void 0:e(i)}),Nt(i)?e?i.then(e):i:i!==void 0?e?o:Promise.resolve(i):new Promise(s=>{if(e){const a=e;e=l=>{const u=a(l);s(Nt(u)?u.then(c=>c):u)}}else e=s})}function Uh(n,e){return Hh(n,e,!1)}var Fs=new Set(["copyWithin","fill","from","pop","push","reverse","shift","sort","splice","unshift"]),Fu=new Set(["every","filter","find","findIndex","flatMap","forEach","join","map","reduce","some"]),TE=new Set(["filter","find"]),ya=new Map,ba=new Map([["get",as],["set",ut],["peek",vr],["onChange",cn],["assign",function(n,e){const t=qe(n);if(ss(),ze(n.root._)&&(n.root._={}),Re(e)){const r=oe(n);Re(r)?e.forEach((i,o)=>r.set(o,i)):ut(n,e)}else{n.isAssigning=(n.isAssigning||0)+1;try{Object.assign(t,e)}finally{n.isAssigning--}}return Nr(),t}],["delete",zh],["toggle",function(n){const e=oe(n);(e==null||Oh(e))&&ut(n,!e)}]]);function jh(n,e,t,...r){var i;if(t!=="push"||r.length!==1){const o=e.slice(),s=e[t].apply(e,r);if(n){const a=rs(n),l=a?n.key:"_";(a?oe(n.parent):n.root)[l]=o,Er((i=n.parent)!=null?i:n,l,e)}return s}Er(n,e.length+"",r[0])}function Ll(n,e,t){var r,i,o;if(vt(e)&&gi(e)||vt(t)&&gi(t)){const R=e!==t;return R&&(n.listeners||n.listenersImmediate)&&Di(n,e,t,0),R}const s=De(e);let a,l;const u=Re(e),c=Kt(e),d=Re(t),h=Kt(t),p=Na(e,s,u,c),f=Na(t,s,d,h),m=((r=p||e)==null?void 0:r.length)||0,E=((i=f||t)==null?void 0:i.length)||0;let A,D,_,S=!1;if(s&&De(t)){if(t.length>0){const R=t[0];if(R!==void 0&&(A=vh(R,n),A&&(D=J(A),a=new Map,l=[]),n.children))for(let v=0;v<t.length;v++){const I=t[v];if(I){const L=n.children.get(v+"");if(L&&(e[v]||xu(L,I),A)){const g=D?A(I):I[A];a.set(g,L)}}}}}else if(t&&(!e||vt(e))){const R=f.length;for(let v=0;v<R;v++){const I=f[v];if(!p.includes(I)){S=!0;const L=At(n,I),g=d?t.get(I):t[I];g!==void 0&&xu(L,g)}}}if(e&&!ze(e)){S=S||m!==E;const R=S;let v=!1;for(let I=0;I<m;I++){const L=s?I+"":p[I];let g=u?e.get(L):e[L];const O=d?t==null?void 0:t.get(L):t==null?void 0:t[L];let k=!yh(g,O);if(k){const w=A&&g?D?A(g):g[A]:void 0,U=(o=n.children)==null?void 0:o.get(L);if(fe(g)){const M=Fi(g);if((U==null?void 0:U.linkedToNode)===M){const j=oe(M);u?e.set(L,j):e[L]=j;continue}const $=g;g=()=>$}let y=At(n,L,g);if(y.lazy||!J(g)&&!fe(g)||(Gh(y,g),Fn(y)),s&&w!==void 0){const M=w!==void 0?a==null?void 0:a.get(w):void 0;if(M){if(M!==void 0&&M.key!==L){const $=t[M.key];R&&(y=M,n.children.delete(y.key),y.key=L,l.push([L,y])),v=!0,k=$!==g}}else S=!0}if(k)if(J(g)||fe(g))gr(n,L,g);else if(ze(g))S=!0;else{const M=Ll(y,g,O);S=S||M,k=M}(k||s&&!R)&&(y.listeners||y.listenersImmediate)&&Di(y,g,O,0,!R)}}if(l)for(let I=0;I<l.length;I++){const[L,g]=l[I];n.children.set(L,g)}_=S||v}else t!==void 0&&(_=!0);return _!=null&&_}function xu(n,e){var t,r;(t=n.linkedToNodeDispose)==null||t.call(n),(r=n.activatedObserveDispose)==null||r.call(n),ze(e)||Ll(n,void 0,e),(n.listeners||n.listenersImmediate)&&Di(n,void 0,e,0)}function qe(n,e,t){return e!==void 0&&(n=At(n,e,t)),n.proxy||(n.proxy=new Proxy(n,$h))}function La(){if(Ae.pendingNodes.size>0){const n=Array.from(Ae.pendingNodes.values());Ae.pendingNodes.clear(),n.forEach(e=>e())}}var $h={get(n,e,t){var r,i;if(e===uE)throw new Error("[legend-state] observable is not a primitive.");if(e===fr)return n;if(e==="apply"||e==="call"){const d=oe(n);if(J(d))return d[e]}let o=Fn(n,e==="get"||e==="peek");if(e===cE)return!o||ze(o)?void 0:o[e];const s=n.linkedToNode||(o==null?void 0:o[fr]);if(s&&e!=="onChange")return $h.get(s,e,t);if(Re(o)||Kt(o)){const d=function(h,p,f){const m=f==null?void 0:f[p];if(p==="size")return co(h,!0),f[p];if(J(m))return function(E,A,D){const _=arguments.length,S=f;if(p==="get"){if(_>0&&typeof E!="boolean"&&E!==Il)return qe(h,E)}else{if(p==="set")return _===2?ut(At(h,E),A):_===1&&Re(f)&&ut(h,E),qe(h);if(p==="delete"){if(_>0){const v=f.get?S.get(E):E;return zh(h,E),v!==void 0}}else{if(p==="clear"){const v=Kt(S)?new Set(S):new Map(S),I=S.size;return S.clear(),void(I&&Vh(h,f,v))}if(p==="add"){const v=new Set(f),I=f.add(E);return f.has(p)||Di(h,I,v,0),qe(h)}}}const R=ba.get(p);if(!R)return f[p](E,A);switch(_){case 0:return R(h);case 1:return R(h,E);case 2:return R(h,E,A);default:return R(h,E,A,D)}}}(n,e,o);if(d!==void 0)return d}const a=ba.get(e);if(a)return e!=="get"&&e!=="peek"||La(),function(d,h,p){switch(arguments.length){case 0:return a(n);case 1:return a(n,d);case 2:return a(n,d,h);default:return a(n,d,h,p)}};const l=ya.get(e);if(l)return l.get(n);let u=o==null?void 0:o[e];if(vt(o)&&gi(o))return u;const c=(r=n.functions)==null?void 0:r.get(e);if(c)return fe(c)?c:qe(n,e,c);if(u=function(d,h){if(d){const p=Object.getOwnPropertyDescriptor(d,h);return p!=null&&p.get&&(delete d[h],d[h]=p.set?function(f){J(f)&&(f={get:f});const m=function(){return{[Ai]:f}};return m.prototype[Ai]=f,m}({get:p.get,set:({value:f})=>p.set(f)}):p.get),d[h]}}(o,e),function(d){return d==null}(o)&&u===void 0&&(Fs.has(e)||Fu.has(e))&&(o=[],Fs.has(e)&&Yt(n,o),u=o[e]),J(u)){if(De(o)){if(Fs.has(e))return(...h)=>jh(n,o,e,...h);if(Fu.has(e))return co(n,!0),function(h,p){const f=e==="reduce",m=f?(D,_,S,R)=>h(D,qe(n,S+"",_),S,R):(D,_,S)=>h(qe(n,_+"",D),_,S);if(f||!TE.has(e))return o[e](m,p);const E=e==="find",A=[];for(let D=0;D<o.length;D++)if(m(o[D],D,o)){const _=qe(n,D+"");if(E)return _;A.push(_)}return E?void 0:A}}gr(n,e,u);const d=(i=n.functions)==null?void 0:i.get(e);return d?qe(n,e,d):u.bind(o)}return ze(u)&&e==="length"&&De(o)?(co(n,!0),u):qe(n,e)},getPrototypeOf(n){const e=oe(n);return e!==null&&typeof e=="object"?Reflect.getPrototypeOf(e):null},ownKeys(n){Fn(n);const e=as(n,!0);if(ze(e))return[];const t=e?Reflect.ownKeys(e):[];if(De(e)&&t[t.length-1]==="length"&&t.splice(t.length-1,1),J(n)){const r=Reflect.ownKeys(n);["caller","arguments","prototype"].forEach(i=>r.includes(i)&&t.push(i))}return t},getOwnPropertyDescriptor(n,e){if(e==="caller"||e==="arguments"||e==="prototype")return{configurable:!1,enumerable:!1};const t=oe(n);if(ze(t))return;const r=Reflect.getOwnPropertyDescriptor(t,e);return r?{...r,configurable:!0}:void 0},set(n,e,t){if(n.isSetting)return Reflect.set(n,e,t);if(n.isAssigning)return Er(n,e,t),!0;const r=ya.get(e);return!!r&&(r.set(n,t),!0)},deleteProperty:(n,e)=>!!n.isSetting&&Reflect.deleteProperty(n,e),has(n,e){const t=oe(n);return Reflect.has(t,e)},apply(n,e,t){fe(e)&&(e=e.peek());const r=oe(n),i=J(r)?r:n.lazyFn||n;return Reflect.apply(i,e,t)}};function ut(n,e){n.parent?Er(n.parent,n.key,e):Er(n,"_",e)}function Er(n,e,t,r){const i=!n.parent&&e==="_";bh(n,t),!n.parent||oe(n)||J(t)||ut(n,{[e]:t});const o=i?n:At(n,e,t);if(fe(t))bo(o,t);else{const{newValue:s,prevValue:a,parentValue:l}=Yt(o,t),u=ze(a)||a instanceof Date||ze(s)||s instanceof Date;if(!u){let h=o;do h.needsExtract=!0,h.recursivelyAutoActivated=!1;while(h=h.parent)}const c=!yh(s,a),d=!c&&o.isComputing&&!u&&!o.isPlain;!c&&!d||o.isComputing&&o.isPlain&&n.numListenersRecursive===0||Vh(n,s,a,o,l,u,i,r,d),gr(n,e,s)}}function zh(n,e){e===void 0&&rs(n)&&(e=n.key,n=n.parent);const t=oe(n);De(t)?jh(n,t,"splice",e,1):Er(n,e!=null?e:"_",is,-1)}function Vh(n,e,t,r,i,o,s,a,l){r||(r=n),ss(),o===void 0&&(o=ze(e));let u,c,d=l||o,h=!1;(!o||t&&!ze(t))&&(d=d||Ll(r,e,t),De(e)?u=e:(Re(e)||Kt(e))&&(c=e)),De(i)?u=i:(Re(i)||Kt(i))&&(c=i),u?h=(u==null?void 0:u.length)!==(t==null?void 0:t.length):c&&(h=(c==null?void 0:c.size)!==(t==null?void 0:t.size)),(o||!e||Io(e)&&!Io(t)?e!==t:d)&&Di(o&&s?n:r,e,t,(a!=null?a:t===void 0)?-1:d?0:1,h),Nr()}function Ar(n,e,t){const r=n.numGets=(n.numGets||0)+1;n.state||(n.state=bl({isLoaded:!1},0,Ar,qe)),e.then(i=>{r>=(n.getNumResolved||0)&&(n.getNumResolved=n.numGets,t?t({value:i}):ut(n,i),n.state.assign({isLoaded:!0,error:void 0}))}).catch(i=>{n.state.error.set(i)})}function gr(n,e,t){if(Nt(t)){const r=At(n,e);return Ar(r,t),void Yt(r,void 0)}if(fe(t)){const r=()=>t;yu(n,e,r);const i=At(n,e,r),o=vr(Fi(t));return bo(i,t),Yt(i,o),oe(i)}if(typeof t=="function")return yu(n,e,t),e}function as(n,e){return co(n,e?vt(e)?e.shallow:e:void 0),vr(n)}function vr(n){return Fn(n,!0)}var Ki=!1;function Fn(n,e){var t;if(Ki=!0,e&&((t=n.dirtyChildren)==null?void 0:t.size)){const i=Array.from(n.dirtyChildren);n.dirtyChildren.clear(),i.forEach(o=>o.dirtyFn&&Fn(o))}if(n.dirtyFn){const i=n.dirtyFn;n.dirtyFn=void 0,Ae.dirtyNodes.delete(n),i()}Ki=!1;let r=oe(n);return n.root.isLoadingLocal||n.isPlain||(r=function(i,o,s){const a=o,l=i.lazy;if(l){const u=i.lazyFn;if(delete i.lazy,J(u))if(u.length===1)o={};else{if(i.parent){const c=oe(i.parent);J(o)&&(c?delete c[i.key]:i.root._=void 0)}o=function(c,d){let h,p,f,m=!0;const E=d;let A,D,_=[];function S(){c.dirtyFn=D,Ae.dirtyNodes.add(c)}const R=Oi(()=>{var v,I,L,g;if(m)m=!1,J(oe(c))&&Yt(c,void 0);else if(!Ki&&D&&function(y,M){if(!Ki&&!function(j){var G,V;let Y=j,K=j.numListenersRecursive>0;for(;Y&&!K;)((G=Y.listeners)!=null&&G.size||(V=Y.listenersImmediate)!=null&&V.size)&&(K=!0),Y=Y.parent;return K}(y)){M&&(y.dirtyFn=M);let j=y;for(;j;)j.dirtyChildren||(j.dirtyChildren=new Set),j.dirtyChildren.add(y),j=j.parent;return!0}}(c,D))return void(f=!0);let O=E(),k=!1;const w=fe(O);(w||c.linkedToNode)&&(k=w,O=bo(c,O)),J(O)&&O.length===0&&(O=O());const U=w||O==null?void 0:O[Ai];if(U&&(c.activationState=U,O=void 0),f=!1,p=Nt(O),c.activated){if(c.activationState){const y=c.activationState;(I=(v=c.state)==null?void 0:v.peek())!=null&&I.sync?(c.state.sync(),f=!0):O=(g=(L=y.get)==null?void 0:L.call(y))!=null?g:y.initial}}else{c.activated=!0;let y=RE;U!=null&&U.synced&&(y=Ae.activateSyncedNode,f=!0);const M=y(c,O);h=M.update;let $=M.value;!k&&fe($)&&($=bo(c,$)),O=$!=null?$:U==null?void 0:U.initial}return f&&(A=O),p=p||Nt(O),O},v=>{const{value:I,nodes:L,refresh:g}=v;if(D=g,!f){if(!p||!Ae.isLoadingRemote)if(p)if(c.activationState){const{initial:O}=c.activationState;I&&Nt(I)&&Ar(c,I,h),J(oe(c))&&Yt(c,O!=null?O:void 0)}else c.activated&&(Ar(c,I,h),J(oe(c))&&Yt(c,void 0));else{A=I;const O=c.state.isLoaded.peek();!O&&J(I)||(c.isComputing=!0,ut(c,I),c.isComputing=!1),O||c.state.assign({isLoaded:!0,error:void 0})}_.forEach(O=>O()),_=[],L==null||L.forEach(({node:O,track:k})=>{_.push(cn(O,S,{immediate:!0,trackingType:k}))})}v.cancel=!0},{fromComputed:!0});return c.activatedObserveDispose=()=>{R==null||R(),_.forEach(v=>v())},A}(i,u)}else fe(o)&&(o=gr(i.parent,i.key,o))}return bh(i,o),!l&&!i.needsExtract||i.isPlain||fe(o)||ze(o)||(s&&function(u,c){if(!c.recursivelyAutoActivated&&(vt(u)||De(u))&&!gi(u)){c.recursivelyAutoActivated=!0;const d=[];Xh(u,d,()=>{var p;let f=c;for(let m=0;m<d.length;m++){const E=d[m],A=(p=oe(f))==null?void 0:p[E];f=At(f,E,J(A)?A:void 0),Fn(f)}return f})}}(o,i),i.parent&&gr(i.parent,i.key,a)),o}(n,r,!!e)),r}function Yh(n){var e,t;(e=n.activatedObserveDispose)==null||e.call(n),(t=n.linkedToNodeDispose)==null||t.call(n),n.activatedObserveDispose=n.linkedToNodeDispose=n.linkedToNode=void 0}function Gh(n,e){Yh(n),n.lazyFn=e,n.lazy=!0}function RE(n,e){if(n.state||(n.state=bl({isLoaded:!1},0,Ar,qe)),n.activationState){const{set:t,get:r,initial:i}=n.activationState;if((e=r==null?void 0:r())!=null&&e!==null||(e=i),t){let o,s=[],a=0;const l=u=>{if(s.length>0){let c,d,h,p=!1,f=!1;u?(c=u.changes,d=u.value,p=u.isFromPersist,f=u.isFromSync,h=u.getPrevious):(c=s,d=o,h=yl(d,c)),s=[],o=void 0,Ae.pendingNodes.delete(n),a++;const m=a,E=()=>{m===a&&(n.isComputing=!0,t({value:d,changes:c,isFromPersist:p,isFromSync:f,getPrevious:h}),n.isComputing=!1)};Hh(n.state.isLoaded,E,!0)}};cn(n,({value:u,changes:c})=>{n.isComputing||(c.length>1||!J(c[0].prevAtPath))&&(o=u,s.length>0&&(c=c.filter(d=>!kh(s[0].path,d.path))),s.push(...c),Ae.pendingNodes.set(n,l))},{immediate:!0}),cn(n,l)}}return{update:({value:t})=>{n.isComputing||(n.isComputing=!0,ut(n,t),n.isComputing=!1)},value:e}}function bo(n,e){var t;const r=e?Fi(e):void 0;return r!==n&&(r==null?void 0:r.linkedToNode)!==n&&(n.linkedToNode=r,(t=n.linkedToNodeDispose)==null||t.call(n),r&&(r.linkedFromNodes||(r.linkedFromNodes=new Set),r.linkedFromNodes.add(n),n.linkedToNodeDispose=cn(r,()=>{J(e=Fn(r))||ut(n,e)},{initial:!0},new Set([n])))),e}function Xh(n,e,t){var r;if((vt(n)||De(n))&&!gi(n)&&!Sh(n)){for(const i in n)if(Cl.call(n,i)){const o=n[i];if(fe(o)){const s=t();gr(s,i,o),delete s.lazy}else{const s=J(o)&&((r=o.prototype)==null?void 0:r[Ai]);if(s){const a=s.activate;(!a||a==="auto")&&vr(At(t(),i,o))}}typeof o=="object"&&(e.push(i),Xh(o,e,t),e.pop())}}}var Pu=["get","set","peek","onChange","toggle"];function sr(n){this._node=n;for(let e=0;e<Pu.length;e++){const t=Pu[e];this[t]=this[t].bind(this)}}function Wi(n,e){sr.prototype[n]=function(...t){return e.call(this,this._node,...t)}}function pe(n){return bl(n,0,Ar,qe,sr)}Wi("peek",n=>(La(),vr(n))),Wi("get",(n,e)=>(La(),as(n,e))),Wi("set",ut),Wi("onChange",cn),Object.defineProperty(sr.prototype,fr,{configurable:!0,get(){return this._node}}),sr.prototype.toggle=function(){const n=this.peek();(n==null||Oh(n))&&this.set(!n)},sr.prototype.delete=function(){return this.set(void 0),this};var ls={createPreviousHandler:yl,clone:Ih,deactivateNode:Yh,deepMerge:No,ensureNodeValue:Nl,findIDKey:vh,get:as,getChildNode:At,getKeys:Na,getNode:Fi,getNodeValue:oe,getPathType:Th,getProxy:qe,getValueAtPath:function(n,e){return e.reduce(EE,n)},globalState:Ae,initializePathType:vl,ObservablePrimitiveClass:sr,observableProperties:ya,observableFns:ba,optimized:Il,peek:vr,reactivateNode:Gh,registerMiddleware:function(n,e,t){let r=Zn.get(n);r||(r=new Map,Zn.set(n,r));let i=r.get(e);return i||(i=new Set,r.set(e,i)),i.add(t),()=>{const o=Zn.get(n);if(!o)return;const s=o.get(e);s&&(s.delete(t),s.size===0&&(o.delete(e),o.size===0&&Zn.delete(n)))}},safeParse:Ch,safeStringify:Rh,set:ut,setAtPath:Lh,setNodeValue:Yt,symbolLinked:Ai,symbolDelete:is,tracking:er},{globalState:Bu,observableProperties:CE,observableFns:IE,ObservablePrimitiveClass:Hu}=ls;class Kh extends Error{}function Uu(n,e){if(!n)throw new Kh(e!=null?e:"Assertion failed")}const le=Object.assign(Uu,{is:function(n,e,t){return Uu(e,t)},unreachable:function(){throw new Error("Unreachable code")},never:function(n){throw new Error("Unreachable")},defined:function(n){if(n==null)throw new Kh("Value is not defined")}});class us{constructor(e={}){this._handlers=new Set,this._meta=e}meta(e){return new us(e)}_emit(e,t){for(const r of this._handlers)r({level:e,data:t,timestamp:Date.now(),meta:this._meta})}error(...e){return this._emit("error",e)}warn(...e){return this._emit("warn",e)}info(...e){return this._emit("info",e)}log(...e){return this._emit("log",e)}trace(...e){return this._emit("trace",e)}registerHandler(e){return this._handlers.add(e),()=>this._handlers.delete(e)}}const Lo=new us,zt=new us,NE="https://cdn.jsdelivr.net/npm/emoji-picker-element@1.26.3/+esm",kl=function(n){let e;return()=>(e===void 0&&(e={value:n()}),e.value)}(async function(){if(typeof window=="undefined"||window.document===void 0)return new Promise(()=>{});try{const n=await async function(t){return import(t).catch(()=>new Function("url","return import(url)")(t)).catch(()=>{throw new Error("Cannot dynamically import module in this environment")})}(NE);return await new n.Database().ready(),n}catch(n){return Lo.error("Failed to load emoji picker:",n),new Promise(()=>{})}});function ju(n,e,t){return n.clearRect(0,0,100,100),n.fillStyle=t,n.fillText(e,0,0),n.getImageData(0,0,1,1).data.join(",")}function $u(n){const e=function(){const i=document.createElement("canvas");i.width=i.height=1;const o=i.getContext("2d",{willReadFrequently:!0});return o.textBaseline="top",o.font='100px "Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',o.scale(.01,.01),o}(),t=ju(e,n,"#fff"),r=ju(e,n,"#000");return r===t&&!r.startsWith("0,0,0,")}function vE(n){const{common:e}=n;return e.conversation.subject?x`
1
+ "use client";"use strict";var Nu=n=>{throw TypeError(n)};var vu=(n,e,t)=>e.has(n)||Nu("Cannot "+t);var Le=(n,e,t)=>(vu(n,e,"read from private field"),t?t.call(n):e.get(n)),xr=(n,e,t)=>e.has(n)?Nu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),Ls=(n,e,t,r)=>(vu(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),R=require("react"),sE=require("@talkjs/core"),lo=require("react-dom");function Oh(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const ae=Oh(R),aE=Oh(lo);var Cl=Object.prototype.hasOwnProperty;function De(n){return Array.isArray(n)}function vt(n){return!(!n||typeof n!="object"||n instanceof Date||De(n))}function J(n){return typeof n=="function"}function ze(n){const e=typeof n;return n!==void 0&&(Ia(n)||e!=="object"&&e!=="function")}function Ia(n){return n instanceof Date}function _h(n){return typeof n=="boolean"}function Nt(n){return n instanceof Promise}function Re(n){return n instanceof Map||n instanceof WeakMap}function Kt(n){return n instanceof Set||n instanceof WeakSet}function Io(n){if(!n)return!1;if(De(n))return n.length===0;if(Re(n)||Kt(n))return n.size===0;for(const e in n)if(Cl.call(n,e))return!1;return!0}var lE=new Set(["boolean","string","number"]);function rs(n){return!!n.parent}var uE=Symbol.toPrimitive,cE=Symbol.iterator,fr=Symbol("getNode"),is=Symbol("delete"),Sh=Symbol("opaque"),dE=Symbol("plain"),Il=Symbol("optimized"),Ai=Symbol("linked"),Ae={pendingNodes:new Map,dirtyNodes:new Set};function gi(n){return n&&(n[Sh]||n.$$typeof)}function Th(n){return n&&n[dE]}function Rh(n){return De(n)?"array":Re(n)?"map":n instanceof Set?"set":"object"}function hE(n,e){return Re(e)?{__LSType:"Map",value:Array.from(e.entries())}:e instanceof Set?{__LSType:"Set",value:Array.from(e)}:(Ae.replacer&&(e=Ae.replacer(n,e)),e)}var pE=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/;function fE(n,e){if(e){if(typeof e=="string"&&pE.test(e))return new Date(e);if(typeof e=="object"){if(e.__LSType==="Map")return new Map(e.value);if(e.__LSType==="Set")return new Set(e.value)}Ae.reviver&&(e=Ae.reviver(n,e))}return e}function Ch(n){return n&&JSON.stringify(n,hE)}function Ih(n){return n&&JSON.parse(n,fE)}function Nh(n){return Ih(Ch(n))}function pe(n){return!!n&&!!n[fr]}function Fi(n){return n&&n[fr]}function vh(n,e,t,r,i){return r?n.add(t):i?n.set(e,t):n[e]=t,t}function Yt(n,e){var t;const r=(t=n.parent)!=null?t:n,i=n.parent?n.key:"_",o=e===is;o&&(e=void 0);const s=n.parent?Nl(r):r.root,a=Kt(s),l=Re(s),u=a?i:l?s.get(i):s[i],c=J(e);if((e=r.isAssigning||!c||J(u)?e:e(u))!==u)try{r.isSetting=(r.isSetting||0)+1,o?l||a?s.delete(i):delete s[i]:vh(s,i,e,a,l)}finally{r.isSetting--}return{prevValue:u,newValue:e,parentValue:s}}var yu=[];function oe(n){let e=0,t=n;for(;rs(t);)yu[e++]=t.key,t=t.parent;let r=n.root._;for(let i=e-1;r&&i>=0;i--){const o=yu[i];r=o!=="size"&&Re(r)?r.get(o):r[o]}return r}function At(n,e,t){var r,i;let o=(r=n.children)==null?void 0:r.get(e);return o||(o={root:n.root,parent:n,key:e,lazy:!0,numListenersRecursive:0},((i=n.lazyFn)==null?void 0:i.length)===1&&(t=n.lazyFn.bind(n,e)),J(t)&&(o=Object.assign(()=>{},o),o.lazyFn=t),n.children||(n.children=new Map),n.children.set(e,o)),o}function Nl(n){let e=oe(n);if(!e||J(e))if(rs(n)){const t=Nl(n.parent),r=Kt(t),i=Re(t);e=vh(t,n.key,{},r,i)}else e=n.root._={};return e}function yh(n,e){var t,r;let i=pe(n)?void 0:vt(n)?"id"in n?"id":"key"in n?"key":"_id"in n?"_id":"__id"in n?"__id":void 0:void 0;if(!i&&e.parent){const o=e.key+"_keyExtractor",s=(r=(t=e.functions)==null?void 0:t.get(o))!=null?r:oe(e.parent)[e.key+"_keyExtractor"];s&&J(s)&&(i=s)}return i}function bu(n,e,t){n.functions||(n.functions=new Map),n.functions.set(e,t)}function bh(n,e){return n===e||Ia(n)&&Ia(e)&&+n==+e}function Na(n,e,t,r){return e?void 0:n?r?Array.from(n):t?Array.from(n.keys()):Object.keys(n):[]}function mE(n,e){return n&&Object.defineProperty(n,e,{value:!0,enumerable:!1,writable:!0,configurable:!0}),n}var Lu=function(n){return mE(n,Sh)};function Lh(n,e){var t;n.isPlain||!((t=n.parent)!=null&&t.isPlain)&&!Th(e)||(n.isPlain=!0)}function Gt(n,e,t,r){let i=n;return!pe(i)&&J(i)&&(i=t?i(t):i()),pe(i)&&!r?i.get(e):i}var ai,EE=(n,e)=>n&&n[e];function kh(n,e,t,r,i,o,s){let a,l=n;if(e.length>0){let u=o;for(let c=0;c<e.length;c++){a=e[c];const d=Re(l);let h=l?d?l.get(a):l[a]:void 0;const p=u?d?u.get(a):u[a]:void 0;if(h===is)return u&&(d?l.set(a,p):l[a]=p,s==null||s(e.slice(0,c+1),p)),n;if(h===void 0&&r===void 0&&c===e.length-1)return n;c<e.length-1&&h==null&&(h=vl(t[c]),Re(l)?l.set(a,h):l[a]=h),c<e.length-1&&(l=h,u&&(u=p))}}return a===void 0?n=i==="merge"?No(n,r):r:i==="merge"?l[a]=No(l[a],r):Re(l)?l.set(a,r):l[a]=r,n}function ku(n,e,t){let r=t;for(let i=0;i<n.length;i++){const o=n[i];r=r?r[o]:vl(e[i])}return r}function wu(n){return!(!n||(vt(n)||De(n))&&Io(n))}function vl(n){switch(n){case"array":return[];case"map":return new Map;case"set":return new Set;default:return{}}}function AE(n,e,t){const{path:r,valueAtPath:i,prevAtPath:o,pathTypes:s}=e;return kh(n,r,s,o)}function No(n,...e){if(ze(n))return e[e.length-1];let t=De(n)?[...n]:{...n};for(let i=0;i<e.length;i++){const o=e[i];if(vt(r=o)&&r.constructor===Object||De(o)){const s=o;for(const a in s)Cl.call(s,a)&&(s[a]instanceof Object&&!pe(s[a])&&Object.keys(s[a]).length>0?t[a]=No(t[a]||(De(s[a])?[]:{}),s[a]):t[a]=s[a])}else t=o}var r;return t}var vo=0,ks=!1,ws=!1,or=new Map;function gE(){or.size>0&&Nr(!0)}function wh(n,e){for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function DE(n,e){try{return function(t,r){for(let i=0;i<r.length;i++)t=AE(t,r[i]);return t}(n?Nh(n):{},e)}catch(t){return}}function yl(n,e){return function(){return DE(n,e)}}function Di(n,e,t,r,i){const o=new Map;yo(o,n,!!Ae.isLoadingLocal,!!Ae.isLoadingRemote,e,[],[],e,t,!0,r,i);const s=or.get(n);s?s.prev===e?or.delete(n):s.value=e:or.set(n,{value:e,prev:t,level:r,whenOptimizedOnlyIf:i,isFromSync:!!Ae.isLoadingRemote,isFromPersist:!!Ae.isLoadingLocal}),o.size&&Mh(o,!0),vo<=0&&Fh()}function yo(n,e,t,r,i,o,s,a,l,u,c,d){if(e.numListenersRecursive>0&&(function(h,p,f,m,E,A,D,_,S,T,N,I){if(T?p.listenersImmediate:p.listeners){const L={path:A,pathTypes:D,valueAtPath:_,prevAtPath:S},g=h.get(p);if(g&&A.length>0){const{changes:O}=g;wh(O[0].path,L.path)||(O.push(L),g.level=Math.min(g.level,N),g.whenOptimizedOnlyIf||(g.whenOptimizedOnlyIf=I))}else h.set(p,{level:N,value:E,isFromSync:m,isFromPersist:f,whenOptimizedOnlyIf:I,changes:[L]})}}(n,e,t,r,i,o,s,a,l,u,c,d),e.linkedFromNodes))for(const h of e.linkedFromNodes)yo(n,OE(h,o),t,r,a,[],[],a,l,u,0,d);if(e.parent){const h=e.parent;h&&yo(n,h,t,r,oe(h),[e.key].concat(o),[Rh(i)].concat(s),a,l,u,c+1,d)}}function Mh(n,e){const t=new Set;n.forEach(({changes:r,level:i,value:o,isFromPersist:s,isFromSync:a,whenOptimizedOnlyIf:l},u)=>{const c=e?u.listenersImmediate:u.listeners;if(c){let d;const h=Array.from(c);for(let p=0;p<h.length;p++){const f=h[p],{track:m,noArgs:E,listener:A}=f;t.has(A)||(m===!0?i<=0:m!==Il||l&&i<=0)&&(E||d||(d={value:o,isFromPersist:s,isFromSync:a,getPrevious:yl(o,r),changes:r}),m||t.add(A),A(d))}}})}function Fh(){const n=Array.from(Ae.dirtyNodes);Ae.dirtyNodes.clear(),n.forEach(r=>{const i=r.dirtyFn;i&&(r.dirtyFn=void 0,i())});const e=or;or=new Map;const t=new Map;e.forEach(({value:r,prev:i,level:o,isFromPersist:s,isFromSync:a,whenOptimizedOnlyIf:l},u)=>{yo(t,u,s,a,r,[],[],r,i,!1,o,l)}),t.size&&Mh(t,!1)}function mr(n){ss();try{n()}finally{Nr()}}function ss(){vo++,ai||(ai=setTimeout(gE,0))}function Nr(n){(--vo<=0||n)&&(ks?ws=!0:(ai&&(clearTimeout(ai),ai=void 0),vo=0,ks=!0,Fh(),ks=!1,ws&&(ws=!1,Nr(!0))))}function OE(n,e){let t=n;for(let r=0;r<e.length;r++)t=At(t,e[r]);return t}function bl(n,e,t,r,i){if(pe(n))return n;const o=Nt(n);let s={root:{_:n},lazy:!0,numListenersRecursive:0};J(n)&&(s=Object.assign(()=>{},s),s.lazyFn=n);var a;const l=(a=n,lE.has(typeof a)?new i(s):r(s));return o&&(Yt(s,void 0),t(s,n)),l}var Zn=new WeakMap,xh=[],Ph=[],Bh=[],Qn=0,va=!1;function Ms(n,e,t){const r=Zn.get(n);if(!r||!r.has(t))return;const i=r.get(t);i&&i.size!==0&&(xh[Qn]=n,Ph[Qn]=e,Bh[Qn]=t,Qn++,va||(va=!0,queueMicrotask(_E)))}var Pr={type:"listener-added",node:null,listener:void 0,timestamp:0};function _E(){va=!1;const n=typeof performance!="undefined"?performance.now():Date.now();Pr.timestamp=n;for(let e=0;e<Qn;e++){const t=xh[e],r=Ph[e],i=Bh[e],o=Zn.get(t);if(!o)continue;const s=o.get(i);if(!s||s.size===0)continue;const a=t.listeners,l=t.listenersImmediate;if(!a&&!l)continue;let u=!1;if(u=i==="listener-added"?!!(a!=null&&a.has(r))||!!(l!=null&&l.has(r)):i==="listener-removed"?!(a!=null&&a.has(r))&&!(l!=null&&l.has(r)):!(a!=null&&a.size)&&!(l!=null&&l.size),u){Pr.type=i,Pr.node=t,Pr.listener=r;const c=Array.from(s);for(let d=0;d<c.length;d++)try{c[d](Pr)}catch(h){console.error(`Error in middleware handler for ${i}:`,h)}}}Qn=0}function cn(n,e,t={},r){var i;const{initial:o,immediate:s,noArgs:a}=t,{trackingType:l}=t;let u=s?n.listenersImmediate:n.listeners;u||(u=new Set,s?n.listenersImmediate=u:n.listeners=u);const c={listener:e,track:l,noArgs:a};if(u.add(c),o){const m=oe(n);e({value:m,isFromPersist:!0,isFromSync:!1,changes:[{path:[],pathTypes:[],prevAtPath:m,valueAtPath:m}],getPrevious:()=>{}})}let d;function h(m,E=e,A){if(!(r!=null&&r.has(m))){r||(r=new Set),r.add(A||n),E||(E=e);const D={trackingType:!0,...t};d=[...d||[],cn(m,E,D,r)]}}n.linkedToNode&&h(n.linkedToNode),(i=n.linkedFromNodes)==null||i.forEach(m=>h(m)),n.numListenersRecursive++;let p=n.parent,f=[n.key];for(;p;){if(p.linkedFromNodes)for(const m of p.linkedFromNodes)r!=null&&r.has(m)||h(m,SE(m,f,e),p);p.numListenersRecursive++,f=[p.key,...f],p=p.parent}return Ms(n,c,"listener-added"),()=>{u.delete(c),d==null||d.forEach(E=>E());let m=n;for(;m;)m.numListenersRecursive--,m=m.parent;Ms(n,c,"listener-removed"),u.size===0&&Ms(n,void 0,"listeners-cleared")}}function SE(n,e,t){let r=ku(e,[],oe(n));return function({value:i,isFromPersist:o,isFromSync:s}){const a=ku(e,[],i);a!==r&&t({value:a,isFromPersist:o,isFromSync:s,changes:[{path:[],pathTypes:[],prevAtPath:r,valueAtPath:a}],getPrevious:()=>r}),r=a}}function Mu(n,e,t,r){let i=[];return n==null||n.forEach(o=>{const{node:s,track:a}=o;i.push(cn(s,e,{trackingType:a,immediate:r,noArgs:t}))}),()=>{if(i){for(let o=0;o<i.length;o++)i[o]();i=void 0}}}var uo=0,Fu=[],er={current:void 0};function co(n,e){if(uo){const t=er.current;if(t){t.nodes||(t.nodes=new Map);const r=t.nodes.get(n);r?(r.track=r.track||e,r.num++):t.nodes.set(n,{node:n,track:e,num:1})}}}function Hh(n,e,t,r,i,o){let s,a,l=e;Fu.push(er.current),uo++,er.current={};const u=n&&Gt(n,t,r,i==null?void 0:i.fromComputed),c=er.current.nodes;return--uo<0&&(uo=0),er.current=Fu.pop(),r!=null&&r.cancel||(s=Mu(c,l,!1,i==null?void 0:i.immediate),a=o?()=>(s==null||s(),s=Mu(c,l),s):void 0),{nodes:c,value:u,dispose:s,resubscribe:a}}function Oi(n,e,t){let r,i;J(e)?r=e:t=e;let o=!1;const s={num:0},a=function(){if(o)return;s.onCleanup&&(s.onCleanup(),s.onCleanup=void 0),o=!0,ss(),delete s.value,i==null||i();const{dispose:l,value:u,nodes:c}=Hh(n,a,void 0,s,t);var d,h;i=l,s.value=u,s.nodes=c,s.refresh=a,s.onCleanupReaction&&(s.onCleanupReaction(),s.onCleanupReaction=void 0),Nr(),o=!1,!r||!(t!=null&&t.fromComputed)&&(!(s.num>0)&&(d=n)&&((h=d[fr])!=null&&h.isEvent)||s.previous===s.value&&typeof s.value!="object")||r(s),s.previous=s.value,s.num++};return a(),()=>{var l,u;(l=s.onCleanup)==null||l.call(s),s.onCleanup=void 0,(u=s.onCleanupReaction)==null||u.call(s),s.onCleanupReaction=void 0,i==null||i()}}function Uh(n,e,t){if(Nt(n))return e?n.then(e):n;const r=De(n);let i,o;return Oi(function(s){const a=r?n.map(l=>Gt(l)):Gt(n);if(!Nt(a)){{let l=!0;if(De(a))for(let u=0;u<a.length;u++){let c=a[u];pe(c)?c=Gt(c):J(c)&&(c=c()),l=l&&!!(t?wu(c):c)}else l=t?wu(a):a;l&&(i=a,s.cancel=!0)}return i}i=a},function(){o=e==null?void 0:e(i)}),Nt(i)?e?i.then(e):i:i!==void 0?e?o:Promise.resolve(i):new Promise(s=>{if(e){const a=e;e=l=>{const u=a(l);s(Nt(u)?u.then(c=>c):u)}}else e=s})}function jh(n,e){return Uh(n,e,!1)}var Fs=new Set(["copyWithin","fill","from","pop","push","reverse","shift","sort","splice","unshift"]),xu=new Set(["every","filter","find","findIndex","flatMap","forEach","join","map","reduce","some"]),TE=new Set(["filter","find"]),ya=new Map,ba=new Map([["get",as],["set",ut],["peek",vr],["onChange",cn],["assign",function(n,e){const t=qe(n);if(ss(),ze(n.root._)&&(n.root._={}),Re(e)){const r=oe(n);Re(r)?e.forEach((i,o)=>r.set(o,i)):ut(n,e)}else{n.isAssigning=(n.isAssigning||0)+1;try{Object.assign(t,e)}finally{n.isAssigning--}}return Nr(),t}],["delete",Vh],["toggle",function(n){const e=oe(n);(e==null||_h(e))&&ut(n,!e)}]]);function $h(n,e,t,...r){var i;if(t!=="push"||r.length!==1){const o=e.slice(),s=e[t].apply(e,r);if(n){const a=rs(n),l=a?n.key:"_";(a?oe(n.parent):n.root)[l]=o,Er((i=n.parent)!=null?i:n,l,e)}return s}Er(n,e.length+"",r[0])}function Ll(n,e,t){var r,i,o;if(vt(e)&&gi(e)||vt(t)&&gi(t)){const T=e!==t;return T&&(n.listeners||n.listenersImmediate)&&Di(n,e,t,0),T}const s=De(e);let a,l;const u=Re(e),c=Kt(e),d=Re(t),h=Kt(t),p=Na(e,s,u,c),f=Na(t,s,d,h),m=((r=p||e)==null?void 0:r.length)||0,E=((i=f||t)==null?void 0:i.length)||0;let A,D,_,S=!1;if(s&&De(t)){if(t.length>0){const T=t[0];if(T!==void 0&&(A=yh(T,n),A&&(D=J(A),a=new Map,l=[]),n.children))for(let N=0;N<t.length;N++){const I=t[N];if(I){const L=n.children.get(N+"");if(L&&(e[N]||Pu(L,I),A)){const g=D?A(I):I[A];a.set(g,L)}}}}}else if(t&&(!e||vt(e))){const T=f.length;for(let N=0;N<T;N++){const I=f[N];if(!p.includes(I)){S=!0;const L=At(n,I),g=d?t.get(I):t[I];g!==void 0&&Pu(L,g)}}}if(e&&!ze(e)){S=S||m!==E;const T=S;let N=!1;for(let I=0;I<m;I++){const L=s?I+"":p[I];let g=u?e.get(L):e[L];const O=d?t==null?void 0:t.get(L):t==null?void 0:t[L];let k=!bh(g,O);if(k){const w=A&&g?D?A(g):g[A]:void 0,U=(o=n.children)==null?void 0:o.get(L);if(pe(g)){const M=Fi(g);if((U==null?void 0:U.linkedToNode)===M){const j=oe(M);u?e.set(L,j):e[L]=j;continue}const $=g;g=()=>$}let y=At(n,L,g);if(y.lazy||!J(g)&&!pe(g)||(Xh(y,g),Fn(y)),s&&w!==void 0){const M=w!==void 0?a==null?void 0:a.get(w):void 0;if(M){if(M!==void 0&&M.key!==L){const $=t[M.key];T&&(y=M,n.children.delete(y.key),y.key=L,l.push([L,y])),N=!0,k=$!==g}}else S=!0}if(k)if(J(g)||pe(g))gr(n,L,g);else if(ze(g))S=!0;else{const M=Ll(y,g,O);S=S||M,k=M}(k||s&&!T)&&(y.listeners||y.listenersImmediate)&&Di(y,g,O,0,!T)}}if(l)for(let I=0;I<l.length;I++){const[L,g]=l[I];n.children.set(L,g)}_=S||N}else t!==void 0&&(_=!0);return _!=null&&_}function Pu(n,e){var t,r;(t=n.linkedToNodeDispose)==null||t.call(n),(r=n.activatedObserveDispose)==null||r.call(n),ze(e)||Ll(n,void 0,e),(n.listeners||n.listenersImmediate)&&Di(n,void 0,e,0)}function qe(n,e,t){return e!==void 0&&(n=At(n,e,t)),n.proxy||(n.proxy=new Proxy(n,zh))}function La(){if(Ae.pendingNodes.size>0){const n=Array.from(Ae.pendingNodes.values());Ae.pendingNodes.clear(),n.forEach(e=>e())}}var zh={get(n,e,t){var r,i;if(e===uE)throw new Error("[legend-state] observable is not a primitive.");if(e===fr)return n;if(e==="apply"||e==="call"){const d=oe(n);if(J(d))return d[e]}let o=Fn(n,e==="get"||e==="peek");if(e===cE)return!o||ze(o)?void 0:o[e];const s=n.linkedToNode||(o==null?void 0:o[fr]);if(s&&e!=="onChange")return zh.get(s,e,t);if(Re(o)||Kt(o)){const d=function(h,p,f){const m=f==null?void 0:f[p];if(p==="size")return co(h,!0),f[p];if(J(m))return function(E,A,D){const _=arguments.length,S=f;if(p==="get"){if(_>0&&typeof E!="boolean"&&E!==Il)return qe(h,E)}else{if(p==="set")return _===2?ut(At(h,E),A):_===1&&Re(f)&&ut(h,E),qe(h);if(p==="delete"){if(_>0){const N=f.get?S.get(E):E;return Vh(h,E),N!==void 0}}else{if(p==="clear"){const N=Kt(S)?new Set(S):new Map(S),I=S.size;return S.clear(),void(I&&Yh(h,f,N))}if(p==="add"){const N=new Set(f),I=f.add(E);return f.has(p)||Di(h,I,N,0),qe(h)}}}const T=ba.get(p);if(!T)return f[p](E,A);switch(_){case 0:return T(h);case 1:return T(h,E);case 2:return T(h,E,A);default:return T(h,E,A,D)}}}(n,e,o);if(d!==void 0)return d}const a=ba.get(e);if(a)return e!=="get"&&e!=="peek"||La(),function(d,h,p){switch(arguments.length){case 0:return a(n);case 1:return a(n,d);case 2:return a(n,d,h);default:return a(n,d,h,p)}};const l=ya.get(e);if(l)return l.get(n);let u=o==null?void 0:o[e];if(vt(o)&&gi(o))return u;const c=(r=n.functions)==null?void 0:r.get(e);if(c)return pe(c)?c:qe(n,e,c);if(u=function(d,h){if(d){const p=Object.getOwnPropertyDescriptor(d,h);return p!=null&&p.get&&(delete d[h],d[h]=p.set?function(f){J(f)&&(f={get:f});const m=function(){return{[Ai]:f}};return m.prototype[Ai]=f,m}({get:p.get,set:({value:f})=>p.set(f)}):p.get),d[h]}}(o,e),function(d){return d==null}(o)&&u===void 0&&(Fs.has(e)||xu.has(e))&&(o=[],Fs.has(e)&&Yt(n,o),u=o[e]),J(u)){if(De(o)){if(Fs.has(e))return(...h)=>$h(n,o,e,...h);if(xu.has(e))return co(n,!0),function(h,p){const f=e==="reduce",m=f?(D,_,S,T)=>h(D,qe(n,S+"",_),S,T):(D,_,S)=>h(qe(n,_+"",D),_,S);if(f||!TE.has(e))return o[e](m,p);const E=e==="find",A=[];for(let D=0;D<o.length;D++)if(m(o[D],D,o)){const _=qe(n,D+"");if(E)return _;A.push(_)}return E?void 0:A}}gr(n,e,u);const d=(i=n.functions)==null?void 0:i.get(e);return d?qe(n,e,d):u.bind(o)}return ze(u)&&e==="length"&&De(o)?(co(n,!0),u):qe(n,e)},getPrototypeOf(n){const e=oe(n);return e!==null&&typeof e=="object"?Reflect.getPrototypeOf(e):null},ownKeys(n){Fn(n);const e=as(n,!0);if(ze(e))return[];const t=e?Reflect.ownKeys(e):[];if(De(e)&&t[t.length-1]==="length"&&t.splice(t.length-1,1),J(n)){const r=Reflect.ownKeys(n);["caller","arguments","prototype"].forEach(i=>r.includes(i)&&t.push(i))}return t},getOwnPropertyDescriptor(n,e){if(e==="caller"||e==="arguments"||e==="prototype")return{configurable:!1,enumerable:!1};const t=oe(n);if(ze(t))return;const r=Reflect.getOwnPropertyDescriptor(t,e);return r?{...r,configurable:!0}:void 0},set(n,e,t){if(n.isSetting)return Reflect.set(n,e,t);if(n.isAssigning)return Er(n,e,t),!0;const r=ya.get(e);return!!r&&(r.set(n,t),!0)},deleteProperty:(n,e)=>!!n.isSetting&&Reflect.deleteProperty(n,e),has(n,e){const t=oe(n);return Reflect.has(t,e)},apply(n,e,t){pe(e)&&(e=e.peek());const r=oe(n),i=J(r)?r:n.lazyFn||n;return Reflect.apply(i,e,t)}};function ut(n,e){n.parent?Er(n.parent,n.key,e):Er(n,"_",e)}function Er(n,e,t,r){const i=!n.parent&&e==="_";Lh(n,t),!n.parent||oe(n)||J(t)||ut(n,{[e]:t});const o=i?n:At(n,e,t);if(pe(t))bo(o,t);else{const{newValue:s,prevValue:a,parentValue:l}=Yt(o,t),u=ze(a)||a instanceof Date||ze(s)||s instanceof Date;if(!u){let h=o;do h.needsExtract=!0,h.recursivelyAutoActivated=!1;while(h=h.parent)}const c=!bh(s,a),d=!c&&o.isComputing&&!u&&!o.isPlain;!c&&!d||o.isComputing&&o.isPlain&&n.numListenersRecursive===0||Yh(n,s,a,o,l,u,i,r,d),gr(n,e,s)}}function Vh(n,e){e===void 0&&rs(n)&&(e=n.key,n=n.parent);const t=oe(n);De(t)?$h(n,t,"splice",e,1):Er(n,e!=null?e:"_",is,-1)}function Yh(n,e,t,r,i,o,s,a,l){r||(r=n),ss(),o===void 0&&(o=ze(e));let u,c,d=l||o,h=!1;(!o||t&&!ze(t))&&(d=d||Ll(r,e,t),De(e)?u=e:(Re(e)||Kt(e))&&(c=e)),De(i)?u=i:(Re(i)||Kt(i))&&(c=i),u?h=(u==null?void 0:u.length)!==(t==null?void 0:t.length):c&&(h=(c==null?void 0:c.size)!==(t==null?void 0:t.size)),(o||!e||Io(e)&&!Io(t)?e!==t:d)&&Di(o&&s?n:r,e,t,(a!=null?a:t===void 0)?-1:d?0:1,h),Nr()}function Ar(n,e,t){const r=n.numGets=(n.numGets||0)+1;n.state||(n.state=bl({isLoaded:!1},0,Ar,qe)),e.then(i=>{r>=(n.getNumResolved||0)&&(n.getNumResolved=n.numGets,t?t({value:i}):ut(n,i),n.state.assign({isLoaded:!0,error:void 0}))}).catch(i=>{n.state.error.set(i)})}function gr(n,e,t){if(Nt(t)){const r=At(n,e);return Ar(r,t),void Yt(r,void 0)}if(pe(t)){const r=()=>t;bu(n,e,r);const i=At(n,e,r),o=vr(Fi(t));return bo(i,t),Yt(i,o),oe(i)}if(typeof t=="function")return bu(n,e,t),e}function as(n,e){return co(n,e?vt(e)?e.shallow:e:void 0),vr(n)}function vr(n){return Fn(n,!0)}var Ki=!1;function Fn(n,e){var t;if(Ki=!0,e&&((t=n.dirtyChildren)==null?void 0:t.size)){const i=Array.from(n.dirtyChildren);n.dirtyChildren.clear(),i.forEach(o=>o.dirtyFn&&Fn(o))}if(n.dirtyFn){const i=n.dirtyFn;n.dirtyFn=void 0,Ae.dirtyNodes.delete(n),i()}Ki=!1;let r=oe(n);return n.root.isLoadingLocal||n.isPlain||(r=function(i,o,s){const a=o,l=i.lazy;if(l){const u=i.lazyFn;if(delete i.lazy,J(u))if(u.length===1)o={};else{if(i.parent){const c=oe(i.parent);J(o)&&(c?delete c[i.key]:i.root._=void 0)}o=function(c,d){let h,p,f,m=!0;const E=d;let A,D,_=[];function S(){c.dirtyFn=D,Ae.dirtyNodes.add(c)}const T=Oi(()=>{var N,I,L,g;if(m)m=!1,J(oe(c))&&Yt(c,void 0);else if(!Ki&&D&&function(y,M){if(!Ki&&!function(j){var G,V;let Y=j,K=j.numListenersRecursive>0;for(;Y&&!K;)((G=Y.listeners)!=null&&G.size||(V=Y.listenersImmediate)!=null&&V.size)&&(K=!0),Y=Y.parent;return K}(y)){M&&(y.dirtyFn=M);let j=y;for(;j;)j.dirtyChildren||(j.dirtyChildren=new Set),j.dirtyChildren.add(y),j=j.parent;return!0}}(c,D))return void(f=!0);let O=E(),k=!1;const w=pe(O);(w||c.linkedToNode)&&(k=w,O=bo(c,O)),J(O)&&O.length===0&&(O=O());const U=w||O==null?void 0:O[Ai];if(U&&(c.activationState=U,O=void 0),f=!1,p=Nt(O),c.activated){if(c.activationState){const y=c.activationState;(I=(N=c.state)==null?void 0:N.peek())!=null&&I.sync?(c.state.sync(),f=!0):O=(g=(L=y.get)==null?void 0:L.call(y))!=null?g:y.initial}}else{c.activated=!0;let y=RE;U!=null&&U.synced&&(y=Ae.activateSyncedNode,f=!0);const M=y(c,O);h=M.update;let $=M.value;!k&&pe($)&&($=bo(c,$)),O=$!=null?$:U==null?void 0:U.initial}return f&&(A=O),p=p||Nt(O),O},N=>{const{value:I,nodes:L,refresh:g}=N;if(D=g,!f){if(!p||!Ae.isLoadingRemote)if(p)if(c.activationState){const{initial:O}=c.activationState;I&&Nt(I)&&Ar(c,I,h),J(oe(c))&&Yt(c,O!=null?O:void 0)}else c.activated&&(Ar(c,I,h),J(oe(c))&&Yt(c,void 0));else{A=I;const O=c.state.isLoaded.peek();!O&&J(I)||(c.isComputing=!0,ut(c,I),c.isComputing=!1),O||c.state.assign({isLoaded:!0,error:void 0})}_.forEach(O=>O()),_=[],L==null||L.forEach(({node:O,track:k})=>{_.push(cn(O,S,{immediate:!0,trackingType:k}))})}N.cancel=!0},{fromComputed:!0});return c.activatedObserveDispose=()=>{T==null||T(),_.forEach(N=>N())},A}(i,u)}else pe(o)&&(o=gr(i.parent,i.key,o))}return Lh(i,o),!l&&!i.needsExtract||i.isPlain||pe(o)||ze(o)||(s&&function(u,c){if(!c.recursivelyAutoActivated&&(vt(u)||De(u))&&!gi(u)){c.recursivelyAutoActivated=!0;const d=[];Kh(u,d,()=>{var p;let f=c;for(let m=0;m<d.length;m++){const E=d[m],A=(p=oe(f))==null?void 0:p[E];f=At(f,E,J(A)?A:void 0),Fn(f)}return f})}}(o,i),i.parent&&gr(i.parent,i.key,a)),o}(n,r,!!e)),r}function Gh(n){var e,t;(e=n.activatedObserveDispose)==null||e.call(n),(t=n.linkedToNodeDispose)==null||t.call(n),n.activatedObserveDispose=n.linkedToNodeDispose=n.linkedToNode=void 0}function Xh(n,e){Gh(n),n.lazyFn=e,n.lazy=!0}function RE(n,e){if(n.state||(n.state=bl({isLoaded:!1},0,Ar,qe)),n.activationState){const{set:t,get:r,initial:i}=n.activationState;if((e=r==null?void 0:r())!=null&&e!==null||(e=i),t){let o,s=[],a=0;const l=u=>{if(s.length>0){let c,d,h,p=!1,f=!1;u?(c=u.changes,d=u.value,p=u.isFromPersist,f=u.isFromSync,h=u.getPrevious):(c=s,d=o,h=yl(d,c)),s=[],o=void 0,Ae.pendingNodes.delete(n),a++;const m=a,E=()=>{m===a&&(n.isComputing=!0,t({value:d,changes:c,isFromPersist:p,isFromSync:f,getPrevious:h}),n.isComputing=!1)};Uh(n.state.isLoaded,E,!0)}};cn(n,({value:u,changes:c})=>{n.isComputing||(c.length>1||!J(c[0].prevAtPath))&&(o=u,s.length>0&&(c=c.filter(d=>!wh(s[0].path,d.path))),s.push(...c),Ae.pendingNodes.set(n,l))},{immediate:!0}),cn(n,l)}}return{update:({value:t})=>{n.isComputing||(n.isComputing=!0,ut(n,t),n.isComputing=!1)},value:e}}function bo(n,e){var t;const r=e?Fi(e):void 0;return r!==n&&(r==null?void 0:r.linkedToNode)!==n&&(n.linkedToNode=r,(t=n.linkedToNodeDispose)==null||t.call(n),r&&(r.linkedFromNodes||(r.linkedFromNodes=new Set),r.linkedFromNodes.add(n),n.linkedToNodeDispose=cn(r,()=>{J(e=Fn(r))||ut(n,e)},{initial:!0},new Set([n])))),e}function Kh(n,e,t){var r;if((vt(n)||De(n))&&!gi(n)&&!Th(n)){for(const i in n)if(Cl.call(n,i)){const o=n[i];if(pe(o)){const s=t();gr(s,i,o),delete s.lazy}else{const s=J(o)&&((r=o.prototype)==null?void 0:r[Ai]);if(s){const a=s.activate;(!a||a==="auto")&&vr(At(t(),i,o))}}typeof o=="object"&&(e.push(i),Kh(o,e,t),e.pop())}}}var Bu=["get","set","peek","onChange","toggle"];function sr(n){this._node=n;for(let e=0;e<Bu.length;e++){const t=Bu[e];this[t]=this[t].bind(this)}}function Wi(n,e){sr.prototype[n]=function(...t){return e.call(this,this._node,...t)}}function me(n){return bl(n,0,Ar,qe,sr)}Wi("peek",n=>(La(),vr(n))),Wi("get",(n,e)=>(La(),as(n,e))),Wi("set",ut),Wi("onChange",cn),Object.defineProperty(sr.prototype,fr,{configurable:!0,get(){return this._node}}),sr.prototype.toggle=function(){const n=this.peek();(n==null||_h(n))&&this.set(!n)},sr.prototype.delete=function(){return this.set(void 0),this};var ls={createPreviousHandler:yl,clone:Nh,deactivateNode:Gh,deepMerge:No,ensureNodeValue:Nl,findIDKey:yh,get:as,getChildNode:At,getKeys:Na,getNode:Fi,getNodeValue:oe,getPathType:Rh,getProxy:qe,getValueAtPath:function(n,e){return e.reduce(EE,n)},globalState:Ae,initializePathType:vl,ObservablePrimitiveClass:sr,observableProperties:ya,observableFns:ba,optimized:Il,peek:vr,reactivateNode:Xh,registerMiddleware:function(n,e,t){let r=Zn.get(n);r||(r=new Map,Zn.set(n,r));let i=r.get(e);return i||(i=new Set,r.set(e,i)),i.add(t),()=>{const o=Zn.get(n);if(!o)return;const s=o.get(e);s&&(s.delete(t),s.size===0&&(o.delete(e),o.size===0&&Zn.delete(n)))}},safeParse:Ih,safeStringify:Ch,set:ut,setAtPath:kh,setNodeValue:Yt,symbolLinked:Ai,symbolDelete:is,tracking:er},{globalState:Hu,observableProperties:CE,observableFns:IE,ObservablePrimitiveClass:Uu}=ls;class Wh extends Error{}function ju(n,e){if(!n)throw new Wh(e!=null?e:"Assertion failed")}const le=Object.assign(ju,{is:function(n,e,t){return ju(e,t)},unreachable:function(){throw new Error("Unreachable code")},never:function(n){throw new Error("Unreachable")},defined:function(n){if(n==null)throw new Wh("Value is not defined")}});class us{constructor(e={}){this._handlers=new Set,this._meta=e}meta(e){return new us(e)}_emit(e,t){for(const r of this._handlers)r({level:e,data:t,timestamp:Date.now(),meta:this._meta})}error(...e){return this._emit("error",e)}warn(...e){return this._emit("warn",e)}info(...e){return this._emit("info",e)}log(...e){return this._emit("log",e)}trace(...e){return this._emit("trace",e)}registerHandler(e){return this._handlers.add(e),()=>this._handlers.delete(e)}}const Lo=new us,zt=new us,NE="https://cdn.jsdelivr.net/npm/emoji-picker-element@1.26.3/+esm",kl=function(n){let e;return()=>(e===void 0&&(e={value:n()}),e.value)}(async function(){if(typeof window=="undefined"||window.document===void 0)return new Promise(()=>{});try{const n=await async function(t){return import(t).catch(()=>new Function("url","return import(url)")(t)).catch(()=>{throw new Error("Cannot dynamically import module in this environment")})}(NE);return await new n.Database().ready(),n}catch(n){return Lo.error("Failed to load emoji picker:",n),new Promise(()=>{})}});function $u(n,e,t){return n.clearRect(0,0,100,100),n.fillStyle=t,n.fillText(e,0,0),n.getImageData(0,0,1,1).data.join(",")}function zu(n){const e=function(){const i=document.createElement("canvas");i.width=i.height=1;const o=i.getContext("2d",{willReadFrequently:!0});return o.textBaseline="top",o.font='100px "Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',o.scale(.01,.01),o}(),t=$u(e,n,"#fff"),r=$u(e,n,"#000");return r===t&&!r.startsWith("0,0,0,")}function vE(n){const{common:e}=n;return e.conversation.subject?x`
2
2
  <div className="t-title">${e.conversation.subject}</div>
3
3
  <div className="t-subtitle">
4
- <${zu} ...${n} />
4
+ <${Vu} ...${n} />
5
5
  </div>
6
6
  `:x`<div className="t-title">
7
- <${zu} ...${n} />
8
- </div>`}function zu({common:n,isUserConnected:e,permissions:t}){const{participants:r}=n,i=r.filter(({user:s})=>s.id!==n.currentUser.id),o=i.length===0?r:i;return t.showOnlineStatus?x`
7
+ <${Vu} ...${n} />
8
+ </div>`}function Vu({common:n,isUserConnected:e,permissions:t}){const{participants:r}=n,i=r.filter(({user:s})=>s.id!==n.currentUser.id),o=i.length===0?r:i;return t.showOnlineStatus?x`
9
9
  <span className="t-participants">
10
10
  ${o.map(({user:s})=>x`
11
11
  <span className="t-participant" key=${s.id}>
@@ -43,7 +43,7 @@
43
43
  d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"
44
44
  ></path>
45
45
  </svg>
46
- `},chevronLeft:Vu,left:Vu,chevronRight:Yu,right:Yu,chevronUp:Gu,up:Gu,chevronDown:Xu,down:Xu,close:function({className:n}){return x`
46
+ `},chevronLeft:Yu,left:Yu,chevronRight:Gu,right:Gu,chevronUp:Xu,up:Xu,chevronDown:Ku,down:Ku,close:function({className:n}){return x`
47
47
  <svg
48
48
  className=${n}
49
49
  xmlns="http://www.w3.org/2000/svg"
@@ -607,7 +607,7 @@
607
607
  <line x1="19" y1="12" x2="5" y2="12"></line>
608
608
  <polyline points="12 19 5 12 12 5"></polyline>
609
609
  </svg>
610
- `}};function Vu({className:n}){return x`
610
+ `}};function Yu({className:n}){return x`
611
611
  <svg
612
612
  className=${n}
613
613
  xmlns="http://www.w3.org/2000/svg"
@@ -621,7 +621,7 @@
621
621
  >
622
622
  <polyline fill="none" points="15 6 9 12 15 18"></polyline>
623
623
  </svg>
624
- `}function Yu({className:n}){return x`
624
+ `}function Gu({className:n}){return x`
625
625
  <svg
626
626
  className=${n}
627
627
  xmlns="http://www.w3.org/2000/svg"
@@ -635,7 +635,7 @@
635
635
  >
636
636
  <polyline fill="none" points="9 6 15 12 9 18"></polyline>
637
637
  </svg>
638
- `}function Gu({className:n}){return x`
638
+ `}function Xu({className:n}){return x`
639
639
  <svg
640
640
  className=${n}
641
641
  xmlns="http://www.w3.org/2000/svg"
@@ -650,7 +650,7 @@
650
650
  >
651
651
  <polyline fill="none" points="18 15 12 9 6 15"></polyline>
652
652
  </svg>
653
- `}function Xu({className:n}){return x`
653
+ `}function Ku({className:n}){return x`
654
654
  <svg
655
655
  className=${n}
656
656
  xmlns="http://www.w3.org/2000/svg"
@@ -665,7 +665,7 @@
665
665
  >
666
666
  <polyline fill="none" points="6 9 12 15 18 9"></polyline>
667
667
  </svg>
668
- `}function LE({message:n,common:e}){var s;const t=n.content[0],{theme:r,t:i}=e,{Icon:o}=r;if(t.type==="text")return x`<${iu}
668
+ `}function LE({message:n,common:e}){var s;const t=n.content[0],{theme:r,t:i}=e,{Icon:o}=r;if(t.type==="text")return x`<${ou}
669
669
  block=${t}
670
670
  message=${n}
671
671
  nonInteractive
@@ -680,7 +680,7 @@
680
680
  ${t.filename}
681
681
  `;if(t.subtype==="voice")return x`
682
682
  <${o} type="microphone" common=${e} />
683
- ${i.VOICE_MESSAGE} (${hu((s=t.duration)!=null?s:0)})
683
+ ${i.VOICE_MESSAGE} (${pu((s=t.duration)!=null?s:0)})
684
684
  `;if(t.subtype===void 0)return x`
685
685
  <${o} type="attachment" common=${e} />
686
686
  ${t.filename}
@@ -696,7 +696,7 @@
696
696
  <div className="t-theme-audio-block">
697
697
  <${Vo} src=${n.url} filename=${n.filename} />
698
698
 
699
- <a className="t-body-text" href=${e}>
699
+ <a className="t-body-text" href=${e} target="_blank">
700
700
  <${r}
701
701
  type="attachment"
702
702
  className="t-attachment-icon"
@@ -744,7 +744,7 @@
744
744
  common=${n}
745
745
  />`:x`
746
746
  <${s} participants=${t} common=${n} />
747
- `},ConversationListItem:function(n){var D,_,S;const{common:e,conversation:t,participants:r,isSelected:i}=n,{currentUser:o,theme:s,conversationList:a}=e,{TimeAgo:l,ConversationImage:u,CompactMessageContent:c}=s,{lastMessage:d}=t,h=r.length>=3,p=(D=d==null?void 0:d.sender)==null?void 0:D.name,f=(_=d==null?void 0:d.editedAt)!=null?_:d==null?void 0:d.createdAt,m=r.filter(R=>R.user.id!==o.id),E=m.length?m:r,A=(S=t.subject)!=null?S:E.map(R=>R.user.name).join(", ");return x`
747
+ `},ConversationListItem:function(n){var D,_,S;const{common:e,conversation:t,participants:r,isSelected:i}=n,{currentUser:o,theme:s,conversationList:a}=e,{TimeAgo:l,ConversationImage:u,CompactMessageContent:c}=s,{lastMessage:d}=t,h=r.length>=3,p=(D=d==null?void 0:d.sender)==null?void 0:D.name,f=(_=d==null?void 0:d.editedAt)!=null?_:d==null?void 0:d.createdAt,m=r.filter(T=>T.user.id!==o.id),E=m.length?m:r,A=(S=t.subject)!=null?S:E.map(T=>T.user.name).join(", ");return x`
748
748
  <div
749
749
  className="t-theme-conversation-list-item"
750
750
  t-unread=${t.unreadMessageCount?"":void 0}
@@ -786,7 +786,7 @@
786
786
  </div>
787
787
  `},FileBlock:function({block:n,downloadUrl:e,common:t}){const{Icon:r}=t.theme;return x`
788
788
  <div className="t-theme-file-block">
789
- <a className="t-body-text" href=${e}>
789
+ <a className="t-body-text" href=${e} target="_blank">
790
790
  <${r}
791
791
  type="attachment"
792
792
  className="t-attachment-icon"
@@ -857,13 +857,13 @@
857
857
  </div>
858
858
  </a>
859
859
 
860
- <a href=${e} className="t-body-text">
860
+ <a href=${e} className="t-body-text" target="_blank">
861
861
  <${r} className="download-icon" type="download" common=${t} />
862
862
  <span>${n.filename}</span>
863
863
  <span className="t-filesize"> (${oi(n.size)})</span>
864
864
  </a>
865
865
  </div>
866
- `},LocationBlock:function({block:n}){const{imageUrl:e,linkUrl:t}=du(n);return x`
866
+ `},LocationBlock:function({block:n}){const{imageUrl:e,linkUrl:t}=hu(n);return x`
867
867
  <div className="t-theme-location-block">
868
868
  <a
869
869
  href=${t}
@@ -940,18 +940,18 @@
940
940
 
941
941
  ${e.reactions.length>0&&x`
942
942
  <div className="t-emoji-reactions">
943
- ${e.reactions.map(R=>x`
943
+ ${e.reactions.map(T=>x`
944
944
  <button
945
945
  className="t-reaction-button"
946
- t-active=${R.currentUserReacted?"true":void 0}
947
- onClick=${()=>l.toggleReaction(e.id,R.emoji)}
946
+ t-active=${T.currentUserReacted?"true":void 0}
947
+ onClick=${()=>l.toggleReaction(e.id,T.emoji)}
948
948
  disabled=${!r.canAddReaction}
949
- aria-label=${u.ARIA_REACTION_COUNT(R.count,R.emoji)}
950
- aria-pressed=${R.currentUserReacted}
951
- key=${R.emoji}
949
+ aria-label=${u.ARIA_REACTION_COUNT(T.count,T.emoji)}
950
+ aria-pressed=${T.currentUserReacted}
951
+ key=${T.emoji}
952
952
  >
953
- <span className="t-emoji">${R.emoji}</span>
954
- <span className="t-num-reactions">${R.count}</span>
953
+ <span className="t-emoji">${T.emoji}</span>
954
+ <span className="t-num-reactions">${T.count}</span>
955
955
  </button>
956
956
  `)}
957
957
  </div>
@@ -992,7 +992,7 @@
992
992
  <div className="t-theme-message-field" t-mode=${p}>
993
993
  ${r.showEmojiPicker&&x`
994
994
  <div className="t-emoji-picker-wrapper">
995
- <${ou} colorScheme="light" />
995
+ <${su} colorScheme="light" />
996
996
  </div>
997
997
  `}
998
998
  <${Am} />
@@ -1141,7 +1141,7 @@
1141
1141
  </div>
1142
1142
  `},TextBlock:function({block:n,message:e}){return x`
1143
1143
  <div className="t-theme-text-block">
1144
- <${iu} block=${n} message=${e} />
1144
+ <${ou} block=${n} message=${e} />
1145
1145
  </div>
1146
1146
  `},TimeAgo:function({timestamp:n,common:e}){const{t}=e,r=new Date(n).toLocaleString(t.locale,{weekday:"short",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),i=jm(n,t);return x`
1147
1147
  <span className="t-theme-time-ago">
@@ -1169,7 +1169,7 @@
1169
1169
  </div>
1170
1170
  </div>
1171
1171
 
1172
- <a href=${e} className="t-body-text">
1172
+ <a href=${e} className="t-body-text" target="_blank">
1173
1173
  <${r} className="download-icon" type="download" common=${t} />
1174
1174
  <span>${n.filename}</span>
1175
1175
  <span className="t-filesize"> (${oi(n.size)})</span>
@@ -1179,24 +1179,24 @@
1179
1179
  className="t-theme-voice-block"
1180
1180
  src=${n.url}
1181
1181
  filename=${n.filename}
1182
- />`}},Symbol.toStringTag,{value:"Module"})),wE=T.createContext(null),xs={didCatch:!1,error:null};class Wh extends T.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=xs}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];(t=(r=this.props).onReset)===null||t===void 0||t.call(r,{args:o,reason:"imperative-api"}),this.setState(xs)}}componentDidCatch(e,t){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,e,t)}componentDidUpdate(e,t){const{didCatch:r}=this.state,{resetKeys:i}=this.props;var o,s;r&&t.error!==null&&function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return a.length!==l.length||a.some((u,c)=>!Object.is(u,l[c]))}(e.resetKeys,i)&&((o=(s=this.props).onReset)===null||o===void 0||o.call(s,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(xs))}render(){const{children:e,fallbackRender:t,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:s}=this.state;let a=e;if(o){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof t=="function")a=t(l);else if(r)a=T.createElement(r,l);else{if(i===void 0)throw s;a=i}}return T.createElement(wE.Provider,{value:{didCatch:o,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}var Ji=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ME(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Jh(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var qh={exports:{}},Ku={},Dr=T,FE=typeof Object.is=="function"?Object.is:function(n,e){return n===e&&(n!==0||1/n==1/e)||n!=n&&e!=e},xE=Dr.useState,PE=Dr.useEffect,BE=Dr.useLayoutEffect,HE=Dr.useDebugValue;function Ps(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!FE(n,t)}catch(r){return!0}}var UE=typeof window=="undefined"||window.document===void 0||window.document.createElement===void 0?function(n,e){return e()}:function(n,e){var t=e(),r=xE({inst:{value:t,getSnapshot:e}}),i=r[0].inst,o=r[1];return BE(function(){i.value=t,i.getSnapshot=e,Ps(i)&&o({inst:i})},[n,t,e]),PE(function(){return Ps(i)&&o({inst:i}),n(function(){Ps(i)&&o({inst:i})})},[n]),HE(t),t};Ku.useSyncExternalStore=Dr.useSyncExternalStore!==void 0?Dr.useSyncExternalStore:UE,qh.exports=Ku;var jE=qh.exports,Wu=!1,ka={inObserver:!1},Ju=void 0,$E=()=>Ju||(Ju=T.createContext(null));function qu(n){const e=Uh(n);if(!T.use)throw e;T.use(e)}function Z(n,e){let t;if(ka.inObserver&&fe(n)&&!(e!=null&&e.suspense))return t=Gt(n,e),e!=null&&e.suspense&&t===void 0&&qu(n),t;try{const r=T.useContext($E()),i=T.useMemo(()=>function(l,u){let c,d,h,p,f,m,E=0;const A=()=>{d==null||d();const{value:_,dispose:S,resubscribe:R}=Bh(p,D,l,void 0,void 0,!0);return d=S,h=R,_},D=({value:_})=>{if(u!=null&&u.peek()){const S=m;m=_,S===void 0&&Uh(()=>!u.get(),()=>{const R=m;m=void 0,D({value:R})})}else{let S=l==null?void 0:l.skipCheck;if(!S){const R=A();(R!==f||!ze(R)&&R===_)&&(S=!0)}S&&(E++,c==null||c())}};return{subscribe:_=>(c=_,!d&&h&&(d=h()),()=>{d==null||d(),d=void 0}),getVersion:()=>E,run:_=>(p=_,f=A())}}(e,r),[]),{subscribe:o,getVersion:s,run:a}=i;t=a(n),jE.useSyncExternalStore(o,s,s)}catch(r){throw r}return e!=null&&e.suspense&&t===void 0&&qu(n),t}var Zu=typeof Symbol=="function"&&Symbol.for;function Zh(n,e,t,r,i){const o=Zu?Symbol.for("react.forward_ref"):typeof T.forwardRef=="function"&&T.forwardRef(f=>null).$$typeof,s=Zu?Symbol.for("react.memo"):typeof T.forwardRef=="function"&&T.memo(f=>null).$$typeof;if(n.__legend_proxied)return n;let a=!1,l=!1,u=n;s&&u.$$typeof===s&&u.type&&(l=!0,u=u.type),o&&u.$$typeof===o&&(a=!0,u=u.render);const c=r?new Set(r):void 0,d={apply(f,m,E){if(t){const A=E[0],D={},_=Object.keys(A);for(let S=0;S<_.length;S++){const R=_[S],v=A[R],I=c&&c.has(R);if(R==="children"&&(J(v)||fe(v)))D[R]=Z(v,{skipCheck:!0});else if(I||R.startsWith("$")||R.endsWith("$")){const L=I?R:R.endsWith("$")?R.slice(0,-1):R.slice(1),g=i==null?void 0:i[L],O=g&&fe(v);if(D[L]=O&&(g!=null&&g.selector)?g.selector(D,v):Z(v),O&&(g.defaultValue!==void 0&&D[L]===void 0&&(D[L]=g.defaultValue),g.handler&&g.getValue)){const k=w=>{var U;v.set(g.getValue(w)),(U=A[g.handler])==null||U.call(A,w)};D[g.handler]=T.useCallback(k,[A[g.handler],i])}I||delete D[R]}else D[R]===void 0&&(D[R]=v)}E[0]=D}return e?Z(()=>{ka.inObserver=!0;try{return Reflect.apply(f,m,E)}finally{ka.inObserver=!1}},{skipCheck:!0}):Reflect.apply(f,m,E)}},h=new Proxy(u,d);let p;return a?(p=T.forwardRef(h),p.__legend_proxied=!0):p=h,e||l?T.memo(p):p}var{findIDKey:zE,getNode:VE,optimized:YE}=ls,Qu=new Map;function wa({each:n,optimized:e,item:t,itemProps:r,sortValues:i,children:o}){var s;if(!n)return null;const a=Z(()=>n.get(!e||YE));if(!t&&o){const u=T.useRef();u.current=o,t=T.useMemo(()=>{return c=({item$:d,id:h})=>u.current(d,h),Zh(c,!0);var c},[])}else if(t.$$typeof!==Symbol.for("react.memo")){let u=Qu.get(t);u||(u=T.memo(t),Qu.set(t,u)),t=u}if(!a)return null;const l=[];if(De(a)){const u=a[0],c=VE(n),d=a.length,h=d>0?c&&zE(u,c)||(u.id!==void 0?"id":u.key!==void 0?"key":void 0):void 0,p=J(h);for(let f=0;f<d;f++)if(a[f]){const m=a[f],E=(s=p?h(m):m[h])!=null?s:f,A=n[f],D={key:E,id:E,item$:A,item:A};l.push(T.createElement(t,r?Object.assign(D,r):D))}}else{const u=Re(a),c=u?Array.from(a.keys()):Object.keys(a);i&&c.sort((d,h)=>i(u?a.get(d):a[d],u?a.get(h):a[h],d,h));for(let d=0;d<c.length;d++){const h=c[d];if(u?a.get(h):a[h]){const p=u?n.get(h):n[h],f={key:h,id:h,item$:p,item:p};l.push(T.createElement(t,r?Object.assign(f,r):f))}}}return l}T.memo(function({children:n}){return Z(()=>Gt(Gt(n)),{skipCheck:!0})},(n,e)=>!e.scoped||n.children===e.children);var ec=new Map,tc=new Map;new Proxy({},{get(n,e){if(!n[e]){const t=ec.get(e)||e,r=T.forwardRef((i,o)=>{const s={...i};return!o||!J(o)&&Io(o)||(s.ref=o),T.createElement(t,s)});n[e]=function(i,o,s){return Zh(i,!1,!0,o,s)}(r,[],tc.get(e))}return n[e]}}),function(n){(function(e){if(Wu)return;Wu=!0;const t={value:{handler:"onChange",getValue:i=>i.target.value,defaultValue:""}},r=Object.assign({checked:{handler:"onChange",getValue:i=>i.target.checked}},t);e({binders:{input:r,textarea:t,select:t}})})(n)}(function({components:n,binders:e}){if(n)for(const t in n)ec.set(t,n[t]);if(e)for(const t in e)tc.set(t,e[t])});var GE=(n,e)=>{{const t=T.useRef({num:0});T.useEffect(()=>{var r;const{current:i}=t;i.num++;const o=()=>{i.dispose&&i.num<2&&(i.dispose(),i.dispose=void 0),i.num--};if(i.dispose!==void 0)return o;{const s=(r=n())!=null?r:null;if(s&&J(s))return i.dispose=s,()=>queueMicrotask(o)}},e)}};function Qh(n){return GE(()=>{const e=n();if(!Nt(e))return e},[])}var XE=Qh,{deactivateNode:KE}=ls;function ft(n,e){var t;const r=T.useRef({});r.current.value=n;const i=e?ft(e):void 0;if(!((t=r.current)!=null&&t.obs$)){const s=i?J(n)&&n.length===1?a=>(i.get(),r.current.value(a)):()=>(i.get(),Gt(r.current.value)):n;r.current.obs$=pe(s)}var o;return i&&i.set(e),o=()=>{const s=r.current.obs$;if(s){const a=Fi(s);KE(a)}},Qh(()=>o),r.current.obs$}function Or(n,e,t,r){let i;J(e)?i=e:Array.isArray(e)?(r=e,t=void 0):t=e,i&&Array.isArray(t)&&(r=t,t=void 0),r=r||(t==null?void 0:t.deps);const o=T.useRef({}),s=r?ft(r):void 0;o.current.selector=n,o.current.reaction=i,s&&s.set(r),XE(()=>Oi(a=>{var l;return s==null||s.get(),Gt((l=o.current)==null?void 0:l.selector,void 0,a)},a=>{var l,u;return(u=(l=o.current).reaction)==null?void 0:u.call(l,a)},t))}const[ep,Dt]=wt(),[tp,xi]=wt(),[np,NO]=wt(),[rp,Pi]=wt(),[WE,JE]=wt(),[ip,ie]=wt(),[op,Bi]=wt(),[sp,ap]=wt(),[lp,qE]=wt(),[ZE,Ml]=wt();function wt(){const n=T.createContext(void 0);return[n,()=>{const e=T.useContext(n);return le(e!==void 0),e}]}const up={code:"en-US",name:"English (US)",translation:{YESTERDAY:"Yesterday",TODAY:"Today",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"just now",LOCATION:"Location",CANCEL:"Cancel",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Browser notifications",DESKTOP_NOTIFICATIONS_ERROR:"Can't enable browser notifications because your browser actively blocks them. Try looking in the settings or using a different browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notification`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"If you keep your browser tab open, you'll see this pop up when someone talks to you.",SEND_BUTTON_TEXT:"Send",ENTRYBOX_TEXT_LIMIT:"Only 10,000 characters are allowed.",ENTRYBOX_PLACEHOLDER:"Say something...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"This conversation is no longer active.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"You can read, but not send messages.",MESSAGELIST_LOADING_OLDER:"Loading older messages...",MESSAGELIST_SHOW_OLDER:"Show older messages",MESSAGELIST_NEW_MARKER:"New",MESSAGE_SENT_VIA_EMAIL:"This message was sent via email",YOU_MARKER:"you",UPLOAD_IN_PROGRESS:"Uploading...",UPLOAD_SEND_FILE:"Send file",UPLOAD_SHARE_LOCATION:"Share location",UPLOAD_ERROR:"Unfortunately, something went wrong uploading. The file might be unsupported or too large.",SHARE_LOCATION_ERROR:"Cannot share location: ",LOADING:"Loading...",HUB_EMPTY:"Your chat history will show up here",HUB_SHOW_EARLIER:"Show earlier chats",INBOX_NO_CHATS_TITLE:"No chats yet!",INBOX_NO_CHATS_BODY:"Once you've had one or more conversations, they will show up here.",ENABLE_TRANSLATION:"Translate this conversation to English",DISABLE_TRANSLATION:"Show original",SEARCH_PLACEHOLDER_TEXT:"Search...",SEARCH_SEARCHING:"Searching...",SEARCH_NO_RESULTS:"No results found",SEARCH_NO_MORE_RESULTS:"No more results",CHAT_NOT_FOUND:"Chat not found",DELETE_MESSAGE:"Delete message",DELETION_EXPLANATION:"If you delete this message, it will disappear for everybody.",EDIT_MESSAGE:"Edit message",SAVE:"Save",EDITED_INDICATOR:"edited",REPLY_TO_MESSAGE:"Reply",ADD_REACTION:"Add reaction",AUTH_EXPIRED_OVERLAY_TITLE:"Your chat session has expired",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Refresh the page to continue",VOICE_MESSAGE:"Voice message",LEAVE_CONVERSATION:"Leave conversation",MARK_CONVERSATION_AS_UNREAD:"Mark as unread",STATUS_INDICATOR_ONLINE:"Online",STATUS_INDICATOR_OFFLINE:"Offline",CONTACT_INFORMATION_HIDDEN:"hidden information",ARIA_LEAVE_SEARCH_MODE:"Leave search mode",ARIA_SEARCH_UP:"Search up",ARIA_SEARCH_DOWN:"Search down",ARIA_CLOSE_CHAT_POPUP:"Close the chat popup",ARIA_SEARCH_INSIDE_CONVERSATION:"Search inside this conversation",ARIA_SEARCH:"Search",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"set playback speed",ARIA_CANCEL_UPLOAD:"Cancel upload",ARIA_STOP_RECORDING:"Stop recording",ARIA_CANCEL_RECORDING:"Cancel recording",ARIA_INSERT_EMOJI:"Insert an emoji",ARIA_PLAY_AUDIO:"play audio",ARIA_PAUSE_AUDIO:"pause audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reactions with ${e}`,ARIA_MORE_ACTIONS:"More actions",ARIA_REPLYING_TO:(n,e)=>`Replying to ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Exit reply mode"}},nc={ar:{code:"ar",name:"Arabic",translation:{YESTERDAY:"الأمس",TODAY:"اليوم",DAYS:"يوم",HOURS:"ساعة",MINUTES:"دقيقة",JUST_NOW:"فقط الآن",LOCATION:"الموقع",CANCEL:"إلغاء",INBOX:"علبة الوارد",DESKTOP_NOTIFICATIONS:"إشعارات المتصفح",DESKTOP_NOTIFICATIONS_ERROR:"لا يمكن تمكين إشعارات المتصفح لأن متصفحك يمنعها بشكل نشط. جرّب البحث في الإعدادات أو استخدام متصفح آخر.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`إعلام ${n} التجريبي`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"إذا أبقيت علامة تبويب المتصفح مفتوحة ، فسترى هذا ينبثق عندما يتحدث شخص معك.",SEND_BUTTON_TEXT:"إرسال",ENTRYBOX_TEXT_LIMIT:"يُسمح فقط بـ 10.000 حرف.",ENTRYBOX_PLACEHOLDER:"قل شيئًا ...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"هذه المحادثة لم تعد نشطة.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"يمكنك القراءة ، لكن لا يمكنك إرسال الرسائل.",MESSAGELIST_LOADING_OLDER:"جارٍ تحميل الرسائل القديمة ...",MESSAGELIST_SHOW_OLDER:"عرض الرسائل الأقدم",MESSAGELIST_NEW_MARKER:"جديد",MESSAGE_SENT_VIA_EMAIL:"تم إرسال هذه الرسالة عبر البريد الإلكتروني",YOU_MARKER:"أنت",UPLOAD_IN_PROGRESS:"جارٍ التحميل ...",UPLOAD_SEND_FILE:"إرسال ملف",UPLOAD_SHARE_LOCATION:"مشاركة الموقع",UPLOAD_ERROR:"حدث خطأ ما في تحميل شيء. ربما يكون الملف غير متوافق أو كبير جدًا.",SHARE_LOCATION_ERROR:"لا يمكن مشاركة الموقع:",LOADING:"جارٍ التحميل ...",HUB_EMPTY:"سوف يظهر سجل الدردشات هنا",HUB_SHOW_EARLIER:"إظهار الدردشات السابقة",INBOX_NO_CHATS_TITLE:"لا توجد دردشات بعد!",INBOX_NO_CHATS_BODY:"بمجرد أن يكون لديك واحد أو أكثر من المحادثات ، سوف تظهر هنا.",ENABLE_TRANSLATION:"ترجم هذه المحادثة إلى العربية",DISABLE_TRANSLATION:"إظهار الأصلي",SEARCH_PLACEHOLDER_TEXT:"...بحث",SEARCH_SEARCHING:"...يتم الآن البحث",SEARCH_NO_RESULTS:"لم يتم العثور على نتائج",SEARCH_NO_MORE_RESULTS:"لا يوجد المزيد من النتائج",CHAT_NOT_FOUND:"لم يتم العثور على الدردشة",DELETE_MESSAGE:"احذف الرسالة",DELETION_EXPLANATION:"إذا قمت بحذف هذه الرسالة، فهي ستختفي للجميع.",EDIT_MESSAGE:"تعديل الرسالة",SAVE:"حفظ",EDITED_INDICATOR:"معدّلة",REPLY_TO_MESSAGE:"رد",ADD_REACTION:"أضف تفاعلاً",AUTH_EXPIRED_OVERLAY_TITLE:"انتهت جلسة الدردشة المخصصة لك",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"يُرجى إعادة تحميل الصفحة للمتابعة",VOICE_MESSAGE:"رسالة صوتية",LEAVE_CONVERSATION:"الخروج من المحادثة",MARK_CONVERSATION_AS_UNREAD:"وضع علامة غير مقروءة",STATUS_INDICATOR_ONLINE:"نشط",STATUS_INDICATOR_OFFLINE:"بعيد",CONTACT_INFORMATION_HIDDEN:"المعلومات المخفية",ARIA_LEAVE_SEARCH_MODE:"الخروج من وضع البحث",ARIA_SEARCH_UP:"البحث لأعلى",ARIA_SEARCH_DOWN:"البحث لأسفل",ARIA_CLOSE_CHAT_POPUP:"إغلاق نافذة الدردشة",ARIA_SEARCH_INSIDE_CONVERSATION:"البحث داخل هذه المحادثة",ARIA_SEARCH:"بحث",ARIA_CHAT:"دردشة",ARIA_SET_PLAYBACK_SPEED:"تعيين سرعة التشغيل",ARIA_CANCEL_UPLOAD:"إلغاء الرفع",ARIA_STOP_RECORDING:"إيقاف التسجيل",ARIA_CANCEL_RECORDING:"إلغاء التسجيل",ARIA_INSERT_EMOJI:"إدراج رمز تعبيري",ARIA_PLAY_AUDIO:"تشغيل الصوت",ARIA_PAUSE_AUDIO:"إيقاف الصوت مؤقتاً",ARIA_REACTION_COUNT:(n,e)=>`${n} تفاعل مع ${e}`,ARIA_MORE_ACTIONS:"المزيد من الإجراءات",ARIA_REPLYING_TO:(n,e)=>`الرد على ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"الخروج من وضع الرد"}},bg:{code:"bg-BG",name:"Bulgarian",translation:{YESTERDAY:"Вчера",TODAY:"Днес",DAYS:"Ден",HOURS:"Час",MINUTES:"m",JUST_NOW:"Току-що",LOCATION:"местоположението",CANCEL:"Откажи",INBOX:"Кутия",DESKTOP_NOTIFICATIONS:"Известия на браузъра",DESKTOP_NOTIFICATIONS_ERROR:"Не можете да активирате известията на браузъра, защото браузърът ви ги блокира активно. Опитайте да погледнете в настройките или да използвате друг браузър.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} демо известие`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ако държите раздела на браузъра си отворен, ще видите този изскачащ прозорец, когато някой говори с вас.",SEND_BUTTON_TEXT:"Изпрати",ENTRYBOX_TEXT_LIMIT:"Разрешени са само до 10.000 знака.",ENTRYBOX_PLACEHOLDER:"Кажете нещо...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Този ​​разговор вече не е активен.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Можете да четете, но не и да изпращате съобщения.",MESSAGELIST_LOADING_OLDER:"Зареждане на по-стари съобщения...",MESSAGELIST_SHOW_OLDER:"Показване на по-стари съобщения",MESSAGELIST_NEW_MARKER:"Нови",MESSAGE_SENT_VIA_EMAIL:"Това съобщение беше изпратено по имейл",YOU_MARKER:"Вие",UPLOAD_IN_PROGRESS:"Качване...",UPLOAD_SEND_FILE:"Изпращане на файл",UPLOAD_SHARE_LOCATION:"Споделяне на местоположението",UPLOAD_ERROR:"За съжаление нещо се обърка при качването. Файлът може да не се поддържа или е твърде голям.",SHARE_LOCATION_ERROR:"Не може да се сподели местоположението: ",LOADING:"Зареждане...",HUB_EMPTY:"Историята на вашите разговори ще се покаже тук",HUB_SHOW_EARLIER:"Показване на по-ранни чатове",INBOX_NO_CHATS_TITLE:"Все още нямате разговори!",INBOX_NO_CHATS_BODY:"След като проведете един или повече разговори, те ще се покажат тук.",ENABLE_TRANSLATION:"Преведете този разговор на български",DISABLE_TRANSLATION:"Показване на оригинал",SEARCH_PLACEHOLDER_TEXT:"Търсене...",SEARCH_SEARCHING:"Търсене...",SEARCH_NO_RESULTS:"Няма намерени резултати",SEARCH_NO_MORE_RESULTS:"Няма повече резултати",CHAT_NOT_FOUND:"Чатът не е намерен",DELETE_MESSAGE:"Изтриване на съобщение",DELETION_EXPLANATION:"Ако изтриете това съобщение, то ще изчезне за всички.",EDIT_MESSAGE:"Редактиране на съобщението",SAVE:"Запиши",EDITED_INDICATOR:"редактирано",REPLY_TO_MESSAGE:"Отговори",ADD_REACTION:"Добави реакция",AUTH_EXPIRED_OVERLAY_TITLE:"Вашата чат сесия е изтекла",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Обновете страницата, за да продължите",VOICE_MESSAGE:"Гласово съобщение",CONTACT_INFORMATION_HIDDEN:"Скрита информация",LEAVE_CONVERSATION:"Напускане на разговора",MARK_CONVERSATION_AS_UNREAD:"Маркирай като непрочетено",STATUS_INDICATOR_ONLINE:"Активен",STATUS_INDICATOR_OFFLINE:"Отсъстващ",ARIA_LEAVE_SEARCH_MODE:"Напусни режим на търсене",ARIA_SEARCH_UP:"Търси нагоре",ARIA_SEARCH_DOWN:"Търси надолу",ARIA_CLOSE_CHAT_POPUP:"Затвори прозореца за чат",ARIA_SEARCH_INSIDE_CONVERSATION:"Търси в този разговор",ARIA_SEARCH:"Търсене",ARIA_CHAT:"Чат",ARIA_SET_PLAYBACK_SPEED:"задай скорост на възпроизвеждане",ARIA_CANCEL_UPLOAD:"Отмени качване",ARIA_STOP_RECORDING:"Спри запис",ARIA_CANCEL_RECORDING:"Отмени запис",ARIA_INSERT_EMOJI:"Вмъкни emoji",ARIA_PLAY_AUDIO:"възпроизведи аудио",ARIA_PAUSE_AUDIO:"паузирай аудио",ARIA_REACTION_COUNT:(n,e)=>`${n} реакции с ${e}`,ARIA_MORE_ACTIONS:"Още действия",ARIA_REPLYING_TO:(n,e)=>`Отговор на ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Излизане от режим на отговор"}},bs:{code:"bs-BA",name:"Bosnian",translation:{YESTERDAY:"Jučer",TODAY:"Danas",DAYS:"d",HOURS:"s",MINUTES:"m",JUST_NOW:"Upravo sad",LOCATION:"Lokacija",CANCEL:"Otkaži",INBOX:"Pretinac",DESKTOP_NOTIFICATIONS:"Obavijesti preglednika",DESKTOP_NOTIFICATIONS_ERROR:"Notifikacije preglednika se ne mogu omogućiti jer ih vaš preglednik aktivno blokira. Pokušajte pregledati postavke ili koristiti drugi preglednik.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notifikacija`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ako karticu preglednika ostavite otvorenu, pojavit će se ovaj pop-up kada netko razgovara s vama.",SEND_BUTTON_TEXT:"Pošalji",ENTRYBOX_TEXT_LIMIT:"Dozvoljeno je samo 10.000 znakova.",ENTRYBOX_PLACEHOLDER:"Reci nešto...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ovaj razgovor više nije aktivan.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Možeš čitati, ali ne i slati poruke.",MESSAGELIST_LOADING_OLDER:"Učitavam starije poruke...",MESSAGELIST_SHOW_OLDER:"Prikaži starije poruke",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Ova poruka je poslana e-poštom",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Učitavam...",UPLOAD_SEND_FILE:"Pošalji datoteku",UPLOAD_SHARE_LOCATION:"Podijeli lokaciju",UPLOAD_ERROR:"Nažalost, nešto je pošlo krivo. Datoteka možda nije podržana ili je prevelika.",SHARE_LOCATION_ERROR:"Nije moguće podijeliti lokaciju: ",LOADING:"Učitavam...",HUB_EMPTY:"Ovdje će se prikazati vaša povijest razgovora",HUB_SHOW_EARLIER:"Prikaži ranije razgovore",INBOX_NO_CHATS_TITLE:"Nema razgovora!",INBOX_NO_CHATS_BODY:"Nakon što vodite jedan ili više razgovora, oni će se pojaviti ovdje.",ENABLE_TRANSLATION:"Prevedi ovaj razgovor na bosanski jezik",DISABLE_TRANSLATION:"Prikaži original",SEARCH_PLACEHOLDER_TEXT:"Pretraži...",SEARCH_SEARCHING:"Pretraživanje...",SEARCH_NO_RESULTS:"Nema rezultata",SEARCH_NO_MORE_RESULTS:"Nema više rezultata",CHAT_NOT_FOUND:"Ćaskanje nije pronađeno",DELETE_MESSAGE:"Obriši poruku",DELETION_EXPLANATION:"Ako izbrišete ovu poruku, ona će nestati za sve.",EDIT_MESSAGE:"Uredi poruku",SAVE:"Sačuvati",EDITED_INDICATOR:"uređeno",REPLY_TO_MESSAGE:"Odgovorite",ADD_REACTION:"Dodajte reakciju",AUTH_EXPIRED_OVERLAY_TITLE:"Vaša chat sesija je istekla",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Osvježite stranicu da nastavite",VOICE_MESSAGE:"Glasovna poruka",CONTACT_INFORMATION_HIDDEN:"Skrivene informacije",LEAVE_CONVERSATION:"Napusti razgovor",MARK_CONVERSATION_AS_UNREAD:"Označi kao nepročitano",STATUS_INDICATOR_ONLINE:"Aktivan",STATUS_INDICATOR_OFFLINE:"Odsutan",ARIA_LEAVE_SEARCH_MODE:"Napusti način pretrage",ARIA_SEARCH_UP:"Traži gore",ARIA_SEARCH_DOWN:"Traži dolje",ARIA_CLOSE_CHAT_POPUP:"Zatvori prozor chata",ARIA_SEARCH_INSIDE_CONVERSATION:"Traži u ovom razgovoru",ARIA_SEARCH:"Traži",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"postavi brzinu reprodukcije",ARIA_CANCEL_UPLOAD:"Otkaži učitavanje",ARIA_STOP_RECORDING:"Zaustavi snimanje",ARIA_CANCEL_RECORDING:"Otkaži snimanje",ARIA_INSERT_EMOJI:"Umetni emoji",ARIA_PLAY_AUDIO:"reproduciraj audio",ARIA_PAUSE_AUDIO:"pauziraj audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reakcija s ${e}`,ARIA_MORE_ACTIONS:"Više radnji",ARIA_REPLYING_TO:(n,e)=>`Odgovaranje korisniku ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Izađi iz moda odgovaranja"}},ca:{code:"ca-ES",name:"Catalan (ES)",translation:{YESTERDAY:"Ahir",TODAY:"Avui",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"ara mateix",LOCATION:"Ubicació",CANCEL:"Cancel·lar",INBOX:"Safata d'entrada",DESKTOP_NOTIFICATIONS:"Notificacions d'escriptori",DESKTOP_NOTIFICATIONS_ERROR:"No es poden habilitar les notificacions del navegador perquè el teu navegador les bloqueja activament. Prova de buscar a la configuració o utilitza un altre navegador.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`Notificació de demostració de ${n}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Si mantens la pestanya del navegador oberta, veuràs aquesta notificació quan algú et parli.",SEND_BUTTON_TEXT:"Enviar",ENTRYBOX_TEXT_LIMIT:"Només es permeten 10.000 caràcters.",ENTRYBOX_PLACEHOLDER:"Digues alguna cosa...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Aquesta conversa ja no està activa.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Pots llegir, però no enviar missatges.",MESSAGELIST_LOADING_OLDER:"Carregant missatges antics...",MESSAGELIST_SHOW_OLDER:"Mostrar missatges més antics",MESSAGELIST_NEW_MARKER:"Nou",MESSAGE_SENT_VIA_EMAIL:"Aquest missatge s'ha enviat per correu electrònic",YOU_MARKER:"tu",UPLOAD_IN_PROGRESS:"S'està pujant...",UPLOAD_SEND_FILE:"Enviar arxiu",UPLOAD_SHARE_LOCATION:"Compartir ubicació",UPLOAD_ERROR:"Desafortunadament, alguna cosa ha anat malament en pujar. L'arxiu pot ser no compatible o massa gran.",SHARE_LOCATION_ERROR:"No es pot compartir la ubicació: ",LOADING:"Carregant...",HUB_EMPTY:"El teu historial de xat apareixerà aquí",HUB_SHOW_EARLIER:"Mostra xats anteriors",INBOX_NO_CHATS_TITLE:"Encara no hi ha xats!",INBOX_NO_CHATS_BODY:"Un cop hagis tingut una o més converses, apareixeran aquí.",ENABLE_TRANSLATION:"Traduir aquesta conversa al català",DISABLE_TRANSLATION:"Mostrar original",SEARCH_PLACEHOLDER_TEXT:"Cerca...",SEARCH_SEARCHING:"Buscant...",SEARCH_NO_RESULTS:"No s'han trobat resultats",SEARCH_NO_MORE_RESULTS:"No hi ha més resultats",CHAT_NOT_FOUND:"Xat no trobat",DELETE_MESSAGE:"Esborrar missatge",DELETION_EXPLANATION:"Si esborres aquest missatge, desapareixerà per a tothom.",EDIT_MESSAGE:"Editar missatge",SAVE:"Desar",EDITED_INDICATOR:"editat",REPLY_TO_MESSAGE:"Respondre",ADD_REACTION:"Afegir reacció",VOICE_MESSAGE:"Missatge de veu",LEAVE_CONVERSATION:"Abandonar la conversa",MARK_CONVERSATION_AS_UNREAD:"marcar com no llegit",STATUS_INDICATOR_ONLINE:"Actiu",STATUS_INDICATOR_OFFLINE:"Absent",CONTACT_INFORMATION_HIDDEN:"informació oculta",AUTH_EXPIRED_OVERLAY_TITLE:"La teva sessió de xat ha caducat",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Actualitza la pàgina per continuar",ARIA_LEAVE_SEARCH_MODE:"Sortir del mode de cerca",ARIA_SEARCH_UP:"Cercar cap amunt",ARIA_SEARCH_DOWN:"Cercar cap avall",ARIA_CLOSE_CHAT_POPUP:"Tancar la finestra de xat",ARIA_SEARCH_INSIDE_CONVERSATION:"Cercar en aquesta conversa",ARIA_SEARCH:"Cercar",ARIA_CHAT:"Xat",ARIA_SET_PLAYBACK_SPEED:"establir velocitat de reproducció",ARIA_CANCEL_UPLOAD:"Cancel·lar la càrrega",ARIA_STOP_RECORDING:"Aturar l'enregistrament",ARIA_CANCEL_RECORDING:"Cancel·lar l'enregistrament",ARIA_INSERT_EMOJI:"Inserir un emoji",ARIA_PLAY_AUDIO:"reproduir àudio",ARIA_PAUSE_AUDIO:"pausar àudio",ARIA_REACTION_COUNT:(n,e)=>`${n} reaccions amb ${e}`,ARIA_MORE_ACTIONS:"Més accions",ARIA_REPLYING_TO:(n,e)=>`Responent a ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Sortir del mode de resposta"}},cs:{code:"cs-CZ",name:"Czech",translation:{YESTERDAY:"Včera",TODAY:"Dnes",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"právě teď",LOCATION:"Lokace",CANCEL:"Zrušit",INBOX:"Doručené",DESKTOP_NOTIFICATIONS:"Oznámení v prohlížeči",DESKTOP_NOTIFICATIONS_ERROR:"Nelze povolit notifikace prohlížeče, protože váš prohlížeč je aktivně blokuje. Zkuste se podívat na nastavení nebo zkuste použít jiný prohlížeč.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notifikace`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Pokud necháte kartu prohlížeče otevřenou, uvidíte tento popup jakmile s vámi bude někdo mluvit.",SEND_BUTTON_TEXT:"Odeslat",ENTRYBOX_TEXT_LIMIT:"Je povoleno Maximálně 10.000 znaků.",ENTRYBOX_PLACEHOLDER:"Napište něco...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Tato konverzace již není aktivní.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Můžete číst, ale nemůžete posílat zprávy.",MESSAGELIST_LOADING_OLDER:"Nahrávám starší zprávy...",MESSAGELIST_SHOW_OLDER:"Zobrazit starší zprávy",MESSAGELIST_NEW_MARKER:"Nové",MESSAGE_SENT_VIA_EMAIL:"Tato zpráva byla odeslána přes mail.",YOU_MARKER:"vy",UPLOAD_IN_PROGRESS:"Nahrávám...",UPLOAD_SEND_FILE:"Poslat soubor",UPLOAD_SHARE_LOCATION:"Sdílet pozici",UPLOAD_ERROR:"Nepodařilo se nahrát soubor. Ten je buď nepodporován a/nebo příliš velký.",SHARE_LOCATION_ERROR:"Není možné sdílet pozici: ",LOADING:"Nahrávám...",HUB_EMPTY:"Vaše historie se zde zobrazí",HUB_SHOW_EARLIER:"Zobrazit dřívější konverzace",INBOX_NO_CHATS_TITLE:"Zatím zde nejsou žádné konverzace!",INBOX_NO_CHATS_BODY:"Jakmile budete mít jednu nebo více konverzací, objeví se zde.",ENABLE_TRANSLATION:"Přeložit tuto konverzaci do češtiny",DISABLE_TRANSLATION:"Zobrazit původní",SEARCH_PLACEHOLDER_TEXT:"Hledat...",SEARCH_SEARCHING:"Hledání...",SEARCH_NO_RESULTS:"Nenašly se žádné výsledky",SEARCH_NO_MORE_RESULTS:"Žádné další výsledky",CHAT_NOT_FOUND:"Chat nenalezen",DELETE_MESSAGE:"Smazat zprávu",DELETION_EXPLANATION:"Pokud tuto zprávu smažete, zmizí pro všechny.",EDIT_MESSAGE:"Upravit zprávu",SAVE:"Uložit",EDITED_INDICATOR:"upraveno",REPLY_TO_MESSAGE:"Odpovědět",ADD_REACTION:"Reagovat",AUTH_EXPIRED_OVERLAY_TITLE:"Váš chat byl kvůli nečinnosti odpojen",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Pro pokračování obnovte stránku",VOICE_MESSAGE:"Hlasová zpráva",CONTACT_INFORMATION_HIDDEN:"Skrytá informace",LEAVE_CONVERSATION:"Opustit konverzaci",MARK_CONVERSATION_AS_UNREAD:"Označit jako nepřečtené",STATUS_INDICATOR_ONLINE:"Aktivní",STATUS_INDICATOR_OFFLINE:"Nedostupný",ARIA_LEAVE_SEARCH_MODE:"Opustit režim vyhledávání",ARIA_SEARCH_UP:"Hledat nahoru",ARIA_SEARCH_DOWN:"Hledat dolů",ARIA_CLOSE_CHAT_POPUP:"Zavřít okno chatu",ARIA_SEARCH_INSIDE_CONVERSATION:"Hledat v této konverzaci",ARIA_SEARCH:"Hledat",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"nastavit rychlost přehrávání",ARIA_CANCEL_UPLOAD:"Zrušit nahrávání",ARIA_STOP_RECORDING:"Zastavit nahrávání",ARIA_CANCEL_RECORDING:"Zrušit nahrávání",ARIA_INSERT_EMOJI:"Vložit emoji",ARIA_PLAY_AUDIO:"přehrát audio",ARIA_PAUSE_AUDIO:"pozastavit audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reakcí s ${e}`,ARIA_MORE_ACTIONS:"Další akce",ARIA_REPLYING_TO:(n,e)=>`Odpověď na ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Opustit režim odpovědi"}},da:{code:"da-DK",name:"Danish",translation:{YESTERDAY:"I går",TODAY:"I dag",DAYS:"d",HOURS:"t",MINUTES:"m",JUST_NOW:"lige nu",LOCATION:"Placering",CANCEL:"Annuller",INBOX:"Indbakke",DESKTOP_NOTIFICATIONS:"Browsermeddelelser",DESKTOP_NOTIFICATIONS_ERROR:"Kan ikke aktivere Browsermeddelelser, fordi din browser aktivt blokerer dem. Prøv at kigge i indstillingerne eller benyt en anden browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demomeddelelse`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Hvis du holder dit browser-faneblad åben, vil du se det her komme op, når nogen taler til dig.",SEND_BUTTON_TEXT:"Send",ENTRYBOX_TEXT_LIMIT:"Kun 10.000 tegn er tilladt.",ENTRYBOX_PLACEHOLDER:"Sig noget...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Denne samtale er ikke længere aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Du kan læse, men ikke sende beskeder.",MESSAGELIST_LOADING_OLDER:"Indlæser ældre beskeder...",MESSAGELIST_SHOW_OLDER:"Vis ældre beskeder",MESSAGELIST_NEW_MARKER:"Ny",MESSAGE_SENT_VIA_EMAIL:"Denne besked blev sendt via e-mail",YOU_MARKER:"dig",UPLOAD_IN_PROGRESS:"Overfører...",UPLOAD_SEND_FILE:"Send fil",UPLOAD_SHARE_LOCATION:"Del placering",UPLOAD_ERROR:"Der er sket noget forkert ved upload. Filen kan ikke understøttes eller filen er for stor.",SHARE_LOCATION_ERROR:"Kan ikke dele placering: ",LOADING:"Indlæser...",HUB_EMPTY:"Dine samtaler vises her",HUB_SHOW_EARLIER:"Vis tidligere chats",INBOX_NO_CHATS_TITLE:"Ingen chats endnu!",INBOX_NO_CHATS_BODY:"Når du har haft en eller flere samtaler, vises de her.",ENABLE_TRANSLATION:"Oversæt denne konversation til dansk",DISABLE_TRANSLATION:"Vis den oprindelige",SEARCH_PLACEHOLDER_TEXT:"Søg...",SEARCH_SEARCHING:"Søger...",SEARCH_NO_RESULTS:"Ingen resultater fundet",SEARCH_NO_MORE_RESULTS:"Ikke flere resultater",CHAT_NOT_FOUND:"Chat ikke fundet",DELETE_MESSAGE:"Slet besked",DELETION_EXPLANATION:"Hvis du sletter denne besked, vil ingen kunne se den.",EDIT_MESSAGE:"Rediger besked",SAVE:"Gem",EDITED_INDICATOR:"redigeret",REPLY_TO_MESSAGE:"Svar",ADD_REACTION:"Tilføj reaktion",AUTH_EXPIRED_OVERLAY_TITLE:"Din chatsession er udløbet",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Opdater siden for at fortsætte",VOICE_MESSAGE:"Talebesked",CONTACT_INFORMATION_HIDDEN:"Skjulte oplysninger",LEAVE_CONVERSATION:"Forlad samtale",MARK_CONVERSATION_AS_UNREAD:"Marker som ulæst",STATUS_INDICATOR_ONLINE:"Online",STATUS_INDICATOR_OFFLINE:"Offline",ARIA_LEAVE_SEARCH_MODE:"Forlad søgemodus",ARIA_SEARCH_UP:"Søg opad",ARIA_SEARCH_DOWN:"Søg nedad",ARIA_CLOSE_CHAT_POPUP:"Luk chatvindue",ARIA_SEARCH_INSIDE_CONVERSATION:"Søg i denne samtale",ARIA_SEARCH:"Søg",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"Indstil afspilningshastighed",ARIA_CANCEL_UPLOAD:"Annuller upload",ARIA_STOP_RECORDING:"Stop optagelse",ARIA_CANCEL_RECORDING:"Annuller optagelse",ARIA_INSERT_EMOJI:"Indsæt en emoji",ARIA_PLAY_AUDIO:"Afspil lyd",ARIA_PAUSE_AUDIO:"Pauser lyd",ARIA_REACTION_COUNT:(n,e)=>`${n} Reaktioner med ${e}`,ARIA_MORE_ACTIONS:"Flere handlinger",ARIA_REPLYING_TO:(n,e)=>`Svarer til ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Forlad svarstilstand"}},de:{code:"de-DE",name:"German",translation:{YESTERDAY:"Gestern",TODAY:"Heute",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"gerade jetzt",LOCATION:"Standort",CANCEL:"Abbrechen",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Browser-Benachrichtigungen",DESKTOP_NOTIFICATIONS_ERROR:"Browser-Benachrichtigungen können nicht aktiviert werden, da Ihr Browser sie aktiv blockiert. Versuchen Sie, in den Einstellungen nachzuschlagen oder einen anderen Browser zu verwenden.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} Demo-Benachrichtigung`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Wenn Sie Ihre Browser-Registerkarte geöffnet lassen, wird dies angezeigt, wenn jemand mit Ihnen spricht.",SEND_BUTTON_TEXT:"Senden",ENTRYBOX_TEXT_LIMIT:"Nur 10.000 Zeichen sind erlaubt.",ENTRYBOX_PLACEHOLDER:"Sag etwas...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Diese Konversation ist nicht mehr aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Sie können Nachrichten lesen, aber nicht senden.",MESSAGELIST_LOADING_OLDER:"Ältere Nachrichten werden geladen...",MESSAGELIST_SHOW_OLDER:"Zeige ältere Nachrichten",MESSAGELIST_NEW_MARKER:"Neu",MESSAGE_SENT_VIA_EMAIL:"Diese Nachricht wurde per E-Mail gesendet",YOU_MARKER:"du",UPLOAD_IN_PROGRESS:"Hochladen...",UPLOAD_SEND_FILE:"Datei senden",UPLOAD_SHARE_LOCATION:"Standort teilen",UPLOAD_ERROR:"Beim Hochladen ist ein Fehler aufgetreten. Die Datei ist möglicherweise nicht unterstützt oder zu groß.",SHARE_LOCATION_ERROR:"Standort kann nicht freigegeben werden: ",LOADING:"Laden...",HUB_EMPTY:"Ihr Chat-Verlauf wird hier angezeigt",HUB_SHOW_EARLIER:"Zeige frühere Chats",INBOX_NO_CHATS_TITLE:"Noch keine Chats!",INBOX_NO_CHATS_BODY:"Sobald Sie eine oder mehrere Unterhaltungen geführt haben, werden sie hier angezeigt.",ENABLE_TRANSLATION:"Dieses Gespräch auf Deutsch übersetzen",DISABLE_TRANSLATION:"Originaltext anzeigen",SEARCH_PLACEHOLDER_TEXT:"Suche...",SEARCH_SEARCHING:"Suchen...",SEARCH_NO_RESULTS:"Keine Suchergebnisse gefunden",SEARCH_NO_MORE_RESULTS:"Keine weiteren Suchergebnisse",CHAT_NOT_FOUND:"Chat nicht gefunden",DELETE_MESSAGE:"Nachricht löschen",DELETION_EXPLANATION:"Wenn Sie diese Nachricht löschen, wird sie für alle verschwinden.",EDIT_MESSAGE:"Nachricht bearbeiten",SAVE:"Speichern",EDITED_INDICATOR:"bearbeitet",REPLY_TO_MESSAGE:"Antworten",ADD_REACTION:"Reaktion hinzufügen",AUTH_EXPIRED_OVERLAY_TITLE:"Ihre Chatsitzung ist abgelaufen",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Laden Sie zum Fortfahren die Seite neu",VOICE_MESSAGE:"Sprachnachricht",CONTACT_INFORMATION_HIDDEN:"Geschützte Angaben",LEAVE_CONVERSATION:"Unterhaltung verlassen",MARK_CONVERSATION_AS_UNREAD:"als ungelesen markieren",STATUS_INDICATOR_ONLINE:"Aktiv",STATUS_INDICATOR_OFFLINE:"Abwesend",ARIA_LEAVE_SEARCH_MODE:"Suchmodus verlassen",ARIA_SEARCH_UP:"Nach oben suchen",ARIA_SEARCH_DOWN:"Nach unten suchen",ARIA_CLOSE_CHAT_POPUP:"Chat-Popup schließen",ARIA_SEARCH_INSIDE_CONVERSATION:"In dieser Unterhaltung suchen",ARIA_SEARCH:"Suchen",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"Wiedergabegeschwindigkeit einstellen",ARIA_CANCEL_UPLOAD:"Upload abbrechen",ARIA_STOP_RECORDING:"Aufnahme stoppen",ARIA_CANCEL_RECORDING:"Aufnahme abbrechen",ARIA_INSERT_EMOJI:"Emoji einfügen",ARIA_PLAY_AUDIO:"Audio abspielen",ARIA_PAUSE_AUDIO:"Audio pausieren",ARIA_REACTION_COUNT:(n,e)=>`${n} Reaktionen mit ${e}`,ARIA_MORE_ACTIONS:"Weitere Aktionen",ARIA_REPLYING_TO:(n,e)=>`Antworten an ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Antwortmodus verlassen"}},el:{code:"el-GR",name:"Greek (Greece)",translation:{YESTERDAY:"Χθές",TODAY:"Σήμερα",DAYS:"Ημέρες",HOURS:"'Ωρες",MINUTES:"Λεπτά",JUST_NOW:"Μόλις τώρα",LOCATION:"Τοποθεσία",CANCEL:"Ακύρωση",INBOX:"Εισερχόμενα",DESKTOP_NOTIFICATIONS:"Ειδοποιήσεις περιηγητή",DESKTOP_NOTIFICATIONS_ERROR:"Δεν είναι δυνατή η ενεργοποίηση των ειδοποιήσεων του προγράμματος περιήγησης, επειδή το πρόγραμμα περιήγησης τις αποκλείει ενεργά. Δοκιμάστε να τσεκάρετε τις ρυθμίσεις ή να χρησιμοποιήσετε διαφορετικό πρόγραμμα περιήγησης.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} Δοκιμαστική επίδειξη`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Αν διατηρήσετε ανοιχτή τη σελίδα του προγράμματος περιήγησης, θα δείτε αυτό το pop up (παράθυρο) όταν κάποιος σας μιλάει.",SEND_BUTTON_TEXT:"Αποστολή",ENTRYBOX_TEXT_LIMIT:"Επιτρέπονται μόνο 10.000 χαρακτήρες.",ENTRYBOX_PLACEHOLDER:"Πείτε κάτι...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Αυτή η συζήτηση δεν είναι πλέον ενεργή.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Μπορείτε να διαβάσετε αλλά δεν μπορείτε να στείλετε μηνύματα.",MESSAGELIST_LOADING_OLDER:"Φόρτωση παλαιοτέρων μηνυμάτων...",MESSAGELIST_SHOW_OLDER:"Εμφάνιση παλαιότερων μηνυμάτων",MESSAGELIST_NEW_MARKER:"Νέο",MESSAGE_SENT_VIA_EMAIL:"Αυτό το μήνυμα εστάλη μέσω ηλεκτρονικού ταχυδρομείου",YOU_MARKER:"Εσείς",UPLOAD_IN_PROGRESS:"Ανέβασμα...",UPLOAD_SEND_FILE:"Αποστολή αρχείου",UPLOAD_SHARE_LOCATION:"Κοινή χρήση τοποθεσίας",UPLOAD_ERROR:"Κάτι πήγε στραβά κατά τη φόρτωση. Το αρχείο ενδέχεται να μην υποστηρίζεται ή να είναι υπερβολικά μεγάλο.",SHARE_LOCATION_ERROR:"Δεν είναι δυνατή η χρήση κοινής τοποθεσίας: ",LOADING:"Φόρτωση...",HUB_EMPTY:"Το ιστορικό των συνομιλιών σας θα εμφανιστεί εδώ",HUB_SHOW_EARLIER:"Εμφάνιση προηγούμενων συνομιλιών",INBOX_NO_CHATS_TITLE:"Δεν υπάρχουν ακόμα συζητήσεις!",INBOX_NO_CHATS_BODY:"Μόλις έχετε μία ή περισσότερες συνομιλίες, θα εμφανιστούν εδώ.",ENABLE_TRANSLATION:"Μετάφραση αυτής της συνομιλίας στα ελληνικά",DISABLE_TRANSLATION:"Προβολή πρωτοτύπου",SEARCH_PLACEHOLDER_TEXT:"Αναζήτηση...",SEARCH_SEARCHING:"Αναζήτηση...",SEARCH_NO_RESULTS:"Δεν βρέθηκαν αποτελέσματα",SEARCH_NO_MORE_RESULTS:"Δεν υπάρχουν περισσότερα αποτελέσματα",CHAT_NOT_FOUND:"Η συνομιλία δεν βρέθηκε",DELETE_MESSAGE:"Διαγραφή μηνύματος",DELETION_EXPLANATION:"Εάν διαγράψετε αυτό το μήνυμα, θα εξαφανιστεί για όλους.",EDIT_MESSAGE:"Επεξεργασία μηνύματος",SAVE:"Αποθήκευση",EDITED_INDICATOR:"επεξεργασμένο",REPLY_TO_MESSAGE:"Απάντηση",ADD_REACTION:"Προσθήκη αντίδρασης",AUTH_EXPIRED_OVERLAY_TITLE:"Η συνεδρία της συνομιλίας σας έχει λήξει",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Ανανεώστε τη σελίδα για να συνεχίσετε",VOICE_MESSAGE:"Ηχητικό μήνυμα",CONTACT_INFORMATION_HIDDEN:"Κρυμμένες πληροφορίες",LEAVE_CONVERSATION:"Αποσυρθείτε από τη συζήτηση",MARK_CONVERSATION_AS_UNREAD:"Επισήμανση ως μη αναγνωσμένα",STATUS_INDICATOR_ONLINE:"Ενεργός",STATUS_INDICATOR_OFFLINE:"Ανενεργός",ARIA_LEAVE_SEARCH_MODE:"Αποχώρηση από τη λειτουργία αναζήτησης",ARIA_SEARCH_UP:"Αναζήτηση προς τα πάνω",ARIA_SEARCH_DOWN:"Αναζήτηση προς τα κάτω",ARIA_CLOSE_CHAT_POPUP:"Κλείσιμο παραθύρου συνομιλίας",ARIA_SEARCH_INSIDE_CONVERSATION:"Αναζήτηση σε αυτή τη συνομιλία",ARIA_SEARCH:"Αναζήτηση",ARIA_CHAT:"Συνομιλία",ARIA_SET_PLAYBACK_SPEED:"ορισμός ταχύτητας αναπαραγωγής",ARIA_CANCEL_UPLOAD:"Ακύρωση φόρτωσης",ARIA_STOP_RECORDING:"Διακοπή εγγραφής",ARIA_CANCEL_RECORDING:"Ακύρωση εγγραφής",ARIA_INSERT_EMOJI:"Εισαγωγή emoji",ARIA_PLAY_AUDIO:"αναπαραγωγή ήχου",ARIA_PAUSE_AUDIO:"παύση ήχου",ARIA_REACTION_COUNT:(n,e)=>`${n} αντιδράσεις με ${e}`,ARIA_MORE_ACTIONS:"Περισσότερες ενέργειες",ARIA_REPLYING_TO:(n,e)=>`Απάντηση στον ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Έξοδος από τη λειτουργία απάντησης"}},en:up,es:{code:"es-ES",name:"Spanish",translation:{YESTERDAY:"Ayer",TODAY:"Hoy",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"justo ahora",LOCATION:"Ubicación",CANCEL:"Cancelar",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Notificaciones del navigator",DESKTOP_NOTIFICATIONS_ERROR:"No se logró habilitar las notificaciones del navigador, comprueba que tu navegador no las esté bloqueando o intenta con otro navegador.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} notificación de prueba`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Si dejas esta pestaña abierta, verás este pop up cuando alguien te hable.",SEND_BUTTON_TEXT:"Enviar",ENTRYBOX_TEXT_LIMIT:"Sólo 10.000 caracteres permitidos.",ENTRYBOX_PLACEHOLDER:"Escribe algo...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Esta conversación ya no está activa.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Puedes leer pero no enviar mensajes.",MESSAGELIST_LOADING_OLDER:"Cargando mensajes pasados...",MESSAGELIST_SHOW_OLDER:"Ver mensajes pasados",MESSAGELIST_NEW_MARKER:"Nuevo",MESSAGE_SENT_VIA_EMAIL:"Este mensaje ha sido enviado vía email",YOU_MARKER:"tú",UPLOAD_IN_PROGRESS:"Subir...",UPLOAD_SEND_FILE:"Enviar archivo",UPLOAD_SHARE_LOCATION:"Compartir ubicación",UPLOAD_ERROR:"Ocurrió un problema subiendo el archivo. Puede que el archivo esté en un formato no soportado o que sea demasiado grande.",SHARE_LOCATION_ERROR:"No se logró compartir la ubicación: ",LOADING:"Cargando...",HUB_EMPTY:"Tu historial de conversaciones se mostrará aquí",HUB_SHOW_EARLIER:"Ver conversaciones pasadas",INBOX_NO_CHATS_TITLE:"¡Aún sin conversaciones!",INBOX_NO_CHATS_BODY:"Una vez que tengas una o más conversaciones, se mostrarán aquí.",ENABLE_TRANSLATION:"Traducir esta conversación al español",DISABLE_TRANSLATION:"Mostrar la conversación original",SEARCH_PLACEHOLDER_TEXT:"Buscar...",SEARCH_SEARCHING:"Buscando...",SEARCH_NO_RESULTS:"No se encontraron resultados",SEARCH_NO_MORE_RESULTS:"No hay más resultados",CHAT_NOT_FOUND:"Chat no encontrado",DELETE_MESSAGE:"Eliminar mensaje",DELETION_EXPLANATION:"Este mensaje desaparecerá para todos si lo borras.",EDIT_MESSAGE:"Editar mensaje",SAVE:"Guardar",EDITED_INDICATOR:"editado",REPLY_TO_MESSAGE:"Responder",ADD_REACTION:"Añadir reacción",AUTH_EXPIRED_OVERLAY_TITLE:"Su sesión de chat ha expirado",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Actualice la página para continuar",VOICE_MESSAGE:"Mensaje de voz",CONTACT_INFORMATION_HIDDEN:"Información oculta",LEAVE_CONVERSATION:"Abandonar conversación",MARK_CONVERSATION_AS_UNREAD:"Marcar como no leída",STATUS_INDICATOR_ONLINE:"Activo",STATUS_INDICATOR_OFFLINE:"Ausente",ARIA_LEAVE_SEARCH_MODE:"Salir del modo búsqueda",ARIA_SEARCH_UP:"Buscar hacia arriba",ARIA_SEARCH_DOWN:"Buscar hacia abajo",ARIA_CLOSE_CHAT_POPUP:"Cerrar la ventana de chat",ARIA_SEARCH_INSIDE_CONVERSATION:"Buscar en esta conversación",ARIA_SEARCH:"Buscar",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"establecer velocidad de reproducción",ARIA_CANCEL_UPLOAD:"Cancelar envío",ARIA_STOP_RECORDING:"Detener grabación",ARIA_CANCEL_RECORDING:"Cancelar grabación",ARIA_INSERT_EMOJI:"Insertar un emoji",ARIA_PLAY_AUDIO:"reproducir audio",ARIA_PAUSE_AUDIO:"pausar audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reacciones con ${e}`,ARIA_MORE_ACTIONS:"Más acciones",ARIA_REPLYING_TO:(n,e)=>`Respondiendo a ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Salir del modo respuesta"}},et:{code:"et-EE",name:"Estonian",translation:{YESTERDAY:"Eile",TODAY:"Täna",DAYS:"p",HOURS:"t",MINUTES:"m",JUST_NOW:"Just nüüd",LOCATION:"Asukoht",CANCEL:"Katkesta",INBOX:"Postkast",DESKTOP_NOTIFICATIONS:"Veebibrauseri teated",DESKTOP_NOTIFICATIONS_ERROR:"Töölaua teatisi ei saa lubada, kuna Teie brauser blokeerib need aktiivselt. Proovige muuta seadeid või kasutada mõnda muud brauserit.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo teavitus`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Kui hoiate oma brauseri vahekaardi lahti ja näete seda hüpikakent, siis keegi soovib Teiega rääkida.",SEND_BUTTON_TEXT:"Saada",ENTRYBOX_TEXT_LIMIT:"Ainult kuni 10.000 tähemärki on lubatud.",ENTRYBOX_PLACEHOLDER:"Kirjuta midagi...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"See vestlus ei ole enam aktiivne.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Sa saad lugeda teateid, aga mitte kirjutada.",MESSAGELIST_LOADING_OLDER:"Laen vanemaid teateid...",MESSAGELIST_SHOW_OLDER:"Näita vanemaid teateid",MESSAGELIST_NEW_MARKER:"Uus",MESSAGE_SENT_VIA_EMAIL:"See teade on saadetud e-postiga",YOU_MARKER:"Sina",UPLOAD_IN_PROGRESS:"Laen...",UPLOAD_SEND_FILE:"Saada fail",UPLOAD_SHARE_LOCATION:"Jaga faili asukohta",UPLOAD_ERROR:"Nüüd läks midagi nihu, seoses faili ülesse laadimisega. Tundmatu fail või liiga suur.",SHARE_LOCATION_ERROR:"Ei suuda jagada faili asukohta: ",LOADING:"Laen...",HUB_EMPTY:"Siin on Sinu vestluste ajalugu",HUB_SHOW_EARLIER:"Näita vanemaid vestlusi",INBOX_NO_CHATS_TITLE:"Pole ühtegi vestlust!",INBOX_NO_CHATS_BODY:"Kui Sul tekib üks või rohkem vestlust, siis on need kuvatakse siin.",ENABLE_TRANSLATION:"Tõlgi see vestlus eesti keelde",DISABLE_TRANSLATION:"Näita algteksti",SEARCH_PLACEHOLDER_TEXT:"Otsi...",SEARCH_SEARCHING:"Otsin...",SEARCH_NO_RESULTS:"Otsingu tulemused puuduvad",SEARCH_NO_MORE_RESULTS:"Rohkem tulemusi ei ole ",CHAT_NOT_FOUND:"Vestlust ei leitud",DELETE_MESSAGE:"Kustuta sõnum",DELETION_EXPLANATION:"Kui kustutate selle sõnumi, kaob see kõigi jaoks.",EDIT_MESSAGE:"Redigeeri sõnumit",SAVE:"Salvesta",EDITED_INDICATOR:"muudetud",REPLY_TO_MESSAGE:"Vasta",ADD_REACTION:"Lisa reaktsioon",AUTH_EXPIRED_OVERLAY_TITLE:"Teie vestlussessioon on lõppenud",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Jätkamiseks värskendage lehte",VOICE_MESSAGE:"Häälsõnum",CONTACT_INFORMATION_HIDDEN:"Varjatud informatsioon",LEAVE_CONVERSATION:"Lahku vestlusest",MARK_CONVERSATION_AS_UNREAD:"Märgi mitteloetuks",STATUS_INDICATOR_ONLINE:"Aktiivne",STATUS_INDICATOR_OFFLINE:"Eemal",ARIA_LEAVE_SEARCH_MODE:"Välju otsingurežiimist",ARIA_SEARCH_UP:"Otsi üles",ARIA_SEARCH_DOWN:"Otsi alla",ARIA_CLOSE_CHAT_POPUP:"Sulge vestluse aken",ARIA_SEARCH_INSIDE_CONVERSATION:"Otsi sellest vestlusest",ARIA_SEARCH:"Otsi",ARIA_CHAT:"Vestlus",ARIA_SET_PLAYBACK_SPEED:"määra taasesituse kiirus",ARIA_CANCEL_UPLOAD:"Tühista üleslaadimine",ARIA_STOP_RECORDING:"Peata salvestamine",ARIA_CANCEL_RECORDING:"Tühista salvestamine",ARIA_INSERT_EMOJI:"Sisesta emoji",ARIA_PLAY_AUDIO:"esita heli",ARIA_PAUSE_AUDIO:"pausi heli",ARIA_REACTION_COUNT:(n,e)=>`${n} reaktsiooni (${e})`,ARIA_MORE_ACTIONS:"Rohkem toiminguid",ARIA_REPLYING_TO:(n,e)=>`Vastamine kasutajale ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Välju vastamisrežiimist"}},fa:{code:"fa",name:"Persian (Farsi)",translation:{YESTERDAY:"دیروز",TODAY:"امروز",DAYS:"روز",HOURS:"ساعت",MINUTES:"دقیقه",JUST_NOW:"هم اکنون",LOCATION:"مکان",CANCEL:"لغو",INBOX:"صندوق",DESKTOP_NOTIFICATIONS:"اطلاعیه‌های مرورگر",DESKTOP_NOTIFICATIONS_ERROR:"خطا در فعال سازی اعلان های مرورگر، مرورگر شما آنها را مسدود می کند سعی کنید تنظیمات مرورگر را تغییر دهید یا از یک مرورگر دیگر استفاده کنید.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`نوتیفیکیشن دمو ${n}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"اگر صفحه ی مرورگر را باز نگهدارید این را موقعه ای که کسی با شما صحبت کند خواهید دید",SEND_BUTTON_TEXT:"بفرست",ENTRYBOX_TEXT_LIMIT:"فقط ۱۰،۰۰۰ حروف مجاز می باشد.",ENTRYBOX_PLACEHOLDER:"...چیزی بنویسید",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:".این مکالمه دیگر فعال نمی باشد",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"شما می توانید بخوانید اما نمی توانید پیام بفرستید",MESSAGELIST_LOADING_OLDER:"...در حال بارگذاری پیام های قدیمی تر",MESSAGELIST_SHOW_OLDER:"نشان دادن پیام های قدیمی",MESSAGELIST_NEW_MARKER:"جدید",MESSAGE_SENT_VIA_EMAIL:"پیام توسط ایمل ارسال شد",YOU_MARKER:"شما",UPLOAD_IN_PROGRESS:"...در حال بارگذاری",UPLOAD_SEND_FILE:"فرستادن پوشه",UPLOAD_SHARE_LOCATION:"اشتراک گذاری مکان",UPLOAD_ERROR:"متاسفانه بارگذاری با مشکل روبه رو شد. ممکن است فایل حجیم باشد یا ساپورت نشده باشد.",SHARE_LOCATION_ERROR:"خطا در اشتراک گذاری مکان: ",LOADING:"...بارگذاری",HUB_EMPTY:"تاریخچه گفتگو اینجا نمایان می شود",HUB_SHOW_EARLIER:"دیدن گفتگو های قبلی",INBOX_NO_CHATS_TITLE:"هنوز گفتگویی وجود ندارد",INBOX_NO_CHATS_BODY:"بعد از داشتن یک مکالمه یا بیشتر، آنها اینجا نمایان می شوند.",ENABLE_TRANSLATION:"این مکالمه را به فارسی ترجمه کن",DISABLE_TRANSLATION:"زبان اصلی را نشان بده",SEARCH_PLACEHOLDER_TEXT:"...جستجو",SEARCH_SEARCHING:"...در حال جستجو",SEARCH_NO_RESULTS:"نتیجه ای یافت نشد",SEARCH_NO_MORE_RESULTS:"نتیجه بیشتری وجود ندارد",CHAT_NOT_FOUND:"مکالمه پیدا نشد",DELETE_MESSAGE:"حذف پیام ",DELETION_EXPLANATION:"اگر این پیام را حذف کنید، برای همه ناپدید می شود.",EDIT_MESSAGE:"ویرایش پیام",SAVE:"ذخیره",EDITED_INDICATOR:"ویرایش‌شده",REPLY_TO_MESSAGE:"پاسخ دادن",ADD_REACTION:"واکنش را اضافه کنید",AUTH_EXPIRED_OVERLAY_TITLE:"جلسه چت شما منقضی شده است",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"برای ادامه صفحه را بازخوانی کنید",VOICE_MESSAGE:"پیام صوتی",CONTACT_INFORMATION_HIDDEN:"اطلاعات پنهان",LEAVE_CONVERSATION:"خروج از گفتگو",MARK_CONVERSATION_AS_UNREAD:"به عنوان خوانده نشده علامت گذاری کن",STATUS_INDICATOR_ONLINE:"فعال",STATUS_INDICATOR_OFFLINE:"غایب",ARIA_LEAVE_SEARCH_MODE:"خروج از حالت جستجو",ARIA_SEARCH_UP:"جستجوی بالا",ARIA_SEARCH_DOWN:"جستجوی پایین",ARIA_CLOSE_CHAT_POPUP:"بستن پنجره چت",ARIA_SEARCH_INSIDE_CONVERSATION:"جستجو در این گفتگو",ARIA_SEARCH:"جستجو",ARIA_CHAT:"چت",ARIA_SET_PLAYBACK_SPEED:"تنظیم سرعت پخش",ARIA_CANCEL_UPLOAD:"لغو آپلود",ARIA_STOP_RECORDING:"توقف ضبط",ARIA_CANCEL_RECORDING:"لغو ضبط",ARIA_INSERT_EMOJI:"درج ایموجی",ARIA_PLAY_AUDIO:"پخش صدا",ARIA_PAUSE_AUDIO:"مکث صدا",ARIA_REACTION_COUNT:(n,e)=>`${n} واکنش با ${e}`,ARIA_MORE_ACTIONS:"اقدامات بیشتر",ARIA_REPLYING_TO:(n,e)=>`در حال پاسخ به ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"خروج از حالت پاسخ"}},fi:{code:"fi-FI",name:"Finnish",translation:{YESTERDAY:"Eilen",TODAY:"Tänään",DAYS:"p",HOURS:"t",MINUTES:"m",JUST_NOW:"juuri nyt",LOCATION:"Sijainti",CANCEL:"Peruuta",INBOX:"Saapuneet",DESKTOP_NOTIFICATIONS:"Selaimen ilmoitukset",DESKTOP_NOTIFICATIONS_ERROR:"Työpöydän ilmoituksia ei voitu kytkeä päälle, koska selaimesi estää ne aktiivisesti. Koeta tutkia sen asetuksia tai vaihda selainta.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo ilmoitus`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Jos pidät tämän sivun auki, näet vastaavan ilmoituksen kun joku puhuu sinulle.",SEND_BUTTON_TEXT:"Lähetä",ENTRYBOX_TEXT_LIMIT:"Maksimissaan 10000 merkkiä.",ENTRYBOX_PLACEHOLDER:"Sano jotain...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Tämä keskustelu ei ole enää aktiivinen.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Voit lukea, mutta et lähettää viestejä.",MESSAGELIST_LOADING_OLDER:"Ladataan vanhoja viestejä..",MESSAGELIST_SHOW_OLDER:"Näytä vanhat viestit",MESSAGELIST_NEW_MARKER:"Uusi",MESSAGE_SENT_VIA_EMAIL:"Tämä viesti on lähetetty sähköpostin välityksellä",YOU_MARKER:"sinä",UPLOAD_IN_PROGRESS:"Ladataan...",UPLOAD_SEND_FILE:"Lähetä tiedosto",UPLOAD_SHARE_LOCATION:"Jaa sijainti",UPLOAD_ERROR:"Valitettavasti jokin meni vikaan. Tiedostotyyppiä ei ehkä tueta tai se saattaa olla liian suuri.",SHARE_LOCATION_ERROR:"Sijaintia ei pystytty jakamaan: ",LOADING:"Ladataan...",HUB_EMPTY:"Keskusteluhistoriasi näkyy tässä",HUB_SHOW_EARLIER:"Näytä aiemmat keskustelut",INBOX_NO_CHATS_TITLE:"Ei keskusteluja, vielä!",INBOX_NO_CHATS_BODY:"Kun olet käynyt yhden tai useamman keskustelun, ne näkyvät täällä.",ENABLE_TRANSLATION:"Käännä keskustelu kielelle suomi",DISABLE_TRANSLATION:"Näytä alkuperäinen",SEARCH_PLACEHOLDER_TEXT:"Etsi...",SEARCH_SEARCHING:"Etsiminen...",SEARCH_NO_RESULTS:"Tuloksia ei löytynyt",SEARCH_NO_MORE_RESULTS:"Ei enempää tuloksia",CHAT_NOT_FOUND:"Keskustelua ei löytynyt",DELETE_MESSAGE:"Poista viesti",DELETION_EXPLANATION:"Jos poistat tämän viestin, se häviää kaikilta.",EDIT_MESSAGE:"Muokkaa viestiä",SAVE:"Tallenna",EDITED_INDICATOR:"muokattu",REPLY_TO_MESSAGE:"Vastaa",ADD_REACTION:"Lisää reaktio",AUTH_EXPIRED_OVERLAY_TITLE:"Istuntosi on vanhentunut",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Päivitä sivu jatkaaksesi",VOICE_MESSAGE:"Ääniviesti",CONTACT_INFORMATION_HIDDEN:"Piilotetut tiedot",LEAVE_CONVERSATION:"Poistu keskustelusta",MARK_CONVERSATION_AS_UNREAD:"Merkitse lukemattomaksi",STATUS_INDICATOR_ONLINE:"Aktiivinen",STATUS_INDICATOR_OFFLINE:"Poissa",ARIA_LEAVE_SEARCH_MODE:"Poistu hakutilasta",ARIA_SEARCH_UP:"Hae ylöspäin",ARIA_SEARCH_DOWN:"Hae alaspäin",ARIA_CLOSE_CHAT_POPUP:"Sulje chat-ikkuna",ARIA_SEARCH_INSIDE_CONVERSATION:"Hae tästä keskustelusta",ARIA_SEARCH:"Hae",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"aseta toistonopeus",ARIA_CANCEL_UPLOAD:"Peruuta lähetys",ARIA_STOP_RECORDING:"Lopeta tallennus",ARIA_CANCEL_RECORDING:"Peruuta tallennus",ARIA_INSERT_EMOJI:"Lisää emoji",ARIA_PLAY_AUDIO:"toista ääni",ARIA_PAUSE_AUDIO:"keskeytä ääni",ARIA_REACTION_COUNT:(n,e)=>`${n} reaktiota (${e})`,ARIA_MORE_ACTIONS:"Lisää toimintoja",ARIA_REPLYING_TO:(n,e)=>`Vastataan käyttäjälle ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Poistu vastaustilasta"}},fr:{code:"fr-FR",name:"French",translation:{YESTERDAY:"Hier",TODAY:"Aujourd'hui",DAYS:"j",HOURS:"h",MINUTES:"m",JUST_NOW:"maintenant",LOCATION:"Emplacement",CANCEL:"Annuler",INBOX:"Boîte de réception",DESKTOP_NOTIFICATIONS:"Notifications du navigateur",DESKTOP_NOTIFICATIONS_ERROR:"Impossible d'activer les notifications du navigateur car votre navigateur les bloque. Essayez de changer ses paramètres ou de changer de navigateur.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`Notification de démonstration ${n}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Si vous maintenez l'onglet ouvert dans votre navigateur vous verrez apparaître une alerte lorsque quelqu'un vous parlera.",SEND_BUTTON_TEXT:"Envoyer",ENTRYBOX_TEXT_LIMIT:"Seuls 10.000 caractères sont autorisés.",ENTRYBOX_PLACEHOLDER:"Ecrivez quelque chose...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Cette conversation n'est plus active.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Vous pouvez lire, mais pas envoyer de messages.",MESSAGELIST_LOADING_OLDER:"Chargement des anciens messages ...",MESSAGELIST_SHOW_OLDER:"Afficher les anciens messages",MESSAGELIST_NEW_MARKER:"Nouveau",MESSAGE_SENT_VIA_EMAIL:"Ce message a été envoyé par e-mail",YOU_MARKER:"vous",UPLOAD_IN_PROGRESS:"Envoi en cours...",UPLOAD_SEND_FILE:"Envoyer un fichier",UPLOAD_SHARE_LOCATION:"Partager mon emplacement",UPLOAD_ERROR:"Un problème est survenu lors de l'envoi: le fichier est peut-être non pris en charge ou trop volumineux.",SHARE_LOCATION_ERROR:"Impossible de partager votre emplacement: ",LOADING:"Chargement en cours...",HUB_EMPTY:"Votre historique de discussion apparaîtra ici",HUB_SHOW_EARLIER:"Afficher les conversations précédentes",INBOX_NO_CHATS_TITLE:"Aucune conversation pour l'instant!",INBOX_NO_CHATS_BODY:"Une fois que vous aurez eu une ou plusieurs conversations, elles apparaîtront ici.",ENABLE_TRANSLATION:"Traduire cette conversation en français",DISABLE_TRANSLATION:"Remontrer la conversation originale",SEARCH_PLACEHOLDER_TEXT:"Rechercher...",SEARCH_SEARCHING:"Recherche...",SEARCH_NO_RESULTS:"Aucun résultat trouvé",SEARCH_NO_MORE_RESULTS:"Il n’y a plus de résultats",CHAT_NOT_FOUND:"Conversation introuvable",DELETE_MESSAGE:"Supprimer le message",DELETION_EXPLANATION:"Si vous supprimez ce message, il disparaîtra pour tout le monde.",EDIT_MESSAGE:"Modifier le message",SAVE:"Enregistrer",EDITED_INDICATOR:"modifié",REPLY_TO_MESSAGE:"Répondre",ADD_REACTION:"Ajouter une réaction",AUTH_EXPIRED_OVERLAY_TITLE:"Votre session de chat a expiré",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Actualisez la page pour continuer",VOICE_MESSAGE:"Message vocal",CONTACT_INFORMATION_HIDDEN:"Informations masquées",LEAVE_CONVERSATION:"Quitter la conversation",MARK_CONVERSATION_AS_UNREAD:"Marquer comme non lu",STATUS_INDICATOR_ONLINE:"Actif",STATUS_INDICATOR_OFFLINE:"Absent",ARIA_LEAVE_SEARCH_MODE:"Quitter le mode recherche",ARIA_SEARCH_UP:"Rechercher vers le haut",ARIA_SEARCH_DOWN:"Rechercher vers le bas",ARIA_CLOSE_CHAT_POPUP:"Fermer la fenêtre de chat",ARIA_SEARCH_INSIDE_CONVERSATION:"Rechercher dans cette conversation",ARIA_SEARCH:"Rechercher",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"définir la vitesse de lecture",ARIA_CANCEL_UPLOAD:"Annuler l'envoi",ARIA_STOP_RECORDING:"Arrêter l'enregistrement",ARIA_CANCEL_RECORDING:"Annuler l'enregistrement",ARIA_INSERT_EMOJI:"Insérer un emoji",ARIA_PLAY_AUDIO:"lire l'audio",ARIA_PAUSE_AUDIO:"mettre en pause l'audio",ARIA_REACTION_COUNT:(n,e)=>`${n} réactions avec ${e}`,ARIA_MORE_ACTIONS:"Plus d'actions",ARIA_REPLYING_TO:(n,e)=>`Répondre à ${n} : ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Quitter le mode réponse"}},he:{code:"he-IL",name:"Hebrew",translation:{YESTERDAY:"אתמול",TODAY:"היום",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"עכשיו",LOCATION:"מיקום",CANCEL:"בטל",INBOX:"דואר נכנס",DESKTOP_NOTIFICATIONS:"התראות דפדפן",DESKTOP_NOTIFICATIONS_ERROR:"לא ניתן להפעיל התראות במרועה דפדפן מכיוון שהדפדפן שלך חוסם אותן באופן פעיל. נסה להסתכל בהגדרות או להשתמש בדפדפן אחר.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} הודעה על הדגמה`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"אם אתה שומר על כרטיסיית הדפדפן שלך פתוחה, תראה את זה צץ כשמישהו ידבר איתך.",SEND_BUTTON_TEXT:"שלח",ENTRYBOX_TEXT_LIMIT:"רק 10.000 תווים",ENTRYBOX_PLACEHOLDER:"תגיד משהו...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"שיחה זו אינה פעילה עוד.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"אתה יכול לקרוא, אך לא לשלוח הודעות.",MESSAGELIST_LOADING_OLDER:"טוען הודעות ישנות...",MESSAGELIST_SHOW_OLDER:"הצג הודעות ישנות",MESSAGELIST_NEW_MARKER:"חדש",MESSAGE_SENT_VIA_EMAIL:"הודעה זאת נשלחה דרך אימייל",YOU_MARKER:"אתה",UPLOAD_IN_PROGRESS:"מעלה ...",UPLOAD_SEND_FILE:"שלח קובץ",UPLOAD_SHARE_LOCATION:"שתף מיקום",UPLOAD_ERROR:"לרוע המזל משהו השתבש בהעלאה. ייתכן שהקובץ אינו נתמך או גדול מדי.",SHARE_LOCATION_ERROR:"לא ניתן לשתף מיקום: ",LOADING:"טוען...",HUB_EMPTY:"היסטוריית הצ'אט שלך תופיע כאן",HUB_SHOW_EARLIER:"הצג צ'אטים קודמים",INBOX_NO_CHATS_TITLE:"אין עדיין צ'אטים!",INBOX_NO_CHATS_BODY:"לאחר שניהלת שיחה אחת או יותר, הם יופיעו כאן.",ENABLE_TRANSLATION:"תרגם שיחה זו לעברית",DISABLE_TRANSLATION:"הצג מקור",SEARCH_PLACEHOLDER_TEXT:"...חפש",SEARCH_SEARCHING:"...מחפש",SEARCH_NO_RESULTS:"לא נמצאו תוצאות",SEARCH_NO_MORE_RESULTS:"אין תוצאות נוספות",CHAT_NOT_FOUND:"הצ'אט לא נמצא",DELETE_MESSAGE:"מחיקת הודעה",DELETION_EXPLANATION:"אם תמחק הודעה זו, היא תיעלם עבור כולם.",EDIT_MESSAGE:"עריכת הודעה",SAVE:"שמור",EDITED_INDICATOR:"ערוך",REPLY_TO_MESSAGE:"השב",ADD_REACTION:"הוספת תגובה",AUTH_EXPIRED_OVERLAY_TITLE:"הפעלת הצ׳אט שלכם פגה",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"רעננו את העמוד כדי להמשיך",VOICE_MESSAGE:"הודעה קולית",CONTACT_INFORMATION_HIDDEN:"מידע מוסתר",LEAVE_CONVERSATION:"צא מהשיחה",MARK_CONVERSATION_AS_UNREAD:"סמן כלא נקרא",STATUS_INDICATOR_ONLINE:"פעיל",STATUS_INDICATOR_OFFLINE:"לא פעיל",ARIA_LEAVE_SEARCH_MODE:"צא ממצב חיפוש",ARIA_SEARCH_UP:"חפש למעלה",ARIA_SEARCH_DOWN:"חפש למטה",ARIA_CLOSE_CHAT_POPUP:"סגור חלון צ'אט",ARIA_SEARCH_INSIDE_CONVERSATION:"חפש בתוך השיחה הזו",ARIA_SEARCH:"חפש",ARIA_CHAT:"צ'אט",ARIA_SET_PLAYBACK_SPEED:"הגדר מהירות השמעה",ARIA_CANCEL_UPLOAD:"בטל העלאה",ARIA_STOP_RECORDING:"עצור הקלטה",ARIA_CANCEL_RECORDING:"בטל הקלטה",ARIA_INSERT_EMOJI:"הוסף אמוג'י",ARIA_PLAY_AUDIO:"נגן אודיו",ARIA_PAUSE_AUDIO:"השהה אודיו",ARIA_REACTION_COUNT:(n,e)=>`${n} תגובות עם ${e}`,ARIA_MORE_ACTIONS:"פעולות נוספות",ARIA_REPLYING_TO:(n,e)=>`משיב ל-${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"צא ממצב תשובה"}},hi:{code:"hi-IN",name:"Hindi (IN)",translation:{YESTERDAY:"कल",TODAY:"आज",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"अभी",LOCATION:"जगह",CANCEL:"रद्द करें",INBOX:"इनबॉक्स",DESKTOP_NOTIFICATIONS:"ब्राउज़र सूचनाएं",DESKTOP_NOTIFICATIONS_ERROR:"ब्राउज़र सूचनाएं सक्षम नहीं कर सकता क्योंकि आपका ब्राउज़र सक्रिय रूप से उन्हें ब्लॉक करता है। सेटिंग्स में देखने या एक अलग ब्राउज़र का उपयोग करने का प्रयास करें।",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} डेमो अधिसूचना`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"यदि आप अपना ब्राउज़र टैब खुला रखते हैं, तो यह पॉप अप आपको तब दिखाई देगा जब कोई आपसे बात करेगा।",SEND_BUTTON_TEXT:"भेजें",ENTRYBOX_TEXT_LIMIT:"केवल 10,000 वर्णों की अनुमति है।",ENTRYBOX_PLACEHOLDER:"कुछ कहिए...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"यह चैट अब सक्रिय नहीं है।",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"आप पढ़ सकते हैं, लेकिन संदेश नहीं भेज सकते।",MESSAGELIST_LOADING_OLDER:"पुराने संदेश लोड हो रहे हैं ...",MESSAGELIST_SHOW_OLDER:"पुराने संदेश दिखाएं",MESSAGELIST_NEW_MARKER:"नया",MESSAGE_SENT_VIA_EMAIL:"यह संदेश ईमेल के माध्यम से भेजा गया था",YOU_MARKER:"आप",UPLOAD_IN_PROGRESS:"अपलोड हो रहा है...",UPLOAD_SEND_FILE:"फाइल भेजें",UPLOAD_SHARE_LOCATION:"जगह शेयर करें",UPLOAD_ERROR:"दुर्भाग्य से, अपलोड करते समय कुछ गलत हो गया। फ़ाइल असमर्थित या बहुत बड़ी हो सकती है।",SHARE_LOCATION_ERROR:"जगह शेयर नहीं हो पाया: ",LOADING:"लोड हो रहा है...",HUB_EMPTY:"आपका चैट इतिहास यहां दिखाई देगा",HUB_SHOW_EARLIER:"पहले की चैट दिखाओ",INBOX_NO_CHATS_TITLE:"अभी तक कोई चैट नहीं!",INBOX_NO_CHATS_BODY:"एक बार जब आप एक या अधिक चैट कर लेते हैं, तो वे यहां दिखाई देंगे।",ENABLE_TRANSLATION:"इस बातचीत का हिंदी में अनुवाद कीजिए",DISABLE_TRANSLATION:"मूल दिखाएँ",SEARCH_PLACEHOLDER_TEXT:"खोजें...",SEARCH_SEARCHING:"खोज जारी है...",SEARCH_NO_RESULTS:"कोई परिणाम नहीं मिला",SEARCH_NO_MORE_RESULTS:"और कोई परिणाम नहीं",CHAT_NOT_FOUND:"चैट नहीं मिली",DELETE_MESSAGE:"संदेश डिलीट करें",DELETION_EXPLANATION:"यदि आप इस संदेश को हटाते हैं, तो यह सभी के लिए गायब हो जाएगा.",EDIT_MESSAGE:"संदेश में बदलाव करें",SAVE:"सहेजें",EDITED_INDICATOR:"संपादित किया गया",REPLY_TO_MESSAGE:"जवाब दीजिए ।",ADD_REACTION:"प्रतिक्रिया जोड़ें",AUTH_EXPIRED_OVERLAY_TITLE:"आपका चैट सेशन समाप्त हो चुका है",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"आगे बढ़ने के लिए रिफ्रेश करें",VOICE_MESSAGE:"वॉयस मैसेज",CONTACT_INFORMATION_HIDDEN:"छुपी हुई जानकारी",LEAVE_CONVERSATION:"बातचीत को ख़त्म करें",MARK_CONVERSATION_AS_UNREAD:"अपठित के रूप में चिह्नित करें",STATUS_INDICATOR_ONLINE:"सक्रिय",STATUS_INDICATOR_OFFLINE:"अनुपस्थित",ARIA_LEAVE_SEARCH_MODE:"खोज मोड से बाहर निकलें",ARIA_SEARCH_UP:"ऊपर खोजें",ARIA_SEARCH_DOWN:"नीचे खोजें",ARIA_CLOSE_CHAT_POPUP:"चैट विंडो बंद करें",ARIA_SEARCH_INSIDE_CONVERSATION:"इस बातचीत में खोजें",ARIA_SEARCH:"खोजें",ARIA_CHAT:"चैट",ARIA_SET_PLAYBACK_SPEED:"प्लेबैक गति सेट करें",ARIA_CANCEL_UPLOAD:"अपलोड रद्द करें",ARIA_STOP_RECORDING:"रिकॉर्डिंग रोकें",ARIA_CANCEL_RECORDING:"रिकॉर्डिंग रद्द करें",ARIA_INSERT_EMOJI:"इमोजी डालें",ARIA_PLAY_AUDIO:"ऑडियो चलाएं",ARIA_PAUSE_AUDIO:"ऑडियो रोकें",ARIA_REACTION_COUNT:(n,e)=>`${n} प्रतिक्रियाएं (${e})`,ARIA_MORE_ACTIONS:"अधिक कार्य",ARIA_REPLYING_TO:(n,e)=>`${n} को उत्तर दे रहे हैं: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"उत्तर मोड से बाहर निकलें"}},hr:{code:"hr-HR",name:"Croatian",translation:{YESTERDAY:"Jučer",TODAY:"Danas",DAYS:"d",HOURS:"s",MINUTES:"m",JUST_NOW:"Upravo sad",LOCATION:"Lokacija",CANCEL:"Otkaži",INBOX:"Pretinac",DESKTOP_NOTIFICATIONS:"Obavijesti preglednika",DESKTOP_NOTIFICATIONS_ERROR:"Notifikacije preglednika nisu omogućene jer ih vaš preglednik aktivno blokira. Pokušajte pogledati postavke ili koristiti neki drugi preglednik.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notifikacija`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ako karticu preglednika ostavite otvorenu, pojavit će se ovaj pop-up kada netko razgovara s vama.",SEND_BUTTON_TEXT:"Pošalji",ENTRYBOX_TEXT_LIMIT:"Dozvoljeno je samo 10.000 znakova.",ENTRYBOX_PLACEHOLDER:"Reci nešto...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ovaj razgovor više nije aktivan.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Možeš čitati, ali ne i slati poruke.",MESSAGELIST_LOADING_OLDER:"Učitavam starije poruke...",MESSAGELIST_SHOW_OLDER:"Prikaži starije poruke",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Ova poruka je poslana e-poštom",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Učitavam...",UPLOAD_SEND_FILE:"Pošalji datoteku",UPLOAD_SHARE_LOCATION:"Podijeli lokaciju",UPLOAD_ERROR:"Nažalost, nešto je pošlo krivo. Datoteka možda nije podržana ili je prevelika.",SHARE_LOCATION_ERROR:"Nije moguće podijeliti lokaciju: ",LOADING:"Učitavam...",HUB_EMPTY:"Ovdje će se prikazati vaša povijest razgovora",HUB_SHOW_EARLIER:"Prikaži ranije razgovore",INBOX_NO_CHATS_TITLE:"Nema razgovora!",INBOX_NO_CHATS_BODY:"Nakon što vodite jedan ili više razgovora, oni će se pojaviti ovdje.",ENABLE_TRANSLATION:"Prevedi ovaj razgovor na hrvatski jezik",DISABLE_TRANSLATION:"Prikaži original",SEARCH_PLACEHOLDER_TEXT:"Pretraži...",SEARCH_SEARCHING:"Pretraživanje...",SEARCH_NO_RESULTS:"Nema rezultata",SEARCH_NO_MORE_RESULTS:"Nema više rezultata",CHAT_NOT_FOUND:"Razgovor nije pronađen",DELETE_MESSAGE:"Obriši poruku",DELETION_EXPLANATION:"Ako izbrišete ovu poruku, nestat će za sve.",EDIT_MESSAGE:"Uredi poruku",SAVE:"Spremi",EDITED_INDICATOR:"uređivao",REPLY_TO_MESSAGE:"Odgovorite",ADD_REACTION:"Dodajte reakciju",AUTH_EXPIRED_OVERLAY_TITLE:"Vaša sesija razgovora je istekla",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Osvježite stranicu za nastavak",VOICE_MESSAGE:"Glasovna poruka",CONTACT_INFORMATION_HIDDEN:"Skrivene informacije",LEAVE_CONVERSATION:"Napustiti razgovor",MARK_CONVERSATION_AS_UNREAD:"Označi kao nepročitano",STATUS_INDICATOR_ONLINE:"Aktivan",STATUS_INDICATOR_OFFLINE:"Odsutan",ARIA_LEAVE_SEARCH_MODE:"Napusti način pretraživanja",ARIA_SEARCH_UP:"Traži gore",ARIA_SEARCH_DOWN:"Traži dolje",ARIA_CLOSE_CHAT_POPUP:"Zatvori prozor za chat",ARIA_SEARCH_INSIDE_CONVERSATION:"Traži u ovom razgovoru",ARIA_SEARCH:"Traži",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"postavi brzinu reprodukcije",ARIA_CANCEL_UPLOAD:"Otkaži učitavanje",ARIA_STOP_RECORDING:"Zaustavi snimanje",ARIA_CANCEL_RECORDING:"Otkaži snimanje",ARIA_INSERT_EMOJI:"Umetni emoji",ARIA_PLAY_AUDIO:"reproduciraj audio",ARIA_PAUSE_AUDIO:"pauziraj audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reakcija s ${e}`,ARIA_MORE_ACTIONS:"Više radnji",ARIA_REPLYING_TO:(n,e)=>`Odgovaranje korisniku ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Izađi iz moda odgovaranja"}},hu:{code:"hu-HU",name:"Hungarian",translation:{YESTERDAY:"Tegnap",TODAY:"Ma",DAYS:"n",HOURS:"ó",MINUTES:"p",JUST_NOW:"éppen most",LOCATION:"Helyszín",CANCEL:"Visszavonás",INBOX:"Postaláda",DESKTOP_NOTIFICATIONS:"Böngésző értesítések",DESKTOP_NOTIFICATIONS_ERROR:"Azért nem tudja bekapcsolni a böngésző értesítések funkciót, mert böngészője aktívan blokkolja azt. Tekintse meg a beállításokat vagy használjon másik böngészőt.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo értesítés`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ha nyitva hagyja böngészőjét, felugró ablak fog megjelenni, ha valaki beszélni szeretne Önnel.",SEND_BUTTON_TEXT:"Küldés",ENTRYBOX_TEXT_LIMIT:"Mindőssze 10.000 karakter megengedett.",ENTRYBOX_PLACEHOLDER:"Mondjon valamit...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ez a beszélgetés már nem aktív.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Elolvashatja az üzeneteket, de nem küldhet újat.",MESSAGELIST_LOADING_OLDER:"Korábbi üzenetek betöltése...",MESSAGELIST_SHOW_OLDER:"Korábbi üzenetek megjelenítése",MESSAGELIST_NEW_MARKER:"Új",MESSAGE_SENT_VIA_EMAIL:"Ez az üzenet e-mailben került elküldésre",YOU_MARKER:"Ön",UPLOAD_IN_PROGRESS:"Feltöltés...",UPLOAD_SEND_FILE:"Fájl küldése",UPLOAD_SHARE_LOCATION:"Helyszín megosztása",UPLOAD_ERROR:"Sajnos hiba történt a feltöltés során. A fájl nem támogatott vagy túl nagy.",SHARE_LOCATION_ERROR:"Helyszín megosztása nem lehetséges: ",LOADING:"Betöltés...",HUB_EMPTY:"A beszélgetések előzményei itt láthatók",HUB_SHOW_EARLIER:"Korábbi beszélgetések megjelenítése",INBOX_NO_CHATS_TITLE:"Még nincs megjeleníthető beszélgetés!",INBOX_NO_CHATS_BODY:"Amint egy vagy több beszélgetéssel rendelkezik, azok itt fognak megjelenni.",ENABLE_TRANSLATION:"A beszélgetés lefordítása erre a nyelvre: magyar",DISABLE_TRANSLATION:"Eredeti megjelenítése",SEARCH_PLACEHOLDER_TEXT:"Keresés...",SEARCH_SEARCHING:"Keresés...",SEARCH_NO_RESULTS:"Nincs találat",SEARCH_NO_MORE_RESULTS:"Nincs több találat",CHAT_NOT_FOUND:"A csevegés nem található",DELETE_MESSAGE:"Üzenet törlése",DELETION_EXPLANATION:"Ha törlöd ezt az üzenetet, az mindenki számára eltűnik.",EDIT_MESSAGE:"Üzenet szerkesztése",SAVE:"Mentés",EDITED_INDICATOR:"szerkesztve",REPLY_TO_MESSAGE:"Válaszadás",ADD_REACTION:"Reagálás erre",AUTH_EXPIRED_OVERLAY_TITLE:"Chat munkamenete lejárt",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Folytatáshoz frissítse az oldalt",VOICE_MESSAGE:"Hangüzenet",CONTACT_INFORMATION_HIDDEN:"Rejtett információ",LEAVE_CONVERSATION:"Kilépés a beszélgetésből",MARK_CONVERSATION_AS_UNREAD:"Megjelölés olvasatlanként",STATUS_INDICATOR_ONLINE:"Aktív",STATUS_INDICATOR_OFFLINE:"Távol",ARIA_LEAVE_SEARCH_MODE:"Keresési mód elhagyása",ARIA_SEARCH_UP:"Keresés felfelé",ARIA_SEARCH_DOWN:"Keresés lefelé",ARIA_CLOSE_CHAT_POPUP:"Csevegő ablak bezárása",ARIA_SEARCH_INSIDE_CONVERSATION:"Keresés ebben a beszélgetésben",ARIA_SEARCH:"Keresés",ARIA_CHAT:"Csevegés",ARIA_SET_PLAYBACK_SPEED:"lejátszási sebesség beállítása",ARIA_CANCEL_UPLOAD:"Feltöltés megszakítása",ARIA_STOP_RECORDING:"Felvétel leállítása",ARIA_CANCEL_RECORDING:"Felvétel megszakítása",ARIA_INSERT_EMOJI:"Emoji beszúrása",ARIA_PLAY_AUDIO:"hang lejátszása",ARIA_PAUSE_AUDIO:"hang szüneteltetése",ARIA_REACTION_COUNT:(n,e)=>`${n} reakció (${e})`,ARIA_MORE_ACTIONS:"További műveletek",ARIA_REPLYING_TO:(n,e)=>`Válaszolás ${n} részére: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Kilépés a válasz módóból"}},id:{code:"id-ID",name:"Bahasa Indonesia",translation:{YESTERDAY:"Kemarin",TODAY:"Hari ini",DAYS:"h",HOURS:"j",MINUTES:"m",JUST_NOW:"sekarang",LOCATION:"Lokasi",CANCEL:"Batal",INBOX:"Kotak Masuk",DESKTOP_NOTIFICATIONS:"Notifikasi peramban",DESKTOP_NOTIFICATIONS_ERROR:"Tidak dapat mengaktifkan pemberitahuan browser karena browser Anda secara aktif memblokir mereka. Coba cari di pengaturan atau menggunakan browser yang berbeda.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`pemberitahuan demo ${n}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Jika Anda membiarkan tab browser tetap terbuka, Anda akan melihat ini muncul ketika seseorang berbicara kepada Anda.",SEND_BUTTON_TEXT:"Kirim",ENTRYBOX_TEXT_LIMIT:"Hanya 10.000 karakter yang diizinkan.",ENTRYBOX_PLACEHOLDER:"Katakan sesuatu...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Percakapan ini tidak lagi aktif.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Anda dapat membaca, tetapi tidak mengirim pesan.",MESSAGELIST_LOADING_OLDER:"Memuat pesan lama...",MESSAGELIST_SHOW_OLDER:"Tampilkan pesan yang lebih lama",MESSAGELIST_NEW_MARKER:"Baru",MESSAGE_SENT_VIA_EMAIL:"Pesan ini dikirim melalui email",YOU_MARKER:"Anda",UPLOAD_IN_PROGRESS:"Mengunggah...",UPLOAD_SEND_FILE:"Kirim mengajukan",UPLOAD_SHARE_LOCATION:"Bagikan lokasi",UPLOAD_ERROR:"Ada yang salah diunggah. File mungkin tidak didukung atau terlalu besar.",SHARE_LOCATION_ERROR:"Tidak dapat membagikan lokasi: ",LOADING:"Memuat...",HUB_EMPTY:"Riwayat obrolan Anda akan muncul di sini",HUB_SHOW_EARLIER:"Tampilkan obrolan sebelumnya",INBOX_NO_CHATS_TITLE:"Belum ada obrolan!",INBOX_NO_CHATS_BODY:"Setelah Anda melakukan satu atau lebih percakapan, mereka akan muncul di sini.",ENABLE_TRANSLATION:"Terjemahkan percakapan ini ke Indonesia",DISABLE_TRANSLATION:"Perlihatkan asli",SEARCH_PLACEHOLDER_TEXT:"Cari...",SEARCH_SEARCHING:"Mencari...",SEARCH_NO_RESULTS:"Tidak ditemukan hasil",SEARCH_NO_MORE_RESULTS:"Tidak ada hasil lainnya",CHAT_NOT_FOUND:"Obrolan tidak ditemukan",DELETE_MESSAGE:"Hapus pesan",DELETION_EXPLANATION:"Jika pesan ini Anda hapus, pesan ini akan tidak terlihat bagi siapa pun.",EDIT_MESSAGE:"Sunting pesan",SAVE:"Mentés",EDITED_INDICATOR:"diedit",REPLY_TO_MESSAGE:"Balas",ADD_REACTION:"Tambah reaksi",AUTH_EXPIRED_OVERLAY_TITLE:"Sesi obrolan Anda sudah lewat batas waktu",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Muat ulang halaman untuk melanjutkan",VOICE_MESSAGE:"Pesan suara",CONTACT_INFORMATION_HIDDEN:"Informasi tersembunyi",LEAVE_CONVERSATION:"Tinggalkan percakapan",MARK_CONVERSATION_AS_UNREAD:"Tandai sebagai Belum dibaca",STATUS_INDICATOR_ONLINE:"Aktif",STATUS_INDICATOR_OFFLINE:"Tidak aktif",ARIA_LEAVE_SEARCH_MODE:"Keluar dari mode pencarian",ARIA_SEARCH_UP:"Cari ke atas",ARIA_SEARCH_DOWN:"Cari ke bawah",ARIA_CLOSE_CHAT_POPUP:"Tutup jendela obrolan",ARIA_SEARCH_INSIDE_CONVERSATION:"Cari dalam percakapan ini",ARIA_SEARCH:"Cari",ARIA_CHAT:"Obrolan",ARIA_SET_PLAYBACK_SPEED:"atur kecepatan pemutaran",ARIA_CANCEL_UPLOAD:"Batalkan unggah",ARIA_STOP_RECORDING:"Hentikan perekaman",ARIA_CANCEL_RECORDING:"Batalkan perekaman",ARIA_INSERT_EMOJI:"Sisipkan emoji",ARIA_PLAY_AUDIO:"putar audio",ARIA_PAUSE_AUDIO:"jeda audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reaksi dengan ${e}`,ARIA_MORE_ACTIONS:"Tindakan lainnya",ARIA_REPLYING_TO:(n,e)=>`Membalas ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Keluar dari mode balasan"}},is:{code:"is-IS",name:"Íslenska",translation:{YESTERDAY:"Í gær",TODAY:"Í dag",DAYS:"dagar",HOURS:"klst.",MINUTES:"mín.",JUST_NOW:"núna",LOCATION:"Staðsetning",CANCEL:"Hætta við",INBOX:"Pósthólf",DESKTOP_NOTIFICATIONS:"Tilkynningar í vafra",DESKTOP_NOTIFICATIONS_ERROR:"Ekki er hægt að birta tilkynningar í vafra vegna þess að vafrinn sem þú notar hindrar það. Reyndu að leita að stillingum eða að nota annan vafra.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} prufutilkynning`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ef flipinn í vafranum er opinn muntu sjá þessa tilkynningu birtast þegar einhver sendir þér skilaboð.",SEND_BUTTON_TEXT:"Senda",ENTRYBOX_TEXT_LIMIT:"Aðeins 10.000 stafir komast fyrir.",ENTRYBOX_PLACEHOLDER:"Segðu eitthvað...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Þessar samræður eru ekki lengar virkar.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Þú getur lesið, en ekki sent skilaboð.",MESSAGELIST_LOADING_OLDER:"Sæki eldri skilaboð...",MESSAGELIST_SHOW_OLDER:"Sýna eldri skilaboð",MESSAGELIST_NEW_MARKER:"Ný",MESSAGE_SENT_VIA_EMAIL:"Þessi skilaboð voru send með tölvupósti",YOU_MARKER:"þú",UPLOAD_IN_PROGRESS:"Hleð upp...",UPLOAD_SEND_FILE:"Senda skrá",UPLOAD_SHARE_LOCATION:"Deila staðsetningu",UPLOAD_ERROR:"Því miður fór eitthvað úrskeiðis við að hlaða upp. Skráin gæti verið af rangri tegund eð of stór.",SHARE_LOCATION_ERROR:"Ekki er hægt að deila staðsetningu: ",LOADING:"Hleð...",HUB_EMPTY:"Fyrri samtöl munu birtast hér",HUB_SHOW_EARLIER:"Sýna fyrri samtöl",INBOX_NO_CHATS_TITLE:"Engin samtöl enn!",INBOX_NO_CHATS_BODY:"Þegar þú hefur átt eitt eða fleiri samtöl, munu þau birtast hér.",ENABLE_TRANSLATION:"Þýða þetta samtal á ensku",DISABLE_TRANSLATION:"Sýna upprunalegt",SEARCH_PLACEHOLDER_TEXT:"Leita...",SEARCH_SEARCHING:"Leita...",SEARCH_NO_RESULTS:"Ekkert fannst",SEARCH_NO_MORE_RESULTS:"Engar fleiri niðurstöður",CHAT_NOT_FOUND:"Samtal fannst ekki",DELETE_MESSAGE:"Eyða skilaboðum",DELETION_EXPLANATION:"Ef þú eyðir þessum skilaboðum munu þau hverfa hjá öllum.",EDIT_MESSAGE:"Breyta skilaboðum",SAVE:"Vista",EDITED_INDICATOR:"breytt",REPLY_TO_MESSAGE:"Svara",ADD_REACTION:"Setja inn viðbrögð",AUTH_EXPIRED_OVERLAY_TITLE:"Spjallið hefur runnið út",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Endurnýjaðu síðuna til að halda áfram",VOICE_MESSAGE:"Raddskilaboð",LEAVE_CONVERSATION:"Skilja eftir skilaboð",MARK_CONVERSATION_AS_UNREAD:"Merkja sem ólesið",STATUS_INDICATOR_ONLINE:"Virk",STATUS_INDICATOR_OFFLINE:"Ekki við",CONTACT_INFORMATION_HIDDEN:"faldar upplýsingar",ARIA_LEAVE_SEARCH_MODE:"Hætta í leitastillingu",ARIA_SEARCH_UP:"Leita upp",ARIA_SEARCH_DOWN:"Leita niður",ARIA_CLOSE_CHAT_POPUP:"Loka spjallglugga",ARIA_SEARCH_INSIDE_CONVERSATION:"Leita í þessari samtal",ARIA_SEARCH:"Leita",ARIA_CHAT:"Spjall",ARIA_SET_PLAYBACK_SPEED:"stilla afspilunarhraða",ARIA_CANCEL_UPLOAD:"Hætta við upphleðslu",ARIA_STOP_RECORDING:"Stöðva upptöku",ARIA_CANCEL_RECORDING:"Hætta við upptöku",ARIA_INSERT_EMOJI:"Setja inn emoji",ARIA_PLAY_AUDIO:"spila hljóð",ARIA_PAUSE_AUDIO:"gera hlé á hljóði",ARIA_REACTION_COUNT:(n,e)=>`${n} viðbrögð með ${e}`,ARIA_MORE_ACTIONS:"Fleiri aðgerðir",ARIA_REPLYING_TO:(n,e)=>`Svara ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Hætta í svarmód"}},it:{code:"it-IT",name:"Italian",translation:{YESTERDAY:"Ieri",TODAY:"Oggi",DAYS:"g",HOURS:"o",MINUTES:"m",JUST_NOW:"adesso",LOCATION:"Posizione",CANCEL:"Annulla",INBOX:"Posta in arrivo",DESKTOP_NOTIFICATIONS:"Notifiche browser",DESKTOP_NOTIFICATIONS_ERROR:"Impossibile abilitare le notifiche browser perché il browser le blocca attivamente. Prova a cercare le impostazioni o utilizzare un browser diverso.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notification`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Se si mantiene aperta la scheda del browser, questo verrà visualizzato quando qualcuno ti parla.",SEND_BUTTON_TEXT:"Invia",ENTRYBOX_TEXT_LIMIT:"Sono consentiti solo 10.000 caratteri.",ENTRYBOX_PLACEHOLDER:"Dì qualcosa...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Questa conversazione non è più attiva.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Puoi leggere, ma non inviare messaggi.",MESSAGELIST_LOADING_OLDER:"Caricamento dei messaggi precedenti...",MESSAGELIST_SHOW_OLDER:"Mostra messaggi precedenti",MESSAGELIST_NEW_MARKER:"Nuovo",MESSAGE_SENT_VIA_EMAIL:"Questo messaggio è stato inviato via email",YOU_MARKER:"tu",UPLOAD_IN_PROGRESS:"Caricamento in corso...",UPLOAD_SEND_FILE:"Invia file",UPLOAD_SHARE_LOCATION:"Condividi posizione",UPLOAD_ERROR:"Qualcosa è andato storto durante il caricamento. Il file potrebbe non essere supportato o troppo grande.",SHARE_LOCATION_ERROR:"Impossibile condividere la posizione: ",LOADING:"Caricamento in corso...",HUB_EMPTY:"La cronologia della tua chat verrà mostrata qui",HUB_SHOW_EARLIER:"Mostra chat precedenti",INBOX_NO_CHATS_TITLE:"Non ci sono ancora chat!",INBOX_NO_CHATS_BODY:"Una volta che hai avuto una o più conversazioni, verranno visualizzate qui.",ENABLE_TRANSLATION:"Traduci questa conversazione in italiano",DISABLE_TRANSLATION:"Mostra l'originale",SEARCH_PLACEHOLDER_TEXT:"Cerca...",SEARCH_SEARCHING:"Cercando...",SEARCH_NO_RESULTS:"Nessun risultato trovato",SEARCH_NO_MORE_RESULTS:"Non ci sono più risultati",CHAT_NOT_FOUND:"Chat non trovata",DELETE_MESSAGE:"Elimina messaggio",DELETION_EXPLANATION:"Se elimini il messaggio, questo scomparirà per tutti.",EDIT_MESSAGE:"Modifica messaggio",SAVE:"Salva",EDITED_INDICATOR:"modificato",REPLY_TO_MESSAGE:"Rispondi",ADD_REACTION:"Aggiungi reazione",AUTH_EXPIRED_OVERLAY_TITLE:"La sessione di chat è scaduta",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Aggiorna la pagina per continuare",VOICE_MESSAGE:"Messaggio vocale",LEAVE_CONVERSATION:"Abbandona la conversazione",MARK_CONVERSATION_AS_UNREAD:"Segna come non letto",STATUS_INDICATOR_ONLINE:"Online",STATUS_INDICATOR_OFFLINE:"Offline",CONTACT_INFORMATION_HIDDEN:"Informazioni nascoste",ARIA_LEAVE_SEARCH_MODE:"Esci dalla modalità ricerca",ARIA_SEARCH_UP:"Cerca in alto",ARIA_SEARCH_DOWN:"Cerca in basso",ARIA_CLOSE_CHAT_POPUP:"Chiudi la finestra di chat",ARIA_SEARCH_INSIDE_CONVERSATION:"Cerca in questa conversazione",ARIA_SEARCH:"Cerca",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"imposta velocità di riproduzione",ARIA_CANCEL_UPLOAD:"Annulla caricamento",ARIA_STOP_RECORDING:"Interrompi registrazione",ARIA_CANCEL_RECORDING:"Annulla registrazione",ARIA_INSERT_EMOJI:"Inserisci un'emoji",ARIA_PLAY_AUDIO:"riproduci audio",ARIA_PAUSE_AUDIO:"metti in pausa audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reazioni con ${e}`,ARIA_MORE_ACTIONS:"Altre azioni",ARIA_REPLYING_TO:(n,e)=>`Rispondendo a ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Esci dalla modalità risposta"}},ja:{code:"ja-JP",name:"Japanese",translation:{YESTERDAY:"昨日",TODAY:"今日",DAYS:"日前",HOURS:"時間前",MINUTES:"分前",JUST_NOW:"たった今",LOCATION:"場所",CANCEL:"キャンセル",INBOX:"受信箱",DESKTOP_NOTIFICATIONS:"ブラウザの通知",DESKTOP_NOTIFICATIONS_ERROR:"ブラウザの通知はブロックされているため、ブラウザの通知を有効にできません。設定を確認するか、別のブラウザを使用してください。",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} デモ通知`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"ブラウザのタブを開いたままにしておくと、誰かがあなたに話しかけたときにこのポップアップが表示されます。",SEND_BUTTON_TEXT:"送信",ENTRYBOX_TEXT_LIMIT:"許可されているのは10.000文字までです。",ENTRYBOX_PLACEHOLDER:"メッセージを入力してください",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"この会話はもうアクティブではありません。",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"あなたは読むことはできますが、メッセージを送ることはできません。",MESSAGELIST_LOADING_OLDER:"古いメッセージを読み込んでいます...",MESSAGELIST_SHOW_OLDER:"古いメッセージを表示",MESSAGELIST_NEW_MARKER:"新着",MESSAGE_SENT_VIA_EMAIL:"このメッセージはメールで送信されました",YOU_MARKER:"あなたは",UPLOAD_IN_PROGRESS:"アップロード中...",UPLOAD_SEND_FILE:"ファイル送信",UPLOAD_SHARE_LOCATION:"共有場所",UPLOAD_ERROR:"アップロード中に問題が発生しました。ファイルがサポートされていないか、大きすぎる可能性があります。",SHARE_LOCATION_ERROR:"場所を共有できません: ",LOADING:"読み込み中...",HUB_EMPTY:"あなたのチャット履歴がここに表示されます",HUB_SHOW_EARLIER:"以前のチャットを表示",INBOX_NO_CHATS_TITLE:"まだチャットがありません!",INBOX_NO_CHATS_BODY:"会話が1つ以上あると、ここに表示されます",ENABLE_TRANSLATION:"この会話を日本語に翻訳する",DISABLE_TRANSLATION:"オリジナルを表示",SEARCH_PLACEHOLDER_TEXT:"検索...",SEARCH_SEARCHING:"検索中...",SEARCH_NO_RESULTS:"結果が見つかりません",SEARCH_NO_MORE_RESULTS:"これ以上結果はありません",CHAT_NOT_FOUND:"チャットが見つかりませんでした",DELETE_MESSAGE:"メッセージを削除する",DELETION_EXPLANATION:"このメッセージを削除すると、全ての人に表示されなくなります。",EDIT_MESSAGE:"メッセージを編集する",SAVE:"上書き保存",EDITED_INDICATOR:"編集",REPLY_TO_MESSAGE:"返信する",ADD_REACTION:"リアクションを追加",AUTH_EXPIRED_OVERLAY_TITLE:"チャットセッションの有効期限が切れました",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"続けるにはページを更新してください",VOICE_MESSAGE:"ボイスメッセージ",CONTACT_INFORMATION_HIDDEN:"機密情報",LEAVE_CONVERSATION:"会話をやめる",MARK_CONVERSATION_AS_UNREAD:"未読としてマーク",STATUS_INDICATOR_ONLINE:"アクティブ",STATUS_INDICATOR_OFFLINE:"退席中",ARIA_LEAVE_SEARCH_MODE:"検索モードを終了",ARIA_SEARCH_UP:"上に検索",ARIA_SEARCH_DOWN:"下に検索",ARIA_CLOSE_CHAT_POPUP:"チャットポップアップを閉じる",ARIA_SEARCH_INSIDE_CONVERSATION:"この会話内を検索",ARIA_SEARCH:"検索",ARIA_CHAT:"チャット",ARIA_SET_PLAYBACK_SPEED:"再生速度を設定",ARIA_CANCEL_UPLOAD:"アップロードをキャンセル",ARIA_STOP_RECORDING:"録音を停止",ARIA_CANCEL_RECORDING:"録音をキャンセル",ARIA_INSERT_EMOJI:"絵文字を挿入",ARIA_PLAY_AUDIO:"音声を再生",ARIA_PAUSE_AUDIO:"音声を一時停止",ARIA_REACTION_COUNT:(n,e)=>`${n}件のリアクション(${e})`,ARIA_MORE_ACTIONS:"その他の操作",ARIA_REPLYING_TO:(n,e)=>`${n}に返信: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"返信モードを終了"}},ka:{code:"ka-GE",name:"Georgian",translation:{YESTERDAY:"გუშინ",TODAY:"დღეს",DAYS:"დღ",HOURS:"სთ",MINUTES:"წთ",JUST_NOW:"ახლა",LOCATION:"ადგილმდებარეობა",CANCEL:"გაუქმება",INBOX:"მიღებული შეტყობინება",DESKTOP_NOTIFICATIONS:"ბრაუზერის შეტყობინებები",DESKTOP_NOTIFICATIONS_ERROR:"შეუძლებელია ბრაუზერის შეტკობინებების ჩართვა. ეს ბრაუზერი ბლოკავს მათ. სცადე ცვლილება ოპციებიდან ან გამოიყენე სხვა ბრაუზერი.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} შეტყობინებების დემო ვერსია`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"თუ დატოვებ ბრაუზერის ფანჯარას გახსნილს, როცა ვიღაც მოგწერს საუბარი ამოვარდება დესკტოპზე.",SEND_BUTTON_TEXT:"გაგზავნა",ENTRYBOX_TEXT_LIMIT:"დაშვებულია მხოლოდ 10.000 სიმბოლო.",ENTRYBOX_PLACEHOLDER:"დაწერე რაღაც...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"ეს დიალოგი აღარ არის ხელმისაწვდომი.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"შეგიძლია წაიკითხო, მაგრამ ვერ გააგზავნი შეტყობინებას.",MESSAGELIST_LOADING_OLDER:"იტვირთება ძველი შეტყობინებები...",MESSAGELIST_SHOW_OLDER:"ძველი შეტყობინებების ჩვენება",MESSAGELIST_NEW_MARKER:"ახალი",MESSAGE_SENT_VIA_EMAIL:"ეს შეტყობინება გამოგზავნილია იმეილით",YOU_MARKER:"you",UPLOAD_IN_PROGRESS:"იტვირთება...",UPLOAD_SEND_FILE:"ფაილის გაგზავნა",UPLOAD_SHARE_LOCATION:"ადგილმდებარეობის გაზიარება",UPLOAD_ERROR:"პრობლემაა ატვირთვისას. ფაილის შესაძლოა არის არათავსებადი ან ძალიან დიდი.",SHARE_LOCATION_ERROR:"შეუძლებელია ადგილმდებარეობის გაზიარება: ",LOADING:"იტვირთება...",HUB_EMPTY:"საუბრების ისტორია გამოჩნდება აქ",HUB_SHOW_EARLIER:"წინა საუბრების ნახვა",INBOX_NO_CHATS_TITLE:"ჯერ-ჯერობით არ არის საუბრები!",INBOX_NO_CHATS_BODY:"უკვე დასრულებული საუბარები გამოჩნდება აქ",ENABLE_TRANSLATION:"თარგმნეთ ეს საუბარი ინგლისურად",DISABLE_TRANSLATION:"ორიგინალის ჩვენება",SEARCH_PLACEHOLDER_TEXT:"ძიება...",SEARCH_SEARCHING:"მიმდინარეობს ძიება...",SEARCH_NO_RESULTS:"შედეგები ვერ ქართველი",SEARCH_NO_MORE_RESULTS:"სხვა შედეგი ვერ მოიძებნა",CHAT_NOT_FOUND:"ჩატი ვერ მოიძებნა",DELETE_MESSAGE:"შეტყობინების წაშლა ",DELETION_EXPLANATION:"თუ ამ შეტყობინებას წაშლით, ის ყველასთვის გაქრება.",EDIT_MESSAGE:"შეტყობინების რედაქტირება",SAVE:"შენახვა",EDITED_INDICATOR:"რედაქტირებულია",REPLY_TO_MESSAGE:"პასუხის გაცემა",ADD_REACTION:"დაამატეთ რეაქცია",AUTH_EXPIRED_OVERLAY_TITLE:"თქვენი ჩეთის სესიის ვადა ამოიწურა",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"განაახლეთ გვერდი გასაგრძელებლად",VOICE_MESSAGE:"ხმოვანი შეტყობინება",LEAVE_CONVERSATION:"საუბრის დატოვება",MARK_CONVERSATION_AS_UNREAD:"წაუკითხავად მონიშვნა",STATUS_INDICATOR_ONLINE:"აქტიური",STATUS_INDICATOR_OFFLINE:"გამორთული",CONTACT_INFORMATION_HIDDEN:"ფარული ინფორმაცია",ARIA_LEAVE_SEARCH_MODE:"ძიების რეჟიმიდან გასვლა",ARIA_SEARCH_UP:"ძიება ზემოთ",ARIA_SEARCH_DOWN:"ძიება ქვემოთ",ARIA_CLOSE_CHAT_POPUP:"ჩეთის ფანჯრის დახურვა",ARIA_SEARCH_INSIDE_CONVERSATION:"ძიება ამ საუბარში",ARIA_SEARCH:"ძიება",ARIA_CHAT:"ჩეთი",ARIA_SET_PLAYBACK_SPEED:"გადახვევის სიჩქარის დაყენება",ARIA_CANCEL_UPLOAD:"ატვირთვის გაუქმება",ARIA_STOP_RECORDING:"ჩაწერის შეჩერება",ARIA_CANCEL_RECORDING:"ჩაწერის გაუქმება",ARIA_INSERT_EMOJI:"ემოჯის ჩასმა",ARIA_PLAY_AUDIO:"აუდიოს დაკვრა",ARIA_PAUSE_AUDIO:"აუდიოს შეჩერება",ARIA_REACTION_COUNT:(n,e)=>`${n} რეაქცია (${e})`,ARIA_MORE_ACTIONS:"მეტი ქმედება",ARIA_REPLYING_TO:(n,e)=>`პასუხი ${n}-ს: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"პასუხის რეჟიმიდან გასვლა"}},ko:{code:"ko-KR",name:"Korean (South Korea)",translation:{YESTERDAY:"어제",TODAY:"오늘",DAYS:"일 전",HOURS:"시간 전",MINUTES:"분 전",JUST_NOW:"방금",LOCATION:"위치",CANCEL:"취소",INBOX:"대화 목록",DESKTOP_NOTIFICATIONS:"브라우저 알림",DESKTOP_NOTIFICATIONS_ERROR:"브라우저 알림을 표시할 수 없습니다. 브라우저 설정을 확인하거나 다른 브라우저를 사용해주세요.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} 데모 알림`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"브라우저 탭을 열어 둔 상태에서 누군가 대화 할 때 이 팝업이 표시됩니다.",SEND_BUTTON_TEXT:"전송",ENTRYBOX_TEXT_LIMIT:"최대 10,000자까지 입력할 수 있습니다.",ENTRYBOX_PLACEHOLDER:"메세지를 입력하세요...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"채팅이 종료되었습니다.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"읽기만 가능하며 메시지를 보낼 수 없습니다.",MESSAGELIST_LOADING_OLDER:"이전 메시지 로드 중...",MESSAGELIST_SHOW_OLDER:"이전 메시지 표시",MESSAGELIST_NEW_MARKER:"새 메시지",MESSAGE_SENT_VIA_EMAIL:"이 메시지는 이메일을 통해 전송되었습니다.",YOU_MARKER:"나",UPLOAD_IN_PROGRESS:"업로드 중...",UPLOAD_SEND_FILE:"파일 전송",UPLOAD_SHARE_LOCATION:"위치 공유",UPLOAD_ERROR:"업로드가 실패했습니다. 파일이 지원되지 않거나 너무 클 수 있습니다.",SHARE_LOCATION_ERROR:"위치를 공유 할 수 없습니다: ",LOADING:"로드 중...",HUB_EMPTY:"채팅 기록이 여기에 표시됩니다",HUB_SHOW_EARLIER:"이전 채팅보기",INBOX_NO_CHATS_TITLE:"아직 채팅이 없습니다!",INBOX_NO_CHATS_BODY:"대화가 하나 이상 있으면 여기에 표시됩니다.",ENABLE_TRANSLATION:"이 대화를 한국어로 번역",DISABLE_TRANSLATION:"원본 표시",SEARCH_PLACEHOLDER_TEXT:"검색...",SEARCH_SEARCHING:"검색 중...",SEARCH_NO_RESULTS:"검색 결과 없음",SEARCH_NO_MORE_RESULTS:"추가 검색 결과 없음",CHAT_NOT_FOUND:"대화를 찾지 못했습니다",DELETE_MESSAGE:"메시지 삭제",DELETION_EXPLANATION:"이 메시지를 삭제하면 모든 사람이 볼 수 없게 됩니다.",EDIT_MESSAGE:"메시지 편집하기",SAVE:"저장",EDITED_INDICATOR:"편집",REPLY_TO_MESSAGE:"회신",ADD_REACTION:"반응 추가",AUTH_EXPIRED_OVERLAY_TITLE:"채팅 세션이 만료되었습니다",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"계속하려면 페이지를 새로고침하세요",VOICE_MESSAGE:"음성 메시지",CONTACT_INFORMATION_HIDDEN:"숨겨진 정보",LEAVE_CONVERSATION:"대화 떠나기",MARK_CONVERSATION_AS_UNREAD:"읽지 않은 상태로 표시",STATUS_INDICATOR_ONLINE:"활성",STATUS_INDICATOR_OFFLINE:"부재중",ARIA_LEAVE_SEARCH_MODE:"검색 모드 종료",ARIA_SEARCH_UP:"위로 검색",ARIA_SEARCH_DOWN:"아래로 검색",ARIA_CLOSE_CHAT_POPUP:"채팅 팝업 닫기",ARIA_SEARCH_INSIDE_CONVERSATION:"이 대화 내 검색",ARIA_SEARCH:"검색",ARIA_CHAT:"채팅",ARIA_SET_PLAYBACK_SPEED:"재생 속도 설정",ARIA_CANCEL_UPLOAD:"업로드 취소",ARIA_STOP_RECORDING:"녹음 중지",ARIA_CANCEL_RECORDING:"녹음 취소",ARIA_INSERT_EMOJI:"이모지 삽입",ARIA_PLAY_AUDIO:"오디오 재생",ARIA_PAUSE_AUDIO:"오디오 일시 정지",ARIA_REACTION_COUNT:(n,e)=>`${n}개 반응 (${e})`,ARIA_MORE_ACTIONS:"추가 작업",ARIA_REPLYING_TO:(n,e)=>`${n}에게 답장: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"답장 모드 종료"}},nb:{code:"nb-NO",name:"Norwegian (Bokmål)",translation:{YESTERDAY:"I går",TODAY:"I dag",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"Nå",LOCATION:"Plassering",CANCEL:"Avbryt",INBOX:"Innboks",DESKTOP_NOTIFICATIONS:"Nettleservarsler",DESKTOP_NOTIFICATIONS_ERROR:"Kan ikke aktivere Nettleservarsler fordi nettleseren din aktivt blokkerer dem. Prøv å se i innstillingene eller bruke en annen nettleser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo varslinger`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Hvis du holder nettleservinduet åpent, vil du se dette varsel når noen snakker til deg.",SEND_BUTTON_TEXT:"Send",ENTRYBOX_TEXT_LIMIT:"Kun 10.000 tegn er tillatt.",ENTRYBOX_PLACEHOLDER:"Si noe...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Denne samtale er ikke lengre aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Du kan lese, men ikke sende meldinger.",MESSAGELIST_LOADING_OLDER:"Laster eldre meldinger...",MESSAGELIST_SHOW_OLDER:"Vis eldre meldinger",MESSAGELIST_NEW_MARKER:"Ny",MESSAGE_SENT_VIA_EMAIL:"Denne meldingen er sendt via e-post",YOU_MARKER:"deg",UPLOAD_IN_PROGRESS:"Laster opp...",UPLOAD_SEND_FILE:"Send fil",UPLOAD_SHARE_LOCATION:"Del din plassering",UPLOAD_ERROR:"Noe gikk galt i uplastingen. Det kan være filen ikke støttes eller for stor.",SHARE_LOCATION_ERROR:"Kan ikke dele plasseringen: ",LOADING:"Laster...",HUB_EMPTY:"Din chats historikk vil vises her",HUB_SHOW_EARLIER:"Vis tidligere chats",INBOX_NO_CHATS_TITLE:"Ingen chats enda!",INBOX_NO_CHATS_BODY:"Så snart du får en eller flere samtaler, vil de vises her.",ENABLE_TRANSLATION:"Oversett denne samtalen til norsk",DISABLE_TRANSLATION:"Vis original",SEARCH_PLACEHOLDER_TEXT:"Søk...",SEARCH_SEARCHING:"Søker...",SEARCH_NO_RESULTS:"Finner ingen resultater",SEARCH_NO_MORE_RESULTS:"Ingen flere resultater",CHAT_NOT_FOUND:"Chat ikke funnet",DELETE_MESSAGE:"Slett melding",DELETION_EXPLANATION:"Hvis du sletter denne meldingen, forsvinner den for alle.",EDIT_MESSAGE:"Rediger melding",SAVE:"Lagre",EDITED_INDICATOR:"redigert",REPLY_TO_MESSAGE:"Svar",ADD_REACTION:"Legg til reaksjon",AUTH_EXPIRED_OVERLAY_TITLE:"Chatøkten er utløpt",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Oppdater siden for å fortsette",VOICE_MESSAGE:"Lydmelding",CONTACT_INFORMATION_HIDDEN:"Skjult informasjon",LEAVE_CONVERSATION:"Forlat samtalen",MARK_CONVERSATION_AS_UNREAD:"Merk som ulest",STATUS_INDICATOR_ONLINE:"Aktiv",STATUS_INDICATOR_OFFLINE:"Borte",ARIA_LEAVE_SEARCH_MODE:"Forlat søkemodus",ARIA_SEARCH_UP:"Søk oppover",ARIA_SEARCH_DOWN:"Søk nedover",ARIA_CLOSE_CHAT_POPUP:"Lukk chatvindu",ARIA_SEARCH_INSIDE_CONVERSATION:"Søk i denne samtalen",ARIA_SEARCH:"Søk",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"angi avspillingshastighet",ARIA_CANCEL_UPLOAD:"Avbryt opplasting",ARIA_STOP_RECORDING:"Stopp opptak",ARIA_CANCEL_RECORDING:"Avbryt opptak",ARIA_INSERT_EMOJI:"Sett inn en emoji",ARIA_PLAY_AUDIO:"spill av lyd",ARIA_PAUSE_AUDIO:"pause lyd",ARIA_REACTION_COUNT:(n,e)=>`${n} reaksjoner med ${e}`,ARIA_MORE_ACTIONS:"Flere handlinger",ARIA_REPLYING_TO:(n,e)=>`Svarer til ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Avslutt svarmodus"}},nl:{code:"nl-NL",name:"Dutch",translation:{YESTERDAY:"Gisteren",TODAY:"Vandaag",DAYS:"d",HOURS:"u",MINUTES:"m",JUST_NOW:"zojuist",LOCATION:"Locatie",CANCEL:"Annuleren",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Browsermeldingen",DESKTOP_NOTIFICATIONS_ERROR:"Browsermeldingen kunnen niet geactiveerd worden omdat de browser het blokkeert. Check de instellingen van je browser of probeer een andere browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notificatie`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Als je je browser open houdt, zie je deze popup als iemand tegen je praat.",SEND_BUTTON_TEXT:"Verzenden",ENTRYBOX_TEXT_LIMIT:"Maximaal 10.000 tekens toegestaan.",ENTRYBOX_PLACEHOLDER:"Typ een bericht...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Dit gesprek is niet actief meer.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Je kunt geen berichten sturen.",MESSAGELIST_LOADING_OLDER:"Eerdere berichten laden...",MESSAGELIST_SHOW_OLDER:"Laad eerdere berichten",MESSAGELIST_NEW_MARKER:"Nieuw",MESSAGE_SENT_VIA_EMAIL:"Dit bericht is verstuurd via e-mail",YOU_MARKER:"jij",UPLOAD_IN_PROGRESS:"Uploaden...",UPLOAD_SEND_FILE:"Verzend bestand",UPLOAD_SHARE_LOCATION:"Deel locatie",UPLOAD_ERROR:"Er ging iets mis. Het bestand wordt niet ondersteund of is te groot.",SHARE_LOCATION_ERROR:"Locatie delen mislukt: ",LOADING:"Bezig met laden...",HUB_EMPTY:"Berichtengeschiedenis wordt hier weergegeven",HUB_SHOW_EARLIER:"Laat eerdere berichten zien",INBOX_NO_CHATS_TITLE:"Nog geen chats!",INBOX_NO_CHATS_BODY:"Zodra je een of meerdere conversaties hebt gehad, worden deze hier weergegeven.",ENABLE_TRANSLATION:"Vertaal dit gesprek naar het Nederlands",DISABLE_TRANSLATION:"Toon oorspronkelijk gesprek",SEARCH_PLACEHOLDER_TEXT:"Zoek...",SEARCH_SEARCHING:"Zoeken...",SEARCH_NO_RESULTS:"Geen resultaten gevonden",SEARCH_NO_MORE_RESULTS:"Niet meer resultaten",CHAT_NOT_FOUND:"Chat niet gevonden",DELETE_MESSAGE:"Bericht verwijderen",DELETION_EXPLANATION:"Als je dit bericht verwijdert, zal het voor iedereen verdwijnen.",EDIT_MESSAGE:"Bericht bewerken",SAVE:"Opslaan",EDITED_INDICATOR:"bewerkt",REPLY_TO_MESSAGE:"Beantwoorden",ADD_REACTION:"Reactie toevoegen",AUTH_EXPIRED_OVERLAY_TITLE:"Je chatsessie is verlopen",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Ververs de pagina om door te gaan",VOICE_MESSAGE:"Spraakbericht",LEAVE_CONVERSATION:"Gesprek verlaten",MARK_CONVERSATION_AS_UNREAD:"Markeren als ongelezen",STATUS_INDICATOR_ONLINE:"Online",STATUS_INDICATOR_OFFLINE:"Offline",CONTACT_INFORMATION_HIDDEN:"verborgen informatie",ARIA_LEAVE_SEARCH_MODE:"Zoekmodus verlaten",ARIA_SEARCH_UP:"Omhoog zoeken",ARIA_SEARCH_DOWN:"Omlaag zoeken",ARIA_CLOSE_CHAT_POPUP:"Chatvenster sluiten",ARIA_SEARCH_INSIDE_CONVERSATION:"Zoeken in dit gesprek",ARIA_SEARCH:"Zoeken",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"Afspeelsnelheid instellen",ARIA_CANCEL_UPLOAD:"Upload annuleren",ARIA_STOP_RECORDING:"Opname stoppen",ARIA_CANCEL_RECORDING:"Opname annuleren",ARIA_INSERT_EMOJI:"Een emoji invoegen",ARIA_PLAY_AUDIO:"Audio afspelen",ARIA_PAUSE_AUDIO:"Audio pauzeren",ARIA_REACTION_COUNT:(n,e)=>`${n} Reacties met ${e}`,ARIA_MORE_ACTIONS:"Meer acties",ARIA_REPLYING_TO:(n,e)=>`Beantwoorden aan ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Verlaat antwoordmodus"}},pl:{code:"pl-PL",name:"Polish",translation:{YESTERDAY:"Wczoraj",TODAY:"Dzisiaj",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"teraz",LOCATION:"Lokalizacja",CANCEL:"Anuluj",INBOX:"Skrzynka odbiorcza",DESKTOP_NOTIFICATIONS:"Powiadomienia",DESKTOP_NOTIFICATIONS_ERROR:"Nie można aktywować powiadomień, ponieważ twoja przeglądarka je blokuje. Proszę zmienić ustawienie lub spróbować innej przeglądarki.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} przykładowe powiadomienie`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Jeśli zostawisz tę kartę otwartą, zobaczysz takie powiadomienie, gdy ktoś napisze do Ciebie.",SEND_BUTTON_TEXT:"Wyślij",ENTRYBOX_TEXT_LIMIT:"Nie można wysyłać więcej niż 10000 znaków.",ENTRYBOX_PLACEHOLDER:"Napisz coś...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ten czat nie jest aktywny.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Możesz czytać wiadomości, ale nie możesz ich wysyłać.",MESSAGELIST_LOADING_OLDER:"Wczytuję starsze wiadomości...",MESSAGELIST_SHOW_OLDER:"Zobacz starsze wiadomości",MESSAGELIST_NEW_MARKER:"Nowe",MESSAGE_SENT_VIA_EMAIL:"Ta wiadomość została wysłana przez email.",YOU_MARKER:"ty",UPLOAD_IN_PROGRESS:"Przesyłanie...",UPLOAD_SEND_FILE:"Prześlij plik",UPLOAD_SHARE_LOCATION:"Udostępnij lokalizację",UPLOAD_ERROR:"Coś poszło nie tak. Plik może być zbyt duży lub jest nieobsługiwany.",SHARE_LOCATION_ERROR:"Nie da się udostępnić lokalizacji: ",LOADING:"Ładowanie...",HUB_EMPTY:"Twoje czaty pojawią się tutaj",HUB_SHOW_EARLIER:"Zobacz starsze czaty",INBOX_NO_CHATS_TITLE:"Brak czatów!",INBOX_NO_CHATS_BODY:"Rozpoczęte konwersacje pojawią się tutaj.",ENABLE_TRANSLATION:"Przetłumacz tę konwersację na język polski",DISABLE_TRANSLATION:"Pokaż oryginał",SEARCH_PLACEHOLDER_TEXT:"Wyszukaj...",SEARCH_SEARCHING:"Wyszukiwanie...",SEARCH_NO_RESULTS:"Nie znaleziono wyników",SEARCH_NO_MORE_RESULTS:"Nie ma innych wyników",CHAT_NOT_FOUND:"Nie znaleziono konwersacji",DELETE_MESSAGE:"Usuń wiadomość",DELETION_EXPLANATION:"Jeśli usuniesz tę wiadomość, przestanie być widoczna dla wszystkich.",EDIT_MESSAGE:"Edytuj wiadomość",SAVE:"Zapisz",EDITED_INDICATOR:"edytowano",REPLY_TO_MESSAGE:"Odpowiedz",ADD_REACTION:"Dodaj reakcję",AUTH_EXPIRED_OVERLAY_TITLE:"Twoja sesja wygasła",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Odśwież stronę, aby kontynuować",VOICE_MESSAGE:"Wiadomość głosowa",CONTACT_INFORMATION_HIDDEN:"Ukryte informacje",LEAVE_CONVERSATION:"Opuść konwersację",MARK_CONVERSATION_AS_UNREAD:"Oznacz jako nieprzeczytane",STATUS_INDICATOR_ONLINE:"Aktywny",STATUS_INDICATOR_OFFLINE:"Nieobecny",ARIA_LEAVE_SEARCH_MODE:"Wyjdź z trybu wyszukiwania",ARIA_SEARCH_UP:"Szukaj w górę",ARIA_SEARCH_DOWN:"Szukaj w dół",ARIA_CLOSE_CHAT_POPUP:"Zamknij okno czatu",ARIA_SEARCH_INSIDE_CONVERSATION:"Szukaj w tej konwersacji",ARIA_SEARCH:"Szukaj",ARIA_CHAT:"Czat",ARIA_SET_PLAYBACK_SPEED:"ustaw prędkość odtwarzania",ARIA_CANCEL_UPLOAD:"Anuluj przesyłanie",ARIA_STOP_RECORDING:"Zatrzymaj nagrywanie",ARIA_CANCEL_RECORDING:"Anuluj nagrywanie",ARIA_INSERT_EMOJI:"Wstaw emoji",ARIA_PLAY_AUDIO:"odtwórz audio",ARIA_PAUSE_AUDIO:"wstrzymaj audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reakcji z ${e}`,ARIA_MORE_ACTIONS:"Więcej akcji",ARIA_REPLYING_TO:(n,e)=>`Odpowiadanie na ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Wyjdź z trybu odpowiedzi"}},pt:{code:"pt-BR",name:"Portuguese (Brazil)",translation:{YESTERDAY:"Ontem",TODAY:"Hoje",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"agora mesmo",LOCATION:"Localização",CANCEL:"Cancelar",INBOX:"Caixa de entrada",DESKTOP_NOTIFICATIONS:"Notificações do navegador",DESKTOP_NOTIFICATIONS_ERROR:"Não é possível ativar as notificações da navegador porque seu navegador as bloqueia. Tente procurar nas configurações ou usar um navegador diferente.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} notificação de demonstração`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Se você mantiver a guia do navegador aberta, verá essa mensagem quando alguém falar com você.",SEND_BUTTON_TEXT:"Enviar",ENTRYBOX_TEXT_LIMIT:"Apenas 10.000 caracteres são permitidos.",ENTRYBOX_PLACEHOLDER:"Diga algo...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Esta conversa não está mais ativa.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Você pode ler, mas não enviar mensagens.",MESSAGELIST_LOADING_OLDER:"Carregando mensagens antigas...",MESSAGELIST_SHOW_OLDER:"Mostrar mensagens mais antigas",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Esta mensagem foi enviada via email.",YOU_MARKER:"Você",UPLOAD_IN_PROGRESS:"Carregando...",UPLOAD_SEND_FILE:"Enviar arquivo",UPLOAD_SHARE_LOCATION:"Compartilhar localização",UPLOAD_ERROR:"Algo deu errado ao fazer o upload. O arquivo pode não ter suporte ou ser muito grande.",SHARE_LOCATION_ERROR:"Não é possível compartilhar o local: ",LOADING:"Carregando...",HUB_EMPTY:"Seu histórico de conversas será exibido aqui",HUB_SHOW_EARLIER:"Mostrar conversas anteriores",INBOX_NO_CHATS_TITLE:"Ainda não há chats!",INBOX_NO_CHATS_BODY:"Depois de ter uma ou mais conversas, elas serão exibidas aqui.",ENABLE_TRANSLATION:"Traduzir esta conversa para português",DISABLE_TRANSLATION:"Ver a conversa não traduzida",SEARCH_PLACEHOLDER_TEXT:"Busca...",SEARCH_SEARCHING:"Consultando...",SEARCH_NO_RESULTS:"Resultados nao encontrados",SEARCH_NO_MORE_RESULTS:"Não há mais resultados",CHAT_NOT_FOUND:"Conversa não encontrada",DELETE_MESSAGE:"Excluir mensagem",DELETION_EXPLANATION:"Se você excluir esta mensagem, ela desaparecerá para todos.",EDIT_MESSAGE:"Editar mensagem",SAVE:"Salvar",EDITED_INDICATOR:"editada",REPLY_TO_MESSAGE:"Responder",ADD_REACTION:"Adicionar reação",AUTH_EXPIRED_OVERLAY_TITLE:"Sua sessão de chat expirou",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Atualize a página para continuar",VOICE_MESSAGE:"Mensagem de voz",LEAVE_CONVERSATION:"Sair da conversa",MARK_CONVERSATION_AS_UNREAD:"Marcar como não lida",STATUS_INDICATOR_ONLINE:"Online",STATUS_INDICATOR_OFFLINE:"Offline",CONTACT_INFORMATION_HIDDEN:"Informação oculta",ARIA_LEAVE_SEARCH_MODE:"Sair do modo de pesquisa",ARIA_SEARCH_UP:"Pesquisar para cima",ARIA_SEARCH_DOWN:"Pesquisar para baixo",ARIA_CLOSE_CHAT_POPUP:"Fechar janela de chat",ARIA_SEARCH_INSIDE_CONVERSATION:"Pesquisar nesta conversa",ARIA_SEARCH:"Pesquisar",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"definir velocidade de reprodução",ARIA_CANCEL_UPLOAD:"Cancelar envio",ARIA_STOP_RECORDING:"Parar gravação",ARIA_CANCEL_RECORDING:"Cancelar gravação",ARIA_INSERT_EMOJI:"Inserir um emoji",ARIA_PLAY_AUDIO:"reproduzir áudio",ARIA_PAUSE_AUDIO:"pausar áudio",ARIA_REACTION_COUNT:(n,e)=>`${n} reações com ${e}`,ARIA_MORE_ACTIONS:"Mais ações",ARIA_REPLYING_TO:(n,e)=>`Respondendo a ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Sair do modo de resposta"}},ro:{code:"ro-RO",name:"Romanian (Romania)",translation:{YESTERDAY:"Ieri",TODAY:"Astăzi",DAYS:"z",HOURS:"o",MINUTES:"m",JUST_NOW:"chiar acum",LOCATION:"Locație",CANCEL:"Anulare",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Notificări browser",DESKTOP_NOTIFICATIONS_ERROR:"Nu se pot activa notificări browser deoarece browserul dvs. le blochează în mod activ. Încercați să căutați în setări sau utilizând un alt browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`Notificare de debit ${n}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Dacă țineți fișa browserului deschis, veți vedea acest pop-up atunci când cineva vorbește cu dvs.",SEND_BUTTON_TEXT:"Trimiteți",ENTRYBOX_TEXT_LIMIT:"Sunt permise numai 10.000 de caractere.",ENTRYBOX_PLACEHOLDER:"Spune ceva...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Această conversație nu mai este activă.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Puteți citi, dar nu puteți trimite mesaje.",MESSAGELIST_LOADING_OLDER:"Încărcarea mesajelor mai vechi...",MESSAGELIST_SHOW_OLDER:"Afișați mesaje mai vechi",MESSAGELIST_NEW_MARKER:"Nou",MESSAGE_SENT_VIA_EMAIL:"Acest mesaj a fost trimis prin e-mail",YOU_MARKER:"voi",UPLOAD_IN_PROGRESS:"Încărcarea...",UPLOAD_SEND_FILE:"Trimiteți fișierul",UPLOAD_SHARE_LOCATION:"Distribuiți locația",UPLOAD_ERROR:"Sa încărcat ceva în mod greșit. Fișierul ar putea fi neacceptat sau prea mare.",SHARE_LOCATION_ERROR:"Nu se poate partaja locația: ",LOADING:"Încărcare...",HUB_EMPTY:"Istoricul chat-ului dvs. va apărea aici",HUB_SHOW_EARLIER:"Afișați discuțiile anterioare",INBOX_NO_CHATS_TITLE:"Încă nu vorbești!",INBOX_NO_CHATS_BODY:"După ce ați avut una sau mai multe conversații, acestea vor apărea aici.",ENABLE_TRANSLATION:"Traduceți această conversație în română",DISABLE_TRANSLATION:"Arată originalul",SEARCH_PLACEHOLDER_TEXT:"Căutare...",SEARCH_SEARCHING:"Se caută...",SEARCH_NO_RESULTS:"Nu s-au găsit rezultate",SEARCH_NO_MORE_RESULTS:"Nu mai există rezultate",CHAT_NOT_FOUND:"Conversația nu a fost găsită",DELETE_MESSAGE:"Șterge mesajul",DELETION_EXPLANATION:"Dacă ștergi acest mesaj, acesta va dispărea pentru toată lumea.",EDIT_MESSAGE:"Redactează mesajul",SAVE:"Salvare",EDITED_INDICATOR:"editat",REPLY_TO_MESSAGE:"Răspundeți",ADD_REACTION:"Adaugă o reacție",AUTH_EXPIRED_OVERLAY_TITLE:"Sesiunea dumneavoastră de chat a expirat",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Reîmprospătați pagina pentru a continua",VOICE_MESSAGE:"Mesaj vocal",CONTACT_INFORMATION_HIDDEN:"Informații ascunse",LEAVE_CONVERSATION:"Părăsește conversația",MARK_CONVERSATION_AS_UNREAD:"Marcheaza ca necitit",STATUS_INDICATOR_ONLINE:"Activ",STATUS_INDICATOR_OFFLINE:"Plecat",ARIA_LEAVE_SEARCH_MODE:"Părăsește modul de căutare",ARIA_SEARCH_UP:"Caută în sus",ARIA_SEARCH_DOWN:"Caută în jos",ARIA_CLOSE_CHAT_POPUP:"Închide fereastra de chat",ARIA_SEARCH_INSIDE_CONVERSATION:"Caută în această conversație",ARIA_SEARCH:"Caută",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"setează viteza de redare",ARIA_CANCEL_UPLOAD:"Anulează încărcarea",ARIA_STOP_RECORDING:"Oprește înregistrarea",ARIA_CANCEL_RECORDING:"Anulează înregistrarea",ARIA_INSERT_EMOJI:"Inserează un emoji",ARIA_PLAY_AUDIO:"redă audio",ARIA_PAUSE_AUDIO:"pauză audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reacții cu ${e}`,ARIA_MORE_ACTIONS:"Mai multe acțiuni",ARIA_REPLYING_TO:(n,e)=>`Răspuns la ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Părăsește modul de răspuns"}},ru:{code:"ru-RU",name:"Russian",translation:{YESTERDAY:"Вчера",TODAY:"Сегодня",DAYS:"д",HOURS:"ч",MINUTES:"м",JUST_NOW:"только что",LOCATION:"Местоположение",CANCEL:"Отмена",INBOX:"Входящие",DESKTOP_NOTIFICATIONS:"Оповещения",DESKTOP_NOTIFICATIONS_ERROR:"Невозможно включить оповещения, потому что ваш браузер активно блокирует их. Проверьте ваши настройки или попробуйте другой браузер.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} демо-оповещение`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Если вкладка вашего браузера открыта, вы увидите всплывающее окошко оповещения когда кто-то отправит вам сообщение.",SEND_BUTTON_TEXT:"Отправить",ENTRYBOX_TEXT_LIMIT:"Разрешено использовать только 10 тысяч символов.",ENTRYBOX_PLACEHOLDER:"Напишите что-нибудь...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Этот разговор больше неактивен.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Вы можете читать, но не отправлять сообщения.",MESSAGELIST_LOADING_OLDER:"Загрузка старых сообщения...",MESSAGELIST_SHOW_OLDER:"Показать старые сообщения",MESSAGELIST_NEW_MARKER:"Новые",MESSAGE_SENT_VIA_EMAIL:"Это сообщение было отправлено по электронной почте",YOU_MARKER:"вы",UPLOAD_IN_PROGRESS:"Загрузка...",UPLOAD_SEND_FILE:"Отправить файл",UPLOAD_SHARE_LOCATION:"Поделиться местоположением",UPLOAD_ERROR:"Что-то пошло не так: такой файл не поддерживается или он слишком большой.",SHARE_LOCATION_ERROR:"Не удается поделиться местоположением: ",LOADING:"Загрузка...",HUB_EMPTY:"Здесь появится ваша история чата",HUB_SHOW_EARLIER:"Показать предыдущие чаты",INBOX_NO_CHATS_TITLE:"Пока нет чатов!",INBOX_NO_CHATS_BODY:"Как только у вас будет один или несколько разговоров, они появятся здесь.",ENABLE_TRANSLATION:"Переведите этот разговор на русский",DISABLE_TRANSLATION:"Show source",SEARCH_PLACEHOLDER_TEXT:"поиск...",SEARCH_SEARCHING:"Поиск...",SEARCH_NO_RESULTS:"Результаты не найдены",SEARCH_NO_MORE_RESULTS:"Больше результатов нет",CHAT_NOT_FOUND:"Чат не найден",DELETE_MESSAGE:"Удалить сообщение",DELETION_EXPLANATION:"Если вы удалите это сообщение, оно исчезнет для всех.",EDIT_MESSAGE:"Изменить сообщение",SAVE:"сохранить",EDITED_INDICATOR:"изменено",REPLY_TO_MESSAGE:"Ответить",ADD_REACTION:"Добавить реакцию",AUTH_EXPIRED_OVERLAY_TITLE:"Срок действия вашего сеанса чата истек",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Обновите страницу, чтобы продолжить",VOICE_MESSAGE:"Голосовое сообщение",CONTACT_INFORMATION_HIDDEN:"Информация скрыта",LEAVE_CONVERSATION:"Выйти из беседы",MARK_CONVERSATION_AS_UNREAD:"Отметить как непрочитанное",STATUS_INDICATOR_ONLINE:"Активен",STATUS_INDICATOR_OFFLINE:"Не в сети",ARIA_LEAVE_SEARCH_MODE:"Выйти из режима поиска",ARIA_SEARCH_UP:"Искать вверх",ARIA_SEARCH_DOWN:"Искать вниз",ARIA_CLOSE_CHAT_POPUP:"Закрыть окно чата",ARIA_SEARCH_INSIDE_CONVERSATION:"Искать в этом разговоре",ARIA_SEARCH:"Поиск",ARIA_CHAT:"Чат",ARIA_SET_PLAYBACK_SPEED:"установить скорость воспроизведения",ARIA_CANCEL_UPLOAD:"Отменить загрузку",ARIA_STOP_RECORDING:"Остановить запись",ARIA_CANCEL_RECORDING:"Отменить запись",ARIA_INSERT_EMOJI:"Вставить эмодзи",ARIA_PLAY_AUDIO:"воспроизвести аудио",ARIA_PAUSE_AUDIO:"приостановить аудио",ARIA_REACTION_COUNT:(n,e)=>`${n} реакций с ${e}`,ARIA_MORE_ACTIONS:"Дополнительные действия",ARIA_REPLYING_TO:(n,e)=>`Ответ на ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Выйти из режима ответа"}},sq:{code:"sq-AL",name:"Albanian",translation:{YESTERDAY:"Dje",TODAY:"Sot",DAYS:"d",HOURS:"o",MINUTES:"m",JUST_NOW:"Tani",LOCATION:"Pozicion",CANCEL:"Anulo",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Njoftimet e shfletuesit",DESKTOP_NOTIFICATIONS_ERROR:"Nuk mund të aktivizohen njoftimet në shfletues sepse shfletuesi juaj i bllokon ato në mënyrë aktive. Provoni të shikoni cilësimet ose përdorni një shfletues të ndryshëm.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} njoftime në desktop`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Lënia e skedës së shfletuesit tuaj të hapur do të pop-up kur dikush flet me ju.",SEND_BUTTON_TEXT:"Dërgo",ENTRYBOX_TEXT_LIMIT:"Lejohen vetëm 10,000 karaktere",ENTRYBOX_PLACEHOLDER:"Thuaj diçka...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Kjo bisedë nuk është më aktive.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Mund të lexoni por jo të dërgoni mesazhe.",MESSAGELIST_LOADING_OLDER:"Duke ngarkuar mesazhe më të vjetra...",MESSAGELIST_SHOW_OLDER:"Trego mesazhe më të vjetra",MESSAGELIST_NEW_MARKER:"E ri",MESSAGE_SENT_VIA_EMAIL:"Ky mesazh u dërgua si email",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Ngarkim...",UPLOAD_SEND_FILE:"Dërgo datotekën",UPLOAD_SHARE_LOCATION:"Ndani lokacionin",UPLOAD_ERROR:"Na vjen keq, diçka nuk shkoi si duhet. Dosja mund të mos ket mbështetje ose mund të jetë shumë e madhe.",SHARE_LOCATION_ERROR:"Nuk mund të ndahet lokacioni: ",LOADING:"Ngarkim...",HUB_EMPTY:"Këtu do të paraqitet/ shfaqet historia e bisedës tuaj",HUB_SHOW_EARLIER:"Shfaqi bisedat e mëparshme",INBOX_NO_CHATS_TITLE:"Nuk ka biseda!",INBOX_NO_CHATS_BODY:"Pasi të keni një ose më shumë biseda, ato do të paraqiten/shfaqen këtu.",ENABLE_TRANSLATION:"Përkthejeni këtë bisedë në shqiptare",DISABLE_TRANSLATION:"Shikoni origjinalin",SEARCH_PLACEHOLDER_TEXT:"Kërko...",SEARCH_SEARCHING:"Kërko...",SEARCH_NO_RESULTS:"Nuk ka rezultate",SEARCH_NO_MORE_RESULTS:"Nuk ka më rezultate",CHAT_NOT_FOUND:"Biseda nuk u gjet",DELETE_MESSAGE:"Fshi mesazhin",DELETION_EXPLANATION:"Nëse e fshini këtë mesazh, ai do të zhduket për të gjithë.",EDIT_MESSAGE:"Redakto mesazhin",SAVE:"Ruaj",EDITED_INDICATOR:"redaktuar",REPLY_TO_MESSAGE:"Përgjigj",ADD_REACTION:"Shtoni reagimin",AUTH_EXPIRED_OVERLAY_TITLE:"Sesioni juaj i bisedës ka skaduar",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Rifresko faqen për të vazhduar",VOICE_MESSAGE:"Mesazh zanor",CONTACT_INFORMATION_HIDDEN:"informacione të fshehura",LEAVE_CONVERSATION:"Largohu nga bashkëbisedimi",MARK_CONVERSATION_AS_UNREAD:"Shëno si të palexuar",STATUS_INDICATOR_ONLINE:"Aktiv",STATUS_INDICATOR_OFFLINE:"Larg",ARIA_LEAVE_SEARCH_MODE:"Dil nga mënyra e kërkimit",ARIA_SEARCH_UP:"Kërko lart",ARIA_SEARCH_DOWN:"Kërko poshtë",ARIA_CLOSE_CHAT_POPUP:"Mbyll dritaren e bisedës",ARIA_SEARCH_INSIDE_CONVERSATION:"Kërko në këtë bisedë",ARIA_SEARCH:"Kërko",ARIA_CHAT:"Bisedë",ARIA_SET_PLAYBACK_SPEED:"vendos shpejtësinë e luajtjes",ARIA_CANCEL_UPLOAD:"Anulo ngarkimin",ARIA_STOP_RECORDING:"Ndalo regjistrimin",ARIA_CANCEL_RECORDING:"Anulo regjistrimin",ARIA_INSERT_EMOJI:"Fut një emoji",ARIA_PLAY_AUDIO:"luaj audio",ARIA_PAUSE_AUDIO:"pauzë audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reagime me ${e}`,ARIA_MORE_ACTIONS:"Më shumë veprime",ARIA_REPLYING_TO:(n,e)=>`Duke u përgjigjur ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Dil nga mënyra e përgjigjes"}},sr:{code:"sr-SP",name:"Serbian",translation:{YESTERDAY:"Juče",TODAY:"Danas",DAYS:"d",HOURS:"s",MINUTES:"m",JUST_NOW:"Upravo sad",LOCATION:"Lokacija",CANCEL:"Otkaži",INBOX:"Pretinac",DESKTOP_NOTIFICATIONS:"Browser Notifikacija",DESKTOP_NOTIFICATIONS_ERROR:"Browser notifikacije nisu omogućene jer ih vaš pregledač aktivno blokira. Pokušajte pogledati postavke ili koristiti neki drugi pregledač.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notifikacija`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ako karticu pregledača ostavite otvorenu, pojaviće se ovaj pop-up kada neko razgovara s vama.",SEND_BUTTON_TEXT:"Pošalji",ENTRYBOX_TEXT_LIMIT:"Dozvoljeno je samo 10.000 znakova.",ENTRYBOX_PLACEHOLDER:"Kaži nešto...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ovaj razgovor više nije aktivan.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Možete da čitate, ali ne i da šaljete poruke.",MESSAGELIST_LOADING_OLDER:"Učitavam starije poruke...",MESSAGELIST_SHOW_OLDER:"Prikaži starije poruke",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Ova poruka je poslana imejlom",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Učitavam...",UPLOAD_SEND_FILE:"Pošalji datoteku",UPLOAD_SHARE_LOCATION:"Podeli lokaciju",UPLOAD_ERROR:"Nažalost, nešto je pošlo krivo. Datoteka možda nije podržana ili je prevelika.",SHARE_LOCATION_ERROR:"Nije moguće podeliti lokaciju: ",LOADING:"Učitavam...",HUB_EMPTY:"Ovde će biti prikazana istorija razgovora",HUB_SHOW_EARLIER:"Prikaži ranije razgovore",INBOX_NO_CHATS_TITLE:"Nema razgovora!",INBOX_NO_CHATS_BODY:"Nakon što vodite jedan ili više razgovora, oni će se pojaviti ovde.",ENABLE_TRANSLATION:"Prevedi ovaj razgovor na srpski jezik",DISABLE_TRANSLATION:"Prikaži original",SEARCH_PLACEHOLDER_TEXT:"Pretraži...",SEARCH_SEARCHING:"Pretraživanje...",SEARCH_NO_RESULTS:"Nema rezultata",SEARCH_NO_MORE_RESULTS:"Nema više rezultata",CHAT_NOT_FOUND:"Ćaskanje nije pronađeno",DELETE_MESSAGE:"Izbriši poruku",DELETION_EXPLANATION:"Ako obrišete ovu poruku, ona neće biti vidljiva ni za koga.",EDIT_MESSAGE:"Ispravi poruku",SAVE:"Sačuvaj",EDITED_INDICATOR:"ispravljeno",REPLY_TO_MESSAGE:"Odgovorite",ADD_REACTION:"Dodaj reakciju",AUTH_EXPIRED_OVERLAY_TITLE:"Vaša sesija ćaskanja je istekla",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Osvežite stranicu da biste nastavili",VOICE_MESSAGE:"Glasovna poruka",CONTACT_INFORMATION_HIDDEN:"Sakrivene informacije",LEAVE_CONVERSATION:"Napusti razgovor",MARK_CONVERSATION_AS_UNREAD:"Označi kao nepročitanu",STATUS_INDICATOR_ONLINE:"Aktivan",STATUS_INDICATOR_OFFLINE:"Neaktivan",ARIA_LEAVE_SEARCH_MODE:"Напусти режим претраге",ARIA_SEARCH_UP:"Тражи горе",ARIA_SEARCH_DOWN:"Тражи доле",ARIA_CLOSE_CHAT_POPUP:"Затвори прозор ћаскања",ARIA_SEARCH_INSIDE_CONVERSATION:"Тражи у овом разговору",ARIA_SEARCH:"Тражи",ARIA_CHAT:"Ћаскање",ARIA_SET_PLAYBACK_SPEED:"постави брзину репродукције",ARIA_CANCEL_UPLOAD:"Откажи отпремање",ARIA_STOP_RECORDING:"Заустави снимање",ARIA_CANCEL_RECORDING:"Откажи снимање",ARIA_INSERT_EMOJI:"Уметни емоџи",ARIA_PLAY_AUDIO:"репродукуј аудио",ARIA_PAUSE_AUDIO:"паузирај аудио",ARIA_REACTION_COUNT:(n,e)=>`${n} реакција са ${e}`,ARIA_MORE_ACTIONS:"Више радњи",ARIA_REPLYING_TO:(n,e)=>`Одговарање кориснику ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Izađi iz moda odgovaranja"}},sv:{code:"sv-SE",name:"Swedish (Sweden)",translation:{YESTERDAY:"Igår",TODAY:"Idag",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"just nu",LOCATION:"Plats",CANCEL:"Avbryt",INBOX:"Inkorg",DESKTOP_NOTIFICATIONS:"Webbläsarnotiser",DESKTOP_NOTIFICATIONS_ERROR:"Kan inte aktivera webbläsarnotiser eftersom din webbläsare aktivt blockerar dem. Se över inställningarna eller använd en annan webbläsare.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demonotis`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Om du har fliken i webbläsaren öppen så kommer den här notisen visas när någon pratar med dig.",SEND_BUTTON_TEXT:"Skicka",ENTRYBOX_TEXT_LIMIT:"Max 10 000 tecken är tillåtet.",ENTRYBOX_PLACEHOLDER:"Skriv ett meddelande...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Den här konversationen är inte längre aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Du kan läsa men inte skicka meddelanden.",MESSAGELIST_LOADING_OLDER:"Läser in tidigare meddelanden...",MESSAGELIST_SHOW_OLDER:"Visa tidigare meddelanden",MESSAGELIST_NEW_MARKER:"Nytt",MESSAGE_SENT_VIA_EMAIL:"Detta meddelande skickades via e-post",YOU_MARKER:"du",UPLOAD_IN_PROGRESS:"Laddar upp...",UPLOAD_SEND_FILE:"Skicka fil",UPLOAD_SHARE_LOCATION:"Dela plats",UPLOAD_ERROR:"Något gick fel vid uppladdningen. Filen kan vara av en typ som inte stöds eller är för stor.",SHARE_LOCATION_ERROR:"Kan inte dela plats: ",LOADING:"Laddar...",HUB_EMPTY:"Din chatthistorik kommer att visas här",HUB_SHOW_EARLIER:"Visa tidigare chattar",INBOX_NO_CHATS_TITLE:"Inga chattar ännu!",INBOX_NO_CHATS_BODY:"När du har haft en eller flera konversationer kommer de att visas här.",ENABLE_TRANSLATION:"Översätt den här konversationen till svenska",DISABLE_TRANSLATION:"Visa original",SEARCH_PLACEHOLDER_TEXT:"Sök...",SEARCH_SEARCHING:"Söker...",SEARCH_NO_RESULTS:"Inga resultat hittades",SEARCH_NO_MORE_RESULTS:"Inga fler resultat",CHAT_NOT_FOUND:"Chatten hittades inte",DELETE_MESSAGE:"Radera meddelandet",DELETION_EXPLANATION:"Om du raderar det här meddelandet försvinner det för alla.",EDIT_MESSAGE:"Redigera meddelandet",SAVE:"Spara",EDITED_INDICATOR:"redigerad",REPLY_TO_MESSAGE:"Svara",ADD_REACTION:"Lägg till reaktion",AUTH_EXPIRED_OVERLAY_TITLE:"Din chatsession har gått ut",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Uppdatera sidan för att fortsätta",VOICE_MESSAGE:"Röstmeddelande",CONTACT_INFORMATION_HIDDEN:"Dold information",LEAVE_CONVERSATION:"Lämna konversationen",MARK_CONVERSATION_AS_UNREAD:"Markera som oläst",STATUS_INDICATOR_ONLINE:"Online",STATUS_INDICATOR_OFFLINE:"Offline",ARIA_LEAVE_SEARCH_MODE:"Avsluta sökläge",ARIA_SEARCH_UP:"Sök uppåt",ARIA_SEARCH_DOWN:"Sök nedåt",ARIA_CLOSE_CHAT_POPUP:"Stäng chattfönstret",ARIA_SEARCH_INSIDE_CONVERSATION:"Sök i denna konversation",ARIA_SEARCH:"Sök",ARIA_CHAT:"Chatt",ARIA_SET_PLAYBACK_SPEED:"Ställ in uppspelningshastighet",ARIA_CANCEL_UPLOAD:"Avbryt uppladdning",ARIA_STOP_RECORDING:"Stoppa inspelning",ARIA_CANCEL_RECORDING:"Avbryt inspelning",ARIA_INSERT_EMOJI:"Infoga en emoji",ARIA_PLAY_AUDIO:"Spela upp ljud",ARIA_PAUSE_AUDIO:"Pausa ljud",ARIA_REACTION_COUNT:(n,e)=>`${n} Reaktioner med ${e}`,ARIA_MORE_ACTIONS:"Fler åtgärder",ARIA_REPLYING_TO:(n,e)=>`Svarar på ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Avsluta svarsläge"}},tr:{code:"tr-TR",name:"Turkish",translation:{YESTERDAY:"Dün",TODAY:"Bugün",DAYS:"g",HOURS:"s",MINUTES:"d",JUST_NOW:"az önce",LOCATION:"Konum",CANCEL:"İptal",INBOX:"Gelen Kutusu",SEND_BUTTON_TEXT:"Gönder",ENTRYBOX_TEXT_LIMIT:"En fazla 10.000 karaktere izin veriliyor.",ENTRYBOX_PLACEHOLDER:"Bir şeyler söyle...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Bu konuşma artık aktif değil.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Mesajları okuyabilirsiniz ancak mesaj gönderemezsiniz.",MESSAGELIST_LOADING_OLDER:"Eski mesajlar yükleniyor...",MESSAGELIST_SHOW_OLDER:"Eski mesajları göster",MESSAGELIST_NEW_MARKER:"Yeni",DESKTOP_NOTIFICATIONS:"Tarayıcı bildirimleri",DESKTOP_NOTIFICATIONS_ERROR:"Tarayıcınız aktif olarak engellediğinden tarayıcı bildirimlerini etkinleştiremiyoruz. Ayarları kontrol etmeyi veya farklı bir tarayıcı kullanmayı deneyebilirsiniz.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} test bildirimi`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Eğer tarayıcınızın penceresini açık tutarsanız biri mesaj yazdığında bu bildirimi göreceksiniz.",MESSAGE_SENT_VIA_EMAIL:"Bu mesaj e-posta ile gönderilmiştir.",YOU_MARKER:"siz",UPLOAD_IN_PROGRESS:"Yükleniyor...",UPLOAD_SEND_FILE:"Dosya gönder",UPLOAD_SHARE_LOCATION:"Konum paylaş",UPLOAD_ERROR:"Yükleme sırasında bir şeyler yanlış gitti. Dosya desteklenmiyor veya izin verilenden büyük olabilir.",SHARE_LOCATION_ERROR:"Konum paylaşılamadı: ",LOADING:"Yükleniyor...",HUB_EMPTY:"Konuşma geçmişiniz burada görünecek",HUB_SHOW_EARLIER:"Önceki konuşmaları göster",INBOX_NO_CHATS_TITLE:"Henüz konuşma yok!",INBOX_NO_CHATS_BODY:"Bir veya daha fazla konuşma başlattığınız konuşmalar burada belirecek.",ENABLE_TRANSLATION:"Bu konuşmayı Türkçe'ye çevir",DISABLE_TRANSLATION:"Orijinali göster",SEARCH_PLACEHOLDER_TEXT:"Ara...",SEARCH_SEARCHING:"Arıyor...",SEARCH_NO_RESULTS:"Sonuç bulunamadı",SEARCH_NO_MORE_RESULTS:"Başka sonuç bulunamadı.",CHAT_NOT_FOUND:"Sohbet bulunamadı",DELETE_MESSAGE:"Mesajı sil",DELETION_EXPLANATION:"Bu mesajı silerseniz herkes için görünmez olacaktır.",EDIT_MESSAGE:"Mesajı düzenle",SAVE:"Kaydet",EDITED_INDICATOR:"düzenlenmiş",REPLY_TO_MESSAGE:"Yanıtla",ADD_REACTION:"Tepki ekle",AUTH_EXPIRED_OVERLAY_TITLE:"Sohbet oturumunuz sona erdi",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Devam etmek için sayfayı yenileyin",VOICE_MESSAGE:"Sesli mesaj",CONTACT_INFORMATION_HIDDEN:"Gizli bilgi",LEAVE_CONVERSATION:"Konuşmadan ayrıl",MARK_CONVERSATION_AS_UNREAD:"Okunmamış olarak işaretle",STATUS_INDICATOR_ONLINE:"Aktif",STATUS_INDICATOR_OFFLINE:"Uzakta",ARIA_LEAVE_SEARCH_MODE:"Arama modundan çık",ARIA_SEARCH_UP:"Yukarı ara",ARIA_SEARCH_DOWN:"Aşağı ara",ARIA_CLOSE_CHAT_POPUP:"Sohbet penceresini kapat",ARIA_SEARCH_INSIDE_CONVERSATION:"Bu konuşmada ara",ARIA_SEARCH:"Ara",ARIA_CHAT:"Sohbet",ARIA_SET_PLAYBACK_SPEED:"oynatma hızını ayarla",ARIA_CANCEL_UPLOAD:"Yüklemeyi iptal et",ARIA_STOP_RECORDING:"Kaydı durdur",ARIA_CANCEL_RECORDING:"Kaydı iptal et",ARIA_INSERT_EMOJI:"Emoji ekle",ARIA_PLAY_AUDIO:"sesi oynat",ARIA_PAUSE_AUDIO:"sesi duraklat",ARIA_REACTION_COUNT:(n,e)=>`${n} tepki (${e})`,ARIA_MORE_ACTIONS:"Daha fazla işlem",ARIA_REPLYING_TO:(n,e)=>`${n}'a yanıtlama: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Yanıt modundan çık"}},uk:{code:"uk-UA",name:"Ukrainian (Ukraine)",translation:{YESTERDAY:"Вчора",TODAY:"Сьогодні",DAYS:"d",HOURS:"h",MINUTES:"м",JUST_NOW:"просто зараз",LOCATION:"Місцезнаходження",CANCEL:"Скасувати",INBOX:"Вхідні",DESKTOP_NOTIFICATIONS:"Сповіщення в браузері",DESKTOP_NOTIFICATIONS_ERROR:"Неможливо ввімкнути сповіщення в браузері, оскільки ваш веб-переглядач активно їх блокує. Спробуйте переглянути налаштування або використовувати інший браузер.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`Демо-повідомлення про ${n}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Якщо ви відкриєте вкладку веб-переглядача відкритою, ви побачите це спливаюче вікно, коли хтось спілкується з вами.",SEND_BUTTON_TEXT:"Надіслати",ENTRYBOX_TEXT_LIMIT:"Дозволено лише 10 000 символів.",ENTRYBOX_PLACEHOLDER:"Скажи щось...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ця розмова більше не активна.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Ви можете читати, але не надсилати повідомлення.",MESSAGELIST_LOADING_OLDER:"Завантаження старих повідомлень...",MESSAGELIST_SHOW_OLDER:"Показати старіші повідомлення",MESSAGELIST_NEW_MARKER:"Нові",MESSAGE_SENT_VIA_EMAIL:"Це повідомлення надіслано електронною поштою",YOU_MARKER:"ти",UPLOAD_IN_PROGRESS:"Завантаження...",UPLOAD_SEND_FILE:"Надіслати файл",UPLOAD_SHARE_LOCATION:"Поділитися місцезнаходженням",UPLOAD_ERROR:"На жаль, під час завантаження щось не вдалось. Файл може бути непідтримуваним або занадто великим.",SHARE_LOCATION_ERROR:"Неможливо поділити місцезнаходження: ",LOADING:"Завантаження...",HUB_EMPTY:"Тут відобразиться ваша історія чатів",HUB_SHOW_EARLIER:"Показати попередні чати",INBOX_NO_CHATS_TITLE:"Чатів ще немає!",INBOX_NO_CHATS_BODY:"Після того, як ви проведете одну чи кілька бесід, вони з’являться тут.",ENABLE_TRANSLATION:"Перекласти цю розмову англійською",DISABLE_TRANSLATION:"Показати оригінал",SEARCH_PLACEHOLDER_TEXT:"Пошук...",SEARCH_SEARCHING:"Пошук...",SEARCH_NO_RESULTS:"Не знайдено результатів",SEARCH_NO_MORE_RESULTS:"Більше немає результатів",CHAT_NOT_FOUND:"Чат не знайдено",DELETE_MESSAGE:"Видалити повідомлення",DELETION_EXPLANATION:"Якщо ви видалите це повідомлення, воно зникне для всіх.",EDIT_MESSAGE:"Редагувати повідомлення",SAVE:"Зберегти",EDITED_INDICATOR:"відредаговано",REPLY_TO_MESSAGE:"Відповісти",ADD_REACTION:"Додати реакцію",AUTH_EXPIRED_OVERLAY_TITLE:"Ваша сесія в чаті закінчилась",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Оновіть сторінку, щоб продовжити",VOICE_MESSAGE:"Голосове повідомлення",CONTACT_INFORMATION_HIDDEN:"Прихована інформація",LEAVE_CONVERSATION:"Залишити розмову",MARK_CONVERSATION_AS_UNREAD:"Відзначити як непрочитане",STATUS_INDICATOR_ONLINE:"Активний",STATUS_INDICATOR_OFFLINE:"Відсутній",ARIA_LEAVE_SEARCH_MODE:"Вийти з режиму пошуку",ARIA_SEARCH_UP:"Шукати вгору",ARIA_SEARCH_DOWN:"Шукати вниз",ARIA_CLOSE_CHAT_POPUP:"Закрити вікно чату",ARIA_SEARCH_INSIDE_CONVERSATION:"Шукати в цій розмові",ARIA_SEARCH:"Пошук",ARIA_CHAT:"Чат",ARIA_SET_PLAYBACK_SPEED:"встановити швидкість відтворення",ARIA_CANCEL_UPLOAD:"Скасувати завантаження",ARIA_STOP_RECORDING:"Зупинити запис",ARIA_CANCEL_RECORDING:"Скасувати запис",ARIA_INSERT_EMOJI:"Вставити емодзі",ARIA_PLAY_AUDIO:"відтворити аудіо",ARIA_PAUSE_AUDIO:"призупинити аудіо",ARIA_REACTION_COUNT:(n,e)=>`${n} реакцій з ${e}`,ARIA_MORE_ACTIONS:"Більше дій",ARIA_REPLYING_TO:(n,e)=>`Відповідь на ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Вийти з режиму відповіді"}},vi:{code:"vi-VN",name:"Vietnamese",translation:{YESTERDAY:"Hôm qua",TODAY:"Hôm nay",DAYS:"ngày",HOURS:"giờ",MINUTES:"phút",JUST_NOW:"vừa xong",LOCATION:"Địa điểm",CANCEL:"Hủy",INBOX:"Hộp thư đến",DESKTOP_NOTIFICATIONS:"Thông báo trình duyệt",DESKTOP_NOTIFICATIONS_ERROR:"Không thể bật thông báo trên trình duyệt vì trình duyệt của bạn đang tắt chức năng này. Hãy thử tìm trong cài đặt trình duyệt hoặc sử dụng một trình duyệt khác.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} thông báo thử nghiệm`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Nếu bạn giữ tab trình duyệt của bạn mở, bạn sẽ thấy cửa sổ bật lên khi ai đó nói chuyện với bạn.",SEND_BUTTON_TEXT:"Gửi",ENTRYBOX_TEXT_LIMIT:"Tối đa 10.000 ký tự.",ENTRYBOX_PLACEHOLDER:"Nói gì đó...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Cuộc hội thoại này không còn hoạt động.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Bạn có thể đọc, nhưng không thể gửi tin nhắn.",MESSAGELIST_LOADING_OLDER:"Đang tải tin nhắn cũ...",MESSAGELIST_SHOW_OLDER:"Hiển thị tin nhắn trước đó",MESSAGELIST_NEW_MARKER:"Mới",MESSAGE_SENT_VIA_EMAIL:"Tin nhắn này đã được gửi qua email",YOU_MARKER:"bạn",UPLOAD_IN_PROGRESS:"Đang tải lên...",UPLOAD_SEND_FILE:"Gửi tệp",UPLOAD_SHARE_LOCATION:"Chia sẻ vị trí",UPLOAD_ERROR:"Thật không may, quá trình tải lên không thành công. Tệp không được hỗ trợ hoặc quá lớn.",SHARE_LOCATION_ERROR:"Không thể chia sẻ vị trí: ",LOADING:"Đang tải...",HUB_EMPTY:"Lịch sử trò chuyện của bạn sẽ hiển thị ở đây",HUB_SHOW_EARLIER:"Hiển thị các cuộc trò chuyện trước đó",INBOX_NO_CHATS_TITLE:"Chưa có cuộc trò chuyện nào!",INBOX_NO_CHATS_BODY:"Khi bạn đã có một hoặc nhiều cuộc trò chuyện, chúng sẽ hiển thị ở đây.",ENABLE_TRANSLATION:"Dịch cuộc hội thoại sang Tiếng Việt",DISABLE_TRANSLATION:"Hiển thị nội dung gốc",SEARCH_PLACEHOLDER_TEXT:"TÌm kiếm...",SEARCH_SEARCHING:"Đang tìm kiếm...",SEARCH_NO_RESULTS:"Không tìm thấy kết quả nào",SEARCH_NO_MORE_RESULTS:"Không có kết quả nào khác",CHAT_NOT_FOUND:"Không tìm thấy cuộc trò chuyện",DELETE_MESSAGE:"Xóa tin nhắn",DELETION_EXPLANATION:"Nếu bạn xóa tin nhắn này, tất cả mọi người sẽ không còn thấy nó.",EDIT_MESSAGE:"Chỉnh sửa tin nhắn",SAVE:"lưu",EDITED_INDICATOR:"đã chỉnh sửa",REPLY_TO_MESSAGE:"đáp lại",ADD_REACTION:"Thêm biểu tượng cảm xúc",AUTH_EXPIRED_OVERLAY_TITLE:"Phiên trò chuyện của bạn đã hết hạn",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Hãy làm mới trang để tiếp tục",VOICE_MESSAGE:"Tin nhắn thoại",CONTACT_INFORMATION_HIDDEN:"Thông tin ẩn",LEAVE_CONVERSATION:"Thoát khỏi cuộc trò chuyện",MARK_CONVERSATION_AS_UNREAD:"Đánh dấu là chưa đọc",STATUS_INDICATOR_ONLINE:"Hoạt động",STATUS_INDICATOR_OFFLINE:"Vắng mặt",ARIA_LEAVE_SEARCH_MODE:"Thoát chế độ tìm kiếm",ARIA_SEARCH_UP:"Tìm kiếm lên trên",ARIA_SEARCH_DOWN:"Tìm kiếm xuống dưới",ARIA_CLOSE_CHAT_POPUP:"Đóng cửa sổ trò chuyện",ARIA_SEARCH_INSIDE_CONVERSATION:"Tìm kiếm trong cuộc trò chuyện này",ARIA_SEARCH:"Tìm kiếm",ARIA_CHAT:"Trò chuyện",ARIA_SET_PLAYBACK_SPEED:"đặt tốc độ phát",ARIA_CANCEL_UPLOAD:"Hủy tải lên",ARIA_STOP_RECORDING:"Dừng ghi âm",ARIA_CANCEL_RECORDING:"Hủy ghi âm",ARIA_INSERT_EMOJI:"Chèn biểu tượng cảm xúc",ARIA_PLAY_AUDIO:"phát âm thanh",ARIA_PAUSE_AUDIO:"tạm dừng âm thanh",ARIA_REACTION_COUNT:(n,e)=>`${n} phản ứng với ${e}`,ARIA_MORE_ACTIONS:"Thêm hành động",ARIA_REPLYING_TO:(n,e)=>`Đang trả lời ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Thoát chế độ trả lời"}},zh:{code:"zh-CN",name:"Chinese (Simplified)",translation:{YESTERDAY:"昨天",TODAY:"今天",DAYS:"天",HOURS:"小时",MINUTES:"分钟",JUST_NOW:"刚才",LOCATION:"地点",CANCEL:"取消",INBOX:"收件箱",DESKTOP_NOTIFICATIONS:"浏览器通知",DESKTOP_NOTIFICATIONS_ERROR:"因浏览器设置为阻止,所以无法激活浏览器提醒。请去设置里查看或者尝试其他的浏览器。",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} 演示提醒`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"只要保持浏览器开着,如果有人和你对话,将会自动弹出对话窗口。",SEND_BUTTON_TEXT:"发送",ENTRYBOX_TEXT_LIMIT:"不超过10,000个字符。",ENTRYBOX_PLACEHOLDER:"写点什么吧……",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"该对话已结束。",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"你只能阅读信息,不能发送信息。",MESSAGELIST_LOADING_OLDER:"载入之前的信息……",MESSAGELIST_SHOW_OLDER:"显示之前的信息",MESSAGELIST_NEW_MARKER:"新消息",MESSAGE_SENT_VIA_EMAIL:"该信息已通过邮件发送。",YOU_MARKER:"你",UPLOAD_IN_PROGRESS:"上传中……",UPLOAD_SEND_FILE:"发送文件",UPLOAD_SHARE_LOCATION:"分享地址",UPLOAD_ERROR:"上传出错。文件格式不支持或者太大。",SHARE_LOCATION_ERROR:"无法分享地址: ",LOADING:"正在载入……",HUB_EMPTY:"你的聊天记录将在此显示。",HUB_SHOW_EARLIER:"显示之前的聊天记录。",INBOX_NO_CHATS_TITLE:"暂无任何聊天记录!",INBOX_NO_CHATS_BODY:"如果你有一个或多个对话窗口进行中,将显示在这里。",ENABLE_TRANSLATION:"翻译至简体中文",DISABLE_TRANSLATION:"查看原文",SEARCH_PLACEHOLDER_TEXT:"搜索...",SEARCH_SEARCHING:"正在搜索...",SEARCH_NO_RESULTS:"未找到结果",SEARCH_NO_MORE_RESULTS:"无更多结果",CHAT_NOT_FOUND:"未找到“聊天”",DELETE_MESSAGE:"删除消息",DELETION_EXPLANATION:"如果您删除此消息,那么所有人都将无法再看到它。",EDIT_MESSAGE:"编辑消息",SAVE:"保存",EDITED_INDICATOR:"本消息有改动",REPLY_TO_MESSAGE:"回复",ADD_REACTION:"添加反应",AUTH_EXPIRED_OVERLAY_TITLE:"您的聊天会话已过期",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"刷新页面以继续",VOICE_MESSAGE:"语音消息",CONTACT_INFORMATION_HIDDEN:"隐藏信息",LEAVE_CONVERSATION:"离开对话",MARK_CONVERSATION_AS_UNREAD:"标记为未读",STATUS_INDICATOR_ONLINE:"活跃",STATUS_INDICATOR_OFFLINE:"离开",ARIA_LEAVE_SEARCH_MODE:"退出搜索模式",ARIA_SEARCH_UP:"向上搜索",ARIA_SEARCH_DOWN:"向下搜索",ARIA_CLOSE_CHAT_POPUP:"关闭聊天弹窗",ARIA_SEARCH_INSIDE_CONVERSATION:"在此对话中搜索",ARIA_SEARCH:"搜索",ARIA_CHAT:"聊天",ARIA_SET_PLAYBACK_SPEED:"设置播放速度",ARIA_CANCEL_UPLOAD:"取消上传",ARIA_STOP_RECORDING:"停止录音",ARIA_CANCEL_RECORDING:"取消录音",ARIA_INSERT_EMOJI:"插入表情符号",ARIA_PLAY_AUDIO:"播放音频",ARIA_PAUSE_AUDIO:"暂停音频",ARIA_REACTION_COUNT:(n,e)=>`${n}个反应(${e})`,ARIA_MORE_ACTIONS:"更多操作",ARIA_REPLYING_TO:(n,e)=>`正在回复 ${n}:${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"退出回复模式"}},zhTw:{code:"zh-TW",name:"Chinese (Traditional)",translation:{YESTERDAY:"昨天",TODAY:"昨天",DAYS:"天",HOURS:"小時",MINUTES:"分",JUST_NOW:"現在",LOCATION:"地點",CANCEL:"取消",INBOX:"收件箱",DESKTOP_NOTIFICATIONS:"瀏覽器通知",DESKTOP_NOTIFICATIONS_ERROR:"無法啟用瀏覽器通知,因為您的瀏覽器主動阻止它們。 嘗試查看設置或使用其他瀏覽器。",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} 演示通知`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"如果您持續打開瀏覽器標籤頁,當有人與您通話時,您會看到此彈出窗口。",SEND_BUTTON_TEXT:"發送",ENTRYBOX_TEXT_LIMIT:"只允許10.000個字符。",ENTRYBOX_PLACEHOLDER:"說些什麼...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"此對話不再有效。",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"您可以閱讀,但不能發送消息。",MESSAGELIST_LOADING_OLDER:"加載舊訊息...",MESSAGELIST_SHOW_OLDER:"顯示較舊的訊息",MESSAGELIST_NEW_MARKER:"新的",MESSAGE_SENT_VIA_EMAIL:"此訊息是通過電郵發送的",YOU_MARKER:"您",UPLOAD_IN_PROGRESS:"上傳中...",UPLOAD_SEND_FILE:"發送文件",UPLOAD_SHARE_LOCATION:"共享位置",UPLOAD_ERROR:"不幸的是,上傳出了問題。 該文件可能不受支持或太大。",SHARE_LOCATION_ERROR:"無法分享位置:",LOADING:"載入中...",HUB_EMPTY:"您的聊天記錄將顯示在此處",HUB_SHOW_EARLIER:"顯示早先的聊天記錄",INBOX_NO_CHATS_TITLE:"還沒聊天!",INBOX_NO_CHATS_BODY:"一旦您進行了一次或多次對話,他們就會顯示在此處。",ENABLE_TRANSLATION:"翻譯此對話至繁體中文",DISABLE_TRANSLATION:"顯示原文",SEARCH_PLACEHOLDER_TEXT:"搜尋...",SEARCH_SEARCHING:"正在搜尋...",SEARCH_NO_RESULTS:"找不到任何結果",SEARCH_NO_MORE_RESULTS:"沒有其他結果",CHAT_NOT_FOUND:"查無對話",DELETE_MESSAGE:"刪除訊息",DELETION_EXPLANATION:"您如果刪除這條訊息,所有人都將看不到它。",EDIT_MESSAGE:"編輯訊息",SAVE:"儲存",EDITED_INDICATOR:"已編輯",REPLY_TO_MESSAGE:"回覆",ADD_REACTION:"加入表情回應",AUTH_EXPIRED_OVERLAY_TITLE:"您的會話過程已過期",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"請刷新頁面以繼續",VOICE_MESSAGE:"語音訊息",CONTACT_INFORMATION_HIDDEN:"隱藏訊息",LEAVE_CONVERSATION:"離開對話",MARK_CONVERSATION_AS_UNREAD:"標記為未讀",STATUS_INDICATOR_ONLINE:"活躍",STATUS_INDICATOR_OFFLINE:"離開",ARIA_LEAVE_SEARCH_MODE:"離開搜尋模式",ARIA_SEARCH_UP:"向上搜尋",ARIA_SEARCH_DOWN:"向下搜尋",ARIA_CLOSE_CHAT_POPUP:"關閉聊天彈窗",ARIA_SEARCH_INSIDE_CONVERSATION:"在此對話中搜尋",ARIA_SEARCH:"搜尋",ARIA_CHAT:"聊天",ARIA_SET_PLAYBACK_SPEED:"設定播放速度",ARIA_CANCEL_UPLOAD:"取消上傳",ARIA_STOP_RECORDING:"停止錄音",ARIA_CANCEL_RECORDING:"取消錄音",ARIA_INSERT_EMOJI:"插入表情符號",ARIA_PLAY_AUDIO:"播放音訊",ARIA_PAUSE_AUDIO:"暫停音訊",ARIA_REACTION_COUNT:(n,e)=>`${n}個反應(${e})`,ARIA_MORE_ACTIONS:"更多操作",ARIA_REPLYING_TO:(n,e)=>`正在回覆 ${n}:${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"退出回覆模式"}}};function cp(n){const e=n.replace(/_/g,"-").toLowerCase(),t=nc[e];if(t)return{...t.translation,locale:e};const r=e.slice(0,2),i=nc[r];return i?{...i.translation,locale:r}:(zt.warn(`User locale '${n}' not supported; falling back to English.`),{...up.translation,locale:"en-US"})}const dp=()=>{const n=document.createElement("canvas");n.width=n.height=1;const e=n.getContext("2d");return e.textBaseline="top",e.font='100px "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Twemoji Mozilla","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',e.scale(.01,.01),e},rc=(n,e)=>{const t=dp();return t.fillStyle=e,t.fillText(n,0,0),t.getImageData(0,0,1,1).data},QE=n=>!n.includes("‍")||dp().measureText(n).width<160,eA=(n,e)=>{const t=[...n].join(",");return t===[...e].join(",")&&!t.startsWith("0,0,0,")};function hp(n){try{return function(e){const t=rc(e,"#000"),r=rc(e,"#fff"),i=QE(e);return t&&r&&i&&eA(t,r)}(n)}catch(e){return!0}}var gh;const pp=(gh=globalThis.window)!=null&&gh.document?function(){if(typeof window=="undefined"||window.E2E)return 16;const n={"🫩":16,"🚶‍➡️":15.1,"🫨":15,"🫠":14,"😵‍💫":13.1,"🥲":13,"🧑‍🦰":12.1,"🥻":12,"🥰":11,"🤩":5,"👱‍♀️":4,"🤣":3,"👁️‍🗨️":2,"😀":1,"😐️":.7,"😃":.6};for(const[e,t]of Object.entries(n))if(hp(e))return t}():0;class fp{constructor(e,t){this.currentUser$=pe(null),this.app$=pe(null),this.appId$=pe(null),this.extUserId$=pe(null),this.authTokenState$=pe("idle"),this.themeCustom$=pe(bu({value:void 0})),this.device$=pe({supportsEmojiPicker:!!pp,isMobile:typeof window!="undefined"&&/Mobi/i.test(window.navigator.userAgent)}),this.errors$=pe({unknownConversation:!1,unknownUser:!1,wrongAppId:!1,serverError:!1}),this.t$=pe(()=>{var s,a;const r=this.extUserId$.get(),i=this.app$.appMetadata.defaultLocale.get(),o=this.currentUser$.locale.get();return cp((a=(s=r&&o)!=null?s:i)!=null?a:"en-US")}),mr(()=>{this.appId$.set(e),this.extUserId$.set(t)})}updateThemeCustom(e){this.themeCustom$.set(bu({value:e}))}listenForErrors(e,t){this.errors$.assign({unknownConversation:!1,unknownUser:!1,wrongAppId:!1,serverError:!1});const r=e.onError(s=>{zt.error(s.message),this.errors$.serverError.set(!0)}),i=e.currentUser.subscribe(s=>{this.errors$.unknownUser.set(s===null)}),o=t&&e.conversation(t).subscribe(s=>{this.errors$.unknownConversation.set(s===null)});return()=>{r.unsubscribe(),i.unsubscribe(),o==null||o.unsubscribe()}}listenForAuthChanges(e,t){let r=!0;this.authTokenState$.peek()!=="loading"&&this.authTokenState$.set("loading"),e._authProvider.getToken().then(()=>{r&&this.authTokenState$.set("valid")});const i=e._authProvider.onTokenRefreshFailed(()=>{r&&this.authTokenState$.set(t?"invalid":"expired")});return()=>{r=!1,i()}}listenForUserAndAppChanges(e,t){let r=!0,i=null;const o=e.currentUser.subscribe(async s=>{if(r&&s&&(this.currentUser$.set(s),s.role!==i)){i=s.role;const a=await t.getApp(s.role);if(!r)return;this.app$.set(a)}});return()=>{r=!1,o.unsubscribe()}}}var Fl={};function tA(n){return String.fromCharCode(parseInt(n.slice(1),16))}Object.defineProperty(Fl,"__esModule",{value:!0});var nA=Fl.encode=function(n){return btoa(encodeURIComponent(n).replace(/%[0-9A-F]{2}/g,tA))};function rA(n){return`%${`00${n.charCodeAt(0).toString(16)}`.slice(-2)}`}Fl.decode=function(n){return decodeURIComponent(Array.from(atob(n),rA).join(""))};const iA=/[^a-zA-Z\u00C0-\u024F\u1E00-\u1EFF\u0400-\u044f\u0300-\u036e]+/,oA=n=>n.split(iA).filter(e=>e).map(e=>e[0]).join("")||n[Symbol.iterator]().next().value||"";function mp(n){const e=function(t){let r=0;for(let i=0;i<t.length;i++)r=(r<<5)-r+t.charCodeAt(i),r|=0;return Math.abs(r)}(n)%oc.length;return oc[e]}function cs(n,e){const t=e.lastIndex;let r;const i=[];for(;(r=e.exec(n))!==null;)i.push(r),r[0]===""&&(e.lastIndex+=1);return e.lastIndex=t,i}function Ma(n,e,t){let r=0;const i=[];for(const o of e)o.offset<r||(o.offset>r&&i.push(n.substring(r,o.offset)),i.push(...t(o)),r=o.offset+o.matchedText.length);return r<n.length&&i.push(n.substring(r)),i}function Ep(n){try{return new URL(n).hostname}catch(e){return}}function qi(n){const e=n.replace(/%2F/g,"/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/,"$1");return decodeURIComponent(e)}function ic(n,e){return n.localeCompare(e,void 0,{usage:"search",sensitivity:"base"})===0}const oc=["#996666","#9A6E61","#8D7662","#8E775E","#948771","#8A8360","#888D65","#6F8E63","#749378","#678975","#779E86","#639A8F","#6D92A1","#65869F","#697E9A","#736C9F","#8C6495","#956387","#B05D54","#B16D52","#AF8751","#AC8A56","#B7A458","#B5B35C","#83AA5D","#4F9D5D","#5FA777","#66B58F","#5FB3AC","#589AAF","#4E7F9E","#456CAC","#6456B7","#714AB2","#9771B5","#C154C1","#B05E81","#B04C6A","#B94E48","#AF593E","#C5994B","#B8C25D","#87AB39","#4FA83D","#40A860","#41AA78","#3AB09E","#3FC1AA","#56B4BE","#3EABBF","#4682B4","#7A58C1","#9966CC","#C54B8C","#B44668","#AE4560","#A3807B","#AB917A","#ACA586","#A8AF8E","#9EA587","#8BA690","#7DA98D","#7CB0A1","#8BA9A5","#7CA1A6","#859FAF","#8D90A1","#A397B4","#AE809E","#C08081","#BB8983","#B19461","#B5A27F","#B8B56A","#9AB973","#7AC488","#7CB7BB","#80B3C4","#788BBA","#7A89B8","#9678B6","#CB8FA9","#B57281","#C6726B","#C88A65","#C2955D","#C8B568","#B9C46A","#74C365","#6FD0C5","#6093D1","#7666C6","#D06DA1"],sA={canReplyToMessage:!1,canEditMessage:!1,canDeleteMessage:!1,canAddReaction:!1};class Ap extends fp{constructor(e,t){super(e,t),this.type="ChatboxStore",this.messageSubscription=null,this.readyForNewMessagesPromise=Promise.resolve(),this.participantSubscription=null,this.onlineSubscriptions={},this.state$=pe({extCurrentConversationId:null,editor:{isEmpty:!0,isTyping:!1,atTextLimit:!1,characterCount:0,showEmojiPicker:!1,suggestEmojiQuery:void 0,suggestMentionQuery:void 0},referencedMessageId:null,editingMessageId:null,currentConversation:null,visibility:{isInView:!1,tabFocused:!0},messages:{},participants:{},typing:{},isUserConnected:{},ephemeralMessages:{},ephemeralMessageIdMapping:{},localFileBlobUrls:{},userPermissions:()=>{const r=this.app$.role.general.get(),i=this.app$.role.permissions.get();return le.defined(r),le.defined(i),{showTypingIndicator:r.showTypingIndicators,canShareFile:r.enableFileTransfers,canShareLocation:r.enableLocation,canMention:r.enableMentions,showOnlineStatus:r.enablePresence!==!1,canSendVoiceMessage:r.enableVoiceRecording,canLeaveConversation:i.conversations.leave==="all",canMarkConversationAsUnread:i.conversations.markAsUnread==="all"}},messagePermissions:()=>{const r=this.app$.role.permissions.get();le.defined(r);const i=this.state$.userPermissions.get(),o={...sA,...i},s={canReplyToMessage:Jt(r.messages.reply,!0),canEditMessage:Jt(r.messages.edit,!0),canDeleteMessage:Jt(r.messages.delete,!0),canAddReaction:Jt(r.messages.emojiReactions,!0),...i},a={...s,canEditMessage:!1},l={canReplyToMessage:Jt(r.messages.reply,!1),canEditMessage:Jt(r.messages.edit,!1),canDeleteMessage:Jt(r.messages.delete,!1),canAddReaction:Jt(r.messages.emojiReactions,!1),...i};return{system:o,own:s,ownWithoutEditing:a,other:l,otherWithoutEditing:{...l,canEditMessage:!1}}}}),this.locale$=pe(()=>{var s,a;const r=this.extUserId$.get(),i=this.app$.appMetadata.defaultLocale.get(),o=this.currentUser$.locale.get();return(a=(s=r&&o)!=null?s:i)!=null?a:"en-US"}),this.t$=pe(()=>cp(this.locale$.get())),this.referencedMessage$=pe(()=>{const r=this.state$.extCurrentConversationId.get(),i=this.state$.referencedMessageId.get();return r&&i?this.state$.messages.child(r).lookup.child(i).get():null}),this.chatItems$=pe(()=>{var p,f;const r=this.state$.extCurrentConversationId.get();if(!r)return[];const i=this.state$.currentConversation.readUntil.get(),o=(p=this.state$.messages.child(r).state.get())!=null?p:[],s=Object.values((f=this.state$.ephemeralMessages.child(r).get())!=null?f:{}),a=s.length===0?o:s.concat(o).sort((m,E)=>E.createdAt-m.createdAt),l=a.map(m=>{const E=m.content[0],A=E==null?void 0:E.type;if(!E||A!=="file")return m;const D=E.size+","+E.filename,_=this.state$.localFileBlobUrls.child(r).child(D).url.get();return _?{...m,content:[{...E,url:_}]}:m});let u=null,c=0,d=!1;const h=[];for(const m of l){const E=new Date(m.createdAt),A=new Date(E).setHours(0,0,0,0),D=c&&A!==c,_=E.getTime()>i,S=!(!d||_||u!=null&&u.id.startsWith("ephemeral"));(S||D)&&h.push(new Fa({id:"border-before-"+m.id,isDayMarker:!!D,isReadMarker:!!S,timestamp:D?c:void 0})),h.push(m),d=_,c=A,u=m}return function(m,E){const A=[];let D=[];const _=Symbol("NO_KEY");let S=_;for(const R of m){const v=E(R);S===_||S===v?D.push(R):(A.push(D),D=[R]),S=v}return D.length!==0&&A.push(D),A}(h,m=>{var E;return m instanceof Fa?m.id:(E=m.sender)==null?void 0:E.id}).map(m=>(m.id=m.map(E=>E.id).join(","),m))}),this.mentionableUsers$=pe(()=>{const r=this.state$.extCurrentConversationId.get(),i=this.extUserId$.get();if(!r||!i)return[];const o=this.state$.participants.child(r).get();if(!o||o.length===0)return[];const s=o.map(a=>a.user);return s.sort((a,l)=>a.name.localeCompare(l.name)),function(a,l){const u=l.findIndex(c=>c.id===a);if(u>-1){const c=l[u];l.splice(u,1),l.push(c)}return l}(i,s)})}storeTyping(e,t){this.state$.typing.child(e).set(t)}messagePermissions$(e){const t=this.currentUser$.get();if(!t)throw new Error("Unreachable");const r=e.content[0];return e.sender?t.id===e.sender.id?r.type==="text"?this.state$.messagePermissions.own:this.state$.messagePermissions.ownWithoutEditing:r.type==="text"?this.state$.messagePermissions.other:this.state$.messagePermissions.otherWithoutEditing:this.state$.messagePermissions.system}storeMessages(e,t,r){mr(()=>{var l;const i=t.reduce((u,c)=>(u[c.id]=c,u),{}),o=this.state$.extCurrentConversationId.peek(),s=this.extUserId$.peek();le(s&&o),this.state$.messages.child(e).set({state:t,lookup:i,loadedAll:r});const a=this.state$.ephemeralMessages.child(e);for(const u of t){const c=this.state$.ephemeralMessageIdMapping.child(e).child(u.id).peek();c&&a.child(c).delete();const d=u.content[0];if(((l=u.sender)==null?void 0:l.id)!==s||d.type!=="file")continue;const h=d.size+","+d.filename,p=this.state$.localFileBlobUrls.child(o).child(h);if(p.fetching.peek()!==!1)continue;const f=()=>p.delete();if(d.subtype==="image"){p.fetching.set(!0);const m=document.createElement("img");m.addEventListener("load",f,{once:!0}),m.src=d.url}else if(d.subtype==="video"){p.fetching.set(!0);const m=document.createElement("video");m.addEventListener("loaddata",f,{once:!0}),m.src=d.url}else if(d.subtype==="audio"){p.fetching.set(!0);const m=document.createElement("audio");m.addEventListener("loaddata",f,{once:!0}),m.src=d.url}}})}}function Jt(n,e){return n==="all"||n==="own"&&e||n==="other"&&!e}class Fa{constructor({id:e,isDayMarker:t,isReadMarker:r,timestamp:i}){this.id=e,this.isDayMarker=t,this.isReadMarker=r,this.timestamp=t?i:void 0}}function Rt(n,e=!1){return function(t,r=!1){return t.map(i=>{if(typeof i=="string")return i;switch(i.type){case"bold":return"*"+Rt(i.children)+"*";case"italic":return"_"+Rt(i.children)+"_";case"strikethrough":return"~"+Rt(i.children)+"~";case"blockquote":return Rt(i.children).split(`
1182
+ />`}},Symbol.toStringTag,{value:"Module"})),wE=R.createContext(null),xs={didCatch:!1,error:null};class Jh extends R.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=xs}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];(t=(r=this.props).onReset)===null||t===void 0||t.call(r,{args:o,reason:"imperative-api"}),this.setState(xs)}}componentDidCatch(e,t){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,e,t)}componentDidUpdate(e,t){const{didCatch:r}=this.state,{resetKeys:i}=this.props;var o,s;r&&t.error!==null&&function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return a.length!==l.length||a.some((u,c)=>!Object.is(u,l[c]))}(e.resetKeys,i)&&((o=(s=this.props).onReset)===null||o===void 0||o.call(s,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(xs))}render(){const{children:e,fallbackRender:t,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:s}=this.state;let a=e;if(o){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof t=="function")a=t(l);else if(r)a=R.createElement(r,l);else{if(i===void 0)throw s;a=i}}return R.createElement(wE.Provider,{value:{didCatch:o,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}var Ji=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ME(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function qh(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var Zh={exports:{}},Wu={},Dr=R,FE=typeof Object.is=="function"?Object.is:function(n,e){return n===e&&(n!==0||1/n==1/e)||n!=n&&e!=e},xE=Dr.useState,PE=Dr.useEffect,BE=Dr.useLayoutEffect,HE=Dr.useDebugValue;function Ps(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!FE(n,t)}catch(r){return!0}}var UE=typeof window=="undefined"||window.document===void 0||window.document.createElement===void 0?function(n,e){return e()}:function(n,e){var t=e(),r=xE({inst:{value:t,getSnapshot:e}}),i=r[0].inst,o=r[1];return BE(function(){i.value=t,i.getSnapshot=e,Ps(i)&&o({inst:i})},[n,t,e]),PE(function(){return Ps(i)&&o({inst:i}),n(function(){Ps(i)&&o({inst:i})})},[n]),HE(t),t};Wu.useSyncExternalStore=Dr.useSyncExternalStore!==void 0?Dr.useSyncExternalStore:UE,Zh.exports=Wu;var jE=Zh.exports,Ju=!1,ka={inObserver:!1},qu=void 0,$E=()=>qu||(qu=R.createContext(null));function Zu(n){const e=jh(n);if(!R.use)throw e;R.use(e)}function Z(n,e){let t;if(ka.inObserver&&pe(n)&&!(e!=null&&e.suspense))return t=Gt(n,e),e!=null&&e.suspense&&t===void 0&&Zu(n),t;try{const r=R.useContext($E()),i=R.useMemo(()=>function(l,u){let c,d,h,p,f,m,E=0;const A=()=>{d==null||d();const{value:_,dispose:S,resubscribe:T}=Hh(p,D,l,void 0,void 0,!0);return d=S,h=T,_},D=({value:_})=>{if(u!=null&&u.peek()){const S=m;m=_,S===void 0&&jh(()=>!u.get(),()=>{const T=m;m=void 0,D({value:T})})}else{let S=l==null?void 0:l.skipCheck;if(!S){const T=A();(T!==f||!ze(T)&&T===_)&&(S=!0)}S&&(E++,c==null||c())}};return{subscribe:_=>(c=_,!d&&h&&(d=h()),()=>{d==null||d(),d=void 0}),getVersion:()=>E,run:_=>(p=_,f=A())}}(e,r),[]),{subscribe:o,getVersion:s,run:a}=i;t=a(n),jE.useSyncExternalStore(o,s,s)}catch(r){throw r}return e!=null&&e.suspense&&t===void 0&&Zu(n),t}var Qu=typeof Symbol=="function"&&Symbol.for;function Qh(n,e,t,r,i){const o=Qu?Symbol.for("react.forward_ref"):typeof R.forwardRef=="function"&&R.forwardRef(f=>null).$$typeof,s=Qu?Symbol.for("react.memo"):typeof R.forwardRef=="function"&&R.memo(f=>null).$$typeof;if(n.__legend_proxied)return n;let a=!1,l=!1,u=n;s&&u.$$typeof===s&&u.type&&(l=!0,u=u.type),o&&u.$$typeof===o&&(a=!0,u=u.render);const c=r?new Set(r):void 0,d={apply(f,m,E){if(t){const A=E[0],D={},_=Object.keys(A);for(let S=0;S<_.length;S++){const T=_[S],N=A[T],I=c&&c.has(T);if(T==="children"&&(J(N)||pe(N)))D[T]=Z(N,{skipCheck:!0});else if(I||T.startsWith("$")||T.endsWith("$")){const L=I?T:T.endsWith("$")?T.slice(0,-1):T.slice(1),g=i==null?void 0:i[L],O=g&&pe(N);if(D[L]=O&&(g!=null&&g.selector)?g.selector(D,N):Z(N),O&&(g.defaultValue!==void 0&&D[L]===void 0&&(D[L]=g.defaultValue),g.handler&&g.getValue)){const k=w=>{var U;N.set(g.getValue(w)),(U=A[g.handler])==null||U.call(A,w)};D[g.handler]=R.useCallback(k,[A[g.handler],i])}I||delete D[T]}else D[T]===void 0&&(D[T]=N)}E[0]=D}return e?Z(()=>{ka.inObserver=!0;try{return Reflect.apply(f,m,E)}finally{ka.inObserver=!1}},{skipCheck:!0}):Reflect.apply(f,m,E)}},h=new Proxy(u,d);let p;return a?(p=R.forwardRef(h),p.__legend_proxied=!0):p=h,e||l?R.memo(p):p}var{findIDKey:zE,getNode:VE,optimized:YE}=ls,ec=new Map;function wa({each:n,optimized:e,item:t,itemProps:r,sortValues:i,children:o}){var s;if(!n)return null;const a=Z(()=>n.get(!e||YE));if(!t&&o){const u=R.useRef();u.current=o,t=R.useMemo(()=>{return c=({item$:d,id:h})=>u.current(d,h),Qh(c,!0);var c},[])}else if(t.$$typeof!==Symbol.for("react.memo")){let u=ec.get(t);u||(u=R.memo(t),ec.set(t,u)),t=u}if(!a)return null;const l=[];if(De(a)){const u=a[0],c=VE(n),d=a.length,h=d>0?c&&zE(u,c)||(u.id!==void 0?"id":u.key!==void 0?"key":void 0):void 0,p=J(h);for(let f=0;f<d;f++)if(a[f]){const m=a[f],E=(s=p?h(m):m[h])!=null?s:f,A=n[f],D={key:E,id:E,item$:A,item:A};l.push(R.createElement(t,r?Object.assign(D,r):D))}}else{const u=Re(a),c=u?Array.from(a.keys()):Object.keys(a);i&&c.sort((d,h)=>i(u?a.get(d):a[d],u?a.get(h):a[h],d,h));for(let d=0;d<c.length;d++){const h=c[d];if(u?a.get(h):a[h]){const p=u?n.get(h):n[h],f={key:h,id:h,item$:p,item:p};l.push(R.createElement(t,r?Object.assign(f,r):f))}}}return l}R.memo(function({children:n}){return Z(()=>Gt(Gt(n)),{skipCheck:!0})},(n,e)=>!e.scoped||n.children===e.children);var tc=new Map,nc=new Map;new Proxy({},{get(n,e){if(!n[e]){const t=tc.get(e)||e,r=R.forwardRef((i,o)=>{const s={...i};return!o||!J(o)&&Io(o)||(s.ref=o),R.createElement(t,s)});n[e]=function(i,o,s){return Qh(i,!1,!0,o,s)}(r,[],nc.get(e))}return n[e]}}),function(n){(function(e){if(Ju)return;Ju=!0;const t={value:{handler:"onChange",getValue:i=>i.target.value,defaultValue:""}},r=Object.assign({checked:{handler:"onChange",getValue:i=>i.target.checked}},t);e({binders:{input:r,textarea:t,select:t}})})(n)}(function({components:n,binders:e}){if(n)for(const t in n)tc.set(t,n[t]);if(e)for(const t in e)nc.set(t,e[t])});var GE=(n,e)=>{{const t=R.useRef({num:0});R.useEffect(()=>{var r;const{current:i}=t;i.num++;const o=()=>{i.dispose&&i.num<2&&(i.dispose(),i.dispose=void 0),i.num--};if(i.dispose!==void 0)return o;{const s=(r=n())!=null?r:null;if(s&&J(s))return i.dispose=s,()=>queueMicrotask(o)}},e)}};function ep(n){return GE(()=>{const e=n();if(!Nt(e))return e},[])}var XE=ep,{deactivateNode:KE}=ls;function ft(n,e){var t;const r=R.useRef({});r.current.value=n;const i=e?ft(e):void 0;if(!((t=r.current)!=null&&t.obs$)){const s=i?J(n)&&n.length===1?a=>(i.get(),r.current.value(a)):()=>(i.get(),Gt(r.current.value)):n;r.current.obs$=me(s)}var o;return i&&i.set(e),o=()=>{const s=r.current.obs$;if(s){const a=Fi(s);KE(a)}},ep(()=>o),r.current.obs$}function Or(n,e,t,r){let i;J(e)?i=e:Array.isArray(e)?(r=e,t=void 0):t=e,i&&Array.isArray(t)&&(r=t,t=void 0),r=r||(t==null?void 0:t.deps);const o=R.useRef({}),s=r?ft(r):void 0;o.current.selector=n,o.current.reaction=i,s&&s.set(r),XE(()=>Oi(a=>{var l;return s==null||s.get(),Gt((l=o.current)==null?void 0:l.selector,void 0,a)},a=>{var l,u;return(u=(l=o.current).reaction)==null?void 0:u.call(l,a)},t))}const[tp,Dt]=wt(),[np,xi]=wt(),[rp,NO]=wt(),[Ml,Pi]=wt(),[WE,JE]=wt(),[ip,ie]=wt(),[op,Bi]=wt(),[sp,ap]=wt(),[lp,qE]=wt(),[ZE,Fl]=wt();function wt(){const n=R.createContext(void 0);return[n,()=>{const e=R.useContext(n);return le(e!==void 0),e}]}const up={code:"en-US",name:"English (US)",translation:{YESTERDAY:"Yesterday",TODAY:"Today",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"just now",LOCATION:"Location",CANCEL:"Cancel",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Browser notifications",DESKTOP_NOTIFICATIONS_ERROR:"Can't enable browser notifications because your browser actively blocks them. Try looking in the settings or using a different browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notification`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"If you keep your browser tab open, you'll see this pop up when someone talks to you.",SEND_BUTTON_TEXT:"Send",ENTRYBOX_TEXT_LIMIT:"Only 10,000 characters are allowed.",ENTRYBOX_PLACEHOLDER:"Say something...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"This conversation is no longer active.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"You can read, but not send messages.",MESSAGELIST_LOADING_OLDER:"Loading older messages...",MESSAGELIST_SHOW_OLDER:"Show older messages",MESSAGELIST_NEW_MARKER:"New",MESSAGE_SENT_VIA_EMAIL:"This message was sent via email",YOU_MARKER:"you",UPLOAD_IN_PROGRESS:"Uploading...",UPLOAD_SEND_FILE:"Send file",UPLOAD_SHARE_LOCATION:"Share location",UPLOAD_ERROR:"Unfortunately, something went wrong uploading. The file might be unsupported or too large.",SHARE_LOCATION_ERROR:"Cannot share location: ",LOADING:"Loading...",HUB_EMPTY:"Your chat history will show up here",HUB_SHOW_EARLIER:"Show earlier chats",INBOX_NO_CHATS_TITLE:"No chats yet!",INBOX_NO_CHATS_BODY:"Once you've had one or more conversations, they will show up here.",ENABLE_TRANSLATION:"Translate this conversation to English",DISABLE_TRANSLATION:"Show original",SEARCH_PLACEHOLDER_TEXT:"Search...",SEARCH_SEARCHING:"Searching...",SEARCH_NO_RESULTS:"No results found",SEARCH_NO_MORE_RESULTS:"No more results",CHAT_NOT_FOUND:"Chat not found",DELETE_MESSAGE:"Delete message",DELETION_EXPLANATION:"If you delete this message, it will disappear for everybody.",EDIT_MESSAGE:"Edit message",SAVE:"Save",EDITED_INDICATOR:"edited",REPLY_TO_MESSAGE:"Reply",ADD_REACTION:"Add reaction",AUTH_EXPIRED_OVERLAY_TITLE:"Your chat session has expired",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Refresh the page to continue",VOICE_MESSAGE:"Voice message",LEAVE_CONVERSATION:"Leave conversation",MARK_CONVERSATION_AS_UNREAD:"Mark as unread",STATUS_INDICATOR_ONLINE:"Online",STATUS_INDICATOR_OFFLINE:"Offline",CONTACT_INFORMATION_HIDDEN:"hidden information",ARIA_LEAVE_SEARCH_MODE:"Leave search mode",ARIA_SEARCH_UP:"Search up",ARIA_SEARCH_DOWN:"Search down",ARIA_CLOSE_CHAT_POPUP:"Close the chat popup",ARIA_SEARCH_INSIDE_CONVERSATION:"Search inside this conversation",ARIA_SEARCH:"Search",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"set playback speed",ARIA_CANCEL_UPLOAD:"Cancel upload",ARIA_STOP_RECORDING:"Stop recording",ARIA_CANCEL_RECORDING:"Cancel recording",ARIA_INSERT_EMOJI:"Insert an emoji",ARIA_PLAY_AUDIO:"play audio",ARIA_PAUSE_AUDIO:"pause audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reactions with ${e}`,ARIA_MORE_ACTIONS:"More actions",ARIA_REPLYING_TO:(n,e)=>`Replying to ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Exit reply mode"}},rc={ar:{code:"ar",name:"Arabic",translation:{YESTERDAY:"الأمس",TODAY:"اليوم",DAYS:"يوم",HOURS:"ساعة",MINUTES:"دقيقة",JUST_NOW:"فقط الآن",LOCATION:"الموقع",CANCEL:"إلغاء",INBOX:"علبة الوارد",DESKTOP_NOTIFICATIONS:"إشعارات المتصفح",DESKTOP_NOTIFICATIONS_ERROR:"لا يمكن تمكين إشعارات المتصفح لأن متصفحك يمنعها بشكل نشط. جرّب البحث في الإعدادات أو استخدام متصفح آخر.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`إعلام ${n} التجريبي`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"إذا أبقيت علامة تبويب المتصفح مفتوحة ، فسترى هذا ينبثق عندما يتحدث شخص معك.",SEND_BUTTON_TEXT:"إرسال",ENTRYBOX_TEXT_LIMIT:"يُسمح فقط بـ 10.000 حرف.",ENTRYBOX_PLACEHOLDER:"قل شيئًا ...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"هذه المحادثة لم تعد نشطة.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"يمكنك القراءة ، لكن لا يمكنك إرسال الرسائل.",MESSAGELIST_LOADING_OLDER:"جارٍ تحميل الرسائل القديمة ...",MESSAGELIST_SHOW_OLDER:"عرض الرسائل الأقدم",MESSAGELIST_NEW_MARKER:"جديد",MESSAGE_SENT_VIA_EMAIL:"تم إرسال هذه الرسالة عبر البريد الإلكتروني",YOU_MARKER:"أنت",UPLOAD_IN_PROGRESS:"جارٍ التحميل ...",UPLOAD_SEND_FILE:"إرسال ملف",UPLOAD_SHARE_LOCATION:"مشاركة الموقع",UPLOAD_ERROR:"حدث خطأ ما في تحميل شيء. ربما يكون الملف غير متوافق أو كبير جدًا.",SHARE_LOCATION_ERROR:"لا يمكن مشاركة الموقع:",LOADING:"جارٍ التحميل ...",HUB_EMPTY:"سوف يظهر سجل الدردشات هنا",HUB_SHOW_EARLIER:"إظهار الدردشات السابقة",INBOX_NO_CHATS_TITLE:"لا توجد دردشات بعد!",INBOX_NO_CHATS_BODY:"بمجرد أن يكون لديك واحد أو أكثر من المحادثات ، سوف تظهر هنا.",ENABLE_TRANSLATION:"ترجم هذه المحادثة إلى العربية",DISABLE_TRANSLATION:"إظهار الأصلي",SEARCH_PLACEHOLDER_TEXT:"...بحث",SEARCH_SEARCHING:"...يتم الآن البحث",SEARCH_NO_RESULTS:"لم يتم العثور على نتائج",SEARCH_NO_MORE_RESULTS:"لا يوجد المزيد من النتائج",CHAT_NOT_FOUND:"لم يتم العثور على الدردشة",DELETE_MESSAGE:"احذف الرسالة",DELETION_EXPLANATION:"إذا قمت بحذف هذه الرسالة، فهي ستختفي للجميع.",EDIT_MESSAGE:"تعديل الرسالة",SAVE:"حفظ",EDITED_INDICATOR:"معدّلة",REPLY_TO_MESSAGE:"رد",ADD_REACTION:"أضف تفاعلاً",AUTH_EXPIRED_OVERLAY_TITLE:"انتهت جلسة الدردشة المخصصة لك",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"يُرجى إعادة تحميل الصفحة للمتابعة",VOICE_MESSAGE:"رسالة صوتية",LEAVE_CONVERSATION:"الخروج من المحادثة",MARK_CONVERSATION_AS_UNREAD:"وضع علامة غير مقروءة",STATUS_INDICATOR_ONLINE:"نشط",STATUS_INDICATOR_OFFLINE:"بعيد",CONTACT_INFORMATION_HIDDEN:"المعلومات المخفية",ARIA_LEAVE_SEARCH_MODE:"الخروج من وضع البحث",ARIA_SEARCH_UP:"البحث لأعلى",ARIA_SEARCH_DOWN:"البحث لأسفل",ARIA_CLOSE_CHAT_POPUP:"إغلاق نافذة الدردشة",ARIA_SEARCH_INSIDE_CONVERSATION:"البحث داخل هذه المحادثة",ARIA_SEARCH:"بحث",ARIA_CHAT:"دردشة",ARIA_SET_PLAYBACK_SPEED:"تعيين سرعة التشغيل",ARIA_CANCEL_UPLOAD:"إلغاء الرفع",ARIA_STOP_RECORDING:"إيقاف التسجيل",ARIA_CANCEL_RECORDING:"إلغاء التسجيل",ARIA_INSERT_EMOJI:"إدراج رمز تعبيري",ARIA_PLAY_AUDIO:"تشغيل الصوت",ARIA_PAUSE_AUDIO:"إيقاف الصوت مؤقتاً",ARIA_REACTION_COUNT:(n,e)=>`${n} تفاعل مع ${e}`,ARIA_MORE_ACTIONS:"المزيد من الإجراءات",ARIA_REPLYING_TO:(n,e)=>`الرد على ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"الخروج من وضع الرد"}},bg:{code:"bg-BG",name:"Bulgarian",translation:{YESTERDAY:"Вчера",TODAY:"Днес",DAYS:"Ден",HOURS:"Час",MINUTES:"m",JUST_NOW:"Току-що",LOCATION:"местоположението",CANCEL:"Откажи",INBOX:"Кутия",DESKTOP_NOTIFICATIONS:"Известия на браузъра",DESKTOP_NOTIFICATIONS_ERROR:"Не можете да активирате известията на браузъра, защото браузърът ви ги блокира активно. Опитайте да погледнете в настройките или да използвате друг браузър.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} демо известие`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ако държите раздела на браузъра си отворен, ще видите този изскачащ прозорец, когато някой говори с вас.",SEND_BUTTON_TEXT:"Изпрати",ENTRYBOX_TEXT_LIMIT:"Разрешени са само до 10.000 знака.",ENTRYBOX_PLACEHOLDER:"Кажете нещо...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Този ​​разговор вече не е активен.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Можете да четете, но не и да изпращате съобщения.",MESSAGELIST_LOADING_OLDER:"Зареждане на по-стари съобщения...",MESSAGELIST_SHOW_OLDER:"Показване на по-стари съобщения",MESSAGELIST_NEW_MARKER:"Нови",MESSAGE_SENT_VIA_EMAIL:"Това съобщение беше изпратено по имейл",YOU_MARKER:"Вие",UPLOAD_IN_PROGRESS:"Качване...",UPLOAD_SEND_FILE:"Изпращане на файл",UPLOAD_SHARE_LOCATION:"Споделяне на местоположението",UPLOAD_ERROR:"За съжаление нещо се обърка при качването. Файлът може да не се поддържа или е твърде голям.",SHARE_LOCATION_ERROR:"Не може да се сподели местоположението: ",LOADING:"Зареждане...",HUB_EMPTY:"Историята на вашите разговори ще се покаже тук",HUB_SHOW_EARLIER:"Показване на по-ранни чатове",INBOX_NO_CHATS_TITLE:"Все още нямате разговори!",INBOX_NO_CHATS_BODY:"След като проведете един или повече разговори, те ще се покажат тук.",ENABLE_TRANSLATION:"Преведете този разговор на български",DISABLE_TRANSLATION:"Показване на оригинал",SEARCH_PLACEHOLDER_TEXT:"Търсене...",SEARCH_SEARCHING:"Търсене...",SEARCH_NO_RESULTS:"Няма намерени резултати",SEARCH_NO_MORE_RESULTS:"Няма повече резултати",CHAT_NOT_FOUND:"Чатът не е намерен",DELETE_MESSAGE:"Изтриване на съобщение",DELETION_EXPLANATION:"Ако изтриете това съобщение, то ще изчезне за всички.",EDIT_MESSAGE:"Редактиране на съобщението",SAVE:"Запиши",EDITED_INDICATOR:"редактирано",REPLY_TO_MESSAGE:"Отговори",ADD_REACTION:"Добави реакция",AUTH_EXPIRED_OVERLAY_TITLE:"Вашата чат сесия е изтекла",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Обновете страницата, за да продължите",VOICE_MESSAGE:"Гласово съобщение",CONTACT_INFORMATION_HIDDEN:"Скрита информация",LEAVE_CONVERSATION:"Напускане на разговора",MARK_CONVERSATION_AS_UNREAD:"Маркирай като непрочетено",STATUS_INDICATOR_ONLINE:"Активен",STATUS_INDICATOR_OFFLINE:"Отсъстващ",ARIA_LEAVE_SEARCH_MODE:"Напусни режим на търсене",ARIA_SEARCH_UP:"Търси нагоре",ARIA_SEARCH_DOWN:"Търси надолу",ARIA_CLOSE_CHAT_POPUP:"Затвори прозореца за чат",ARIA_SEARCH_INSIDE_CONVERSATION:"Търси в този разговор",ARIA_SEARCH:"Търсене",ARIA_CHAT:"Чат",ARIA_SET_PLAYBACK_SPEED:"задай скорост на възпроизвеждане",ARIA_CANCEL_UPLOAD:"Отмени качване",ARIA_STOP_RECORDING:"Спри запис",ARIA_CANCEL_RECORDING:"Отмени запис",ARIA_INSERT_EMOJI:"Вмъкни emoji",ARIA_PLAY_AUDIO:"възпроизведи аудио",ARIA_PAUSE_AUDIO:"паузирай аудио",ARIA_REACTION_COUNT:(n,e)=>`${n} реакции с ${e}`,ARIA_MORE_ACTIONS:"Още действия",ARIA_REPLYING_TO:(n,e)=>`Отговор на ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Излизане от режим на отговор"}},bs:{code:"bs-BA",name:"Bosnian",translation:{YESTERDAY:"Jučer",TODAY:"Danas",DAYS:"d",HOURS:"s",MINUTES:"m",JUST_NOW:"Upravo sad",LOCATION:"Lokacija",CANCEL:"Otkaži",INBOX:"Pretinac",DESKTOP_NOTIFICATIONS:"Obavijesti preglednika",DESKTOP_NOTIFICATIONS_ERROR:"Notifikacije preglednika se ne mogu omogućiti jer ih vaš preglednik aktivno blokira. Pokušajte pregledati postavke ili koristiti drugi preglednik.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notifikacija`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ako karticu preglednika ostavite otvorenu, pojavit će se ovaj pop-up kada netko razgovara s vama.",SEND_BUTTON_TEXT:"Pošalji",ENTRYBOX_TEXT_LIMIT:"Dozvoljeno je samo 10.000 znakova.",ENTRYBOX_PLACEHOLDER:"Reci nešto...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ovaj razgovor više nije aktivan.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Možeš čitati, ali ne i slati poruke.",MESSAGELIST_LOADING_OLDER:"Učitavam starije poruke...",MESSAGELIST_SHOW_OLDER:"Prikaži starije poruke",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Ova poruka je poslana e-poštom",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Učitavam...",UPLOAD_SEND_FILE:"Pošalji datoteku",UPLOAD_SHARE_LOCATION:"Podijeli lokaciju",UPLOAD_ERROR:"Nažalost, nešto je pošlo krivo. Datoteka možda nije podržana ili je prevelika.",SHARE_LOCATION_ERROR:"Nije moguće podijeliti lokaciju: ",LOADING:"Učitavam...",HUB_EMPTY:"Ovdje će se prikazati vaša povijest razgovora",HUB_SHOW_EARLIER:"Prikaži ranije razgovore",INBOX_NO_CHATS_TITLE:"Nema razgovora!",INBOX_NO_CHATS_BODY:"Nakon što vodite jedan ili više razgovora, oni će se pojaviti ovdje.",ENABLE_TRANSLATION:"Prevedi ovaj razgovor na bosanski jezik",DISABLE_TRANSLATION:"Prikaži original",SEARCH_PLACEHOLDER_TEXT:"Pretraži...",SEARCH_SEARCHING:"Pretraživanje...",SEARCH_NO_RESULTS:"Nema rezultata",SEARCH_NO_MORE_RESULTS:"Nema više rezultata",CHAT_NOT_FOUND:"Ćaskanje nije pronađeno",DELETE_MESSAGE:"Obriši poruku",DELETION_EXPLANATION:"Ako izbrišete ovu poruku, ona će nestati za sve.",EDIT_MESSAGE:"Uredi poruku",SAVE:"Sačuvati",EDITED_INDICATOR:"uređeno",REPLY_TO_MESSAGE:"Odgovorite",ADD_REACTION:"Dodajte reakciju",AUTH_EXPIRED_OVERLAY_TITLE:"Vaša chat sesija je istekla",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Osvježite stranicu da nastavite",VOICE_MESSAGE:"Glasovna poruka",CONTACT_INFORMATION_HIDDEN:"Skrivene informacije",LEAVE_CONVERSATION:"Napusti razgovor",MARK_CONVERSATION_AS_UNREAD:"Označi kao nepročitano",STATUS_INDICATOR_ONLINE:"Aktivan",STATUS_INDICATOR_OFFLINE:"Odsutan",ARIA_LEAVE_SEARCH_MODE:"Napusti način pretrage",ARIA_SEARCH_UP:"Traži gore",ARIA_SEARCH_DOWN:"Traži dolje",ARIA_CLOSE_CHAT_POPUP:"Zatvori prozor chata",ARIA_SEARCH_INSIDE_CONVERSATION:"Traži u ovom razgovoru",ARIA_SEARCH:"Traži",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"postavi brzinu reprodukcije",ARIA_CANCEL_UPLOAD:"Otkaži učitavanje",ARIA_STOP_RECORDING:"Zaustavi snimanje",ARIA_CANCEL_RECORDING:"Otkaži snimanje",ARIA_INSERT_EMOJI:"Umetni emoji",ARIA_PLAY_AUDIO:"reproduciraj audio",ARIA_PAUSE_AUDIO:"pauziraj audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reakcija s ${e}`,ARIA_MORE_ACTIONS:"Više radnji",ARIA_REPLYING_TO:(n,e)=>`Odgovaranje korisniku ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Izađi iz moda odgovaranja"}},ca:{code:"ca-ES",name:"Catalan (ES)",translation:{YESTERDAY:"Ahir",TODAY:"Avui",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"ara mateix",LOCATION:"Ubicació",CANCEL:"Cancel·lar",INBOX:"Safata d'entrada",DESKTOP_NOTIFICATIONS:"Notificacions d'escriptori",DESKTOP_NOTIFICATIONS_ERROR:"No es poden habilitar les notificacions del navegador perquè el teu navegador les bloqueja activament. Prova de buscar a la configuració o utilitza un altre navegador.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`Notificació de demostració de ${n}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Si mantens la pestanya del navegador oberta, veuràs aquesta notificació quan algú et parli.",SEND_BUTTON_TEXT:"Enviar",ENTRYBOX_TEXT_LIMIT:"Només es permeten 10.000 caràcters.",ENTRYBOX_PLACEHOLDER:"Digues alguna cosa...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Aquesta conversa ja no està activa.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Pots llegir, però no enviar missatges.",MESSAGELIST_LOADING_OLDER:"Carregant missatges antics...",MESSAGELIST_SHOW_OLDER:"Mostrar missatges més antics",MESSAGELIST_NEW_MARKER:"Nou",MESSAGE_SENT_VIA_EMAIL:"Aquest missatge s'ha enviat per correu electrònic",YOU_MARKER:"tu",UPLOAD_IN_PROGRESS:"S'està pujant...",UPLOAD_SEND_FILE:"Enviar arxiu",UPLOAD_SHARE_LOCATION:"Compartir ubicació",UPLOAD_ERROR:"Desafortunadament, alguna cosa ha anat malament en pujar. L'arxiu pot ser no compatible o massa gran.",SHARE_LOCATION_ERROR:"No es pot compartir la ubicació: ",LOADING:"Carregant...",HUB_EMPTY:"El teu historial de xat apareixerà aquí",HUB_SHOW_EARLIER:"Mostra xats anteriors",INBOX_NO_CHATS_TITLE:"Encara no hi ha xats!",INBOX_NO_CHATS_BODY:"Un cop hagis tingut una o més converses, apareixeran aquí.",ENABLE_TRANSLATION:"Traduir aquesta conversa al català",DISABLE_TRANSLATION:"Mostrar original",SEARCH_PLACEHOLDER_TEXT:"Cerca...",SEARCH_SEARCHING:"Buscant...",SEARCH_NO_RESULTS:"No s'han trobat resultats",SEARCH_NO_MORE_RESULTS:"No hi ha més resultats",CHAT_NOT_FOUND:"Xat no trobat",DELETE_MESSAGE:"Esborrar missatge",DELETION_EXPLANATION:"Si esborres aquest missatge, desapareixerà per a tothom.",EDIT_MESSAGE:"Editar missatge",SAVE:"Desar",EDITED_INDICATOR:"editat",REPLY_TO_MESSAGE:"Respondre",ADD_REACTION:"Afegir reacció",VOICE_MESSAGE:"Missatge de veu",LEAVE_CONVERSATION:"Abandonar la conversa",MARK_CONVERSATION_AS_UNREAD:"marcar com no llegit",STATUS_INDICATOR_ONLINE:"Actiu",STATUS_INDICATOR_OFFLINE:"Absent",CONTACT_INFORMATION_HIDDEN:"informació oculta",AUTH_EXPIRED_OVERLAY_TITLE:"La teva sessió de xat ha caducat",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Actualitza la pàgina per continuar",ARIA_LEAVE_SEARCH_MODE:"Sortir del mode de cerca",ARIA_SEARCH_UP:"Cercar cap amunt",ARIA_SEARCH_DOWN:"Cercar cap avall",ARIA_CLOSE_CHAT_POPUP:"Tancar la finestra de xat",ARIA_SEARCH_INSIDE_CONVERSATION:"Cercar en aquesta conversa",ARIA_SEARCH:"Cercar",ARIA_CHAT:"Xat",ARIA_SET_PLAYBACK_SPEED:"establir velocitat de reproducció",ARIA_CANCEL_UPLOAD:"Cancel·lar la càrrega",ARIA_STOP_RECORDING:"Aturar l'enregistrament",ARIA_CANCEL_RECORDING:"Cancel·lar l'enregistrament",ARIA_INSERT_EMOJI:"Inserir un emoji",ARIA_PLAY_AUDIO:"reproduir àudio",ARIA_PAUSE_AUDIO:"pausar àudio",ARIA_REACTION_COUNT:(n,e)=>`${n} reaccions amb ${e}`,ARIA_MORE_ACTIONS:"Més accions",ARIA_REPLYING_TO:(n,e)=>`Responent a ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Sortir del mode de resposta"}},cs:{code:"cs-CZ",name:"Czech",translation:{YESTERDAY:"Včera",TODAY:"Dnes",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"právě teď",LOCATION:"Lokace",CANCEL:"Zrušit",INBOX:"Doručené",DESKTOP_NOTIFICATIONS:"Oznámení v prohlížeči",DESKTOP_NOTIFICATIONS_ERROR:"Nelze povolit notifikace prohlížeče, protože váš prohlížeč je aktivně blokuje. Zkuste se podívat na nastavení nebo zkuste použít jiný prohlížeč.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notifikace`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Pokud necháte kartu prohlížeče otevřenou, uvidíte tento popup jakmile s vámi bude někdo mluvit.",SEND_BUTTON_TEXT:"Odeslat",ENTRYBOX_TEXT_LIMIT:"Je povoleno Maximálně 10.000 znaků.",ENTRYBOX_PLACEHOLDER:"Napište něco...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Tato konverzace již není aktivní.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Můžete číst, ale nemůžete posílat zprávy.",MESSAGELIST_LOADING_OLDER:"Nahrávám starší zprávy...",MESSAGELIST_SHOW_OLDER:"Zobrazit starší zprávy",MESSAGELIST_NEW_MARKER:"Nové",MESSAGE_SENT_VIA_EMAIL:"Tato zpráva byla odeslána přes mail.",YOU_MARKER:"vy",UPLOAD_IN_PROGRESS:"Nahrávám...",UPLOAD_SEND_FILE:"Poslat soubor",UPLOAD_SHARE_LOCATION:"Sdílet pozici",UPLOAD_ERROR:"Nepodařilo se nahrát soubor. Ten je buď nepodporován a/nebo příliš velký.",SHARE_LOCATION_ERROR:"Není možné sdílet pozici: ",LOADING:"Nahrávám...",HUB_EMPTY:"Vaše historie se zde zobrazí",HUB_SHOW_EARLIER:"Zobrazit dřívější konverzace",INBOX_NO_CHATS_TITLE:"Zatím zde nejsou žádné konverzace!",INBOX_NO_CHATS_BODY:"Jakmile budete mít jednu nebo více konverzací, objeví se zde.",ENABLE_TRANSLATION:"Přeložit tuto konverzaci do češtiny",DISABLE_TRANSLATION:"Zobrazit původní",SEARCH_PLACEHOLDER_TEXT:"Hledat...",SEARCH_SEARCHING:"Hledání...",SEARCH_NO_RESULTS:"Nenašly se žádné výsledky",SEARCH_NO_MORE_RESULTS:"Žádné další výsledky",CHAT_NOT_FOUND:"Chat nenalezen",DELETE_MESSAGE:"Smazat zprávu",DELETION_EXPLANATION:"Pokud tuto zprávu smažete, zmizí pro všechny.",EDIT_MESSAGE:"Upravit zprávu",SAVE:"Uložit",EDITED_INDICATOR:"upraveno",REPLY_TO_MESSAGE:"Odpovědět",ADD_REACTION:"Reagovat",AUTH_EXPIRED_OVERLAY_TITLE:"Váš chat byl kvůli nečinnosti odpojen",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Pro pokračování obnovte stránku",VOICE_MESSAGE:"Hlasová zpráva",CONTACT_INFORMATION_HIDDEN:"Skrytá informace",LEAVE_CONVERSATION:"Opustit konverzaci",MARK_CONVERSATION_AS_UNREAD:"Označit jako nepřečtené",STATUS_INDICATOR_ONLINE:"Aktivní",STATUS_INDICATOR_OFFLINE:"Nedostupný",ARIA_LEAVE_SEARCH_MODE:"Opustit režim vyhledávání",ARIA_SEARCH_UP:"Hledat nahoru",ARIA_SEARCH_DOWN:"Hledat dolů",ARIA_CLOSE_CHAT_POPUP:"Zavřít okno chatu",ARIA_SEARCH_INSIDE_CONVERSATION:"Hledat v této konverzaci",ARIA_SEARCH:"Hledat",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"nastavit rychlost přehrávání",ARIA_CANCEL_UPLOAD:"Zrušit nahrávání",ARIA_STOP_RECORDING:"Zastavit nahrávání",ARIA_CANCEL_RECORDING:"Zrušit nahrávání",ARIA_INSERT_EMOJI:"Vložit emoji",ARIA_PLAY_AUDIO:"přehrát audio",ARIA_PAUSE_AUDIO:"pozastavit audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reakcí s ${e}`,ARIA_MORE_ACTIONS:"Další akce",ARIA_REPLYING_TO:(n,e)=>`Odpověď na ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Opustit režim odpovědi"}},da:{code:"da-DK",name:"Danish",translation:{YESTERDAY:"I går",TODAY:"I dag",DAYS:"d",HOURS:"t",MINUTES:"m",JUST_NOW:"lige nu",LOCATION:"Placering",CANCEL:"Annuller",INBOX:"Indbakke",DESKTOP_NOTIFICATIONS:"Browsermeddelelser",DESKTOP_NOTIFICATIONS_ERROR:"Kan ikke aktivere Browsermeddelelser, fordi din browser aktivt blokerer dem. Prøv at kigge i indstillingerne eller benyt en anden browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demomeddelelse`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Hvis du holder dit browser-faneblad åben, vil du se det her komme op, når nogen taler til dig.",SEND_BUTTON_TEXT:"Send",ENTRYBOX_TEXT_LIMIT:"Kun 10.000 tegn er tilladt.",ENTRYBOX_PLACEHOLDER:"Sig noget...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Denne samtale er ikke længere aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Du kan læse, men ikke sende beskeder.",MESSAGELIST_LOADING_OLDER:"Indlæser ældre beskeder...",MESSAGELIST_SHOW_OLDER:"Vis ældre beskeder",MESSAGELIST_NEW_MARKER:"Ny",MESSAGE_SENT_VIA_EMAIL:"Denne besked blev sendt via e-mail",YOU_MARKER:"dig",UPLOAD_IN_PROGRESS:"Overfører...",UPLOAD_SEND_FILE:"Send fil",UPLOAD_SHARE_LOCATION:"Del placering",UPLOAD_ERROR:"Der er sket noget forkert ved upload. Filen kan ikke understøttes eller filen er for stor.",SHARE_LOCATION_ERROR:"Kan ikke dele placering: ",LOADING:"Indlæser...",HUB_EMPTY:"Dine samtaler vises her",HUB_SHOW_EARLIER:"Vis tidligere chats",INBOX_NO_CHATS_TITLE:"Ingen chats endnu!",INBOX_NO_CHATS_BODY:"Når du har haft en eller flere samtaler, vises de her.",ENABLE_TRANSLATION:"Oversæt denne konversation til dansk",DISABLE_TRANSLATION:"Vis den oprindelige",SEARCH_PLACEHOLDER_TEXT:"Søg...",SEARCH_SEARCHING:"Søger...",SEARCH_NO_RESULTS:"Ingen resultater fundet",SEARCH_NO_MORE_RESULTS:"Ikke flere resultater",CHAT_NOT_FOUND:"Chat ikke fundet",DELETE_MESSAGE:"Slet besked",DELETION_EXPLANATION:"Hvis du sletter denne besked, vil ingen kunne se den.",EDIT_MESSAGE:"Rediger besked",SAVE:"Gem",EDITED_INDICATOR:"redigeret",REPLY_TO_MESSAGE:"Svar",ADD_REACTION:"Tilføj reaktion",AUTH_EXPIRED_OVERLAY_TITLE:"Din chatsession er udløbet",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Opdater siden for at fortsætte",VOICE_MESSAGE:"Talebesked",CONTACT_INFORMATION_HIDDEN:"Skjulte oplysninger",LEAVE_CONVERSATION:"Forlad samtale",MARK_CONVERSATION_AS_UNREAD:"Marker som ulæst",STATUS_INDICATOR_ONLINE:"Online",STATUS_INDICATOR_OFFLINE:"Offline",ARIA_LEAVE_SEARCH_MODE:"Forlad søgemodus",ARIA_SEARCH_UP:"Søg opad",ARIA_SEARCH_DOWN:"Søg nedad",ARIA_CLOSE_CHAT_POPUP:"Luk chatvindue",ARIA_SEARCH_INSIDE_CONVERSATION:"Søg i denne samtale",ARIA_SEARCH:"Søg",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"Indstil afspilningshastighed",ARIA_CANCEL_UPLOAD:"Annuller upload",ARIA_STOP_RECORDING:"Stop optagelse",ARIA_CANCEL_RECORDING:"Annuller optagelse",ARIA_INSERT_EMOJI:"Indsæt en emoji",ARIA_PLAY_AUDIO:"Afspil lyd",ARIA_PAUSE_AUDIO:"Pauser lyd",ARIA_REACTION_COUNT:(n,e)=>`${n} Reaktioner med ${e}`,ARIA_MORE_ACTIONS:"Flere handlinger",ARIA_REPLYING_TO:(n,e)=>`Svarer til ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Forlad svarstilstand"}},de:{code:"de-DE",name:"German",translation:{YESTERDAY:"Gestern",TODAY:"Heute",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"gerade jetzt",LOCATION:"Standort",CANCEL:"Abbrechen",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Browser-Benachrichtigungen",DESKTOP_NOTIFICATIONS_ERROR:"Browser-Benachrichtigungen können nicht aktiviert werden, da Ihr Browser sie aktiv blockiert. Versuchen Sie, in den Einstellungen nachzuschlagen oder einen anderen Browser zu verwenden.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} Demo-Benachrichtigung`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Wenn Sie Ihre Browser-Registerkarte geöffnet lassen, wird dies angezeigt, wenn jemand mit Ihnen spricht.",SEND_BUTTON_TEXT:"Senden",ENTRYBOX_TEXT_LIMIT:"Nur 10.000 Zeichen sind erlaubt.",ENTRYBOX_PLACEHOLDER:"Sag etwas...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Diese Konversation ist nicht mehr aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Sie können Nachrichten lesen, aber nicht senden.",MESSAGELIST_LOADING_OLDER:"Ältere Nachrichten werden geladen...",MESSAGELIST_SHOW_OLDER:"Zeige ältere Nachrichten",MESSAGELIST_NEW_MARKER:"Neu",MESSAGE_SENT_VIA_EMAIL:"Diese Nachricht wurde per E-Mail gesendet",YOU_MARKER:"du",UPLOAD_IN_PROGRESS:"Hochladen...",UPLOAD_SEND_FILE:"Datei senden",UPLOAD_SHARE_LOCATION:"Standort teilen",UPLOAD_ERROR:"Beim Hochladen ist ein Fehler aufgetreten. Die Datei ist möglicherweise nicht unterstützt oder zu groß.",SHARE_LOCATION_ERROR:"Standort kann nicht freigegeben werden: ",LOADING:"Laden...",HUB_EMPTY:"Ihr Chat-Verlauf wird hier angezeigt",HUB_SHOW_EARLIER:"Zeige frühere Chats",INBOX_NO_CHATS_TITLE:"Noch keine Chats!",INBOX_NO_CHATS_BODY:"Sobald Sie eine oder mehrere Unterhaltungen geführt haben, werden sie hier angezeigt.",ENABLE_TRANSLATION:"Dieses Gespräch auf Deutsch übersetzen",DISABLE_TRANSLATION:"Originaltext anzeigen",SEARCH_PLACEHOLDER_TEXT:"Suche...",SEARCH_SEARCHING:"Suchen...",SEARCH_NO_RESULTS:"Keine Suchergebnisse gefunden",SEARCH_NO_MORE_RESULTS:"Keine weiteren Suchergebnisse",CHAT_NOT_FOUND:"Chat nicht gefunden",DELETE_MESSAGE:"Nachricht löschen",DELETION_EXPLANATION:"Wenn Sie diese Nachricht löschen, wird sie für alle verschwinden.",EDIT_MESSAGE:"Nachricht bearbeiten",SAVE:"Speichern",EDITED_INDICATOR:"bearbeitet",REPLY_TO_MESSAGE:"Antworten",ADD_REACTION:"Reaktion hinzufügen",AUTH_EXPIRED_OVERLAY_TITLE:"Ihre Chatsitzung ist abgelaufen",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Laden Sie zum Fortfahren die Seite neu",VOICE_MESSAGE:"Sprachnachricht",CONTACT_INFORMATION_HIDDEN:"Geschützte Angaben",LEAVE_CONVERSATION:"Unterhaltung verlassen",MARK_CONVERSATION_AS_UNREAD:"als ungelesen markieren",STATUS_INDICATOR_ONLINE:"Aktiv",STATUS_INDICATOR_OFFLINE:"Abwesend",ARIA_LEAVE_SEARCH_MODE:"Suchmodus verlassen",ARIA_SEARCH_UP:"Nach oben suchen",ARIA_SEARCH_DOWN:"Nach unten suchen",ARIA_CLOSE_CHAT_POPUP:"Chat-Popup schließen",ARIA_SEARCH_INSIDE_CONVERSATION:"In dieser Unterhaltung suchen",ARIA_SEARCH:"Suchen",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"Wiedergabegeschwindigkeit einstellen",ARIA_CANCEL_UPLOAD:"Upload abbrechen",ARIA_STOP_RECORDING:"Aufnahme stoppen",ARIA_CANCEL_RECORDING:"Aufnahme abbrechen",ARIA_INSERT_EMOJI:"Emoji einfügen",ARIA_PLAY_AUDIO:"Audio abspielen",ARIA_PAUSE_AUDIO:"Audio pausieren",ARIA_REACTION_COUNT:(n,e)=>`${n} Reaktionen mit ${e}`,ARIA_MORE_ACTIONS:"Weitere Aktionen",ARIA_REPLYING_TO:(n,e)=>`Antworten an ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Antwortmodus verlassen"}},el:{code:"el-GR",name:"Greek (Greece)",translation:{YESTERDAY:"Χθές",TODAY:"Σήμερα",DAYS:"Ημέρες",HOURS:"'Ωρες",MINUTES:"Λεπτά",JUST_NOW:"Μόλις τώρα",LOCATION:"Τοποθεσία",CANCEL:"Ακύρωση",INBOX:"Εισερχόμενα",DESKTOP_NOTIFICATIONS:"Ειδοποιήσεις περιηγητή",DESKTOP_NOTIFICATIONS_ERROR:"Δεν είναι δυνατή η ενεργοποίηση των ειδοποιήσεων του προγράμματος περιήγησης, επειδή το πρόγραμμα περιήγησης τις αποκλείει ενεργά. Δοκιμάστε να τσεκάρετε τις ρυθμίσεις ή να χρησιμοποιήσετε διαφορετικό πρόγραμμα περιήγησης.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} Δοκιμαστική επίδειξη`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Αν διατηρήσετε ανοιχτή τη σελίδα του προγράμματος περιήγησης, θα δείτε αυτό το pop up (παράθυρο) όταν κάποιος σας μιλάει.",SEND_BUTTON_TEXT:"Αποστολή",ENTRYBOX_TEXT_LIMIT:"Επιτρέπονται μόνο 10.000 χαρακτήρες.",ENTRYBOX_PLACEHOLDER:"Πείτε κάτι...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Αυτή η συζήτηση δεν είναι πλέον ενεργή.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Μπορείτε να διαβάσετε αλλά δεν μπορείτε να στείλετε μηνύματα.",MESSAGELIST_LOADING_OLDER:"Φόρτωση παλαιοτέρων μηνυμάτων...",MESSAGELIST_SHOW_OLDER:"Εμφάνιση παλαιότερων μηνυμάτων",MESSAGELIST_NEW_MARKER:"Νέο",MESSAGE_SENT_VIA_EMAIL:"Αυτό το μήνυμα εστάλη μέσω ηλεκτρονικού ταχυδρομείου",YOU_MARKER:"Εσείς",UPLOAD_IN_PROGRESS:"Ανέβασμα...",UPLOAD_SEND_FILE:"Αποστολή αρχείου",UPLOAD_SHARE_LOCATION:"Κοινή χρήση τοποθεσίας",UPLOAD_ERROR:"Κάτι πήγε στραβά κατά τη φόρτωση. Το αρχείο ενδέχεται να μην υποστηρίζεται ή να είναι υπερβολικά μεγάλο.",SHARE_LOCATION_ERROR:"Δεν είναι δυνατή η χρήση κοινής τοποθεσίας: ",LOADING:"Φόρτωση...",HUB_EMPTY:"Το ιστορικό των συνομιλιών σας θα εμφανιστεί εδώ",HUB_SHOW_EARLIER:"Εμφάνιση προηγούμενων συνομιλιών",INBOX_NO_CHATS_TITLE:"Δεν υπάρχουν ακόμα συζητήσεις!",INBOX_NO_CHATS_BODY:"Μόλις έχετε μία ή περισσότερες συνομιλίες, θα εμφανιστούν εδώ.",ENABLE_TRANSLATION:"Μετάφραση αυτής της συνομιλίας στα ελληνικά",DISABLE_TRANSLATION:"Προβολή πρωτοτύπου",SEARCH_PLACEHOLDER_TEXT:"Αναζήτηση...",SEARCH_SEARCHING:"Αναζήτηση...",SEARCH_NO_RESULTS:"Δεν βρέθηκαν αποτελέσματα",SEARCH_NO_MORE_RESULTS:"Δεν υπάρχουν περισσότερα αποτελέσματα",CHAT_NOT_FOUND:"Η συνομιλία δεν βρέθηκε",DELETE_MESSAGE:"Διαγραφή μηνύματος",DELETION_EXPLANATION:"Εάν διαγράψετε αυτό το μήνυμα, θα εξαφανιστεί για όλους.",EDIT_MESSAGE:"Επεξεργασία μηνύματος",SAVE:"Αποθήκευση",EDITED_INDICATOR:"επεξεργασμένο",REPLY_TO_MESSAGE:"Απάντηση",ADD_REACTION:"Προσθήκη αντίδρασης",AUTH_EXPIRED_OVERLAY_TITLE:"Η συνεδρία της συνομιλίας σας έχει λήξει",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Ανανεώστε τη σελίδα για να συνεχίσετε",VOICE_MESSAGE:"Ηχητικό μήνυμα",CONTACT_INFORMATION_HIDDEN:"Κρυμμένες πληροφορίες",LEAVE_CONVERSATION:"Αποσυρθείτε από τη συζήτηση",MARK_CONVERSATION_AS_UNREAD:"Επισήμανση ως μη αναγνωσμένα",STATUS_INDICATOR_ONLINE:"Ενεργός",STATUS_INDICATOR_OFFLINE:"Ανενεργός",ARIA_LEAVE_SEARCH_MODE:"Αποχώρηση από τη λειτουργία αναζήτησης",ARIA_SEARCH_UP:"Αναζήτηση προς τα πάνω",ARIA_SEARCH_DOWN:"Αναζήτηση προς τα κάτω",ARIA_CLOSE_CHAT_POPUP:"Κλείσιμο παραθύρου συνομιλίας",ARIA_SEARCH_INSIDE_CONVERSATION:"Αναζήτηση σε αυτή τη συνομιλία",ARIA_SEARCH:"Αναζήτηση",ARIA_CHAT:"Συνομιλία",ARIA_SET_PLAYBACK_SPEED:"ορισμός ταχύτητας αναπαραγωγής",ARIA_CANCEL_UPLOAD:"Ακύρωση φόρτωσης",ARIA_STOP_RECORDING:"Διακοπή εγγραφής",ARIA_CANCEL_RECORDING:"Ακύρωση εγγραφής",ARIA_INSERT_EMOJI:"Εισαγωγή emoji",ARIA_PLAY_AUDIO:"αναπαραγωγή ήχου",ARIA_PAUSE_AUDIO:"παύση ήχου",ARIA_REACTION_COUNT:(n,e)=>`${n} αντιδράσεις με ${e}`,ARIA_MORE_ACTIONS:"Περισσότερες ενέργειες",ARIA_REPLYING_TO:(n,e)=>`Απάντηση στον ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Έξοδος από τη λειτουργία απάντησης"}},en:up,es:{code:"es-ES",name:"Spanish",translation:{YESTERDAY:"Ayer",TODAY:"Hoy",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"justo ahora",LOCATION:"Ubicación",CANCEL:"Cancelar",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Notificaciones del navigator",DESKTOP_NOTIFICATIONS_ERROR:"No se logró habilitar las notificaciones del navigador, comprueba que tu navegador no las esté bloqueando o intenta con otro navegador.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} notificación de prueba`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Si dejas esta pestaña abierta, verás este pop up cuando alguien te hable.",SEND_BUTTON_TEXT:"Enviar",ENTRYBOX_TEXT_LIMIT:"Sólo 10.000 caracteres permitidos.",ENTRYBOX_PLACEHOLDER:"Escribe algo...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Esta conversación ya no está activa.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Puedes leer pero no enviar mensajes.",MESSAGELIST_LOADING_OLDER:"Cargando mensajes pasados...",MESSAGELIST_SHOW_OLDER:"Ver mensajes pasados",MESSAGELIST_NEW_MARKER:"Nuevo",MESSAGE_SENT_VIA_EMAIL:"Este mensaje ha sido enviado vía email",YOU_MARKER:"tú",UPLOAD_IN_PROGRESS:"Subir...",UPLOAD_SEND_FILE:"Enviar archivo",UPLOAD_SHARE_LOCATION:"Compartir ubicación",UPLOAD_ERROR:"Ocurrió un problema subiendo el archivo. Puede que el archivo esté en un formato no soportado o que sea demasiado grande.",SHARE_LOCATION_ERROR:"No se logró compartir la ubicación: ",LOADING:"Cargando...",HUB_EMPTY:"Tu historial de conversaciones se mostrará aquí",HUB_SHOW_EARLIER:"Ver conversaciones pasadas",INBOX_NO_CHATS_TITLE:"¡Aún sin conversaciones!",INBOX_NO_CHATS_BODY:"Una vez que tengas una o más conversaciones, se mostrarán aquí.",ENABLE_TRANSLATION:"Traducir esta conversación al español",DISABLE_TRANSLATION:"Mostrar la conversación original",SEARCH_PLACEHOLDER_TEXT:"Buscar...",SEARCH_SEARCHING:"Buscando...",SEARCH_NO_RESULTS:"No se encontraron resultados",SEARCH_NO_MORE_RESULTS:"No hay más resultados",CHAT_NOT_FOUND:"Chat no encontrado",DELETE_MESSAGE:"Eliminar mensaje",DELETION_EXPLANATION:"Este mensaje desaparecerá para todos si lo borras.",EDIT_MESSAGE:"Editar mensaje",SAVE:"Guardar",EDITED_INDICATOR:"editado",REPLY_TO_MESSAGE:"Responder",ADD_REACTION:"Añadir reacción",AUTH_EXPIRED_OVERLAY_TITLE:"Su sesión de chat ha expirado",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Actualice la página para continuar",VOICE_MESSAGE:"Mensaje de voz",CONTACT_INFORMATION_HIDDEN:"Información oculta",LEAVE_CONVERSATION:"Abandonar conversación",MARK_CONVERSATION_AS_UNREAD:"Marcar como no leída",STATUS_INDICATOR_ONLINE:"Activo",STATUS_INDICATOR_OFFLINE:"Ausente",ARIA_LEAVE_SEARCH_MODE:"Salir del modo búsqueda",ARIA_SEARCH_UP:"Buscar hacia arriba",ARIA_SEARCH_DOWN:"Buscar hacia abajo",ARIA_CLOSE_CHAT_POPUP:"Cerrar la ventana de chat",ARIA_SEARCH_INSIDE_CONVERSATION:"Buscar en esta conversación",ARIA_SEARCH:"Buscar",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"establecer velocidad de reproducción",ARIA_CANCEL_UPLOAD:"Cancelar envío",ARIA_STOP_RECORDING:"Detener grabación",ARIA_CANCEL_RECORDING:"Cancelar grabación",ARIA_INSERT_EMOJI:"Insertar un emoji",ARIA_PLAY_AUDIO:"reproducir audio",ARIA_PAUSE_AUDIO:"pausar audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reacciones con ${e}`,ARIA_MORE_ACTIONS:"Más acciones",ARIA_REPLYING_TO:(n,e)=>`Respondiendo a ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Salir del modo respuesta"}},et:{code:"et-EE",name:"Estonian",translation:{YESTERDAY:"Eile",TODAY:"Täna",DAYS:"p",HOURS:"t",MINUTES:"m",JUST_NOW:"Just nüüd",LOCATION:"Asukoht",CANCEL:"Katkesta",INBOX:"Postkast",DESKTOP_NOTIFICATIONS:"Veebibrauseri teated",DESKTOP_NOTIFICATIONS_ERROR:"Töölaua teatisi ei saa lubada, kuna Teie brauser blokeerib need aktiivselt. Proovige muuta seadeid või kasutada mõnda muud brauserit.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo teavitus`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Kui hoiate oma brauseri vahekaardi lahti ja näete seda hüpikakent, siis keegi soovib Teiega rääkida.",SEND_BUTTON_TEXT:"Saada",ENTRYBOX_TEXT_LIMIT:"Ainult kuni 10.000 tähemärki on lubatud.",ENTRYBOX_PLACEHOLDER:"Kirjuta midagi...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"See vestlus ei ole enam aktiivne.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Sa saad lugeda teateid, aga mitte kirjutada.",MESSAGELIST_LOADING_OLDER:"Laen vanemaid teateid...",MESSAGELIST_SHOW_OLDER:"Näita vanemaid teateid",MESSAGELIST_NEW_MARKER:"Uus",MESSAGE_SENT_VIA_EMAIL:"See teade on saadetud e-postiga",YOU_MARKER:"Sina",UPLOAD_IN_PROGRESS:"Laen...",UPLOAD_SEND_FILE:"Saada fail",UPLOAD_SHARE_LOCATION:"Jaga faili asukohta",UPLOAD_ERROR:"Nüüd läks midagi nihu, seoses faili ülesse laadimisega. Tundmatu fail või liiga suur.",SHARE_LOCATION_ERROR:"Ei suuda jagada faili asukohta: ",LOADING:"Laen...",HUB_EMPTY:"Siin on Sinu vestluste ajalugu",HUB_SHOW_EARLIER:"Näita vanemaid vestlusi",INBOX_NO_CHATS_TITLE:"Pole ühtegi vestlust!",INBOX_NO_CHATS_BODY:"Kui Sul tekib üks või rohkem vestlust, siis on need kuvatakse siin.",ENABLE_TRANSLATION:"Tõlgi see vestlus eesti keelde",DISABLE_TRANSLATION:"Näita algteksti",SEARCH_PLACEHOLDER_TEXT:"Otsi...",SEARCH_SEARCHING:"Otsin...",SEARCH_NO_RESULTS:"Otsingu tulemused puuduvad",SEARCH_NO_MORE_RESULTS:"Rohkem tulemusi ei ole ",CHAT_NOT_FOUND:"Vestlust ei leitud",DELETE_MESSAGE:"Kustuta sõnum",DELETION_EXPLANATION:"Kui kustutate selle sõnumi, kaob see kõigi jaoks.",EDIT_MESSAGE:"Redigeeri sõnumit",SAVE:"Salvesta",EDITED_INDICATOR:"muudetud",REPLY_TO_MESSAGE:"Vasta",ADD_REACTION:"Lisa reaktsioon",AUTH_EXPIRED_OVERLAY_TITLE:"Teie vestlussessioon on lõppenud",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Jätkamiseks värskendage lehte",VOICE_MESSAGE:"Häälsõnum",CONTACT_INFORMATION_HIDDEN:"Varjatud informatsioon",LEAVE_CONVERSATION:"Lahku vestlusest",MARK_CONVERSATION_AS_UNREAD:"Märgi mitteloetuks",STATUS_INDICATOR_ONLINE:"Aktiivne",STATUS_INDICATOR_OFFLINE:"Eemal",ARIA_LEAVE_SEARCH_MODE:"Välju otsingurežiimist",ARIA_SEARCH_UP:"Otsi üles",ARIA_SEARCH_DOWN:"Otsi alla",ARIA_CLOSE_CHAT_POPUP:"Sulge vestluse aken",ARIA_SEARCH_INSIDE_CONVERSATION:"Otsi sellest vestlusest",ARIA_SEARCH:"Otsi",ARIA_CHAT:"Vestlus",ARIA_SET_PLAYBACK_SPEED:"määra taasesituse kiirus",ARIA_CANCEL_UPLOAD:"Tühista üleslaadimine",ARIA_STOP_RECORDING:"Peata salvestamine",ARIA_CANCEL_RECORDING:"Tühista salvestamine",ARIA_INSERT_EMOJI:"Sisesta emoji",ARIA_PLAY_AUDIO:"esita heli",ARIA_PAUSE_AUDIO:"pausi heli",ARIA_REACTION_COUNT:(n,e)=>`${n} reaktsiooni (${e})`,ARIA_MORE_ACTIONS:"Rohkem toiminguid",ARIA_REPLYING_TO:(n,e)=>`Vastamine kasutajale ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Välju vastamisrežiimist"}},fa:{code:"fa",name:"Persian (Farsi)",translation:{YESTERDAY:"دیروز",TODAY:"امروز",DAYS:"روز",HOURS:"ساعت",MINUTES:"دقیقه",JUST_NOW:"هم اکنون",LOCATION:"مکان",CANCEL:"لغو",INBOX:"صندوق",DESKTOP_NOTIFICATIONS:"اطلاعیه‌های مرورگر",DESKTOP_NOTIFICATIONS_ERROR:"خطا در فعال سازی اعلان های مرورگر، مرورگر شما آنها را مسدود می کند سعی کنید تنظیمات مرورگر را تغییر دهید یا از یک مرورگر دیگر استفاده کنید.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`نوتیفیکیشن دمو ${n}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"اگر صفحه ی مرورگر را باز نگهدارید این را موقعه ای که کسی با شما صحبت کند خواهید دید",SEND_BUTTON_TEXT:"بفرست",ENTRYBOX_TEXT_LIMIT:"فقط ۱۰،۰۰۰ حروف مجاز می باشد.",ENTRYBOX_PLACEHOLDER:"...چیزی بنویسید",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:".این مکالمه دیگر فعال نمی باشد",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"شما می توانید بخوانید اما نمی توانید پیام بفرستید",MESSAGELIST_LOADING_OLDER:"...در حال بارگذاری پیام های قدیمی تر",MESSAGELIST_SHOW_OLDER:"نشان دادن پیام های قدیمی",MESSAGELIST_NEW_MARKER:"جدید",MESSAGE_SENT_VIA_EMAIL:"پیام توسط ایمل ارسال شد",YOU_MARKER:"شما",UPLOAD_IN_PROGRESS:"...در حال بارگذاری",UPLOAD_SEND_FILE:"فرستادن پوشه",UPLOAD_SHARE_LOCATION:"اشتراک گذاری مکان",UPLOAD_ERROR:"متاسفانه بارگذاری با مشکل روبه رو شد. ممکن است فایل حجیم باشد یا ساپورت نشده باشد.",SHARE_LOCATION_ERROR:"خطا در اشتراک گذاری مکان: ",LOADING:"...بارگذاری",HUB_EMPTY:"تاریخچه گفتگو اینجا نمایان می شود",HUB_SHOW_EARLIER:"دیدن گفتگو های قبلی",INBOX_NO_CHATS_TITLE:"هنوز گفتگویی وجود ندارد",INBOX_NO_CHATS_BODY:"بعد از داشتن یک مکالمه یا بیشتر، آنها اینجا نمایان می شوند.",ENABLE_TRANSLATION:"این مکالمه را به فارسی ترجمه کن",DISABLE_TRANSLATION:"زبان اصلی را نشان بده",SEARCH_PLACEHOLDER_TEXT:"...جستجو",SEARCH_SEARCHING:"...در حال جستجو",SEARCH_NO_RESULTS:"نتیجه ای یافت نشد",SEARCH_NO_MORE_RESULTS:"نتیجه بیشتری وجود ندارد",CHAT_NOT_FOUND:"مکالمه پیدا نشد",DELETE_MESSAGE:"حذف پیام ",DELETION_EXPLANATION:"اگر این پیام را حذف کنید، برای همه ناپدید می شود.",EDIT_MESSAGE:"ویرایش پیام",SAVE:"ذخیره",EDITED_INDICATOR:"ویرایش‌شده",REPLY_TO_MESSAGE:"پاسخ دادن",ADD_REACTION:"واکنش را اضافه کنید",AUTH_EXPIRED_OVERLAY_TITLE:"جلسه چت شما منقضی شده است",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"برای ادامه صفحه را بازخوانی کنید",VOICE_MESSAGE:"پیام صوتی",CONTACT_INFORMATION_HIDDEN:"اطلاعات پنهان",LEAVE_CONVERSATION:"خروج از گفتگو",MARK_CONVERSATION_AS_UNREAD:"به عنوان خوانده نشده علامت گذاری کن",STATUS_INDICATOR_ONLINE:"فعال",STATUS_INDICATOR_OFFLINE:"غایب",ARIA_LEAVE_SEARCH_MODE:"خروج از حالت جستجو",ARIA_SEARCH_UP:"جستجوی بالا",ARIA_SEARCH_DOWN:"جستجوی پایین",ARIA_CLOSE_CHAT_POPUP:"بستن پنجره چت",ARIA_SEARCH_INSIDE_CONVERSATION:"جستجو در این گفتگو",ARIA_SEARCH:"جستجو",ARIA_CHAT:"چت",ARIA_SET_PLAYBACK_SPEED:"تنظیم سرعت پخش",ARIA_CANCEL_UPLOAD:"لغو آپلود",ARIA_STOP_RECORDING:"توقف ضبط",ARIA_CANCEL_RECORDING:"لغو ضبط",ARIA_INSERT_EMOJI:"درج ایموجی",ARIA_PLAY_AUDIO:"پخش صدا",ARIA_PAUSE_AUDIO:"مکث صدا",ARIA_REACTION_COUNT:(n,e)=>`${n} واکنش با ${e}`,ARIA_MORE_ACTIONS:"اقدامات بیشتر",ARIA_REPLYING_TO:(n,e)=>`در حال پاسخ به ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"خروج از حالت پاسخ"}},fi:{code:"fi-FI",name:"Finnish",translation:{YESTERDAY:"Eilen",TODAY:"Tänään",DAYS:"p",HOURS:"t",MINUTES:"m",JUST_NOW:"juuri nyt",LOCATION:"Sijainti",CANCEL:"Peruuta",INBOX:"Saapuneet",DESKTOP_NOTIFICATIONS:"Selaimen ilmoitukset",DESKTOP_NOTIFICATIONS_ERROR:"Työpöydän ilmoituksia ei voitu kytkeä päälle, koska selaimesi estää ne aktiivisesti. Koeta tutkia sen asetuksia tai vaihda selainta.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo ilmoitus`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Jos pidät tämän sivun auki, näet vastaavan ilmoituksen kun joku puhuu sinulle.",SEND_BUTTON_TEXT:"Lähetä",ENTRYBOX_TEXT_LIMIT:"Maksimissaan 10000 merkkiä.",ENTRYBOX_PLACEHOLDER:"Sano jotain...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Tämä keskustelu ei ole enää aktiivinen.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Voit lukea, mutta et lähettää viestejä.",MESSAGELIST_LOADING_OLDER:"Ladataan vanhoja viestejä..",MESSAGELIST_SHOW_OLDER:"Näytä vanhat viestit",MESSAGELIST_NEW_MARKER:"Uusi",MESSAGE_SENT_VIA_EMAIL:"Tämä viesti on lähetetty sähköpostin välityksellä",YOU_MARKER:"sinä",UPLOAD_IN_PROGRESS:"Ladataan...",UPLOAD_SEND_FILE:"Lähetä tiedosto",UPLOAD_SHARE_LOCATION:"Jaa sijainti",UPLOAD_ERROR:"Valitettavasti jokin meni vikaan. Tiedostotyyppiä ei ehkä tueta tai se saattaa olla liian suuri.",SHARE_LOCATION_ERROR:"Sijaintia ei pystytty jakamaan: ",LOADING:"Ladataan...",HUB_EMPTY:"Keskusteluhistoriasi näkyy tässä",HUB_SHOW_EARLIER:"Näytä aiemmat keskustelut",INBOX_NO_CHATS_TITLE:"Ei keskusteluja, vielä!",INBOX_NO_CHATS_BODY:"Kun olet käynyt yhden tai useamman keskustelun, ne näkyvät täällä.",ENABLE_TRANSLATION:"Käännä keskustelu kielelle suomi",DISABLE_TRANSLATION:"Näytä alkuperäinen",SEARCH_PLACEHOLDER_TEXT:"Etsi...",SEARCH_SEARCHING:"Etsiminen...",SEARCH_NO_RESULTS:"Tuloksia ei löytynyt",SEARCH_NO_MORE_RESULTS:"Ei enempää tuloksia",CHAT_NOT_FOUND:"Keskustelua ei löytynyt",DELETE_MESSAGE:"Poista viesti",DELETION_EXPLANATION:"Jos poistat tämän viestin, se häviää kaikilta.",EDIT_MESSAGE:"Muokkaa viestiä",SAVE:"Tallenna",EDITED_INDICATOR:"muokattu",REPLY_TO_MESSAGE:"Vastaa",ADD_REACTION:"Lisää reaktio",AUTH_EXPIRED_OVERLAY_TITLE:"Istuntosi on vanhentunut",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Päivitä sivu jatkaaksesi",VOICE_MESSAGE:"Ääniviesti",CONTACT_INFORMATION_HIDDEN:"Piilotetut tiedot",LEAVE_CONVERSATION:"Poistu keskustelusta",MARK_CONVERSATION_AS_UNREAD:"Merkitse lukemattomaksi",STATUS_INDICATOR_ONLINE:"Aktiivinen",STATUS_INDICATOR_OFFLINE:"Poissa",ARIA_LEAVE_SEARCH_MODE:"Poistu hakutilasta",ARIA_SEARCH_UP:"Hae ylöspäin",ARIA_SEARCH_DOWN:"Hae alaspäin",ARIA_CLOSE_CHAT_POPUP:"Sulje chat-ikkuna",ARIA_SEARCH_INSIDE_CONVERSATION:"Hae tästä keskustelusta",ARIA_SEARCH:"Hae",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"aseta toistonopeus",ARIA_CANCEL_UPLOAD:"Peruuta lähetys",ARIA_STOP_RECORDING:"Lopeta tallennus",ARIA_CANCEL_RECORDING:"Peruuta tallennus",ARIA_INSERT_EMOJI:"Lisää emoji",ARIA_PLAY_AUDIO:"toista ääni",ARIA_PAUSE_AUDIO:"keskeytä ääni",ARIA_REACTION_COUNT:(n,e)=>`${n} reaktiota (${e})`,ARIA_MORE_ACTIONS:"Lisää toimintoja",ARIA_REPLYING_TO:(n,e)=>`Vastataan käyttäjälle ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Poistu vastaustilasta"}},fr:{code:"fr-FR",name:"French",translation:{YESTERDAY:"Hier",TODAY:"Aujourd'hui",DAYS:"j",HOURS:"h",MINUTES:"m",JUST_NOW:"maintenant",LOCATION:"Emplacement",CANCEL:"Annuler",INBOX:"Boîte de réception",DESKTOP_NOTIFICATIONS:"Notifications du navigateur",DESKTOP_NOTIFICATIONS_ERROR:"Impossible d'activer les notifications du navigateur car votre navigateur les bloque. Essayez de changer ses paramètres ou de changer de navigateur.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`Notification de démonstration ${n}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Si vous maintenez l'onglet ouvert dans votre navigateur vous verrez apparaître une alerte lorsque quelqu'un vous parlera.",SEND_BUTTON_TEXT:"Envoyer",ENTRYBOX_TEXT_LIMIT:"Seuls 10.000 caractères sont autorisés.",ENTRYBOX_PLACEHOLDER:"Ecrivez quelque chose...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Cette conversation n'est plus active.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Vous pouvez lire, mais pas envoyer de messages.",MESSAGELIST_LOADING_OLDER:"Chargement des anciens messages ...",MESSAGELIST_SHOW_OLDER:"Afficher les anciens messages",MESSAGELIST_NEW_MARKER:"Nouveau",MESSAGE_SENT_VIA_EMAIL:"Ce message a été envoyé par e-mail",YOU_MARKER:"vous",UPLOAD_IN_PROGRESS:"Envoi en cours...",UPLOAD_SEND_FILE:"Envoyer un fichier",UPLOAD_SHARE_LOCATION:"Partager mon emplacement",UPLOAD_ERROR:"Un problème est survenu lors de l'envoi: le fichier est peut-être non pris en charge ou trop volumineux.",SHARE_LOCATION_ERROR:"Impossible de partager votre emplacement: ",LOADING:"Chargement en cours...",HUB_EMPTY:"Votre historique de discussion apparaîtra ici",HUB_SHOW_EARLIER:"Afficher les conversations précédentes",INBOX_NO_CHATS_TITLE:"Aucune conversation pour l'instant!",INBOX_NO_CHATS_BODY:"Une fois que vous aurez eu une ou plusieurs conversations, elles apparaîtront ici.",ENABLE_TRANSLATION:"Traduire cette conversation en français",DISABLE_TRANSLATION:"Remontrer la conversation originale",SEARCH_PLACEHOLDER_TEXT:"Rechercher...",SEARCH_SEARCHING:"Recherche...",SEARCH_NO_RESULTS:"Aucun résultat trouvé",SEARCH_NO_MORE_RESULTS:"Il n’y a plus de résultats",CHAT_NOT_FOUND:"Conversation introuvable",DELETE_MESSAGE:"Supprimer le message",DELETION_EXPLANATION:"Si vous supprimez ce message, il disparaîtra pour tout le monde.",EDIT_MESSAGE:"Modifier le message",SAVE:"Enregistrer",EDITED_INDICATOR:"modifié",REPLY_TO_MESSAGE:"Répondre",ADD_REACTION:"Ajouter une réaction",AUTH_EXPIRED_OVERLAY_TITLE:"Votre session de chat a expiré",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Actualisez la page pour continuer",VOICE_MESSAGE:"Message vocal",CONTACT_INFORMATION_HIDDEN:"Informations masquées",LEAVE_CONVERSATION:"Quitter la conversation",MARK_CONVERSATION_AS_UNREAD:"Marquer comme non lu",STATUS_INDICATOR_ONLINE:"Actif",STATUS_INDICATOR_OFFLINE:"Absent",ARIA_LEAVE_SEARCH_MODE:"Quitter le mode recherche",ARIA_SEARCH_UP:"Rechercher vers le haut",ARIA_SEARCH_DOWN:"Rechercher vers le bas",ARIA_CLOSE_CHAT_POPUP:"Fermer la fenêtre de chat",ARIA_SEARCH_INSIDE_CONVERSATION:"Rechercher dans cette conversation",ARIA_SEARCH:"Rechercher",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"définir la vitesse de lecture",ARIA_CANCEL_UPLOAD:"Annuler l'envoi",ARIA_STOP_RECORDING:"Arrêter l'enregistrement",ARIA_CANCEL_RECORDING:"Annuler l'enregistrement",ARIA_INSERT_EMOJI:"Insérer un emoji",ARIA_PLAY_AUDIO:"lire l'audio",ARIA_PAUSE_AUDIO:"mettre en pause l'audio",ARIA_REACTION_COUNT:(n,e)=>`${n} réactions avec ${e}`,ARIA_MORE_ACTIONS:"Plus d'actions",ARIA_REPLYING_TO:(n,e)=>`Répondre à ${n} : ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Quitter le mode réponse"}},he:{code:"he-IL",name:"Hebrew",translation:{YESTERDAY:"אתמול",TODAY:"היום",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"עכשיו",LOCATION:"מיקום",CANCEL:"בטל",INBOX:"דואר נכנס",DESKTOP_NOTIFICATIONS:"התראות דפדפן",DESKTOP_NOTIFICATIONS_ERROR:"לא ניתן להפעיל התראות במרועה דפדפן מכיוון שהדפדפן שלך חוסם אותן באופן פעיל. נסה להסתכל בהגדרות או להשתמש בדפדפן אחר.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} הודעה על הדגמה`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"אם אתה שומר על כרטיסיית הדפדפן שלך פתוחה, תראה את זה צץ כשמישהו ידבר איתך.",SEND_BUTTON_TEXT:"שלח",ENTRYBOX_TEXT_LIMIT:"רק 10.000 תווים",ENTRYBOX_PLACEHOLDER:"תגיד משהו...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"שיחה זו אינה פעילה עוד.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"אתה יכול לקרוא, אך לא לשלוח הודעות.",MESSAGELIST_LOADING_OLDER:"טוען הודעות ישנות...",MESSAGELIST_SHOW_OLDER:"הצג הודעות ישנות",MESSAGELIST_NEW_MARKER:"חדש",MESSAGE_SENT_VIA_EMAIL:"הודעה זאת נשלחה דרך אימייל",YOU_MARKER:"אתה",UPLOAD_IN_PROGRESS:"מעלה ...",UPLOAD_SEND_FILE:"שלח קובץ",UPLOAD_SHARE_LOCATION:"שתף מיקום",UPLOAD_ERROR:"לרוע המזל משהו השתבש בהעלאה. ייתכן שהקובץ אינו נתמך או גדול מדי.",SHARE_LOCATION_ERROR:"לא ניתן לשתף מיקום: ",LOADING:"טוען...",HUB_EMPTY:"היסטוריית הצ'אט שלך תופיע כאן",HUB_SHOW_EARLIER:"הצג צ'אטים קודמים",INBOX_NO_CHATS_TITLE:"אין עדיין צ'אטים!",INBOX_NO_CHATS_BODY:"לאחר שניהלת שיחה אחת או יותר, הם יופיעו כאן.",ENABLE_TRANSLATION:"תרגם שיחה זו לעברית",DISABLE_TRANSLATION:"הצג מקור",SEARCH_PLACEHOLDER_TEXT:"...חפש",SEARCH_SEARCHING:"...מחפש",SEARCH_NO_RESULTS:"לא נמצאו תוצאות",SEARCH_NO_MORE_RESULTS:"אין תוצאות נוספות",CHAT_NOT_FOUND:"הצ'אט לא נמצא",DELETE_MESSAGE:"מחיקת הודעה",DELETION_EXPLANATION:"אם תמחק הודעה זו, היא תיעלם עבור כולם.",EDIT_MESSAGE:"עריכת הודעה",SAVE:"שמור",EDITED_INDICATOR:"ערוך",REPLY_TO_MESSAGE:"השב",ADD_REACTION:"הוספת תגובה",AUTH_EXPIRED_OVERLAY_TITLE:"הפעלת הצ׳אט שלכם פגה",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"רעננו את העמוד כדי להמשיך",VOICE_MESSAGE:"הודעה קולית",CONTACT_INFORMATION_HIDDEN:"מידע מוסתר",LEAVE_CONVERSATION:"צא מהשיחה",MARK_CONVERSATION_AS_UNREAD:"סמן כלא נקרא",STATUS_INDICATOR_ONLINE:"פעיל",STATUS_INDICATOR_OFFLINE:"לא פעיל",ARIA_LEAVE_SEARCH_MODE:"צא ממצב חיפוש",ARIA_SEARCH_UP:"חפש למעלה",ARIA_SEARCH_DOWN:"חפש למטה",ARIA_CLOSE_CHAT_POPUP:"סגור חלון צ'אט",ARIA_SEARCH_INSIDE_CONVERSATION:"חפש בתוך השיחה הזו",ARIA_SEARCH:"חפש",ARIA_CHAT:"צ'אט",ARIA_SET_PLAYBACK_SPEED:"הגדר מהירות השמעה",ARIA_CANCEL_UPLOAD:"בטל העלאה",ARIA_STOP_RECORDING:"עצור הקלטה",ARIA_CANCEL_RECORDING:"בטל הקלטה",ARIA_INSERT_EMOJI:"הוסף אמוג'י",ARIA_PLAY_AUDIO:"נגן אודיו",ARIA_PAUSE_AUDIO:"השהה אודיו",ARIA_REACTION_COUNT:(n,e)=>`${n} תגובות עם ${e}`,ARIA_MORE_ACTIONS:"פעולות נוספות",ARIA_REPLYING_TO:(n,e)=>`משיב ל-${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"צא ממצב תשובה"}},hi:{code:"hi-IN",name:"Hindi (IN)",translation:{YESTERDAY:"कल",TODAY:"आज",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"अभी",LOCATION:"जगह",CANCEL:"रद्द करें",INBOX:"इनबॉक्स",DESKTOP_NOTIFICATIONS:"ब्राउज़र सूचनाएं",DESKTOP_NOTIFICATIONS_ERROR:"ब्राउज़र सूचनाएं सक्षम नहीं कर सकता क्योंकि आपका ब्राउज़र सक्रिय रूप से उन्हें ब्लॉक करता है। सेटिंग्स में देखने या एक अलग ब्राउज़र का उपयोग करने का प्रयास करें।",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} डेमो अधिसूचना`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"यदि आप अपना ब्राउज़र टैब खुला रखते हैं, तो यह पॉप अप आपको तब दिखाई देगा जब कोई आपसे बात करेगा।",SEND_BUTTON_TEXT:"भेजें",ENTRYBOX_TEXT_LIMIT:"केवल 10,000 वर्णों की अनुमति है।",ENTRYBOX_PLACEHOLDER:"कुछ कहिए...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"यह चैट अब सक्रिय नहीं है।",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"आप पढ़ सकते हैं, लेकिन संदेश नहीं भेज सकते।",MESSAGELIST_LOADING_OLDER:"पुराने संदेश लोड हो रहे हैं ...",MESSAGELIST_SHOW_OLDER:"पुराने संदेश दिखाएं",MESSAGELIST_NEW_MARKER:"नया",MESSAGE_SENT_VIA_EMAIL:"यह संदेश ईमेल के माध्यम से भेजा गया था",YOU_MARKER:"आप",UPLOAD_IN_PROGRESS:"अपलोड हो रहा है...",UPLOAD_SEND_FILE:"फाइल भेजें",UPLOAD_SHARE_LOCATION:"जगह शेयर करें",UPLOAD_ERROR:"दुर्भाग्य से, अपलोड करते समय कुछ गलत हो गया। फ़ाइल असमर्थित या बहुत बड़ी हो सकती है।",SHARE_LOCATION_ERROR:"जगह शेयर नहीं हो पाया: ",LOADING:"लोड हो रहा है...",HUB_EMPTY:"आपका चैट इतिहास यहां दिखाई देगा",HUB_SHOW_EARLIER:"पहले की चैट दिखाओ",INBOX_NO_CHATS_TITLE:"अभी तक कोई चैट नहीं!",INBOX_NO_CHATS_BODY:"एक बार जब आप एक या अधिक चैट कर लेते हैं, तो वे यहां दिखाई देंगे।",ENABLE_TRANSLATION:"इस बातचीत का हिंदी में अनुवाद कीजिए",DISABLE_TRANSLATION:"मूल दिखाएँ",SEARCH_PLACEHOLDER_TEXT:"खोजें...",SEARCH_SEARCHING:"खोज जारी है...",SEARCH_NO_RESULTS:"कोई परिणाम नहीं मिला",SEARCH_NO_MORE_RESULTS:"और कोई परिणाम नहीं",CHAT_NOT_FOUND:"चैट नहीं मिली",DELETE_MESSAGE:"संदेश डिलीट करें",DELETION_EXPLANATION:"यदि आप इस संदेश को हटाते हैं, तो यह सभी के लिए गायब हो जाएगा.",EDIT_MESSAGE:"संदेश में बदलाव करें",SAVE:"सहेजें",EDITED_INDICATOR:"संपादित किया गया",REPLY_TO_MESSAGE:"जवाब दीजिए ।",ADD_REACTION:"प्रतिक्रिया जोड़ें",AUTH_EXPIRED_OVERLAY_TITLE:"आपका चैट सेशन समाप्त हो चुका है",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"आगे बढ़ने के लिए रिफ्रेश करें",VOICE_MESSAGE:"वॉयस मैसेज",CONTACT_INFORMATION_HIDDEN:"छुपी हुई जानकारी",LEAVE_CONVERSATION:"बातचीत को ख़त्म करें",MARK_CONVERSATION_AS_UNREAD:"अपठित के रूप में चिह्नित करें",STATUS_INDICATOR_ONLINE:"सक्रिय",STATUS_INDICATOR_OFFLINE:"अनुपस्थित",ARIA_LEAVE_SEARCH_MODE:"खोज मोड से बाहर निकलें",ARIA_SEARCH_UP:"ऊपर खोजें",ARIA_SEARCH_DOWN:"नीचे खोजें",ARIA_CLOSE_CHAT_POPUP:"चैट विंडो बंद करें",ARIA_SEARCH_INSIDE_CONVERSATION:"इस बातचीत में खोजें",ARIA_SEARCH:"खोजें",ARIA_CHAT:"चैट",ARIA_SET_PLAYBACK_SPEED:"प्लेबैक गति सेट करें",ARIA_CANCEL_UPLOAD:"अपलोड रद्द करें",ARIA_STOP_RECORDING:"रिकॉर्डिंग रोकें",ARIA_CANCEL_RECORDING:"रिकॉर्डिंग रद्द करें",ARIA_INSERT_EMOJI:"इमोजी डालें",ARIA_PLAY_AUDIO:"ऑडियो चलाएं",ARIA_PAUSE_AUDIO:"ऑडियो रोकें",ARIA_REACTION_COUNT:(n,e)=>`${n} प्रतिक्रियाएं (${e})`,ARIA_MORE_ACTIONS:"अधिक कार्य",ARIA_REPLYING_TO:(n,e)=>`${n} को उत्तर दे रहे हैं: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"उत्तर मोड से बाहर निकलें"}},hr:{code:"hr-HR",name:"Croatian",translation:{YESTERDAY:"Jučer",TODAY:"Danas",DAYS:"d",HOURS:"s",MINUTES:"m",JUST_NOW:"Upravo sad",LOCATION:"Lokacija",CANCEL:"Otkaži",INBOX:"Pretinac",DESKTOP_NOTIFICATIONS:"Obavijesti preglednika",DESKTOP_NOTIFICATIONS_ERROR:"Notifikacije preglednika nisu omogućene jer ih vaš preglednik aktivno blokira. Pokušajte pogledati postavke ili koristiti neki drugi preglednik.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notifikacija`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ako karticu preglednika ostavite otvorenu, pojavit će se ovaj pop-up kada netko razgovara s vama.",SEND_BUTTON_TEXT:"Pošalji",ENTRYBOX_TEXT_LIMIT:"Dozvoljeno je samo 10.000 znakova.",ENTRYBOX_PLACEHOLDER:"Reci nešto...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ovaj razgovor više nije aktivan.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Možeš čitati, ali ne i slati poruke.",MESSAGELIST_LOADING_OLDER:"Učitavam starije poruke...",MESSAGELIST_SHOW_OLDER:"Prikaži starije poruke",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Ova poruka je poslana e-poštom",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Učitavam...",UPLOAD_SEND_FILE:"Pošalji datoteku",UPLOAD_SHARE_LOCATION:"Podijeli lokaciju",UPLOAD_ERROR:"Nažalost, nešto je pošlo krivo. Datoteka možda nije podržana ili je prevelika.",SHARE_LOCATION_ERROR:"Nije moguće podijeliti lokaciju: ",LOADING:"Učitavam...",HUB_EMPTY:"Ovdje će se prikazati vaša povijest razgovora",HUB_SHOW_EARLIER:"Prikaži ranije razgovore",INBOX_NO_CHATS_TITLE:"Nema razgovora!",INBOX_NO_CHATS_BODY:"Nakon što vodite jedan ili više razgovora, oni će se pojaviti ovdje.",ENABLE_TRANSLATION:"Prevedi ovaj razgovor na hrvatski jezik",DISABLE_TRANSLATION:"Prikaži original",SEARCH_PLACEHOLDER_TEXT:"Pretraži...",SEARCH_SEARCHING:"Pretraživanje...",SEARCH_NO_RESULTS:"Nema rezultata",SEARCH_NO_MORE_RESULTS:"Nema više rezultata",CHAT_NOT_FOUND:"Razgovor nije pronađen",DELETE_MESSAGE:"Obriši poruku",DELETION_EXPLANATION:"Ako izbrišete ovu poruku, nestat će za sve.",EDIT_MESSAGE:"Uredi poruku",SAVE:"Spremi",EDITED_INDICATOR:"uređivao",REPLY_TO_MESSAGE:"Odgovorite",ADD_REACTION:"Dodajte reakciju",AUTH_EXPIRED_OVERLAY_TITLE:"Vaša sesija razgovora je istekla",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Osvježite stranicu za nastavak",VOICE_MESSAGE:"Glasovna poruka",CONTACT_INFORMATION_HIDDEN:"Skrivene informacije",LEAVE_CONVERSATION:"Napustiti razgovor",MARK_CONVERSATION_AS_UNREAD:"Označi kao nepročitano",STATUS_INDICATOR_ONLINE:"Aktivan",STATUS_INDICATOR_OFFLINE:"Odsutan",ARIA_LEAVE_SEARCH_MODE:"Napusti način pretraživanja",ARIA_SEARCH_UP:"Traži gore",ARIA_SEARCH_DOWN:"Traži dolje",ARIA_CLOSE_CHAT_POPUP:"Zatvori prozor za chat",ARIA_SEARCH_INSIDE_CONVERSATION:"Traži u ovom razgovoru",ARIA_SEARCH:"Traži",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"postavi brzinu reprodukcije",ARIA_CANCEL_UPLOAD:"Otkaži učitavanje",ARIA_STOP_RECORDING:"Zaustavi snimanje",ARIA_CANCEL_RECORDING:"Otkaži snimanje",ARIA_INSERT_EMOJI:"Umetni emoji",ARIA_PLAY_AUDIO:"reproduciraj audio",ARIA_PAUSE_AUDIO:"pauziraj audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reakcija s ${e}`,ARIA_MORE_ACTIONS:"Više radnji",ARIA_REPLYING_TO:(n,e)=>`Odgovaranje korisniku ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Izađi iz moda odgovaranja"}},hu:{code:"hu-HU",name:"Hungarian",translation:{YESTERDAY:"Tegnap",TODAY:"Ma",DAYS:"n",HOURS:"ó",MINUTES:"p",JUST_NOW:"éppen most",LOCATION:"Helyszín",CANCEL:"Visszavonás",INBOX:"Postaláda",DESKTOP_NOTIFICATIONS:"Böngésző értesítések",DESKTOP_NOTIFICATIONS_ERROR:"Azért nem tudja bekapcsolni a böngésző értesítések funkciót, mert böngészője aktívan blokkolja azt. Tekintse meg a beállításokat vagy használjon másik böngészőt.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo értesítés`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ha nyitva hagyja böngészőjét, felugró ablak fog megjelenni, ha valaki beszélni szeretne Önnel.",SEND_BUTTON_TEXT:"Küldés",ENTRYBOX_TEXT_LIMIT:"Mindőssze 10.000 karakter megengedett.",ENTRYBOX_PLACEHOLDER:"Mondjon valamit...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ez a beszélgetés már nem aktív.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Elolvashatja az üzeneteket, de nem küldhet újat.",MESSAGELIST_LOADING_OLDER:"Korábbi üzenetek betöltése...",MESSAGELIST_SHOW_OLDER:"Korábbi üzenetek megjelenítése",MESSAGELIST_NEW_MARKER:"Új",MESSAGE_SENT_VIA_EMAIL:"Ez az üzenet e-mailben került elküldésre",YOU_MARKER:"Ön",UPLOAD_IN_PROGRESS:"Feltöltés...",UPLOAD_SEND_FILE:"Fájl küldése",UPLOAD_SHARE_LOCATION:"Helyszín megosztása",UPLOAD_ERROR:"Sajnos hiba történt a feltöltés során. A fájl nem támogatott vagy túl nagy.",SHARE_LOCATION_ERROR:"Helyszín megosztása nem lehetséges: ",LOADING:"Betöltés...",HUB_EMPTY:"A beszélgetések előzményei itt láthatók",HUB_SHOW_EARLIER:"Korábbi beszélgetések megjelenítése",INBOX_NO_CHATS_TITLE:"Még nincs megjeleníthető beszélgetés!",INBOX_NO_CHATS_BODY:"Amint egy vagy több beszélgetéssel rendelkezik, azok itt fognak megjelenni.",ENABLE_TRANSLATION:"A beszélgetés lefordítása erre a nyelvre: magyar",DISABLE_TRANSLATION:"Eredeti megjelenítése",SEARCH_PLACEHOLDER_TEXT:"Keresés...",SEARCH_SEARCHING:"Keresés...",SEARCH_NO_RESULTS:"Nincs találat",SEARCH_NO_MORE_RESULTS:"Nincs több találat",CHAT_NOT_FOUND:"A csevegés nem található",DELETE_MESSAGE:"Üzenet törlése",DELETION_EXPLANATION:"Ha törlöd ezt az üzenetet, az mindenki számára eltűnik.",EDIT_MESSAGE:"Üzenet szerkesztése",SAVE:"Mentés",EDITED_INDICATOR:"szerkesztve",REPLY_TO_MESSAGE:"Válaszadás",ADD_REACTION:"Reagálás erre",AUTH_EXPIRED_OVERLAY_TITLE:"Chat munkamenete lejárt",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Folytatáshoz frissítse az oldalt",VOICE_MESSAGE:"Hangüzenet",CONTACT_INFORMATION_HIDDEN:"Rejtett információ",LEAVE_CONVERSATION:"Kilépés a beszélgetésből",MARK_CONVERSATION_AS_UNREAD:"Megjelölés olvasatlanként",STATUS_INDICATOR_ONLINE:"Aktív",STATUS_INDICATOR_OFFLINE:"Távol",ARIA_LEAVE_SEARCH_MODE:"Keresési mód elhagyása",ARIA_SEARCH_UP:"Keresés felfelé",ARIA_SEARCH_DOWN:"Keresés lefelé",ARIA_CLOSE_CHAT_POPUP:"Csevegő ablak bezárása",ARIA_SEARCH_INSIDE_CONVERSATION:"Keresés ebben a beszélgetésben",ARIA_SEARCH:"Keresés",ARIA_CHAT:"Csevegés",ARIA_SET_PLAYBACK_SPEED:"lejátszási sebesség beállítása",ARIA_CANCEL_UPLOAD:"Feltöltés megszakítása",ARIA_STOP_RECORDING:"Felvétel leállítása",ARIA_CANCEL_RECORDING:"Felvétel megszakítása",ARIA_INSERT_EMOJI:"Emoji beszúrása",ARIA_PLAY_AUDIO:"hang lejátszása",ARIA_PAUSE_AUDIO:"hang szüneteltetése",ARIA_REACTION_COUNT:(n,e)=>`${n} reakció (${e})`,ARIA_MORE_ACTIONS:"További műveletek",ARIA_REPLYING_TO:(n,e)=>`Válaszolás ${n} részére: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Kilépés a válasz módóból"}},id:{code:"id-ID",name:"Bahasa Indonesia",translation:{YESTERDAY:"Kemarin",TODAY:"Hari ini",DAYS:"h",HOURS:"j",MINUTES:"m",JUST_NOW:"sekarang",LOCATION:"Lokasi",CANCEL:"Batal",INBOX:"Kotak Masuk",DESKTOP_NOTIFICATIONS:"Notifikasi peramban",DESKTOP_NOTIFICATIONS_ERROR:"Tidak dapat mengaktifkan pemberitahuan browser karena browser Anda secara aktif memblokir mereka. Coba cari di pengaturan atau menggunakan browser yang berbeda.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`pemberitahuan demo ${n}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Jika Anda membiarkan tab browser tetap terbuka, Anda akan melihat ini muncul ketika seseorang berbicara kepada Anda.",SEND_BUTTON_TEXT:"Kirim",ENTRYBOX_TEXT_LIMIT:"Hanya 10.000 karakter yang diizinkan.",ENTRYBOX_PLACEHOLDER:"Katakan sesuatu...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Percakapan ini tidak lagi aktif.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Anda dapat membaca, tetapi tidak mengirim pesan.",MESSAGELIST_LOADING_OLDER:"Memuat pesan lama...",MESSAGELIST_SHOW_OLDER:"Tampilkan pesan yang lebih lama",MESSAGELIST_NEW_MARKER:"Baru",MESSAGE_SENT_VIA_EMAIL:"Pesan ini dikirim melalui email",YOU_MARKER:"Anda",UPLOAD_IN_PROGRESS:"Mengunggah...",UPLOAD_SEND_FILE:"Kirim mengajukan",UPLOAD_SHARE_LOCATION:"Bagikan lokasi",UPLOAD_ERROR:"Ada yang salah diunggah. File mungkin tidak didukung atau terlalu besar.",SHARE_LOCATION_ERROR:"Tidak dapat membagikan lokasi: ",LOADING:"Memuat...",HUB_EMPTY:"Riwayat obrolan Anda akan muncul di sini",HUB_SHOW_EARLIER:"Tampilkan obrolan sebelumnya",INBOX_NO_CHATS_TITLE:"Belum ada obrolan!",INBOX_NO_CHATS_BODY:"Setelah Anda melakukan satu atau lebih percakapan, mereka akan muncul di sini.",ENABLE_TRANSLATION:"Terjemahkan percakapan ini ke Indonesia",DISABLE_TRANSLATION:"Perlihatkan asli",SEARCH_PLACEHOLDER_TEXT:"Cari...",SEARCH_SEARCHING:"Mencari...",SEARCH_NO_RESULTS:"Tidak ditemukan hasil",SEARCH_NO_MORE_RESULTS:"Tidak ada hasil lainnya",CHAT_NOT_FOUND:"Obrolan tidak ditemukan",DELETE_MESSAGE:"Hapus pesan",DELETION_EXPLANATION:"Jika pesan ini Anda hapus, pesan ini akan tidak terlihat bagi siapa pun.",EDIT_MESSAGE:"Sunting pesan",SAVE:"Mentés",EDITED_INDICATOR:"diedit",REPLY_TO_MESSAGE:"Balas",ADD_REACTION:"Tambah reaksi",AUTH_EXPIRED_OVERLAY_TITLE:"Sesi obrolan Anda sudah lewat batas waktu",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Muat ulang halaman untuk melanjutkan",VOICE_MESSAGE:"Pesan suara",CONTACT_INFORMATION_HIDDEN:"Informasi tersembunyi",LEAVE_CONVERSATION:"Tinggalkan percakapan",MARK_CONVERSATION_AS_UNREAD:"Tandai sebagai Belum dibaca",STATUS_INDICATOR_ONLINE:"Aktif",STATUS_INDICATOR_OFFLINE:"Tidak aktif",ARIA_LEAVE_SEARCH_MODE:"Keluar dari mode pencarian",ARIA_SEARCH_UP:"Cari ke atas",ARIA_SEARCH_DOWN:"Cari ke bawah",ARIA_CLOSE_CHAT_POPUP:"Tutup jendela obrolan",ARIA_SEARCH_INSIDE_CONVERSATION:"Cari dalam percakapan ini",ARIA_SEARCH:"Cari",ARIA_CHAT:"Obrolan",ARIA_SET_PLAYBACK_SPEED:"atur kecepatan pemutaran",ARIA_CANCEL_UPLOAD:"Batalkan unggah",ARIA_STOP_RECORDING:"Hentikan perekaman",ARIA_CANCEL_RECORDING:"Batalkan perekaman",ARIA_INSERT_EMOJI:"Sisipkan emoji",ARIA_PLAY_AUDIO:"putar audio",ARIA_PAUSE_AUDIO:"jeda audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reaksi dengan ${e}`,ARIA_MORE_ACTIONS:"Tindakan lainnya",ARIA_REPLYING_TO:(n,e)=>`Membalas ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Keluar dari mode balasan"}},is:{code:"is-IS",name:"Íslenska",translation:{YESTERDAY:"Í gær",TODAY:"Í dag",DAYS:"dagar",HOURS:"klst.",MINUTES:"mín.",JUST_NOW:"núna",LOCATION:"Staðsetning",CANCEL:"Hætta við",INBOX:"Pósthólf",DESKTOP_NOTIFICATIONS:"Tilkynningar í vafra",DESKTOP_NOTIFICATIONS_ERROR:"Ekki er hægt að birta tilkynningar í vafra vegna þess að vafrinn sem þú notar hindrar það. Reyndu að leita að stillingum eða að nota annan vafra.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} prufutilkynning`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ef flipinn í vafranum er opinn muntu sjá þessa tilkynningu birtast þegar einhver sendir þér skilaboð.",SEND_BUTTON_TEXT:"Senda",ENTRYBOX_TEXT_LIMIT:"Aðeins 10.000 stafir komast fyrir.",ENTRYBOX_PLACEHOLDER:"Segðu eitthvað...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Þessar samræður eru ekki lengar virkar.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Þú getur lesið, en ekki sent skilaboð.",MESSAGELIST_LOADING_OLDER:"Sæki eldri skilaboð...",MESSAGELIST_SHOW_OLDER:"Sýna eldri skilaboð",MESSAGELIST_NEW_MARKER:"Ný",MESSAGE_SENT_VIA_EMAIL:"Þessi skilaboð voru send með tölvupósti",YOU_MARKER:"þú",UPLOAD_IN_PROGRESS:"Hleð upp...",UPLOAD_SEND_FILE:"Senda skrá",UPLOAD_SHARE_LOCATION:"Deila staðsetningu",UPLOAD_ERROR:"Því miður fór eitthvað úrskeiðis við að hlaða upp. Skráin gæti verið af rangri tegund eð of stór.",SHARE_LOCATION_ERROR:"Ekki er hægt að deila staðsetningu: ",LOADING:"Hleð...",HUB_EMPTY:"Fyrri samtöl munu birtast hér",HUB_SHOW_EARLIER:"Sýna fyrri samtöl",INBOX_NO_CHATS_TITLE:"Engin samtöl enn!",INBOX_NO_CHATS_BODY:"Þegar þú hefur átt eitt eða fleiri samtöl, munu þau birtast hér.",ENABLE_TRANSLATION:"Þýða þetta samtal á ensku",DISABLE_TRANSLATION:"Sýna upprunalegt",SEARCH_PLACEHOLDER_TEXT:"Leita...",SEARCH_SEARCHING:"Leita...",SEARCH_NO_RESULTS:"Ekkert fannst",SEARCH_NO_MORE_RESULTS:"Engar fleiri niðurstöður",CHAT_NOT_FOUND:"Samtal fannst ekki",DELETE_MESSAGE:"Eyða skilaboðum",DELETION_EXPLANATION:"Ef þú eyðir þessum skilaboðum munu þau hverfa hjá öllum.",EDIT_MESSAGE:"Breyta skilaboðum",SAVE:"Vista",EDITED_INDICATOR:"breytt",REPLY_TO_MESSAGE:"Svara",ADD_REACTION:"Setja inn viðbrögð",AUTH_EXPIRED_OVERLAY_TITLE:"Spjallið hefur runnið út",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Endurnýjaðu síðuna til að halda áfram",VOICE_MESSAGE:"Raddskilaboð",LEAVE_CONVERSATION:"Skilja eftir skilaboð",MARK_CONVERSATION_AS_UNREAD:"Merkja sem ólesið",STATUS_INDICATOR_ONLINE:"Virk",STATUS_INDICATOR_OFFLINE:"Ekki við",CONTACT_INFORMATION_HIDDEN:"faldar upplýsingar",ARIA_LEAVE_SEARCH_MODE:"Hætta í leitastillingu",ARIA_SEARCH_UP:"Leita upp",ARIA_SEARCH_DOWN:"Leita niður",ARIA_CLOSE_CHAT_POPUP:"Loka spjallglugga",ARIA_SEARCH_INSIDE_CONVERSATION:"Leita í þessari samtal",ARIA_SEARCH:"Leita",ARIA_CHAT:"Spjall",ARIA_SET_PLAYBACK_SPEED:"stilla afspilunarhraða",ARIA_CANCEL_UPLOAD:"Hætta við upphleðslu",ARIA_STOP_RECORDING:"Stöðva upptöku",ARIA_CANCEL_RECORDING:"Hætta við upptöku",ARIA_INSERT_EMOJI:"Setja inn emoji",ARIA_PLAY_AUDIO:"spila hljóð",ARIA_PAUSE_AUDIO:"gera hlé á hljóði",ARIA_REACTION_COUNT:(n,e)=>`${n} viðbrögð með ${e}`,ARIA_MORE_ACTIONS:"Fleiri aðgerðir",ARIA_REPLYING_TO:(n,e)=>`Svara ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Hætta í svarmód"}},it:{code:"it-IT",name:"Italian",translation:{YESTERDAY:"Ieri",TODAY:"Oggi",DAYS:"g",HOURS:"o",MINUTES:"m",JUST_NOW:"adesso",LOCATION:"Posizione",CANCEL:"Annulla",INBOX:"Posta in arrivo",DESKTOP_NOTIFICATIONS:"Notifiche browser",DESKTOP_NOTIFICATIONS_ERROR:"Impossibile abilitare le notifiche browser perché il browser le blocca attivamente. Prova a cercare le impostazioni o utilizzare un browser diverso.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notification`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Se si mantiene aperta la scheda del browser, questo verrà visualizzato quando qualcuno ti parla.",SEND_BUTTON_TEXT:"Invia",ENTRYBOX_TEXT_LIMIT:"Sono consentiti solo 10.000 caratteri.",ENTRYBOX_PLACEHOLDER:"Dì qualcosa...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Questa conversazione non è più attiva.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Puoi leggere, ma non inviare messaggi.",MESSAGELIST_LOADING_OLDER:"Caricamento dei messaggi precedenti...",MESSAGELIST_SHOW_OLDER:"Mostra messaggi precedenti",MESSAGELIST_NEW_MARKER:"Nuovo",MESSAGE_SENT_VIA_EMAIL:"Questo messaggio è stato inviato via email",YOU_MARKER:"tu",UPLOAD_IN_PROGRESS:"Caricamento in corso...",UPLOAD_SEND_FILE:"Invia file",UPLOAD_SHARE_LOCATION:"Condividi posizione",UPLOAD_ERROR:"Qualcosa è andato storto durante il caricamento. Il file potrebbe non essere supportato o troppo grande.",SHARE_LOCATION_ERROR:"Impossibile condividere la posizione: ",LOADING:"Caricamento in corso...",HUB_EMPTY:"La cronologia della tua chat verrà mostrata qui",HUB_SHOW_EARLIER:"Mostra chat precedenti",INBOX_NO_CHATS_TITLE:"Non ci sono ancora chat!",INBOX_NO_CHATS_BODY:"Una volta che hai avuto una o più conversazioni, verranno visualizzate qui.",ENABLE_TRANSLATION:"Traduci questa conversazione in italiano",DISABLE_TRANSLATION:"Mostra l'originale",SEARCH_PLACEHOLDER_TEXT:"Cerca...",SEARCH_SEARCHING:"Cercando...",SEARCH_NO_RESULTS:"Nessun risultato trovato",SEARCH_NO_MORE_RESULTS:"Non ci sono più risultati",CHAT_NOT_FOUND:"Chat non trovata",DELETE_MESSAGE:"Elimina messaggio",DELETION_EXPLANATION:"Se elimini il messaggio, questo scomparirà per tutti.",EDIT_MESSAGE:"Modifica messaggio",SAVE:"Salva",EDITED_INDICATOR:"modificato",REPLY_TO_MESSAGE:"Rispondi",ADD_REACTION:"Aggiungi reazione",AUTH_EXPIRED_OVERLAY_TITLE:"La sessione di chat è scaduta",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Aggiorna la pagina per continuare",VOICE_MESSAGE:"Messaggio vocale",LEAVE_CONVERSATION:"Abbandona la conversazione",MARK_CONVERSATION_AS_UNREAD:"Segna come non letto",STATUS_INDICATOR_ONLINE:"Online",STATUS_INDICATOR_OFFLINE:"Offline",CONTACT_INFORMATION_HIDDEN:"Informazioni nascoste",ARIA_LEAVE_SEARCH_MODE:"Esci dalla modalità ricerca",ARIA_SEARCH_UP:"Cerca in alto",ARIA_SEARCH_DOWN:"Cerca in basso",ARIA_CLOSE_CHAT_POPUP:"Chiudi la finestra di chat",ARIA_SEARCH_INSIDE_CONVERSATION:"Cerca in questa conversazione",ARIA_SEARCH:"Cerca",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"imposta velocità di riproduzione",ARIA_CANCEL_UPLOAD:"Annulla caricamento",ARIA_STOP_RECORDING:"Interrompi registrazione",ARIA_CANCEL_RECORDING:"Annulla registrazione",ARIA_INSERT_EMOJI:"Inserisci un'emoji",ARIA_PLAY_AUDIO:"riproduci audio",ARIA_PAUSE_AUDIO:"metti in pausa audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reazioni con ${e}`,ARIA_MORE_ACTIONS:"Altre azioni",ARIA_REPLYING_TO:(n,e)=>`Rispondendo a ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Esci dalla modalità risposta"}},ja:{code:"ja-JP",name:"Japanese",translation:{YESTERDAY:"昨日",TODAY:"今日",DAYS:"日前",HOURS:"時間前",MINUTES:"分前",JUST_NOW:"たった今",LOCATION:"場所",CANCEL:"キャンセル",INBOX:"受信箱",DESKTOP_NOTIFICATIONS:"ブラウザの通知",DESKTOP_NOTIFICATIONS_ERROR:"ブラウザの通知はブロックされているため、ブラウザの通知を有効にできません。設定を確認するか、別のブラウザを使用してください。",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} デモ通知`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"ブラウザのタブを開いたままにしておくと、誰かがあなたに話しかけたときにこのポップアップが表示されます。",SEND_BUTTON_TEXT:"送信",ENTRYBOX_TEXT_LIMIT:"許可されているのは10.000文字までです。",ENTRYBOX_PLACEHOLDER:"メッセージを入力してください",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"この会話はもうアクティブではありません。",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"あなたは読むことはできますが、メッセージを送ることはできません。",MESSAGELIST_LOADING_OLDER:"古いメッセージを読み込んでいます...",MESSAGELIST_SHOW_OLDER:"古いメッセージを表示",MESSAGELIST_NEW_MARKER:"新着",MESSAGE_SENT_VIA_EMAIL:"このメッセージはメールで送信されました",YOU_MARKER:"あなたは",UPLOAD_IN_PROGRESS:"アップロード中...",UPLOAD_SEND_FILE:"ファイル送信",UPLOAD_SHARE_LOCATION:"共有場所",UPLOAD_ERROR:"アップロード中に問題が発生しました。ファイルがサポートされていないか、大きすぎる可能性があります。",SHARE_LOCATION_ERROR:"場所を共有できません: ",LOADING:"読み込み中...",HUB_EMPTY:"あなたのチャット履歴がここに表示されます",HUB_SHOW_EARLIER:"以前のチャットを表示",INBOX_NO_CHATS_TITLE:"まだチャットがありません!",INBOX_NO_CHATS_BODY:"会話が1つ以上あると、ここに表示されます",ENABLE_TRANSLATION:"この会話を日本語に翻訳する",DISABLE_TRANSLATION:"オリジナルを表示",SEARCH_PLACEHOLDER_TEXT:"検索...",SEARCH_SEARCHING:"検索中...",SEARCH_NO_RESULTS:"結果が見つかりません",SEARCH_NO_MORE_RESULTS:"これ以上結果はありません",CHAT_NOT_FOUND:"チャットが見つかりませんでした",DELETE_MESSAGE:"メッセージを削除する",DELETION_EXPLANATION:"このメッセージを削除すると、全ての人に表示されなくなります。",EDIT_MESSAGE:"メッセージを編集する",SAVE:"上書き保存",EDITED_INDICATOR:"編集",REPLY_TO_MESSAGE:"返信する",ADD_REACTION:"リアクションを追加",AUTH_EXPIRED_OVERLAY_TITLE:"チャットセッションの有効期限が切れました",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"続けるにはページを更新してください",VOICE_MESSAGE:"ボイスメッセージ",CONTACT_INFORMATION_HIDDEN:"機密情報",LEAVE_CONVERSATION:"会話をやめる",MARK_CONVERSATION_AS_UNREAD:"未読としてマーク",STATUS_INDICATOR_ONLINE:"アクティブ",STATUS_INDICATOR_OFFLINE:"退席中",ARIA_LEAVE_SEARCH_MODE:"検索モードを終了",ARIA_SEARCH_UP:"上に検索",ARIA_SEARCH_DOWN:"下に検索",ARIA_CLOSE_CHAT_POPUP:"チャットポップアップを閉じる",ARIA_SEARCH_INSIDE_CONVERSATION:"この会話内を検索",ARIA_SEARCH:"検索",ARIA_CHAT:"チャット",ARIA_SET_PLAYBACK_SPEED:"再生速度を設定",ARIA_CANCEL_UPLOAD:"アップロードをキャンセル",ARIA_STOP_RECORDING:"録音を停止",ARIA_CANCEL_RECORDING:"録音をキャンセル",ARIA_INSERT_EMOJI:"絵文字を挿入",ARIA_PLAY_AUDIO:"音声を再生",ARIA_PAUSE_AUDIO:"音声を一時停止",ARIA_REACTION_COUNT:(n,e)=>`${n}件のリアクション(${e})`,ARIA_MORE_ACTIONS:"その他の操作",ARIA_REPLYING_TO:(n,e)=>`${n}に返信: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"返信モードを終了"}},ka:{code:"ka-GE",name:"Georgian",translation:{YESTERDAY:"გუშინ",TODAY:"დღეს",DAYS:"დღ",HOURS:"სთ",MINUTES:"წთ",JUST_NOW:"ახლა",LOCATION:"ადგილმდებარეობა",CANCEL:"გაუქმება",INBOX:"მიღებული შეტყობინება",DESKTOP_NOTIFICATIONS:"ბრაუზერის შეტყობინებები",DESKTOP_NOTIFICATIONS_ERROR:"შეუძლებელია ბრაუზერის შეტკობინებების ჩართვა. ეს ბრაუზერი ბლოკავს მათ. სცადე ცვლილება ოპციებიდან ან გამოიყენე სხვა ბრაუზერი.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} შეტყობინებების დემო ვერსია`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"თუ დატოვებ ბრაუზერის ფანჯარას გახსნილს, როცა ვიღაც მოგწერს საუბარი ამოვარდება დესკტოპზე.",SEND_BUTTON_TEXT:"გაგზავნა",ENTRYBOX_TEXT_LIMIT:"დაშვებულია მხოლოდ 10.000 სიმბოლო.",ENTRYBOX_PLACEHOLDER:"დაწერე რაღაც...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"ეს დიალოგი აღარ არის ხელმისაწვდომი.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"შეგიძლია წაიკითხო, მაგრამ ვერ გააგზავნი შეტყობინებას.",MESSAGELIST_LOADING_OLDER:"იტვირთება ძველი შეტყობინებები...",MESSAGELIST_SHOW_OLDER:"ძველი შეტყობინებების ჩვენება",MESSAGELIST_NEW_MARKER:"ახალი",MESSAGE_SENT_VIA_EMAIL:"ეს შეტყობინება გამოგზავნილია იმეილით",YOU_MARKER:"you",UPLOAD_IN_PROGRESS:"იტვირთება...",UPLOAD_SEND_FILE:"ფაილის გაგზავნა",UPLOAD_SHARE_LOCATION:"ადგილმდებარეობის გაზიარება",UPLOAD_ERROR:"პრობლემაა ატვირთვისას. ფაილის შესაძლოა არის არათავსებადი ან ძალიან დიდი.",SHARE_LOCATION_ERROR:"შეუძლებელია ადგილმდებარეობის გაზიარება: ",LOADING:"იტვირთება...",HUB_EMPTY:"საუბრების ისტორია გამოჩნდება აქ",HUB_SHOW_EARLIER:"წინა საუბრების ნახვა",INBOX_NO_CHATS_TITLE:"ჯერ-ჯერობით არ არის საუბრები!",INBOX_NO_CHATS_BODY:"უკვე დასრულებული საუბარები გამოჩნდება აქ",ENABLE_TRANSLATION:"თარგმნეთ ეს საუბარი ინგლისურად",DISABLE_TRANSLATION:"ორიგინალის ჩვენება",SEARCH_PLACEHOLDER_TEXT:"ძიება...",SEARCH_SEARCHING:"მიმდინარეობს ძიება...",SEARCH_NO_RESULTS:"შედეგები ვერ ქართველი",SEARCH_NO_MORE_RESULTS:"სხვა შედეგი ვერ მოიძებნა",CHAT_NOT_FOUND:"ჩატი ვერ მოიძებნა",DELETE_MESSAGE:"შეტყობინების წაშლა ",DELETION_EXPLANATION:"თუ ამ შეტყობინებას წაშლით, ის ყველასთვის გაქრება.",EDIT_MESSAGE:"შეტყობინების რედაქტირება",SAVE:"შენახვა",EDITED_INDICATOR:"რედაქტირებულია",REPLY_TO_MESSAGE:"პასუხის გაცემა",ADD_REACTION:"დაამატეთ რეაქცია",AUTH_EXPIRED_OVERLAY_TITLE:"თქვენი ჩეთის სესიის ვადა ამოიწურა",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"განაახლეთ გვერდი გასაგრძელებლად",VOICE_MESSAGE:"ხმოვანი შეტყობინება",LEAVE_CONVERSATION:"საუბრის დატოვება",MARK_CONVERSATION_AS_UNREAD:"წაუკითხავად მონიშვნა",STATUS_INDICATOR_ONLINE:"აქტიური",STATUS_INDICATOR_OFFLINE:"გამორთული",CONTACT_INFORMATION_HIDDEN:"ფარული ინფორმაცია",ARIA_LEAVE_SEARCH_MODE:"ძიების რეჟიმიდან გასვლა",ARIA_SEARCH_UP:"ძიება ზემოთ",ARIA_SEARCH_DOWN:"ძიება ქვემოთ",ARIA_CLOSE_CHAT_POPUP:"ჩეთის ფანჯრის დახურვა",ARIA_SEARCH_INSIDE_CONVERSATION:"ძიება ამ საუბარში",ARIA_SEARCH:"ძიება",ARIA_CHAT:"ჩეთი",ARIA_SET_PLAYBACK_SPEED:"გადახვევის სიჩქარის დაყენება",ARIA_CANCEL_UPLOAD:"ატვირთვის გაუქმება",ARIA_STOP_RECORDING:"ჩაწერის შეჩერება",ARIA_CANCEL_RECORDING:"ჩაწერის გაუქმება",ARIA_INSERT_EMOJI:"ემოჯის ჩასმა",ARIA_PLAY_AUDIO:"აუდიოს დაკვრა",ARIA_PAUSE_AUDIO:"აუდიოს შეჩერება",ARIA_REACTION_COUNT:(n,e)=>`${n} რეაქცია (${e})`,ARIA_MORE_ACTIONS:"მეტი ქმედება",ARIA_REPLYING_TO:(n,e)=>`პასუხი ${n}-ს: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"პასუხის რეჟიმიდან გასვლა"}},ko:{code:"ko-KR",name:"Korean (South Korea)",translation:{YESTERDAY:"어제",TODAY:"오늘",DAYS:"일 전",HOURS:"시간 전",MINUTES:"분 전",JUST_NOW:"방금",LOCATION:"위치",CANCEL:"취소",INBOX:"대화 목록",DESKTOP_NOTIFICATIONS:"브라우저 알림",DESKTOP_NOTIFICATIONS_ERROR:"브라우저 알림을 표시할 수 없습니다. 브라우저 설정을 확인하거나 다른 브라우저를 사용해주세요.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} 데모 알림`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"브라우저 탭을 열어 둔 상태에서 누군가 대화 할 때 이 팝업이 표시됩니다.",SEND_BUTTON_TEXT:"전송",ENTRYBOX_TEXT_LIMIT:"최대 10,000자까지 입력할 수 있습니다.",ENTRYBOX_PLACEHOLDER:"메세지를 입력하세요...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"채팅이 종료되었습니다.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"읽기만 가능하며 메시지를 보낼 수 없습니다.",MESSAGELIST_LOADING_OLDER:"이전 메시지 로드 중...",MESSAGELIST_SHOW_OLDER:"이전 메시지 표시",MESSAGELIST_NEW_MARKER:"새 메시지",MESSAGE_SENT_VIA_EMAIL:"이 메시지는 이메일을 통해 전송되었습니다.",YOU_MARKER:"나",UPLOAD_IN_PROGRESS:"업로드 중...",UPLOAD_SEND_FILE:"파일 전송",UPLOAD_SHARE_LOCATION:"위치 공유",UPLOAD_ERROR:"업로드가 실패했습니다. 파일이 지원되지 않거나 너무 클 수 있습니다.",SHARE_LOCATION_ERROR:"위치를 공유 할 수 없습니다: ",LOADING:"로드 중...",HUB_EMPTY:"채팅 기록이 여기에 표시됩니다",HUB_SHOW_EARLIER:"이전 채팅보기",INBOX_NO_CHATS_TITLE:"아직 채팅이 없습니다!",INBOX_NO_CHATS_BODY:"대화가 하나 이상 있으면 여기에 표시됩니다.",ENABLE_TRANSLATION:"이 대화를 한국어로 번역",DISABLE_TRANSLATION:"원본 표시",SEARCH_PLACEHOLDER_TEXT:"검색...",SEARCH_SEARCHING:"검색 중...",SEARCH_NO_RESULTS:"검색 결과 없음",SEARCH_NO_MORE_RESULTS:"추가 검색 결과 없음",CHAT_NOT_FOUND:"대화를 찾지 못했습니다",DELETE_MESSAGE:"메시지 삭제",DELETION_EXPLANATION:"이 메시지를 삭제하면 모든 사람이 볼 수 없게 됩니다.",EDIT_MESSAGE:"메시지 편집하기",SAVE:"저장",EDITED_INDICATOR:"편집",REPLY_TO_MESSAGE:"회신",ADD_REACTION:"반응 추가",AUTH_EXPIRED_OVERLAY_TITLE:"채팅 세션이 만료되었습니다",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"계속하려면 페이지를 새로고침하세요",VOICE_MESSAGE:"음성 메시지",CONTACT_INFORMATION_HIDDEN:"숨겨진 정보",LEAVE_CONVERSATION:"대화 떠나기",MARK_CONVERSATION_AS_UNREAD:"읽지 않은 상태로 표시",STATUS_INDICATOR_ONLINE:"활성",STATUS_INDICATOR_OFFLINE:"부재중",ARIA_LEAVE_SEARCH_MODE:"검색 모드 종료",ARIA_SEARCH_UP:"위로 검색",ARIA_SEARCH_DOWN:"아래로 검색",ARIA_CLOSE_CHAT_POPUP:"채팅 팝업 닫기",ARIA_SEARCH_INSIDE_CONVERSATION:"이 대화 내 검색",ARIA_SEARCH:"검색",ARIA_CHAT:"채팅",ARIA_SET_PLAYBACK_SPEED:"재생 속도 설정",ARIA_CANCEL_UPLOAD:"업로드 취소",ARIA_STOP_RECORDING:"녹음 중지",ARIA_CANCEL_RECORDING:"녹음 취소",ARIA_INSERT_EMOJI:"이모지 삽입",ARIA_PLAY_AUDIO:"오디오 재생",ARIA_PAUSE_AUDIO:"오디오 일시 정지",ARIA_REACTION_COUNT:(n,e)=>`${n}개 반응 (${e})`,ARIA_MORE_ACTIONS:"추가 작업",ARIA_REPLYING_TO:(n,e)=>`${n}에게 답장: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"답장 모드 종료"}},nb:{code:"nb-NO",name:"Norwegian (Bokmål)",translation:{YESTERDAY:"I går",TODAY:"I dag",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"Nå",LOCATION:"Plassering",CANCEL:"Avbryt",INBOX:"Innboks",DESKTOP_NOTIFICATIONS:"Nettleservarsler",DESKTOP_NOTIFICATIONS_ERROR:"Kan ikke aktivere Nettleservarsler fordi nettleseren din aktivt blokkerer dem. Prøv å se i innstillingene eller bruke en annen nettleser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo varslinger`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Hvis du holder nettleservinduet åpent, vil du se dette varsel når noen snakker til deg.",SEND_BUTTON_TEXT:"Send",ENTRYBOX_TEXT_LIMIT:"Kun 10.000 tegn er tillatt.",ENTRYBOX_PLACEHOLDER:"Si noe...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Denne samtale er ikke lengre aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Du kan lese, men ikke sende meldinger.",MESSAGELIST_LOADING_OLDER:"Laster eldre meldinger...",MESSAGELIST_SHOW_OLDER:"Vis eldre meldinger",MESSAGELIST_NEW_MARKER:"Ny",MESSAGE_SENT_VIA_EMAIL:"Denne meldingen er sendt via e-post",YOU_MARKER:"deg",UPLOAD_IN_PROGRESS:"Laster opp...",UPLOAD_SEND_FILE:"Send fil",UPLOAD_SHARE_LOCATION:"Del din plassering",UPLOAD_ERROR:"Noe gikk galt i uplastingen. Det kan være filen ikke støttes eller for stor.",SHARE_LOCATION_ERROR:"Kan ikke dele plasseringen: ",LOADING:"Laster...",HUB_EMPTY:"Din chats historikk vil vises her",HUB_SHOW_EARLIER:"Vis tidligere chats",INBOX_NO_CHATS_TITLE:"Ingen chats enda!",INBOX_NO_CHATS_BODY:"Så snart du får en eller flere samtaler, vil de vises her.",ENABLE_TRANSLATION:"Oversett denne samtalen til norsk",DISABLE_TRANSLATION:"Vis original",SEARCH_PLACEHOLDER_TEXT:"Søk...",SEARCH_SEARCHING:"Søker...",SEARCH_NO_RESULTS:"Finner ingen resultater",SEARCH_NO_MORE_RESULTS:"Ingen flere resultater",CHAT_NOT_FOUND:"Chat ikke funnet",DELETE_MESSAGE:"Slett melding",DELETION_EXPLANATION:"Hvis du sletter denne meldingen, forsvinner den for alle.",EDIT_MESSAGE:"Rediger melding",SAVE:"Lagre",EDITED_INDICATOR:"redigert",REPLY_TO_MESSAGE:"Svar",ADD_REACTION:"Legg til reaksjon",AUTH_EXPIRED_OVERLAY_TITLE:"Chatøkten er utløpt",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Oppdater siden for å fortsette",VOICE_MESSAGE:"Lydmelding",CONTACT_INFORMATION_HIDDEN:"Skjult informasjon",LEAVE_CONVERSATION:"Forlat samtalen",MARK_CONVERSATION_AS_UNREAD:"Merk som ulest",STATUS_INDICATOR_ONLINE:"Aktiv",STATUS_INDICATOR_OFFLINE:"Borte",ARIA_LEAVE_SEARCH_MODE:"Forlat søkemodus",ARIA_SEARCH_UP:"Søk oppover",ARIA_SEARCH_DOWN:"Søk nedover",ARIA_CLOSE_CHAT_POPUP:"Lukk chatvindu",ARIA_SEARCH_INSIDE_CONVERSATION:"Søk i denne samtalen",ARIA_SEARCH:"Søk",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"angi avspillingshastighet",ARIA_CANCEL_UPLOAD:"Avbryt opplasting",ARIA_STOP_RECORDING:"Stopp opptak",ARIA_CANCEL_RECORDING:"Avbryt opptak",ARIA_INSERT_EMOJI:"Sett inn en emoji",ARIA_PLAY_AUDIO:"spill av lyd",ARIA_PAUSE_AUDIO:"pause lyd",ARIA_REACTION_COUNT:(n,e)=>`${n} reaksjoner med ${e}`,ARIA_MORE_ACTIONS:"Flere handlinger",ARIA_REPLYING_TO:(n,e)=>`Svarer til ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Avslutt svarmodus"}},nl:{code:"nl-NL",name:"Dutch",translation:{YESTERDAY:"Gisteren",TODAY:"Vandaag",DAYS:"d",HOURS:"u",MINUTES:"m",JUST_NOW:"zojuist",LOCATION:"Locatie",CANCEL:"Annuleren",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Browsermeldingen",DESKTOP_NOTIFICATIONS_ERROR:"Browsermeldingen kunnen niet geactiveerd worden omdat de browser het blokkeert. Check de instellingen van je browser of probeer een andere browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notificatie`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Als je je browser open houdt, zie je deze popup als iemand tegen je praat.",SEND_BUTTON_TEXT:"Verzenden",ENTRYBOX_TEXT_LIMIT:"Maximaal 10.000 tekens toegestaan.",ENTRYBOX_PLACEHOLDER:"Typ een bericht...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Dit gesprek is niet actief meer.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Je kunt geen berichten sturen.",MESSAGELIST_LOADING_OLDER:"Eerdere berichten laden...",MESSAGELIST_SHOW_OLDER:"Laad eerdere berichten",MESSAGELIST_NEW_MARKER:"Nieuw",MESSAGE_SENT_VIA_EMAIL:"Dit bericht is verstuurd via e-mail",YOU_MARKER:"jij",UPLOAD_IN_PROGRESS:"Uploaden...",UPLOAD_SEND_FILE:"Verzend bestand",UPLOAD_SHARE_LOCATION:"Deel locatie",UPLOAD_ERROR:"Er ging iets mis. Het bestand wordt niet ondersteund of is te groot.",SHARE_LOCATION_ERROR:"Locatie delen mislukt: ",LOADING:"Bezig met laden...",HUB_EMPTY:"Berichtengeschiedenis wordt hier weergegeven",HUB_SHOW_EARLIER:"Laat eerdere berichten zien",INBOX_NO_CHATS_TITLE:"Nog geen chats!",INBOX_NO_CHATS_BODY:"Zodra je een of meerdere conversaties hebt gehad, worden deze hier weergegeven.",ENABLE_TRANSLATION:"Vertaal dit gesprek naar het Nederlands",DISABLE_TRANSLATION:"Toon oorspronkelijk gesprek",SEARCH_PLACEHOLDER_TEXT:"Zoek...",SEARCH_SEARCHING:"Zoeken...",SEARCH_NO_RESULTS:"Geen resultaten gevonden",SEARCH_NO_MORE_RESULTS:"Niet meer resultaten",CHAT_NOT_FOUND:"Chat niet gevonden",DELETE_MESSAGE:"Bericht verwijderen",DELETION_EXPLANATION:"Als je dit bericht verwijdert, zal het voor iedereen verdwijnen.",EDIT_MESSAGE:"Bericht bewerken",SAVE:"Opslaan",EDITED_INDICATOR:"bewerkt",REPLY_TO_MESSAGE:"Beantwoorden",ADD_REACTION:"Reactie toevoegen",AUTH_EXPIRED_OVERLAY_TITLE:"Je chatsessie is verlopen",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Ververs de pagina om door te gaan",VOICE_MESSAGE:"Spraakbericht",LEAVE_CONVERSATION:"Gesprek verlaten",MARK_CONVERSATION_AS_UNREAD:"Markeren als ongelezen",STATUS_INDICATOR_ONLINE:"Online",STATUS_INDICATOR_OFFLINE:"Offline",CONTACT_INFORMATION_HIDDEN:"verborgen informatie",ARIA_LEAVE_SEARCH_MODE:"Zoekmodus verlaten",ARIA_SEARCH_UP:"Omhoog zoeken",ARIA_SEARCH_DOWN:"Omlaag zoeken",ARIA_CLOSE_CHAT_POPUP:"Chatvenster sluiten",ARIA_SEARCH_INSIDE_CONVERSATION:"Zoeken in dit gesprek",ARIA_SEARCH:"Zoeken",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"Afspeelsnelheid instellen",ARIA_CANCEL_UPLOAD:"Upload annuleren",ARIA_STOP_RECORDING:"Opname stoppen",ARIA_CANCEL_RECORDING:"Opname annuleren",ARIA_INSERT_EMOJI:"Een emoji invoegen",ARIA_PLAY_AUDIO:"Audio afspelen",ARIA_PAUSE_AUDIO:"Audio pauzeren",ARIA_REACTION_COUNT:(n,e)=>`${n} Reacties met ${e}`,ARIA_MORE_ACTIONS:"Meer acties",ARIA_REPLYING_TO:(n,e)=>`Beantwoorden aan ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Verlaat antwoordmodus"}},pl:{code:"pl-PL",name:"Polish",translation:{YESTERDAY:"Wczoraj",TODAY:"Dzisiaj",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"teraz",LOCATION:"Lokalizacja",CANCEL:"Anuluj",INBOX:"Skrzynka odbiorcza",DESKTOP_NOTIFICATIONS:"Powiadomienia",DESKTOP_NOTIFICATIONS_ERROR:"Nie można aktywować powiadomień, ponieważ twoja przeglądarka je blokuje. Proszę zmienić ustawienie lub spróbować innej przeglądarki.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} przykładowe powiadomienie`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Jeśli zostawisz tę kartę otwartą, zobaczysz takie powiadomienie, gdy ktoś napisze do Ciebie.",SEND_BUTTON_TEXT:"Wyślij",ENTRYBOX_TEXT_LIMIT:"Nie można wysyłać więcej niż 10000 znaków.",ENTRYBOX_PLACEHOLDER:"Napisz coś...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ten czat nie jest aktywny.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Możesz czytać wiadomości, ale nie możesz ich wysyłać.",MESSAGELIST_LOADING_OLDER:"Wczytuję starsze wiadomości...",MESSAGELIST_SHOW_OLDER:"Zobacz starsze wiadomości",MESSAGELIST_NEW_MARKER:"Nowe",MESSAGE_SENT_VIA_EMAIL:"Ta wiadomość została wysłana przez email.",YOU_MARKER:"ty",UPLOAD_IN_PROGRESS:"Przesyłanie...",UPLOAD_SEND_FILE:"Prześlij plik",UPLOAD_SHARE_LOCATION:"Udostępnij lokalizację",UPLOAD_ERROR:"Coś poszło nie tak. Plik może być zbyt duży lub jest nieobsługiwany.",SHARE_LOCATION_ERROR:"Nie da się udostępnić lokalizacji: ",LOADING:"Ładowanie...",HUB_EMPTY:"Twoje czaty pojawią się tutaj",HUB_SHOW_EARLIER:"Zobacz starsze czaty",INBOX_NO_CHATS_TITLE:"Brak czatów!",INBOX_NO_CHATS_BODY:"Rozpoczęte konwersacje pojawią się tutaj.",ENABLE_TRANSLATION:"Przetłumacz tę konwersację na język polski",DISABLE_TRANSLATION:"Pokaż oryginał",SEARCH_PLACEHOLDER_TEXT:"Wyszukaj...",SEARCH_SEARCHING:"Wyszukiwanie...",SEARCH_NO_RESULTS:"Nie znaleziono wyników",SEARCH_NO_MORE_RESULTS:"Nie ma innych wyników",CHAT_NOT_FOUND:"Nie znaleziono konwersacji",DELETE_MESSAGE:"Usuń wiadomość",DELETION_EXPLANATION:"Jeśli usuniesz tę wiadomość, przestanie być widoczna dla wszystkich.",EDIT_MESSAGE:"Edytuj wiadomość",SAVE:"Zapisz",EDITED_INDICATOR:"edytowano",REPLY_TO_MESSAGE:"Odpowiedz",ADD_REACTION:"Dodaj reakcję",AUTH_EXPIRED_OVERLAY_TITLE:"Twoja sesja wygasła",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Odśwież stronę, aby kontynuować",VOICE_MESSAGE:"Wiadomość głosowa",CONTACT_INFORMATION_HIDDEN:"Ukryte informacje",LEAVE_CONVERSATION:"Opuść konwersację",MARK_CONVERSATION_AS_UNREAD:"Oznacz jako nieprzeczytane",STATUS_INDICATOR_ONLINE:"Aktywny",STATUS_INDICATOR_OFFLINE:"Nieobecny",ARIA_LEAVE_SEARCH_MODE:"Wyjdź z trybu wyszukiwania",ARIA_SEARCH_UP:"Szukaj w górę",ARIA_SEARCH_DOWN:"Szukaj w dół",ARIA_CLOSE_CHAT_POPUP:"Zamknij okno czatu",ARIA_SEARCH_INSIDE_CONVERSATION:"Szukaj w tej konwersacji",ARIA_SEARCH:"Szukaj",ARIA_CHAT:"Czat",ARIA_SET_PLAYBACK_SPEED:"ustaw prędkość odtwarzania",ARIA_CANCEL_UPLOAD:"Anuluj przesyłanie",ARIA_STOP_RECORDING:"Zatrzymaj nagrywanie",ARIA_CANCEL_RECORDING:"Anuluj nagrywanie",ARIA_INSERT_EMOJI:"Wstaw emoji",ARIA_PLAY_AUDIO:"odtwórz audio",ARIA_PAUSE_AUDIO:"wstrzymaj audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reakcji z ${e}`,ARIA_MORE_ACTIONS:"Więcej akcji",ARIA_REPLYING_TO:(n,e)=>`Odpowiadanie na ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Wyjdź z trybu odpowiedzi"}},pt:{code:"pt-BR",name:"Portuguese (Brazil)",translation:{YESTERDAY:"Ontem",TODAY:"Hoje",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"agora mesmo",LOCATION:"Localização",CANCEL:"Cancelar",INBOX:"Caixa de entrada",DESKTOP_NOTIFICATIONS:"Notificações do navegador",DESKTOP_NOTIFICATIONS_ERROR:"Não é possível ativar as notificações da navegador porque seu navegador as bloqueia. Tente procurar nas configurações ou usar um navegador diferente.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} notificação de demonstração`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Se você mantiver a guia do navegador aberta, verá essa mensagem quando alguém falar com você.",SEND_BUTTON_TEXT:"Enviar",ENTRYBOX_TEXT_LIMIT:"Apenas 10.000 caracteres são permitidos.",ENTRYBOX_PLACEHOLDER:"Diga algo...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Esta conversa não está mais ativa.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Você pode ler, mas não enviar mensagens.",MESSAGELIST_LOADING_OLDER:"Carregando mensagens antigas...",MESSAGELIST_SHOW_OLDER:"Mostrar mensagens mais antigas",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Esta mensagem foi enviada via email.",YOU_MARKER:"Você",UPLOAD_IN_PROGRESS:"Carregando...",UPLOAD_SEND_FILE:"Enviar arquivo",UPLOAD_SHARE_LOCATION:"Compartilhar localização",UPLOAD_ERROR:"Algo deu errado ao fazer o upload. O arquivo pode não ter suporte ou ser muito grande.",SHARE_LOCATION_ERROR:"Não é possível compartilhar o local: ",LOADING:"Carregando...",HUB_EMPTY:"Seu histórico de conversas será exibido aqui",HUB_SHOW_EARLIER:"Mostrar conversas anteriores",INBOX_NO_CHATS_TITLE:"Ainda não há chats!",INBOX_NO_CHATS_BODY:"Depois de ter uma ou mais conversas, elas serão exibidas aqui.",ENABLE_TRANSLATION:"Traduzir esta conversa para português",DISABLE_TRANSLATION:"Ver a conversa não traduzida",SEARCH_PLACEHOLDER_TEXT:"Busca...",SEARCH_SEARCHING:"Consultando...",SEARCH_NO_RESULTS:"Resultados nao encontrados",SEARCH_NO_MORE_RESULTS:"Não há mais resultados",CHAT_NOT_FOUND:"Conversa não encontrada",DELETE_MESSAGE:"Excluir mensagem",DELETION_EXPLANATION:"Se você excluir esta mensagem, ela desaparecerá para todos.",EDIT_MESSAGE:"Editar mensagem",SAVE:"Salvar",EDITED_INDICATOR:"editada",REPLY_TO_MESSAGE:"Responder",ADD_REACTION:"Adicionar reação",AUTH_EXPIRED_OVERLAY_TITLE:"Sua sessão de chat expirou",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Atualize a página para continuar",VOICE_MESSAGE:"Mensagem de voz",LEAVE_CONVERSATION:"Sair da conversa",MARK_CONVERSATION_AS_UNREAD:"Marcar como não lida",STATUS_INDICATOR_ONLINE:"Online",STATUS_INDICATOR_OFFLINE:"Offline",CONTACT_INFORMATION_HIDDEN:"Informação oculta",ARIA_LEAVE_SEARCH_MODE:"Sair do modo de pesquisa",ARIA_SEARCH_UP:"Pesquisar para cima",ARIA_SEARCH_DOWN:"Pesquisar para baixo",ARIA_CLOSE_CHAT_POPUP:"Fechar janela de chat",ARIA_SEARCH_INSIDE_CONVERSATION:"Pesquisar nesta conversa",ARIA_SEARCH:"Pesquisar",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"definir velocidade de reprodução",ARIA_CANCEL_UPLOAD:"Cancelar envio",ARIA_STOP_RECORDING:"Parar gravação",ARIA_CANCEL_RECORDING:"Cancelar gravação",ARIA_INSERT_EMOJI:"Inserir um emoji",ARIA_PLAY_AUDIO:"reproduzir áudio",ARIA_PAUSE_AUDIO:"pausar áudio",ARIA_REACTION_COUNT:(n,e)=>`${n} reações com ${e}`,ARIA_MORE_ACTIONS:"Mais ações",ARIA_REPLYING_TO:(n,e)=>`Respondendo a ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Sair do modo de resposta"}},ro:{code:"ro-RO",name:"Romanian (Romania)",translation:{YESTERDAY:"Ieri",TODAY:"Astăzi",DAYS:"z",HOURS:"o",MINUTES:"m",JUST_NOW:"chiar acum",LOCATION:"Locație",CANCEL:"Anulare",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Notificări browser",DESKTOP_NOTIFICATIONS_ERROR:"Nu se pot activa notificări browser deoarece browserul dvs. le blochează în mod activ. Încercați să căutați în setări sau utilizând un alt browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`Notificare de debit ${n}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Dacă țineți fișa browserului deschis, veți vedea acest pop-up atunci când cineva vorbește cu dvs.",SEND_BUTTON_TEXT:"Trimiteți",ENTRYBOX_TEXT_LIMIT:"Sunt permise numai 10.000 de caractere.",ENTRYBOX_PLACEHOLDER:"Spune ceva...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Această conversație nu mai este activă.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Puteți citi, dar nu puteți trimite mesaje.",MESSAGELIST_LOADING_OLDER:"Încărcarea mesajelor mai vechi...",MESSAGELIST_SHOW_OLDER:"Afișați mesaje mai vechi",MESSAGELIST_NEW_MARKER:"Nou",MESSAGE_SENT_VIA_EMAIL:"Acest mesaj a fost trimis prin e-mail",YOU_MARKER:"voi",UPLOAD_IN_PROGRESS:"Încărcarea...",UPLOAD_SEND_FILE:"Trimiteți fișierul",UPLOAD_SHARE_LOCATION:"Distribuiți locația",UPLOAD_ERROR:"Sa încărcat ceva în mod greșit. Fișierul ar putea fi neacceptat sau prea mare.",SHARE_LOCATION_ERROR:"Nu se poate partaja locația: ",LOADING:"Încărcare...",HUB_EMPTY:"Istoricul chat-ului dvs. va apărea aici",HUB_SHOW_EARLIER:"Afișați discuțiile anterioare",INBOX_NO_CHATS_TITLE:"Încă nu vorbești!",INBOX_NO_CHATS_BODY:"După ce ați avut una sau mai multe conversații, acestea vor apărea aici.",ENABLE_TRANSLATION:"Traduceți această conversație în română",DISABLE_TRANSLATION:"Arată originalul",SEARCH_PLACEHOLDER_TEXT:"Căutare...",SEARCH_SEARCHING:"Se caută...",SEARCH_NO_RESULTS:"Nu s-au găsit rezultate",SEARCH_NO_MORE_RESULTS:"Nu mai există rezultate",CHAT_NOT_FOUND:"Conversația nu a fost găsită",DELETE_MESSAGE:"Șterge mesajul",DELETION_EXPLANATION:"Dacă ștergi acest mesaj, acesta va dispărea pentru toată lumea.",EDIT_MESSAGE:"Redactează mesajul",SAVE:"Salvare",EDITED_INDICATOR:"editat",REPLY_TO_MESSAGE:"Răspundeți",ADD_REACTION:"Adaugă o reacție",AUTH_EXPIRED_OVERLAY_TITLE:"Sesiunea dumneavoastră de chat a expirat",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Reîmprospătați pagina pentru a continua",VOICE_MESSAGE:"Mesaj vocal",CONTACT_INFORMATION_HIDDEN:"Informații ascunse",LEAVE_CONVERSATION:"Părăsește conversația",MARK_CONVERSATION_AS_UNREAD:"Marcheaza ca necitit",STATUS_INDICATOR_ONLINE:"Activ",STATUS_INDICATOR_OFFLINE:"Plecat",ARIA_LEAVE_SEARCH_MODE:"Părăsește modul de căutare",ARIA_SEARCH_UP:"Caută în sus",ARIA_SEARCH_DOWN:"Caută în jos",ARIA_CLOSE_CHAT_POPUP:"Închide fereastra de chat",ARIA_SEARCH_INSIDE_CONVERSATION:"Caută în această conversație",ARIA_SEARCH:"Caută",ARIA_CHAT:"Chat",ARIA_SET_PLAYBACK_SPEED:"setează viteza de redare",ARIA_CANCEL_UPLOAD:"Anulează încărcarea",ARIA_STOP_RECORDING:"Oprește înregistrarea",ARIA_CANCEL_RECORDING:"Anulează înregistrarea",ARIA_INSERT_EMOJI:"Inserează un emoji",ARIA_PLAY_AUDIO:"redă audio",ARIA_PAUSE_AUDIO:"pauză audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reacții cu ${e}`,ARIA_MORE_ACTIONS:"Mai multe acțiuni",ARIA_REPLYING_TO:(n,e)=>`Răspuns la ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Părăsește modul de răspuns"}},ru:{code:"ru-RU",name:"Russian",translation:{YESTERDAY:"Вчера",TODAY:"Сегодня",DAYS:"д",HOURS:"ч",MINUTES:"м",JUST_NOW:"только что",LOCATION:"Местоположение",CANCEL:"Отмена",INBOX:"Входящие",DESKTOP_NOTIFICATIONS:"Оповещения",DESKTOP_NOTIFICATIONS_ERROR:"Невозможно включить оповещения, потому что ваш браузер активно блокирует их. Проверьте ваши настройки или попробуйте другой браузер.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} демо-оповещение`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Если вкладка вашего браузера открыта, вы увидите всплывающее окошко оповещения когда кто-то отправит вам сообщение.",SEND_BUTTON_TEXT:"Отправить",ENTRYBOX_TEXT_LIMIT:"Разрешено использовать только 10 тысяч символов.",ENTRYBOX_PLACEHOLDER:"Напишите что-нибудь...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Этот разговор больше неактивен.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Вы можете читать, но не отправлять сообщения.",MESSAGELIST_LOADING_OLDER:"Загрузка старых сообщения...",MESSAGELIST_SHOW_OLDER:"Показать старые сообщения",MESSAGELIST_NEW_MARKER:"Новые",MESSAGE_SENT_VIA_EMAIL:"Это сообщение было отправлено по электронной почте",YOU_MARKER:"вы",UPLOAD_IN_PROGRESS:"Загрузка...",UPLOAD_SEND_FILE:"Отправить файл",UPLOAD_SHARE_LOCATION:"Поделиться местоположением",UPLOAD_ERROR:"Что-то пошло не так: такой файл не поддерживается или он слишком большой.",SHARE_LOCATION_ERROR:"Не удается поделиться местоположением: ",LOADING:"Загрузка...",HUB_EMPTY:"Здесь появится ваша история чата",HUB_SHOW_EARLIER:"Показать предыдущие чаты",INBOX_NO_CHATS_TITLE:"Пока нет чатов!",INBOX_NO_CHATS_BODY:"Как только у вас будет один или несколько разговоров, они появятся здесь.",ENABLE_TRANSLATION:"Переведите этот разговор на русский",DISABLE_TRANSLATION:"Show source",SEARCH_PLACEHOLDER_TEXT:"поиск...",SEARCH_SEARCHING:"Поиск...",SEARCH_NO_RESULTS:"Результаты не найдены",SEARCH_NO_MORE_RESULTS:"Больше результатов нет",CHAT_NOT_FOUND:"Чат не найден",DELETE_MESSAGE:"Удалить сообщение",DELETION_EXPLANATION:"Если вы удалите это сообщение, оно исчезнет для всех.",EDIT_MESSAGE:"Изменить сообщение",SAVE:"сохранить",EDITED_INDICATOR:"изменено",REPLY_TO_MESSAGE:"Ответить",ADD_REACTION:"Добавить реакцию",AUTH_EXPIRED_OVERLAY_TITLE:"Срок действия вашего сеанса чата истек",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Обновите страницу, чтобы продолжить",VOICE_MESSAGE:"Голосовое сообщение",CONTACT_INFORMATION_HIDDEN:"Информация скрыта",LEAVE_CONVERSATION:"Выйти из беседы",MARK_CONVERSATION_AS_UNREAD:"Отметить как непрочитанное",STATUS_INDICATOR_ONLINE:"Активен",STATUS_INDICATOR_OFFLINE:"Не в сети",ARIA_LEAVE_SEARCH_MODE:"Выйти из режима поиска",ARIA_SEARCH_UP:"Искать вверх",ARIA_SEARCH_DOWN:"Искать вниз",ARIA_CLOSE_CHAT_POPUP:"Закрыть окно чата",ARIA_SEARCH_INSIDE_CONVERSATION:"Искать в этом разговоре",ARIA_SEARCH:"Поиск",ARIA_CHAT:"Чат",ARIA_SET_PLAYBACK_SPEED:"установить скорость воспроизведения",ARIA_CANCEL_UPLOAD:"Отменить загрузку",ARIA_STOP_RECORDING:"Остановить запись",ARIA_CANCEL_RECORDING:"Отменить запись",ARIA_INSERT_EMOJI:"Вставить эмодзи",ARIA_PLAY_AUDIO:"воспроизвести аудио",ARIA_PAUSE_AUDIO:"приостановить аудио",ARIA_REACTION_COUNT:(n,e)=>`${n} реакций с ${e}`,ARIA_MORE_ACTIONS:"Дополнительные действия",ARIA_REPLYING_TO:(n,e)=>`Ответ на ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Выйти из режима ответа"}},sq:{code:"sq-AL",name:"Albanian",translation:{YESTERDAY:"Dje",TODAY:"Sot",DAYS:"d",HOURS:"o",MINUTES:"m",JUST_NOW:"Tani",LOCATION:"Pozicion",CANCEL:"Anulo",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Njoftimet e shfletuesit",DESKTOP_NOTIFICATIONS_ERROR:"Nuk mund të aktivizohen njoftimet në shfletues sepse shfletuesi juaj i bllokon ato në mënyrë aktive. Provoni të shikoni cilësimet ose përdorni një shfletues të ndryshëm.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} njoftime në desktop`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Lënia e skedës së shfletuesit tuaj të hapur do të pop-up kur dikush flet me ju.",SEND_BUTTON_TEXT:"Dërgo",ENTRYBOX_TEXT_LIMIT:"Lejohen vetëm 10,000 karaktere",ENTRYBOX_PLACEHOLDER:"Thuaj diçka...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Kjo bisedë nuk është më aktive.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Mund të lexoni por jo të dërgoni mesazhe.",MESSAGELIST_LOADING_OLDER:"Duke ngarkuar mesazhe më të vjetra...",MESSAGELIST_SHOW_OLDER:"Trego mesazhe më të vjetra",MESSAGELIST_NEW_MARKER:"E ri",MESSAGE_SENT_VIA_EMAIL:"Ky mesazh u dërgua si email",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Ngarkim...",UPLOAD_SEND_FILE:"Dërgo datotekën",UPLOAD_SHARE_LOCATION:"Ndani lokacionin",UPLOAD_ERROR:"Na vjen keq, diçka nuk shkoi si duhet. Dosja mund të mos ket mbështetje ose mund të jetë shumë e madhe.",SHARE_LOCATION_ERROR:"Nuk mund të ndahet lokacioni: ",LOADING:"Ngarkim...",HUB_EMPTY:"Këtu do të paraqitet/ shfaqet historia e bisedës tuaj",HUB_SHOW_EARLIER:"Shfaqi bisedat e mëparshme",INBOX_NO_CHATS_TITLE:"Nuk ka biseda!",INBOX_NO_CHATS_BODY:"Pasi të keni një ose më shumë biseda, ato do të paraqiten/shfaqen këtu.",ENABLE_TRANSLATION:"Përkthejeni këtë bisedë në shqiptare",DISABLE_TRANSLATION:"Shikoni origjinalin",SEARCH_PLACEHOLDER_TEXT:"Kërko...",SEARCH_SEARCHING:"Kërko...",SEARCH_NO_RESULTS:"Nuk ka rezultate",SEARCH_NO_MORE_RESULTS:"Nuk ka më rezultate",CHAT_NOT_FOUND:"Biseda nuk u gjet",DELETE_MESSAGE:"Fshi mesazhin",DELETION_EXPLANATION:"Nëse e fshini këtë mesazh, ai do të zhduket për të gjithë.",EDIT_MESSAGE:"Redakto mesazhin",SAVE:"Ruaj",EDITED_INDICATOR:"redaktuar",REPLY_TO_MESSAGE:"Përgjigj",ADD_REACTION:"Shtoni reagimin",AUTH_EXPIRED_OVERLAY_TITLE:"Sesioni juaj i bisedës ka skaduar",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Rifresko faqen për të vazhduar",VOICE_MESSAGE:"Mesazh zanor",CONTACT_INFORMATION_HIDDEN:"informacione të fshehura",LEAVE_CONVERSATION:"Largohu nga bashkëbisedimi",MARK_CONVERSATION_AS_UNREAD:"Shëno si të palexuar",STATUS_INDICATOR_ONLINE:"Aktiv",STATUS_INDICATOR_OFFLINE:"Larg",ARIA_LEAVE_SEARCH_MODE:"Dil nga mënyra e kërkimit",ARIA_SEARCH_UP:"Kërko lart",ARIA_SEARCH_DOWN:"Kërko poshtë",ARIA_CLOSE_CHAT_POPUP:"Mbyll dritaren e bisedës",ARIA_SEARCH_INSIDE_CONVERSATION:"Kërko në këtë bisedë",ARIA_SEARCH:"Kërko",ARIA_CHAT:"Bisedë",ARIA_SET_PLAYBACK_SPEED:"vendos shpejtësinë e luajtjes",ARIA_CANCEL_UPLOAD:"Anulo ngarkimin",ARIA_STOP_RECORDING:"Ndalo regjistrimin",ARIA_CANCEL_RECORDING:"Anulo regjistrimin",ARIA_INSERT_EMOJI:"Fut një emoji",ARIA_PLAY_AUDIO:"luaj audio",ARIA_PAUSE_AUDIO:"pauzë audio",ARIA_REACTION_COUNT:(n,e)=>`${n} reagime me ${e}`,ARIA_MORE_ACTIONS:"Më shumë veprime",ARIA_REPLYING_TO:(n,e)=>`Duke u përgjigjur ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Dil nga mënyra e përgjigjes"}},sr:{code:"sr-SP",name:"Serbian",translation:{YESTERDAY:"Juče",TODAY:"Danas",DAYS:"d",HOURS:"s",MINUTES:"m",JUST_NOW:"Upravo sad",LOCATION:"Lokacija",CANCEL:"Otkaži",INBOX:"Pretinac",DESKTOP_NOTIFICATIONS:"Browser Notifikacija",DESKTOP_NOTIFICATIONS_ERROR:"Browser notifikacije nisu omogućene jer ih vaš pregledač aktivno blokira. Pokušajte pogledati postavke ili koristiti neki drugi pregledač.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demo notifikacija`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ako karticu pregledača ostavite otvorenu, pojaviće se ovaj pop-up kada neko razgovara s vama.",SEND_BUTTON_TEXT:"Pošalji",ENTRYBOX_TEXT_LIMIT:"Dozvoljeno je samo 10.000 znakova.",ENTRYBOX_PLACEHOLDER:"Kaži nešto...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ovaj razgovor više nije aktivan.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Možete da čitate, ali ne i da šaljete poruke.",MESSAGELIST_LOADING_OLDER:"Učitavam starije poruke...",MESSAGELIST_SHOW_OLDER:"Prikaži starije poruke",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Ova poruka je poslana imejlom",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Učitavam...",UPLOAD_SEND_FILE:"Pošalji datoteku",UPLOAD_SHARE_LOCATION:"Podeli lokaciju",UPLOAD_ERROR:"Nažalost, nešto je pošlo krivo. Datoteka možda nije podržana ili je prevelika.",SHARE_LOCATION_ERROR:"Nije moguće podeliti lokaciju: ",LOADING:"Učitavam...",HUB_EMPTY:"Ovde će biti prikazana istorija razgovora",HUB_SHOW_EARLIER:"Prikaži ranije razgovore",INBOX_NO_CHATS_TITLE:"Nema razgovora!",INBOX_NO_CHATS_BODY:"Nakon što vodite jedan ili više razgovora, oni će se pojaviti ovde.",ENABLE_TRANSLATION:"Prevedi ovaj razgovor na srpski jezik",DISABLE_TRANSLATION:"Prikaži original",SEARCH_PLACEHOLDER_TEXT:"Pretraži...",SEARCH_SEARCHING:"Pretraživanje...",SEARCH_NO_RESULTS:"Nema rezultata",SEARCH_NO_MORE_RESULTS:"Nema više rezultata",CHAT_NOT_FOUND:"Ćaskanje nije pronađeno",DELETE_MESSAGE:"Izbriši poruku",DELETION_EXPLANATION:"Ako obrišete ovu poruku, ona neće biti vidljiva ni za koga.",EDIT_MESSAGE:"Ispravi poruku",SAVE:"Sačuvaj",EDITED_INDICATOR:"ispravljeno",REPLY_TO_MESSAGE:"Odgovorite",ADD_REACTION:"Dodaj reakciju",AUTH_EXPIRED_OVERLAY_TITLE:"Vaša sesija ćaskanja je istekla",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Osvežite stranicu da biste nastavili",VOICE_MESSAGE:"Glasovna poruka",CONTACT_INFORMATION_HIDDEN:"Sakrivene informacije",LEAVE_CONVERSATION:"Napusti razgovor",MARK_CONVERSATION_AS_UNREAD:"Označi kao nepročitanu",STATUS_INDICATOR_ONLINE:"Aktivan",STATUS_INDICATOR_OFFLINE:"Neaktivan",ARIA_LEAVE_SEARCH_MODE:"Напусти режим претраге",ARIA_SEARCH_UP:"Тражи горе",ARIA_SEARCH_DOWN:"Тражи доле",ARIA_CLOSE_CHAT_POPUP:"Затвори прозор ћаскања",ARIA_SEARCH_INSIDE_CONVERSATION:"Тражи у овом разговору",ARIA_SEARCH:"Тражи",ARIA_CHAT:"Ћаскање",ARIA_SET_PLAYBACK_SPEED:"постави брзину репродукције",ARIA_CANCEL_UPLOAD:"Откажи отпремање",ARIA_STOP_RECORDING:"Заустави снимање",ARIA_CANCEL_RECORDING:"Откажи снимање",ARIA_INSERT_EMOJI:"Уметни емоџи",ARIA_PLAY_AUDIO:"репродукуј аудио",ARIA_PAUSE_AUDIO:"паузирај аудио",ARIA_REACTION_COUNT:(n,e)=>`${n} реакција са ${e}`,ARIA_MORE_ACTIONS:"Више радњи",ARIA_REPLYING_TO:(n,e)=>`Одговарање кориснику ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Izađi iz moda odgovaranja"}},sv:{code:"sv-SE",name:"Swedish (Sweden)",translation:{YESTERDAY:"Igår",TODAY:"Idag",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"just nu",LOCATION:"Plats",CANCEL:"Avbryt",INBOX:"Inkorg",DESKTOP_NOTIFICATIONS:"Webbläsarnotiser",DESKTOP_NOTIFICATIONS_ERROR:"Kan inte aktivera webbläsarnotiser eftersom din webbläsare aktivt blockerar dem. Se över inställningarna eller använd en annan webbläsare.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} demonotis`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Om du har fliken i webbläsaren öppen så kommer den här notisen visas när någon pratar med dig.",SEND_BUTTON_TEXT:"Skicka",ENTRYBOX_TEXT_LIMIT:"Max 10 000 tecken är tillåtet.",ENTRYBOX_PLACEHOLDER:"Skriv ett meddelande...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Den här konversationen är inte längre aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Du kan läsa men inte skicka meddelanden.",MESSAGELIST_LOADING_OLDER:"Läser in tidigare meddelanden...",MESSAGELIST_SHOW_OLDER:"Visa tidigare meddelanden",MESSAGELIST_NEW_MARKER:"Nytt",MESSAGE_SENT_VIA_EMAIL:"Detta meddelande skickades via e-post",YOU_MARKER:"du",UPLOAD_IN_PROGRESS:"Laddar upp...",UPLOAD_SEND_FILE:"Skicka fil",UPLOAD_SHARE_LOCATION:"Dela plats",UPLOAD_ERROR:"Något gick fel vid uppladdningen. Filen kan vara av en typ som inte stöds eller är för stor.",SHARE_LOCATION_ERROR:"Kan inte dela plats: ",LOADING:"Laddar...",HUB_EMPTY:"Din chatthistorik kommer att visas här",HUB_SHOW_EARLIER:"Visa tidigare chattar",INBOX_NO_CHATS_TITLE:"Inga chattar ännu!",INBOX_NO_CHATS_BODY:"När du har haft en eller flera konversationer kommer de att visas här.",ENABLE_TRANSLATION:"Översätt den här konversationen till svenska",DISABLE_TRANSLATION:"Visa original",SEARCH_PLACEHOLDER_TEXT:"Sök...",SEARCH_SEARCHING:"Söker...",SEARCH_NO_RESULTS:"Inga resultat hittades",SEARCH_NO_MORE_RESULTS:"Inga fler resultat",CHAT_NOT_FOUND:"Chatten hittades inte",DELETE_MESSAGE:"Radera meddelandet",DELETION_EXPLANATION:"Om du raderar det här meddelandet försvinner det för alla.",EDIT_MESSAGE:"Redigera meddelandet",SAVE:"Spara",EDITED_INDICATOR:"redigerad",REPLY_TO_MESSAGE:"Svara",ADD_REACTION:"Lägg till reaktion",AUTH_EXPIRED_OVERLAY_TITLE:"Din chatsession har gått ut",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Uppdatera sidan för att fortsätta",VOICE_MESSAGE:"Röstmeddelande",CONTACT_INFORMATION_HIDDEN:"Dold information",LEAVE_CONVERSATION:"Lämna konversationen",MARK_CONVERSATION_AS_UNREAD:"Markera som oläst",STATUS_INDICATOR_ONLINE:"Online",STATUS_INDICATOR_OFFLINE:"Offline",ARIA_LEAVE_SEARCH_MODE:"Avsluta sökläge",ARIA_SEARCH_UP:"Sök uppåt",ARIA_SEARCH_DOWN:"Sök nedåt",ARIA_CLOSE_CHAT_POPUP:"Stäng chattfönstret",ARIA_SEARCH_INSIDE_CONVERSATION:"Sök i denna konversation",ARIA_SEARCH:"Sök",ARIA_CHAT:"Chatt",ARIA_SET_PLAYBACK_SPEED:"Ställ in uppspelningshastighet",ARIA_CANCEL_UPLOAD:"Avbryt uppladdning",ARIA_STOP_RECORDING:"Stoppa inspelning",ARIA_CANCEL_RECORDING:"Avbryt inspelning",ARIA_INSERT_EMOJI:"Infoga en emoji",ARIA_PLAY_AUDIO:"Spela upp ljud",ARIA_PAUSE_AUDIO:"Pausa ljud",ARIA_REACTION_COUNT:(n,e)=>`${n} Reaktioner med ${e}`,ARIA_MORE_ACTIONS:"Fler åtgärder",ARIA_REPLYING_TO:(n,e)=>`Svarar på ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Avsluta svarsläge"}},tr:{code:"tr-TR",name:"Turkish",translation:{YESTERDAY:"Dün",TODAY:"Bugün",DAYS:"g",HOURS:"s",MINUTES:"d",JUST_NOW:"az önce",LOCATION:"Konum",CANCEL:"İptal",INBOX:"Gelen Kutusu",SEND_BUTTON_TEXT:"Gönder",ENTRYBOX_TEXT_LIMIT:"En fazla 10.000 karaktere izin veriliyor.",ENTRYBOX_PLACEHOLDER:"Bir şeyler söyle...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Bu konuşma artık aktif değil.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Mesajları okuyabilirsiniz ancak mesaj gönderemezsiniz.",MESSAGELIST_LOADING_OLDER:"Eski mesajlar yükleniyor...",MESSAGELIST_SHOW_OLDER:"Eski mesajları göster",MESSAGELIST_NEW_MARKER:"Yeni",DESKTOP_NOTIFICATIONS:"Tarayıcı bildirimleri",DESKTOP_NOTIFICATIONS_ERROR:"Tarayıcınız aktif olarak engellediğinden tarayıcı bildirimlerini etkinleştiremiyoruz. Ayarları kontrol etmeyi veya farklı bir tarayıcı kullanmayı deneyebilirsiniz.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} test bildirimi`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Eğer tarayıcınızın penceresini açık tutarsanız biri mesaj yazdığında bu bildirimi göreceksiniz.",MESSAGE_SENT_VIA_EMAIL:"Bu mesaj e-posta ile gönderilmiştir.",YOU_MARKER:"siz",UPLOAD_IN_PROGRESS:"Yükleniyor...",UPLOAD_SEND_FILE:"Dosya gönder",UPLOAD_SHARE_LOCATION:"Konum paylaş",UPLOAD_ERROR:"Yükleme sırasında bir şeyler yanlış gitti. Dosya desteklenmiyor veya izin verilenden büyük olabilir.",SHARE_LOCATION_ERROR:"Konum paylaşılamadı: ",LOADING:"Yükleniyor...",HUB_EMPTY:"Konuşma geçmişiniz burada görünecek",HUB_SHOW_EARLIER:"Önceki konuşmaları göster",INBOX_NO_CHATS_TITLE:"Henüz konuşma yok!",INBOX_NO_CHATS_BODY:"Bir veya daha fazla konuşma başlattığınız konuşmalar burada belirecek.",ENABLE_TRANSLATION:"Bu konuşmayı Türkçe'ye çevir",DISABLE_TRANSLATION:"Orijinali göster",SEARCH_PLACEHOLDER_TEXT:"Ara...",SEARCH_SEARCHING:"Arıyor...",SEARCH_NO_RESULTS:"Sonuç bulunamadı",SEARCH_NO_MORE_RESULTS:"Başka sonuç bulunamadı.",CHAT_NOT_FOUND:"Sohbet bulunamadı",DELETE_MESSAGE:"Mesajı sil",DELETION_EXPLANATION:"Bu mesajı silerseniz herkes için görünmez olacaktır.",EDIT_MESSAGE:"Mesajı düzenle",SAVE:"Kaydet",EDITED_INDICATOR:"düzenlenmiş",REPLY_TO_MESSAGE:"Yanıtla",ADD_REACTION:"Tepki ekle",AUTH_EXPIRED_OVERLAY_TITLE:"Sohbet oturumunuz sona erdi",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Devam etmek için sayfayı yenileyin",VOICE_MESSAGE:"Sesli mesaj",CONTACT_INFORMATION_HIDDEN:"Gizli bilgi",LEAVE_CONVERSATION:"Konuşmadan ayrıl",MARK_CONVERSATION_AS_UNREAD:"Okunmamış olarak işaretle",STATUS_INDICATOR_ONLINE:"Aktif",STATUS_INDICATOR_OFFLINE:"Uzakta",ARIA_LEAVE_SEARCH_MODE:"Arama modundan çık",ARIA_SEARCH_UP:"Yukarı ara",ARIA_SEARCH_DOWN:"Aşağı ara",ARIA_CLOSE_CHAT_POPUP:"Sohbet penceresini kapat",ARIA_SEARCH_INSIDE_CONVERSATION:"Bu konuşmada ara",ARIA_SEARCH:"Ara",ARIA_CHAT:"Sohbet",ARIA_SET_PLAYBACK_SPEED:"oynatma hızını ayarla",ARIA_CANCEL_UPLOAD:"Yüklemeyi iptal et",ARIA_STOP_RECORDING:"Kaydı durdur",ARIA_CANCEL_RECORDING:"Kaydı iptal et",ARIA_INSERT_EMOJI:"Emoji ekle",ARIA_PLAY_AUDIO:"sesi oynat",ARIA_PAUSE_AUDIO:"sesi duraklat",ARIA_REACTION_COUNT:(n,e)=>`${n} tepki (${e})`,ARIA_MORE_ACTIONS:"Daha fazla işlem",ARIA_REPLYING_TO:(n,e)=>`${n}'a yanıtlama: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Yanıt modundan çık"}},uk:{code:"uk-UA",name:"Ukrainian (Ukraine)",translation:{YESTERDAY:"Вчора",TODAY:"Сьогодні",DAYS:"d",HOURS:"h",MINUTES:"м",JUST_NOW:"просто зараз",LOCATION:"Місцезнаходження",CANCEL:"Скасувати",INBOX:"Вхідні",DESKTOP_NOTIFICATIONS:"Сповіщення в браузері",DESKTOP_NOTIFICATIONS_ERROR:"Неможливо ввімкнути сповіщення в браузері, оскільки ваш веб-переглядач активно їх блокує. Спробуйте переглянути налаштування або використовувати інший браузер.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`Демо-повідомлення про ${n}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Якщо ви відкриєте вкладку веб-переглядача відкритою, ви побачите це спливаюче вікно, коли хтось спілкується з вами.",SEND_BUTTON_TEXT:"Надіслати",ENTRYBOX_TEXT_LIMIT:"Дозволено лише 10 000 символів.",ENTRYBOX_PLACEHOLDER:"Скажи щось...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ця розмова більше не активна.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Ви можете читати, але не надсилати повідомлення.",MESSAGELIST_LOADING_OLDER:"Завантаження старих повідомлень...",MESSAGELIST_SHOW_OLDER:"Показати старіші повідомлення",MESSAGELIST_NEW_MARKER:"Нові",MESSAGE_SENT_VIA_EMAIL:"Це повідомлення надіслано електронною поштою",YOU_MARKER:"ти",UPLOAD_IN_PROGRESS:"Завантаження...",UPLOAD_SEND_FILE:"Надіслати файл",UPLOAD_SHARE_LOCATION:"Поділитися місцезнаходженням",UPLOAD_ERROR:"На жаль, під час завантаження щось не вдалось. Файл може бути непідтримуваним або занадто великим.",SHARE_LOCATION_ERROR:"Неможливо поділити місцезнаходження: ",LOADING:"Завантаження...",HUB_EMPTY:"Тут відобразиться ваша історія чатів",HUB_SHOW_EARLIER:"Показати попередні чати",INBOX_NO_CHATS_TITLE:"Чатів ще немає!",INBOX_NO_CHATS_BODY:"Після того, як ви проведете одну чи кілька бесід, вони з’являться тут.",ENABLE_TRANSLATION:"Перекласти цю розмову англійською",DISABLE_TRANSLATION:"Показати оригінал",SEARCH_PLACEHOLDER_TEXT:"Пошук...",SEARCH_SEARCHING:"Пошук...",SEARCH_NO_RESULTS:"Не знайдено результатів",SEARCH_NO_MORE_RESULTS:"Більше немає результатів",CHAT_NOT_FOUND:"Чат не знайдено",DELETE_MESSAGE:"Видалити повідомлення",DELETION_EXPLANATION:"Якщо ви видалите це повідомлення, воно зникне для всіх.",EDIT_MESSAGE:"Редагувати повідомлення",SAVE:"Зберегти",EDITED_INDICATOR:"відредаговано",REPLY_TO_MESSAGE:"Відповісти",ADD_REACTION:"Додати реакцію",AUTH_EXPIRED_OVERLAY_TITLE:"Ваша сесія в чаті закінчилась",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Оновіть сторінку, щоб продовжити",VOICE_MESSAGE:"Голосове повідомлення",CONTACT_INFORMATION_HIDDEN:"Прихована інформація",LEAVE_CONVERSATION:"Залишити розмову",MARK_CONVERSATION_AS_UNREAD:"Відзначити як непрочитане",STATUS_INDICATOR_ONLINE:"Активний",STATUS_INDICATOR_OFFLINE:"Відсутній",ARIA_LEAVE_SEARCH_MODE:"Вийти з режиму пошуку",ARIA_SEARCH_UP:"Шукати вгору",ARIA_SEARCH_DOWN:"Шукати вниз",ARIA_CLOSE_CHAT_POPUP:"Закрити вікно чату",ARIA_SEARCH_INSIDE_CONVERSATION:"Шукати в цій розмові",ARIA_SEARCH:"Пошук",ARIA_CHAT:"Чат",ARIA_SET_PLAYBACK_SPEED:"встановити швидкість відтворення",ARIA_CANCEL_UPLOAD:"Скасувати завантаження",ARIA_STOP_RECORDING:"Зупинити запис",ARIA_CANCEL_RECORDING:"Скасувати запис",ARIA_INSERT_EMOJI:"Вставити емодзі",ARIA_PLAY_AUDIO:"відтворити аудіо",ARIA_PAUSE_AUDIO:"призупинити аудіо",ARIA_REACTION_COUNT:(n,e)=>`${n} реакцій з ${e}`,ARIA_MORE_ACTIONS:"Більше дій",ARIA_REPLYING_TO:(n,e)=>`Відповідь на ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Вийти з режиму відповіді"}},vi:{code:"vi-VN",name:"Vietnamese",translation:{YESTERDAY:"Hôm qua",TODAY:"Hôm nay",DAYS:"ngày",HOURS:"giờ",MINUTES:"phút",JUST_NOW:"vừa xong",LOCATION:"Địa điểm",CANCEL:"Hủy",INBOX:"Hộp thư đến",DESKTOP_NOTIFICATIONS:"Thông báo trình duyệt",DESKTOP_NOTIFICATIONS_ERROR:"Không thể bật thông báo trên trình duyệt vì trình duyệt của bạn đang tắt chức năng này. Hãy thử tìm trong cài đặt trình duyệt hoặc sử dụng một trình duyệt khác.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} thông báo thử nghiệm`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Nếu bạn giữ tab trình duyệt của bạn mở, bạn sẽ thấy cửa sổ bật lên khi ai đó nói chuyện với bạn.",SEND_BUTTON_TEXT:"Gửi",ENTRYBOX_TEXT_LIMIT:"Tối đa 10.000 ký tự.",ENTRYBOX_PLACEHOLDER:"Nói gì đó...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Cuộc hội thoại này không còn hoạt động.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Bạn có thể đọc, nhưng không thể gửi tin nhắn.",MESSAGELIST_LOADING_OLDER:"Đang tải tin nhắn cũ...",MESSAGELIST_SHOW_OLDER:"Hiển thị tin nhắn trước đó",MESSAGELIST_NEW_MARKER:"Mới",MESSAGE_SENT_VIA_EMAIL:"Tin nhắn này đã được gửi qua email",YOU_MARKER:"bạn",UPLOAD_IN_PROGRESS:"Đang tải lên...",UPLOAD_SEND_FILE:"Gửi tệp",UPLOAD_SHARE_LOCATION:"Chia sẻ vị trí",UPLOAD_ERROR:"Thật không may, quá trình tải lên không thành công. Tệp không được hỗ trợ hoặc quá lớn.",SHARE_LOCATION_ERROR:"Không thể chia sẻ vị trí: ",LOADING:"Đang tải...",HUB_EMPTY:"Lịch sử trò chuyện của bạn sẽ hiển thị ở đây",HUB_SHOW_EARLIER:"Hiển thị các cuộc trò chuyện trước đó",INBOX_NO_CHATS_TITLE:"Chưa có cuộc trò chuyện nào!",INBOX_NO_CHATS_BODY:"Khi bạn đã có một hoặc nhiều cuộc trò chuyện, chúng sẽ hiển thị ở đây.",ENABLE_TRANSLATION:"Dịch cuộc hội thoại sang Tiếng Việt",DISABLE_TRANSLATION:"Hiển thị nội dung gốc",SEARCH_PLACEHOLDER_TEXT:"TÌm kiếm...",SEARCH_SEARCHING:"Đang tìm kiếm...",SEARCH_NO_RESULTS:"Không tìm thấy kết quả nào",SEARCH_NO_MORE_RESULTS:"Không có kết quả nào khác",CHAT_NOT_FOUND:"Không tìm thấy cuộc trò chuyện",DELETE_MESSAGE:"Xóa tin nhắn",DELETION_EXPLANATION:"Nếu bạn xóa tin nhắn này, tất cả mọi người sẽ không còn thấy nó.",EDIT_MESSAGE:"Chỉnh sửa tin nhắn",SAVE:"lưu",EDITED_INDICATOR:"đã chỉnh sửa",REPLY_TO_MESSAGE:"đáp lại",ADD_REACTION:"Thêm biểu tượng cảm xúc",AUTH_EXPIRED_OVERLAY_TITLE:"Phiên trò chuyện của bạn đã hết hạn",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Hãy làm mới trang để tiếp tục",VOICE_MESSAGE:"Tin nhắn thoại",CONTACT_INFORMATION_HIDDEN:"Thông tin ẩn",LEAVE_CONVERSATION:"Thoát khỏi cuộc trò chuyện",MARK_CONVERSATION_AS_UNREAD:"Đánh dấu là chưa đọc",STATUS_INDICATOR_ONLINE:"Hoạt động",STATUS_INDICATOR_OFFLINE:"Vắng mặt",ARIA_LEAVE_SEARCH_MODE:"Thoát chế độ tìm kiếm",ARIA_SEARCH_UP:"Tìm kiếm lên trên",ARIA_SEARCH_DOWN:"Tìm kiếm xuống dưới",ARIA_CLOSE_CHAT_POPUP:"Đóng cửa sổ trò chuyện",ARIA_SEARCH_INSIDE_CONVERSATION:"Tìm kiếm trong cuộc trò chuyện này",ARIA_SEARCH:"Tìm kiếm",ARIA_CHAT:"Trò chuyện",ARIA_SET_PLAYBACK_SPEED:"đặt tốc độ phát",ARIA_CANCEL_UPLOAD:"Hủy tải lên",ARIA_STOP_RECORDING:"Dừng ghi âm",ARIA_CANCEL_RECORDING:"Hủy ghi âm",ARIA_INSERT_EMOJI:"Chèn biểu tượng cảm xúc",ARIA_PLAY_AUDIO:"phát âm thanh",ARIA_PAUSE_AUDIO:"tạm dừng âm thanh",ARIA_REACTION_COUNT:(n,e)=>`${n} phản ứng với ${e}`,ARIA_MORE_ACTIONS:"Thêm hành động",ARIA_REPLYING_TO:(n,e)=>`Đang trả lời ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Thoát chế độ trả lời"}},zh:{code:"zh-CN",name:"Chinese (Simplified)",translation:{YESTERDAY:"昨天",TODAY:"今天",DAYS:"天",HOURS:"小时",MINUTES:"分钟",JUST_NOW:"刚才",LOCATION:"地点",CANCEL:"取消",INBOX:"收件箱",DESKTOP_NOTIFICATIONS:"浏览器通知",DESKTOP_NOTIFICATIONS_ERROR:"因浏览器设置为阻止,所以无法激活浏览器提醒。请去设置里查看或者尝试其他的浏览器。",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} 演示提醒`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"只要保持浏览器开着,如果有人和你对话,将会自动弹出对话窗口。",SEND_BUTTON_TEXT:"发送",ENTRYBOX_TEXT_LIMIT:"不超过10,000个字符。",ENTRYBOX_PLACEHOLDER:"写点什么吧……",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"该对话已结束。",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"你只能阅读信息,不能发送信息。",MESSAGELIST_LOADING_OLDER:"载入之前的信息……",MESSAGELIST_SHOW_OLDER:"显示之前的信息",MESSAGELIST_NEW_MARKER:"新消息",MESSAGE_SENT_VIA_EMAIL:"该信息已通过邮件发送。",YOU_MARKER:"你",UPLOAD_IN_PROGRESS:"上传中……",UPLOAD_SEND_FILE:"发送文件",UPLOAD_SHARE_LOCATION:"分享地址",UPLOAD_ERROR:"上传出错。文件格式不支持或者太大。",SHARE_LOCATION_ERROR:"无法分享地址: ",LOADING:"正在载入……",HUB_EMPTY:"你的聊天记录将在此显示。",HUB_SHOW_EARLIER:"显示之前的聊天记录。",INBOX_NO_CHATS_TITLE:"暂无任何聊天记录!",INBOX_NO_CHATS_BODY:"如果你有一个或多个对话窗口进行中,将显示在这里。",ENABLE_TRANSLATION:"翻译至简体中文",DISABLE_TRANSLATION:"查看原文",SEARCH_PLACEHOLDER_TEXT:"搜索...",SEARCH_SEARCHING:"正在搜索...",SEARCH_NO_RESULTS:"未找到结果",SEARCH_NO_MORE_RESULTS:"无更多结果",CHAT_NOT_FOUND:"未找到“聊天”",DELETE_MESSAGE:"删除消息",DELETION_EXPLANATION:"如果您删除此消息,那么所有人都将无法再看到它。",EDIT_MESSAGE:"编辑消息",SAVE:"保存",EDITED_INDICATOR:"本消息有改动",REPLY_TO_MESSAGE:"回复",ADD_REACTION:"添加反应",AUTH_EXPIRED_OVERLAY_TITLE:"您的聊天会话已过期",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"刷新页面以继续",VOICE_MESSAGE:"语音消息",CONTACT_INFORMATION_HIDDEN:"隐藏信息",LEAVE_CONVERSATION:"离开对话",MARK_CONVERSATION_AS_UNREAD:"标记为未读",STATUS_INDICATOR_ONLINE:"活跃",STATUS_INDICATOR_OFFLINE:"离开",ARIA_LEAVE_SEARCH_MODE:"退出搜索模式",ARIA_SEARCH_UP:"向上搜索",ARIA_SEARCH_DOWN:"向下搜索",ARIA_CLOSE_CHAT_POPUP:"关闭聊天弹窗",ARIA_SEARCH_INSIDE_CONVERSATION:"在此对话中搜索",ARIA_SEARCH:"搜索",ARIA_CHAT:"聊天",ARIA_SET_PLAYBACK_SPEED:"设置播放速度",ARIA_CANCEL_UPLOAD:"取消上传",ARIA_STOP_RECORDING:"停止录音",ARIA_CANCEL_RECORDING:"取消录音",ARIA_INSERT_EMOJI:"插入表情符号",ARIA_PLAY_AUDIO:"播放音频",ARIA_PAUSE_AUDIO:"暂停音频",ARIA_REACTION_COUNT:(n,e)=>`${n}个反应(${e})`,ARIA_MORE_ACTIONS:"更多操作",ARIA_REPLYING_TO:(n,e)=>`正在回复 ${n}:${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"退出回复模式"}},zhTw:{code:"zh-TW",name:"Chinese (Traditional)",translation:{YESTERDAY:"昨天",TODAY:"昨天",DAYS:"天",HOURS:"小時",MINUTES:"分",JUST_NOW:"現在",LOCATION:"地點",CANCEL:"取消",INBOX:"收件箱",DESKTOP_NOTIFICATIONS:"瀏覽器通知",DESKTOP_NOTIFICATIONS_ERROR:"無法啟用瀏覽器通知,因為您的瀏覽器主動阻止它們。 嘗試查看設置或使用其他瀏覽器。",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`${n} 演示通知`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"如果您持續打開瀏覽器標籤頁,當有人與您通話時,您會看到此彈出窗口。",SEND_BUTTON_TEXT:"發送",ENTRYBOX_TEXT_LIMIT:"只允許10.000個字符。",ENTRYBOX_PLACEHOLDER:"說些什麼...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"此對話不再有效。",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"您可以閱讀,但不能發送消息。",MESSAGELIST_LOADING_OLDER:"加載舊訊息...",MESSAGELIST_SHOW_OLDER:"顯示較舊的訊息",MESSAGELIST_NEW_MARKER:"新的",MESSAGE_SENT_VIA_EMAIL:"此訊息是通過電郵發送的",YOU_MARKER:"您",UPLOAD_IN_PROGRESS:"上傳中...",UPLOAD_SEND_FILE:"發送文件",UPLOAD_SHARE_LOCATION:"共享位置",UPLOAD_ERROR:"不幸的是,上傳出了問題。 該文件可能不受支持或太大。",SHARE_LOCATION_ERROR:"無法分享位置:",LOADING:"載入中...",HUB_EMPTY:"您的聊天記錄將顯示在此處",HUB_SHOW_EARLIER:"顯示早先的聊天記錄",INBOX_NO_CHATS_TITLE:"還沒聊天!",INBOX_NO_CHATS_BODY:"一旦您進行了一次或多次對話,他們就會顯示在此處。",ENABLE_TRANSLATION:"翻譯此對話至繁體中文",DISABLE_TRANSLATION:"顯示原文",SEARCH_PLACEHOLDER_TEXT:"搜尋...",SEARCH_SEARCHING:"正在搜尋...",SEARCH_NO_RESULTS:"找不到任何結果",SEARCH_NO_MORE_RESULTS:"沒有其他結果",CHAT_NOT_FOUND:"查無對話",DELETE_MESSAGE:"刪除訊息",DELETION_EXPLANATION:"您如果刪除這條訊息,所有人都將看不到它。",EDIT_MESSAGE:"編輯訊息",SAVE:"儲存",EDITED_INDICATOR:"已編輯",REPLY_TO_MESSAGE:"回覆",ADD_REACTION:"加入表情回應",AUTH_EXPIRED_OVERLAY_TITLE:"您的會話過程已過期",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"請刷新頁面以繼續",VOICE_MESSAGE:"語音訊息",CONTACT_INFORMATION_HIDDEN:"隱藏訊息",LEAVE_CONVERSATION:"離開對話",MARK_CONVERSATION_AS_UNREAD:"標記為未讀",STATUS_INDICATOR_ONLINE:"活躍",STATUS_INDICATOR_OFFLINE:"離開",ARIA_LEAVE_SEARCH_MODE:"離開搜尋模式",ARIA_SEARCH_UP:"向上搜尋",ARIA_SEARCH_DOWN:"向下搜尋",ARIA_CLOSE_CHAT_POPUP:"關閉聊天彈窗",ARIA_SEARCH_INSIDE_CONVERSATION:"在此對話中搜尋",ARIA_SEARCH:"搜尋",ARIA_CHAT:"聊天",ARIA_SET_PLAYBACK_SPEED:"設定播放速度",ARIA_CANCEL_UPLOAD:"取消上傳",ARIA_STOP_RECORDING:"停止錄音",ARIA_CANCEL_RECORDING:"取消錄音",ARIA_INSERT_EMOJI:"插入表情符號",ARIA_PLAY_AUDIO:"播放音訊",ARIA_PAUSE_AUDIO:"暫停音訊",ARIA_REACTION_COUNT:(n,e)=>`${n}個反應(${e})`,ARIA_MORE_ACTIONS:"更多操作",ARIA_REPLYING_TO:(n,e)=>`正在回覆 ${n}:${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"退出回覆模式"}}};function cp(n){const e=n.replace(/_/g,"-").toLowerCase(),t=rc[e];if(t)return{...t.translation,locale:e};const r=e.slice(0,2),i=rc[r];return i?{...i.translation,locale:r}:(zt.warn(`User locale '${n}' not supported; falling back to English.`),{...up.translation,locale:"en-US"})}const dp=()=>{const n=document.createElement("canvas");n.width=n.height=1;const e=n.getContext("2d");return e.textBaseline="top",e.font='100px "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Twemoji Mozilla","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',e.scale(.01,.01),e},ic=(n,e)=>{const t=dp();return t.fillStyle=e,t.fillText(n,0,0),t.getImageData(0,0,1,1).data},QE=n=>!n.includes("‍")||dp().measureText(n).width<160,eA=(n,e)=>{const t=[...n].join(",");return t===[...e].join(",")&&!t.startsWith("0,0,0,")};function hp(n){try{return function(e){const t=ic(e,"#000"),r=ic(e,"#fff"),i=QE(e);return t&&r&&i&&eA(t,r)}(n)}catch(e){return!0}}var Dh;const pp=(Dh=globalThis.window)!=null&&Dh.document?function(){if(typeof window=="undefined"||window.E2E)return 16;const n={"🫩":16,"🚶‍➡️":15.1,"🫨":15,"🫠":14,"😵‍💫":13.1,"🥲":13,"🧑‍🦰":12.1,"🥻":12,"🥰":11,"🤩":5,"👱‍♀️":4,"🤣":3,"👁️‍🗨️":2,"😀":1,"😐️":.7,"😃":.6};for(const[e,t]of Object.entries(n))if(hp(e))return t}():0;class fp{constructor(e,t){this.currentUser$=me(null),this.app$=me(null),this.appId$=me(null),this.extUserId$=me(null),this.authTokenState$=me("idle"),this.themeCustom$=me(Lu({value:void 0})),this.device$=me({supportsEmojiPicker:!!pp,isMobile:typeof window!="undefined"&&/Mobi/i.test(window.navigator.userAgent)}),this.errors$=me({unknownConversation:!1,unknownUser:!1,wrongAppId:!1,serverError:!1}),this.t$=me(()=>{var s,a;const r=this.extUserId$.get(),i=this.app$.appMetadata.defaultLocale.get(),o=this.currentUser$.locale.get();return cp((a=(s=r&&o)!=null?s:i)!=null?a:"en-US")}),mr(()=>{this.appId$.set(e),this.extUserId$.set(t)})}updateThemeCustom(e){this.themeCustom$.set(Lu({value:e}))}listenForErrors(e,t){this.errors$.assign({unknownConversation:!1,unknownUser:!1,wrongAppId:!1,serverError:!1});const r=e.onError(s=>{zt.error(s.message),this.errors$.serverError.set(!0)}),i=e.currentUser.subscribe(s=>{this.errors$.unknownUser.set(s===null)}),o=t&&e.conversation(t).subscribe(s=>{this.errors$.unknownConversation.set(s===null)});return()=>{r.unsubscribe(),i.unsubscribe(),o==null||o.unsubscribe()}}listenForAuthChanges(e,t){let r=!0;this.authTokenState$.peek()!=="loading"&&this.authTokenState$.set("loading"),e._authProvider.getToken().then(()=>{r&&this.authTokenState$.set("valid")});const i=e._authProvider.onTokenRefreshFailed(()=>{r&&this.authTokenState$.set(t?"invalid":"expired")});return()=>{r=!1,i()}}listenForUserAndAppChanges(e,t){let r=!0,i=null;const o=e.currentUser.subscribe(async s=>{if(r&&s&&(this.currentUser$.set(s),s.role!==i)){i=s.role;const a=await t.getApp(s.role);if(!r)return;this.app$.set(a)}});return()=>{r=!1,o.unsubscribe()}}}var xl={};function tA(n){return String.fromCharCode(parseInt(n.slice(1),16))}Object.defineProperty(xl,"__esModule",{value:!0});var nA=xl.encode=function(n){return btoa(encodeURIComponent(n).replace(/%[0-9A-F]{2}/g,tA))};function rA(n){return`%${`00${n.charCodeAt(0).toString(16)}`.slice(-2)}`}xl.decode=function(n){return decodeURIComponent(Array.from(atob(n),rA).join(""))};const iA=/[^a-zA-Z\u00C0-\u024F\u1E00-\u1EFF\u0400-\u044f\u0300-\u036e]+/,oA=n=>n.split(iA).filter(e=>e).map(e=>e[0]).join("")||n[Symbol.iterator]().next().value||"";function mp(n){const e=function(t){let r=0;for(let i=0;i<t.length;i++)r=(r<<5)-r+t.charCodeAt(i),r|=0;return Math.abs(r)}(n)%sc.length;return sc[e]}function cs(n,e){const t=e.lastIndex;let r;const i=[];for(;(r=e.exec(n))!==null;)i.push(r),r[0]===""&&(e.lastIndex+=1);return e.lastIndex=t,i}function Ma(n,e,t){let r=0;const i=[];for(const o of e)o.offset<r||(o.offset>r&&i.push(n.substring(r,o.offset)),i.push(...t(o)),r=o.offset+o.matchedText.length);return r<n.length&&i.push(n.substring(r)),i}function Ep(n){try{return new URL(n).hostname}catch(e){return}}function qi(n){const e=n.replace(/%2F/g,"/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/,"$1");return decodeURIComponent(e)}function oc(n,e){return n.localeCompare(e,void 0,{usage:"search",sensitivity:"base"})===0}const sc=["#996666","#9A6E61","#8D7662","#8E775E","#948771","#8A8360","#888D65","#6F8E63","#749378","#678975","#779E86","#639A8F","#6D92A1","#65869F","#697E9A","#736C9F","#8C6495","#956387","#B05D54","#B16D52","#AF8751","#AC8A56","#B7A458","#B5B35C","#83AA5D","#4F9D5D","#5FA777","#66B58F","#5FB3AC","#589AAF","#4E7F9E","#456CAC","#6456B7","#714AB2","#9771B5","#C154C1","#B05E81","#B04C6A","#B94E48","#AF593E","#C5994B","#B8C25D","#87AB39","#4FA83D","#40A860","#41AA78","#3AB09E","#3FC1AA","#56B4BE","#3EABBF","#4682B4","#7A58C1","#9966CC","#C54B8C","#B44668","#AE4560","#A3807B","#AB917A","#ACA586","#A8AF8E","#9EA587","#8BA690","#7DA98D","#7CB0A1","#8BA9A5","#7CA1A6","#859FAF","#8D90A1","#A397B4","#AE809E","#C08081","#BB8983","#B19461","#B5A27F","#B8B56A","#9AB973","#7AC488","#7CB7BB","#80B3C4","#788BBA","#7A89B8","#9678B6","#CB8FA9","#B57281","#C6726B","#C88A65","#C2955D","#C8B568","#B9C46A","#74C365","#6FD0C5","#6093D1","#7666C6","#D06DA1"],sA={canReplyToMessage:!1,canEditMessage:!1,canDeleteMessage:!1,canAddReaction:!1};class Ap extends fp{constructor(e,t){super(e,t),this.type="ChatboxStore",this.messageSubscription=null,this.readyForNewMessagesPromise=Promise.resolve(),this.participantSubscription=null,this.onlineSubscriptions={},this.state$=me({extCurrentConversationId:null,editor:{isEmpty:!0,isTyping:!1,atTextLimit:!1,characterCount:0,showEmojiPicker:!1,suggestEmojiQuery:void 0,suggestMentionQuery:void 0},referencedMessageId:null,editingMessageId:null,currentConversation:null,visibility:{isInView:!1,tabFocused:!0},messages:{},participants:{},typing:{},isUserConnected:{},ephemeralMessages:{},ephemeralMessageIdMapping:{},localFileBlobUrls:{},userPermissions:()=>{const r=this.app$.role.general.get(),i=this.app$.role.permissions.get();return le.defined(r),le.defined(i),{showTypingIndicator:r.showTypingIndicators,canShareFile:r.enableFileTransfers,canShareLocation:r.enableLocation,canMention:r.enableMentions,showOnlineStatus:r.enablePresence!==!1,canSendVoiceMessage:r.enableVoiceRecording,canLeaveConversation:i.conversations.leave==="all",canMarkConversationAsUnread:i.conversations.markAsUnread==="all"}},messagePermissions:()=>{const r=this.app$.role.permissions.get();le.defined(r);const i=this.state$.userPermissions.get(),o={...sA,...i},s={canReplyToMessage:Jt(r.messages.reply,!0),canEditMessage:Jt(r.messages.edit,!0),canDeleteMessage:Jt(r.messages.delete,!0),canAddReaction:Jt(r.messages.emojiReactions,!0),...i},a={...s,canEditMessage:!1},l={canReplyToMessage:Jt(r.messages.reply,!1),canEditMessage:Jt(r.messages.edit,!1),canDeleteMessage:Jt(r.messages.delete,!1),canAddReaction:Jt(r.messages.emojiReactions,!1),...i};return{system:o,own:s,ownWithoutEditing:a,other:l,otherWithoutEditing:{...l,canEditMessage:!1}}}}),this.locale$=me(()=>{var s,a;const r=this.extUserId$.get(),i=this.app$.appMetadata.defaultLocale.get(),o=this.currentUser$.locale.get();return(a=(s=r&&o)!=null?s:i)!=null?a:"en-US"}),this.t$=me(()=>cp(this.locale$.get())),this.referencedMessage$=me(()=>{const r=this.state$.extCurrentConversationId.get(),i=this.state$.referencedMessageId.get();return r&&i?this.state$.messages.child(r).lookup.child(i).get():null}),this.chatItems$=me(()=>{var p,f;const r=this.state$.extCurrentConversationId.get();if(!r)return[];const i=this.state$.currentConversation.readUntil.get(),o=(p=this.state$.messages.child(r).state.get())!=null?p:[],s=Object.values((f=this.state$.ephemeralMessages.child(r).get())!=null?f:{}),a=s.length===0?o:s.concat(o).sort((m,E)=>E.createdAt-m.createdAt),l=a.map(m=>{const E=m.content[0],A=E==null?void 0:E.type;if(!E||A!=="file")return m;const D=E.size+","+E.filename,_=this.state$.localFileBlobUrls.child(r).child(D).url.get();return _?{...m,content:[{...E,url:_}]}:m});let u=null,c=0,d=!1;const h=[];for(const m of l){const E=new Date(m.createdAt),A=new Date(E).setHours(0,0,0,0),D=c&&A!==c,_=E.getTime()>i,S=!(!d||_||u!=null&&u.id.startsWith("ephemeral"));(S||D)&&h.push(new Fa({id:"border-before-"+m.id,isDayMarker:!!D,isReadMarker:!!S,timestamp:D?c:void 0})),h.push(m),d=_,c=A,u=m}return function(m,E){const A=[];let D=[];const _=Symbol("NO_KEY");let S=_;for(const T of m){const N=E(T);S===_||S===N?D.push(T):(A.push(D),D=[T]),S=N}return D.length!==0&&A.push(D),A}(h,m=>{var E;return m instanceof Fa?m.id:(E=m.sender)==null?void 0:E.id}).map(m=>(m.id=m.map(E=>E.id).join(","),m))})}storeTyping(e,t){this.state$.typing.child(e).set(t)}messagePermissions$(e){const t=this.currentUser$.get();if(!t)throw new Error("Unreachable");const r=e.content[0];return e.sender?t.id===e.sender.id?r.type==="text"?this.state$.messagePermissions.own:this.state$.messagePermissions.ownWithoutEditing:r.type==="text"?this.state$.messagePermissions.other:this.state$.messagePermissions.otherWithoutEditing:this.state$.messagePermissions.system}storeMessages(e,t,r){mr(()=>{var l;const i=t.reduce((u,c)=>(u[c.id]=c,u),{}),o=this.state$.extCurrentConversationId.peek(),s=this.extUserId$.peek();le(s&&o),this.state$.messages.child(e).set({state:t,lookup:i,loadedAll:r});const a=this.state$.ephemeralMessages.child(e);for(const u of t){const c=this.state$.ephemeralMessageIdMapping.child(e).child(u.id).peek();c&&a.child(c).delete();const d=u.content[0];if(((l=u.sender)==null?void 0:l.id)!==s||d.type!=="file")continue;const h=d.size+","+d.filename,p=this.state$.localFileBlobUrls.child(o).child(h);if(p.fetching.peek()!==!1)continue;const f=()=>p.delete();if(d.subtype==="image"){p.fetching.set(!0);const m=document.createElement("img");m.addEventListener("load",f,{once:!0}),m.src=d.url}else if(d.subtype==="video"){p.fetching.set(!0);const m=document.createElement("video");m.addEventListener("loaddata",f,{once:!0}),m.src=d.url}else if(d.subtype==="audio"){p.fetching.set(!0);const m=document.createElement("audio");m.addEventListener("loaddata",f,{once:!0}),m.src=d.url}}})}}function Jt(n,e){return n==="all"||n==="own"&&e||n==="other"&&!e}class Fa{constructor({id:e,isDayMarker:t,isReadMarker:r,timestamp:i}){this.id=e,this.isDayMarker=t,this.isReadMarker=r,this.timestamp=t?i:void 0}}function Rt(n,e=!1){return function(t,r=!1){return t.map(i=>{if(typeof i=="string")return i;switch(i.type){case"bold":return"*"+Rt(i.children)+"*";case"italic":return"_"+Rt(i.children)+"_";case"strikethrough":return"~"+Rt(i.children)+"~";case"blockquote":return Rt(i.children).split(`
1183
1183
  `).map(o=>"> "+o).join(`
1184
1184
  `)+`
1185
1185
  `;case"autolink":case"autoLink":case"suppressed":case"emoji":return i.text;case"codeblock":case"codeBlock":return"```"+i.language+`
1186
1186
  `+i.text+"```";case"codespan":case"codeSpan":return"```"+i.text+"```";case"mention":return r?`<!!mention:${i.id}|${i.text}>`:`@${i.text}`;case"customemoji":case"customEmoji":return r?`<!!customemoji:${i.text}>`:i.text;case"link":return`<${i.url}|${Rt(i.children)}>`;case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return function(o){const s=new URLSearchParams(o.params).toString(),a=s?o.action+"?"+s:o.action;return`<${o.type}:${a}|${Rt(o.children)}>`}(i);case"bulletlist":case"bulletList":return`
1187
1187
  `+Rt(i.children);case"bulletpoint":case"bulletPoint":return"- "+Rt(i.children)+`
1188
- `}}).join("")}(n,e).trim()}class sc{constructor(e,t,r,i,o){this.send=t,this.attachFile=r,this.shareLocation=i,this.toggleEmojiPicker=o,this.isEmpty=e.isEmpty,this.isTyping=e.isTyping,this.atTextLimit=e.atTextLimit,this.characterCount=e.characterCount,this.showEmojiPicker=e.showEmojiPicker}}function Ne(n){this.content=n}function gp(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i!=o){if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=gp(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}else t+=i.nodeSize}}function Dp(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),a=e.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let u=0,c=Math.min(s.text.length,a.text.length);for(;u<c&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,t--,r--;return{a:t,b:r}}if(s.content.size||a.content.size){let u=Dp(s.content,a.content,t-1,r-1);if(u)return u}t-=l,r-=l}else t-=l,r-=l}}Ne.prototype={constructor:Ne,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new Ne(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Ne(t)},addToStart:function(n,e){return new Ne([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Ne(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new Ne(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return(n=Ne.from(n)).size?new Ne(n.content.concat(this.subtract(n).content)):this},append:function(n){return(n=Ne.from(n)).size?new Ne(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Ne.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},Ne.from=function(n){if(n instanceof Ne)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ne(e)};class H{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,a=0;a<t;s++){let l=this.content[s],u=a+l.nodeSize;if(u>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,t-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new H(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>t)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),i+=a.nodeSize),s=l}return new H(r,i)}cutByIndex(e,t){return e==t?H.empty:e==0&&t==this.content.length?this:new H(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new H(i,o)}addToStart(e){return new H([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new H(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return gp(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Dp(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Zi(0,e);if(e==this.size)return Zi(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=i+this.child(r).nodeSize;if(o>=e)return o==e||t>0?Zi(r+1,o):Zi(r,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return H.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new H(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return H.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new H(t||e,r)}static from(e){if(!e)return H.empty;if(e instanceof H)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new H([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}H.empty=new H([],0);const Bs={index:0,offset:0};function Zi(n,e){return Bs.index=n,Bs.offset=e,Bs}function ko(n,e){if(n===e)return!0;if(!n||typeof n!="object"||!e||typeof e!="object")return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!ko(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!ko(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}class te{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ko(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return te.none;if(e instanceof te)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}}te.none=[];class _r extends Error{}class B{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=_p(this.content,e+this.openStart,t);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,t){return new B(Op(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return B.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new B(H.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new B(e,r,i)}}function Op(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(i==e||o.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(Op(o.content,e-i-1,t-i-1)))}function _p(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return n.cut(0,e).append(t).append(n.cut(e));let a=_p(s.content,e-o-1,t);return a&&n.replaceChild(i,s.copy(a))}function aA(n,e,t){if(t.openStart>n.depth)throw new _r("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new _r("Inconsistent open depths");return Sp(n,e,t,0)}function Sp(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=Sp(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}if(t.content.size){if(t.openStart||t.openEnd||n.depth!=r||e.depth!=r){let{start:s,end:a}=function(l,u){let c=u.depth-l.openStart,d=u.node(c).copy(l.content);for(let h=c-1;h>=0;h--)d=u.node(h).copy(H.from(d));return{start:d.resolveNoCache(l.openStart+c),end:d.resolveNoCache(d.content.size-l.openEnd-c)}}(t,n);return Ln(o,Rp(n,s,a,e,r))}{let s=n.parent,a=s.content;return Ln(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}}return Ln(o,wo(n,e,r))}function Tp(n,e){if(!e.type.compatibleContent(n.type))throw new _r("Cannot join "+e.type.name+" onto "+n.type.name)}function xa(n,e,t){let r=n.node(t);return Tp(r,e.node(t)),r}function bn(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function li(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(bn(n.nodeAfter,r),o++));for(let a=o;a<s;a++)bn(i.child(a),r);e&&e.depth==t&&e.textOffset&&bn(e.nodeBefore,r)}function Ln(n,e){return n.type.checkContent(e),n.copy(e)}function Rp(n,e,t,r,i){let o=n.depth>i&&xa(n,e,i+1),s=r.depth>i&&xa(t,r,i+1),a=[];return li(null,n,i,a),o&&s&&e.index(i)==t.index(i)?(Tp(o,s),bn(Ln(o,Rp(n,e,t,r,i+1)),a)):(o&&bn(Ln(o,wo(n,e,i+1)),a),li(e,t,i,a),s&&bn(Ln(s,wo(t,r,i+1)),a)),li(r,null,i,a),new H(a)}function wo(n,e,t){let r=[];return li(null,n,t,r),n.depth>t&&bn(Ln(xa(n,e,t+1),wo(n,e,t+1)),r),li(e,null,t,r),new H(r)}B.empty=new B(H.empty,0,0);class _i{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return(e=this.resolveDepth(e))==0?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[3*t],i=t==0?0:this.path[3*t-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return te.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive!==!1||i&&o[s].isInSet(i.marks)||(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive!==!1||i&&r[o].isInSet(i.marks)||(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new uA(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new _i(t,r,o)}static resolveCached(e,t){for(let i=0;i<Hs.length;i++){let o=Hs[i];if(o.pos==t&&o.doc==e)return o}let r=Hs[Us]=_i.resolve(e,t);return Us=(Us+1)%lA,r}}let Hs=[],Us=0,lA=12;class uA{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const cA=Object.create(null);let kn=class Pa{constructor(e,t,r,i=te.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||H.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&ko(this.attrs,t||e.defaultAttrs||cA)&&te.sameSet(this.marks,r||te.none)}copy(e=null){return e==this.content?this:new Pa(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Pa(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return B.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),a=i.start(s),l=i.node(s).content.cut(i.pos-a,o.pos-a);return new B(l,i.depth-s,o.depth-s)}replace(e,t,r){return aA(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return _i.resolveCached(this,e)}resolveNoCache(e){return _i.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Cp(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=H.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);return!!s&&s.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=te.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!te.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=H.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};kn.prototype.text=void 0;class Mo extends kn{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Cp(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Mo(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Mo(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Cp(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class xn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new dA(e,t);if(r.next==null)return xn.empty;let i=Ip(r);r.next&&r.err("Unexpected trailing text");let o=function(s){let a=Object.create(null);return l(lc(s,0));function l(u){let c=[];u.forEach(h=>{s[h].forEach(({term:p,to:f})=>{if(!p)return;let m;for(let E=0;E<c.length;E++)c[E][0]==p&&(m=c[E][1]);lc(s,f).forEach(E=>{m||c.push([p,m=[]]),m.indexOf(E)==-1&&m.push(E)})})});let d=a[u.join(",")]=new xn(u.indexOf(s.length-1)>-1);for(let h=0;h<c.length;h++){let p=c[h][1].sort(Np);d.next.push({type:c[h][0],next:a[p.join(",")]||l(p)})}return d}}(function(s){let a=[[]];return c(d(s,0),l()),a;function l(){return a.push([])-1}function u(h,p,f){let m={term:f,to:p};return a[h].push(m),m}function c(h,p){h.forEach(f=>f.to=p)}function d(h,p){if(h.type=="choice")return h.exprs.reduce((f,m)=>f.concat(d(m,p)),[]);if(h.type!="seq"){if(h.type=="star"){let f=l();return u(p,f),c(d(h.expr,f),f),[u(f)]}if(h.type=="plus"){let f=l();return c(d(h.expr,p),f),c(d(h.expr,f),f),[u(f)]}if(h.type=="opt")return[u(p)].concat(d(h.expr,p));if(h.type=="range"){let f=p;for(let m=0;m<h.min;m++){let E=l();c(d(h.expr,f),E),f=E}if(h.max==-1)c(d(h.expr,f),f);else for(let m=h.min;m<h.max;m++){let E=l();u(f,E),c(d(h.expr,f),E),f=E}return[u(f)]}if(h.type=="name")return[u(p,void 0,h.value)];throw new Error("Unknown expr type")}for(let f=0;;f++){let m=d(h.exprs[f],p);if(f==h.exprs.length-1)return m;c(m,p=l())}}}(i));return function(s,a){for(let l=0,u=[s];l<u.length;l++){let c=u[l],d=!c.validEnd,h=[];for(let p=0;p<c.next.length;p++){let{type:f,next:m}=c.next[p];h.push(f.name),!d||f.isText||f.hasRequiredAttrs()||(d=!1),u.indexOf(m)==-1&&u.push(m)}d&&a.err("Only non-generatable nodes ("+h.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];return function o(s,a){let l=s.matchFragment(e,r);if(l&&(!t||l.validEnd))return H.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!c.isText&&!c.hasRequiredAttrs()&&i.indexOf(d)==-1){i.push(d);let h=o(d,a.concat(c));if(h)return h}}return null}(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];a.isLeaf||a.hasRequiredAttrs()||a.name in t||i.type&&!l.validEnd||(r.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}(this),e.map((t,r)=>{let i=r+(t.validEnd?"*":" ")+" ";for(let o=0;o<t.next.length;o++)i+=(o?", ":"")+t.next[o].type.name+"->"+e.indexOf(t.next[o].next);return i}).join(`
1189
- `)}}xn.empty=new xn(!0);class dA{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ip(n){let e=[];do e.push(hA(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function hA(n){let e=[];do e.push(pA(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function pA(n){let e=function(t){if(t.eat("(")){let r=Ip(t);return t.eat(")")||t.err("Missing closing paren"),r}if(!/\W/.test(t.next)){let r=function(i,o){let s=i.nodeTypes,a=s[o];if(a)return[a];let l=[];for(let u in s){let c=s[u];c.groups.indexOf(o)>-1&&l.push(c)}return l.length==0&&i.err("No node type or group '"+o+"' found"),l}(t,t.next).map(i=>(t.inline==null?t.inline=i.isInline:t.inline!=i.isInline&&t.err("Mixing inline and block content"),{type:"name",value:i}));return t.pos++,r.length==1?r[0]:{type:"choice",exprs:r}}t.err("Unexpected token '"+t.next+"'")}(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else{if(!n.eat("{"))break;e=fA(n,e)}return e}function ac(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function fA(n,e){let t=ac(n),r=t;return n.eat(",")&&(r=n.next!="}"?ac(n):-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Np(n,e){return e-n}function lc(n,e){let t=[];return function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];a||t.indexOf(l)!=-1||r(l)}}(e),t.sort(Np)}function vp(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function yp(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(!o.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=o.default}t[r]=i}return t}function bp(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new mA(n[t]);return e}let uc=class Lp{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=bp(r.attrs),this.defaultAttrs=vp(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==xn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:yp(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new kn(this,this.computeAttrs(e),H.from(t),te.setFrom(r))}createChecked(e=null,t,r){return t=H.from(t),this.checkContent(t),new kn(this,this.computeAttrs(e),t,te.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),(t=H.from(t)).size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(H.empty,!0);return o?new kn(this,e,t.append(o),te.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:te.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Lp(o,t,s));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class mA{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class ds{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=bp(i.attrs),this.excluded=null;let o=vp(this.attrs);this.instance=o?new te(this,o):null}create(e=null){return!e&&this.instance?this.instance:new te(this,yp(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new ds(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}function cc(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],s=o;if(o)t.push(o);else for(let a in n.marks){let l=n.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class Si{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new pc(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new pc(this,t,!0);return r.addAll(e,t.from,t.to),B.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(AA(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(s.getAttrs){let l=s.getAttrs(t);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<t.length;s++){let a=t[s];if((a.priority==null?50:a.priority)<o)break}t.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=fc(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=fc(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Si(e,Si.schemaRules(e)))}}const kp={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},EA={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},dc={ol:!0,ul:!0};function hc(n,e,t){return e!=null?(e?1:0)|(e==="full"?2:0):n&&n.whitespace=="pre"?3:-5&t}class js{constructor(e,t,r,i,o,s,a){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=te.none,this.stashMarks=[],this.match=s||(4&a?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(H.from(e));if(!t){let r,i=this.type.contentMatch;return(r=i.findWrapping(e.type))?(this.match=i,r):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let r,i=this.content[this.content.length-1];if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let o=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-r[0].length))}}let t=H.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(H.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):gA(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!kp.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class pc{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i,o=t.topNode,s=hc(null,t.preserveWhitespace,0)|(r?4:0);i=o?new js(o.type,o.attrs,te.none,te.none,!0,t.topMatch||o.type.contentMatch,s):new js(r?null:e.schema.topNodeType,null,te.none,te.none,!0,null,s),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,t){let r=e.getAttribute("style");if(!r)return t();let i=this.readStyles(function(l){let u,c=/\s*([\w-]+)\s*:\s*([^;]+)/g,d=[];for(;u=c.exec(l);)d.push(u[1],u[2].trim());return d}(r));if(!i)return;let[o,s]=i,a=this.top;for(let l=0;l<s.length;l++)this.removePendingMark(s[l],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l]);t();for(let l=0;l<o.length;l++)this.removePendingMark(o[l],a);for(let l=0;l<s.length;l++)this.addPendingMark(s[l])}addTextNode(e){let t=e.nodeValue,r=this.top;if(2&r.options||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&r.options)t=2&r.options?t.replace(/\r\n?/g,`
1190
- `):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r,i=e.nodeName.toLowerCase();dc.hasOwnProperty(i)&&this.parser.normalizeLists&&function(s){for(let a=s.firstChild,l=null;a;a=a.nextSibling){let u=a.nodeType==1?a.nodeName.toLowerCase():null;u&&dc.hasOwnProperty(u)&&l?(l.appendChild(a),a=l):u=="li"?l=a:u&&(l=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(r=this.parser.matchTag(e,this,t));if(o?o.ignore:EA.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let s,a=this.top,l=this.needsBlock;if(kp.hasOwnProperty(i))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?r:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
1191
- `))}ignoreFallback(e){e.nodeName!="BR"||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=te.none,r=te.none;for(let i=0;i<e.length;i+=2)for(let o;;){let s=this.parser.matchStyle(e[i],e[i+1],this,o);if(!s)break;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(a=>{s.clearMark(a)&&(r=a.addToSet(r))}):t=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(t),s.consuming!==!1)break;o=s}return[t,r]}addElementByRule(e,t,r){let i,o,s;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(s=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!t||t.length>s.length)&&(t=s,r=o,!s.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)t.type&&!t.type.allowsMarkType(e.marks[i].type)||(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let s=hc(e,i,o.options);4&o.options&&o.content.length==0&&(s|=4),this.nodes.push(new js(e,t,o.activeMarks,o.pendingMarks,r,null,s)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=t[a];if(u==""){if(a==t.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;l--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=function(r,i){for(let o=0;o<i.length;o++)if(r.eq(i[o]))return i[o]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}}function AA(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function fc(n){let e={};for(let t in n)e[t]=n[t];return e}function gA(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:c}=a.edge(l);if(u==e||o.indexOf(c)<0&&s(c))return!0}};if(s(i.contentMatch))return!0}}class Vt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=$s(t).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let u=s.marks[l];if(this.marks[u.type.name]){if(!u.eq(o[a][0])||u.type.spec.spanning===!1)break;a++,l++}else l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],c=this.serializeMark(u,s.isInline,t);c&&(o.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Vt.renderSpec($s(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Vt.renderSpec($s(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i,o=t[0],s=o.indexOf(" ");s>0&&(r=o.slice(0,s),o=o.slice(s+1));let a=r?e.createElementNS(r,o):e.createElement(o),l=t[1],u=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let c in l)if(l[c]!=null){let d=c.indexOf(" ");d>0?a.setAttributeNS(c.slice(0,d),c.slice(d+1),l[c]):a.setAttribute(c,l[c])}}for(let c=u;c<t.length;c++){let d=t[c];if(d===0){if(c<t.length-1||c>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}{let{dom:h,contentDOM:p}=Vt.renderSpec(e,d,r);if(a.appendChild(h),p){if(i)throw new RangeError("Multiple content holes");i=p}}}return{dom:a,contentDOM:i}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Vt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=mc(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return mc(e.marks)}}function mc(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function $s(n){return n.document||window.document}const wp=Math.pow(2,16);function DA(n,e){return n+e*wp}function Ec(n){return 65535&n}let Ba=class{constructor(n,e,t){this.pos=n,this.delInfo=e,this.recover=t}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}},Pn=class Xn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Xn.empty)return Xn.empty}recover(e){let t=0,r=Ec(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*r]+t+function(i){return(i-(65535&i))/wp}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=l+i+((u?e==l?-1:e==d?1:t:t)<0?0:c);if(r)return h;let p=e==(t<0?l:d)?null:DA(a/3,e-l),f=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(f|=8),new Ba(h,f,p)}i+=c-u}return r?e+i:new Ba(e+i,0,null)}touches(e,t){let r=0,i=Ec(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o];if(e<=l+u&&a==3*i)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new Xn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Xn.empty:new Xn(e<0?[0,-e,0]:[0,0,e])}};Pn.empty=new Pn([]);let OA=class ho{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new ho(this.maps,this.mirror,e,t)}copy(){return new ho(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new ho;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o].mapResult(e,t);if(s.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this.maps[a].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new Ba(e,i,null)}};const zs=Object.create(null);let xe=class{getMap(){return Pn.empty}merge(n){return null}static fromJSON(n,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let t=zs[e.stepType];if(!t)throw new RangeError(`No step type ${e.stepType} defined`);return t.fromJSON(n,e)}static jsonID(n,e){if(n in zs)throw new RangeError("Duplicate use of step JSON ID "+n);return zs[n]=e,e.prototype.jsonID=n,e}},Ve=class $r{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new $r(e,null)}static fail(e){return new $r(null,e)}static fromReplace(e,t,r,i){try{return $r.ok(e.replace(t,r,i))}catch(o){if(o instanceof _r)return $r.fail(o.message);throw o}}};function xl(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(xl(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return H.fromArray(r)}let Pl=class zr extends xe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new B(xl(t.content,(s,a)=>s.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return Ve.fromReplace(e,this.from,this.to,o)}invert(){return new ui(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new zr(t.pos,r.pos,this.mark)}merge(e){return e instanceof zr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new zr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new zr(t.from,t.to,e.markFromJSON(t.mark))}};xe.jsonID("addMark",Pl);let ui=class Vr extends xe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new B(xl(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Ve.fromReplace(e,this.from,this.to,r)}invert(){return new Pl(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Vr(t.pos,r.pos,this.mark)}merge(e){return e instanceof Vr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Vr(t.from,t.to,e.markFromJSON(t.mark))}};xe.jsonID("removeMark",ui);let Bl=class Yr extends xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ve.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ve.fromReplace(e,this.pos,this.pos+1,new B(H.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Yr(this.pos,t.marks[i]);return new Yr(this.pos,this.mark)}}return new Hl(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Yr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Yr(t.pos,e.markFromJSON(t.mark))}};xe.jsonID("addNodeMark",Bl);let Hl=class Ha extends xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ve.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ve.fromReplace(e,this.pos,this.pos+1,new B(H.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Bl(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ha(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ha(t.pos,e.markFromJSON(t.mark))}};xe.jsonID("removeNodeMark",Hl);let jt=class En extends xe{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Ua(e,this.from,this.to)?Ve.fail("Structure replace would overwrite content"):Ve.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Pn([this.from,this.to-this.from,this.slice.size])}invert(e){return new En(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new En(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof En)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new En(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new En(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new En(t.from,t.to,B.fromJSON(e,t.slice),!!t.structure)}};xe.jsonID("replace",jt);let Tn=class po extends xe{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Ua(e,this.from,this.gapFrom)||Ua(e,this.gapTo,this.to)))return Ve.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ve.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Ve.fromReplace(e,this.from,this.to,r):Ve.fail("Content does not fit in gap")}getMap(){return new Pn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new po(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new po(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new po(t.from,t.to,t.gapFrom,t.gapTo,B.fromJSON(e,t.slice),t.insert,!!t.structure)}};function Ua(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function Ac(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}xe.jsonID("replaceAround",Tn);let _A=class{constructor(n,e,t){this.$from=n,this.$to=e,this.unplaced=t,this.frontier=[],this.placed=H.empty;for(let r=0;r<=n.depth;r++){let i=n.node(r);this.frontier.push({type:i.type,match:i.contentMatchAt(n.indexAfter(r))})}for(let r=n.depth;r>0;r--)this.placed=H.from(n.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let l=this.findFittable();l?this.placeNodes(l):this.openMore()||this.dropNode()}let n=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,t=this.$from,r=this.close(n<0?this.$to:t.doc.resolve(n));if(!r)return null;let i=this.placed,o=t.depth,s=r.depth;for(;o&&s&&i.childCount==1;)i=i.firstChild.content,o--,s--;let a=new B(i,o,s);return n>-1?new Tn(t.pos,n,this.$to.pos,this.$to.end(),a,e):a.size||t.pos!=this.$to.pos?new jt(t.pos,r.pos,a):null}findFittable(){let n=this.unplaced.openStart;for(let e=this.unplaced.content,t=0,r=this.unplaced.openEnd;t<n;t++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=t){n=t;break}e=i.content}for(let e=1;e<=2;e++)for(let t=e==1?n:this.unplaced.openStart;t>=0;t--){let r,i=null;t?(i=Vs(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let s=this.depth;s>=0;s--){let a,{type:l,match:u}=this.frontier[s],c=null;if(e==1&&(o?u.matchType(o.type)||(c=u.fillBefore(H.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:s,parent:i,inject:c};if(e==2&&o&&(a=u.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:s,parent:i,wrap:a};if(i&&u.matchType(i.type))break}}}openMore(){let{content:n,openStart:e,openEnd:t}=this.unplaced,r=Vs(n,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new B(n,e+1,Math.max(t,r.size+e>=n.size-t?e+1:0)),!0)}dropNode(){let{content:n,openStart:e,openEnd:t}=this.unplaced,r=Vs(n,e);if(r.childCount<=1&&e>0){let i=n.size-e<=e+r.size;this.unplaced=new B(Gr(n,e-1,1),e-1,i?e-1:t)}else this.unplaced=new B(Gr(n,e,1),e,t)}placeNodes({sliceDepth:n,frontierDepth:e,parent:t,inject:r,wrap:i}){for(;this.depth>e;)this.closeFrontierNode();if(i)for(let f=0;f<i.length;f++)this.openFrontierNode(i[f]);let o=this.unplaced,s=t?t.content:o.content,a=o.openStart-n,l=0,u=[],{match:c,type:d}=this.frontier[e];if(r){for(let f=0;f<r.childCount;f++)u.push(r.child(f));c=c.matchFragment(r)}let h=s.size+n-(o.content.size-o.openEnd);for(;l<s.childCount;){let f=s.child(l),m=c.matchType(f.type);if(!m)break;l++,(l>1||a==0||f.content.size)&&(c=m,u.push(Mp(f.mark(d.allowedMarks(f.marks)),l==1?a:0,l==s.childCount?h:-1)))}let p=l==s.childCount;p||(h=-1),this.placed=Xr(this.placed,e,H.from(u)),this.frontier[e].match=c,p&&h<0&&t&&t.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=s;f<h;f++){let E=m.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),m=E.content}this.unplaced=p?n==0?B.empty:new B(Gr(o.content,n-1,1),n-1,h<0?o.openEnd:n-1):new B(Gr(o.content,n,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let n,e=this.frontier[this.depth];if(!e.type.isTextblock||!Ys(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:t}=this.$to,r=this.$to.after(t);for(;t>1&&r==this.$to.end(--t);)++r;return r}findCloseLevel(n){e:for(let e=Math.min(this.depth,n.depth);e>=0;e--){let{match:t,type:r}=this.frontier[e],i=e<n.depth&&n.end(e+1)==n.pos+(n.depth-(e+1)),o=Ys(n,e,r,t,i);if(o){for(let s=e-1;s>=0;s--){let{match:a,type:l}=this.frontier[s],u=Ys(n,s,l,a,!0);if(!u||u.childCount)continue e}return{depth:e,fit:o,move:i?n.doc.resolve(n.after(e+1)):n}}}}close(n){let e=this.findCloseLevel(n);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Xr(this.placed,e.depth,e.fit)),n=e.move;for(let t=e.depth+1;t<=n.depth;t++){let r=n.node(t),i=r.type.contentMatch.fillBefore(r.content,!0,n.index(t));this.openFrontierNode(r.type,r.attrs,i)}return n}openFrontierNode(n,e=null,t){let r=this.frontier[this.depth];r.match=r.match.matchType(n),this.placed=Xr(this.placed,this.depth,H.from(n.create(e,t))),this.frontier.push({type:n,match:n.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(H.empty,!0);n.childCount&&(this.placed=Xr(this.placed,this.frontier.length,n))}};function Gr(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Gr(n.firstChild.content,e-1,t)))}function Xr(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Xr(n.lastChild.content,e-1,t)))}function Vs(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Mp(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Mp(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(H.empty,!0)))),n.copy(r)}function Ys(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(l,u,c){for(let d=c;d<u.childCount;d++)if(!l.allowsMarks(u.child(d).marks))return!0;return!1}(t,o.content,s)?a:null}function Fp(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(Fp(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(H.empty,!0))}return n}function gc(n,e){let t=[];for(let r=Math.min(n.depth,e.depth);r>=0;r--){let i=n.start(r);if(i<n.pos-(n.depth-r)||e.end(r)>e.pos+(e.depth-r)||n.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(i==e.start(r)||r==n.depth&&r==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==i-1)&&t.push(r)}return t}let xp=class fo extends xe{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ve.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Ve.fromReplace(e,this.pos,this.pos+1,new B(H.from(i),0,t.isLeaf?0:1))}getMap(){return Pn.empty}invert(e){return new fo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new fo(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fo(t.pos,t.attr,t.value)}};xe.jsonID("attr",xp);let Pp=class ja extends xe{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Ve.ok(r)}getMap(){return Pn.empty}invert(e){return new ja(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ja(t.attr,t.value)}};xe.jsonID("docAttr",Pp);let Kr=class extends Error{};Kr=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(Kr.prototype=Object.create(Error.prototype)).constructor=Kr,Kr.prototype.name="TransformError";class SA{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new OA}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Kr(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=B.empty){let i=function(o,s,a=s,l=B.empty){if(s==a&&!l.size)return null;let u=o.resolve(s),c=o.resolve(a);return Ac(u,c,l)?new jt(s,a,l):new _A(u,c,l).fit()}(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new B(H.from(r),0,0))}delete(e,t){return this.replace(e,t,B.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return function(i,o,s,a){if(!a.size)return i.deleteRange(o,s);let l=i.doc.resolve(o),u=i.doc.resolve(s);if(Ac(l,u,a))return i.step(new jt(o,s,a));let c=gc(l,i.doc.resolve(s));c[c.length-1]==0&&c.pop();let d=-(l.depth+1);c.unshift(d);for(let A=l.depth,D=l.pos-1;A>0;A--,D--){let _=l.node(A).type.spec;if(_.defining||_.definingAsContext||_.isolating)break;c.indexOf(A)>-1?d=A:l.before(A)==D&&c.splice(1,0,-A)}let h=c.indexOf(d),p=[],f=a.openStart;for(let A=a.content,D=0;;D++){let _=A.firstChild;if(p.push(_),D==a.openStart)break;A=_.content}for(let A=f-1;A>=0;A--){let D=p[A],_=(m=D.type).spec.defining||m.spec.definingForContent;if(_&&!D.sameMarkup(l.node(Math.abs(d)-1)))f=A;else if(_||!D.type.isTextblock)break}var m;for(let A=a.openStart;A>=0;A--){let D=(A+f+1)%(a.openStart+1),_=p[D];if(_)for(let S=0;S<c.length;S++){let R=c[(S+h)%c.length],v=!0;R<0&&(v=!1,R=-R);let I=l.node(R-1),L=l.index(R-1);if(I.canReplaceWith(L,L,_.type,_.marks))return i.replace(l.before(R),v?u.after(R):s,new B(Fp(a.content,0,a.openStart,D),D,a.openEnd))}}let E=i.steps.length;for(let A=c.length-1;A>=0&&(i.replace(o,s,a),!(i.steps.length>E));A--){let D=c[A];D<0||(o=l.before(D),s=u.after(D))}}(this,e,t,r),this}replaceRangeWith(e,t,r){return function(i,o,s,a){if(!a.isInline&&o==s&&i.doc.resolve(o).parent.content.size){let l=function(u,c,d){let h=u.resolve(c);if(h.parent.canReplaceWith(h.index(),h.index(),d))return c;if(h.parentOffset==0)for(let p=h.depth-1;p>=0;p--){let f=h.index(p);if(h.node(p).canReplaceWith(f,f,d))return h.before(p+1);if(f>0)return null}if(h.parentOffset==h.parent.content.size)for(let p=h.depth-1;p>=0;p--){let f=h.indexAfter(p);if(h.node(p).canReplaceWith(f,f,d))return h.after(p+1);if(f<h.node(p).childCount)return null}return null}(i.doc,o,a.type);l!=null&&(o=s=l)}i.replaceRange(o,s,new B(H.from(a),0,0))}(this,e,t,r),this}deleteRange(e,t){return function(r,i,o){let s=r.doc.resolve(i),a=r.doc.resolve(o),l=gc(s,a);for(let u=0;u<l.length;u++){let c=l[u],d=u==l.length-1;if(d&&c==0||s.node(c).type.contentMatch.validEnd)return r.delete(s.start(c),a.end(c));if(c>0&&(d||s.node(c-1).canReplace(s.index(c-1),a.indexAfter(c-1))))return r.delete(s.before(c),a.after(c))}for(let u=1;u<=s.depth&&u<=a.depth;u++)if(i-s.start(u)==s.depth-u&&o>s.end(u)&&a.end(u)-o!=a.depth-u)return r.delete(s.before(u),o);r.delete(i,o)}(this,e,t),this}lift(e,t){return function(r,i,o){let{$from:s,$to:a,depth:l}=i,u=s.before(l+1),c=a.after(l+1),d=u,h=c,p=H.empty,f=0;for(let A=l,D=!1;A>o;A--)D||s.index(A)>0?(D=!0,p=H.from(s.node(A).copy(p)),f++):d--;let m=H.empty,E=0;for(let A=l,D=!1;A>o;A--)D||a.after(A+1)<a.end(A)?(D=!0,m=H.from(a.node(A).copy(m)),E++):h++;r.step(new Tn(d,h,u,c,new B(p.append(m),f,E),p.size-f,!0))}(this,e,t),this}join(e,t=1){return function(r,i,o){let s=new jt(i-o,i+o,B.empty,!0);r.step(s)}(this,e,t),this}wrap(e,t){return function(r,i,o){let s=H.empty;for(let u=o.length-1;u>=0;u--){if(s.size){let c=o[u].type.contentMatch.matchFragment(s);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}s=H.from(o[u].type.create(o[u].attrs,s))}let a=i.start,l=i.end;r.step(new Tn(a,l,a,l,new B(s,0,0),o.length,!0))}(this,e,t),this}setBlockType(e,t=e,r,i=null){return function(o,s,a,l,u){if(!l.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let c=o.steps.length;o.doc.nodesBetween(s,a,(d,h)=>{if(d.isTextblock&&!d.hasMarkup(l,u)&&function(p,f,m){let E=p.resolve(f),A=E.index();return E.parent.canReplaceWith(A,A+1,m)}(o.doc,o.mapping.slice(c).map(h),l)){o.clearIncompatible(o.mapping.slice(c).map(h,1),l);let p=o.mapping.slice(c),f=p.map(h,1),m=p.map(h+d.nodeSize,1);return o.step(new Tn(f,m,f+1,m-1,new B(H.from(l.create(u,null,d.marks)),0,0),1,!0)),!1}})}(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return function(o,s,a,l,u){let c=o.doc.nodeAt(s);if(!c)throw new RangeError("No node at given position");a||(a=c.type);let d=a.create(l,null,u||c.marks);if(c.isLeaf)return o.replaceWith(s,s+c.nodeSize,d);if(!a.validContent(c.content))throw new RangeError("Invalid content for node type "+a.name);o.step(new Tn(s,s+c.nodeSize,s+1,s+c.nodeSize-1,new B(H.from(d),0,0),1,!0))}(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new xp(e,t,r)),this}setDocAttribute(e,t){return this.step(new Pp(e,t)),this}addNodeMark(e,t){return this.step(new Bl(e,t)),this}removeNodeMark(e,t){if(!(t instanceof te)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(r.marks)))return this}return this.step(new Hl(e,t)),this}split(e,t=1,r){return function(i,o,s=1,a){let l=i.doc.resolve(o),u=H.empty,c=H.empty;for(let d=l.depth,h=l.depth-s,p=s-1;d>h;d--,p--){u=H.from(l.node(d).copy(u));let f=a&&a[p];c=H.from(f?f.type.create(f.attrs,c):l.node(d).copy(c))}i.step(new jt(o,o,new B(u.append(c),s,s),!0))}(this,e,t,r),this}addMark(e,t,r){return function(i,o,s,a){let l,u,c=[],d=[];i.doc.nodesBetween(o,s,(h,p,f)=>{if(!h.isInline)return;let m=h.marks;if(!a.isInSet(m)&&f.type.allowsMarkType(a.type)){let E=Math.max(p,o),A=Math.min(p+h.nodeSize,s),D=a.addToSet(m);for(let _=0;_<m.length;_++)m[_].isInSet(D)||(l&&l.to==E&&l.mark.eq(m[_])?l.to=A:c.push(l=new ui(E,A,m[_])));u&&u.to==E?u.to=A:d.push(u=new Pl(E,A,a))}}),c.forEach(h=>i.step(h)),d.forEach(h=>i.step(h))}(this,e,t,r),this}removeMark(e,t,r){return function(i,o,s,a){let l=[],u=0;i.doc.nodesBetween(o,s,(c,d)=>{if(!c.isInline)return;u++;let h=null;if(a instanceof ds){let p,f=c.marks;for(;p=a.isInSet(f);)(h||(h=[])).push(p),f=p.removeFromSet(f)}else a?a.isInSet(c.marks)&&(h=[a]):h=c.marks;if(h&&h.length){let p=Math.min(d+c.nodeSize,s);for(let f=0;f<h.length;f++){let m,E=h[f];for(let A=0;A<l.length;A++){let D=l[A];D.step==u-1&&E.eq(l[A].style)&&(m=D)}m?(m.to=p,m.step=u):l.push({style:E,from:Math.max(d,o),to:p,step:u})}}}),l.forEach(c=>i.step(new ui(c.from,c.to,c.style)))}(this,e,t,r),this}clearIncompatible(e,t,r){return function(i,o,s,a=s.contentMatch){let l=i.doc.nodeAt(o),u=[],c=o+1;for(let d=0;d<l.childCount;d++){let h=l.child(d),p=c+h.nodeSize,f=a.matchType(h.type);if(f){a=f;for(let m=0;m<h.marks.length;m++)s.allowsMarkType(h.marks[m].type)||i.step(new ui(c,p,h.marks[m]));if(h.isText&&!s.spec.code){let m,E,A=/\r?\n|\r/g;for(;m=A.exec(h.text);)E||(E=new B(H.from(s.schema.text(" ",s.allowedMarks(h.marks))),0,0)),u.push(new jt(c+m.index,c+m.index+m[0].length,E))}}else u.push(new jt(c,p,B.empty));c=p}if(!a.validEnd){let d=a.fillBefore(H.empty,!0);i.replace(c,c,new B(d,0,0))}for(let d=u.length-1;d>=0;d--)i.step(u[d])}(this,e,t,r),this}}const Gs=Object.create(null);class Q{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new TA(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=B.empty){let r=t.content.lastChild,i=null;for(let a=0;a<t.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:u}=s[a],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(u.pos),a?B.empty:t),a==0&&_c(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(r),u=l.map(s.pos),c=l.map(a.pos);o?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),_c(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new ne(e):Kn(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=t<0?Kn(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Kn(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new st(e.node(0))}static atStart(e){return Kn(e,e,0,0,1)||new st(e)}static atEnd(e){return Kn(e,e,e.content.size,e.childCount,-1)||new st(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Gs[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Gs)throw new RangeError("Duplicate use of selection JSON ID "+e);return Gs[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ne.between(this.$anchor,this.$head).getBookmark()}}Q.prototype.visible=!0;class TA{constructor(e,t){this.$from=e,this.$to=t}}let Dc=!1;function Oc(n){Dc||n.parent.inlineContent||(Dc=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class ne extends Q{constructor(e,t=e){Oc(e),Oc(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return Q.near(r);let i=e.resolve(t.map(this.anchor));return new ne(i.parent.inlineContent?i:r,r)}replace(e,t=B.empty){if(super.replace(e,t),t==B.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ne&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new hs(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ne(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if(r&&!i||(r=i>=0?1:-1),!t.parent.inlineContent){let o=Q.findFrom(t,r,!0)||Q.findFrom(t,-r,!0);if(!o)return Q.near(t,r);t=o.$head}return e.parent.inlineContent||(i==0||(e=(Q.findFrom(e,-r,!0)||Q.findFrom(e,r,!0)).$anchor).pos<t.pos!=i<0)&&(e=t),new ne(e,t)}}Q.jsonID("text",ne);class hs{constructor(e,t){this.anchor=e,this.head=t}map(e){return new hs(e.map(this.anchor),e.map(this.head))}resolve(e){return ne.between(e.resolve(this.anchor),e.resolve(this.head))}}class X extends Q{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?Q.near(o):new X(o)}content(){return new B(H.from(this.node),0,0)}eq(e){return e instanceof X&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ul(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new X(e.resolve(t.anchor))}static create(e,t){return new X(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}X.prototype.visible=!1,Q.jsonID("node",X);class Ul{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new hs(r,r):new Ul(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&X.isSelectable(r)?new X(t):Q.near(t)}}class st extends Q{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=B.empty){if(t==B.empty){e.delete(0,e.doc.content.size);let r=Q.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new st(e)}map(e){return new st(e)}eq(e){return e instanceof st}getBookmark(){return RA}}Q.jsonID("all",st);const RA={map(){return this},resolve:n=>new st(n)};function Kn(n,e,t,r,i,o=!1){if(e.inlineContent)return ne.create(n,t);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&X.isSelectable(a))return X.create(n,t-(i<0?a.nodeSize:0))}else{let l=Kn(n,a,t+i,i<0?a.childCount:0,i,o);if(l)return l}t+=a.nodeSize*i}return null}function _c(n,e,t){let r=n.steps.length-1;if(r<e)return;let i,o=n.steps[r];(o instanceof jt||o instanceof Tn)&&(n.mapping.maps[r].forEach((s,a,l,u)=>{i==null&&(i=u)}),n.setSelection(Q.near(n.doc.resolve(i),t)))}class CA extends SA{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return te.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||te.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r==null?t:r,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(Q.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Sc(n,e){return e&&n?n.bind(e):n}class Wr{constructor(e,t,r){this.name=e,this.init=Sc(t.init,r),this.apply=Sc(t.apply,r)}}const IA=[new Wr("doc",{init:n=>n.doc||n.schema.topNodeType.createAndFill(),apply:n=>n.doc}),new Wr("selection",{init:(n,e)=>n.selection||Q.atStart(e.doc),apply:n=>n.selection}),new Wr("storedMarks",{init:n=>n.storedMarks||null,apply:(n,e,t,r)=>r.selection.$cursor?n.storedMarks:null}),new Wr("scrollToSelection",{init:()=>0,apply:(n,e)=>n.scrolledIntoView?e+1:e})];class Xs{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=IA.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Wr(r.key,r.spec.state,r))})}}class tr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,u=i?i[s].state:this,c=l<t.length&&a.spec.appendTransaction.call(a,l?t.slice(l):t,u,r);if(c&&r.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<s?{state:r,n:t.length}:{state:this,n:0})}t.push(c),r=r.applyInner(c),o=!0}i&&(i[s]={state:r,n:t.length})}}if(!o)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new tr(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new CA(this)}static create(e){let t=new Xs(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new tr(t);for(let i=0;i<t.fields.length;i++)r[t.fields[i].name]=t.fields[i].init(e,r);return r}reconfigure(e){let t=new Xs(this.schema,e.plugins),r=t.fields,i=new tr(t);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Xs(e.schema,e.plugins),o=new tr(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=kn.fromJSON(e.schema,t.doc);else if(s.name=="selection")o.selection=Q.fromJSON(o.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,a))return void(o[s.name]=u.fromJSON.call(l,e,t[a],o))}o[s.name]=s.init(e,o)}}),o}}function Bp(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Bp(i,e,{})),t[r]=i}return t}class ps{constructor(e){this.spec=e,this.props={},e.props&&Bp(e.props,this,this.props),this.key=e.key?e.key.key:Hp("plugin")}getState(e){return e[this.key]}}const Ks=Object.create(null);function Hp(n){return n in Ks?n+"$"+ ++Ks[n]:(Ks[n]=0,n+"$")}class fs{constructor(e="key"){this.key=Hp(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const je=function(n){for(var e=0;;e++)if(!(n=n.previousSibling))return e},Ti=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Tc=null;const Ut=function(n,e,t){let r=Tc||(Tc=document.createRange());return r.setEnd(n,t==null?n.nodeValue.length:t),r.setStart(n,e||0),r},Bn=function(n,e,t,r){return t&&(Rc(n,e,t,r,-1)||Rc(n,e,t,r,1))},NA=/^(img|br|input|textarea|hr)$/i;function Rc(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:It(n))){let o=n.parentNode;if(!o||o.nodeType!=1||$a(n)||NA.test(n.nodeName)||n.contentEditable=="false")return!1;e=je(n)+(i<0?0:1),n=o}else{if(n.nodeType!=1||(n=n.childNodes[e+(i<0?-1:0)]).contentEditable=="false")return!1;e=i<0?It(n):0}}}function It(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function $a(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const ms=function(n){return n.focusNode&&Bn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Sn(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const Lt=typeof navigator!="undefined"?navigator:null,Cc=typeof document!="undefined"?document:null,hn=Lt&&Lt.userAgent||"",za=/Edge\/(\d+)/.exec(hn),Up=/MSIE \d/.exec(hn),Va=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hn),Ze=!!(Up||Va||za),sn=Up?document.documentMode:Va?+Va[1]:za?+za[1]:0,gt=!Ze&&/gecko\/(\d+)/i.test(hn);gt&&(/Firefox\/(\d+)/.exec(hn)||[0,0])[1];const Ya=!Ze&&/Chrome\/(\d+)/.exec(hn),we=!!Ya,vA=Ya?+Ya[1]:0,Xe=!Ze&&!!Lt&&/Apple Computer/.test(Lt.vendor),Sr=Xe&&(/Mobile\/\w+/.test(hn)||!!Lt&&Lt.maxTouchPoints>2),lt=Sr||!!Lt&&/Mac/.test(Lt.platform),yA=!!Lt&&/Win/.test(Lt.platform),dt=/Android \d/.test(hn),Hi=!!Cc&&"webkitFontSmoothing"in Cc.documentElement.style,bA=Hi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function LA(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Pt(n,e){return typeof n=="number"?n:n[e]}function kA(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function Ic(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;s=Ti(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,u=l?LA(o):kA(a),c=0,d=0;if(e.top<u.top+Pt(r,"top")?d=-(u.top-e.top+Pt(i,"top")):e.bottom>u.bottom-Pt(r,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Pt(i,"top")-u.top:e.bottom-u.bottom+Pt(i,"bottom")),e.left<u.left+Pt(r,"left")?c=-(u.left-e.left+Pt(i,"left")):e.right>u.right-Pt(r,"right")&&(c=e.right-u.right+Pt(i,"right")),c||d)if(l)o.defaultView.scrollBy(c,d);else{let h=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),c&&(a.scrollLeft+=c);let f=a.scrollLeft-h,m=a.scrollTop-p;e={left:e.left-f,top:e.top-m,right:e.right-f,bottom:e.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Nc(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Ti(r));return e}function vc(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:i,left:o}=n[t];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Vn=null;function jp(n,e){let t,r,i,o,s=2e8,a=0,l=e.top,u=e.top;for(let c=n.firstChild,d=0;c;c=c.nextSibling,d++){let h;if(c.nodeType==1)h=c.getClientRects();else{if(c.nodeType!=3)continue;h=Ut(c).getClientRects()}for(let p=0;p<h.length;p++){let f=h[p];if(f.top<=l&&f.bottom>=u){l=Math.max(f.bottom,l),u=Math.min(f.top,u);let m=f.left>e.left?f.left-e.left:f.right<e.left?e.left-f.right:0;if(m<s){t=c,s=m,r=m&&t.nodeType==3?{left:f.right<e.left?f.right:f.left,top:e.top}:e,c.nodeType==1&&m&&(a=d+(e.left>=(f.left+f.right)/2?1:0));continue}}else f.top>e.top&&!i&&f.left<=e.left&&f.right>=e.left&&(i=c,o={left:Math.max(f.left,Math.min(f.right,e.left)),top:f.top});!t&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(a=d+1)}}return!t&&i&&(t=i,r=o,s=0),t&&t.nodeType==3?function(c,d){let h=c.nodeValue.length,p=document.createRange();for(let f=0;f<h;f++){p.setEnd(c,f+1),p.setStart(c,f);let m=qt(p,1);if(m.top!=m.bottom&&jl(d,m))return{node:c,offset:f+(d.left>=(m.left+m.right)/2?1:0)}}return{node:c,offset:0}}(t,r):!t||s&&t.nodeType==1?{node:n,offset:a}:jp(t,r)}function jl(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function $p(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),o=i;;){let s=n.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(jl(e,u))return $p(s,e,u)}}if((o=(o+1)%r)==i)break}return n}function wA(n,e){let t,r=n.dom.ownerDocument,i=0,o=function(u,c,d){if(u.caretPositionFromPoint)try{let h=u.caretPositionFromPoint(c,d);if(h)return{node:h.offsetNode,offset:h.offset}}catch(h){}if(u.caretRangeFromPoint){let h=u.caretRangeFromPoint(c,d);if(h)return{node:h.startContainer,offset:h.startOffset}}}(r,e.left,e.top);o&&({node:t,offset:i}=o);let s,a=(n.root.elementFromPoint?n.root:r).elementFromPoint(e.left,e.top);if(!a||!n.dom.contains(a.nodeType!=1?a.parentNode:a)){let u=n.dom.getBoundingClientRect();if(!jl(e,u)||(a=$p(n.dom,e,u),!a))return null}if(Xe)for(let u=a;t&&u;u=Ti(u))u.draggable&&(t=void 0);if(a=function(u,c){let d=u.parentNode;return d&&/^li$/i.test(d.nodeName)&&c.left<u.getBoundingClientRect().left?d:u}(a,e),t){if(gt&&t.nodeType==1&&(i=Math.min(i,t.childNodes.length),i<t.childNodes.length)){let c,d=t.childNodes[i];d.nodeName=="IMG"&&(c=d.getBoundingClientRect()).right<=e.left&&c.bottom>e.top&&i++}let u;Hi&&i&&t.nodeType==1&&(u=t.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,t==n.dom&&i==t.childNodes.length-1&&t.lastChild.nodeType==1&&e.top>t.lastChild.getBoundingClientRect().bottom?s=n.state.doc.content.size:i!=0&&t.nodeType==1&&t.childNodes[i-1].nodeName=="BR"||(s=function(c,d,h,p){let f=-1;for(let m=d,E=!1;m!=c.dom;){let A=c.docView.nearestDesc(m,!0);if(!A)return null;if(A.dom.nodeType==1&&(A.node.isBlock&&A.parent&&!E||!A.contentDOM)){let D=A.dom.getBoundingClientRect();if(A.node.isBlock&&A.parent&&!E&&(E=!0,D.left>p.left||D.top>p.top?f=A.posBefore:(D.right<p.left||D.bottom<p.top)&&(f=A.posAfter)),!A.contentDOM&&f<0&&!A.node.isText)return(A.node.isBlock?p.top<(D.top+D.bottom)/2:p.left<(D.left+D.right)/2)?A.posBefore:A.posAfter}m=A.dom.parentNode}return f>-1?f:c.docView.posFromDOM(d,h,-1)}(n,t,i,e))}s==null&&(s=function(u,c,d){let{node:h,offset:p}=jp(c,d),f=-1;if(h.nodeType==1&&!h.firstChild){let m=h.getBoundingClientRect();f=m.left!=m.right&&d.left>(m.left+m.right)/2?1:-1}return u.docView.posFromDOM(h,p,f)}(n,a,e));let l=n.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function yc(n){return n.top<n.bottom||n.left<n.right}function qt(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(yc(r))return r}return Array.prototype.find.call(t,yc)||n.getBoundingClientRect()}const MA=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function zp(n,e,t){let{node:r,offset:i,atom:o}=n.docView.domFromPos(e,t<0?-1:1),s=Hi||gt;if(r.nodeType==3){if(!s||!MA.test(r.nodeValue)&&(t<0?i:i!=r.nodeValue.length)){let a=i,l=i,u=t<0?1:-1;return t<0&&!i?(l++,u=-1):t>=0&&i==r.nodeValue.length?(a--,u=1):t<0?a--:l++,Br(qt(Ut(r,a,l),u),u<0)}{let a=qt(Ut(r,i,i),t);if(gt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let l=qt(Ut(r,i-1,i-1),-1);if(l.top==a.top){let u=qt(Ut(r,i,i+1),-1);if(u.top!=a.top)return Br(u,u.left<l.left)}}return a}}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==It(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return Ws(a.getBoundingClientRect(),!1)}if(o==null&&i<It(r)){let a=r.childNodes[i];if(a.nodeType==1)return Ws(a.getBoundingClientRect(),!0)}return Ws(r.getBoundingClientRect(),t>=0)}if(o==null&&i&&(t<0||i==It(r))){let a=r.childNodes[i-1],l=a.nodeType==3?Ut(a,It(a)-(s?0:1)):a.nodeType!=1||a.nodeName=="BR"&&a.nextSibling?null:a;if(l)return Br(qt(l,1),!1)}if(o==null&&i<It(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let l=a?a.nodeType==3?Ut(a,0,s?0:1):a.nodeType==1?a:null:null;if(l)return Br(qt(l,-1),!0)}return Br(qt(r.nodeType==3?Ut(r):r,-t),t>=0)}function Br(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function Ws(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function bc(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}const FA=/[\u0590-\u08ac]/;let Lc=null,kc=null,wc=!1;function xA(n,e,t){return Lc==e&&kc==t?wc:(Lc=e,kc=t,wc=t=="up"||t=="down"?function(r,i,o){let s=i.selection,a=o=="up"?s.$from:s.$to;return bc(r,i,()=>{let{node:l}=r.docView.domFromPos(a.pos,o=="up"?-1:1);for(;;){let c=r.docView.nearestDesc(l,!0);if(!c)break;if(c.node.isBlock){l=c.contentDOM||c.dom;break}l=c.dom.parentNode}let u=zp(r,a.pos,1);for(let c=l.firstChild;c;c=c.nextSibling){let d;if(c.nodeType==1)d=c.getClientRects();else{if(c.nodeType!=3)continue;d=Ut(c,0,c.nodeValue.length).getClientRects()}for(let h=0;h<d.length;h++){let p=d[h];if(p.bottom>p.top+1&&(o=="up"?u.top-p.top>2*(p.bottom-u.top):p.bottom-u.bottom>2*(u.bottom-p.top)))return!1}}return!0})}(n,e,t):function(r,i,o){let{$head:s}=i.selection;if(!s.parent.isTextblock)return!1;let a=s.parentOffset,l=!a,u=a==s.parent.content.size,c=r.domSelection();return FA.test(s.parent.textContent)&&c.modify?bc(r,i,()=>{let{focusNode:d,focusOffset:h,anchorNode:p,anchorOffset:f}=r.domSelectionRange(),m=c.caretBidiLevel;c.modify("move",o,"character");let E=s.depth?r.docView.domAfterPos(s.before()):r.dom,{focusNode:A,focusOffset:D}=r.domSelectionRange(),_=A&&!E.contains(A.nodeType==1?A:A.parentNode)||d==A&&h==D;try{c.collapse(p,f),d&&(d!=p||h!=f)&&c.extend&&c.extend(d,h)}catch(S){}return m!=null&&(c.caretBidiLevel=m),_}):o=="left"||o=="backward"?l:u}(n,e,t))}class Ui{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let i=this.children[t];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&(!(s=o.pmViewDesc)||s.parent!=this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}{let o,s;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&(!(s=o.pmViewDesc)||s.parent!=this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}}let i;if(e==this.dom&&this.contentDOM)i=t>je(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return(i==null?r>0:i)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o,s=this.getDesc(i);if(s&&(!t||s.node)){if(!r||!(o=s.nodeDOM)||(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))return s;r=!1}}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let i=this.children[t],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof Yp){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Vp&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,o&&o.dom.parentNode!=this.contentDOM;r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?je(o.dom)+1:0}}{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,o&&o.dom.parentNode!=this.contentDOM;r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,t):{node:this.contentDOM,offset:o?je(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],u=s+l.size;if(i==-1&&e<=u){let c=s+l.border;if(e>=c&&t<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,c);e=s;for(let d=a;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=je(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(u>t||a==this.children.length-1)){t=u;for(let c=a+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){o=je(d.dom);break}t+=d.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=u}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,i=!1){let o=Math.min(e,t),s=Math.max(e,t);for(let h=0,p=0;h<this.children.length;h++){let f=this.children[h],m=p+f.size;if(o>p&&s<m)return f.setSelection(e-p-f.border,t-p-f.border,r,i);p=m}let a=this.domFromPos(e,e?-1:1),l=t==e?a:this.domFromPos(t,t?-1:1),u=r.getSelection(),c=!1;if((gt||Xe)&&e==t){let{node:h,offset:p}=a;if(h.nodeType==3){if(c=!(!p||h.nodeValue[p-1]!=`
1192
- `),c&&p==h.nodeValue.length)for(let f,m=h;m;m=m.parentNode){if(f=m.nextSibling){f.nodeName=="BR"&&(a=l={node:f.parentNode,offset:je(f)+1});break}let E=m.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let f=h.childNodes[p-1];c=f&&(f.nodeName=="BR"||f.contentEditable=="false")}}if(gt&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||c&&Xe)&&Bn(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Bn(l.node,l.offset,u.focusNode,u.focusOffset))return;let d=!1;if((u.extend||e==t)&&!c){u.collapse(a.node,a.offset);try{e!=t&&u.extend(l.node,l.offset),d=!0}catch(h){}}if(!d){if(e>t){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&t>=r:e<s&&t>r){let a=r+o.border,l=s-o.border;if(e>=a&&t<=l)return this.dirty=e==r||t==s?2:1,void(e!=a||t!=l||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=s}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?2:1;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Vp extends Ui{constructor(e,t,r,i){let o,s=t.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:i)),!t.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==0&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class PA extends Ui{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class wn extends Ui{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return s&&s.dom||(s=Vt.renderSpec(document,t.type.spec.toDOM(t,r))),new wn(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=3&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=0){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}slice(e,t,r){let i=wn.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;t<s&&(o=Ka(o,t,s,r)),e>0&&(o=Ka(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}}class an extends Ui{constructor(e,t,r,i,o,s,a,l,u){super(e,[],o,s),this.node=t,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,t,r,i,o,s){let a,l=o.nodeViews[t.type.name],u=l&&l(t,o,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s,r,i),c=u&&u.dom,d=u&&u.contentDOM;if(t.isText)if(c){if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:d}=Vt.renderSpec(document,t.type.spec.toDOM(t)));d||t.isText||c.nodeName=="BR"||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let h=c;return c=Kp(c,r,t),u?a=new BA(e,t,r,i,c,d||null,h,u,o,s+1):t.isText?new Es(e,t,r,i,c,h,o):new an(e,t,r,i,c,d||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>H.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,r){return this.dirty==0&&e.eq(this.node)&&Xa(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new UA(this,s&&s.node,e);(function(u,c,d,h){let p=c.locals(u),f=0;if(p.length==0){for(let D=0;D<u.childCount;D++){let _=u.child(D);h(_,p,c.forChild(f,_),D),f+=_.nodeSize}return}let m=0,E=[],A=null;for(let D=0;;){let _,S,R,v;for(;m<p.length&&p[m].to==f;){let g=p[m++];g.widget&&(_?(S||(S=[_])).push(g):_=g)}if(_)if(S){S.sort(jA);for(let g=0;g<S.length;g++)d(S[g],D,!!A)}else d(_,D,!!A);if(A)v=-1,R=A,A=null;else{if(!(D<u.childCount))break;v=D,R=u.child(D++)}for(let g=0;g<E.length;g++)E[g].to<=f&&E.splice(g--,1);for(;m<p.length&&p[m].from<=f&&p[m].to>f;)E.push(p[m++]);let I=f+R.nodeSize;if(R.isText){let g=I;m<p.length&&p[m].from<g&&(g=p[m].from);for(let O=0;O<E.length;O++)E[O].to<g&&(g=E[O].to);g<I&&(A=R.cut(g-f),R=R.cut(0,g-f),I=g,v=-1)}else for(;m<p.length&&p[m].to<=I;)m++;let L=R.isInline&&!R.isLeaf?E.filter(g=>!g.inline):E.slice();h(R,L,c.forChild(f,R),v),f=I}})(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!d&&l.syncToMarks(c==this.node.childCount?te.none:this.node.child(c).marks,r,e),l.placeWidget(u,e,i)},(u,c,d,h)=>{let p;l.syncToMarks(u.marks,r,e),l.findNodeMatch(u,c,d,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(u,c,d,p,e)||l.updateNextNode(u,c,d,e,h,i)||l.addNode(u,c,d,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==2)&&(s&&this.protectLocalComposition(e,s),Gp(this.contentDOM,this.children,e),Sr&&function(u){if(u.nodeName=="UL"||u.nodeName=="OL"){let c=u.style.cssText;u.style.cssText=c+"; list-style: square !important",window.getComputedStyle(u).listStyle,u.style.cssText=c}}(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ne)||r<t||i>t+this.node.content.size)return null;let o=e.domSelectionRange(),s=function(a,l){for(;;){if(a.nodeType==3)return a;if(a.nodeType==1&&l>0){if(a.childNodes.length>l&&a.childNodes[l].nodeType==3)return a.childNodes[l];l=It(a=a.childNodes[l-1])}else{if(!(a.nodeType==1&&l<a.childNodes.length))return null;a=a.childNodes[l],l=0}}}(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=function(u,c,d,h){for(let p=0,f=0;p<u.childCount&&f<=h;){let m=u.child(p++),E=f;if(f+=m.nodeSize,!m.isText)continue;let A=m.text;for(;p<u.childCount;){let D=u.child(p++);if(f+=D.nodeSize,!D.isText)break;A+=D.text}if(f>=d){if(f>=h&&A.slice(h-c.length-E,h-E)==c)return h-c.length;let D=E<h?A.lastIndexOf(c,h-E-1):-1;if(D>=0&&D+c.length+E>=d)return E+D;if(d==h&&A.length>=h+c.length-E&&A.slice(h-E,h-E+c.length)==c)return h}}return-1}(this.node.content,a,r-t,i-t);return l<0?null:{node:s,pos:l,text:a}}return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new PA(this,o,t,i);e.input.compositionNodes.push(s),this.children=Ka(this.children,r,r+i.length,e,s)}update(e,t,r,i){return!(this.dirty==3||!e.sameMarkup(this.node))&&(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(Xa(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Xp(this.dom,this.nodeDOM,Ga(this.outerDeco,this.node,t),Ga(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Mc(n,e,t,r,i){Kp(r,e,n);let o=new an(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Es extends an{constructor(e,t,r,i,o,s,a){super(e,t,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return!(this.dirty==3||this.dirty!=0&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==0&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new Es(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||e!=0&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Yp extends Ui{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==0&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class BA extends an{constructor(e,t,r,i,o,s,a,l,u,c){super(e,t,r,i,o,s,a,u,c),this.spec=l}update(e,t,r,i){if(this.dirty==3)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Gp(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==n){for(;a!=r;)r=Fc(r),i=!0;r=r.nextSibling}else i=!0,n.insertBefore(a,r);if(s instanceof wn){let l=r?r.previousSibling:n.lastChild;Gp(s.contentDOM,s.children,t),r=l?l.nextSibling:n.firstChild}}for(;r;)r=Fc(r),i=!0;i&&t.trackWrites==n&&(t.trackWrites=null)}const ci=function(n){n&&(this.nodeName=n)};ci.prototype=Object.create(null);const Rn=[new ci];function Ga(n,e,t){if(n.length==0)return Rn;let r=t?Rn[0]:new ci,i=[r];for(let o=0;o<n.length;o++){let s=n[o].type.attrs;if(s){s.nodeName&&i.push(r=new ci(s.nodeName));for(let a in s){let l=s[a];l!=null&&(t&&i.length==1&&i.push(r=new ci(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function Xp(n,e,t,r){if(t==Rn&&r==Rn)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=t[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=n&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Rn[0]),i=l}HA(i,a||Rn[0],s)}return i}function HA(n,e,t){for(let r in e)r=="class"||r=="style"||r=="nodeName"||r in t||n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&n.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&n.classList.add(i[o]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r,i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;r=i.exec(e.style);)n.style.removeProperty(r[1])}t.style&&(n.style.cssText+=t.style)}}function Kp(n,e,t){return Xp(n,n,Rn,Ga(e,t,n.nodeType!=1))}function Xa(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function Fc(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class UA{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(i,o){let s=o,a=s.children.length,l=i.childCount,u=new Map,c=[];e:for(;l>0;){let d;for(;;)if(a){let p=s.children[a-1];if(!(p instanceof wn)){d=p,a--;break}s=p,a=p.children.length}else{if(s==o)break e;a=s.parent.children.indexOf(s),s=s.parent}let h=d.node;if(h){if(h!=i.child(l-1))break;--l,u.set(d,l),c.push(d)}}return{index:l,matched:u,matches:c.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[o])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=wn.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o,s=-1;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,t,r)&&!this.preMatch.matched.has(u)){s=a;break}}return!(s<0)&&(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,r,i,o){let s=this.top.children[i];return s.dirty==3&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(e,t,r,o)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=t}}updateNextNode(e,t,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof an){let u=this.preMatch.matched.get(l);if(u!=null&&u!=o)return!1;let c,d=l.dom,h=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=3&&Xa(t,l.outerDeco));if(!h&&l.update(e,t,r,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!h&&(c=this.recreateWrapper(l,e,t,r,i,s)))return this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(i,s+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,i,o,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let a=an.create(this.top,t,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,t,r,i,o){let s=an.create(this.top,e,t,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,t,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(!i||!i.matchesWidget(e)||e!=i.widget&&i.widget.type.toDOM.parentNode){let o=new Vp(this.top,e,t,r);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof wn;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Es)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Xe||we)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Yp(this.top,[],r,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function jA(n,e){return n.type.side-e.type.side}function Ka(n,e,t,r,i){let o=[];for(let s=0,a=0;s<n.length;s++){let l=n[s],u=a,c=a+=l.size;u>=t||c<=e?o.push(l):(u<e&&o.push(l.slice(0,e-u,r)),i&&(o.push(i),i=void 0),c>t&&o.push(l.slice(t-u,l.size,r)))}return o}function $l(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(ms(t)){for(a=u;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&X.isSelectable(c)&&i.parent&&(!c.isInline||!function(d,h,p){for(let f=h==0,m=h==It(d);f||m;){if(d==p)return!0;let E=je(d);if(!(d=d.parentNode))return!1;f=f&&E==0,m=m&&E==It(d)}}(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;l=new X(s==d?u:r.resolve(d))}}else{let c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null;a=r.resolve(c)}return l||(l=zl(n,a,u,e=="pointer"||n.state.selection.head<u.pos&&!o?1:-1)),l}function xc(n){return n.editable?n.hasFocus():Jp(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Xt(n,e=!1){let t=n.state.selection;if(Wp(n,t),xc(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&we){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Bn(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset))return n.input.mouseDown.delayedSelectionSync=!0,void n.domObserver.setCurSelection()}if(n.domObserver.disconnectSelection(),n.cursorWrapper)(function(r){let i=r.domSelection(),o=document.createRange(),s=r.cursorWrapper.dom,a=s.nodeName=="IMG";a?o.setEnd(s.parentNode,je(s)+1):o.setEnd(s,0),o.collapse(!1),i.removeAllRanges(),i.addRange(o),!a&&!r.state.selection.visible&&Ze&&sn<=11&&(s.disabled=!0,s.disabled=!1)})(n);else{let r,i,{anchor:o,head:s}=t;!Pc||t instanceof ne||(t.$from.parent.inlineContent||(r=Bc(n,t.from)),t.empty||t.$from.parent.inlineContent||(i=Bc(n,t.to))),n.docView.setSelection(o,s,n.root,e),Pc&&(r&&Hc(r),i&&Hc(i)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(a){let l=a.dom.ownerDocument;l.removeEventListener("selectionchange",a.input.hideSelectionGuard);let u=a.domSelectionRange(),c=u.anchorNode,d=u.anchorOffset;l.addEventListener("selectionchange",a.input.hideSelectionGuard=()=>{u.anchorNode==c&&u.anchorOffset==d||(l.removeEventListener("selectionchange",a.input.hideSelectionGuard),setTimeout(()=>{xc(a)&&!a.state.selection.visible||a.dom.classList.remove("ProseMirror-hideselection")},20))})}(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const Pc=Xe||we&&vA<63;function Bc(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(Xe&&i&&i.contentEditable=="false")return Js(i);if(!(i&&i.contentEditable!="false"||o&&o.contentEditable!="false")){if(i)return Js(i);if(o)return Js(o)}}function Js(n){return n.contentEditable="true",Xe&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Hc(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function Wp(n,e){if(e instanceof X){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Uc(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Uc(n)}function Uc(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function zl(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||ne.between(e,t,r)}function jc(n){return!(n.editable&&!n.hasFocus())&&Jp(n)}function Jp(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Wa(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&Q.findFrom(o,e)}function Qt(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function $c(n,e,t){let r=n.state.selection;if(!(r instanceof ne)){if(r instanceof X&&r.node.isInline)return Qt(n,new ne(e>0?r.$to:r.$from));{let i=Wa(n.state,e);return!!i&&Qt(n,i)}}if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Qt(n,new ne(r.$anchor,s))}if(!r.empty)return!1;if(n.endOfTextblock(e>0?"forward":"backward")){let i=Wa(n.state,e);return!!(i&&i instanceof X)&&Qt(n,i)}if(!(lt&&t.indexOf("m")>-1)){let i,o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText)return!1;let a=e<0?o.pos-s.nodeSize:o.pos;return!!(s.isAtom||(i=n.docView.descAt(a))&&!i.contentDOM)&&(X.isSelectable(s)?Qt(n,new X(e<0?n.state.doc.resolve(o.pos-s.nodeSize):o)):!!Hi&&Qt(n,new ne(n.state.doc.resolve(e<0?a:a+s.nodeSize))))}}function Qi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Hr(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Yn(n,e){return e<0?function(t){let r=t.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s,a,l=!1;for(gt&&i.nodeType==1&&o<Qi(i)&&Hr(i.childNodes[o],-1)&&(l=!0);;)if(o>0){if(i.nodeType!=1)break;{let u=i.childNodes[o-1];if(Hr(u,-1))s=i,a=--o;else{if(u.nodeType!=3)break;i=u,o=i.nodeValue.length}}}else{if(zc(i))break;{let u=i.previousSibling;for(;u&&Hr(u,-1);)s=i.parentNode,a=je(u),u=u.previousSibling;if(u)i=u,o=Qi(i);else{if(i=i.parentNode,i==t.dom)break;o=0}}}l?qs(t,i,o):s&&qs(t,s,a)}(n):function(t){let r=t.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s,a,l=Qi(i);for(;;)if(o<l){if(i.nodeType!=1||!Hr(i.childNodes[o],1))break;s=i,a=++o}else{if(zc(i))break;{let u=i.nextSibling;for(;u&&Hr(u,1);)s=u.parentNode,a=je(u)+1,u=u.nextSibling;if(u)i=u,o=0,l=Qi(i);else{if(i=i.parentNode,i==t.dom)break;o=l=0}}}s&&qs(t,s,a)}(n)}function zc(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function qs(n,e,t){if(e.nodeType!=3){let o,s;(s=function(a,l){for(;a&&l==a.childNodes.length&&!$a(a);)l=je(a)+1,a=a.parentNode;for(;a&&l<a.childNodes.length;){let u=a.childNodes[l];if(u.nodeType==3)return u;if(u.nodeType==1&&u.contentEditable=="false")break;a=u,l=0}}(e,t))?(e=s,t=0):(o=function(a,l){for(;a&&!l&&!$a(a);)l=je(a),a=a.parentNode;for(;a&&l;){let u=a.childNodes[l-1];if(u.nodeType==3)return u;if(u.nodeType==1&&u.contentEditable=="false")break;l=(a=u).childNodes.length}}(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(ms(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&Xt(n)},50)}function Vc(n,e){let t=n.state.doc.resolve(e);if(!we&&!yA&&t.parent.inlineContent){let r=n.coordsAtPos(e);if(e>t.start()){let i=n.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left<r.left?"ltr":"rtl"}if(e<t.end()){let i=n.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left>r.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Yc(n,e,t){let r=n.state.selection;if(r instanceof ne&&!r.empty||t.indexOf("s")>-1||lt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=Wa(n.state,e);if(s&&s instanceof X)return Qt(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof st?Q.near(s,e):Q.findFrom(s,e);return!!a&&Qt(n,a)}return!1}function Gc(n,e){if(!(n.state.selection instanceof ne))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function Xc(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function $A(n,e){let t=e.keyCode,r=function(i){let o="";return i.ctrlKey&&(o+="c"),i.metaKey&&(o+="m"),i.altKey&&(o+="a"),i.shiftKey&&(o+="s"),o}(e);if(t==8||lt&&t==72&&r=="c")return Gc(n,-1)||Yn(n,-1);if(t==46&&!e.shiftKey||lt&&t==68&&r=="c")return Gc(n,1)||Yn(n,1);if(t==13||t==27)return!0;if(t==37||lt&&t==66&&r=="c"){let i=t==37?Vc(n,n.state.selection.from)=="ltr"?-1:1:-1;return $c(n,i,r)||Yn(n,i)}if(t==39||lt&&t==70&&r=="c"){let i=t==39?Vc(n,n.state.selection.from)=="ltr"?1:-1:1;return $c(n,i,r)||Yn(n,i)}return t==38||lt&&t==80&&r=="c"?Yc(n,-1,r)||Yn(n,-1):t==40||lt&&t==78&&r=="c"?function(i){if(!Xe||i.state.selection.$head.parentOffset>0)return!1;let{focusNode:o,focusOffset:s}=i.domSelectionRange();if(o&&o.nodeType==1&&s==0&&o.firstChild&&o.firstChild.contentEditable=="false"){let a=o.firstChild;Xc(i,a,"true"),setTimeout(()=>Xc(i,a,"false"),20)}return!1}(n)||Yc(n,1,r)||Yn(n,1):r==(lt?"m":"c")&&(t==66||t==73||t==89||t==90)}function qp(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=n.someProp("clipboardSerializer")||Vt.fromSchema(n.state.schema),a=rf(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&c.nodeType==1&&(u=nf[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let f=a.createElement(u[p]);for(;l.firstChild;)f.appendChild(l.firstChild);l.appendChild(f),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(t)}`);let h=n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,`
1188
+ `}}).join("")}(n,e).trim()}class ac{constructor(e,t,r,i,o){this.send=t,this.attachFile=r,this.shareLocation=i,this.toggleEmojiPicker=o,this.isEmpty=e.isEmpty,this.isTyping=e.isTyping,this.atTextLimit=e.atTextLimit,this.characterCount=e.characterCount,this.showEmojiPicker=e.showEmojiPicker}}function Ne(n){this.content=n}function gp(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i!=o){if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=gp(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}else t+=i.nodeSize}}function Dp(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),a=e.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let u=0,c=Math.min(s.text.length,a.text.length);for(;u<c&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,t--,r--;return{a:t,b:r}}if(s.content.size||a.content.size){let u=Dp(s.content,a.content,t-1,r-1);if(u)return u}t-=l,r-=l}else t-=l,r-=l}}Ne.prototype={constructor:Ne,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new Ne(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Ne(t)},addToStart:function(n,e){return new Ne([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Ne(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new Ne(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return(n=Ne.from(n)).size?new Ne(n.content.concat(this.subtract(n).content)):this},append:function(n){return(n=Ne.from(n)).size?new Ne(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Ne.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},Ne.from=function(n){if(n instanceof Ne)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ne(e)};class H{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,a=0;a<t;s++){let l=this.content[s],u=a+l.nodeSize;if(u>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,t-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new H(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>t)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),i+=a.nodeSize),s=l}return new H(r,i)}cutByIndex(e,t){return e==t?H.empty:e==0&&t==this.content.length?this:new H(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new H(i,o)}addToStart(e){return new H([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new H(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return gp(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Dp(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Zi(0,e);if(e==this.size)return Zi(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=i+this.child(r).nodeSize;if(o>=e)return o==e||t>0?Zi(r+1,o):Zi(r,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return H.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new H(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return H.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new H(t||e,r)}static from(e){if(!e)return H.empty;if(e instanceof H)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new H([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}H.empty=new H([],0);const Bs={index:0,offset:0};function Zi(n,e){return Bs.index=n,Bs.offset=e,Bs}function ko(n,e){if(n===e)return!0;if(!n||typeof n!="object"||!e||typeof e!="object")return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!ko(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!ko(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}class te{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ko(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return te.none;if(e instanceof te)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}}te.none=[];class _r extends Error{}class B{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=_p(this.content,e+this.openStart,t);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,t){return new B(Op(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return B.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new B(H.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new B(e,r,i)}}function Op(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(i==e||o.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(Op(o.content,e-i-1,t-i-1)))}function _p(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return n.cut(0,e).append(t).append(n.cut(e));let a=_p(s.content,e-o-1,t);return a&&n.replaceChild(i,s.copy(a))}function aA(n,e,t){if(t.openStart>n.depth)throw new _r("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new _r("Inconsistent open depths");return Sp(n,e,t,0)}function Sp(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=Sp(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}if(t.content.size){if(t.openStart||t.openEnd||n.depth!=r||e.depth!=r){let{start:s,end:a}=function(l,u){let c=u.depth-l.openStart,d=u.node(c).copy(l.content);for(let h=c-1;h>=0;h--)d=u.node(h).copy(H.from(d));return{start:d.resolveNoCache(l.openStart+c),end:d.resolveNoCache(d.content.size-l.openEnd-c)}}(t,n);return Ln(o,Rp(n,s,a,e,r))}{let s=n.parent,a=s.content;return Ln(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}}return Ln(o,wo(n,e,r))}function Tp(n,e){if(!e.type.compatibleContent(n.type))throw new _r("Cannot join "+e.type.name+" onto "+n.type.name)}function xa(n,e,t){let r=n.node(t);return Tp(r,e.node(t)),r}function bn(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function li(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(bn(n.nodeAfter,r),o++));for(let a=o;a<s;a++)bn(i.child(a),r);e&&e.depth==t&&e.textOffset&&bn(e.nodeBefore,r)}function Ln(n,e){return n.type.checkContent(e),n.copy(e)}function Rp(n,e,t,r,i){let o=n.depth>i&&xa(n,e,i+1),s=r.depth>i&&xa(t,r,i+1),a=[];return li(null,n,i,a),o&&s&&e.index(i)==t.index(i)?(Tp(o,s),bn(Ln(o,Rp(n,e,t,r,i+1)),a)):(o&&bn(Ln(o,wo(n,e,i+1)),a),li(e,t,i,a),s&&bn(Ln(s,wo(t,r,i+1)),a)),li(r,null,i,a),new H(a)}function wo(n,e,t){let r=[];return li(null,n,t,r),n.depth>t&&bn(Ln(xa(n,e,t+1),wo(n,e,t+1)),r),li(e,null,t,r),new H(r)}B.empty=new B(H.empty,0,0);class _i{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return(e=this.resolveDepth(e))==0?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[3*t],i=t==0?0:this.path[3*t-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return te.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive!==!1||i&&o[s].isInSet(i.marks)||(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive!==!1||i&&r[o].isInSet(i.marks)||(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new uA(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new _i(t,r,o)}static resolveCached(e,t){for(let i=0;i<Hs.length;i++){let o=Hs[i];if(o.pos==t&&o.doc==e)return o}let r=Hs[Us]=_i.resolve(e,t);return Us=(Us+1)%lA,r}}let Hs=[],Us=0,lA=12;class uA{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const cA=Object.create(null);let kn=class Pa{constructor(e,t,r,i=te.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||H.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&ko(this.attrs,t||e.defaultAttrs||cA)&&te.sameSet(this.marks,r||te.none)}copy(e=null){return e==this.content?this:new Pa(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Pa(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return B.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),a=i.start(s),l=i.node(s).content.cut(i.pos-a,o.pos-a);return new B(l,i.depth-s,o.depth-s)}replace(e,t,r){return aA(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return _i.resolveCached(this,e)}resolveNoCache(e){return _i.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Cp(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=H.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);return!!s&&s.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=te.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!te.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=H.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};kn.prototype.text=void 0;class Mo extends kn{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Cp(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Mo(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Mo(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Cp(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class xn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new dA(e,t);if(r.next==null)return xn.empty;let i=Ip(r);r.next&&r.err("Unexpected trailing text");let o=function(s){let a=Object.create(null);return l(uc(s,0));function l(u){let c=[];u.forEach(h=>{s[h].forEach(({term:p,to:f})=>{if(!p)return;let m;for(let E=0;E<c.length;E++)c[E][0]==p&&(m=c[E][1]);uc(s,f).forEach(E=>{m||c.push([p,m=[]]),m.indexOf(E)==-1&&m.push(E)})})});let d=a[u.join(",")]=new xn(u.indexOf(s.length-1)>-1);for(let h=0;h<c.length;h++){let p=c[h][1].sort(Np);d.next.push({type:c[h][0],next:a[p.join(",")]||l(p)})}return d}}(function(s){let a=[[]];return c(d(s,0),l()),a;function l(){return a.push([])-1}function u(h,p,f){let m={term:f,to:p};return a[h].push(m),m}function c(h,p){h.forEach(f=>f.to=p)}function d(h,p){if(h.type=="choice")return h.exprs.reduce((f,m)=>f.concat(d(m,p)),[]);if(h.type!="seq"){if(h.type=="star"){let f=l();return u(p,f),c(d(h.expr,f),f),[u(f)]}if(h.type=="plus"){let f=l();return c(d(h.expr,p),f),c(d(h.expr,f),f),[u(f)]}if(h.type=="opt")return[u(p)].concat(d(h.expr,p));if(h.type=="range"){let f=p;for(let m=0;m<h.min;m++){let E=l();c(d(h.expr,f),E),f=E}if(h.max==-1)c(d(h.expr,f),f);else for(let m=h.min;m<h.max;m++){let E=l();u(f,E),c(d(h.expr,f),E),f=E}return[u(f)]}if(h.type=="name")return[u(p,void 0,h.value)];throw new Error("Unknown expr type")}for(let f=0;;f++){let m=d(h.exprs[f],p);if(f==h.exprs.length-1)return m;c(m,p=l())}}}(i));return function(s,a){for(let l=0,u=[s];l<u.length;l++){let c=u[l],d=!c.validEnd,h=[];for(let p=0;p<c.next.length;p++){let{type:f,next:m}=c.next[p];h.push(f.name),!d||f.isText||f.hasRequiredAttrs()||(d=!1),u.indexOf(m)==-1&&u.push(m)}d&&a.err("Only non-generatable nodes ("+h.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];return function o(s,a){let l=s.matchFragment(e,r);if(l&&(!t||l.validEnd))return H.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!c.isText&&!c.hasRequiredAttrs()&&i.indexOf(d)==-1){i.push(d);let h=o(d,a.concat(c));if(h)return h}}return null}(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];a.isLeaf||a.hasRequiredAttrs()||a.name in t||i.type&&!l.validEnd||(r.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}(this),e.map((t,r)=>{let i=r+(t.validEnd?"*":" ")+" ";for(let o=0;o<t.next.length;o++)i+=(o?", ":"")+t.next[o].type.name+"->"+e.indexOf(t.next[o].next);return i}).join(`
1189
+ `)}}xn.empty=new xn(!0);class dA{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ip(n){let e=[];do e.push(hA(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function hA(n){let e=[];do e.push(pA(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function pA(n){let e=function(t){if(t.eat("(")){let r=Ip(t);return t.eat(")")||t.err("Missing closing paren"),r}if(!/\W/.test(t.next)){let r=function(i,o){let s=i.nodeTypes,a=s[o];if(a)return[a];let l=[];for(let u in s){let c=s[u];c.groups.indexOf(o)>-1&&l.push(c)}return l.length==0&&i.err("No node type or group '"+o+"' found"),l}(t,t.next).map(i=>(t.inline==null?t.inline=i.isInline:t.inline!=i.isInline&&t.err("Mixing inline and block content"),{type:"name",value:i}));return t.pos++,r.length==1?r[0]:{type:"choice",exprs:r}}t.err("Unexpected token '"+t.next+"'")}(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else{if(!n.eat("{"))break;e=fA(n,e)}return e}function lc(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function fA(n,e){let t=lc(n),r=t;return n.eat(",")&&(r=n.next!="}"?lc(n):-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Np(n,e){return e-n}function uc(n,e){let t=[];return function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];a||t.indexOf(l)!=-1||r(l)}}(e),t.sort(Np)}function vp(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function yp(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(!o.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=o.default}t[r]=i}return t}function bp(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new mA(n[t]);return e}let cc=class Lp{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=bp(r.attrs),this.defaultAttrs=vp(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==xn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:yp(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new kn(this,this.computeAttrs(e),H.from(t),te.setFrom(r))}createChecked(e=null,t,r){return t=H.from(t),this.checkContent(t),new kn(this,this.computeAttrs(e),t,te.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),(t=H.from(t)).size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(H.empty,!0);return o?new kn(this,e,t.append(o),te.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:te.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Lp(o,t,s));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class mA{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class ds{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=bp(i.attrs),this.excluded=null;let o=vp(this.attrs);this.instance=o?new te(this,o):null}create(e=null){return!e&&this.instance?this.instance:new te(this,yp(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new ds(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}function dc(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],s=o;if(o)t.push(o);else for(let a in n.marks){let l=n.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class Si{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new fc(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new fc(this,t,!0);return r.addAll(e,t.from,t.to),B.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(AA(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(s.getAttrs){let l=s.getAttrs(t);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<t.length;s++){let a=t[s];if((a.priority==null?50:a.priority)<o)break}t.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=mc(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=mc(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Si(e,Si.schemaRules(e)))}}const kp={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},EA={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},hc={ol:!0,ul:!0};function pc(n,e,t){return e!=null?(e?1:0)|(e==="full"?2:0):n&&n.whitespace=="pre"?3:-5&t}class js{constructor(e,t,r,i,o,s,a){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=te.none,this.stashMarks=[],this.match=s||(4&a?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(H.from(e));if(!t){let r,i=this.type.contentMatch;return(r=i.findWrapping(e.type))?(this.match=i,r):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let r,i=this.content[this.content.length-1];if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let o=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-r[0].length))}}let t=H.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(H.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):gA(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!kp.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class fc{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i,o=t.topNode,s=pc(null,t.preserveWhitespace,0)|(r?4:0);i=o?new js(o.type,o.attrs,te.none,te.none,!0,t.topMatch||o.type.contentMatch,s):new js(r?null:e.schema.topNodeType,null,te.none,te.none,!0,null,s),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,t){let r=e.getAttribute("style");if(!r)return t();let i=this.readStyles(function(l){let u,c=/\s*([\w-]+)\s*:\s*([^;]+)/g,d=[];for(;u=c.exec(l);)d.push(u[1],u[2].trim());return d}(r));if(!i)return;let[o,s]=i,a=this.top;for(let l=0;l<s.length;l++)this.removePendingMark(s[l],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l]);t();for(let l=0;l<o.length;l++)this.removePendingMark(o[l],a);for(let l=0;l<s.length;l++)this.addPendingMark(s[l])}addTextNode(e){let t=e.nodeValue,r=this.top;if(2&r.options||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&r.options)t=2&r.options?t.replace(/\r\n?/g,`
1190
+ `):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r,i=e.nodeName.toLowerCase();hc.hasOwnProperty(i)&&this.parser.normalizeLists&&function(s){for(let a=s.firstChild,l=null;a;a=a.nextSibling){let u=a.nodeType==1?a.nodeName.toLowerCase():null;u&&hc.hasOwnProperty(u)&&l?(l.appendChild(a),a=l):u=="li"?l=a:u&&(l=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(r=this.parser.matchTag(e,this,t));if(o?o.ignore:EA.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let s,a=this.top,l=this.needsBlock;if(kp.hasOwnProperty(i))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?r:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
1191
+ `))}ignoreFallback(e){e.nodeName!="BR"||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=te.none,r=te.none;for(let i=0;i<e.length;i+=2)for(let o;;){let s=this.parser.matchStyle(e[i],e[i+1],this,o);if(!s)break;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(a=>{s.clearMark(a)&&(r=a.addToSet(r))}):t=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(t),s.consuming!==!1)break;o=s}return[t,r]}addElementByRule(e,t,r){let i,o,s;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(s=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!t||t.length>s.length)&&(t=s,r=o,!s.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)t.type&&!t.type.allowsMarkType(e.marks[i].type)||(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let s=pc(e,i,o.options);4&o.options&&o.content.length==0&&(s|=4),this.nodes.push(new js(e,t,o.activeMarks,o.pendingMarks,r,null,s)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=t[a];if(u==""){if(a==t.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;l--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=function(r,i){for(let o=0;o<i.length;o++)if(r.eq(i[o]))return i[o]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}}function AA(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function mc(n){let e={};for(let t in n)e[t]=n[t];return e}function gA(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:c}=a.edge(l);if(u==e||o.indexOf(c)<0&&s(c))return!0}};if(s(i.contentMatch))return!0}}class Vt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=$s(t).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let u=s.marks[l];if(this.marks[u.type.name]){if(!u.eq(o[a][0])||u.type.spec.spanning===!1)break;a++,l++}else l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],c=this.serializeMark(u,s.isInline,t);c&&(o.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Vt.renderSpec($s(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Vt.renderSpec($s(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i,o=t[0],s=o.indexOf(" ");s>0&&(r=o.slice(0,s),o=o.slice(s+1));let a=r?e.createElementNS(r,o):e.createElement(o),l=t[1],u=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let c in l)if(l[c]!=null){let d=c.indexOf(" ");d>0?a.setAttributeNS(c.slice(0,d),c.slice(d+1),l[c]):a.setAttribute(c,l[c])}}for(let c=u;c<t.length;c++){let d=t[c];if(d===0){if(c<t.length-1||c>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}{let{dom:h,contentDOM:p}=Vt.renderSpec(e,d,r);if(a.appendChild(h),p){if(i)throw new RangeError("Multiple content holes");i=p}}}return{dom:a,contentDOM:i}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Vt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Ec(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Ec(e.marks)}}function Ec(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function $s(n){return n.document||window.document}const wp=Math.pow(2,16);function DA(n,e){return n+e*wp}function Ac(n){return 65535&n}let Ba=class{constructor(n,e,t){this.pos=n,this.delInfo=e,this.recover=t}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}},Pn=class Xn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Xn.empty)return Xn.empty}recover(e){let t=0,r=Ac(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*r]+t+function(i){return(i-(65535&i))/wp}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=l+i+((u?e==l?-1:e==d?1:t:t)<0?0:c);if(r)return h;let p=e==(t<0?l:d)?null:DA(a/3,e-l),f=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(f|=8),new Ba(h,f,p)}i+=c-u}return r?e+i:new Ba(e+i,0,null)}touches(e,t){let r=0,i=Ac(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o];if(e<=l+u&&a==3*i)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new Xn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Xn.empty:new Xn(e<0?[0,-e,0]:[0,0,e])}};Pn.empty=new Pn([]);let OA=class ho{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new ho(this.maps,this.mirror,e,t)}copy(){return new ho(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new ho;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o].mapResult(e,t);if(s.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this.maps[a].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new Ba(e,i,null)}};const zs=Object.create(null);let xe=class{getMap(){return Pn.empty}merge(n){return null}static fromJSON(n,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let t=zs[e.stepType];if(!t)throw new RangeError(`No step type ${e.stepType} defined`);return t.fromJSON(n,e)}static jsonID(n,e){if(n in zs)throw new RangeError("Duplicate use of step JSON ID "+n);return zs[n]=e,e.prototype.jsonID=n,e}},Ve=class $r{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new $r(e,null)}static fail(e){return new $r(null,e)}static fromReplace(e,t,r,i){try{return $r.ok(e.replace(t,r,i))}catch(o){if(o instanceof _r)return $r.fail(o.message);throw o}}};function Pl(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Pl(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return H.fromArray(r)}let Bl=class zr extends xe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new B(Pl(t.content,(s,a)=>s.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return Ve.fromReplace(e,this.from,this.to,o)}invert(){return new ui(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new zr(t.pos,r.pos,this.mark)}merge(e){return e instanceof zr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new zr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new zr(t.from,t.to,e.markFromJSON(t.mark))}};xe.jsonID("addMark",Bl);let ui=class Vr extends xe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new B(Pl(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Ve.fromReplace(e,this.from,this.to,r)}invert(){return new Bl(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Vr(t.pos,r.pos,this.mark)}merge(e){return e instanceof Vr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Vr(t.from,t.to,e.markFromJSON(t.mark))}};xe.jsonID("removeMark",ui);let Hl=class Yr extends xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ve.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ve.fromReplace(e,this.pos,this.pos+1,new B(H.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Yr(this.pos,t.marks[i]);return new Yr(this.pos,this.mark)}}return new Ul(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Yr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Yr(t.pos,e.markFromJSON(t.mark))}};xe.jsonID("addNodeMark",Hl);let Ul=class Ha extends xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ve.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ve.fromReplace(e,this.pos,this.pos+1,new B(H.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Hl(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ha(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ha(t.pos,e.markFromJSON(t.mark))}};xe.jsonID("removeNodeMark",Ul);let jt=class En extends xe{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Ua(e,this.from,this.to)?Ve.fail("Structure replace would overwrite content"):Ve.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Pn([this.from,this.to-this.from,this.slice.size])}invert(e){return new En(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new En(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof En)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new En(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new En(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new En(t.from,t.to,B.fromJSON(e,t.slice),!!t.structure)}};xe.jsonID("replace",jt);let Tn=class po extends xe{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Ua(e,this.from,this.gapFrom)||Ua(e,this.gapTo,this.to)))return Ve.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ve.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Ve.fromReplace(e,this.from,this.to,r):Ve.fail("Content does not fit in gap")}getMap(){return new Pn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new po(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new po(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new po(t.from,t.to,t.gapFrom,t.gapTo,B.fromJSON(e,t.slice),t.insert,!!t.structure)}};function Ua(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function gc(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}xe.jsonID("replaceAround",Tn);let _A=class{constructor(n,e,t){this.$from=n,this.$to=e,this.unplaced=t,this.frontier=[],this.placed=H.empty;for(let r=0;r<=n.depth;r++){let i=n.node(r);this.frontier.push({type:i.type,match:i.contentMatchAt(n.indexAfter(r))})}for(let r=n.depth;r>0;r--)this.placed=H.from(n.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let l=this.findFittable();l?this.placeNodes(l):this.openMore()||this.dropNode()}let n=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,t=this.$from,r=this.close(n<0?this.$to:t.doc.resolve(n));if(!r)return null;let i=this.placed,o=t.depth,s=r.depth;for(;o&&s&&i.childCount==1;)i=i.firstChild.content,o--,s--;let a=new B(i,o,s);return n>-1?new Tn(t.pos,n,this.$to.pos,this.$to.end(),a,e):a.size||t.pos!=this.$to.pos?new jt(t.pos,r.pos,a):null}findFittable(){let n=this.unplaced.openStart;for(let e=this.unplaced.content,t=0,r=this.unplaced.openEnd;t<n;t++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=t){n=t;break}e=i.content}for(let e=1;e<=2;e++)for(let t=e==1?n:this.unplaced.openStart;t>=0;t--){let r,i=null;t?(i=Vs(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let s=this.depth;s>=0;s--){let a,{type:l,match:u}=this.frontier[s],c=null;if(e==1&&(o?u.matchType(o.type)||(c=u.fillBefore(H.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:s,parent:i,inject:c};if(e==2&&o&&(a=u.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:s,parent:i,wrap:a};if(i&&u.matchType(i.type))break}}}openMore(){let{content:n,openStart:e,openEnd:t}=this.unplaced,r=Vs(n,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new B(n,e+1,Math.max(t,r.size+e>=n.size-t?e+1:0)),!0)}dropNode(){let{content:n,openStart:e,openEnd:t}=this.unplaced,r=Vs(n,e);if(r.childCount<=1&&e>0){let i=n.size-e<=e+r.size;this.unplaced=new B(Gr(n,e-1,1),e-1,i?e-1:t)}else this.unplaced=new B(Gr(n,e,1),e,t)}placeNodes({sliceDepth:n,frontierDepth:e,parent:t,inject:r,wrap:i}){for(;this.depth>e;)this.closeFrontierNode();if(i)for(let f=0;f<i.length;f++)this.openFrontierNode(i[f]);let o=this.unplaced,s=t?t.content:o.content,a=o.openStart-n,l=0,u=[],{match:c,type:d}=this.frontier[e];if(r){for(let f=0;f<r.childCount;f++)u.push(r.child(f));c=c.matchFragment(r)}let h=s.size+n-(o.content.size-o.openEnd);for(;l<s.childCount;){let f=s.child(l),m=c.matchType(f.type);if(!m)break;l++,(l>1||a==0||f.content.size)&&(c=m,u.push(Mp(f.mark(d.allowedMarks(f.marks)),l==1?a:0,l==s.childCount?h:-1)))}let p=l==s.childCount;p||(h=-1),this.placed=Xr(this.placed,e,H.from(u)),this.frontier[e].match=c,p&&h<0&&t&&t.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=s;f<h;f++){let E=m.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),m=E.content}this.unplaced=p?n==0?B.empty:new B(Gr(o.content,n-1,1),n-1,h<0?o.openEnd:n-1):new B(Gr(o.content,n,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let n,e=this.frontier[this.depth];if(!e.type.isTextblock||!Ys(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:t}=this.$to,r=this.$to.after(t);for(;t>1&&r==this.$to.end(--t);)++r;return r}findCloseLevel(n){e:for(let e=Math.min(this.depth,n.depth);e>=0;e--){let{match:t,type:r}=this.frontier[e],i=e<n.depth&&n.end(e+1)==n.pos+(n.depth-(e+1)),o=Ys(n,e,r,t,i);if(o){for(let s=e-1;s>=0;s--){let{match:a,type:l}=this.frontier[s],u=Ys(n,s,l,a,!0);if(!u||u.childCount)continue e}return{depth:e,fit:o,move:i?n.doc.resolve(n.after(e+1)):n}}}}close(n){let e=this.findCloseLevel(n);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Xr(this.placed,e.depth,e.fit)),n=e.move;for(let t=e.depth+1;t<=n.depth;t++){let r=n.node(t),i=r.type.contentMatch.fillBefore(r.content,!0,n.index(t));this.openFrontierNode(r.type,r.attrs,i)}return n}openFrontierNode(n,e=null,t){let r=this.frontier[this.depth];r.match=r.match.matchType(n),this.placed=Xr(this.placed,this.depth,H.from(n.create(e,t))),this.frontier.push({type:n,match:n.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(H.empty,!0);n.childCount&&(this.placed=Xr(this.placed,this.frontier.length,n))}};function Gr(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Gr(n.firstChild.content,e-1,t)))}function Xr(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Xr(n.lastChild.content,e-1,t)))}function Vs(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Mp(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Mp(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(H.empty,!0)))),n.copy(r)}function Ys(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(l,u,c){for(let d=c;d<u.childCount;d++)if(!l.allowsMarks(u.child(d).marks))return!0;return!1}(t,o.content,s)?a:null}function Fp(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(Fp(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(H.empty,!0))}return n}function Dc(n,e){let t=[];for(let r=Math.min(n.depth,e.depth);r>=0;r--){let i=n.start(r);if(i<n.pos-(n.depth-r)||e.end(r)>e.pos+(e.depth-r)||n.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(i==e.start(r)||r==n.depth&&r==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==i-1)&&t.push(r)}return t}let xp=class fo extends xe{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ve.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Ve.fromReplace(e,this.pos,this.pos+1,new B(H.from(i),0,t.isLeaf?0:1))}getMap(){return Pn.empty}invert(e){return new fo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new fo(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fo(t.pos,t.attr,t.value)}};xe.jsonID("attr",xp);let Pp=class ja extends xe{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Ve.ok(r)}getMap(){return Pn.empty}invert(e){return new ja(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ja(t.attr,t.value)}};xe.jsonID("docAttr",Pp);let Kr=class extends Error{};Kr=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(Kr.prototype=Object.create(Error.prototype)).constructor=Kr,Kr.prototype.name="TransformError";class SA{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new OA}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Kr(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=B.empty){let i=function(o,s,a=s,l=B.empty){if(s==a&&!l.size)return null;let u=o.resolve(s),c=o.resolve(a);return gc(u,c,l)?new jt(s,a,l):new _A(u,c,l).fit()}(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new B(H.from(r),0,0))}delete(e,t){return this.replace(e,t,B.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return function(i,o,s,a){if(!a.size)return i.deleteRange(o,s);let l=i.doc.resolve(o),u=i.doc.resolve(s);if(gc(l,u,a))return i.step(new jt(o,s,a));let c=Dc(l,i.doc.resolve(s));c[c.length-1]==0&&c.pop();let d=-(l.depth+1);c.unshift(d);for(let A=l.depth,D=l.pos-1;A>0;A--,D--){let _=l.node(A).type.spec;if(_.defining||_.definingAsContext||_.isolating)break;c.indexOf(A)>-1?d=A:l.before(A)==D&&c.splice(1,0,-A)}let h=c.indexOf(d),p=[],f=a.openStart;for(let A=a.content,D=0;;D++){let _=A.firstChild;if(p.push(_),D==a.openStart)break;A=_.content}for(let A=f-1;A>=0;A--){let D=p[A],_=(m=D.type).spec.defining||m.spec.definingForContent;if(_&&!D.sameMarkup(l.node(Math.abs(d)-1)))f=A;else if(_||!D.type.isTextblock)break}var m;for(let A=a.openStart;A>=0;A--){let D=(A+f+1)%(a.openStart+1),_=p[D];if(_)for(let S=0;S<c.length;S++){let T=c[(S+h)%c.length],N=!0;T<0&&(N=!1,T=-T);let I=l.node(T-1),L=l.index(T-1);if(I.canReplaceWith(L,L,_.type,_.marks))return i.replace(l.before(T),N?u.after(T):s,new B(Fp(a.content,0,a.openStart,D),D,a.openEnd))}}let E=i.steps.length;for(let A=c.length-1;A>=0&&(i.replace(o,s,a),!(i.steps.length>E));A--){let D=c[A];D<0||(o=l.before(D),s=u.after(D))}}(this,e,t,r),this}replaceRangeWith(e,t,r){return function(i,o,s,a){if(!a.isInline&&o==s&&i.doc.resolve(o).parent.content.size){let l=function(u,c,d){let h=u.resolve(c);if(h.parent.canReplaceWith(h.index(),h.index(),d))return c;if(h.parentOffset==0)for(let p=h.depth-1;p>=0;p--){let f=h.index(p);if(h.node(p).canReplaceWith(f,f,d))return h.before(p+1);if(f>0)return null}if(h.parentOffset==h.parent.content.size)for(let p=h.depth-1;p>=0;p--){let f=h.indexAfter(p);if(h.node(p).canReplaceWith(f,f,d))return h.after(p+1);if(f<h.node(p).childCount)return null}return null}(i.doc,o,a.type);l!=null&&(o=s=l)}i.replaceRange(o,s,new B(H.from(a),0,0))}(this,e,t,r),this}deleteRange(e,t){return function(r,i,o){let s=r.doc.resolve(i),a=r.doc.resolve(o),l=Dc(s,a);for(let u=0;u<l.length;u++){let c=l[u],d=u==l.length-1;if(d&&c==0||s.node(c).type.contentMatch.validEnd)return r.delete(s.start(c),a.end(c));if(c>0&&(d||s.node(c-1).canReplace(s.index(c-1),a.indexAfter(c-1))))return r.delete(s.before(c),a.after(c))}for(let u=1;u<=s.depth&&u<=a.depth;u++)if(i-s.start(u)==s.depth-u&&o>s.end(u)&&a.end(u)-o!=a.depth-u)return r.delete(s.before(u),o);r.delete(i,o)}(this,e,t),this}lift(e,t){return function(r,i,o){let{$from:s,$to:a,depth:l}=i,u=s.before(l+1),c=a.after(l+1),d=u,h=c,p=H.empty,f=0;for(let A=l,D=!1;A>o;A--)D||s.index(A)>0?(D=!0,p=H.from(s.node(A).copy(p)),f++):d--;let m=H.empty,E=0;for(let A=l,D=!1;A>o;A--)D||a.after(A+1)<a.end(A)?(D=!0,m=H.from(a.node(A).copy(m)),E++):h++;r.step(new Tn(d,h,u,c,new B(p.append(m),f,E),p.size-f,!0))}(this,e,t),this}join(e,t=1){return function(r,i,o){let s=new jt(i-o,i+o,B.empty,!0);r.step(s)}(this,e,t),this}wrap(e,t){return function(r,i,o){let s=H.empty;for(let u=o.length-1;u>=0;u--){if(s.size){let c=o[u].type.contentMatch.matchFragment(s);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}s=H.from(o[u].type.create(o[u].attrs,s))}let a=i.start,l=i.end;r.step(new Tn(a,l,a,l,new B(s,0,0),o.length,!0))}(this,e,t),this}setBlockType(e,t=e,r,i=null){return function(o,s,a,l,u){if(!l.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let c=o.steps.length;o.doc.nodesBetween(s,a,(d,h)=>{if(d.isTextblock&&!d.hasMarkup(l,u)&&function(p,f,m){let E=p.resolve(f),A=E.index();return E.parent.canReplaceWith(A,A+1,m)}(o.doc,o.mapping.slice(c).map(h),l)){o.clearIncompatible(o.mapping.slice(c).map(h,1),l);let p=o.mapping.slice(c),f=p.map(h,1),m=p.map(h+d.nodeSize,1);return o.step(new Tn(f,m,f+1,m-1,new B(H.from(l.create(u,null,d.marks)),0,0),1,!0)),!1}})}(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return function(o,s,a,l,u){let c=o.doc.nodeAt(s);if(!c)throw new RangeError("No node at given position");a||(a=c.type);let d=a.create(l,null,u||c.marks);if(c.isLeaf)return o.replaceWith(s,s+c.nodeSize,d);if(!a.validContent(c.content))throw new RangeError("Invalid content for node type "+a.name);o.step(new Tn(s,s+c.nodeSize,s+1,s+c.nodeSize-1,new B(H.from(d),0,0),1,!0))}(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new xp(e,t,r)),this}setDocAttribute(e,t){return this.step(new Pp(e,t)),this}addNodeMark(e,t){return this.step(new Hl(e,t)),this}removeNodeMark(e,t){if(!(t instanceof te)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(r.marks)))return this}return this.step(new Ul(e,t)),this}split(e,t=1,r){return function(i,o,s=1,a){let l=i.doc.resolve(o),u=H.empty,c=H.empty;for(let d=l.depth,h=l.depth-s,p=s-1;d>h;d--,p--){u=H.from(l.node(d).copy(u));let f=a&&a[p];c=H.from(f?f.type.create(f.attrs,c):l.node(d).copy(c))}i.step(new jt(o,o,new B(u.append(c),s,s),!0))}(this,e,t,r),this}addMark(e,t,r){return function(i,o,s,a){let l,u,c=[],d=[];i.doc.nodesBetween(o,s,(h,p,f)=>{if(!h.isInline)return;let m=h.marks;if(!a.isInSet(m)&&f.type.allowsMarkType(a.type)){let E=Math.max(p,o),A=Math.min(p+h.nodeSize,s),D=a.addToSet(m);for(let _=0;_<m.length;_++)m[_].isInSet(D)||(l&&l.to==E&&l.mark.eq(m[_])?l.to=A:c.push(l=new ui(E,A,m[_])));u&&u.to==E?u.to=A:d.push(u=new Bl(E,A,a))}}),c.forEach(h=>i.step(h)),d.forEach(h=>i.step(h))}(this,e,t,r),this}removeMark(e,t,r){return function(i,o,s,a){let l=[],u=0;i.doc.nodesBetween(o,s,(c,d)=>{if(!c.isInline)return;u++;let h=null;if(a instanceof ds){let p,f=c.marks;for(;p=a.isInSet(f);)(h||(h=[])).push(p),f=p.removeFromSet(f)}else a?a.isInSet(c.marks)&&(h=[a]):h=c.marks;if(h&&h.length){let p=Math.min(d+c.nodeSize,s);for(let f=0;f<h.length;f++){let m,E=h[f];for(let A=0;A<l.length;A++){let D=l[A];D.step==u-1&&E.eq(l[A].style)&&(m=D)}m?(m.to=p,m.step=u):l.push({style:E,from:Math.max(d,o),to:p,step:u})}}}),l.forEach(c=>i.step(new ui(c.from,c.to,c.style)))}(this,e,t,r),this}clearIncompatible(e,t,r){return function(i,o,s,a=s.contentMatch){let l=i.doc.nodeAt(o),u=[],c=o+1;for(let d=0;d<l.childCount;d++){let h=l.child(d),p=c+h.nodeSize,f=a.matchType(h.type);if(f){a=f;for(let m=0;m<h.marks.length;m++)s.allowsMarkType(h.marks[m].type)||i.step(new ui(c,p,h.marks[m]));if(h.isText&&!s.spec.code){let m,E,A=/\r?\n|\r/g;for(;m=A.exec(h.text);)E||(E=new B(H.from(s.schema.text(" ",s.allowedMarks(h.marks))),0,0)),u.push(new jt(c+m.index,c+m.index+m[0].length,E))}}else u.push(new jt(c,p,B.empty));c=p}if(!a.validEnd){let d=a.fillBefore(H.empty,!0);i.replace(c,c,new B(d,0,0))}for(let d=u.length-1;d>=0;d--)i.step(u[d])}(this,e,t,r),this}}const Gs=Object.create(null);class Q{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new TA(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=B.empty){let r=t.content.lastChild,i=null;for(let a=0;a<t.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:u}=s[a],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(u.pos),a?B.empty:t),a==0&&Sc(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(r),u=l.map(s.pos),c=l.map(a.pos);o?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),Sc(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new ne(e):Kn(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=t<0?Kn(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Kn(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new st(e.node(0))}static atStart(e){return Kn(e,e,0,0,1)||new st(e)}static atEnd(e){return Kn(e,e,e.content.size,e.childCount,-1)||new st(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Gs[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Gs)throw new RangeError("Duplicate use of selection JSON ID "+e);return Gs[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ne.between(this.$anchor,this.$head).getBookmark()}}Q.prototype.visible=!0;class TA{constructor(e,t){this.$from=e,this.$to=t}}let Oc=!1;function _c(n){Oc||n.parent.inlineContent||(Oc=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class ne extends Q{constructor(e,t=e){_c(e),_c(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return Q.near(r);let i=e.resolve(t.map(this.anchor));return new ne(i.parent.inlineContent?i:r,r)}replace(e,t=B.empty){if(super.replace(e,t),t==B.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ne&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new hs(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ne(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if(r&&!i||(r=i>=0?1:-1),!t.parent.inlineContent){let o=Q.findFrom(t,r,!0)||Q.findFrom(t,-r,!0);if(!o)return Q.near(t,r);t=o.$head}return e.parent.inlineContent||(i==0||(e=(Q.findFrom(e,-r,!0)||Q.findFrom(e,r,!0)).$anchor).pos<t.pos!=i<0)&&(e=t),new ne(e,t)}}Q.jsonID("text",ne);class hs{constructor(e,t){this.anchor=e,this.head=t}map(e){return new hs(e.map(this.anchor),e.map(this.head))}resolve(e){return ne.between(e.resolve(this.anchor),e.resolve(this.head))}}class X extends Q{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?Q.near(o):new X(o)}content(){return new B(H.from(this.node),0,0)}eq(e){return e instanceof X&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new jl(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new X(e.resolve(t.anchor))}static create(e,t){return new X(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}X.prototype.visible=!1,Q.jsonID("node",X);class jl{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new hs(r,r):new jl(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&X.isSelectable(r)?new X(t):Q.near(t)}}class st extends Q{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=B.empty){if(t==B.empty){e.delete(0,e.doc.content.size);let r=Q.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new st(e)}map(e){return new st(e)}eq(e){return e instanceof st}getBookmark(){return RA}}Q.jsonID("all",st);const RA={map(){return this},resolve:n=>new st(n)};function Kn(n,e,t,r,i,o=!1){if(e.inlineContent)return ne.create(n,t);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&X.isSelectable(a))return X.create(n,t-(i<0?a.nodeSize:0))}else{let l=Kn(n,a,t+i,i<0?a.childCount:0,i,o);if(l)return l}t+=a.nodeSize*i}return null}function Sc(n,e,t){let r=n.steps.length-1;if(r<e)return;let i,o=n.steps[r];(o instanceof jt||o instanceof Tn)&&(n.mapping.maps[r].forEach((s,a,l,u)=>{i==null&&(i=u)}),n.setSelection(Q.near(n.doc.resolve(i),t)))}class CA extends SA{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return te.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||te.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r==null?t:r,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(Q.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Tc(n,e){return e&&n?n.bind(e):n}class Wr{constructor(e,t,r){this.name=e,this.init=Tc(t.init,r),this.apply=Tc(t.apply,r)}}const IA=[new Wr("doc",{init:n=>n.doc||n.schema.topNodeType.createAndFill(),apply:n=>n.doc}),new Wr("selection",{init:(n,e)=>n.selection||Q.atStart(e.doc),apply:n=>n.selection}),new Wr("storedMarks",{init:n=>n.storedMarks||null,apply:(n,e,t,r)=>r.selection.$cursor?n.storedMarks:null}),new Wr("scrollToSelection",{init:()=>0,apply:(n,e)=>n.scrolledIntoView?e+1:e})];class Xs{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=IA.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Wr(r.key,r.spec.state,r))})}}class tr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,u=i?i[s].state:this,c=l<t.length&&a.spec.appendTransaction.call(a,l?t.slice(l):t,u,r);if(c&&r.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<s?{state:r,n:t.length}:{state:this,n:0})}t.push(c),r=r.applyInner(c),o=!0}i&&(i[s]={state:r,n:t.length})}}if(!o)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new tr(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new CA(this)}static create(e){let t=new Xs(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new tr(t);for(let i=0;i<t.fields.length;i++)r[t.fields[i].name]=t.fields[i].init(e,r);return r}reconfigure(e){let t=new Xs(this.schema,e.plugins),r=t.fields,i=new tr(t);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Xs(e.schema,e.plugins),o=new tr(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=kn.fromJSON(e.schema,t.doc);else if(s.name=="selection")o.selection=Q.fromJSON(o.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,a))return void(o[s.name]=u.fromJSON.call(l,e,t[a],o))}o[s.name]=s.init(e,o)}}),o}}function Bp(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Bp(i,e,{})),t[r]=i}return t}class ps{constructor(e){this.spec=e,this.props={},e.props&&Bp(e.props,this,this.props),this.key=e.key?e.key.key:Hp("plugin")}getState(e){return e[this.key]}}const Ks=Object.create(null);function Hp(n){return n in Ks?n+"$"+ ++Ks[n]:(Ks[n]=0,n+"$")}class fs{constructor(e="key"){this.key=Hp(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const je=function(n){for(var e=0;;e++)if(!(n=n.previousSibling))return e},Ti=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Rc=null;const Ut=function(n,e,t){let r=Rc||(Rc=document.createRange());return r.setEnd(n,t==null?n.nodeValue.length:t),r.setStart(n,e||0),r},Bn=function(n,e,t,r){return t&&(Cc(n,e,t,r,-1)||Cc(n,e,t,r,1))},NA=/^(img|br|input|textarea|hr)$/i;function Cc(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:It(n))){let o=n.parentNode;if(!o||o.nodeType!=1||$a(n)||NA.test(n.nodeName)||n.contentEditable=="false")return!1;e=je(n)+(i<0?0:1),n=o}else{if(n.nodeType!=1||(n=n.childNodes[e+(i<0?-1:0)]).contentEditable=="false")return!1;e=i<0?It(n):0}}}function It(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function $a(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const ms=function(n){return n.focusNode&&Bn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Sn(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const Lt=typeof navigator!="undefined"?navigator:null,Ic=typeof document!="undefined"?document:null,hn=Lt&&Lt.userAgent||"",za=/Edge\/(\d+)/.exec(hn),Up=/MSIE \d/.exec(hn),Va=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hn),Ze=!!(Up||Va||za),sn=Up?document.documentMode:Va?+Va[1]:za?+za[1]:0,gt=!Ze&&/gecko\/(\d+)/i.test(hn);gt&&(/Firefox\/(\d+)/.exec(hn)||[0,0])[1];const Ya=!Ze&&/Chrome\/(\d+)/.exec(hn),we=!!Ya,vA=Ya?+Ya[1]:0,Xe=!Ze&&!!Lt&&/Apple Computer/.test(Lt.vendor),Sr=Xe&&(/Mobile\/\w+/.test(hn)||!!Lt&&Lt.maxTouchPoints>2),lt=Sr||!!Lt&&/Mac/.test(Lt.platform),yA=!!Lt&&/Win/.test(Lt.platform),dt=/Android \d/.test(hn),Hi=!!Ic&&"webkitFontSmoothing"in Ic.documentElement.style,bA=Hi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function LA(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Pt(n,e){return typeof n=="number"?n:n[e]}function kA(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function Nc(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;s=Ti(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,u=l?LA(o):kA(a),c=0,d=0;if(e.top<u.top+Pt(r,"top")?d=-(u.top-e.top+Pt(i,"top")):e.bottom>u.bottom-Pt(r,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Pt(i,"top")-u.top:e.bottom-u.bottom+Pt(i,"bottom")),e.left<u.left+Pt(r,"left")?c=-(u.left-e.left+Pt(i,"left")):e.right>u.right-Pt(r,"right")&&(c=e.right-u.right+Pt(i,"right")),c||d)if(l)o.defaultView.scrollBy(c,d);else{let h=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),c&&(a.scrollLeft+=c);let f=a.scrollLeft-h,m=a.scrollTop-p;e={left:e.left-f,top:e.top-m,right:e.right-f,bottom:e.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function vc(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Ti(r));return e}function yc(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:i,left:o}=n[t];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Vn=null;function jp(n,e){let t,r,i,o,s=2e8,a=0,l=e.top,u=e.top;for(let c=n.firstChild,d=0;c;c=c.nextSibling,d++){let h;if(c.nodeType==1)h=c.getClientRects();else{if(c.nodeType!=3)continue;h=Ut(c).getClientRects()}for(let p=0;p<h.length;p++){let f=h[p];if(f.top<=l&&f.bottom>=u){l=Math.max(f.bottom,l),u=Math.min(f.top,u);let m=f.left>e.left?f.left-e.left:f.right<e.left?e.left-f.right:0;if(m<s){t=c,s=m,r=m&&t.nodeType==3?{left:f.right<e.left?f.right:f.left,top:e.top}:e,c.nodeType==1&&m&&(a=d+(e.left>=(f.left+f.right)/2?1:0));continue}}else f.top>e.top&&!i&&f.left<=e.left&&f.right>=e.left&&(i=c,o={left:Math.max(f.left,Math.min(f.right,e.left)),top:f.top});!t&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(a=d+1)}}return!t&&i&&(t=i,r=o,s=0),t&&t.nodeType==3?function(c,d){let h=c.nodeValue.length,p=document.createRange();for(let f=0;f<h;f++){p.setEnd(c,f+1),p.setStart(c,f);let m=qt(p,1);if(m.top!=m.bottom&&$l(d,m))return{node:c,offset:f+(d.left>=(m.left+m.right)/2?1:0)}}return{node:c,offset:0}}(t,r):!t||s&&t.nodeType==1?{node:n,offset:a}:jp(t,r)}function $l(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function $p(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),o=i;;){let s=n.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if($l(e,u))return $p(s,e,u)}}if((o=(o+1)%r)==i)break}return n}function wA(n,e){let t,r=n.dom.ownerDocument,i=0,o=function(u,c,d){if(u.caretPositionFromPoint)try{let h=u.caretPositionFromPoint(c,d);if(h)return{node:h.offsetNode,offset:h.offset}}catch(h){}if(u.caretRangeFromPoint){let h=u.caretRangeFromPoint(c,d);if(h)return{node:h.startContainer,offset:h.startOffset}}}(r,e.left,e.top);o&&({node:t,offset:i}=o);let s,a=(n.root.elementFromPoint?n.root:r).elementFromPoint(e.left,e.top);if(!a||!n.dom.contains(a.nodeType!=1?a.parentNode:a)){let u=n.dom.getBoundingClientRect();if(!$l(e,u)||(a=$p(n.dom,e,u),!a))return null}if(Xe)for(let u=a;t&&u;u=Ti(u))u.draggable&&(t=void 0);if(a=function(u,c){let d=u.parentNode;return d&&/^li$/i.test(d.nodeName)&&c.left<u.getBoundingClientRect().left?d:u}(a,e),t){if(gt&&t.nodeType==1&&(i=Math.min(i,t.childNodes.length),i<t.childNodes.length)){let c,d=t.childNodes[i];d.nodeName=="IMG"&&(c=d.getBoundingClientRect()).right<=e.left&&c.bottom>e.top&&i++}let u;Hi&&i&&t.nodeType==1&&(u=t.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,t==n.dom&&i==t.childNodes.length-1&&t.lastChild.nodeType==1&&e.top>t.lastChild.getBoundingClientRect().bottom?s=n.state.doc.content.size:i!=0&&t.nodeType==1&&t.childNodes[i-1].nodeName=="BR"||(s=function(c,d,h,p){let f=-1;for(let m=d,E=!1;m!=c.dom;){let A=c.docView.nearestDesc(m,!0);if(!A)return null;if(A.dom.nodeType==1&&(A.node.isBlock&&A.parent&&!E||!A.contentDOM)){let D=A.dom.getBoundingClientRect();if(A.node.isBlock&&A.parent&&!E&&(E=!0,D.left>p.left||D.top>p.top?f=A.posBefore:(D.right<p.left||D.bottom<p.top)&&(f=A.posAfter)),!A.contentDOM&&f<0&&!A.node.isText)return(A.node.isBlock?p.top<(D.top+D.bottom)/2:p.left<(D.left+D.right)/2)?A.posBefore:A.posAfter}m=A.dom.parentNode}return f>-1?f:c.docView.posFromDOM(d,h,-1)}(n,t,i,e))}s==null&&(s=function(u,c,d){let{node:h,offset:p}=jp(c,d),f=-1;if(h.nodeType==1&&!h.firstChild){let m=h.getBoundingClientRect();f=m.left!=m.right&&d.left>(m.left+m.right)/2?1:-1}return u.docView.posFromDOM(h,p,f)}(n,a,e));let l=n.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function bc(n){return n.top<n.bottom||n.left<n.right}function qt(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(bc(r))return r}return Array.prototype.find.call(t,bc)||n.getBoundingClientRect()}const MA=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function zp(n,e,t){let{node:r,offset:i,atom:o}=n.docView.domFromPos(e,t<0?-1:1),s=Hi||gt;if(r.nodeType==3){if(!s||!MA.test(r.nodeValue)&&(t<0?i:i!=r.nodeValue.length)){let a=i,l=i,u=t<0?1:-1;return t<0&&!i?(l++,u=-1):t>=0&&i==r.nodeValue.length?(a--,u=1):t<0?a--:l++,Br(qt(Ut(r,a,l),u),u<0)}{let a=qt(Ut(r,i,i),t);if(gt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let l=qt(Ut(r,i-1,i-1),-1);if(l.top==a.top){let u=qt(Ut(r,i,i+1),-1);if(u.top!=a.top)return Br(u,u.left<l.left)}}return a}}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==It(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return Ws(a.getBoundingClientRect(),!1)}if(o==null&&i<It(r)){let a=r.childNodes[i];if(a.nodeType==1)return Ws(a.getBoundingClientRect(),!0)}return Ws(r.getBoundingClientRect(),t>=0)}if(o==null&&i&&(t<0||i==It(r))){let a=r.childNodes[i-1],l=a.nodeType==3?Ut(a,It(a)-(s?0:1)):a.nodeType!=1||a.nodeName=="BR"&&a.nextSibling?null:a;if(l)return Br(qt(l,1),!1)}if(o==null&&i<It(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let l=a?a.nodeType==3?Ut(a,0,s?0:1):a.nodeType==1?a:null:null;if(l)return Br(qt(l,-1),!0)}return Br(qt(r.nodeType==3?Ut(r):r,-t),t>=0)}function Br(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function Ws(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Lc(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}const FA=/[\u0590-\u08ac]/;let kc=null,wc=null,Mc=!1;function xA(n,e,t){return kc==e&&wc==t?Mc:(kc=e,wc=t,Mc=t=="up"||t=="down"?function(r,i,o){let s=i.selection,a=o=="up"?s.$from:s.$to;return Lc(r,i,()=>{let{node:l}=r.docView.domFromPos(a.pos,o=="up"?-1:1);for(;;){let c=r.docView.nearestDesc(l,!0);if(!c)break;if(c.node.isBlock){l=c.contentDOM||c.dom;break}l=c.dom.parentNode}let u=zp(r,a.pos,1);for(let c=l.firstChild;c;c=c.nextSibling){let d;if(c.nodeType==1)d=c.getClientRects();else{if(c.nodeType!=3)continue;d=Ut(c,0,c.nodeValue.length).getClientRects()}for(let h=0;h<d.length;h++){let p=d[h];if(p.bottom>p.top+1&&(o=="up"?u.top-p.top>2*(p.bottom-u.top):p.bottom-u.bottom>2*(u.bottom-p.top)))return!1}}return!0})}(n,e,t):function(r,i,o){let{$head:s}=i.selection;if(!s.parent.isTextblock)return!1;let a=s.parentOffset,l=!a,u=a==s.parent.content.size,c=r.domSelection();return FA.test(s.parent.textContent)&&c.modify?Lc(r,i,()=>{let{focusNode:d,focusOffset:h,anchorNode:p,anchorOffset:f}=r.domSelectionRange(),m=c.caretBidiLevel;c.modify("move",o,"character");let E=s.depth?r.docView.domAfterPos(s.before()):r.dom,{focusNode:A,focusOffset:D}=r.domSelectionRange(),_=A&&!E.contains(A.nodeType==1?A:A.parentNode)||d==A&&h==D;try{c.collapse(p,f),d&&(d!=p||h!=f)&&c.extend&&c.extend(d,h)}catch(S){}return m!=null&&(c.caretBidiLevel=m),_}):o=="left"||o=="backward"?l:u}(n,e,t))}class Ui{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let i=this.children[t];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&(!(s=o.pmViewDesc)||s.parent!=this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}{let o,s;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&(!(s=o.pmViewDesc)||s.parent!=this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}}let i;if(e==this.dom&&this.contentDOM)i=t>je(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return(i==null?r>0:i)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o,s=this.getDesc(i);if(s&&(!t||s.node)){if(!r||!(o=s.nodeDOM)||(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))return s;r=!1}}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let i=this.children[t],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof Yp){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Vp&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,o&&o.dom.parentNode!=this.contentDOM;r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?je(o.dom)+1:0}}{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,o&&o.dom.parentNode!=this.contentDOM;r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,t):{node:this.contentDOM,offset:o?je(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],u=s+l.size;if(i==-1&&e<=u){let c=s+l.border;if(e>=c&&t<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,c);e=s;for(let d=a;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=je(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(u>t||a==this.children.length-1)){t=u;for(let c=a+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){o=je(d.dom);break}t+=d.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=u}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,i=!1){let o=Math.min(e,t),s=Math.max(e,t);for(let h=0,p=0;h<this.children.length;h++){let f=this.children[h],m=p+f.size;if(o>p&&s<m)return f.setSelection(e-p-f.border,t-p-f.border,r,i);p=m}let a=this.domFromPos(e,e?-1:1),l=t==e?a:this.domFromPos(t,t?-1:1),u=r.getSelection(),c=!1;if((gt||Xe)&&e==t){let{node:h,offset:p}=a;if(h.nodeType==3){if(c=!(!p||h.nodeValue[p-1]!=`
1192
+ `),c&&p==h.nodeValue.length)for(let f,m=h;m;m=m.parentNode){if(f=m.nextSibling){f.nodeName=="BR"&&(a=l={node:f.parentNode,offset:je(f)+1});break}let E=m.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let f=h.childNodes[p-1];c=f&&(f.nodeName=="BR"||f.contentEditable=="false")}}if(gt&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||c&&Xe)&&Bn(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Bn(l.node,l.offset,u.focusNode,u.focusOffset))return;let d=!1;if((u.extend||e==t)&&!c){u.collapse(a.node,a.offset);try{e!=t&&u.extend(l.node,l.offset),d=!0}catch(h){}}if(!d){if(e>t){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&t>=r:e<s&&t>r){let a=r+o.border,l=s-o.border;if(e>=a&&t<=l)return this.dirty=e==r||t==s?2:1,void(e!=a||t!=l||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=s}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?2:1;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Vp extends Ui{constructor(e,t,r,i){let o,s=t.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:i)),!t.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==0&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class PA extends Ui{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class wn extends Ui{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return s&&s.dom||(s=Vt.renderSpec(document,t.type.spec.toDOM(t,r))),new wn(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=3&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=0){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}slice(e,t,r){let i=wn.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;t<s&&(o=Ka(o,t,s,r)),e>0&&(o=Ka(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}}class an extends Ui{constructor(e,t,r,i,o,s,a,l,u){super(e,[],o,s),this.node=t,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,t,r,i,o,s){let a,l=o.nodeViews[t.type.name],u=l&&l(t,o,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s,r,i),c=u&&u.dom,d=u&&u.contentDOM;if(t.isText)if(c){if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:d}=Vt.renderSpec(document,t.type.spec.toDOM(t)));d||t.isText||c.nodeName=="BR"||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let h=c;return c=Kp(c,r,t),u?a=new BA(e,t,r,i,c,d||null,h,u,o,s+1):t.isText?new Es(e,t,r,i,c,h,o):new an(e,t,r,i,c,d||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>H.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,r){return this.dirty==0&&e.eq(this.node)&&Xa(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new UA(this,s&&s.node,e);(function(u,c,d,h){let p=c.locals(u),f=0;if(p.length==0){for(let D=0;D<u.childCount;D++){let _=u.child(D);h(_,p,c.forChild(f,_),D),f+=_.nodeSize}return}let m=0,E=[],A=null;for(let D=0;;){let _,S,T,N;for(;m<p.length&&p[m].to==f;){let g=p[m++];g.widget&&(_?(S||(S=[_])).push(g):_=g)}if(_)if(S){S.sort(jA);for(let g=0;g<S.length;g++)d(S[g],D,!!A)}else d(_,D,!!A);if(A)N=-1,T=A,A=null;else{if(!(D<u.childCount))break;N=D,T=u.child(D++)}for(let g=0;g<E.length;g++)E[g].to<=f&&E.splice(g--,1);for(;m<p.length&&p[m].from<=f&&p[m].to>f;)E.push(p[m++]);let I=f+T.nodeSize;if(T.isText){let g=I;m<p.length&&p[m].from<g&&(g=p[m].from);for(let O=0;O<E.length;O++)E[O].to<g&&(g=E[O].to);g<I&&(A=T.cut(g-f),T=T.cut(0,g-f),I=g,N=-1)}else for(;m<p.length&&p[m].to<=I;)m++;let L=T.isInline&&!T.isLeaf?E.filter(g=>!g.inline):E.slice();h(T,L,c.forChild(f,T),N),f=I}})(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!d&&l.syncToMarks(c==this.node.childCount?te.none:this.node.child(c).marks,r,e),l.placeWidget(u,e,i)},(u,c,d,h)=>{let p;l.syncToMarks(u.marks,r,e),l.findNodeMatch(u,c,d,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(u,c,d,p,e)||l.updateNextNode(u,c,d,e,h,i)||l.addNode(u,c,d,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==2)&&(s&&this.protectLocalComposition(e,s),Gp(this.contentDOM,this.children,e),Sr&&function(u){if(u.nodeName=="UL"||u.nodeName=="OL"){let c=u.style.cssText;u.style.cssText=c+"; list-style: square !important",window.getComputedStyle(u).listStyle,u.style.cssText=c}}(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ne)||r<t||i>t+this.node.content.size)return null;let o=e.domSelectionRange(),s=function(a,l){for(;;){if(a.nodeType==3)return a;if(a.nodeType==1&&l>0){if(a.childNodes.length>l&&a.childNodes[l].nodeType==3)return a.childNodes[l];l=It(a=a.childNodes[l-1])}else{if(!(a.nodeType==1&&l<a.childNodes.length))return null;a=a.childNodes[l],l=0}}}(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=function(u,c,d,h){for(let p=0,f=0;p<u.childCount&&f<=h;){let m=u.child(p++),E=f;if(f+=m.nodeSize,!m.isText)continue;let A=m.text;for(;p<u.childCount;){let D=u.child(p++);if(f+=D.nodeSize,!D.isText)break;A+=D.text}if(f>=d){if(f>=h&&A.slice(h-c.length-E,h-E)==c)return h-c.length;let D=E<h?A.lastIndexOf(c,h-E-1):-1;if(D>=0&&D+c.length+E>=d)return E+D;if(d==h&&A.length>=h+c.length-E&&A.slice(h-E,h-E+c.length)==c)return h}}return-1}(this.node.content,a,r-t,i-t);return l<0?null:{node:s,pos:l,text:a}}return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new PA(this,o,t,i);e.input.compositionNodes.push(s),this.children=Ka(this.children,r,r+i.length,e,s)}update(e,t,r,i){return!(this.dirty==3||!e.sameMarkup(this.node))&&(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(Xa(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Xp(this.dom,this.nodeDOM,Ga(this.outerDeco,this.node,t),Ga(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Fc(n,e,t,r,i){Kp(r,e,n);let o=new an(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Es extends an{constructor(e,t,r,i,o,s,a){super(e,t,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return!(this.dirty==3||this.dirty!=0&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==0&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new Es(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||e!=0&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Yp extends Ui{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==0&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class BA extends an{constructor(e,t,r,i,o,s,a,l,u,c){super(e,t,r,i,o,s,a,u,c),this.spec=l}update(e,t,r,i){if(this.dirty==3)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Gp(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==n){for(;a!=r;)r=xc(r),i=!0;r=r.nextSibling}else i=!0,n.insertBefore(a,r);if(s instanceof wn){let l=r?r.previousSibling:n.lastChild;Gp(s.contentDOM,s.children,t),r=l?l.nextSibling:n.firstChild}}for(;r;)r=xc(r),i=!0;i&&t.trackWrites==n&&(t.trackWrites=null)}const ci=function(n){n&&(this.nodeName=n)};ci.prototype=Object.create(null);const Rn=[new ci];function Ga(n,e,t){if(n.length==0)return Rn;let r=t?Rn[0]:new ci,i=[r];for(let o=0;o<n.length;o++){let s=n[o].type.attrs;if(s){s.nodeName&&i.push(r=new ci(s.nodeName));for(let a in s){let l=s[a];l!=null&&(t&&i.length==1&&i.push(r=new ci(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function Xp(n,e,t,r){if(t==Rn&&r==Rn)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=t[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=n&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Rn[0]),i=l}HA(i,a||Rn[0],s)}return i}function HA(n,e,t){for(let r in e)r=="class"||r=="style"||r=="nodeName"||r in t||n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&n.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&n.classList.add(i[o]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r,i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;r=i.exec(e.style);)n.style.removeProperty(r[1])}t.style&&(n.style.cssText+=t.style)}}function Kp(n,e,t){return Xp(n,n,Rn,Ga(e,t,n.nodeType!=1))}function Xa(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function xc(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class UA{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(i,o){let s=o,a=s.children.length,l=i.childCount,u=new Map,c=[];e:for(;l>0;){let d;for(;;)if(a){let p=s.children[a-1];if(!(p instanceof wn)){d=p,a--;break}s=p,a=p.children.length}else{if(s==o)break e;a=s.parent.children.indexOf(s),s=s.parent}let h=d.node;if(h){if(h!=i.child(l-1))break;--l,u.set(d,l),c.push(d)}}return{index:l,matched:u,matches:c.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[o])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=wn.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o,s=-1;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,t,r)&&!this.preMatch.matched.has(u)){s=a;break}}return!(s<0)&&(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,r,i,o){let s=this.top.children[i];return s.dirty==3&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(e,t,r,o)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=t}}updateNextNode(e,t,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof an){let u=this.preMatch.matched.get(l);if(u!=null&&u!=o)return!1;let c,d=l.dom,h=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=3&&Xa(t,l.outerDeco));if(!h&&l.update(e,t,r,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!h&&(c=this.recreateWrapper(l,e,t,r,i,s)))return this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(i,s+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,i,o,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let a=an.create(this.top,t,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,t,r,i,o){let s=an.create(this.top,e,t,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,t,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(!i||!i.matchesWidget(e)||e!=i.widget&&i.widget.type.toDOM.parentNode){let o=new Vp(this.top,e,t,r);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof wn;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Es)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Xe||we)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Yp(this.top,[],r,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function jA(n,e){return n.type.side-e.type.side}function Ka(n,e,t,r,i){let o=[];for(let s=0,a=0;s<n.length;s++){let l=n[s],u=a,c=a+=l.size;u>=t||c<=e?o.push(l):(u<e&&o.push(l.slice(0,e-u,r)),i&&(o.push(i),i=void 0),c>t&&o.push(l.slice(t-u,l.size,r)))}return o}function zl(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(ms(t)){for(a=u;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&X.isSelectable(c)&&i.parent&&(!c.isInline||!function(d,h,p){for(let f=h==0,m=h==It(d);f||m;){if(d==p)return!0;let E=je(d);if(!(d=d.parentNode))return!1;f=f&&E==0,m=m&&E==It(d)}}(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;l=new X(s==d?u:r.resolve(d))}}else{let c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null;a=r.resolve(c)}return l||(l=Vl(n,a,u,e=="pointer"||n.state.selection.head<u.pos&&!o?1:-1)),l}function Pc(n){return n.editable?n.hasFocus():Jp(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Xt(n,e=!1){let t=n.state.selection;if(Wp(n,t),Pc(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&we){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Bn(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset))return n.input.mouseDown.delayedSelectionSync=!0,void n.domObserver.setCurSelection()}if(n.domObserver.disconnectSelection(),n.cursorWrapper)(function(r){let i=r.domSelection(),o=document.createRange(),s=r.cursorWrapper.dom,a=s.nodeName=="IMG";a?o.setEnd(s.parentNode,je(s)+1):o.setEnd(s,0),o.collapse(!1),i.removeAllRanges(),i.addRange(o),!a&&!r.state.selection.visible&&Ze&&sn<=11&&(s.disabled=!0,s.disabled=!1)})(n);else{let r,i,{anchor:o,head:s}=t;!Bc||t instanceof ne||(t.$from.parent.inlineContent||(r=Hc(n,t.from)),t.empty||t.$from.parent.inlineContent||(i=Hc(n,t.to))),n.docView.setSelection(o,s,n.root,e),Bc&&(r&&Uc(r),i&&Uc(i)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(a){let l=a.dom.ownerDocument;l.removeEventListener("selectionchange",a.input.hideSelectionGuard);let u=a.domSelectionRange(),c=u.anchorNode,d=u.anchorOffset;l.addEventListener("selectionchange",a.input.hideSelectionGuard=()=>{u.anchorNode==c&&u.anchorOffset==d||(l.removeEventListener("selectionchange",a.input.hideSelectionGuard),setTimeout(()=>{Pc(a)&&!a.state.selection.visible||a.dom.classList.remove("ProseMirror-hideselection")},20))})}(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const Bc=Xe||we&&vA<63;function Hc(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(Xe&&i&&i.contentEditable=="false")return Js(i);if(!(i&&i.contentEditable!="false"||o&&o.contentEditable!="false")){if(i)return Js(i);if(o)return Js(o)}}function Js(n){return n.contentEditable="true",Xe&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Uc(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function Wp(n,e){if(e instanceof X){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(jc(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else jc(n)}function jc(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Vl(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||ne.between(e,t,r)}function $c(n){return!(n.editable&&!n.hasFocus())&&Jp(n)}function Jp(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Wa(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&Q.findFrom(o,e)}function Qt(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function zc(n,e,t){let r=n.state.selection;if(!(r instanceof ne)){if(r instanceof X&&r.node.isInline)return Qt(n,new ne(e>0?r.$to:r.$from));{let i=Wa(n.state,e);return!!i&&Qt(n,i)}}if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Qt(n,new ne(r.$anchor,s))}if(!r.empty)return!1;if(n.endOfTextblock(e>0?"forward":"backward")){let i=Wa(n.state,e);return!!(i&&i instanceof X)&&Qt(n,i)}if(!(lt&&t.indexOf("m")>-1)){let i,o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText)return!1;let a=e<0?o.pos-s.nodeSize:o.pos;return!!(s.isAtom||(i=n.docView.descAt(a))&&!i.contentDOM)&&(X.isSelectable(s)?Qt(n,new X(e<0?n.state.doc.resolve(o.pos-s.nodeSize):o)):!!Hi&&Qt(n,new ne(n.state.doc.resolve(e<0?a:a+s.nodeSize))))}}function Qi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Hr(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Yn(n,e){return e<0?function(t){let r=t.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s,a,l=!1;for(gt&&i.nodeType==1&&o<Qi(i)&&Hr(i.childNodes[o],-1)&&(l=!0);;)if(o>0){if(i.nodeType!=1)break;{let u=i.childNodes[o-1];if(Hr(u,-1))s=i,a=--o;else{if(u.nodeType!=3)break;i=u,o=i.nodeValue.length}}}else{if(Vc(i))break;{let u=i.previousSibling;for(;u&&Hr(u,-1);)s=i.parentNode,a=je(u),u=u.previousSibling;if(u)i=u,o=Qi(i);else{if(i=i.parentNode,i==t.dom)break;o=0}}}l?qs(t,i,o):s&&qs(t,s,a)}(n):function(t){let r=t.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s,a,l=Qi(i);for(;;)if(o<l){if(i.nodeType!=1||!Hr(i.childNodes[o],1))break;s=i,a=++o}else{if(Vc(i))break;{let u=i.nextSibling;for(;u&&Hr(u,1);)s=u.parentNode,a=je(u)+1,u=u.nextSibling;if(u)i=u,o=0,l=Qi(i);else{if(i=i.parentNode,i==t.dom)break;o=l=0}}}s&&qs(t,s,a)}(n)}function Vc(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function qs(n,e,t){if(e.nodeType!=3){let o,s;(s=function(a,l){for(;a&&l==a.childNodes.length&&!$a(a);)l=je(a)+1,a=a.parentNode;for(;a&&l<a.childNodes.length;){let u=a.childNodes[l];if(u.nodeType==3)return u;if(u.nodeType==1&&u.contentEditable=="false")break;a=u,l=0}}(e,t))?(e=s,t=0):(o=function(a,l){for(;a&&!l&&!$a(a);)l=je(a),a=a.parentNode;for(;a&&l;){let u=a.childNodes[l-1];if(u.nodeType==3)return u;if(u.nodeType==1&&u.contentEditable=="false")break;l=(a=u).childNodes.length}}(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(ms(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&Xt(n)},50)}function Yc(n,e){let t=n.state.doc.resolve(e);if(!we&&!yA&&t.parent.inlineContent){let r=n.coordsAtPos(e);if(e>t.start()){let i=n.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left<r.left?"ltr":"rtl"}if(e<t.end()){let i=n.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left>r.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Gc(n,e,t){let r=n.state.selection;if(r instanceof ne&&!r.empty||t.indexOf("s")>-1||lt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=Wa(n.state,e);if(s&&s instanceof X)return Qt(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof st?Q.near(s,e):Q.findFrom(s,e);return!!a&&Qt(n,a)}return!1}function Xc(n,e){if(!(n.state.selection instanceof ne))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function Kc(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function $A(n,e){let t=e.keyCode,r=function(i){let o="";return i.ctrlKey&&(o+="c"),i.metaKey&&(o+="m"),i.altKey&&(o+="a"),i.shiftKey&&(o+="s"),o}(e);if(t==8||lt&&t==72&&r=="c")return Xc(n,-1)||Yn(n,-1);if(t==46&&!e.shiftKey||lt&&t==68&&r=="c")return Xc(n,1)||Yn(n,1);if(t==13||t==27)return!0;if(t==37||lt&&t==66&&r=="c"){let i=t==37?Yc(n,n.state.selection.from)=="ltr"?-1:1:-1;return zc(n,i,r)||Yn(n,i)}if(t==39||lt&&t==70&&r=="c"){let i=t==39?Yc(n,n.state.selection.from)=="ltr"?1:-1:1;return zc(n,i,r)||Yn(n,i)}return t==38||lt&&t==80&&r=="c"?Gc(n,-1,r)||Yn(n,-1):t==40||lt&&t==78&&r=="c"?function(i){if(!Xe||i.state.selection.$head.parentOffset>0)return!1;let{focusNode:o,focusOffset:s}=i.domSelectionRange();if(o&&o.nodeType==1&&s==0&&o.firstChild&&o.firstChild.contentEditable=="false"){let a=o.firstChild;Kc(i,a,"true"),setTimeout(()=>Kc(i,a,"false"),20)}return!1}(n)||Gc(n,1,r)||Yn(n,1):r==(lt?"m":"c")&&(t==66||t==73||t==89||t==90)}function qp(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=n.someProp("clipboardSerializer")||Vt.fromSchema(n.state.schema),a=rf(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&c.nodeType==1&&(u=nf[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let f=a.createElement(u[p]);for(;l.firstChild;)f.appendChild(l.firstChild);l.appendChild(f),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(t)}`);let h=n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,`
1193
1193
 
1194
1194
  `);return{dom:l,text:h}}function Zp(n,e,t,r,i){let o,s,a=i.parent.type.spec.code;if(!t&&!e)return null;let l=e&&(r||a||!t);if(l){if(n.someProp("transformPastedText",h=>{e=h(e,a||r,n)}),a)return e?new B(H.from(n.state.schema.text(e.replace(/\r\n?/g,`
1195
- `))),0,0):B.empty;let d=n.someProp("clipboardTextParser",h=>h(e,i,r,n));if(d)s=d;else{let h=i.marks(),{schema:p}=n.state,f=Vt.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let E=o.appendChild(document.createElement("p"));m&&E.appendChild(f.serializeNode(p.text(m,h)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),o=function(d){let h=/^(\s*<meta [^>]*>)*/.exec(d);h&&(d=d.slice(h[0].length));let p,f=rf().createElement("div"),m=/<([a-z][^>\s]+)/i.exec(d);if((p=m&&nf[m[1].toLowerCase()])&&(d=p.map(E=>"<"+E+">").join("")+d+p.map(E=>"</"+E+">").reverse().join("")),f.innerHTML=d,p)for(let E=0;E<p.length;E++)f=f.querySelector(p[E])||f;return f}(t),Hi&&function(d){let h=d.querySelectorAll(we?"span:not([class]):not([style])":"span.Apple-converted-space");for(let p=0;p<h.length;p++){let f=h[p];f.childNodes.length==1&&f.textContent==" "&&f.parentNode&&f.parentNode.replaceChild(d.ownerDocument.createTextNode(" "),f)}}(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(s||(s=(n.someProp("clipboardParser")||n.someProp("domParser")||Si.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:h=>h.nodeName!="BR"||h.nextSibling||!h.parentNode||zA.test(h.parentNode.nodeName)?null:{ignore:!0}})),c)s=function(d,h){if(!d.size)return d;let p,f=d.content.firstChild.type.schema;try{p=JSON.parse(h)}catch(D){return d}let{content:m,openStart:E,openEnd:A}=d;for(let D=p.length-2;D>=0;D-=2){let _=f.nodes[p[D]];if(!_||_.hasRequiredAttrs())break;m=H.from(_.create(p[D+1],m)),E++,A++}return new B(m,E,A)}(Kc(s,+c[1],+c[2]),c[4]);else if(s=B.maxOpen(function(d,h){if(d.childCount<2)return d;for(let p=h.depth;p>=0;p--){let f,m=h.node(p).contentMatchAt(h.index(p)),E=[];if(d.forEach(A=>{if(!E)return;let D,_=m.findWrapping(A.type);if(!_)return E=null;if(D=E.length&&f.length&&ef(_,f,A,E[E.length-1],0))E[E.length-1]=D;else{E.length&&(E[E.length-1]=tf(E[E.length-1],f.length));let S=Qp(A,_);E.push(S),m=m.matchType(S.type),f=_}}),E)return H.from(E)}return d}(s.content,i),!0),s.openStart||s.openEnd){let d=0,h=0;for(let p=s.content.firstChild;d<s.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=s.content.lastChild;h<s.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);s=Kc(s,d,h)}return n.someProp("transformPasted",d=>{s=d(s,n)}),s}const zA=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Qp(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,H.from(n));return n}function ef(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=ef(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(H.from(Qp(t,n,i+1))))}}function tf(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,tf(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(H.empty,!0);return n.copy(t.append(r))}function Ja(n,e,t,r,i,o){let s=e<0?n.firstChild:n.lastChild,a=s.content;return n.childCount>1&&(o=0),i<r-1&&(a=Ja(a,e,t,r,i+1,o)),i>=t&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(H.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(a))}function Kc(n,e,t){return e<n.openStart&&(n=new B(Ja(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new B(Ja(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const nf={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Wc=null;function rf(){return Wc||(Wc=document.implementation.createHTMLDocument("title"))}const $e={},Ge={},VA={touchstart:!0,touchmove:!0};class YA{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function rn(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function Zs(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>qa(n,r))})}function qa(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return!!r&&(r(n,e)||e.defaultPrevented)})}function GA(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Fo(n){return{left:n.clientX,top:n.clientY}}function Vl(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,a=>s>o.depth?a(n,t,o.nodeAfter,o.before(s),i,!0):a(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function ar(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function XA(n,e,t,r,i){return Vl(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?function(o,s){if(s==-1)return!1;let a,l,u=o.state.selection;u instanceof X&&(a=u.node);let c=o.state.doc.resolve(s);for(let d=c.depth+1;d>0;d--){let h=d>c.depth?c.nodeAfter:c.node(d);if(X.isSelectable(h)){l=a&&u.$from.depth>0&&d>=u.$from.depth&&c.before(u.$from.depth+1)==u.$from.pos?c.before(u.$from.depth):c.before(d);break}}return l!=null&&(ar(o,X.create(o.state.doc,l)),!0)}(n,t):function(o,s){if(s==-1)return!1;let a=o.state.doc.resolve(s),l=a.nodeAfter;return!!(l&&l.isAtom&&X.isSelectable(l))&&(ar(o,new X(a)),!0)}(n,t))}function KA(n,e,t,r){return Vl(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function WA(n,e,t,r){return Vl(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||function(i,o,s){if(s.button!=0)return!1;let a=i.state.doc;if(o==-1)return!!a.inlineContent&&(ar(i,ne.create(a,0,a.content.size)),!0);let l=a.resolve(o);for(let u=l.depth+1;u>0;u--){let c=u>l.depth?l.nodeAfter:l.node(u),d=l.before(u);if(c.inlineContent)ar(i,ne.create(a,d+1,d+1+c.content.size));else{if(!X.isSelectable(c))continue;ar(i,X.create(a,d))}return!0}}(n,t,r)}function Za(n){return xo(n)}Ge.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Jc(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!dt||!we||t.keyCode!=13))if(t.keyCode!=229&&n.domObserver.forceFlush(),!Sr||t.keyCode!=13||t.ctrlKey||t.altKey||t.metaKey)n.someProp("handleKeyDown",r=>r(n,t))||$A(n,t)?t.preventDefault():rn(n,"key");else{let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Sn(13,"Enter"))),n.input.lastIOSEnter=0)},200)}},Ge.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Ge.keypress=(n,e)=>{let t=e;if(Jc(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||lt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t)))return void t.preventDefault();let r=n.state.selection;if(!(r instanceof ne&&r.$from.sameParent(r.$to))){let i=String.fromCharCode(t.charCode);/[\r\n]/.test(i)||n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))||n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};const of=lt?"metaKey":"ctrlKey";$e.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Za(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&function(a,l){let u=l.x-a.clientX,c=l.y-a.clientY;return u*u+c*c<100}(t,n.input.lastClick)&&!t[of]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let s=n.posAtCoords(Fo(t));s&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new JA(n,s,t,!!r)):(o=="doubleClick"?KA:WA)(n,s.pos,s.inside,t)?t.preventDefault():rn(n,"pointer"))};class JA{constructor(e,t,r,i){let o,s;if(this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[of],this.allowDefault=r.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let c=e.state.doc.resolve(t.pos);o=c.parent,s=c.depth?c.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:u}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof X&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!gt||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),rn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Xt(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Fo(e))),this.updateAllowDefault(e),this.allowDefault||!t?rn(this.view,"pointer"):XA(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Xe&&this.mightDrag&&!this.mightDrag.node.isAtom||we&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(ar(this.view,Q.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):rn(this.view,"pointer")}move(e){this.updateAllowDefault(e),rn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function Jc(n,e){return!!n.composing||!!(Xe&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500)&&(n.input.compositionEndedAt=-2e8,!0)}$e.touchstart=n=>{n.input.lastTouch=Date.now(),Za(n),rn(n,"pointer")},$e.touchmove=n=>{n.input.lastTouch=Date.now(),rn(n,"pointer")},$e.contextmenu=n=>Za(n);const qA=dt?5e3:-1;function qc(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>xo(n),e))}function sf(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function xo(n,e=!1){if(!(dt&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),sf(n),e||n.docView&&n.docView.dirty){let t=$l(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}Ge.compositionstart=Ge.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),xo(n,!0),n.markCursor=null;else if(xo(n),gt&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){n.domSelection().collapse(s,s.nodeValue.length);break}i=s,o=-1}}n.input.composing=!0}qc(n,qA)},Ge.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,qc(n,20))};const di=Ze&&sn<15||Sr&&bA<604;function hi(n,e,t,r,i){let o=Zp(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",l=>l(n,i,o||B.empty)))return!0;if(!o)return!1;let s=function(l){return l.openStart==0&&l.openEnd==0&&l.content.childCount==1?l.content.firstChild:null}(o),a=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function af(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}$e.copy=Ge.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=di?null:t.clipboardData,s=r.content(),{dom:a,text:l}=qp(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(u,c){if(!u.dom.parentNode)return;let d=u.dom.parentNode.appendChild(document.createElement("div"));d.appendChild(c),d.style.cssText="position: fixed; left: -10000px; top: 10px";let h=getSelection(),p=document.createRange();p.selectNodeContents(c),u.dom.blur(),h.removeAllRanges(),h.addRange(p),setTimeout(()=>{d.parentNode&&d.parentNode.removeChild(d),u.focus()},50)}(n,a),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Ge.paste=(n,e)=>{let t=e;if(n.composing&&!dt)return;let r=di?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&hi(n,af(r),r.getData("text/html"),i,t)?t.preventDefault():function(o,s){if(!o.dom.parentNode)return;let a=o.input.shiftKey||o.state.selection.$from.parent.type.spec.code,l=o.dom.parentNode.appendChild(document.createElement(a?"textarea":"div"));a||(l.contentEditable="true"),l.style.cssText="position: fixed; left: -10000px; top: 10px",l.focus();let u=o.input.shiftKey&&o.input.lastKeyCode!=45;setTimeout(()=>{o.focus(),l.parentNode&&l.parentNode.removeChild(l),a?hi(o,l.value,null,u,s):hi(o,l.textContent,l.innerHTML,u,s)},50)}(n,t)};class lf{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const Zc=lt?"altKey":"ctrlKey";$e.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i,o=n.state.selection,s=o.empty?null:n.posAtCoords(Fo(t));if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof X?o.to-1:o.to))){if(r&&r.mightDrag)i=X.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let c=n.docView.nearestDesc(t.target,!0);c&&c.node.type.spec.draggable&&c!=n.docView&&(i=X.create(n.state.doc,c.posBefore))}}let a=(i||n.state.selection).content(),{dom:l,text:u}=qp(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(di?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",di||t.dataTransfer.setData("text/plain",u),n.dragging=new lf(a,!t[Zc],i)},$e.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Ge.dragover=Ge.dragenter=(n,e)=>e.preventDefault(),Ge.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Fo(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",f=>{s=f(s,n)}):s=Zp(n,af(t.dataTransfer),di?null:t.dataTransfer.getData("text/html"),!1,o);let a=!(!r||t[Zc]);if(n.someProp("handleDrop",f=>f(n,t,s||B.empty,a)))return void t.preventDefault();if(!s)return;t.preventDefault();let l=s?function(f,m,E){let A=f.resolve(m);if(!E.content.size)return m;let D=E.content;for(let _=0;_<E.openStart;_++)D=D.firstChild.content;for(let _=1;_<=(E.openStart==0&&E.size?2:1);_++)for(let S=A.depth;S>=0;S--){let R=S==A.depth?0:A.pos<=(A.start(S+1)+A.end(S+1))/2?-1:1,v=A.index(S)+(R>0?1:0),I=A.node(S),L=!1;if(_==1)L=I.canReplace(v,v,D);else{let g=I.contentMatchAt(v).findWrapping(D.firstChild.type);L=g&&I.canReplaceWith(v,v,g[0])}if(L)return R==0?A.pos:R<0?A.before(S+1):A.after(S+1)}return null}(n.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let u=n.state.tr;if(a){let{node:f}=r;f?f.replace(u):u.deleteSelection()}let c=u.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(h))return;let p=u.doc.resolve(c);if(d&&X.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new X(p));else{let f=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((m,E,A,D)=>f=D),u.setSelection(zl(n,p,u.doc.resolve(f)))}n.focus(),n.dispatch(u.setMeta("uiEvent","drop"))},$e.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Xt(n)},20))},$e.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},$e.beforeinput=(n,e)=>{if(we&&dt&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:t}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=t||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,Sn(8,"Backspace")))))return;let{$cursor:r}=n.state.selection;r&&r.pos>0&&n.dispatch(n.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let n in Ge)$e[n]=Ge[n];function Ri(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Po{constructor(e,t){this.toDOM=e,this.spec=t||Mn,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new it(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Po&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ri(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ln{constructor(e,t){this.attrs=e,this.spec=t||Mn}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new it(o,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof ln&&Ri(this.attrs,e.attrs)&&Ri(this.spec,e.spec)}static is(e){return e.type instanceof ln}destroy(){}}class Yl{constructor(e,t){this.attrs=e,this.spec=t||Mn}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let s=e.mapResult(t.to+i,-1);return s.deleted||s.pos<=o.pos?null:new it(o.pos-r,s.pos-r,this)}valid(e,t){let r,{index:i,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(r=e.child(i)).isText&&o+r.nodeSize==t.to}eq(e){return this==e||e instanceof Yl&&Ri(this.attrs,e.attrs)&&Ri(this.spec,e.spec)}destroy(){}}class it{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new it(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new it(e,e,new Po(t,r))}static inline(e,t,r,i){return new it(e,t,new ln(r,i))}static node(e,t,r,i){return new it(e,t,new Yl(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof ln}get widget(){return this.type instanceof Po}}const Wn=[],Mn={};class Ee{constructor(e,t){this.local=e.length?e:Wn,this.children=t.length?t:Wn}static create(e,t){return t.length?mo(t,e,0,Mn):ke}find(e,t,r){let i=[];return this.findInner(e==null?0:e,t==null?1e9:t,i,0,r),i}findInner(e,t,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=t&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,t-a,r,i+a,o)}}map(e,t,r){return this==ke||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Mn)}mapInner(e,t,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(t,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?function(a,l,u,c,d,h,p){let f=a.slice();for(let E=0,A=h;E<u.maps.length;E++){let D=0;u.maps[E].forEach((_,S,R,v)=>{let I=v-R-(S-_);for(let L=0;L<f.length;L+=3){let g=f[L+1];if(g<0||_>g+A-D)continue;let O=f[L]+A-D;S>=O?f[L+1]=_<=O?-2:-1:_>=A&&I&&(f[L]+=I,f[L+1]+=I)}D+=I}),A=u.maps[E].map(A,-1)}let m=!1;for(let E=0;E<f.length;E+=3)if(f[E+1]<0){if(f[E+1]==-2){m=!0,f[E+1]=-1;continue}let A=u.map(a[E]+h),D=A-d;if(D<0||D>=c.content.size){m=!0;continue}let _=u.map(a[E+1]+h,-1)-d,{index:S,offset:R}=c.content.findIndex(D),v=c.maybeChild(S);if(v&&R==D&&R+v.nodeSize==_){let I=f[E+2].mapInner(u,v,A+1,a[E]+h+1,p);I!=ke?(f[E]=D,f[E+1]=_,f[E+2]=I):(f[E+1]=-2,m=!0)}else m=!0}if(m){let E=function(D,_,S,R,v,I,L){function g(O,k){for(let w=0;w<O.local.length;w++){let U=O.local[w].map(R,v,k);U?S.push(U):L.onRemove&&L.onRemove(O.local[w].spec)}for(let w=0;w<O.children.length;w+=3)g(O.children[w+2],O.children[w]+k+1)}for(let O=0;O<D.length;O+=3)D[O+1]==-1&&g(D[O+2],_[O]+I+1);return S}(f,a,l,u,d,h,p),A=mo(E,c,0,p);l=A.local;for(let D=0;D<f.length;D+=3)f[D+1]<0&&(f.splice(D,3),D-=3);for(let D=0,_=0;D<A.children.length;D+=3){let S=A.children[D];for(;_<f.length&&f[_]<S;)_+=3;f.splice(_,0,A.children[D],A.children[D+1],A.children[D+2])}}return new Ee(l.sort(Cn),f)}(this.children,s||[],e,t,r,i,o):s?new Ee(s.sort(Cn),Wn):ke}add(e,t){return t.length?this==ke?Ee.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((a,l)=>{let u,c=l+r;if(u=cf(t,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,u,c+1):i.splice(o,0,l,l+a.nodeSize,mo(u,a,c+1,Mn)),o+=3}});let s=uf(o?df(t):t,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ee(s.length?this.local.concat(s).sort(Cn):this.local,i||this.children)}remove(e){return e.length==0||this==ke?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+t,l=r[o+1]+t;for(let c,d=0;d<e.length;d++)(c=e[d])&&c.from>a&&c.to<l&&(e[d]=null,(s||(s=[])).push(c));if(!s)continue;r==this.children&&(r=this.children.slice());let u=r[o+2].removeInner(s,a+1);u!=ke?r[o+2]=u:(r.splice(o,3),o-=3)}if(i.length){for(let o,s=0;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ee(i,r):ke}forChild(e,t){if(this==ke)return this;if(t.isLeaf)return Ee.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+t.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof ln){let u=Math.max(o,l.from)-o,c=Math.min(s,l.to)-o;u<c&&(i||(i=[])).push(l.copy(u,c))}}if(i){let a=new Ee(i.sort(Cn),Wn);return r?new tn([a,r]):a}return r||ke}eq(e){if(this==e)return!0;if(!(e instanceof Ee)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Gl(this.localsInner(e))}localsInner(e){if(this==ke)return Wn;if(e.inlineContent||!this.local.some(ln.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ln||t.push(this.local[r]);return t}}Ee.empty=new Ee([],[]),Ee.removeOverlap=Gl;const ke=Ee.empty;class tn{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Mn));return tn.from(r)}forChild(e,t){if(t.isLeaf)return Ee.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ke&&(o instanceof tn?r=r.concat(o.members):r.push(o))}return tn.from(r)}eq(e){if(!(e instanceof tn)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(t){r&&(t=t.slice(),r=!1);for(let s=0;s<o.length;s++)t.push(o[s])}else t=o}return t?Gl(r?t:t.sort(Cn)):Wn}static from(e){switch(e.length){case 0:return ke;case 1:return e[0];default:return new tn(e.every(t=>t instanceof Ee)?e:e.reduce((t,r)=>t.concat(r instanceof Ee?r:r.members),[]))}}}function uf(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new it(i.from+e,i.to+e,i.type))}return t}function cf(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o,s=0;s<n.length;s++)(o=n[s])&&o.from>t&&o.to<r&&((i||(i=[])).push(o),n[s]=null);return i}function df(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function mo(n,e,t,r){let i=[],o=!1;e.forEach((a,l)=>{let u=cf(n,a,l+t);if(u){o=!0;let c=mo(u,a,t+l+1,r);c!=ke&&i.push(l,l+a.nodeSize,c)}});let s=uf(o?df(n):n,-t).sort(Cn);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Ee(s,i):ke}function Cn(n,e){return n.from-e.from||n.to-e.to}function Gl(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from!=r.from){o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),Qc(e,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),Qc(e,i+1,o.copy(r.to,o.to)))}}return e}function Qc(n,e,t){for(;e<n.length&&Cn(t,n[e])>0;)e++;n.splice(e,0,t)}function Qs(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=ke&&e.push(r)}),n.cursorWrapper&&e.push(Ee.create(n.state.doc,[n.cursorWrapper.deco])),tn.from(e)}const ZA={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},QA=Ze&&sn<=11;class eg{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class tg{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new eg,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Ze&&sn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),QA&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ZA)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(jc(this.view)){if(this.suppressingSelectionUpdates)return Xt(this.view);if(Ze&&sn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Bn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,r=new Set;for(let o=e.focusNode;o;o=Ti(o))r.add(o);for(let o=e.anchorNode;o;o=Ti(o))if(r.has(o)){t=o;break}let i=t&&this.view.docView.nearestDesc(t);return i&&i.ignoreMutation({type:"selection",target:t.nodeType==3?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&jc(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let c=0;c<t.length;c++){let d=this.registerMutation(t[c],l);d&&(o=o<0?d.from:Math.min(d.from,o),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(gt&&l.length>1){let c=l.filter(d=>d.nodeName=="BR");if(c.length==2){let d=c[0],h=c[1];d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}}let u=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ms(r)&&(u=$l(e))&&u.eq(Q.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Xt(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),function(c){if(!ed.has(c)&&(ed.set(c,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(c.dom).whiteSpace)!==-1)){if(c.requiresGeckoHackNode=gt,td)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),td=!0}}(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Xt(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++)t.push(e.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Ze&&sn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:c,nextSibling:d}=e.addedNodes[u];(!c||Array.prototype.indexOf.call(e.addedNodes,c)<0)&&(i=c),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d)}let s=i&&i.parentNode==e.target?je(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?je(o):e.target.childNodes.length;return{from:a,to:r.localPosFromDOM(e.target,l,1)}}return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let ed=new WeakMap,td=!1;function ng(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Xe&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}if(n.parentNode.lastChild==n||Xe&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const rg=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function ig(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let g=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,O=$l(n,g);if(O&&!n.state.selection.eq(O)){if(we&&dt&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",w=>w(n,Sn(13,"Enter"))))return;let k=n.state.tr.setSelection(O);g=="pointer"?k.setMeta("pointer",!0):g=="key"&&k.scrollIntoView(),o&&k.setMeta("composition",o),n.dispatch(k)}return}let s=n.state.doc.resolve(e),a=s.sharedDepth(t);e=s.before(a+1),t=n.state.doc.resolve(t).after(a+1);let l,u,c=n.state.selection,d=function(g,O,k){let w,{node:U,fromOffset:y,toOffset:M,from:$,to:j}=g.docView.parseRange(O,k),G=g.domSelectionRange(),V=G.anchorNode;if(V&&g.dom.contains(V.nodeType==1?V:V.parentNode)&&(w=[{node:V,offset:G.anchorOffset}],ms(G)||w.push({node:G.focusNode,offset:G.focusOffset})),we&&g.input.lastKeyCode===8)for(let re=M;re>y;re--){let Oe=U.childNodes[re-1],_e=Oe.pmViewDesc;if(Oe.nodeName=="BR"&&!_e){M=re;break}if(!_e||_e.size)break}let Y=g.state.doc,K=g.someProp("domParser")||Si.fromSchema(g.state.schema),W=Y.resolve($),ee=null,F=K.parse(U,{topNode:W.parent,topMatch:W.parent.contentMatchAt(W.index()),topOpen:!0,from:y,to:M,preserveWhitespace:W.parent.type.whitespace!="pre"||"full",findPositions:w,ruleFromNode:ng,context:W});if(w&&w[0].pos!=null){let re=w[0].pos,Oe=w[1]&&w[1].pos;Oe==null&&(Oe=re),ee={anchor:re+$,head:Oe+$}}return{doc:F,sel:ee,from:$,to:j}}(n,e,t),h=n.state.doc,p=h.slice(d.from,d.to);n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(l=n.state.selection.to,u="end"):(l=n.state.selection.from,u="start"),n.input.lastKeyCode=null;let f=function(g,O,k,w,U){let y=g.findDiffStart(O,k);if(y==null)return null;let{a:M,b:$}=g.findDiffEnd(O,k+g.size,k+O.size);if(U=="end"&&(w-=M+Math.max(0,y-Math.min(M,$))-y),M<y&&g.size<O.size){let j=w<=y&&w>=M?y-w:0;y-=j,y&&y<O.size&&rd(O.textBetween(y-1,y+1))&&(y+=j?1:-1),$=y+($-M),M=y}else if($<y){let j=w<=y&&w>=$?y-w:0;y-=j,y&&y<g.size&&rd(g.textBetween(y-1,y+1))&&(y+=j?1:-1),M=y+(M-$),$=y}return{start:y,endA:M,endB:$}}(p.content,d.doc.content,d.from,l,u);if((Sr&&n.input.lastIOSEnter>Date.now()-225||dt)&&i.some(g=>g.nodeType==1&&!rg.test(g.nodeName))&&(!f||f.endA>=f.endB)&&n.someProp("handleKeyDown",g=>g(n,Sn(13,"Enter"))))return void(n.input.lastIOSEnter=0);if(!f){if(!(r&&c instanceof ne&&!c.empty&&c.$head.sameParent(c.$anchor))||n.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){let g=nd(n,n.state.doc,d.sel);if(g&&!g.eq(n.state.selection)){let O=n.state.tr.setSelection(g);o&&O.setMeta("composition",o),n.dispatch(O)}}return}f={start:c.from,endA:c.to,endB:c.to}}if(we&&n.cursorWrapper&&d.sel&&d.sel.anchor==n.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let g=f.endB-f.start;d.sel={anchor:d.sel.anchor+g,head:d.sel.anchor+g}}n.input.domChangeCount++,n.state.selection.from<n.state.selection.to&&f.start==f.endB&&n.state.selection instanceof ne&&(f.start>n.state.selection.from&&f.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?f.start=n.state.selection.from:f.endA<n.state.selection.to&&f.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(f.endB+=n.state.selection.to-f.endA,f.endA=n.state.selection.to)),Ze&&sn<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>d.from&&d.doc.textBetween(f.start-d.from-1,f.start-d.from+1)=="  "&&(f.start--,f.endA--,f.endB--);let m,E=d.doc.resolveNoCache(f.start-d.from),A=d.doc.resolveNoCache(f.endB-d.from),D=h.resolve(f.start),_=E.sameParent(A)&&E.parent.inlineContent&&D.end()>=f.endA;if((Sr&&n.input.lastIOSEnter>Date.now()-225&&(!_||i.some(g=>g.nodeName=="DIV"||g.nodeName=="P"))||!_&&E.pos<d.doc.content.size&&!E.sameParent(A)&&(m=Q.findFrom(d.doc.resolve(E.pos+1),1,!0))&&m.head==A.pos)&&n.someProp("handleKeyDown",g=>g(n,Sn(13,"Enter"))))return void(n.input.lastIOSEnter=0);if(n.state.selection.anchor>f.start&&function(g,O,k,w,U){if(!w.parent.isTextblock||k-O<=U.pos-w.pos||ea(w,!0,!1)<U.pos)return!1;let y=g.resolve(O);if(y.parentOffset<y.parent.content.size||!y.parent.isTextblock)return!1;let M=g.resolve(ea(y,!0,!0));return!(!M.parent.isTextblock||M.pos>k||ea(M,!0,!1)<k)&&w.parent.content.cut(w.parentOffset).eq(M.parent.content)}(h,f.start,f.endA,E,A)&&n.someProp("handleKeyDown",g=>g(n,Sn(8,"Backspace"))))return void(dt&&we&&n.domObserver.suppressSelectionUpdates());we&&dt&&f.endB==f.start&&(n.input.lastAndroidDelete=Date.now()),dt&&!_&&E.start()!=A.start()&&A.parentOffset==0&&E.depth==A.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==f.endA&&(f.endB-=2,A=d.doc.resolveNoCache(f.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(g){return g(n,Sn(13,"Enter"))})},20));let S,R,v,I=f.start,L=f.endA;if(_){if(E.pos==A.pos)Ze&&sn<=11&&E.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Xt(n),20)),S=n.state.tr.delete(I,L),R=h.resolve(f.start).marksAcross(h.resolve(f.endA));else if(f.endA==f.endB&&(v=function(g,O){let k,w,U,y=g.firstChild.marks,M=O.firstChild.marks,$=y,j=M;for(let V=0;V<M.length;V++)$=M[V].removeFromSet($);for(let V=0;V<y.length;V++)j=y[V].removeFromSet(j);if($.length==1&&j.length==0)w=$[0],k="add",U=V=>V.mark(w.addToSet(V.marks));else{if($.length!=0||j.length!=1)return null;w=j[0],k="remove",U=V=>V.mark(w.removeFromSet(V.marks))}let G=[];for(let V=0;V<O.childCount;V++)G.push(U(O.child(V)));if(H.from(G).eq(g))return{mark:w,type:k}}(E.parent.content.cut(E.parentOffset,A.parentOffset),D.parent.content.cut(D.parentOffset,f.endA-D.start()))))S=n.state.tr,v.type=="add"?S.addMark(I,L,v.mark):S.removeMark(I,L,v.mark);else if(E.parent.child(E.index()).isText&&E.index()==A.index()-(A.textOffset?0:1)){let g=E.parent.textBetween(E.parentOffset,A.parentOffset);if(n.someProp("handleTextInput",O=>O(n,I,L,g)))return;S=n.state.tr.insertText(g,I,L)}}if(S||(S=n.state.tr.replace(I,L,d.doc.slice(f.start-d.from,f.endB-d.from))),d.sel){let g=nd(n,S.doc,d.sel);g&&!(we&&dt&&n.composing&&g.empty&&(f.start!=f.endB||n.input.lastAndroidDelete<Date.now()-100)&&(g.head==I||g.head==S.mapping.map(L)-1)||Ze&&g.empty&&g.head==I)&&S.setSelection(g)}R&&S.ensureMarks(R),o&&S.setMeta("composition",o),n.dispatch(S.scrollIntoView())}function nd(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:zl(n,e.resolve(t.anchor),e.resolve(t.head))}function ea(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function rd(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class og{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new YA,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(ld),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=sd(this),od(this),this.nodeViews=ad(this),this.docView=Mc(this.state.doc,id(this),Qs(this),this.dom,this),this.domObserver=new tg(this,(r,i,o,s)=>ig(this,r,i,o,s)),this.domObserver.start(),function(r){for(let i in $e){let o=$e[i];r.dom.addEventListener(i,r.input.eventHandlers[i]=s=>{!GA(r,s)||qa(r,s)||!r.editable&&s.type in Ge||o(r,s)},VA[i]?{passive:!0}:void 0)}Xe&&r.dom.addEventListener("input",()=>null),Zs(r)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Zs(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ld),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(sf(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=ad(this);(function(f,m){let E=0,A=0;for(let D in f){if(f[D]!=m[D])return!0;E++}for(let D in m)A++;return E!=A})(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Zs(this),this.editable=sd(this),od(this);let l=Qs(this),u=id(this),c=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(e.doc,u,l);!d&&e.selection.eq(i.selection)||(s=!0);let h=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&function(p){let f,m,E=p.dom.getBoundingClientRect(),A=Math.max(0,E.top);for(let D=(E.left+E.right)/2,_=A+1;_<Math.min(innerHeight,E.bottom);_+=5){let S=p.root.elementFromPoint(D,_);if(!S||S==p.dom||!p.dom.contains(S))continue;let R=S.getBoundingClientRect();if(R.top>=A-20){f=S,m=R.top;break}}return{refDOM:f,refTop:m,stack:Nc(p.dom)}}(this);if(s){this.domObserver.stop();let p=d&&(Ze||we)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&function(f,m){let E=Math.min(f.$anchor.sharedDepth(f.head),m.$anchor.sharedDepth(m.head));return f.$anchor.start(E)!=m.$anchor.start(E)}(i.selection,e.selection);if(d){let f=we?this.trackWrites=this.domSelectionRange().focusNode:null;!o&&this.docView.update(e.doc,u,l,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Mc(e.doc,u,l,this.dom,this)),f&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(f){let m=f.docView.domFromPos(f.state.selection.anchor,0),E=f.domSelectionRange();return Bn(m.node,m.offset,E.anchorNode,E.anchorOffset)}(this))?Xt(this,p):(Wp(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():h&&function({refDOM:p,refTop:f,stack:m}){let E=p?p.getBoundingClientRect().top:0;vc(m,E==0?0:E-f)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof X){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Ic(this,t.getBoundingClientRect(),e)}else Ic(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}}updateDraggedNode(e,t){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-t.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new lf(e.slice,e.move,i<0?void 0:X.create(this.state.doc,i))}someProp(e,t){let r,i=this._props&&this._props[e];if(i!=null&&(r=t?t(i):i))return r;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(r=t?t(a):a))return r}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(Ze){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(Vn)return e.focus(Vn);let t=Nc(e);e.focus(Vn==null?{get preventScroll(){return Vn={preventScroll:!0},!0}}:void 0),Vn||(Vn=!1,vc(t,0))}(this.dom),Xt(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return wA(this,e)}coordsAtPos(e,t=1){return zp(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return xA(this,t||this.state,e)}pasteHTML(e,t){return hi(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return hi(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Qs(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return function(t,r){qa(t,r)||!$e[r.type]||!t.editable&&r.type in Ge||$e[r.type](t,r)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Xe&&this.root.nodeType===11&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom?function(e){let t;function r(u){u.preventDefault(),u.stopImmediatePropagation(),t=u.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0);let i=t.startContainer,o=t.startOffset,s=t.endContainer,a=t.endOffset,l=e.domAtPos(e.state.selection.anchor);return Bn(l.node,l.offset,s,a)&&([i,o,s,a]=[s,a,i,o]),{anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:a}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function id(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:e[r]||r=="contenteditable"||r=="nodeName"||(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[it.node(0,n.state.doc.content.size,e)]}function od(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:it.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function sd(n){return!n.someProp("editable",e=>e(n.state)===!1)}function ad(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function ld(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const Se=new class{constructor(n){this.cached=Object.create(null);let e=this.spec={};for(let r in n)e[r]=n[r];e.nodes=Ne.from(n.nodes),e.marks=Ne.from(n.marks||{}),this.nodes=uc.compile(this.spec.nodes,this),this.marks=ds.compile(this.spec.marks,this);let t=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let i=this.nodes[r],o=i.spec.content||"",s=i.spec.marks;i.contentMatch=t[o]||(t[o]=xn.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=s=="_"?null:s?cc(this,s.split(" ")):s!=""&&i.inlineContent?null:[]}for(let r in this.marks){let i=this.marks[r],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:cc(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(n,e=null,t,r){if(typeof n=="string")n=this.nodeType(n);else{if(!(n instanceof uc))throw new RangeError("Invalid node type: "+n);if(n.schema!=this)throw new RangeError("Node type from different schema used ("+n.name+")")}return n.createChecked(e,t,r)}text(n,e){let t=this.nodes.text;return new Mo(t,t.defaultAttrs,n,te.setFrom(e))}mark(n,e){return typeof n=="string"&&(n=this.marks[n]),n.create(e)}nodeFromJSON(n){return kn.fromJSON(this,n)}markFromJSON(n){return te.fromJSON(this,n)}nodeType(n){let e=this.nodes[n];if(!e)throw new RangeError("Unknown node type: "+n);return e}}({nodes:{doc:{content:"paragraph+"},paragraph:{code:!0,content:"inline*",parseDOM:[{tag:"p"}],toDOM:()=>["p",0]},text:{group:"inline"},mention:{group:"inline",inline:!0,attrs:{id:{},name:{}},content:"text*",toDOM:n=>["span",{"data-mention-id":n.attrs.id,class:"t-mention"},`@${n.attrs.name}`],parseDOM:[{tag:"span[data-mention-id]",getAttrs:n=>({id:n.dataset["mention-id"]})}]},customemoji:{group:"inline",inline:!0,attrs:{name:{},url:{}},content:"text*",selectable:!1,toDOM:n=>["img",{src:n.attrs.url,alt:n.attrs.name,"data-custom-emoji":n.attrs.name}],parseDOM:[{tag:"img[data-custom-emoji]",getAttrs:n=>{const e=n;return{name:e.dataset.customEmoji,url:e.src}}}]}},marks:{literal:{toDOM:()=>["span",{"data-literal":""}],parseDOM:[{tag:"span[data-literal]"}]},bold:{toDOM:()=>["b"],parseDOM:[{tag:"b"}]},italic:{toDOM:()=>["i"],parseDOM:[{tag:"i"}]},strikethrough:{toDOM:()=>["del"],parseDOM:[{tag:"del"}]},emoji:{attrs:{emoji:{}},toDOM:n=>["span",{"data-emoji":n.attrs.emoji},n.attrs.emoji],parseDOM:[{tag:"span[data-emoji]",getAttrs:n=>({emoji:n.dataset.emoji})}]}}}),ta=new fs("placeholder"),ud=new ps({key:ta,props:{decorations(n){if(hf(n.doc))return;const e=n.doc.firstChild,t=it.node(0,e.nodeSize,{class:"empty-node","data-placeholder":ta.getState(n)});return Ee.create(n.doc,[t])}},state:{init:()=>"",apply:(n,e)=>{var t;return(t=n.getMeta(ta))!=null?t:e}}});function hf(n){return n.childCount!==1||n.firstChild.childCount!==0}for(var dn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Bo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},cd=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent),sg=typeof navigator!="undefined"&&/Apple Computer/.test(navigator.vendor),ag=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent),dd=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),lg=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ug=cd&&(dd||+cd[1]<57)||ag&&dd,ye=0;ye<10;ye++)dn[48+ye]=dn[96+ye]=String(ye);for(ye=1;ye<=24;ye++)dn[ye+111]="F"+ye;for(ye=65;ye<=90;ye++)dn[ye]=String.fromCharCode(ye+32),Bo[ye]=String.fromCharCode(ye);for(var na in dn)Bo.hasOwnProperty(na)||(Bo[na]=dn[na]);const cg=typeof navigator!="undefined"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function dg(n){let e,t,r,i,o=n.split(/-(?!$)/),s=o[o.length-1];s=="Space"&&(s=" ");for(let a=0;a<o.length-1;a++){let l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))e=!0;else if(/^(c|ctrl|control)$/i.test(l))t=!0;else if(/^s(hift)?$/i.test(l))r=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);cg?i=!0:t=!0}}return e&&(s="Alt-"+s),t&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function ra(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function hd(n){return new ps({props:{handleKeyDown:hg(n)}})}function hg(n){let e=function(t){let r=Object.create(null);for(let i in t)r[dg(i)]=t[i];return r}(n);return function(t,r){let i,o=function(a){var l=!(ug&&(a.ctrlKey||a.altKey||a.metaKey)||(sg||lg)&&a.shiftKey&&a.key&&a.key.length==1)&&a.key||(a.shiftKey?Bo:dn)[a.keyCode]||a.key||"Unidentified";return l=="Esc"&&(l="Escape"),l=="Del"&&(l="Delete"),l=="Left"&&(l="ArrowLeft"),l=="Up"&&(l="ArrowUp"),l=="Right"&&(l="ArrowRight"),l=="Down"&&(l="ArrowDown"),l}(r),s=e[ra(o,r)];if(s&&s(t.state,t.dispatch,t))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[ra(o,r,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=dn[r.keyCode])&&i!=o){let a=e[ra(i,r)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}var Ho=200,ve=function(){};ve.prototype.append=function(n){return n.length?(n=ve.from(n),!this.length&&n||n.length<Ho&&this.leafAppend(n)||this.length<Ho&&n.leafPrepend(this)||this.appendInner(n)):this},ve.prototype.prepend=function(n){return n.length?ve.from(n).append(this):this},ve.prototype.appendInner=function(n){return new pg(this,n)},ve.prototype.slice=function(n,e){return n===void 0&&(n=0),e===void 0&&(e=this.length),n>=e?ve.empty:this.sliceInner(Math.max(0,n),Math.min(this.length,e))},ve.prototype.get=function(n){if(!(n<0||n>=this.length))return this.getInner(n)},ve.prototype.forEach=function(n,e,t){e===void 0&&(e=0),t===void 0&&(t=this.length),e<=t?this.forEachInner(n,e,t,0):this.forEachInvertedInner(n,e,t,0)},ve.prototype.map=function(n,e,t){e===void 0&&(e=0),t===void 0&&(t=this.length);var r=[];return this.forEach(function(i,o){return r.push(n(i,o))},e,t),r},ve.from=function(n){return n instanceof ve?n:n&&n.length?new pf(n):ve.empty};var pf=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,i){return r==0&&i==this.length?this:new e(this.values.slice(r,i))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,i,o,s){for(var a=i;a<o;a++)if(r(this.values[a],s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){for(var a=i-1;a>=o;a--)if(r(this.values[a],s+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Ho)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Ho)return new e(r.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(ve);ve.empty=new pf([]);var pg=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,r,i,o){var s=this.left.length;return!(r<s&&this.left.forEachInner(t,r,Math.min(i,s),o)===!1)&&!(i>s&&this.right.forEachInner(t,Math.max(r-s,0),Math.min(this.length,i)-s,o+s)===!1)&&void 0},e.prototype.forEachInvertedInner=function(t,r,i,o){var s=this.left.length;return!(r>s&&this.right.forEachInvertedInner(t,r-s,Math.max(i,s)-s,o+s)===!1)&&!(i<s&&this.left.forEachInvertedInner(t,Math.min(r,s),i,o)===!1)&&void 0},e.prototype.sliceInner=function(t,r){if(t==0&&r==this.length)return this;var i=this.left.length;return r<=i?this.left.slice(t,r):t>=i?this.right.slice(t-i,r-i):this.left.slice(t,i).append(this.right.slice(0,r-i))},e.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new e(r,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(ve),ff=ve;const mf=Math.pow(2,16);function fg(n,e){return n+e*mf}function pd(n){return 65535&n}let Qa=class{constructor(n,e,t){this.pos=n,this.delInfo=e,this.recover=t}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}},Hn=class Jn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Jn.empty)return Jn.empty}recover(e){let t=0,r=pd(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*r]+t+function(i){return(i-(65535&i))/mf}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=l+i+((u?e==l?-1:e==d?1:t:t)<0?0:c);if(r)return h;let p=e==(t<0?l:d)?null:fg(a/3,e-l),f=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(f|=8),new Qa(h,f,p)}i+=c-u}return r?e+i:new Qa(e+i,0,null)}touches(e,t){let r=0,i=pd(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o];if(e<=l+u&&a==3*i)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new Jn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Jn.empty:new Jn(e<0?[0,-e,0]:[0,0,e])}};Hn.empty=new Hn([]);class pi{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new pi(this.maps,this.mirror,e,t)}copy(){return new pi(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new pi;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o].mapResult(e,t);if(s.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this.maps[a].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new Qa(e,i,null)}}const ia=Object.create(null);let Fe=class{getMap(){return Hn.empty}merge(n){return null}static fromJSON(n,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let t=ia[e.stepType];if(!t)throw new RangeError(`No step type ${e.stepType} defined`);return t.fromJSON(n,e)}static jsonID(n,e){if(n in ia)throw new RangeError("Duplicate use of step JSON ID "+n);return ia[n]=e,e.prototype.jsonID=n,e}},Ye=class Jr{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Jr(e,null)}static fail(e){return new Jr(null,e)}static fromReplace(e,t,r,i){try{return Jr.ok(e.replace(t,r,i))}catch(o){if(o instanceof _r)return Jr.fail(o.message);throw o}}};function Xl(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Xl(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return H.fromArray(r)}let Ef=class qr extends Fe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new B(Xl(t.content,(s,a)=>s.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return Ye.fromReplace(e,this.from,this.to,o)}invert(){return new Af(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new qr(t.pos,r.pos,this.mark)}merge(e){return e instanceof qr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new qr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new qr(t.from,t.to,e.markFromJSON(t.mark))}};Fe.jsonID("addMark",Ef);let Af=class Zr extends Fe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new B(Xl(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Ye.fromReplace(e,this.from,this.to,r)}invert(){return new Ef(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Zr(t.pos,r.pos,this.mark)}merge(e){return e instanceof Zr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Zr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Zr(t.from,t.to,e.markFromJSON(t.mark))}};Fe.jsonID("removeMark",Af);let gf=class Qr extends Fe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ye.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ye.fromReplace(e,this.pos,this.pos+1,new B(H.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Qr(this.pos,t.marks[i]);return new Qr(this.pos,this.mark)}}return new Df(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Qr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Qr(t.pos,e.markFromJSON(t.mark))}};Fe.jsonID("addNodeMark",gf);let Df=class el extends Fe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ye.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ye.fromReplace(e,this.pos,this.pos+1,new B(H.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new gf(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new el(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new el(t.pos,e.markFromJSON(t.mark))}};Fe.jsonID("removeNodeMark",Df);Fe.jsonID("replace",class An extends Fe{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&tl(e,this.from,this.to)?Ye.fail("Structure replace would overwrite content"):Ye.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Hn([this.from,this.to-this.from,this.slice.size])}invert(e){return new An(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new An(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof An)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new An(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new An(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new An(t.from,t.to,B.fromJSON(e,t.slice),!!t.structure)}});function tl(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}Fe.jsonID("replaceAround",class Eo extends Fe{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(tl(e,this.from,this.gapFrom)||tl(e,this.gapTo,this.to)))return Ye.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ye.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Ye.fromReplace(e,this.from,this.to,r):Ye.fail("Content does not fit in gap")}getMap(){return new Hn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Eo(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new Eo(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Eo(t.from,t.to,t.gapFrom,t.gapTo,B.fromJSON(e,t.slice),t.insert,!!t.structure)}});Fe.jsonID("attr",class Ao extends Fe{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ye.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Ye.fromReplace(e,this.pos,this.pos+1,new B(H.from(i),0,t.isLeaf?0:1))}getMap(){return Hn.empty}invert(e){return new Ao(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ao(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ao(t.pos,t.attr,t.value)}});Fe.jsonID("docAttr",class nl extends Fe{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Ye.ok(r)}getMap(){return Hn.empty}invert(e){return new nl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new nl(t.attr,t.value)}});let eo=class extends Error{};eo=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(eo.prototype=Object.create(Error.prototype)).constructor=eo,eo.prototype.name="TransformError";class pt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r,i,o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}t&&(r=this.remapping(o,this.items.length),i=r.maps.length);let s,a,l=e.tr,u=[],c=[];return this.items.forEach((d,h)=>{if(!d.step)return r||(r=this.remapping(o,h+1),i=r.maps.length),i--,void c.push(d);if(r){c.push(new Ct(d.map));let p,f=d.step.map(r.slice(i));f&&l.maybeStep(f).doc&&(p=l.mapping.maps[l.mapping.maps.length-1],u.push(new Ct(p,void 0,void 0,u.length+c.length))),i--,p&&r.appendMap(p,i)}else l.maybeStep(d.step);return d.selection?(s=r?d.selection.map(r.slice(i)):d.selection,a=new pt(this.items.slice(0,o).append(c.reverse().concat(u)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:a,transform:l,selection:s}}addTransform(e,t,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let d,h=e.steps[c].invert(e.docs[c]),p=new Ct(e.mapping.maps[c],h,t);(d=l&&l.merge(p))&&(p=d,c?o.pop():a=a.slice(0,a.length-1)),o.push(p),t&&(s++,t=void 0),i||(l=p)}let u=s-r.depth;return u>mg&&(a=function(c,d){let h;return c.forEach((p,f)=>{if(p.selection&&d--==0)return h=f,!1}),c.slice(h)}(a,u),s-=u),new pt(a.append(o),s)}remapping(e,t){let r=new pi;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new pt(this.items.append(e.map(t=>new Ct(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=t;this.items.forEach(h=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let f=o.maps[p];if(h.step){let m=e.steps[p].invert(e.docs[p]),E=h.selection&&h.selection.map(o.slice(l+1,p));E&&a++,r.push(new Ct(f,m,E))}else r.push(new Ct(f))},i);let u=[];for(let h=t;h<s;h++)u.push(new Ct(o.maps[h]));let c=this.items.slice(0,i).append(u).append(r),d=new pt(c,a);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(t.slice(r)),u=l&&l.getMap();if(r--,u&&t.appendMap(u,r),l){let c=s.selection&&s.selection.map(t.slice(r));c&&o++;let d,h=new Ct(u.invert(),l,c),p=i.length-1;(d=i.length&&i[p].merge(h))?i[p]=d:i.push(h)}}else s.map&&r--},this.items.length,0),new pt(ff.from(i.reverse()),o)}}pt.empty=new pt(ff.empty,0);class Ct{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Ct(t.getMap().invert(),t,this.selection)}}}class Zt{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const mg=20;function fd(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function oa(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}let sa=!1,md=null;function go(n){let e=n.plugins;if(md!=e){sa=!1,md=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){sa=!0;break}}return sa}const In=new fs("history"),Eg=new fs("closeHistory");function Ag(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new ps({key:In,state:{init:()=>new Zt(pt.empty,pt.empty,null,0,-1),apply:(e,t,r)=>function(i,o,s,a){let l,u=s.getMeta(In);if(u)return u.historyState;s.getMeta(Eg)&&(i=new Zt(i.done,i.undone,null,0,-1));let c=s.getMeta("appendedTransaction");if(s.steps.length==0)return i;if(c&&c.getMeta(In))return c.getMeta(In).redo?new Zt(i.done.addTransform(s,void 0,a,go(o)),i.undone,fd(s.mapping.maps),i.prevTime,i.prevComposition):new Zt(i.done,i.undone.addTransform(s,void 0,a,go(o)),null,i.prevTime,i.prevComposition);if(s.getMeta("addToHistory")===!1||c&&c.getMeta("addToHistory")===!1)return(l=s.getMeta("rebased"))?new Zt(i.done.rebased(s,l),i.undone.rebased(s,l),oa(i.prevRanges,s.mapping),i.prevTime,i.prevComposition):new Zt(i.done.addMaps(s.mapping.maps),i.undone.addMaps(s.mapping.maps),oa(i.prevRanges,s.mapping),i.prevTime,i.prevComposition);{let d=s.getMeta("composition"),h=i.prevTime==0||!c&&i.prevComposition!=d&&(i.prevTime<(s.time||0)-a.newGroupDelay||!function(f,m){if(!m)return!1;if(!f.docChanged)return!0;let E=!1;return f.mapping.maps[0].forEach((A,D)=>{for(let _=0;_<m.length;_+=2)A<=m[_+1]&&D>=m[_]&&(E=!0)}),E}(s,i.prevRanges)),p=c?oa(i.prevRanges,s.mapping):fd(s.mapping.maps);return new Zt(i.done.addTransform(s,h?o.selection.getBookmark():void 0,a,go(o)),pt.empty,p,s.time,d==null?i.prevComposition:d)}}(t,r,e,n)},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?_f:r=="historyRedo"?Sf:null;return!!i&&(t.preventDefault(),i(e.state,e.dispatch))}}}})}function Of(n,e){return(t,r)=>{let i=In.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=function(s,a,l){let u=go(a),c=In.get(a).spec.config,d=(l?s.undone:s.done).popEvent(a,u);if(!d)return null;let h=d.selection.resolve(d.transform.doc),p=(l?s.done:s.undone).addTransform(d.transform,a.selection.getBookmark(),c,u),f=new Zt(l?p:d.remaining,l?d.remaining:p,null,0,-1);return d.transform.setSelection(h).setMeta(In,{redo:l,historyState:f})}(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const _f=Of(!1,!0),Sf=Of(!0,!0),Tf=Math.pow(2,16);function gg(n,e){return n+e*Tf}function Ed(n){return 65535&n}class Ad{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class rt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&rt.empty)return rt.empty}recover(e){let t=0,r=Ed(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*r]+t+function(i){return(i-(65535&i))/Tf}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=l+i+((u?e==l?-1:e==d?1:t:t)<0?0:c);if(r)return h;let p=e==(t<0?l:d)?null:gg(a/3,e-l),f=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(f|=8),new Ad(h,f,p)}i+=c-u}return r?e+i:new Ad(e+i,0,null)}touches(e,t){let r=0,i=Ed(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o];if(e<=l+u&&a==3*i)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new rt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?rt.empty:new rt(e<0?[0,-e,0]:[0,0,e])}}rt.empty=new rt([]);const aa=Object.create(null);class Pe{getMap(){return rt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=aa[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in aa)throw new RangeError("Duplicate use of step JSON ID "+e);return aa[e]=t,t.prototype.jsonID=e,t}}class ge{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new ge(e,null)}static fail(e){return new ge(null,e)}static fromReplace(e,t,r,i){try{return ge.ok(e.replace(t,r,i))}catch(o){if(o instanceof _r)return ge.fail(o.message);throw o}}}function Kl(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Kl(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return H.fromArray(r)}class Nn extends Pe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new B(Kl(t.content,(s,a)=>s.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return ge.fromReplace(e,this.from,this.to,o)}invert(){return new vn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Nn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Nn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Nn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Nn(t.from,t.to,e.markFromJSON(t.mark))}}Pe.jsonID("addMark",Nn);class vn extends Pe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new B(Kl(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return ge.fromReplace(e,this.from,this.to,r)}invert(){return new Nn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new vn(t.pos,r.pos,this.mark)}merge(e){return e instanceof vn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new vn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new vn(t.from,t.to,e.markFromJSON(t.mark))}}Pe.jsonID("removeMark",vn);class yn extends Pe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ge.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ge.fromReplace(e,this.pos,this.pos+1,new B(H.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new yn(this.pos,t.marks[i]);return new yn(this.pos,this.mark)}}return new Ci(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new yn(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new yn(t.pos,e.markFromJSON(t.mark))}}Pe.jsonID("addNodeMark",yn);class Ci extends Pe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ge.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ge.fromReplace(e,this.pos,this.pos+1,new B(H.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new yn(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ci(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ci(t.pos,e.markFromJSON(t.mark))}}Pe.jsonID("removeNodeMark",Ci);class ht extends Pe{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&rl(e,this.from,this.to)?ge.fail("Structure replace would overwrite content"):ge.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new rt([this.from,this.to-this.from,this.slice.size])}invert(e){return new ht(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new ht(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof ht)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ht(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ht(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ht(t.from,t.to,B.fromJSON(e,t.slice),!!t.structure)}}Pe.jsonID("replace",ht);class un extends Pe{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(rl(e,this.from,this.gapFrom)||rl(e,this.gapTo,this.to)))return ge.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ge.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?ge.fromReplace(e,this.from,this.to,r):ge.fail("Content does not fit in gap")}getMap(){return new rt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new un(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new un(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new un(t.from,t.to,t.gapFrom,t.gapTo,B.fromJSON(e,t.slice),t.insert,!!t.structure)}}function rl(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function Dg(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Wl(n){let e=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let t=n.depth;;--t){let r=n.$from.node(t),i=n.$from.index(t),o=n.$to.indexAfter(t);if(t<n.depth&&r.canReplace(i,o,e))return t;if(t==0||r.type.spec.isolating||!Dg(r,i,o))break}return null}function Do(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=t-2;u>o;u--,c--){let d=i.node(u),h=i.index(u);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(h,d.childCount),f=r&&r[c+1];f&&(p=p.replaceChild(0,f.type.create(f.attrs)));let m=r&&r[c]||d;if(!d.canReplace(h+1,d.childCount)||!m.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function gd(n,e){let t=n.resolve(e),r=t.index();return function(i,o){return!(!i||!o||i.isLeaf||!function(s,a){a.content.size||s.type.compatibleContent(a.type);let l=s.contentMatchAt(s.childCount),{linebreakReplacement:u}=s.type.schema;for(let c=0;c<a.childCount;c++){let d=a.child(c),h=d.type==u?s.type.schema.nodes.text:d.type;if(l=l.matchType(h),!l||!s.type.allowsMarks(d.marks))return!1}return l.validEnd}(i,o))}(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Rf(n,e,t=e,r=B.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return function(s,a,l){return!l.openStart&&!l.openEnd&&s.start()==a.start()&&s.parent.canReplace(s.index(),a.index(),l.content)}(i,o,r)?new ht(e,t,r):new Og(i,o,r).fit()}Pe.jsonID("replaceAround",un);class Og{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=H.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=H.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new B(o,s,a);return e>-1?new un(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new ht(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=la(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let l,{type:u,match:c}=this.frontier[a],d=null;if(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(H.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:d};if(t==2&&s&&(l=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:l};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=la(e,t);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new B(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=la(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new B(ei(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new B(ei(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,u=0,c=[],{match:d,type:h}=this.frontier[t];if(i){for(let m=0;m<i.childCount;m++)c.push(i.child(m));d=d.matchFragment(i)}let p=a.size+e-(s.content.size-s.openEnd);for(;u<a.childCount;){let m=a.child(u),E=d.matchType(m.type);if(!E)break;u++,(u>1||l==0||m.content.size)&&(d=E,c.push(Cf(m.mark(h.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?p:-1)))}let f=u==a.childCount;f||(p=-1),this.placed=ti(this.placed,t,H.from(c)),this.frontier[t].match=d,f&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,E=a;m<p;m++){let A=E.lastChild;this.frontier.push({type:A.type,match:A.contentMatchAt(A.childCount)}),E=A.content}this.unplaced=f?e==0?B.empty:new B(ei(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new B(ei(s.content,e,u),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!ua(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=ua(e,t,i,r,o);if(s){for(let a=t-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],c=ua(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:t,fit:s,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=ti(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=ti(this.placed,this.depth,H.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(H.empty,!0);e.childCount&&(this.placed=ti(this.placed,this.frontier.length,e))}}function ei(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(ei(n.firstChild.content,e-1,t)))}function ti(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(ti(n.lastChild.content,e-1,t)))}function la(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Cf(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Cf(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(H.empty,!0)))),n.copy(r)}function ua(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(l,u,c){for(let d=c;d<u.childCount;d++)if(!l.allowsMarks(u.child(d).marks))return!0;return!1}(t,o.content,s)?a:null}class fi extends Pe{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return ge.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return ge.fromReplace(e,this.pos,this.pos+1,new B(H.from(i),0,t.isLeaf?0:1))}getMap(){return rt.empty}invert(e){return new fi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new fi(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fi(t.pos,t.attr,t.value)}}Pe.jsonID("attr",fi);class Uo extends Pe{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return ge.ok(r)}getMap(){return rt.empty}invert(e){return new Uo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Uo(t.attr,t.value)}}Pe.jsonID("docAttr",Uo);let to=class extends Error{};to=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(to.prototype=Object.create(Error.prototype)).constructor=to,to.prototype.name="TransformError";const If=(n,e)=>!n.selection.empty&&(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function Tr(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}function Dd(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function Od(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}function il(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const _g=(n,e)=>{let{$from:t,$to:r}=n.selection;if(n.selection instanceof X&&n.selection.node.isBlock)return!(!t.parentOffset||!Do(n.doc,t.pos)||(e&&e(n.tr.split(t.pos).scrollIntoView()),0));if(!t.depth)return!1;let i,o,s=[],a=!1,l=!1;for(let h=t.depth;;h--){if(t.node(h).isBlock){a=t.end(h)==t.pos+(t.depth-h),l=t.start(h)==t.pos-(t.depth-h),o=il(t.node(h-1).contentMatchAt(t.indexAfter(h-1))),s.unshift(a&&o?{type:o}:null),i=h;break}if(h==1)return!1;s.unshift(null)}let u=n.tr;(n.selection instanceof ne||n.selection instanceof st)&&u.deleteSelection();let c=u.mapping.map(t.pos),d=Do(u.doc,c,s.length,s);if(d||(s[0]=o?{type:o}:null,d=Do(u.doc,c,s.length,s)),u.split(c,s.length,s),!a&&l&&t.node(i).type!=o){let h=u.mapping.map(t.before(i)),p=u.doc.resolve(h);o&&t.node(i-1).canReplaceWith(p.index(),p.index()+1,o)&&u.setNodeMarkup(u.mapping.map(t.before(i)),o)}return e&&e(u.scrollIntoView()),!0};function Nf(n,e,t,r){let i,o,s=e.nodeBefore,a=e.nodeAfter,l=s.type.spec.isolating||a.type.spec.isolating;if(!l&&function(p,f,m){let E=f.nodeBefore,A=f.nodeAfter,D=f.index();return!(!(E&&A&&E.type.compatibleContent(A.type))||(!E.content.size&&f.parent.canReplace(D-1,D)?(m&&m(p.tr.delete(f.pos-E.nodeSize,f.pos).scrollIntoView()),0):!f.parent.canReplace(D,D+1)||!A.isTextblock&&!gd(p.doc,f.pos)||(m&&m(p.tr.join(f.pos).scrollIntoView()),0)))}(n,e,t))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(i=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(i[0]||a.type).validEnd){if(t){let p=e.pos+a.nodeSize,f=H.empty;for(let A=i.length-1;A>=0;A--)f=H.from(i[A].create(null,f));f=H.from(s.copy(f));let m=n.tr.step(new un(e.pos-1,p,e.pos,p,new B(f,1,0),i.length,!0)),E=m.doc.resolve(p+2*i.length);E.nodeAfter&&E.nodeAfter.type==s.type&&gd(m.doc,E.pos)&&m.join(E.pos),t(m.scrollIntoView())}return!0}let c=a.type.spec.isolating||r>0&&l?null:Q.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),h=d&&Wl(d);if(h!=null&&h>=e.depth)return t&&t(n.tr.lift(d,h).scrollIntoView()),!0;if(u&&Tr(a,"start",!0)&&Tr(s,"end")){let p=s,f=[];for(;f.push(p),!p.isTextblock;)p=p.lastChild;let m=a,E=1;for(;!m.isTextblock;m=m.firstChild)E++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(t){let A=H.empty;for(let D=f.length-1;D>=0;D--)A=H.from(f[D].copy(A));t(n.tr.step(new un(e.pos-f.length,e.pos+a.nodeSize,e.pos+E,e.pos+a.nodeSize-E,new B(A,f.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function vf(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(t&&t(e.tr.setSelection(ne.create(e.doc,n<0?i.start(o):i.end(o)))),!0)}}const Sg=vf(-1),Tg=vf(1);function Jl(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}let ca=Jl(If,(n,e,t)=>{let r=function(s,a){let{$cursor:l}=s.selection;return!l||(a?!a.endOfTextblock("backward",s):l.parentOffset>0)?null:l}(n,t);if(!r)return!1;let i=Dd(r);if(!i){let s=r.blockRange(),a=s&&Wl(s);return a!=null&&(e&&e(n.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(Nf(n,i,e,-1))return!0;if(r.parent.content.size==0&&(Tr(o,"end")||X.isSelectable(o)))for(let s=r.depth;;s--){let a=Rf(n.doc,r.before(s),r.after(s),B.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=n.tr.step(a);l.setSelection(Tr(o,"end")?Q.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):X.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)},(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=Dd(r)}let s=o&&o.nodeBefore;return!(!s||!X.isSelectable(s))&&(e&&e(n.tr.setSelection(X.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)}),_d=Jl(If,(n,e,t)=>{let r=function(s,a){let{$cursor:l}=s.selection;return!l||(a?!a.endOfTextblock("forward",s):l.parentOffset<l.parent.content.size)?null:l}(n,t);if(!r)return!1;let i=Od(r);if(!i)return!1;let o=i.nodeAfter;if(Nf(n,i,e,1))return!0;if(r.parent.content.size==0&&(Tr(o,"start")||X.isSelectable(o))){let s=Rf(n.doc,r.before(),r.after(),B.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=n.tr.step(s);a.setSelection(Tr(o,"start")?Q.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):X.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=Od(r)}let s=o&&o.nodeAfter;return!(!s||!X.isSelectable(s))&&(e&&e(n.tr.setSelection(X.create(n.doc,o.pos)).scrollIntoView()),!0)});const $t={Enter:Jl((n,e)=>{let{$head:t,$anchor:r}=n.selection;return!(!t.parent.type.spec.code||!t.sameParent(r))&&(e&&e(n.tr.insertText(`
1196
- `).scrollIntoView()),!0)},(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof st||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=il(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=n.tr.insert(s,o.createAndFill());a.setSelection(ne.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(Do(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Wl(r);return i!=null&&(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},_g),"Mod-Enter":(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),s=il(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=t.after(),l=n.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Q.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Backspace:ca,"Mod-Backspace":ca,"Shift-Backspace":ca,Delete:_d,"Mod-Delete":_d,"Mod-a":(n,e)=>(e&&e(n.tr.setSelection(new st(n.doc))),!0)},yf={"Ctrl-h":$t.Backspace,"Alt-Backspace":$t["Mod-Backspace"],"Ctrl-d":$t.Delete,"Ctrl-Alt-Backspace":$t["Mod-Delete"],"Alt-Delete":$t["Mod-Delete"],"Alt-d":$t["Mod-Delete"],"Ctrl-a":Sg,"Ctrl-e":Tg};for(let n in $t)yf[n]=$t[n];const no=(typeof navigator!="undefined"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!(typeof os=="undefined"||!os.platform)&&os.platform()=="darwin")?yf:$t;function ql(n,e){return n.reduce((t,r,i)=>t.concat(e(r,i)),[])}const mi=(n,e,t=void 0)=>ql(n,r=>{if(typeof r=="string")return e(r,t);switch(r.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return[{type:r.type,children:mi(r.children,e,r.type)}];case"link":return[{type:r.type,url:r.url,children:mi(r.children,e,r.type)}];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return[{type:r.type,action:r.action,params:r.params,children:mi(r.children,e,r.type)}];case"mention":case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return[r]}});function Wt(n,e){return t=>{const r=t;let i=0;const o=[];for(const s of cs(t,n)){s.index-i>0&&o.push(r.substring(i,s.index));const a=e(s);Array.isArray(a)?o.push(...a):o.push(a),i=s.index+s[0].length}return i<t.length&&o.push(t.substring(i)),o}}function bf(n){return n.replace(/<!!mention:.*?\|([^>]*)>/gim,"@$1").replace(/<!!customemoji:(.*?)>/gim,"$1")}const Sd="’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var ol=(n=>(n[n.italic=1]="italic",n[n.strikethrough=2]="strikethrough",n[n.bold=4]="bold",n))(ol||{});const Rg=[0,1,2,3,4,5,6].map(n=>{const e=[];return 1&n||e.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/),2&n||e.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/),4&n||e.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/),new RegExp(e.map(t=>t.source).join("|"),"g")}),Cg={_:1,"*":4,"~":2};function Ig(n){return Lf(n,0)}function Lf(n,e=0){const t=Rg[e],r=t?function(i){const o=Ng.getOrCompute(i,()=>new RegExp(`(?:^|[\\s${Sd}])(?:${i.source})(?=[\\s${Sd}]|$)`,"g")),s=Wt(o,a=>{const l=a[0][1],u=a[1]||a[2]||a[3]||a[4]||a[5]||a[6];return[" ",{type:ol[Cg[l]],children:[u]}]});return a=>{const[l,...u]=s(" "+a);return l.length>1&&u.unshift(l.substring(1)),u}}(t):()=>[n];return mi(r(n),(i,o)=>o==="bold"||o==="italic"||o==="strikethrough"?Lf(i,e|ol[o]):[i])}const Ng=function(){const n=function(){try{return new WeakMap}catch(e){const t={has:()=>!1,get:()=>{},set:()=>t};return t}}();return{getOrCompute(e,t){if(n.has(e))return n.get(e);const r=t();return n.set(e,r),r}}}();function Td(n,e){if(Array.prototype.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function fn(n,e){for(var t=n.length-1;t>=0;t--)e(n[t])===!0&&n.splice(t,1)}function kf(n){throw new Error("Unhandled case for value: '"+n+"'")}var sl=function(){function n(e){e===void 0&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return n.prototype.setTagName=function(e){return this.tagName=e,this},n.prototype.getTagName=function(){return this.tagName||""},n.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},n.prototype.getAttr=function(e){return this.getAttrs()[e]},n.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},n.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},n.prototype.setClass=function(e){return this.setAttr("class",e)},n.prototype.addClass=function(e){for(var t,r=this.getClass(),i=this.whitespaceRegex,o=r?r.split(i):[],s=e.split(i);t=s.shift();)Td(o,t)===-1&&o.push(t);return this.getAttrs().class=o.join(" "),this},n.prototype.removeClass=function(e){for(var t,r=this.getClass(),i=this.whitespaceRegex,o=r?r.split(i):[],s=e.split(i);o.length&&(t=s.shift());){var a=Td(o,t);a!==-1&&o.splice(a,1)}return this.getAttrs().class=o.join(" "),this},n.prototype.getClass=function(){return this.getAttrs().class||""},n.prototype.hasClass=function(e){return(" "+this.getClass()+" ").indexOf(" "+e+" ")!==-1},n.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},n.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},n.prototype.getInnerHTML=function(){return this.innerHTML||""},n.prototype.getInnerHtml=function(){return this.getInnerHTML()},n.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},n.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")},n}(),Rd=function(){function n(e){e===void 0&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return n.prototype.build=function(e){return new sl({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},n.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},r=this.createCssClass(e);return r&&(t.class=r),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},n.prototype.createCssClass=function(e){var t=this.className;if(t){for(var r=[t],i=e.getCssClassSuffixes(),o=0,s=i.length;o<s;o++)r.push(t+"-"+i[o]);return r.join(" ")}return""},n.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},n.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var r=t.length,i=t.location;return i==="smart"?function(o,s,a){var l,u;a==null?(a="&hellip;",u=3,l=8):(u=a.length,l=a.length);var c=function(S){var R="";return S.scheme&&S.host&&(R+=S.scheme+"://"),S.host&&(R+=S.host),S.path&&(R+="/"+S.path),S.query&&(R+="?"+S.query),S.fragment&&(R+="#"+S.fragment),R},d=function(S,R){var v=R/2,I=Math.ceil(v),L=-1*Math.floor(v),g="";return L<0&&(g=S.substr(L)),S.substr(0,I)+a+g};if(o.length<=s)return o;var h=s-u,p=function(S){var R={},v=S,I=v.match(/^([a-z]+):\/\//i);return I&&(R.scheme=I[1],v=v.substr(I[0].length)),(I=v.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(R.host=I[1],v=v.substr(I[0].length)),(I=v.match(/^\/(.*?)(?=(\?|#|$))/i))&&(R.path=I[1],v=v.substr(I[0].length)),(I=v.match(/^\?(.*?)(?=(#|$))/i))&&(R.query=I[1],v=v.substr(I[0].length)),(I=v.match(/^#(.*?)$/i))&&(R.fragment=I[1]),R}(o);if(p.query){var f=p.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(p.query=p.query.substr(0,f[1].length),o=c(p))}if(o.length<=s||(p.host&&(p.host=p.host.replace(/^www\./,""),o=c(p)),o.length<=s))return o;var m="";if(p.host&&(m+=p.host),m.length>=h)return p.host.length==s?(p.host.substr(0,s-u)+a).substr(0,h+l):d(m,h).substr(0,h+l);var E="";if(p.path&&(E+="/"+p.path),p.query&&(E+="?"+p.query),E){if((m+E).length>=h)return(m+E).length==s?(m+E).substr(0,s):(m+d(E,h-m.length)).substr(0,h+l);m+=E}if(p.fragment){var A="#"+p.fragment;if((m+A).length>=h)return(m+A).length==s?(m+A).substr(0,s):(m+d(A,h-m.length)).substr(0,h+l);m+=A}if(p.scheme&&p.host){var D=p.scheme+"://";if((m+D).length<h)return(D+m).substr(0,s)}if(m.length<=s)return m;var _="";return h>0&&(_=m.substr(-1*Math.floor(h/2))),(m.substr(0,Math.ceil(h/2))+a+_).substr(0,h+l)}(e,r):i==="middle"?function(o,s,a){if(o.length<=s)return o;var l,u;a==null?(a="&hellip;",l=8,u=3):(l=a.length,u=a.length);var c=s-u,d="";return c>0&&(d=o.substr(-1*Math.floor(c/2))),(o.substr(0,Math.ceil(c/2))+a+d).substr(0,c+l)}(e,r):function(o,s,a){return function(l,u,c){var d;return l.length>u&&(c==null?(c="&hellip;",d=3):d=c.length,l=l.substring(0,u-d)+c),l}(o,s,a)}(e,r)},n}(),yr=function(){function n(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return n.prototype.getMatchedText=function(){return this.matchedText},n.prototype.setOffset=function(e){this.offset=e},n.prototype.getOffset=function(){return this.offset},n.prototype.getCssClassSuffixes=function(){return[this.getType()]},n.prototype.buildTag=function(){return this.tagBuilder.build(this)},n}(),al=function(n,e){return al=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},al(n,e)};function Mt(n,e){function t(){this.constructor=n}al(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Cd,ce=function(){return ce=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},ce.apply(this,arguments)},Zl=function(n){function e(t){var r=n.call(this,t)||this;return r.email="",r.email=t.email,r}return Mt(e,n),e.prototype.getType=function(){return"email"},e.prototype.getEmail=function(){return this.email},e.prototype.getAnchorHref=function(){return"mailto:"+this.email},e.prototype.getAnchorText=function(){return this.email},e}(yr),wf=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="",r.hashtag="",r.serviceName=t.serviceName,r.hashtag=t.hashtag,r}return Mt(e,n),e.prototype.getType=function(){return"hashtag"},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getHashtag=function(){return this.hashtag},e.prototype.getAnchorHref=function(){var t=this.serviceName,r=this.hashtag;switch(t){case"twitter":return"https://twitter.com/hashtag/"+r;case"facebook":return"https://www.facebook.com/hashtag/"+r;case"instagram":return"https://instagram.com/explore/tags/"+r;default:throw new Error("Unknown service name to point hashtag to: "+t)}},e.prototype.getAnchorText=function(){return"#"+this.hashtag},e}(yr),Mf=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.mention="",r.mention=t.mention,r.serviceName=t.serviceName,r}return Mt(e,n),e.prototype.getType=function(){return"mention"},e.prototype.getMention=function(){return this.mention},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},e.prototype.getAnchorText=function(){return"@"+this.mention},e.prototype.getCssClassSuffixes=function(){var t=n.prototype.getCssClassSuffixes.call(this),r=this.getServiceName();return r&&t.push(r),t},e}(yr),Ff=function(n){function e(t){var r=n.call(this,t)||this;return r.number="",r.plusSign=!1,r.number=t.number,r.plusSign=t.plusSign,r}return Mt(e,n),e.prototype.getType=function(){return"phone"},e.prototype.getPhoneNumber=function(){return this.number},e.prototype.getNumber=function(){return this.getPhoneNumber()},e.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},e.prototype.getAnchorText=function(){return this.matchedText},e}(yr),Ql=function(n){function e(t){var r=n.call(this,t)||this;return r.url="",r.urlMatchType="scheme",r.protocolUrlMatch=!1,r.protocolRelativeMatch=!1,r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.schemePrefixRegex=/^(https?:\/\/)?/i,r.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,r.protocolRelativeRegex=/^\/\//,r.protocolPrepended=!1,r.urlMatchType=t.urlMatchType,r.url=t.url,r.protocolUrlMatch=t.protocolUrlMatch,r.protocolRelativeMatch=t.protocolRelativeMatch,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return Mt(e,n),e.prototype.getType=function(){return"url"},e.prototype.getUrlMatchType=function(){return this.urlMatchType},e.prototype.getUrl=function(){var t=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(t=this.url="http://"+t,this.protocolPrepended=!0),t},e.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,"&")},e.prototype.getAnchorText=function(){var t=this.getMatchedText();return this.protocolRelativeMatch&&(t=this.stripProtocolRelativePrefix(t)),this.stripPrefix.scheme&&(t=this.stripSchemePrefix(t)),this.stripPrefix.www&&(t=this.stripWwwPrefix(t)),this.stripTrailingSlash&&(t=this.removeTrailingSlash(t)),this.decodePercentEncoding&&(t=this.removePercentEncoding(t)),t},e.prototype.stripSchemePrefix=function(t){return t.replace(this.schemePrefixRegex,"")},e.prototype.stripWwwPrefix=function(t){return t.replace(this.wwwPrefixRegex,"$1")},e.prototype.stripProtocolRelativePrefix=function(t){return t.replace(this.protocolRelativeRegex,"")},e.prototype.removeTrailingSlash=function(t){return t.charAt(t.length-1)==="/"&&(t=t.slice(0,-1)),t},e.prototype.removePercentEncoding=function(t){var r=t.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(r)}catch(i){return r}},e}(yr),br=function(n){this.__jsduckDummyDocProp=null,this.tagBuilder=n.tagBuilder},da=/[A-Za-z]/,vg=/[\d]/,yg=/[\D]/,mn=/\s/,ha=/['"]/,bg=/[\x00-\x1F\x7F]/,xf=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,Pf=xf+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\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\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,jo=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,Lg=Pf+jo,me=Pf+jo,kg="(?:["+jo+"]{1,3}\\.){3}["+jo+"]{1,3}",wg="["+me+"](?:["+me+"\\-]{0,61}["+me+"])?",Id=function(n){return"(?=("+wg+"))\\"+n},pa=function(n){return"(?:"+Id(n)+"(?:\\."+Id(n+1)+"){0,126}|"+kg+")"},ro=new RegExp("["+me+"]"),Bf=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,Mg=new RegExp("["+me+"!#$%&'*+/=?^_`{|}~-]"),Fg=new RegExp("^"+Bf.source+"$"),Nd=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.localPartCharRegex=Mg,t.strictTldRegex=Fg,t}return Mt(e,n),e.prototype.parseMatches=function(t){for(var r=this.tagBuilder,i=this.localPartCharRegex,o=this.strictTldRegex,s=[],a=t.length,l=new io,u={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},c=0,d=0,h=l;c<a;){var p=t.charAt(c);switch(d){case 0:f(p);break;case 1:m(t.charAt(c-1),p);break;case 2:E(p);break;case 3:A(p);break;case 4:D(p);break;case 5:_(p);break;case 6:S(p);break;case 7:R(p);break;default:kf(d)}c++}return L(),s;function f(g){g==="m"?v(1):i.test(g)&&v()}function m(g,O){g===":"?i.test(O)?(d=2,h=new io(ce(ce({},h),{hasMailtoPrefix:!0}))):I():u[g]===O||(i.test(O)?d=2:O==="."?d=3:O==="@"?d=4:I())}function E(g){g==="."?d=3:g==="@"?d=4:i.test(g)||I()}function A(g){g==="."||g==="@"?I():i.test(g)?d=2:I()}function D(g){ro.test(g)?d=5:I()}function _(g){g==="."?d=7:g==="-"?d=6:ro.test(g)||L()}function S(g){g==="-"||g==="."?L():ro.test(g)?d=5:L()}function R(g){g==="."||g==="-"?L():ro.test(g)?(d=5,h=new io(ce(ce({},h),{hasDomainDot:!0}))):L()}function v(g){g===void 0&&(g=2),d=g,h=new io({idx:c})}function I(){d=0,h=l}function L(){if(h.hasDomainDot){var g=t.slice(h.idx,c);/[-.]$/.test(g)&&(g=g.slice(0,-1));var O=h.hasMailtoPrefix?g.slice(7):g;(function(k){var w=k.split(".").pop()||"",U=w.toLowerCase();return o.test(U)})(O)&&s.push(new Zl({tagBuilder:r,matchedText:g,offset:h.idx,email:O}))}I()}},e}(br),io=function(n){n===void 0&&(n={}),this.idx=n.idx!==void 0?n.idx:-1,this.hasMailtoPrefix=!!n.hasMailtoPrefix,this.hasDomainDot=!!n.hasDomainDot},xg=function(){function n(){}return n.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},n.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return e.match(t)!==null},n.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},n.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),r=t&&t[0].toLowerCase();return r!=="javascript:"&&r!=="vbscript:"},n.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||e.indexOf(".")!==-1)},n.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&!this.hasFullProtocolRegex.test(t)&&!this.hasWordCharAfterProtocolRegex.test(e)},n.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,n.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,n.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+xf+"]"),n.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,n}(),Pg=(Cd=new RegExp("[/?#](?:["+me+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+me+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,pa(2),")","|","(","(//)?",/(?:www\.)/.source,pa(6),")","|","(","(//)?",pa(10)+"\\.",Bf.source,"(?![-"+Lg+"])",")",")","(?::[0-9]+)?","(?:"+Cd.source+")?"].join(""),"gi")),Bg=new RegExp("["+me+"]"),vd=function(n){function e(t){var r=n.call(this,t)||this;return r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.matcherRegex=Pg,r.wordCharRegExp=Bg,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return Mt(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.stripPrefix,s=this.stripTrailingSlash,a=this.decodePercentEncoding,l=this.tagBuilder,u=[],c=function(){var h=r[0],p=r[1],f=r[4],m=r[5],E=r[9],A=r.index,D=m||E,_=t.charAt(A-1);if(!xg.isValid(h,p)||A>0&&_==="@"||A>0&&D&&d.wordCharRegExp.test(_))return"continue";if(/\?$/.test(h)&&(h=h.substr(0,h.length-1)),d.matchHasUnbalancedClosingParen(h))h=h.substr(0,h.length-1);else{var S=d.matchHasInvalidCharAfterTld(h,p);S>-1&&(h=h.substr(0,S))}var R=["http://","https://"].find(function(g){return!!p&&p.indexOf(g)!==-1});if(R){var v=h.indexOf(R);h=h.substr(v),p=p.substr(v),A+=v}var I=p?"scheme":f?"www":"tld",L=!!p;u.push(new Ql({tagBuilder:l,matchedText:h,offset:A,urlMatchType:I,url:h,protocolUrlMatch:L,protocolRelativeMatch:!!D,stripPrefix:o,stripTrailingSlash:s,decodePercentEncoding:a}))},d=this;(r=i.exec(t))!==null;)c();return u},e.prototype.matchHasUnbalancedClosingParen=function(t){var r,i=t.charAt(t.length-1);if(i===")")r="(";else if(i==="]")r="[";else{if(i!=="}")return!1;r="{"}for(var o=0,s=0,a=t.length-1;s<a;s++){var l=t.charAt(s);l===r?o++:l===i&&(o=Math.max(o-1,0))}return o===0},e.prototype.matchHasInvalidCharAfterTld=function(t,r){if(!t)return-1;var i=0;r&&(i=t.indexOf(":"),t=t.slice(i));var o=new RegExp("^((.?//)?[-."+me+"]*[-"+me+"]\\.[-"+me+"]+)").exec(t);return o===null?-1:(i+=o[1].length,t=t.slice(o[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(t)?i:-1)},e}(br),Hg=new RegExp("#[_"+me+"]{1,139}(?![_"+me+"])","g"),Ug=new RegExp("[^"+me+"]"),yd=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.matcherRegex=Hg,r.nonWordCharRegex=Ug,r.serviceName=t.serviceName,r}return Mt(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.nonWordCharRegex,s=this.serviceName,a=this.tagBuilder,l=[];(r=i.exec(t))!==null;){var u=r.index,c=t.charAt(u-1);if(u===0||o.test(c)){var d=r[0],h=r[0].slice(1);l.push(new wf({tagBuilder:a,matchedText:d,offset:u,serviceName:s,hashtag:h}))}}return l},e}(br),jg=new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source+"|"+/(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source,"g"),bd=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.matcherRegex=jg,t}return Mt(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.tagBuilder,s=[];(r=i.exec(t))!==null;){var a=r[0],l=a.replace(/[^0-9,;#]/g,""),u=!(!r[1]&&!r[2]),c=r.index==0?"":t.substr(r.index-1,1),d=t.substr(r.index+a.length,1),h=!c.match(/\d/)&&!d.match(/\d/);this.testMatch(r[3])&&this.testMatch(a)&&h&&s.push(new Ff({tagBuilder:o,matchedText:a,offset:r.index,number:l,plusSign:u}))}return s},e.prototype.testMatch=function(t){return yg.test(t)},e}(br),$g=new RegExp("@[_"+me+"]{1,50}(?![_"+me+"])","g"),zg=new RegExp("@[_."+me+"]{1,30}(?![_"+me+"])","g"),Vg=new RegExp("@[-_."+me+"]{1,50}(?![-_"+me+"])","g"),Yg=new RegExp("[^"+me+"]"),Ld=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.matcherRegexes={twitter:$g,instagram:zg,soundcloud:Vg},r.nonWordCharRegex=Yg,r.serviceName=t.serviceName,r}return Mt(e,n),e.prototype.parseMatches=function(t){var r,i=this.serviceName,o=this.matcherRegexes[this.serviceName],s=this.nonWordCharRegex,a=this.tagBuilder,l=[];if(!o)return l;for(;(r=o.exec(t))!==null;){var u=r.index,c=t.charAt(u-1);if(u===0||s.test(c)){var d=r[0].replace(/\.+$/g,""),h=d.slice(1);l.push(new Mf({tagBuilder:a,matchedText:d,offset:u,serviceName:i,mention:h}))}}return l},e}(br);function Gg(n,e){for(var t,r=e.onOpenTag,i=e.onCloseTag,o=e.onText,s=e.onComment,a=e.onDoctype,l=new Tt,u=0,c=n.length,d=0,h=0,p=l;u<c;){var f=n.charAt(u);switch(d){case 0:m(f);break;case 1:E(f);break;case 2:D(f);break;case 3:A(f);break;case 4:_(f);break;case 5:S(f);break;case 6:R(f);break;case 7:v(f);break;case 8:I(f);break;case 9:L(f);break;case 10:g(f);break;case 11:O(f);break;case 12:k(f);break;case 13:w();break;case 14:U(f);break;case 15:y(f);break;case 16:M(f);break;case 17:$(f);break;case 18:j(f);break;case 19:G(f);break;case 20:V(f);break;default:kf(d)}u++}function m(F){F==="<"&&K()}function E(F){F==="!"?d=13:F==="/"?(d=2,p=new Tt(ce(ce({},p),{isClosing:!0}))):F==="<"?K():da.test(F)?(d=3,p=new Tt(ce(ce({},p),{isOpening:!0}))):(d=0,p=l)}function A(F){mn.test(F)?(p=new Tt(ce(ce({},p),{name:ee()})),d=4):F==="<"?K():F==="/"?(p=new Tt(ce(ce({},p),{name:ee()})),d=12):F===">"?(p=new Tt(ce(ce({},p),{name:ee()})),W()):da.test(F)||vg.test(F)||F===":"||Y()}function D(F){F===">"?Y():da.test(F)?d=3:Y()}function _(F){mn.test(F)||(F==="/"?d=12:F===">"?W():F==="<"?K():F==="="||ha.test(F)||bg.test(F)?Y():d=5)}function S(F){mn.test(F)?d=6:F==="/"?d=12:F==="="?d=7:F===">"?W():F==="<"?K():ha.test(F)&&Y()}function R(F){mn.test(F)||(F==="/"?d=12:F==="="?d=7:F===">"?W():F==="<"?K():ha.test(F)?Y():d=5)}function v(F){mn.test(F)||(F==='"'?d=8:F==="'"?d=9:/[>=`]/.test(F)?Y():F==="<"?K():d=10)}function I(F){F==='"'&&(d=11)}function L(F){F==="'"&&(d=11)}function g(F){mn.test(F)?d=4:F===">"?W():F==="<"&&K()}function O(F){mn.test(F)?d=4:F==="/"?d=12:F===">"?W():F==="<"?K():(d=4,u--)}function k(F){F===">"?(p=new Tt(ce(ce({},p),{isClosing:!0})),W()):d=4}function w(F){n.substr(u,2)==="--"?(u+=2,p=new Tt(ce(ce({},p),{type:"comment"})),d=14):n.substr(u,7).toUpperCase()==="DOCTYPE"?(u+=7,p=new Tt(ce(ce({},p),{type:"doctype"})),d=20):Y()}function U(F){F==="-"?d=15:F===">"?Y():d=16}function y(F){F==="-"?d=18:F===">"?Y():d=16}function M(F){F==="-"&&(d=17)}function $(F){d=F==="-"?18:16}function j(F){F===">"?W():F==="!"?d=19:F==="-"||(d=16)}function G(F){F==="-"?d=17:F===">"?W():d=16}function V(F){F===">"?W():F==="<"&&K()}function Y(){d=0,p=l}function K(){d=1,p=new Tt({idx:u})}function W(){var F=n.slice(h,p.idx);F&&o(F,h),p.type==="comment"?s(p.idx):p.type==="doctype"?a(p.idx):(p.isOpening&&r(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),Y(),h=u+1}function ee(){var F=p.idx+(p.isClosing?2:1);return n.slice(F,u).toLowerCase()}h<u&&(t=n.slice(h,u),o(t,h),h=u+1)}var Tt=function(n){n===void 0&&(n={}),this.idx=n.idx!==void 0?n.idx:-1,this.type=n.type||"tag",this.name=n.name||"",this.isOpening=!!n.isOpening,this.isClosing=!!n.isClosing},Xg=function(){function n(e){e===void 0&&(e={}),this.version=n.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(e.urls),this.email=typeof e.email=="boolean"?e.email:this.email,this.phone=typeof e.phone=="boolean"?e.phone:this.phone,this.hashtag=e.hashtag||this.hashtag,this.mention=e.mention||this.mention,this.newWindow=typeof e.newWindow=="boolean"?e.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(e.stripPrefix),this.stripTrailingSlash=typeof e.stripTrailingSlash=="boolean"?e.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=typeof e.decodePercentEncoding=="boolean"?e.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=e.sanitizeHtml||!1;var t=this.mention;if(t!==!1&&t!=="twitter"&&t!=="instagram"&&t!=="soundcloud")throw new Error("invalid `mention` cfg - see docs");var r=this.hashtag;if(r!==!1&&r!=="twitter"&&r!=="facebook"&&r!=="instagram")throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(e.truncate),this.className=e.className||this.className,this.replaceFn=e.replaceFn||this.replaceFn,this.context=e.context||this}return n.link=function(e,t){return new n(t).link(e)},n.parse=function(e,t){return new n(t).parse(e)},n.prototype.normalizeUrlsCfg=function(e){return e==null&&(e=!0),typeof e=="boolean"?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:typeof e.schemeMatches!="boolean"||e.schemeMatches,wwwMatches:typeof e.wwwMatches!="boolean"||e.wwwMatches,tldMatches:typeof e.tldMatches!="boolean"||e.tldMatches}},n.prototype.normalizeStripPrefixCfg=function(e){return e==null&&(e=!0),typeof e=="boolean"?{scheme:e,www:e}:{scheme:typeof e.scheme!="boolean"||e.scheme,www:typeof e.www!="boolean"||e.www}},n.prototype.normalizeTruncateCfg=function(e){return typeof e=="number"?{length:e,location:"end"}:function(t,r){for(var i in r)r.hasOwnProperty(i)&&t[i]===void 0&&(t[i]=r[i]);return t}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},n.prototype.parse=function(e){var t=this,r=["a","style","script"],i=0,o=[];return Gg(e,{onOpenTag:function(s){r.indexOf(s)>=0&&i++},onText:function(s,a){if(i===0){var l=function(c,d){if(!d.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var h,p=[],f=0;h=d.exec(c);)p.push(c.substring(f,h.index)),p.push(h[0]),f=h.index+h[0].length;return p.push(c.substring(f)),p}(s,/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),u=a;l.forEach(function(c,d){if(d%2==0){var h=t.parseText(c,u);o.push.apply(o,h)}u+=c.length})}},onCloseTag:function(s){r.indexOf(s)>=0&&(i=Math.max(i-1,0))},onComment:function(s){},onDoctype:function(s){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o)},n.prototype.compactMatches=function(e){e.sort(function(l,u){return l.getOffset()-u.getOffset()});for(var t=0;t<e.length-1;t++){var r=e[t],i=r.getOffset(),o=r.getMatchedText().length,s=i+o;if(t+1<e.length){if(e[t+1].getOffset()===i){var a=e[t+1].getMatchedText().length>o?t:t+1;e.splice(a,1);continue}e[t+1].getOffset()<s&&e.splice(t+1,1)}}return e},n.prototype.removeUnwantedMatches=function(e){return this.hashtag||fn(e,function(t){return t.getType()==="hashtag"}),this.email||fn(e,function(t){return t.getType()==="email"}),this.phone||fn(e,function(t){return t.getType()==="phone"}),this.mention||fn(e,function(t){return t.getType()==="mention"}),this.urls.schemeMatches||fn(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="scheme"}),this.urls.wwwMatches||fn(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="www"}),this.urls.tldMatches||fn(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="tld"}),e},n.prototype.parseText=function(e,t){t===void 0&&(t=0),t=t||0;for(var r=this.getMatchers(),i=[],o=0,s=r.length;o<s;o++){for(var a=r[o].parseMatches(e),l=0,u=a.length;l<u;l++)a[l].setOffset(t+a[l].getOffset());i.push.apply(i,a)}return i},n.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var t=this.parse(e),r=[],i=0,o=0,s=t.length;o<s;o++){var a=t[o];r.push(e.substring(i,a.getOffset())),r.push(this.createMatchReturnVal(a)),i=a.getOffset()+a.getMatchedText().length}return r.push(e.substring(i)),r.join("")},n.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),typeof t=="string"?t:t===!1?e.getMatchedText():t instanceof sl?t.toAnchorString():e.buildTag().toAnchorString()},n.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new yd({tagBuilder:e,serviceName:this.hashtag}),new Nd({tagBuilder:e}),new bd({tagBuilder:e}),new Ld({tagBuilder:e,serviceName:this.mention}),new vd({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},n.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new Rd({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},n.version="3.14.3",n.AnchorTagBuilder=Rd,n.HtmlTag=sl,n.matcher={Email:Nd,Hashtag:yd,Matcher:br,Mention:Ld,Phone:bd,Url:vd},n.match={Email:Zl,Hashtag:wf,Match:yr,Mention:Mf,Phone:Ff,Url:Ql},n}();function Hf(n,e=n){return{type:"autolink",url:n,text:e}}const Kg=()=>Wt(/```([^]+?)```/g,([n,e])=>({type:"codespan",text:bf(e)})),Wg=Wt(/<!!mention:([^>\s]*?)\|(.*?)>/gm,([n,e,t])=>function(r,i){return{type:"mention",id:r,text:i}}(decodeURIComponent(e),t)),Jg=Wt(/<!!customemoji:(.*?)>/gm,([n,e])=>function(t){return{type:"customemoji",text:t}}(e)),Uf=Wt(/<((?:https?|mailto):.*?)\|(.*?)>/gi,([n,e,t])=>function(r,i=[]){return{type:"link",url:r,children:i}}(e,[t])),qg=Wt(/<actionlink:([^|]+)[|]([^>]*)>/gi,([n,e,t])=>{const{action:r,params:i}=jf(e);return function(o,s,a=[]){return{type:"actionlink",action:o,params:s,children:a}}(r,i,[t])}),Zg=Wt(/<actionbutton:([^|]+)[|]([^>]*)>/gi,([n,e,t])=>{const{action:r,params:i}=jf(e);return function(o,s,a=[]){return{type:"actionbutton",action:o,params:s,children:a}}(r,i,[t])});function jf(n){const e=n.indexOf("?");return e===-1?{action:n,params:{}}:{action:n.slice(0,e),params:Object.fromEntries(new URLSearchParams(n.slice(e)))}}const Qg=Wt(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g,([n])=>function(e=[]){return{type:"bulletlist",children:e}}([n.startsWith(`
1197
- `)?n.slice(1):n])),eD=Wt(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm,([n,e])=>({type:"bulletpoint",children:[e]})),$f=n=>{const e=/(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;let t=0;const r=[];for(const i of cs(n,e)){const o=i[0],s=i[1],a=o.startsWith(s)?i.index:i.index+1;a-t>0&&r.push(n.substring(t,a));const l=Hf("tel:"+s.replace(/[^0-9+]/g,""),s);r.push(l),t=a+s.length}return t<n.length&&r.push(n.substring(t)),r},zf=n=>Uf(n).flatMap(e=>typeof e=="string"?fa(e):["<",...fa(e.url),...fa("|"+e.children[0]+">")]),fa=n=>{const e=Xg.parse(n,{urls:!0,email:!0,phone:!1,hashtag:!1,mention:!1}),t=[];let r=0;for(const i of e){const o=i.getOffset(),s=i.getMatchedText(),a=s.length;let l=s;i instanceof Zl?l="mailto:"+i.getEmail():i instanceof Ql&&(l=i.getUrl()),o>r&&t.push(n.substring(r,o)),t.push(Hf(l,s)),r=o+a}return r<n.length&&t.push(n.substring(r)),t},tD=["Codeblock","Codespan","FormattedLink","Wikitext","Autolink","Actions","Mention","Mention","BulletPoint","CustomEmoji"],nD=function(n){const e=RegExp(`[^${n}]+${n}?|${n}`,"g");return t=>Array.from(t.match(e)||[])}(`
1198
- `);function Vf(n,e={except:[]}){const t=function(i={except:[]}){var a;const o={multilineSteps:[],singlelineSteps:[]},s=(a=i.except)!=null?a:tD.filter(l=>!i.only.includes(l));return s.includes("BulletPoint")||o.multilineSteps.push(Qg,eD),s.includes("Mention")||o.singlelineSteps.push(Wg),s.includes("CustomEmoji")||o.singlelineSteps.push(Jg),s.includes("Codespan")||o.multilineSteps.push(Kg()),s.includes("FormattedLink")||o.singlelineSteps.push(Uf),s.includes("Actions")||(o.singlelineSteps.push(qg),o.singlelineSteps.push(Zg)),s.includes("Wikitext")||o.singlelineSteps.push(Ig),s.includes("Autolink")||o.singlelineSteps.push(zf,$f),o}(e);let r=Yf(n,t);return r=Gf(r,!1),r}function Yf(n,e){let t=[n];return t=ma(t,e.multilineSteps),t=ma(t,[nD]),t=ma(t,e.singlelineSteps),t=eu(t),t}function ma(n,e){return e.reduce((t,r)=>mi(t,r),n)}function eu(n){const e=[];let t=-1;for(const r of n)typeof r=="string"?typeof e[t]=="string"?e[t]+=r:e[++t]=r:e[++t]="children"in r?{...r,children:eu(r.children)}:r;return e}function Gf(n,e){const t=[];let r=[];for(let i=0;i<n.length;i++){const o=n[i];if(typeof o=="string")r.push(o);else if("children"in o){r.length>0&&(t.push(r.join("")),r=[]);const s=Gf(o.children,e||o.type==="link"||o.type==="actionbutton"||o.type==="actionlink");t.push({...o,children:s})}else o.type==="autolink"&&e?r.push(o.text):(r.length>0&&(t.push(r.join("")),r=[]),t.push(o))}return r.length>0&&(t.push(r.join("")),r=[]),t}function rD(){let n,e=0;return t=>{const r=(o=Date.now())=>{if(window.clearTimeout(n),n=void 0,e=o,t.isDestroyed)return;const s=function(a){a=a.removeMark(0,a.doc.content.size,Se.marks.bold),a=a.removeMark(0,a.doc.content.size,Se.marks.italic),a=a.removeMark(0,a.doc.content.size,Se.marks.strikethrough),a.doc.firstChild;const l=function(u){const c=[];let d,h="";return u.descendants((p,f)=>(p.isText?(h+=p.text,d!=null||(d=f)):h&&d!==void 0&&(c.push({text:h,pos:d}),h="",d=void 0),p.type!==Se.nodes.mention)),h&&d!==void 0&&c.push({text:h,pos:d}),c}(a.doc);for(const{text:u,pos:c}of l){const d=Vf(u,{only:["Wikitext"]});[a]=Xf(a,c,d)}return a}(t.state.tr);t.dispatch(s)},i=Date.now();i-e<300?n||(n=window.setTimeout(r,300)):r(i)}}function Xf(n,e,t,r=0,i=[]){for(const o of t)if(typeof o=="string"){for(const s of i)n.addMark(e+r,e+r+o.length,s.create());r+=o.length}else if(o.type==="bold"||o.type==="italic"||o.type==="strikethrough"){r+=1;const s=Se.marks[o.type],a=[...i,s];[n,r]=Xf(n,e,o.children,r,a),r+=1}else le.unreachable();return[n,r]}function kd(n){return(e,t)=>{if(!t)return!0;let r=e.tr;const i=ne.between(e.selection.$from,e.selection.$to);return r=r.replaceRangeWith(i.from,i.from,Se.text(n,r.storedMarks)),r=r.replaceRangeWith(i.to+1,i.to+1,Se.text(n,r.storedMarks)),r=r.setSelection(ne.near(r.doc.resolve(i.to+1))),t(r),!0}}function iD(n,e,t){const r=e.clipboardData;if(!r)return!1;const i=function(o){const s=o.items||[],a={"image/gif":"gif","image/png":"png","image/jpeg":"jpg","image/svg+xml":"svg"},l=Array.from(s).filter(d=>d.kind==="file"&&a[d.type]);if(l.length===0||o.types.includes("text/rtf"))return;const u=l[0];let c=u.getAsFile();if(!c.name){const d="image."+a[u.type];c=new File([c],d,{type:u.type,lastModified:Date.now()})}return c}(r);return i?t(i):function(o,s){const a=o.state.tr.insertText(s).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");o.dispatch(a)}(n,r.getData("text/plain")),!0}function oD(n,{allowSpaces:e=!1}){return t=>{const r=new RegExp(`\\s${n}$`),i=e?new RegExp(`${n}.*?(?=\\s${n}|$)`,"g"):new RegExp(`(?:^)?${n}[^\\s${n}]*`,"g"),o=t.before(),s=t.end(),a=t.doc.textBetween(o,s,"\0","\0");let l;for(;l=i.exec(a);){const u=l.input.slice(Math.max(0,l.index-1),l.index);if(!/^[\s\0]?$/.test(u))continue;const c=l.index+t.start();let d=c+l[0].length;if(e&&r.test(a.slice(d-1,d+1))&&(l[0]+=" ",d++),c<t.pos&&d>=t.pos)return{range:{from:c,to:d},text:l[0]}}}}function wd({matcher:n=oD("#"),suggestionClass:e="ProseMirror-suggestion",onEnter:t=()=>!1,onChange:r=()=>!1,onExit:i=()=>!1,onKeyDown:o=()=>!1,debug:s=!1}){return new ps({key:new fs("suggestions"),view(){return{update:(a,l)=>{const u=this.key.getState(l),c=this.key.getState(a.state),d=u.active&&c.active&&u.range.from!==c.range.from,h=!u.active&&c.active,p=u.active&&!c.active,f=!h&&!p&&u.text!==c.text;(p||d)&&i({view:a,range:u.range,text:u.text}),f&&!d&&r({view:a,range:c.range,text:c.text}),(h||d)&&t({view:a,range:c.range,text:c.text})}}},state:{init:()=>({active:!1,range:{},text:null}),apply(a,l){const{selection:u}=a,c={...l};if(u.from===u.to){(u.from<l.range.from||u.from>l.range.to)&&(c.active=!1);const d=u.$from,h=n(d);h?(c.active=!0,c.range=h.range,c.text=h.text):c.active=!1}else c.active=!1;return c.active||(c.range={},c.text=null),c}},props:{handleKeyDown(a,l){const{active:u}=this.getState(a.state);return!!u&&o({view:a,event:l})},decorations(a){const{active:l,range:u}=this.getState(a);return l?Ee.create(a.doc,[it.inline(u.from,u.to,{nodeName:"span",class:e,style:s?"background: rgba(0, 0, 255, 0.05); color: blue; border: 2px solid blue;":null})]):null}}})}function Kf({placeholder:n,disabled:e,className:t="",characterLimit:r,spellcheck:i}){const o=xi(),s=T.useRef(),a=T.useRef(null);return T.useEffect(()=>(s.current=function(l,u,c,d,h){const p=tr.create({schema:Se,plugins:[...h.filter(sD),Ag(),hd({...no,"Mod-z":_f,"Mod-y":Sf,"Mod-b":kd("*"),"Mod-i":kd("_"),"Mod-Enter":no.Enter,"Shift-Enter":no.Enter,Enter:c}),hd({Enter:no.Enter}),ud]}),f=rD(),m=new og(l,{handlePaste:(E,A,D)=>iD(E,A,d),clipboardTextSerializer(E){const A=[];return E.content.forEach(D=>{D&&A.push(bf(D.textContent))}),A.join()},state:p,dispatchTransaction(E){E=(E=E.removeStoredMark(Se.marks.literal)).removeStoredMark(Se.marks.emoji);const A=m.state.apply(E);m.state.doc.eq(A.doc)||u(new $o(A.doc)),m.updateState(A),E.steps.some(D=>D instanceof ht)&&f(m)}});return m}(a.current,l=>o.onChange(l),()=>!!o.onEnter&&(o.onEnter(),!0),l=>o.onPasteImage(l),[o.emojiSuggesterPlugin(),o.mentionsPlugin()]),o.setEditorView(s.current),()=>{var l;o.setEditorView(void 0),(l=s.current)==null||l.destroy()}),[o]),T.useEffect(()=>{var l;(l=s.current)==null||l.setProps({editable:()=>!e})},[e]),T.useEffect(()=>Oi(()=>{var l,u,c;return(c=s.current)==null?void 0:c.setProps({attributes:{spellcheck:String((u=(l=o.spellcheck$.get())!=null?l:i)!=null?u:!1),class:"t-text-input","aria-label":"Message Field",role:"textbox"}})}),[o,i]),T.useEffect(()=>Oi(()=>{var u;const l=s.current;l==null||l.dispatch(l.state.tr.setMeta(ud,(u=o.placeholder$.get())!=null?u:n))}),[o,n]),T.useEffect(()=>{r&&Number.isInteger(r)&&o.setMaxLength(r)},[r,o]),N.jsx("div",{className:`t-editor ${t}`,ref:a})}function Md(n){if(n.startsWith(":"))throw new Error("Not implemented");{const e=Se.marks.emoji.create({emoji:n});return Se.text(n,[e])}}function Fd(n,e){const t=encodeURIComponent(n);return Se.nodes.mention.create({id:n,name:e},Se.text(`<!!mention:${t}|${e}>`))}const ts=class ts{constructor(e){this.doc=e,this.size=this.doc.content.size,this.hasContent=hf(this.doc)}hasNonWhitespaceContent(){return this.hasContent&&function(e){let t=!1;return e.descendants(r=>!(r.isText&&r.text&&/\S/.test(r.text))||(t=!0,!1)),t}(this.doc)}asText(){return this.doc.textContent.replace(/\xa0/g," ")}};ts.EMPTY=new ts(Se.topNodeType.create());let $o=ts;function sD(n){return n!=null}const xd=(n,e)=>t=>{var l;const r=(l=t.nodeBefore)==null?void 0:l.text;if(!r)return;const i=r.match(n);if(!i)return;const o=i[2],s=t.pos-o.length,a=t.pos;if(!t.doc.rangeHasMark(s,a,e.marks.literal))return{range:{from:s,to:a},text:o}},aD=/(^|\s)(:[^:\s]+:?)$/,lD=/(^|\s)(@[^@]*)$/;class Wf{constructor(e,t,r){this.state$=e,this.device$=t,this.userPermissions$=r,this.currentDoc=$o.EMPTY,this.maxLength=1e4,this.markAsTyping=function(i,o){let s=!1;return(...a)=>{if(!s)return s=!0,setTimeout(()=>{s=!1},o),i(...a)}}(()=>{var i;(i=this.controller)==null||i.markAsTyping()},5e3),this._suggesterKeydownHandlers={emoji:void 0,mention:void 0},this.toggleEmojiPicker=i=>{const o=this.state$.showEmojiPicker;i!=null||(i=!o.peek()),o.set(i),i===!1&&this.focus()},this.spellcheck$=pe(),this.placeholder$=pe()}setEditorView(e){this.editorView=e}emojiSuggesterPlugin(){if(this.device$.peek().supportsEmojiPicker)return wd({debug:!1,matcher:xd(aD,Se),onEnter:e=>this.suggestEmoji(e.text,e.range),onChange:e=>this.suggestEmoji(e.text,e.range),onExit:()=>this.onExitSuggester(),onKeyDown:({event:e})=>{var t,r,i;return(i=(r=(t=this._suggesterKeydownHandlers).emoji)==null?void 0:r.call(t,e.key))!=null?i:!1}})}mentionsPlugin(){const e=this.userPermissions$.peek();if(le.defined(e),e.canMention)return wd({debug:!1,matcher:xd(lD,Se),onEnter:t=>this.suggestMention(t.text,t.range),onChange:t=>this.suggestMention(t.text,t.range),onExit:()=>this.onExitSuggester(),onKeyDown:({event:t})=>{var r,i,o;return(o=(i=(r=this._suggesterKeydownHandlers).mention)==null?void 0:i.call(r,t.key))!=null?o:!1}})}closeSuggester(){le.defined(this._suggestionRange),function(e,t){const{from:r,to:i}=t,o=e.state.tr.addMark(r,i,Se.marks.literal.create());e.dispatch(o)}(this.editorView,this._suggestionRange)}listenKeydown(e,t){this._suggesterKeydownHandlers[e]=t}onExitSuggester(){this._suggestionRange=void 0,this.state$.suggestEmojiQuery.set(void 0),this.state$.suggestMentionQuery.set(void 0)}suggestEmoji(e,t){e.length<2||(this._suggestionRange=t,this.state$.suggestEmojiQuery.set(e))}suggestMention(e,t){e.length<1||(this._suggestionRange=t,this.state$.suggestMentionQuery.set(e))}onPasteImage(e){le.defined(this.uploadFile),this.uploadFile(e)}onChange(e){var r;this.currentDoc=e;const t=e.size>this.maxLength&&e.asText().length>this.maxLength;e.hasContent&&this.markAsTyping(),this.state$.assign({isTyping:e.hasContent,atTextLimit:t,isEmpty:!e.hasNonWhitespaceContent(),characterCount:e.size===0?0:e.size-2}),(r=this.controller)==null||r.storeDraft(()=>e.asText())}setMaxLength(e){this.maxLength=e}focus({skipProseMirrorStuff:e}={skipProseMirrorStuff:!1}){var t,r;e?(t=this.editorView)==null||t.dom.focus():(r=this.editorView)==null||r.focus()}setText(e){this.editorView&&function(t,r){const i=t.state.doc.content.size,o=r.split(/(<!!(?:mention|customemoji):.*?>)/g).filter(a=>a||a.length).map(a=>{const[l,u,c]=a.match(/<!!mention:(.*)\|(.*)>/)||[null];if(l&&u&&c)return Fd(u,c);const[d,h]=a.match(/<!!customemoji:(.*?)>/)||[null];return d&&h?Md(h):Se.text(a)}),s=t.state.tr.replaceWith(0,i,o);t.dispatch(s)}(this.editorView,e)}typeText(e){this.editorView&&function(t,r,i="replace"){const o=t.state.doc.content.size,s=i=="insert"?t.state.tr.insertText(r):t.state.tr.insertText(r,0,o);t.dispatch(s)}(this.editorView,e,"insert")}getText(){return this.currentDoc.asText().trim()}clearText(){this.editorView&&function(e){const t=e.state.doc.content.size,r=e.state.tr.insertText("",0,t);e.dispatch(r)}(this.editorView)}selectEmoji(e){le.defined(this.editorView),function(t,r,i){const o=Md(r);let s;if(i){const{from:a,to:l}=i;s=t.state.tr.replaceRangeWith(a,l,o)}else s=t.state.tr.replaceSelectionWith(o,!1);t.dispatch(s)}(this.editorView,e,this._suggestionRange),this.focus()}selectMention(e){le.defined(this.editorView),function(t,r,i){const o=Fd(r.id,r.name);let s=t.state.tr;if(i){const{from:a,to:l}=i;s=s.replaceRangeWith(a,l,o)}else s=s.replaceSelectionWith(o,!1);s=s.insertText(" "),t.dispatch(s)}(this.editorView,e,this._suggestionRange),this.focus()}}const uD=Symbol("no_render");function nt(n){const e=ft(!1),t=T.useRef({_value:typeof n=="function"?n():n.peek(),get value(){return setTimeout(()=>{e.set(!0)}),t.current._value},set value(r){t.current._value=r}});return Z(()=>{if(!e.get())return uD;const r=typeof n=="function"?n():n.get();return t.current.value=r,r}),t.current}function Lr(){const n=Pi(),e=ie(),t=ap(),r=Dt(),i=nt(e.app$.appMetadata),o=nt(e.currentUser$),s=nt(e.state$.currentConversation),a=nt(e.t$),l=nt(e.device$),u=nt(e.themeCustom$),c=nt(()=>e.state$.typing.child(e.state$.extCurrentConversationId.get()).get()),d=nt(()=>e.state$.participants.child(e.state$.extCurrentConversationId.get()).get());return T.useMemo(()=>({session:n,store:e,chatbox:t,theme:r,get app(){return i.value},get currentUser(){return o.value},get conversation(){return s.value},get t(){return a.value},get device(){return l.value},get themeCustom(){return u.value.value},get typing(){return c.value},get participants(){return d.value}}),[i,t,s,o,l,e,a,r,u,c,d,n])}function Jf(){const n=Pi(),e=ie(),t=Dt(),r=ap(),i=nt(e.app$.appMetadata),o=nt(e.currentUser$),s=nt(e.t$),a=nt(e.device$),l=nt(e.themeCustom$);return T.useMemo(()=>({session:n,store:e,theme:t,conversationList:r,get app(){return i.value},get currentUser(){return o.value},get t(){return s.value},get device(){return a.value},get themeCustom(){return l.value.value}}),[i,r,o,a,n,e,s,t,l])}const cD=(()=>{if(typeof window!="undefined"){let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),!0}catch(e){return e instanceof DOMException&&(e.code===22||e.code===1014||e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")&&n&&n.length!==0}}return!1})(),He={};cD?(He.setItem=window.localStorage.setItem.bind(window.localStorage),He.getItem=window.localStorage.getItem.bind(window.localStorage),He.removeItem=window.localStorage.removeItem.bind(window.localStorage),He.isSupported=!0):(He.setItem=function(){},He.getItem=function(){return null},He.removeItem=function(){},He.isSupported=!1),He.set=(n,e)=>He.setItem(n,JSON.stringify(e)),He.get=n=>JSON.parse(He.getItem(n)||"null");const ll="talkjs_drafts",dD=function(n,e){let t;return(...r)=>{clearTimeout(t),t=setTimeout(()=>e(...r),n)}}(200,(n,e,t,r)=>{const i=qf(n,e,t),o=JSON.parse(He.getItem(ll)||"{}"),s=r();s.match(/^\s*$/)?delete o[i]:o[i]=s,He.setItem(ll,JSON.stringify(o))}),qf=(n,e,t)=>`draft_${n}_${e}_${t}`;function Zf(n){const e=Dt(),t=ie(),r=Lr(),i=Z(t.referencedMessage$),o=Z(t.state$.userPermissions),s=xi(),{sendMessage:a}=JE(),l=Z(ft(()=>{const c=s.state$.get();return n.editMessageId===void 0?new sc(c,a,n.attachFile,n.shareLocation,s.toggleEmojiPicker):new sc(c,n.onEditMessage,()=>{},()=>{},()=>{})},[s.state$,s.toggleEmojiPicker,n.attachFile,n.editMessageId,n.onEditMessage,n.shareLocation,a])),u=T.useCallback(c=>s.setText(c),[s]);return function({appId:c,conversationId:d,meId:h,setText:p,enabled:f}){const m=T.useMemo(()=>qf(d,h,c),[c,d,h]);T.useEffect(()=>{var A;if(!m||!f)return;const E=(A=JSON.parse(He.getItem(ll)||"{}")[m])!=null?A:"";p(E)},[m,f,p])}({appId:r.app.id,conversationId:r.conversation.id,meId:r.currentUser.id,setText:u,enabled:!n.editMessageId}),N.jsx(lp.Provider,{value:{onClose:()=>s.toggleEmojiPicker(!1),onEmojiSelected:c=>s.selectEmoji(c)},children:N.jsx(e.MessageField,{common:r,referencedMessage:i,permissions:o,editor:l,editMessageId:n.editMessageId})})}function hD({message:n}){const e=ie(),t=Bi(),r=Z(e.state$.editingMessageId),i=T.useMemo(()=>Rt(n.content[0].children),[n]),o=ft({isEmpty:i.length===0,isTyping:!1,atTextLimit:!1,characterCount:i.length,showEmojiPicker:!1,suggestEmojiQuery:void 0,suggestMentionQuery:void 0}),s=T.useMemo(()=>new Wf(o,e.device$,e.state$.userPermissions),[o,e]),a=T.useCallback(async()=>{const l=s.state$;if(l.isEmpty.peek()||l.atTextLimit.peek())return;const u=s.getText();u&&await t.editMessage(n.id,{text:u}),e.state$.editingMessageId.set(null)},[e,t,s,n.id]);return T.useEffect(()=>{s.onEnter=a},[s,a]),T.useEffect(()=>{s.focus(),s.setText(Rt(n.content[0].children,!0))},[s,n]),N.jsx(tp.Provider,{value:s,children:N.jsx(Zf,{editMessageId:r,onEditMessage:a})})}function pD(){const n=Dt(),e=Lr();return N.jsx(n.MessageListFooter,{common:e})}function fD(n){const e=Dt(),t=Lr();return N.jsx(e.MessageDivider,{common:t,...n})}function mD({message:n}){const e=Dt(),t=ie(),r=Lr(),[i,o]=T.useState("sent");return Or(s=>{if(n.id.startsWith("ephemeral-"))return o("sending");const a=t.state$.currentConversation.everyoneReadUntil.get();return a!==void 0?n.createdAt<=a?o("everyoneRead"):o("sent"):void 0}),N.jsx(e.Message,{common:r,message:n,messageStatus:i,permissions:t.messagePermissions$(n).get()})}function ED({extConversationId:n}){const e=Pi(),t=ie(),r=Bi(),i=T.useRef(!0),o=T.useRef(null);T.useLayoutEffect(()=>{i.current=o.current.scrollTop>-30}),T.useEffect(()=>{i.current&&(o.current.scrollTop=0)}),T.useEffect(()=>{const c=new IntersectionObserver(d=>t.state$.visibility.isInView.set(d[0].isIntersecting),{threshold:.9});return c.observe(o.current),()=>c.disconnect()},[t]),T.useEffect(()=>{const c=()=>t.state$.visibility.tabFocused.set(!document.hidden);return document.addEventListener("visibilitychange",c),()=>document.removeEventListener("visibilitychange",c)},[t]);const[s,a]=T.useState(!1);T.useEffect(()=>{a(!1);const c=t.state$.currentConversation.peek();(c==null?void 0:c.isUnread)===!0&&e.conversation(n).markAsRead().catch(d=>{Lo.warn("Could not mark conversation as read",d)})},[n,e,t]),Or(c=>{if(!o.current)return;const d=t.state$.currentConversation.get(),h=!(!d||!d.isUnread),p=d==null?void 0:d.unreadMessageCount;if(h&&p===0)return void a(!0);if(h&&s)return;if(!h)return void a(!1);const f=t.state$.visibility.tabFocused.get(),m=t.state$.visibility.isInView.get(),E=function(A){if(A.checkVisibility)return A.checkVisibility({contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0,checkOpacity:!0,checkVisibilityCSS:!0});{const D=window.getComputedStyle(A),_=D.visibility,S=D.opacity;return!(A.getClientRects().length===0||_==="hidden"||S==="0")}}(o.current);return f&&m&&E?e.conversation(d.id).markAsRead():void 0});const l=T.useCallback(c=>{const d=c.currentTarget;d.scrollHeight-d.clientHeight+d.scrollTop<90&&t.messageSubscription&&t.messageSubscription.loadMore(10)},[t.messageSubscription]),u=Z(t.state$.typing.child(n));return N.jsxs("div",{className:"t-message-list",ref:o,"t-menu-boundary":"",onScroll:l,children:[u&&N.jsx(pD,{}),N.jsx(wa,{each:t.chatItems$,children:c=>N.jsx("div",{className:"t-message-group",children:N.jsx(wa,{each:c,item:AD,itemProps:{controller:r,extConversationId:n}})})})]})}function AD({item$:n}){const e=ie(),t=Z(n),r=Z(e.state$.editingMessageId);return t instanceof Fa?N.jsx(fD,{timestamp:t.timestamp,isReadMarker:t.isReadMarker,isDayMarker:t.isDayMarker}):r===t.id?N.jsx(hD,{message:t}):N.jsx(mD,{message:t})}function zo(n){const e=ie()instanceof Ap?gD:DD;return N.jsx(e,{...n})}function gD(n){const e=Dt(),t=Lr();return N.jsx(e.Icon,{common:t,...n})}function DD(n){const e=Dt(),t=Jf();return N.jsx(e.Icon,{common:t,...n})}function tu(){const n=Z(ie().t$);return N.jsx(zo,{type:"spinner","aria-label":n.LOADING,className:"t-loading-icon"})}const OD=new Set(["ByV39eoc","B1FxElnd","aW4c49tW","qGfuGtx","SbERe5ee","ilaVEa15","FOlWOSaH","dao5gGmT","DLUgAhzL","fqXFumr6","FtiWHMYT","66iWOyWt","1375amYi","mWbJgzpt","jO7GqAvL","SkFIKxo5","2z4ILc3y","aDr8oPL1","Hku1c4Pt"]);function As({appId:n,chatboxState:e}){const t=n.charAt(0)==="t"||OD.has(n);return T.useEffect(()=>{switch(e.type){case"auth-failed":zt.error("Could not authenticate user. Check if you are authenticating correctly.");break;case"unknown-user":zt.error(`User \`${e.userId}\` not found. Please verify that you synchronized this user's data with TalkJS, either using the JS SDK or through the REST API.`);break;case"unexpected-error":zt.error(e.error);break;case"wrong-app-id":zt.error(`Could not find given appId: "${e.appId}". You can find your appId on https://talkjs.com/dashboard.`);break;case"server-error":break;default:le.never(e)}},[e]),N.jsxs("div",{className:"t-panel t-error-panel",children:[N.jsx("span",{className:"t-heading",children:"Something went wrong."}),N.jsx("p",{children:"Please reload the page and try again."}),t?N.jsxs("p",{style:{fontStyle:"italic"},children:["Developer note: check your browser's developer tools console for messages that may help solve the problem.",N.jsx("br",{}),N.jsx("small",{children:"This message only shows up in test mode."})]}):N.jsx("p",{children:"If things keep not working, do not hesitate to get in touch with us."})]})}function _D(){const n=Z(ie().t$);return N.jsx("div",{className:"t-panel t-error-panel",children:N.jsx("span",{className:"t-heading",style:{fontStyle:"italic"},children:n.CHAT_NOT_FOUND})})}function Qf(){return N.jsx("div",{className:"t-panel t-loading-panel",children:N.jsx(tu,{})})}function em(){const n=Z(ie().t$);return N.jsxs("div",{className:"t-panel t-error-panel",children:[N.jsx("span",{className:"t-heading",style:{fontStyle:"italic"},children:n.AUTH_EXPIRED_OVERLAY_TITLE}),N.jsx("p",{children:n.AUTH_EXPIRED_OVERLAY_DESCRIPTION})]})}const SD=()=>!0;async function nu(n,e,{initialDelay:t,maxDelay:r,log:i,shouldRetry:o=SD}){return e().catch(async s=>{if(i&&i(`[TalkJS] Retries left: ${n}. Error: ${JSON.stringify(s)}.`),n===0||!await o(s))throw s;const a=1e3*t*1.2,l=r?Math.min(1e3*r,a):a,u=l*(1-(c=.05)+2*Math.random()*c);var c,d;return(d=u,d<=0?Promise.resolve():new Promise(h=>setTimeout(h,d))).then(()=>nu(n-1,e,{initialDelay:u/1e3,maxDelay:r,log:i,shouldRetry:o}))})}function Ii(){const n={},e=new Promise(function(t,r){n.resolve=t,n.reject=r});return n.promise=e,n}function TD(n,e,t){const{beforeBrowserPermissionPrompt:r,onMissingBrowserPermissionCallback:i}=T.useContext(np);return T.useCallback(async()=>{function o(c){c==="denied"&&i({type:n})}if(!r||!await async function(c){if(!("permissions"in navigator))return!1;const d=c;try{return(await navigator.permissions.query({name:d})).state==="prompt"}catch(h){return!1}}(n))return e(c=>{o(c)});const s=Ii(),a=Ii(),l={type:n,showPrompt:async()=>(a.resolve({cancelled:!1}),await s.promise),cancel:()=>{a.resolve({cancelled:!0})}};try{r(l)}catch(c){zt.error("Your beforeBrowserPermissionPrompt callback threw an error: ",c),a.resolve({cancelled:!0})}const{cancelled:u}=await a.promise;return u?void 0:e(c=>{s.resolve(c),o(c)})},[r,i,n,e,...t])}function RD({onClose:n}){const e=ie(),t=Bi(),r=Pi(),[i,o]=T.useState(null),s=T.useCallback(async l=>{try{if(l||(l=(await new Promise(m=>{const E=document.createElement("input");E.type="file",E.multiple=!1,E.addEventListener("change",()=>{m([...E.files])}),E.addEventListener("cancel",()=>{m([])}),E.click()}))[0]),!l)return;const{uploadPromise:u,upload:c}=await async function(m,E){const A=m.name;if(function(R){return/\.(mp4|ts|mov|webm|ogv)$/i.test(R)}(m.name)){const R=await Ea("video",m,L=>({width:L.videoWidth,height:L.videoHeight,duration:L.duration,filename:A})),v=E.uploadVideo(m,R),I=function(L){switch(L.name.split(".").pop()){case"ts":return"video/MP2T";case"mov":return"video/quicktime";case"webm":return"video/webm";case"ogv":return"video/ogg";default:return"video/mp4"}}(m);return{uploadPromise:v,upload:{type:"video",file:m,metadata:R,temporaryBlobUrl:URL.createObjectURL(new Blob([m],{type:I}))}}}if(function(R){return/\.(mp3|m4a|ogg|oga|opus|flac|wav)$/i.test(R)}(m.name)){const R=await Ea("audio",m,v=>({duration:v.duration,filename:A}));return{uploadPromise:E.uploadAudio(m,R),upload:{type:"audio",file:m,metadata:R,temporaryBlobUrl:URL.createObjectURL(new Blob([m]))}}}if(function(R){return/(gif|png|jpg|jpeg|svg|bmp|webp)$/i.test(R)}(m.name)){const R=await Ea("img",m,v=>({width:v.naturalWidth,height:v.naturalHeight,filename:A}));return{uploadPromise:E.uploadImage(m,R),upload:{type:"image",file:m,metadata:R,temporaryBlobUrl:URL.createObjectURL(new Blob([m]))}}}const D={filename:A},_=E.uploadFile(m,D),S=URL.createObjectURL(new Blob([m]));return{uploadPromise:_,upload:{type:"file",file:m,metadata:D,temporaryBlobUrl:S}}}(l,r),d=c.file.size+","+c.file.name;e.state$.localFileBlobUrls.child(e.state$.extCurrentConversationId.peek()).child(d).set({url:c.temporaryBlobUrl,fetching:!1}),e.latestFileUpload=c;const h=Ii(),p={upload:c,closePreview:h.resolve,uploaded:!1,errored:!1};let f;o(p);try{f=await Pd(u,h.promise),o({...p,uploaded:!0})}catch(m){if(m===ul)return;zt.warn("File upload failed",m.toString()),o(E=>({...E,errored:!0}))}if(await h.promise==="cancel")return;le.defined(f),t.sendFileMessage({fileToken:f})}finally{n(),o(null)}},[t,r,o,e,n]),a=TD("geolocation",async l=>{try{const u=Ii(),c={upload:{type:"location",location:void 0},uploaded:!1,closePreview:u.resolve,errored:!1};o(c);const{permissionResult:d,location:h}=await Pd(new Promise(p=>{navigator.geolocation.getCurrentPosition(f=>{const m={latitude:f.coords.latitude,longitude:f.coords.longitude};p({permissionResult:"granted",location:m})},f=>{f.code===1?p({permissionResult:"denied"}):p({permissionResult:"granted"})})}),u.promise);if(l(d),!h||(o({...c,upload:{type:"location",location:h},uploaded:!0}),await u.promise==="cancel"))return;t.sendLocationMessage({location:h})}catch(u){if(u===ul)return;throw u}finally{n(),o(null)}},[t,o,n]);return{attachFile:s,shareLocation:a,uploadState:i}}const ul=Symbol("cancelled");function Pd(n,e){return Promise.race([n,e.then(()=>Promise.reject(ul))])}async function Ea(n,e,t){const r=document.createElement(n);try{return r.src=URL.createObjectURL(e),await new Promise((i,o)=>{const s=n==="img"?"load":"loadedmetadata";r.addEventListener(s,()=>{try{i(t(r))}catch(a){o(a)}},{once:!0})})}finally{URL.revokeObjectURL(r.src)}}var tm=function(n,e,t,r){var i;e[0]=0;for(var o=1;o<e.length;o++){var s=e[o++],a=e[o]?(e[0]|=s?1:2,t[e[o++]]):e[++o];s===3?r[0]=a:s===4?r[1]=Object.assign(r[1]||{},a):s===5?(r[1]=r[1]||{})[e[++o]]=a:s===6?r[1][e[++o]]+=a+"":s?(i=n.apply(a,tm(n,a,t,["",null])),r.push(i),a[0]?e[0]|=2:(e[o-2]=0,e[o]=i)):r.push(a)}return r},Bd=new Map;function CD(n){var e=Bd.get(this);return e||(e=new Map,Bd.set(this,e)),(e=tm(this,e.get(n)||(e.set(n,e=function(t){for(var r,i,o=1,s="",a="",l=[0],u=function(h){o===1&&(h||(s=s.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?l.push(0,h,s):o===3&&(h||s)?(l.push(3,h,s),o=2):o===2&&s==="..."&&h?l.push(4,h,0):o===2&&s&&!h?l.push(5,0,!0,s):o>=5&&((s||!h&&o===5)&&(l.push(o,0,s,i),o=6),h&&(l.push(o,h,0,i),o=6)),s=""},c=0;c<t.length;c++){c&&(o===1&&u(),u(c));for(var d=0;d<t[c].length;d++)r=t[c][d],o===1?r==="<"?(u(),l=[l],o=3):s+=r:o===4?s==="--"&&r===">"?(o=1,s=""):s=r+s[0]:a?r===a?a="":s+=r:r==='"'||r==="'"?a=r:r===">"?(u(),o=1):o&&(r==="="?(o=5,i=s,s=""):r==="/"&&(o<5||t[c][d+1]===">")?(u(),o===3&&(l=l[0]),o=l,(l=l[0]).push(2,0,o),o=0):r===" "||r===" "||r===`
1199
- `||r==="\r"?(u(),o=2):s+=r),o===3&&s==="!--"&&(o=4,l=l[0])}return u(),l}(n)),e),arguments,[])).length>1?e:e[0]}var ID={TALK_GMK:"AIzaSyAs_WXNLlj31EHJI_Lw8siO2B3ZJLUzBH0",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const ND=function(n){return ID[n]}("TALK_GMK");function Me(n,e,t,r){return new(t||(t=Promise))(function(i,o){function s(u){try{l(r.next(u))}catch(c){o(c)}}function a(u){try{l(r.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((r=r.apply(n,e||[])).next())})}class ji{constructor(){this.listeners={}}on(e,t,r){if(this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(t),r==null?void 0:r.once){const i=()=>{this.un(e,i),this.un(e,t)};return this.on(e,i),i}return()=>this.un(e,t)}un(e,t){var r;(r=this.listeners[e])===null||r===void 0||r.delete(t)}once(e,t){return this.on(e,t,{once:!0})}unAll(){this.listeners={}}emit(e,...t){this.listeners[e]&&this.listeners[e].forEach(r=>r(...t))}}const Hd={decode:function(n,e){return Me(this,void 0,void 0,function*(){const t=new AudioContext({sampleRate:e});return t.decodeAudioData(n).finally(()=>t.close())})},createBuffer:function(n,e){return typeof n[0]=="number"&&(n=[n]),function(t){const r=t[0];if(r.some(i=>i>1||i<-1)){const i=r.length;let o=0;for(let s=0;s<i;s++){const a=Math.abs(r[s]);a>o&&(o=a)}for(const s of t)for(let a=0;a<i;a++)s[a]/=o}}(n),{duration:e,length:n[0].length,sampleRate:n[0].length/e,numberOfChannels:n.length,getChannelData:t=>n==null?void 0:n[t],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function nm(n,e){const t=e.xmlns?document.createElementNS(e.xmlns,n):document.createElement(n);for(const[r,i]of Object.entries(e))if(r==="children")for(const[o,s]of Object.entries(e))typeof s=="string"?t.appendChild(document.createTextNode(s)):t.appendChild(nm(o,s));else r==="style"?Object.assign(t.style,i):r==="textContent"?t.textContent=i:t.setAttribute(r,i.toString());return t}function Ud(n,e,t){const r=nm(n,e||{});return t==null||t.appendChild(r),r}var vD=Object.freeze({__proto__:null,createElement:Ud,default:Ud});const yD={fetchBlob:function(n,e,t){return Me(this,void 0,void 0,function*(){const r=yield fetch(n,t);if(r.status>=400)throw new Error(`Failed to fetch ${n}: ${r.status} (${r.statusText})`);return function(i,o){Me(this,void 0,void 0,function*(){if(!i.body||!i.headers)return;const s=i.body.getReader(),a=Number(i.headers.get("Content-Length"))||0;let l=0;const u=d=>Me(this,void 0,void 0,function*(){l+=(d==null?void 0:d.length)||0;const h=Math.round(l/a*100);o(h)}),c=()=>Me(this,void 0,void 0,function*(){let d;try{d=yield s.read()}catch(h){return}d.done||(u(d.value),yield c())});c()})}(r.clone(),e),r.blob()})}};class bD extends ji{constructor(e){super(),this.isExternalMedia=!1,e.media?(this.media=e.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),e.mediaControls&&(this.media.controls=!0),e.autoplay&&(this.media.autoplay=!0),e.playbackRate!=null&&this.onMediaEvent("canplay",()=>{e.playbackRate!=null&&(this.media.playbackRate=e.playbackRate)},{once:!0})}onMediaEvent(e,t,r){return this.media.addEventListener(e,t,r),()=>this.media.removeEventListener(e,t,r)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const e=this.getSrc();e.startsWith("blob:")&&URL.revokeObjectURL(e)}canPlayType(e){return this.media.canPlayType(e)!==""}setSrc(e,t){const r=this.getSrc();if(e&&r===e)return;this.revokeSrc();const i=t instanceof Blob&&(this.canPlayType(t.type)||!e)?URL.createObjectURL(t):e;try{this.media.src=i}catch(o){this.media.src=e}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(e){this.media=e}play(){return Me(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(e){this.media.currentTime=e}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(e){this.media.volume=e}getMuted(){return this.media.muted}setMuted(e){this.media.muted=e}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(e,t){t!=null&&(this.media.preservesPitch=t),this.media.playbackRate=e}getMediaElement(){return this.media}setSinkId(e){return this.media.setSinkId(e)}}class Rr extends ji{constructor(e,t){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.subscriptions=[],this.options=e;const r=this.parentFromOptionsContainer(e.container);this.parent=r;const[i,o]=this.initHtml();r.appendChild(i),this.container=i,this.scrollContainer=o.querySelector(".scroll"),this.wrapper=o.querySelector(".wrapper"),this.canvasWrapper=o.querySelector(".canvases"),this.progressWrapper=o.querySelector(".progress"),this.cursor=o.querySelector(".cursor"),t&&o.appendChild(t),this.initEvents()}parentFromOptionsContainer(e){let t;if(typeof e=="string"?t=document.querySelector(e):e instanceof HTMLElement&&(t=e),!t)throw new Error("Container not found");return t}initEvents(){const e=t=>{const r=this.wrapper.getBoundingClientRect(),i=t.clientX-r.left,o=t.clientY-r.top;return[i/r.width,o/r.height]};if(this.wrapper.addEventListener("click",t=>{const[r,i]=e(t);this.emit("click",r,i)}),this.wrapper.addEventListener("dblclick",t=>{const[r,i]=e(t);this.emit("dblclick",r,i)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:t,scrollWidth:r,clientWidth:i}=this.scrollContainer,o=t/r,s=(t+i)/r;this.emit("scroll",o,s,t,t+i)}),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{t().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const e=this.parent.clientWidth;e===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=e,this.reRender())}initDrag(){this.subscriptions.push(function(e,t,r,i,o=3,s=0,a=100){if(!e)return()=>{};const l=matchMedia("(pointer: coarse)").matches;let u=()=>{};const c=d=>{if(d.button!==s)return;d.preventDefault(),d.stopPropagation();let h=d.clientX,p=d.clientY,f=!1;const m=Date.now(),E=R=>{if(R.preventDefault(),R.stopPropagation(),l&&Date.now()-m<a)return;const v=R.clientX,I=R.clientY,L=v-h,g=I-p;if(f||Math.abs(L)>o||Math.abs(g)>o){const O=e.getBoundingClientRect(),{left:k,top:w}=O;f||(r==null||r(h-k,p-w),f=!0),t(L,g,v-k,I-w),h=v,p=I}},A=R=>{if(f){const v=R.clientX,I=R.clientY,L=e.getBoundingClientRect(),{left:g,top:O}=L;i==null||i(v-g,I-O)}u()},D=R=>{R.relatedTarget&&R.relatedTarget!==document.documentElement||A(R)},_=R=>{f&&(R.stopPropagation(),R.preventDefault())},S=R=>{f&&R.preventDefault()};document.addEventListener("pointermove",E),document.addEventListener("pointerup",A),document.addEventListener("pointerout",D),document.addEventListener("pointercancel",D),document.addEventListener("touchmove",S,{passive:!1}),document.addEventListener("click",_,{capture:!0}),u=()=>{document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",A),document.removeEventListener("pointerout",D),document.removeEventListener("pointercancel",D),document.removeEventListener("touchmove",S),setTimeout(()=>{document.removeEventListener("click",_,{capture:!0})},10)}};return e.addEventListener("pointerdown",c),()=>{u(),e.removeEventListener("pointerdown",c)}}(this.wrapper,(e,t,r)=>{this.emit("drag",Math.max(0,Math.min(1,r/this.wrapper.getBoundingClientRect().width)))},e=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))},e=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))}))}getHeight(e,t){var r;const i=((r=this.audioData)===null||r===void 0?void 0:r.numberOfChannels)||1;if(e==null)return 128;if(!isNaN(Number(e)))return Number(e);if(e==="auto"){const o=this.parent.clientHeight||128;return t!=null&&t.every(s=>!s.overlay)?o/i:o}return 128}initHtml(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"});return t.innerHTML=`
1195
+ `))),0,0):B.empty;let d=n.someProp("clipboardTextParser",h=>h(e,i,r,n));if(d)s=d;else{let h=i.marks(),{schema:p}=n.state,f=Vt.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let E=o.appendChild(document.createElement("p"));m&&E.appendChild(f.serializeNode(p.text(m,h)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),o=function(d){let h=/^(\s*<meta [^>]*>)*/.exec(d);h&&(d=d.slice(h[0].length));let p,f=rf().createElement("div"),m=/<([a-z][^>\s]+)/i.exec(d);if((p=m&&nf[m[1].toLowerCase()])&&(d=p.map(E=>"<"+E+">").join("")+d+p.map(E=>"</"+E+">").reverse().join("")),f.innerHTML=d,p)for(let E=0;E<p.length;E++)f=f.querySelector(p[E])||f;return f}(t),Hi&&function(d){let h=d.querySelectorAll(we?"span:not([class]):not([style])":"span.Apple-converted-space");for(let p=0;p<h.length;p++){let f=h[p];f.childNodes.length==1&&f.textContent==" "&&f.parentNode&&f.parentNode.replaceChild(d.ownerDocument.createTextNode(" "),f)}}(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(s||(s=(n.someProp("clipboardParser")||n.someProp("domParser")||Si.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:h=>h.nodeName!="BR"||h.nextSibling||!h.parentNode||zA.test(h.parentNode.nodeName)?null:{ignore:!0}})),c)s=function(d,h){if(!d.size)return d;let p,f=d.content.firstChild.type.schema;try{p=JSON.parse(h)}catch(D){return d}let{content:m,openStart:E,openEnd:A}=d;for(let D=p.length-2;D>=0;D-=2){let _=f.nodes[p[D]];if(!_||_.hasRequiredAttrs())break;m=H.from(_.create(p[D+1],m)),E++,A++}return new B(m,E,A)}(Wc(s,+c[1],+c[2]),c[4]);else if(s=B.maxOpen(function(d,h){if(d.childCount<2)return d;for(let p=h.depth;p>=0;p--){let f,m=h.node(p).contentMatchAt(h.index(p)),E=[];if(d.forEach(A=>{if(!E)return;let D,_=m.findWrapping(A.type);if(!_)return E=null;if(D=E.length&&f.length&&ef(_,f,A,E[E.length-1],0))E[E.length-1]=D;else{E.length&&(E[E.length-1]=tf(E[E.length-1],f.length));let S=Qp(A,_);E.push(S),m=m.matchType(S.type),f=_}}),E)return H.from(E)}return d}(s.content,i),!0),s.openStart||s.openEnd){let d=0,h=0;for(let p=s.content.firstChild;d<s.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=s.content.lastChild;h<s.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);s=Wc(s,d,h)}return n.someProp("transformPasted",d=>{s=d(s,n)}),s}const zA=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Qp(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,H.from(n));return n}function ef(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=ef(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(H.from(Qp(t,n,i+1))))}}function tf(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,tf(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(H.empty,!0);return n.copy(t.append(r))}function Ja(n,e,t,r,i,o){let s=e<0?n.firstChild:n.lastChild,a=s.content;return n.childCount>1&&(o=0),i<r-1&&(a=Ja(a,e,t,r,i+1,o)),i>=t&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(H.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(a))}function Wc(n,e,t){return e<n.openStart&&(n=new B(Ja(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new B(Ja(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const nf={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Jc=null;function rf(){return Jc||(Jc=document.implementation.createHTMLDocument("title"))}const $e={},Ge={},VA={touchstart:!0,touchmove:!0};class YA{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function rn(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function Zs(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>qa(n,r))})}function qa(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return!!r&&(r(n,e)||e.defaultPrevented)})}function GA(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Fo(n){return{left:n.clientX,top:n.clientY}}function Yl(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,a=>s>o.depth?a(n,t,o.nodeAfter,o.before(s),i,!0):a(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function ar(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function XA(n,e,t,r,i){return Yl(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?function(o,s){if(s==-1)return!1;let a,l,u=o.state.selection;u instanceof X&&(a=u.node);let c=o.state.doc.resolve(s);for(let d=c.depth+1;d>0;d--){let h=d>c.depth?c.nodeAfter:c.node(d);if(X.isSelectable(h)){l=a&&u.$from.depth>0&&d>=u.$from.depth&&c.before(u.$from.depth+1)==u.$from.pos?c.before(u.$from.depth):c.before(d);break}}return l!=null&&(ar(o,X.create(o.state.doc,l)),!0)}(n,t):function(o,s){if(s==-1)return!1;let a=o.state.doc.resolve(s),l=a.nodeAfter;return!!(l&&l.isAtom&&X.isSelectable(l))&&(ar(o,new X(a)),!0)}(n,t))}function KA(n,e,t,r){return Yl(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function WA(n,e,t,r){return Yl(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||function(i,o,s){if(s.button!=0)return!1;let a=i.state.doc;if(o==-1)return!!a.inlineContent&&(ar(i,ne.create(a,0,a.content.size)),!0);let l=a.resolve(o);for(let u=l.depth+1;u>0;u--){let c=u>l.depth?l.nodeAfter:l.node(u),d=l.before(u);if(c.inlineContent)ar(i,ne.create(a,d+1,d+1+c.content.size));else{if(!X.isSelectable(c))continue;ar(i,X.create(a,d))}return!0}}(n,t,r)}function Za(n){return xo(n)}Ge.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!qc(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!dt||!we||t.keyCode!=13))if(t.keyCode!=229&&n.domObserver.forceFlush(),!Sr||t.keyCode!=13||t.ctrlKey||t.altKey||t.metaKey)n.someProp("handleKeyDown",r=>r(n,t))||$A(n,t)?t.preventDefault():rn(n,"key");else{let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Sn(13,"Enter"))),n.input.lastIOSEnter=0)},200)}},Ge.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Ge.keypress=(n,e)=>{let t=e;if(qc(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||lt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t)))return void t.preventDefault();let r=n.state.selection;if(!(r instanceof ne&&r.$from.sameParent(r.$to))){let i=String.fromCharCode(t.charCode);/[\r\n]/.test(i)||n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))||n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};const of=lt?"metaKey":"ctrlKey";$e.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Za(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&function(a,l){let u=l.x-a.clientX,c=l.y-a.clientY;return u*u+c*c<100}(t,n.input.lastClick)&&!t[of]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let s=n.posAtCoords(Fo(t));s&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new JA(n,s,t,!!r)):(o=="doubleClick"?KA:WA)(n,s.pos,s.inside,t)?t.preventDefault():rn(n,"pointer"))};class JA{constructor(e,t,r,i){let o,s;if(this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[of],this.allowDefault=r.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let c=e.state.doc.resolve(t.pos);o=c.parent,s=c.depth?c.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:u}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof X&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!gt||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),rn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Xt(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Fo(e))),this.updateAllowDefault(e),this.allowDefault||!t?rn(this.view,"pointer"):XA(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Xe&&this.mightDrag&&!this.mightDrag.node.isAtom||we&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(ar(this.view,Q.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):rn(this.view,"pointer")}move(e){this.updateAllowDefault(e),rn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function qc(n,e){return!!n.composing||!!(Xe&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500)&&(n.input.compositionEndedAt=-2e8,!0)}$e.touchstart=n=>{n.input.lastTouch=Date.now(),Za(n),rn(n,"pointer")},$e.touchmove=n=>{n.input.lastTouch=Date.now(),rn(n,"pointer")},$e.contextmenu=n=>Za(n);const qA=dt?5e3:-1;function Zc(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>xo(n),e))}function sf(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function xo(n,e=!1){if(!(dt&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),sf(n),e||n.docView&&n.docView.dirty){let t=zl(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}Ge.compositionstart=Ge.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),xo(n,!0),n.markCursor=null;else if(xo(n),gt&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){n.domSelection().collapse(s,s.nodeValue.length);break}i=s,o=-1}}n.input.composing=!0}Zc(n,qA)},Ge.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Zc(n,20))};const di=Ze&&sn<15||Sr&&bA<604;function hi(n,e,t,r,i){let o=Zp(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",l=>l(n,i,o||B.empty)))return!0;if(!o)return!1;let s=function(l){return l.openStart==0&&l.openEnd==0&&l.content.childCount==1?l.content.firstChild:null}(o),a=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function af(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}$e.copy=Ge.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=di?null:t.clipboardData,s=r.content(),{dom:a,text:l}=qp(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(u,c){if(!u.dom.parentNode)return;let d=u.dom.parentNode.appendChild(document.createElement("div"));d.appendChild(c),d.style.cssText="position: fixed; left: -10000px; top: 10px";let h=getSelection(),p=document.createRange();p.selectNodeContents(c),u.dom.blur(),h.removeAllRanges(),h.addRange(p),setTimeout(()=>{d.parentNode&&d.parentNode.removeChild(d),u.focus()},50)}(n,a),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Ge.paste=(n,e)=>{let t=e;if(n.composing&&!dt)return;let r=di?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&hi(n,af(r),r.getData("text/html"),i,t)?t.preventDefault():function(o,s){if(!o.dom.parentNode)return;let a=o.input.shiftKey||o.state.selection.$from.parent.type.spec.code,l=o.dom.parentNode.appendChild(document.createElement(a?"textarea":"div"));a||(l.contentEditable="true"),l.style.cssText="position: fixed; left: -10000px; top: 10px",l.focus();let u=o.input.shiftKey&&o.input.lastKeyCode!=45;setTimeout(()=>{o.focus(),l.parentNode&&l.parentNode.removeChild(l),a?hi(o,l.value,null,u,s):hi(o,l.textContent,l.innerHTML,u,s)},50)}(n,t)};class lf{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const Qc=lt?"altKey":"ctrlKey";$e.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i,o=n.state.selection,s=o.empty?null:n.posAtCoords(Fo(t));if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof X?o.to-1:o.to))){if(r&&r.mightDrag)i=X.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let c=n.docView.nearestDesc(t.target,!0);c&&c.node.type.spec.draggable&&c!=n.docView&&(i=X.create(n.state.doc,c.posBefore))}}let a=(i||n.state.selection).content(),{dom:l,text:u}=qp(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(di?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",di||t.dataTransfer.setData("text/plain",u),n.dragging=new lf(a,!t[Qc],i)},$e.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Ge.dragover=Ge.dragenter=(n,e)=>e.preventDefault(),Ge.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Fo(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",f=>{s=f(s,n)}):s=Zp(n,af(t.dataTransfer),di?null:t.dataTransfer.getData("text/html"),!1,o);let a=!(!r||t[Qc]);if(n.someProp("handleDrop",f=>f(n,t,s||B.empty,a)))return void t.preventDefault();if(!s)return;t.preventDefault();let l=s?function(f,m,E){let A=f.resolve(m);if(!E.content.size)return m;let D=E.content;for(let _=0;_<E.openStart;_++)D=D.firstChild.content;for(let _=1;_<=(E.openStart==0&&E.size?2:1);_++)for(let S=A.depth;S>=0;S--){let T=S==A.depth?0:A.pos<=(A.start(S+1)+A.end(S+1))/2?-1:1,N=A.index(S)+(T>0?1:0),I=A.node(S),L=!1;if(_==1)L=I.canReplace(N,N,D);else{let g=I.contentMatchAt(N).findWrapping(D.firstChild.type);L=g&&I.canReplaceWith(N,N,g[0])}if(L)return T==0?A.pos:T<0?A.before(S+1):A.after(S+1)}return null}(n.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let u=n.state.tr;if(a){let{node:f}=r;f?f.replace(u):u.deleteSelection()}let c=u.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(h))return;let p=u.doc.resolve(c);if(d&&X.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new X(p));else{let f=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((m,E,A,D)=>f=D),u.setSelection(Vl(n,p,u.doc.resolve(f)))}n.focus(),n.dispatch(u.setMeta("uiEvent","drop"))},$e.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Xt(n)},20))},$e.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},$e.beforeinput=(n,e)=>{if(we&&dt&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:t}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=t||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,Sn(8,"Backspace")))))return;let{$cursor:r}=n.state.selection;r&&r.pos>0&&n.dispatch(n.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let n in Ge)$e[n]=Ge[n];function Ri(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Po{constructor(e,t){this.toDOM=e,this.spec=t||Mn,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new it(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Po&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ri(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ln{constructor(e,t){this.attrs=e,this.spec=t||Mn}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new it(o,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof ln&&Ri(this.attrs,e.attrs)&&Ri(this.spec,e.spec)}static is(e){return e.type instanceof ln}destroy(){}}class Gl{constructor(e,t){this.attrs=e,this.spec=t||Mn}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let s=e.mapResult(t.to+i,-1);return s.deleted||s.pos<=o.pos?null:new it(o.pos-r,s.pos-r,this)}valid(e,t){let r,{index:i,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(r=e.child(i)).isText&&o+r.nodeSize==t.to}eq(e){return this==e||e instanceof Gl&&Ri(this.attrs,e.attrs)&&Ri(this.spec,e.spec)}destroy(){}}class it{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new it(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new it(e,e,new Po(t,r))}static inline(e,t,r,i){return new it(e,t,new ln(r,i))}static node(e,t,r,i){return new it(e,t,new Gl(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof ln}get widget(){return this.type instanceof Po}}const Wn=[],Mn={};class Ee{constructor(e,t){this.local=e.length?e:Wn,this.children=t.length?t:Wn}static create(e,t){return t.length?mo(t,e,0,Mn):ke}find(e,t,r){let i=[];return this.findInner(e==null?0:e,t==null?1e9:t,i,0,r),i}findInner(e,t,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=t&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,t-a,r,i+a,o)}}map(e,t,r){return this==ke||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Mn)}mapInner(e,t,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(t,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?function(a,l,u,c,d,h,p){let f=a.slice();for(let E=0,A=h;E<u.maps.length;E++){let D=0;u.maps[E].forEach((_,S,T,N)=>{let I=N-T-(S-_);for(let L=0;L<f.length;L+=3){let g=f[L+1];if(g<0||_>g+A-D)continue;let O=f[L]+A-D;S>=O?f[L+1]=_<=O?-2:-1:_>=A&&I&&(f[L]+=I,f[L+1]+=I)}D+=I}),A=u.maps[E].map(A,-1)}let m=!1;for(let E=0;E<f.length;E+=3)if(f[E+1]<0){if(f[E+1]==-2){m=!0,f[E+1]=-1;continue}let A=u.map(a[E]+h),D=A-d;if(D<0||D>=c.content.size){m=!0;continue}let _=u.map(a[E+1]+h,-1)-d,{index:S,offset:T}=c.content.findIndex(D),N=c.maybeChild(S);if(N&&T==D&&T+N.nodeSize==_){let I=f[E+2].mapInner(u,N,A+1,a[E]+h+1,p);I!=ke?(f[E]=D,f[E+1]=_,f[E+2]=I):(f[E+1]=-2,m=!0)}else m=!0}if(m){let E=function(D,_,S,T,N,I,L){function g(O,k){for(let w=0;w<O.local.length;w++){let U=O.local[w].map(T,N,k);U?S.push(U):L.onRemove&&L.onRemove(O.local[w].spec)}for(let w=0;w<O.children.length;w+=3)g(O.children[w+2],O.children[w]+k+1)}for(let O=0;O<D.length;O+=3)D[O+1]==-1&&g(D[O+2],_[O]+I+1);return S}(f,a,l,u,d,h,p),A=mo(E,c,0,p);l=A.local;for(let D=0;D<f.length;D+=3)f[D+1]<0&&(f.splice(D,3),D-=3);for(let D=0,_=0;D<A.children.length;D+=3){let S=A.children[D];for(;_<f.length&&f[_]<S;)_+=3;f.splice(_,0,A.children[D],A.children[D+1],A.children[D+2])}}return new Ee(l.sort(Cn),f)}(this.children,s||[],e,t,r,i,o):s?new Ee(s.sort(Cn),Wn):ke}add(e,t){return t.length?this==ke?Ee.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((a,l)=>{let u,c=l+r;if(u=cf(t,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,u,c+1):i.splice(o,0,l,l+a.nodeSize,mo(u,a,c+1,Mn)),o+=3}});let s=uf(o?df(t):t,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ee(s.length?this.local.concat(s).sort(Cn):this.local,i||this.children)}remove(e){return e.length==0||this==ke?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+t,l=r[o+1]+t;for(let c,d=0;d<e.length;d++)(c=e[d])&&c.from>a&&c.to<l&&(e[d]=null,(s||(s=[])).push(c));if(!s)continue;r==this.children&&(r=this.children.slice());let u=r[o+2].removeInner(s,a+1);u!=ke?r[o+2]=u:(r.splice(o,3),o-=3)}if(i.length){for(let o,s=0;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ee(i,r):ke}forChild(e,t){if(this==ke)return this;if(t.isLeaf)return Ee.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+t.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof ln){let u=Math.max(o,l.from)-o,c=Math.min(s,l.to)-o;u<c&&(i||(i=[])).push(l.copy(u,c))}}if(i){let a=new Ee(i.sort(Cn),Wn);return r?new tn([a,r]):a}return r||ke}eq(e){if(this==e)return!0;if(!(e instanceof Ee)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Xl(this.localsInner(e))}localsInner(e){if(this==ke)return Wn;if(e.inlineContent||!this.local.some(ln.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ln||t.push(this.local[r]);return t}}Ee.empty=new Ee([],[]),Ee.removeOverlap=Xl;const ke=Ee.empty;class tn{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Mn));return tn.from(r)}forChild(e,t){if(t.isLeaf)return Ee.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ke&&(o instanceof tn?r=r.concat(o.members):r.push(o))}return tn.from(r)}eq(e){if(!(e instanceof tn)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(t){r&&(t=t.slice(),r=!1);for(let s=0;s<o.length;s++)t.push(o[s])}else t=o}return t?Xl(r?t:t.sort(Cn)):Wn}static from(e){switch(e.length){case 0:return ke;case 1:return e[0];default:return new tn(e.every(t=>t instanceof Ee)?e:e.reduce((t,r)=>t.concat(r instanceof Ee?r:r.members),[]))}}}function uf(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new it(i.from+e,i.to+e,i.type))}return t}function cf(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o,s=0;s<n.length;s++)(o=n[s])&&o.from>t&&o.to<r&&((i||(i=[])).push(o),n[s]=null);return i}function df(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function mo(n,e,t,r){let i=[],o=!1;e.forEach((a,l)=>{let u=cf(n,a,l+t);if(u){o=!0;let c=mo(u,a,t+l+1,r);c!=ke&&i.push(l,l+a.nodeSize,c)}});let s=uf(o?df(n):n,-t).sort(Cn);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Ee(s,i):ke}function Cn(n,e){return n.from-e.from||n.to-e.to}function Xl(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from!=r.from){o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),ed(e,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),ed(e,i+1,o.copy(r.to,o.to)))}}return e}function ed(n,e,t){for(;e<n.length&&Cn(t,n[e])>0;)e++;n.splice(e,0,t)}function Qs(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=ke&&e.push(r)}),n.cursorWrapper&&e.push(Ee.create(n.state.doc,[n.cursorWrapper.deco])),tn.from(e)}const ZA={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},QA=Ze&&sn<=11;class eg{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class tg{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new eg,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Ze&&sn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),QA&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ZA)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if($c(this.view)){if(this.suppressingSelectionUpdates)return Xt(this.view);if(Ze&&sn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Bn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,r=new Set;for(let o=e.focusNode;o;o=Ti(o))r.add(o);for(let o=e.anchorNode;o;o=Ti(o))if(r.has(o)){t=o;break}let i=t&&this.view.docView.nearestDesc(t);return i&&i.ignoreMutation({type:"selection",target:t.nodeType==3?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&$c(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let c=0;c<t.length;c++){let d=this.registerMutation(t[c],l);d&&(o=o<0?d.from:Math.min(d.from,o),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(gt&&l.length>1){let c=l.filter(d=>d.nodeName=="BR");if(c.length==2){let d=c[0],h=c[1];d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}}let u=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ms(r)&&(u=zl(e))&&u.eq(Q.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Xt(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),function(c){if(!td.has(c)&&(td.set(c,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(c.dom).whiteSpace)!==-1)){if(c.requiresGeckoHackNode=gt,nd)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),nd=!0}}(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Xt(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++)t.push(e.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Ze&&sn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:c,nextSibling:d}=e.addedNodes[u];(!c||Array.prototype.indexOf.call(e.addedNodes,c)<0)&&(i=c),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d)}let s=i&&i.parentNode==e.target?je(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?je(o):e.target.childNodes.length;return{from:a,to:r.localPosFromDOM(e.target,l,1)}}return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let td=new WeakMap,nd=!1;function ng(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Xe&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}if(n.parentNode.lastChild==n||Xe&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const rg=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function ig(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let g=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,O=zl(n,g);if(O&&!n.state.selection.eq(O)){if(we&&dt&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",w=>w(n,Sn(13,"Enter"))))return;let k=n.state.tr.setSelection(O);g=="pointer"?k.setMeta("pointer",!0):g=="key"&&k.scrollIntoView(),o&&k.setMeta("composition",o),n.dispatch(k)}return}let s=n.state.doc.resolve(e),a=s.sharedDepth(t);e=s.before(a+1),t=n.state.doc.resolve(t).after(a+1);let l,u,c=n.state.selection,d=function(g,O,k){let w,{node:U,fromOffset:y,toOffset:M,from:$,to:j}=g.docView.parseRange(O,k),G=g.domSelectionRange(),V=G.anchorNode;if(V&&g.dom.contains(V.nodeType==1?V:V.parentNode)&&(w=[{node:V,offset:G.anchorOffset}],ms(G)||w.push({node:G.focusNode,offset:G.focusOffset})),we&&g.input.lastKeyCode===8)for(let re=M;re>y;re--){let Oe=U.childNodes[re-1],_e=Oe.pmViewDesc;if(Oe.nodeName=="BR"&&!_e){M=re;break}if(!_e||_e.size)break}let Y=g.state.doc,K=g.someProp("domParser")||Si.fromSchema(g.state.schema),W=Y.resolve($),ee=null,F=K.parse(U,{topNode:W.parent,topMatch:W.parent.contentMatchAt(W.index()),topOpen:!0,from:y,to:M,preserveWhitespace:W.parent.type.whitespace!="pre"||"full",findPositions:w,ruleFromNode:ng,context:W});if(w&&w[0].pos!=null){let re=w[0].pos,Oe=w[1]&&w[1].pos;Oe==null&&(Oe=re),ee={anchor:re+$,head:Oe+$}}return{doc:F,sel:ee,from:$,to:j}}(n,e,t),h=n.state.doc,p=h.slice(d.from,d.to);n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(l=n.state.selection.to,u="end"):(l=n.state.selection.from,u="start"),n.input.lastKeyCode=null;let f=function(g,O,k,w,U){let y=g.findDiffStart(O,k);if(y==null)return null;let{a:M,b:$}=g.findDiffEnd(O,k+g.size,k+O.size);if(U=="end"&&(w-=M+Math.max(0,y-Math.min(M,$))-y),M<y&&g.size<O.size){let j=w<=y&&w>=M?y-w:0;y-=j,y&&y<O.size&&id(O.textBetween(y-1,y+1))&&(y+=j?1:-1),$=y+($-M),M=y}else if($<y){let j=w<=y&&w>=$?y-w:0;y-=j,y&&y<g.size&&id(g.textBetween(y-1,y+1))&&(y+=j?1:-1),M=y+(M-$),$=y}return{start:y,endA:M,endB:$}}(p.content,d.doc.content,d.from,l,u);if((Sr&&n.input.lastIOSEnter>Date.now()-225||dt)&&i.some(g=>g.nodeType==1&&!rg.test(g.nodeName))&&(!f||f.endA>=f.endB)&&n.someProp("handleKeyDown",g=>g(n,Sn(13,"Enter"))))return void(n.input.lastIOSEnter=0);if(!f){if(!(r&&c instanceof ne&&!c.empty&&c.$head.sameParent(c.$anchor))||n.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){let g=rd(n,n.state.doc,d.sel);if(g&&!g.eq(n.state.selection)){let O=n.state.tr.setSelection(g);o&&O.setMeta("composition",o),n.dispatch(O)}}return}f={start:c.from,endA:c.to,endB:c.to}}if(we&&n.cursorWrapper&&d.sel&&d.sel.anchor==n.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let g=f.endB-f.start;d.sel={anchor:d.sel.anchor+g,head:d.sel.anchor+g}}n.input.domChangeCount++,n.state.selection.from<n.state.selection.to&&f.start==f.endB&&n.state.selection instanceof ne&&(f.start>n.state.selection.from&&f.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?f.start=n.state.selection.from:f.endA<n.state.selection.to&&f.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(f.endB+=n.state.selection.to-f.endA,f.endA=n.state.selection.to)),Ze&&sn<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>d.from&&d.doc.textBetween(f.start-d.from-1,f.start-d.from+1)=="  "&&(f.start--,f.endA--,f.endB--);let m,E=d.doc.resolveNoCache(f.start-d.from),A=d.doc.resolveNoCache(f.endB-d.from),D=h.resolve(f.start),_=E.sameParent(A)&&E.parent.inlineContent&&D.end()>=f.endA;if((Sr&&n.input.lastIOSEnter>Date.now()-225&&(!_||i.some(g=>g.nodeName=="DIV"||g.nodeName=="P"))||!_&&E.pos<d.doc.content.size&&!E.sameParent(A)&&(m=Q.findFrom(d.doc.resolve(E.pos+1),1,!0))&&m.head==A.pos)&&n.someProp("handleKeyDown",g=>g(n,Sn(13,"Enter"))))return void(n.input.lastIOSEnter=0);if(n.state.selection.anchor>f.start&&function(g,O,k,w,U){if(!w.parent.isTextblock||k-O<=U.pos-w.pos||ea(w,!0,!1)<U.pos)return!1;let y=g.resolve(O);if(y.parentOffset<y.parent.content.size||!y.parent.isTextblock)return!1;let M=g.resolve(ea(y,!0,!0));return!(!M.parent.isTextblock||M.pos>k||ea(M,!0,!1)<k)&&w.parent.content.cut(w.parentOffset).eq(M.parent.content)}(h,f.start,f.endA,E,A)&&n.someProp("handleKeyDown",g=>g(n,Sn(8,"Backspace"))))return void(dt&&we&&n.domObserver.suppressSelectionUpdates());we&&dt&&f.endB==f.start&&(n.input.lastAndroidDelete=Date.now()),dt&&!_&&E.start()!=A.start()&&A.parentOffset==0&&E.depth==A.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==f.endA&&(f.endB-=2,A=d.doc.resolveNoCache(f.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(g){return g(n,Sn(13,"Enter"))})},20));let S,T,N,I=f.start,L=f.endA;if(_){if(E.pos==A.pos)Ze&&sn<=11&&E.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Xt(n),20)),S=n.state.tr.delete(I,L),T=h.resolve(f.start).marksAcross(h.resolve(f.endA));else if(f.endA==f.endB&&(N=function(g,O){let k,w,U,y=g.firstChild.marks,M=O.firstChild.marks,$=y,j=M;for(let V=0;V<M.length;V++)$=M[V].removeFromSet($);for(let V=0;V<y.length;V++)j=y[V].removeFromSet(j);if($.length==1&&j.length==0)w=$[0],k="add",U=V=>V.mark(w.addToSet(V.marks));else{if($.length!=0||j.length!=1)return null;w=j[0],k="remove",U=V=>V.mark(w.removeFromSet(V.marks))}let G=[];for(let V=0;V<O.childCount;V++)G.push(U(O.child(V)));if(H.from(G).eq(g))return{mark:w,type:k}}(E.parent.content.cut(E.parentOffset,A.parentOffset),D.parent.content.cut(D.parentOffset,f.endA-D.start()))))S=n.state.tr,N.type=="add"?S.addMark(I,L,N.mark):S.removeMark(I,L,N.mark);else if(E.parent.child(E.index()).isText&&E.index()==A.index()-(A.textOffset?0:1)){let g=E.parent.textBetween(E.parentOffset,A.parentOffset);if(n.someProp("handleTextInput",O=>O(n,I,L,g)))return;S=n.state.tr.insertText(g,I,L)}}if(S||(S=n.state.tr.replace(I,L,d.doc.slice(f.start-d.from,f.endB-d.from))),d.sel){let g=rd(n,S.doc,d.sel);g&&!(we&&dt&&n.composing&&g.empty&&(f.start!=f.endB||n.input.lastAndroidDelete<Date.now()-100)&&(g.head==I||g.head==S.mapping.map(L)-1)||Ze&&g.empty&&g.head==I)&&S.setSelection(g)}T&&S.ensureMarks(T),o&&S.setMeta("composition",o),n.dispatch(S.scrollIntoView())}function rd(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:Vl(n,e.resolve(t.anchor),e.resolve(t.head))}function ea(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function id(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class og{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new YA,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(ud),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ad(this),sd(this),this.nodeViews=ld(this),this.docView=Fc(this.state.doc,od(this),Qs(this),this.dom,this),this.domObserver=new tg(this,(r,i,o,s)=>ig(this,r,i,o,s)),this.domObserver.start(),function(r){for(let i in $e){let o=$e[i];r.dom.addEventListener(i,r.input.eventHandlers[i]=s=>{!GA(r,s)||qa(r,s)||!r.editable&&s.type in Ge||o(r,s)},VA[i]?{passive:!0}:void 0)}Xe&&r.dom.addEventListener("input",()=>null),Zs(r)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Zs(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ud),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(sf(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=ld(this);(function(f,m){let E=0,A=0;for(let D in f){if(f[D]!=m[D])return!0;E++}for(let D in m)A++;return E!=A})(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Zs(this),this.editable=ad(this),sd(this);let l=Qs(this),u=od(this),c=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(e.doc,u,l);!d&&e.selection.eq(i.selection)||(s=!0);let h=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&function(p){let f,m,E=p.dom.getBoundingClientRect(),A=Math.max(0,E.top);for(let D=(E.left+E.right)/2,_=A+1;_<Math.min(innerHeight,E.bottom);_+=5){let S=p.root.elementFromPoint(D,_);if(!S||S==p.dom||!p.dom.contains(S))continue;let T=S.getBoundingClientRect();if(T.top>=A-20){f=S,m=T.top;break}}return{refDOM:f,refTop:m,stack:vc(p.dom)}}(this);if(s){this.domObserver.stop();let p=d&&(Ze||we)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&function(f,m){let E=Math.min(f.$anchor.sharedDepth(f.head),m.$anchor.sharedDepth(m.head));return f.$anchor.start(E)!=m.$anchor.start(E)}(i.selection,e.selection);if(d){let f=we?this.trackWrites=this.domSelectionRange().focusNode:null;!o&&this.docView.update(e.doc,u,l,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Fc(e.doc,u,l,this.dom,this)),f&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(f){let m=f.docView.domFromPos(f.state.selection.anchor,0),E=f.domSelectionRange();return Bn(m.node,m.offset,E.anchorNode,E.anchorOffset)}(this))?Xt(this,p):(Wp(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():h&&function({refDOM:p,refTop:f,stack:m}){let E=p?p.getBoundingClientRect().top:0;yc(m,E==0?0:E-f)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof X){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Nc(this,t.getBoundingClientRect(),e)}else Nc(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}}updateDraggedNode(e,t){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-t.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new lf(e.slice,e.move,i<0?void 0:X.create(this.state.doc,i))}someProp(e,t){let r,i=this._props&&this._props[e];if(i!=null&&(r=t?t(i):i))return r;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(r=t?t(a):a))return r}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(Ze){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(Vn)return e.focus(Vn);let t=vc(e);e.focus(Vn==null?{get preventScroll(){return Vn={preventScroll:!0},!0}}:void 0),Vn||(Vn=!1,yc(t,0))}(this.dom),Xt(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return wA(this,e)}coordsAtPos(e,t=1){return zp(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return xA(this,t||this.state,e)}pasteHTML(e,t){return hi(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return hi(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Qs(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return function(t,r){qa(t,r)||!$e[r.type]||!t.editable&&r.type in Ge||$e[r.type](t,r)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Xe&&this.root.nodeType===11&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom?function(e){let t;function r(u){u.preventDefault(),u.stopImmediatePropagation(),t=u.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0);let i=t.startContainer,o=t.startOffset,s=t.endContainer,a=t.endOffset,l=e.domAtPos(e.state.selection.anchor);return Bn(l.node,l.offset,s,a)&&([i,o,s,a]=[s,a,i,o]),{anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:a}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function od(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:e[r]||r=="contenteditable"||r=="nodeName"||(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[it.node(0,n.state.doc.content.size,e)]}function sd(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:it.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function ad(n){return!n.someProp("editable",e=>e(n.state)===!1)}function ld(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function ud(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const Se=new class{constructor(n){this.cached=Object.create(null);let e=this.spec={};for(let r in n)e[r]=n[r];e.nodes=Ne.from(n.nodes),e.marks=Ne.from(n.marks||{}),this.nodes=cc.compile(this.spec.nodes,this),this.marks=ds.compile(this.spec.marks,this);let t=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let i=this.nodes[r],o=i.spec.content||"",s=i.spec.marks;i.contentMatch=t[o]||(t[o]=xn.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=s=="_"?null:s?dc(this,s.split(" ")):s!=""&&i.inlineContent?null:[]}for(let r in this.marks){let i=this.marks[r],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:dc(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(n,e=null,t,r){if(typeof n=="string")n=this.nodeType(n);else{if(!(n instanceof cc))throw new RangeError("Invalid node type: "+n);if(n.schema!=this)throw new RangeError("Node type from different schema used ("+n.name+")")}return n.createChecked(e,t,r)}text(n,e){let t=this.nodes.text;return new Mo(t,t.defaultAttrs,n,te.setFrom(e))}mark(n,e){return typeof n=="string"&&(n=this.marks[n]),n.create(e)}nodeFromJSON(n){return kn.fromJSON(this,n)}markFromJSON(n){return te.fromJSON(this,n)}nodeType(n){let e=this.nodes[n];if(!e)throw new RangeError("Unknown node type: "+n);return e}}({nodes:{doc:{content:"paragraph+"},paragraph:{code:!0,content:"inline*",parseDOM:[{tag:"p"}],toDOM:()=>["p",0]},text:{group:"inline"},mention:{group:"inline",inline:!0,attrs:{id:{},name:{}},content:"text*",toDOM:n=>["span",{"data-mention-id":n.attrs.id,class:"t-mention"},`@${n.attrs.name}`],parseDOM:[{tag:"span[data-mention-id]",getAttrs:n=>({id:n.dataset["mention-id"]})}]},customemoji:{group:"inline",inline:!0,attrs:{name:{},url:{}},content:"text*",selectable:!1,toDOM:n=>["img",{src:n.attrs.url,alt:n.attrs.name,"data-custom-emoji":n.attrs.name}],parseDOM:[{tag:"img[data-custom-emoji]",getAttrs:n=>{const e=n;return{name:e.dataset.customEmoji,url:e.src}}}]}},marks:{literal:{toDOM:()=>["span",{"data-literal":""}],parseDOM:[{tag:"span[data-literal]"}]},bold:{toDOM:()=>["b"],parseDOM:[{tag:"b"}]},italic:{toDOM:()=>["i"],parseDOM:[{tag:"i"}]},strikethrough:{toDOM:()=>["del"],parseDOM:[{tag:"del"}]},emoji:{attrs:{emoji:{}},toDOM:n=>["span",{"data-emoji":n.attrs.emoji},n.attrs.emoji],parseDOM:[{tag:"span[data-emoji]",getAttrs:n=>({emoji:n.dataset.emoji})}]}}}),ta=new fs("placeholder"),cd=new ps({key:ta,props:{decorations(n){if(hf(n.doc))return;const e=n.doc.firstChild,t=it.node(0,e.nodeSize,{class:"empty-node","data-placeholder":ta.getState(n)});return Ee.create(n.doc,[t])}},state:{init:()=>"",apply:(n,e)=>{var t;return(t=n.getMeta(ta))!=null?t:e}}});function hf(n){return n.childCount!==1||n.firstChild.childCount!==0}for(var dn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Bo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},dd=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent),sg=typeof navigator!="undefined"&&/Apple Computer/.test(navigator.vendor),ag=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent),hd=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),lg=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ug=dd&&(hd||+dd[1]<57)||ag&&hd,ye=0;ye<10;ye++)dn[48+ye]=dn[96+ye]=String(ye);for(ye=1;ye<=24;ye++)dn[ye+111]="F"+ye;for(ye=65;ye<=90;ye++)dn[ye]=String.fromCharCode(ye+32),Bo[ye]=String.fromCharCode(ye);for(var na in dn)Bo.hasOwnProperty(na)||(Bo[na]=dn[na]);const cg=typeof navigator!="undefined"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function dg(n){let e,t,r,i,o=n.split(/-(?!$)/),s=o[o.length-1];s=="Space"&&(s=" ");for(let a=0;a<o.length-1;a++){let l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))e=!0;else if(/^(c|ctrl|control)$/i.test(l))t=!0;else if(/^s(hift)?$/i.test(l))r=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);cg?i=!0:t=!0}}return e&&(s="Alt-"+s),t&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function ra(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function pd(n){return new ps({props:{handleKeyDown:hg(n)}})}function hg(n){let e=function(t){let r=Object.create(null);for(let i in t)r[dg(i)]=t[i];return r}(n);return function(t,r){let i,o=function(a){var l=!(ug&&(a.ctrlKey||a.altKey||a.metaKey)||(sg||lg)&&a.shiftKey&&a.key&&a.key.length==1)&&a.key||(a.shiftKey?Bo:dn)[a.keyCode]||a.key||"Unidentified";return l=="Esc"&&(l="Escape"),l=="Del"&&(l="Delete"),l=="Left"&&(l="ArrowLeft"),l=="Up"&&(l="ArrowUp"),l=="Right"&&(l="ArrowRight"),l=="Down"&&(l="ArrowDown"),l}(r),s=e[ra(o,r)];if(s&&s(t.state,t.dispatch,t))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[ra(o,r,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=dn[r.keyCode])&&i!=o){let a=e[ra(i,r)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}var Ho=200,ve=function(){};ve.prototype.append=function(n){return n.length?(n=ve.from(n),!this.length&&n||n.length<Ho&&this.leafAppend(n)||this.length<Ho&&n.leafPrepend(this)||this.appendInner(n)):this},ve.prototype.prepend=function(n){return n.length?ve.from(n).append(this):this},ve.prototype.appendInner=function(n){return new pg(this,n)},ve.prototype.slice=function(n,e){return n===void 0&&(n=0),e===void 0&&(e=this.length),n>=e?ve.empty:this.sliceInner(Math.max(0,n),Math.min(this.length,e))},ve.prototype.get=function(n){if(!(n<0||n>=this.length))return this.getInner(n)},ve.prototype.forEach=function(n,e,t){e===void 0&&(e=0),t===void 0&&(t=this.length),e<=t?this.forEachInner(n,e,t,0):this.forEachInvertedInner(n,e,t,0)},ve.prototype.map=function(n,e,t){e===void 0&&(e=0),t===void 0&&(t=this.length);var r=[];return this.forEach(function(i,o){return r.push(n(i,o))},e,t),r},ve.from=function(n){return n instanceof ve?n:n&&n.length?new pf(n):ve.empty};var pf=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,i){return r==0&&i==this.length?this:new e(this.values.slice(r,i))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,i,o,s){for(var a=i;a<o;a++)if(r(this.values[a],s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){for(var a=i-1;a>=o;a--)if(r(this.values[a],s+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Ho)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Ho)return new e(r.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(ve);ve.empty=new pf([]);var pg=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,r,i,o){var s=this.left.length;return!(r<s&&this.left.forEachInner(t,r,Math.min(i,s),o)===!1)&&!(i>s&&this.right.forEachInner(t,Math.max(r-s,0),Math.min(this.length,i)-s,o+s)===!1)&&void 0},e.prototype.forEachInvertedInner=function(t,r,i,o){var s=this.left.length;return!(r>s&&this.right.forEachInvertedInner(t,r-s,Math.max(i,s)-s,o+s)===!1)&&!(i<s&&this.left.forEachInvertedInner(t,Math.min(r,s),i,o)===!1)&&void 0},e.prototype.sliceInner=function(t,r){if(t==0&&r==this.length)return this;var i=this.left.length;return r<=i?this.left.slice(t,r):t>=i?this.right.slice(t-i,r-i):this.left.slice(t,i).append(this.right.slice(0,r-i))},e.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new e(r,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(ve),ff=ve;const mf=Math.pow(2,16);function fg(n,e){return n+e*mf}function fd(n){return 65535&n}let Qa=class{constructor(n,e,t){this.pos=n,this.delInfo=e,this.recover=t}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}},Hn=class Jn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Jn.empty)return Jn.empty}recover(e){let t=0,r=fd(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*r]+t+function(i){return(i-(65535&i))/mf}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=l+i+((u?e==l?-1:e==d?1:t:t)<0?0:c);if(r)return h;let p=e==(t<0?l:d)?null:fg(a/3,e-l),f=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(f|=8),new Qa(h,f,p)}i+=c-u}return r?e+i:new Qa(e+i,0,null)}touches(e,t){let r=0,i=fd(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o];if(e<=l+u&&a==3*i)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new Jn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Jn.empty:new Jn(e<0?[0,-e,0]:[0,0,e])}};Hn.empty=new Hn([]);class pi{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new pi(this.maps,this.mirror,e,t)}copy(){return new pi(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new pi;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o].mapResult(e,t);if(s.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this.maps[a].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new Qa(e,i,null)}}const ia=Object.create(null);let Fe=class{getMap(){return Hn.empty}merge(n){return null}static fromJSON(n,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let t=ia[e.stepType];if(!t)throw new RangeError(`No step type ${e.stepType} defined`);return t.fromJSON(n,e)}static jsonID(n,e){if(n in ia)throw new RangeError("Duplicate use of step JSON ID "+n);return ia[n]=e,e.prototype.jsonID=n,e}},Ye=class Jr{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Jr(e,null)}static fail(e){return new Jr(null,e)}static fromReplace(e,t,r,i){try{return Jr.ok(e.replace(t,r,i))}catch(o){if(o instanceof _r)return Jr.fail(o.message);throw o}}};function Kl(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Kl(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return H.fromArray(r)}let Ef=class qr extends Fe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new B(Kl(t.content,(s,a)=>s.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return Ye.fromReplace(e,this.from,this.to,o)}invert(){return new Af(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new qr(t.pos,r.pos,this.mark)}merge(e){return e instanceof qr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new qr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new qr(t.from,t.to,e.markFromJSON(t.mark))}};Fe.jsonID("addMark",Ef);let Af=class Zr extends Fe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new B(Kl(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Ye.fromReplace(e,this.from,this.to,r)}invert(){return new Ef(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Zr(t.pos,r.pos,this.mark)}merge(e){return e instanceof Zr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Zr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Zr(t.from,t.to,e.markFromJSON(t.mark))}};Fe.jsonID("removeMark",Af);let gf=class Qr extends Fe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ye.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ye.fromReplace(e,this.pos,this.pos+1,new B(H.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Qr(this.pos,t.marks[i]);return new Qr(this.pos,this.mark)}}return new Df(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Qr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Qr(t.pos,e.markFromJSON(t.mark))}};Fe.jsonID("addNodeMark",gf);let Df=class el extends Fe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ye.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ye.fromReplace(e,this.pos,this.pos+1,new B(H.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new gf(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new el(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new el(t.pos,e.markFromJSON(t.mark))}};Fe.jsonID("removeNodeMark",Df);Fe.jsonID("replace",class An extends Fe{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&tl(e,this.from,this.to)?Ye.fail("Structure replace would overwrite content"):Ye.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Hn([this.from,this.to-this.from,this.slice.size])}invert(e){return new An(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new An(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof An)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new An(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new An(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new An(t.from,t.to,B.fromJSON(e,t.slice),!!t.structure)}});function tl(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}Fe.jsonID("replaceAround",class Eo extends Fe{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(tl(e,this.from,this.gapFrom)||tl(e,this.gapTo,this.to)))return Ye.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ye.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Ye.fromReplace(e,this.from,this.to,r):Ye.fail("Content does not fit in gap")}getMap(){return new Hn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Eo(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new Eo(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Eo(t.from,t.to,t.gapFrom,t.gapTo,B.fromJSON(e,t.slice),t.insert,!!t.structure)}});Fe.jsonID("attr",class Ao extends Fe{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ye.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Ye.fromReplace(e,this.pos,this.pos+1,new B(H.from(i),0,t.isLeaf?0:1))}getMap(){return Hn.empty}invert(e){return new Ao(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ao(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ao(t.pos,t.attr,t.value)}});Fe.jsonID("docAttr",class nl extends Fe{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Ye.ok(r)}getMap(){return Hn.empty}invert(e){return new nl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new nl(t.attr,t.value)}});let eo=class extends Error{};eo=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(eo.prototype=Object.create(Error.prototype)).constructor=eo,eo.prototype.name="TransformError";class pt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r,i,o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}t&&(r=this.remapping(o,this.items.length),i=r.maps.length);let s,a,l=e.tr,u=[],c=[];return this.items.forEach((d,h)=>{if(!d.step)return r||(r=this.remapping(o,h+1),i=r.maps.length),i--,void c.push(d);if(r){c.push(new Ct(d.map));let p,f=d.step.map(r.slice(i));f&&l.maybeStep(f).doc&&(p=l.mapping.maps[l.mapping.maps.length-1],u.push(new Ct(p,void 0,void 0,u.length+c.length))),i--,p&&r.appendMap(p,i)}else l.maybeStep(d.step);return d.selection?(s=r?d.selection.map(r.slice(i)):d.selection,a=new pt(this.items.slice(0,o).append(c.reverse().concat(u)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:a,transform:l,selection:s}}addTransform(e,t,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let d,h=e.steps[c].invert(e.docs[c]),p=new Ct(e.mapping.maps[c],h,t);(d=l&&l.merge(p))&&(p=d,c?o.pop():a=a.slice(0,a.length-1)),o.push(p),t&&(s++,t=void 0),i||(l=p)}let u=s-r.depth;return u>mg&&(a=function(c,d){let h;return c.forEach((p,f)=>{if(p.selection&&d--==0)return h=f,!1}),c.slice(h)}(a,u),s-=u),new pt(a.append(o),s)}remapping(e,t){let r=new pi;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new pt(this.items.append(e.map(t=>new Ct(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=t;this.items.forEach(h=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let f=o.maps[p];if(h.step){let m=e.steps[p].invert(e.docs[p]),E=h.selection&&h.selection.map(o.slice(l+1,p));E&&a++,r.push(new Ct(f,m,E))}else r.push(new Ct(f))},i);let u=[];for(let h=t;h<s;h++)u.push(new Ct(o.maps[h]));let c=this.items.slice(0,i).append(u).append(r),d=new pt(c,a);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(t.slice(r)),u=l&&l.getMap();if(r--,u&&t.appendMap(u,r),l){let c=s.selection&&s.selection.map(t.slice(r));c&&o++;let d,h=new Ct(u.invert(),l,c),p=i.length-1;(d=i.length&&i[p].merge(h))?i[p]=d:i.push(h)}}else s.map&&r--},this.items.length,0),new pt(ff.from(i.reverse()),o)}}pt.empty=new pt(ff.empty,0);class Ct{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Ct(t.getMap().invert(),t,this.selection)}}}class Zt{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const mg=20;function md(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function oa(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}let sa=!1,Ed=null;function go(n){let e=n.plugins;if(Ed!=e){sa=!1,Ed=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){sa=!0;break}}return sa}const In=new fs("history"),Eg=new fs("closeHistory");function Ag(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new ps({key:In,state:{init:()=>new Zt(pt.empty,pt.empty,null,0,-1),apply:(e,t,r)=>function(i,o,s,a){let l,u=s.getMeta(In);if(u)return u.historyState;s.getMeta(Eg)&&(i=new Zt(i.done,i.undone,null,0,-1));let c=s.getMeta("appendedTransaction");if(s.steps.length==0)return i;if(c&&c.getMeta(In))return c.getMeta(In).redo?new Zt(i.done.addTransform(s,void 0,a,go(o)),i.undone,md(s.mapping.maps),i.prevTime,i.prevComposition):new Zt(i.done,i.undone.addTransform(s,void 0,a,go(o)),null,i.prevTime,i.prevComposition);if(s.getMeta("addToHistory")===!1||c&&c.getMeta("addToHistory")===!1)return(l=s.getMeta("rebased"))?new Zt(i.done.rebased(s,l),i.undone.rebased(s,l),oa(i.prevRanges,s.mapping),i.prevTime,i.prevComposition):new Zt(i.done.addMaps(s.mapping.maps),i.undone.addMaps(s.mapping.maps),oa(i.prevRanges,s.mapping),i.prevTime,i.prevComposition);{let d=s.getMeta("composition"),h=i.prevTime==0||!c&&i.prevComposition!=d&&(i.prevTime<(s.time||0)-a.newGroupDelay||!function(f,m){if(!m)return!1;if(!f.docChanged)return!0;let E=!1;return f.mapping.maps[0].forEach((A,D)=>{for(let _=0;_<m.length;_+=2)A<=m[_+1]&&D>=m[_]&&(E=!0)}),E}(s,i.prevRanges)),p=c?oa(i.prevRanges,s.mapping):md(s.mapping.maps);return new Zt(i.done.addTransform(s,h?o.selection.getBookmark():void 0,a,go(o)),pt.empty,p,s.time,d==null?i.prevComposition:d)}}(t,r,e,n)},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?_f:r=="historyRedo"?Sf:null;return!!i&&(t.preventDefault(),i(e.state,e.dispatch))}}}})}function Of(n,e){return(t,r)=>{let i=In.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=function(s,a,l){let u=go(a),c=In.get(a).spec.config,d=(l?s.undone:s.done).popEvent(a,u);if(!d)return null;let h=d.selection.resolve(d.transform.doc),p=(l?s.done:s.undone).addTransform(d.transform,a.selection.getBookmark(),c,u),f=new Zt(l?p:d.remaining,l?d.remaining:p,null,0,-1);return d.transform.setSelection(h).setMeta(In,{redo:l,historyState:f})}(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const _f=Of(!1,!0),Sf=Of(!0,!0),Tf=Math.pow(2,16);function gg(n,e){return n+e*Tf}function Ad(n){return 65535&n}class gd{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class rt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&rt.empty)return rt.empty}recover(e){let t=0,r=Ad(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*r]+t+function(i){return(i-(65535&i))/Tf}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=l+i+((u?e==l?-1:e==d?1:t:t)<0?0:c);if(r)return h;let p=e==(t<0?l:d)?null:gg(a/3,e-l),f=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(f|=8),new gd(h,f,p)}i+=c-u}return r?e+i:new gd(e+i,0,null)}touches(e,t){let r=0,i=Ad(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o];if(e<=l+u&&a==3*i)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new rt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?rt.empty:new rt(e<0?[0,-e,0]:[0,0,e])}}rt.empty=new rt([]);const aa=Object.create(null);class Pe{getMap(){return rt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=aa[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in aa)throw new RangeError("Duplicate use of step JSON ID "+e);return aa[e]=t,t.prototype.jsonID=e,t}}class ge{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new ge(e,null)}static fail(e){return new ge(null,e)}static fromReplace(e,t,r,i){try{return ge.ok(e.replace(t,r,i))}catch(o){if(o instanceof _r)return ge.fail(o.message);throw o}}}function Wl(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Wl(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return H.fromArray(r)}class Nn extends Pe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new B(Wl(t.content,(s,a)=>s.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return ge.fromReplace(e,this.from,this.to,o)}invert(){return new vn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Nn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Nn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Nn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Nn(t.from,t.to,e.markFromJSON(t.mark))}}Pe.jsonID("addMark",Nn);class vn extends Pe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new B(Wl(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return ge.fromReplace(e,this.from,this.to,r)}invert(){return new Nn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new vn(t.pos,r.pos,this.mark)}merge(e){return e instanceof vn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new vn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new vn(t.from,t.to,e.markFromJSON(t.mark))}}Pe.jsonID("removeMark",vn);class yn extends Pe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ge.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ge.fromReplace(e,this.pos,this.pos+1,new B(H.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new yn(this.pos,t.marks[i]);return new yn(this.pos,this.mark)}}return new Ci(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new yn(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new yn(t.pos,e.markFromJSON(t.mark))}}Pe.jsonID("addNodeMark",yn);class Ci extends Pe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ge.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ge.fromReplace(e,this.pos,this.pos+1,new B(H.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new yn(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ci(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ci(t.pos,e.markFromJSON(t.mark))}}Pe.jsonID("removeNodeMark",Ci);class ht extends Pe{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&rl(e,this.from,this.to)?ge.fail("Structure replace would overwrite content"):ge.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new rt([this.from,this.to-this.from,this.slice.size])}invert(e){return new ht(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new ht(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof ht)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ht(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ht(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ht(t.from,t.to,B.fromJSON(e,t.slice),!!t.structure)}}Pe.jsonID("replace",ht);class un extends Pe{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(rl(e,this.from,this.gapFrom)||rl(e,this.gapTo,this.to)))return ge.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ge.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?ge.fromReplace(e,this.from,this.to,r):ge.fail("Content does not fit in gap")}getMap(){return new rt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new un(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new un(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new un(t.from,t.to,t.gapFrom,t.gapTo,B.fromJSON(e,t.slice),t.insert,!!t.structure)}}function rl(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function Dg(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Jl(n){let e=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let t=n.depth;;--t){let r=n.$from.node(t),i=n.$from.index(t),o=n.$to.indexAfter(t);if(t<n.depth&&r.canReplace(i,o,e))return t;if(t==0||r.type.spec.isolating||!Dg(r,i,o))break}return null}function Do(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=t-2;u>o;u--,c--){let d=i.node(u),h=i.index(u);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(h,d.childCount),f=r&&r[c+1];f&&(p=p.replaceChild(0,f.type.create(f.attrs)));let m=r&&r[c]||d;if(!d.canReplace(h+1,d.childCount)||!m.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Dd(n,e){let t=n.resolve(e),r=t.index();return function(i,o){return!(!i||!o||i.isLeaf||!function(s,a){a.content.size||s.type.compatibleContent(a.type);let l=s.contentMatchAt(s.childCount),{linebreakReplacement:u}=s.type.schema;for(let c=0;c<a.childCount;c++){let d=a.child(c),h=d.type==u?s.type.schema.nodes.text:d.type;if(l=l.matchType(h),!l||!s.type.allowsMarks(d.marks))return!1}return l.validEnd}(i,o))}(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Rf(n,e,t=e,r=B.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return function(s,a,l){return!l.openStart&&!l.openEnd&&s.start()==a.start()&&s.parent.canReplace(s.index(),a.index(),l.content)}(i,o,r)?new ht(e,t,r):new Og(i,o,r).fit()}Pe.jsonID("replaceAround",un);class Og{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=H.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=H.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new B(o,s,a);return e>-1?new un(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new ht(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=la(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let l,{type:u,match:c}=this.frontier[a],d=null;if(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(H.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:d};if(t==2&&s&&(l=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:l};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=la(e,t);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new B(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=la(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new B(ei(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new B(ei(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,u=0,c=[],{match:d,type:h}=this.frontier[t];if(i){for(let m=0;m<i.childCount;m++)c.push(i.child(m));d=d.matchFragment(i)}let p=a.size+e-(s.content.size-s.openEnd);for(;u<a.childCount;){let m=a.child(u),E=d.matchType(m.type);if(!E)break;u++,(u>1||l==0||m.content.size)&&(d=E,c.push(Cf(m.mark(h.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?p:-1)))}let f=u==a.childCount;f||(p=-1),this.placed=ti(this.placed,t,H.from(c)),this.frontier[t].match=d,f&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,E=a;m<p;m++){let A=E.lastChild;this.frontier.push({type:A.type,match:A.contentMatchAt(A.childCount)}),E=A.content}this.unplaced=f?e==0?B.empty:new B(ei(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new B(ei(s.content,e,u),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!ua(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=ua(e,t,i,r,o);if(s){for(let a=t-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],c=ua(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:t,fit:s,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=ti(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=ti(this.placed,this.depth,H.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(H.empty,!0);e.childCount&&(this.placed=ti(this.placed,this.frontier.length,e))}}function ei(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(ei(n.firstChild.content,e-1,t)))}function ti(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(ti(n.lastChild.content,e-1,t)))}function la(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Cf(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Cf(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(H.empty,!0)))),n.copy(r)}function ua(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(l,u,c){for(let d=c;d<u.childCount;d++)if(!l.allowsMarks(u.child(d).marks))return!0;return!1}(t,o.content,s)?a:null}class fi extends Pe{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return ge.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return ge.fromReplace(e,this.pos,this.pos+1,new B(H.from(i),0,t.isLeaf?0:1))}getMap(){return rt.empty}invert(e){return new fi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new fi(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fi(t.pos,t.attr,t.value)}}Pe.jsonID("attr",fi);class Uo extends Pe{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return ge.ok(r)}getMap(){return rt.empty}invert(e){return new Uo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Uo(t.attr,t.value)}}Pe.jsonID("docAttr",Uo);let to=class extends Error{};to=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(to.prototype=Object.create(Error.prototype)).constructor=to,to.prototype.name="TransformError";const If=(n,e)=>!n.selection.empty&&(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function Tr(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}function Od(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function _d(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}function il(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const _g=(n,e)=>{let{$from:t,$to:r}=n.selection;if(n.selection instanceof X&&n.selection.node.isBlock)return!(!t.parentOffset||!Do(n.doc,t.pos)||(e&&e(n.tr.split(t.pos).scrollIntoView()),0));if(!t.depth)return!1;let i,o,s=[],a=!1,l=!1;for(let h=t.depth;;h--){if(t.node(h).isBlock){a=t.end(h)==t.pos+(t.depth-h),l=t.start(h)==t.pos-(t.depth-h),o=il(t.node(h-1).contentMatchAt(t.indexAfter(h-1))),s.unshift(a&&o?{type:o}:null),i=h;break}if(h==1)return!1;s.unshift(null)}let u=n.tr;(n.selection instanceof ne||n.selection instanceof st)&&u.deleteSelection();let c=u.mapping.map(t.pos),d=Do(u.doc,c,s.length,s);if(d||(s[0]=o?{type:o}:null,d=Do(u.doc,c,s.length,s)),u.split(c,s.length,s),!a&&l&&t.node(i).type!=o){let h=u.mapping.map(t.before(i)),p=u.doc.resolve(h);o&&t.node(i-1).canReplaceWith(p.index(),p.index()+1,o)&&u.setNodeMarkup(u.mapping.map(t.before(i)),o)}return e&&e(u.scrollIntoView()),!0};function Nf(n,e,t,r){let i,o,s=e.nodeBefore,a=e.nodeAfter,l=s.type.spec.isolating||a.type.spec.isolating;if(!l&&function(p,f,m){let E=f.nodeBefore,A=f.nodeAfter,D=f.index();return!(!(E&&A&&E.type.compatibleContent(A.type))||(!E.content.size&&f.parent.canReplace(D-1,D)?(m&&m(p.tr.delete(f.pos-E.nodeSize,f.pos).scrollIntoView()),0):!f.parent.canReplace(D,D+1)||!A.isTextblock&&!Dd(p.doc,f.pos)||(m&&m(p.tr.join(f.pos).scrollIntoView()),0)))}(n,e,t))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(i=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(i[0]||a.type).validEnd){if(t){let p=e.pos+a.nodeSize,f=H.empty;for(let A=i.length-1;A>=0;A--)f=H.from(i[A].create(null,f));f=H.from(s.copy(f));let m=n.tr.step(new un(e.pos-1,p,e.pos,p,new B(f,1,0),i.length,!0)),E=m.doc.resolve(p+2*i.length);E.nodeAfter&&E.nodeAfter.type==s.type&&Dd(m.doc,E.pos)&&m.join(E.pos),t(m.scrollIntoView())}return!0}let c=a.type.spec.isolating||r>0&&l?null:Q.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),h=d&&Jl(d);if(h!=null&&h>=e.depth)return t&&t(n.tr.lift(d,h).scrollIntoView()),!0;if(u&&Tr(a,"start",!0)&&Tr(s,"end")){let p=s,f=[];for(;f.push(p),!p.isTextblock;)p=p.lastChild;let m=a,E=1;for(;!m.isTextblock;m=m.firstChild)E++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(t){let A=H.empty;for(let D=f.length-1;D>=0;D--)A=H.from(f[D].copy(A));t(n.tr.step(new un(e.pos-f.length,e.pos+a.nodeSize,e.pos+E,e.pos+a.nodeSize-E,new B(A,f.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function vf(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(t&&t(e.tr.setSelection(ne.create(e.doc,n<0?i.start(o):i.end(o)))),!0)}}const Sg=vf(-1),Tg=vf(1);function ql(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}let ca=ql(If,(n,e,t)=>{let r=function(s,a){let{$cursor:l}=s.selection;return!l||(a?!a.endOfTextblock("backward",s):l.parentOffset>0)?null:l}(n,t);if(!r)return!1;let i=Od(r);if(!i){let s=r.blockRange(),a=s&&Jl(s);return a!=null&&(e&&e(n.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(Nf(n,i,e,-1))return!0;if(r.parent.content.size==0&&(Tr(o,"end")||X.isSelectable(o)))for(let s=r.depth;;s--){let a=Rf(n.doc,r.before(s),r.after(s),B.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=n.tr.step(a);l.setSelection(Tr(o,"end")?Q.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):X.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)},(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=Od(r)}let s=o&&o.nodeBefore;return!(!s||!X.isSelectable(s))&&(e&&e(n.tr.setSelection(X.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)}),Sd=ql(If,(n,e,t)=>{let r=function(s,a){let{$cursor:l}=s.selection;return!l||(a?!a.endOfTextblock("forward",s):l.parentOffset<l.parent.content.size)?null:l}(n,t);if(!r)return!1;let i=_d(r);if(!i)return!1;let o=i.nodeAfter;if(Nf(n,i,e,1))return!0;if(r.parent.content.size==0&&(Tr(o,"start")||X.isSelectable(o))){let s=Rf(n.doc,r.before(),r.after(),B.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=n.tr.step(s);a.setSelection(Tr(o,"start")?Q.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):X.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=_d(r)}let s=o&&o.nodeAfter;return!(!s||!X.isSelectable(s))&&(e&&e(n.tr.setSelection(X.create(n.doc,o.pos)).scrollIntoView()),!0)});const $t={Enter:ql((n,e)=>{let{$head:t,$anchor:r}=n.selection;return!(!t.parent.type.spec.code||!t.sameParent(r))&&(e&&e(n.tr.insertText(`
1196
+ `).scrollIntoView()),!0)},(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof st||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=il(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=n.tr.insert(s,o.createAndFill());a.setSelection(ne.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(Do(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Jl(r);return i!=null&&(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},_g),"Mod-Enter":(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),s=il(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=t.after(),l=n.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Q.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Backspace:ca,"Mod-Backspace":ca,"Shift-Backspace":ca,Delete:Sd,"Mod-Delete":Sd,"Mod-a":(n,e)=>(e&&e(n.tr.setSelection(new st(n.doc))),!0)},yf={"Ctrl-h":$t.Backspace,"Alt-Backspace":$t["Mod-Backspace"],"Ctrl-d":$t.Delete,"Ctrl-Alt-Backspace":$t["Mod-Delete"],"Alt-Delete":$t["Mod-Delete"],"Alt-d":$t["Mod-Delete"],"Ctrl-a":Sg,"Ctrl-e":Tg};for(let n in $t)yf[n]=$t[n];const no=(typeof navigator!="undefined"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!(typeof os=="undefined"||!os.platform)&&os.platform()=="darwin")?yf:$t;function Zl(n,e){return n.reduce((t,r,i)=>t.concat(e(r,i)),[])}const mi=(n,e,t=void 0)=>Zl(n,r=>{if(typeof r=="string")return e(r,t);switch(r.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return[{type:r.type,children:mi(r.children,e,r.type)}];case"link":return[{type:r.type,url:r.url,children:mi(r.children,e,r.type)}];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return[{type:r.type,action:r.action,params:r.params,children:mi(r.children,e,r.type)}];case"mention":case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return[r]}});function Wt(n,e){return t=>{const r=t;let i=0;const o=[];for(const s of cs(t,n)){s.index-i>0&&o.push(r.substring(i,s.index));const a=e(s);Array.isArray(a)?o.push(...a):o.push(a),i=s.index+s[0].length}return i<t.length&&o.push(t.substring(i)),o}}function bf(n){return n.replace(/<!!mention:.*?\|([^>]*)>/gim,"@$1").replace(/<!!customemoji:(.*?)>/gim,"$1")}const Td="’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var ol=(n=>(n[n.italic=1]="italic",n[n.strikethrough=2]="strikethrough",n[n.bold=4]="bold",n))(ol||{});const Rg=[0,1,2,3,4,5,6].map(n=>{const e=[];return 1&n||e.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/),2&n||e.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/),4&n||e.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/),new RegExp(e.map(t=>t.source).join("|"),"g")}),Cg={_:1,"*":4,"~":2};function Ig(n){return Lf(n,0)}function Lf(n,e=0){const t=Rg[e],r=t?function(i){const o=Ng.getOrCompute(i,()=>new RegExp(`(?:^|[\\s${Td}])(?:${i.source})(?=[\\s${Td}]|$)`,"g")),s=Wt(o,a=>{const l=a[0][1],u=a[1]||a[2]||a[3]||a[4]||a[5]||a[6];return[" ",{type:ol[Cg[l]],children:[u]}]});return a=>{const[l,...u]=s(" "+a);return l.length>1&&u.unshift(l.substring(1)),u}}(t):()=>[n];return mi(r(n),(i,o)=>o==="bold"||o==="italic"||o==="strikethrough"?Lf(i,e|ol[o]):[i])}const Ng=function(){const n=function(){try{return new WeakMap}catch(e){const t={has:()=>!1,get:()=>{},set:()=>t};return t}}();return{getOrCompute(e,t){if(n.has(e))return n.get(e);const r=t();return n.set(e,r),r}}}();function Rd(n,e){if(Array.prototype.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function fn(n,e){for(var t=n.length-1;t>=0;t--)e(n[t])===!0&&n.splice(t,1)}function kf(n){throw new Error("Unhandled case for value: '"+n+"'")}var sl=function(){function n(e){e===void 0&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return n.prototype.setTagName=function(e){return this.tagName=e,this},n.prototype.getTagName=function(){return this.tagName||""},n.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},n.prototype.getAttr=function(e){return this.getAttrs()[e]},n.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},n.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},n.prototype.setClass=function(e){return this.setAttr("class",e)},n.prototype.addClass=function(e){for(var t,r=this.getClass(),i=this.whitespaceRegex,o=r?r.split(i):[],s=e.split(i);t=s.shift();)Rd(o,t)===-1&&o.push(t);return this.getAttrs().class=o.join(" "),this},n.prototype.removeClass=function(e){for(var t,r=this.getClass(),i=this.whitespaceRegex,o=r?r.split(i):[],s=e.split(i);o.length&&(t=s.shift());){var a=Rd(o,t);a!==-1&&o.splice(a,1)}return this.getAttrs().class=o.join(" "),this},n.prototype.getClass=function(){return this.getAttrs().class||""},n.prototype.hasClass=function(e){return(" "+this.getClass()+" ").indexOf(" "+e+" ")!==-1},n.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},n.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},n.prototype.getInnerHTML=function(){return this.innerHTML||""},n.prototype.getInnerHtml=function(){return this.getInnerHTML()},n.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},n.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")},n}(),Cd=function(){function n(e){e===void 0&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return n.prototype.build=function(e){return new sl({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},n.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},r=this.createCssClass(e);return r&&(t.class=r),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},n.prototype.createCssClass=function(e){var t=this.className;if(t){for(var r=[t],i=e.getCssClassSuffixes(),o=0,s=i.length;o<s;o++)r.push(t+"-"+i[o]);return r.join(" ")}return""},n.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},n.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var r=t.length,i=t.location;return i==="smart"?function(o,s,a){var l,u;a==null?(a="&hellip;",u=3,l=8):(u=a.length,l=a.length);var c=function(S){var T="";return S.scheme&&S.host&&(T+=S.scheme+"://"),S.host&&(T+=S.host),S.path&&(T+="/"+S.path),S.query&&(T+="?"+S.query),S.fragment&&(T+="#"+S.fragment),T},d=function(S,T){var N=T/2,I=Math.ceil(N),L=-1*Math.floor(N),g="";return L<0&&(g=S.substr(L)),S.substr(0,I)+a+g};if(o.length<=s)return o;var h=s-u,p=function(S){var T={},N=S,I=N.match(/^([a-z]+):\/\//i);return I&&(T.scheme=I[1],N=N.substr(I[0].length)),(I=N.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(T.host=I[1],N=N.substr(I[0].length)),(I=N.match(/^\/(.*?)(?=(\?|#|$))/i))&&(T.path=I[1],N=N.substr(I[0].length)),(I=N.match(/^\?(.*?)(?=(#|$))/i))&&(T.query=I[1],N=N.substr(I[0].length)),(I=N.match(/^#(.*?)$/i))&&(T.fragment=I[1]),T}(o);if(p.query){var f=p.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(p.query=p.query.substr(0,f[1].length),o=c(p))}if(o.length<=s||(p.host&&(p.host=p.host.replace(/^www\./,""),o=c(p)),o.length<=s))return o;var m="";if(p.host&&(m+=p.host),m.length>=h)return p.host.length==s?(p.host.substr(0,s-u)+a).substr(0,h+l):d(m,h).substr(0,h+l);var E="";if(p.path&&(E+="/"+p.path),p.query&&(E+="?"+p.query),E){if((m+E).length>=h)return(m+E).length==s?(m+E).substr(0,s):(m+d(E,h-m.length)).substr(0,h+l);m+=E}if(p.fragment){var A="#"+p.fragment;if((m+A).length>=h)return(m+A).length==s?(m+A).substr(0,s):(m+d(A,h-m.length)).substr(0,h+l);m+=A}if(p.scheme&&p.host){var D=p.scheme+"://";if((m+D).length<h)return(D+m).substr(0,s)}if(m.length<=s)return m;var _="";return h>0&&(_=m.substr(-1*Math.floor(h/2))),(m.substr(0,Math.ceil(h/2))+a+_).substr(0,h+l)}(e,r):i==="middle"?function(o,s,a){if(o.length<=s)return o;var l,u;a==null?(a="&hellip;",l=8,u=3):(l=a.length,u=a.length);var c=s-u,d="";return c>0&&(d=o.substr(-1*Math.floor(c/2))),(o.substr(0,Math.ceil(c/2))+a+d).substr(0,c+l)}(e,r):function(o,s,a){return function(l,u,c){var d;return l.length>u&&(c==null?(c="&hellip;",d=3):d=c.length,l=l.substring(0,u-d)+c),l}(o,s,a)}(e,r)},n}(),yr=function(){function n(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return n.prototype.getMatchedText=function(){return this.matchedText},n.prototype.setOffset=function(e){this.offset=e},n.prototype.getOffset=function(){return this.offset},n.prototype.getCssClassSuffixes=function(){return[this.getType()]},n.prototype.buildTag=function(){return this.tagBuilder.build(this)},n}(),al=function(n,e){return al=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},al(n,e)};function Mt(n,e){function t(){this.constructor=n}al(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Id,ce=function(){return ce=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},ce.apply(this,arguments)},Ql=function(n){function e(t){var r=n.call(this,t)||this;return r.email="",r.email=t.email,r}return Mt(e,n),e.prototype.getType=function(){return"email"},e.prototype.getEmail=function(){return this.email},e.prototype.getAnchorHref=function(){return"mailto:"+this.email},e.prototype.getAnchorText=function(){return this.email},e}(yr),wf=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="",r.hashtag="",r.serviceName=t.serviceName,r.hashtag=t.hashtag,r}return Mt(e,n),e.prototype.getType=function(){return"hashtag"},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getHashtag=function(){return this.hashtag},e.prototype.getAnchorHref=function(){var t=this.serviceName,r=this.hashtag;switch(t){case"twitter":return"https://twitter.com/hashtag/"+r;case"facebook":return"https://www.facebook.com/hashtag/"+r;case"instagram":return"https://instagram.com/explore/tags/"+r;default:throw new Error("Unknown service name to point hashtag to: "+t)}},e.prototype.getAnchorText=function(){return"#"+this.hashtag},e}(yr),Mf=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.mention="",r.mention=t.mention,r.serviceName=t.serviceName,r}return Mt(e,n),e.prototype.getType=function(){return"mention"},e.prototype.getMention=function(){return this.mention},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},e.prototype.getAnchorText=function(){return"@"+this.mention},e.prototype.getCssClassSuffixes=function(){var t=n.prototype.getCssClassSuffixes.call(this),r=this.getServiceName();return r&&t.push(r),t},e}(yr),Ff=function(n){function e(t){var r=n.call(this,t)||this;return r.number="",r.plusSign=!1,r.number=t.number,r.plusSign=t.plusSign,r}return Mt(e,n),e.prototype.getType=function(){return"phone"},e.prototype.getPhoneNumber=function(){return this.number},e.prototype.getNumber=function(){return this.getPhoneNumber()},e.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},e.prototype.getAnchorText=function(){return this.matchedText},e}(yr),eu=function(n){function e(t){var r=n.call(this,t)||this;return r.url="",r.urlMatchType="scheme",r.protocolUrlMatch=!1,r.protocolRelativeMatch=!1,r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.schemePrefixRegex=/^(https?:\/\/)?/i,r.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,r.protocolRelativeRegex=/^\/\//,r.protocolPrepended=!1,r.urlMatchType=t.urlMatchType,r.url=t.url,r.protocolUrlMatch=t.protocolUrlMatch,r.protocolRelativeMatch=t.protocolRelativeMatch,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return Mt(e,n),e.prototype.getType=function(){return"url"},e.prototype.getUrlMatchType=function(){return this.urlMatchType},e.prototype.getUrl=function(){var t=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(t=this.url="http://"+t,this.protocolPrepended=!0),t},e.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,"&")},e.prototype.getAnchorText=function(){var t=this.getMatchedText();return this.protocolRelativeMatch&&(t=this.stripProtocolRelativePrefix(t)),this.stripPrefix.scheme&&(t=this.stripSchemePrefix(t)),this.stripPrefix.www&&(t=this.stripWwwPrefix(t)),this.stripTrailingSlash&&(t=this.removeTrailingSlash(t)),this.decodePercentEncoding&&(t=this.removePercentEncoding(t)),t},e.prototype.stripSchemePrefix=function(t){return t.replace(this.schemePrefixRegex,"")},e.prototype.stripWwwPrefix=function(t){return t.replace(this.wwwPrefixRegex,"$1")},e.prototype.stripProtocolRelativePrefix=function(t){return t.replace(this.protocolRelativeRegex,"")},e.prototype.removeTrailingSlash=function(t){return t.charAt(t.length-1)==="/"&&(t=t.slice(0,-1)),t},e.prototype.removePercentEncoding=function(t){var r=t.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(r)}catch(i){return r}},e}(yr),br=function(n){this.__jsduckDummyDocProp=null,this.tagBuilder=n.tagBuilder},da=/[A-Za-z]/,vg=/[\d]/,yg=/[\D]/,mn=/\s/,ha=/['"]/,bg=/[\x00-\x1F\x7F]/,xf=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,Pf=xf+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\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\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,jo=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,Lg=Pf+jo,fe=Pf+jo,kg="(?:["+jo+"]{1,3}\\.){3}["+jo+"]{1,3}",wg="["+fe+"](?:["+fe+"\\-]{0,61}["+fe+"])?",Nd=function(n){return"(?=("+wg+"))\\"+n},pa=function(n){return"(?:"+Nd(n)+"(?:\\."+Nd(n+1)+"){0,126}|"+kg+")"},ro=new RegExp("["+fe+"]"),Bf=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,Mg=new RegExp("["+fe+"!#$%&'*+/=?^_`{|}~-]"),Fg=new RegExp("^"+Bf.source+"$"),vd=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.localPartCharRegex=Mg,t.strictTldRegex=Fg,t}return Mt(e,n),e.prototype.parseMatches=function(t){for(var r=this.tagBuilder,i=this.localPartCharRegex,o=this.strictTldRegex,s=[],a=t.length,l=new io,u={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},c=0,d=0,h=l;c<a;){var p=t.charAt(c);switch(d){case 0:f(p);break;case 1:m(t.charAt(c-1),p);break;case 2:E(p);break;case 3:A(p);break;case 4:D(p);break;case 5:_(p);break;case 6:S(p);break;case 7:T(p);break;default:kf(d)}c++}return L(),s;function f(g){g==="m"?N(1):i.test(g)&&N()}function m(g,O){g===":"?i.test(O)?(d=2,h=new io(ce(ce({},h),{hasMailtoPrefix:!0}))):I():u[g]===O||(i.test(O)?d=2:O==="."?d=3:O==="@"?d=4:I())}function E(g){g==="."?d=3:g==="@"?d=4:i.test(g)||I()}function A(g){g==="."||g==="@"?I():i.test(g)?d=2:I()}function D(g){ro.test(g)?d=5:I()}function _(g){g==="."?d=7:g==="-"?d=6:ro.test(g)||L()}function S(g){g==="-"||g==="."?L():ro.test(g)?d=5:L()}function T(g){g==="."||g==="-"?L():ro.test(g)?(d=5,h=new io(ce(ce({},h),{hasDomainDot:!0}))):L()}function N(g){g===void 0&&(g=2),d=g,h=new io({idx:c})}function I(){d=0,h=l}function L(){if(h.hasDomainDot){var g=t.slice(h.idx,c);/[-.]$/.test(g)&&(g=g.slice(0,-1));var O=h.hasMailtoPrefix?g.slice(7):g;(function(k){var w=k.split(".").pop()||"",U=w.toLowerCase();return o.test(U)})(O)&&s.push(new Ql({tagBuilder:r,matchedText:g,offset:h.idx,email:O}))}I()}},e}(br),io=function(n){n===void 0&&(n={}),this.idx=n.idx!==void 0?n.idx:-1,this.hasMailtoPrefix=!!n.hasMailtoPrefix,this.hasDomainDot=!!n.hasDomainDot},xg=function(){function n(){}return n.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},n.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return e.match(t)!==null},n.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},n.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),r=t&&t[0].toLowerCase();return r!=="javascript:"&&r!=="vbscript:"},n.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||e.indexOf(".")!==-1)},n.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&!this.hasFullProtocolRegex.test(t)&&!this.hasWordCharAfterProtocolRegex.test(e)},n.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,n.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,n.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+xf+"]"),n.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,n}(),Pg=(Id=new RegExp("[/?#](?:["+fe+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+fe+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,pa(2),")","|","(","(//)?",/(?:www\.)/.source,pa(6),")","|","(","(//)?",pa(10)+"\\.",Bf.source,"(?![-"+Lg+"])",")",")","(?::[0-9]+)?","(?:"+Id.source+")?"].join(""),"gi")),Bg=new RegExp("["+fe+"]"),yd=function(n){function e(t){var r=n.call(this,t)||this;return r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.matcherRegex=Pg,r.wordCharRegExp=Bg,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return Mt(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.stripPrefix,s=this.stripTrailingSlash,a=this.decodePercentEncoding,l=this.tagBuilder,u=[],c=function(){var h=r[0],p=r[1],f=r[4],m=r[5],E=r[9],A=r.index,D=m||E,_=t.charAt(A-1);if(!xg.isValid(h,p)||A>0&&_==="@"||A>0&&D&&d.wordCharRegExp.test(_))return"continue";if(/\?$/.test(h)&&(h=h.substr(0,h.length-1)),d.matchHasUnbalancedClosingParen(h))h=h.substr(0,h.length-1);else{var S=d.matchHasInvalidCharAfterTld(h,p);S>-1&&(h=h.substr(0,S))}var T=["http://","https://"].find(function(g){return!!p&&p.indexOf(g)!==-1});if(T){var N=h.indexOf(T);h=h.substr(N),p=p.substr(N),A+=N}var I=p?"scheme":f?"www":"tld",L=!!p;u.push(new eu({tagBuilder:l,matchedText:h,offset:A,urlMatchType:I,url:h,protocolUrlMatch:L,protocolRelativeMatch:!!D,stripPrefix:o,stripTrailingSlash:s,decodePercentEncoding:a}))},d=this;(r=i.exec(t))!==null;)c();return u},e.prototype.matchHasUnbalancedClosingParen=function(t){var r,i=t.charAt(t.length-1);if(i===")")r="(";else if(i==="]")r="[";else{if(i!=="}")return!1;r="{"}for(var o=0,s=0,a=t.length-1;s<a;s++){var l=t.charAt(s);l===r?o++:l===i&&(o=Math.max(o-1,0))}return o===0},e.prototype.matchHasInvalidCharAfterTld=function(t,r){if(!t)return-1;var i=0;r&&(i=t.indexOf(":"),t=t.slice(i));var o=new RegExp("^((.?//)?[-."+fe+"]*[-"+fe+"]\\.[-"+fe+"]+)").exec(t);return o===null?-1:(i+=o[1].length,t=t.slice(o[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(t)?i:-1)},e}(br),Hg=new RegExp("#[_"+fe+"]{1,139}(?![_"+fe+"])","g"),Ug=new RegExp("[^"+fe+"]"),bd=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.matcherRegex=Hg,r.nonWordCharRegex=Ug,r.serviceName=t.serviceName,r}return Mt(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.nonWordCharRegex,s=this.serviceName,a=this.tagBuilder,l=[];(r=i.exec(t))!==null;){var u=r.index,c=t.charAt(u-1);if(u===0||o.test(c)){var d=r[0],h=r[0].slice(1);l.push(new wf({tagBuilder:a,matchedText:d,offset:u,serviceName:s,hashtag:h}))}}return l},e}(br),jg=new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source+"|"+/(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source,"g"),Ld=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.matcherRegex=jg,t}return Mt(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.tagBuilder,s=[];(r=i.exec(t))!==null;){var a=r[0],l=a.replace(/[^0-9,;#]/g,""),u=!(!r[1]&&!r[2]),c=r.index==0?"":t.substr(r.index-1,1),d=t.substr(r.index+a.length,1),h=!c.match(/\d/)&&!d.match(/\d/);this.testMatch(r[3])&&this.testMatch(a)&&h&&s.push(new Ff({tagBuilder:o,matchedText:a,offset:r.index,number:l,plusSign:u}))}return s},e.prototype.testMatch=function(t){return yg.test(t)},e}(br),$g=new RegExp("@[_"+fe+"]{1,50}(?![_"+fe+"])","g"),zg=new RegExp("@[_."+fe+"]{1,30}(?![_"+fe+"])","g"),Vg=new RegExp("@[-_."+fe+"]{1,50}(?![-_"+fe+"])","g"),Yg=new RegExp("[^"+fe+"]"),kd=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.matcherRegexes={twitter:$g,instagram:zg,soundcloud:Vg},r.nonWordCharRegex=Yg,r.serviceName=t.serviceName,r}return Mt(e,n),e.prototype.parseMatches=function(t){var r,i=this.serviceName,o=this.matcherRegexes[this.serviceName],s=this.nonWordCharRegex,a=this.tagBuilder,l=[];if(!o)return l;for(;(r=o.exec(t))!==null;){var u=r.index,c=t.charAt(u-1);if(u===0||s.test(c)){var d=r[0].replace(/\.+$/g,""),h=d.slice(1);l.push(new Mf({tagBuilder:a,matchedText:d,offset:u,serviceName:i,mention:h}))}}return l},e}(br);function Gg(n,e){for(var t,r=e.onOpenTag,i=e.onCloseTag,o=e.onText,s=e.onComment,a=e.onDoctype,l=new Tt,u=0,c=n.length,d=0,h=0,p=l;u<c;){var f=n.charAt(u);switch(d){case 0:m(f);break;case 1:E(f);break;case 2:D(f);break;case 3:A(f);break;case 4:_(f);break;case 5:S(f);break;case 6:T(f);break;case 7:N(f);break;case 8:I(f);break;case 9:L(f);break;case 10:g(f);break;case 11:O(f);break;case 12:k(f);break;case 13:w();break;case 14:U(f);break;case 15:y(f);break;case 16:M(f);break;case 17:$(f);break;case 18:j(f);break;case 19:G(f);break;case 20:V(f);break;default:kf(d)}u++}function m(F){F==="<"&&K()}function E(F){F==="!"?d=13:F==="/"?(d=2,p=new Tt(ce(ce({},p),{isClosing:!0}))):F==="<"?K():da.test(F)?(d=3,p=new Tt(ce(ce({},p),{isOpening:!0}))):(d=0,p=l)}function A(F){mn.test(F)?(p=new Tt(ce(ce({},p),{name:ee()})),d=4):F==="<"?K():F==="/"?(p=new Tt(ce(ce({},p),{name:ee()})),d=12):F===">"?(p=new Tt(ce(ce({},p),{name:ee()})),W()):da.test(F)||vg.test(F)||F===":"||Y()}function D(F){F===">"?Y():da.test(F)?d=3:Y()}function _(F){mn.test(F)||(F==="/"?d=12:F===">"?W():F==="<"?K():F==="="||ha.test(F)||bg.test(F)?Y():d=5)}function S(F){mn.test(F)?d=6:F==="/"?d=12:F==="="?d=7:F===">"?W():F==="<"?K():ha.test(F)&&Y()}function T(F){mn.test(F)||(F==="/"?d=12:F==="="?d=7:F===">"?W():F==="<"?K():ha.test(F)?Y():d=5)}function N(F){mn.test(F)||(F==='"'?d=8:F==="'"?d=9:/[>=`]/.test(F)?Y():F==="<"?K():d=10)}function I(F){F==='"'&&(d=11)}function L(F){F==="'"&&(d=11)}function g(F){mn.test(F)?d=4:F===">"?W():F==="<"&&K()}function O(F){mn.test(F)?d=4:F==="/"?d=12:F===">"?W():F==="<"?K():(d=4,u--)}function k(F){F===">"?(p=new Tt(ce(ce({},p),{isClosing:!0})),W()):d=4}function w(F){n.substr(u,2)==="--"?(u+=2,p=new Tt(ce(ce({},p),{type:"comment"})),d=14):n.substr(u,7).toUpperCase()==="DOCTYPE"?(u+=7,p=new Tt(ce(ce({},p),{type:"doctype"})),d=20):Y()}function U(F){F==="-"?d=15:F===">"?Y():d=16}function y(F){F==="-"?d=18:F===">"?Y():d=16}function M(F){F==="-"&&(d=17)}function $(F){d=F==="-"?18:16}function j(F){F===">"?W():F==="!"?d=19:F==="-"||(d=16)}function G(F){F==="-"?d=17:F===">"?W():d=16}function V(F){F===">"?W():F==="<"&&K()}function Y(){d=0,p=l}function K(){d=1,p=new Tt({idx:u})}function W(){var F=n.slice(h,p.idx);F&&o(F,h),p.type==="comment"?s(p.idx):p.type==="doctype"?a(p.idx):(p.isOpening&&r(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),Y(),h=u+1}function ee(){var F=p.idx+(p.isClosing?2:1);return n.slice(F,u).toLowerCase()}h<u&&(t=n.slice(h,u),o(t,h),h=u+1)}var Tt=function(n){n===void 0&&(n={}),this.idx=n.idx!==void 0?n.idx:-1,this.type=n.type||"tag",this.name=n.name||"",this.isOpening=!!n.isOpening,this.isClosing=!!n.isClosing},Xg=function(){function n(e){e===void 0&&(e={}),this.version=n.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(e.urls),this.email=typeof e.email=="boolean"?e.email:this.email,this.phone=typeof e.phone=="boolean"?e.phone:this.phone,this.hashtag=e.hashtag||this.hashtag,this.mention=e.mention||this.mention,this.newWindow=typeof e.newWindow=="boolean"?e.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(e.stripPrefix),this.stripTrailingSlash=typeof e.stripTrailingSlash=="boolean"?e.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=typeof e.decodePercentEncoding=="boolean"?e.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=e.sanitizeHtml||!1;var t=this.mention;if(t!==!1&&t!=="twitter"&&t!=="instagram"&&t!=="soundcloud")throw new Error("invalid `mention` cfg - see docs");var r=this.hashtag;if(r!==!1&&r!=="twitter"&&r!=="facebook"&&r!=="instagram")throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(e.truncate),this.className=e.className||this.className,this.replaceFn=e.replaceFn||this.replaceFn,this.context=e.context||this}return n.link=function(e,t){return new n(t).link(e)},n.parse=function(e,t){return new n(t).parse(e)},n.prototype.normalizeUrlsCfg=function(e){return e==null&&(e=!0),typeof e=="boolean"?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:typeof e.schemeMatches!="boolean"||e.schemeMatches,wwwMatches:typeof e.wwwMatches!="boolean"||e.wwwMatches,tldMatches:typeof e.tldMatches!="boolean"||e.tldMatches}},n.prototype.normalizeStripPrefixCfg=function(e){return e==null&&(e=!0),typeof e=="boolean"?{scheme:e,www:e}:{scheme:typeof e.scheme!="boolean"||e.scheme,www:typeof e.www!="boolean"||e.www}},n.prototype.normalizeTruncateCfg=function(e){return typeof e=="number"?{length:e,location:"end"}:function(t,r){for(var i in r)r.hasOwnProperty(i)&&t[i]===void 0&&(t[i]=r[i]);return t}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},n.prototype.parse=function(e){var t=this,r=["a","style","script"],i=0,o=[];return Gg(e,{onOpenTag:function(s){r.indexOf(s)>=0&&i++},onText:function(s,a){if(i===0){var l=function(c,d){if(!d.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var h,p=[],f=0;h=d.exec(c);)p.push(c.substring(f,h.index)),p.push(h[0]),f=h.index+h[0].length;return p.push(c.substring(f)),p}(s,/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),u=a;l.forEach(function(c,d){if(d%2==0){var h=t.parseText(c,u);o.push.apply(o,h)}u+=c.length})}},onCloseTag:function(s){r.indexOf(s)>=0&&(i=Math.max(i-1,0))},onComment:function(s){},onDoctype:function(s){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o)},n.prototype.compactMatches=function(e){e.sort(function(l,u){return l.getOffset()-u.getOffset()});for(var t=0;t<e.length-1;t++){var r=e[t],i=r.getOffset(),o=r.getMatchedText().length,s=i+o;if(t+1<e.length){if(e[t+1].getOffset()===i){var a=e[t+1].getMatchedText().length>o?t:t+1;e.splice(a,1);continue}e[t+1].getOffset()<s&&e.splice(t+1,1)}}return e},n.prototype.removeUnwantedMatches=function(e){return this.hashtag||fn(e,function(t){return t.getType()==="hashtag"}),this.email||fn(e,function(t){return t.getType()==="email"}),this.phone||fn(e,function(t){return t.getType()==="phone"}),this.mention||fn(e,function(t){return t.getType()==="mention"}),this.urls.schemeMatches||fn(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="scheme"}),this.urls.wwwMatches||fn(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="www"}),this.urls.tldMatches||fn(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="tld"}),e},n.prototype.parseText=function(e,t){t===void 0&&(t=0),t=t||0;for(var r=this.getMatchers(),i=[],o=0,s=r.length;o<s;o++){for(var a=r[o].parseMatches(e),l=0,u=a.length;l<u;l++)a[l].setOffset(t+a[l].getOffset());i.push.apply(i,a)}return i},n.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var t=this.parse(e),r=[],i=0,o=0,s=t.length;o<s;o++){var a=t[o];r.push(e.substring(i,a.getOffset())),r.push(this.createMatchReturnVal(a)),i=a.getOffset()+a.getMatchedText().length}return r.push(e.substring(i)),r.join("")},n.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),typeof t=="string"?t:t===!1?e.getMatchedText():t instanceof sl?t.toAnchorString():e.buildTag().toAnchorString()},n.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new bd({tagBuilder:e,serviceName:this.hashtag}),new vd({tagBuilder:e}),new Ld({tagBuilder:e}),new kd({tagBuilder:e,serviceName:this.mention}),new yd({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},n.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new Cd({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},n.version="3.14.3",n.AnchorTagBuilder=Cd,n.HtmlTag=sl,n.matcher={Email:vd,Hashtag:bd,Matcher:br,Mention:kd,Phone:Ld,Url:yd},n.match={Email:Ql,Hashtag:wf,Match:yr,Mention:Mf,Phone:Ff,Url:eu},n}();function Hf(n,e=n){return{type:"autolink",url:n,text:e}}const Kg=()=>Wt(/```([^]+?)```/g,([n,e])=>({type:"codespan",text:bf(e)})),Wg=Wt(/<!!mention:([^>\s]*?)\|(.*?)>/gm,([n,e,t])=>function(r,i){return{type:"mention",id:r,text:i}}(decodeURIComponent(e),t)),Jg=Wt(/<!!customemoji:(.*?)>/gm,([n,e])=>function(t){return{type:"customemoji",text:t}}(e)),Uf=Wt(/<((?:https?|mailto):.*?)\|(.*?)>/gi,([n,e,t])=>function(r,i=[]){return{type:"link",url:r,children:i}}(e,[t])),qg=Wt(/<actionlink:([^|]+)[|]([^>]*)>/gi,([n,e,t])=>{const{action:r,params:i}=jf(e);return function(o,s,a=[]){return{type:"actionlink",action:o,params:s,children:a}}(r,i,[t])}),Zg=Wt(/<actionbutton:([^|]+)[|]([^>]*)>/gi,([n,e,t])=>{const{action:r,params:i}=jf(e);return function(o,s,a=[]){return{type:"actionbutton",action:o,params:s,children:a}}(r,i,[t])});function jf(n){const e=n.indexOf("?");return e===-1?{action:n,params:{}}:{action:n.slice(0,e),params:Object.fromEntries(new URLSearchParams(n.slice(e)))}}const Qg=Wt(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g,([n])=>function(e=[]){return{type:"bulletlist",children:e}}([n.startsWith(`
1197
+ `)?n.slice(1):n])),eD=Wt(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm,([n,e])=>({type:"bulletpoint",children:[e]})),$f=n=>{const e=/(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;let t=0;const r=[];for(const i of cs(n,e)){const o=i[0],s=i[1],a=o.startsWith(s)?i.index:i.index+1;a-t>0&&r.push(n.substring(t,a));const l=Hf("tel:"+s.replace(/[^0-9+]/g,""),s);r.push(l),t=a+s.length}return t<n.length&&r.push(n.substring(t)),r},zf=n=>Uf(n).flatMap(e=>typeof e=="string"?fa(e):["<",...fa(e.url),...fa("|"+e.children[0]+">")]),fa=n=>{const e=Xg.parse(n,{urls:!0,email:!0,phone:!1,hashtag:!1,mention:!1}),t=[];let r=0;for(const i of e){const o=i.getOffset(),s=i.getMatchedText(),a=s.length;let l=s;i instanceof Ql?l="mailto:"+i.getEmail():i instanceof eu&&(l=i.getUrl()),o>r&&t.push(n.substring(r,o)),t.push(Hf(l,s)),r=o+a}return r<n.length&&t.push(n.substring(r)),t},tD=["Codeblock","Codespan","FormattedLink","Wikitext","Autolink","Actions","Mention","Mention","BulletPoint","CustomEmoji"],nD=function(n){const e=RegExp(`[^${n}]+${n}?|${n}`,"g");return t=>Array.from(t.match(e)||[])}(`
1198
+ `);function Vf(n,e={except:[]}){const t=function(i={except:[]}){var a;const o={multilineSteps:[],singlelineSteps:[]},s=(a=i.except)!=null?a:tD.filter(l=>!i.only.includes(l));return s.includes("BulletPoint")||o.multilineSteps.push(Qg,eD),s.includes("Mention")||o.singlelineSteps.push(Wg),s.includes("CustomEmoji")||o.singlelineSteps.push(Jg),s.includes("Codespan")||o.multilineSteps.push(Kg()),s.includes("FormattedLink")||o.singlelineSteps.push(Uf),s.includes("Actions")||(o.singlelineSteps.push(qg),o.singlelineSteps.push(Zg)),s.includes("Wikitext")||o.singlelineSteps.push(Ig),s.includes("Autolink")||o.singlelineSteps.push(zf,$f),o}(e);let r=Yf(n,t);return r=Gf(r,!1),r}function Yf(n,e){let t=[n];return t=ma(t,e.multilineSteps),t=ma(t,[nD]),t=ma(t,e.singlelineSteps),t=tu(t),t}function ma(n,e){return e.reduce((t,r)=>mi(t,r),n)}function tu(n){const e=[];let t=-1;for(const r of n)typeof r=="string"?typeof e[t]=="string"?e[t]+=r:e[++t]=r:e[++t]="children"in r?{...r,children:tu(r.children)}:r;return e}function Gf(n,e){const t=[];let r=[];for(let i=0;i<n.length;i++){const o=n[i];if(typeof o=="string")r.push(o);else if("children"in o){r.length>0&&(t.push(r.join("")),r=[]);const s=Gf(o.children,e||o.type==="link"||o.type==="actionbutton"||o.type==="actionlink");t.push({...o,children:s})}else o.type==="autolink"&&e?r.push(o.text):(r.length>0&&(t.push(r.join("")),r=[]),t.push(o))}return r.length>0&&(t.push(r.join("")),r=[]),t}function rD(){let n,e=0;return t=>{const r=(o=Date.now())=>{if(window.clearTimeout(n),n=void 0,e=o,t.isDestroyed)return;const s=function(a){a=a.removeMark(0,a.doc.content.size,Se.marks.bold),a=a.removeMark(0,a.doc.content.size,Se.marks.italic),a=a.removeMark(0,a.doc.content.size,Se.marks.strikethrough),a.doc.firstChild;const l=function(u){const c=[];let d,h="";return u.descendants((p,f)=>(p.isText?(h+=p.text,d!=null||(d=f)):h&&d!==void 0&&(c.push({text:h,pos:d}),h="",d=void 0),p.type!==Se.nodes.mention)),h&&d!==void 0&&c.push({text:h,pos:d}),c}(a.doc);for(const{text:u,pos:c}of l){const d=Vf(u,{only:["Wikitext"]});[a]=Xf(a,c,d)}return a}(t.state.tr);t.dispatch(s)},i=Date.now();i-e<300?n||(n=window.setTimeout(r,300)):r(i)}}function Xf(n,e,t,r=0,i=[]){for(const o of t)if(typeof o=="string"){for(const s of i)n.addMark(e+r,e+r+o.length,s.create());r+=o.length}else if(o.type==="bold"||o.type==="italic"||o.type==="strikethrough"){r+=1;const s=Se.marks[o.type],a=[...i,s];[n,r]=Xf(n,e,o.children,r,a),r+=1}else le.unreachable();return[n,r]}function wd(n){return(e,t)=>{if(!t)return!0;let r=e.tr;const i=ne.between(e.selection.$from,e.selection.$to);return r=r.replaceRangeWith(i.from,i.from,Se.text(n,r.storedMarks)),r=r.replaceRangeWith(i.to+1,i.to+1,Se.text(n,r.storedMarks)),r=r.setSelection(ne.near(r.doc.resolve(i.to+1))),t(r),!0}}function iD(n,e,t){const r=e.clipboardData;if(!r)return!1;const i=function(o){const s=o.items||[],a={"image/gif":"gif","image/png":"png","image/jpeg":"jpg","image/svg+xml":"svg"},l=Array.from(s).filter(d=>d.kind==="file"&&a[d.type]);if(l.length===0||o.types.includes("text/rtf"))return;const u=l[0];let c=u.getAsFile();if(!c.name){const d="image."+a[u.type];c=new File([c],d,{type:u.type,lastModified:Date.now()})}return c}(r);return i?t(i):function(o,s){const a=o.state.tr.insertText(s).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");o.dispatch(a)}(n,r.getData("text/plain")),!0}function oD(n,{allowSpaces:e=!1}){return t=>{const r=new RegExp(`\\s${n}$`),i=e?new RegExp(`${n}.*?(?=\\s${n}|$)`,"g"):new RegExp(`(?:^)?${n}[^\\s${n}]*`,"g"),o=t.before(),s=t.end(),a=t.doc.textBetween(o,s,"\0","\0");let l;for(;l=i.exec(a);){const u=l.input.slice(Math.max(0,l.index-1),l.index);if(!/^[\s\0]?$/.test(u))continue;const c=l.index+t.start();let d=c+l[0].length;if(e&&r.test(a.slice(d-1,d+1))&&(l[0]+=" ",d++),c<t.pos&&d>=t.pos)return{range:{from:c,to:d},text:l[0]}}}}function Md({matcher:n=oD("#"),suggestionClass:e="ProseMirror-suggestion",onEnter:t=()=>!1,onChange:r=()=>!1,onExit:i=()=>!1,onKeyDown:o=()=>!1,debug:s=!1}){return new ps({key:new fs("suggestions"),view(){return{update:(a,l)=>{const u=this.key.getState(l),c=this.key.getState(a.state),d=u.active&&c.active&&u.range.from!==c.range.from,h=!u.active&&c.active,p=u.active&&!c.active,f=!h&&!p&&u.text!==c.text;(p||d)&&i({view:a,range:u.range,text:u.text}),f&&!d&&r({view:a,range:c.range,text:c.text}),(h||d)&&t({view:a,range:c.range,text:c.text})}}},state:{init:()=>({active:!1,range:{},text:null}),apply(a,l){const{selection:u}=a,c={...l};if(u.from===u.to){(u.from<l.range.from||u.from>l.range.to)&&(c.active=!1);const d=u.$from,h=n(d);h?(c.active=!0,c.range=h.range,c.text=h.text):c.active=!1}else c.active=!1;return c.active||(c.range={},c.text=null),c}},props:{handleKeyDown(a,l){const{active:u}=this.getState(a.state);return!!u&&o({view:a,event:l})},decorations(a){const{active:l,range:u}=this.getState(a);return l?Ee.create(a.doc,[it.inline(u.from,u.to,{nodeName:"span",class:e,style:s?"background: rgba(0, 0, 255, 0.05); color: blue; border: 2px solid blue;":null})]):null}}})}function Kf({placeholder:n,disabled:e,className:t="",characterLimit:r,spellcheck:i}){const o=xi(),s=R.useRef(),a=R.useRef(null);return R.useEffect(()=>(s.current=function(l,u,c,d,h){const p=tr.create({schema:Se,plugins:[...h.filter(sD),Ag(),pd({...no,"Mod-z":_f,"Mod-y":Sf,"Mod-b":wd("*"),"Mod-i":wd("_"),"Mod-Enter":no.Enter,"Shift-Enter":no.Enter,Enter:c}),pd({Enter:no.Enter}),cd]}),f=rD(),m=new og(l,{handlePaste:(E,A,D)=>iD(E,A,d),clipboardTextSerializer(E){const A=[];return E.content.forEach(D=>{D&&A.push(bf(D.textContent))}),A.join()},state:p,dispatchTransaction(E){E=(E=E.removeStoredMark(Se.marks.literal)).removeStoredMark(Se.marks.emoji);const A=m.state.apply(E);m.state.doc.eq(A.doc)||u(new $o(A.doc)),m.updateState(A),E.steps.some(D=>D instanceof ht)&&f(m)}});return m}(a.current,l=>o.onChange(l),()=>!!o.onEnter&&(o.onEnter(),!0),l=>o.onPasteImage(l),[o.emojiSuggesterPlugin(),o.mentionsPlugin()]),o.setEditorView(s.current),()=>{var l;o.setEditorView(void 0),(l=s.current)==null||l.destroy()}),[o]),R.useEffect(()=>{var l;(l=s.current)==null||l.setProps({editable:()=>!e})},[e]),R.useEffect(()=>Oi(()=>{var l,u,c;return(c=s.current)==null?void 0:c.setProps({attributes:{spellcheck:String((u=(l=o.spellcheck$.get())!=null?l:i)!=null?u:!1),class:"t-text-input","aria-label":"Message Field",role:"textbox"}})}),[o,i]),R.useEffect(()=>Oi(()=>{var u;const l=s.current;l==null||l.dispatch(l.state.tr.setMeta(cd,(u=o.placeholder$.get())!=null?u:n))}),[o,n]),R.useEffect(()=>{r&&Number.isInteger(r)&&o.setMaxLength(r)},[r,o]),v.jsx("div",{className:`t-editor ${t}`,ref:a})}function Fd(n){if(n.startsWith(":"))throw new Error("Not implemented");{const e=Se.marks.emoji.create({emoji:n});return Se.text(n,[e])}}function xd(n,e){const t=encodeURIComponent(n);return Se.nodes.mention.create({id:n,name:e},Se.text(`<!!mention:${t}|${e}>`))}const ts=class ts{constructor(e){this.doc=e,this.size=this.doc.content.size,this.hasContent=hf(this.doc)}hasNonWhitespaceContent(){return this.hasContent&&function(e){let t=!1;return e.descendants(r=>!(r.isText&&r.text&&/\S/.test(r.text))||(t=!0,!1)),t}(this.doc)}asText(){return this.doc.textContent.replace(/\xa0/g," ")}};ts.EMPTY=new ts(Se.topNodeType.create());let $o=ts;function sD(n){return n!=null}const Pd=(n,e)=>t=>{var l;const r=(l=t.nodeBefore)==null?void 0:l.text;if(!r)return;const i=r.match(n);if(!i)return;const o=i[2],s=t.pos-o.length,a=t.pos;if(!t.doc.rangeHasMark(s,a,e.marks.literal))return{range:{from:s,to:a},text:o}},aD=/(^|\s)(:[^:\s]+:?)$/,lD=/(^|\s)(@[^@]*)$/;class Wf{constructor(e,t,r){this.state$=e,this.device$=t,this.userPermissions$=r,this.currentDoc=$o.EMPTY,this.maxLength=1e4,this.markAsTyping=function(i,o){let s=!1;return(...a)=>{if(!s)return s=!0,setTimeout(()=>{s=!1},o),i(...a)}}(()=>{var i;(i=this.controller)==null||i.markAsTyping()},5e3),this._suggesterKeydownHandlers={emoji:void 0,mention:void 0},this.toggleEmojiPicker=i=>{const o=this.state$.showEmojiPicker;i!=null||(i=!o.peek()),o.set(i),i===!1&&this.focus()},this.spellcheck$=me(),this.placeholder$=me()}setEditorView(e){this.editorView=e}emojiSuggesterPlugin(){if(this.device$.peek().supportsEmojiPicker)return Md({debug:!1,matcher:Pd(aD,Se),onEnter:e=>this.suggestEmoji(e.text,e.range),onChange:e=>this.suggestEmoji(e.text,e.range),onExit:()=>this.onExitSuggester(),onKeyDown:({event:e})=>{var t,r,i;return(i=(r=(t=this._suggesterKeydownHandlers).emoji)==null?void 0:r.call(t,e.key))!=null?i:!1}})}mentionsPlugin(){const e=this.userPermissions$.peek();if(le.defined(e),e.canMention)return Md({debug:!1,matcher:Pd(lD,Se),onEnter:t=>this.suggestMention(t.text,t.range),onChange:t=>this.suggestMention(t.text,t.range),onExit:()=>this.onExitSuggester(),onKeyDown:({event:t})=>{var r,i,o;return(o=(i=(r=this._suggesterKeydownHandlers).mention)==null?void 0:i.call(r,t.key))!=null?o:!1}})}closeSuggester(){le.defined(this._suggestionRange),function(e,t){const{from:r,to:i}=t,o=e.state.tr.addMark(r,i,Se.marks.literal.create());e.dispatch(o)}(this.editorView,this._suggestionRange)}listenKeydown(e,t){this._suggesterKeydownHandlers[e]=t}onExitSuggester(){this._suggestionRange=void 0,this.state$.suggestEmojiQuery.set(void 0),this.state$.suggestMentionQuery.set(void 0)}suggestEmoji(e,t){e.length<2||(this._suggestionRange=t,this.state$.suggestEmojiQuery.set(e))}suggestMention(e,t){e.length<1||(this._suggestionRange=t,this.state$.suggestMentionQuery.set(e))}onPasteImage(e){le.defined(this.uploadFile),this.uploadFile(e)}onChange(e){var r;this.currentDoc=e;const t=e.size>this.maxLength&&e.asText().length>this.maxLength;e.hasContent&&this.markAsTyping(),this.state$.assign({isTyping:e.hasContent,atTextLimit:t,isEmpty:!e.hasNonWhitespaceContent(),characterCount:e.size===0?0:e.size-2}),(r=this.controller)==null||r.storeDraft(()=>e.asText())}setMaxLength(e){this.maxLength=e}focus({skipProseMirrorStuff:e}={skipProseMirrorStuff:!1}){var t,r;e?(t=this.editorView)==null||t.dom.focus():(r=this.editorView)==null||r.focus()}setText(e){this.editorView&&function(t,r){const i=t.state.doc.content.size,o=r.split(/(<!!(?:mention|customemoji):.*?>)/g).filter(a=>a||a.length).map(a=>{const[l,u,c]=a.match(/<!!mention:(.*)\|(.*)>/)||[null];if(l&&u&&c)return xd(u,c);const[d,h]=a.match(/<!!customemoji:(.*?)>/)||[null];return d&&h?Fd(h):Se.text(a)}),s=t.state.tr.replaceWith(0,i,o);t.dispatch(s)}(this.editorView,e)}typeText(e){this.editorView&&function(t,r,i="replace"){const o=t.state.doc.content.size,s=i=="insert"?t.state.tr.insertText(r):t.state.tr.insertText(r,0,o);t.dispatch(s)}(this.editorView,e,"insert")}getText(){return this.currentDoc.asText().trim()}clearText(){this.editorView&&function(e){const t=e.state.doc.content.size,r=e.state.tr.insertText("",0,t);e.dispatch(r)}(this.editorView)}selectEmoji(e){le.defined(this.editorView),function(t,r,i){const o=Fd(r);if(i){const{from:a,to:l}=i,u=t.state.tr.deleteRange(a,l);t.dispatch(u)}const s=t.state.tr.replaceSelectionWith(o,!1);t.dispatch(s)}(this.editorView,e,this._suggestionRange),this.focus()}selectMention(e){le.defined(this.editorView),function(t,r,i){const o=xd(r.id,r.name);let s=t.state.tr;if(i){const{from:a,to:l}=i;s=s.replaceRangeWith(a,l,o)}else s=s.replaceSelectionWith(o,!1);s=s.insertText(" "),t.dispatch(s)}(this.editorView,e,this._suggestionRange),this.focus()}}const uD=Symbol("no_render");function nt(n){const e=ft(!1),t=R.useRef({_value:typeof n=="function"?n():n.peek(),get value(){return setTimeout(()=>{e.set(!0)}),t.current._value},set value(r){t.current._value=r}});return Z(()=>{if(!e.get())return uD;const r=typeof n=="function"?n():n.get();return t.current.value=r,r}),t.current}function Lr(){const n=Pi(),e=ie(),t=ap(),r=Dt(),i=nt(e.app$.appMetadata),o=nt(e.currentUser$),s=nt(e.state$.currentConversation),a=nt(e.t$),l=nt(e.device$),u=nt(e.themeCustom$),c=nt(()=>e.state$.typing.child(e.state$.extCurrentConversationId.get()).get()),d=nt(()=>e.state$.participants.child(e.state$.extCurrentConversationId.get()).get());return R.useMemo(()=>({session:n,store:e,chatbox:t,theme:r,get app(){return i.value},get currentUser(){return o.value},get conversation(){return s.value},get t(){return a.value},get device(){return l.value},get themeCustom(){return u.value.value},get typing(){return c.value},get participants(){return d.value}}),[i,t,s,o,l,e,a,r,u,c,d,n])}function Jf(){const n=Pi(),e=ie(),t=Dt(),r=ap(),i=nt(e.app$.appMetadata),o=nt(e.currentUser$),s=nt(e.t$),a=nt(e.device$),l=nt(e.themeCustom$);return R.useMemo(()=>({session:n,store:e,theme:t,conversationList:r,get app(){return i.value},get currentUser(){return o.value},get t(){return s.value},get device(){return a.value},get themeCustom(){return l.value.value}}),[i,r,o,a,n,e,s,t,l])}const cD=(()=>{if(typeof window!="undefined"){let n;try{n=window.localStorage;const e="__storage_test__";return n.setItem(e,e),n.removeItem(e),!0}catch(e){return e instanceof DOMException&&(e.code===22||e.code===1014||e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")&&n&&n.length!==0}}return!1})(),He={};cD?(He.setItem=window.localStorage.setItem.bind(window.localStorage),He.getItem=window.localStorage.getItem.bind(window.localStorage),He.removeItem=window.localStorage.removeItem.bind(window.localStorage),He.isSupported=!0):(He.setItem=function(){},He.getItem=function(){return null},He.removeItem=function(){},He.isSupported=!1),He.set=(n,e)=>He.setItem(n,JSON.stringify(e)),He.get=n=>JSON.parse(He.getItem(n)||"null");const ll="talkjs_drafts",dD=function(n,e){let t;return(...r)=>{clearTimeout(t),t=setTimeout(()=>e(...r),n)}}(200,(n,e,t,r)=>{const i=qf(n,e,t),o=JSON.parse(He.getItem(ll)||"{}"),s=r();s.match(/^\s*$/)?delete o[i]:o[i]=s,He.setItem(ll,JSON.stringify(o))}),qf=(n,e,t)=>`draft_${n}_${e}_${t}`;function Zf(n){const e=Dt(),t=ie(),r=Lr(),i=Z(t.referencedMessage$),o=Z(t.state$.userPermissions),s=xi(),{sendMessage:a}=JE(),l=Z(ft(()=>{const c=s.state$.get();return n.editMessageId===void 0?new ac(c,a,n.attachFile,n.shareLocation,s.toggleEmojiPicker):new ac(c,n.onEditMessage,()=>{},()=>{},()=>{})},[s.state$,s.toggleEmojiPicker,n.attachFile,n.editMessageId,n.onEditMessage,n.shareLocation,a])),u=R.useCallback(c=>s.setText(c),[s]);return function({appId:c,conversationId:d,meId:h,setText:p,enabled:f}){const m=R.useMemo(()=>qf(d,h,c),[c,d,h]);R.useEffect(()=>{var A;if(!m||!f)return;const E=(A=JSON.parse(He.getItem(ll)||"{}")[m])!=null?A:"";p(E)},[m,f,p])}({appId:r.app.id,conversationId:r.conversation.id,meId:r.currentUser.id,setText:u,enabled:!n.editMessageId}),v.jsx(lp.Provider,{value:{onClose:()=>s.toggleEmojiPicker(!1),onEmojiSelected:c=>s.selectEmoji(c)},children:v.jsx(e.MessageField,{common:r,referencedMessage:i,permissions:o,editor:l,editMessageId:n.editMessageId})})}function hD({message:n}){const e=ie(),t=Bi(),r=Z(e.state$.editingMessageId),i=R.useMemo(()=>Rt(n.content[0].children),[n]),o=ft({isEmpty:i.length===0,isTyping:!1,atTextLimit:!1,characterCount:i.length,showEmojiPicker:!1,suggestEmojiQuery:void 0,suggestMentionQuery:void 0}),s=R.useMemo(()=>new Wf(o,e.device$,e.state$.userPermissions),[o,e]),a=R.useCallback(async()=>{const l=s.state$;if(l.isEmpty.peek()||l.atTextLimit.peek())return;const u=s.getText();u&&await t.editMessage(n.id,{text:u}),e.state$.editingMessageId.set(null)},[e,t,s,n.id]);return R.useEffect(()=>{s.onEnter=a},[s,a]),R.useEffect(()=>{s.focus(),s.setText(Rt(n.content[0].children,!0))},[s,n]),v.jsx(np.Provider,{value:s,children:v.jsx(Zf,{editMessageId:r,onEditMessage:a})})}function pD(){const n=Dt(),e=Lr();return v.jsx(n.MessageListFooter,{common:e})}function fD(n){const e=Dt(),t=Lr();return v.jsx(e.MessageDivider,{common:t,...n})}function mD({message:n}){const e=Dt(),t=ie(),r=Lr(),[i,o]=R.useState("sent");return Or(s=>{if(n.id.startsWith("ephemeral-"))return o("sending");const a=t.state$.currentConversation.everyoneReadUntil.get();return a!==void 0?n.createdAt<=a?o("everyoneRead"):o("sent"):void 0}),v.jsx(e.Message,{common:r,message:n,messageStatus:i,permissions:t.messagePermissions$(n).get()})}function ED({extConversationId:n}){const e=Pi(),t=ie(),r=Bi(),i=R.useRef(!0),o=R.useRef(null);R.useLayoutEffect(()=>{i.current=o.current.scrollTop>-30}),R.useEffect(()=>{i.current&&(o.current.scrollTop=0)}),R.useEffect(()=>{const c=new IntersectionObserver(d=>t.state$.visibility.isInView.set(d[0].isIntersecting),{threshold:.9});return c.observe(o.current),()=>c.disconnect()},[t]),R.useEffect(()=>{const c=()=>t.state$.visibility.tabFocused.set(!document.hidden);return document.addEventListener("visibilitychange",c),()=>document.removeEventListener("visibilitychange",c)},[t]);const[s,a]=R.useState(!1);R.useEffect(()=>{a(!1);const c=t.state$.currentConversation.peek();(c==null?void 0:c.isUnread)===!0&&e.conversation(n).markAsRead().catch(d=>{Lo.warn("Could not mark conversation as read",d)})},[n,e,t]),Or(c=>{if(!o.current)return;const d=t.state$.currentConversation.get(),h=!(!d||!d.isUnread),p=d==null?void 0:d.unreadMessageCount;if(h&&p===0)return void a(!0);if(h&&s)return;if(!h)return void a(!1);const f=t.state$.visibility.tabFocused.get(),m=t.state$.visibility.isInView.get(),E=function(A){if(A.checkVisibility)return A.checkVisibility({contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0,checkOpacity:!0,checkVisibilityCSS:!0});{const D=window.getComputedStyle(A),_=D.visibility,S=D.opacity;return!(A.getClientRects().length===0||_==="hidden"||S==="0")}}(o.current);return f&&m&&E?e.conversation(d.id).markAsRead():void 0});const l=R.useCallback(c=>{const d=c.currentTarget;d.scrollHeight-d.clientHeight+d.scrollTop<90&&t.messageSubscription&&t.messageSubscription.loadMore(10)},[t.messageSubscription]),u=Z(t.state$.typing.child(n));return v.jsxs("div",{className:"t-message-list",ref:o,"t-menu-boundary":"",onScroll:l,children:[u&&v.jsx(pD,{}),v.jsx(wa,{each:t.chatItems$,children:c=>v.jsx("div",{className:"t-message-group",children:v.jsx(wa,{each:c,item:AD,itemProps:{controller:r,extConversationId:n}})})})]})}function AD({item$:n}){const e=ie(),t=Z(n),r=Z(e.state$.editingMessageId);return t instanceof Fa?v.jsx(fD,{timestamp:t.timestamp,isReadMarker:t.isReadMarker,isDayMarker:t.isDayMarker}):r===t.id?v.jsx(hD,{message:t}):v.jsx(mD,{message:t})}function zo(n){const e=ie()instanceof Ap?gD:DD;return v.jsx(e,{...n})}function gD(n){const e=Dt(),t=Lr();return v.jsx(e.Icon,{common:t,...n})}function DD(n){const e=Dt(),t=Jf();return v.jsx(e.Icon,{common:t,...n})}function nu(){const n=Z(ie().t$);return v.jsx(zo,{type:"spinner","aria-label":n.LOADING,className:"t-loading-icon"})}const OD=new Set(["ByV39eoc","B1FxElnd","aW4c49tW","qGfuGtx","SbERe5ee","ilaVEa15","FOlWOSaH","dao5gGmT","DLUgAhzL","fqXFumr6","FtiWHMYT","66iWOyWt","1375amYi","mWbJgzpt","jO7GqAvL","SkFIKxo5","2z4ILc3y","aDr8oPL1","Hku1c4Pt"]);function As({appId:n,chatboxState:e}){const t=n.charAt(0)==="t"||OD.has(n);return R.useEffect(()=>{switch(e.type){case"auth-failed":zt.error("Could not authenticate user. Check if you are authenticating correctly.");break;case"unknown-user":zt.error(`User \`${e.userId}\` not found. Please verify that you synchronized this user's data with TalkJS, either using the JS SDK or through the REST API.`);break;case"unexpected-error":zt.error(e.error);break;case"wrong-app-id":zt.error(`Could not find given appId: "${e.appId}". You can find your appId on https://talkjs.com/dashboard.`);break;case"server-error":break;default:le.never(e)}},[e]),v.jsxs("div",{className:"t-panel t-error-panel",children:[v.jsx("span",{className:"t-heading",children:"Something went wrong."}),v.jsx("p",{children:"Please reload the page and try again."}),t?v.jsxs("p",{style:{fontStyle:"italic"},children:["Developer note: check your browser's developer tools console for messages that may help solve the problem.",v.jsx("br",{}),v.jsx("small",{children:"This message only shows up in test mode."})]}):v.jsx("p",{children:"If things keep not working, do not hesitate to get in touch with us."})]})}function _D(){const n=Z(ie().t$);return v.jsx("div",{className:"t-panel t-error-panel",children:v.jsx("span",{className:"t-heading",style:{fontStyle:"italic"},children:n.CHAT_NOT_FOUND})})}function Qf(){return v.jsx("div",{className:"t-panel t-loading-panel",children:v.jsx(nu,{})})}function em(){const n=Z(ie().t$);return v.jsxs("div",{className:"t-panel t-error-panel",children:[v.jsx("span",{className:"t-heading",style:{fontStyle:"italic"},children:n.AUTH_EXPIRED_OVERLAY_TITLE}),v.jsx("p",{children:n.AUTH_EXPIRED_OVERLAY_DESCRIPTION})]})}const SD=()=>!0;async function ru(n,e,{initialDelay:t,maxDelay:r,log:i,shouldRetry:o=SD}){return e().catch(async s=>{if(i&&i(`[TalkJS] Retries left: ${n}. Error: ${JSON.stringify(s)}.`),n===0||!await o(s))throw s;const a=1e3*t*1.2,l=r?Math.min(1e3*r,a):a,u=l*(1-(c=.05)+2*Math.random()*c);var c,d;return(d=u,d<=0?Promise.resolve():new Promise(h=>setTimeout(h,d))).then(()=>ru(n-1,e,{initialDelay:u/1e3,maxDelay:r,log:i,shouldRetry:o}))})}function Ii(){const n={},e=new Promise(function(t,r){n.resolve=t,n.reject=r});return n.promise=e,n}function TD(n,e,t){const{beforeBrowserPermissionPrompt:r,onMissingBrowserPermissionCallback:i}=R.useContext(rp);return R.useCallback(async()=>{function o(c){c==="denied"&&i({type:n})}if(!r||!await async function(c){if(!("permissions"in navigator))return!1;const d=c;try{return(await navigator.permissions.query({name:d})).state==="prompt"}catch(h){return!1}}(n))return e(c=>{o(c)});const s=Ii(),a=Ii(),l={type:n,showPrompt:async()=>(a.resolve({cancelled:!1}),await s.promise),cancel:()=>{a.resolve({cancelled:!0})}};try{r(l)}catch(c){zt.error("Your beforeBrowserPermissionPrompt callback threw an error: ",c),a.resolve({cancelled:!0})}const{cancelled:u}=await a.promise;return u?void 0:e(c=>{s.resolve(c),o(c)})},[r,i,n,e,...t])}function RD({onClose:n}){const e=ie(),t=Bi(),r=Pi(),[i,o]=R.useState(null),s=R.useCallback(async l=>{try{if(l||(l=(await new Promise(m=>{const E=document.createElement("input");E.type="file",E.multiple=!1,E.addEventListener("change",()=>{m([...E.files])}),E.addEventListener("cancel",()=>{m([])}),E.click()}))[0]),!l)return;const{uploadPromise:u,upload:c}=await async function(m,E){const A=m.name;if(function(T){return/\.(mp4|ts|mov|webm|ogv)$/i.test(T)}(m.name)){const T=await Ea("video",m,L=>({width:L.videoWidth,height:L.videoHeight,duration:L.duration,filename:A})),N=E.uploadVideo(m,T),I=function(L){switch(L.name.split(".").pop()){case"ts":return"video/MP2T";case"mov":return"video/quicktime";case"webm":return"video/webm";case"ogv":return"video/ogg";default:return"video/mp4"}}(m);return{uploadPromise:N,upload:{type:"video",file:m,metadata:T,temporaryBlobUrl:URL.createObjectURL(new Blob([m],{type:I}))}}}if(function(T){return/\.(mp3|m4a|ogg|oga|opus|flac|wav)$/i.test(T)}(m.name)){const T=await Ea("audio",m,N=>({duration:N.duration,filename:A}));return{uploadPromise:E.uploadAudio(m,T),upload:{type:"audio",file:m,metadata:T,temporaryBlobUrl:URL.createObjectURL(new Blob([m]))}}}if(function(T){return/(gif|png|jpg|jpeg|svg|bmp|webp)$/i.test(T)}(m.name)){const T=await Ea("img",m,N=>({width:N.naturalWidth,height:N.naturalHeight,filename:A}));return{uploadPromise:E.uploadImage(m,T),upload:{type:"image",file:m,metadata:T,temporaryBlobUrl:URL.createObjectURL(new Blob([m]))}}}const D={filename:A},_=E.uploadFile(m,D),S=URL.createObjectURL(new Blob([m]));return{uploadPromise:_,upload:{type:"file",file:m,metadata:D,temporaryBlobUrl:S}}}(l,r),d=c.file.size+","+c.file.name;e.state$.localFileBlobUrls.child(e.state$.extCurrentConversationId.peek()).child(d).set({url:c.temporaryBlobUrl,fetching:!1}),e.latestFileUpload=c;const h=Ii(),p={upload:c,closePreview:h.resolve,uploaded:!1,errored:!1};let f;o(p);try{f=await Bd(u,h.promise),o({...p,uploaded:!0})}catch(m){if(m===ul)return;zt.warn("File upload failed",m.toString()),o(E=>({...E,errored:!0}))}if(await h.promise==="cancel")return;le.defined(f),t.sendFileMessage({fileToken:f})}finally{n(),o(null)}},[t,r,o,e,n]),a=TD("geolocation",async l=>{try{const u=Ii(),c={upload:{type:"location",location:void 0},uploaded:!1,closePreview:u.resolve,errored:!1};o(c);const{permissionResult:d,location:h}=await Bd(new Promise(p=>{navigator.geolocation.getCurrentPosition(f=>{const m={latitude:f.coords.latitude,longitude:f.coords.longitude};p({permissionResult:"granted",location:m})},f=>{f.code===1?p({permissionResult:"denied"}):p({permissionResult:"granted"})})}),u.promise);if(l(d),!h||(o({...c,upload:{type:"location",location:h},uploaded:!0}),await u.promise==="cancel"))return;t.sendLocationMessage({location:h})}catch(u){if(u===ul)return;throw u}finally{n(),o(null)}},[t,o,n]);return{attachFile:s,shareLocation:a,uploadState:i}}const ul=Symbol("cancelled");function Bd(n,e){return Promise.race([n,e.then(()=>Promise.reject(ul))])}async function Ea(n,e,t){const r=document.createElement(n);try{return r.src=URL.createObjectURL(e),await new Promise((i,o)=>{const s=n==="img"?"load":"loadedmetadata";r.addEventListener(s,()=>{try{i(t(r))}catch(a){o(a)}},{once:!0})})}finally{URL.revokeObjectURL(r.src)}}var tm=function(n,e,t,r){var i;e[0]=0;for(var o=1;o<e.length;o++){var s=e[o++],a=e[o]?(e[0]|=s?1:2,t[e[o++]]):e[++o];s===3?r[0]=a:s===4?r[1]=Object.assign(r[1]||{},a):s===5?(r[1]=r[1]||{})[e[++o]]=a:s===6?r[1][e[++o]]+=a+"":s?(i=n.apply(a,tm(n,a,t,["",null])),r.push(i),a[0]?e[0]|=2:(e[o-2]=0,e[o]=i)):r.push(a)}return r},Hd=new Map;function CD(n){var e=Hd.get(this);return e||(e=new Map,Hd.set(this,e)),(e=tm(this,e.get(n)||(e.set(n,e=function(t){for(var r,i,o=1,s="",a="",l=[0],u=function(h){o===1&&(h||(s=s.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?l.push(0,h,s):o===3&&(h||s)?(l.push(3,h,s),o=2):o===2&&s==="..."&&h?l.push(4,h,0):o===2&&s&&!h?l.push(5,0,!0,s):o>=5&&((s||!h&&o===5)&&(l.push(o,0,s,i),o=6),h&&(l.push(o,h,0,i),o=6)),s=""},c=0;c<t.length;c++){c&&(o===1&&u(),u(c));for(var d=0;d<t[c].length;d++)r=t[c][d],o===1?r==="<"?(u(),l=[l],o=3):s+=r:o===4?s==="--"&&r===">"?(o=1,s=""):s=r+s[0]:a?r===a?a="":s+=r:r==='"'||r==="'"?a=r:r===">"?(u(),o=1):o&&(r==="="?(o=5,i=s,s=""):r==="/"&&(o<5||t[c][d+1]===">")?(u(),o===3&&(l=l[0]),o=l,(l=l[0]).push(2,0,o),o=0):r===" "||r===" "||r===`
1199
+ `||r==="\r"?(u(),o=2):s+=r),o===3&&s==="!--"&&(o=4,l=l[0])}return u(),l}(n)),e),arguments,[])).length>1?e:e[0]}var ID={TALK_GMK:"AIzaSyAs_WXNLlj31EHJI_Lw8siO2B3ZJLUzBH0",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const ND=function(n){return ID[n]}("TALK_GMK");function Me(n,e,t,r){return new(t||(t=Promise))(function(i,o){function s(u){try{l(r.next(u))}catch(c){o(c)}}function a(u){try{l(r.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((r=r.apply(n,e||[])).next())})}class ji{constructor(){this.listeners={}}on(e,t,r){if(this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(t),r==null?void 0:r.once){const i=()=>{this.un(e,i),this.un(e,t)};return this.on(e,i),i}return()=>this.un(e,t)}un(e,t){var r;(r=this.listeners[e])===null||r===void 0||r.delete(t)}once(e,t){return this.on(e,t,{once:!0})}unAll(){this.listeners={}}emit(e,...t){this.listeners[e]&&this.listeners[e].forEach(r=>r(...t))}}const Ud={decode:function(n,e){return Me(this,void 0,void 0,function*(){const t=new AudioContext({sampleRate:e});return t.decodeAudioData(n).finally(()=>t.close())})},createBuffer:function(n,e){return typeof n[0]=="number"&&(n=[n]),function(t){const r=t[0];if(r.some(i=>i>1||i<-1)){const i=r.length;let o=0;for(let s=0;s<i;s++){const a=Math.abs(r[s]);a>o&&(o=a)}for(const s of t)for(let a=0;a<i;a++)s[a]/=o}}(n),{duration:e,length:n[0].length,sampleRate:n[0].length/e,numberOfChannels:n.length,getChannelData:t=>n==null?void 0:n[t],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function nm(n,e){const t=e.xmlns?document.createElementNS(e.xmlns,n):document.createElement(n);for(const[r,i]of Object.entries(e))if(r==="children")for(const[o,s]of Object.entries(e))typeof s=="string"?t.appendChild(document.createTextNode(s)):t.appendChild(nm(o,s));else r==="style"?Object.assign(t.style,i):r==="textContent"?t.textContent=i:t.setAttribute(r,i.toString());return t}function jd(n,e,t){const r=nm(n,e||{});return t==null||t.appendChild(r),r}var vD=Object.freeze({__proto__:null,createElement:jd,default:jd});const yD={fetchBlob:function(n,e,t){return Me(this,void 0,void 0,function*(){const r=yield fetch(n,t);if(r.status>=400)throw new Error(`Failed to fetch ${n}: ${r.status} (${r.statusText})`);return function(i,o){Me(this,void 0,void 0,function*(){if(!i.body||!i.headers)return;const s=i.body.getReader(),a=Number(i.headers.get("Content-Length"))||0;let l=0;const u=d=>Me(this,void 0,void 0,function*(){l+=(d==null?void 0:d.length)||0;const h=Math.round(l/a*100);o(h)}),c=()=>Me(this,void 0,void 0,function*(){let d;try{d=yield s.read()}catch(h){return}d.done||(u(d.value),yield c())});c()})}(r.clone(),e),r.blob()})}};class bD extends ji{constructor(e){super(),this.isExternalMedia=!1,e.media?(this.media=e.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),e.mediaControls&&(this.media.controls=!0),e.autoplay&&(this.media.autoplay=!0),e.playbackRate!=null&&this.onMediaEvent("canplay",()=>{e.playbackRate!=null&&(this.media.playbackRate=e.playbackRate)},{once:!0})}onMediaEvent(e,t,r){return this.media.addEventListener(e,t,r),()=>this.media.removeEventListener(e,t,r)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const e=this.getSrc();e.startsWith("blob:")&&URL.revokeObjectURL(e)}canPlayType(e){return this.media.canPlayType(e)!==""}setSrc(e,t){const r=this.getSrc();if(e&&r===e)return;this.revokeSrc();const i=t instanceof Blob&&(this.canPlayType(t.type)||!e)?URL.createObjectURL(t):e;try{this.media.src=i}catch(o){this.media.src=e}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(e){this.media=e}play(){return Me(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(e){this.media.currentTime=e}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(e){this.media.volume=e}getMuted(){return this.media.muted}setMuted(e){this.media.muted=e}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(e,t){t!=null&&(this.media.preservesPitch=t),this.media.playbackRate=e}getMediaElement(){return this.media}setSinkId(e){return this.media.setSinkId(e)}}class Rr extends ji{constructor(e,t){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.subscriptions=[],this.options=e;const r=this.parentFromOptionsContainer(e.container);this.parent=r;const[i,o]=this.initHtml();r.appendChild(i),this.container=i,this.scrollContainer=o.querySelector(".scroll"),this.wrapper=o.querySelector(".wrapper"),this.canvasWrapper=o.querySelector(".canvases"),this.progressWrapper=o.querySelector(".progress"),this.cursor=o.querySelector(".cursor"),t&&o.appendChild(t),this.initEvents()}parentFromOptionsContainer(e){let t;if(typeof e=="string"?t=document.querySelector(e):e instanceof HTMLElement&&(t=e),!t)throw new Error("Container not found");return t}initEvents(){const e=t=>{const r=this.wrapper.getBoundingClientRect(),i=t.clientX-r.left,o=t.clientY-r.top;return[i/r.width,o/r.height]};if(this.wrapper.addEventListener("click",t=>{const[r,i]=e(t);this.emit("click",r,i)}),this.wrapper.addEventListener("dblclick",t=>{const[r,i]=e(t);this.emit("dblclick",r,i)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:t,scrollWidth:r,clientWidth:i}=this.scrollContainer,o=t/r,s=(t+i)/r;this.emit("scroll",o,s,t,t+i)}),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{t().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const e=this.parent.clientWidth;e===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=e,this.reRender())}initDrag(){this.subscriptions.push(function(e,t,r,i,o=3,s=0,a=100){if(!e)return()=>{};const l=matchMedia("(pointer: coarse)").matches;let u=()=>{};const c=d=>{if(d.button!==s)return;d.preventDefault(),d.stopPropagation();let h=d.clientX,p=d.clientY,f=!1;const m=Date.now(),E=T=>{if(T.preventDefault(),T.stopPropagation(),l&&Date.now()-m<a)return;const N=T.clientX,I=T.clientY,L=N-h,g=I-p;if(f||Math.abs(L)>o||Math.abs(g)>o){const O=e.getBoundingClientRect(),{left:k,top:w}=O;f||(r==null||r(h-k,p-w),f=!0),t(L,g,N-k,I-w),h=N,p=I}},A=T=>{if(f){const N=T.clientX,I=T.clientY,L=e.getBoundingClientRect(),{left:g,top:O}=L;i==null||i(N-g,I-O)}u()},D=T=>{T.relatedTarget&&T.relatedTarget!==document.documentElement||A(T)},_=T=>{f&&(T.stopPropagation(),T.preventDefault())},S=T=>{f&&T.preventDefault()};document.addEventListener("pointermove",E),document.addEventListener("pointerup",A),document.addEventListener("pointerout",D),document.addEventListener("pointercancel",D),document.addEventListener("touchmove",S,{passive:!1}),document.addEventListener("click",_,{capture:!0}),u=()=>{document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",A),document.removeEventListener("pointerout",D),document.removeEventListener("pointercancel",D),document.removeEventListener("touchmove",S),setTimeout(()=>{document.removeEventListener("click",_,{capture:!0})},10)}};return e.addEventListener("pointerdown",c),()=>{u(),e.removeEventListener("pointerdown",c)}}(this.wrapper,(e,t,r)=>{this.emit("drag",Math.max(0,Math.min(1,r/this.wrapper.getBoundingClientRect().width)))},e=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))},e=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))}))}getHeight(e,t){var r;const i=((r=this.audioData)===null||r===void 0?void 0:r.numberOfChannels)||1;if(e==null)return 128;if(!isNaN(Number(e)))return Number(e);if(e==="auto"){const o=this.parent.clientHeight||128;return t!=null&&t.every(s=>!s.overlay)?o/i:o}return 128}initHtml(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"});return t.innerHTML=`
1200
1200
  <style>
1201
1201
  :host {
1202
1202
  user-select: none;
@@ -1268,17 +1268,17 @@
1268
1268
  <div class="cursor" part="cursor"></div>
1269
1269
  </div>
1270
1270
  </div>
1271
- `,[e,t]}setOptions(e){if(this.options.container!==e.container){const t=this.parentFromOptionsContainer(e.container);t.appendChild(this.container),this.parent=t}e.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.options=e,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(e){this.scrollContainer.scrollLeft=e}setScrollPercentage(e){const{scrollWidth:t}=this.scrollContainer,r=t*e;this.setScroll(r)}destroy(){var e,t;this.subscriptions.forEach(r=>r()),this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.unsubscribeOnScroll)===null||t===void 0||t.call(this)}createDelay(e=10){let t,r;const i=()=>{t&&clearTimeout(t),r&&r()};return this.timeouts.push(i),()=>new Promise((o,s)=>{i(),r=s,t=setTimeout(()=>{t=void 0,r=void 0,o()},e)})}convertColorValues(e){if(!Array.isArray(e))return e||"";if(e.length<2)return e[0]||"";const t=document.createElement("canvas"),r=t.getContext("2d"),i=t.height*(window.devicePixelRatio||1),o=r.createLinearGradient(0,0,0,i),s=1/(e.length-1);return e.forEach((a,l)=>{const u=l*s;o.addColorStop(u,a)}),o}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(e,t,r,i){const o=e[0],s=e[1]||e[0],a=o.length,{width:l,height:u}=r.canvas,c=u/2,d=this.getPixelRatio(),h=t.barWidth?t.barWidth*d:1,p=t.barGap?t.barGap*d:t.barWidth?h/2:0,f=t.barRadius||0,m=l/(h+p)/a,E=f&&"roundRect"in r?"roundRect":"rect";r.beginPath();let A=0,D=0,_=0;for(let S=0;S<=a;S++){const R=Math.round(S*m);if(R>A){const L=Math.round(D*c*i),g=L+Math.round(_*c*i)||1;let O=c-L;t.barAlign==="top"?O=0:t.barAlign==="bottom"&&(O=u-g),r[E](A*(h+p),O,h,g,f),A=R,D=0,_=0}const v=Math.abs(o[S]||0),I=Math.abs(s[S]||0);v>D&&(D=v),I>_&&(_=I)}r.fill(),r.closePath()}renderLineWaveform(e,t,r,i){const o=s=>{const a=e[s]||e[0],l=a.length,{height:u}=r.canvas,c=u/2,d=r.canvas.width/l;r.moveTo(0,c);let h=0,p=0;for(let f=0;f<=l;f++){const m=Math.round(f*d);if(m>h){const A=c+(Math.round(p*c*i)||1)*(s===0?-1:1);r.lineTo(h,A),h=m,p=0}const E=Math.abs(a[f]||0);E>p&&(p=E)}r.lineTo(h,c)};r.beginPath(),o(0),o(1),r.fill(),r.closePath()}renderWaveform(e,t,r){if(r.fillStyle=this.convertColorValues(t.waveColor),t.renderFunction)return void t.renderFunction(e,r);let i=t.barHeight||1;if(t.normalize){const o=Array.from(e[0]).reduce((s,a)=>Math.max(s,Math.abs(a)),0);i=o?1/o:1}t.barWidth||t.barGap||t.barAlign?this.renderBarWaveform(e,t,r,i):this.renderLineWaveform(e,t,r,i)}renderSingleCanvas(e,t,r,i,o,s,a){const l=this.getPixelRatio(),u=document.createElement("canvas");u.width=Math.round(r*l),u.height=Math.round(i*l),u.style.width=`${r}px`,u.style.height=`${i}px`,u.style.left=`${Math.round(o)}px`,s.appendChild(u);const c=u.getContext("2d");if(this.renderWaveform(e,t,c),u.width>0&&u.height>0){const d=u.cloneNode(),h=d.getContext("2d");h.drawImage(u,0,0),h.globalCompositeOperation="source-in",h.fillStyle=this.convertColorValues(t.progressColor),h.fillRect(0,0,u.width,u.height),a.appendChild(d)}}renderMultiCanvas(e,t,r,i,o,s){const a=this.getPixelRatio(),{clientWidth:l}=this.scrollContainer;if(l*a>=r)return void this.renderSingleCanvas(e,t,l,i,0,o,s);const u=r/a;let c=Math.min(Rr.MAX_CANVAS_WIDTH,l,u),d={};if(t.barWidth||t.barGap){const E=t.barWidth||.5,A=E+(t.barGap||E/2);c%A!=0&&(c=Math.floor(c/A)*A)}const h=E=>{if(E<0||E>=p||d[E])return;d[E]=!0;const A=E*c,D=Math.min(u-A,c);if(D<=0)return;const _=e.map(S=>{const R=Math.floor(A/u*S.length),v=Math.floor((A+D)/u*S.length);return S.slice(R,v)});this.renderSingleCanvas(_,t,D,i,A,o,s)},p=Math.ceil(u/c),f=this.scrollContainer.scrollLeft/u,m=Math.floor(f*p);h(m-1),h(m),h(m+1),p>1&&(this.unsubscribeOnScroll=this.on("scroll",()=>{const{scrollLeft:E}=this.scrollContainer,A=Math.floor(E/u*p);Object.keys(d).length>Rr.MAX_NODES&&(o.innerHTML="",s.innerHTML="",d={}),h(A-1),h(A),h(A+1)}))}renderChannel(e,t,r,i){var{overlay:o}=t,s=function(c,d){var h={};for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&d.indexOf(p)<0&&(h[p]=c[p]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function"){var f=0;for(p=Object.getOwnPropertySymbols(c);f<p.length;f++)d.indexOf(p[f])<0&&Object.prototype.propertyIsEnumerable.call(c,p[f])&&(h[p[f]]=c[p[f]])}return h}(t,["overlay"]);const a=document.createElement("div"),l=this.getHeight(s.height,s.splitChannels);a.style.height=`${l}px`,o&&i>0&&(a.style.marginTop=`-${l}px`),this.canvasWrapper.style.minHeight=`${l}px`,this.canvasWrapper.appendChild(a);const u=a.cloneNode();this.progressWrapper.appendChild(u),this.renderMultiCanvas(e,s,r,l,a,u)}render(e){return Me(this,void 0,void 0,function*(){var t;this.timeouts.forEach(l=>l()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const r=this.getPixelRatio(),i=this.scrollContainer.clientWidth,o=Math.ceil(e.duration*(this.options.minPxPerSec||0));this.isScrollable=o>i;const s=this.options.fillParent&&!this.isScrollable,a=(s?i:o)*r;if(this.wrapper.style.width=s?"100%":`${o}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=e,this.emit("render"),this.options.splitChannels)for(let l=0;l<e.numberOfChannels;l++){const u=Object.assign(Object.assign({},this.options),(t=this.options.splitChannels)===null||t===void 0?void 0:t[l]);this.renderChannel([e.getChannelData(l)],u,a,l)}else{const l=[e.getChannelData(0)];e.numberOfChannels>1&&l.push(e.getChannelData(1)),this.renderChannel(l,this.options,a,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){var e;if((e=this.unsubscribeOnScroll)===null||e===void 0||e.call(this),delete this.unsubscribeOnScroll,!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:r}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:i}=this.progressWrapper.getBoundingClientRect();let o=i-r;o*=2,o=o<0?Math.floor(o):Math.ceil(o),o/=2,this.scrollContainer.scrollLeft+=o}}zoom(e){this.options.minPxPerSec=e,this.reRender()}scrollIntoView(e,t=!1){const{scrollLeft:r,scrollWidth:i,clientWidth:o}=this.scrollContainer,s=e*i,a=r,l=r+o,u=o/2;if(this.isDragging)s+30>l?this.scrollContainer.scrollLeft+=30:s-30<a&&(this.scrollContainer.scrollLeft-=30);else{(s<a||s>l)&&(this.scrollContainer.scrollLeft=s-(this.options.autoCenter?u:0));const c=s-r-u;t&&this.options.autoCenter&&c>0&&(this.scrollContainer.scrollLeft+=Math.min(c,10))}{const c=this.scrollContainer.scrollLeft,d=c/i,h=(c+o)/i;this.emit("scroll",d,h,c,c+o)}}renderProgress(e,t){if(isNaN(e))return;const r=100*e;this.canvasWrapper.style.clipPath=`polygon(${r}% 0, 100% 0, 100% 100%, ${r}% 100%)`,this.progressWrapper.style.width=`${r}%`,this.cursor.style.left=`${r}%`,this.cursor.style.transform=`translateX(-${Math.round(r)===100?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(e,t)}exportImage(e,t,r){return Me(this,void 0,void 0,function*(){const i=this.canvasWrapper.querySelectorAll("canvas");if(!i.length)throw new Error("No waveform data");if(r==="dataURL"){const o=Array.from(i).map(s=>s.toDataURL(e,t));return Promise.resolve(o)}return Promise.all(Array.from(i).map(o=>new Promise((s,a)=>{o.toBlob(l=>{l?s(l):a(new Error("Could not export image"))},e,t)})))})}}Rr.MAX_CANVAS_WIDTH=8e3,Rr.MAX_NODES=10;class LD extends ji{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}}class jd extends ji{constructor(e=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=e,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return Me(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(e){if(this.currentSrc=e,this._duration=void 0,!e)return this.buffer=null,void this.emit("emptied");fetch(e).then(t=>{if(t.status>=400)throw new Error(`Failed to fetch ${e}: ${t.status} (${t.statusText})`);return t.arrayBuffer()}).then(t=>this.currentSrc!==e?null:this.audioContext.decodeAudioData(t)).then(t=>{this.currentSrc===e&&(this.buffer=t,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var e;if(!this.paused)return;this.paused=!1,(e=this.bufferNode)===null||e===void 0||e.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let t=this.playedDuration*this._playbackRate;t>=this.duration&&(t=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,t),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var e;this.paused=!0,(e=this.bufferNode)===null||e===void 0||e.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return Me(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(e){var t,r;const i=e-this.currentTime;(t=this.bufferNode)===null||t===void 0||t.stop(this.audioContext.currentTime+i),(r=this.bufferNode)===null||r===void 0||r.addEventListener("ended",()=>{this.bufferNode=null,this.pause()},{once:!0})}setSinkId(e){return Me(this,void 0,void 0,function*(){return this.audioContext.setSinkId(e)})}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this.bufferNode&&(this.bufferNode.playbackRate.value=e)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(e){const t=!this.paused;t&&this._pause(),this.playedDuration=e/this._playbackRate,t&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var e,t;return(e=this._duration)!==null&&e!==void 0?e:((t=this.buffer)===null||t===void 0?void 0:t.duration)||0}set duration(e){this._duration=e}get volume(){return this.gainNode.gain.value}set volume(e){this.gainNode.gain.value=e,this.emit("volumechange")}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(e){return/^(audio|video)\//.test(e)}getGainNode(){return this.gainNode}getChannelData(){const e=[];if(!this.buffer)return e;const t=this.buffer.numberOfChannels;for(let r=0;r<t;r++)e.push(this.buffer.getChannelData(r));return e}}const kD={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};class Ni extends bD{static create(e){return new Ni(e)}constructor(e){const t=e.media||(e.backend==="WebAudio"?new jd:void 0);super({media:t,mediaControls:e.mediaControls,autoplay:e.autoplay,playbackRate:e.audioRate}),this.plugins=[],this.decodedData=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},kD,e),this.timer=new LD;const r=t?void 0:this.getMediaElement();this.renderer=new Rr(this.options,r),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const i=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:o,duration:s}=this.options;(i||o&&s)&&this.load(i,o,s).catch(()=>null)})}updateProgress(e=this.getCurrentTime()){return this.renderer.renderProgress(e/this.getDuration(),this.isPlaying()),e}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{if(!this.isSeeking()){const e=this.updateProgress();this.emit("timeupdate",e),this.emit("audioprocess",e)}}))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const e=this.updateProgress();this.emit("timeupdate",e)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop()}),this.onMediaEvent("emptied",()=>{this.timer.stop()}),this.onMediaEvent("ended",()=>{this.emit("finish")}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}),this.onMediaEvent("error",e=>{this.emit("error",e.error)}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(e,t)=>{this.options.interact&&(this.seekTo(e),this.emit("interaction",e*this.getDuration()),this.emit("click",e,t))}),this.renderer.on("dblclick",(e,t)=>{this.emit("dblclick",e,t)}),this.renderer.on("scroll",(e,t,r,i)=>{const o=this.getDuration();this.emit("scroll",e*o,t*o,r,i)}),this.renderer.on("render",()=>{this.emit("redraw")}),this.renderer.on("rendered",()=>{this.emit("redrawcomplete")}),this.renderer.on("dragstart",e=>{this.emit("dragstart",e)}),this.renderer.on("dragend",e=>{this.emit("dragend",e)}));{let e;this.subscriptions.push(this.renderer.on("drag",t=>{if(!this.options.interact)return;let r;this.renderer.renderProgress(t),clearTimeout(e),this.isPlaying()?r=0:this.options.dragToSeek===!0?r=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(r=this.options.dragToSeek.debounceTime),e=setTimeout(()=>{this.seekTo(t)},r),this.emit("interaction",t*this.getDuration()),this.emit("drag",t)}))}}initPlugins(){var e;!((e=this.options.plugins)===null||e===void 0)&&e.length&&this.options.plugins.forEach(t=>{this.registerPlugin(t)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(e=>e()),this.mediaSubscriptions=[]}setOptions(e){this.options=Object.assign({},this.options,e),this.renderer.setOptions(this.options),e.audioRate&&this.setPlaybackRate(e.audioRate),e.mediaControls!=null&&(this.getMediaElement().controls=e.mediaControls)}registerPlugin(e){return e._init(this),this.plugins.push(e),this.subscriptions.push(e.once("destroy",()=>{this.plugins=this.plugins.filter(t=>t!==e)})),e}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(e){return this.renderer.setScroll(e)}setScrollTime(e){const t=e/this.getDuration();this.renderer.setScrollPercentage(t)}getActivePlugins(){return this.plugins}loadAudio(e,t,r,i){return Me(this,void 0,void 0,function*(){var o;if(this.emit("load",e),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,!t&&!r){const a=this.options.fetchParams||{};window.AbortController&&!a.signal&&(this.abortController=new AbortController,a.signal=(o=this.abortController)===null||o===void 0?void 0:o.signal);const l=u=>this.emit("loading",u);t=yield yD.fetchBlob(e,l,a)}this.setSrc(e,t);const s=yield new Promise(a=>{const l=i||this.getDuration();l?a(l):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>a(this.getDuration()),{once:!0}))});if(!e&&!t){const a=this.getMediaElement();a instanceof jd&&(a.duration=s)}if(r)this.decodedData=Hd.createBuffer(r,s||0);else if(t){const a=yield t.arrayBuffer();this.decodedData=yield Hd.decode(a,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(e,t,r){return Me(this,void 0,void 0,function*(){try{return yield this.loadAudio(e,void 0,t,r)}catch(i){throw this.emit("error",i),i}})}loadBlob(e,t,r){return Me(this,void 0,void 0,function*(){try{return yield this.loadAudio("",e,t,r)}catch(i){throw this.emit("error",i),i}})}zoom(e){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(e),this.emit("zoom",e)}getDecodedData(){return this.decodedData}exportPeaks({channels:e=2,maxLength:t=8e3,precision:r=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const i=Math.min(e,this.decodedData.numberOfChannels),o=[];for(let s=0;s<i;s++){const a=this.decodedData.getChannelData(s),l=[],u=a.length/t;for(let c=0;c<t;c++){const d=a.slice(Math.floor(c*u),Math.ceil((c+1)*u));let h=0;for(let p=0;p<d.length;p++){const f=d[p];Math.abs(f)>Math.abs(h)&&(h=f)}l.push(Math.round(h*r)/r)}o.push(l)}return o}getDuration(){let e=super.getDuration()||0;return e!==0&&e!==1/0||!this.decodedData||(e=this.decodedData.duration),e}toggleInteraction(e){this.options.interact=e}setTime(e){super.setTime(e),this.updateProgress(e),this.emit("timeupdate",e)}seekTo(e){const t=this.getDuration()*e;this.setTime(t)}playPause(){return Me(this,void 0,void 0,function*(){return this.isPlaying()?this.pause():this.play()})}stop(){this.pause(),this.setTime(0)}skip(e){this.setTime(this.getCurrentTime()+e)}empty(){this.load("",[[0]],.001)}setMediaElement(e){this.unsubscribePlayerEvents(),super.setMediaElement(e),this.initPlayerEvents()}exportImage(){return Me(this,arguments,void 0,function*(e="image/png",t=1,r="dataURL"){return this.renderer.exportImage(e,t,r)})}destroy(){var e;this.emit("destroy"),(e=this.abortController)===null||e===void 0||e.abort(),this.plugins.forEach(t=>t.destroy()),this.subscriptions.forEach(t=>t()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}}function Vo({src:n,onError:e,filename:t,className:r=""}){const i=T.useRef(null),o=T.useRef(),s=T.useRef(),[a,l]=T.useState(!1),[u,c]=T.useState(0),[d,h]=T.useState(1),p=T.useRef(),[f,m]=T.useState(!1),E=Z(ie().t$);T.useEffect(()=>{o.current=new Audio;const _={normalize:!0,height:50,container:i.current};function S(){const I=o.current;I&&(I.error.message==="PIPELINE_ERROR_READ: FFmpegDemuxer: demuxer seek failed"?(I.load(),l(!1)):(m(!0),l(!1),e==null||e()))}const R=t.slice(t.lastIndexOf(".")+1);if(function(I){return/(?:^|\/)talkjs_audio_message_[0-9]+_([0-9]+)[.](?:mp3|webm)$/.test(I)}(t)&&R==="webm"&&!o.current.canPlayType("audio/webm;codecs=opus"))_.backend="WebAudio",s.current=new Audio("data:audio/mp3;base64,//MkxAAHiAICWABElBeKPL/RANb2w+yiT1g/gTok//lP/W/l3h8QO/OCdCqCW2Cw//MkxAQHkAIWUAhEmAQXWUOFW2dxPu//9mr60ElY5sseQ+xxesmHKtZr7bsqqX2L//MkxAgFwAYiQAhEAC2hq22d3///9FTV6tA36JdgBJoOGgc+7qvqej5Zu7/7uI9l//MkxBQHAAYi8AhEAO193vt9KGOq+6qcT7hhfN5FTInmwk8RkqKImTM55pRQHQSq//MkxBsGkgoIAABHhTACIJLf99nVI///yuW1uBqWfEu7CgNPWGpUadBmZ////4sL//MkxCMHMAH9iABEmAsKioqKigsLCwtVTEFNRTMuOTkuNVVVVVVVVVVVVVVVVVVV//MkxCkECAUYCAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),s.current.controls=!1;else{const I=o.current;I.addEventListener("error",S),I.src=n,I.preload="auto",I.preservesPitch=!0,_.media=I}p.current=function(I){var k,w,U,y,M,$,j,G;if(!I.container)return;const L=getComputedStyle(I.container),g=(k=vi.parse(L.color))!=null?k:new vi(255,255,255,1),O=g.withAlpha(g.alpha/2);return Ni.create({...I,barGap:(w=I.barGap)!=null?w:2,barRadius:(U=I.barRadius)!=null?U:0,barWidth:(y=I.barWidth)!=null?y:2,barHeight:I.barHeight,hideScrollbar:!0,cursorWidth:(M=I.cursorWidth)!=null?M:0,cursorColor:I.cursorColor,height:($=I.height)!=null?$:24,progressColor:(j=I.progressColor)!=null?j:O.toRgbaString(),waveColor:(G=I.waveColor)!=null?G:O.toRgbaString()})}(_);const v=p.current;return v.on("finish",()=>{o.current.loop=!0,l(!1)}),v.on("ready",I=>c(Math.trunc(I))),v.on("timeupdate",I=>c(Math.trunc(I))),_.backend==="WebAudio"&&v.load(n).catch(()=>{m(!0),l(!1),e==null||e()}),()=>{var I;(I=o.current)==null||I.removeEventListener("error",S),o.current=void 0,v.destroy(),p.current=void 0}},[n,t,e]);const A=T.useCallback(()=>{var _;if(p.current.options.backend==="WebAudio")p.current.isPlaying()||s.current.play(),p.current.playPause(),l((_=p.current.isPlaying())!=null?_:!1);else{const S=o.current;S.paused?S.play():S.pause(),S.loop=!1,!S.paused&&S.ended&&(S.load(),S.play()),l(!S.paused)}},[]),D=T.useCallback(_=>{p.current.setPlaybackRate(_),h(_)},[]);return f?N.jsx("div",{}):N.jsxs("div",{className:`t-audio-player ${r}`,children:[N.jsx("button",{onClick:A,children:N.jsx(zo,{className:"t-play-pause-icon",type:a?"pause":"play","aria-label":a?E.ARIA_PAUSE_AUDIO:E.ARIA_PLAY_AUDIO})}),N.jsx("div",{className:"t-waveform",ref:i}),N.jsx("div",{className:"t-duration",children:hu(u)}),N.jsxs(rr,{type:"menu",popoverComponent:MD,popoverProps:{playbackSpeed:d,selectPlaybackSpeed:D},className:"t-playback-speed","aria-label":E.ARIA_SET_PLAYBACK_SPEED,children:[d,"x",N.jsx(zo,{type:"updown",className:"t-up-down-icon","aria-hidden":!0})]})]})}Ni.BasePlugin=class extends ji{constructor(n){super(),this.subscriptions=[],this.options=n}onInit(){}_init(n){this.wavesurfer=n,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(n=>n())}},Ni.dom=vD;const wD=[.25,.5,.75,1,1.25,1.5,2];function MD({playbackSpeed:n,selectPlaybackSpeed:e}){return N.jsxs("div",{className:"t-playback-speed-menu",children:[N.jsx("div",{className:"t-playback-heading",children:"Playback Speed"}),wD.map(t=>N.jsxs(en,{className:"t-menu-item",onSelect:()=>e(t),children:[N.jsx("span",{className:"t-playback-checkmark",children:n===t?"✓ ":""}),t,"x"]},t))]})}const FD=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,xD=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/;class vi{constructor(e,t,r,i){this.red=e,this.green=t,this.blue=r,this.alpha=i}static parse(e){var r;const t=(r=e.match(FD))!=null?r:e.match(xD);if(t){const[i,o,s,a,l="1"]=t;return new vi(Number(o),Number(s),Number(a),Number(l))}return null}withAlpha(e){return new vi(this.red,this.green,this.blue,e)}toRgbaString(){const{red:e,green:t,blue:r,alpha:i}=this;return i!==1?`rgba(${e}, ${t}, ${r}, ${i})`:`rgb(${e}, ${t}, ${r})`}}const rm=/^\/.*[^\\]\/[im]*$/;function $d(n){return rm.test(n)?!Yo(n).test(""):!1}function Yo(n){const e=n.match(/^\/(.*[^\\])\/(.*)$/);if(!e)throw new Error(`Expected ${n} to be a (non-empty) regex`);let t=e[2]||"";return t=t.replace(/[^im]/g,"")+"g",new RegExp(e[1],t)}function im(n){const e=n.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp("^"+e+"$","i")}function PD(n,e){const t=Ep(e),r=im(n);return t!==void 0&&r.test(t)}const BD=/^[]/g;function om(n){return n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function cl(n,e){!n()&&!e&&(e=n.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/,"`$1`")+" was not true")}(n=>{function e(r){}function t(r,i){(function(o,s){switch(s){case"undefined":return o===void 0;case String:return typeof o=="string"||o instanceof String;case Boolean:return typeof o=="boolean"||o instanceof Boolean;case Number:return typeof o=="number"||o instanceof Number;default:return o instanceof s}})(r,i)||(i.name,String(r))}n.defined=e,n.has=function(r,i){r[i]},n.is=t,n.equals=function(r,i){},n.oneOf=function(r,i){i.includes(r)||JSON.stringify(i)},n.isArray=function(r,i){t(r,Array),r&&r.length>0&&t(r[0],i)},n.optional=function(r,i){r!==void 0&&t(r,i)},n.falsy=function(r){},n.never=function(r){}})(cl||(cl={}));const lr=cl,HD=new RegExp(":arslan:|"+/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g.source,"g"),UD=/\uFE0F/g,jD="‍";function $D(n){if(n===":arslan:")return"https://cdn.talkjs.com/__assets/5461191341cea882b3f227c085d5772c.gif";const e=function(r){const i=[];let o=0,s=0,a=0;for(;a<r.length;)o=r.charCodeAt(a++),s?(i.push((65536+(s-55296<<10)+(o-56320)).toString(16)),s=0):55296<=o&&o<=56319?s=o:i.push(o.toString(16));return i.join("-")}((t=n).indexOf(jD)<0?t.replace(UD,""):t);var t;return`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/${e}.svg`}class sm{constructor({mode:e,allowedHostnames:t,allowedPhoneNrs:r,allowedMatches:i,forbiddenMatches:o,forbiddenWords:s,suppressLinks:a,suppressEmailAddresses:l,suppressPhoneNumbers:u,replacement:c}){if(lr.oneOf(e,["all","otherOnly","off"]),this.mode=e,this.suppressLinks=a!==!1,this.suppressEmailAddresses=l!==!1,this.suppressPhoneNumbers=u!==!1,this.allowedHostnames=t||[],this.allowedPhoneNrs=(r||[]).filter(d=>d).map(d=>d.replace(/[^0-9]/g,"")),this.allowedMatches=(i||[]).filter($d).map(d=>Yo(d)),this.forbiddenMatches=(o||[]).filter($d).map(d=>Yo(d)),s){const d=s.split(`
1272
- `).map(h=>h.trim().toLowerCase()).filter(h=>h.length>0&&!h.startsWith("#")).map(h=>om(h));d.length&&this.forbiddenMatches.push(new RegExp(`\\b(${d.join("|")})\\b`,"gi"))}lr(()=>this.allowedMatches.every(d=>d.flags.includes("g")),"All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"),lr(()=>this.forbiddenMatches.every(d=>d.flags.includes("g")),"All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"),c=c==null?void 0:c.trim(),this.replacement=c&&c.length>0?c:void 0}shouldSuppress({isContentBySender:e}){return this.mode==="all"||this.mode==="otherOnly"&&!e}}function ru(n){var t,r,i,o,s,a,l,u,c,d,h,p,f;let e="";return n.t&&(e=`(${n.t("CONTACT_INFORMATION_HIDDEN")})`),{formattedLinks:(t=n.formattedLinks)!=null?t:"plaintext",markup:(r=n.markup)!=null?r:!1,useFallbackMentions:(i=n.useFallbackMentions)!=null?i:!1,sameTabLinkRules:(o=n.sameTabLinkRules)!=null?o:[],enableEmojiImageFallback:(s=n.enableEmojiImageFallback)!=null?s:!1,highlight:(a=n.highlight)!=null?a:[],contactInfo:(l=n.contactInfo)!=null?l:!1,suppression:(u=n.suppression)!=null?u:new sm({mode:"off"}),contactInfoHiddenText:(h=(d=n.contactInfoHiddenText)!=null?d:(c=n.suppression)==null?void 0:c.replacement)!=null?h:e,customEmojiUrls:(p=n.customEmojiUrls)!=null?p:{},enableActions:(f=n.enableActions)!=null?f:!0}}function zD({id:n,text:e}){var s;const t=ie(),r=Z(()=>{var u;if(t.type==="ConversationListStore")return;const a=t.state$.extCurrentConversationId.get(),l=a&&t.state$.participants.child(a).get();return(u=l==null?void 0:l.find(c=>c.user.id===n))==null?void 0:u.user}),i=Z(t.extUserId$)===n,o=`@${(s=r==null?void 0:r.name)!=null?s:e}`;return N.jsx("span",{className:"t-mention","t-is-current-user":i?"":void 0,children:o})}function VD({message:n,type:e,action:t,params:r,children:i}){const o=Bi(),s=T.useCallback(l=>{l.preventDefault(),o.triggerMessageAction(n,t,r)},[o,n,t,r]),a={"t-action":t,onClick:s};return e==="actionButton"?N.jsx("button",{...a,type:"button",children:i}):N.jsx("a",{...a,href:"#",children:i})}function Cr(n,e){const t=n.flatMap(r=>{if(typeof r=="string")return Aa(r,e.highlight);switch(r.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletpoint":case"bulletPoint":return YD(r,e);case"bulletlist":case"bulletList":return[T.createElement("ul",null,...Cr(r.children,e))];case"autolink":case"autoLink":case"link":return XD(r,e);case"codeblock":case"codeBlock":return[N.jsx("code",{"data-language":r.language,children:Aa(r.text,e.highlight)})];case"codespan":case"codeSpan":return N.jsx("code",{children:Aa((i=r.text,i.replace(/^\s*\n/m,"").replace(/\n\s*$/m,"")),e.highlight)});case"mention":return lr.falsy(e.useFallbackMentions),N.jsx(zD,{id:r.id,text:r.text},r.id);case"suppressed":return[N.jsx("i",{children:e.contactInfoHiddenText})];case"emoji":return e.enableEmojiImageFallback?[N.jsx(GD,{unicode:r.text})]:[r.text];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return KD(r,e);case"customemoji":case"customEmoji":return r.text;default:lr.never(r)}var i});return t.every(r=>typeof r=="string")?[t.join("")]:t}function Aa(n,e){if(e.length===0)return[n];const t=function(r){const i=r.map(s=>s.trim()).filter(s=>s);if(i.length===0)return BD;const o=i.map(om).join("|");return new RegExp(o,"gi")}(e);return Ma(n,cs(n,t).map(r=>({offset:r.index,matchedText:r[0]})),({matchedText:r})=>[N.jsx("span",{className:"highlighted-text",children:r})])}const YD=(n,e)=>{const t={bold:"strong",italic:"em",strikethrough:"del",blockquote:"blockquote",bulletpoint:"li",bulletPoint:"li"}[n.type];return[T.createElement(t,null,...Cr(n.children,e))]};function GD({unicode:n}){const[e,t]=T.useState(()=>n!==":arslan:");if(T.useEffect(()=>{e&&!hp(n)&&t(!1)},[]),e)return N.jsx("span",{className:"t-emoji",children:n});const r=$D(n);return N.jsx("img",{className:"t-emoji",src:r,alt:n})}const XD=(n,e)=>{const t="children"in n?n.children:[n.text];switch(e.formattedLinks){case"link":{const r=function(i,o){for(const s of i)if(rm.test(s)){if(Yo(s).test(o))return"_top"}else if(PD(s,o))return"_top";return"_blank"}(e.sameTabLinkRules,n.url);return[T.createElement("a",{target:r,href:n.url,rel:"noreferrer"},...Cr(t,e))]}case"plaintext":return"children"in n&&n.children.every(r=>typeof r=="string")?[n.children.join("")]:[T.createElement(T.Fragment,null,...Cr(t,e))];default:lr.never(e.formattedLinks)}},KD=(n,e)=>{if(!e.enableActions)return n.children;const t=n.type==="actionlink"?"actionLink":n.type==="actionbutton"?"actionButton":n.type;return[T.createElement(VD,{type:t,action:n.action,params:n.params,message:e.message},...Cr(n.children,e))]};function WD(n,e){return Oo(n,ru(e))}function Oo(n,e){return n.flatMap(t=>{if(typeof t=="string"){let r=[t];return r=ga(r,i=>function(o,s){const{suppression:{forbiddenMatches:a,allowedMatches:l}}=s,u=ql(a,c=>cs(o,c)).filter(([c])=>!l.some(d=>c.match(d)!==null)).map(c=>({offset:c.index,matchedText:c[0]}));return Ma(o,u,()=>[{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"}])}(i,e)),r=ga(r,i=>function(o){return Ma(o,function(s){const a=[];let l;for(;l=HD.exec(s);){const u=l[0],c=l.index;a.push({offset:c,matchedText:u})}return a}(o),s=>[{type:"emoji",text:s.matchedText}])}(i)),r=ga(r,i=>function(o,s){if(s.contactInfo!=="suppress")return[o];const a=[];if((s.suppression.suppressEmailAddresses||s.suppression.suppressLinks)&&a.push(zf),s.suppression.suppressPhoneNumbers&&a.push($f),a.length===0)return[o];const l=Yf(o,{multilineSteps:[],singlelineSteps:a}),u=l.map(c=>typeof c=="string"?c:zd(c.url,s.suppression)?c.text:{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"});return eu(u)}(i,e)),r}switch(t.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return{type:t.type,children:Oo(t.children,e)};case"codespan":case"codeSpan":case"codeblock":case"codeBlock":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return t;case"mention":return{type:"mention",id:t.id,text:t.text};case"autolink":case"autoLink":return function(r,i){return i.contactInfo==="link"?r:i.contactInfo==="suppress"?zd(r.url,i.suppression)?r:{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"}:r.text}(t,e);case"link":return{type:"link",url:t.url,children:Oo(t.children,e)};case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return{type:t.type,action:t.action,params:t.params,children:Oo(t.children,e)}}})}function ga(n,e){return ql(n,t=>typeof t=="string"?e(t):[t])}function zd(n,e){if(e.allowedMatches.some(t=>n.match(t)!==null))return!0;if(e.forbiddenMatches.some(t=>n.match(t)!==null))return!1;if(n.startsWith("mailto:")){const t=n.substring(7).replace(/^.*@/,"");return!e.suppressEmailAddresses||Vd(e.allowedHostnames,t)}if(n.startsWith("tel:")){const t=n.substring(4).replace(/[^0-9]/g,"");return!e.suppressPhoneNumbers||e.allowedPhoneNrs.some(r=>t.endsWith(r))}{const t=Ep(n);return!e.suppressLinks||!t||Vd(e.allowedHostnames,t)}}function Vd(n,e){for(const t of n)if(im(t).test(e))return!0;return!1}function iu({block:n,nonInteractive:e,message:t,className:r=""}){const i=!e,{nodes:o,roleOptions:s}=function(l,u){var D;const c=ie(),d=Z(c.app$.role);le.defined(d);const h=u.type==="UserMessage",p=((D=u.sender)==null?void 0:D.id)===c.extUserId$.peek(),f=d.suppressContactInfo,m=h&&f.shouldSuppress({isContentBySender:p}),E=WD(l.children,{contactInfo:m?"suppress":"link",suppression:f}),A={sameTabLinkRules:d.sameTabLinkRules,contactInfoHiddenText:d.suppressContactInfo.replacement||`(${c.t$.peek().CONTACT_INFORMATION_HIDDEN})`};return{nodes:E,roleOptions:A}}(n,t),a=function(l,u={},c){return Cr(l,{...ru(u),message:c})}(o,{enableEmojiImageFallback:!0,formattedLinks:i?"link":"plaintext",enableActions:i,...s},t);return ae.createElement("span",{className:`t-text ${r}`},...a)}function am(n){const e=Dt(),t=ie(),{className:r="",...i}=n,o=Z(()=>t.state$.messages.child(t.state$.extCurrentConversationId.get()).lookup.child(n.message.id).content.child(0).url.get());return N.jsx("div",{className:`t-message-content ${r}`,children:n.message.content.map(s=>{var a;return N.jsx(JD,{block:s,theme:e,downloadUrl:o,...i},n.message.createdAt+((a=n.message.editedAt)!=null?a:0))})})}function JD({common:n,block:e,message:t,theme:r,downloadUrl:i}){const o=function(s,a){switch(a.type){case"text":return s.TextBlock;case"location":return s.LocationBlock;case"file":switch(a.subtype){case"image":return s.ImageBlock;case"video":return s.VideoBlock;case"voice":return s.VoiceBlock;case"audio":return s.AudioBlock;default:return s.FileBlock}default:le.never(a)}}(r,e);return N.jsx(o,{block:e,common:n,message:t,downloadUrl:i})}const qD=27;function $i(n,e,t=!0){const r=T.useCallback(o=>{o.keyCode===qD&&n()},[n]),i=T.useCallback(o=>{o.target.closest(e)===null&&n()},[e,n]);T.useEffect(()=>{if(t)return window.addEventListener("keydown",r,!0),document.addEventListener("mousedown",i,!0),()=>{window.removeEventListener("keydown",r,!0),document.removeEventListener("mousedown",i,!0)}},[r,i,t])}const ZD=".search-row{margin-right:var(--emoji-padding)}.emoji-menu{grid-template-columns:repeat(auto-fill,var(--total-emoji-size));padding:var(--emoji-padding)}.emoji,button.emoji{border-radius:8px}.favorites{border-top-width:1px}input.search:focus{border-color:var(--input-focused-border-color);outline:0}.picker{container-type:size}@container (height < 300px){.favorites{display:none}}#skintone-button{margin:0 -3px 0 4px}.custom-emoji{padding:0}#emo-🏻,#emo-🏼,#emo-🏽,#emo-🏾,#emo-🏿{display:none}[data-has-mouse] .emoji:hover{background-color:var(--button-hover-background)}";function lm(n){const[e,t]=T.useState();return T.useEffect(()=>{let r=!0;return n().then(i=>{r&&t({value:i})}),()=>{r=!1}},[n]),e}function ou(n){const{onClose:e,onEmojiSelected:t}=qE(),r=T.useRef(null),i=lm(kl);return T.useEffect(()=>{if(!i)return;le.defined(r.current);const o=r.current,s=o.shadowRoot;(function(u,c){const d=document.createElement("style");d.textContent=c,u.appendChild(d)})(s,ZD);const a=u=>{var d;const c=(d=u.detail.unicode)!=null?d:u.detail.name;t(c)};function l(u){u.pointerType==="mouse"&&(s.querySelector("section").dataset.hasMouse="true")}return o.addEventListener("emoji-click",a),o.addEventListener("pointermove",l,{once:!0}),()=>{o.removeEventListener("emoji-click",a),o.removeEventListener("pointermove",l)}},[i,t]),T.useEffect(()=>{var o;i&&r.current&&((o=r.current.shadowRoot.getElementById("search"))==null||o.focus())},[i]),$i(()=>e(),".t-emoji-picker"),i?N.jsx("div",{className:"t-emoji-picker",children:N.jsx("emoji-picker",{ref:r,class:n.colorScheme})}):N.jsx("div",{className:"t-emoji-picker","t-loading":"",children:N.jsx(tu,{})})}function um({messageId:n,colorScheme:e}){const{closePopover:t}=Ml(),r=Bi();return N.jsx("div",{className:"t-reaction-picker",children:N.jsx(lp.Provider,{value:{onClose:t,onEmojiSelected:i=>{r.addReaction(n,i),t()}},children:N.jsx(ou,{colorScheme:e})})})}function dl(){return dl=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},dl.apply(this,arguments)}function cm(n,e){if(n==null)return{};var t,r,i={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(i[t]=n[t]);return i}function hl(n,e){return hl=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},hl(n,e)}function dm(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,hl(n,e)}function hm(){}function pm(){}pm.resetWarningCache=hm;function Yd(n,e){return n.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}(function(){function n(r,i,o,s,a,l){if(l!=="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function e(){return n}n.isRequired=n;var t={array:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:pm,resetWarningCache:hm};t.PropTypes=t})();const Gd=!1,fm=T.createContext(null);var ni="unmounted",gn="exited",Dn="entering",qn="entered",pl="exiting",Bt=function(n){function e(r,i){var o;o=n.call(this,r,i)||this;var s,a=i&&!i.isMounting?r.enter:r.appear;return o.appearStatus=null,r.in?a?(s=gn,o.appearStatus=Dn):s=qn:s=r.unmountOnExit||r.mountOnEnter?ni:gn,o.state={status:s},o.nextCallback=null,o}dm(e,n),e.getDerivedStateFromProps=function(r,i){return r.in&&i.status===ni?{status:gn}:null};var t=e.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(r){var i=null;if(r!==this.props){var o=this.state.status;this.props.in?o!==Dn&&o!==qn&&(i=Dn):o!==Dn&&o!==qn||(i=pl)}this.updateStatus(!1,i)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var r,i,o,s=this.props.timeout;return r=i=o=s,s!=null&&typeof s!="number"&&(r=s.exit,i=s.enter,o=s.appear!==void 0?s.appear:i),{exit:r,enter:i,appear:o}},t.updateStatus=function(r,i){r===void 0&&(r=!1),i!==null?(this.cancelNextCallback(),i===Dn?this.performEnter(r):this.performExit()):this.props.unmountOnExit&&this.state.status===gn&&this.setState({status:ni})},t.performEnter=function(r){var i=this,o=this.props.enter,s=this.context?this.context.isMounting:r,a=this.props.nodeRef?[s]:[lo.findDOMNode(this),s],l=a[0],u=a[1],c=this.getTimeouts(),d=s?c.appear:c.enter;!r&&!o||Gd?this.safeSetState({status:qn},function(){i.props.onEntered(l)}):(this.props.onEnter(l,u),this.safeSetState({status:Dn},function(){i.props.onEntering(l,u),i.onTransitionEnd(d,function(){i.safeSetState({status:qn},function(){i.props.onEntered(l,u)})})}))},t.performExit=function(){var r=this,i=this.props.exit,o=this.getTimeouts(),s=this.props.nodeRef?void 0:lo.findDOMNode(this);i&&!Gd?(this.props.onExit(s),this.safeSetState({status:pl},function(){r.props.onExiting(s),r.onTransitionEnd(o.exit,function(){r.safeSetState({status:gn},function(){r.props.onExited(s)})})})):this.safeSetState({status:gn},function(){r.props.onExited(s)})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},t.setNextCallback=function(r){var i=this,o=!0;return this.nextCallback=function(s){o&&(o=!1,i.nextCallback=null,r(s))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(r,i){this.setNextCallback(i);var o=this.props.nodeRef?this.props.nodeRef.current:lo.findDOMNode(this),s=r==null&&!this.props.addEndListener;if(o&&!s){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],l=a[0],u=a[1];this.props.addEndListener(l,u)}r!=null&&setTimeout(this.nextCallback,r)}else setTimeout(this.nextCallback,0)},t.render=function(){var r=this.state.status;if(r===ni)return null;var i=this.props,o=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var s=cm(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return T.createElement(fm.Provider,{value:null},typeof o=="function"?o(r,s):T.cloneElement(T.Children.only(o),s))},e}(T.Component);function Gn(){}Bt.contextType=fm,Bt.propTypes={},Bt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Gn,onEntering:Gn,onEntered:Gn,onExit:Gn,onExiting:Gn,onExited:Gn},Bt.UNMOUNTED=ni,Bt.EXITED=gn,Bt.ENTERING=Dn,Bt.ENTERED=qn,Bt.EXITING=pl;var Da=function(n,e){return n&&e&&e.split(" ").forEach(function(t){return i=t,void((r=n).classList?r.classList.remove(i):typeof r.className=="string"?r.className=Yd(r.className,i):r.setAttribute("class",Yd(r.className&&r.className.baseVal||"",i)));var r,i})},fl=function(n){function e(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return(r=n.call.apply(n,[this].concat(o))||this).appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1];r.removeClasses(c,"exit"),r.addClass(c,d?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(a,l)},r.onEntering=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1]?"appear":"enter";r.addClass(c,d,"active"),r.props.onEntering&&r.props.onEntering(a,l)},r.onEntered=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1]?"appear":"enter";r.removeClasses(c,d),r.addClass(c,d,"done"),r.props.onEntered&&r.props.onEntered(a,l)},r.onExit=function(a){var l=r.resolveArguments(a)[0];r.removeClasses(l,"appear"),r.removeClasses(l,"enter"),r.addClass(l,"exit","base"),r.props.onExit&&r.props.onExit(a)},r.onExiting=function(a){var l=r.resolveArguments(a)[0];r.addClass(l,"exit","active"),r.props.onExiting&&r.props.onExiting(a)},r.onExited=function(a){var l=r.resolveArguments(a)[0];r.removeClasses(l,"exit"),r.addClass(l,"exit","done"),r.props.onExited&&r.props.onExited(a)},r.resolveArguments=function(a,l){return r.props.nodeRef?[r.props.nodeRef.current,a]:[a,l]},r.getClassNames=function(a){var l=r.props.classNames,u=typeof l=="string",c=u?(u&&l?l+"-":"")+a:l[a];return{baseClassName:c,activeClassName:u?c+"-active":l[a+"Active"],doneClassName:u?c+"-done":l[a+"Done"]}},r}dm(e,n);var t=e.prototype;return t.addClass=function(r,i,o){var s=this.getClassNames(i)[o+"ClassName"],a=this.getClassNames("enter").doneClassName;i==="appear"&&o==="done"&&a&&(s+=" "+a),o==="active"&&r&&r.scrollTop,s&&(this.appliedClasses[i][o]=s,function(l,u){l&&u&&u.split(" ").forEach(function(c){return h=c,void((d=l).classList?d.classList.add(h):function(p,f){return p.classList?!!f&&p.classList.contains(f):(" "+(p.className.baseVal||p.className)+" ").indexOf(" "+f+" ")!==-1}(d,h)||(typeof d.className=="string"?d.className=d.className+" "+h:d.setAttribute("class",(d.className&&d.className.baseVal||"")+" "+h)));var d,h})}(r,s))},t.removeClasses=function(r,i){var o=this.appliedClasses[i],s=o.base,a=o.active,l=o.done;this.appliedClasses[i]={},s&&Da(r,s),a&&Da(r,a),l&&Da(r,l)},t.render=function(){var r=this.props;r.classNames;var i=cm(r,["classNames"]);return T.createElement(Bt,dl({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(T.Component);fl.defaultProps={classNames:""},fl.propTypes={};const QD={ltr:["ArrowLeft","ArrowRight"],rtl:["ArrowRight","ArrowLeft"],ttb:["ArrowUp","ArrowDown"]};function mm(n,{focused:e,setFocused:t,itemCount:r,dir:i,onConfirm:o,onSpace:s}){if(r===0)return!1;const a=c=>{var d,h,p;d=0,h=c,p=r-1,c=Math.max(d,Math.min(h,p)),t(c)},[l,u]=QD[i];switch(n){case l:return a(e-1),!0;case u:return a(e+1),!0;case" ":return!!s&&s();case"Enter":case"Tab":return o(),!0}return!1}function Em({focused:n,setFocused:e,buttonId:t}){T.useLayoutEffect(()=>{var a;const s=t(n);s&&((a=document.getElementById(s))==null||a.scrollIntoView({block:"nearest"}))},[n,t]);const r=T.useCallback(s=>{const a=s.currentTarget.dataset.index;e(+a)},[e]),i=T.useMemo(()=>({role:"menu","aria-activedescendant":t(n)}),[n,t]),o=T.useCallback(s=>({onMouseMove:r,id:t(s),"data-index":s}),[r,t]);return{containerProps:i,itemProps:o}}function Am(n){const[e,t]=T.useState([]),[r,i]=T.useState([]),[o,s]=T.useState(0),[a,l]=T.useState(0),u=lm(kl),c=T.useMemo(()=>u&&new u.value.Database({}),[u]),d=xi(),h=Z(d.state$.suggestEmojiQuery);T.useEffect(()=>{c&&(h?async function(){const D=await c.getPreferredSkinTone();l(D);let _=await c.getEmojiBySearchQuery(h);if(_=_.filter(S=>S.url||function(R){return R.version<=pp&&!t0.includes(R.unicode)}(S)),function(S,R){R.sort((v,I)=>{var O,k;const L=(O=v.shortcodes)==null?void 0:O.find(w=>w.startsWith(S)),g=(k=I.shortcodes)==null?void 0:k.find(w=>w.startsWith(S));return L&&!g?-1:!L&&g?1:L&&g?L.length-g.length:0})}(h.substring(1),_),s(0),t(_),_.length>0&&i(_),h.endsWith(":")){const S=h.slice(1,-1),R=_.find(v=>{var I;return(I=v.shortcodes)==null?void 0:I.includes(S)});R&&d.selectEmoji(ri(R,D))}}():t([]))},[h,d,c]);const p=T.useCallback(D=>{const _=e[D];return _&&"emoji-button-"+ri(_,a)},[e,a]),{containerProps:f,itemProps:m}=Em({focused:o,setFocused:s,buttonId:p}),E=e.length>0;$i(()=>d.closeSuggester(),".t-emoji-suggest-bar",E),T.useEffect(()=>{if(E)return d.listenKeydown("emoji",D=>mm(D,{dir:"ltr",focused:o,setFocused:s,itemCount:e.length,onConfirm(){const _=e[o];le.defined(_),d.selectEmoji(ri(_,a))}})),()=>{d.listenKeydown("emoji",void 0)};d.listenKeydown("emoji",void 0)},[d,e,o,E,a]);const A=T.useRef(null);return N.jsx(fl,{in:E,timeout:100,classNames:"slide",mountOnEnter:!0,unmountOnExit:!0,nodeRef:A,children:N.jsx("div",{className:"t-emoji-suggest-bar",ref:A,...f,children:r.map((D,_)=>N.jsx(e0,{emoji:D,skinTone:a,focused:_===o,onSelect:S=>d.selectEmoji(S),...m(_)},ri(D,a)))})})}function ri(n,e){return ml(n)?gm(n,e):n.name}function ml(n){return!!n.unicode}function e0(n){var u;const{emoji:e,focused:t,skinTone:r,onSelect:i,...o}=n,s=((u=e.shortcodes)!=null?u:[]).join(", "),a=ml(e)?[e.unicode,s].join(", "):s,l=ml(e)?gm(e,r):null;return N.jsx("button",{"t-focused":t?"":void 0,title:s,"aria-label":a,onClick:()=>i(ri(e,r)),...o,children:l})}function gm(n,e){var r,i;const t=(r=n.skins)==null?void 0:r.find(o=>o.tone===e);return(i=t==null?void 0:t.unicode)!=null?i:n.unicode}const t0=["🏻","🏼","🏽","🏾","🏿"],n0=["top","right","bottom","left"],El=Math.min,ur=Math.max,Go=Math.round,oo=Math.floor,yt=n=>({x:n,y:n}),r0={left:"right",right:"left",bottom:"top",top:"bottom"},i0={start:"end",end:"start"};function su(n,e){return typeof n=="function"?n(e):n}function yi(n){return n.split("-")[0]}function au(n){return n.split("-")[1]}function Dm(n){return n==="y"?"height":"width"}const o0=new Set(["top","bottom"]);function nr(n){return o0.has(yi(n))?"y":"x"}function Om(n){return nr(n)==="x"?"y":"x"}function Al(n){return n.replace(/start|end/g,e=>i0[e])}const Xd=["left","right"],Kd=["right","left"],s0=["top","bottom"],a0=["bottom","top"];function l0(n,e,t,r){const i=au(n);let o=function(s,a,l){switch(s){case"top":case"bottom":return l?a?Kd:Xd:a?Xd:Kd;case"left":case"right":return a?s0:a0;default:return[]}}(yi(n),t==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Al)))),o}function so(n){return n.replace(/left|right|bottom|top/g,e=>r0[e])}function Xo(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function Wd(n,e,t){let{reference:r,floating:i}=n;const o=nr(e),s=Om(e),a=Dm(s),l=yi(e),u=o==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(au(e)){case"start":p[s]-=h*(t&&u?-1:1);break;case"end":p[s]+=h*(t&&u?-1:1)}return p}async function gl(n,e){var t;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=su(e,n),f=function(R){return typeof R!="number"?function(v){return{top:0,right:0,bottom:0,left:0,...v}}(R):{top:R,right:R,bottom:R,left:R}}(p),m=a[h?d==="floating"?"reference":"floating":d],E=Xo(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(m)))==null||t?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),A=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,D=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),_=await(o.isElement==null?void 0:o.isElement(D))&&await(o.getScale==null?void 0:o.getScale(D))||{x:1,y:1},S=Xo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:D,strategy:l}):A);return{top:(E.top-S.top+f.top)/_.y,bottom:(S.bottom-E.bottom+f.bottom)/_.y,left:(E.left-S.left+f.left)/_.x,right:(S.right-E.right+f.right)/_.x}}function Jd(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function qd(n){return n0.some(e=>n[e]>=0)}function gs(){return typeof window!="undefined"}function Ir(n){return _m(n)?(n.nodeName||"").toLowerCase():"#document"}function ot(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function bt(n){var e;return(e=(_m(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function _m(n){return!!gs()&&(n instanceof Node||n instanceof ot(n).Node)}function mt(n){return!!gs()&&(n instanceof Element||n instanceof ot(n).Element)}function kt(n){return!!gs()&&(n instanceof HTMLElement||n instanceof ot(n).HTMLElement)}function Zd(n){return!(!gs()||typeof ShadowRoot=="undefined")&&(n instanceof ShadowRoot||n instanceof ot(n).ShadowRoot)}const u0=new Set(["inline","contents"]);function bi(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=Et(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!u0.has(i)}const c0=new Set(["table","td","th"]);function d0(n){return c0.has(Ir(n))}const h0=[":popover-open",":modal"];function Ko(n){return h0.some(e=>{try{return n.matches(e)}catch(t){return!1}})}const p0=["transform","translate","scale","rotate","perspective"],f0=["transform","translate","scale","rotate","perspective","filter"],m0=["paint","layout","strict","content"];function Dl(n){const e=lu(),t=mt(n)?Et(n):n;return p0.some(r=>!!t[r]&&t[r]!=="none")||!!t.containerType&&t.containerType!=="normal"||!e&&!!t.backdropFilter&&t.backdropFilter!=="none"||!e&&!!t.filter&&t.filter!=="none"||f0.some(r=>(t.willChange||"").includes(r))||m0.some(r=>(t.contain||"").includes(r))}function lu(){return!(typeof CSS=="undefined"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const E0=new Set(["html","body","#document"]);function cr(n){return E0.has(Ir(n))}function Et(n){return ot(n).getComputedStyle(n)}function Ds(n){return mt(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function on(n){if(Ir(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Zd(n)&&n.host||bt(n);return Zd(e)?e.host:e}function Sm(n){const e=on(n);return cr(e)?n.ownerDocument?n.ownerDocument.body:n.body:kt(e)&&bi(e)?e:Sm(e)}function Li(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=Sm(n),o=i===((r=n.ownerDocument)==null?void 0:r.body),s=ot(i);if(o){const a=Ol(s);return e.concat(s,s.visualViewport||[],bi(i)?i:[],a&&t?Li(a):[])}return e.concat(i,Li(i,[],t))}function Ol(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Tm(n){const e=Et(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=kt(n),o=i?n.offsetWidth:t,s=i?n.offsetHeight:r,a=Go(t)!==o||Go(r)!==s;return a&&(t=o,r=s),{width:t,height:r,$:a}}function uu(n){return mt(n)?n:n.contextElement}function dr(n){const e=uu(n);if(!kt(e))return yt(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:o}=Tm(e);let s=(o?Go(t.width):t.width)/r,a=(o?Go(t.height):t.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const A0=yt(0);function Rm(n){const e=ot(n);return lu()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:A0}function Un(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),o=uu(n);let s=yt(1);e&&(r?mt(r)&&(s=dr(r)):s=dr(n));const a=function(h,p,f){return p===void 0&&(p=!1),!(!f||p&&f!==ot(h))&&p}(o,t,r)?Rm(o):yt(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const h=ot(o),p=r&&mt(r)?ot(r):r;let f=h,m=Ol(f);for(;m&&r&&p!==f;){const E=dr(m),A=m.getBoundingClientRect(),D=Et(m),_=A.left+(m.clientLeft+parseFloat(D.paddingLeft))*E.x,S=A.top+(m.clientTop+parseFloat(D.paddingTop))*E.y;l*=E.x,u*=E.y,c*=E.x,d*=E.y,l+=_,u+=S,f=ot(m),m=Ol(f)}}return Xo({width:c,height:d,x:l,y:u})}function Wo(n,e){const t=Ds(n).scrollLeft;return e?e.left+t:Un(bt(n)).left+t}function Cm(n,e){const t=n.getBoundingClientRect();return{x:t.left+e.scrollLeft-Wo(n,t),y:t.top+e.scrollTop}}const g0=new Set(["absolute","fixed"]);function Qd(n,e,t){let r;if(e==="viewport")r=function(i,o){const s=ot(i),a=bt(i),l=s.visualViewport;let u=a.clientWidth,c=a.clientHeight,d=0,h=0;if(l){u=l.width,c=l.height;const f=lu();(!f||f&&o==="fixed")&&(d=l.offsetLeft,h=l.offsetTop)}const p=Wo(a);if(p<=0){const f=a.ownerDocument,m=f.body,E=getComputedStyle(m),A=f.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,D=Math.abs(a.clientWidth-m.clientWidth-A);D<=25&&(u-=D)}else p<=25&&(u+=p);return{width:u,height:c,x:d,y:h}}(n,t);else if(e==="document")r=function(i){const o=bt(i),s=Ds(i),a=i.ownerDocument.body,l=ur(o.scrollWidth,o.clientWidth,a.scrollWidth,a.clientWidth),u=ur(o.scrollHeight,o.clientHeight,a.scrollHeight,a.clientHeight);let c=-s.scrollLeft+Wo(i);const d=-s.scrollTop;return Et(a).direction==="rtl"&&(c+=ur(o.clientWidth,a.clientWidth)-l),{width:l,height:u,x:c,y:d}}(bt(n));else if(mt(e))r=function(i,o){const s=Un(i,!0,o==="fixed"),a=s.top+i.clientTop,l=s.left+i.clientLeft,u=kt(i)?dr(i):yt(1);return{width:i.clientWidth*u.x,height:i.clientHeight*u.y,x:l*u.x,y:a*u.y}}(e,t);else{const i=Rm(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Xo(r)}function Im(n,e){const t=on(n);return!(t===e||!mt(t)||cr(t))&&(Et(t).position==="fixed"||Im(t,e))}function D0(n,e,t){const r=kt(e),i=bt(e),o=t==="fixed",s=Un(n,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=yt(0);function u(){l.x=Wo(i)}if(r||!r&&!o)if((Ir(e)!=="body"||bi(i))&&(a=Ds(e)),r){const d=Un(e,!0,o,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else i&&u();o&&!r&&i&&u();const c=!i||r||o?yt(0):Cm(i,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function Oa(n){return Et(n).position==="static"}function eh(n,e){if(!kt(n)||Et(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return bt(n)===t&&(t=t.ownerDocument.body),t}function th(n,e){const t=ot(n);if(Ko(n))return t;if(!kt(n)){let i=on(n);for(;i&&!cr(i);){if(mt(i)&&!Oa(i))return i;i=on(i)}return t}let r=eh(n,e);for(;r&&d0(r)&&Oa(r);)r=eh(r,e);return r&&cr(r)&&Oa(r)&&!Dl(r)?t:r||function(i){let o=on(i);for(;kt(o)&&!cr(o);){if(Dl(o))return o;if(Ko(o))return null;o=on(o)}return null}(n)||t}const O0={convertOffsetParentRelativeRectToViewportRelativeRect:function(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const o=i==="fixed",s=bt(r),a=!!e&&Ko(e.floating);if(r===s||a&&o)return t;let l={scrollLeft:0,scrollTop:0},u=yt(1);const c=yt(0),d=kt(r);if((d||!d&&!o)&&((Ir(r)!=="body"||bi(s))&&(l=Ds(r)),kt(r))){const p=Un(r);u=dr(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const h=!s||d||o?yt(0):Cm(s,l);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:t.y*u.y-l.scrollTop*u.y+c.y+h.y}},getDocumentElement:bt,getClippingRect:function(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const o=t==="clippingAncestors"?Ko(e)?[]:function(u,c){const d=c.get(u);if(d)return d;let h=Li(u,[],!1).filter(E=>mt(E)&&Ir(E)!=="body"),p=null;const f=Et(u).position==="fixed";let m=f?on(u):u;for(;mt(m)&&!cr(m);){const E=Et(m),A=Dl(m);A||E.position!=="fixed"||(p=null),(f?!A&&!p:!A&&E.position==="static"&&p&&g0.has(p.position)||bi(m)&&!A&&Im(u,m))?h=h.filter(D=>D!==m):p=E,m=on(m)}return c.set(u,h),h}(e,this._c):[].concat(t),s=[...o,r],a=s[0],l=s.reduce((u,c)=>{const d=Qd(e,c,i);return u.top=ur(d.top,u.top),u.right=El(d.right,u.right),u.bottom=El(d.bottom,u.bottom),u.left=ur(d.left,u.left),u},Qd(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:th,getElementRects:async function(n){const e=this.getOffsetParent||th,t=this.getDimensions,r=await t(n.floating);return{reference:D0(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(n){return Array.from(n.getClientRects())},getDimensions:function(n){const{width:e,height:t}=Tm(n);return{width:e,height:t}},getScale:dr,isElement:mt,isRTL:function(n){return Et(n).direction==="rtl"}};function nh(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function _0(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=uu(n),c=i||o?[...u?Li(u):[],...Li(e)]:[];c.forEach(E=>{i&&E.addEventListener("scroll",t,{passive:!0}),o&&E.addEventListener("resize",t)});const d=u&&a?function(E,A){let D,_=null;const S=bt(E);function R(){var v;clearTimeout(D),(v=_)==null||v.disconnect(),_=null}return function v(I,L){I===void 0&&(I=!1),L===void 0&&(L=1),R();const g=E.getBoundingClientRect(),{left:O,top:k,width:w,height:U}=g;if(I||A(),!w||!U)return;const y={rootMargin:-oo(k)+"px "+-oo(S.clientWidth-(O+w))+"px "+-oo(S.clientHeight-(k+U))+"px "+-oo(O)+"px",threshold:ur(0,El(1,L))||1};let M=!0;function $(j){const G=j[0].intersectionRatio;if(G!==L){if(!M)return v();G?v(!1,G):D=setTimeout(()=>{v(!1,1e-7)},1e3)}G!==1||nh(g,E.getBoundingClientRect())||v(),M=!1}try{_=new IntersectionObserver($,{...y,root:S.ownerDocument})}catch(j){_=new IntersectionObserver($,y)}_.observe(E)}(!0),R}(u,t):null;let h,p=-1,f=null;s&&(f=new ResizeObserver(E=>{let[A]=E;A&&A.target===u&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var D;(D=f)==null||D.observe(e)})),t()}),u&&!l&&f.observe(u),f.observe(e));let m=l?Un(n):null;return l&&function E(){const A=Un(n);m&&!nh(m,A)&&t(),m=A,h=requestAnimationFrame(E)}(),t(),()=>{var E;c.forEach(A=>{i&&A.removeEventListener("scroll",t),o&&A.removeEventListener("resize",t)}),d==null||d(),(E=f)==null||E.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const S0=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...E}=su(n,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const A=yi(i),D=nr(a),_=yi(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),R=h||(_||!m?[so(a)]:function(y){const M=so(y);return[Al(y),M,Al(M)]}(a)),v=f!=="none";!h&&v&&R.push(...l0(a,m,f,S));const I=[a,...R],L=await gl(e,E),g=[];let O=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&g.push(L[A]),d){const y=function(M,$,j){j===void 0&&(j=!1);const G=au(M),V=Om(M),Y=Dm(V);let K=V==="x"?G===(j?"end":"start")?"right":"left":G==="start"?"bottom":"top";return $.reference[Y]>$.floating[Y]&&(K=so(K)),[K,so(K)]}(i,s,S);g.push(L[y[0]],L[y[1]])}if(O=[...O,{placement:i,overflows:g}],!g.every(y=>y<=0)){var k,w;const y=(((k=o.flip)==null?void 0:k.index)||0)+1,M=I[y];if(M&&(!(d==="alignment"&&D!==nr(M))||O.every(j=>nr(j.placement)!==D||j.overflows[0]>0)))return{data:{index:y,overflows:O},reset:{placement:M}};let $=(w=O.filter(j=>j.overflows[0]<=0).sort((j,G)=>j.overflows[1]-G.overflows[1])[0])==null?void 0:w.placement;if(!$)switch(p){case"bestFit":{var U;const j=(U=O.filter(G=>{if(v){const V=nr(G.placement);return V===D||V==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(V=>V>0).reduce((V,Y)=>V+Y,0)]).sort((G,V)=>G[1]-V[1])[0])==null?void 0:U[0];j&&($=j);break}case"initialPlacement":$=a}if(i!==$)return{reset:{placement:$}}}return{}}}},T0=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:r="referenceHidden",...i}=su(n,e);switch(r){case"referenceHidden":{const o=Jd(await gl(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:qd(o)}}}case"escaped":{const o=Jd(await gl(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:o,escaped:qd(o)}}}default:return{}}}}},R0=(n,e,t)=>{const r=new Map,i={platform:O0,...t},o={...i.platform,_c:r};return(async(s,a,l)=>{const{placement:u="bottom",strategy:c="absolute",middleware:d=[],platform:h}=l,p=d.filter(Boolean),f=await(h.isRTL==null?void 0:h.isRTL(a));let m=await h.getElementRects({reference:s,floating:a,strategy:c}),{x:E,y:A}=Wd(m,u,f),D=u,_={},S=0;for(let R=0;R<p.length;R++){const{name:v,fn:I}=p[R],{x:L,y:g,data:O,reset:k}=await I({x:E,y:A,initialPlacement:u,placement:D,strategy:c,middlewareData:_,rects:m,platform:h,elements:{reference:s,floating:a}});E=L!=null?L:E,A=g!=null?g:A,_={..._,[v]:{..._[v],...O}},k&&S<=50&&(S++,typeof k=="object"&&(k.placement&&(D=k.placement),k.rects&&(m=k.rects===!0?await h.getElementRects({reference:s,floating:a,strategy:c}):k.rects),{x:E,y:A}=Wd(m,D,f)),R=-1)}return{x:E,y:A,placement:D,strategy:c,middlewareData:_}})(n,e,{...i,platform:o})};var _o=typeof document!="undefined"?T.useLayoutEffect:function(){};function Jo(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,i;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!=0;)if(!Jo(n[r],e[r]))return!1;return!0}if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!=0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=t;r--!=0;){const o=i[r];if((o!=="_owner"||!n.$$typeof)&&!Jo(n[o],e[o]))return!1}return!0}return n!=n&&e!=e}function Nm(n){return typeof window=="undefined"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function rh(n,e){const t=Nm(n);return Math.round(e*t)/t}function _a(n){const e=ae.useRef(n);return _o(()=>{e.current=n}),e}const C0=(n,e)=>({...S0(n),options:[n,e]}),I0=(n,e)=>({...T0(n),options:[n,e]});var vm={exports:{}},ym=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],qo=ym.join(","),bm=typeof Element=="undefined",jn=bm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,So=!bm&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n==null?void 0:n.ownerDocument},ki=function(n,e){var t;e===void 0&&(e=!0);var r=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"inert");return r===""||r==="true"||e&&n&&ki(n.parentNode)},Lm=function(n,e,t){if(ki(n))return[];var r=Array.prototype.slice.apply(n.querySelectorAll(qo));return e&&jn.call(n,qo)&&r.unshift(n),r=r.filter(t)},Zo=function(n,e,t){for(var r=[],i=Array.from(n);i.length;){var o=i.shift();if(!ki(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),a=s.length?s:o.children,l=Zo(a,!0,t);t.flatten?r.push.apply(r,l):r.push({scopeParent:o,candidates:l})}else{jn.call(o,qo)&&t.filter(o)&&(e||!n.includes(o))&&r.push(o);var u=o.shadowRoot||typeof t.getShadowRoot=="function"&&t.getShadowRoot(o),c=!ki(u,!1)&&(!t.shadowRootFilter||t.shadowRootFilter(o));if(u&&c){var d=Zo(u===!0?o.children:u.children,!0,t);t.flatten?r.push.apply(r,d):r.push({scopeParent:o,candidates:d})}else i.unshift.apply(i,o.children)}}return r},km=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},nn=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"}(n))&&!km(n)?0:n.tabIndex},N0=function(n,e){return n.tabIndex===e.tabIndex?n.documentOrder-e.documentOrder:n.tabIndex-e.tabIndex},wm=function(n){return n.tagName==="INPUT"},v0=function(n){return function(e){return wm(e)&&e.type==="radio"}(n)&&!function(e){if(!e.name)return!0;var t,r=e.form||So(e),i=function(s){return r.querySelectorAll('input[type="radio"][name="'+s+'"]')};if(typeof window!="undefined"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")t=i(window.CSS.escape(e.name));else try{t=i(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=function(s,a){for(var l=0;l<s.length;l++)if(s[l].checked&&s[l].form===a)return s[l]}(t,e.form);return!o||o===e}(n)},ih=function(n){var e=n.getBoundingClientRect(),t=e.width,r=e.height;return t===0&&r===0},y0=function(n,e){var t=e.displayCheck,r=e.getShadowRoot;if(t==="full-native"&&"checkVisibility"in n)return!n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(n).visibility==="hidden")return!0;var i=jn.call(n,"details>summary:first-of-type")?n.parentElement:n;if(jn.call(i,"details:not([open]) *"))return!0;if(t&&t!=="full"&&t!=="full-native"&&t!=="legacy-full"){if(t==="non-zero-area")return ih(n)}else{if(typeof r=="function"){for(var o=n;n;){var s=n.parentElement,a=So(n);if(s&&!s.shadowRoot&&r(s)===!0)return ih(n);n=n.assignedSlot?n.assignedSlot:s||a===n.ownerDocument?s:a.host}n=o}if(function(l){var u,c,d,h,p=l&&So(l),f=(u=p)===null||u===void 0?void 0:u.host,m=!1;if(p&&p!==l)for(m=!!((c=f)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(f)||l!=null&&(h=l.ownerDocument)!==null&&h!==void 0&&h.contains(l));!m&&f;){var E,A,D;m=!((A=f=(E=p=So(f))===null||E===void 0?void 0:E.host)===null||A===void 0||(D=A.ownerDocument)===null||D===void 0||!D.contains(f))}return m}(n))return!n.getClientRects().length;if(t!=="legacy-full")return!0}return!1},Qo=function(n,e){return!(e.disabled||ki(e)||function(t){return wm(t)&&t.type==="hidden"}(e)||y0(e,n)||function(t){return t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"})}(e)||function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var i=0;i<r.children.length;i++){var o=r.children.item(i);if(o.tagName==="LEGEND")return!!jn.call(r,"fieldset[disabled] *")||!o.contains(t)}return!0}r=r.parentElement}return!1}(e))},_l=function(n,e){return!(v0(e)||nn(e)<0||!Qo(n,e))},b0=function(n){var e=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},Mm=function(n){var e=[],t=[];return n.forEach(function(r,i){var o=!!r.scopeParent,s=o?r.scopeParent:r,a=function(u,c){var d=nn(u);return d<0&&c&&!km(u)?0:d}(s,o),l=o?Mm(r.candidates):s;a===0?o?e.push.apply(e,l):e.push(s):t.push({documentOrder:i,tabIndex:a,item:r,isScope:o,content:l})}),t.sort(N0).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(e)},Fm=function(n,e){var t;return t=(e=e||{}).getShadowRoot?Zo([n],e.includeContainer,{filter:_l.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:b0}):Lm(n,e.includeContainer,_l.bind(null,e)),Mm(t)},cu=function(n,e){return(e=e||{}).getShadowRoot?Zo([n],e.includeContainer,{filter:Qo.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):Lm(n,e.includeContainer,Qo.bind(null,e))},On=function(n,e){if(e=e||{},!n)throw new Error("No node provided");return jn.call(n,qo)!==!1&&_l(e,n)},L0=ym.concat("iframe").join(","),To=function(n,e){if(e=e||{},!n)throw new Error("No node provided");return jn.call(n,L0)!==!1&&Qo(e,n)};const k0=Object.freeze(Object.defineProperty({__proto__:null,focusable:cu,getTabIndex:nn,isFocusable:To,isTabbable:On,tabbable:Fm},Symbol.toStringTag,{value:"Module"}));function Sa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function w0(n,e,t){return(e=function(r){var i=function(o,s){if(typeof o!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var l=a.call(o,s);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(o)}(r,"string");return typeof i=="symbol"?i:i+""}(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oh(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function sh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oh(Object(t),!0).forEach(function(r){w0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oh(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function M0(n){return function(e){if(Array.isArray(e))return Sa(e)}(n)||function(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||function(e,t){if(e){if(typeof e=="string")return Sa(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sa(e,t):void 0}}(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1273
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var F0=function(n,e){if(n.length>0){var t=n[n.length-1];t!==e&&t._setPausedState(!0)}var r=n.indexOf(e);r===-1||n.splice(r,1),n.push(e)},x0=function(n,e){var t=n.indexOf(e);t!==-1&&n.splice(t,1),n.length>0&&!n[n.length-1]._isManuallyPaused()&&n[n.length-1]._setPausedState(!1)},Ei=function(n){return(n==null?void 0:n.key)==="Tab"||(n==null?void 0:n.keyCode)===9},P0=function(n){return Ei(n)&&!n.shiftKey},B0=function(n){return Ei(n)&&n.shiftKey},ah=function(n){return setTimeout(n,0)},Ur=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return typeof n=="function"?n.apply(void 0,t):n},ao=function(n){return n.target.shadowRoot&&typeof n.composedPath=="function"?n.composedPath()[0]:n.target},H0=[];const U0=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:function(n,e){var t,r=(e==null?void 0:e.document)||document,i=(e==null?void 0:e.trapStack)||H0,o=sh({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:P0,isKeyBackward:B0},e),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a=function(g,O,k){return g&&g[O]!==void 0?g[O]:o[k||O]},l=function(g,O){var k=typeof(O==null?void 0:O.composedPath)=="function"?O.composedPath():void 0;return s.containerGroups.findIndex(function(w){var U=w.container,y=w.tabbableNodes;return U.contains(g)||(k==null?void 0:k.includes(U))||y.find(function(M){return M===g})})},u=function(g){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=O.hasFallback,w=k!==void 0&&k,U=O.params,y=U===void 0?[]:U,M=o[g];if(typeof M=="function"&&(M=M.apply(void 0,M0(y))),M===!0&&(M=void 0),!M){if(M===void 0||M===!1)return M;throw new Error("`".concat(g,"` was specified but was not a node, or did not return a node"))}var $=M;if(typeof M=="string"){try{$=r.querySelector(M)}catch(j){throw new Error("`".concat(g,'` appears to be an invalid selector; error="').concat(j.message,'"'))}if(!$&&!w)throw new Error("`".concat(g,"` as selector refers to no known node"))}return $},c=function(){var g=u("initialFocus",{hasFallback:!0});if(g===!1)return!1;if(g===void 0||g&&!To(g,o.tabbableOptions))if(l(r.activeElement)>=0)g=r.activeElement;else{var O=s.tabbableGroups[0];g=O&&O.firstTabbableNode||u("fallbackFocus")}else g===null&&(g=u("fallbackFocus"));if(!g)throw new Error("Your focus-trap needs to have at least one focusable element");return g},d=function(){if(s.containerGroups=s.containers.map(function(g){var O=Fm(g,o.tabbableOptions),k=cu(g,o.tabbableOptions),w=O.length>0?O[0]:void 0,U=O.length>0?O[O.length-1]:void 0,y=k.find(function(j){return On(j)}),M=k.slice().reverse().find(function(j){return On(j)}),$=!!O.find(function(j){return nn(j)>0});return{container:g,tabbableNodes:O,focusableNodes:k,posTabIndexesFound:$,firstTabbableNode:w,lastTabbableNode:U,firstDomTabbableNode:y,lastDomTabbableNode:M,nextTabbableNode:function(j){var G=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],V=O.indexOf(j);return V<0?G?k.slice(k.indexOf(j)+1).find(function(Y){return On(Y)}):k.slice(0,k.indexOf(j)).reverse().find(function(Y){return On(Y)}):O[V+(G?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(g){return g.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(g){return g.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(g){var O=g.activeElement;if(O)return O.shadowRoot&&O.shadowRoot.activeElement!==null?h(O.shadowRoot):O},p=function(g){g!==!1&&g!==h(document)&&(g&&g.focus?(g.focus({preventScroll:!!o.preventScroll}),s.mostRecentlyFocusedNode=g,function(O){return O.tagName&&O.tagName.toLowerCase()==="input"&&typeof O.select=="function"}(g)&&g.select()):p(c()))},f=function(g){var O=u("setReturnFocus",{params:[g]});return O||O!==!1&&g},m=function(g){var O=g.target,k=g.event,w=g.isBackward,U=w!==void 0&&w;O=O||ao(k),d();var y=null;if(s.tabbableGroups.length>0){var M=l(O,k),$=M>=0?s.containerGroups[M]:void 0;if(M<0)y=U?s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:s.tabbableGroups[0].firstTabbableNode;else if(U){var j=s.tabbableGroups.findIndex(function(ee){var F=ee.firstTabbableNode;return O===F});if(j<0&&($.container===O||To(O,o.tabbableOptions)&&!On(O,o.tabbableOptions)&&!$.nextTabbableNode(O,!1))&&(j=M),j>=0){var G=j===0?s.tabbableGroups.length-1:j-1,V=s.tabbableGroups[G];y=nn(O)>=0?V.lastTabbableNode:V.lastDomTabbableNode}else Ei(k)||(y=$.nextTabbableNode(O,!1))}else{var Y=s.tabbableGroups.findIndex(function(ee){var F=ee.lastTabbableNode;return O===F});if(Y<0&&($.container===O||To(O,o.tabbableOptions)&&!On(O,o.tabbableOptions)&&!$.nextTabbableNode(O))&&(Y=M),Y>=0){var K=Y===s.tabbableGroups.length-1?0:Y+1,W=s.tabbableGroups[K];y=nn(O)>=0?W.firstTabbableNode:W.firstDomTabbableNode}else Ei(k)||(y=$.nextTabbableNode(O))}}else y=u("fallbackFocus");return y},E=function(g){var O=ao(g);l(O,g)>=0||(Ur(o.clickOutsideDeactivates,g)?t.deactivate({returnFocus:o.returnFocusOnDeactivate}):Ur(o.allowOutsideClick,g)||g.preventDefault())},A=function(g){var O=ao(g),k=l(O,g)>=0;if(k||O instanceof Document)k&&(s.mostRecentlyFocusedNode=O);else{var w;g.stopImmediatePropagation();var U=!0;if(s.mostRecentlyFocusedNode)if(nn(s.mostRecentlyFocusedNode)>0){var y=l(s.mostRecentlyFocusedNode),M=s.containerGroups[y].tabbableNodes;if(M.length>0){var $=M.findIndex(function(j){return j===s.mostRecentlyFocusedNode});$>=0&&(o.isKeyForward(s.recentNavEvent)?$+1<M.length&&(w=M[$+1],U=!1):$-1>=0&&(w=M[$-1],U=!1))}}else s.containerGroups.some(function(j){return j.tabbableNodes.some(function(G){return nn(G)>0})})||(U=!1);else U=!1;U&&(w=m({target:s.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(s.recentNavEvent)})),p(w||s.mostRecentlyFocusedNode||c())}s.recentNavEvent=void 0},D=function(g){(o.isKeyForward(g)||o.isKeyBackward(g))&&function(O){var k=arguments.length>1&&arguments[1]!==void 0&&arguments[1];s.recentNavEvent=O;var w=m({event:O,isBackward:k});w&&(Ei(O)&&O.preventDefault(),p(w))}(g,o.isKeyBackward(g))},_=function(g){(function(O){return(O==null?void 0:O.key)==="Escape"||(O==null?void 0:O.key)==="Esc"||(O==null?void 0:O.keyCode)===27})(g)&&Ur(o.escapeDeactivates,g)!==!1&&(g.preventDefault(),t.deactivate())},S=function(g){var O=ao(g);l(O,g)>=0||Ur(o.clickOutsideDeactivates,g)||Ur(o.allowOutsideClick,g)||(g.preventDefault(),g.stopImmediatePropagation())},R=function(){if(s.active)return F0(i,t),s.delayInitialFocusTimer=o.delayInitialFocus?ah(function(){p(c())}):p(c()),r.addEventListener("focusin",A,!0),r.addEventListener("mousedown",E,{capture:!0,passive:!1}),r.addEventListener("touchstart",E,{capture:!0,passive:!1}),r.addEventListener("click",S,{capture:!0,passive:!1}),r.addEventListener("keydown",D,{capture:!0,passive:!1}),r.addEventListener("keydown",_),t},v=function(){if(s.active)return r.removeEventListener("focusin",A,!0),r.removeEventListener("mousedown",E,!0),r.removeEventListener("touchstart",E,!0),r.removeEventListener("click",S,!0),r.removeEventListener("keydown",D,!0),r.removeEventListener("keydown",_),t},I=typeof window!="undefined"&&"MutationObserver"in window?new MutationObserver(function(g){g.some(function(O){return Array.from(O.removedNodes).some(function(k){return k===s.mostRecentlyFocusedNode})})&&p(c())}):void 0,L=function(){I&&(I.disconnect(),s.active&&!s.paused&&s.containers.map(function(g){I.observe(g,{subtree:!0,childList:!0})}))};return t={get active(){return s.active},get paused(){return s.paused},activate:function(g){if(s.active)return this;var O=a(g,"onActivate"),k=a(g,"onPostActivate"),w=a(g,"checkCanFocusTrap");w||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=h(r),O==null||O();var U=function(){w&&d(),R(),L(),k==null||k()};return w?(w(s.containers.concat()).then(U,U),this):(U(),this)},deactivate:function(g){if(!s.active)return this;var O=sh({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},g);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,v(),s.active=!1,s.paused=!1,L(),x0(i,t);var k=a(O,"onDeactivate"),w=a(O,"onPostDeactivate"),U=a(O,"checkCanReturnFocus"),y=a(O,"returnFocus","returnFocusOnDeactivate");k==null||k();var M=function(){ah(function(){y&&p(f(s.nodeFocusedBeforeActivation)),w==null||w()})};return y&&U?(U(f(s.nodeFocusedBeforeActivation)).then(M,M),this):(M(),this)},pause:function(g){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,g)):this},unpause:function(g){return s.active?(s.manuallyPaused=!1,i[i.length-1]!==this?this:this._setPausedState(!1,g)):this},updateContainerElements:function(g){var O=[].concat(g).filter(Boolean);return s.containers=O.map(function(k){return typeof k=="string"?r.querySelector(k):k}),s.active&&d(),L(),this}},Object.defineProperties(t,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(g,O){if(s.paused===g)return this;if(s.paused=g,g){var k=a(O,"onPause"),w=a(O,"onPostPause");k==null||k(),v(),L(),w==null||w()}else{var U=a(O,"onUnpause"),y=a(O,"onPostUnpause");U==null||U(),d(),R(),L(),y==null||y()}return this}}}),t.updateContainerElements(n),t}},Symbol.toStringTag,{value:"Module"})),j0=Jh(U0),$0=Jh(k0);function hr(n){return hr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hr(n)}var Ta,Ra;function z0(n,e,t){return e&&function(r,i){for(var o=0;o<i.length;o++){var s=i[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,Pm(s.key),s)}}(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function V0(n,e,t){return e=es(e),function(r,i){if(i&&(hr(i)=="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(r)}(n,xm()?Reflect.construct(e,t||[],es(n).constructor):e.apply(n,t))}function xm(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(xm=function(){return!!n})()}function es(n){return es=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},es(n)}function Sl(n,e){return Sl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},Sl(n,e)}function Pm(n){var e=function(t,r){if(hr(t)!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var o=i.call(t,r);if(hr(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n,"string");return hr(e)=="symbol"?e:e+""}var ii=T,Y0=j0.createFocusTrap,G0=$0.isFocusable,X0=parseInt((Ta=(Ra=/^(\d+)\./.exec(ii.version))===null||Ra===void 0?void 0:Ra[1])!==null&&Ta!==void 0?Ta:0,10),Tl=function(){function n(e){var t;(function(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")})(this,n),function(o,s,a){(s=Pm(s))in o?Object.defineProperty(o,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[s]=a}(t=V0(this,n,[e]),"getNodeForOption",function(o){var s,a=(s=this.internalOptions[o])!==null&&s!==void 0?s:this.originalOptions[o];if(typeof a=="function"){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];a=a.apply(void 0,u)}if(a===!0&&(a=void 0),!a){if(a===void 0||a===!1)return a;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var d,h=a;if(typeof a=="string"&&!(h=(d=this.getDocument())===null||d===void 0?void 0:d.querySelector(a)))throw new Error("`".concat(o,"` as selector refers to no known node"));return h}),t.handleDeactivate=t.handleDeactivate.bind(t),t.handlePostDeactivate=t.handlePostDeactivate.bind(t),t.handleClickOutsideDeactivates=t.handleClickOutsideDeactivates.bind(t),t.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:t.handleDeactivate,onPostDeactivate:t.handlePostDeactivate,clickOutsideDeactivates:t.handleClickOutsideDeactivates},t.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var r=e.focusTrapOptions;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i!=="returnFocusOnDeactivate"&&i!=="onDeactivate"&&i!=="onPostDeactivate"&&i!=="checkCanReturnFocus"&&i!=="clickOutsideDeactivates"?t.internalOptions[i]=r[i]:t.originalOptions[i]=r[i]);return t.outsideClick=null,t.focusTrapElements=e.containerElements||[],t.updatePreviousElement(),t}return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sl(e,t)}(n,ii.Component),z0(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document!="undefined"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var e=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return e||e!==!1&&this.previouslyFocusedElement}},{key:"updatePreviousElement",value:function(){var e=this.getDocument();e&&(this.previouslyFocusedElement=e.activeElement)}},{key:"deactivateTrap",value:function(){this.focusTrap&&this.focusTrap.active&&this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(e){var t=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,e):this.originalOptions.clickOutsideDeactivates;return t&&(this.outsideClick={target:e.target,allowDeactivation:t}),t}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var e=this,t=function(){var r=e.getReturnFocusNode(),i=!(!e.originalOptions.returnFocusOnDeactivate||r==null||!r.focus||e.outsideClick&&(!e.outsideClick.allowDeactivation||G0(e.outsideClick.target,e.internalOptions.tabbableOptions))),o=e.internalOptions.preventScroll,s=o!==void 0&&o;i&&r.focus({preventScroll:s}),e.originalOptions.onPostDeactivate&&e.originalOptions.onPostDeactivate.call(null),e.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(t,t):t()}},{key:"setupFocusTrap",value:function(){this.focusTrap?this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()):this.focusTrapElements.some(Boolean)&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(e){if(this.focusTrap){e.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var t=!e.active&&this.props.active,r=e.active&&!this.props.active,i=!e.paused&&this.props.paused,o=e.paused&&!this.props.paused;if(t&&(this.updatePreviousElement(),this.focusTrap.activate()),r)return void this.deactivateTrap();i&&this.focusTrap.pause(),o&&this.focusTrap.unpause()}else e.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var e=this,t=this.props.children?ii.Children.only(this.props.children):void 0;if(t){if(t.type&&t.type===ii.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");return ii.cloneElement(t,{ref:function(r){var i=e.props.containerElements;t&&(X0>=19?typeof t.props.ref=="function"?t.props.ref(r):t.props.ref&&(t.props.ref.current=r):typeof t.ref=="function"?t.ref(r):t.ref&&(t.ref.current=r)),e.focusTrapElements=i||[r]}})}return null}}])}();Tl.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:Y0},vm.exports=Tl;var K0=vm.exports.FocusTrap=Tl;function Bm(n){var m;const{children:e,preferredPlacement:t="top-start",anchorElement:r,boundaryElement:i,trapFocus:o=!1,initialFocus:s,...a}=n,{anchor:l,boundary:u}=T.useMemo(()=>({anchor:lh(r),boundary:i?lh(i):void 0}),[r,i]);let c=[];u&&(c=[C0({boundary:u}),I0({boundary:u})]);const{refs:d,floatingStyles:h,middlewareData:p}=function(E){E===void 0&&(E={});const{placement:A="bottom",strategy:D="absolute",middleware:_=[],platform:S,elements:{reference:R,floating:v}={},transform:I=!0,whileElementsMounted:L,open:g}=E,[O,k]=ae.useState({x:0,y:0,strategy:D,placement:A,middlewareData:{},isPositioned:!1}),[w,U]=ae.useState(_);Jo(w,_)||U(_);const[y,M]=ae.useState(null),[$,j]=ae.useState(null),G=ae.useCallback(ue=>{ue!==W.current&&(W.current=ue,M(ue))},[]),V=ae.useCallback(ue=>{ue!==ee.current&&(ee.current=ue,j(ue))},[]),Y=R||y,K=v||$,W=ae.useRef(null),ee=ae.useRef(null),F=ae.useRef(O),re=L!=null,Oe=_a(L),_e=_a(S),Qe=_a(g),ct=ae.useCallback(()=>{if(!W.current||!ee.current)return;const ue={placement:A,strategy:D,middleware:w};_e.current&&(ue.platform=_e.current),R0(W.current,ee.current,ue).then($n=>{const _t={...$n,isPositioned:Qe.current!==!1};kr.current&&!Jo(F.current,_t)&&(F.current=_t,aE.flushSync(()=>{k(_t)}))})},[w,A,D,_e,Qe]);_o(()=>{g===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,k(ue=>({...ue,isPositioned:!1})))},[g]);const kr=ae.useRef(!1);_o(()=>(kr.current=!0,()=>{kr.current=!1}),[]),_o(()=>{if(Y&&(W.current=Y),K&&(ee.current=K),Y&&K){if(Oe.current)return Oe.current(Y,K,ct);ct()}},[Y,K,ct,Oe,re]);const Ot=ae.useMemo(()=>({reference:W,floating:ee,setReference:G,setFloating:V}),[G,V]),Ce=ae.useMemo(()=>({reference:Y,floating:K}),[Y,K]),Ft=ae.useMemo(()=>{const ue={position:D,left:0,top:0};if(!Ce.floating)return ue;const $n=rh(Ce.floating,O.x),_t=rh(Ce.floating,O.y);return I?{...ue,transform:"translate("+$n+"px, "+_t+"px)",...Nm(Ce.floating)>=1.5&&{willChange:"transform"}}:{position:D,left:$n,top:_t}},[D,I,Ce.floating,O.x,O.y]);return ae.useMemo(()=>({...O,update:ct,refs:Ot,elements:Ce,floatingStyles:Ft}),[O,ct,Ot,Ce,Ft])}({placement:t,middleware:c,whileElementsMounted:_0});T.useLayoutEffect(()=>{l&&d.setReference(l)},[d,l]);const f=o?N.jsx(K0,{focusTrapOptions:{initialFocus:s,fallbackFocus:".t-fallback-focus",tabbableOptions:{getShadowRoot:!0}},children:N.jsxs("div",{children:[e,N.jsx("span",{className:"t-fallback-focus",tabIndex:-1})]})}):e;return N.jsx("div",{ref:d.setFloating,style:{...h,zIndex:1e3,visibility:(m=p.hide)!=null&&m.referenceHidden?"hidden":"visible"},...a,children:f})}function lh(n){return typeof n=="string"?document.querySelector(n):n}function Hm(n){const e=ie(),t=Z(()=>e.mentionableUsers$.get()),[r,i]=T.useState(0),o=xi(),s=Z(o.state$.suggestMentionQuery),a=T.useMemo(()=>Object.fromEntries(t.map(p=>{return[p.id,(f=p.name,[...f.matchAll(/^|\s+/g)].map(m=>m.index+m[0].length).map(m=>f.substring(m)))];var f})),[t]),l=T.useMemo(()=>{if(!s)return[];const p=uh(s);return p===""?t:t.filter(f=>a[f.id].some(m=>function(E,A){return ic(E.substring(0,A.length),A)}(m,p)))},[s,t,a]),u=T.useRef(void 0);T.useEffect(()=>{if(u.current){const p=l.findIndex(f=>f.id===u.current);i(p===-1?0:p)}},[l]),T.useEffect(()=>{var p;u.current=(p=l[r])==null?void 0:p.id},[r,l]);const c=T.useCallback(p=>{var m;const f=(m=l[p])==null?void 0:m.id;return f&&"mention-button-"+f},[l]),{containerProps:d,itemProps:h}=Em({focused:r,setFocused:i,buttonId:c});return T.useEffect(()=>{if(l.length!==0)return o.listenKeydown("mention",p=>mm(p,{dir:"ttb",focused:r,setFocused:i,itemCount:l.length,onSpace(){if(s){const f=l[r];if(ic(f.name,uh(s)))return o.selectMention(f),!0}return!1},onConfirm(){const f=l[r];o.selectMention(f)}})),()=>{o.listenKeydown("mention",void 0)}},[o,r,l,s]),$i(()=>o.closeSuggester(),".t-mention-suggest-list",l.length>0),l.length===0?null:N.jsx(Bm,{className:"t-mention-suggest-list",...d,anchorElement:".ProseMirror-suggestion",children:l.map((p,f)=>N.jsx(W0,{user:p,isFocused:f===r,onSelect:()=>o.selectMention(p),...h(f)},p.id))})}const W0=ae.memo(function(n){const{user:e,isFocused:t,onSelect:r,...i}=n;return N.jsx("button",{className:t?"focused":"",onClick:()=>r(e.id),...i,children:e.name})});function uh(n){return le(n[0]==="@"),n.substring(1)}function ch(n,e,t){const r=cu(n),i=r.indexOf(e);return i===-1?null:r[i+t]||null}const J0=T.forwardRef(function(n,e){const{children:t,triggerElement:r}=n,{closePopover:i}=Ml(),o=T.useRef(null);T.useImperativeHandle(e,()=>o.current),T.useEffect(()=>{var a;(a=o.current)==null||a.focus()},[]);const s=T.useCallback(a=>{(function(l,u,c,d){var E;const h=u.querySelectorAll("[t-menu-item]"),p=document.activeElement;if(!p||!p.hasAttribute("t-menu-item")&&!p.hasAttribute("t-menu"))return;const f=Array.from(h).indexOf(p);let m;switch(l.key){case"ArrowDown":m=Math.min(f+1,h.length-1);break;case"ArrowUp":m=Math.max(f-1,0),f===-1&&(m=h.length-1);break;case"Home":m=0;break;case"End":m=h.length-1;break;case"Tab":{const A=c.closest("t-chatbox,t-conversation-list,.t-chatbox,.t-conversation-list"),D=l.shiftKey?ch(A,c,-1):function(_,S){return ch(_,S,1)}(A,c);return D==null||D.focus(),void d()}default:return}(E=h[m])==null||E.focus()})(a,o.current,r,i)},[i,r]);return N.jsx("div",{"t-menu":"",role:"menu",tabIndex:-1,ref:o,onKeyDown:s,children:t})});function rr(n){const{popoverComponent:e,popoverProps:t,children:r,type:i="popover",initialFocus:o,...s}=n,[a,l]=T.useState(void 0),u=T.useRef(null),[c,d]=T.useState(!1);$i(T.useCallback(()=>{var p;d(!1),(p=u.current)==null||p.focus()},[]),"[t-popover-content]",c);const h=i==="menu"?N.jsx(J0,{triggerElement:u.current,children:N.jsx(e,{...t})}):N.jsx(e,{...t});return N.jsxs(ZE.Provider,{value:{closePopover:()=>d(!1)},children:[N.jsx(q0,{...s,"aria-haspopup":i==="menu"?"menu":"true","aria-expanded":c,onTrigger:()=>d(!0),ref:p=>(f=>{var E;const m=(E=f==null?void 0:f.closest("[t-menu-boundary]"))!=null?E:void 0;u.current=f,l(m)})(p),children:r}),c&&N.jsx(Bm,{"t-popover-content":"",anchorElement:u.current,boundaryElement:a,preferredPlacement:"bottom-start",trapFocus:i==="popover",initialFocus:i==="menu"?"t-menu":o,role:i==="menu"?void 0:"dialog",children:h})]})}const q0=T.forwardRef(function(n,e){const{onTrigger:t,...r}=n,i=T.useCallback(o=>{o.key!=="Enter"&&o.key!==" "||t()},[t]);return N.jsx("button",{...r,ref:e,onClick:t,onKeyDown:i})});function en(n){const{onSelect:e,...t}=n,{closePopover:r}=Ml(),i=T.useCallback(s=>{s.key!=="Enter"&&s.key!==" "||(r(),e==null||e())},[e,r]),o=T.useCallback(()=>{r(),e==null||e()},[r,e]);return N.jsx("div",{tabIndex:-1,role:"menuitem",onClick:o,onKeyDown:i,"t-menu-item":"",...t})}function Um(n){return mp(n)}function _n(n){var e;return(e=n.photoUrl)!=null?e:function(t,r){const i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
1271
+ `,[e,t]}setOptions(e){if(this.options.container!==e.container){const t=this.parentFromOptionsContainer(e.container);t.appendChild(this.container),this.parent=t}e.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.options=e,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(e){this.scrollContainer.scrollLeft=e}setScrollPercentage(e){const{scrollWidth:t}=this.scrollContainer,r=t*e;this.setScroll(r)}destroy(){var e,t;this.subscriptions.forEach(r=>r()),this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.unsubscribeOnScroll)===null||t===void 0||t.call(this)}createDelay(e=10){let t,r;const i=()=>{t&&clearTimeout(t),r&&r()};return this.timeouts.push(i),()=>new Promise((o,s)=>{i(),r=s,t=setTimeout(()=>{t=void 0,r=void 0,o()},e)})}convertColorValues(e){if(!Array.isArray(e))return e||"";if(e.length<2)return e[0]||"";const t=document.createElement("canvas"),r=t.getContext("2d"),i=t.height*(window.devicePixelRatio||1),o=r.createLinearGradient(0,0,0,i),s=1/(e.length-1);return e.forEach((a,l)=>{const u=l*s;o.addColorStop(u,a)}),o}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(e,t,r,i){const o=e[0],s=e[1]||e[0],a=o.length,{width:l,height:u}=r.canvas,c=u/2,d=this.getPixelRatio(),h=t.barWidth?t.barWidth*d:1,p=t.barGap?t.barGap*d:t.barWidth?h/2:0,f=t.barRadius||0,m=l/(h+p)/a,E=f&&"roundRect"in r?"roundRect":"rect";r.beginPath();let A=0,D=0,_=0;for(let S=0;S<=a;S++){const T=Math.round(S*m);if(T>A){const L=Math.round(D*c*i),g=L+Math.round(_*c*i)||1;let O=c-L;t.barAlign==="top"?O=0:t.barAlign==="bottom"&&(O=u-g),r[E](A*(h+p),O,h,g,f),A=T,D=0,_=0}const N=Math.abs(o[S]||0),I=Math.abs(s[S]||0);N>D&&(D=N),I>_&&(_=I)}r.fill(),r.closePath()}renderLineWaveform(e,t,r,i){const o=s=>{const a=e[s]||e[0],l=a.length,{height:u}=r.canvas,c=u/2,d=r.canvas.width/l;r.moveTo(0,c);let h=0,p=0;for(let f=0;f<=l;f++){const m=Math.round(f*d);if(m>h){const A=c+(Math.round(p*c*i)||1)*(s===0?-1:1);r.lineTo(h,A),h=m,p=0}const E=Math.abs(a[f]||0);E>p&&(p=E)}r.lineTo(h,c)};r.beginPath(),o(0),o(1),r.fill(),r.closePath()}renderWaveform(e,t,r){if(r.fillStyle=this.convertColorValues(t.waveColor),t.renderFunction)return void t.renderFunction(e,r);let i=t.barHeight||1;if(t.normalize){const o=Array.from(e[0]).reduce((s,a)=>Math.max(s,Math.abs(a)),0);i=o?1/o:1}t.barWidth||t.barGap||t.barAlign?this.renderBarWaveform(e,t,r,i):this.renderLineWaveform(e,t,r,i)}renderSingleCanvas(e,t,r,i,o,s,a){const l=this.getPixelRatio(),u=document.createElement("canvas");u.width=Math.round(r*l),u.height=Math.round(i*l),u.style.width=`${r}px`,u.style.height=`${i}px`,u.style.left=`${Math.round(o)}px`,s.appendChild(u);const c=u.getContext("2d");if(this.renderWaveform(e,t,c),u.width>0&&u.height>0){const d=u.cloneNode(),h=d.getContext("2d");h.drawImage(u,0,0),h.globalCompositeOperation="source-in",h.fillStyle=this.convertColorValues(t.progressColor),h.fillRect(0,0,u.width,u.height),a.appendChild(d)}}renderMultiCanvas(e,t,r,i,o,s){const a=this.getPixelRatio(),{clientWidth:l}=this.scrollContainer;if(l*a>=r)return void this.renderSingleCanvas(e,t,l,i,0,o,s);const u=r/a;let c=Math.min(Rr.MAX_CANVAS_WIDTH,l,u),d={};if(t.barWidth||t.barGap){const E=t.barWidth||.5,A=E+(t.barGap||E/2);c%A!=0&&(c=Math.floor(c/A)*A)}const h=E=>{if(E<0||E>=p||d[E])return;d[E]=!0;const A=E*c,D=Math.min(u-A,c);if(D<=0)return;const _=e.map(S=>{const T=Math.floor(A/u*S.length),N=Math.floor((A+D)/u*S.length);return S.slice(T,N)});this.renderSingleCanvas(_,t,D,i,A,o,s)},p=Math.ceil(u/c),f=this.scrollContainer.scrollLeft/u,m=Math.floor(f*p);h(m-1),h(m),h(m+1),p>1&&(this.unsubscribeOnScroll=this.on("scroll",()=>{const{scrollLeft:E}=this.scrollContainer,A=Math.floor(E/u*p);Object.keys(d).length>Rr.MAX_NODES&&(o.innerHTML="",s.innerHTML="",d={}),h(A-1),h(A),h(A+1)}))}renderChannel(e,t,r,i){var{overlay:o}=t,s=function(c,d){var h={};for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&d.indexOf(p)<0&&(h[p]=c[p]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function"){var f=0;for(p=Object.getOwnPropertySymbols(c);f<p.length;f++)d.indexOf(p[f])<0&&Object.prototype.propertyIsEnumerable.call(c,p[f])&&(h[p[f]]=c[p[f]])}return h}(t,["overlay"]);const a=document.createElement("div"),l=this.getHeight(s.height,s.splitChannels);a.style.height=`${l}px`,o&&i>0&&(a.style.marginTop=`-${l}px`),this.canvasWrapper.style.minHeight=`${l}px`,this.canvasWrapper.appendChild(a);const u=a.cloneNode();this.progressWrapper.appendChild(u),this.renderMultiCanvas(e,s,r,l,a,u)}render(e){return Me(this,void 0,void 0,function*(){var t;this.timeouts.forEach(l=>l()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const r=this.getPixelRatio(),i=this.scrollContainer.clientWidth,o=Math.ceil(e.duration*(this.options.minPxPerSec||0));this.isScrollable=o>i;const s=this.options.fillParent&&!this.isScrollable,a=(s?i:o)*r;if(this.wrapper.style.width=s?"100%":`${o}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=e,this.emit("render"),this.options.splitChannels)for(let l=0;l<e.numberOfChannels;l++){const u=Object.assign(Object.assign({},this.options),(t=this.options.splitChannels)===null||t===void 0?void 0:t[l]);this.renderChannel([e.getChannelData(l)],u,a,l)}else{const l=[e.getChannelData(0)];e.numberOfChannels>1&&l.push(e.getChannelData(1)),this.renderChannel(l,this.options,a,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){var e;if((e=this.unsubscribeOnScroll)===null||e===void 0||e.call(this),delete this.unsubscribeOnScroll,!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:r}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:i}=this.progressWrapper.getBoundingClientRect();let o=i-r;o*=2,o=o<0?Math.floor(o):Math.ceil(o),o/=2,this.scrollContainer.scrollLeft+=o}}zoom(e){this.options.minPxPerSec=e,this.reRender()}scrollIntoView(e,t=!1){const{scrollLeft:r,scrollWidth:i,clientWidth:o}=this.scrollContainer,s=e*i,a=r,l=r+o,u=o/2;if(this.isDragging)s+30>l?this.scrollContainer.scrollLeft+=30:s-30<a&&(this.scrollContainer.scrollLeft-=30);else{(s<a||s>l)&&(this.scrollContainer.scrollLeft=s-(this.options.autoCenter?u:0));const c=s-r-u;t&&this.options.autoCenter&&c>0&&(this.scrollContainer.scrollLeft+=Math.min(c,10))}{const c=this.scrollContainer.scrollLeft,d=c/i,h=(c+o)/i;this.emit("scroll",d,h,c,c+o)}}renderProgress(e,t){if(isNaN(e))return;const r=100*e;this.canvasWrapper.style.clipPath=`polygon(${r}% 0, 100% 0, 100% 100%, ${r}% 100%)`,this.progressWrapper.style.width=`${r}%`,this.cursor.style.left=`${r}%`,this.cursor.style.transform=`translateX(-${Math.round(r)===100?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(e,t)}exportImage(e,t,r){return Me(this,void 0,void 0,function*(){const i=this.canvasWrapper.querySelectorAll("canvas");if(!i.length)throw new Error("No waveform data");if(r==="dataURL"){const o=Array.from(i).map(s=>s.toDataURL(e,t));return Promise.resolve(o)}return Promise.all(Array.from(i).map(o=>new Promise((s,a)=>{o.toBlob(l=>{l?s(l):a(new Error("Could not export image"))},e,t)})))})}}Rr.MAX_CANVAS_WIDTH=8e3,Rr.MAX_NODES=10;class LD extends ji{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}}class $d extends ji{constructor(e=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=e,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return Me(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(e){if(this.currentSrc=e,this._duration=void 0,!e)return this.buffer=null,void this.emit("emptied");fetch(e).then(t=>{if(t.status>=400)throw new Error(`Failed to fetch ${e}: ${t.status} (${t.statusText})`);return t.arrayBuffer()}).then(t=>this.currentSrc!==e?null:this.audioContext.decodeAudioData(t)).then(t=>{this.currentSrc===e&&(this.buffer=t,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var e;if(!this.paused)return;this.paused=!1,(e=this.bufferNode)===null||e===void 0||e.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let t=this.playedDuration*this._playbackRate;t>=this.duration&&(t=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,t),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var e;this.paused=!0,(e=this.bufferNode)===null||e===void 0||e.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return Me(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(e){var t,r;const i=e-this.currentTime;(t=this.bufferNode)===null||t===void 0||t.stop(this.audioContext.currentTime+i),(r=this.bufferNode)===null||r===void 0||r.addEventListener("ended",()=>{this.bufferNode=null,this.pause()},{once:!0})}setSinkId(e){return Me(this,void 0,void 0,function*(){return this.audioContext.setSinkId(e)})}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this.bufferNode&&(this.bufferNode.playbackRate.value=e)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(e){const t=!this.paused;t&&this._pause(),this.playedDuration=e/this._playbackRate,t&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var e,t;return(e=this._duration)!==null&&e!==void 0?e:((t=this.buffer)===null||t===void 0?void 0:t.duration)||0}set duration(e){this._duration=e}get volume(){return this.gainNode.gain.value}set volume(e){this.gainNode.gain.value=e,this.emit("volumechange")}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(e){return/^(audio|video)\//.test(e)}getGainNode(){return this.gainNode}getChannelData(){const e=[];if(!this.buffer)return e;const t=this.buffer.numberOfChannels;for(let r=0;r<t;r++)e.push(this.buffer.getChannelData(r));return e}}const kD={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};class Ni extends bD{static create(e){return new Ni(e)}constructor(e){const t=e.media||(e.backend==="WebAudio"?new $d:void 0);super({media:t,mediaControls:e.mediaControls,autoplay:e.autoplay,playbackRate:e.audioRate}),this.plugins=[],this.decodedData=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},kD,e),this.timer=new LD;const r=t?void 0:this.getMediaElement();this.renderer=new Rr(this.options,r),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const i=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:o,duration:s}=this.options;(i||o&&s)&&this.load(i,o,s).catch(()=>null)})}updateProgress(e=this.getCurrentTime()){return this.renderer.renderProgress(e/this.getDuration(),this.isPlaying()),e}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{if(!this.isSeeking()){const e=this.updateProgress();this.emit("timeupdate",e),this.emit("audioprocess",e)}}))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const e=this.updateProgress();this.emit("timeupdate",e)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop()}),this.onMediaEvent("emptied",()=>{this.timer.stop()}),this.onMediaEvent("ended",()=>{this.emit("finish")}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}),this.onMediaEvent("error",e=>{this.emit("error",e.error)}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(e,t)=>{this.options.interact&&(this.seekTo(e),this.emit("interaction",e*this.getDuration()),this.emit("click",e,t))}),this.renderer.on("dblclick",(e,t)=>{this.emit("dblclick",e,t)}),this.renderer.on("scroll",(e,t,r,i)=>{const o=this.getDuration();this.emit("scroll",e*o,t*o,r,i)}),this.renderer.on("render",()=>{this.emit("redraw")}),this.renderer.on("rendered",()=>{this.emit("redrawcomplete")}),this.renderer.on("dragstart",e=>{this.emit("dragstart",e)}),this.renderer.on("dragend",e=>{this.emit("dragend",e)}));{let e;this.subscriptions.push(this.renderer.on("drag",t=>{if(!this.options.interact)return;let r;this.renderer.renderProgress(t),clearTimeout(e),this.isPlaying()?r=0:this.options.dragToSeek===!0?r=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(r=this.options.dragToSeek.debounceTime),e=setTimeout(()=>{this.seekTo(t)},r),this.emit("interaction",t*this.getDuration()),this.emit("drag",t)}))}}initPlugins(){var e;!((e=this.options.plugins)===null||e===void 0)&&e.length&&this.options.plugins.forEach(t=>{this.registerPlugin(t)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(e=>e()),this.mediaSubscriptions=[]}setOptions(e){this.options=Object.assign({},this.options,e),this.renderer.setOptions(this.options),e.audioRate&&this.setPlaybackRate(e.audioRate),e.mediaControls!=null&&(this.getMediaElement().controls=e.mediaControls)}registerPlugin(e){return e._init(this),this.plugins.push(e),this.subscriptions.push(e.once("destroy",()=>{this.plugins=this.plugins.filter(t=>t!==e)})),e}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(e){return this.renderer.setScroll(e)}setScrollTime(e){const t=e/this.getDuration();this.renderer.setScrollPercentage(t)}getActivePlugins(){return this.plugins}loadAudio(e,t,r,i){return Me(this,void 0,void 0,function*(){var o;if(this.emit("load",e),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,!t&&!r){const a=this.options.fetchParams||{};window.AbortController&&!a.signal&&(this.abortController=new AbortController,a.signal=(o=this.abortController)===null||o===void 0?void 0:o.signal);const l=u=>this.emit("loading",u);t=yield yD.fetchBlob(e,l,a)}this.setSrc(e,t);const s=yield new Promise(a=>{const l=i||this.getDuration();l?a(l):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>a(this.getDuration()),{once:!0}))});if(!e&&!t){const a=this.getMediaElement();a instanceof $d&&(a.duration=s)}if(r)this.decodedData=Ud.createBuffer(r,s||0);else if(t){const a=yield t.arrayBuffer();this.decodedData=yield Ud.decode(a,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(e,t,r){return Me(this,void 0,void 0,function*(){try{return yield this.loadAudio(e,void 0,t,r)}catch(i){throw this.emit("error",i),i}})}loadBlob(e,t,r){return Me(this,void 0,void 0,function*(){try{return yield this.loadAudio("",e,t,r)}catch(i){throw this.emit("error",i),i}})}zoom(e){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(e),this.emit("zoom",e)}getDecodedData(){return this.decodedData}exportPeaks({channels:e=2,maxLength:t=8e3,precision:r=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const i=Math.min(e,this.decodedData.numberOfChannels),o=[];for(let s=0;s<i;s++){const a=this.decodedData.getChannelData(s),l=[],u=a.length/t;for(let c=0;c<t;c++){const d=a.slice(Math.floor(c*u),Math.ceil((c+1)*u));let h=0;for(let p=0;p<d.length;p++){const f=d[p];Math.abs(f)>Math.abs(h)&&(h=f)}l.push(Math.round(h*r)/r)}o.push(l)}return o}getDuration(){let e=super.getDuration()||0;return e!==0&&e!==1/0||!this.decodedData||(e=this.decodedData.duration),e}toggleInteraction(e){this.options.interact=e}setTime(e){super.setTime(e),this.updateProgress(e),this.emit("timeupdate",e)}seekTo(e){const t=this.getDuration()*e;this.setTime(t)}playPause(){return Me(this,void 0,void 0,function*(){return this.isPlaying()?this.pause():this.play()})}stop(){this.pause(),this.setTime(0)}skip(e){this.setTime(this.getCurrentTime()+e)}empty(){this.load("",[[0]],.001)}setMediaElement(e){this.unsubscribePlayerEvents(),super.setMediaElement(e),this.initPlayerEvents()}exportImage(){return Me(this,arguments,void 0,function*(e="image/png",t=1,r="dataURL"){return this.renderer.exportImage(e,t,r)})}destroy(){var e;this.emit("destroy"),(e=this.abortController)===null||e===void 0||e.abort(),this.plugins.forEach(t=>t.destroy()),this.subscriptions.forEach(t=>t()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}}function Vo({src:n,onError:e,filename:t,className:r=""}){const i=R.useRef(null),o=R.useRef(),s=R.useRef(),[a,l]=R.useState(!1),[u,c]=R.useState(0),[d,h]=R.useState(1),p=R.useRef(),[f,m]=R.useState(!1),E=Z(ie().t$);R.useEffect(()=>{o.current=new Audio;const _={normalize:!0,height:50,container:i.current};function S(){const I=o.current;I&&(I.error.message==="PIPELINE_ERROR_READ: FFmpegDemuxer: demuxer seek failed"?(I.load(),l(!1)):(m(!0),l(!1),e==null||e()))}const T=t.slice(t.lastIndexOf(".")+1);if(function(I){return/(?:^|\/)talkjs_audio_message_[0-9]+_([0-9]+)[.](?:mp3|webm)$/.test(I)}(t)&&T==="webm"&&!o.current.canPlayType("audio/webm;codecs=opus"))_.backend="WebAudio",s.current=new Audio("data:audio/mp3;base64,//MkxAAHiAICWABElBeKPL/RANb2w+yiT1g/gTok//lP/W/l3h8QO/OCdCqCW2Cw//MkxAQHkAIWUAhEmAQXWUOFW2dxPu//9mr60ElY5sseQ+xxesmHKtZr7bsqqX2L//MkxAgFwAYiQAhEAC2hq22d3///9FTV6tA36JdgBJoOGgc+7qvqej5Zu7/7uI9l//MkxBQHAAYi8AhEAO193vt9KGOq+6qcT7hhfN5FTInmwk8RkqKImTM55pRQHQSq//MkxBsGkgoIAABHhTACIJLf99nVI///yuW1uBqWfEu7CgNPWGpUadBmZ////4sL//MkxCMHMAH9iABEmAsKioqKigsLCwtVTEFNRTMuOTkuNVVVVVVVVVVVVVVVVVVV//MkxCkECAUYCAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),s.current.controls=!1;else{const I=o.current;I.addEventListener("error",S),I.src=n,I.preload="auto",I.preservesPitch=!0,_.media=I}p.current=function(I){var k,w,U,y,M,$,j,G;if(!I.container)return;const L=getComputedStyle(I.container),g=(k=vi.parse(L.color))!=null?k:new vi(255,255,255,1),O=g.withAlpha(g.alpha/2);return Ni.create({...I,barGap:(w=I.barGap)!=null?w:2,barRadius:(U=I.barRadius)!=null?U:0,barWidth:(y=I.barWidth)!=null?y:2,barHeight:I.barHeight,hideScrollbar:!0,cursorWidth:(M=I.cursorWidth)!=null?M:0,cursorColor:I.cursorColor,height:($=I.height)!=null?$:24,progressColor:(j=I.progressColor)!=null?j:O.toRgbaString(),waveColor:(G=I.waveColor)!=null?G:O.toRgbaString()})}(_);const N=p.current;return N.on("finish",()=>{o.current.loop=!0,l(!1)}),N.on("ready",I=>c(Math.trunc(I))),N.on("timeupdate",I=>c(Math.trunc(I))),_.backend==="WebAudio"&&N.load(n).catch(()=>{m(!0),l(!1),e==null||e()}),()=>{var I;(I=o.current)==null||I.removeEventListener("error",S),o.current=void 0,N.destroy(),p.current=void 0}},[n,t,e]);const A=R.useCallback(()=>{var _;if(p.current.options.backend==="WebAudio")p.current.isPlaying()||s.current.play(),p.current.playPause(),l((_=p.current.isPlaying())!=null?_:!1);else{const S=o.current;S.paused?S.play():S.pause(),S.loop=!1,!S.paused&&S.ended&&(S.load(),S.play()),l(!S.paused)}},[]),D=R.useCallback(_=>{p.current.setPlaybackRate(_),h(_)},[]);return f?v.jsx("div",{}):v.jsxs("div",{className:`t-audio-player ${r}`,children:[v.jsx("button",{onClick:A,children:v.jsx(zo,{className:"t-play-pause-icon",type:a?"pause":"play","aria-label":a?E.ARIA_PAUSE_AUDIO:E.ARIA_PLAY_AUDIO})}),v.jsx("div",{className:"t-waveform",ref:i}),v.jsx("div",{className:"t-duration",children:pu(u)}),v.jsxs(rr,{type:"menu",popoverComponent:MD,popoverProps:{playbackSpeed:d,selectPlaybackSpeed:D},className:"t-playback-speed","aria-label":E.ARIA_SET_PLAYBACK_SPEED,children:[d,"x",v.jsx(zo,{type:"updown",className:"t-up-down-icon","aria-hidden":!0})]})]})}Ni.BasePlugin=class extends ji{constructor(n){super(),this.subscriptions=[],this.options=n}onInit(){}_init(n){this.wavesurfer=n,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(n=>n())}},Ni.dom=vD;const wD=[.25,.5,.75,1,1.25,1.5,2];function MD({playbackSpeed:n,selectPlaybackSpeed:e}){return v.jsxs("div",{className:"t-playback-speed-menu",children:[v.jsx("div",{className:"t-playback-heading",children:"Playback Speed"}),wD.map(t=>v.jsxs(en,{className:"t-menu-item",onSelect:()=>e(t),children:[v.jsx("span",{className:"t-playback-checkmark",children:n===t?"✓ ":""}),t,"x"]},t))]})}const FD=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,xD=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/;class vi{constructor(e,t,r,i){this.red=e,this.green=t,this.blue=r,this.alpha=i}static parse(e){var r;const t=(r=e.match(FD))!=null?r:e.match(xD);if(t){const[i,o,s,a,l="1"]=t;return new vi(Number(o),Number(s),Number(a),Number(l))}return null}withAlpha(e){return new vi(this.red,this.green,this.blue,e)}toRgbaString(){const{red:e,green:t,blue:r,alpha:i}=this;return i!==1?`rgba(${e}, ${t}, ${r}, ${i})`:`rgb(${e}, ${t}, ${r})`}}const rm=/^\/.*[^\\]\/[im]*$/;function zd(n){return rm.test(n)?!Yo(n).test(""):!1}function Yo(n){const e=n.match(/^\/(.*[^\\])\/(.*)$/);if(!e)throw new Error(`Expected ${n} to be a (non-empty) regex`);let t=e[2]||"";return t=t.replace(/[^im]/g,"")+"g",new RegExp(e[1],t)}function im(n){const e=n.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp("^"+e+"$","i")}function PD(n,e){const t=Ep(e),r=im(n);return t!==void 0&&r.test(t)}const BD=/^[]/g;function om(n){return n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function cl(n,e){!n()&&!e&&(e=n.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/,"`$1`")+" was not true")}(n=>{function e(r){}function t(r,i){(function(o,s){switch(s){case"undefined":return o===void 0;case String:return typeof o=="string"||o instanceof String;case Boolean:return typeof o=="boolean"||o instanceof Boolean;case Number:return typeof o=="number"||o instanceof Number;default:return o instanceof s}})(r,i)||(i.name,String(r))}n.defined=e,n.has=function(r,i){r[i]},n.is=t,n.equals=function(r,i){},n.oneOf=function(r,i){i.includes(r)||JSON.stringify(i)},n.isArray=function(r,i){t(r,Array),r&&r.length>0&&t(r[0],i)},n.optional=function(r,i){r!==void 0&&t(r,i)},n.falsy=function(r){},n.never=function(r){}})(cl||(cl={}));const lr=cl,HD=new RegExp(":arslan:|"+/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g.source,"g"),UD=/\uFE0F/g,jD="‍";function $D(n){if(n===":arslan:")return"https://cdn.talkjs.com/__assets/5461191341cea882b3f227c085d5772c.gif";const e=function(r){const i=[];let o=0,s=0,a=0;for(;a<r.length;)o=r.charCodeAt(a++),s?(i.push((65536+(s-55296<<10)+(o-56320)).toString(16)),s=0):55296<=o&&o<=56319?s=o:i.push(o.toString(16));return i.join("-")}((t=n).indexOf(jD)<0?t.replace(UD,""):t);var t;return`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/${e}.svg`}class sm{constructor({mode:e,allowedHostnames:t,allowedPhoneNrs:r,allowedMatches:i,forbiddenMatches:o,forbiddenWords:s,suppressLinks:a,suppressEmailAddresses:l,suppressPhoneNumbers:u,replacement:c}){if(lr.oneOf(e,["all","otherOnly","off"]),this.mode=e,this.suppressLinks=a!==!1,this.suppressEmailAddresses=l!==!1,this.suppressPhoneNumbers=u!==!1,this.allowedHostnames=t||[],this.allowedPhoneNrs=(r||[]).filter(d=>d).map(d=>d.replace(/[^0-9]/g,"")),this.allowedMatches=(i||[]).filter(zd).map(d=>Yo(d)),this.forbiddenMatches=(o||[]).filter(zd).map(d=>Yo(d)),s){const d=s.split(`
1272
+ `).map(h=>h.trim().toLowerCase()).filter(h=>h.length>0&&!h.startsWith("#")).map(h=>om(h));d.length&&this.forbiddenMatches.push(new RegExp(`\\b(${d.join("|")})\\b`,"gi"))}lr(()=>this.allowedMatches.every(d=>d.flags.includes("g")),"All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"),lr(()=>this.forbiddenMatches.every(d=>d.flags.includes("g")),"All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"),c=c==null?void 0:c.trim(),this.replacement=c&&c.length>0?c:void 0}shouldSuppress({isContentBySender:e}){return this.mode==="all"||this.mode==="otherOnly"&&!e}}function iu(n){var t,r,i,o,s,a,l,u,c,d,h,p,f;let e="";return n.t&&(e=`(${n.t("CONTACT_INFORMATION_HIDDEN")})`),{formattedLinks:(t=n.formattedLinks)!=null?t:"plaintext",markup:(r=n.markup)!=null?r:!1,useFallbackMentions:(i=n.useFallbackMentions)!=null?i:!1,sameTabLinkRules:(o=n.sameTabLinkRules)!=null?o:[],enableEmojiImageFallback:(s=n.enableEmojiImageFallback)!=null?s:!1,highlight:(a=n.highlight)!=null?a:[],contactInfo:(l=n.contactInfo)!=null?l:!1,suppression:(u=n.suppression)!=null?u:new sm({mode:"off"}),contactInfoHiddenText:(h=(d=n.contactInfoHiddenText)!=null?d:(c=n.suppression)==null?void 0:c.replacement)!=null?h:e,customEmojiUrls:(p=n.customEmojiUrls)!=null?p:{},enableActions:(f=n.enableActions)!=null?f:!0}}function zD({id:n,text:e}){var s;const t=ie(),r=Z(()=>{var u;if(t.type==="ConversationListStore")return;const a=t.state$.extCurrentConversationId.get(),l=a&&t.state$.participants.child(a).get();return(u=l==null?void 0:l.find(c=>c.user.id===n))==null?void 0:u.user}),i=Z(t.extUserId$)===n,o=`@${(s=r==null?void 0:r.name)!=null?s:e}`;return v.jsx("span",{className:"t-mention","t-is-current-user":i?"":void 0,children:o})}function VD({message:n,type:e,action:t,params:r,children:i}){const o=Bi(),s=R.useCallback(l=>{l.preventDefault(),o.triggerMessageAction(n,t,r)},[o,n,t,r]),a={"t-action":t,onClick:s};return e==="actionButton"?v.jsx("button",{...a,type:"button",children:i}):v.jsx("a",{...a,href:"#",children:i})}function Cr(n,e){const t=n.flatMap(r=>{if(typeof r=="string")return Aa(r,e.highlight);switch(r.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletpoint":case"bulletPoint":return YD(r,e);case"bulletlist":case"bulletList":return[R.createElement("ul",null,...Cr(r.children,e))];case"autolink":case"autoLink":case"link":return XD(r,e);case"codeblock":case"codeBlock":return[v.jsx("code",{"data-language":r.language,children:Aa(r.text,e.highlight)})];case"codespan":case"codeSpan":return v.jsx("code",{children:Aa((i=r.text,i.replace(/^\s*\n/m,"").replace(/\n\s*$/m,"")),e.highlight)});case"mention":return lr.falsy(e.useFallbackMentions),v.jsx(zD,{id:r.id,text:r.text},r.id);case"suppressed":return[v.jsx("i",{children:e.contactInfoHiddenText})];case"emoji":return e.enableEmojiImageFallback?[v.jsx(GD,{unicode:r.text})]:[r.text];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return KD(r,e);case"customemoji":case"customEmoji":return r.text;default:lr.never(r)}var i});return t.every(r=>typeof r=="string")?[t.join("")]:t}function Aa(n,e){if(e.length===0)return[n];const t=function(r){const i=r.map(s=>s.trim()).filter(s=>s);if(i.length===0)return BD;const o=i.map(om).join("|");return new RegExp(o,"gi")}(e);return Ma(n,cs(n,t).map(r=>({offset:r.index,matchedText:r[0]})),({matchedText:r})=>[v.jsx("span",{className:"highlighted-text",children:r})])}const YD=(n,e)=>{const t={bold:"strong",italic:"em",strikethrough:"del",blockquote:"blockquote",bulletpoint:"li",bulletPoint:"li"}[n.type];return[R.createElement(t,null,...Cr(n.children,e))]};function GD({unicode:n}){const[e,t]=R.useState(()=>n!==":arslan:");if(R.useEffect(()=>{e&&!hp(n)&&t(!1)},[]),e)return v.jsx("span",{className:"t-emoji",children:n});const r=$D(n);return v.jsx("img",{className:"t-emoji",src:r,alt:n})}const XD=(n,e)=>{const t="children"in n?n.children:[n.text];switch(e.formattedLinks){case"link":{const r=function(i,o){for(const s of i)if(rm.test(s)){if(Yo(s).test(o))return"_top"}else if(PD(s,o))return"_top";return"_blank"}(e.sameTabLinkRules,n.url);return[R.createElement("a",{target:r,href:n.url,rel:"noreferrer"},...Cr(t,e))]}case"plaintext":return"children"in n&&n.children.every(r=>typeof r=="string")?[n.children.join("")]:[R.createElement(R.Fragment,null,...Cr(t,e))];default:lr.never(e.formattedLinks)}},KD=(n,e)=>{if(!e.enableActions)return n.children;const t=n.type==="actionlink"?"actionLink":n.type==="actionbutton"?"actionButton":n.type;return[R.createElement(VD,{type:t,action:n.action,params:n.params,message:e.message},...Cr(n.children,e))]};function WD(n,e){return Oo(n,iu(e))}function Oo(n,e){return n.flatMap(t=>{if(typeof t=="string"){let r=[t];return r=ga(r,i=>function(o,s){const{suppression:{forbiddenMatches:a,allowedMatches:l}}=s,u=Zl(a,c=>cs(o,c)).filter(([c])=>!l.some(d=>c.match(d)!==null)).map(c=>({offset:c.index,matchedText:c[0]}));return Ma(o,u,()=>[{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"}])}(i,e)),r=ga(r,i=>function(o){return Ma(o,function(s){const a=[];let l;for(;l=HD.exec(s);){const u=l[0],c=l.index;a.push({offset:c,matchedText:u})}return a}(o),s=>[{type:"emoji",text:s.matchedText}])}(i)),r=ga(r,i=>function(o,s){if(s.contactInfo!=="suppress")return[o];const a=[];if((s.suppression.suppressEmailAddresses||s.suppression.suppressLinks)&&a.push(zf),s.suppression.suppressPhoneNumbers&&a.push($f),a.length===0)return[o];const l=Yf(o,{multilineSteps:[],singlelineSteps:a}),u=l.map(c=>typeof c=="string"?c:Vd(c.url,s.suppression)?c.text:{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"});return tu(u)}(i,e)),r}switch(t.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return{type:t.type,children:Oo(t.children,e)};case"codespan":case"codeSpan":case"codeblock":case"codeBlock":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return t;case"mention":return{type:"mention",id:t.id,text:t.text};case"autolink":case"autoLink":return function(r,i){return i.contactInfo==="link"?r:i.contactInfo==="suppress"?Vd(r.url,i.suppression)?r:{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"}:r.text}(t,e);case"link":return{type:"link",url:t.url,children:Oo(t.children,e)};case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return{type:t.type,action:t.action,params:t.params,children:Oo(t.children,e)}}})}function ga(n,e){return Zl(n,t=>typeof t=="string"?e(t):[t])}function Vd(n,e){if(e.allowedMatches.some(t=>n.match(t)!==null))return!0;if(e.forbiddenMatches.some(t=>n.match(t)!==null))return!1;if(n.startsWith("mailto:")){const t=n.substring(7).replace(/^.*@/,"");return!e.suppressEmailAddresses||Yd(e.allowedHostnames,t)}if(n.startsWith("tel:")){const t=n.substring(4).replace(/[^0-9]/g,"");return!e.suppressPhoneNumbers||e.allowedPhoneNrs.some(r=>t.endsWith(r))}{const t=Ep(n);return!e.suppressLinks||!t||Yd(e.allowedHostnames,t)}}function Yd(n,e){for(const t of n)if(im(t).test(e))return!0;return!1}function ou({block:n,nonInteractive:e,message:t,className:r=""}){const i=!e,{nodes:o,roleOptions:s}=function(l,u){var D;const c=ie(),d=Z(c.app$.role);le.defined(d);const h=u.type==="UserMessage",p=((D=u.sender)==null?void 0:D.id)===c.extUserId$.peek(),f=d.suppressContactInfo,m=h&&f.shouldSuppress({isContentBySender:p}),E=WD(l.children,{contactInfo:m?"suppress":"link",suppression:f}),A={sameTabLinkRules:d.sameTabLinkRules,contactInfoHiddenText:d.suppressContactInfo.replacement||`(${c.t$.peek().CONTACT_INFORMATION_HIDDEN})`};return{nodes:E,roleOptions:A}}(n,t),a=function(l,u={},c){return Cr(l,{...iu(u),message:c})}(o,{enableEmojiImageFallback:!0,formattedLinks:i?"link":"plaintext",enableActions:i,...s},t);return ae.createElement("span",{className:`t-text ${r}`},...a)}function am(n){const e=Dt(),t=ie(),{className:r="",...i}=n,o=Z(()=>t.state$.messages.child(t.state$.extCurrentConversationId.get()).lookup.child(n.message.id).content.child(0).url.get());return v.jsx("div",{className:`t-message-content ${r}`,children:n.message.content.map(s=>{var a;return v.jsx(JD,{block:s,theme:e,downloadUrl:o,...i},n.message.createdAt+((a=n.message.editedAt)!=null?a:0))})})}function JD({common:n,block:e,message:t,theme:r,downloadUrl:i}){const o=function(s,a){switch(a.type){case"text":return s.TextBlock;case"location":return s.LocationBlock;case"file":switch(a.subtype){case"image":return s.ImageBlock;case"video":return s.VideoBlock;case"voice":return s.VoiceBlock;case"audio":return s.AudioBlock;default:return s.FileBlock}default:le.never(a)}}(r,e);return v.jsx(o,{block:e,common:n,message:t,downloadUrl:i})}const qD=27;function $i(n,e,t=!0){const r=R.useCallback(o=>{o.keyCode===qD&&n()},[n]),i=R.useCallback(o=>{o.target.closest(e)===null&&n()},[e,n]);R.useEffect(()=>{if(t)return window.addEventListener("keydown",r,!0),document.addEventListener("mousedown",i,!0),()=>{window.removeEventListener("keydown",r,!0),document.removeEventListener("mousedown",i,!0)}},[r,i,t])}const ZD=".search-row{margin-right:var(--emoji-padding)}.emoji-menu{grid-template-columns:repeat(auto-fill,var(--total-emoji-size));padding:var(--emoji-padding)}.emoji,button.emoji{border-radius:8px}.favorites{border-top-width:1px}input.search:focus{border-color:var(--input-focused-border-color);outline:0}.picker{container-type:size}@container (height < 300px){.favorites{display:none}}#skintone-button{margin:0 -3px 0 4px}.custom-emoji{padding:0}#emo-🏻,#emo-🏼,#emo-🏽,#emo-🏾,#emo-🏿{display:none}[data-has-mouse] .emoji:hover{background-color:var(--button-hover-background)}";function lm(n){const[e,t]=R.useState();return R.useEffect(()=>{let r=!0;return n().then(i=>{r&&t({value:i})}),()=>{r=!1}},[n]),e}function su(n){const{onClose:e,onEmojiSelected:t}=qE(),r=R.useRef(null),i=lm(kl);return R.useEffect(()=>{if(!i)return;le.defined(r.current);const o=r.current,s=o.shadowRoot;(function(u,c){const d=document.createElement("style");d.textContent=c,u.appendChild(d)})(s,ZD);const a=u=>{var d;const c=(d=u.detail.unicode)!=null?d:u.detail.name;t(c)};function l(u){u.pointerType==="mouse"&&(s.querySelector("section").dataset.hasMouse="true")}return o.addEventListener("emoji-click",a),o.addEventListener("pointermove",l,{once:!0}),()=>{o.removeEventListener("emoji-click",a),o.removeEventListener("pointermove",l)}},[i,t]),R.useEffect(()=>{var o;i&&r.current&&((o=r.current.shadowRoot.getElementById("search"))==null||o.focus())},[i]),$i(()=>e(),".t-emoji-picker"),i?v.jsx("div",{className:"t-emoji-picker",children:v.jsx("emoji-picker",{ref:r,class:n.colorScheme})}):v.jsx("div",{className:"t-emoji-picker","t-loading":"",children:v.jsx(nu,{})})}function um({messageId:n,colorScheme:e}){const{closePopover:t}=Fl(),r=Bi();return v.jsx("div",{className:"t-reaction-picker",children:v.jsx(lp.Provider,{value:{onClose:t,onEmojiSelected:i=>{r.addReaction(n,i),t()}},children:v.jsx(su,{colorScheme:e})})})}function dl(){return dl=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},dl.apply(this,arguments)}function cm(n,e){if(n==null)return{};var t,r,i={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(i[t]=n[t]);return i}function hl(n,e){return hl=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},hl(n,e)}function dm(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,hl(n,e)}function hm(){}function pm(){}pm.resetWarningCache=hm;function Gd(n,e){return n.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}(function(){function n(r,i,o,s,a,l){if(l!=="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function e(){return n}n.isRequired=n;var t={array:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:pm,resetWarningCache:hm};t.PropTypes=t})();const Xd=!1,fm=R.createContext(null);var ni="unmounted",gn="exited",Dn="entering",qn="entered",pl="exiting",Bt=function(n){function e(r,i){var o;o=n.call(this,r,i)||this;var s,a=i&&!i.isMounting?r.enter:r.appear;return o.appearStatus=null,r.in?a?(s=gn,o.appearStatus=Dn):s=qn:s=r.unmountOnExit||r.mountOnEnter?ni:gn,o.state={status:s},o.nextCallback=null,o}dm(e,n),e.getDerivedStateFromProps=function(r,i){return r.in&&i.status===ni?{status:gn}:null};var t=e.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(r){var i=null;if(r!==this.props){var o=this.state.status;this.props.in?o!==Dn&&o!==qn&&(i=Dn):o!==Dn&&o!==qn||(i=pl)}this.updateStatus(!1,i)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var r,i,o,s=this.props.timeout;return r=i=o=s,s!=null&&typeof s!="number"&&(r=s.exit,i=s.enter,o=s.appear!==void 0?s.appear:i),{exit:r,enter:i,appear:o}},t.updateStatus=function(r,i){r===void 0&&(r=!1),i!==null?(this.cancelNextCallback(),i===Dn?this.performEnter(r):this.performExit()):this.props.unmountOnExit&&this.state.status===gn&&this.setState({status:ni})},t.performEnter=function(r){var i=this,o=this.props.enter,s=this.context?this.context.isMounting:r,a=this.props.nodeRef?[s]:[lo.findDOMNode(this),s],l=a[0],u=a[1],c=this.getTimeouts(),d=s?c.appear:c.enter;!r&&!o||Xd?this.safeSetState({status:qn},function(){i.props.onEntered(l)}):(this.props.onEnter(l,u),this.safeSetState({status:Dn},function(){i.props.onEntering(l,u),i.onTransitionEnd(d,function(){i.safeSetState({status:qn},function(){i.props.onEntered(l,u)})})}))},t.performExit=function(){var r=this,i=this.props.exit,o=this.getTimeouts(),s=this.props.nodeRef?void 0:lo.findDOMNode(this);i&&!Xd?(this.props.onExit(s),this.safeSetState({status:pl},function(){r.props.onExiting(s),r.onTransitionEnd(o.exit,function(){r.safeSetState({status:gn},function(){r.props.onExited(s)})})})):this.safeSetState({status:gn},function(){r.props.onExited(s)})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},t.setNextCallback=function(r){var i=this,o=!0;return this.nextCallback=function(s){o&&(o=!1,i.nextCallback=null,r(s))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(r,i){this.setNextCallback(i);var o=this.props.nodeRef?this.props.nodeRef.current:lo.findDOMNode(this),s=r==null&&!this.props.addEndListener;if(o&&!s){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],l=a[0],u=a[1];this.props.addEndListener(l,u)}r!=null&&setTimeout(this.nextCallback,r)}else setTimeout(this.nextCallback,0)},t.render=function(){var r=this.state.status;if(r===ni)return null;var i=this.props,o=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var s=cm(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return R.createElement(fm.Provider,{value:null},typeof o=="function"?o(r,s):R.cloneElement(R.Children.only(o),s))},e}(R.Component);function Gn(){}Bt.contextType=fm,Bt.propTypes={},Bt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Gn,onEntering:Gn,onEntered:Gn,onExit:Gn,onExiting:Gn,onExited:Gn},Bt.UNMOUNTED=ni,Bt.EXITED=gn,Bt.ENTERING=Dn,Bt.ENTERED=qn,Bt.EXITING=pl;var Da=function(n,e){return n&&e&&e.split(" ").forEach(function(t){return i=t,void((r=n).classList?r.classList.remove(i):typeof r.className=="string"?r.className=Gd(r.className,i):r.setAttribute("class",Gd(r.className&&r.className.baseVal||"",i)));var r,i})},fl=function(n){function e(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return(r=n.call.apply(n,[this].concat(o))||this).appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1];r.removeClasses(c,"exit"),r.addClass(c,d?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(a,l)},r.onEntering=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1]?"appear":"enter";r.addClass(c,d,"active"),r.props.onEntering&&r.props.onEntering(a,l)},r.onEntered=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1]?"appear":"enter";r.removeClasses(c,d),r.addClass(c,d,"done"),r.props.onEntered&&r.props.onEntered(a,l)},r.onExit=function(a){var l=r.resolveArguments(a)[0];r.removeClasses(l,"appear"),r.removeClasses(l,"enter"),r.addClass(l,"exit","base"),r.props.onExit&&r.props.onExit(a)},r.onExiting=function(a){var l=r.resolveArguments(a)[0];r.addClass(l,"exit","active"),r.props.onExiting&&r.props.onExiting(a)},r.onExited=function(a){var l=r.resolveArguments(a)[0];r.removeClasses(l,"exit"),r.addClass(l,"exit","done"),r.props.onExited&&r.props.onExited(a)},r.resolveArguments=function(a,l){return r.props.nodeRef?[r.props.nodeRef.current,a]:[a,l]},r.getClassNames=function(a){var l=r.props.classNames,u=typeof l=="string",c=u?(u&&l?l+"-":"")+a:l[a];return{baseClassName:c,activeClassName:u?c+"-active":l[a+"Active"],doneClassName:u?c+"-done":l[a+"Done"]}},r}dm(e,n);var t=e.prototype;return t.addClass=function(r,i,o){var s=this.getClassNames(i)[o+"ClassName"],a=this.getClassNames("enter").doneClassName;i==="appear"&&o==="done"&&a&&(s+=" "+a),o==="active"&&r&&r.scrollTop,s&&(this.appliedClasses[i][o]=s,function(l,u){l&&u&&u.split(" ").forEach(function(c){return h=c,void((d=l).classList?d.classList.add(h):function(p,f){return p.classList?!!f&&p.classList.contains(f):(" "+(p.className.baseVal||p.className)+" ").indexOf(" "+f+" ")!==-1}(d,h)||(typeof d.className=="string"?d.className=d.className+" "+h:d.setAttribute("class",(d.className&&d.className.baseVal||"")+" "+h)));var d,h})}(r,s))},t.removeClasses=function(r,i){var o=this.appliedClasses[i],s=o.base,a=o.active,l=o.done;this.appliedClasses[i]={},s&&Da(r,s),a&&Da(r,a),l&&Da(r,l)},t.render=function(){var r=this.props;r.classNames;var i=cm(r,["classNames"]);return R.createElement(Bt,dl({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(R.Component);fl.defaultProps={classNames:""},fl.propTypes={};const QD={ltr:["ArrowLeft","ArrowRight"],rtl:["ArrowRight","ArrowLeft"],ttb:["ArrowUp","ArrowDown"]};function mm(n,{focused:e,setFocused:t,itemCount:r,dir:i,onConfirm:o,onSpace:s}){if(r===0)return!1;const a=c=>{var d,h,p;d=0,h=c,p=r-1,c=Math.max(d,Math.min(h,p)),t(c)},[l,u]=QD[i];switch(n){case l:return a(e-1),!0;case u:return a(e+1),!0;case" ":return!!s&&s();case"Enter":case"Tab":return o(),!0}return!1}function Em({focused:n,setFocused:e,buttonId:t}){R.useLayoutEffect(()=>{var a;const s=t(n);s&&((a=document.getElementById(s))==null||a.scrollIntoView({block:"nearest"}))},[n,t]);const r=R.useCallback(s=>{const a=s.currentTarget.dataset.index;e(+a)},[e]),i=R.useMemo(()=>({role:"menu","aria-activedescendant":t(n)}),[n,t]),o=R.useCallback(s=>({onMouseMove:r,id:t(s),"data-index":s}),[r,t]);return{containerProps:i,itemProps:o}}function Am(n){const[e,t]=R.useState([]),[r,i]=R.useState([]),[o,s]=R.useState(0),[a,l]=R.useState(0),u=lm(kl),c=R.useMemo(()=>u&&new u.value.Database({}),[u]),d=xi(),h=Z(d.state$.suggestEmojiQuery);R.useEffect(()=>{c&&(h?async function(){const D=await c.getPreferredSkinTone();l(D);let _=await c.getEmojiBySearchQuery(h);if(_=_.filter(S=>S.url||function(T){return T.version<=pp&&!t0.includes(T.unicode)}(S)),function(S,T){T.sort((N,I)=>{var O,k;const L=(O=N.shortcodes)==null?void 0:O.find(w=>w.startsWith(S)),g=(k=I.shortcodes)==null?void 0:k.find(w=>w.startsWith(S));return L&&!g?-1:!L&&g?1:L&&g?L.length-g.length:0})}(h.substring(1),_),s(0),t(_),_.length>0&&i(_),h.endsWith(":")){const S=h.slice(1,-1),T=_.find(N=>{var I;return(I=N.shortcodes)==null?void 0:I.includes(S)});T&&d.selectEmoji(ri(T,D))}}():t([]))},[h,d,c]);const p=R.useCallback(D=>{const _=e[D];return _&&"emoji-button-"+ri(_,a)},[e,a]),{containerProps:f,itemProps:m}=Em({focused:o,setFocused:s,buttonId:p}),E=e.length>0;$i(()=>d.closeSuggester(),".t-emoji-suggest-bar",E),R.useEffect(()=>{if(E)return d.listenKeydown("emoji",D=>mm(D,{dir:"ltr",focused:o,setFocused:s,itemCount:e.length,onConfirm(){const _=e[o];le.defined(_),d.selectEmoji(ri(_,a))}})),()=>{d.listenKeydown("emoji",void 0)};d.listenKeydown("emoji",void 0)},[d,e,o,E,a]);const A=R.useRef(null);return v.jsx(fl,{in:E,timeout:100,classNames:"slide",mountOnEnter:!0,unmountOnExit:!0,nodeRef:A,children:v.jsx("div",{className:"t-emoji-suggest-bar",ref:A,...f,children:r.map((D,_)=>v.jsx(e0,{emoji:D,skinTone:a,focused:_===o,onSelect:S=>d.selectEmoji(S),...m(_)},ri(D,a)))})})}function ri(n,e){return ml(n)?gm(n,e):n.name}function ml(n){return!!n.unicode}function e0(n){var u;const{emoji:e,focused:t,skinTone:r,onSelect:i,...o}=n,s=((u=e.shortcodes)!=null?u:[]).join(", "),a=ml(e)?[e.unicode,s].join(", "):s,l=ml(e)?gm(e,r):null;return v.jsx("button",{"t-focused":t?"":void 0,title:s,"aria-label":a,onClick:()=>i(ri(e,r)),...o,children:l})}function gm(n,e){var r,i;const t=(r=n.skins)==null?void 0:r.find(o=>o.tone===e);return(i=t==null?void 0:t.unicode)!=null?i:n.unicode}const t0=["🏻","🏼","🏽","🏾","🏿"],n0=["top","right","bottom","left"],El=Math.min,ur=Math.max,Go=Math.round,oo=Math.floor,yt=n=>({x:n,y:n}),r0={left:"right",right:"left",bottom:"top",top:"bottom"},i0={start:"end",end:"start"};function au(n,e){return typeof n=="function"?n(e):n}function yi(n){return n.split("-")[0]}function lu(n){return n.split("-")[1]}function Dm(n){return n==="y"?"height":"width"}const o0=new Set(["top","bottom"]);function nr(n){return o0.has(yi(n))?"y":"x"}function Om(n){return nr(n)==="x"?"y":"x"}function Al(n){return n.replace(/start|end/g,e=>i0[e])}const Kd=["left","right"],Wd=["right","left"],s0=["top","bottom"],a0=["bottom","top"];function l0(n,e,t,r){const i=lu(n);let o=function(s,a,l){switch(s){case"top":case"bottom":return l?a?Wd:Kd:a?Kd:Wd;case"left":case"right":return a?s0:a0;default:return[]}}(yi(n),t==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Al)))),o}function so(n){return n.replace(/left|right|bottom|top/g,e=>r0[e])}function Xo(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function Jd(n,e,t){let{reference:r,floating:i}=n;const o=nr(e),s=Om(e),a=Dm(s),l=yi(e),u=o==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(lu(e)){case"start":p[s]-=h*(t&&u?-1:1);break;case"end":p[s]+=h*(t&&u?-1:1)}return p}async function gl(n,e){var t;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=au(e,n),f=function(T){return typeof T!="number"?function(N){return{top:0,right:0,bottom:0,left:0,...N}}(T):{top:T,right:T,bottom:T,left:T}}(p),m=a[h?d==="floating"?"reference":"floating":d],E=Xo(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(m)))==null||t?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),A=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,D=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),_=await(o.isElement==null?void 0:o.isElement(D))&&await(o.getScale==null?void 0:o.getScale(D))||{x:1,y:1},S=Xo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:D,strategy:l}):A);return{top:(E.top-S.top+f.top)/_.y,bottom:(S.bottom-E.bottom+f.bottom)/_.y,left:(E.left-S.left+f.left)/_.x,right:(S.right-E.right+f.right)/_.x}}function qd(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function Zd(n){return n0.some(e=>n[e]>=0)}function gs(){return typeof window!="undefined"}function Ir(n){return _m(n)?(n.nodeName||"").toLowerCase():"#document"}function ot(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function bt(n){var e;return(e=(_m(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function _m(n){return!!gs()&&(n instanceof Node||n instanceof ot(n).Node)}function mt(n){return!!gs()&&(n instanceof Element||n instanceof ot(n).Element)}function kt(n){return!!gs()&&(n instanceof HTMLElement||n instanceof ot(n).HTMLElement)}function Qd(n){return!(!gs()||typeof ShadowRoot=="undefined")&&(n instanceof ShadowRoot||n instanceof ot(n).ShadowRoot)}const u0=new Set(["inline","contents"]);function bi(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=Et(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!u0.has(i)}const c0=new Set(["table","td","th"]);function d0(n){return c0.has(Ir(n))}const h0=[":popover-open",":modal"];function Ko(n){return h0.some(e=>{try{return n.matches(e)}catch(t){return!1}})}const p0=["transform","translate","scale","rotate","perspective"],f0=["transform","translate","scale","rotate","perspective","filter"],m0=["paint","layout","strict","content"];function Dl(n){const e=uu(),t=mt(n)?Et(n):n;return p0.some(r=>!!t[r]&&t[r]!=="none")||!!t.containerType&&t.containerType!=="normal"||!e&&!!t.backdropFilter&&t.backdropFilter!=="none"||!e&&!!t.filter&&t.filter!=="none"||f0.some(r=>(t.willChange||"").includes(r))||m0.some(r=>(t.contain||"").includes(r))}function uu(){return!(typeof CSS=="undefined"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const E0=new Set(["html","body","#document"]);function cr(n){return E0.has(Ir(n))}function Et(n){return ot(n).getComputedStyle(n)}function Ds(n){return mt(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function on(n){if(Ir(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Qd(n)&&n.host||bt(n);return Qd(e)?e.host:e}function Sm(n){const e=on(n);return cr(e)?n.ownerDocument?n.ownerDocument.body:n.body:kt(e)&&bi(e)?e:Sm(e)}function Li(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=Sm(n),o=i===((r=n.ownerDocument)==null?void 0:r.body),s=ot(i);if(o){const a=Ol(s);return e.concat(s,s.visualViewport||[],bi(i)?i:[],a&&t?Li(a):[])}return e.concat(i,Li(i,[],t))}function Ol(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Tm(n){const e=Et(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=kt(n),o=i?n.offsetWidth:t,s=i?n.offsetHeight:r,a=Go(t)!==o||Go(r)!==s;return a&&(t=o,r=s),{width:t,height:r,$:a}}function cu(n){return mt(n)?n:n.contextElement}function dr(n){const e=cu(n);if(!kt(e))return yt(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:o}=Tm(e);let s=(o?Go(t.width):t.width)/r,a=(o?Go(t.height):t.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const A0=yt(0);function Rm(n){const e=ot(n);return uu()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:A0}function Un(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),o=cu(n);let s=yt(1);e&&(r?mt(r)&&(s=dr(r)):s=dr(n));const a=function(h,p,f){return p===void 0&&(p=!1),!(!f||p&&f!==ot(h))&&p}(o,t,r)?Rm(o):yt(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const h=ot(o),p=r&&mt(r)?ot(r):r;let f=h,m=Ol(f);for(;m&&r&&p!==f;){const E=dr(m),A=m.getBoundingClientRect(),D=Et(m),_=A.left+(m.clientLeft+parseFloat(D.paddingLeft))*E.x,S=A.top+(m.clientTop+parseFloat(D.paddingTop))*E.y;l*=E.x,u*=E.y,c*=E.x,d*=E.y,l+=_,u+=S,f=ot(m),m=Ol(f)}}return Xo({width:c,height:d,x:l,y:u})}function Wo(n,e){const t=Ds(n).scrollLeft;return e?e.left+t:Un(bt(n)).left+t}function Cm(n,e){const t=n.getBoundingClientRect();return{x:t.left+e.scrollLeft-Wo(n,t),y:t.top+e.scrollTop}}const g0=new Set(["absolute","fixed"]);function eh(n,e,t){let r;if(e==="viewport")r=function(i,o){const s=ot(i),a=bt(i),l=s.visualViewport;let u=a.clientWidth,c=a.clientHeight,d=0,h=0;if(l){u=l.width,c=l.height;const f=uu();(!f||f&&o==="fixed")&&(d=l.offsetLeft,h=l.offsetTop)}const p=Wo(a);if(p<=0){const f=a.ownerDocument,m=f.body,E=getComputedStyle(m),A=f.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,D=Math.abs(a.clientWidth-m.clientWidth-A);D<=25&&(u-=D)}else p<=25&&(u+=p);return{width:u,height:c,x:d,y:h}}(n,t);else if(e==="document")r=function(i){const o=bt(i),s=Ds(i),a=i.ownerDocument.body,l=ur(o.scrollWidth,o.clientWidth,a.scrollWidth,a.clientWidth),u=ur(o.scrollHeight,o.clientHeight,a.scrollHeight,a.clientHeight);let c=-s.scrollLeft+Wo(i);const d=-s.scrollTop;return Et(a).direction==="rtl"&&(c+=ur(o.clientWidth,a.clientWidth)-l),{width:l,height:u,x:c,y:d}}(bt(n));else if(mt(e))r=function(i,o){const s=Un(i,!0,o==="fixed"),a=s.top+i.clientTop,l=s.left+i.clientLeft,u=kt(i)?dr(i):yt(1);return{width:i.clientWidth*u.x,height:i.clientHeight*u.y,x:l*u.x,y:a*u.y}}(e,t);else{const i=Rm(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Xo(r)}function Im(n,e){const t=on(n);return!(t===e||!mt(t)||cr(t))&&(Et(t).position==="fixed"||Im(t,e))}function D0(n,e,t){const r=kt(e),i=bt(e),o=t==="fixed",s=Un(n,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=yt(0);function u(){l.x=Wo(i)}if(r||!r&&!o)if((Ir(e)!=="body"||bi(i))&&(a=Ds(e)),r){const d=Un(e,!0,o,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else i&&u();o&&!r&&i&&u();const c=!i||r||o?yt(0):Cm(i,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function Oa(n){return Et(n).position==="static"}function th(n,e){if(!kt(n)||Et(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return bt(n)===t&&(t=t.ownerDocument.body),t}function nh(n,e){const t=ot(n);if(Ko(n))return t;if(!kt(n)){let i=on(n);for(;i&&!cr(i);){if(mt(i)&&!Oa(i))return i;i=on(i)}return t}let r=th(n,e);for(;r&&d0(r)&&Oa(r);)r=th(r,e);return r&&cr(r)&&Oa(r)&&!Dl(r)?t:r||function(i){let o=on(i);for(;kt(o)&&!cr(o);){if(Dl(o))return o;if(Ko(o))return null;o=on(o)}return null}(n)||t}const O0={convertOffsetParentRelativeRectToViewportRelativeRect:function(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const o=i==="fixed",s=bt(r),a=!!e&&Ko(e.floating);if(r===s||a&&o)return t;let l={scrollLeft:0,scrollTop:0},u=yt(1);const c=yt(0),d=kt(r);if((d||!d&&!o)&&((Ir(r)!=="body"||bi(s))&&(l=Ds(r)),kt(r))){const p=Un(r);u=dr(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const h=!s||d||o?yt(0):Cm(s,l);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:t.y*u.y-l.scrollTop*u.y+c.y+h.y}},getDocumentElement:bt,getClippingRect:function(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const o=t==="clippingAncestors"?Ko(e)?[]:function(u,c){const d=c.get(u);if(d)return d;let h=Li(u,[],!1).filter(E=>mt(E)&&Ir(E)!=="body"),p=null;const f=Et(u).position==="fixed";let m=f?on(u):u;for(;mt(m)&&!cr(m);){const E=Et(m),A=Dl(m);A||E.position!=="fixed"||(p=null),(f?!A&&!p:!A&&E.position==="static"&&p&&g0.has(p.position)||bi(m)&&!A&&Im(u,m))?h=h.filter(D=>D!==m):p=E,m=on(m)}return c.set(u,h),h}(e,this._c):[].concat(t),s=[...o,r],a=s[0],l=s.reduce((u,c)=>{const d=eh(e,c,i);return u.top=ur(d.top,u.top),u.right=El(d.right,u.right),u.bottom=El(d.bottom,u.bottom),u.left=ur(d.left,u.left),u},eh(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:nh,getElementRects:async function(n){const e=this.getOffsetParent||nh,t=this.getDimensions,r=await t(n.floating);return{reference:D0(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(n){return Array.from(n.getClientRects())},getDimensions:function(n){const{width:e,height:t}=Tm(n);return{width:e,height:t}},getScale:dr,isElement:mt,isRTL:function(n){return Et(n).direction==="rtl"}};function rh(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function _0(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=cu(n),c=i||o?[...u?Li(u):[],...Li(e)]:[];c.forEach(E=>{i&&E.addEventListener("scroll",t,{passive:!0}),o&&E.addEventListener("resize",t)});const d=u&&a?function(E,A){let D,_=null;const S=bt(E);function T(){var N;clearTimeout(D),(N=_)==null||N.disconnect(),_=null}return function N(I,L){I===void 0&&(I=!1),L===void 0&&(L=1),T();const g=E.getBoundingClientRect(),{left:O,top:k,width:w,height:U}=g;if(I||A(),!w||!U)return;const y={rootMargin:-oo(k)+"px "+-oo(S.clientWidth-(O+w))+"px "+-oo(S.clientHeight-(k+U))+"px "+-oo(O)+"px",threshold:ur(0,El(1,L))||1};let M=!0;function $(j){const G=j[0].intersectionRatio;if(G!==L){if(!M)return N();G?N(!1,G):D=setTimeout(()=>{N(!1,1e-7)},1e3)}G!==1||rh(g,E.getBoundingClientRect())||N(),M=!1}try{_=new IntersectionObserver($,{...y,root:S.ownerDocument})}catch(j){_=new IntersectionObserver($,y)}_.observe(E)}(!0),T}(u,t):null;let h,p=-1,f=null;s&&(f=new ResizeObserver(E=>{let[A]=E;A&&A.target===u&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var D;(D=f)==null||D.observe(e)})),t()}),u&&!l&&f.observe(u),f.observe(e));let m=l?Un(n):null;return l&&function E(){const A=Un(n);m&&!rh(m,A)&&t(),m=A,h=requestAnimationFrame(E)}(),t(),()=>{var E;c.forEach(A=>{i&&A.removeEventListener("scroll",t),o&&A.removeEventListener("resize",t)}),d==null||d(),(E=f)==null||E.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const S0=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...E}=au(n,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const A=yi(i),D=nr(a),_=yi(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),T=h||(_||!m?[so(a)]:function(y){const M=so(y);return[Al(y),M,Al(M)]}(a)),N=f!=="none";!h&&N&&T.push(...l0(a,m,f,S));const I=[a,...T],L=await gl(e,E),g=[];let O=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&g.push(L[A]),d){const y=function(M,$,j){j===void 0&&(j=!1);const G=lu(M),V=Om(M),Y=Dm(V);let K=V==="x"?G===(j?"end":"start")?"right":"left":G==="start"?"bottom":"top";return $.reference[Y]>$.floating[Y]&&(K=so(K)),[K,so(K)]}(i,s,S);g.push(L[y[0]],L[y[1]])}if(O=[...O,{placement:i,overflows:g}],!g.every(y=>y<=0)){var k,w;const y=(((k=o.flip)==null?void 0:k.index)||0)+1,M=I[y];if(M&&(!(d==="alignment"&&D!==nr(M))||O.every(j=>nr(j.placement)!==D||j.overflows[0]>0)))return{data:{index:y,overflows:O},reset:{placement:M}};let $=(w=O.filter(j=>j.overflows[0]<=0).sort((j,G)=>j.overflows[1]-G.overflows[1])[0])==null?void 0:w.placement;if(!$)switch(p){case"bestFit":{var U;const j=(U=O.filter(G=>{if(N){const V=nr(G.placement);return V===D||V==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(V=>V>0).reduce((V,Y)=>V+Y,0)]).sort((G,V)=>G[1]-V[1])[0])==null?void 0:U[0];j&&($=j);break}case"initialPlacement":$=a}if(i!==$)return{reset:{placement:$}}}return{}}}},T0=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:r="referenceHidden",...i}=au(n,e);switch(r){case"referenceHidden":{const o=qd(await gl(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Zd(o)}}}case"escaped":{const o=qd(await gl(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:o,escaped:Zd(o)}}}default:return{}}}}},R0=(n,e,t)=>{const r=new Map,i={platform:O0,...t},o={...i.platform,_c:r};return(async(s,a,l)=>{const{placement:u="bottom",strategy:c="absolute",middleware:d=[],platform:h}=l,p=d.filter(Boolean),f=await(h.isRTL==null?void 0:h.isRTL(a));let m=await h.getElementRects({reference:s,floating:a,strategy:c}),{x:E,y:A}=Jd(m,u,f),D=u,_={},S=0;for(let T=0;T<p.length;T++){const{name:N,fn:I}=p[T],{x:L,y:g,data:O,reset:k}=await I({x:E,y:A,initialPlacement:u,placement:D,strategy:c,middlewareData:_,rects:m,platform:h,elements:{reference:s,floating:a}});E=L!=null?L:E,A=g!=null?g:A,_={..._,[N]:{..._[N],...O}},k&&S<=50&&(S++,typeof k=="object"&&(k.placement&&(D=k.placement),k.rects&&(m=k.rects===!0?await h.getElementRects({reference:s,floating:a,strategy:c}):k.rects),{x:E,y:A}=Jd(m,D,f)),T=-1)}return{x:E,y:A,placement:D,strategy:c,middlewareData:_}})(n,e,{...i,platform:o})};var _o=typeof document!="undefined"?R.useLayoutEffect:function(){};function Jo(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,i;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!=0;)if(!Jo(n[r],e[r]))return!1;return!0}if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!=0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=t;r--!=0;){const o=i[r];if((o!=="_owner"||!n.$$typeof)&&!Jo(n[o],e[o]))return!1}return!0}return n!=n&&e!=e}function Nm(n){return typeof window=="undefined"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function ih(n,e){const t=Nm(n);return Math.round(e*t)/t}function _a(n){const e=ae.useRef(n);return _o(()=>{e.current=n}),e}const C0=(n,e)=>({...S0(n),options:[n,e]}),I0=(n,e)=>({...T0(n),options:[n,e]});var vm={exports:{}},ym=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],qo=ym.join(","),bm=typeof Element=="undefined",jn=bm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,So=!bm&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n==null?void 0:n.ownerDocument},ki=function(n,e){var t;e===void 0&&(e=!0);var r=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"inert");return r===""||r==="true"||e&&n&&ki(n.parentNode)},Lm=function(n,e,t){if(ki(n))return[];var r=Array.prototype.slice.apply(n.querySelectorAll(qo));return e&&jn.call(n,qo)&&r.unshift(n),r=r.filter(t)},Zo=function(n,e,t){for(var r=[],i=Array.from(n);i.length;){var o=i.shift();if(!ki(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),a=s.length?s:o.children,l=Zo(a,!0,t);t.flatten?r.push.apply(r,l):r.push({scopeParent:o,candidates:l})}else{jn.call(o,qo)&&t.filter(o)&&(e||!n.includes(o))&&r.push(o);var u=o.shadowRoot||typeof t.getShadowRoot=="function"&&t.getShadowRoot(o),c=!ki(u,!1)&&(!t.shadowRootFilter||t.shadowRootFilter(o));if(u&&c){var d=Zo(u===!0?o.children:u.children,!0,t);t.flatten?r.push.apply(r,d):r.push({scopeParent:o,candidates:d})}else i.unshift.apply(i,o.children)}}return r},km=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},nn=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"}(n))&&!km(n)?0:n.tabIndex},N0=function(n,e){return n.tabIndex===e.tabIndex?n.documentOrder-e.documentOrder:n.tabIndex-e.tabIndex},wm=function(n){return n.tagName==="INPUT"},v0=function(n){return function(e){return wm(e)&&e.type==="radio"}(n)&&!function(e){if(!e.name)return!0;var t,r=e.form||So(e),i=function(s){return r.querySelectorAll('input[type="radio"][name="'+s+'"]')};if(typeof window!="undefined"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")t=i(window.CSS.escape(e.name));else try{t=i(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=function(s,a){for(var l=0;l<s.length;l++)if(s[l].checked&&s[l].form===a)return s[l]}(t,e.form);return!o||o===e}(n)},oh=function(n){var e=n.getBoundingClientRect(),t=e.width,r=e.height;return t===0&&r===0},y0=function(n,e){var t=e.displayCheck,r=e.getShadowRoot;if(t==="full-native"&&"checkVisibility"in n)return!n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(n).visibility==="hidden")return!0;var i=jn.call(n,"details>summary:first-of-type")?n.parentElement:n;if(jn.call(i,"details:not([open]) *"))return!0;if(t&&t!=="full"&&t!=="full-native"&&t!=="legacy-full"){if(t==="non-zero-area")return oh(n)}else{if(typeof r=="function"){for(var o=n;n;){var s=n.parentElement,a=So(n);if(s&&!s.shadowRoot&&r(s)===!0)return oh(n);n=n.assignedSlot?n.assignedSlot:s||a===n.ownerDocument?s:a.host}n=o}if(function(l){var u,c,d,h,p=l&&So(l),f=(u=p)===null||u===void 0?void 0:u.host,m=!1;if(p&&p!==l)for(m=!!((c=f)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(f)||l!=null&&(h=l.ownerDocument)!==null&&h!==void 0&&h.contains(l));!m&&f;){var E,A,D;m=!((A=f=(E=p=So(f))===null||E===void 0?void 0:E.host)===null||A===void 0||(D=A.ownerDocument)===null||D===void 0||!D.contains(f))}return m}(n))return!n.getClientRects().length;if(t!=="legacy-full")return!0}return!1},Qo=function(n,e){return!(e.disabled||ki(e)||function(t){return wm(t)&&t.type==="hidden"}(e)||y0(e,n)||function(t){return t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"})}(e)||function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var i=0;i<r.children.length;i++){var o=r.children.item(i);if(o.tagName==="LEGEND")return!!jn.call(r,"fieldset[disabled] *")||!o.contains(t)}return!0}r=r.parentElement}return!1}(e))},_l=function(n,e){return!(v0(e)||nn(e)<0||!Qo(n,e))},b0=function(n){var e=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},Mm=function(n){var e=[],t=[];return n.forEach(function(r,i){var o=!!r.scopeParent,s=o?r.scopeParent:r,a=function(u,c){var d=nn(u);return d<0&&c&&!km(u)?0:d}(s,o),l=o?Mm(r.candidates):s;a===0?o?e.push.apply(e,l):e.push(s):t.push({documentOrder:i,tabIndex:a,item:r,isScope:o,content:l})}),t.sort(N0).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(e)},Fm=function(n,e){var t;return t=(e=e||{}).getShadowRoot?Zo([n],e.includeContainer,{filter:_l.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:b0}):Lm(n,e.includeContainer,_l.bind(null,e)),Mm(t)},du=function(n,e){return(e=e||{}).getShadowRoot?Zo([n],e.includeContainer,{filter:Qo.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):Lm(n,e.includeContainer,Qo.bind(null,e))},On=function(n,e){if(e=e||{},!n)throw new Error("No node provided");return jn.call(n,qo)!==!1&&_l(e,n)},L0=ym.concat("iframe").join(","),To=function(n,e){if(e=e||{},!n)throw new Error("No node provided");return jn.call(n,L0)!==!1&&Qo(e,n)};const k0=Object.freeze(Object.defineProperty({__proto__:null,focusable:du,getTabIndex:nn,isFocusable:To,isTabbable:On,tabbable:Fm},Symbol.toStringTag,{value:"Module"}));function Sa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function w0(n,e,t){return(e=function(r){var i=function(o,s){if(typeof o!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var l=a.call(o,s);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(o)}(r,"string");return typeof i=="symbol"?i:i+""}(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sh(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ah(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sh(Object(t),!0).forEach(function(r){w0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):sh(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function M0(n){return function(e){if(Array.isArray(e))return Sa(e)}(n)||function(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||function(e,t){if(e){if(typeof e=="string")return Sa(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sa(e,t):void 0}}(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1273
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var F0=function(n,e){if(n.length>0){var t=n[n.length-1];t!==e&&t._setPausedState(!0)}var r=n.indexOf(e);r===-1||n.splice(r,1),n.push(e)},x0=function(n,e){var t=n.indexOf(e);t!==-1&&n.splice(t,1),n.length>0&&!n[n.length-1]._isManuallyPaused()&&n[n.length-1]._setPausedState(!1)},Ei=function(n){return(n==null?void 0:n.key)==="Tab"||(n==null?void 0:n.keyCode)===9},P0=function(n){return Ei(n)&&!n.shiftKey},B0=function(n){return Ei(n)&&n.shiftKey},lh=function(n){return setTimeout(n,0)},Ur=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return typeof n=="function"?n.apply(void 0,t):n},ao=function(n){return n.target.shadowRoot&&typeof n.composedPath=="function"?n.composedPath()[0]:n.target},H0=[];const U0=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:function(n,e){var t,r=(e==null?void 0:e.document)||document,i=(e==null?void 0:e.trapStack)||H0,o=ah({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:P0,isKeyBackward:B0},e),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a=function(g,O,k){return g&&g[O]!==void 0?g[O]:o[k||O]},l=function(g,O){var k=typeof(O==null?void 0:O.composedPath)=="function"?O.composedPath():void 0;return s.containerGroups.findIndex(function(w){var U=w.container,y=w.tabbableNodes;return U.contains(g)||(k==null?void 0:k.includes(U))||y.find(function(M){return M===g})})},u=function(g){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=O.hasFallback,w=k!==void 0&&k,U=O.params,y=U===void 0?[]:U,M=o[g];if(typeof M=="function"&&(M=M.apply(void 0,M0(y))),M===!0&&(M=void 0),!M){if(M===void 0||M===!1)return M;throw new Error("`".concat(g,"` was specified but was not a node, or did not return a node"))}var $=M;if(typeof M=="string"){try{$=r.querySelector(M)}catch(j){throw new Error("`".concat(g,'` appears to be an invalid selector; error="').concat(j.message,'"'))}if(!$&&!w)throw new Error("`".concat(g,"` as selector refers to no known node"))}return $},c=function(){var g=u("initialFocus",{hasFallback:!0});if(g===!1)return!1;if(g===void 0||g&&!To(g,o.tabbableOptions))if(l(r.activeElement)>=0)g=r.activeElement;else{var O=s.tabbableGroups[0];g=O&&O.firstTabbableNode||u("fallbackFocus")}else g===null&&(g=u("fallbackFocus"));if(!g)throw new Error("Your focus-trap needs to have at least one focusable element");return g},d=function(){if(s.containerGroups=s.containers.map(function(g){var O=Fm(g,o.tabbableOptions),k=du(g,o.tabbableOptions),w=O.length>0?O[0]:void 0,U=O.length>0?O[O.length-1]:void 0,y=k.find(function(j){return On(j)}),M=k.slice().reverse().find(function(j){return On(j)}),$=!!O.find(function(j){return nn(j)>0});return{container:g,tabbableNodes:O,focusableNodes:k,posTabIndexesFound:$,firstTabbableNode:w,lastTabbableNode:U,firstDomTabbableNode:y,lastDomTabbableNode:M,nextTabbableNode:function(j){var G=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],V=O.indexOf(j);return V<0?G?k.slice(k.indexOf(j)+1).find(function(Y){return On(Y)}):k.slice(0,k.indexOf(j)).reverse().find(function(Y){return On(Y)}):O[V+(G?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(g){return g.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(g){return g.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(g){var O=g.activeElement;if(O)return O.shadowRoot&&O.shadowRoot.activeElement!==null?h(O.shadowRoot):O},p=function(g){g!==!1&&g!==h(document)&&(g&&g.focus?(g.focus({preventScroll:!!o.preventScroll}),s.mostRecentlyFocusedNode=g,function(O){return O.tagName&&O.tagName.toLowerCase()==="input"&&typeof O.select=="function"}(g)&&g.select()):p(c()))},f=function(g){var O=u("setReturnFocus",{params:[g]});return O||O!==!1&&g},m=function(g){var O=g.target,k=g.event,w=g.isBackward,U=w!==void 0&&w;O=O||ao(k),d();var y=null;if(s.tabbableGroups.length>0){var M=l(O,k),$=M>=0?s.containerGroups[M]:void 0;if(M<0)y=U?s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:s.tabbableGroups[0].firstTabbableNode;else if(U){var j=s.tabbableGroups.findIndex(function(ee){var F=ee.firstTabbableNode;return O===F});if(j<0&&($.container===O||To(O,o.tabbableOptions)&&!On(O,o.tabbableOptions)&&!$.nextTabbableNode(O,!1))&&(j=M),j>=0){var G=j===0?s.tabbableGroups.length-1:j-1,V=s.tabbableGroups[G];y=nn(O)>=0?V.lastTabbableNode:V.lastDomTabbableNode}else Ei(k)||(y=$.nextTabbableNode(O,!1))}else{var Y=s.tabbableGroups.findIndex(function(ee){var F=ee.lastTabbableNode;return O===F});if(Y<0&&($.container===O||To(O,o.tabbableOptions)&&!On(O,o.tabbableOptions)&&!$.nextTabbableNode(O))&&(Y=M),Y>=0){var K=Y===s.tabbableGroups.length-1?0:Y+1,W=s.tabbableGroups[K];y=nn(O)>=0?W.firstTabbableNode:W.firstDomTabbableNode}else Ei(k)||(y=$.nextTabbableNode(O))}}else y=u("fallbackFocus");return y},E=function(g){var O=ao(g);l(O,g)>=0||(Ur(o.clickOutsideDeactivates,g)?t.deactivate({returnFocus:o.returnFocusOnDeactivate}):Ur(o.allowOutsideClick,g)||g.preventDefault())},A=function(g){var O=ao(g),k=l(O,g)>=0;if(k||O instanceof Document)k&&(s.mostRecentlyFocusedNode=O);else{var w;g.stopImmediatePropagation();var U=!0;if(s.mostRecentlyFocusedNode)if(nn(s.mostRecentlyFocusedNode)>0){var y=l(s.mostRecentlyFocusedNode),M=s.containerGroups[y].tabbableNodes;if(M.length>0){var $=M.findIndex(function(j){return j===s.mostRecentlyFocusedNode});$>=0&&(o.isKeyForward(s.recentNavEvent)?$+1<M.length&&(w=M[$+1],U=!1):$-1>=0&&(w=M[$-1],U=!1))}}else s.containerGroups.some(function(j){return j.tabbableNodes.some(function(G){return nn(G)>0})})||(U=!1);else U=!1;U&&(w=m({target:s.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(s.recentNavEvent)})),p(w||s.mostRecentlyFocusedNode||c())}s.recentNavEvent=void 0},D=function(g){(o.isKeyForward(g)||o.isKeyBackward(g))&&function(O){var k=arguments.length>1&&arguments[1]!==void 0&&arguments[1];s.recentNavEvent=O;var w=m({event:O,isBackward:k});w&&(Ei(O)&&O.preventDefault(),p(w))}(g,o.isKeyBackward(g))},_=function(g){(function(O){return(O==null?void 0:O.key)==="Escape"||(O==null?void 0:O.key)==="Esc"||(O==null?void 0:O.keyCode)===27})(g)&&Ur(o.escapeDeactivates,g)!==!1&&(g.preventDefault(),t.deactivate())},S=function(g){var O=ao(g);l(O,g)>=0||Ur(o.clickOutsideDeactivates,g)||Ur(o.allowOutsideClick,g)||(g.preventDefault(),g.stopImmediatePropagation())},T=function(){if(s.active)return F0(i,t),s.delayInitialFocusTimer=o.delayInitialFocus?lh(function(){p(c())}):p(c()),r.addEventListener("focusin",A,!0),r.addEventListener("mousedown",E,{capture:!0,passive:!1}),r.addEventListener("touchstart",E,{capture:!0,passive:!1}),r.addEventListener("click",S,{capture:!0,passive:!1}),r.addEventListener("keydown",D,{capture:!0,passive:!1}),r.addEventListener("keydown",_),t},N=function(){if(s.active)return r.removeEventListener("focusin",A,!0),r.removeEventListener("mousedown",E,!0),r.removeEventListener("touchstart",E,!0),r.removeEventListener("click",S,!0),r.removeEventListener("keydown",D,!0),r.removeEventListener("keydown",_),t},I=typeof window!="undefined"&&"MutationObserver"in window?new MutationObserver(function(g){g.some(function(O){return Array.from(O.removedNodes).some(function(k){return k===s.mostRecentlyFocusedNode})})&&p(c())}):void 0,L=function(){I&&(I.disconnect(),s.active&&!s.paused&&s.containers.map(function(g){I.observe(g,{subtree:!0,childList:!0})}))};return t={get active(){return s.active},get paused(){return s.paused},activate:function(g){if(s.active)return this;var O=a(g,"onActivate"),k=a(g,"onPostActivate"),w=a(g,"checkCanFocusTrap");w||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=h(r),O==null||O();var U=function(){w&&d(),T(),L(),k==null||k()};return w?(w(s.containers.concat()).then(U,U),this):(U(),this)},deactivate:function(g){if(!s.active)return this;var O=ah({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},g);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,N(),s.active=!1,s.paused=!1,L(),x0(i,t);var k=a(O,"onDeactivate"),w=a(O,"onPostDeactivate"),U=a(O,"checkCanReturnFocus"),y=a(O,"returnFocus","returnFocusOnDeactivate");k==null||k();var M=function(){lh(function(){y&&p(f(s.nodeFocusedBeforeActivation)),w==null||w()})};return y&&U?(U(f(s.nodeFocusedBeforeActivation)).then(M,M),this):(M(),this)},pause:function(g){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,g)):this},unpause:function(g){return s.active?(s.manuallyPaused=!1,i[i.length-1]!==this?this:this._setPausedState(!1,g)):this},updateContainerElements:function(g){var O=[].concat(g).filter(Boolean);return s.containers=O.map(function(k){return typeof k=="string"?r.querySelector(k):k}),s.active&&d(),L(),this}},Object.defineProperties(t,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(g,O){if(s.paused===g)return this;if(s.paused=g,g){var k=a(O,"onPause"),w=a(O,"onPostPause");k==null||k(),N(),L(),w==null||w()}else{var U=a(O,"onUnpause"),y=a(O,"onPostUnpause");U==null||U(),d(),T(),L(),y==null||y()}return this}}}),t.updateContainerElements(n),t}},Symbol.toStringTag,{value:"Module"})),j0=qh(U0),$0=qh(k0);function hr(n){return hr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hr(n)}var Ta,Ra;function z0(n,e,t){return e&&function(r,i){for(var o=0;o<i.length;o++){var s=i[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,Pm(s.key),s)}}(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function V0(n,e,t){return e=es(e),function(r,i){if(i&&(hr(i)=="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(r)}(n,xm()?Reflect.construct(e,t||[],es(n).constructor):e.apply(n,t))}function xm(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(xm=function(){return!!n})()}function es(n){return es=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},es(n)}function Sl(n,e){return Sl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},Sl(n,e)}function Pm(n){var e=function(t,r){if(hr(t)!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var o=i.call(t,r);if(hr(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n,"string");return hr(e)=="symbol"?e:e+""}var ii=R,Y0=j0.createFocusTrap,G0=$0.isFocusable,X0=parseInt((Ta=(Ra=/^(\d+)\./.exec(ii.version))===null||Ra===void 0?void 0:Ra[1])!==null&&Ta!==void 0?Ta:0,10),Tl=function(){function n(e){var t;(function(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")})(this,n),function(o,s,a){(s=Pm(s))in o?Object.defineProperty(o,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[s]=a}(t=V0(this,n,[e]),"getNodeForOption",function(o){var s,a=(s=this.internalOptions[o])!==null&&s!==void 0?s:this.originalOptions[o];if(typeof a=="function"){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];a=a.apply(void 0,u)}if(a===!0&&(a=void 0),!a){if(a===void 0||a===!1)return a;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var d,h=a;if(typeof a=="string"&&!(h=(d=this.getDocument())===null||d===void 0?void 0:d.querySelector(a)))throw new Error("`".concat(o,"` as selector refers to no known node"));return h}),t.handleDeactivate=t.handleDeactivate.bind(t),t.handlePostDeactivate=t.handlePostDeactivate.bind(t),t.handleClickOutsideDeactivates=t.handleClickOutsideDeactivates.bind(t),t.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:t.handleDeactivate,onPostDeactivate:t.handlePostDeactivate,clickOutsideDeactivates:t.handleClickOutsideDeactivates},t.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var r=e.focusTrapOptions;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i!=="returnFocusOnDeactivate"&&i!=="onDeactivate"&&i!=="onPostDeactivate"&&i!=="checkCanReturnFocus"&&i!=="clickOutsideDeactivates"?t.internalOptions[i]=r[i]:t.originalOptions[i]=r[i]);return t.outsideClick=null,t.focusTrapElements=e.containerElements||[],t.updatePreviousElement(),t}return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sl(e,t)}(n,ii.Component),z0(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document!="undefined"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var e=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return e||e!==!1&&this.previouslyFocusedElement}},{key:"updatePreviousElement",value:function(){var e=this.getDocument();e&&(this.previouslyFocusedElement=e.activeElement)}},{key:"deactivateTrap",value:function(){this.focusTrap&&this.focusTrap.active&&this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(e){var t=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,e):this.originalOptions.clickOutsideDeactivates;return t&&(this.outsideClick={target:e.target,allowDeactivation:t}),t}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var e=this,t=function(){var r=e.getReturnFocusNode(),i=!(!e.originalOptions.returnFocusOnDeactivate||r==null||!r.focus||e.outsideClick&&(!e.outsideClick.allowDeactivation||G0(e.outsideClick.target,e.internalOptions.tabbableOptions))),o=e.internalOptions.preventScroll,s=o!==void 0&&o;i&&r.focus({preventScroll:s}),e.originalOptions.onPostDeactivate&&e.originalOptions.onPostDeactivate.call(null),e.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(t,t):t()}},{key:"setupFocusTrap",value:function(){this.focusTrap?this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()):this.focusTrapElements.some(Boolean)&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(e){if(this.focusTrap){e.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var t=!e.active&&this.props.active,r=e.active&&!this.props.active,i=!e.paused&&this.props.paused,o=e.paused&&!this.props.paused;if(t&&(this.updatePreviousElement(),this.focusTrap.activate()),r)return void this.deactivateTrap();i&&this.focusTrap.pause(),o&&this.focusTrap.unpause()}else e.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var e=this,t=this.props.children?ii.Children.only(this.props.children):void 0;if(t){if(t.type&&t.type===ii.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");return ii.cloneElement(t,{ref:function(r){var i=e.props.containerElements;t&&(X0>=19?typeof t.props.ref=="function"?t.props.ref(r):t.props.ref&&(t.props.ref.current=r):typeof t.ref=="function"?t.ref(r):t.ref&&(t.ref.current=r)),e.focusTrapElements=i||[r]}})}return null}}])}();Tl.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:Y0},vm.exports=Tl;var K0=vm.exports.FocusTrap=Tl;function Bm(n){var m;const{children:e,preferredPlacement:t="top-start",anchorElement:r,boundaryElement:i,trapFocus:o=!1,initialFocus:s,...a}=n,{anchor:l,boundary:u}=R.useMemo(()=>({anchor:uh(r),boundary:i?uh(i):void 0}),[r,i]);let c=[];u&&(c=[C0({boundary:u}),I0({boundary:u})]);const{refs:d,floatingStyles:h,middlewareData:p}=function(E){E===void 0&&(E={});const{placement:A="bottom",strategy:D="absolute",middleware:_=[],platform:S,elements:{reference:T,floating:N}={},transform:I=!0,whileElementsMounted:L,open:g}=E,[O,k]=ae.useState({x:0,y:0,strategy:D,placement:A,middlewareData:{},isPositioned:!1}),[w,U]=ae.useState(_);Jo(w,_)||U(_);const[y,M]=ae.useState(null),[$,j]=ae.useState(null),G=ae.useCallback(ue=>{ue!==W.current&&(W.current=ue,M(ue))},[]),V=ae.useCallback(ue=>{ue!==ee.current&&(ee.current=ue,j(ue))},[]),Y=T||y,K=N||$,W=ae.useRef(null),ee=ae.useRef(null),F=ae.useRef(O),re=L!=null,Oe=_a(L),_e=_a(S),Qe=_a(g),ct=ae.useCallback(()=>{if(!W.current||!ee.current)return;const ue={placement:A,strategy:D,middleware:w};_e.current&&(ue.platform=_e.current),R0(W.current,ee.current,ue).then($n=>{const _t={...$n,isPositioned:Qe.current!==!1};kr.current&&!Jo(F.current,_t)&&(F.current=_t,aE.flushSync(()=>{k(_t)}))})},[w,A,D,_e,Qe]);_o(()=>{g===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,k(ue=>({...ue,isPositioned:!1})))},[g]);const kr=ae.useRef(!1);_o(()=>(kr.current=!0,()=>{kr.current=!1}),[]),_o(()=>{if(Y&&(W.current=Y),K&&(ee.current=K),Y&&K){if(Oe.current)return Oe.current(Y,K,ct);ct()}},[Y,K,ct,Oe,re]);const Ot=ae.useMemo(()=>({reference:W,floating:ee,setReference:G,setFloating:V}),[G,V]),Ce=ae.useMemo(()=>({reference:Y,floating:K}),[Y,K]),Ft=ae.useMemo(()=>{const ue={position:D,left:0,top:0};if(!Ce.floating)return ue;const $n=ih(Ce.floating,O.x),_t=ih(Ce.floating,O.y);return I?{...ue,transform:"translate("+$n+"px, "+_t+"px)",...Nm(Ce.floating)>=1.5&&{willChange:"transform"}}:{position:D,left:$n,top:_t}},[D,I,Ce.floating,O.x,O.y]);return ae.useMemo(()=>({...O,update:ct,refs:Ot,elements:Ce,floatingStyles:Ft}),[O,ct,Ot,Ce,Ft])}({placement:t,middleware:c,whileElementsMounted:_0});R.useLayoutEffect(()=>{l&&d.setReference(l)},[d,l]);const f=o?v.jsx(K0,{focusTrapOptions:{initialFocus:s,fallbackFocus:".t-fallback-focus",tabbableOptions:{getShadowRoot:!0}},children:v.jsxs("div",{children:[e,v.jsx("span",{className:"t-fallback-focus",tabIndex:-1})]})}):e;return v.jsx("div",{ref:d.setFloating,style:{...h,zIndex:1e3,visibility:(m=p.hide)!=null&&m.referenceHidden?"hidden":"visible"},...a,children:f})}function uh(n){return typeof n=="string"?document.querySelector(n):n}function Hm(n){const e=ie(),t=xi(),r=Z(t.state$.suggestMentionQuery),i=function(E,A=10){const D=R.useContext(Ml),[_,S]=R.useState(null);return R.useEffect(()=>{const T=D.conversation(E).subscribeParticipants(N=>S(N));return A>10&&T.connected.then(async()=>{for(;T.state.type==="active"&&!T.state.loadedAll&&T.state.latestSnapshot!==null&&T.state.latestSnapshot.length<A;){const N=Math.min(A-T.state.latestSnapshot.length,50);await T.loadMore(N)}}),()=>{T.unsubscribe()}},[E,D,A]),_}(Z(e.state$.extCurrentConversationId),r?1e3:0),o=R.useMemo(()=>(i!=null?i:[]).map(E=>E.user),[i]),[s,a]=R.useState(0),l=R.useMemo(()=>Object.fromEntries(o.map(E=>{return[E.id,(A=E.name,[...A.matchAll(/^|\s+/g)].map(D=>D.index+D[0].length).map(D=>A.substring(D)))];var A})),[o]),u=R.useMemo(()=>{if(!r)return[];const E=ch(r);return E===""?o:o.filter(A=>l[A.id].some(D=>function(_,S){return oc(_.substring(0,S.length),S)}(D,E)))},[r,o,l]),c=R.useRef(void 0);R.useEffect(()=>{if(c.current){const E=u.findIndex(A=>A.id===c.current);a(E===-1?0:E)}},[u]),R.useEffect(()=>{var E;c.current=(E=u[s])==null?void 0:E.id},[s,u]);const d=R.useCallback(E=>{var D;const A=(D=u[E])==null?void 0:D.id;return A&&"mention-button-"+A},[u]),{containerProps:h,itemProps:p}=Em({focused:s,setFocused:a,buttonId:d});if(R.useEffect(()=>{if(u.length!==0)return t.listenKeydown("mention",E=>mm(E,{dir:"ttb",focused:s,setFocused:a,itemCount:u.length,onSpace(){if(r){const A=u[s];if(oc(A.name,ch(r)))return t.selectMention(A),!0}return!1},onConfirm(){const A=u[s];t.selectMention(A)}})),()=>{t.listenKeydown("mention",void 0)}},[t,s,u,r]),$i(()=>t.closeSuggester(),".t-mention-suggest-list",u.length>0),u.length===0)return null;const f=document.querySelector(".ProseMirror-suggestion");let m;if(f){let E=f.getBoundingClientRect();m={getBoundingClientRect(){const A=f.getBoundingClientRect();return A.width>0&&(E=A),E}}}return v.jsx(Bm,{className:"t-mention-suggest-list",...h,anchorElement:m,children:u.map((E,A)=>v.jsx(W0,{user:E,isFocused:A===s,onSelect:()=>t.selectMention(E),...p(A)},E.id))})}const W0=ae.memo(function(n){const{user:e,isFocused:t,onSelect:r,...i}=n;return v.jsx("button",{className:t?"focused":"",onClick:()=>r(e.id),...i,children:e.name})});function ch(n){return le(n[0]==="@"),n.substring(1)}function dh(n,e,t){const r=du(n),i=r.indexOf(e);return i===-1?null:r[i+t]||null}const J0=R.forwardRef(function(n,e){const{children:t,triggerElement:r}=n,{closePopover:i}=Fl(),o=R.useRef(null);R.useImperativeHandle(e,()=>o.current),R.useEffect(()=>{var a;(a=o.current)==null||a.focus()},[]);const s=R.useCallback(a=>{(function(l,u,c,d){var E;const h=u.querySelectorAll("[t-menu-item]"),p=document.activeElement;if(!p||!p.hasAttribute("t-menu-item")&&!p.hasAttribute("t-menu"))return;const f=Array.from(h).indexOf(p);let m;switch(l.key){case"ArrowDown":m=Math.min(f+1,h.length-1);break;case"ArrowUp":m=Math.max(f-1,0),f===-1&&(m=h.length-1);break;case"Home":m=0;break;case"End":m=h.length-1;break;case"Tab":{const A=c.closest("t-chatbox,t-conversation-list,.t-chatbox,.t-conversation-list"),D=l.shiftKey?dh(A,c,-1):function(_,S){return dh(_,S,1)}(A,c);return D==null||D.focus(),void d()}default:return}(E=h[m])==null||E.focus()})(a,o.current,r,i)},[i,r]);return v.jsx("div",{"t-menu":"",role:"menu",tabIndex:-1,ref:o,onKeyDown:s,children:t})});function rr(n){const{popoverComponent:e,popoverProps:t,children:r,type:i="popover",initialFocus:o,...s}=n,[a,l]=R.useState(void 0),u=R.useRef(null),[c,d]=R.useState(!1);$i(R.useCallback(()=>{var p;d(!1),(p=u.current)==null||p.focus()},[]),"[t-popover-content]",c);const h=i==="menu"?v.jsx(J0,{triggerElement:u.current,children:v.jsx(e,{...t})}):v.jsx(e,{...t});return v.jsxs(ZE.Provider,{value:{closePopover:()=>d(!1)},children:[v.jsx(q0,{...s,"aria-haspopup":i==="menu"?"menu":"true","aria-expanded":c,onTrigger:()=>d(!0),ref:p=>(f=>{var E;const m=(E=f==null?void 0:f.closest("[t-menu-boundary]"))!=null?E:void 0;u.current=f,l(m)})(p),children:r}),c&&v.jsx(Bm,{"t-popover-content":"",anchorElement:u.current,boundaryElement:a,preferredPlacement:"bottom-start",trapFocus:i==="popover",initialFocus:i==="menu"?"t-menu":o,role:i==="menu"?void 0:"dialog",children:h})]})}const q0=R.forwardRef(function(n,e){const{onTrigger:t,...r}=n,i=R.useCallback(o=>{o.key!=="Enter"&&o.key!==" "||t()},[t]);return v.jsx("button",{...r,ref:e,onClick:t,onKeyDown:i})});function en(n){const{onSelect:e,...t}=n,{closePopover:r}=Fl(),i=R.useCallback(s=>{s.key!=="Enter"&&s.key!==" "||(r(),e==null||e())},[e,r]),o=R.useCallback(()=>{r(),e==null||e()},[r,e]);return v.jsx("div",{tabIndex:-1,role:"menuitem",onClick:o,onKeyDown:i,"t-menu-item":"",...t})}function Um(n){return mp(n)}function _n(n){var e;return(e=n.photoUrl)!=null?e:function(t,r){const i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
1274
1274
  <rect x="0" y="0" width="100" height="100" fill="${mp(t)}"/>
1275
1275
  <text x="50%" y="54%" dominant-baseline="middle" font-size="34" font-family="San Francisco, Segoe UI, Helvetica Neue, Arial, Helvetica, sans-serif" fill="#fff" text-anchor="middle">${r}</text>
1276
- </svg>`.replace(/\s+/g," ");return"data:image/svg+xml;base64,"+nA(i)}(n.id,oA(n.name))}function oi(n){return n<1024?n+" B":n<1048576?Math.floor(n/1024)+" KB":n<1073741824?Math.floor(n/1048576)+" MB":n<1099511627776?Math.floor(n/1073741824)+" GB":Math.floor(n/1099511627776)+" TB"}function du({latitude:n,longitude:e}){const t=n+","+e;return{imageUrl:`https://maps.googleapis.com/maps/api/staticmap?center=${t}&zoom=15&size=300x200&scale=2&maptype=roadmap&markers=${t}&key=${ND}`,linkUrl:`https://maps.google.com/maps?q=${t}&z=15`}}function jm(n,e){const[t,r]=T.useState({long:"",short:""});return T.useLayoutEffect(()=>{let i,o=!0;const s=()=>{const l=Date.now(),u=function(c,d,h){const p=c-d;let f,m,E;const A=new Date(d),D={month:"short",day:"numeric"};if(p<hh)return{changeTimeout:5e3,short:h.JUST_NOW,long:h.JUST_NOW};if(p<ph)f=hh,m="MINUTES",E=h.MINUTES;else if(p<fh)f=ph,m="HOURS",E=h.HOURS;else{if(!(p<Z0)){if(A.getFullYear()===new Date(c).getFullYear()){const S=A.toLocaleDateString(h.locale,D);return{changeTimeout:void 0,short:S,long:S}}{const S=A.toLocaleDateString(h.locale,{...D,year:"numeric"});return{changeTimeout:void 0,short:S,long:S}}}f=fh,m="DAYS",E=h.DAYS}const _=Math.floor(p/f);return{changeTimeout:f,short:_+E,long:Q0(_,m.toLowerCase(),h.locale)}}(l,n>l?l-2e3:n,e);return r(u),u},a=()=>{const l=s();o&&l.changeTimeout&&(i=window.setTimeout(a,l.changeTimeout))};return s(),i=window.setTimeout(a,100),()=>{o=!1,clearTimeout(i)}},[e,n]),t}function hu(n){n=Math.floor(n);const e=Math.floor(n/3600);n%=3600;const t=Math.floor(n/60);n%=60;const r=o=>o.toString().padStart(2,"0");let i=`${r(t)}:${r(n)}`;return e>0&&(i=`${r(e)}:${i}`),i}const dh=864e5;function $m(n,e){const t=Date.now(),r=(i=n,o=t,Math.floor((o-i)/dh));var i,o;if(r<0||r===0)return e.TODAY;if(r===1)return e.YESTERDAY;const s={weekday:"long"},a=new Date(n);if(r<7)return a.toLocaleDateString(e.locale,s);const l=new Date(t);return function(c,d){return Math.floor((d-c)/(365*dh))}(l.setFullYear(l.getFullYear()-1),n)===0?a.toLocaleDateString(e.locale,{...s,month:"long",day:"numeric"}):a.toLocaleDateString(e.locale,{...s,year:"numeric",month:"long",day:"numeric"})}const hh=6e4,ph=36e5,fh=864e5,Z0=6048e5;function Q0(n,e,t){return new Intl.RelativeTimeFormat(t).format(-n,e)}function x(n,...e){const t=CD.bind(ae.createElement)(n,...e);return Array.isArray(t)?ae.createElement(ae.Fragment,{},...t):t}function zm({children:n,className:e,...t}){return N.jsx("div",{className:"t-attach-overlay "+e,...t,children:n})}function eO({uploadState:n}){const{uploaded:e,errored:t}=n;$i(()=>n.closePreview("cancel"),".t-upload-preview");const r=T.useRef(null);T.useEffect(()=>{e&&r.current.focus()},[e]);const i=Z(ie().t$);return N.jsx(zm,{className:"t-upload-preview",children:N.jsxs("div",{className:"t-preview",children:[N.jsx(tO,{upload:n.upload,uploaded:e}),t&&N.jsx("div",{className:"t-error-row",children:i.UPLOAD_ERROR}),N.jsxs("div",{className:"t-send-row",children:[N.jsx("button",{className:"t-cancel",onClick:()=>n.closePreview("cancel"),children:i.CANCEL}),!t&&e&&N.jsx("button",{className:"t-confirm-send test__confirm-upload-button",onClick:()=>n.closePreview("send"),ref:r,children:i.SEND_BUTTON_TEXT})]})]})})}function tO({upload:n,uploaded:e}){const t=Z(ie().t$);return n.type!=="location"?N.jsxs(N.Fragment,{children:[N.jsx(rO,{upload:n}),N.jsx(iO,{upload:n,uploaded:e,t})]}):e?N.jsx(nO,{location:n.location}):N.jsx("div",{className:"t-loading",children:N.jsx(tu,{})})}function nO({location:n}){const{imageUrl:e,linkUrl:t}=du(n),r=JSON.stringify(e);return N.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"t-location-upload-preview",style:{background:`url(${r}) center center / cover no-repeat`}})}const rO=ae.memo(function({upload:n}){let e=null;const t=n.file;if(n.type==="video"){const r=/[.]ts/i.test(t.name)?"mpegts":"native";e=N.jsx("div",{className:"video-container",children:N.jsx(oO,{src:n.temporaryBlobUrl,videoType:r,playsInline:!0,controls:!0,preload:"auto"})})}else if(n.type==="image"){const r=URL.createObjectURL(t);e=N.jsx("div",{className:"t-img-container",children:N.jsx("img",{src:r})})}else if(n.type==="audio"){const r=URL.createObjectURL(t);e=N.jsx(Vo,{src:r,filename:t.name})}return e}),iO=ae.memo(function({uploaded:n,upload:e,t}){let r;r=n?e.metadata.filename:t.UPLOAD_IN_PROGRESS;let i="",o="";return e.type==="file"&&(i="is-file",n&&(o="file-block")),N.jsx("div",{className:`t-filename-row ${i}`,children:N.jsx("div",{className:o,children:r})})});function oO(n){const{videoType:e,...t}=n;return N.jsx("video",{...t})}function sO(){const n=Dt(),e=ie(),t=Lr(),r=Z(e.state$.isUserConnected),i=Z(e.state$.userPermissions);return N.jsx(n.ChatHeader,{common:t,isUserConnected:r,permissions:i})}function aO({appId:n,chatHeaderVisible:e,messageFieldVisible:t}){const r=xi(),i=function(){const p=ie(),f=ft(()=>{const A=p.extUserId$.get(),D=p.errors$.get(),_=p.authTokenState$.get(),S=A&&p.currentUser$.get(),R=p.state$.currentConversation.get(),v=p.state$.extCurrentConversationId.get(),I=v&&p.state$.participants.child(v).get(),L=p.app$.get();return p.device$.get(),D.serverError?"server-error":D.wrongAppId?"wrong-app-id":_==="loading"||_==="idle"?"loading-token":_==="invalid"?"invalid-token":_==="expired"?"expired-token":_==="valid"?D.unknownUser?"unknown-user":D.unknownConversation?"loading-conv-failed":S&&R&&I&&L?"loaded":"loading-data":void le.unreachable()}),m=ft({type:"loading"});Or(A=>{const D=f.get(),_=p.state$.extCurrentConversationId.peek(),S=p.extUserId$.peek(),R=p.appId$.peek();function v(I){m.set({type:"loading"});const L=setTimeout(()=>{m.set(I)},5e3);return()=>clearTimeout(L)}switch(D){case"invalid-token":m.set({type:"auth-failed"});break;case"expired-token":m.set({type:"expired-token"});break;case"wrong-app-id":m.set({type:"wrong-app-id",appId:R});break;case"server-error":m.set({type:"server-error"});break;case"loading-data":case"loading-token":m.set({type:"loading"});break;case"loaded":m.set({type:"loaded",conversationId:_,userId:S});break;case"loading-conv-failed":A.onCleanup=v({type:"inaccessible-conversation",userId:S,conversationId:_});break;case"unknown-user":A.onCleanup=v({type:"unknown-user",userId:S});break;default:le.never(D)}});const E=ft({type:"loading"});return Or(A=>{if(m.type.get()==="loading"){E.set({type:"invisible-loading"});const D=setTimeout(()=>{E.set({type:"loading"})},1e3);A.onCleanup=()=>{clearTimeout(D)}}else E.set(m.get())}),Z(E)}(),{attachFile:o,shareLocation:s,uploadState:a}=RD({onClose:()=>r.focus()});T.useEffect(()=>{r.uploadFile=o},[r,o]);const[l,u]=T.useState(!1),c=T.useCallback(p=>{o(p.dataTransfer.files[0]),p.preventDefault(),u(!1)},[o]),d=T.useCallback(p=>{p.preventDefault(),u(!0)},[]),h=T.useCallback(p=>{p.preventDefault(),u(!1)},[]);return i.type==="invisible-loading"?N.jsx(N.Fragment,{}):i.type==="loading"?N.jsx(Qf,{}):i.type==="inaccessible-conversation"?N.jsx(_D,{}):i.type==="unknown-user"||i.type==="auth-failed"||i.type==="wrong-app-id"||i.type==="server-error"||i.type==="unexpected-error"?N.jsx(As,{appId:n,chatboxState:i}):i.type=="expired-token"?N.jsx(em,{}):i.type==="loaded"?N.jsxs("div",{className:"t-chatbox-content",onDragOver:d,onDragLeave:h,onDrop:c,children:[e&&N.jsx(sO,{}),N.jsx(ED,{extConversationId:i.conversationId}),t&&N.jsx(Zf,{attachFile:o,shareLocation:s}),a&&N.jsx(eO,{uploadState:a}),l&&N.jsx(zm,{className:"t-drop-overlay",children:N.jsx(zo,{type:"attach"})})]}):N.jsx(N.Fragment,{})}function lO(n,e){return n.map(r=>function(i,o){if(i.type==="text")return function(s,a){const l=ru(a);return Ro(s,l)}(i.children,o);if(i.type==="file"&&i.subtype==="video")return`🎥 ${qi(i.url)}`;if(i.type==="file"&&i.subtype==="image")return`📷 ${qi(i.url)}`;if(i.type==="file"&&i.subtype==="audio")return`🎧 ${qi(i.url)}`;if(i.type==="file"&&i.subtype==="voice"){const s=i.duration;return s===void 0?"🎙️":`🎙️ (${Math.floor(s/60)}:${Math.floor(s%60).toString().padStart(2,"0")})`}return i.type==="file"?(i.subtype,`📎 ${qi(i.url)}`):i.type==="location"?"📍":""}(r,e)).join(`
1276
+ </svg>`.replace(/\s+/g," ");return"data:image/svg+xml;base64,"+nA(i)}(n.id,oA(n.name))}function oi(n){return n<1024?n+" B":n<1048576?Math.floor(n/1024)+" KB":n<1073741824?Math.floor(n/1048576)+" MB":n<1099511627776?Math.floor(n/1073741824)+" GB":Math.floor(n/1099511627776)+" TB"}function hu({latitude:n,longitude:e}){const t=n+","+e;return{imageUrl:`https://maps.googleapis.com/maps/api/staticmap?center=${t}&zoom=15&size=300x200&scale=2&maptype=roadmap&markers=${t}&key=${ND}`,linkUrl:`https://maps.google.com/maps?q=${t}&z=15`}}function jm(n,e){const[t,r]=R.useState({long:"",short:""});return R.useLayoutEffect(()=>{let i,o=!0;const s=()=>{const l=Date.now(),u=function(c,d,h){const p=c-d;let f,m,E;const A=new Date(d),D={month:"short",day:"numeric"};if(p<ph)return{changeTimeout:5e3,short:h.JUST_NOW,long:h.JUST_NOW};if(p<fh)f=ph,m="MINUTES",E=h.MINUTES;else if(p<mh)f=fh,m="HOURS",E=h.HOURS;else{if(!(p<Z0)){if(A.getFullYear()===new Date(c).getFullYear()){const S=A.toLocaleDateString(h.locale,D);return{changeTimeout:void 0,short:S,long:S}}{const S=A.toLocaleDateString(h.locale,{...D,year:"numeric"});return{changeTimeout:void 0,short:S,long:S}}}f=mh,m="DAYS",E=h.DAYS}const _=Math.floor(p/f);return{changeTimeout:f,short:_+E,long:Q0(_,m.toLowerCase(),h.locale)}}(l,n>l?l-2e3:n,e);return r(u),u},a=()=>{const l=s();o&&l.changeTimeout&&(i=window.setTimeout(a,l.changeTimeout))};return s(),i=window.setTimeout(a,100),()=>{o=!1,clearTimeout(i)}},[e,n]),t}function pu(n){n=Math.floor(n);const e=Math.floor(n/3600);n%=3600;const t=Math.floor(n/60);n%=60;const r=o=>o.toString().padStart(2,"0");let i=`${r(t)}:${r(n)}`;return e>0&&(i=`${r(e)}:${i}`),i}const hh=864e5;function $m(n,e){const t=Date.now(),r=(i=n,o=t,Math.floor((o-i)/hh));var i,o;if(r<0||r===0)return e.TODAY;if(r===1)return e.YESTERDAY;const s={weekday:"long"},a=new Date(n);if(r<7)return a.toLocaleDateString(e.locale,s);const l=new Date(t);return function(c,d){return Math.floor((d-c)/(365*hh))}(l.setFullYear(l.getFullYear()-1),n)===0?a.toLocaleDateString(e.locale,{...s,month:"long",day:"numeric"}):a.toLocaleDateString(e.locale,{...s,year:"numeric",month:"long",day:"numeric"})}const ph=6e4,fh=36e5,mh=864e5,Z0=6048e5;function Q0(n,e,t){return new Intl.RelativeTimeFormat(t).format(-n,e)}function x(n,...e){const t=CD.bind(ae.createElement)(n,...e);return Array.isArray(t)?ae.createElement(ae.Fragment,{},...t):t}function zm({children:n,className:e,...t}){return v.jsx("div",{className:"t-attach-overlay "+e,...t,children:n})}function eO({uploadState:n}){const{uploaded:e,errored:t}=n;$i(()=>n.closePreview("cancel"),".t-upload-preview");const r=R.useRef(null);R.useEffect(()=>{e&&r.current.focus()},[e]);const i=Z(ie().t$);return v.jsx(zm,{className:"t-upload-preview",children:v.jsxs("div",{className:"t-preview",children:[v.jsx(tO,{upload:n.upload,uploaded:e}),t&&v.jsx("div",{className:"t-error-row",children:i.UPLOAD_ERROR}),v.jsxs("div",{className:"t-send-row",children:[v.jsx("button",{className:"t-cancel",onClick:()=>n.closePreview("cancel"),children:i.CANCEL}),!t&&e&&v.jsx("button",{className:"t-confirm-send test__confirm-upload-button",onClick:()=>n.closePreview("send"),ref:r,children:i.SEND_BUTTON_TEXT})]})]})})}function tO({upload:n,uploaded:e}){const t=Z(ie().t$);return n.type!=="location"?v.jsxs(v.Fragment,{children:[v.jsx(rO,{upload:n}),v.jsx(iO,{upload:n,uploaded:e,t})]}):e?v.jsx(nO,{location:n.location}):v.jsx("div",{className:"t-loading",children:v.jsx(nu,{})})}function nO({location:n}){const{imageUrl:e,linkUrl:t}=hu(n),r=JSON.stringify(e);return v.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"t-location-upload-preview",style:{background:`url(${r}) center center / cover no-repeat`}})}const rO=ae.memo(function({upload:n}){let e=null;const t=n.file;if(n.type==="video"){const r=/[.]ts/i.test(t.name)?"mpegts":"native";e=v.jsx("div",{className:"video-container",children:v.jsx(oO,{src:n.temporaryBlobUrl,videoType:r,playsInline:!0,controls:!0,preload:"auto"})})}else if(n.type==="image"){const r=URL.createObjectURL(t);e=v.jsx("div",{className:"t-img-container",children:v.jsx("img",{src:r})})}else if(n.type==="audio"){const r=URL.createObjectURL(t);e=v.jsx(Vo,{src:r,filename:t.name})}return e}),iO=ae.memo(function({uploaded:n,upload:e,t}){let r;r=n?e.metadata.filename:t.UPLOAD_IN_PROGRESS;let i="",o="";return e.type==="file"&&(i="is-file",n&&(o="file-block")),v.jsx("div",{className:`t-filename-row ${i}`,children:v.jsx("div",{className:o,children:r})})});function oO(n){const{videoType:e,...t}=n;return v.jsx("video",{...t})}function sO(){const n=Dt(),e=ie(),t=Lr(),r=Z(e.state$.isUserConnected),i=Z(e.state$.userPermissions);return v.jsx(n.ChatHeader,{common:t,isUserConnected:r,permissions:i})}function aO({appId:n,chatHeaderVisible:e,messageFieldVisible:t}){const r=xi(),i=function(){const m=ie(),E=ft(()=>{const _=m.extUserId$.get(),S=m.errors$.get(),T=m.authTokenState$.get(),N=_&&m.currentUser$.get(),I=m.state$.currentConversation.get(),L=m.state$.extCurrentConversationId.get(),g=L&&m.state$.participants.child(L).get(),O=m.app$.get();return m.device$.get(),S.serverError?"server-error":S.wrongAppId?"wrong-app-id":T==="loading"||T==="idle"?"loading-token":T==="invalid"?"invalid-token":T==="expired"?"expired-token":T==="valid"?S.unknownUser?"unknown-user":S.unknownConversation?"loading-conv-failed":N&&I&&g&&O?"loaded":"loading-data":void le.unreachable()}),A=ft({type:"loading"});Or(_=>{const S=E.get(),T=m.state$.extCurrentConversationId.peek(),N=m.extUserId$.peek(),I=m.appId$.peek();function L(g){A.set({type:"loading"});const O=setTimeout(()=>{A.set(g)},5e3);return()=>clearTimeout(O)}switch(S){case"invalid-token":A.set({type:"auth-failed"});break;case"expired-token":A.set({type:"expired-token"});break;case"wrong-app-id":A.set({type:"wrong-app-id",appId:I});break;case"server-error":A.set({type:"server-error"});break;case"loading-data":case"loading-token":A.set({type:"loading"});break;case"loaded":A.set({type:"loaded",conversationId:T,userId:N});break;case"loading-conv-failed":_.onCleanup=L({type:"inaccessible-conversation",userId:N,conversationId:T});break;case"unknown-user":_.onCleanup=L({type:"unknown-user",userId:N});break;default:le.never(S)}});const D=ft({type:"loading"});return Or(_=>{if(A.type.get()==="loading"){D.set({type:"invisible-loading"});const S=setTimeout(()=>{D.set({type:"loading"})},1e3);_.onCleanup=()=>{clearTimeout(S)}}else D.set(A.get())}),Z(D)}(),{attachFile:o,shareLocation:s,uploadState:a}=RD({onClose:()=>r.focus()});R.useEffect(()=>{r.uploadFile=o},[r,o]);const[l,u]=R.useState(!1),c=ie(),d=Z(()=>c.app$.get()?c.state$.userPermissions.canShareFile.get():void 0),h=R.useCallback(m=>{o(m.dataTransfer.files[0]),m.preventDefault(),u(!1)},[o]),p=R.useCallback(m=>{m.preventDefault(),u(!0)},[]),f=R.useCallback(m=>{m.preventDefault(),u(!1)},[]);return i.type==="invisible-loading"?v.jsx(v.Fragment,{}):i.type==="loading"?v.jsx(Qf,{}):i.type==="inaccessible-conversation"?v.jsx(_D,{}):i.type==="unknown-user"||i.type==="auth-failed"||i.type==="wrong-app-id"||i.type==="server-error"||i.type==="unexpected-error"?v.jsx(As,{appId:n,chatboxState:i}):i.type=="expired-token"?v.jsx(em,{}):i.type==="loaded"?v.jsxs("div",{className:"t-chatbox-content",onDragOver:d?p:void 0,onDragLeave:d?f:void 0,onDrop:d?h:void 0,children:[e&&v.jsx(sO,{}),v.jsx(ED,{extConversationId:i.conversationId}),t&&v.jsx(Zf,{attachFile:o,shareLocation:s}),a&&v.jsx(eO,{uploadState:a}),l&&v.jsx(zm,{className:"t-drop-overlay",children:v.jsx(zo,{type:"attach"})})]}):v.jsx(v.Fragment,{})}function lO(n,e){return n.map(r=>function(i,o){if(i.type==="text")return function(s,a){const l=iu(a);return Ro(s,l)}(i.children,o);if(i.type==="file"&&i.subtype==="video")return`🎥 ${qi(i.url)}`;if(i.type==="file"&&i.subtype==="image")return`📷 ${qi(i.url)}`;if(i.type==="file"&&i.subtype==="audio")return`🎧 ${qi(i.url)}`;if(i.type==="file"&&i.subtype==="voice"){const s=i.duration;return s===void 0?"🎙️":`🎙️ (${Math.floor(s/60)}:${Math.floor(s%60).toString().padStart(2,"0")})`}return i.type==="file"?(i.subtype,`📎 ${qi(i.url)}`):i.type==="location"?"📍":""}(r,e)).join(`
1277
1277
 
1278
1278
  `)}function Ro(n,e){return n.flatMap(t=>{if(typeof t=="string")return t;switch(t.type){case"blockquote":case"bold":case"italic":case"strikethrough":case"link":case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return Ro(t.children,e);case"bulletlist":case"bulletList":return`
1279
1279
  `+Ro(t.children,e);case"bulletpoint":case"bulletPoint":return"- "+Ro(t.children,e)+`
1280
- `;case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"emoji":case"customemoji":case"customEmoji":return t.text;case"suppressed":return e.contactInfoHiddenText;case"mention":return`@${t.text}`}}).join("")}function Vm(){const n=typeof window!="undefined"?window.crypto:void 0,e=n?()=>n.getRandomValues(new Uint8Array(1))[0]:()=>Math.floor(255*Math.random());return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(t^e()&15>>t/4).toString(16))}class uO{constructor(e,t,r,i,o,s){this.store=e,this.talkSession=t,this.editorInternals=r,this.onSendMessage=i,this.onDeleteMessage=o,this.onMessageAction=s}async deleteMessage(e){const t=this.store.state$.extCurrentConversationId.peek(),r=this.store.state$.messages.child(t).lookup.child(e).peek(),i=this.talkSession.conversation(t).message(e),[o]=await Promise.all([r!=null?r:i.get(),i.delete()]);if(o){const s={currentUser:this.store.currentUser$.peek(),conversation:this.store.state$.currentConversation.peek(),message:r};this.onDeleteMessage(s)}}setEditing(e){this.store.state$.editingMessageId.set(e)}async editMessage(e,t){const r=this.store.state$.extCurrentConversationId.peek();await this.talkSession.conversation(r).message(e).edit(t)}setReferencedMessage(e){this.store.state$.referencedMessageId.set(e),setTimeout(()=>this.editorInternals.focus({skipProseMirrorStuff:!0}),100)}async sendMessage(e){const t=this.store.state$.extCurrentConversationId.peek(),r=await async function(s,a){var m,E,A,D,_;const l=s.state$.extCurrentConversationId.peek(),u=s.state$.messages.child(l),c=typeof a.referencedMessage=="string"?u.lookup.child(a.referencedMessage).peek():await((E=(m=a.referencedMessage)==null?void 0:m.get())!=null?E:null),d=c&&{...c,type:"UserMessage",sender:c.sender,referencedMessageId:(D=(A=c.referencedMessage)==null?void 0:A.id)!=null?D:null};d&&delete d.referencedMessage;const h=s.latestFileUpload,p="content"in a?[mh(h,a.content[0])]:[cO(a.text)],f="text"in a?a.text:lO(a.content.map(S=>mh(h,S)),{});return{id:"ephemeral-"+Vm(),type:"UserMessage",sender:s.currentUser$.peek(),createdAt:Date.now(),editedAt:null,custom:(_=a.custom)!=null?_:{},origin:"web",referencedMessage:d,reactions:[],content:p,plaintext:f}}(this.store,e);this.store.state$.ephemeralMessages.child(t).child(r.id).set(r);const i=Ii();this.store.readyForNewMessagesPromise=i.promise;const o=await this.talkSession.conversation(t).send(e);this.store.state$.ephemeralMessageIdMapping.child(t).child(o.id).set(r.id),i.resolve(),this.onSendMessage({message:await o.get(),currentUser:this.store.currentUser$.peek(),conversation:this.store.state$.currentConversation.peek()})}sendFileMessage(e){const t={type:"file",fileToken:e.fileToken};return this.sendMessage({content:[t],custom:e.custom})}sendLocationMessage(e){const t={type:"location",latitude:e.location.latitude,longitude:e.location.longitude};return this.sendMessage({content:[t],custom:e.custom})}markAsTyping(){const e=this.store.state$.extCurrentConversationId.peek();this.talkSession.conversation(e).markAsTyping()}async toggleReaction(e,t){typeof t!="string"&&(t=t.emoji);const r=this.store.state$.extCurrentConversationId.peek(),i=this.store.state$.messages.child(r).lookup.child(e).peek().reactions.find(s=>s.emoji===t),o=this._getReactionRef(e,t);i!=null&&i.currentUserReacted?await o.remove():await o.add()}async addReaction(e,t){await this._getReactionRef(e,t).add()}triggerMessageAction(e,t,r){const i=this.store.state$.currentConversation.peek();typeof e=="string"&&(e=this.store.state$.messages.child(i.id).lookup.child(e).peek()),this.onMessageAction({action:t,params:r,message:e,conversation:i})}storeDraft(e){const t=this.store.state$.extCurrentConversationId.peek(),r=this.store.currentUser$.peek(),i=this.store.appId$.peek();t&&r&&i&&dD(t,r.id,i,e)}_getReactionRef(e,t){const r=this.store.state$.extCurrentConversationId.peek();return this.talkSession.conversation(r).message(e).reaction(t)}}const cO=n=>({type:"text",children:function(t){return Vf(t,{except:["FormattedLink","Actions"]})}(n)});function mh(n,e){switch(e.type){case"text":case"location":return e;case"file":return function(t,r){return{type:"file",subtype:t.type==="file"?void 0:t.type,...t.metadata,size:t.file.size,filename:t.file.name,fileToken:r.fileToken,url:t.temporaryBlobUrl}}(n,e)}}function Eh(n){return Object.keys(n)}class Ca extends Error{constructor(e,t){const r=function(i){if(typeof i=="string")return i;if(Array.isArray(i))return i.join(`
1281
- `);try{return JSON.stringify(i)}catch(o){return String(i)}}(e);super(r),this.userMessage=t!=null?t:r,Object.setPrototypeOf&&Object.setPrototypeOf(this,new.target.prototype)}}const wi=console;class dO{constructor(e,t,r,i){this.apiUrls=e,this.appId=t,this.sessionId=r,this.authProvider=i,this._lastPutPromise=Promise.resolve()}async get(e,t={}){const r=this.endpointUrl(e,t),i=await jr(()=>this.fetchWithReauth(r),{retries:11});return await this.handleResponse(i,r)}async queuedPut(e,t){await this._lastPutPromise;const r=jr(()=>this._doPut(e,t));return this._lastPutPromise=r,r}put(e,t,r){const i=()=>this._doPut(e,t);return r?Ah(i,r):jr(i,{retries:5})}post(e,t,r){const i=()=>this._doPost(e,t);return r?Ah(i,r):jr(i,{retries:5})}delete(e,t={}){return jr(()=>this._doDelete(e,t),{retries:11})}endpointUrl(e,t={}){const r=new URL(this.apiUrls.internalHttpApiUrl);r.pathname+=`/${this.appId}/${e}`,r.searchParams.set("sessionId",this.sessionId);for(const[i,o]of Object.entries(t))r.searchParams.set(i,o);return r}async _doPut(e,t){const r=this.endpointUrl(e),i=await this.fetchWithReauth(r,{method:"PUT",body:JSON.stringify(t)});return await this.handleResponse(i,r)}async _doPost(e,t){const r=this.endpointUrl(e),i=await this.fetchWithReauth(r,{method:"POST",body:JSON.stringify(t)});return await this.handleResponse(i,r)}async _doDelete(e,t){const r=this.endpointUrl(e,t),i=await this.fetchWithReauth(r,{method:"DELETE"});return await this.handleResponse(i,r)}async handleResponse(e,t){if(e.status>=300){if(e.status===404)throw Lo.error(`[${this.appId}][BackendRestClient] Couldn't find resource.`),new Ca("Could not find app.",`Could not find given appId: "${this.appId}". You can find your appId on https://talkjs.com/dashboard.`);if(e.status===401){const r=await this.authProvider.getToken();throw Lo.error(`[${this.appId}][BackendRestClient] Couldn't authenticate ${t} with token ${r}.`),new Ca("User not authenticated.","Could not authenticate user. Check if your signature is calculated correctly.")}if(e.status>=300&&e.status<500){const{error:r}=await e.json();throw new Ca(r)}{const r=await e.text();throw new Error(`Got non-success response (${r}) from the server for url: ${t}.`)}}return await e.json()}async fetchWithReauth(e,t){function r(s){const a={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${s}`};return fetch(e,{...t,headers:a})}const i=await this.authProvider.getToken(),o=await r(i);return o.status!==401?o:(wi.error(`401 error from ${t==null?void 0:t.method} ${e}, ${i}`),this.authProvider.refreshToken(),r(await this.authProvider.getToken()))}}function Ym(n){return!n.userMessage}function jr(n,{retries:e=30}={}){return nu(e,n,{shouldRetry:Ym,log:wi.warn.bind(wi),maxDelay:30,initialDelay:.2})}async function Ah(n,e){try{return await n()}catch(r){if(!Ym(r))throw r}let t=!1;return e.then(()=>{t=!0}),nu(1e3,n,{initialDelay:.2,maxDelay:30,shouldRetry:()=>!t,log:wi.warn.bind(wi)})}var Rl={exports:{}};(function(n,e){var t="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",o="[object Function]",s="[object Object]",a=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[i]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[o]=u["[object Map]"]=u["[object Number]"]=u[s]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var c=typeof Ji=="object"&&Ji&&Ji.Object===Object&&Ji,d=typeof self=="object"&&self&&self.Object===Object&&self,h=c||d||Function("return this")(),p=e&&!e.nodeType&&e,f=p&&n&&!n.nodeType&&n,m=f&&f.exports===p,E=m&&c.process,A=function(){try{var C=f&&f.require&&f.require("util").types;return C||E&&E.binding&&E.binding("util")}catch(b){}}(),D=A&&A.isTypedArray,_,S=Array.prototype,R=Function.prototype,v=Object.prototype,I=h["__core-js_shared__"],L=R.toString,g=v.hasOwnProperty,O=(_=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+_:"",k=v.toString,w=L.call(Object),U=RegExp("^"+L.call(g).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),y=m?h.Buffer:void 0,M=h.Symbol,$=h.Uint8Array;y&&y.allocUnsafe;var j,G,V=(j=Object.getPrototypeOf,G=Object,function(C){return j(G(C))}),Y=Object.create,K=v.propertyIsEnumerable,W=S.splice,ee=M?M.toStringTag:void 0,F=function(){try{var C=_s(Object,"defineProperty");return C({},"",{}),C}catch(b){}}(),re=y?y.isBuffer:void 0,Oe=Math.max,_e=Date.now,Qe=_s(h,"Map"),ct=_s(Object,"create"),kr=function(){function C(){}return function(b){if(!pn(b))return{};if(Y)return Y(b);C.prototype=b;var P=new C;return C.prototype=void 0,P}}();function Ot(C){var b=-1,P=C==null?0:C.length;for(this.clear();++b<P;){var z=C[b];this.set(z[0],z[1])}}function Ce(C){var b=-1,P=C==null?0:C.length;for(this.clear();++b<P;){var z=C[b];this.set(z[0],z[1])}}function Ft(C){var b=-1,P=C==null?0:C.length;for(this.clear();++b<P;){var z=C[b];this.set(z[0],z[1])}}function ue(C){var b=this.__data__=new Ce(C);this.size=b.size}function $n(C,b){var P=Rs(C),z=!P&&Ts(C),q=!P&&!z&&Au(C),de=!P&&!z&&!q&&Du(C),se=P||z||q||de,Be=se?function(Ie,xt){for(var We=-1,zn=Array(Ie);++We<Ie;)zn[We]=xt(We);return zn}(C.length,String):[],Ke=Be.length;for(var he in C)se&&(he=="length"||q&&(he=="offset"||he=="parent")||de&&(he=="buffer"||he=="byteLength"||he=="byteOffset")||mu(he,Ke))||Be.push(he);return Be}function _t(C,b,P){(P!==void 0&&!Gi(C[b],P)||P===void 0&&!(b in C))&&Os(C,b,P)}function Jm(C,b,P){var z=C[b];g.call(C,b)&&Gi(z,P)&&(P!==void 0||b in C)||Os(C,b,P)}function zi(C,b){for(var P=C.length;P--;)if(Gi(C[P][0],b))return P;return-1}function Os(C,b,P){b=="__proto__"&&F?F(C,b,{configurable:!0,enumerable:!0,value:P,writable:!0}):C[b]=P}Ot.prototype.clear=function(){this.__data__=ct?ct(null):{},this.size=0},Ot.prototype.delete=function(C){var b=this.has(C)&&delete this.__data__[C];return this.size-=b?1:0,b},Ot.prototype.get=function(C){var b=this.__data__;if(ct){var P=b[C];return P===t?void 0:P}return g.call(b,C)?b[C]:void 0},Ot.prototype.has=function(C){var b=this.__data__;return ct?b[C]!==void 0:g.call(b,C)},Ot.prototype.set=function(C,b){var P=this.__data__;return this.size+=this.has(C)?0:1,P[C]=ct&&b===void 0?t:b,this},Ce.prototype.clear=function(){this.__data__=[],this.size=0},Ce.prototype.delete=function(C){var b=this.__data__,P=zi(b,C);return!(P<0)&&(P==b.length-1?b.pop():W.call(b,P,1),--this.size,!0)},Ce.prototype.get=function(C){var b=this.__data__,P=zi(b,C);return P<0?void 0:b[P][1]},Ce.prototype.has=function(C){return zi(this.__data__,C)>-1},Ce.prototype.set=function(C,b){var P=this.__data__,z=zi(P,C);return z<0?(++this.size,P.push([C,b])):P[z][1]=b,this},Ft.prototype.clear=function(){this.size=0,this.__data__={hash:new Ot,map:new(Qe||Ce),string:new Ot}},Ft.prototype.delete=function(C){var b=Yi(this,C).delete(C);return this.size-=b?1:0,b},Ft.prototype.get=function(C){return Yi(this,C).get(C)},Ft.prototype.has=function(C){return Yi(this,C).has(C)},Ft.prototype.set=function(C,b){var P=Yi(this,C),z=P.size;return P.set(C,b),this.size+=P.size==z?0:1,this},ue.prototype.clear=function(){this.__data__=new Ce,this.size=0},ue.prototype.delete=function(C){var b=this.__data__,P=b.delete(C);return this.size=b.size,P},ue.prototype.get=function(C){return this.__data__.get(C)},ue.prototype.has=function(C){return this.__data__.has(C)},ue.prototype.set=function(C,b){var P=this.__data__;if(P instanceof Ce){var z=P.__data__;if(!Qe||z.length<199)return z.push([C,b]),this.size=++P.size,this;P=this.__data__=new Ft(z)}return P.set(C,b),this.size=P.size,this};var qm=function(C,b,P){for(var z=-1,q=Object(C),de=P(C),se=de.length;se--;){var Be=de[++z];if(b(q[Be],Be,q)===!1)break}return C};function Vi(C){return C==null?C===void 0?"[object Undefined]":"[object Null]":ee&&ee in Object(C)?function(b){var P=g.call(b,ee),z=b[ee];try{b[ee]=void 0;var q=!0}catch(se){}var de=k.call(b);return q&&(P?b[ee]=z:delete b[ee]),de}(C):function(b){return k.call(b)}(C)}function pu(C){return wr(C)&&Vi(C)==i}function Zm(C){return!(!pn(C)||function(b){return!!O&&O in b}(C))&&(Is(C)?U:a).test(function(b){if(b!=null){try{return L.call(b)}catch(P){}try{return b+""}catch(P){}}return""}(C))}function Qm(C){if(!pn(C))return function(q){var de=[];if(q!=null)for(var se in Object(q))de.push(se);return de}(C);var b=Eu(C),P=[];for(var z in C)(z!="constructor"||!b&&g.call(C,z))&&P.push(z);return P}function fu(C,b,P,z,q){C!==b&&qm(b,function(de,se){if(q||(q=new ue),pn(de))(function(Ke,he,Ie,xt,We,zn,Mr){var St=Ss(Ke,Ie),Je=Ss(he,Ie),Su=Mr.get(Je);if(Su)return void _t(Ke,Ie,Su);var et=zn?zn(St,Je,Ie+"",Ke,he,Mr):void 0,Fr=et===void 0;if(Fr){var vs=Rs(Je),ys=!vs&&Au(Je),Tu=!vs&&!ys&&Du(Je);et=Je,vs||ys||Tu?Rs(St)?et=St:wr(Ru=St)&&Cs(Ru)?et=function(Te,at){var be=-1,tt=Te.length;for(at||(at=Array(tt));++be<tt;)at[be]=Te[be];return at}(St):ys?(Fr=!1,et=Je.slice()):Tu?(Fr=!1,et=function(Te){var at=(be=Te.buffer,tt=new be.constructor(be.byteLength),new $(tt).set(new $(be)),tt),be,tt;return new Te.constructor(at,Te.byteOffset,Te.length)}(Je)):et=[]:function(Te){if(!wr(Te)||Vi(Te)!=s)return!1;var at=V(Te);if(at===null)return!0;var be=g.call(at,"constructor")&&at.constructor;return typeof be=="function"&&be instanceof be&&L.call(be)==w}(Je)||Ts(Je)?(et=St,Ts(St)?et=function(Te){return function(at,be,tt){var iE=!tt;tt||(tt={});for(var Cu=-1,oE=be.length;++Cu<oE;){var bs=be[Cu],Xi=void 0;Xi===void 0&&(Xi=at[bs]),iE?Os(tt,bs,Xi):Jm(tt,bs,Xi)}return tt}(Te,Ou(Te))}(St):pn(St)&&!Is(St)||(et=function(Te){return typeof Te.constructor!="function"||Eu(Te)?{}:kr(V(Te))}(Je))):Fr=!1}var Ru;Fr&&(Mr.set(Je,et),We(et,Je,xt,zn,Mr),Mr.delete(Je)),_t(Ke,Ie,et)})(C,b,se,P,fu,z,q);else{var Be=z?z(Ss(C,se),de,se+"",C,b,q):void 0;Be===void 0&&(Be=de),_t(C,se,Be)}},Ou)}function eE(C,b){return nE(function(P,z,q){return z=Oe(z===void 0?P.length-1:z,0),function(){for(var de=arguments,se=-1,Be=Oe(de.length-z,0),Ke=Array(Be);++se<Be;)Ke[se]=de[z+se];se=-1;for(var he=Array(z+1);++se<z;)he[se]=de[se];return he[z]=q(Ke),function(Ie,xt,We){switch(We.length){case 0:return Ie.call(xt);case 1:return Ie.call(xt,We[0]);case 2:return Ie.call(xt,We[0],We[1]);case 3:return Ie.call(xt,We[0],We[1],We[2])}return Ie.apply(xt,We)}(P,this,he)}}(C,b,_u),C+"")}var tE=F?function(C,b){return F(C,"toString",{configurable:!0,enumerable:!1,value:(P=b,function(){return P}),writable:!0});var P}:_u;function Yi(C,b){var P,z,q=C.__data__;return((z=typeof(P=b))=="string"||z=="number"||z=="symbol"||z=="boolean"?P!=="__proto__":P===null)?q[typeof b=="string"?"string":"hash"]:q.map}function _s(C,b){var P=function(z,q){return z==null?void 0:z[q]}(C,b);return Zm(P)?P:void 0}function mu(C,b){var P=typeof C;return!!(b=b==null?r:b)&&(P=="number"||P!="symbol"&&l.test(C))&&C>-1&&C%1==0&&C<b}function Eu(C){var b=C&&C.constructor;return C===(typeof b=="function"&&b.prototype||v)}function Ss(C,b){if((b!=="constructor"||typeof C[b]!="function")&&b!="__proto__")return C[b]}var nE=function(C){var b=0,P=0;return function(){var z=_e(),q=16-(z-P);if(P=z,q>0){if(++b>=800)return arguments[0]}else b=0;return C.apply(void 0,arguments)}}(tE);function Gi(C,b){return C===b||C!=C&&b!=b}var Ts=pu(function(){return arguments}())?pu:function(C){return wr(C)&&g.call(C,"callee")&&!K.call(C,"callee")},Rs=Array.isArray;function Cs(C){return C!=null&&gu(C.length)&&!Is(C)}var Au=re||function(){return!1};function Is(C){if(!pn(C))return!1;var b=Vi(C);return b==o||b=="[object GeneratorFunction]"||b=="[object AsyncFunction]"||b=="[object Proxy]"}function gu(C){return typeof C=="number"&&C>-1&&C%1==0&&C<=r}function pn(C){var b=typeof C;return C!=null&&(b=="object"||b=="function")}function wr(C){return C!=null&&typeof C=="object"}var Du=D?function(C){return function(b){return C(b)}}(D):function(C){return wr(C)&&gu(C.length)&&!!u[Vi(C)]};function Ou(C){return Cs(C)?$n(C):Qm(C)}var Ns,rE=(Ns=function(C,b,P){fu(C,b,P)},eE(function(C,b){var P=-1,z=b.length,q=z>1?b[z-1]:void 0,de=z>2?b[2]:void 0;for(q=Ns.length>3&&typeof q=="function"?(z--,q):void 0,de&&function(Be,Ke,he){if(!pn(he))return!1;var Ie=typeof Ke;return!!(Ie=="number"?Cs(he)&&mu(Ke,he.length):Ie=="string"&&Ke in he)&&Gi(he[Ke],Be)}(b[0],b[1],de)&&(q=z<3?void 0:q,z=1),C=Object(C);++P<z;){var se=b[P];se&&Ns(C,se,P,q)}return C}));function _u(C){return C}n.exports=rE})(Rl,Rl.exports);const hO=ME(Rl.exports);class pO{constructor(e,t,r,i){this.backendRestClient=new dO(e,t,r,i)}async getApp(e){return function(t){const r=function(s,a){const l={general:{enableFileTransfers:a.includes("file_sharing"),enableLocation:a.includes("location_sharing"),enableMentions:!1,showTypingIndicators:!0,enablePresence:!1,enableVoiceRecording:!1},theme:{version:"v2",name:"default"},permissions:{messages:{delete:"own",edit:"own",reply:"all",emojiReactions:"all"},messagesCustom:{},conversations:{leave:"none",markAsUnread:"none"},conversationsCustom:{}},generalNotificationSettings:{timeout:"15"},emailSettings:{enabled:!0,subject:"{{sender.name}} wants to chat with you on {{app.name}}",replySeparator:"--- Write ABOVE THIS LINE to post a reply via email ---",unsubscribeText:"Unsubscribe from all chat emails",senderName:"{{sender.name}} (via {{app.name}})",header:`Hi {{recipient.name}},
1280
+ `;case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"emoji":case"customemoji":case"customEmoji":return t.text;case"suppressed":return e.contactInfoHiddenText;case"mention":return`@${t.text}`}}).join("")}function Vm(){const n=typeof window!="undefined"?window.crypto:void 0,e=n?()=>n.getRandomValues(new Uint8Array(1))[0]:()=>Math.floor(255*Math.random());return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(t^e()&15>>t/4).toString(16))}class uO{constructor(e,t,r,i,o,s){this.store=e,this.talkSession=t,this.editorInternals=r,this.onSendMessage=i,this.onDeleteMessage=o,this.onMessageAction=s}async deleteMessage(e){const t=this.store.state$.extCurrentConversationId.peek(),r=this.store.state$.messages.child(t).lookup.child(e).peek(),i=this.talkSession.conversation(t).message(e),[o]=await Promise.all([r!=null?r:i.get(),i.delete()]);if(o){const s={currentUser:this.store.currentUser$.peek(),conversation:this.store.state$.currentConversation.peek(),message:r};this.onDeleteMessage(s)}}setEditing(e){this.store.state$.editingMessageId.set(e)}async editMessage(e,t){const r=this.store.state$.extCurrentConversationId.peek();await this.talkSession.conversation(r).message(e).edit(t)}setReferencedMessage(e){this.store.state$.referencedMessageId.set(e),setTimeout(()=>this.editorInternals.focus({skipProseMirrorStuff:!0}),100)}async sendMessage(e){const t=this.store.state$.extCurrentConversationId.peek(),r=await async function(s,a){var m,E,A,D,_;const l=s.state$.extCurrentConversationId.peek(),u=s.state$.messages.child(l),c=typeof a.referencedMessage=="string"?u.lookup.child(a.referencedMessage).peek():await((E=(m=a.referencedMessage)==null?void 0:m.get())!=null?E:null),d=c&&{...c,type:"UserMessage",sender:c.sender,referencedMessageId:(D=(A=c.referencedMessage)==null?void 0:A.id)!=null?D:null};d&&delete d.referencedMessage;const h=s.latestFileUpload,p="content"in a?[Eh(h,a.content[0])]:[cO(a.text)],f="text"in a?a.text:lO(a.content.map(S=>Eh(h,S)),{});return{id:"ephemeral-"+Vm(),type:"UserMessage",sender:s.currentUser$.peek(),createdAt:Date.now(),editedAt:null,custom:(_=a.custom)!=null?_:{},origin:"web",referencedMessage:d,reactions:[],content:p,plaintext:f}}(this.store,e);this.store.state$.ephemeralMessages.child(t).child(r.id).set(r);const i=Ii();this.store.readyForNewMessagesPromise=i.promise;const o=await this.talkSession.conversation(t).send(e);this.store.state$.ephemeralMessageIdMapping.child(t).child(o.id).set(r.id),i.resolve(),this.onSendMessage({message:await o.get(),currentUser:this.store.currentUser$.peek(),conversation:this.store.state$.currentConversation.peek()})}sendFileMessage(e){const t={type:"file",fileToken:e.fileToken};return this.sendMessage({content:[t],custom:e.custom})}sendLocationMessage(e){const t={type:"location",latitude:e.location.latitude,longitude:e.location.longitude};return this.sendMessage({content:[t],custom:e.custom})}markAsTyping(){const e=this.store.state$.extCurrentConversationId.peek();this.talkSession.conversation(e).markAsTyping()}async toggleReaction(e,t){typeof t!="string"&&(t=t.emoji);const r=this.store.state$.extCurrentConversationId.peek(),i=this.store.state$.messages.child(r).lookup.child(e).peek().reactions.find(s=>s.emoji===t),o=this._getReactionRef(e,t);i!=null&&i.currentUserReacted?await o.remove():await o.add()}async addReaction(e,t){await this._getReactionRef(e,t).add()}triggerMessageAction(e,t,r){const i=this.store.state$.currentConversation.peek();typeof e=="string"&&(e=this.store.state$.messages.child(i.id).lookup.child(e).peek()),this.onMessageAction({action:t,params:r,message:e,conversation:i})}storeDraft(e){const t=this.store.state$.extCurrentConversationId.peek(),r=this.store.currentUser$.peek(),i=this.store.appId$.peek();t&&r&&i&&dD(t,r.id,i,e)}_getReactionRef(e,t){const r=this.store.state$.extCurrentConversationId.peek();return this.talkSession.conversation(r).message(e).reaction(t)}}const cO=n=>({type:"text",children:function(t){return Vf(t,{except:["FormattedLink","Actions"]})}(n)});function Eh(n,e){switch(e.type){case"text":case"location":return e;case"file":return function(t,r){return{type:"file",subtype:t.type==="file"?void 0:t.type,...t.metadata,size:t.file.size,filename:t.file.name,fileToken:r.fileToken,url:t.temporaryBlobUrl}}(n,e)}}function Ah(n){return Object.keys(n)}class Ca extends Error{constructor(e,t){const r=function(i){if(typeof i=="string")return i;if(Array.isArray(i))return i.join(`
1281
+ `);try{return JSON.stringify(i)}catch(o){return String(i)}}(e);super(r),this.userMessage=t!=null?t:r,Object.setPrototypeOf&&Object.setPrototypeOf(this,new.target.prototype)}}const wi=console;class dO{constructor(e,t,r,i){this.apiUrls=e,this.appId=t,this.sessionId=r,this.authProvider=i,this._lastPutPromise=Promise.resolve()}async get(e,t={}){const r=this.endpointUrl(e,t),i=await jr(()=>this.fetchWithReauth(r),{retries:11});return await this.handleResponse(i,r)}async queuedPut(e,t){await this._lastPutPromise;const r=jr(()=>this._doPut(e,t));return this._lastPutPromise=r,r}put(e,t,r){const i=()=>this._doPut(e,t);return r?gh(i,r):jr(i,{retries:5})}post(e,t,r){const i=()=>this._doPost(e,t);return r?gh(i,r):jr(i,{retries:5})}delete(e,t={}){return jr(()=>this._doDelete(e,t),{retries:11})}endpointUrl(e,t={}){const r=new URL(this.apiUrls.internalHttpApiUrl);r.pathname+=`/${this.appId}/${e}`,r.searchParams.set("sessionId",this.sessionId);for(const[i,o]of Object.entries(t))r.searchParams.set(i,o);return r}async _doPut(e,t){const r=this.endpointUrl(e),i=await this.fetchWithReauth(r,{method:"PUT",body:JSON.stringify(t)});return await this.handleResponse(i,r)}async _doPost(e,t){const r=this.endpointUrl(e),i=await this.fetchWithReauth(r,{method:"POST",body:JSON.stringify(t)});return await this.handleResponse(i,r)}async _doDelete(e,t){const r=this.endpointUrl(e,t),i=await this.fetchWithReauth(r,{method:"DELETE"});return await this.handleResponse(i,r)}async handleResponse(e,t){if(e.status>=300){if(e.status===404)throw Lo.error(`[${this.appId}][BackendRestClient] Couldn't find resource.`),new Ca("Could not find app.",`Could not find given appId: "${this.appId}". You can find your appId on https://talkjs.com/dashboard.`);if(e.status===401){const r=await this.authProvider.getToken();throw Lo.error(`[${this.appId}][BackendRestClient] Couldn't authenticate ${t} with token ${r}.`),new Ca("User not authenticated.","Could not authenticate user. Check if your signature is calculated correctly.")}if(e.status>=300&&e.status<500){const{error:r}=await e.json();throw new Ca(r)}{const r=await e.text();throw new Error(`Got non-success response (${r}) from the server for url: ${t}.`)}}return await e.json()}async fetchWithReauth(e,t){function r(s){const a={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${s}`};return fetch(e,{...t,headers:a})}const i=await this.authProvider.getToken(),o=await r(i);return o.status!==401?o:(wi.error(`401 error from ${t==null?void 0:t.method} ${e}, ${i}`),this.authProvider.refreshToken(),r(await this.authProvider.getToken()))}}function Ym(n){return!n.userMessage}function jr(n,{retries:e=30}={}){return ru(e,n,{shouldRetry:Ym,log:wi.warn.bind(wi),maxDelay:30,initialDelay:.2})}async function gh(n,e){try{return await n()}catch(r){if(!Ym(r))throw r}let t=!1;return e.then(()=>{t=!0}),ru(1e3,n,{initialDelay:.2,maxDelay:30,shouldRetry:()=>!t,log:wi.warn.bind(wi)})}var Rl={exports:{}};(function(n,e){var t="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",o="[object Function]",s="[object Object]",a=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[i]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[o]=u["[object Map]"]=u["[object Number]"]=u[s]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var c=typeof Ji=="object"&&Ji&&Ji.Object===Object&&Ji,d=typeof self=="object"&&self&&self.Object===Object&&self,h=c||d||Function("return this")(),p=e&&!e.nodeType&&e,f=p&&n&&!n.nodeType&&n,m=f&&f.exports===p,E=m&&c.process,A=function(){try{var C=f&&f.require&&f.require("util").types;return C||E&&E.binding&&E.binding("util")}catch(b){}}(),D=A&&A.isTypedArray,_,S=Array.prototype,T=Function.prototype,N=Object.prototype,I=h["__core-js_shared__"],L=T.toString,g=N.hasOwnProperty,O=(_=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+_:"",k=N.toString,w=L.call(Object),U=RegExp("^"+L.call(g).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),y=m?h.Buffer:void 0,M=h.Symbol,$=h.Uint8Array;y&&y.allocUnsafe;var j,G,V=(j=Object.getPrototypeOf,G=Object,function(C){return j(G(C))}),Y=Object.create,K=N.propertyIsEnumerable,W=S.splice,ee=M?M.toStringTag:void 0,F=function(){try{var C=_s(Object,"defineProperty");return C({},"",{}),C}catch(b){}}(),re=y?y.isBuffer:void 0,Oe=Math.max,_e=Date.now,Qe=_s(h,"Map"),ct=_s(Object,"create"),kr=function(){function C(){}return function(b){if(!pn(b))return{};if(Y)return Y(b);C.prototype=b;var P=new C;return C.prototype=void 0,P}}();function Ot(C){var b=-1,P=C==null?0:C.length;for(this.clear();++b<P;){var z=C[b];this.set(z[0],z[1])}}function Ce(C){var b=-1,P=C==null?0:C.length;for(this.clear();++b<P;){var z=C[b];this.set(z[0],z[1])}}function Ft(C){var b=-1,P=C==null?0:C.length;for(this.clear();++b<P;){var z=C[b];this.set(z[0],z[1])}}function ue(C){var b=this.__data__=new Ce(C);this.size=b.size}function $n(C,b){var P=Rs(C),z=!P&&Ts(C),q=!P&&!z&&gu(C),de=!P&&!z&&!q&&Ou(C),se=P||z||q||de,Be=se?function(Ie,xt){for(var We=-1,zn=Array(Ie);++We<Ie;)zn[We]=xt(We);return zn}(C.length,String):[],Ke=Be.length;for(var he in C)se&&(he=="length"||q&&(he=="offset"||he=="parent")||de&&(he=="buffer"||he=="byteLength"||he=="byteOffset")||Eu(he,Ke))||Be.push(he);return Be}function _t(C,b,P){(P!==void 0&&!Gi(C[b],P)||P===void 0&&!(b in C))&&Os(C,b,P)}function Jm(C,b,P){var z=C[b];g.call(C,b)&&Gi(z,P)&&(P!==void 0||b in C)||Os(C,b,P)}function zi(C,b){for(var P=C.length;P--;)if(Gi(C[P][0],b))return P;return-1}function Os(C,b,P){b=="__proto__"&&F?F(C,b,{configurable:!0,enumerable:!0,value:P,writable:!0}):C[b]=P}Ot.prototype.clear=function(){this.__data__=ct?ct(null):{},this.size=0},Ot.prototype.delete=function(C){var b=this.has(C)&&delete this.__data__[C];return this.size-=b?1:0,b},Ot.prototype.get=function(C){var b=this.__data__;if(ct){var P=b[C];return P===t?void 0:P}return g.call(b,C)?b[C]:void 0},Ot.prototype.has=function(C){var b=this.__data__;return ct?b[C]!==void 0:g.call(b,C)},Ot.prototype.set=function(C,b){var P=this.__data__;return this.size+=this.has(C)?0:1,P[C]=ct&&b===void 0?t:b,this},Ce.prototype.clear=function(){this.__data__=[],this.size=0},Ce.prototype.delete=function(C){var b=this.__data__,P=zi(b,C);return!(P<0)&&(P==b.length-1?b.pop():W.call(b,P,1),--this.size,!0)},Ce.prototype.get=function(C){var b=this.__data__,P=zi(b,C);return P<0?void 0:b[P][1]},Ce.prototype.has=function(C){return zi(this.__data__,C)>-1},Ce.prototype.set=function(C,b){var P=this.__data__,z=zi(P,C);return z<0?(++this.size,P.push([C,b])):P[z][1]=b,this},Ft.prototype.clear=function(){this.size=0,this.__data__={hash:new Ot,map:new(Qe||Ce),string:new Ot}},Ft.prototype.delete=function(C){var b=Yi(this,C).delete(C);return this.size-=b?1:0,b},Ft.prototype.get=function(C){return Yi(this,C).get(C)},Ft.prototype.has=function(C){return Yi(this,C).has(C)},Ft.prototype.set=function(C,b){var P=Yi(this,C),z=P.size;return P.set(C,b),this.size+=P.size==z?0:1,this},ue.prototype.clear=function(){this.__data__=new Ce,this.size=0},ue.prototype.delete=function(C){var b=this.__data__,P=b.delete(C);return this.size=b.size,P},ue.prototype.get=function(C){return this.__data__.get(C)},ue.prototype.has=function(C){return this.__data__.has(C)},ue.prototype.set=function(C,b){var P=this.__data__;if(P instanceof Ce){var z=P.__data__;if(!Qe||z.length<199)return z.push([C,b]),this.size=++P.size,this;P=this.__data__=new Ft(z)}return P.set(C,b),this.size=P.size,this};var qm=function(C,b,P){for(var z=-1,q=Object(C),de=P(C),se=de.length;se--;){var Be=de[++z];if(b(q[Be],Be,q)===!1)break}return C};function Vi(C){return C==null?C===void 0?"[object Undefined]":"[object Null]":ee&&ee in Object(C)?function(b){var P=g.call(b,ee),z=b[ee];try{b[ee]=void 0;var q=!0}catch(se){}var de=k.call(b);return q&&(P?b[ee]=z:delete b[ee]),de}(C):function(b){return k.call(b)}(C)}function fu(C){return wr(C)&&Vi(C)==i}function Zm(C){return!(!pn(C)||function(b){return!!O&&O in b}(C))&&(Is(C)?U:a).test(function(b){if(b!=null){try{return L.call(b)}catch(P){}try{return b+""}catch(P){}}return""}(C))}function Qm(C){if(!pn(C))return function(q){var de=[];if(q!=null)for(var se in Object(q))de.push(se);return de}(C);var b=Au(C),P=[];for(var z in C)(z!="constructor"||!b&&g.call(C,z))&&P.push(z);return P}function mu(C,b,P,z,q){C!==b&&qm(b,function(de,se){if(q||(q=new ue),pn(de))(function(Ke,he,Ie,xt,We,zn,Mr){var St=Ss(Ke,Ie),Je=Ss(he,Ie),Tu=Mr.get(Je);if(Tu)return void _t(Ke,Ie,Tu);var et=zn?zn(St,Je,Ie+"",Ke,he,Mr):void 0,Fr=et===void 0;if(Fr){var vs=Rs(Je),ys=!vs&&gu(Je),Ru=!vs&&!ys&&Ou(Je);et=Je,vs||ys||Ru?Rs(St)?et=St:wr(Cu=St)&&Cs(Cu)?et=function(Te,at){var be=-1,tt=Te.length;for(at||(at=Array(tt));++be<tt;)at[be]=Te[be];return at}(St):ys?(Fr=!1,et=Je.slice()):Ru?(Fr=!1,et=function(Te){var at=(be=Te.buffer,tt=new be.constructor(be.byteLength),new $(tt).set(new $(be)),tt),be,tt;return new Te.constructor(at,Te.byteOffset,Te.length)}(Je)):et=[]:function(Te){if(!wr(Te)||Vi(Te)!=s)return!1;var at=V(Te);if(at===null)return!0;var be=g.call(at,"constructor")&&at.constructor;return typeof be=="function"&&be instanceof be&&L.call(be)==w}(Je)||Ts(Je)?(et=St,Ts(St)?et=function(Te){return function(at,be,tt){var iE=!tt;tt||(tt={});for(var Iu=-1,oE=be.length;++Iu<oE;){var bs=be[Iu],Xi=void 0;Xi===void 0&&(Xi=at[bs]),iE?Os(tt,bs,Xi):Jm(tt,bs,Xi)}return tt}(Te,_u(Te))}(St):pn(St)&&!Is(St)||(et=function(Te){return typeof Te.constructor!="function"||Au(Te)?{}:kr(V(Te))}(Je))):Fr=!1}var Cu;Fr&&(Mr.set(Je,et),We(et,Je,xt,zn,Mr),Mr.delete(Je)),_t(Ke,Ie,et)})(C,b,se,P,mu,z,q);else{var Be=z?z(Ss(C,se),de,se+"",C,b,q):void 0;Be===void 0&&(Be=de),_t(C,se,Be)}},_u)}function eE(C,b){return nE(function(P,z,q){return z=Oe(z===void 0?P.length-1:z,0),function(){for(var de=arguments,se=-1,Be=Oe(de.length-z,0),Ke=Array(Be);++se<Be;)Ke[se]=de[z+se];se=-1;for(var he=Array(z+1);++se<z;)he[se]=de[se];return he[z]=q(Ke),function(Ie,xt,We){switch(We.length){case 0:return Ie.call(xt);case 1:return Ie.call(xt,We[0]);case 2:return Ie.call(xt,We[0],We[1]);case 3:return Ie.call(xt,We[0],We[1],We[2])}return Ie.apply(xt,We)}(P,this,he)}}(C,b,Su),C+"")}var tE=F?function(C,b){return F(C,"toString",{configurable:!0,enumerable:!1,value:(P=b,function(){return P}),writable:!0});var P}:Su;function Yi(C,b){var P,z,q=C.__data__;return((z=typeof(P=b))=="string"||z=="number"||z=="symbol"||z=="boolean"?P!=="__proto__":P===null)?q[typeof b=="string"?"string":"hash"]:q.map}function _s(C,b){var P=function(z,q){return z==null?void 0:z[q]}(C,b);return Zm(P)?P:void 0}function Eu(C,b){var P=typeof C;return!!(b=b==null?r:b)&&(P=="number"||P!="symbol"&&l.test(C))&&C>-1&&C%1==0&&C<b}function Au(C){var b=C&&C.constructor;return C===(typeof b=="function"&&b.prototype||N)}function Ss(C,b){if((b!=="constructor"||typeof C[b]!="function")&&b!="__proto__")return C[b]}var nE=function(C){var b=0,P=0;return function(){var z=_e(),q=16-(z-P);if(P=z,q>0){if(++b>=800)return arguments[0]}else b=0;return C.apply(void 0,arguments)}}(tE);function Gi(C,b){return C===b||C!=C&&b!=b}var Ts=fu(function(){return arguments}())?fu:function(C){return wr(C)&&g.call(C,"callee")&&!K.call(C,"callee")},Rs=Array.isArray;function Cs(C){return C!=null&&Du(C.length)&&!Is(C)}var gu=re||function(){return!1};function Is(C){if(!pn(C))return!1;var b=Vi(C);return b==o||b=="[object GeneratorFunction]"||b=="[object AsyncFunction]"||b=="[object Proxy]"}function Du(C){return typeof C=="number"&&C>-1&&C%1==0&&C<=r}function pn(C){var b=typeof C;return C!=null&&(b=="object"||b=="function")}function wr(C){return C!=null&&typeof C=="object"}var Ou=D?function(C){return function(b){return C(b)}}(D):function(C){return wr(C)&&Du(C.length)&&!!u[Vi(C)]};function _u(C){return Cs(C)?$n(C):Qm(C)}var Ns,rE=(Ns=function(C,b,P){mu(C,b,P)},eE(function(C,b){var P=-1,z=b.length,q=z>1?b[z-1]:void 0,de=z>2?b[2]:void 0;for(q=Ns.length>3&&typeof q=="function"?(z--,q):void 0,de&&function(Be,Ke,he){if(!pn(he))return!1;var Ie=typeof Ke;return!!(Ie=="number"?Cs(he)&&Eu(Ke,he.length):Ie=="string"&&Ke in he)&&Gi(he[Ke],Be)}(b[0],b[1],de)&&(q=z<3?void 0:q,z=1),C=Object(C);++P<z;){var se=b[P];se&&Ns(C,se,P,q)}return C}));function Su(C){return C}n.exports=rE})(Rl,Rl.exports);const hO=ME(Rl.exports);class pO{constructor(e,t,r,i){this.backendRestClient=new dO(e,t,r,i)}async getApp(e){return function(t){const r=function(s,a){const l={general:{enableFileTransfers:a.includes("file_sharing"),enableLocation:a.includes("location_sharing"),enableMentions:!1,showTypingIndicators:!0,enablePresence:!1,enableVoiceRecording:!1},theme:{version:"v2",name:"default"},permissions:{messages:{delete:"own",edit:"own",reply:"all",emojiReactions:"all"},messagesCustom:{},conversations:{leave:"none",markAsUnread:"none"},conversationsCustom:{}},generalNotificationSettings:{timeout:"15"},emailSettings:{enabled:!0,subject:"{{sender.name}} wants to chat with you on {{app.name}}",replySeparator:"--- Write ABOVE THIS LINE to post a reply via email ---",unsubscribeText:"Unsubscribe from all chat emails",senderName:"{{sender.name}} (via {{app.name}})",header:`Hi {{recipient.name}},
1282
1282
  {{sender.name}} wants to chat with you on {{app.name}}:`,includeMessages:!0,inboxUrl:"{{app.custom.websiteUrl}}",inboxLinkText:"Join the chat",footer:`On behalf of {{sender.name}},
1283
1283
  The {{app.name}} team`,enableReplyToEmail:a.includes("reply_via_email"),emailThemeType:a.includes("email_templates")?"custom":"standard",emailTheme:"default_email",emailAttachmentMode:"enabledExcludingImages",htmlTemplate:`<div>
1284
1284
  Hi {{recipient.name}}, <br/>
@@ -1302,10 +1302,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1302
1302
  {{app.custom.websiteUrl}} Join the chat
1303
1303
 
1304
1304
  On behalf of {{sender.name}},
1305
- The {{app.name}} team`},smsSettings:{enabled:a.includes("sms_notifications"),smsTemplate:'({{app.name}}) {{sender.name}}: "{{messages}}". Reply here: {{app.custom.websiteUrl}}',maximumSegments:"1",enableAutoOptOutText:!1,optOutText:"To stop receiving these messages, reply STOP."},suppressContactInfo:JSON.stringify({mode:"off",suppressLinks:!0,suppressEmailAddresses:!0,suppressPhoneNumbers:!0}),sameTabLinkRules:[]};return hO(l,s)}(t.configuration,t.features),i=JSON.parse(r.suppressContactInfo),o={...r,suppressContactInfo:new sm(i)};return{appMetadata:{...t.appMetadata,id:t.appMetadata.id},features:t.features,role:o}}(await this.backendRestClient.get("/app",{role_name:e}))}async checkIfAppExists(){return this.backendRestClient.get("/app").then(()=>!0).catch(e=>{if(e.message==="Could not find app.")return!1;throw e})}}class ir{constructor(e,t,r){this.realtimeWsApiUrl=e,this.internalHttpApiUrl=t,this.restApiHttpUrl=r}getBokensUrl(e,t,r){return this.internalHttpApiUrl+`/${e}/bokens/${encodeURIComponent(t)}?signature=${encodeURIComponent(r!=null?r:"")}`}getRealtimeWsUrl(e,t,r,i,o){const s=encodeURIComponent(t);return this.realtimeWsApiUrl+`/${e}/realtime/${s}?talkjs-client-build=${o!=null?o:"standalone"}&talkjs-core=${r}&talkjs-client-id=${i}`}static fromHost(e){var r;const t=new ir("wss://realtime.talkjs.com/v1","https://app.talkjs.com/api/v0","https://api.talkjs.com/v1");if(!e)return t;if(e==="@currentHost"){if(typeof location=="undefined")throw new Error("You can only use @currentHost in a browser.");e=((r=window.top)!=null?r:window).location.host}if(e.endsWith("talkjs.com")){const i=e.match(/^(?:\w+-)?([^.]+)\.talkjs\.com$/);if(i){const o=i[1];return["app","cdn","api","realtime"].includes(o)?t:new ir(`wss://realtime-${o}.talkjs.com/v1`,`https://app-${o}.talkjs.com/api/v0`,`https://api-${o}.talkjs.com/v1`)}return t}return e.includes("localhost")||e.includes("localtest.me")||/^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e)?new ir(`ws://${e}/public_api/v1`,`http://${e}/api/v0`,`http://${e}/public_api/v1`):new ir(`wss://${e}/public_api/v1`,`https://${e}/api/v0`,`https://${e}/public_api/v1`)}}function Gm(n,e){const t=e.appId,r=e.userId,i="conversationId"in e?e.conversationId:void 0,o=T.useMemo(()=>ir.fromHost(e.host),[e.host]),s=T.useRef(void 0),a=T.useMemo(()=>{const d=s.current,h=typeof d!=typeof e.tokenFetcher?e.tokenFetcher:d;return s.current=h,h},[e.tokenFetcher]);T.useLayoutEffect(()=>{n.updateThemeCustom(e.themeCustom)},[n,e.themeCustom]);const l=T.useMemo(()=>Vm(),[e.appId,e.userId,e.token,a]),u=sE.getTalkSession({apiUrls:o,appId:t,userId:r,token:e.token,tokenFetcher:a});T.useEffect(()=>n.listenForErrors(u,i),[u,n,i]);const c=T.useMemo(()=>new pO(o,t,l,u._authProvider),[t,l,u,o]);return T.useEffect(()=>n.listenForAuthChanges(u,a),[u,n,a]),T.useEffect(()=>n.listenForUserAndAppChanges(u,c),[n,c,u]),{session:u,restApi:c}}function si(n,e,t){const r=T.useRef(n),i=T.useRef(t);return T.useLayoutEffect(()=>{r.current=n,i.current=t}),T.useCallback(o=>{r.current&&r.current(o),(e==null?void 0:e.tagName)!=="T-CHATBOX"&&(e==null?void 0:e.tagName)!=="T-CONVERSATION-LIST"||function(s,a,l){for(const u of l){const c=new Event(u);Object.assign(c,a),s.dispatchEvent(c)}}(e,o,i.current)},[e])}function Xm(n){T.useEffect(()=>{const e=window,t=n.current;if(e.cordova&&t){const r=i=>{i.target instanceof HTMLAnchorElement&&(i.preventDefault(),function(o){const s=window;s.cordova.InAppBrowser?s.cordova.InAppBrowser.open(o,"_system"):window.open(o,"_system","location=yes")}(i.target.href))};return t.addEventListener("click",r),()=>t.removeEventListener("click",r)}},[n])}function Km(){const[n,e]=T.useState(!0);return T.useEffect(()=>{e(!1)},[]),n}const fO=T.forwardRef(function(n,e){var I,L;const{onSendMessage:t,onDeleteMessage:r,onMessageAction:i,beforeBrowserPermissionPrompt:o,onMissingBrowserPermission:s,messageFieldPlaceholder:a,messageFieldSpellcheck:l,__hostElement:u}=n;T.useEffect(()=>{var g;(g=n.__internalOnLoaded)==null||g.call(n)},[]);const c=Km(),d=T.useRef(u!=null?u:null);Xm(d);const h=si(r,u,["deleteMessage","delete-message","deletemessage","DeleteMessage"]),p=si(t,u,["sendMessage","send-message","sendmessage","SendMessage"]),f=si(i,u,["messageAction","message-action","messageaction","MessageAction"]),m={beforeBrowserPermissionPrompt:o,onMissingBrowserPermissionCallback:si(s,u,["browserPermissionDenied","browser-permission-denied","browserpermissiondenied","BrowserPermissionDenied"])},{store:E,controller:A,editorInternals:D,session:_}=function(g,O,k,w){const U=g.conversationId,y=T.useMemo(()=>new Ap(g.appId,g.userId),[]),{session:M,restApi:$}=Gm(y,g),j=T.useMemo(()=>new Wf(y.state$.editor,y.device$,y.state$.userPermissions),[y]),G=T.useMemo(()=>new uO(y,M,j,O,k,w),[M,y,j,O,k,w]);return j.controller=G,T.useEffect(()=>{let V,Y=!0;const K=M.currentUser.subscribe(async W=>{if(Y&&(y.errors$.unknownUser.set(!W),W&&(y.currentUser$.set(W),W.role!==V))){V=W.role;const ee=await $.getApp(W.role);if(!Y)return;y.app$.set(ee)}});return()=>{Y=!1,K.unsubscribe()}},[$,M,y]),T.useEffect(()=>{let V=!0;mr(()=>{y.state$.extCurrentConversationId.set(U),y.state$.currentConversation.set(null),y.state$.referencedMessageId.set(null)});const Y=M.conversation(U).subscribeMessages(async(re,Oe)=>{V&&re&&(await y.readyForNewMessagesPromise,y.storeMessages(U,re,Oe))});y.messageSubscription=Y;const K=M.conversation(U).subscribeParticipants(re=>{V&&re&&y.state$.participants.child(U).set(re)});y.participantSubscription=K;const W=M.conversation(U).subscribe(async re=>{V&&re&&y.state$.currentConversation.set(re)}),ee=M.conversation(U).subscribeTyping(re=>{V&&re&&y.storeTyping(U,re)}),F=y.state$.participants.child(U).onChange(({value:re})=>{if(!re)return;const Oe=new Set;for(const _e of re)Oe.add(_e.user.id);mr(()=>{var _e;for(const Qe of Eh(y.onlineSubscriptions))Oe.has(Qe)||((_e=y.onlineSubscriptions[Qe])==null||_e.unsubscribe(),delete y.onlineSubscriptions[Qe],y.state$.isUserConnected.child(Qe).set(!1))});for(const _e of Oe)y.onlineSubscriptions[_e]||(y.onlineSubscriptions[_e]=M.user(_e).subscribeOnline(Qe=>{Qe&&y.state$.isUserConnected.child(_e).set(Qe.isConnected)}))},{initial:!0});return()=>{V=!1,K.unsubscribe(),W.unsubscribe(),Y.unsubscribe(),ee.unsubscribe(),y.messageSubscription=null,y.participantSubscription=null,F();for(const re of Eh(y.onlineSubscriptions))y.onlineSubscriptions[re].unsubscribe();y.onlineSubscriptions={},y.state$.isUserConnected.set({})}},[y,U,M]),{store:y,controller:G,editorInternals:j,session:M}}(n,p,h,f),S=T.useCallback(async()=>{const g=D.state$;if(g.isEmpty.peek()||g.atTextLimit.peek())return;const O=D.getText(),k=E.state$.referencedMessageId.peek();k&&A.setReferencedMessage(null),D.clearText(),E.state$.editor.showEmojiPicker.set(!1),await A.sendMessage({text:O,referencedMessage:k!=null?k:void 0})},[A,D,E]);T.useEffect(()=>{var O;const g=(O=n.enterSendsMessage)!=null?O:!0;D.onEnter=g?S:void 0},[D,n.enterSendsMessage,S]),T.useEffect(()=>{D.spellcheck$.set(l)},[D,l]),T.useEffect(()=>{D.placeholder$.set(a)},[D,a]),T.useImperativeHandle(e,()=>({controller:A,editorInternals:D}));const R=T.useCallback(({error:g})=>N.jsx(As,{appId:n.appId,chatboxState:{type:"unexpected-error",error:g}}),[n.appId]),v=c?null:N.jsx(Wh,{fallbackRender:R,children:N.jsx(tp.Provider,{value:D,children:N.jsx(ip.Provider,{value:E,children:N.jsx(ep.Provider,{value:n.theme,children:N.jsx(np.Provider,{value:m,children:N.jsx(op.Provider,{value:A,children:N.jsx(rp.Provider,{value:_,children:N.jsx(WE.Provider,{value:{sendMessage:S},children:N.jsx(aO,{appId:n.appId,chatHeaderVisible:(I=n.chatHeaderVisible)!=null?I:!0,messageFieldVisible:(L=n.messageFieldVisible)!=null?L:!0})})})})})})})})});if(u)return v;{const g="t-chatbox"+(n.className?` ${n.className}`:"");return N.jsx("div",{className:g,style:n.style,ref:d,children:v})}});(function(n="Twemoji Country Flags",e="https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2"){if(typeof window<"u"&&$u("😊")&&!$u("🇨🇭")){const t=document.createElement("style");return t.textContent=`@font-face {
1305
+ The {{app.name}} team`},smsSettings:{enabled:a.includes("sms_notifications"),smsTemplate:'({{app.name}}) {{sender.name}}: "{{messages}}". Reply here: {{app.custom.websiteUrl}}',maximumSegments:"1",enableAutoOptOutText:!1,optOutText:"To stop receiving these messages, reply STOP."},suppressContactInfo:JSON.stringify({mode:"off",suppressLinks:!0,suppressEmailAddresses:!0,suppressPhoneNumbers:!0}),sameTabLinkRules:[]};return hO(l,s)}(t.configuration,t.features),i=JSON.parse(r.suppressContactInfo),o={...r,suppressContactInfo:new sm(i)};return{appMetadata:{...t.appMetadata,id:t.appMetadata.id},features:t.features,role:o}}(await this.backendRestClient.get("/app",{role_name:e}))}async checkIfAppExists(){return this.backendRestClient.get("/app").then(()=>!0).catch(e=>{if(e.message==="Could not find app.")return!1;throw e})}}class ir{constructor(e,t,r){this.realtimeWsApiUrl=e,this.internalHttpApiUrl=t,this.restApiHttpUrl=r}getBokensUrl(e,t,r){return this.internalHttpApiUrl+`/${e}/bokens/${encodeURIComponent(t)}?signature=${encodeURIComponent(r!=null?r:"")}`}getRealtimeWsUrl(e,t,r,i,o){const s=encodeURIComponent(t);return this.realtimeWsApiUrl+`/${e}/realtime/${s}?talkjs-client-build=${o!=null?o:"standalone"}&talkjs-core=${r}&talkjs-client-id=${i}`}static fromHost(e){var r;const t=new ir("wss://realtime.talkjs.com/v1","https://app.talkjs.com/api/v0","https://api.talkjs.com/v1");if(!e)return t;if(e==="@currentHost"){if(typeof location=="undefined")throw new Error("You can only use @currentHost in a browser.");e=((r=window.top)!=null?r:window).location.host}if(e.endsWith("talkjs.com")){const i=e.match(/^(?:\w+-)?([^.]+)\.talkjs\.com$/);if(i){const o=i[1];return["app","cdn","api","realtime"].includes(o)?t:new ir(`wss://realtime-${o}.talkjs.com/v1`,`https://app-${o}.talkjs.com/api/v0`,`https://api-${o}.talkjs.com/v1`)}return t}return e.includes("localhost")||e.includes("localtest.me")||/^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e)?new ir(`ws://${e}/public_api/v1`,`http://${e}/api/v0`,`http://${e}/public_api/v1`):new ir(`wss://${e}/public_api/v1`,`https://${e}/api/v0`,`https://${e}/public_api/v1`)}}function Gm(n,e){const t=e.appId,r=e.userId,i="conversationId"in e?e.conversationId:void 0,o=R.useMemo(()=>ir.fromHost(e.host),[e.host]),s=R.useRef(void 0),a=R.useMemo(()=>{const d=s.current,h=typeof d!=typeof e.tokenFetcher?e.tokenFetcher:d;return s.current=h,h},[e.tokenFetcher]);R.useLayoutEffect(()=>{n.updateThemeCustom(e.themeCustom)},[n,e.themeCustom]);const l=R.useMemo(()=>Vm(),[e.appId,e.userId,e.token,a]),u=sE.getTalkSession({apiUrls:o,appId:t,userId:r,token:e.token,tokenFetcher:a});R.useEffect(()=>n.listenForErrors(u,i),[u,n,i]);const c=R.useMemo(()=>new pO(o,t,l,u._authProvider),[t,l,u,o]);return R.useEffect(()=>n.listenForAuthChanges(u,a),[u,n,a]),R.useEffect(()=>n.listenForUserAndAppChanges(u,c),[n,c,u]),{session:u,restApi:c}}function si(n,e,t){const r=R.useRef(n),i=R.useRef(t);return R.useLayoutEffect(()=>{r.current=n,i.current=t}),R.useCallback(o=>{r.current&&r.current(o),(e==null?void 0:e.tagName)!=="T-CHATBOX"&&(e==null?void 0:e.tagName)!=="T-CONVERSATION-LIST"||function(s,a,l){for(const u of l){const c=new Event(u);Object.assign(c,a),s.dispatchEvent(c)}}(e,o,i.current)},[e])}function Xm(n){R.useEffect(()=>{const e=window,t=n.current;if(e.cordova&&t){const r=i=>{i.target instanceof HTMLAnchorElement&&(i.preventDefault(),function(o){const s=window;s.cordova.InAppBrowser?s.cordova.InAppBrowser.open(o,"_system"):window.open(o,"_system","location=yes")}(i.target.href))};return t.addEventListener("click",r),()=>t.removeEventListener("click",r)}},[n])}function Km(){const[n,e]=R.useState(!0);return R.useEffect(()=>{e(!1)},[]),n}const fO=R.forwardRef(function(n,e){var I,L;const{onSendMessage:t,onDeleteMessage:r,onMessageAction:i,beforeBrowserPermissionPrompt:o,onMissingBrowserPermission:s,messageFieldPlaceholder:a,messageFieldSpellcheck:l,__hostElement:u}=n;R.useEffect(()=>{var g;(g=n.__internalOnLoaded)==null||g.call(n)},[]);const c=Km(),d=R.useRef(u!=null?u:null);Xm(d);const h=si(r,u,["deleteMessage","delete-message","deletemessage","DeleteMessage"]),p=si(t,u,["sendMessage","send-message","sendmessage","SendMessage"]),f=si(i,u,["messageAction","message-action","messageaction","MessageAction"]),m={beforeBrowserPermissionPrompt:o,onMissingBrowserPermissionCallback:si(s,u,["browserPermissionDenied","browser-permission-denied","browserpermissiondenied","BrowserPermissionDenied"])},{store:E,controller:A,editorInternals:D,session:_}=function(g,O,k,w){const U=g.conversationId,y=R.useMemo(()=>new Ap(g.appId,g.userId),[]),{session:M,restApi:$}=Gm(y,g),j=R.useMemo(()=>new Wf(y.state$.editor,y.device$,y.state$.userPermissions),[y]),G=R.useMemo(()=>new uO(y,M,j,O,k,w),[M,y,j,O,k,w]);return j.controller=G,R.useEffect(()=>{let V,Y=!0;const K=M.currentUser.subscribe(async W=>{if(Y&&(y.errors$.unknownUser.set(!W),W&&(y.currentUser$.set(W),W.role!==V))){V=W.role;const ee=await $.getApp(W.role);if(!Y)return;y.app$.set(ee)}});return()=>{Y=!1,K.unsubscribe()}},[$,M,y]),R.useEffect(()=>{let V=!0;mr(()=>{y.state$.extCurrentConversationId.set(U),y.state$.currentConversation.set(null),y.state$.referencedMessageId.set(null)});const Y=M.conversation(U).subscribeMessages(async(re,Oe)=>{V&&re&&(await y.readyForNewMessagesPromise,y.storeMessages(U,re,Oe))});y.messageSubscription=Y;const K=M.conversation(U).subscribeParticipants(re=>{V&&re&&y.state$.participants.child(U).set(re)});y.participantSubscription=K;const W=M.conversation(U).subscribe(async re=>{V&&re&&y.state$.currentConversation.set(re)}),ee=M.conversation(U).subscribeTyping(re=>{V&&re&&y.storeTyping(U,re)}),F=y.state$.participants.child(U).onChange(({value:re})=>{if(!re)return;const Oe=new Set;for(const _e of re)Oe.add(_e.user.id);mr(()=>{var _e;for(const Qe of Ah(y.onlineSubscriptions))Oe.has(Qe)||((_e=y.onlineSubscriptions[Qe])==null||_e.unsubscribe(),delete y.onlineSubscriptions[Qe],y.state$.isUserConnected.child(Qe).set(!1))});for(const _e of Oe)y.onlineSubscriptions[_e]||(y.onlineSubscriptions[_e]=M.user(_e).subscribeOnline(Qe=>{Qe&&y.state$.isUserConnected.child(_e).set(Qe.isConnected)}))},{initial:!0});return()=>{V=!1,K.unsubscribe(),W.unsubscribe(),Y.unsubscribe(),ee.unsubscribe(),y.messageSubscription=null,y.participantSubscription=null,F();for(const re of Ah(y.onlineSubscriptions))y.onlineSubscriptions[re].unsubscribe();y.onlineSubscriptions={},y.state$.isUserConnected.set({})}},[y,U,M]),{store:y,controller:G,editorInternals:j,session:M}}(n,p,h,f),S=R.useCallback(async()=>{const g=D.state$;if(g.isEmpty.peek()||g.atTextLimit.peek())return;const O=D.getText(),k=E.state$.referencedMessageId.peek();k&&A.setReferencedMessage(null),D.clearText(),E.state$.editor.showEmojiPicker.set(!1),await A.sendMessage({text:O,referencedMessage:k!=null?k:void 0})},[A,D,E]);R.useEffect(()=>{var O;const g=(O=n.enterSendsMessage)!=null?O:!0;D.onEnter=g?S:void 0},[D,n.enterSendsMessage,S]),R.useEffect(()=>{D.spellcheck$.set(l)},[D,l]),R.useEffect(()=>{D.placeholder$.set(a)},[D,a]),R.useImperativeHandle(e,()=>({controller:A,editorInternals:D}));const T=R.useCallback(({error:g})=>v.jsx(As,{appId:n.appId,chatboxState:{type:"unexpected-error",error:g}}),[n.appId]),N=c?null:v.jsx(Jh,{fallbackRender:T,children:v.jsx(np.Provider,{value:D,children:v.jsx(ip.Provider,{value:E,children:v.jsx(tp.Provider,{value:n.theme,children:v.jsx(rp.Provider,{value:m,children:v.jsx(op.Provider,{value:A,children:v.jsx(Ml.Provider,{value:_,children:v.jsx(WE.Provider,{value:{sendMessage:S},children:v.jsx(aO,{appId:n.appId,chatHeaderVisible:(I=n.chatHeaderVisible)!=null?I:!0,messageFieldVisible:(L=n.messageFieldVisible)!=null?L:!0})})})})})})})})});if(u)return N;{const g="t-chatbox"+(n.className?` ${n.className}`:"");return v.jsx("div",{className:g,style:n.style,ref:d,children:N})}});(function(n="Twemoji Country Flags",e="https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2"){if(typeof window<"u"&&zu("😊")&&!zu("🇨🇭")){const t=document.createElement("style");return t.textContent=`@font-face {
1306
1306
  font-family: "${n}";
1307
1307
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067,
1308
1308
  U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
1309
1309
  src: url('${e}') format('woff2');
1310
1310
  font-display: swap;
1311
- }`,document.head.appendChild(t),!0}})(),kl(),function({observableFunctions:n,observableProperties:e,jsonReplacer:t,jsonReviver:r}){if(n)for(const i in n){const o=n[i];IE.set(i,o),Hu.prototype[i]=function(...s){return o.call(this,this._node,...s)}}if(e)for(const i in e){const o=e[i];CE.set(i,o),Object.defineProperty(Hu.prototype,i,{configurable:!0,get(){return o.get.call(this,this._node)},set(s){return o.set.call(this,this._node,s)}})}t&&(Bu.replacer=t),r&&(Bu.reviver=r)}({observableFunctions:{child:(n,e)=>(le(typeof e=="string"||typeof e=="number","Key should be a string or a number"),ls.getProxy(n,e.toString()))}}),zt.registerHandler(({level:n,data:e})=>{console[n]("[TalkJS]",...e)});const mO=T.forwardRef(function(n,e){const t=T.useRef(null),r=T.useMemo(()=>new EO(t),[]);T.useImperativeHandle(e,()=>r,[r]);const{theme:i,...o}=n,s=T.useMemo(()=>({...wl,...i!=null?i:{}}),[i]),a=`${n.userId}|${n.appId}`;return N.jsx(sp.Provider,{value:r,children:T.createElement(fO,{...o,key:a,theme:s,ref:t})})});var pr,Ue,Ht,Co;class EO{constructor(e){xr(this,Ue);xr(this,pr);Ls(this,pr,e)}deleteMessage(e){return Le(this,Ue,Ht).deleteMessage(e)}setEditing(e){Le(this,Ue,Ht).setEditing(e)}editMessage(e,t){return Le(this,Ue,Ht).editMessage(e,t)}sendMessage(e){return Le(this,Ue,Ht).sendMessage(e)}sendFileMessage(e){return Le(this,Ue,Ht).sendFileMessage(e)}sendLocationMessage(e){return Le(this,Ue,Ht).sendLocationMessage(e)}setReferencedMessage(e){Le(this,Ue,Ht).setReferencedMessage(e)}toggleReaction(e,t){return Le(this,Ue,Ht).toggleReaction(e,t)}getMessageFieldText(){return Le(this,Ue,Co).getText()}setMessageFieldText(e){Le(this,Ue,Co).setText(e)}focusMessageField(){Le(this,Ue,Co).focus()}}pr=new WeakMap,Ue=new WeakSet,Ht=function(){return Le(this,pr).current.controller},Co=function(){return Le(this,pr).current.editorInternals};function AO({conversation:n}){const e=ie(),t=Pi(),r=Dt(),i=Jf(),o=Z(e.extCurrentConversationId$),[s,a]=T.useState([]);return T.useEffect(()=>{const l=t.conversation(n.id).subscribeParticipants(async u=>{u&&a(u)});return()=>l.unsubscribe()},[t,n.id]),s?N.jsx(r.ConversationListItem,{common:i,conversation:n,participants:s,isSelected:o===n.id}):null}function gO(){const n=ie(),e=T.useRef(null);T.useEffect(()=>{let r=!0;const i=e.current;return async function(){var s;let o=0;for(;r&&n.conversationListSubscription&&i.scrollHeight===i.clientHeight&&o<2;)await((s=n.conversationListSubscription)==null?void 0:s.loadMore(20)),o+=1}(),()=>{r=!1}},[n]);const t=T.useCallback(r=>{const i=r.currentTarget;i.scrollHeight-i.clientHeight-i.scrollTop<15&&n.conversationListSubscription&&n.conversationListSubscription.loadMore(20)},[n]);return N.jsx("div",{className:"t-conversation-list-scrollable",ref:e,"t-menu-boundary":"",onScroll:t,children:N.jsx(wa,{each:n.conversationsArray$,children:r=>N.jsx(AO,{conversation:r.get()})})})}function DO({appId:n}){ie();const e=function(){const t=ie(),r=ft(()=>{const s=t.currentUser$.get(),a=t.app$.get(),l=t.errors$.get(),u=t.authTokenState$.get();return l.serverError?"server-error":l.wrongAppId?"wrong-app-id":u==="loading"||u==="idle"?"loading-token":u==="invalid"?"invalid-token":u==="expired"?"expired-token":u==="valid"?l.unknownUser?"unknown-user":s&&a?"loaded":"loading-data":void le.unreachable()}),i=ft({type:"loading"});Or(s=>{const a=r.get(),l=t.extUserId$.peek(),u=t.appId$.peek();switch(a){case"invalid-token":i.set({type:"auth-failed"});break;case"expired-token":i.set({type:"expired-token"});break;case"wrong-app-id":i.set({type:"wrong-app-id",appId:u});break;case"server-error":i.set({type:"server-error"});break;case"loading-data":case"loading-token":i.set({type:"loading"});break;case"loaded":i.set({type:"loaded",currentUser:t.currentUser$.peek()});break;case"unknown-user":s.onCleanup=function(c){i.set({type:"loading"});const d=setTimeout(()=>{i.set(c)},5e3);return()=>clearTimeout(d)}({type:"unknown-user",userId:l});break;default:le.never(a)}});const o=ft({type:"loading"});return Or(s=>{if(i.type.get()==="loading"){o.set({type:"invisible-loading"});const a=setTimeout(()=>{o.set({type:"loading"})},1e3);s.onCleanup=()=>{clearTimeout(a)}}else o.set(i.get())}),Z(o)}();return e.type==="invisible-loading"?N.jsx(N.Fragment,{}):e.type==="loading"?N.jsx(Qf,{}):e.type==="unknown-user"||e.type==="auth-failed"||e.type==="wrong-app-id"||e.type==="server-error"||e.type==="unexpected-error"?N.jsx(As,{appId:n,chatboxState:e}):e.type=="expired-token"?N.jsx(em,{}):e.type==="loaded"?N.jsx(gO,{}):N.jsx(N.Fragment,{})}class OO extends fp{constructor(){super(...arguments),this.type="ConversationListStore",this.conversationListSubscription=null,this.extCurrentConversationId$=pe(null),this.conversationsArray$=pe([]),this.conversationsMap$=pe({})}listenForConversations(e){const t=e.subscribeConversations(r=>{mr(()=>{this.conversationsArray$.set(r);const i={};for(const o of r)i[o.id]=o;this.conversationsMap$.set(i)})});return this.conversationListSubscription=t,()=>{t.unsubscribe(),this.conversationListSubscription=null}}}class _O{constructor(e,t){this.store=e,this.onSelectConversation=t}selectConversation(e){if(e===this.store.extCurrentConversationId$.peek())return;this.store.extCurrentConversationId$.set(e);const t={currentUser:this.store.currentUser$.peek(),conversation:this.store.conversationsMap$.child(e).peek()};this.onSelectConversation(t)}}const SO=T.forwardRef(function(n,e){const{__hostElement:t,onSelectConversation:r}=n;T.useEffect(()=>{var h;(h=n.__internalOnLoaded)==null||h.call(n)},[]);const i=Km(),o=T.useRef(t!=null?t:null);Xm(o);const s=si(r,t,["selectConversation","select-conversation","selectconversation","SelectConversation"]),a=T.useMemo(()=>new OO(n.appId,n.userId),[]);T.useEffect(()=>{mr(()=>{a.extUserId$.set(n.userId),a.appId$.set(n.appId)})},[a,n.appId,n.userId]);const{session:l}=Gm(a,n),u=T.useMemo(()=>new _O(a,s),[a,s]);T.useEffect(()=>a.listenForConversations(l),[a,l]),T.useEffect(()=>{n.selectedConversationId!==void 0&&a.extCurrentConversationId$.set(n.selectedConversationId)},[a,n.selectedConversationId]),T.useEffect(()=>{const h=n.__hostElement;if(h)return a.extCurrentConversationId$.onChange(({value:p})=>{h.selectedConversationId=p})},[a,n.__hostElement]),T.useImperativeHandle(e,()=>({controller:u}));const c=T.useCallback(({error:h})=>N.jsx(As,{appId:n.appId,chatboxState:{type:"unexpected-error",error:h}}),[n.appId]),d=i?null:N.jsx(Wh,{fallbackRender:c,children:N.jsx(ip.Provider,{value:a,children:N.jsx(ep.Provider,{value:n.theme,children:N.jsx(op.Provider,{value:u,children:N.jsx(rp.Provider,{value:l,children:N.jsx(DO,{appId:n.appId})})})})})});if(t)return d;{const h="t-conversation-list"+(n.className?` ${n.className}`:"");return N.jsx("div",{className:h,style:n.style,ref:o,children:d})}});var Mi,ns,Wm;class TO{constructor(e){xr(this,ns);xr(this,Mi);Ls(this,Mi,e)}selectConversation(e){Le(this,ns,Wm).selectConversation(e)}}Mi=new WeakMap,ns=new WeakSet,Wm=function(){return Le(this,Mi).current.controller};const RO=T.forwardRef(function(n,e){const t=T.useRef(null),r=T.useMemo(()=>new TO(t),[]);T.useImperativeHandle(e,()=>r,[r]);const{theme:i,...o}=n,s=T.useMemo(()=>({...wl,...i!=null?i:{}}),[i]),a=`${n.userId}|${n.appId}`;return N.jsx(sp.Provider,{value:r,children:T.createElement(SO,{...o,key:a,theme:s,ref:t})})}),CO=wl;exports.AudioPlayer=Vo,exports.Chatbox=mO,exports.ConversationList=RO,exports.Editor=Kf,exports.EmojiPicker=ou,exports.EmojiSuggestBar=Am,exports.MentionSuggestList=Hm,exports.MenuItem=en,exports.MessageContent=am,exports.PopoverButton=rr,exports.ReactionPicker=um,exports.Text=iu,exports.defaultTheme=CO,exports.formatDuration=hu,exports.formatFilesize=oi,exports.getGoogleMapsUrls=du,exports.getPhotoUrlWithFallback=_n,exports.getRandomColor=Um,exports.html=x,exports.useTimeAgo=jm,exports.userFriendlyDate=$m;
1311
+ }`,document.head.appendChild(t),!0}})(),kl(),function({observableFunctions:n,observableProperties:e,jsonReplacer:t,jsonReviver:r}){if(n)for(const i in n){const o=n[i];IE.set(i,o),Uu.prototype[i]=function(...s){return o.call(this,this._node,...s)}}if(e)for(const i in e){const o=e[i];CE.set(i,o),Object.defineProperty(Uu.prototype,i,{configurable:!0,get(){return o.get.call(this,this._node)},set(s){return o.set.call(this,this._node,s)}})}t&&(Hu.replacer=t),r&&(Hu.reviver=r)}({observableFunctions:{child:(n,e)=>(le(typeof e=="string"||typeof e=="number","Key should be a string or a number"),ls.getProxy(n,e.toString()))}}),zt.registerHandler(({level:n,data:e})=>{console[n]("[TalkJS]",...e)});const mO=R.forwardRef(function(n,e){const t=R.useRef(null),r=R.useMemo(()=>new EO(t),[]);R.useImperativeHandle(e,()=>r,[r]);const{theme:i,...o}=n,s=R.useMemo(()=>({...wl,...i!=null?i:{}}),[i]),a=`${n.userId}|${n.appId}`;return v.jsx(sp.Provider,{value:r,children:R.createElement(fO,{...o,key:a,theme:s,ref:t})})});var pr,Ue,Ht,Co;class EO{constructor(e){xr(this,Ue);xr(this,pr);Ls(this,pr,e)}deleteMessage(e){return Le(this,Ue,Ht).deleteMessage(e)}setEditing(e){Le(this,Ue,Ht).setEditing(e)}editMessage(e,t){return Le(this,Ue,Ht).editMessage(e,t)}sendMessage(e){return Le(this,Ue,Ht).sendMessage(e)}sendFileMessage(e){return Le(this,Ue,Ht).sendFileMessage(e)}sendLocationMessage(e){return Le(this,Ue,Ht).sendLocationMessage(e)}setReferencedMessage(e){Le(this,Ue,Ht).setReferencedMessage(e)}toggleReaction(e,t){return Le(this,Ue,Ht).toggleReaction(e,t)}getMessageFieldText(){return Le(this,Ue,Co).getText()}setMessageFieldText(e){Le(this,Ue,Co).setText(e)}focusMessageField(){Le(this,Ue,Co).focus()}}pr=new WeakMap,Ue=new WeakSet,Ht=function(){return Le(this,pr).current.controller},Co=function(){return Le(this,pr).current.editorInternals};function AO({conversation:n}){const e=ie(),t=Pi(),r=Dt(),i=Jf(),o=Z(e.extCurrentConversationId$),[s,a]=R.useState([]);return R.useEffect(()=>{const l=t.conversation(n.id).subscribeParticipants(async u=>{u&&a(u)});return()=>l.unsubscribe()},[t,n.id]),s?v.jsx(r.ConversationListItem,{common:i,conversation:n,participants:s,isSelected:o===n.id}):null}function gO(){const n=ie(),e=R.useRef(null);R.useEffect(()=>{let r=!0;const i=e.current;return async function(){var s;let o=0;for(;r&&n.conversationListSubscription&&i.scrollHeight===i.clientHeight&&o<2;)await((s=n.conversationListSubscription)==null?void 0:s.loadMore(20)),o+=1}(),()=>{r=!1}},[n]);const t=R.useCallback(r=>{const i=r.currentTarget;i.scrollHeight-i.clientHeight-i.scrollTop<15&&n.conversationListSubscription&&n.conversationListSubscription.loadMore(20)},[n]);return v.jsx("div",{className:"t-conversation-list-scrollable",ref:e,"t-menu-boundary":"",onScroll:t,children:v.jsx(wa,{each:n.conversationsArray$,children:r=>v.jsx(AO,{conversation:r.get()})})})}function DO({appId:n}){ie();const e=function(){const t=ie(),r=ft(()=>{const s=t.currentUser$.get(),a=t.app$.get(),l=t.errors$.get(),u=t.authTokenState$.get();return l.serverError?"server-error":l.wrongAppId?"wrong-app-id":u==="loading"||u==="idle"?"loading-token":u==="invalid"?"invalid-token":u==="expired"?"expired-token":u==="valid"?l.unknownUser?"unknown-user":s&&a?"loaded":"loading-data":void le.unreachable()}),i=ft({type:"loading"});Or(s=>{const a=r.get(),l=t.extUserId$.peek(),u=t.appId$.peek();switch(a){case"invalid-token":i.set({type:"auth-failed"});break;case"expired-token":i.set({type:"expired-token"});break;case"wrong-app-id":i.set({type:"wrong-app-id",appId:u});break;case"server-error":i.set({type:"server-error"});break;case"loading-data":case"loading-token":i.set({type:"loading"});break;case"loaded":i.set({type:"loaded",currentUser:t.currentUser$.peek()});break;case"unknown-user":s.onCleanup=function(c){i.set({type:"loading"});const d=setTimeout(()=>{i.set(c)},5e3);return()=>clearTimeout(d)}({type:"unknown-user",userId:l});break;default:le.never(a)}});const o=ft({type:"loading"});return Or(s=>{if(i.type.get()==="loading"){o.set({type:"invisible-loading"});const a=setTimeout(()=>{o.set({type:"loading"})},1e3);s.onCleanup=()=>{clearTimeout(a)}}else o.set(i.get())}),Z(o)}();return e.type==="invisible-loading"?v.jsx(v.Fragment,{}):e.type==="loading"?v.jsx(Qf,{}):e.type==="unknown-user"||e.type==="auth-failed"||e.type==="wrong-app-id"||e.type==="server-error"||e.type==="unexpected-error"?v.jsx(As,{appId:n,chatboxState:e}):e.type=="expired-token"?v.jsx(em,{}):e.type==="loaded"?v.jsx(gO,{}):v.jsx(v.Fragment,{})}class OO extends fp{constructor(){super(...arguments),this.type="ConversationListStore",this.conversationListSubscription=null,this.extCurrentConversationId$=me(null),this.conversationsArray$=me([]),this.conversationsMap$=me({})}listenForConversations(e){const t=e.subscribeConversations(r=>{mr(()=>{this.conversationsArray$.set(r);const i={};for(const o of r)i[o.id]=o;this.conversationsMap$.set(i)})});return this.conversationListSubscription=t,()=>{t.unsubscribe(),this.conversationListSubscription=null}}}class _O{constructor(e,t){this.store=e,this.onSelectConversation=t}selectConversation(e){if(e===this.store.extCurrentConversationId$.peek())return;this.store.extCurrentConversationId$.set(e);const t={currentUser:this.store.currentUser$.peek(),conversation:this.store.conversationsMap$.child(e).peek()};this.onSelectConversation(t)}}const SO=R.forwardRef(function(n,e){const{__hostElement:t,onSelectConversation:r}=n;R.useEffect(()=>{var h;(h=n.__internalOnLoaded)==null||h.call(n)},[]);const i=Km(),o=R.useRef(t!=null?t:null);Xm(o);const s=si(r,t,["selectConversation","select-conversation","selectconversation","SelectConversation"]),a=R.useMemo(()=>new OO(n.appId,n.userId),[]);R.useEffect(()=>{mr(()=>{a.extUserId$.set(n.userId),a.appId$.set(n.appId)})},[a,n.appId,n.userId]);const{session:l}=Gm(a,n),u=R.useMemo(()=>new _O(a,s),[a,s]);R.useEffect(()=>a.listenForConversations(l),[a,l]),R.useEffect(()=>{n.selectedConversationId!==void 0&&a.extCurrentConversationId$.set(n.selectedConversationId)},[a,n.selectedConversationId]),R.useEffect(()=>{const h=n.__hostElement;if(h)return a.extCurrentConversationId$.onChange(({value:p})=>{h.selectedConversationId=p})},[a,n.__hostElement]),R.useImperativeHandle(e,()=>({controller:u}));const c=R.useCallback(({error:h})=>v.jsx(As,{appId:n.appId,chatboxState:{type:"unexpected-error",error:h}}),[n.appId]),d=i?null:v.jsx(Jh,{fallbackRender:c,children:v.jsx(ip.Provider,{value:a,children:v.jsx(tp.Provider,{value:n.theme,children:v.jsx(op.Provider,{value:u,children:v.jsx(Ml.Provider,{value:l,children:v.jsx(DO,{appId:n.appId})})})})})});if(t)return d;{const h="t-conversation-list"+(n.className?` ${n.className}`:"");return v.jsx("div",{className:h,style:n.style,ref:o,children:d})}});var Mi,ns,Wm;class TO{constructor(e){xr(this,ns);xr(this,Mi);Ls(this,Mi,e)}selectConversation(e){Le(this,ns,Wm).selectConversation(e)}}Mi=new WeakMap,ns=new WeakSet,Wm=function(){return Le(this,Mi).current.controller};const RO=R.forwardRef(function(n,e){const t=R.useRef(null),r=R.useMemo(()=>new TO(t),[]);R.useImperativeHandle(e,()=>r,[r]);const{theme:i,...o}=n,s=R.useMemo(()=>({...wl,...i!=null?i:{}}),[i]),a=`${n.userId}|${n.appId}`;return v.jsx(sp.Provider,{value:r,children:R.createElement(SO,{...o,key:a,theme:s,ref:t})})}),CO=wl;exports.AudioPlayer=Vo,exports.Chatbox=mO,exports.ConversationList=RO,exports.Editor=Kf,exports.EmojiPicker=su,exports.EmojiSuggestBar=Am,exports.MentionSuggestList=Hm,exports.MenuItem=en,exports.MessageContent=am,exports.PopoverButton=rr,exports.ReactionPicker=um,exports.Text=ou,exports.defaultTheme=CO,exports.formatDuration=pu,exports.formatFilesize=oi,exports.getGoogleMapsUrls=hu,exports.getPhotoUrlWithFallback=_n,exports.getRandomColor=Um,exports.html=x,exports.useTimeAgo=jm,exports.userFriendlyDate=$m;