@zyui/components 0.0.41 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Oge=Object.defineProperty;var $ge=(o,s,i)=>s in o?Oge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i;var zc=(o,s,i)=>$ge(o,typeof s!="symbol"?s+"":s,i);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("vue"),Bn=require("element-plus"),Dge="0.0.41";var Mge=Object.defineProperty,Rge=(o,s,i)=>s in o?Mge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i,See=(o,s,i)=>Rge(o,typeof s!="symbol"?s+"":s,i);function _ce(o,s){return function(){return o.apply(s,arguments)}}const{toString:Bge}=Object.prototype,{getPrototypeOf:Mne}=Object,zz=(o=>s=>{const i=Bge.call(s);return o[i]||(o[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Bh=o=>(o=o.toLowerCase(),s=>zz(s)===o),Uz=o=>s=>typeof s===o,{isArray:v4}=Array,KM=Uz("undefined");function Ige(o){return o!==null&&!KM(o)&&o.constructor!==null&&!KM(o.constructor)&&wp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const kce=Bh("ArrayBuffer");function Pge(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&kce(o.buffer),s}const Fge=Uz("string"),wp=Uz("function"),Tce=Uz("number"),jz=o=>o!==null&&typeof o=="object",Lge=o=>o===!0||o===!1,VH=o=>{if(zz(o)!=="object")return!1;const s=Mne(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},Vge=Bh("Date"),Hge=Bh("File"),zge=Bh("Blob"),Uge=Bh("FileList"),jge=o=>jz(o)&&wp(o.pipe),Wge=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||wp(o.append)&&((s=zz(o))==="formdata"||s==="object"&&wp(o.toString)&&o.toString()==="[object FormData]"))},Zge=Bh("URLSearchParams"),[Gge,qge,Yge,Kge]=["ReadableStream","Request","Response","Headers"].map(Bh),Xge=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function cR(o,s,{allOwnKeys:i=!1}={}){if(o===null||typeof o>"u")return;let u,m;if(typeof o!="object"&&(o=[o]),v4(o))for(u=0,m=o.length;u<m;u++)s.call(null,o[u],u,o);else{const h=i?Object.getOwnPropertyNames(o):Object.keys(o),b=h.length;let C;for(u=0;u<b;u++)C=h[u],s.call(null,o[C],C,o)}}function Ace(o,s){s=s.toLowerCase();const i=Object.keys(o);let u=i.length,m;for(;u-- >0;)if(m=i[u],s===m.toLowerCase())return m;return null}const cE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Nce=o=>!KM(o)&&o!==cE;function Rte(){const{caseless:o}=Nce(this)&&this||{},s={},i=(u,m)=>{const h=o&&Ace(s,m)||m;VH(s[h])&&VH(u)?s[h]=Rte(s[h],u):VH(u)?s[h]=Rte({},u):v4(u)?s[h]=u.slice():s[h]=u};for(let u=0,m=arguments.length;u<m;u++)arguments[u]&&cR(arguments[u],i);return s}const Jge=(o,s,i,{allOwnKeys:u}={})=>(cR(s,(m,h)=>{i&&wp(m)?o[h]=_ce(m,i):o[h]=m},{allOwnKeys:u}),o),Qge=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),ehe=(o,s,i,u)=>{o.prototype=Object.create(s.prototype,u),o.prototype.constructor=o,Object.defineProperty(o,"super",{value:s.prototype}),i&&Object.assign(o.prototype,i)},the=(o,s,i,u)=>{let m,h,b;const C={};if(s=s||{},o==null)return s;do{for(m=Object.getOwnPropertyNames(o),h=m.length;h-- >0;)b=m[h],(!u||u(b,o,s))&&!C[b]&&(s[b]=o[b],C[b]=!0);o=i!==!1&&Mne(o)}while(o&&(!i||i(o,s))&&o!==Object.prototype);return s},nhe=(o,s,i)=>{o=String(o),(i===void 0||i>o.length)&&(i=o.length),i-=s.length;const u=o.indexOf(s,i);return u!==-1&&u===i},ohe=o=>{if(!o)return null;if(v4(o))return o;let s=o.length;if(!Tce(s))return null;const i=new Array(s);for(;s-- >0;)i[s]=o[s];return i},she=(o=>s=>o&&s instanceof o)(typeof Uint8Array<"u"&&Mne(Uint8Array)),rhe=(o,s)=>{const i=(o&&o[Symbol.iterator]).call(o);let u;for(;(u=i.next())&&!u.done;){const m=u.value;s.call(o,m[0],m[1])}},ahe=(o,s)=>{let i;const u=[];for(;(i=o.exec(s))!==null;)u.push(i);return u},ihe=Bh("HTMLFormElement"),lhe=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,u){return i.toUpperCase()+u}),Are=(({hasOwnProperty:o})=>(s,i)=>o.call(s,i))(Object.prototype),che=Bh("RegExp"),Oce=(o,s)=>{const i=Object.getOwnPropertyDescriptors(o),u={};cR(i,(m,h)=>{let b;(b=s(m,h,o))!==!1&&(u[h]=b||m)}),Object.defineProperties(o,u)},uhe=o=>{Oce(o,(s,i)=>{if(wp(o)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const u=o[i];if(wp(u)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},dhe=(o,s)=>{const i={},u=m=>{m.forEach(h=>{i[h]=!0})};return v4(o)?u(o):u(String(o).split(s)),i},fhe=()=>{},mhe=(o,s)=>o!=null&&Number.isFinite(o=+o)?o:s,xee="abcdefghijklmnopqrstuvwxyz",Nre="0123456789",$ce={DIGIT:Nre,ALPHA:xee,ALPHA_DIGIT:xee+xee.toUpperCase()+Nre},phe=(o=16,s=$ce.ALPHA_DIGIT)=>{let i="";const{length:u}=s;for(;o--;)i+=s[Math.random()*u|0];return i};function ghe(o){return!!(o&&wp(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const hhe=o=>{const s=new Array(10),i=(u,m)=>{if(jz(u)){if(s.indexOf(u)>=0)return;if(!("toJSON"in u)){s[m]=u;const h=v4(u)?[]:{};return cR(u,(b,C)=>{const x=i(b,m+1);!KM(x)&&(h[C]=x)}),s[m]=void 0,h}}return u};return i(o,0)},vhe=Bh("AsyncFunction"),bhe=o=>o&&(jz(o)||wp(o))&&wp(o.then)&&wp(o.catch),Dce=((o,s)=>o?setImmediate:s?((i,u)=>(cE.addEventListener("message",({source:m,data:h})=>{m===cE&&h===i&&u.length&&u.shift()()},!1),m=>{u.push(m),cE.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",wp(cE.postMessage)),yhe=typeof queueMicrotask<"u"?queueMicrotask.bind(cE):typeof process<"u"&&process.nextTick||Dce,Mn={isArray:v4,isArrayBuffer:kce,isBuffer:Ige,isFormData:Wge,isArrayBufferView:Pge,isString:Fge,isNumber:Tce,isBoolean:Lge,isObject:jz,isPlainObject:VH,isReadableStream:Gge,isRequest:qge,isResponse:Yge,isHeaders:Kge,isUndefined:KM,isDate:Vge,isFile:Hge,isBlob:zge,isRegExp:che,isFunction:wp,isStream:jge,isURLSearchParams:Zge,isTypedArray:she,isFileList:Uge,forEach:cR,merge:Rte,extend:Jge,trim:Xge,stripBOM:Qge,inherits:ehe,toFlatObject:the,kindOf:zz,kindOfTest:Bh,endsWith:nhe,toArray:ohe,forEachEntry:rhe,matchAll:ahe,isHTMLForm:ihe,hasOwnProperty:Are,hasOwnProp:Are,reduceDescriptors:Oce,freezeMethods:uhe,toObjectSet:dhe,toCamelCase:lhe,noop:fhe,toFiniteNumber:mhe,findKey:Ace,global:cE,isContextDefined:Nce,ALPHABET:$ce,generateString:phe,isSpecCompliantForm:ghe,toJSONObject:hhe,isAsyncFn:vhe,isThenable:bhe,setImmediate:Dce,asap:yhe};function Er(o,s,i,u,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=o,this.name="AxiosError",s&&(this.code=s),i&&(this.config=i),u&&(this.request=u),m&&(this.response=m,this.status=m.status?m.status:null)}Mn.inherits(Er,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Mn.toJSONObject(this.config),code:this.code,status:this.status}}});const Mce=Er.prototype,Rce={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(o=>{Rce[o]={value:o}});Object.defineProperties(Er,Rce);Object.defineProperty(Mce,"isAxiosError",{value:!0});Er.from=(o,s,i,u,m,h)=>{const b=Object.create(Mce);return Mn.toFlatObject(o,b,function(C){return C!==Error.prototype},C=>C!=="isAxiosError"),Er.call(b,o.message,s,i,u,m),b.cause=o,b.name=o.name,h&&Object.assign(b,h),b};const whe=null;function Bte(o){return Mn.isPlainObject(o)||Mn.isArray(o)}function Bce(o){return Mn.endsWith(o,"[]")?o.slice(0,-2):o}function Ore(o,s,i){return o?o.concat(s).map(function(u,m){return u=Bce(u),!i&&m?"["+u+"]":u}).join(i?".":""):s}function Che(o){return Mn.isArray(o)&&!o.some(Bte)}const She=Mn.toFlatObject(Mn,{},null,function(o){return/^is[A-Z]/.test(o)});function Wz(o,s,i){if(!Mn.isObject(o))throw new TypeError("target must be an object");s=s||new FormData,i=Mn.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(L,j){return!Mn.isUndefined(j[L])});const u=i.metaTokens,m=i.visitor||_,h=i.dots,b=i.indexes,C=(i.Blob||typeof Blob<"u"&&Blob)&&Mn.isSpecCompliantForm(s);if(!Mn.isFunction(m))throw new TypeError("visitor must be a function");function x(L){if(L===null)return"";if(Mn.isDate(L))return L.toISOString();if(!C&&Mn.isBlob(L))throw new Er("Blob is not supported. Use a Buffer instead.");return Mn.isArrayBuffer(L)||Mn.isTypedArray(L)?C&&typeof Blob=="function"?new Blob([L]):Buffer.from(L):L}function _(L,j,J){let Y=L;if(L&&!J&&typeof L=="object"){if(Mn.endsWith(j,"{}"))j=u?j:j.slice(0,-2),L=JSON.stringify(L);else if(Mn.isArray(L)&&Che(L)||(Mn.isFileList(L)||Mn.endsWith(j,"[]"))&&(Y=Mn.toArray(L)))return j=Bce(j),Y.forEach(function(ne,K){!(Mn.isUndefined(ne)||ne===null)&&s.append(b===!0?Ore([j],K,h):b===null?j:j+"[]",x(ne))}),!1}return Bte(L)?!0:(s.append(Ore(J,j,h),x(L)),!1)}const N=[],O=Object.assign(She,{defaultVisitor:_,convertValue:x,isVisitable:Bte});function B(L,j){if(!Mn.isUndefined(L)){if(N.indexOf(L)!==-1)throw Error("Circular reference detected in "+j.join("."));N.push(L),Mn.forEach(L,function(J,Y){(!(Mn.isUndefined(J)||J===null)&&m.call(s,J,Mn.isString(Y)?Y.trim():Y,j,O))===!0&&B(J,j?j.concat(Y):[Y])}),N.pop()}}if(!Mn.isObject(o))throw new TypeError("data must be an object");return B(o),s}function $re(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Rne(o,s){this._pairs=[],o&&Wz(o,this,s)}const Ice=Rne.prototype;Ice.append=function(o,s){this._pairs.push([o,s])};Ice.toString=function(o){const s=o?function(i){return o.call(this,i,$re)}:$re;return this._pairs.map(function(i){return s(i[0])+"="+s(i[1])},"").join("&")};function xhe(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Pce(o,s,i){if(!s)return o;const u=i&&i.encode||xhe;Mn.isFunction(i)&&(i={serialize:i});const m=i&&i.serialize;let h;if(m?h=m(s,i):h=Mn.isURLSearchParams(s)?s.toString():new Rne(s,i).toString(u),h){const b=o.indexOf("#");b!==-1&&(o=o.slice(0,b)),o+=(o.indexOf("?")===-1?"?":"&")+h}return o}let Dre=class{constructor(){this.handlers=[]}use(s,i,u){return this.handlers.push({fulfilled:s,rejected:i,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1}eject(s){this.handlers[s]&&(this.handlers[s]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){Mn.forEach(this.handlers,function(i){i!==null&&s(i)})}};const Fce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ehe=typeof URLSearchParams<"u"?URLSearchParams:Rne,_he=typeof FormData<"u"?FormData:null,khe=typeof Blob<"u"?Blob:null,The={isBrowser:!0,classes:{URLSearchParams:Ehe,FormData:_he,Blob:khe},protocols:["http","https","file","blob","url","data"]},Bne=typeof window<"u"&&typeof document<"u",Ite=typeof navigator=="object"&&navigator||void 0,Ahe=Bne&&(!Ite||["ReactNative","NativeScript","NS"].indexOf(Ite.product)<0),Nhe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ohe=Bne&&window.location.href||"http://localhost",$he=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Bne,hasStandardBrowserEnv:Ahe,hasStandardBrowserWebWorkerEnv:Nhe,navigator:Ite,origin:Ohe},Symbol.toStringTag,{value:"Module"})),Xd={...$he,...The};function Dhe(o,s){return Wz(o,new Xd.classes.URLSearchParams,Object.assign({visitor:function(i,u,m,h){return Xd.isNode&&Mn.isBuffer(i)?(this.append(u,i.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},s))}function Mhe(o){return Mn.matchAll(/\w+|\[(\w*)]/g,o).map(s=>s[0]==="[]"?"":s[1]||s[0])}function Rhe(o){const s={},i=Object.keys(o);let u;const m=i.length;let h;for(u=0;u<m;u++)h=i[u],s[h]=o[h];return s}function Lce(o){function s(i,u,m,h){let b=i[h++];if(b==="__proto__")return!0;const C=Number.isFinite(+b),x=h>=i.length;return b=!b&&Mn.isArray(m)?m.length:b,x?(Mn.hasOwnProp(m,b)?m[b]=[m[b],u]:m[b]=u,!C):((!m[b]||!Mn.isObject(m[b]))&&(m[b]=[]),s(i,u,m[b],h)&&Mn.isArray(m[b])&&(m[b]=Rhe(m[b])),!C)}if(Mn.isFormData(o)&&Mn.isFunction(o.entries)){const i={};return Mn.forEachEntry(o,(u,m)=>{s(Mhe(u),m,i,0)}),i}return null}function Bhe(o,s,i){if(Mn.isString(o))try{return(s||JSON.parse)(o),Mn.trim(o)}catch(u){if(u.name!=="SyntaxError")throw u}return(0,JSON.stringify)(o)}const uR={transitional:Fce,adapter:["xhr","http","fetch"],transformRequest:[function(o,s){const i=s.getContentType()||"",u=i.indexOf("application/json")>-1,m=Mn.isObject(o);if(m&&Mn.isHTMLForm(o)&&(o=new FormData(o)),Mn.isFormData(o))return u?JSON.stringify(Lce(o)):o;if(Mn.isArrayBuffer(o)||Mn.isBuffer(o)||Mn.isStream(o)||Mn.isFile(o)||Mn.isBlob(o)||Mn.isReadableStream(o))return o;if(Mn.isArrayBufferView(o))return o.buffer;if(Mn.isURLSearchParams(o))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let h;if(m){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Dhe(o,this.formSerializer).toString();if((h=Mn.isFileList(o))||i.indexOf("multipart/form-data")>-1){const b=this.env&&this.env.FormData;return Wz(h?{"files[]":o}:o,b&&new b,this.formSerializer)}}return m||u?(s.setContentType("application/json",!1),Bhe(o)):o}],transformResponse:[function(o){const s=this.transitional||uR.transitional,i=s&&s.forcedJSONParsing,u=this.responseType==="json";if(Mn.isResponse(o)||Mn.isReadableStream(o))return o;if(o&&Mn.isString(o)&&(i&&!this.responseType||u)){const m=!(s&&s.silentJSONParsing)&&u;try{return JSON.parse(o)}catch(h){if(m)throw h.name==="SyntaxError"?Er.from(h,Er.ERR_BAD_RESPONSE,this,null,this.response):h}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Xd.classes.FormData,Blob:Xd.classes.Blob},validateStatus:function(o){return o>=200&&o<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Mn.forEach(["delete","get","head","post","put","patch"],o=>{uR.headers[o]={}});const Ihe=Mn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Phe=o=>{const s={};let i,u,m;return o&&o.split(`
|
|
1
|
+
"use strict";var Oge=Object.defineProperty;var $ge=(o,s,i)=>s in o?Oge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i;var zc=(o,s,i)=>$ge(o,typeof s!="symbol"?s+"":s,i);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("vue"),Bn=require("element-plus"),Dge="0.0.42";var Mge=Object.defineProperty,Rge=(o,s,i)=>s in o?Mge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i,See=(o,s,i)=>Rge(o,typeof s!="symbol"?s+"":s,i);function _ce(o,s){return function(){return o.apply(s,arguments)}}const{toString:Bge}=Object.prototype,{getPrototypeOf:Mne}=Object,zz=(o=>s=>{const i=Bge.call(s);return o[i]||(o[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Bh=o=>(o=o.toLowerCase(),s=>zz(s)===o),Uz=o=>s=>typeof s===o,{isArray:v4}=Array,KM=Uz("undefined");function Ige(o){return o!==null&&!KM(o)&&o.constructor!==null&&!KM(o.constructor)&&wp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const kce=Bh("ArrayBuffer");function Pge(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&kce(o.buffer),s}const Fge=Uz("string"),wp=Uz("function"),Tce=Uz("number"),jz=o=>o!==null&&typeof o=="object",Lge=o=>o===!0||o===!1,VH=o=>{if(zz(o)!=="object")return!1;const s=Mne(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},Vge=Bh("Date"),Hge=Bh("File"),zge=Bh("Blob"),Uge=Bh("FileList"),jge=o=>jz(o)&&wp(o.pipe),Wge=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||wp(o.append)&&((s=zz(o))==="formdata"||s==="object"&&wp(o.toString)&&o.toString()==="[object FormData]"))},Zge=Bh("URLSearchParams"),[Gge,qge,Yge,Kge]=["ReadableStream","Request","Response","Headers"].map(Bh),Xge=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function cR(o,s,{allOwnKeys:i=!1}={}){if(o===null||typeof o>"u")return;let u,m;if(typeof o!="object"&&(o=[o]),v4(o))for(u=0,m=o.length;u<m;u++)s.call(null,o[u],u,o);else{const h=i?Object.getOwnPropertyNames(o):Object.keys(o),b=h.length;let C;for(u=0;u<b;u++)C=h[u],s.call(null,o[C],C,o)}}function Ace(o,s){s=s.toLowerCase();const i=Object.keys(o);let u=i.length,m;for(;u-- >0;)if(m=i[u],s===m.toLowerCase())return m;return null}const cE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Nce=o=>!KM(o)&&o!==cE;function Rte(){const{caseless:o}=Nce(this)&&this||{},s={},i=(u,m)=>{const h=o&&Ace(s,m)||m;VH(s[h])&&VH(u)?s[h]=Rte(s[h],u):VH(u)?s[h]=Rte({},u):v4(u)?s[h]=u.slice():s[h]=u};for(let u=0,m=arguments.length;u<m;u++)arguments[u]&&cR(arguments[u],i);return s}const Jge=(o,s,i,{allOwnKeys:u}={})=>(cR(s,(m,h)=>{i&&wp(m)?o[h]=_ce(m,i):o[h]=m},{allOwnKeys:u}),o),Qge=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),ehe=(o,s,i,u)=>{o.prototype=Object.create(s.prototype,u),o.prototype.constructor=o,Object.defineProperty(o,"super",{value:s.prototype}),i&&Object.assign(o.prototype,i)},the=(o,s,i,u)=>{let m,h,b;const C={};if(s=s||{},o==null)return s;do{for(m=Object.getOwnPropertyNames(o),h=m.length;h-- >0;)b=m[h],(!u||u(b,o,s))&&!C[b]&&(s[b]=o[b],C[b]=!0);o=i!==!1&&Mne(o)}while(o&&(!i||i(o,s))&&o!==Object.prototype);return s},nhe=(o,s,i)=>{o=String(o),(i===void 0||i>o.length)&&(i=o.length),i-=s.length;const u=o.indexOf(s,i);return u!==-1&&u===i},ohe=o=>{if(!o)return null;if(v4(o))return o;let s=o.length;if(!Tce(s))return null;const i=new Array(s);for(;s-- >0;)i[s]=o[s];return i},she=(o=>s=>o&&s instanceof o)(typeof Uint8Array<"u"&&Mne(Uint8Array)),rhe=(o,s)=>{const i=(o&&o[Symbol.iterator]).call(o);let u;for(;(u=i.next())&&!u.done;){const m=u.value;s.call(o,m[0],m[1])}},ahe=(o,s)=>{let i;const u=[];for(;(i=o.exec(s))!==null;)u.push(i);return u},ihe=Bh("HTMLFormElement"),lhe=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,u){return i.toUpperCase()+u}),Are=(({hasOwnProperty:o})=>(s,i)=>o.call(s,i))(Object.prototype),che=Bh("RegExp"),Oce=(o,s)=>{const i=Object.getOwnPropertyDescriptors(o),u={};cR(i,(m,h)=>{let b;(b=s(m,h,o))!==!1&&(u[h]=b||m)}),Object.defineProperties(o,u)},uhe=o=>{Oce(o,(s,i)=>{if(wp(o)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const u=o[i];if(wp(u)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},dhe=(o,s)=>{const i={},u=m=>{m.forEach(h=>{i[h]=!0})};return v4(o)?u(o):u(String(o).split(s)),i},fhe=()=>{},mhe=(o,s)=>o!=null&&Number.isFinite(o=+o)?o:s,xee="abcdefghijklmnopqrstuvwxyz",Nre="0123456789",$ce={DIGIT:Nre,ALPHA:xee,ALPHA_DIGIT:xee+xee.toUpperCase()+Nre},phe=(o=16,s=$ce.ALPHA_DIGIT)=>{let i="";const{length:u}=s;for(;o--;)i+=s[Math.random()*u|0];return i};function ghe(o){return!!(o&&wp(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const hhe=o=>{const s=new Array(10),i=(u,m)=>{if(jz(u)){if(s.indexOf(u)>=0)return;if(!("toJSON"in u)){s[m]=u;const h=v4(u)?[]:{};return cR(u,(b,C)=>{const x=i(b,m+1);!KM(x)&&(h[C]=x)}),s[m]=void 0,h}}return u};return i(o,0)},vhe=Bh("AsyncFunction"),bhe=o=>o&&(jz(o)||wp(o))&&wp(o.then)&&wp(o.catch),Dce=((o,s)=>o?setImmediate:s?((i,u)=>(cE.addEventListener("message",({source:m,data:h})=>{m===cE&&h===i&&u.length&&u.shift()()},!1),m=>{u.push(m),cE.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",wp(cE.postMessage)),yhe=typeof queueMicrotask<"u"?queueMicrotask.bind(cE):typeof process<"u"&&process.nextTick||Dce,Mn={isArray:v4,isArrayBuffer:kce,isBuffer:Ige,isFormData:Wge,isArrayBufferView:Pge,isString:Fge,isNumber:Tce,isBoolean:Lge,isObject:jz,isPlainObject:VH,isReadableStream:Gge,isRequest:qge,isResponse:Yge,isHeaders:Kge,isUndefined:KM,isDate:Vge,isFile:Hge,isBlob:zge,isRegExp:che,isFunction:wp,isStream:jge,isURLSearchParams:Zge,isTypedArray:she,isFileList:Uge,forEach:cR,merge:Rte,extend:Jge,trim:Xge,stripBOM:Qge,inherits:ehe,toFlatObject:the,kindOf:zz,kindOfTest:Bh,endsWith:nhe,toArray:ohe,forEachEntry:rhe,matchAll:ahe,isHTMLForm:ihe,hasOwnProperty:Are,hasOwnProp:Are,reduceDescriptors:Oce,freezeMethods:uhe,toObjectSet:dhe,toCamelCase:lhe,noop:fhe,toFiniteNumber:mhe,findKey:Ace,global:cE,isContextDefined:Nce,ALPHABET:$ce,generateString:phe,isSpecCompliantForm:ghe,toJSONObject:hhe,isAsyncFn:vhe,isThenable:bhe,setImmediate:Dce,asap:yhe};function Er(o,s,i,u,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=o,this.name="AxiosError",s&&(this.code=s),i&&(this.config=i),u&&(this.request=u),m&&(this.response=m,this.status=m.status?m.status:null)}Mn.inherits(Er,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Mn.toJSONObject(this.config),code:this.code,status:this.status}}});const Mce=Er.prototype,Rce={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(o=>{Rce[o]={value:o}});Object.defineProperties(Er,Rce);Object.defineProperty(Mce,"isAxiosError",{value:!0});Er.from=(o,s,i,u,m,h)=>{const b=Object.create(Mce);return Mn.toFlatObject(o,b,function(C){return C!==Error.prototype},C=>C!=="isAxiosError"),Er.call(b,o.message,s,i,u,m),b.cause=o,b.name=o.name,h&&Object.assign(b,h),b};const whe=null;function Bte(o){return Mn.isPlainObject(o)||Mn.isArray(o)}function Bce(o){return Mn.endsWith(o,"[]")?o.slice(0,-2):o}function Ore(o,s,i){return o?o.concat(s).map(function(u,m){return u=Bce(u),!i&&m?"["+u+"]":u}).join(i?".":""):s}function Che(o){return Mn.isArray(o)&&!o.some(Bte)}const She=Mn.toFlatObject(Mn,{},null,function(o){return/^is[A-Z]/.test(o)});function Wz(o,s,i){if(!Mn.isObject(o))throw new TypeError("target must be an object");s=s||new FormData,i=Mn.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(L,j){return!Mn.isUndefined(j[L])});const u=i.metaTokens,m=i.visitor||_,h=i.dots,b=i.indexes,C=(i.Blob||typeof Blob<"u"&&Blob)&&Mn.isSpecCompliantForm(s);if(!Mn.isFunction(m))throw new TypeError("visitor must be a function");function x(L){if(L===null)return"";if(Mn.isDate(L))return L.toISOString();if(!C&&Mn.isBlob(L))throw new Er("Blob is not supported. Use a Buffer instead.");return Mn.isArrayBuffer(L)||Mn.isTypedArray(L)?C&&typeof Blob=="function"?new Blob([L]):Buffer.from(L):L}function _(L,j,J){let Y=L;if(L&&!J&&typeof L=="object"){if(Mn.endsWith(j,"{}"))j=u?j:j.slice(0,-2),L=JSON.stringify(L);else if(Mn.isArray(L)&&Che(L)||(Mn.isFileList(L)||Mn.endsWith(j,"[]"))&&(Y=Mn.toArray(L)))return j=Bce(j),Y.forEach(function(ne,K){!(Mn.isUndefined(ne)||ne===null)&&s.append(b===!0?Ore([j],K,h):b===null?j:j+"[]",x(ne))}),!1}return Bte(L)?!0:(s.append(Ore(J,j,h),x(L)),!1)}const N=[],O=Object.assign(She,{defaultVisitor:_,convertValue:x,isVisitable:Bte});function B(L,j){if(!Mn.isUndefined(L)){if(N.indexOf(L)!==-1)throw Error("Circular reference detected in "+j.join("."));N.push(L),Mn.forEach(L,function(J,Y){(!(Mn.isUndefined(J)||J===null)&&m.call(s,J,Mn.isString(Y)?Y.trim():Y,j,O))===!0&&B(J,j?j.concat(Y):[Y])}),N.pop()}}if(!Mn.isObject(o))throw new TypeError("data must be an object");return B(o),s}function $re(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Rne(o,s){this._pairs=[],o&&Wz(o,this,s)}const Ice=Rne.prototype;Ice.append=function(o,s){this._pairs.push([o,s])};Ice.toString=function(o){const s=o?function(i){return o.call(this,i,$re)}:$re;return this._pairs.map(function(i){return s(i[0])+"="+s(i[1])},"").join("&")};function xhe(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Pce(o,s,i){if(!s)return o;const u=i&&i.encode||xhe;Mn.isFunction(i)&&(i={serialize:i});const m=i&&i.serialize;let h;if(m?h=m(s,i):h=Mn.isURLSearchParams(s)?s.toString():new Rne(s,i).toString(u),h){const b=o.indexOf("#");b!==-1&&(o=o.slice(0,b)),o+=(o.indexOf("?")===-1?"?":"&")+h}return o}let Dre=class{constructor(){this.handlers=[]}use(s,i,u){return this.handlers.push({fulfilled:s,rejected:i,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1}eject(s){this.handlers[s]&&(this.handlers[s]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){Mn.forEach(this.handlers,function(i){i!==null&&s(i)})}};const Fce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ehe=typeof URLSearchParams<"u"?URLSearchParams:Rne,_he=typeof FormData<"u"?FormData:null,khe=typeof Blob<"u"?Blob:null,The={isBrowser:!0,classes:{URLSearchParams:Ehe,FormData:_he,Blob:khe},protocols:["http","https","file","blob","url","data"]},Bne=typeof window<"u"&&typeof document<"u",Ite=typeof navigator=="object"&&navigator||void 0,Ahe=Bne&&(!Ite||["ReactNative","NativeScript","NS"].indexOf(Ite.product)<0),Nhe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ohe=Bne&&window.location.href||"http://localhost",$he=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Bne,hasStandardBrowserEnv:Ahe,hasStandardBrowserWebWorkerEnv:Nhe,navigator:Ite,origin:Ohe},Symbol.toStringTag,{value:"Module"})),Xd={...$he,...The};function Dhe(o,s){return Wz(o,new Xd.classes.URLSearchParams,Object.assign({visitor:function(i,u,m,h){return Xd.isNode&&Mn.isBuffer(i)?(this.append(u,i.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},s))}function Mhe(o){return Mn.matchAll(/\w+|\[(\w*)]/g,o).map(s=>s[0]==="[]"?"":s[1]||s[0])}function Rhe(o){const s={},i=Object.keys(o);let u;const m=i.length;let h;for(u=0;u<m;u++)h=i[u],s[h]=o[h];return s}function Lce(o){function s(i,u,m,h){let b=i[h++];if(b==="__proto__")return!0;const C=Number.isFinite(+b),x=h>=i.length;return b=!b&&Mn.isArray(m)?m.length:b,x?(Mn.hasOwnProp(m,b)?m[b]=[m[b],u]:m[b]=u,!C):((!m[b]||!Mn.isObject(m[b]))&&(m[b]=[]),s(i,u,m[b],h)&&Mn.isArray(m[b])&&(m[b]=Rhe(m[b])),!C)}if(Mn.isFormData(o)&&Mn.isFunction(o.entries)){const i={};return Mn.forEachEntry(o,(u,m)=>{s(Mhe(u),m,i,0)}),i}return null}function Bhe(o,s,i){if(Mn.isString(o))try{return(s||JSON.parse)(o),Mn.trim(o)}catch(u){if(u.name!=="SyntaxError")throw u}return(0,JSON.stringify)(o)}const uR={transitional:Fce,adapter:["xhr","http","fetch"],transformRequest:[function(o,s){const i=s.getContentType()||"",u=i.indexOf("application/json")>-1,m=Mn.isObject(o);if(m&&Mn.isHTMLForm(o)&&(o=new FormData(o)),Mn.isFormData(o))return u?JSON.stringify(Lce(o)):o;if(Mn.isArrayBuffer(o)||Mn.isBuffer(o)||Mn.isStream(o)||Mn.isFile(o)||Mn.isBlob(o)||Mn.isReadableStream(o))return o;if(Mn.isArrayBufferView(o))return o.buffer;if(Mn.isURLSearchParams(o))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let h;if(m){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Dhe(o,this.formSerializer).toString();if((h=Mn.isFileList(o))||i.indexOf("multipart/form-data")>-1){const b=this.env&&this.env.FormData;return Wz(h?{"files[]":o}:o,b&&new b,this.formSerializer)}}return m||u?(s.setContentType("application/json",!1),Bhe(o)):o}],transformResponse:[function(o){const s=this.transitional||uR.transitional,i=s&&s.forcedJSONParsing,u=this.responseType==="json";if(Mn.isResponse(o)||Mn.isReadableStream(o))return o;if(o&&Mn.isString(o)&&(i&&!this.responseType||u)){const m=!(s&&s.silentJSONParsing)&&u;try{return JSON.parse(o)}catch(h){if(m)throw h.name==="SyntaxError"?Er.from(h,Er.ERR_BAD_RESPONSE,this,null,this.response):h}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Xd.classes.FormData,Blob:Xd.classes.Blob},validateStatus:function(o){return o>=200&&o<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Mn.forEach(["delete","get","head","post","put","patch"],o=>{uR.headers[o]={}});const Ihe=Mn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Phe=o=>{const s={};let i,u,m;return o&&o.split(`
|
|
2
2
|
`).forEach(function(h){m=h.indexOf(":"),i=h.substring(0,m).trim().toLowerCase(),u=h.substring(m+1).trim(),!(!i||s[i]&&Ihe[i])&&(i==="set-cookie"?s[i]?s[i].push(u):s[i]=[u]:s[i]=s[i]?s[i]+", "+u:u)}),s},Mre=Symbol("internals");function kM(o){return o&&String(o).trim().toLowerCase()}function HH(o){return o===!1||o==null?o:Mn.isArray(o)?o.map(HH):String(o)}function Fhe(o){const s=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let u;for(;u=i.exec(o);)s[u[1]]=u[2];return s}const Lhe=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function Eee(o,s,i,u,m){if(Mn.isFunction(u))return u.call(this,s,i);if(m&&(s=i),!!Mn.isString(s)){if(Mn.isString(u))return s.indexOf(u)!==-1;if(Mn.isRegExp(u))return u.test(s)}}function Vhe(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,i,u)=>i.toUpperCase()+u)}function Hhe(o,s){const i=Mn.toCamelCase(" "+s);["get","set","has"].forEach(u=>{Object.defineProperty(o,u+i,{value:function(m,h,b){return this[u].call(this,s,m,h,b)},configurable:!0})})}let Em=class{constructor(s){s&&this.set(s)}set(s,i,u){const m=this;function h(C,x,_){const N=kM(x);if(!N)throw new Error("header name must be a non-empty string");const O=Mn.findKey(m,N);(!O||m[O]===void 0||_===!0||_===void 0&&m[O]!==!1)&&(m[O||x]=HH(C))}const b=(C,x)=>Mn.forEach(C,(_,N)=>h(_,N,x));if(Mn.isPlainObject(s)||s instanceof this.constructor)b(s,i);else if(Mn.isString(s)&&(s=s.trim())&&!Lhe(s))b(Phe(s),i);else if(Mn.isHeaders(s))for(const[C,x]of s.entries())h(x,C,u);else s!=null&&h(i,s,u);return this}get(s,i){if(s=kM(s),s){const u=Mn.findKey(this,s);if(u){const m=this[u];if(!i)return m;if(i===!0)return Fhe(m);if(Mn.isFunction(i))return i.call(this,m,u);if(Mn.isRegExp(i))return i.exec(m);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,i){if(s=kM(s),s){const u=Mn.findKey(this,s);return!!(u&&this[u]!==void 0&&(!i||Eee(this,this[u],u,i)))}return!1}delete(s,i){const u=this;let m=!1;function h(b){if(b=kM(b),b){const C=Mn.findKey(u,b);C&&(!i||Eee(u,u[C],C,i))&&(delete u[C],m=!0)}}return Mn.isArray(s)?s.forEach(h):h(s),m}clear(s){const i=Object.keys(this);let u=i.length,m=!1;for(;u--;){const h=i[u];(!s||Eee(this,this[h],h,s,!0))&&(delete this[h],m=!0)}return m}normalize(s){const i=this,u={};return Mn.forEach(this,(m,h)=>{const b=Mn.findKey(u,h);if(b){i[b]=HH(m),delete i[h];return}const C=s?Vhe(h):String(h).trim();C!==h&&delete i[h],i[C]=HH(m),u[C]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const i=Object.create(null);return Mn.forEach(this,(u,m)=>{u!=null&&u!==!1&&(i[m]=s&&Mn.isArray(u)?u.join(", "):u)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([s,i])=>s+": "+i).join(`
|
|
3
3
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static concat(s,...i){const u=new this(s);return i.forEach(m=>u.set(m)),u}static accessor(s){const i=(this[Mre]=this[Mre]={accessors:{}}).accessors,u=this.prototype;function m(h){const b=kM(h);i[b]||(Hhe(u,h),i[b]=!0)}return Mn.isArray(s)?s.forEach(m):m(s),this}};Em.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Mn.reduceDescriptors(Em.prototype,({value:o},s)=>{let i=s[0].toUpperCase()+s.slice(1);return{get:()=>o,set(u){this[i]=u}}});Mn.freezeMethods(Em);function _ee(o,s){const i=this||uR,u=s||i,m=Em.from(u.headers);let h=u.data;return Mn.forEach(o,function(b){h=b.call(i,h,m.normalize(),s?s.status:void 0)}),m.normalize(),h}function Vce(o){return!!(o&&o.__CANCEL__)}function b4(o,s,i){Er.call(this,o??"canceled",Er.ERR_CANCELED,s,i),this.name="CanceledError"}Mn.inherits(b4,Er,{__CANCEL__:!0});function Hce(o,s,i){const u=i.config.validateStatus;!i.status||!u||u(i.status)?o(i):s(new Er("Request failed with status code "+i.status,[Er.ERR_BAD_REQUEST,Er.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function zhe(o){const s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return s&&s[1]||""}function Uhe(o,s){o=o||10;const i=new Array(o),u=new Array(o);let m=0,h=0,b;return s=s!==void 0?s:1e3,function(C){const x=Date.now(),_=u[h];b||(b=x),i[m]=C,u[m]=x;let N=h,O=0;for(;N!==m;)O+=i[N++],N=N%o;if(m=(m+1)%o,m===h&&(h=(h+1)%o),x-b<s)return;const B=_&&x-_;return B?Math.round(O*1e3/B):void 0}}function jhe(o,s){let i=0,u=1e3/s,m,h;const b=(C,x=Date.now())=>{i=x,m=null,h&&(clearTimeout(h),h=null),o.apply(null,C)};return[(...C)=>{const x=Date.now(),_=x-i;_>=u?b(C,x):(m=C,h||(h=setTimeout(()=>{h=null,b(m)},u-_)))},()=>m&&b(m)]}const sz=(o,s,i=3)=>{let u=0;const m=Uhe(50,250);return jhe(h=>{const b=h.loaded,C=h.lengthComputable?h.total:void 0,x=b-u,_=m(x),N=b<=C;u=b;const O={loaded:b,total:C,progress:C?b/C:void 0,bytes:x,rate:_||void 0,estimated:_&&C&&N?(C-b)/_:void 0,event:h,lengthComputable:C!=null,[s?"download":"upload"]:!0};o(O)},i)},Rre=(o,s)=>{const i=o!=null;return[u=>s[0]({lengthComputable:i,total:o,loaded:u}),s[1]]},Bre=o=>(...s)=>Mn.asap(()=>o(...s)),Whe=Xd.hasStandardBrowserEnv?((o,s)=>i=>(i=new URL(i,Xd.origin),o.protocol===i.protocol&&o.host===i.host&&(s||o.port===i.port)))(new URL(Xd.origin),Xd.navigator&&/(msie|trident)/i.test(Xd.navigator.userAgent)):()=>!0,Zhe=Xd.hasStandardBrowserEnv?{write(o,s,i,u,m,h){const b=[o+"="+encodeURIComponent(s)];Mn.isNumber(i)&&b.push("expires="+new Date(i).toGMTString()),Mn.isString(u)&&b.push("path="+u),Mn.isString(m)&&b.push("domain="+m),h===!0&&b.push("secure"),document.cookie=b.join("; ")},read(o){const s=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove(o){this.write(o,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ghe(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function qhe(o,s){return s?o.replace(/\/?\/$/,"")+"/"+s.replace(/^\/+/,""):o}function zce(o,s){return o&&!Ghe(s)?qhe(o,s):s}const Ire=o=>o instanceof Em?{...o}:o;function SE(o,s){s=s||{};const i={};function u(_,N,O,B){return Mn.isPlainObject(_)&&Mn.isPlainObject(N)?Mn.merge.call({caseless:B},_,N):Mn.isPlainObject(N)?Mn.merge({},N):Mn.isArray(N)?N.slice():N}function m(_,N,O,B){if(Mn.isUndefined(N)){if(!Mn.isUndefined(_))return u(void 0,_,O,B)}else return u(_,N,O,B)}function h(_,N){if(!Mn.isUndefined(N))return u(void 0,N)}function b(_,N){if(Mn.isUndefined(N)){if(!Mn.isUndefined(_))return u(void 0,_)}else return u(void 0,N)}function C(_,N,O){if(O in s)return u(_,N);if(O in o)return u(void 0,_)}const x={url:h,method:h,data:h,baseURL:b,transformRequest:b,transformResponse:b,paramsSerializer:b,timeout:b,timeoutMessage:b,withCredentials:b,withXSRFToken:b,adapter:b,responseType:b,xsrfCookieName:b,xsrfHeaderName:b,onUploadProgress:b,onDownloadProgress:b,decompress:b,maxContentLength:b,maxBodyLength:b,beforeRedirect:b,transport:b,httpAgent:b,httpsAgent:b,cancelToken:b,socketPath:b,responseEncoding:b,validateStatus:C,headers:(_,N,O)=>m(Ire(_),Ire(N),O,!0)};return Mn.forEach(Object.keys(Object.assign({},o,s)),function(_){const N=x[_]||m,O=N(o[_],s[_],_);Mn.isUndefined(O)&&N!==C||(i[_]=O)}),i}const Uce=o=>{const s=SE({},o);let{data:i,withXSRFToken:u,xsrfHeaderName:m,xsrfCookieName:h,headers:b,auth:C}=s;s.headers=b=Em.from(b),s.url=Pce(zce(s.baseURL,s.url),o.params,o.paramsSerializer),C&&b.set("Authorization","Basic "+btoa((C.username||"")+":"+(C.password?unescape(encodeURIComponent(C.password)):"")));let x;if(Mn.isFormData(i)){if(Xd.hasStandardBrowserEnv||Xd.hasStandardBrowserWebWorkerEnv)b.setContentType(void 0);else if((x=b.getContentType())!==!1){const[_,...N]=x?x.split(";").map(O=>O.trim()).filter(Boolean):[];b.setContentType([_||"multipart/form-data",...N].join("; "))}}if(Xd.hasStandardBrowserEnv&&(u&&Mn.isFunction(u)&&(u=u(s)),u||u!==!1&&Whe(s.url))){const _=m&&h&&Zhe.read(h);_&&b.set(m,_)}return s},Yhe=typeof XMLHttpRequest<"u",Khe=Yhe&&function(o){return new Promise(function(s,i){const u=Uce(o);let m=u.data;const h=Em.from(u.headers).normalize();let{responseType:b,onUploadProgress:C,onDownloadProgress:x}=u,_,N,O,B,L;function j(){B&&B(),L&&L(),u.cancelToken&&u.cancelToken.unsubscribe(_),u.signal&&u.signal.removeEventListener("abort",_)}let J=new XMLHttpRequest;J.open(u.method.toUpperCase(),u.url,!0),J.timeout=u.timeout;function Y(){if(!J)return;const K=Em.from("getAllResponseHeaders"in J&&J.getAllResponseHeaders()),W={data:!b||b==="text"||b==="json"?J.responseText:J.response,status:J.status,statusText:J.statusText,headers:K,config:o,request:J};Hce(function(Se){s(Se),j()},function(Se){i(Se),j()},W),J=null}"onloadend"in J?J.onloadend=Y:J.onreadystatechange=function(){!J||J.readyState!==4||J.status===0&&!(J.responseURL&&J.responseURL.indexOf("file:")===0)||setTimeout(Y)},J.onabort=function(){J&&(i(new Er("Request aborted",Er.ECONNABORTED,o,J)),J=null)},J.onerror=function(){i(new Er("Network Error",Er.ERR_NETWORK,o,J)),J=null},J.ontimeout=function(){let K=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded";const W=u.transitional||Fce;u.timeoutErrorMessage&&(K=u.timeoutErrorMessage),i(new Er(K,W.clarifyTimeoutError?Er.ETIMEDOUT:Er.ECONNABORTED,o,J)),J=null},m===void 0&&h.setContentType(null),"setRequestHeader"in J&&Mn.forEach(h.toJSON(),function(K,W){J.setRequestHeader(W,K)}),Mn.isUndefined(u.withCredentials)||(J.withCredentials=!!u.withCredentials),b&&b!=="json"&&(J.responseType=u.responseType),x&&([O,L]=sz(x,!0),J.addEventListener("progress",O)),C&&J.upload&&([N,B]=sz(C),J.upload.addEventListener("progress",N),J.upload.addEventListener("loadend",B)),(u.cancelToken||u.signal)&&(_=K=>{J&&(i(!K||K.type?new b4(null,o,J):K),J.abort(),J=null)},u.cancelToken&&u.cancelToken.subscribe(_),u.signal&&(u.signal.aborted?_():u.signal.addEventListener("abort",_)));const ne=zhe(u.url);if(ne&&Xd.protocols.indexOf(ne)===-1){i(new Er("Unsupported protocol "+ne+":",Er.ERR_BAD_REQUEST,o));return}J.send(m||null)})},Xhe=(o,s)=>{const{length:i}=o=o?o.filter(Boolean):[];if(s||i){let u=new AbortController,m;const h=function(_){if(!m){m=!0,C();const N=_ instanceof Error?_:this.reason;u.abort(N instanceof Er?N:new b4(N instanceof Error?N.message:N))}};let b=s&&setTimeout(()=>{b=null,h(new Er(`timeout ${s} of ms exceeded`,Er.ETIMEDOUT))},s);const C=()=>{o&&(b&&clearTimeout(b),b=null,o.forEach(_=>{_.unsubscribe?_.unsubscribe(h):_.removeEventListener("abort",h)}),o=null)};o.forEach(_=>_.addEventListener("abort",h));const{signal:x}=u;return x.unsubscribe=()=>Mn.asap(C),x}},Jhe=function*(o,s){let i=o.byteLength;if(i<s){yield o;return}let u=0,m;for(;u<i;)m=u+s,yield o.slice(u,m),u=m},Qhe=async function*(o,s){for await(const i of e1e(o))yield*Jhe(i,s)},e1e=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}const s=o.getReader();try{for(;;){const{done:i,value:u}=await s.read();if(i)break;yield u}}finally{await s.cancel()}},Pre=(o,s,i,u)=>{const m=Qhe(o,s);let h=0,b,C=x=>{b||(b=!0,u&&u(x))};return new ReadableStream({async pull(x){try{const{done:_,value:N}=await m.next();if(_){C(),x.close();return}let O=N.byteLength;if(i){let B=h+=O;i(B)}x.enqueue(new Uint8Array(N))}catch(_){throw C(_),_}},cancel(x){return C(x),m.return()}},{highWaterMark:2})},Zz=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",jce=Zz&&typeof ReadableStream=="function",t1e=Zz&&(typeof TextEncoder=="function"?(o=>s=>o.encode(s))(new TextEncoder):async o=>new Uint8Array(await new Response(o).arrayBuffer())),Wce=(o,...s)=>{try{return!!o(...s)}catch{return!1}},n1e=jce&&Wce(()=>{let o=!1;const s=new Request(Xd.origin,{body:new ReadableStream,method:"POST",get duplex(){return o=!0,"half"}}).headers.has("Content-Type");return o&&!s}),Fre=64*1024,Pte=jce&&Wce(()=>Mn.isReadableStream(new Response("").body)),rz={stream:Pte&&(o=>o.body)};Zz&&(o=>{["text","arrayBuffer","blob","formData","stream"].forEach(s=>{!rz[s]&&(rz[s]=Mn.isFunction(o[s])?i=>i[s]():(i,u)=>{throw new Er(`Response type '${s}' is not supported`,Er.ERR_NOT_SUPPORT,u)})})})(new Response);const o1e=async o=>{if(o==null)return 0;if(Mn.isBlob(o))return o.size;if(Mn.isSpecCompliantForm(o))return(await new Request(Xd.origin,{method:"POST",body:o}).arrayBuffer()).byteLength;if(Mn.isArrayBufferView(o)||Mn.isArrayBuffer(o))return o.byteLength;if(Mn.isURLSearchParams(o)&&(o=o+""),Mn.isString(o))return(await t1e(o)).byteLength},s1e=async(o,s)=>Mn.toFiniteNumber(o.getContentLength())??o1e(s),r1e=Zz&&(async o=>{let{url:s,method:i,data:u,signal:m,cancelToken:h,timeout:b,onDownloadProgress:C,onUploadProgress:x,responseType:_,headers:N,withCredentials:O="same-origin",fetchOptions:B}=Uce(o);_=_?(_+"").toLowerCase():"text";let L=Xhe([m,h&&h.toAbortSignal()],b),j;const J=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let Y;try{if(x&&n1e&&i!=="get"&&i!=="head"&&(Y=await s1e(N,u))!==0){let ut=new Request(s,{method:"POST",body:u,duplex:"half"}),Le;if(Mn.isFormData(u)&&(Le=ut.headers.get("content-type"))&&N.setContentType(Le),ut.body){const[te,We]=Rre(Y,sz(Bre(x)));u=Pre(ut.body,Fre,te,We)}}Mn.isString(O)||(O=O?"include":"omit");const ne="credentials"in Request.prototype;j=new Request(s,{...B,signal:L,method:i.toUpperCase(),headers:N.normalize().toJSON(),body:u,duplex:"half",credentials:ne?O:void 0});let K=await fetch(j);const W=Pte&&(_==="stream"||_==="response");if(Pte&&(C||W&&J)){const ut={};["status","statusText","headers"].forEach(pt=>{ut[pt]=K[pt]});const Le=Mn.toFiniteNumber(K.headers.get("content-length")),[te,We]=C&&Rre(Le,sz(Bre(C),!0))||[];K=new Response(Pre(K.body,Fre,te,()=>{We&&We(),J&&J()}),ut)}_=_||"text";let Se=await rz[Mn.findKey(rz,_)||"text"](K,o);return!W&&J&&J(),await new Promise((ut,Le)=>{Hce(ut,Le,{data:Se,headers:Em.from(K.headers),status:K.status,statusText:K.statusText,config:o,request:j})})}catch(ne){throw J&&J(),ne&&ne.name==="TypeError"&&/fetch/i.test(ne.message)?Object.assign(new Er("Network Error",Er.ERR_NETWORK,o,j),{cause:ne.cause||ne}):Er.from(ne,ne&&ne.code,o,j)}}),Fte={http:whe,xhr:Khe,fetch:r1e};Mn.forEach(Fte,(o,s)=>{if(o){try{Object.defineProperty(o,"name",{value:s})}catch{}Object.defineProperty(o,"adapterName",{value:s})}});const Lre=o=>`- ${o}`,a1e=o=>Mn.isFunction(o)||o===null||o===!1,Zce={getAdapter:o=>{o=Mn.isArray(o)?o:[o];const{length:s}=o;let i,u;const m={};for(let h=0;h<s;h++){i=o[h];let b;if(u=i,!a1e(i)&&(u=Fte[(b=String(i)).toLowerCase()],u===void 0))throw new Er(`Unknown adapter '${b}'`);if(u)break;m[b||"#"+h]=u}if(!u){const h=Object.entries(m).map(([C,x])=>`adapter ${C} `+(x===!1?"is not supported by the environment":"is not available in the build"));let b=s?h.length>1?`since :
|
|
4
4
|
`+h.map(Lre).join(`
|
|
@@ -112,7 +112,7 @@ Required: `+w.join(", "));return bn[fe].apply(null,Ae)},log:bn=>{console.log(bn,
|
|
|
112
112
|
`:"")+"</video>",ye=(Xe,qe)=>{var Ft;const Yt=be.extend({},qe);if(!Yt.source&&(be.extend(Yt,tt((Ft=Yt.embed)!==null&&Ft!==void 0?Ft:"",Xe.schema)),!Yt.source))return"";Yt.altsource||(Yt.altsource=""),Yt.poster||(Yt.poster=""),Yt.source=Xe.convertURL(Yt.source,"source"),Yt.altsource=Xe.convertURL(Yt.altsource,"source"),Yt.sourcemime=pe(Yt.source),Yt.altsourcemime=pe(Yt.altsource),Yt.poster=Xe.convertURL(Yt.poster,"poster");const mo=Ct(Yt.source);if(mo&&(Yt.source=mo.url,Yt.type=mo.type,Yt.allowfullscreen=mo.allowFullscreen,Yt.width=Yt.width||String(mo.w),Yt.height=Yt.height||String(mo.h)),Yt.embed)return pn(Yt.embed,Yt,!0,Xe.schema);{const $o=ut(Xe),Zo=Le(Xe),js=te(Xe);return Yt.width=Yt.width||"300",Yt.height=Yt.height||"150",be.each(Yt,(ln,Wt)=>{Yt[Wt]=Xe.dom.encode(""+ln)}),Yt.type==="iframe"?Q(Yt,js):Yt.sourcemime==="application/x-shockwave-flash"?ie(Yt):Yt.sourcemime.indexOf("audio")!==-1?ce(Yt,$o):G(Yt,Zo)}},De=Xe=>Xe.hasAttribute("data-mce-object")||Xe.hasAttribute("data-ephox-embed-iri"),Ie=Xe=>{Xe.on("mousedown",qe=>{const Ft=Xe.dom.getParent(qe.target,".mce-preview-object");Ft&&Xe.dom.getAttrib(Ft,"data-mce-selected")==="2"&&qe.stopImmediatePropagation()}),Xe.on("click keyup touchend",()=>{const qe=Xe.selection.getNode();qe&&Xe.dom.hasClass(qe,"mce-preview-object")&&Xe.dom.getAttrib(qe,"data-mce-selected")&&qe.setAttribute("data-mce-selected","2")}),Xe.on("ObjectResized",qe=>{const Ft=qe.target;if(Ft.getAttribute("data-mce-object")){let Yt=Ft.getAttribute("data-mce-html");Yt&&(Yt=unescape(Yt),Ft.setAttribute("data-mce-html",escape(pn(Yt,{width:String(qe.width),height:String(qe.height)},!1,Xe.schema))))}})},dt={},je=(Xe,qe,Ft)=>new Promise((Yt,mo)=>{const $o=Zo=>(Zo.html&&(dt[Xe.source]=Zo),Yt({url:Xe.source,html:Zo.html?Zo.html:qe(Xe)}));dt[Xe.source]?$o(dt[Xe.source]):Ft({url:Xe.source}).then($o).catch(mo)}),bt=(Xe,qe)=>Promise.resolve({html:qe(Xe),url:Xe.source}),$t=Xe=>qe=>ye(Xe,qe),gn=(Xe,qe)=>{const Ft=ft(Xe);return Ft?je(qe,$t(Xe),Ft):bt(qe,$t(Xe))},Et=Xe=>K(dt,Xe),Bt=(Xe,qe)=>ne(qe,Xe).bind(Ft=>ne(Ft,"meta")),dn=(Xe,qe,Ft)=>Yt=>{const mo=()=>ne(Xe,Yt),$o=()=>ne(qe,Yt),Zo=Wt=>ne(Wt,"value").bind(Qe=>Qe.length>0?_.some(Qe):_.none()),js=()=>mo().bind(Wt=>h(Wt)?Zo(Wt).orThunk($o):$o().orThunk(()=>_.from(Wt))),ln=()=>$o().orThunk(()=>mo().bind(Wt=>h(Wt)?Zo(Wt):_.from(Wt)));return{[Yt]:(Yt===Ft?js():ln()).getOr("")}},_n=(Xe,qe)=>{const Ft={};return ne(Xe,"dimensions").each(Yt=>{O(["width","height"],mo=>{ne(qe,mo).orThunk(()=>ne(Yt,mo)).each($o=>Ft[mo]=$o)})}),Ft},xo=(Xe,qe)=>{const Ft=qe&&qe!=="dimensions"?Bt(qe,Xe).getOr({}):{},Yt=dn(Xe,Ft,qe);return{...Yt("source"),...Yt("altsource"),...Yt("poster"),...Yt("embed"),..._n(Xe,Ft)}},Qn=Xe=>{const qe={...Xe,source:{value:ne(Xe,"source").getOr("")},altsource:{value:ne(Xe,"altsource").getOr("")},poster:{value:ne(Xe,"poster").getOr("")}};return O(["width","height"],Ft=>{ne(Xe,Ft).each(Yt=>{const mo=qe.dimensions||{};mo[Ft]=Yt,qe.dimensions=mo})}),qe},Nt=Xe=>qe=>{const Ft=qe&&qe.msg?"Media embed handler error: "+qe.msg:"Media embed handler threw unknown error.";Xe.notificationManager.open({type:"error",text:Ft})},rn=Xe=>{const qe=Xe.selection.getNode(),Ft=De(qe)?Xe.serializer.serialize(qe,{selection:!0}):"",Yt=tt(Ft,Xe.schema),$o=(()=>{if(Ro(Yt.source,Yt.type)){const Zo=Xe.dom.getRect(qe);return{width:Zo.w.toString().replace(/px$/,""),height:Zo.h.toString().replace(/px$/,"")}}else return{}})();return{embed:Ft,...Yt,...$o}},an=(Xe,qe)=>Ft=>{if(m(Ft.url)&&Ft.url.trim().length>0){const Yt=Ft.html,$o={...tt(Yt,qe.schema),source:Ft.url,embed:Yt};Xe.setData(Qn($o))}},Nn=(Xe,qe)=>{const Ft=Xe.dom.select("*[data-mce-object]");for(let Yt=0;Yt<qe.length;Yt++)for(let mo=Ft.length-1;mo>=0;mo--)qe[Yt]===Ft[mo]&&Ft.splice(mo,1);Xe.selection.select(Ft[0])},ko=(Xe,qe)=>{const Ft=Xe.dom.select("*[data-mce-object]");Xe.insertContent(qe),Nn(Xe,Ft),Xe.nodeChanged()},Ro=(Xe,qe)=>x(qe)&&qe==="ephox-embed-iri"&&x(Ct(Xe)),ws=(Xe,qe)=>((Yt,mo)=>Yt.width!==mo.width||Yt.height!==mo.height)(Xe,qe)&&Ro(qe.source,Xe.type),yo=(Xe,qe,Ft)=>{var Yt;qe.embed=ws(Xe,qe)&&Pt(Ft)?ye(Ft,{...qe,embed:""}):pn((Yt=qe.embed)!==null&&Yt!==void 0?Yt:"",qe,!1,Ft.schema),qe.embed&&(Xe.source===qe.source||Et(qe.source))?ko(Ft,qe.embed):gn(Ft,qe).then(mo=>{ko(Ft,mo.html)}).catch(Nt(Ft))},Us=Xe=>{const qe=rn(Xe),Ft=L(qe),Yt=Qn(qe),mo=(oo,Co)=>{const Io=xo(Co.getData(),"source");oo.source!==Io.source&&(an(fo,Xe)({url:Io.source,html:""}),gn(Xe,Io).then(an(fo,Xe)).catch(Nt(Xe)))},$o=oo=>{var Co;const Io=xo(oo.getData()),ls=tt((Co=Io.embed)!==null&&Co!==void 0?Co:"",Xe.schema);oo.setData(Qn(ls))},Zo=(oo,Co,Io)=>{const ls=xo(oo.getData(),Co),Js=ws(Io,ls)&&Pt(Xe)?{...ls,embed:""}:ls,Es=ye(Xe,Js);oo.setData(Qn({...Js,embed:Es}))},js=[{name:"source",type:"urlinput",filetype:"media",label:"Source",picker_text:"Browse files"}],ln=Pt(Xe)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],Wt={title:"General",name:"general",items:B([js,ln])},st={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},cn=[];Oe(Xe)&&cn.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),ue(Xe)&&cn.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const yn={title:"Advanced",name:"advanced",items:cn},zn=[Wt,st];cn.length>0&&zn.push(yn);const co={type:"tabpanel",tabs:zn},fo=Xe.windowManager.open({title:"Insert/Edit Media",size:"normal",body:co,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:oo=>{const Co=xo(oo.getData());yo(Ft.get(),Co,Xe),oo.close()},onChange:(oo,Co)=>{switch(Co.name){case"source":mo(Ft.get(),oo);break;case"embed":$o(oo);break;case"dimensions":case"altsource":case"poster":Zo(oo,Co.name,Ft.get());break}Ft.set(xo(oo.getData()))},initialData:Yt})},fn=Xe=>({showDialog:()=>{Us(Xe)}}),Ho=Xe=>{const qe=()=>{Us(Xe)};Xe.addCommand("mceMedia",qe)},tr=(Xe,qe,Ft)=>Xe.length>=qe.length&&Xe.substr(Ft,Ft+qe.length)===qe,rr=(Xe,qe)=>tr(Xe,qe,0);var Ir=tinymce.util.Tools.resolve("tinymce.Env");const Pr=Xe=>{const qe=Xe.name;return qe==="iframe"||qe==="video"||qe==="audio"},ks=(Xe,qe,Ft,Yt=null)=>{const mo=Xe.attr(Ft);return x(mo)?mo:K(qe,Ft)?null:Yt},Nr=(Xe,qe,Ft)=>{const Yt=qe.name==="img"||Xe.name==="video",mo=Yt?"300":null,$o=Xe.name==="audio"?"30":"150",Zo=Yt?$o:null;qe.attr({width:ks(Xe,Ft,"width",mo),height:ks(Xe,Ft,"height",Zo)})},Xr=(Xe,qe,Ft,Yt)=>{const mo=He(Xe.schema).parse(Yt,{context:qe});for(;mo.firstChild;)Ft.append(mo.firstChild)},xs=(Xe,qe)=>{const Ft=qe.name,Yt=new Ze("img",1);return Ps(Xe,qe,Yt),Nr(qe,Yt,{}),Yt.attr({style:qe.attr("style"),src:Ir.transparentSrc,"data-mce-object":Ft,class:"mce-object mce-object-"+Ft}),Yt},uo=(Xe,qe)=>{var Ft;const Yt=qe.name,mo=new Ze("span",1);mo.attr({contentEditable:"false",style:qe.attr("style"),"data-mce-object":Yt,class:"mce-preview-object mce-object-"+Yt}),Ps(Xe,qe,mo);const $o=Xe.dom.parseStyle((Ft=qe.attr("style"))!==null&&Ft!==void 0?Ft:""),Zo=new Ze(Yt,1);if(Nr(qe,Zo,$o),Zo.attr({src:qe.attr("src"),style:qe.attr("style"),class:qe.attr("class")}),Yt==="iframe")Zo.attr({allowfullscreen:qe.attr("allowfullscreen"),frameborder:"0",sandbox:qe.attr("sandbox"),referrerpolicy:qe.attr("referrerpolicy")});else{O(["controls","crossorigin","currentTime","loop","muted","poster","preload"],Qe=>{Zo.attr(Qe,qe.attr(Qe))});const Wt=mo.attr("data-mce-html");x(Wt)&&Xr(Xe,Yt,Zo,unescape(Wt))}const js=new Ze("span",1);return js.attr("class","mce-shim"),mo.append(Zo),mo.append(js),mo},Ps=(Xe,qe,Ft)=>{var Yt;const mo=(Yt=qe.attributes)!==null&&Yt!==void 0?Yt:[];let $o=mo.length;for(;$o--;){const Wt=mo[$o].name;let Qe=mo[$o].value;Wt!=="width"&&Wt!=="height"&&Wt!=="style"&&!rr(Wt,"data-mce-")&&((Wt==="data"||Wt==="src")&&(Qe=Xe.convertURL(Qe,Wt)),Ft.attr("data-mce-p-"+Wt,Qe))}const Zo=Tt({inner:!0},Xe.schema),js=new Ze("div",1);O(qe.children(),Wt=>js.append(Wt));const ln=Zo.serialize(js);ln&&(Ft.attr("data-mce-html",escape(ln)),Ft.empty())},_t=Xe=>{const qe=Xe.attr("class");return m(qe)&&/\btiny-pageembed\b/.test(qe)},Ht=Xe=>{let qe=Xe;for(;qe=qe.parent;)if(qe.attr("data-ephox-embed-iri")||_t(qe))return!0;return!1},Fn=Xe=>qe=>{let Ft=qe.length,Yt;for(;Ft--;)Yt=qe[Ft],Yt.parent&&(Yt.parent.attr("data-mce-object")||(Pr(Yt)&&We(Xe)?Ht(Yt)||Yt.replace(uo(Xe,Yt)):Ht(Yt)||Yt.replace(xs(Xe,Yt))))},ao=(Xe,qe,Ft)=>{const Yt=Xe.options.get,mo=Yt("xss_sanitization"),$o=pt(Xe);return He(Xe.schema,{sanitize:mo,validate:$o}).parse(Ft,{context:qe})},Bo=Xe=>{Xe.on("PreInit",()=>{const{schema:qe,serializer:Ft,parser:Yt}=Xe,mo=qe.getBoolAttrs();O("webkitallowfullscreen mozallowfullscreen".split(" "),$o=>{mo[$o]={}}),Y({embed:["wmode"]},($o,Zo)=>{const js=qe.getElementRule(Zo);js&&O($o,ln=>{js.attributes[ln]={},js.attributesOrder.push(ln)})}),Yt.addNodeFilter("iframe,video,audio,object,embed",Fn(Xe)),Ft.addAttributeFilter("data-mce-object",($o,Zo)=>{var js;let ln=$o.length;for(;ln--;){const Wt=$o[ln];if(!Wt.parent)continue;const Qe=Wt.attr(Zo),st=new Ze(Qe,1);if(Qe!=="audio"){const co=Wt.attr("class");co&&co.indexOf("mce-preview-object")!==-1&&Wt.firstChild?st.attr({width:Wt.firstChild.attr("width"),height:Wt.firstChild.attr("height")}):st.attr({width:Wt.attr("width"),height:Wt.attr("height")})}st.attr({style:Wt.attr("style")});const cn=(js=Wt.attributes)!==null&&js!==void 0?js:[];let yn=cn.length;for(;yn--;){const co=cn[yn].name;co.indexOf("data-mce-p-")===0&&st.attr(co.substr(11),cn[yn].value)}const zn=Wt.attr("data-mce-html");if(zn){const co=ao(Xe,Qe,unescape(zn));O(co.children(),fo=>st.append(fo))}Wt.replace(st)}})}),Xe.on("SetContent",()=>{const qe=Xe.dom;O(qe.select("span.mce-preview-object"),Ft=>{qe.select("span.mce-shim",Ft).length===0&&qe.add(Ft,"span",{class:"mce-shim"})})})},is=Xe=>{Xe.on("ResolveName",qe=>{let Ft;qe.target.nodeType===1&&(Ft=qe.target.getAttribute("data-mce-object"))&&(qe.name=Ft)})},yr=Xe=>qe=>{const Ft=()=>{qe.setEnabled(Xe.selection.isEditable())};return Xe.on("NodeChange",Ft),Ft(),()=>{Xe.off("NodeChange",Ft)}},wr=Xe=>{const qe=()=>Xe.execCommand("mceMedia");Xe.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:qe,onSetup:Ft=>{const Yt=Xe.selection;Ft.setActive(De(Yt.getNode()));const mo=Yt.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",Ft.setActive).unbind,$o=yr(Xe)(Ft);return()=>{mo(),$o()}}}),Xe.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:qe,onSetup:yr(Xe)})};var ar=()=>{o.add("media",Xe=>(Se(Xe),Ho(Xe),wr(Xe),is(Xe),Bo(Xe),Ie(Xe),fn(Xe)))};ar()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=ne=>K=>typeof K===ne,i=s("boolean"),u=s("number"),m=ne=>K=>K.options.get(ne),h=ne=>{const K=ne.options.register;K("nonbreaking_force_tab",{processor:W=>i(W)?{value:W?3:0,valid:!0}:u(W)?{value:W,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),K("nonbreaking_wrap",{processor:"boolean",default:!0})},b=m("nonbreaking_force_tab"),C=m("nonbreaking_wrap"),x=(ne,K)=>{let W="";for(let Se=0;Se<K;Se++)W+=ne;return W},_=ne=>ne.plugins.visualchars?ne.plugins.visualchars.isEnabled():!1,N=(ne,K)=>{const W=()=>_(ne)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap",Se=()=>`<span class="${W()}" contenteditable="false">${x(" ",K)}</span>`,Le=C(ne)||ne.plugins.visualchars?Se():x(" ",K);ne.undoManager.transact(()=>ne.insertContent(Le))},O=ne=>{ne.addCommand("mceNonBreaking",()=>{N(ne,1)})};var B=tinymce.util.Tools.resolve("tinymce.util.VK");const L=ne=>{const K=b(ne);K>0&&ne.on("keydown",W=>{if(W.keyCode===B.TAB&&!W.isDefaultPrevented()){if(W.shiftKey)return;W.preventDefault(),W.stopImmediatePropagation(),N(ne,K)}})},j=ne=>K=>{const W=()=>{K.setEnabled(ne.selection.isEditable())};return ne.on("NodeChange",W),W(),()=>{ne.off("NodeChange",W)}},J=ne=>{const K=()=>ne.execCommand("mceNonBreaking");ne.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:K,onSetup:j(ne)}),ne.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:K,onSetup:j(ne)})};var Y=()=>{o.add("nonbreaking",ne=>{h(ne),O(ne),J(ne),L(ne)})};Y()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=tinymce.util.Tools.resolve("tinymce.Env");const i=j=>J=>J.options.get(j),u=j=>{const J=j.options.register;J("pagebreak_separator",{processor:"string",default:"<!-- pagebreak -->"}),J("pagebreak_split_block",{processor:"boolean",default:!1})},m=i("pagebreak_separator"),h=i("pagebreak_split_block"),b="mce-pagebreak",C=j=>{const J=`<img src="${s.transparentSrc}" class="${b}" data-mce-resize="false" data-mce-placeholder />`;return j?`<p>${J}</p>`:J},x=j=>{const J=m(j),Y=()=>h(j),ne=new RegExp(J.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,K=>"\\"+K),"gi");j.on("BeforeSetContent",K=>{K.content=K.content.replace(ne,C(Y()))}),j.on("PreInit",()=>{j.serializer.addNodeFilter("img",K=>{let W=K.length,Se,ut;for(;W--;)if(Se=K[W],ut=Se.attr("class"),ut&&ut.indexOf(b)!==-1){const Le=Se.parent;if(Le&&j.schema.getBlockElements()[Le.name]&&Y()){Le.type=3,Le.value=J,Le.raw=!0,Se.remove();continue}Se.type=3,Se.value=J,Se.raw=!0}})})},_=j=>{j.addCommand("mcePageBreak",()=>{j.insertContent(C(h(j)))})},N=j=>{j.on("ResolveName",J=>{J.target.nodeName==="IMG"&&j.dom.hasClass(J.target,b)&&(J.name="pagebreak")})},O=j=>J=>{const Y=()=>{J.setEnabled(j.selection.isEditable())};return j.on("NodeChange",Y),Y(),()=>{j.off("NodeChange",Y)}},B=j=>{const J=()=>j.execCommand("mcePageBreak");j.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:J,onSetup:O(j)}),j.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:J,onSetup:O(j)})};var L=()=>{o.add("pagebreak",j=>{u(j),_(j),B(j),x(j),N(j)})};L()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(Nt=>rn=>Nt===rn)(void 0),u=Nt=>Nt==null,m=Nt=>!u(Nt);class h{constructor(rn,an){this.tag=rn,this.value=an}static some(rn){return new h(!0,rn)}static none(){return h.singletonNone}fold(rn,an){return this.tag?an(this.value):rn()}isSome(){return this.tag}isNone(){return!this.tag}map(rn){return this.tag?h.some(rn(this.value)):h.none()}bind(rn){return this.tag?rn(this.value):h.none()}exists(rn){return this.tag&&rn(this.value)}forall(rn){return!this.tag||rn(this.value)}filter(rn){return!this.tag||rn(this.value)?this:h.none()}getOr(rn){return this.tag?this.value:rn}or(rn){return this.tag?this:rn}getOrThunk(rn){return this.tag?this.value:rn()}orThunk(rn){return this.tag?this:rn()}getOrDie(rn){if(this.tag)return this.value;throw new Error(rn??"Called getOrDie on None")}static from(rn){return m(rn)?h.some(rn):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(rn){this.tag&&rn(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}h.singletonNone=new h(!1);const b=Nt=>()=>Nt,C=b(!1),x=(Nt,rn,an)=>{for(let Nn=0,ko=Nt.length;Nn<ko;Nn++){const Ro=Nt[Nn];if(rn(Ro,Nn))return h.some(Ro);if(an(Ro,Nn))break}return h.none()},_=(Nt,rn)=>x(Nt,rn,C),N=(Nt,rn)=>{for(let an=0;an<Nt.length;an++){const Nn=rn(Nt[an],an);if(Nn.isSome())return Nn}return h.none()};typeof window<"u"||Function("return this;")();const O=Nt=>{let rn=!1,an;return(...Nn)=>(rn||(rn=!0,an=Nt.apply(null,Nn)),an)},B=(Nt,rn,an,Nn)=>{const ko=Nt.isiOS()&&/ipad/i.test(an)===!0,Ro=Nt.isiOS()&&!ko,ws=Nt.isiOS()||Nt.isAndroid(),yo=ws||Nn("(pointer:coarse)"),Us=ko||!Ro&&ws&&Nn("(min-device-width:768px)"),fn=Ro||ws&&!Us,Ho=rn.isSafari()&&Nt.isiOS()&&/safari/i.test(an)===!1,tr=!fn&&!Us&&!Ho;return{isiPad:b(ko),isiPhone:b(Ro),isTablet:b(Us),isPhone:b(fn),isTouch:b(yo),isAndroid:Nt.isAndroid,isiOS:Nt.isiOS,isWebView:b(Ho),isDesktop:b(tr)}},L=(Nt,rn)=>{for(let an=0;an<Nt.length;an++){const Nn=Nt[an];if(Nn.test(rn))return Nn}},j=(Nt,rn)=>{const an=L(Nt,rn);if(!an)return{major:0,minor:0};const Nn=ko=>Number(rn.replace(an,"$"+ko));return ne(Nn(1),Nn(2))},J=(Nt,rn)=>{const an=String(rn).toLowerCase();return Nt.length===0?Y():j(Nt,an)},Y=()=>ne(0,0),ne=(Nt,rn)=>({major:Nt,minor:rn}),K={nu:ne,detect:J,unknown:Y},W=(Nt,rn)=>N(rn.brands,an=>{const Nn=an.brand.toLowerCase();return _(Nt,ko=>{var Ro;return Nn===((Ro=ko.brand)===null||Ro===void 0?void 0:Ro.toLowerCase())}).map(ko=>({current:ko.name,version:K.nu(parseInt(an.version,10),0)}))}),Se=(Nt,rn)=>{const an=String(rn).toLowerCase();return _(Nt,Nn=>Nn.search(an))},ut=(Nt,rn)=>Se(Nt,rn).map(an=>{const Nn=K.detect(an.versionRegexes,rn);return{current:an.name,version:Nn}}),Le=(Nt,rn)=>Se(Nt,rn).map(an=>{const Nn=K.detect(an.versionRegexes,rn);return{current:an.name,version:Nn}}),te=(Nt,rn,an=0,Nn)=>{const ko=Nt.indexOf(rn,an);return ko!==-1?i(Nn)?!0:ko+rn.length<=Nn:!1},We=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,pt=Nt=>rn=>te(rn,Nt),ft=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:Nt=>te(Nt,"edge/")&&te(Nt,"chrome")&&te(Nt,"safari")&&te(Nt,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,We],search:Nt=>te(Nt,"chrome")&&!te(Nt,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:Nt=>te(Nt,"msie")||te(Nt,"trident")},{name:"Opera",versionRegexes:[We,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:pt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:pt("firefox")},{name:"Safari",versionRegexes:[We,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:Nt=>(te(Nt,"safari")||te(Nt,"mobile/"))&&te(Nt,"applewebkit")}],Oe=[{name:"Windows",search:pt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:Nt=>te(Nt,"iphone")||te(Nt,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:pt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:pt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:pt("linux"),versionRegexes:[]},{name:"Solaris",search:pt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:pt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:pt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ue={browsers:b(ft),oses:b(Oe)},Pt="Edge",be="Chromium",$e="IE",R="Opera",Ue="Firefox",ve="Safari",nt=()=>tt({current:void 0,version:K.unknown()}),tt=Nt=>{const rn=Nt.current,an=Nt.version,Nn=ko=>()=>rn===ko;return{current:rn,version:an,isEdge:Nn(Pt),isChromium:Nn(be),isIE:Nn($e),isOpera:Nn(R),isFirefox:Nn(Ue),isSafari:Nn(ve)}},pe={unknown:nt,nu:tt,edge:b(Pt),chromium:b(be),ie:b($e),opera:b(R),firefox:b(Ue),safari:b(ve)},Ze="Windows",Tt="iOS",He="Android",vt="Linux",Re="macOS",ct="Solaris",oe="FreeBSD",pn="ChromeOS",gt=()=>St({current:void 0,version:K.unknown()}),St=Nt=>{const rn=Nt.current,an=Nt.version,Nn=ko=>()=>rn===ko;return{current:rn,version:an,isWindows:Nn(Ze),isiOS:Nn(Tt),isAndroid:Nn(He),isMacOS:Nn(Re),isLinux:Nn(vt),isSolaris:Nn(ct),isFreeBSD:Nn(oe),isChromeOS:Nn(pn)}},jt={unknown:gt,nu:St,windows:b(Ze),ios:b(Tt),android:b(He),linux:b(vt),macos:b(Re),solaris:b(ct),freebsd:b(oe),chromeos:b(pn)},Q={detect:(Nt,rn,an)=>{const Nn=ue.browsers(),ko=ue.oses(),Ro=rn.bind(Us=>W(Nn,Us)).orThunk(()=>ut(Nn,Nt)).fold(pe.unknown,pe.nu),ws=Le(ko,Nt).fold(jt.unknown,jt.nu),yo=B(ws,Ro,Nt,an);return{browser:Ro,os:ws,deviceType:yo}}},ie=Nt=>window.matchMedia(Nt).matches;let ce=O(()=>Q.detect(window.navigator.userAgent,h.from(window.navigator.userAgentData),ie));const G=()=>ce(),ye=()=>G().os.isMacOS(),De=()=>G().os.isiOS(),Ie=()=>{const Nt=ye()||De();return`<script>(${(an=>{document.addEventListener("click",Nn=>{for(let ko=Nn.target;ko;ko=ko.parentNode)if(ko.nodeName==="A"){const ws=ko.getAttribute("href");if(ws&&ws.startsWith("#")){Nn.preventDefault();const Us=document.getElementById(ws.substring(1));Us&&Us.scrollIntoView({behavior:"smooth"});return}(an?Nn.metaKey:Nn.ctrlKey&&!Nn.altKey)||Nn.preventDefault()}},!1)}).toString()})(${Nt})<\/script>`};var dt=tinymce.util.Tools.resolve("tinymce.util.Tools");const je=Nt=>rn=>rn.options.get(Nt),bt=je("content_style"),$t=je("content_css_cors"),gn=je("body_class"),Et=je("body_id"),Bt=Nt=>{var rn;let an="";const Nn=Nt.dom.encode,ko=(rn=bt(Nt))!==null&&rn!==void 0?rn:"";an+=`<base href="${Nn(Nt.documentBaseURI.getURI())}">`;const Ro=$t(Nt)?' crossorigin="anonymous"':"";dt.each(Nt.contentCSS,tr=>{an+='<link type="text/css" rel="stylesheet" href="'+Nn(Nt.documentBaseURI.toAbsolute(tr))+'"'+Ro+">"}),ko&&(an+='<style type="text/css">'+ko+"</style>");const ws=Et(Nt),yo=gn(Nt),Us=Nt.getBody().dir,fn=Us?' dir="'+Nn(Us)+'"':"";return"<!DOCTYPE html><html><head>"+an+'</head><body id="'+Nn(ws)+'" class="mce-content-body '+Nn(yo)+'"'+fn+">"+Nt.getContent()+Ie()+"</body></html>"},dn=Nt=>{const rn=Bt(Nt);Nt.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0,transparent:!1}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:rn}}).focus("close")},_n=Nt=>{Nt.addCommand("mcePreview",()=>{dn(Nt)})},xo=Nt=>{const rn=()=>Nt.execCommand("mcePreview");Nt.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:rn,context:"any"}),Nt.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:rn,context:"any"})};var Qn=()=>{o.add("preview",Nt=>{_n(Nt),xo(Nt)})};Qn()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=()=>window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295;let i=0;const u=Ct=>{const ie=new Date().getTime(),ce=Math.floor(s()*1e9);return i++,Ct+"_"+ce+i+String(ie)},m=(Ct,Q,ie)=>{Ct.execCommand("mceInsertTable",!1,{rows:ie,columns:Q})},h=(Ct,Q,ie)=>{const ce=Ct.editorUpload.blobCache,G=ce.create(u("mceu"),ie,Q);ce.add(G),Ct.insertContent(Ct.dom.createHTML("img",{src:G.blobUri()}))},b=Ct=>new Promise(Q=>{const ie=new FileReader;ie.onloadend=()=>{Q(ie.result.split(",")[1])},ie.readAsDataURL(Ct)});var C=tinymce.util.Tools.resolve("tinymce.util.Delay");const x=Ct=>new Promise(Q=>{let ie=!1;const ce=document.createElement("input");ce.type="file",ce.accept="image/*",ce.style.position="fixed",ce.style.left="0",ce.style.top="0",ce.style.opacity="0.001",document.body.appendChild(ce);const G=Ie=>{var dt;ie||((dt=ce.parentNode)===null||dt===void 0||dt.removeChild(ce),ie=!0,Q(Ie))},ye=Ie=>{G(Array.prototype.slice.call(Ie.target.files))};ce.addEventListener("input",ye),ce.addEventListener("change",ye);const De=Ie=>{const dt=()=>{G([])};ie||(Ie.type==="focusin"?C.setEditorTimeout(Ct,dt,1e3):dt()),Ct.off("focusin remove",De)};Ct.on("focusin remove",De),ce.click()}),_=Ct=>{Ct.on("PreInit",()=>{Ct.queryCommandSupported("QuickbarInsertImage")||Ct.addCommand("QuickbarInsertImage",()=>{x(Ct).then(Q=>{if(Q.length>0){const ie=Q[0];b(ie).then(ce=>{h(Ct,ce,ie)})}})})})},N=(Ct,Q,ie)=>{var ce;return ie(Ct,Q.prototype)?!0:((ce=Ct.constructor)===null||ce===void 0?void 0:ce.name)===Q.name},O=Ct=>{const Q=typeof Ct;return Ct===null?"null":Q==="object"&&Array.isArray(Ct)?"array":Q==="object"&&N(Ct,String,(ie,ce)=>ce.isPrototypeOf(ie))?"string":Q},B=Ct=>Q=>O(Q)===Ct,L=Ct=>Q=>typeof Q===Ct,j=B("string"),J=L("boolean"),Y=Ct=>Ct==null,ne=Ct=>!Y(Ct),K=L("function"),W=Ct=>Q=>Q.options.get(Ct),Se=Ct=>{const Q=Ct.options.register,ie=De=>Ie=>{const dt=J(Ie)||j(Ie);return dt?J(Ie)?{value:Ie?De:"",valid:dt}:{value:Ie.trim(),valid:dt}:{valid:!1,message:"Must be a boolean or string."}},ce="bold italic | quicklink h2 h3 blockquote";Q("quickbars_selection_toolbar",{processor:ie(ce),default:ce});const G="quickimage quicktable";Q("quickbars_insert_toolbar",{processor:ie(G),default:G});const ye="alignleft aligncenter alignright";Q("quickbars_image_toolbar",{processor:ie(ye),default:ye})},ut=W("quickbars_selection_toolbar"),Le=W("quickbars_insert_toolbar"),te=W("quickbars_image_toolbar"),We=Ct=>{Ct.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:()=>Ct.execCommand("QuickbarInsertImage")}),Ct.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:()=>{m(Ct,2,2)}})},ft=(Ct=>()=>Ct)(!1);class Oe{constructor(Q,ie){this.tag=Q,this.value=ie}static some(Q){return new Oe(!0,Q)}static none(){return Oe.singletonNone}fold(Q,ie){return this.tag?ie(this.value):Q()}isSome(){return this.tag}isNone(){return!this.tag}map(Q){return this.tag?Oe.some(Q(this.value)):Oe.none()}bind(Q){return this.tag?Q(this.value):Oe.none()}exists(Q){return this.tag&&Q(this.value)}forall(Q){return!this.tag||Q(this.value)}filter(Q){return!this.tag||Q(this.value)?this:Oe.none()}getOr(Q){return this.tag?this.value:Q}or(Q){return this.tag?this:Q}getOrThunk(Q){return this.tag?this.value:Q()}orThunk(Q){return this.tag?this:Q()}getOrDie(Q){if(this.tag)return this.value;throw new Error(Q??"Called getOrDie on None")}static from(Q){return ne(Q)?Oe.some(Q):Oe.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Q){this.tag&&Q(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Oe.singletonNone=new Oe(!1),typeof window<"u"||Function("return this;")();const ue=1,Pt=Ct=>Ct.dom.nodeName.toLowerCase(),be=(Ct,Q)=>{const ie=Ct.dom;return ie&&ie.hasAttribute?ie.hasAttribute(Q):!1};var $e=(Ct,Q,ie,ce,G)=>Ct(ie,ce)?Oe.some(ie):K(G)&&G(ie)?Oe.none():Q(ie,ce,G);const R=(Ct,Q)=>{const ce=(Q||document).createElement("div");if(ce.innerHTML=Ct,!ce.hasChildNodes()||ce.childNodes.length>1){const G="HTML does not have a single root node";throw console.error(G,Ct),new Error(G)}return nt(ce.childNodes[0])},Ue=(Ct,Q)=>{const ce=(Q||document).createElement(Ct);return nt(ce)},ve=(Ct,Q)=>{const ce=(Q||document).createTextNode(Ct);return nt(ce)},nt=Ct=>{if(Ct==null)throw new Error("Node cannot be null or undefined");return{dom:Ct}},pe={fromHtml:R,fromTag:Ue,fromText:ve,fromDom:nt,fromPoint:(Ct,Q,ie)=>Oe.from(Ct.dom.elementFromPoint(Q,ie)).map(nt)},Ze=(Ct,Q)=>{const ie=Ct.dom;if(ie.nodeType!==ue)return!1;{const ce=ie;if(ce.matches!==void 0)return ce.matches(Q);if(ce.msMatchesSelector!==void 0)return ce.msMatchesSelector(Q);if(ce.webkitMatchesSelector!==void 0)return ce.webkitMatchesSelector(Q);if(ce.mozMatchesSelector!==void 0)return ce.mozMatchesSelector(Q);throw new Error("Browser lacks native selectors")}},Tt=(Ct,Q,ie)=>{let ce=Ct.dom;const G=K(ie)?ie:ft;for(;ce.parentNode;){ce=ce.parentNode;const ye=pe.fromDom(ce);if(Q(ye))return Oe.some(ye);if(G(ye))break}return Oe.none()},He=(Ct,Q,ie)=>$e((G,ye)=>ye(G),Tt,Ct,Q,ie),vt=(Ct,Q,ie)=>He(Ct,Q,ie).isSome(),Re=(Ct,Q,ie)=>Tt(Ct,ce=>Ze(ce,Q),ie),ct=(Ct,Q,ie)=>$e((G,ye)=>Ze(G,ye),Re,Ct,Q,ie),oe=Ct=>{const Q=Le(Ct);Q.length>0&&Ct.ui.registry.addContextToolbar("quickblock",{predicate:ie=>{const ce=pe.fromDom(ie),G=Ct.schema.getTextBlockElements(),ye=De=>De.dom===Ct.getBody();return!be(ce,"data-mce-bogus")&&ct(ce,'table,[data-mce-bogus="all"]',ye).fold(()=>vt(ce,De=>Pt(De)in G&&Ct.dom.isEmpty(De.dom),ye),ft)},items:Q,position:"line",scope:"editor"})},pn=Ct=>Ct.dom.classList!==void 0,gt=(Ct,Q)=>pn(Ct)&&Ct.dom.classList.contains(Q),St=Ct=>{const Q=De=>Ct.dom.isEditable(De),ie=De=>Q(De.parentElement),ce=De=>{const Ie=De.nodeName==="FIGURE"&&/image/i.test(De.className),dt=De.nodeName==="IMG"||Ie,je=gt(pe.fromDom(De),"mce-pagebreak");return dt&&ie(De)&&!je},G=te(Ct);G.length>0&&Ct.ui.registry.addContextToolbar("imageselection",{predicate:ce,items:G,position:"node"});const ye=ut(Ct);ye.length>0&&Ct.ui.registry.addContextToolbar("textselection",{predicate:De=>!ce(De)&&!Ct.selection.isCollapsed()&&Q(De),items:ye,position:"selection",scope:"editor"})};var jt=()=>{o.add("quickbars",Ct=>{Se(Ct),_(Ct),We(Ct),oe(Ct),St(Ct)})};jt()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(ne=>K=>typeof K===ne)("function");var u=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=tinymce.util.Tools.resolve("tinymce.util.Tools");const h=ne=>K=>K.options.get(ne),b=ne=>{const K=ne.options.register;K("save_enablewhendirty",{processor:"boolean",default:!0}),K("save_onsavecallback",{processor:"function"}),K("save_oncancelcallback",{processor:"function"})},C=h("save_enablewhendirty"),x=h("save_onsavecallback"),_=h("save_oncancelcallback"),N=(ne,K)=>{ne.notificationManager.open({text:K,type:"error"})},O=ne=>{const K=u.DOM.getParent(ne.id,"form");if(C(ne)&&!ne.isDirty())return;ne.save();const W=x(ne);if(i(W)){W.call(ne,ne),ne.nodeChanged();return}K?(ne.setDirty(!1),(!K.onsubmit||K.onsubmit())&&(typeof K.submit=="function"?K.submit():N(ne,"Error: Form submit field collision.")),ne.nodeChanged()):N(ne,"Error: No form element found.")},B=ne=>{const K=m.trim(ne.startContent),W=_(ne);if(i(W)){W.call(ne,ne);return}ne.resetContent(K)},L=ne=>{ne.addCommand("mceSave",()=>{O(ne)}),ne.addCommand("mceCancel",()=>{B(ne)})},j=ne=>K=>{const W=()=>{K.setEnabled(!C(ne)||ne.isDirty())};return W(),ne.on("NodeChange dirty",W),()=>ne.off("NodeChange dirty",W)},J=ne=>{ne.ui.registry.addButton("save",{icon:"save",tooltip:"Save",enabled:!1,onAction:()=>ne.execCommand("mceSave"),onSetup:j(ne),shortcut:"Meta+S"}),ne.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",enabled:!1,onAction:()=>ne.execCommand("mceCancel"),onSetup:j(ne)}),ne.addShortcut("Meta+S","","mceSave")};var Y=()=>{o.add("save",ne=>{b(ne),J(ne),L(ne)})};Y()})();(function(){const o=Qe=>{let st=Qe;return{get:()=>st,set:zn=>{st=zn}}};var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(Qe,st,cn)=>{var yn;return cn(Qe,st.prototype)?!0:((yn=Qe.constructor)===null||yn===void 0?void 0:yn.name)===st.name},u=Qe=>{const st=typeof Qe;return Qe===null?"null":st==="object"&&Array.isArray(Qe)?"array":st==="object"&&i(Qe,String,(cn,yn)=>yn.isPrototypeOf(cn))?"string":st},m=Qe=>st=>u(st)===Qe,h=Qe=>st=>typeof st===Qe,b=m("string"),C=m("array"),x=h("boolean"),_=Qe=>Qe==null,N=Qe=>!_(Qe),O=h("number"),B=()=>{},L=Qe=>()=>Qe,j=L(!0),Y=L("[~№|!-*+-\\/:;?@\\[-`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]");class ne{constructor(st,cn){this.tag=st,this.value=cn}static some(st){return new ne(!0,st)}static none(){return ne.singletonNone}fold(st,cn){return this.tag?cn(this.value):st()}isSome(){return this.tag}isNone(){return!this.tag}map(st){return this.tag?ne.some(st(this.value)):ne.none()}bind(st){return this.tag?st(this.value):ne.none()}exists(st){return this.tag&&st(this.value)}forall(st){return!this.tag||st(this.value)}filter(st){return!this.tag||st(this.value)?this:ne.none()}getOr(st){return this.tag?this.value:st}or(st){return this.tag?this:st}getOrThunk(st){return this.tag?this.value:st()}orThunk(st){return this.tag?this:st()}getOrDie(st){if(this.tag)return this.value;throw new Error(st??"Called getOrDie on None")}static from(st){return N(st)?ne.some(st):ne.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(st){this.tag&&st(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}ne.singletonNone=new ne(!1);const K=Y;var W=tinymce.util.Tools.resolve("tinymce.Env"),Se=tinymce.util.Tools.resolve("tinymce.util.Tools");const ut=Array.prototype.slice,Le=Array.prototype.push,te=(Qe,st)=>{const cn=Qe.length,yn=new Array(cn);for(let zn=0;zn<cn;zn++){const co=Qe[zn];yn[zn]=st(co,zn)}return yn},We=(Qe,st)=>{for(let cn=0,yn=Qe.length;cn<yn;cn++){const zn=Qe[cn];st(zn,cn)}},pt=(Qe,st)=>{for(let cn=Qe.length-1;cn>=0;cn--){const yn=Qe[cn];st(yn,cn)}},ft=(Qe,st)=>{if(Qe.length===0)return[];{let cn=st(Qe[0]);const yn=[];let zn=[];for(let co=0,fo=Qe.length;co<fo;co++){const oo=Qe[co],Co=st(oo);Co!==cn&&(yn.push(zn),zn=[]),cn=Co,zn.push(oo)}return zn.length!==0&&yn.push(zn),yn}},Oe=(Qe,st,cn)=>(We(Qe,(yn,zn)=>{cn=st(cn,yn,zn)}),cn),ue=Qe=>{const st=[];for(let cn=0,yn=Qe.length;cn<yn;++cn){if(!C(Qe[cn]))throw new Error("Arr.flatten item "+cn+" was not an array, input: "+Qe);Le.apply(st,Qe[cn])}return st},Pt=(Qe,st)=>ue(te(Qe,st)),be=(Qe,st)=>{const cn=ut.call(Qe,0);return cn.sort(st),cn},$e=Object.hasOwnProperty,R=(Qe,st)=>$e.call(Qe,st);typeof window<"u"||Function("return this;")();const Ue=9,ve=11,nt=1,tt=3,pe=Qe=>Qe.dom.nodeType,Tt=(Qe=>st=>pe(st)===Qe)(tt),He=(Qe,st,cn)=>{if(b(cn)||x(cn)||O(cn))Qe.setAttribute(st,cn+"");else throw console.error("Invalid call to Attribute.set. Key ",st,":: Value ",cn,":: Element ",Qe),new Error("Attribute value was not simple")},vt=(Qe,st,cn)=>{He(Qe.dom,st,cn)},Re=(Qe,st)=>{const yn=(st||document).createElement("div");if(yn.innerHTML=Qe,!yn.hasChildNodes()||yn.childNodes.length>1){const zn="HTML does not have a single root node";throw console.error(zn,Qe),new Error(zn)}return pn(yn.childNodes[0])},ct=(Qe,st)=>{const yn=(st||document).createElement(Qe);return pn(yn)},oe=(Qe,st)=>{const yn=(st||document).createTextNode(Qe);return pn(yn)},pn=Qe=>{if(Qe==null)throw new Error("Node cannot be null or undefined");return{dom:Qe}},St={fromHtml:Re,fromTag:ct,fromText:oe,fromDom:pn,fromPoint:(Qe,st,cn)=>ne.from(Qe.dom.elementFromPoint(st,cn)).map(pn)},jt=Qe=>Qe.nodeType!==nt&&Qe.nodeType!==Ue&&Qe.nodeType!==ve||Qe.childElementCount===0,Ct=(Qe,st)=>{const cn=st===void 0?document:st.dom;return jt(cn)?[]:te(cn.querySelectorAll(Qe),St.fromDom)},Q=Qe=>ne.from(Qe.dom.parentNode).map(St.fromDom),ie=Qe=>te(Qe.dom.childNodes,St.fromDom),ce=(Qe,st)=>({element:Qe,offset:st}),G=(Qe,st)=>{const cn=ie(Qe);return cn.length>0&&st<cn.length?ce(cn[st],0):ce(Qe,st)},ye=(Qe,st)=>{Q(Qe).each(yn=>{yn.dom.insertBefore(st.dom,Qe.dom)})},De=(Qe,st)=>{Qe.dom.appendChild(st.dom)},Ie=(Qe,st)=>{ye(Qe,st),De(st,Qe)},je=((Qe,st)=>{const cn=co=>{if(!Qe(co))throw new Error("Can only get "+st+" value of a "+st+" node");return yn(co).getOr("")},yn=co=>Qe(co)?ne.from(co.dom.nodeValue):ne.none();return{get:cn,getOption:yn,set:(co,fo)=>{if(!Qe(co))throw new Error("Can only set raw "+st+" value of a "+st+" node");co.dom.nodeValue=fo}}})(Tt,"text"),bt=Qe=>je.get(Qe),$t=(Qe,st,cn)=>(Qe.compareDocumentPosition(st)&cn)!==0,gn=(Qe,st)=>$t(Qe,st,Node.DOCUMENT_POSITION_PRECEDING),Et=(Qe,st)=>Ct(st,Qe);var Bt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const dn=(Qe,st)=>Qe.isBlock(st)||R(Qe.schema.getVoidElements(),st.nodeName),_n=(Qe,st)=>!Qe.isEditable(st),xo=(Qe,st)=>Qe.getContentEditable(st)==="true"&&st.parentNode&&!Qe.isEditable(st.parentNode),Qn=(Qe,st)=>!Qe.isBlock(st)&&R(Qe.schema.getWhitespaceElements(),st.nodeName),Nt=(Qe,st)=>dn(Qe,st)||_n(Qe,st)||Qn(Qe,st)||xo(Qe,st),rn=Qe=>Qe.nodeType===3,an=()=>({sOffset:0,fOffset:0,elements:[]}),Nn=(Qe,st)=>G(St.fromDom(Qe),st),ko=(Qe,st,cn,yn,zn,co=!0)=>{let fo=co?st(!1):cn;for(;fo;){const oo=_n(Qe,fo);if(oo||Qn(Qe,fo)){if(oo?yn.cef(fo):yn.boundary(fo))break;fo=st(!0);continue}else if(dn(Qe,fo)){if(yn.boundary(fo))break}else rn(fo)&&yn.text(fo);if(fo===zn)break;fo=st(!1)}},Ro=(Qe,st,cn,yn,zn)=>{var co;if(Nt(Qe,cn))return;const fo=(co=Qe.getParent(yn,Qe.isBlock))!==null&&co!==void 0?co:Qe.getRoot(),oo=new Bt(cn,fo),Co=zn?oo.next.bind(oo):oo.prev.bind(oo);ko(Qe,Co,cn,{boundary:j,cef:j,text:Io=>{zn?st.fOffset+=Io.length:st.sOffset+=Io.length,st.elements.push(St.fromDom(Io))}})},ws=(Qe,st,cn,yn,zn,co=!0)=>{const fo=new Bt(cn,st),oo=[];let Co=an();Ro(Qe,Co,cn,st,!1);const Io=()=>(Co.elements.length>0&&(oo.push(Co),Co=an()),!1);return ko(Qe,fo.next.bind(fo),cn,{boundary:Io,cef:ls=>(Io(),zn&&oo.push(...zn.cef(ls)),!1),text:ls=>{Co.elements.push(St.fromDom(ls)),zn&&zn.text(ls,Co)}},yn,co),yn&&Ro(Qe,Co,yn,st,!0),Io(),oo},yo=(Qe,st)=>{const cn=Nn(st.startContainer,st.startOffset),yn=cn.element.dom,zn=Nn(st.endContainer,st.endOffset),co=zn.element.dom;return ws(Qe,st.commonAncestorContainer,yn,co,{text:(fo,oo)=>{fo===co?oo.fOffset+=fo.length-zn.offset:fo===yn&&(oo.sOffset+=cn.offset)},cef:fo=>{const oo=Pt(Et(St.fromDom(fo),"*[contenteditable=true]"),Co=>{const Io=Co.dom;return ws(Qe,Io,Io)});return be(oo,(Co,Io)=>gn(Co.elements[0].dom,Io.elements[0].dom)?1:-1)}},!1)},Us=(Qe,st)=>st.collapsed?[]:yo(Qe,st),fn=(Qe,st)=>{const cn=Qe.createRng();return cn.selectNode(st),Us(Qe,cn)},Ho=(Qe,st)=>Pt(st,cn=>fn(Qe,cn)),tr=(Qe,st,cn=0,yn=Qe.length)=>{const zn=st.regex;zn.lastIndex=cn;const co=[];let fo;for(;fo=zn.exec(Qe);){const oo=fo[st.matchIndex],Co=fo.index+fo[0].indexOf(oo),Io=Co+oo.length;if(Io>yn)break;co.push({start:Co,finish:Io}),zn.lastIndex=Io}return co},rr=(Qe,st)=>{const cn=Oe(Qe,(yn,zn)=>{const co=bt(zn),fo=yn.last,oo=fo+co.length,Co=Pt(st,(Io,ls)=>Io.start<oo&&Io.finish>fo?[{element:zn,start:Math.max(fo,Io.start)-fo,finish:Math.min(oo,Io.finish)-fo,matchId:ls}]:[]);return{results:yn.results.concat(Co),last:oo}},{results:[],last:0}).results;return ft(cn,yn=>yn.matchId)},Ir=(Qe,st)=>Pt(st,cn=>{const yn=cn.elements,zn=te(yn,bt).join(""),co=tr(zn,Qe,cn.sOffset,zn.length-cn.fOffset);return rr(yn,co)}),Pr=(Qe,st)=>{pt(Qe,(cn,yn)=>{pt(cn,zn=>{const co=St.fromDom(st.cloneNode(!1));vt(co,"data-mce-index",yn);const fo=zn.element.dom;if(fo.length===zn.finish&&zn.start===0)Ie(zn.element,co);else{fo.length!==zn.finish&&fo.splitText(zn.finish);const oo=fo.splitText(zn.start);Ie(St.fromDom(oo),co)}})})},ks=(Qe,st,cn,yn)=>{const zn=fn(Qe,cn),co=Ir(st,zn);return Pr(co,yn),co.length},Nr=(Qe,st,cn,yn)=>{const zn=cn.getBookmark(),co=Qe.select("td[data-mce-selected],th[data-mce-selected]"),fo=co.length>0?Ho(Qe,co):Us(Qe,cn.getRng()),oo=Ir(st,fo);return Pr(oo,yn),cn.moveToBookmark(zn),oo.length},Xr=Qe=>Qe.getAttribute("data-mce-index"),xs=(Qe,st,cn,yn)=>{const zn=Qe.dom.create("span",{"data-mce-bogus":1});zn.className="mce-match-marker";const co=Qe.getBody();return ar(Qe,st,!1),yn?Nr(Qe.dom,cn,Qe.selection,zn):ks(Qe.dom,cn,co,zn)},uo=Qe=>{var st;const cn=Qe.parentNode;Qe.firstChild&&cn.insertBefore(Qe.firstChild,Qe),(st=Qe.parentNode)===null||st===void 0||st.removeChild(Qe)},Ps=(Qe,st)=>{const cn=[],yn=Se.toArray(Qe.getBody().getElementsByTagName("span"));if(yn.length)for(let zn=0;zn<yn.length;zn++){const co=Xr(yn[zn]);co===null||!co.length||co===st.toString()&&cn.push(yn[zn])}return cn},_t=(Qe,st,cn)=>{const yn=st.get();let zn=yn.index;const co=Qe.dom;cn?zn+1===yn.count?zn=0:zn++:zn-1===-1?zn=yn.count-1:zn--,co.removeClass(Ps(Qe,yn.index),"mce-match-marker-selected");const fo=Ps(Qe,zn);return fo.length?(co.addClass(Ps(Qe,zn),"mce-match-marker-selected"),Qe.selection.scrollIntoView(fo[0]),zn):-1},Ht=(Qe,st)=>{const cn=st.parentNode;Qe.remove(st),cn&&Qe.isEmpty(cn)&&Qe.remove(cn)},Fn=(Qe,st)=>{const yn="("+Qe.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return st?`(?:^|\\s|${K()})`+yn+`(?=$|\\s|${K()})`:yn},ao=(Qe,st,cn,yn,zn,co)=>{const fo=Qe.selection,oo=Fn(cn,zn),Co=fo.isForward(),Io={regex:new RegExp(oo,yn?"g":"gi"),matchIndex:1},ls=xs(Qe,st,Io,co);if(W.browser.isSafari()&&fo.setRng(fo.getRng(),Co),ls){const Js=_t(Qe,st,!0);st.set({index:Js,count:ls,text:cn,matchCase:yn,wholeWord:zn,inSelection:co})}return ls},Bo=(Qe,st)=>{const cn=_t(Qe,st,!0);st.set({...st.get(),index:cn})},is=(Qe,st)=>{const cn=_t(Qe,st,!1);st.set({...st.get(),index:cn})},yr=Qe=>{const st=Xr(Qe);return st!==null&&st.length>0},wr=(Qe,st,cn,yn,zn)=>{const co=st.get(),fo=co.index;let oo,Co=fo;yn=yn!==!1;const Io=Qe.getBody(),ls=Se.grep(Se.toArray(Io.getElementsByTagName("span")),yr);for(let Js=0;Js<ls.length;Js++){const Es=Xr(ls[Js]);let Ka=oo=parseInt(Es,10);if(zn||Ka===co.index){for(cn.length?(ls[Js].innerText=cn,uo(ls[Js])):Ht(Qe.dom,ls[Js]);ls[++Js];)if(Ka=parseInt(Xr(ls[Js]),10),Ka===oo)Ht(Qe.dom,ls[Js]);else{Js--;break}yn&&Co--}else oo>fo&&ls[Js].setAttribute("data-mce-index",String(oo-1))}return st.set({...co,count:zn?0:co.count-1,index:Co}),yn?Bo(Qe,st):is(Qe,st),!zn&&st.get().count>0},ar=(Qe,st,cn)=>{let yn,zn;const co=st.get(),fo=Se.toArray(Qe.getBody().getElementsByTagName("span"));for(let oo=0;oo<fo.length;oo++){const Co=Xr(fo[oo]);Co!==null&&Co.length&&(Co===co.index.toString()&&(yn||(yn=fo[oo].firstChild),zn=fo[oo].firstChild),uo(fo[oo]))}if(st.set({...co,index:-1,count:0,text:""}),yn&&zn){const oo=Qe.dom.createRng();return oo.setStart(yn,0),oo.setEnd(zn,zn.data.length),cn!==!1&&Qe.selection.setRng(oo),oo}else return},Xe=(Qe,st)=>st.get().count>1,qe=(Qe,st)=>st.get().count>1,Ft=(Qe,st)=>({done:oo=>ar(Qe,st,oo),find:(oo,Co,Io,ls=!1)=>ao(Qe,st,oo,Co,Io,ls),next:()=>Bo(Qe,st),prev:()=>is(Qe,st),replace:(oo,Co,Io)=>wr(Qe,st,oo,Co,Io)}),Yt=Qe=>{const st=o(ne.none()),cn=()=>st.get().each(Qe);return{clear:()=>{cn(),st.set(ne.none())},isSet:()=>st.get().isSome(),get:()=>st.get(),set:oo=>{cn(),st.set(ne.some(oo))}}},mo=()=>{const Qe=Yt(B);return{...Qe,on:cn=>Qe.get().each(cn)}},$o=(Qe,st)=>{const cn=mo();Qe.undoManager.add();const yn=Se.trim(Qe.selection.getContent({format:"text"})),zn=zo=>{zo.setEnabled("next",Xe(Qe,st)),zo.setEnabled("prev",qe(Qe,st))},co=zo=>{const Qo=zo.getData(),ns=st.get();st.set({...ns,matchCase:Qo.matchcase,wholeWord:Qo.wholewords,inSelection:Qo.inselection})},fo=(zo,Qo)=>{We(["replace","replaceall","prev","next"],na=>zo.setEnabled(na,!Qo))},oo=(zo,Qo)=>{Qo.redial(ta(zo,Qo.getData()))},Co=(zo,Qo)=>{W.browser.isSafari()&&W.deviceType.isTouch()&&(Qo==="find"||Qo==="replace"||Qo==="replaceall")&&zo.focus(Qo)},Io=zo=>{ar(Qe,st,!1),fo(zo,!0),zn(zo)},ls=zo=>{const Qo=zo.getData(),ns=st.get();if(!Qo.findtext.length){Io(zo);return}if(ns.text===Qo.findtext&&ns.matchCase===Qo.matchcase&&ns.wholeWord===Qo.wholewords)Bo(Qe,st);else{const ca=ao(Qe,st,Qo.findtext,Qo.matchcase,Qo.wholewords,Qo.inselection);ca<=0&&oo(!0,zo),fo(zo,ca===0)}zn(zo)},Js=st.get(),Es={findtext:yn,replacetext:"",wholewords:Js.wholeWord,matchcase:Js.matchCase,inselection:Js.inSelection},Ka=zo=>{const Qo=[{type:"label",label:"Find",for:"findtext",items:[{type:"bar",items:[{type:"input",name:"findtext",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",enabled:!1,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",enabled:!1,borderless:!0}]}]},{type:"input",name:"replacetext",label:"Replace with",inputMode:"search"}];return zo&&Qo.push({type:"alertbanner",level:"error",text:"Could not find the specified string.",icon:"warning"}),Qo},ta=(zo,Qo)=>({title:"Find and Replace",size:"normal",body:{type:"panel",items:Ka(zo)},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",enabled:!1},{type:"custom",name:"replaceall",text:"Replace all",enabled:!1}],initialData:Qo,onChange:(ns,ca)=>{zo&&oo(!1,ns),ca.name==="findtext"&&st.get().count>0&&Io(ns)},onAction:(ns,ca)=>{const na=ns.getData();switch(ca.name){case"find":ls(ns);break;case"replace":wr(Qe,st,na.replacetext)?zn(ns):Io(ns);break;case"replaceall":wr(Qe,st,na.replacetext,!0,!0),Io(ns);break;case"prev":is(Qe,st),zn(ns);break;case"next":Bo(Qe,st),zn(ns);break;case"matchcase":case"wholewords":case"inselection":oo(!1,ns),co(ns),Io(ns);break}Co(ns,ca.name)},onSubmit:ns=>{ls(ns),Co(ns,"find")},onClose:()=>{Qe.focus(),ar(Qe,st),Qe.undoManager.add()}});cn.set(Qe.windowManager.open(ta(!1,Es),{inline:"toolbar"}))},Zo=(Qe,st)=>{Qe.addCommand("SearchReplace",()=>{$o(Qe,st)})},js=(Qe,st)=>()=>{$o(Qe,st)},ln=(Qe,st)=>{Qe.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:js(Qe,st),icon:"search"}),Qe.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:js(Qe,st),icon:"search",shortcut:"Meta+F"}),Qe.shortcuts.add("Meta+F","",js(Qe,st))};var Wt=()=>{s.add("searchreplace",Qe=>{const st=o({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return Zo(Qe,st),ln(Qe,st),Ft(Qe,st)})};Wt()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=(I,U,me)=>{var Ne;return me(I,U.prototype)?!0:((Ne=I.constructor)===null||Ne===void 0?void 0:Ne.name)===U.name},i=I=>{const U=typeof I;return I===null?"null":U==="object"&&Array.isArray(I)?"array":U==="object"&&s(I,String,(me,Ne)=>Ne.isPrototypeOf(me))?"string":U},u=I=>U=>i(U)===I,m=I=>U=>typeof U===I,h=I=>U=>I===U,b=u("string"),C=u("array"),x=m("boolean"),_=h(void 0),N=I=>I==null,O=I=>!N(I),B=m("function"),L=m("number"),j=()=>{},J=(I,U)=>me=>I(U(me)),Y=I=>()=>I,ne=I=>I,K=(I,U)=>I===U;function W(I,...U){return(...me)=>{const Ne=U.concat(me);return I.apply(null,Ne)}}const Se=I=>{I()},ut=Y(!1),Le=Y(!0);class te{constructor(U,me){this.tag=U,this.value=me}static some(U){return new te(!0,U)}static none(){return te.singletonNone}fold(U,me){return this.tag?me(this.value):U()}isSome(){return this.tag}isNone(){return!this.tag}map(U){return this.tag?te.some(U(this.value)):te.none()}bind(U){return this.tag?U(this.value):te.none()}exists(U){return this.tag&&U(this.value)}forall(U){return!this.tag||U(this.value)}filter(U){return!this.tag||U(this.value)?this:te.none()}getOr(U){return this.tag?this.value:U}or(U){return this.tag?this:U}getOrThunk(U){return this.tag?this.value:U()}orThunk(U){return this.tag?this:U()}getOrDie(U){if(this.tag)return this.value;throw new Error(U??"Called getOrDie on None")}static from(U){return O(U)?te.some(U):te.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(U){this.tag&&U(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}te.singletonNone=new te(!1);const We=Object.keys,pt=Object.hasOwnProperty,ft=(I,U)=>{const me=We(I);for(let Ne=0,lt=me.length;Ne<lt;Ne++){const on=me[Ne],On=I[on];U(On,on)}},Oe=I=>(U,me)=>{I[me]=U},ue=(I,U,me,Ne)=>{ft(I,(lt,on)=>{(U(lt,on)?me:Ne)(lt,on)})},Pt=(I,U)=>{const me={};return ue(I,U,Oe(me),j),me},be=(I,U)=>{const me=[];return ft(I,(Ne,lt)=>{me.push(U(Ne,lt))}),me},$e=I=>be(I,ne),R=I=>We(I).length,Ue=(I,U)=>ve(I,U)?te.from(I[U]):te.none(),ve=(I,U)=>pt.call(I,U),nt=(I,U)=>ve(I,U)&&I[U]!==void 0&&I[U]!==null,tt=I=>{for(const U in I)if(pt.call(I,U))return!1;return!0},pe=Array.prototype.indexOf,Ze=Array.prototype.push,Tt=(I,U)=>pe.call(I,U),He=(I,U)=>Tt(I,U)>-1,vt=(I,U)=>{for(let me=0,Ne=I.length;me<Ne;me++){const lt=I[me];if(U(lt,me))return!0}return!1},Re=(I,U)=>{const me=[];for(let Ne=0;Ne<I;Ne++)me.push(U(Ne));return me},ct=(I,U)=>{const me=I.length,Ne=new Array(me);for(let lt=0;lt<me;lt++){const on=I[lt];Ne[lt]=U(on,lt)}return Ne},oe=(I,U)=>{for(let me=0,Ne=I.length;me<Ne;me++){const lt=I[me];U(lt,me)}},pn=(I,U)=>{for(let me=I.length-1;me>=0;me--){const Ne=I[me];U(Ne,me)}},gt=(I,U)=>{const me=[],Ne=[];for(let lt=0,on=I.length;lt<on;lt++){const On=I[lt];(U(On,lt)?me:Ne).push(On)}return{pass:me,fail:Ne}},St=(I,U)=>{const me=[];for(let Ne=0,lt=I.length;Ne<lt;Ne++){const on=I[Ne];U(on,Ne)&&me.push(on)}return me},jt=(I,U,me)=>(pn(I,(Ne,lt)=>{me=U(me,Ne,lt)}),me),Ct=(I,U,me)=>(oe(I,(Ne,lt)=>{me=U(me,Ne,lt)}),me),Q=(I,U,me)=>{for(let Ne=0,lt=I.length;Ne<lt;Ne++){const on=I[Ne];if(U(on,Ne))return te.some(on);if(me(on,Ne))break}return te.none()},ie=(I,U)=>Q(I,U,ut),ce=I=>{const U=[];for(let me=0,Ne=I.length;me<Ne;++me){if(!C(I[me]))throw new Error("Arr.flatten item "+me+" was not an array, input: "+I);Ze.apply(U,I[me])}return U},G=(I,U)=>ce(ct(I,U)),ye=(I,U)=>{for(let me=0,Ne=I.length;me<Ne;++me){const lt=I[me];if(U(lt,me)!==!0)return!1}return!0},De=(I,U)=>{const me={};for(let Ne=0,lt=I.length;Ne<lt;Ne++){const on=I[Ne];me[String(on)]=U(on,Ne)}return me},Ie=(I,U)=>U>=0&&U<I.length?te.some(I[U]):te.none(),dt=I=>Ie(I,0),je=I=>Ie(I,I.length-1),bt=(I,U)=>{for(let me=0;me<I.length;me++){const Ne=U(I[me],me);if(Ne.isSome())return Ne}return te.none()},$t=8,gn=9,Et=11,Bt=1,dn=3,_n=(I,U)=>{const Ne=(U||document).createElement("div");if(Ne.innerHTML=I,!Ne.hasChildNodes()||Ne.childNodes.length>1){const lt="HTML does not have a single root node";throw console.error(lt,I),new Error(lt)}return Nt(Ne.childNodes[0])},xo=(I,U)=>{const Ne=(U||document).createElement(I);return Nt(Ne)},Qn=(I,U)=>{const Ne=(U||document).createTextNode(I);return Nt(Ne)},Nt=I=>{if(I==null)throw new Error("Node cannot be null or undefined");return{dom:I}},an={fromHtml:_n,fromTag:xo,fromText:Qn,fromDom:Nt,fromPoint:(I,U,me)=>te.from(I.dom.elementFromPoint(U,me)).map(Nt)},Nn=(I,U)=>{const me=I.dom;if(me.nodeType!==Bt)return!1;{const Ne=me;if(Ne.matches!==void 0)return Ne.matches(U);if(Ne.msMatchesSelector!==void 0)return Ne.msMatchesSelector(U);if(Ne.webkitMatchesSelector!==void 0)return Ne.webkitMatchesSelector(U);if(Ne.mozMatchesSelector!==void 0)return Ne.mozMatchesSelector(U);throw new Error("Browser lacks native selectors")}},ko=I=>I.nodeType!==Bt&&I.nodeType!==gn&&I.nodeType!==Et||I.childElementCount===0,Ro=(I,U)=>{const me=U===void 0?document:U.dom;return ko(me)?[]:ct(me.querySelectorAll(I),an.fromDom)},ws=(I,U)=>{const me=U===void 0?document:U.dom;return ko(me)?te.none():te.from(me.querySelector(I)).map(an.fromDom)},yo=(I,U)=>I.dom===U.dom,Us=Nn;typeof window<"u"||Function("return this;")();const fn=I=>I.dom.nodeName.toLowerCase(),Ho=I=>I.dom.nodeType,tr=I=>U=>Ho(U)===I,rr=I=>Ho(I)===$t||fn(I)==="#comment",Ir=tr(Bt),Pr=tr(dn),ks=tr(gn),Nr=tr(Et),Xr=I=>U=>Ir(U)&&fn(U)===I,xs=I=>an.fromDom(I.dom.ownerDocument),uo=I=>ks(I)?I:xs(I),Ps=I=>te.from(I.dom.parentNode).map(an.fromDom),_t=(I,U)=>{const me=B(U)?U:ut;let Ne=I.dom;const lt=[];for(;Ne.parentNode!==null&&Ne.parentNode!==void 0;){const on=Ne.parentNode,On=an.fromDom(on);if(lt.push(On),me(On)===!0)break;Ne=on}return lt},Ht=I=>te.from(I.dom.previousSibling).map(an.fromDom),Fn=I=>te.from(I.dom.nextSibling).map(an.fromDom),ao=I=>ct(I.dom.childNodes,an.fromDom),Bo=(I,U)=>{const me=I.dom.childNodes;return te.from(me[U]).map(an.fromDom)},is=I=>Bo(I,0),yr=I=>Nr(I)&&O(I.dom.host),wr=I=>an.fromDom(I.dom.getRootNode()),ar=I=>{const U=wr(I);return yr(U)?te.some(U):te.none()},Xe=I=>an.fromDom(I.dom.host),qe=I=>{const U=Pr(I)?I.dom.parentNode:I.dom;if(U==null||U.ownerDocument===null)return!1;const me=U.ownerDocument;return ar(an.fromDom(U)).fold(()=>me.body.contains(U),J(qe,Xe))};var Ft=(I,U,me,Ne,lt)=>I(me,Ne)?te.some(me):B(lt)&<(me)?te.none():U(me,Ne,lt);const Yt=(I,U,me)=>{let Ne=I.dom;const lt=B(me)?me:ut;for(;Ne.parentNode;){Ne=Ne.parentNode;const on=an.fromDom(Ne);if(U(on))return te.some(on);if(lt(on))break}return te.none()},mo=(I,U,me)=>Ft((lt,on)=>on(lt),Yt,I,U,me),$o=(I,U)=>{const me=lt=>U(an.fromDom(lt));return ie(I.dom.childNodes,me).map(an.fromDom)},Zo=(I,U,me)=>Yt(I,Ne=>Nn(Ne,U),me),js=(I,U)=>$o(I,me=>Nn(me,U)),ln=(I,U)=>ws(U,I),Wt=(I,U,me)=>Ft((lt,on)=>Nn(lt,on),Zo,I,U,me),Qe=I=>Wt(I,"[contenteditable]"),st=(I,U=!1)=>qe(I)?I.dom.isContentEditable:Qe(I).fold(Y(U),me=>cn(me)==="true"),cn=I=>I.dom.contentEditable,yn=I=>I.nodeName.toLowerCase(),zn=I=>an.fromDom(I.getBody()),co=I=>U=>yo(U,zn(I)),fo=I=>I?I.replace(/px$/,""):"",oo=I=>/^\d+(\.\d+)?$/.test(I)?I+"px":I,Co=I=>an.fromDom(I.selection.getStart()),Io=I=>an.fromDom(I.selection.getEnd()),ls=I=>mo(I,Xr("table")).forall(st),Js=(I,U)=>St(ao(I),U),Es=(I,U)=>{let me=[];return oe(ao(I),Ne=>{U(Ne)&&(me=me.concat([Ne])),me=me.concat(Es(Ne,U))}),me},Ka=(I,U)=>Js(I,me=>Nn(me,U)),ta=(I,U)=>Ro(U,I),zo=(I,U,me)=>{if(b(me)||x(me)||L(me))I.setAttribute(U,me+"");else throw console.error("Invalid call to Attribute.set. Key ",U,":: Value ",me,":: Element ",I),new Error("Attribute value was not simple")},Qo=(I,U,me)=>{zo(I.dom,U,me)},ns=(I,U)=>{const me=I.dom;ft(U,(Ne,lt)=>{zo(me,lt,Ne)})},ca=(I,U)=>{const me=I.dom.getAttribute(U);return me===null?void 0:me},na=(I,U)=>te.from(ca(I,U)),ua=(I,U)=>{I.dom.removeAttribute(U)},Ys=I=>Ct(I.dom.attributes,(U,me)=>(U[me.name]=me.value,U),{}),Yc=(I,U,me=K)=>I.exists(Ne=>me(Ne,U)),fi=I=>{const U=[],me=Ne=>{U.push(Ne)};for(let Ne=0;Ne<I.length;Ne++)I[Ne].each(me);return U},ac=(I,U,me)=>I.isSome()&&U.isSome()?te.some(me(I.getOrDie(),U.getOrDie())):te.none(),cs=I=>I.bind(ne),Di=(I,U)=>I?te.some(U):te.none(),ir=(I,U)=>I.substring(U),Pl=(I,U,me)=>U===""||I.length>=U.length&&I.substr(me,me+U.length)===U,si=(I,U)=>Xi(I,U)?ir(I,U.length):I,Xi=(I,U)=>Pl(I,U,0),Fl=(I=>U=>U.replace(I,""))(/^\s+|\s+$/g),mi=I=>I.length>0,Ll=I=>!mi(I),xl=(I,U=10)=>{const me=parseInt(I,U);return isNaN(me)?te.none():te.some(me)},Vl=I=>{const U=parseFloat(I);return isNaN(U)?te.none():te.some(U)},Or=I=>I.style!==void 0&&B(I.style.getPropertyValue),Mi=(I,U,me)=>{if(!b(me))throw console.error("Invalid call to CSS.set. Property ",U,":: Value ",me,":: Element ",I),new Error("CSS value must be a string: "+me);Or(I)&&I.style.setProperty(U,me)},El=(I,U)=>{Or(I)&&I.style.removeProperty(U)},_l=(I,U,me)=>{const Ne=I.dom;Mi(Ne,U,me)},_c=(I,U)=>{const me=I.dom,lt=window.getComputedStyle(me).getPropertyValue(U);return lt===""&&!qe(I)?pi(me,U):lt},pi=(I,U)=>Or(I)?I.style.getPropertyValue(U):"",Fr=(I,U)=>{const me=I.dom,Ne=pi(me,U);return te.from(Ne).filter(lt=>lt.length>0)},Wr=(I,U)=>{const me=I.dom;El(me,U),Yc(na(I,"style").map(Fl),"")&&ua(I,"style")},Xa=(I,U,me=0)=>na(I,U).map(Ne=>parseInt(Ne,10)).getOr(me),ic=(I,U)=>lc(I,U,Le),lc=(I,U,me)=>G(ao(I),Ne=>Nn(Ne,U)?me(Ne)?[Ne]:[]:lc(Ne,U,me)),Aa=["tfoot","thead","tbody","colgroup"],xe=I=>He(Aa,I),Ge=(I,U)=>({rows:I,columns:U}),mt=(I,U,me)=>({element:I,rowspan:U,colspan:me}),Jt=(I,U,me,Ne,lt,on)=>({element:I,rowspan:U,colspan:me,row:Ne,column:lt,isLocked:on}),de=(I,U,me)=>({element:I,cells:U,section:me}),Ce=(I,U,me,Ne)=>({startRow:I,startCol:U,finishRow:me,finishCol:Ne}),ot=(I,U,me)=>({element:I,colspan:U,column:me}),Xt=(I,U)=>({element:I,columns:U}),In=(I,U,me=ut)=>{if(me(U))return te.none();if(He(I,fn(U)))return te.some(U);const Ne=lt=>Nn(lt,"table")||me(lt);return Zo(U,I.join(","),Ne)},ae=(I,U)=>In(["td","th"],I,U),we=I=>ic(I,"th,td"),Ke=I=>Nn(I,"colgroup")?Ka(I,"col"):G(Tn(I),U=>Ka(U,"col")),At=(I,U)=>Wt(I,"table",U),kn=I=>ic(I,"tr"),Tn=I=>At(I).fold(Y([]),U=>Ka(U,"colgroup")),fs=(I,U)=>ct(I,me=>{if(fn(me)==="colgroup"){const Ne=ct(Ke(me),lt=>{const on=Xa(lt,"span",1);return mt(lt,1,on)});return de(me,Ne,"colgroup")}else{const Ne=ct(we(me),lt=>{const on=Xa(lt,"rowspan",1),On=Xa(lt,"colspan",1);return mt(lt,on,On)});return de(me,Ne,U(me))}}),Jr=I=>Ps(I).map(U=>{const me=fn(U);return xe(me)?me:"tbody"}).getOr("tbody"),tn=I=>{const U=kn(I),Ne=[...Tn(I),...U];return fs(Ne,Jr)},da="data-snooker-locked-cols",Vs=I=>na(I,da).bind(U=>te.from(U.match(/\d+/g))).map(U=>De(U,Le)),cc=(I,U)=>I+","+U,Zr=(I,U,me)=>te.from(I.access[cc(U,me)]),us=(I,U,me)=>{const Ne=gi(I,lt=>me(U,lt.element));return Ne.length>0?te.some(Ne[0]):te.none()},gi=(I,U)=>{const me=G(I.all,Ne=>Ne.cells);return St(me,U)},Na=I=>{const U={};let me=0;return oe(I.cells,Ne=>{const lt=Ne.colspan;Re(lt,on=>{const On=me+on;U[On]=ot(Ne.element,lt,On)}),me+=lt}),U},hi=I=>{const U={},me=[],lt=dt(I).map(Nl=>Nl.element).bind(At).bind(Vs).getOr({});let on=0,On=0,io=0;const{pass:Go,fail:ts}=gt(I,Nl=>Nl.section==="colgroup");oe(ts,Nl=>{const Yu=[];oe(Nl.cells,Wl=>{let wu=0;for(;U[cc(io,wu)]!==void 0;)wu++;const Ip=nt(lt,wu.toString()),Pp=Jt(Wl.element,Wl.rowspan,Wl.colspan,io,wu,Ip);for(let Ol=0;Ol<Wl.colspan;Ol++)for(let Fp=0;Fp<Wl.rowspan;Fp++){const Lp=io+Fp,Xh=wu+Ol,Rg=cc(Lp,Xh);U[Rg]=Pp,On=Math.max(On,Xh+1)}Yu.push(Pp)}),on++,me.push(de(Nl.element,Yu,Nl.section)),io++});const{columns:cr,colgroups:sr}=je(Go).map(Nl=>{const Yu=Na(Nl);return{colgroups:[Xt(Nl.element,$e(Yu))],columns:Yu}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:Ge(on,On),access:U,all:me,columns:cr,colgroups:sr}},Xc={fromTable:I=>{const U=tn(I);return hi(U)},generate:hi,getAt:Zr,findItem:us,filterItems:gi,justCells:I=>G(I.all,U=>U.cells),justColumns:I=>$e(I.columns),hasColumns:I=>We(I.columns).length>0,getColumnAt:(I,U)=>te.from(I.columns[U])};var Oa=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ha=(I,U,me)=>{const Ne=I.select("td,th",U);let lt;for(let on=0;on<Ne.length;on++){const On=I.getStyle(Ne[on],me);if(_(lt)&&(lt=On),lt!==On)return""}return lt},Ri=(I,U,me)=>{Oa.each("left center right".split(" "),Ne=>{Ne!==me&&I.formatter.remove("align"+Ne,{},U)}),me&&I.formatter.apply("align"+me,{},U)},pu=(I,U,me)=>{Oa.each("top middle bottom".split(" "),Ne=>{Ne!==me&&I.formatter.remove("valign"+Ne,{},U)}),me&&I.formatter.apply("valign"+me,{},U)},Me=(I,U,me)=>{I.dispatch("TableModified",{...me,table:U})},Pe=(I,U)=>Vl(I).getOr(U),Dt=(I,U,me)=>Pe(_c(I,U),me),nn=(I,U,me,Ne)=>{const lt=Dt(I,`padding-${me}`,0),on=Dt(I,`padding-${Ne}`,0),On=Dt(I,`border-${me}-width`,0),io=Dt(I,`border-${Ne}-width`,0);return U-lt-on-On-io},vo=(I,U)=>{const me=I.dom,Ne=me.getBoundingClientRect().width||me.offsetWidth;return U==="border-box"?Ne:nn(I,Ne,"left","right")},rs=I=>vo(I,"content-box");var lr=tinymce.util.Tools.resolve("tinymce.Env");const ga="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",Ji=Re(5,I=>{const U=`${I+1}px`;return{title:U,value:U}}),vi=ct(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],I=>({title:I,value:I.toLowerCase()})),$r="100%",sa=I=>{var U;const me=I.dom,Ne=(U=me.getParent(I.selection.getStart(),me.isBlock))!==null&&U!==void 0?U:I.getBody();return rs(an.fromDom(Ne))+"px"},xa=(I,U)=>sf(I)||!Hl(I)?U:Tm(I)?{...U,width:sa(I)}:{...U,width:$r},ri=(I,U)=>sf(I)||Hl(I)?U:Tm(I)?{...U,width:sa(I)}:{...U,width:$r},Qr=I=>U=>U.options.get(I),za=I=>{const U=I.options.register;U("table_border_widths",{processor:"object[]",default:Ji}),U("table_border_styles",{processor:"object[]",default:vi}),U("table_cell_advtab",{processor:"boolean",default:!0}),U("table_row_advtab",{processor:"boolean",default:!0}),U("table_advtab",{processor:"boolean",default:!0}),U("table_appearance_options",{processor:"boolean",default:!0}),U("table_grid",{processor:"boolean",default:!lr.deviceType.isTouch()}),U("table_cell_class_list",{processor:"object[]",default:[]}),U("table_row_class_list",{processor:"object[]",default:[]}),U("table_class_list",{processor:"object[]",default:[]}),U("table_toolbar",{processor:"string",default:ga}),U("table_background_color_map",{processor:"object[]",default:[]}),U("table_border_color_map",{processor:"object[]",default:[]})},Ks=Qr("table_sizing_mode"),Jc=Qr("table_border_widths"),km=Qr("table_border_styles"),Lu=Qr("table_cell_advtab"),tf=Qr("table_row_advtab"),nf=Qr("table_advtab"),fd=Qr("table_appearance_options"),md=Qr("table_grid"),Hl=Qr("table_style_by_css"),Bi=Qr("table_cell_class_list"),Lh=Qr("table_row_class_list"),gu=Qr("table_class_list"),Ep=Qr("table_toolbar"),of=Qr("table_background_color_map"),_p=Qr("table_border_color_map"),Tm=I=>Ks(I)==="fixed",sf=I=>Ks(I)==="responsive",Am=I=>{const U=I.options,me=U.get("table_default_styles");return U.isSet("table_default_styles")?me:xa(I,me)},kp=I=>{const U=I.options,me=U.get("table_default_attributes");return U.isSet("table_default_attributes")?me:ri(I,me)},pd=(I,U)=>U.column>=I.startCol&&U.column+U.colspan-1<=I.finishCol&&U.row>=I.startRow&&U.row+U.rowspan-1<=I.finishRow,Tp=(I,U)=>{let me=!0;const Ne=W(pd,U);for(let lt=U.startRow;lt<=U.finishRow;lt++)for(let on=U.startCol;on<=U.finishCol;on++)me=me&&Xc.getAt(I,lt,on).exists(Ne);return me?te.some(U):te.none()},et=(I,U)=>Ce(Math.min(I.row,U.row),Math.min(I.column,U.column),Math.max(I.row+I.rowspan-1,U.row+U.rowspan-1),Math.max(I.column+I.colspan-1,U.column+U.colspan-1)),rf=(I,U,me)=>{const Ne=Xc.findItem(I,U,yo),lt=Xc.findItem(I,me,yo);return Ne.bind(on=>lt.map(On=>et(on,On)))},ll=(I,U,me)=>rf(I,U,me).bind(Ne=>Tp(I,Ne)),Lv=(I,U,me)=>{const Ne=Vh(I);return ll(Ne,U,me)},Vh=Xc.fromTable,gd=(I,U)=>{Ps(I).each(Ne=>{Ne.dom.insertBefore(U.dom,I.dom)})},$s=(I,U)=>{Fn(I).fold(()=>{Ps(I).each(lt=>{bi(lt,U)})},Ne=>{gd(Ne,U)})},ra=(I,U)=>{is(I).fold(()=>{bi(I,U)},Ne=>{I.dom.insertBefore(U.dom,Ne.dom)})},bi=(I,U)=>{I.dom.appendChild(U.dom)},Vu=(I,U)=>{gd(I,U),bi(U,I)},Ag=(I,U)=>{oe(U,(me,Ne)=>{const lt=Ne===0?I:U[Ne-1];$s(lt,me)})},af=(I,U)=>{oe(U,me=>{bi(I,me)})},Ii=I=>{const U=I.dom;U.parentNode!==null&&U.parentNode.removeChild(U)},Nm=I=>{const U=ao(I);U.length>0&&Ag(I,U),Ii(I)},Hu=((I,U)=>{const me=on=>{if(!I(on))throw new Error("Can only get "+U+" value of a "+U+" node");return Ne(on).getOr("")},Ne=on=>I(on)?te.from(on.dom.nodeValue):te.none();return{get:me,getOption:Ne,set:(on,On)=>{if(!I(on))throw new Error("Can only set raw "+U+" value of a "+U+" node");on.dom.nodeValue=On}}})(Pr,"text"),zu=I=>Hu.get(I),Ff=(I,U)=>Hu.set(I,U);var uc=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],$m=()=>{const I=ts=>an.fromDom(ts.dom.cloneNode(!1)),U=ts=>uo(ts).dom,me=ts=>Ir(ts)?fn(ts)==="body"?!0:He(uc,fn(ts)):!1,Ne=ts=>Ir(ts)?He(["br","img","hr","input"],fn(ts)):!1,lt=ts=>Ir(ts)&&ca(ts,"contenteditable")==="false",on=(ts,cr)=>ts.dom.compareDocumentPosition(cr.dom),On=(ts,cr)=>{const sr=Ys(ts);ns(cr,sr)},io=ts=>{const cr=fn(ts);return He(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],cr)},Go=ts=>Ir(ts)?na(ts,"lang"):te.none();return{up:Y({selector:Zo,closest:Wt,predicate:Yt,all:_t}),down:Y({selector:ta,predicate:Es}),styles:Y({get:_c,getRaw:Fr,set:_l,remove:Wr}),attrs:Y({get:ca,set:Qo,remove:ua,copyTo:On}),insert:Y({before:gd,after:$s,afterAll:Ag,append:bi,appendAll:af,prepend:ra,wrap:Vu}),remove:Y({unwrap:Nm,remove:Ii}),create:Y({nu:an.fromTag,clone:I,text:an.fromText}),query:Y({comparePosition:on,prevSibling:Ht,nextSibling:Fn}),property:Y({children:ao,name:fn,parent:Ps,document:U,isText:Pr,isComment:rr,isElement:Ir,isSpecial:io,getLanguage:Go,getText:zu,setText:Ff,isBoundary:me,isEmptyTag:Ne,isNonEditable:lt}),eq:yo,is:Us}};const ai=(I,U,me,Ne)=>{const lt=me[0],on=me.slice(1);return Ne(I,U,lt,on)},Uu=(I,U,me)=>me.length>0?ai(I,U,me,kc):te.none(),kc=(I,U,me,Ne)=>{const lt=U(I,me);return jt(Ne,(on,On)=>{const io=U(I,On);return Pi(I,on,io)},lt)},Pi=(I,U,me)=>U.bind(Ne=>me.filter(W(I.eq,Ne))),hd=Uu,Hh=$m(),Dm=(I,U)=>hd(Hh,(me,Ne)=>I(Ne),U),Qc=I=>Zo(I,"table"),lf=(I,U)=>{const me=ta(I,U);return me.length>0?te.some(me):te.none()},zh=(I,U,me)=>ln(I,U).bind(Ne=>ln(I,me).bind(lt=>Dm(Qc,[Ne,lt]).map(on=>({first:Ne,last:lt,table:on})))),Ap=(I,U)=>lf(I,U),Uh=(I,U,me)=>zh(I,U,me).bind(Ne=>{const lt=Go=>yo(I,Go),on="thead,tfoot,tbody,table",On=Zo(Ne.first,on,lt),io=Zo(Ne.last,on,lt);return On.bind(Go=>io.bind(ts=>yo(Go,ts)?Lv(Ne.table,Ne.first,Ne.last):te.none()))}),jh=I=>ct(I,an.fromDom),Np="data-mce-selected",ju="td["+Np+"],th["+Np+"]",Mm="data-mce-first-selected",hu="td["+Mm+"],th["+Mm+"]",Lr="data-mce-last-selected",Ua="td["+Lr+"],th["+Lr+"]",cl={selected:Np,selectedSelector:ju,firstSelected:Mm,firstSelectedSelector:hu,lastSelected:Lr,lastSelectedSelector:Ua},Rm=I=>At(I).bind(U=>Ap(U,cl.firstSelectedSelector)).fold(Y(I),U=>U[0]),Lf=I=>(U,me)=>{const Ne=fn(U),lt=Ne==="col"||Ne==="colgroup"?Rm(U):U;return Wt(lt,I,me)},ja=Lf("th,td,caption"),ho=Lf("th,td"),Bm=I=>jh(I.model.table.getSelectedCells()),Wu=(I,U)=>{const me=ho(I),Ne=me.bind(lt=>At(lt)).map(lt=>kn(lt));return ac(me,Ne,(lt,on)=>St(on,On=>vt(jh(On.dom.cells),io=>ca(io,U)==="1"||yo(io,lt)))).getOr([])},ul=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],Ws=I=>({value:Ng(I)}),cf=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Im=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Op=I=>cf.test(I)||Im.test(I),Ng=I=>si(I,"#").toUpperCase(),es=I=>Op(I)?te.some({value:Ng(I)}):te.none(),ha=I=>{const U=I.toString(16);return(U.length===1?"0"+U:U).toUpperCase()},vd=I=>{const U=ha(I.red)+ha(I.green)+ha(I.blue);return Ws(U)},kl=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,dl=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,zl=(I,U,me,Ne)=>({red:I,green:U,blue:me,alpha:Ne}),Ja=(I,U,me,Ne)=>{const lt=parseInt(I,10),on=parseInt(U,10),On=parseInt(me,10),io=parseFloat(Ne);return zl(lt,on,On,io)},Qi=I=>{const U=kl.exec(I);if(U!==null)return te.some(Ja(U[1],U[2],U[3],"1"));const me=dl.exec(I);return me!==null?te.some(Ja(me[1],me[2],me[3],me[4])):te.none()},dc=I=>es(I).orThunk(()=>Qi(I).map(vd)).getOrThunk(()=>{const U=document.createElement("canvas");U.height=1,U.width=1;const me=U.getContext("2d");me.clearRect(0,0,U.width,U.height),me.fillStyle="#FFFFFF",me.fillStyle=I,me.fillRect(0,0,1,1);const Ne=me.getImageData(0,0,1,1).data,lt=Ne[0],on=Ne[1],On=Ne[2],io=Ne[3];return vd(zl(lt,on,On,io))}),$p=I=>Qi(I).map(vd).map(U=>"#"+U.value).getOr(I),Dr=I=>{let U=I;return{get:()=>U,set:lt=>{U=lt}}},Dp=I=>{const U=Dr(te.none()),me=()=>U.get().each(I);return{clear:()=>{me(),U.set(te.none())},isSet:()=>U.get().isSome(),get:()=>U.get(),set:io=>{me(),U.set(te.some(io))}}},Ea=()=>Dp(I=>I.unbind()),bd=(I,U,me)=>Ne=>{const lt=Ea(),on=Ll(me),On=()=>{const io=Bm(I),Go=ts=>I.formatter.match(U,{value:me},ts.dom,on);on?(Ne.setActive(!vt(io,Go)),lt.set(I.formatter.formatChanged(U,ts=>Ne.setActive(!ts),!0))):(Ne.setActive(ye(io,Go)),lt.set(I.formatter.formatChanged(U,Ne.setActive,!1,{value:me})))};return I.initialized?On():I.on("init",On),lt.clear},vu=I=>nt(I,"menu"),ur=I=>ct(I,U=>{const me=U.text||U.title||"";return vu(U)?{text:me,items:ur(U.menu)}:{text:me,value:U.value}}),eu=I=>I.length?te.some(ur([{text:"Select...",value:"mce-no-match"},...I])):te.none(),Vf=(I,U,me,Ne)=>ct(U,lt=>{const on=lt.text||lt.title;return vu(lt)?{type:"nestedmenuitem",text:on,getSubmenuItems:()=>Vf(I,lt.menu,me,Ne)}:{text:on,type:"togglemenuitem",onAction:()=>Ne(lt.value),onSetup:bd(I,me,lt.value)}}),yd=(I,U)=>me=>{I.execCommand("mceTableApplyCellStyle",!1,{[U]:me})},Mr=I=>G(I,U=>vu(U)?[{...U,menu:Mr(U.menu)}]:mi(U.value)?[U]:[]),Zu=(I,U,me,Ne)=>lt=>lt(Vf(I,U,me,Ne)),fc=(I,U,me)=>{const Ne=ct(U,lt=>({text:lt.title,value:"#"+dc(lt.value).value,type:"choiceitem"}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:Ne.length>0?Ne:void 0,allowCustomColors:!1},onAction:lt=>{const on=lt.value==="remove"?"":lt.value;I.execCommand("mceTableApplyCellStyle",!1,{[me]:on})}}]},vs=I=>()=>{const me=I.queryCommandValue("mceTableRowType")==="header"?"body":"header";I.execCommand("mceTableRowType",!1,{type:me})},uf=I=>()=>{const me=I.queryCommandValue("mceTableColType")==="th"?"td":"th";I.execCommand("mceTableColType",!1,{type:me})},Mp=I=>eu(Bi(I)).map(U=>({name:"class",type:"listbox",label:"Class",items:U})),V=[{name:"width",type:"input",label:"Width"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:ul}],ee=I=>V.concat(Mp(I).toArray()),he=(I,U)=>{const Ne=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(ur(km(I)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:U==="cell"?[{name:"borderwidth",type:"input",label:"Border width"}].concat(Ne):Ne}},it={normal:(I,U)=>{const me=I.dom;return{setAttrib:(On,io)=>{me.setAttrib(U,On,io)},setStyle:(On,io)=>{me.setStyle(U,On,io)},setFormat:(On,io)=>{io===""?I.formatter.remove(On,{value:null},U,!0):I.formatter.apply(On,{value:io},U)}}}},wn=Xr("th"),Do=(I,U)=>I&&U?"sectionCells":I?"section":"cells",os=I=>{const U=I.section==="thead",me=Yc(Xo(I.cells),"th");return I.section==="tfoot"?{type:"footer"}:U||me?{type:"header",subType:Do(U,me)}:{type:"body"}},Xo=I=>{const U=St(I,me=>wn(me.element));return U.length===0?te.some("td"):U.length===I.length?te.some("th"):te.none()},po=I=>{const U=ct(I,lt=>os(lt).type),me=He(U,"header"),Ne=He(U,"footer");if(!me&&!Ne)return te.some("body");{const lt=He(U,"body");return me&&!lt&&!Ne?te.some("header"):!me&&!lt&&Ne?te.some("footer"):te.none()}},Vr=I=>{let U=!1,me;return(...Ne)=>(U||(U=!0,me=I.apply(null,Ne)),me)},aa=(I,U)=>bt(I.all,me=>ie(me.cells,Ne=>yo(U,Ne.element))),mc=(I,U,me)=>{const Ne=ct(U.selection,on=>ae(on).bind(On=>aa(I,On)).filter(me)),lt=fi(Ne);return Di(lt.length>0,lt)},Ul=(I,U)=>U.mergable,Vv=(I,U)=>U.unmergable,Hf=(I,U)=>mc(I,U,Le),Wh=(I,U)=>aa(I,U).exists(me=>!me.isLocked),Fi=(I,U)=>ye(U,me=>Wh(I,me)),Zh=(I,U)=>Ul(I,U).filter(me=>Fi(I,me.cells)),G0=(I,U)=>Vv(I,U).filter(me=>Fi(I,me));({...{generate:I=>{if(!C(I))throw new Error("cases must be an array");if(I.length===0)throw new Error("there must be at least one case");const U=[],me={};return oe(I,(Ne,lt)=>{const on=We(Ne);if(on.length!==1)throw new Error("one and only one name per case");const On=on[0],io=Ne[On];if(me[On]!==void 0)throw new Error("duplicate key detected:"+On);if(On==="cata")throw new Error("cannot have a case named cata (sorry)");if(!C(io))throw new Error("case arguments must be an array");U.push(On),me[On]=(...Go)=>{const ts=Go.length;if(ts!==io.length)throw new Error("Wrong number of arguments to case "+On+". Expected "+io.length+" ("+io+"), got "+ts);return{fold:(...sr)=>{if(sr.length!==I.length)throw new Error("Wrong number of arguments to fold. Expected "+I.length+", got "+sr.length);return sr[lt].apply(null,Go)},match:sr=>{const qr=We(sr);if(U.length!==qr.length)throw new Error("Wrong number of arguments to match. Expected: "+U.join(",")+`
|
|
113
113
|
Actual: `+qr.join(","));if(!ye(U,Yu=>He(qr,Yu)))throw new Error("Not all branches were specified when using match. Specified: "+qr.join(", ")+`
|
|
114
114
|
Required: `+U.join(", "));return sr[On].apply(null,Go)},log:sr=>{console.log(sr,{constructors:U,constructor:On,params:Go})}}}}),me}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const Hv=(I,U)=>{const me=Xc.fromTable(I);return Hf(me,U).bind(lt=>{const on=lt[lt.length-1],On=lt[0].row,io=on.row+on.rowspan,Go=me.all.slice(On,io);return po(Go)}).getOr("")},Vi=I=>Xi(I,"rgb")?$p(I):I,Lo=I=>{const U=an.fromDom(I);return{borderwidth:Fr(U,"border-width").getOr(""),borderstyle:Fr(U,"border-style").getOr(""),bordercolor:Fr(U,"border-color").map(Vi).getOr(""),backgroundcolor:Fr(U,"background-color").map(Vi).getOr("")}},tu=I=>{const U=I[0],me=I.slice(1);return oe(me,Ne=>{oe(We(U),lt=>{ft(Ne,(on,On)=>{const io=U[lt];io!==""&<===On&&io!==on&&(U[lt]=lt==="class"?"mce-no-match":"")})})}),U},Pm=(I,U,me,Ne)=>ie(I,lt=>!_(me.formatter.matchNode(Ne,U+lt))).getOr(""),Rp=W(Pm,["left","center","right"],"align"),q0=W(Pm,["top","middle","bottom"],"valign"),Yh=(I,U)=>{const me=Am(I),Ne=kp(I),lt=()=>({borderstyle:Ue(me,"border-style").getOr(""),bordercolor:Vi(Ue(me,"border-color").getOr("")),backgroundcolor:Vi(Ue(me,"background-color").getOr(""))}),on={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},On=()=>{const cr=me["border-width"];return Hl(I)&&cr?{border:cr}:Ue(Ne,"border").fold(()=>({}),sr=>({border:sr}))},io=U?lt():{},Go=()=>{const cr=Ue(me,"border-spacing").or(Ue(Ne,"cellspacing")).fold(()=>({}),qr=>({cellspacing:qr})),sr=Ue(me,"border-padding").or(Ue(Ne,"cellpadding")).fold(()=>({}),qr=>({cellpadding:qr}));return{...cr,...sr}};return{...on,...me,...Ne,...io,...On(),...Go()}},bu=I=>At(an.fromDom(I)).map(U=>{const me={selection:jh(I.cells)};return Hv(U,me)}).getOr(""),wd=(I,U,me)=>{const Ne=(io,Go)=>{const ts=Fr(an.fromDom(Go),"border-width");return Hl(I)&&ts.isSome()?ts.getOr(""):io.getAttrib(Go,"border")||Ha(I.dom,Go,"border-width")||Ha(I.dom,Go,"border")||""},lt=I.dom,on=Hl(I)?lt.getStyle(U,"border-spacing")||lt.getAttrib(U,"cellspacing"):lt.getAttrib(U,"cellspacing")||lt.getStyle(U,"border-spacing"),On=Hl(I)?Ha(lt,U,"padding")||lt.getAttrib(U,"cellpadding"):lt.getAttrib(U,"cellpadding")||Ha(lt,U,"padding");return{width:lt.getStyle(U,"width")||lt.getAttrib(U,"width"),height:lt.getStyle(U,"height")||lt.getAttrib(U,"height"),cellspacing:on??"",cellpadding:On??"",border:Ne(lt,U),caption:!!lt.select("caption",U)[0],class:lt.getAttrib(U,"class",""),align:Rp(I,U),...me?Lo(U):{}}},zf=(I,U,me)=>{const Ne=I.dom;return{height:Ne.getStyle(U,"height")||Ne.getAttrib(U,"height"),class:Ne.getAttrib(U,"class",""),type:bu(U),align:Rp(I,U),...me?Lo(U):{}}},Gn=(I,U,me,Ne)=>{const lt=I.dom,on=Ne.getOr(U);return{width:((io,Go)=>lt.getStyle(io,Go)||lt.getAttrib(io,Go))(on,"width"),scope:lt.getAttrib(U,"scope"),celltype:yn(U),class:lt.getAttrib(U,"class",""),halign:Rp(I,U),valign:q0(I,U),...me?Lo(U):{}}},Tc=(I,U)=>{const me=Xc.fromTable(I),Ne=Xc.justCells(me),lt=St(Ne,on=>vt(U,On=>yo(on.element,On)));return ct(lt,on=>({element:on.element.dom,column:Xc.getColumnAt(me,on.column).map(On=>On.element.dom)}))},zv=(I,U,me,Ne)=>{Ne("scope")&&I.setAttrib("scope",me.scope),Ne("class")&&me.class!=="mce-no-match"&&I.setAttrib("class",me.class),Ne("width")&&U.setStyle("width",oo(me.width))},Fm=(I,U,me)=>{me("backgroundcolor")&&I.setFormat("tablecellbackgroundcolor",U.backgroundcolor),me("bordercolor")&&I.setFormat("tablecellbordercolor",U.bordercolor),me("borderstyle")&&I.setFormat("tablecellborderstyle",U.borderstyle),me("borderwidth")&&I.setFormat("tablecellborderwidth",oo(U.borderwidth))},yu=(I,U,me,Ne)=>{const lt=U.length===1;oe(U,on=>{const On=on.element,io=lt?Le:Ne,Go=it.normal(I,On),ts=on.column.map(cr=>it.normal(I,cr)).getOr(Go);zv(Go,ts,me,io),Lu(I)&&Fm(Go,me,io),Ne("halign")&&Ri(I,On,me.halign),Ne("valign")&&pu(I,On,me.valign)})},Og=(I,U)=>{I.execCommand("mceTableCellType",!1,{type:U.celltype,no_events:!0})},Uf=(I,U,me,Ne)=>{const lt=Pt(Ne,(on,On)=>me[On]!==on);R(lt)>0&&U.length>=1&&At(U[0]).each(on=>{const On=Tc(on,U),io=R(Pt(lt,(ts,cr)=>cr!=="scope"&&cr!=="celltype"))>0,Go=ve(lt,"celltype");(io||ve(lt,"scope"))&&yu(I,On,Ne,W(ve,lt)),Go&&Og(I,Ne),Me(I,on.dom,{structure:Go,style:io})})},Lm=(I,U,me,Ne)=>{const lt=Ne.getData();Ne.close(),I.undoManager.transact(()=>{Uf(I,U,me,lt),I.focus()})},$g=(I,U)=>{const me=At(U[0]).map(Ne=>ct(Tc(Ne,U),lt=>Gn(I,lt.element,Lu(I),lt.column)));return tu(me.getOrDie())},Gu=I=>{const U=Bm(I);if(U.length===0)return;const me=$g(I,U),Ne={type:"tabpanel",tabs:[{title:"General",name:"general",items:ee(I)},he(I,"cell")]},lt={type:"panel",items:[{type:"grid",columns:2,items:ee(I)}]};I.windowManager.open({title:"Cell Properties",size:"normal",body:Lu(I)?Ne:lt,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:me,onSubmit:W(Lm,I,U,me)})},Y0=I=>eu(Lh(I)).map(U=>({name:"class",type:"listbox",label:"Class",items:U})),ia=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Sn=I=>ia.concat(Y0(I).toArray()),Tl=(I,U,me)=>{me("class")&&U.class!=="mce-no-match"&&I.setAttrib("class",U.class),me("height")&&I.setStyle("height",oo(U.height))},qu=(I,U,me)=>{me("backgroundcolor")&&I.setStyle("background-color",U.backgroundcolor),me("bordercolor")&&I.setStyle("border-color",U.bordercolor),me("borderstyle")&&I.setStyle("border-style",U.borderstyle)},Qa=(I,U,me,Ne)=>{const on=U.length===1?Le:Ne;oe(U,On=>{const io=Ka(an.fromDom(On),"td,th"),Go=it.normal(I,On);Tl(Go,me,on),tf(I)&&qu(Go,me,on),Ne("height")&&oe(io,ts=>{I.dom.setStyle(ts.dom,"height",null)}),Ne("align")&&Ri(I,On,me.align)})},Bp=(I,U)=>{I.execCommand("mceTableRowType",!1,{type:U.type,no_events:!0})},ei=(I,U,me,Ne)=>{const lt=Pt(Ne,(on,On)=>me[On]!==on);if(R(lt)>0){const on=ve(lt,"type"),On=on?R(lt)>1:!0;On&&Qa(I,U,Ne,W(ve,lt)),on&&Bp(I,Ne),At(an.fromDom(U[0])).each(io=>Me(I,io.dom,{structure:on,style:On}))}},Fs=(I,U,me,Ne)=>{const lt=Ne.getData();Ne.close(),I.undoManager.transact(()=>{ei(I,U,me,lt),I.focus()})},Kh=I=>{const U=Wu(Co(I),cl.selected);if(U.length===0)return;const me=ct(U,On=>zf(I,On.dom,tf(I))),Ne=tu(me),lt={type:"tabpanel",tabs:[{title:"General",name:"general",items:Sn(I)},he(I,"row")]},on={type:"panel",items:[{type:"grid",columns:2,items:Sn(I)}]};I.windowManager.open({title:"Row Properties",size:"normal",body:tf(I)?lt:on,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Ne,onSubmit:W(Fs,I,ct(U,On=>On.dom),Ne)})},sn=(I,U,me)=>{const Ne=me?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],lt=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],on=fd(I)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],On=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],io=U.length>0?[{name:"class",type:"listbox",label:"Class",items:U}]:[];return Ne.concat(lt).concat(on).concat(On).concat(io)},Ls=(I,U,me,Ne)=>{if(U.tagName==="TD"||U.tagName==="TH")b(me)&&O(Ne)?I.setStyle(U,me,Ne):I.setStyles(U,me);else if(U.children)for(let lt=0;lt<U.children.length;lt++)Ls(I,U.children[lt],me,Ne)},Uv=(I,U,me,Ne)=>{const lt=I.dom,on={},On={},io=Hl(I),Go=nf(I),ts=parseFloat(me.border)===0;if(!_(me.class)&&me.class!=="mce-no-match"&&(on.class=me.class),On.height=oo(me.height),io?On.width=oo(me.width):lt.getAttrib(U,"width")&&(on.width=fo(me.width)),io?(ts?(on.border=0,On["border-width"]=""):(On["border-width"]=oo(me.border),on.border=1),On["border-spacing"]=oo(me.cellspacing)):(on.border=ts?0:me.border,on.cellpadding=me.cellpadding,on.cellspacing=me.cellspacing),io&&U.children){const cr={};if(ts?cr["border-width"]="":Ne.border&&(cr["border-width"]=oo(me.border)),Ne.cellpadding&&(cr.padding=oo(me.cellpadding)),Go&&Ne.bordercolor&&(cr["border-color"]=me.bordercolor),!tt(cr))for(let sr=0;sr<U.children.length;sr++)Ls(lt,U.children[sr],cr)}if(Go){const cr=me;On["background-color"]=cr.backgroundcolor,On["border-color"]=cr.bordercolor,On["border-style"]=cr.borderstyle}lt.setStyles(U,{...Am(I),...On}),lt.setAttribs(U,{...kp(I),...on})},$a=(I,U,me,Ne)=>{const lt=I.dom,on=Ne.getData(),On=Pt(on,(io,Go)=>me[Go]!==io);Ne.close(),I.undoManager.transact(()=>{if(!U){const io=xl(on.cols).getOr(1),Go=xl(on.rows).getOr(1);I.execCommand("mceInsertTable",!1,{rows:Go,columns:io}),U=ho(Co(I),co(I)).bind(ts=>At(ts,co(I))).map(ts=>ts.dom).getOrDie()}if(R(On)>0){const io={border:ve(On,"border"),bordercolor:ve(On,"bordercolor"),cellpadding:ve(On,"cellpadding")};Uv(I,U,on,io);const Go=lt.select("caption",U)[0];(Go&&!on.caption||!Go&&on.caption)&&I.execCommand("mceTableToggleCaption"),Ri(I,U,on.align)}if(I.focus(),I.addVisual(),R(On)>0){const io=ve(On,"caption"),Go=io?R(On)>1:!0;Me(I,U,{structure:io,style:Go})}})},nu=(I,U)=>{const me=I.dom;let Ne,lt=Yh(I,nf(I));U?(lt.cols="1",lt.rows="1",nf(I)&&(lt.borderstyle="",lt.bordercolor="",lt.backgroundcolor="")):(Ne=me.getParent(I.selection.getStart(),"table",I.getBody()),Ne?lt=wd(I,Ne,nf(I)):nf(I)&&(lt.borderstyle="",lt.bordercolor="",lt.backgroundcolor=""));const on=eu(gu(I));on.isSome()&<.class&&(lt.class=lt.class.replace(/\s*mce\-item\-table\s*/g,""));const On={type:"grid",columns:2,items:sn(I,on.getOr([]),U)},io=()=>({type:"panel",items:[On]}),Go=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[On]},he(I,"table")]}),ts=nf(I)?Go():io();I.windowManager.open({title:"Table Properties",size:"normal",body:ts,onSubmit:W($a,I,Ne,lt),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:lt})},yi=I=>{const U=me=>{ls(Co(I))&&me()};ft({mceTableProps:W(nu,I,!1),mceTableRowProps:W(Kh,I),mceTableCellProps:W(Gu,I),mceInsertTableDialog:W(nu,I,!0)},(me,Ne)=>I.addCommand(Ne,()=>U(me)))},x2=(I,U)=>js(I,U).isSome(),Cd=ne,K0=I=>{const U=(Ne,lt)=>na(Ne,lt).exists(on=>parseInt(on,10)>1),me=Ne=>U(Ne,"rowspan")||U(Ne,"colspan");return I.length>0&&ye(I,me)?te.some(I):te.none()},jl=(I,U,me)=>U.length<=1?te.none():Uh(I,me.firstSelectedSelector,me.lastSelectedSelector).map(Ne=>({bounds:Ne,cells:U})),Hs=I=>({element:I,mergable:te.none(),unmergable:te.none(),selection:[I]}),Sd=(I,U,me)=>({element:me,mergable:jl(U,I,cl),unmergable:K0(I),selection:Cd(I)}),Dg=I=>{const U=Dr(te.none()),me=Dr([]);let Ne=te.none();const lt=Xr("caption"),on=Ds=>Ne.forall(Cr=>!Cr[Ds]),On=()=>ja(Co(I),co(I)),io=()=>ja(Io(I),co(I)),Go=()=>On().bind(Ds=>cs(ac(At(Ds),io().bind(At),(Cr,Zl)=>yo(Cr,Zl)?lt(Ds)?te.some(Hs(Ds)):te.some(Sd(Bm(I),Cr,Ds)):te.none()))),ts=Ds=>At(Ds.element).map(Zl=>{const _a=Xc.fromTable(Zl),Jh=Hf(_a,Ds).getOr([]),Bg=Ct(Jh,(jf,gc)=>(gc.isLocked&&(jf.onAny=!0,gc.column===0?jf.onFirst=!0:gc.column+gc.colspan>=_a.grid.columns&&(jf.onLast=!0)),jf),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:Zh(_a,Ds).isSome(),unmergeable:G0(_a,Ds).isSome(),locked:Bg}}),cr=()=>{U.set(Vr(Go)()),Ne=U.get().bind(ts),oe(me.get(),Se)},sr=Ds=>(Ds(),me.set(me.get().concat([Ds])),()=>{me.set(St(me.get(),Cr=>Cr!==Ds))}),qr=(Ds,Cr)=>sr(()=>U.get().fold(()=>{Ds.setEnabled(!1)},Zl=>{Ds.setEnabled(!Cr(Zl)&&I.selection.isEditable())})),Nl=(Ds,Cr,Zl)=>sr(()=>U.get().fold(()=>{Ds.setEnabled(!1),Ds.setActive(!1)},_a=>{Ds.setEnabled(!Cr(_a)&&I.selection.isEditable()),Ds.setActive(Zl(_a))})),Yu=Ds=>Ne.exists(Cr=>Cr.locked[Ds]),Wl=Ds=>qr(Ds,Cr=>!1),wu=Ds=>qr(Ds,Cr=>lt(Cr.element)),Ip=Ds=>Cr=>qr(Cr,Zl=>lt(Zl.element)||Yu(Ds)),Pp=Ds=>Cr=>qr(Cr,Zl=>lt(Zl.element)||Ds().isNone()),Ol=(Ds,Cr)=>Zl=>qr(Zl,_a=>lt(_a.element)||Ds().isNone()||Yu(Cr)),Fp=Ds=>qr(Ds,Cr=>on("mergeable")),Lp=Ds=>qr(Ds,Cr=>on("unmergeable")),Xh=Ds=>Nl(Ds,ut,Cr=>At(Cr.element,co(I)).exists(_a=>x2(_a,"caption"))),Rg=(Ds,Cr)=>Zl=>Nl(Zl,_a=>lt(_a.element),()=>I.queryCommandValue(Ds)===Cr),ii=Rg("mceTableRowType","header"),Cu=Rg("mceTableColType","th");return I.on("NodeChange ExecCommand TableSelectorChange",cr),{onSetupTable:Wl,onSetupCellOrRow:wu,onSetupColumn:Ip,onSetupPasteable:Pp,onSetupPasteableColumn:Ol,onSetupMergeable:Fp,onSetupUnmergeable:Lp,resetTargets:cr,onSetupTableWithCaption:Xh,onSetupTableRowHeaders:ii,onSetupTableColumnHeaders:Cu,targets:U.get}};var va=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const Mg="x-tinymce/dom-table-",df=Mg+"rows",X0=Mg+"columns",Al=I=>{var U;const me=(U=va.read())!==null&&U!==void 0?U:[];return bt(me,Ne=>te.from(Ne.getType(I)))},Ac=()=>Al(df),kt=()=>Al(X0),pc=I=>U=>{const me=()=>{U.setEnabled(I.selection.isEditable())};return I.on("NodeChange",me),me(),()=>{I.off("NodeChange",me)}},ti=(I,U)=>{I.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:pc(I),fetch:io=>io("inserttable | cell row column | advtablesort | tableprops deletetable")});const me=io=>()=>I.execCommand(io),Ne=(io,Go)=>{I.queryCommandSupported(Go.command)&&I.ui.registry.addButton(io,{...Go,onAction:B(Go.onAction)?Go.onAction:me(Go.command)})},lt=(io,Go)=>{I.queryCommandSupported(Go.command)&&I.ui.registry.addToggleButton(io,{...Go,onAction:B(Go.onAction)?Go.onAction:me(Go.command)})};Ne("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:U.onSetupTable}),Ne("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:U.onSetupTable}),Ne("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:U.onSetupCellOrRow}),Ne("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:U.onSetupMergeable}),Ne("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:U.onSetupUnmergeable}),Ne("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:U.onSetupCellOrRow}),Ne("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:U.onSetupCellOrRow}),Ne("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:U.onSetupCellOrRow}),Ne("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:U.onSetupCellOrRow}),Ne("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:U.onSetupColumn("onFirst")}),Ne("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:U.onSetupColumn("onLast")}),Ne("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:U.onSetupColumn("onAny")}),Ne("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:U.onSetupCellOrRow}),Ne("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:U.onSetupCellOrRow}),Ne("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:U.onSetupPasteable(Ac)}),Ne("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:U.onSetupPasteable(Ac)}),Ne("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:U.onSetupColumn("onAny")}),Ne("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:U.onSetupColumn("onAny")}),Ne("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:U.onSetupPasteableColumn(kt,"onFirst")}),Ne("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:U.onSetupPasteableColumn(kt,"onLast")}),Ne("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:pc(I)});const on=Mr(gu(I));on.length!==0&&I.queryCommandSupported("mceTableToggleClass")&&I.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Zu(I,on,"tableclass",io=>I.execCommand("mceTableToggleClass",!1,io)),onSetup:U.onSetupTable});const On=Mr(Bi(I));On.length!==0&&I.queryCommandSupported("mceTableCellToggleClass")&&I.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Zu(I,On,"tablecellclass",io=>I.execCommand("mceTableCellToggleClass",!1,io)),onSetup:U.onSetupCellOrRow}),I.queryCommandSupported("mceTableApplyCellStyle")&&(I.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Zu(I,ul,"tablecellverticalalign",yd(I,"vertical-align")),onSetup:U.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Zu(I,Jc(I),"tablecellborderwidth",yd(I,"border-width")),onSetup:U.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Zu(I,km(I),"tablecellborderstyle",yd(I,"border-style")),onSetup:U.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:io=>io(fc(I,of(I),"background-color")),onSetup:U.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:io=>io(fc(I,_p(I),"border-color")),onSetup:U.onSetupCellOrRow})),lt("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:U.onSetupTableWithCaption}),lt("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:vs(I),onSetup:U.onSetupTableRowHeaders}),lt("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:uf(I),onSetup:U.onSetupTableColumnHeaders})},Gr=I=>{const U=Ne=>I.dom.is(Ne,"table")&&I.getBody().contains(Ne)&&I.dom.isEditable(Ne.parentNode),me=Ep(I);me.length>0&&I.ui.registry.addContextToolbar("table",{predicate:U,items:me,scope:"node",position:"node"})},Nc=I=>U=>{const me=()=>{U.setEnabled(I.selection.isEditable())};return I.on("NodeChange",me),me(),()=>{I.off("NodeChange",me)}},ba=(I,U)=>{const me=sr=>()=>I.execCommand(sr),Ne=(sr,qr)=>I.queryCommandSupported(qr.command)?(I.ui.registry.addMenuItem(sr,{...qr,onAction:B(qr.onAction)?qr.onAction:me(qr.command)}),!0):!1,lt=(sr,qr)=>{I.queryCommandSupported(qr.command)&&I.ui.registry.addToggleMenuItem(sr,{...qr,onAction:B(qr.onAction)?qr.onAction:me(qr.command)})},on=sr=>{I.execCommand("mceInsertTable",!1,{rows:sr.numRows,columns:sr.numColumns})},On=[Ne("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:U.onSetupCellOrRow}),Ne("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:U.onSetupCellOrRow}),Ne("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:U.onSetupCellOrRow}),Ne("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:U.onSetupCellOrRow}),Ne("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:U.onSetupCellOrRow}),Ne("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:U.onSetupCellOrRow}),Ne("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:U.onSetupPasteable(Ac)}),Ne("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:U.onSetupPasteable(Ac)})],io=[Ne("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:U.onSetupColumn("onFirst")}),Ne("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:U.onSetupColumn("onLast")}),Ne("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:U.onSetupColumn("onAny")}),Ne("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:U.onSetupColumn("onAny")}),Ne("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:U.onSetupColumn("onAny")}),Ne("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:U.onSetupPasteableColumn(kt,"onFirst")}),Ne("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:U.onSetupPasteableColumn(kt,"onLast")})],Go=[Ne("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:U.onSetupCellOrRow}),Ne("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:U.onSetupMergeable}),Ne("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:U.onSetupUnmergeable})];md(I)?I.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:on}],onSetup:Nc(I)}):I.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:me("mceInsertTableDialog"),onSetup:Nc(I)}),I.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:me("mceInsertTableDialog"),onSetup:Nc(I)}),Ne("tableprops",{text:"Table properties",onSetup:U.onSetupTable,command:"mceTableProps"}),Ne("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:U.onSetupTable,command:"mceTableDelete"}),He(On,!0)&&I.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:Y("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),He(io,!0)&&I.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:Y("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),He(Go,!0)&&I.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:Y("tablecellprops tablemergecells tablesplitcells")}),I.ui.registry.addContextMenu("table",{update:()=>(U.resetTargets(),U.targets().fold(Y(""),sr=>fn(sr.element)==="caption"?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"))});const ts=Mr(gu(I));ts.length!==0&&I.queryCommandSupported("mceTableToggleClass")&&I.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>Vf(I,ts,"tableclass",sr=>I.execCommand("mceTableToggleClass",!1,sr)),onSetup:U.onSetupTable});const cr=Mr(Bi(I));cr.length!==0&&I.queryCommandSupported("mceTableCellToggleClass")&&I.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Vf(I,cr,"tablecellclass",sr=>I.execCommand("mceTableCellToggleClass",!1,sr)),onSetup:U.onSetupCellOrRow}),I.queryCommandSupported("mceTableApplyCellStyle")&&(I.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>Vf(I,ul,"tablecellverticalalign",yd(I,"vertical-align")),onSetup:U.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Vf(I,Jc(I),"tablecellborderwidth",yd(I,"border-width")),onSetup:U.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Vf(I,km(I),"tablecellborderstyle",yd(I,"border-style")),onSetup:U.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>fc(I,of(I),"background-color"),onSetup:U.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>fc(I,_p(I),"border-color"),onSetup:U.onSetupCellOrRow})),lt("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:U.onSetupTableWithCaption}),lt("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:vs(I),onSetup:U.onSetupTableRowHeaders}),lt("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:uf(I),onSetup:U.onSetupTableRowHeaders})},hr=I=>{const U=Dg(I);za(I),yi(I),ba(I,U),ti(I,U),Gr(I)};var Vm=()=>{o.add("table",hr)};Vm()})();(function(){const o=B=>{let L=B;return{get:()=>L,set:Y=>{L=Y}}};var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(B,L)=>{B.dispatch("VisualBlocks",{state:L})},u=(B,L,j)=>{B.dom.toggleClass(B.getBody(),"mce-visualblocks"),j.set(!j.get()),i(B,j.get())},m=(B,L,j)=>{B.addCommand("mceVisualBlocks",()=>{u(B,L,j)})},h=B=>L=>L.options.get(B),b=B=>{const L=B.options.register;L("visualblocks_default_state",{processor:"boolean",default:!1})},C=h("visualblocks_default_state"),x=(B,L,j)=>{B.on("PreviewFormats AfterPreviewFormats",J=>{j.get()&&B.dom.toggleClass(B.getBody(),"mce-visualblocks",J.type==="afterpreviewformats")}),B.on("init",()=>{C(B)&&u(B,L,j)})},_=(B,L)=>j=>{j.setActive(L.get());const J=Y=>j.setActive(Y.state);return B.on("VisualBlocks",J),()=>B.off("VisualBlocks",J)},N=(B,L)=>{const j=()=>B.execCommand("mceVisualBlocks");B.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:j,onSetup:_(B,L),context:"any"}),B.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:j,onSetup:_(B,L),context:"any"})};var O=()=>{s.add("visualblocks",(B,L)=>{b(B);const j=o(!1);m(B,L,j),N(B,j),x(B,L,j)})};O()})();(function(){const o=_t=>{let Ht=_t;return{get:()=>Ht,set:Bo=>{Ht=Bo}}};var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=_t=>({isEnabled:()=>_t.get()}),u=(_t,Ht)=>_t.dispatch("VisualChars",{state:Ht}),m=(_t,Ht,Fn)=>{var ao;return Fn(_t,Ht.prototype)?!0:((ao=_t.constructor)===null||ao===void 0?void 0:ao.name)===Ht.name},h=_t=>{const Ht=typeof _t;return _t===null?"null":Ht==="object"&&Array.isArray(_t)?"array":Ht==="object"&&m(_t,String,(Fn,ao)=>ao.isPrototypeOf(Fn))?"string":Ht},b=_t=>Ht=>h(Ht)===_t,C=_t=>Ht=>typeof Ht===_t,x=_t=>Ht=>_t===Ht,_=b("string"),N=b("object"),O=x(null),B=C("boolean"),L=_t=>_t==null,j=_t=>!L(_t),J=C("number");class Y{constructor(Ht,Fn){this.tag=Ht,this.value=Fn}static some(Ht){return new Y(!0,Ht)}static none(){return Y.singletonNone}fold(Ht,Fn){return this.tag?Fn(this.value):Ht()}isSome(){return this.tag}isNone(){return!this.tag}map(Ht){return this.tag?Y.some(Ht(this.value)):Y.none()}bind(Ht){return this.tag?Ht(this.value):Y.none()}exists(Ht){return this.tag&&Ht(this.value)}forall(Ht){return!this.tag||Ht(this.value)}filter(Ht){return!this.tag||Ht(this.value)?this:Y.none()}getOr(Ht){return this.tag?this.value:Ht}or(Ht){return this.tag?this:Ht}getOrThunk(Ht){return this.tag?this.value:Ht()}orThunk(Ht){return this.tag?this:Ht()}getOrDie(Ht){if(this.tag)return this.value;throw new Error(Ht??"Called getOrDie on None")}static from(Ht){return j(Ht)?Y.some(Ht):Y.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Ht){this.tag&&Ht(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Y.singletonNone=new Y(!1);const ne=(_t,Ht)=>{const Fn=_t.length,ao=new Array(Fn);for(let Bo=0;Bo<Fn;Bo++){const is=_t[Bo];ao[Bo]=Ht(is,Bo)}return ao},K=(_t,Ht)=>{for(let Fn=0,ao=_t.length;Fn<ao;Fn++){const Bo=_t[Fn];Ht(Bo,Fn)}},W=(_t,Ht)=>{const Fn=[];for(let ao=0,Bo=_t.length;ao<Bo;ao++){const is=_t[ao];Ht(is,ao)&&Fn.push(is)}return Fn},Se=Object.keys,ut=(_t,Ht)=>{const Fn=Se(_t);for(let ao=0,Bo=Fn.length;ao<Bo;ao++){const is=Fn[ao],yr=_t[is];Ht(yr,is)}},Le=typeof window<"u"?window:Function("return this;")(),te=(_t,Ht)=>{let Fn=Ht??Le;for(let ao=0;ao<_t.length&&Fn!==void 0&&Fn!==null;++ao)Fn=Fn[_t[ao]];return Fn},We=(_t,Ht)=>{const Fn=_t.split(".");return te(Fn,Ht)},pt=(_t,Ht)=>We(_t,Ht),ft=(_t,Ht)=>{const Fn=pt(_t,Ht);if(Fn==null)throw new Error(_t+" not available on this browser");return Fn},Oe=Object.getPrototypeOf,ue=_t=>ft("HTMLElement",_t),Pt=_t=>{const Ht=We("ownerDocument.defaultView",_t);return N(_t)&&(ue(Ht).prototype.isPrototypeOf(_t)||/^HTML\w*Element$/.test(Oe(_t).constructor.name))},be=1,$e=3,R=_t=>_t.dom.nodeType,Ue=_t=>_t.dom.nodeValue,ve=_t=>Ht=>R(Ht)===_t,nt=_t=>tt(_t)&&Pt(_t.dom),tt=ve(be),pe=ve($e),Ze=(_t,Ht,Fn)=>{if(_(Fn)||B(Fn)||J(Fn))_t.setAttribute(Ht,Fn+"");else throw console.error("Invalid call to Attribute.set. Key ",Ht,":: Value ",Fn,":: Element ",_t),new Error("Attribute value was not simple")},Tt=(_t,Ht,Fn)=>{Ze(_t.dom,Ht,Fn)},He=(_t,Ht)=>{const Fn=_t.dom.getAttribute(Ht);return Fn===null?void 0:Fn},vt=(_t,Ht)=>{_t.dom.removeAttribute(Ht)},Re=(_t,Ht)=>{const Fn=He(_t,Ht);return Fn===void 0||Fn===""?[]:Fn.split(" ")},ct=(_t,Ht,Fn)=>{const Bo=Re(_t,Ht).concat([Fn]);return Tt(_t,Ht,Bo.join(" ")),!0},oe=(_t,Ht,Fn)=>{const ao=W(Re(_t,Ht),Bo=>Bo!==Fn);return ao.length>0?Tt(_t,Ht,ao.join(" ")):vt(_t,Ht),!1},pn=_t=>_t.dom.classList!==void 0,gt=_t=>Re(_t,"class"),St=(_t,Ht)=>ct(_t,"class",Ht),jt=(_t,Ht)=>oe(_t,"class",Ht),Ct=(_t,Ht)=>{pn(_t)?_t.dom.classList.add(Ht):St(_t,Ht)},Q=_t=>{(pn(_t)?_t.dom.classList:gt(_t)).length===0&&vt(_t,"class")},ie=(_t,Ht)=>{pn(_t)?_t.dom.classList.remove(Ht):jt(_t,Ht),Q(_t)},ce=(_t,Ht)=>{const ao=(Ht||document).createElement("div");if(ao.innerHTML=_t,!ao.hasChildNodes()||ao.childNodes.length>1){const Bo="HTML does not have a single root node";throw console.error(Bo,_t),new Error(Bo)}return De(ao.childNodes[0])},G=(_t,Ht)=>{const ao=(Ht||document).createElement(_t);return De(ao)},ye=(_t,Ht)=>{const ao=(Ht||document).createTextNode(_t);return De(ao)},De=_t=>{if(_t==null)throw new Error("Node cannot be null or undefined");return{dom:_t}},dt={fromHtml:ce,fromTag:G,fromText:ye,fromDom:De,fromPoint:(_t,Ht,Fn)=>Y.from(_t.dom.elementFromPoint(Ht,Fn)).map(De)},je={" ":"nbsp","":"shy"},bt=(_t,Ht)=>{let Fn="";return ut(_t,(ao,Bo)=>{Fn+=Bo}),new RegExp("["+Fn+"]",Ht?"g":"")},$t=_t=>{let Ht="";return ut(_t,Fn=>{Ht&&(Ht+=","),Ht+="span.mce-"+Fn}),Ht},gn=bt(je),Et=bt(je,!0),Bt=$t(je),dn="mce-nbsp",_n=_t=>_t.dom.contentEditable,xo=_t=>'<span data-mce-bogus="1" class="mce-'+je[_t]+'">'+_t+"</span>",Qn=_t=>_t.nodeName.toLowerCase()==="span"&&_t.classList.contains("mce-nbsp-wrap"),Nt=_t=>{const Ht=Ue(_t);return pe(_t)&&_(Ht)&&gn.test(Ht)},rn=_t=>nt(_t)&&_n(_t)==="false",an=(_t,Ht)=>{if(nt(_t)&&!Qn(_t.dom)){const Fn=_n(_t);if(Fn==="true")return!0;if(Fn==="false")return!1}return Ht},Nn=(_t,Ht,Fn)=>{let ao=[];const Bo=_t.dom,is=ne(Bo.childNodes,dt.fromDom),yr=wr=>Qn(wr.dom)||!rn(wr);return K(is,wr=>{Fn&&yr(wr)&&Ht(wr)&&(ao=ao.concat([wr])),ao=ao.concat(Nn(wr,Ht,an(wr,Fn)))}),ao},ko=(_t,Ht)=>{for(;_t.parentNode;){if(_t.parentNode===Ht)return Ht;_t=_t.parentNode}},Ro=_t=>_t.replace(Et,xo),ws=(_t,Ht)=>{const Fn=_t.dom,ao=Nn(dt.fromDom(Ht),Nt,_t.dom.isEditable(Ht));K(ao,Bo=>{var is;const yr=Bo.dom.parentNode;if(Qn(yr))Ct(dt.fromDom(yr),dn);else{const wr=Ro(Fn.encode((is=Ue(Bo))!==null&&is!==void 0?is:"")),ar=Fn.create("div",{},wr);let Xe;for(;Xe=ar.lastChild;)Fn.insertAfter(Xe,Bo.dom);_t.dom.remove(Bo.dom)}})},yo=(_t,Ht)=>{const Fn=_t.dom.select(Bt,Ht);K(Fn,ao=>{Qn(ao)?ie(dt.fromDom(ao),dn):_t.dom.remove(ao,!0)})},Us=_t=>{const Ht=_t.getBody(),Fn=_t.selection.getBookmark();let ao=ko(_t.selection.getNode(),Ht);ao=ao!==void 0?ao:Ht,yo(_t,ao),ws(_t,ao),_t.selection.moveToBookmark(Fn)},fn=(_t,Ht)=>{u(_t,Ht.get());const Fn=_t.getBody();Ht.get()===!0?ws(_t,Fn):yo(_t,Fn)},Ho=(_t,Ht)=>{Ht.set(!Ht.get());const Fn=_t.selection.getBookmark();fn(_t,Ht),_t.selection.moveToBookmark(Fn)},tr=(_t,Ht)=>{_t.addCommand("mceVisualChars",()=>{Ho(_t,Ht)})},rr=_t=>Ht=>Ht.options.get(_t),Ir=_t=>{const Ht=_t.options.register;Ht("visualchars_default_state",{processor:"boolean",default:!1})},Pr=rr("visualchars_default_state"),ks=(_t,Ht)=>{_t.on("init",()=>{fn(_t,Ht)})},Nr=(_t,Ht)=>{let Fn=null;return{cancel:()=>{O(Fn)||(clearTimeout(Fn),Fn=null)},throttle:(...is)=>{O(Fn)&&(Fn=setTimeout(()=>{Fn=null,_t.apply(null,is)},Ht))}}},Xr=(_t,Ht)=>{const Fn=Nr(()=>{Us(_t)},300);_t.on("keydown",ao=>{Ht.get()===!0&&(ao.keyCode===13?Us(_t):Fn.throttle())}),_t.on("remove",Fn.cancel)},xs=(_t,Ht)=>Fn=>{Fn.setActive(Ht.get());const ao=Bo=>Fn.setActive(Bo.state);return _t.on("VisualChars",ao),()=>_t.off("VisualChars",ao)},uo=(_t,Ht)=>{const Fn=()=>_t.execCommand("mceVisualChars");_t.ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:Fn,onSetup:xs(_t,Ht),context:"any"}),_t.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",icon:"visualchars",onAction:Fn,onSetup:xs(_t,Ht),context:"any"})};var Ps=()=>{s.add("visualchars",_t=>{Ir(_t);const Ht=o(Pr(_t));return tr(_t,Ht),uo(_t,Ht),Xr(_t,Ht),ks(_t,Ht),i(Ht)})};Ps()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(Q=>ie=>Q===ie)(null),u=Q=>Q,m=(Q,ie)=>{const ce=Q.length,G=new Array(ce);for(let ye=0;ye<ce;ye++){const De=Q[ye];G[ye]=ie(De,ye)}return G},b={aletter:"[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]",midnumlet:"[-'\\.‘’․﹒'.]",midletter:"[:··״‧︓﹕:]",midnum:"[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]",numeric:"[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]",cr:"\\r",lf:"\\n",newline:"[\v\f
\u2028\u2029]",extend:"[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]",format:"[-឴឵---\uFEFF-]",katakana:"[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]",extendnumlet:"[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]",punctuation:"[~№|!-*+-\\/:;?@\\[-`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]"},C={ALETTER:0,MIDNUMLET:1,MIDLETTER:2,MIDNUM:3,NUMERIC:4,CR:5,LF:6,NEWLINE:7,EXTEND:8,FORMAT:9,KATAKANA:10,EXTENDNUMLET:11,AT:12,OTHER:13},x=[new RegExp(b.aletter),new RegExp(b.midnumlet),new RegExp(b.midletter),new RegExp(b.midnum),new RegExp(b.numeric),new RegExp(b.cr),new RegExp(b.lf),new RegExp(b.newline),new RegExp(b.extend),new RegExp(b.format),new RegExp(b.katakana),new RegExp(b.extendnumlet),new RegExp("@")],_="",N=new RegExp("^"+b.punctuation+"$"),O=/^\s+$/,B=x,L=C.OTHER,j=Q=>{let ie=L;const ce=B.length;for(let G=0;G<ce;++G){const ye=B[G];if(ye&&ye.test(Q)){ie=G;break}}return ie},J=Q=>{const ie={};return ce=>{if(ie[ce])return ie[ce];{const G=Q(ce);return ie[ce]=G,G}}},Y=Q=>{const ie=J(j);return m(Q,ie)},ne=(Q,ie)=>{const ce=Q[ie],G=Q[ie+1];if(ie<0||ie>Q.length-1&&ie!==0||ce===C.ALETTER&&G===C.ALETTER)return!1;const ye=Q[ie+2];if(ce===C.ALETTER&&(G===C.MIDLETTER||G===C.MIDNUMLET||G===C.AT)&&ye===C.ALETTER)return!1;const De=Q[ie-1];return(ce===C.MIDLETTER||ce===C.MIDNUMLET||G===C.AT)&&G===C.ALETTER&&De===C.ALETTER||(ce===C.NUMERIC||ce===C.ALETTER)&&(G===C.NUMERIC||G===C.ALETTER)||(ce===C.MIDNUM||ce===C.MIDNUMLET)&&G===C.NUMERIC&&De===C.NUMERIC||ce===C.NUMERIC&&(G===C.MIDNUM||G===C.MIDNUMLET)&&ye===C.NUMERIC||(ce===C.EXTEND||ce===C.FORMAT)&&(G===C.ALETTER||G===C.NUMERIC||G===C.KATAKANA||G===C.EXTEND||G===C.FORMAT)||(G===C.EXTEND||G===C.FORMAT&&(ye===C.ALETTER||ye===C.NUMERIC||ye===C.KATAKANA||ye===C.EXTEND||ye===C.FORMAT))&&(ce===C.ALETTER||ce===C.NUMERIC||ce===C.KATAKANA||ce===C.EXTEND||ce===C.FORMAT)||ce===C.CR&&G===C.LF?!1:ce===C.NEWLINE||ce===C.CR||ce===C.LF||G===C.NEWLINE||G===C.CR||G===C.LF?!0:!(ce===C.KATAKANA&&G===C.KATAKANA||G===C.EXTENDNUMLET&&(ce===C.ALETTER||ce===C.NUMERIC||ce===C.KATAKANA||ce===C.EXTENDNUMLET)||ce===C.EXTENDNUMLET&&(G===C.ALETTER||G===C.NUMERIC||G===C.KATAKANA)||ce===C.AT)},K=_,W=O,Se=N,ut=Q=>Q==="http"||Q==="https",Le=(Q,ie)=>{let ce;for(ce=ie;ce<Q.length&&!W.test(Q[ce]);ce++);return ce},te=(Q,ie)=>{const ce=Le(Q,ie+1);return Q.slice(ie+1,ce).join(K).substr(0,3)==="://"?ce:ie},We=(Q,ie,ce,G)=>{const ye=[],De=[];let Ie=[];for(let dt=0;dt<ce.length;++dt)if(Ie.push(Q[dt]),ne(ce,dt)){const je=ie[dt];if((G.includeWhitespace||!W.test(je))&&(G.includePunctuation||!Se.test(je))){const bt=dt-Ie.length+1,$t=dt+1,gn=ie.slice(bt,$t).join(K);if(ut(gn)){const Et=te(ie,dt),Bt=Q.slice($t,Et);Array.prototype.push.apply(Ie,Bt),dt=Et}ie[dt+1]==="."&&/^([a-zA-Z]\.)+$/.test(gn+".")?(Ie.push(Q[dt+1]),De.push({start:bt,end:$t+1})):De.push({start:bt,end:$t}),ye.push(Ie)}Ie=[]}return{words:ye,indices:De}},pt=()=>({includeWhitespace:!1,includePunctuation:!1}),ft=(Q,ie,ce)=>{ce={...pt(),...ce};const G=m(Q,ie),ye=Y(G);return We(Q,G,ye,ce)},ue=(Q,ie,ce)=>ft(Q,ie,ce).words,Pt=Q=>Q.replace(/\uFEFF/g,"");var be=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const $e=(Q,ie)=>{const ce=ie.getBlockElements(),G=ie.getVoidElements(),ye=bt=>ce[bt.nodeName]||G[bt.nodeName],De=[];let Ie="";const dt=new be(Q,Q);let je;for(;je=dt.next();)je.nodeType===3?Ie+=Pt(je.data):ye(je)&&Ie.length&&(De.push(Ie),Ie="");return Ie.length&&De.push(Ie),De},R=Q=>Q.replace(/\u200B/g,""),Ue=Q=>Q.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length,ve=(Q,ie)=>{const ce=R($e(Q,ie).join(`
|
|
115
|
-
`));return ue(ce.split(""),u).length},nt=(Q,ie)=>{const ce=$e(Q,ie).join("");return Ue(ce)},tt=(Q,ie)=>{const ce=$e(Q,ie).join("").replace(/\s/g,"");return Ue(ce)},pe=(Q,ie)=>()=>ie(Q.getBody(),Q.schema),Ze=(Q,ie)=>()=>ie(Q.selection.getRng().cloneContents(),Q.schema),Tt=Q=>pe(Q,ve),He=Q=>({body:{getWordCount:Tt(Q),getCharacterCount:pe(Q,nt),getCharacterCountWithoutSpaces:pe(Q,tt)},selection:{getWordCount:Ze(Q,ve),getCharacterCount:Ze(Q,nt),getCharacterCountWithoutSpaces:Ze(Q,tt)},getCount:Tt(Q)}),vt=(Q,ie)=>{Q.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(ie.body.getWordCount()),String(ie.selection.getWordCount())],["Characters (no spaces)",String(ie.body.getCharacterCountWithoutSpaces()),String(ie.selection.getCharacterCountWithoutSpaces())],["Characters",String(ie.body.getCharacterCount()),String(ie.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},Re=(Q,ie)=>{Q.addCommand("mceWordCount",()=>vt(Q,ie))},ct=(Q,ie)=>{let ce=null;return{cancel:()=>{i(ce)||(clearTimeout(ce),ce=null)},throttle:(...De)=>{i(ce)&&(ce=setTimeout(()=>{ce=null,Q.apply(null,De)},ie))}}};var oe=tinymce.util.Tools.resolve("tinymce.util.Delay");const pn=(Q,ie)=>{Q.dispatch("wordCountUpdate",{wordCount:{words:ie.body.getWordCount(),characters:ie.body.getCharacterCount(),charactersWithoutSpaces:ie.body.getCharacterCountWithoutSpaces()}})},gt=(Q,ie)=>{pn(Q,ie)},St=(Q,ie,ce)=>{const G=ct(()=>gt(Q,ie),ce);Q.on("init",()=>{gt(Q,ie),oe.setEditorTimeout(Q,()=>{Q.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",G.throttle)},0),Q.on("remove",G.cancel)})},jt=Q=>{const ie=()=>Q.execCommand("mceWordCount");Q.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:ie,context:"any"}),Q.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:ie,context:"any"})};var Ct=(Q=300)=>{o.add("wordcount",ie=>{const ce=He(ie);return Re(ie,ce),jt(ie),St(ie,ce,Q),ce})};Ct()})();const r6e=o=>/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(o)||/class="OutlineElement/.test(o)||/id="?docs\-internal\-guid\-/.test(o),a6e=(o,s="wps_office")=>{const i=o.split(","),u=i[0].match(/:(.*?);/)[1],m=atob(i[1]);let h=m.length;const b=new Uint8Array(h);for(;h--;)b[h]=m.charCodeAt(h);return new File([b],s,{type:u})},i6e=o=>btoa(o.match(/\w{2}/g).map(s=>String.fromCharCode(parseInt(s,16))).join(""));function l6e(o){if(!o)return[];let s=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp(`(?:(${s.source}))([\\da-fA-F\\s]+)\\}`,"g"),u=o.match(i);console.log("images",u);const m=[];if(u||(s=/{\\pict[\s\S]+?(\\pngblip-?\d+)?(\\wmetafile8-?\d+)?{\\\*\\blipuid\s?[\da-fA-F]+[\s}]*?/,i=new RegExp(`(?:(${s.source}))([\\da-fA-F\\s]+)\\}`,"g"),u=o.match(i)),u)for(const h of u){let b=!1;if(h.includes("\\pngblip")?b="image/png":h.includes("\\jpegblip")&&(b="image/jpeg"),b){const C=h.replace(s,"").replace(/[^\da-fA-F]/g,""),x=`data:${b};base64,${i6e(C)}`;m.push({base64:x,file:a6e(x)})}}return m}const c6e=(o,s)=>{if(!s)return o;try{const u=new DOMParser().parseFromString(o,"text/html"),m=u.querySelectorAll("img"),b=(s.clipboardData||window.Clipboard).getData("text/rtf"),C=l6e(b);return m.forEach((x,_)=>{var O;const N=x.getAttribute("src");if(N&&N.startsWith("file:")&&(O=C==null?void 0:C[_])!=null&&O.base64){const B=C[_].base64;x.setAttribute("src",B)}}),u.body.innerHTML}catch{return o}},u6e=o=>{const s=atob(o.split(",")[1]),i=o.split(",")[0].split(":")[1].split(";")[0],u=new ArrayBuffer(s.length),m=new Uint8Array(u);for(let h=0;h<s.length;h++)m[h]=s.charCodeAt(h);return new Blob([u],{type:i})},d6e=async o=>{try{const s=u6e(o),i=new FormData;i.append("files",s,"image.png");const m=await(await fetch("/api/ajax/uploaddoc",{method:"POST",body:i})).json();if(m.status===1)return m.file_url;throw new Error(m.message)}catch(s){throw s}},f6e=async o=>{const i=new DOMParser().parseFromString(o,"text/html"),u=i.getElementsByTagName("img"),m=[],h=3;for(let b=0;b<u.length;b++){const C=u[b],x=C.getAttribute("src");x&&x.startsWith("data:image")&&(m.push({img:C,src:x,width:C.getAttribute("width"),height:C.getAttribute("height")}),m[m.length-1].width&&C.setAttribute("width",m[m.length-1].width),m[m.length-1].height&&C.setAttribute("height",m[m.length-1].height))}for(let b=0;b<m.length;b+=h){const x=m.slice(b,b+h).map(async _=>{try{const N=await d6e(_.src);_.img.setAttribute("src",N)}catch{_.img.remove()}});await Promise.all(x)}return i.body.innerHTML},m6e=o=>{o.querySelectorAll("td").forEach(i=>{const u=i.getAttribute("width"),m=i.getAttribute("style")||"";u==="0"&&m.includes("border:none")&&i.remove()})},p6e=o=>{o.querySelectorAll("table").forEach(i=>{i.style.maxWidth="100%"})},g6e=o=>{o.querySelectorAll("table").forEach(i=>{const u=i.querySelectorAll("td");let m=!1,h="";for(const b of u){const C=b.getAttribute("style")||"",x=C.match(/border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i)||C.match(/border(?:-(?:right|left|top|bottom))?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i);(x?x[0]:"").includes("double")&&(m=!0,x&&(h=x[0].replace(/^border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*/,""),b.style.borderTop=h,b.style.borderRight=h,b.style.borderBottom=h,b.style.borderLeft=h))}m&&h&&(i.style.borderCollapse="separate",i.style.borderSpacing="2px",i.style.border=h)})},h6e=o=>{o.querySelectorAll("table").forEach(i=>{i.querySelectorAll("td[rowspan]").forEach(m=>{const C=((m.getAttribute("style")||"").match(/border-[^:]+:[^;]+(?:solid|double)[^;]+/g)||[]).find(x=>!x.includes("none"));if(C){const x=C.split(":")[1].trim();m.style.borderBottom=x}})})},v6e=o=>{o.querySelectorAll('[style*="mso-"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/mso-[^:]+:[^;]+;/g,"");i.setAttribute("style",m)})},b6e=o=>{o.querySelectorAll('[style*="tab-stops"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/tab-stops:[^;]+;/g,"");i.setAttribute("style",m)})},y6e=o=>{o=o.replace(/<a(?!.*?href=)[^>]*>([\s\S]*?)<\/a>/gi,"$1");const i=new DOMParser().parseFromString(o,"text/html");return m6e(i),p6e(i),g6e(i),h6e(i),v6e(i),b6e(i),o=i.body.innerHTML,o};Sz.PluginManager.add("pasteprocess",o=>(o.on("paste",s=>{if(s.clipboardData){const i=s.clipboardData.getData("text/html")||s.clipboardData.getData("text");if(r6e(i)){s.preventDefault();const u=o.windowManager.open({title:"处理中",body:{type:"panel",items:[{type:"htmlpanel",html:'<div style="text-align: center; padding: 20px;">正在处理Word内容,请稍候...</div>'}]},buttons:[]}),m=y6e(i),h=c6e(m,s);f6e(h).then(b=>{o.insertContent(b),u.close()})}}}),{}));let xH="A4";const ine={A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},B3:{width:353,height:500},B4:{width:257,height:364},B5:{width:176,height:250}},w6e=Object.keys(ine).map(o=>`pagesize${o}`).join(" ");Sz.PluginManager.add("pagesize",o=>{const s=o.options.register;s("pagesize",{processor:"string",default:"A4"}),xH=(m=>h=>h.options.get(m))("pagesize")(o);const u=m=>{const h=ine[m];if(h){const b=(window.devicePixelRatio||1)*96,C=h.width*b/25.4;o!=null&&o.container&&(o.container.style.minWidth=`${C}px`);const x=o.contentAreaContainer.querySelector("iframe");x&&(x.style.width=`${C}px`),o.fire("pagesizechange",{size:m})}};return Object.keys(ine).forEach(m=>{o.ui.registry.addToggleMenuItem(`pagesize${m}`,{text:m,onAction:()=>{xH=m,u(m)},onSetup:h=>(h.setActive(xH===m),()=>{})})}),o.on("init",()=>{u(xH)}),{}});const C6e=["accordion","advlist","anchor","autolink","autosave","charmap","directionality","importcss","insertdatetime","lists","image","media","pagebreak","preview","save","searchreplace","table","fullscreen","wordcount","pasteprocess","pagesize"],S6e="undo redo | blocks bold italic forecolor removeformat alignleft aligncenter alignright alignjustify outdent indent pagebreakfullscreen preview",x6e={license_key:"gpl",skin:!1,content_css:["./content.css","./reset.css"],promotion:!1,menu:{pagesize:{title:"页面大小",items:w6e}},menubar:"file edit insert table tools help pagesize",cleanup:!0,branding:!1,language:"zh_CN",plugins:C6e,toolbar:S6e,fontsize_formats:"12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 48px 56px 72px",font_formats:"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;",lineheight_formats:"0.5 0.8 1 1.2 1.5 1.75 2 2.5 3 4 5",elementpath:!1,paste_data_images:!0,object_resizing:!0,pagesize:"A4",images_upload_handler:o=>new Promise((s,i)=>{const u=new FormData;u.append("files",o.blob(),o.filename()),fetch("/api/ajax/uploaddoc",{method:"POST",body:u}).then(m=>m.json()).then(m=>{m.status===1?s(m.file_url):i(`上传失败: ${m.message}`)}).catch(m=>{i(`上传出错: ${m.message}`)})})},E6e={name:"ProEditor",components:{Editor:o6e},props:{modelValue:{type:String,default:""},pagesize:{type:String,default:"A4"},hasPagesize:{type:Boolean,default:!1},placeholder:{type:String,default:"请输入内容"},width:{type:[Number,String],default:"100%"},height:{type:Number,default:400}},setup(o,{emit:s}){const i=f.reactive({myInit:m(x6e),contentValue:o.modelValue,timeout:null});f.onMounted(()=>{Sz.init({license_key:"gpl"}),Sz.activeEditor.on("pagesizechange",h=>{s("update:pagesize",h.size)})}),f.watch(()=>i.contentValue,()=>{u(()=>{s("update:modelValue",i.contentValue)})}),f.watch(()=>o.modelValue,h=>{h&&h!==i.contentValue&&(i.contentValue=h)});function u(h,b=400){i.timeout!==null&&clearTimeout(i.timeout),i.timeout=setTimeout(h,b)}function m(h){o!=null&&o.height&&(h.height=o.height),o!=null&&o.width&&(h.width=o.width);const{placeholder:b,pagesize:C}=o;return h={...h,placeholder:b,...o.hasPagesize&&{menu:{...h.menu,pagesize:h.menu.pagesize},menubar:h.menubar.includes("pagesize")?h.menubar:`${h.menubar} pagesize`,pagesize:C},...!o.hasPagesize&&{menu:Object.fromEntries(Object.entries(h.menu).filter(([x])=>x!=="pagesize")),menubar:h.menubar.replace(/pagesize/g,"").trim(),pagesize:""}},h}return{...f.toRefs(i),customer:m,debounce:u}}},_6e={class:"my-tinymce"};function k6e(o,s,i,u,m,h){const b=f.resolveComponent("Editor");return f.openBlock(),f.createElementBlock("div",_6e,[f.createVNode(b,{modelValue:o.contentValue,"onUpdate:modelValue":s[0]||(s[0]=C=>o.contentValue=C),init:o.myInit},null,8,["modelValue","init"])])}const ufe=$i(E6e,[["render",k6e]]),T6e={name:"ShadowDomWrap",setup(o,{emit:s,expose:i}){const u=f.ref(null),m=f.ref(),h=f.ref(!1),b=x=>{if(!u.value)return;const _=u.value.contains(x.target);!_&&h.value?(h.value=!1,s("onBlur")):_&&!h.value&&(h.value=!0)},C=x=>{x.stopPropagation(),h.value||(h.value=!0,s("onFocus"))};return f.onMounted(()=>{var N,O,B;m.value=(N=u.value)==null?void 0:N.attachShadow({mode:"open"}),document.addEventListener("click",b);const x=document.createElement("link");x.rel="stylesheet",x.href=`${location==null?void 0:location.origin}/css/index.min.css`,(O=m.value)==null||O.appendChild(x);const _=document.createElement("link");_.rel="stylesheet",_.href=`${location==null?void 0:location.origin}/css/reset.css`,(B=m.value)==null||B.appendChild(_)}),f.onUnmounted(()=>{document.removeEventListener("click",b)}),i({focus:()=>{h.value=!0}}),{shadowHost:u,shadowRoot:m,handleClick:C}}};function A6e(o,s,i,u,m,h){return f.openBlock(),f.createElementBlock("div",{ref:"shadowHost",class:"shadow-host",onClick:s[0]||(s[0]=f.withModifiers((...b)=>u.handleClick&&u.handleClick(...b),["stop"]))},[u.shadowRoot?(f.openBlock(),f.createBlock(f.Teleport,{key:0,to:u.shadowRoot},[f.renderSlot(o.$slots,"default")],8,["to"])):f.createCommentVNode("",!0)],512)}const yoe=$i(T6e,[["render",A6e]]),N6e=["innerHTML"],dfe=f.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue");return(i,u)=>(f.openBlock(),f.createBlock(yoe,null,{default:f.withCtx(()=>[f.createElementVNode("div",{innerHTML:s.value},null,8,N6e)]),_:1}))}}),ffe=Symbol("nodesUI"),Pf=()=>{const o=f.inject(ffe);if(!o)throw new Error("NodesUI context not found");return o};function woe(o){if(!o||!o.ownerDocument)return null;const s=[];for(let i=o;i&&i.nodeType===1;i=i.parentElement){let u=0;for(let b=i.previousSibling;b;b=b.previousSibling)b.nodeType===1&&b.nodeName===i.nodeName&&u++;const m=i.nodeName.toLowerCase(),h=u?`${m}:nth-child(${u+1})`:m;s.unshift(h)}return s.length?s.join(" > "):null}function O6e(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(`#${CSS.escape(o)}`)}catch(i){return console.error("nodePath query error:",i),null}}function mfe(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const VA=o=>o!=null&&o.id?o==null?void 0:o.id:o.nodePath+(o!=null&&o.textNodeIndex?`-${o==null?void 0:o.textNodeIndex}`:"")+(o!=null&&o.startOffset?`-${o==null?void 0:o.startOffset}`:"")+(o!=null&&o.subNodeSort?`-${o==null?void 0:o.subNodeSort}`:""),$6e=(o,s,i)=>{var u,m;if(!Soe(o)){const h=i==null?void 0:i.getRootNode(),b=(u=h==null?void 0:h.getSelection)==null?void 0:u.call(h),C=mfe(o.nodePath,i);if(b&&o.startOffset!==void 0&&s&&C){const x=document.createRange(),_=(o==null?void 0:o.textNodeIndex)||0,N=C.childNodes[_]||C,O=Math.min(o.startOffset,((m=N.textContent)==null?void 0:m.length)||0);x.setStart(N,O),x.setEnd(N,O);const B=document.createElement("span");B.classList.add("empty-text-node"),x.insertNode(B),x.insertNode(s),x.setStartAfter(s),x.collapse(!0),b.removeAllRanges(),b.addRange(x)}}},D6e=(o,s)=>{s!=null&&s.id&&(o.id=s==null?void 0:s.id),(s==null?void 0:s.nodePath)!==void 0&&o.setAttribute("data-nodePath",s.nodePath),(s==null?void 0:s.textNodeIndex)!==void 0&&s.textNodeIndex>=0&&o.setAttribute("data-textNodeIndex",s.textNodeIndex.toString()),s.startOffset!==void 0&&s.startOffset>=0&&o.setAttribute("data-startOffset",s.startOffset.toString()),(s==null?void 0:s.subNodeSort)!==void 0&&s.subNodeSort>=0&&o.setAttribute("data-subNodeSort",s.subNodeSort.toString()),(s==null?void 0:s.groupKey)!==void 0&&o.setAttribute("data-groupKey",s.groupKey)},M6e=o=>{const s=o.parentNode;if(!s)return-1;let i=0;for(let u=0;u<s.childNodes.length;u++){const m=s.childNodes[u];if(m===o)return i;i++,m.nodeType===Node.ELEMENT_NODE&&(m.classList.contains("node-item")&&(i-=2,i<0&&(i=0)),m.classList.contains("empty-text-node")&&(i-=1,i<0&&(i=0)))}return-1},R6e=o=>{let s=o.closest("TD"),i=o.closest(".node-item"),u=null;if(i?u=i:s&&s.classList.contains("node-item-td")&&(u=s),!u)return null;const m=u||o;let h=m==null?void 0:m.getAttribute("data-nodePath");if(h||(h=woe(m)),(m==null?void 0:m.getAttribute("selectable"))==="false")return null;let b={element:m,nodePath:h};const C=m==null?void 0:m.getAttribute("data-textNodeIndex");C&&(b.textNodeIndex=Number(C));const x=m==null?void 0:m.getAttribute("data-startOffset");x&&(b.startOffset=Number(x));const _=m==null?void 0:m.getAttribute("data-subNodeSort");_&&(b.subNodeSort=Number(_));const N=m==null?void 0:m.getAttribute("data-groupKey");N&&(b.groupKey=N);const O=m==null?void 0:m.getAttribute("id");return O&&(b.id=O),b},B6e=o=>JSe(o,s=>f.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),Coe=(o,s)=>{const i=o.startsWith("#")?o.slice(1):o;let u,m,h;if(i.length===3)u=parseInt(i[0]+i[0],16),m=parseInt(i[1]+i[1],16),h=parseInt(i[2]+i[2],16);else if(i.length===6)u=parseInt(i.substring(0,2),16),m=parseInt(i.substring(2,4),16),h=parseInt(i.substring(4,6),16);else return console.warn("Invalid color format:",o),`rgba(0, 0, 0, ${s})`;return`rgba(${u}, ${m}, ${h}, ${s})`},I6e=o=>{const{element:s}=o;if(!s)return null;if(s.tagName.toLowerCase()!=="td")return{showTextType:"input"};const u=s.closest("tr"),m=Array.from(u.parentElement.children).indexOf(u),h=Array.from(u.children).indexOf(s),b=s.closest("table"),C=s.closest("body").querySelectorAll("table");return{showTextType:"cell",tableIndex:Array.from(C).indexOf(b)+1,colIndex:h,rowIndex:m}},P6e=(o,s)=>{var m,h;let i=1;const u=(m=o==null?void 0:o.map(b=>s==null?void 0:s.find(C=>(C==null?void 0:C.id)===(b==null?void 0:b.id))))==null?void 0:m.filter(Boolean);return(u==null?void 0:u.length)>0?(h=u==null?void 0:u.map(C=>{const x=I6e(C);return x?(x==null?void 0:x.showTextType)==="input"?{...C,...x,inputIndex:i++}:{...C,...x}:null}))==null?void 0:h.filter(Boolean):[]};function F6e(o){if(!o||o.length===0)return[];const s=[...o].sort((m,h)=>m.rowIndex!==h.rowIndex?m.rowIndex-h.rowIndex:m.colIndex-h.colIndex),i=[],u=new Set;for(const m of s){if(u.has(m))continue;const h=[];let b=0,C=0;for(let x=m.colIndex;s.find(N=>N.rowIndex===m.rowIndex&&N.colIndex===x&&!u.has(N));x++)C++;if(C!==0){b=C;for(let x=m.rowIndex;;x++){let _=0;const N=[];for(let O=m.colIndex;O<m.colIndex+b;O++){const B=s.find(L=>L.rowIndex===x&&L.colIndex===O&&!u.has(L));if(B)_++,N.push(B);else break}if(_===b)h.push(...N);else break}h.length>0&&(i.push([...h]),h.forEach(x=>u.add(x)))}}return i}function L6e(o){if(!o||o.length===0)return{min:null,max:null};let s=o[0],i=o[0];for(const u of o)(u.colIndex<s.colIndex||u.colIndex===s.colIndex&&u.rowIndex<s.rowIndex)&&(s=u),(u.colIndex>i.colIndex||u.colIndex===i.colIndex&&u.rowIndex>i.rowIndex)&&(i=u);return{min:s,max:i}}const pfe=(o,s)=>{var _;const i=P6e(o,s||[]),u=[],m=[];(_=f.toValue(i))==null||_.forEach(N=>{(N==null?void 0:N.showTextType)==="input"?u.push(N):m.push(N)});const h=txe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=ede(b==null?void 0:b.map(N=>F6e(N==null?void 0:N.nodes))),x=(C==null?void 0:C.map(N=>L6e(N)))||[];return[...u,...x]},t4=o=>{function s(i){let u="";for(;i>=0;)u=String.fromCharCode(65+i%26)+u,i=Math.floor(i/26)-1;return u}return(o==null?void 0:o.colIndex)>=0&&(o==null?void 0:o.rowIndex)>=0?`${s(o==null?void 0:o.colIndex)}${o==null?void 0:o.rowIndex}`:""},V6e=(o,s)=>{const i=pfe(o,s||[]);let u=[];return i==null||i.forEach(m=>{var h,b;(m==null?void 0:m.showTextType)==="input"?u.push(`填写${m==null?void 0:m.inputIndex}`):u.push(((h=m==null?void 0:m.min)==null?void 0:h.id)===((b=m==null?void 0:m.max)==null?void 0:b.id)?t4(m==null?void 0:m.min):`${t4(m==null?void 0:m.min)}:${t4(m==null?void 0:m.max)}`)}),u==null?void 0:u.join(",")},Soe=o=>o.startOffset===void 0&&o.textNodeIndex===void 0,H6e={key:0},z6e={key:1,class:"td-node"},U6e=f.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,i=f.computed(()=>{var u,m;return((m=(u=s==null?void 0:s.node)==null?void 0:u.element)==null?void 0:m.TagName)==="TD"});return(u,m)=>{var h,b;return i.value?(f.openBlock(),f.createElementBlock("span",H6e,f.toDisplayString((h=s==null?void 0:s.node)==null?void 0:h.label),1)):(f.openBlock(),f.createElementBlock("span",z6e,f.toDisplayString((b=s==null?void 0:s.node)==null?void 0:b.label),1))}}}),gfe=Symbol("nodesEditor"),j0=()=>{const o=f.inject(gfe);if(!o)throw new Error("NodesEditor context not found");return o},wU=f.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=Pf(),{nodes:u}=j0(),m=f.computed(()=>{var C;return(C=s.node)!=null&&C.id?u.value.some(x=>x.id===s.node.id):!1}),h=f.computed(()=>{var C;if(!((C=s.node)!=null&&C.element))return!1;try{return s.node.element.parentNode!==null}catch(x){return console.warn("Element validation failed:",x),!1}}),b=f.computed(()=>{var C;return(C=f.toValue(i))==null?void 0:C.find(x=>{var _;return(x==null?void 0:x.id)===((_=s==null?void 0:s.node)==null?void 0:_.id)})});return f.watch(()=>b,()=>{var x,_,N,O;const C=f.toValue(b);(x=s==null?void 0:s.node)!=null&&x.element&&(C?C!=null&&C.activated||(s.node.element.style.setProperty("--node-color",(C==null?void 0:C.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",Coe((C==null?void 0:C.color)||"#409eff",.1)),s.node.element.setAttribute("data-dataGroupKey",C==null?void 0:C.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("activated")):((_=s.node.element)==null||_.removeAttribute("data-dataGroupKey"),(N=s.node.element)==null||N.removeAttribute("selectable"),(O=s.node.element)==null||O.classList.remove("activated")))},{immediate:!0,deep:!0}),(C,x)=>{var _;return(_=C.node)!=null&&_.element&&h.value&&m.value?(f.openBlock(),f.createBlock(f.Teleport,{key:0,to:C.node.element},[f.renderSlot(C.$slots,"default",{node:C.node},()=>[f.createVNode(U6e,{node:C.node},null,8,["node"])])],8,["to"])):f.createCommentVNode("",!0)}}});function j6e(){const o=f.ref(!1),s=u=>{u.key==="Control"&&(o.value=!0)},i=u=>{u.key==="Control"&&(o.value=!1)};return f.onMounted(()=>{window.addEventListener("keydown",s),window.addEventListener("keyup",i)}),f.onUnmounted(()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",i)}),o}function hfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i,currentNodes:u}=Pf(),{editorId:m,nodes:h}=j0(),b=f.ref(!1),C=f.ref({x:0,y:0}),x=f.ref({x:0,y:0}),_=f.ref({left:0,top:0,width:0,height:0}),N=f.ref(null),O=Le=>{const te=Le.closest(".node-item-td")||Le.closest(".node-item");if(te!==null){let We=[];if(te.classList.contains("node-selected"))return;const pt=te.getAttribute("id");if(pt&&h.value){const ft=h.value.find(Oe=>Oe.id===pt);ft&&(We=[ft])}We=K(We),s(We)}},B=Le=>{Le.button===2&&O(Le==null?void 0:Le.target),Le.button===0&&(b.value=!0,N.value&&(C.value={x:Le.pageX,y:Le.pageY},x.value={x:Le.pageX,y:Le.pageY},Y(Le),W(),N.value.style.display="block",window.addEventListener("mousemove",L),window.addEventListener("mouseup",j)))},L=Gae(Le=>{b.value&&(x.value={x:Le.pageX,y:Le.pageY},W())},16),j=Le=>{Le.button===0&&(b.value=!1,N.value&&(W(),N.value.style.display="none",window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",j)))},J=j6e(),Y=Le=>{var We,pt;let te=[];if(Le.button===0&&(Le!=null&&Le.target)){const ft=((We=Le==null?void 0:Le.target)==null?void 0:We.closest(".node-item-td"))||((pt=Le==null?void 0:Le.target)==null?void 0:pt.closest(".node-item"));if(ft!==null){const Oe=ft.getAttribute("id");if(Oe&&h.value){const ue=h.value.find(Pt=>Pt.id===Oe);ue&&(J.value?o.value.some(Pt=>VA(Pt)===VA(ue))?te=o.value.filter(be=>VA(be)!==VA(ue)):te=[...o.value,ue]:ue&&(te=[ue]))}}te=K(te),s(te)}},ne=()=>{if(!i.value||!(_.value.width>3||_.value.height>3))return;let Le=[];const te={left:_.value.left,right:_.value.left+_.value.width,top:_.value.top,bottom:_.value.top+_.value.height};if(i.value.querySelectorAll("*").forEach(pt=>{const ft=pt.getBoundingClientRect(),Oe=window.scrollX||window.pageXOffset,ue=window.scrollY||window.pageYOffset,Pt={left:ft.left+Oe,right:ft.right+Oe,top:ft.top+ue,bottom:ft.bottom+ue};if(Pt.right>te.left&&Pt.left<te.right&&Pt.bottom>te.top&&Pt.top<te.bottom){const be=pt.getAttribute("id");if(be&&h.value){const $e=h.value.find(R=>R.id===be);$e&&(Le=[...Le,$e])}}}),Le=K(Le),J.value){const pt=new Set(o.value.map(Oe=>VA(Oe))),ft=Le.filter(Oe=>!pt.has(VA(Oe)));s([...o.value,...ft])}else s(Le)},K=Le=>{var We;let te=[];if(Le.length>0){const pt=(We=Le.map(be=>be==null?void 0:be.groupKey))==null?void 0:We.filter(Boolean),ft=new Set(pt),Oe=Array.from(ft),ue=h.value.filter(be=>Oe.includes(be.groupKey));te=[...Le,...ue],te=[...yxe(te.filter(be=>be==null?void 0:be.id),"id")||[],...te.filter(be=>!be.id)]}if(u&&u.value&&u.value.length>0){const pt=new Set(u.value.map(ft=>ft.id).filter(Boolean));te=te.filter(ft=>ft.id?!pt.has(ft.id):!0)}return te},W=Gae(()=>{if(!N.value)return;const{x:Le,y:te}=C.value,{x:We,y:pt}=x.value,ft=Math.min(Le,We),Oe=Math.min(te,pt),ue=Math.abs(Le-We),Pt=Math.abs(te-pt);_.value={left:ft,top:Oe,width:ue,height:Pt}},16),Se=Le=>{if(!N.value)return;const{left:te,top:We,width:pt,height:ft}=f.toValue(Le);N.value.style.left=`${te}px`,N.value.style.top=`${We}px`,N.value.style.width=`${pt}px`,N.value.style.height=`${ft}px`},ut=()=>{if(!i.value)return;i.value.addEventListener("mousedown",B);const Le=document.getElementById(`select_area_${m}`);if(Le){N.value=Le;return}const te=document.createElement("div");te.id=`select_area_${m}`,te.style.position="absolute",te.style.border="1px solid #1677ff",te.style.backgroundColor="rgba(22, 119, 255, 0.05)",te.style.pointerEvents="none",te.style.display="none",document.body.appendChild(te),N.value=te};return f.watch(_,(Le,te)=>{di(Le,te)||(Se(Le),b.value&&ne())},{deep:!0}),f.watch(()=>i.value,Le=>{f.toValue(Le)&&ut()},{immediate:!0}),f.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",B)}),{isSelecting:b,selectionBox:N}}function vfe(){const{selectedNodes:o,containerRef:s}=Pf(),i=()=>{var m;(m=f.toValue(s))==null||m.querySelectorAll(".node-selected").forEach(h=>{h.classList.remove("node-selected")})},u=m=>{m.forEach(h=>{h.classList.add("node-selected")})};f.watch(()=>o,()=>{i(),setTimeout(()=>{var h,b;const m=(b=(h=f.toValue(o))==null?void 0:h.map(C=>{var x;return(x=s.value)==null?void 0:x.querySelector(`[id="${C.id}"]`)}))==null?void 0:b.filter(Boolean);u(m)},0)},{deep:!0})}const ud=[];for(let o=0;o<256;++o)ud.push((o+256).toString(16).slice(1));function W6e(o,s=0){return(ud[o[s+0]]+ud[o[s+1]]+ud[o[s+2]]+ud[o[s+3]]+"-"+ud[o[s+4]]+ud[o[s+5]]+"-"+ud[o[s+6]]+ud[o[s+7]]+"-"+ud[o[s+8]]+ud[o[s+9]]+"-"+ud[o[s+10]]+ud[o[s+11]]+ud[o[s+12]]+ud[o[s+13]]+ud[o[s+14]]+ud[o[s+15]]).toLowerCase()}let ste;const Z6e=new Uint8Array(16);function G6e(){if(!ste){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ste=crypto.getRandomValues.bind(crypto)}return ste(Z6e)}const q6e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Gie={randomUUID:q6e};function yE(o,s,i){var m;if(Gie.randomUUID&&!s&&!o)return Gie.randomUUID();o=o||{};const u=o.random??((m=o.rng)==null?void 0:m.call(o))??G6e();if(u.length<16)throw new Error("Random bytes length must be >= 16");return u[6]=u[6]&15|64,u[8]=u[8]&63|128,W6e(u)}const CU=()=>{const{nodes:o,updateNodes:s}=j0();return{nodes:o,addNode:C=>{const _=(Array.isArray(C)?C:[C]).map(O=>({...O,id:O.id||yE()})),N=[...o.value,..._];s(N)},removeNode:C=>{const x=Array.isArray(C)?C:[C],_=[],N=[];x.forEach(B=>{const L=o.value.find(j=>(j==null?void 0:j.id)===B);Soe(L)?_.push(B):N.push(B)});let O=o.value.filter(B=>!N.includes(B==null?void 0:B.id));O=O==null?void 0:O.map(B=>_.includes(B==null?void 0:B.id)?{id:B==null?void 0:B.id,nodePath:B==null?void 0:B.nodePath,label:"文本",nodeType:"text"}:B),s(O)},editNodes:C=>{const x=Array.isArray(C)?C:[C];let _=yE();const N=x.map(B=>{let L={...B},j=B==null?void 0:B.id;return j||(j=yE(),L.id=j),L!=null&&L.groupKey||(L.groupKey=_),L}),O=[...o.value];N.forEach(B=>{const L=O.findIndex(j=>j.id===B.id);L!==-1?O[L]=B:O.push(B)}),s(O)},insertNodeAt:(C,x)=>{const _=[...o.value];_.splice(x,0,C),s(_)},moveNode:(C,x)=>{const _=[...o.value],[N]=_.splice(C,1);_.splice(x,0,N),s(_)}}};function Y6e(){const{removeNode:o}=CU(),{containerRef:s}=Pf(),i=m=>{var j,J;if(m.target instanceof Element&&m.target.classList.contains("node-item"))return;const h=m.target;if(h===s.value)return;const C=((j=s.value)==null?void 0:j.getRootNode()).getSelection(),x=(J=s.value)==null?void 0:J.querySelectorAll('[contenteditable="true"]');x==null||x.forEach(Y=>{Y.setAttribute("contenteditable","false")});const _=h.textContent||"",N=h.innerHTML||"";h.setAttribute("contenteditable","true"),h.focus();const O=new MutationObserver(()=>{h.textContent!==_&&(h.innerHTML=N)});O.observe(h,{characterData:!0,childList:!0,subtree:!0});const B=Y=>{Y.preventDefault()};h.addEventListener("input",B),h.addEventListener("paste",B),h.addEventListener("drop",B),h.addEventListener("keydown",Y=>{var ne,K,W,Se;if(((ne=document.activeElement)==null?void 0:ne.shadowRoot)===((K=s.value)==null?void 0:K.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(Y.key)){if(Y.key==="Backspace"||Y.key==="Delete"){const ut=C==null?void 0:C.getRangeAt(0);if(h.blur(),(ut==null?void 0:ut.startOffset)===0){const Le=ut.startContainer;if(Le.nodeType===Node.TEXT_NODE){const te=Le.previousSibling;if(te&&te.nodeType===Node.ELEMENT_NODE&&te.classList.contains("node-item")){const We=te.getAttribute("id");We&&o(We),(W=Le.parentElement)==null||W.normalize();return}}else if(Le.nodeType===Node.ELEMENT_NODE){const te=Le.previousSibling;if(te&&te.nodeType===Node.ELEMENT_NODE&&te.classList.contains("node-item")){const We=te.getAttribute("id");We&&o(We),(Se=Le.parentElement)==null||Se.normalize();return}}}}Y.preventDefault()}});const L=()=>{O.disconnect(),h.removeEventListener("input",B),h.removeEventListener("paste",B),h.removeEventListener("drop",B),h.removeEventListener("blur",L),h.setAttribute("contenteditable","false")};h.addEventListener("blur",L)},u=()=>{var m;(m=s.value)==null||m.addEventListener("dblclick",i)};return f.watch(s,m=>{m&&u()},{immediate:!0}),f.onUnmounted(()=>{var m;(m=s.value)==null||m.removeEventListener("dblclick",i)}),{}}function K6e(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=Pf(),h=_=>{var O,B;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const L=N.getRangeAt(0);u.value=M6e(L.startContainer);const j=L.startOffset,J=(B=s.value)==null?void 0:B.querySelectorAll(".node-item");let Y=0;return m.value=0,J==null||J.forEach(ne=>{const K=document.createRange();if(K.selectNode(ne),K.comparePoint(L.startContainer,j)>=0){m.value+=1;const W=ne.getAttribute("data-startOffset");Number(W)>Y&&(Y=Number(W))}}),Y+j}}catch{}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var L;const N=_.target;if(N===o.value)return;s.value=N;const O=(L=o.value)==null?void 0:L.getRootNode();i.value=h(O),N.addEventListener("click",b),N.addEventListener("keyup",j=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(j.key)&&b()});const B=()=>{N.removeEventListener("click",b),N.removeEventListener("keyup",b),N.removeEventListener("blur",B),setTimeout(()=>{s.value=null,u.value=0,i.value=-1},300)};N.addEventListener("blur",B)},x=()=>{var _;(_=o.value)==null||_.addEventListener("focus",C,!0)};return f.watch(o,_=>{_&&x()},{immediate:!0}),f.onUnmounted(()=>{var _;(_=o.value)==null||_.removeEventListener("focus",C,!0)}),{focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}}function X6e(o){const s=o.value===null?[]:[JSON.parse(JSON.stringify(o.value))],i=f.ref(s),u=f.ref(0),m=f.ref(!1),h=f.computed(()=>i.value[u.value]),b=()=>{u.value>0&&(m.value=!0,u.value--,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},C=()=>{u.value<i.value.length-1&&(m.value=!0,u.value++,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},x=_=>{(_.ctrlKey||_.metaKey)&&_.key==="z"?(_.preventDefault(),b()):(_.ctrlKey||_.metaKey)&&_.key==="y"&&(_.preventDefault(),C())};return f.onMounted(()=>{window.addEventListener("keydown",x)}),f.onUnmounted(()=>{window.removeEventListener("keydown",x)}),f.watch(o,uE(_=>{_&&!m.value&&(i.value.splice(u.value+1),i.value.push(JSON.parse(JSON.stringify(_))),u.value++),m.value&&(m.value=!1)},300),{deep:!0}),{current:h,undo:b,redo:C}}function J6e(){const{modelValue:o}=j0(),{nodes:s,addNode:i}=CU(),u=b=>{if(!b||typeof b!="string")return[];const x=new DOMParser().parseFromString(b,"text/html");return Array.from(x.querySelectorAll("td")).filter(O=>{var B;return!((B=O.textContent)!=null&&B.trim())})},m=(b,C)=>{const x=C.map(N=>N.nodePath);return b==null?void 0:b.map(N=>({nodePath:woe(N)})).filter(N=>{const O=N==null?void 0:N.nodePath;return!x.includes(O)})},h=b=>{const C=b.map(x=>({nodeType:"Text",label:"文本",...x}));i(C)};f.onMounted(()=>{const b=u(o),C=m(b,f.toValue(s));h(C)})}function Q6e(){const{selectedNodes:o,containerRef:s}=Pf(),{removeNode:i}=CU(),u=f.ref(null),m=C=>{var x;if((x=f.toValue(s))!=null&&x.contains(u.value)&&(C.key==="Delete"||C.key==="Backspace")){let _=[];C.preventDefault(),f.toValue(o).length>0&&(f.toValue(o).forEach(N=>{var O,B,L;if(((O=N==null?void 0:N.element)==null?void 0:O.tagName)==="TD"){const j=(B=N==null?void 0:N.element)==null?void 0:B.getAttribute("id");j&&_.push(j)}else{const j=(L=N==null?void 0:N.element)==null?void 0:L.getAttribute("id");j&&_.push(j)}}),o.value=[],(_==null?void 0:_.length)>0&&i(_))}},h=C=>{var x;(x=f.toValue(s))!=null&&x.contains(C.target)?u.value=C.target:u.value=null},b=()=>{s.value&&(window.addEventListener("keydown",m),s.value.addEventListener("mousedown",h))};f.watch(()=>s.value,C=>{f.toValue(C)&&b()},{immediate:!0}),f.onUnmounted(()=>{s.value&&(window.removeEventListener("keydown",m),s.value.removeEventListener("mousedown",h))})}function SU(){const{nodes:o}=j0(),{containerRef:s,renderNodes:i,uiReady:u}=Pf(),m=()=>{var h;i.value=[...(h=o.value)==null?void 0:h.map(b=>{var x;const C=(x=s.value)==null?void 0:x.querySelector(`[id="${b.id}"]`);return{...b,element:C}})].filter(b=>!!(b!=null&&b.element))};f.watch(()=>[o,s.value,u],()=>{f.toValue(u)&&m()},{immediate:!0,deep:!0})}const lne=f.ref({});function xU(o){return f.computed(()=>{var s;return(s=lne.value)==null?void 0:s[o]})}function bfe(){const o=j0(),s=Pf();f.onMounted(()=>{const{editorId:i}=o;i&&(lne.value[i]=f.ref({...o,...s}))}),f.onUnmounted(()=>{const{editorId:i}=o;i&&(lne.value[i]=null)})}const eMe=f.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{nodes:s}=j0(),{uiReady:i,renderNodes:u}=Pf();return bfe(),X6e(s),hfe(),vfe(),Q6e(),K6e(),Y6e(),J6e(),SU(),(m,h)=>f.unref(i)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(u),b=>(f.openBlock(),f.createBlock(wU,{key:b==null?void 0:b.id,node:b},{default:f.withCtx(C=>[f.renderSlot(m.$slots,"nodeItem",{node:C==null?void 0:C.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),qie=f.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=Pf();return SU(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(wU,{key:h==null?void 0:h.id,node:h},{default:f.withCtx(b=>[f.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),tMe=f.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=Pf();return SU(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(wU,{key:h==null?void 0:h.id,node:h},{default:f.withCtx(b=>[f.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),nMe=f.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=Pf();return bfe(),hfe(),vfe(),SU(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(wU,{key:h==null?void 0:h.id,node:h},{default:f.withCtx(b=>[f.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),oMe=f.defineComponent({__name:"NodesProvider",props:f.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},renderType:{type:String,default:"preview"},inputTypes:{type:Array,default:()=>[]},editorId:{type:String,default:""}},{formData:{},formDataModifiers:{},nodes:{},nodesModifiers:{}}),emits:f.mergeModels(["update:nodes"],["update:formData","update:nodes"]),setup(o,{emit:s}){const i=o,u=f.useModel(o,"formData"),m=f.useModel(o,"nodes");return f.provide(gfe,{modelValue:i.modelValue,renderType:i.renderType,inputTypes:i.inputTypes,editorId:i==null?void 0:i.editorId,nodes:m,updateNodes:h=>m.value=h,formData:u}),(h,b)=>f.renderSlot(h.$slots,"default")}}),c2=f.ref({});function sMe(o){return f.computed(()=>(c2.value[o]||(c2.value[o]=f.ref([])),c2.value[o]))}function rMe(o){const{editorId:s}=o,i=f.ref(!1);f.onMounted(()=>{c2.value[s]||(c2.value[s]=f.ref([]));const u=c2.value[s].findIndex(m=>m.id===o.id);u!==-1&&c2.value[s].splice(u,1),i.value=!0,c2.value[s].push({...o,isMounted:i})}),f.onUnmounted(()=>{i.value=!1})}const aMe=f.defineComponent({__name:"NodesUIProvider",props:{nodes:{type:Array,default:()=>[]},selectedNodes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},editorId:{type:String,default:""}},emits:["onSelectedNodes","update:selectedNodes"],setup(o,{expose:s,emit:i}){const u=o,m=i,h=f.computed({get:()=>(u.selectedNodes||[]).map(ne=>{var Se;let K=(Se=u==null?void 0:u.nodes)==null?void 0:Se.find(ut=>(ut==null?void 0:ut.id)===(ne==null?void 0:ne.id)),W=ne!=null&&ne.element?ne==null?void 0:ne.element:O6e(ne==null?void 0:ne.id,b.value);return{...K||{},...ne,element:W}}),set:ne=>{const K=ne.map(({element:W,...Se})=>{var Le;return{...((Le=u==null?void 0:u.nodes)==null?void 0:Le.find(te=>(te==null?void 0:te.id)===(Se==null?void 0:Se.id)))||{},...Se}});m("update:selectedNodes",K)}}),b=f.ref(null),C=f.ref([]),x=f.ref(null),_=f.ref(-1),N=f.ref(0),O=f.ref(0),B=sMe(u==null?void 0:u.editorId),L=f.ref(!1),j=f.computed(()=>{var K,W;const ne=((W=(K=f.toValue(B))==null?void 0:K.filter(Se=>!f.toValue(Se==null?void 0:Se.activated)))==null?void 0:W.filter(Se=>f.toValue(Se.isMounted)))||[];return B6e([...(u==null?void 0:u.nodesGroups)||[],...ne])}),J=f.ref([]),Y=ne=>{const K=ne.map(({element:W,...Se})=>{var Le;return{...((Le=C.value)==null?void 0:Le.find(te=>(te==null?void 0:te.id)===(Se==null?void 0:Se.id)))||{},...Se}});di(K,h.value)||(h.value=ne,m("onSelectedNodes",K))};return s({setSelectedNodes:Y}),f.provide(ffe,{containerRef:b,focusedElement:x,currentRenderNodes:J,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:j,selectedNodes:h,setSelectedNodes:Y,renderNodes:C,uiReady:L,nodesGroups:u==null?void 0:u.nodesGroups}),(ne,K)=>f.renderSlot(ne.$slots,"default")}}),iMe=["onClick"],lMe={key:0,class:"icon"},cMe={key:1,class:"arrow"},uMe={key:0,class:"submenu"},dMe=["onClick"],fMe={key:0,class:"icon"},mMe=f.defineComponent({__name:"index",props:f.mergeModels({style:{}},{show:{},showModifiers:{}}),emits:f.mergeModels(["select"],["update:show"]),setup(o,{emit:s}){const{selectedNodes:i,focusedElement:u,cursorPosition:m,focusedNodeIndex:h,preNodeNumber:b}=Pf(),{inputTypes:C}=j0(),x=f.useModel(o,"show"),{editNodes:_}=CU(),N=j=>{if(f.toValue(u)&&!rxe(f.toValue(m))){const J=woe(f.toValue(u)),Y=f.toValue(m),ne=(f.toValue(b)||0)+1,K=R6e(f.toValue(u));J&&Y&&Y>=0&&_({...K,label:j==null?void 0:j.label,nodePath:J,startOffset:Y,subNodeSort:ne,textNodeIndex:f.toValue(h)||0,nodeType:j==null?void 0:j.value})}else if(i){const J=f.toValue(i);J!=null&&J.length&&_(J==null?void 0:J.map(Y=>({...Y,label:j==null?void 0:j.label,element:Y==null?void 0:Y.element,nodePath:Y==null?void 0:Y.nodePath,nodeType:j==null?void 0:j.value})))}x.value=!1},O=f.computed(()=>{const j=[],J=[];return f.toValue(C).forEach(Y=>{Y.groupName==="system"?J.push({...Y,handler:()=>{N(Y)}}):j.push({...Y,handler:()=>{N(Y)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:j},{label:"插入记录标识",icon:"i-bi:flag",children:J}].filter(Y=>{var ne;return(ne=Y==null?void 0:Y.children)==null?void 0:ne.length})}),B=s,L=(j,J)=>{j.preventDefault(),J!=null&&J.handler&&J.handler(),J!=null&&J.value&&B("select",J==null?void 0:J.value)};return(j,J)=>f.withDirectives((f.openBlock(),f.createElementBlock("div",{class:"context-menu",style:f.normalizeStyle({...j.style})},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(O.value,Y=>(f.openBlock(),f.createElementBlock("div",{key:Y==null?void 0:Y.label,class:"menu-item"},[f.createElementVNode("div",{class:"menu-item-content",onClick:ne=>L(ne,Y)},[Y!=null&&Y.icon?(f.openBlock(),f.createElementBlock("div",lMe,[f.createElementVNode("div",{class:f.normalizeClass(Y==null?void 0:Y.icon)},null,2)])):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(Y.label)+" ",1),Y!=null&&Y.children?(f.openBlock(),f.createElementBlock("span",cMe,"›")):f.createCommentVNode("",!0)],8,iMe),Y!=null&&Y.children?(f.openBlock(),f.createElementBlock("div",uMe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(Y.children,ne=>(f.openBlock(),f.createElementBlock("div",{key:ne.action,class:"menu-item",onClick:K=>L(K,ne)},[ne!=null&&ne.icon?(f.openBlock(),f.createElementBlock("div",fMe,[f.createElementVNode("div",{class:f.normalizeClass(ne==null?void 0:ne.icon)},null,2)])):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(ne.label),1)],8,dMe))),128))])):f.createCommentVNode("",!0)]))),128))],4)),[[f.vShow,x.value]])}}),pMe=$i(mMe,[["__scopeId","data-v-7f46efc3"]]);function gMe(){const o=f.ref(!1),s=f.ref({left:"0px",top:"0px"}),i=m=>{m.preventDefault(),o.value=!0;const b=m.currentTarget.getBoundingClientRect(),C=m.clientX-b.left,x=m.clientY-b.top,_=118,N=b.width-C<_;s.value={left:N?`${C-_}px`:`${C}px`,top:`${x}px`}},u=m=>{const h=document.querySelector(".context-menu");h&&!h.contains(m.target)&&(o.value=!1)};return f.onMounted(()=>{document.addEventListener("mousedown",u)}),f.onUnmounted(()=>{document.removeEventListener("mousedown",u)}),{showContextMenu:o,contextMenuStyle:s,onContextMenu:i,closeContextMenu:u}}function yfe(o){return{all:o=o||new Map,on:function(s,i){var u=o.get(s);u?u.push(i):o.set(s,[i])},off:function(s,i){var u=o.get(s);u&&(i?u.splice(u.indexOf(i)>>>0,1):o.set(s,[]))},emit:function(s,i){var u=o.get(s);u&&u.slice().map(function(m){m(i)}),(u=o.get("*"))&&u.slice().map(function(m){m(s,i)})}}}const cne=yfe(),wfe=(...o)=>{const s=o[0],i=o[1];f.onMounted(()=>{cne.on(s,i)}),f.onBeforeUnmount(()=>{cne.off(s)})},xoe=()=>(...s)=>{cne.emit(...s)};let O0=null;function hMe(o){const{onSelected:s}=o,{selectedNodes:i,setSelectedNodes:u}=Pf();return f.watch(()=>i,()=>{O0==null||O0({data:i.value}),s==null||s(f.toValue(i))},{deep:!0}),wfe("selectNodes",h=>{const{data:b,callback:C=null,mode:x="multiple"}=h;setTimeout(()=>{u(f.toValue(b)),O0=C},100)}),{onBlur:()=>{O0&&(O0==null||O0({data:i.value,type:"blur"}),O0=null,u([]))}}}const vMe={class:"relative"},bMe=f.defineComponent({__name:"index",props:{hasContextMenu:{type:Boolean,default:!1}},setup(o){const{containerRef:s,uiReady:i}=Pf(),{nodes:u,modelValue:m}=j0(),{showContextMenu:h,contextMenuStyle:b,onContextMenu:C}=gMe(),x=f.ref(null),_=L=>{let j=null;if(Soe(L))j=mfe(L.nodePath,f.toValue(s)),j&&j.classList.add("node-item-td");else{const J=document.createElement("span");J.setAttribute("contenteditable","false"),J.classList.add("node-item"),j=J,$6e(L,j,s.value)}return j&&D6e(j,L),j},N=()=>{const L=fxe(u.value,[j=>j.nodePath,j=>j.textNodeIndex,j=>j.startOffset??-1,j=>j.subNodeSort],["asc","desc","desc","desc"]);L==null||L.forEach(j=>{_(j)})};f.watch(()=>[u,m,x],()=>{x.value&&(i.value=!1,f.nextTick(()=>{x.value&&(x.value.innerHTML=m,N(),i.value=!0)}))},{deep:!0,immediate:!0});const O=f.ref(),{onBlur:B}=hMe({onSelected:()=>{var L;(L=O.value)==null||L.focus()}});return(L,j)=>(f.openBlock(),f.createElementBlock("div",vMe,[f.createVNode(yoe,{onOnBlur:f.unref(B),ref_key:"shadowDomRef",ref:O},{default:f.withCtx(()=>[f.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:s,onContextmenu:j[0]||(j[0]=f.withModifiers((...J)=>f.unref(C)&&f.unref(C)(...J),["prevent"]))},[f.createElementVNode("body",{ref_key:"bodyRef",ref:x},null,512)],544)]),_:1},8,["onOnBlur"]),o.hasContextMenu?(f.openBlock(),f.createBlock(pMe,{key:0,show:f.unref(h),"onUpdate:show":j[1]||(j[1]=J=>f.isRef(h)?h.value=J:null),style:f.normalizeStyle(f.unref(b))},null,8,["show","style"])):f.createCommentVNode("",!0)]))}}),Yie={A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},B3:{width:353,height:500},B4:{width:257,height:364},B5:{width:176,height:250}},yMe={class:"pagesize"},wMe=f.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"}},setup(o){const s=o,i=f.computed(()=>{const u=Yie[s.pagesize]||Yie.A4,m=(window.devicePixelRatio||1)*96;return u.width*m/25.4});return(u,m)=>(f.openBlock(),f.createElementBlock("div",yMe,[f.createElementVNode("div",{style:f.normalizeStyle({width:`${i.value}px`}),class:"pagesize-content"},[f.renderSlot(u.$slots,"default",{},void 0,!0)],4)]))}}),CMe=$i(wMe,[["__scopeId","data-v-46808dfa"]]),Cfe=f.defineComponent({__name:"index",props:f.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},pagesize:{type:String,default:"A4"},renderType:{type:String,default:"preview"},formData:{type:Object,default:()=>({})},inputTypes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},id:{type:String,default:""}},{selectedNodes:{default:[]},selectedNodesModifiers:{}}),emits:f.mergeModels(["update:nodes","update:formData","onSelectedNodes"],["update:selectedNodes"]),setup(o,{expose:s,emit:i}){const u=o,m=i,h=f.useModel(o,"selectedNodes"),b=f.ref(),C=f.ref(),x=f.computed(()=>{switch(u.renderType){case"edit":return eMe;case"select":return nMe;case"preview":return qie;case"enter":return tMe;default:return qie}}),_=B=>{m("update:nodes",B)},N=B=>{m("update:formData",B)},O=B=>{m("onSelectedNodes",B)};return s({formRef:{validate:()=>{var B,L,j;return(j=(L=(B=b.value)==null?void 0:B.formRef)==null?void 0:L.validate)==null?void 0:j.call(L)}},setSelectedNodes:B=>{var L,j;(j=(L=C.value)==null?void 0:L.setSelectedNodes)==null||j.call(L,B)}}),(B,L)=>(f.openBlock(),f.createBlock(CMe,{pagesize:o.pagesize},{default:f.withCtx(()=>[f.createVNode(aMe,{ref_key:"UIRef",ref:C,nodes:o.nodes,"onUpdate:nodes":_,selectedNodes:h.value,"onUpdate:selectedNodes":L[0]||(L[0]=j=>h.value=j),onOnSelectedNodes:O,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id},{default:f.withCtx(()=>[f.createVNode(oMe,{renderType:o.renderType,"model-value":o.modelValue,nodes:o.nodes,"onUpdate:nodes":_,formData:o.formData,"onUpdate:formData":N,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id},{default:f.withCtx(()=>[f.createVNode(bMe,{hasContextMenu:o.renderType==="edit"},null,8,["hasContextMenu"]),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(x.value),{renderType:o.renderType,pagesize:o.pagesize,ref_key:"contentRef",ref:b},{nodeItem:f.withCtx(j=>[f.renderSlot(B.$slots,"nodeItem",{node:j==null?void 0:j.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId"])]),_:3},8,["pagesize"]))}}),SMe={class:"nodes-text"},xMe={key:0,class:"node-text-input"},EMe={key:1,class:"node-text-td"},_Me={key:0,class:"node-text-table-index"},kMe=f.defineComponent({__name:"index",props:f.mergeModels({editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.useModel(o,"modelValue"),u=xU(s==null?void 0:s.editorId),m=f.computed(()=>{var b,C,x,_,N,O;if(((b=f.toValue(h))==null?void 0:b.length)>0)if((x=(C=f.toValue(h))==null?void 0:C[0])!=null&&x.element){const B=(N=(_=f.toValue(h))==null?void 0:_[0])==null?void 0:N.element.closest("body").querySelectorAll("table");return((O=Array.from(B))==null?void 0:O.length)===1}else return!0;else return!0}),h=f.computed(()=>{var b;return pfe(i.value,((b=f.toValue(u))==null?void 0:b.renderNodes)||[])});return(b,C)=>(f.openBlock(),f.createElementBlock("div",SMe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(h.value,(x,_)=>{var N,O,B;return f.openBlock(),f.createElementBlock("div",{key:_,class:"node-text-item"},[(x==null?void 0:x.showTextType)==="input"?(f.openBlock(),f.createElementBlock("span",xMe," 填写"+f.toDisplayString(x==null?void 0:x.inputIndex),1)):(f.openBlock(),f.createElementBlock("span",EMe,[m.value?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("span",_Me,f.toDisplayString(`表${(N=x==null?void 0:x.min)==null?void 0:N.tableIndex}.`),1)),f.createTextVNode(" "+f.toDisplayString(((O=x==null?void 0:x.min)==null?void 0:O.id)===((B=x==null?void 0:x.max)==null?void 0:B.id)?f.unref(t4)(x==null?void 0:x.min):`${f.unref(t4)(x==null?void 0:x.min)}:${f.unref(t4)(x==null?void 0:x.max)}`),1)]))])}),128))]))}}),Kie=$i(kMe,[["__scopeId","data-v-67e3a210"]]);function TMe(o){const{nodes:s,mode:i="multiple"}=o,u=f.ref(!1),m=xoe();return{isSelecting:u,selectNodes:()=>{if(u.value)return!1;u.value=!0,m("selectNodes",{data:f.toValue(s),mode:i,callback:({data:b,type:C})=>{s.value=b,C==="blur"&&(u.value=!1)}})}}}const HA=["#ff9b40","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],EH=f.ref(0),eE=new Map,AMe={key:0,class:"node-select-small gap-x-2"},NMe={key:1,class:"text-[#999]"},OMe={key:1,class:"node-select"},$Me={class:"flex py-2 px-2 justify-between items-center noder-select-header"},DMe={class:"flex gap-2"},MMe={class:"flex gap-1"},RMe=f.defineComponent({__name:"index",props:f.mergeModels({mode:{type:String,default:"multiple"},color:{type:String},id:{type:String,default:""},editorId:{type:String,default:""},size:{type:String,default:"default"},label:{type:String,default:"点击选择"}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.ref((eE==null?void 0:eE[s==null?void 0:s.id])||0),u=f.ref((s==null?void 0:s.id)||yE()),m=f.useModel(o,"modelValue"),{selectNodes:h,isSelecting:b}=TMe({nodes:m,mode:s.mode}),C=()=>{m.value=[]},x=f.computed(()=>s.color||(HA==null?void 0:HA[f.toValue(i)%(HA==null?void 0:HA.length)])||"#409eff");return f.onMounted(()=>{axe(eE==null?void 0:eE[s==null?void 0:s.id])&&(s!=null&&s.id)&&(eE[s==null?void 0:s.id]=EH.value,i.value=EH.value,EH.value=EH.value+1)}),rMe({id:u.value,editorId:s.editorId,nodes:m,activated:b,color:x}),(_,N)=>{var O;return s.size==="small"?(f.openBlock(),f.createElementBlock("div",AMe,[f.createElementVNode("div",{style:f.normalizeStyle({"--node-color":x.value}),class:"node-color cursor-pointer"},null,4),f.createElementVNode("div",null,f.toDisplayString(s.label),1),f.createElementVNode("div",{style:f.normalizeStyle(f.unref(b)?{color:"#409eff"}:{}),onClick:N[0]||(N[0]=(...B)=>f.unref(h)&&f.unref(h)(...B))},N[6]||(N[6]=[f.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer"},null,-1)]),4),f.createElementVNode("div",{class:"flex items-center flex-wrap gap-1 cursor-pointer",onClick:N[2]||(N[2]=(...B)=>f.unref(h)&&f.unref(h)(...B))},[((O=m.value)==null?void 0:O.length)>0?(f.openBlock(),f.createBlock(Kie,{key:0,modelValue:m.value,"onUpdate:modelValue":N[1]||(N[1]=B=>m.value=B),editorId:o.editorId},null,8,["modelValue","editorId"])):(f.openBlock(),f.createElementBlock("div",NMe,"未设置"))])])):(f.openBlock(),f.createElementBlock("div",OMe,[f.createElementVNode("div",$Me,[f.createElementVNode("div",DMe,[f.createElementVNode("div",{style:f.normalizeStyle({"--node-color":x.value}),class:"node-color cursor-pointer"},null,4),f.createElementVNode("div",{style:f.normalizeStyle(f.unref(b)?{color:"#409eff"}:{})},[f.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:N[3]||(N[3]=(...B)=>f.unref(h)&&f.unref(h)(...B))})],4),f.createElementVNode("div",null,[f.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})])]),f.createElementVNode("div",MMe,[N[8]||(N[8]=f.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),f.createElementVNode("div",null,[f.createVNode(f.unref(Bn.ElPopover),{placement:"top-start",width:200,trigger:"hover",content:"this is content, this is content, this is content"},{reference:f.withCtx(()=>N[7]||(N[7]=[f.createElementVNode("div",{class:"flex flex-center"},[f.createElementVNode("div",{class:"i-bi:info-circle-fill mr-2"}),f.createTextVNode(" 使用帮助 ")],-1)])),_:1})])])]),f.createElementVNode("div",{class:"min-h-[42px] px-2 py-1",onClick:N[5]||(N[5]=(...B)=>f.unref(h)&&f.unref(h)(...B))},[f.createVNode(Kie,{modelValue:m.value,"onUpdate:modelValue":N[4]||(N[4]=B=>m.value=B),editorId:o.editorId},null,8,["modelValue","editorId"])])]))}}}),Sfe=$i(RMe,[["__scopeId","data-v-4ab41798"]]);function BMe(o){if(!o.startsWith("="))return[];const s=[];let i=1;for(o.startsWith("=")&&s.push({type:"startOperator",value:"="});i<o.length;){const u=o[i];if(/\s/.test(u)){i++;continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];if(i<o.length&&o[i]===":"){i++;let h="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)h+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)h+=o[i++];s.push({type:"range",value:`${m}:${h}`});continue}else{s.push({type:"cell",value:m});continue}}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(/[A-Za-z]/.test(u)){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];if(["AVERAGE","AVEDEV","SUM","IF","COUNT","MAX","MIN","SQRT"].includes(m.toUpperCase())&&o[i]==="("){s.push({type:"function",value:m});continue}i-=m.length}if(/\d/.test(u)){let m="";for(;i<o.length&&(/\d/.test(o[i])||o[i]===".");)m+=o[i++];s.push({type:"number",value:m});continue}if(u==='"'){let m="";for(m+=u,i++;i<o.length&&o[i]!=='"';)m+=o[i++];m+=u,i++,s.push({type:"string",value:m});continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(u===":"){s.push({type:"operator",value:":"}),i++;continue}if(/[+\-*/=><]/.test(u)){s.push({type:"operator",value:u}),i++;continue}if(/[()]/.test(u)){s.push({type:"paren",value:u}),i++;continue}if(u===","){s.push({type:"separator",value:","}),i++;continue}i++}return s}function IMe(o,s){const i=[];let u=0;for(;u<o.length;){let m=!1;for(const h of s){const b=h.value;if(o.startsWith(b,u)){i.push({type:h.type,value:b,...h.cellValue?{cellValue:h.cellValue}:{}}),u+=b.length,m=!0;break}}m||(i.push({type:"plain",value:o[u]}),u++)}return i}function PMe(o){const s=xU(o.editorId),i=(b,C)=>{let x=[];const _=Math.min(b.colIndex,C.colIndex),N=Math.max(b.colIndex,C.colIndex),O=Math.min(b.rowIndex,C.rowIndex),B=Math.max(b.rowIndex,C.rowIndex);for(let L=O;L<=B;L++)for(let j=_;j<=N;j++)x.push({colIndex:j,rowIndex:L});return x},u=b=>{var N;const C=b.includes(":");let x=[];if(C){const[O,B]=b.split(":").map(L=>h(L));x=i(O,B)}else x=[h(b)];return m(x,f.toValue((N=f.toValue(s))==null?void 0:N.nodes))},m=(b,C)=>C==null?void 0:C.filter(x=>{const _=x.nodePath.split(" > ");let N=1,O=1;return _.forEach(B=>{if(B.startsWith("tr")){const L=B.match(/tr(?::nth-child\((\d+)\))?/);L&&L[1]&&(N=parseInt(L[1]))}else if(B.startsWith("td")){const L=B.match(/td(?::nth-child\((\d+)\))?/);L&&(O=L[1]?parseInt(L[1]):1)}}),b.some(B=>N===B.rowIndex+1&&O===B.colIndex+1)}),h=b=>{if(!b)return{colIndex:-1,rowIndex:-1};const C=b.match(/^([A-Za-z]+)(\d+)$/);if(!C)return{colIndex:-1,rowIndex:-1};const x=C[1].toUpperCase(),_=parseInt(C[2]);let N=0;for(let O=0;O<x.length;O++)N=N*26+(x.charCodeAt(O)-64);return{colIndex:N-1,rowIndex:_}};return{getCellValue:u}}const Xie=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function FMe(o,s,i){const u=f.ref(null),m=f.ref(null);function h(){return o.value&&o.value.textContent||""}f.onMounted(()=>{o.value&&(u.value=()=>{const C=h();s.value=C},m.value=()=>{const C=h();s.value=C},o.value.addEventListener("input",u.value),o.value.addEventListener("blur",m.value))}),f.onUnmounted(()=>{o.value&&(u.value&&o.value.removeEventListener("input",u.value),m.value&&o.value.removeEventListener("blur",m.value))});const b=C=>{var x,_,N,O;if(C>=0){const B=window.getSelection();if(B){const L=B.getRangeAt(0),j=((x=L.startContainer)==null?void 0:x.nodeName)==="#text"?L.startContainer:(N=(_=L.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],J=Math.min(C,((O=j.textContent)==null?void 0:O.length)||0);L.setStart(j,J)}}};return f.watch(()=>[s,o],()=>{var C;o.value&&(di((C=o.value)==null?void 0:C.textContent,f.toValue(s))||(o.value.textContent=f.toValue(s),b(f.toValue(i))))},{deep:!0,immediate:!0}),{getFormulaContent:h}}function Eoe(o){const{element:s,onFocus:i,onBlur:u}=o,m=f.ref(!1),h=()=>{m.value=!0,i==null||i()},b=()=>{m.value=!1,u==null||u()};return f.onMounted(()=>{var C,x;f.toValue(s)&&((C=f.toValue(s))==null||C.addEventListener("focus",h),(x=f.toValue(s))==null||x.addEventListener("blur",b))}),f.onUnmounted(()=>{var C,x;f.toValue(s)&&((C=f.toValue(s))==null||C.removeEventListener("focus",h),(x=f.toValue(s))==null||x.removeEventListener("blur",b))}),m}function LMe(o){const{element:s,showStr:i,editorId:u}=o,m=xU(u),h=Eoe({element:s}),b=f.computed(()=>{var C;return(C=i==null?void 0:i.value)==null?void 0:C.filter(x=>["range","cell"].includes(x.type))});return f.watch(()=>h,()=>{var x,_,N,O,B,L;const C=j=>{var J;j.preventDefault(),(J=f.toValue(s))==null||J.focus()};f.toValue(h)?((x=f.toValue(m))==null||x.containerRef.addEventListener("click",C),(_=f.toValue(m))==null||_.containerRef.addEventListener("mousedown",C),(N=document.querySelectorAll(".select-function"))==null||N.forEach(j=>{j.addEventListener("click",C),j.addEventListener("mousedown",C)})):((O=f.toValue(m))==null||O.containerRef.removeEventListener("click",C),(B=f.toValue(m))==null||B.containerRef.removeEventListener("mousedown",C),(L=document.querySelectorAll(".select-function"))==null||L.forEach(j=>{j.removeEventListener("click",C),j.removeEventListener("mousedown",C)}))},{deep:!0}),f.watch(()=>[h,b],()=>{var C,x,_,N,O;if((C=f.toValue(m))!=null&&C.containerRef&&((N=(_=(x=f.toValue(m))==null?void 0:x.containerRef)==null?void 0:_.querySelectorAll(".node-formula-cell"))==null||N.forEach(B=>{B.classList.remove("node-formula-cell")}),f.toValue(h))){let B=[];(O=b.value)!=null&&O.length&&(b.value.forEach(L=>{var j;B=[...B,...((j=L==null?void 0:L.cellValue)==null?void 0:j.map(J=>({color:L==null?void 0:L.color,backgroundColor:Coe((L==null?void 0:L.color)||"#000",.1),element:J==null?void 0:J.element})))||[]]}),B.forEach(L=>{var j;L!=null&&L.element&&((j=L==null?void 0:L.element)==null||j.classList.add("node-formula-cell"),L==null||L.element.style.setProperty("--formula-node-color",L==null?void 0:L.color),L==null||L.element.style.setProperty("--formula-node-bg-color",L==null?void 0:L.backgroundColor))}))}},{deep:!0}),h}const VMe=o=>{const{element:s}=o,i=f.ref(-1),u=C=>{const x=C==null?void 0:C.getSelection();try{if(x)return x.getRangeAt(0).startOffset}catch{}return 0},m=()=>{var x;const C=(x=s.value)==null?void 0:x.getRootNode();i.value=u(C)},h=C=>{var O;const x=C.target,_=(O=s.value)==null?void 0:O.getRootNode();i.value=u(_),x.addEventListener("click",m),x.addEventListener("keyup",B=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(B.key)&&m()});const N=()=>{x.removeEventListener("click",m),x.removeEventListener("keyup",m),x.removeEventListener("blur",N),setTimeout(()=>{i.value=-1},300)};x.addEventListener("blur",N)},b=()=>{var C;(C=s.value)==null||C.addEventListener("focus",h,!0)};return f.watch(s,C=>{C&&b()},{immediate:!0}),f.onUnmounted(()=>{var C;(C=s.value)==null||C.removeEventListener("focus",h,!0)}),{startOffset:i}};function HMe(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const zMe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},UMe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,x=xU(m),_=f.ref(-1),N=f.ref(0),O=Eoe({element:C}),B=f.ref(!1),L=xoe(),j=J=>{var Y,ne;if(f.toValue(B)&&f.toValue(O)&&!di((Y=f.toValue(b))==null?void 0:Y.cellValue,J)){const K=V6e(J,((ne=f.toValue(x))==null?void 0:ne.nodes)||"");let W=K;K&&(f.toValue(N)===0&&(W+=","),f.toValue(_)>=0&&(u.value=HMe(f.toValue(u),f.toValue(_),f.toValue(N),W),N.value=K.length))}};f.watch(()=>h,()=>{var J,Y,ne,K,W,Se;if((J=x.value)==null||J.setSelectedNodes([]),["range","cell"].includes((Y=f.toValue(b))==null?void 0:Y.type))return _.value=zMe(i.value,h.value),N.value=(K=(ne=f.toValue(b))==null?void 0:ne.value)==null?void 0:K.length,B.value=!0,L("selectNodes",{data:(W=f.toValue(b))==null?void 0:W.cellValue,mode:"multiple",callback:({data:ut})=>{j(ut)}}),!1;if([",","(","="].includes((Se=f.toValue(b))==null?void 0:Se.value))return _.value=f.toValue(s),B.value=!0,N.value=0,L("selectNodes",{data:[],mode:"multiple",callback:({data:ut})=>{j(ut)}}),!1;B.value=!1,_.value=-1},{immediate:!0,deep:!0})},jMe=o=>{const{startOffset:s,showStr:i}=o,u=f.ref(-1);f.watch(()=>s,()=>{var h;if(f.toValue(s)<=0)u.value=-1;else{let b=0;for(let C=0;C<i.value.length;C++){const x=i.value[C];if(b+=(h=x==null?void 0:x.value)==null?void 0:h.length,b>=f.toValue(s)){u.value=C;break}}}},{deep:!0,immediate:!0});const m=f.computed(()=>{var h;return(h=f.toValue(i))==null?void 0:h[f.toValue(u)]});return{currentItemIndex:u,currentItem:m}};function WMe(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const ZMe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},GMe=o=>{const{startOffset:s,showStr:i,value:u,currentItemIndex:m,currentItem:h,element:b}=o,C=f.ref(-1),x=f.ref(0),_=Eoe({element:b}),N=f.ref(!1),O=xoe(),B=L=>{var j;if(f.toValue(N)&&f.toValue(_)&&!di((j=f.toValue(h))==null?void 0:j.value,L)){const J=L,Y=J;J&&f.toValue(C)>=0&&(u.value=WMe(f.toValue(u),f.toValue(C),f.toValue(x),Y),x.value=J.length)}};f.watch(()=>m,()=>{var L,j,J,Y,ne;if(["function"].includes((L=f.toValue(h))==null?void 0:L.type))return C.value=ZMe(i.value,m.value),x.value=(J=(j=f.toValue(h))==null?void 0:j.value)==null?void 0:J.length,N.value=!0,O("selectFunction",{data:(Y=f.toValue(h))==null?void 0:Y.value,callback:({data:K})=>{console.log(K),B(K)}}),!1;if([",","(","="].includes((ne=f.toValue(h))==null?void 0:ne.value))return C.value=f.toValue(s),N.value=!0,x.value=0,O("selectFunction",{data:"",callback:({data:K})=>{console.log(K),B(K)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},qMe={class:"node-formula"},YMe={class:"node-formula-show"},KMe=f.defineComponent({__name:"index",props:f.mergeModels({id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{getCellValue:i}=PMe({editorId:s==null?void 0:s.editorId}),u=f.useModel(o,"modelValue"),m=f.ref(),{startOffset:h}=VMe({element:m});FMe(m,u,h);const b=f.computed(()=>{const N=BMe(u.value);return N==null?void 0:N.map(B=>B.type==="cell"||B.type==="range"?{cellValue:i(B.value),...B}:B)}),C=f.computed(()=>{const N=IMe(u.value,b.value);let O=-1;return N.map(L=>(L==null?void 0:L.type)==="cell"||(L==null?void 0:L.type)==="range"?(O++,{...L,color:Xie[O%Xie.length]}):(L==null?void 0:L.type)==="function"?{...L,color:"#0318ff"}:L)});LMe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:x,currentItem:_}=jMe({element:m,startOffset:h,value:u,showStr:C});return UMe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:x,currentItem:_}),GMe({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:x,currentItem:_}),(N,O)=>(f.openBlock(),f.createElementBlock("div",qMe,[f.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),f.createElementVNode("div",YMe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C.value,(B,L)=>(f.openBlock(),f.createElementBlock("span",{key:L,class:f.normalizeClass(["node-formula-item",`node-formula-item-type-${B==null?void 0:B.type}`,L===f.unref(x)?"node-formula-item-active":""]),style:f.normalizeStyle({"--text-color":(B==null?void 0:B.color)||"#000","--bg-color":f.unref(Coe)((B==null?void 0:B.color)||"#000",.1)})},f.toDisplayString(B.value),7))),128))])]))}}),xfe=$i(KMe,[["__scopeId","data-v-f4b96eb4"]]),XMe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],JMe={class:"select-function"},QMe=["onClick"],eRe={class:"function-item"},tRe={class:"function-item-desc"},nRe=f.defineComponent({__name:"index",props:f.mergeModels({id:{type:String,default:""},functionList:{type:Array,default:()=>[]}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o;let i=null;const u=f.computed(()=>{var b;return((b=s.functionList)==null?void 0:b.length)>0?s.functionList:XMe}),m=f.useModel(o,"modelValue"),h=b=>{m.value=b,i==null||i({data:b})};return wfe("selectFunction",({data:b,callback:C})=>{i=C,m.value=b}),(b,C)=>(f.openBlock(),f.createElementBlock("div",JMe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(u.value,(x,_)=>(f.openBlock(),f.createElementBlock("div",{key:_},[f.createElementVNode("div",{onClick:()=>{h(x.value)},class:f.normalizeClass(["function-item-wrapper",{active:m.value===x.value}])},[f.createElementVNode("div",eRe,f.toDisplayString(x.value),1),f.createElementVNode("div",tRe,f.toDisplayString(x.label),1)],10,QMe)]))),128))]))}}),Efe=$i(nRe,[["__scopeId","data-v-6e079ff0"]]),oRe=["innerHTML"],_fe=f.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue");return(i,u)=>(f.openBlock(),f.createBlock(yoe,null,{default:f.withCtx(()=>[f.createElementVNode("div",{innerHTML:s.value},null,8,oRe)]),_:1}))}});function EU(o){return f.getCurrentScope()?(f.onScopeDispose(o),!0):!1}function R0(o){return typeof o=="function"?o():f.unref(o)}const sRe=typeof window<"u"&&typeof document<"u",rRe=o=>typeof o<"u",aRe=Object.prototype.toString,iRe=o=>aRe.call(o)==="[object Object]",lRe=()=>{};function cRe(o,s){function i(...u){return new Promise((m,h)=>{Promise.resolve(o(()=>s.apply(this,u),{fn:s,thisArg:this,args:u})).then(m).catch(h)})}return i}const kfe=o=>o();function uRe(o=kfe){const s=f.ref(!0);function i(){s.value=!1}function u(){s.value=!0}const m=(...h)=>{s.value&&o(...h)};return{isActive:f.readonly(s),pause:i,resume:u,eventFilter:m}}function Jie(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function dRe(o,s,i={}){const{eventFilter:u=kfe,...m}=i;return f.watch(o,cRe(u,s),m)}function zA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:x}=uRe(u);return{stop:dRe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:x}}function fRe(o,s={}){if(!f.isRef(o))return f.toRefs(o);const i=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const u in o.value)i[u]=f.customRef(()=>({get(){return o.value[u]},set(m){var h;if((h=R0(s.replaceRef))!=null?h:!0)if(Array.isArray(o.value)){const C=[...o.value];C[u]=m,o.value=C}else{const C={...o.value,[u]:m};Object.setPrototypeOf(C,Object.getPrototypeOf(o.value)),o.value=C}else o.value[u]=m}}));return i}function une(o,s=!1){function i(O,{flush:B="sync",deep:L=!1,timeout:j,throwOnTimeout:J}={}){let Y=null;const K=[new Promise(W=>{Y=f.watch(o,Se=>{O(Se)!==s&&(Y==null||Y(),W(Se))},{flush:B,deep:L,immediate:!0})})];return j!=null&&K.push(Jie(j,J).then(()=>R0(o)).finally(()=>Y==null?void 0:Y())),Promise.race(K)}function u(O,B){if(!f.isRef(O))return i(Se=>Se===O,B);const{flush:L="sync",deep:j=!1,timeout:J,throwOnTimeout:Y}=B??{};let ne=null;const W=[new Promise(Se=>{ne=f.watch([o,O],([ut,Le])=>{s!==(ut===Le)&&(ne==null||ne(),Se(ut))},{flush:L,deep:j,immediate:!0})})];return J!=null&&W.push(Jie(J,Y).then(()=>R0(o)).finally(()=>(ne==null||ne(),R0(o)))),Promise.race(W)}function m(O){return i(B=>!!B,O)}function h(O){return u(null,O)}function b(O){return u(void 0,O)}function C(O){return i(Number.isNaN,O)}function x(O,B){return i(L=>{const j=Array.from(L);return j.includes(O)||j.includes(R0(O))},B)}function _(O){return N(1,O)}function N(O=1,B){let L=-1;return i(()=>(L+=1,L>=O),B)}return Array.isArray(R0(o))?{toMatch:i,toContains:x,changed:_,changedTimes:N,get not(){return une(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return une(o,!s)}}}function dne(o){return une(o)}function mRe(o){var s;const i=R0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const Tfe=sRe?window:void 0;function Afe(...o){let s,i,u,m;if(typeof o[0]=="string"||Array.isArray(o[0])?([i,u,m]=o,s=Tfe):[s,i,u,m]=o,!s)return lRe;Array.isArray(i)||(i=[i]),Array.isArray(u)||(u=[u]);const h=[],b=()=>{h.forEach(N=>N()),h.length=0},C=(N,O,B,L)=>(N.addEventListener(O,B,L),()=>N.removeEventListener(O,B,L)),x=f.watch(()=>[mRe(s),R0(m)],([N,O])=>{if(b(),!N)return;const B=iRe(O)?{...O}:O;h.push(...i.flatMap(L=>u.map(j=>C(N,L,j,B))))},{immediate:!0,flush:"post"}),_=()=>{x(),b()};return EU(_),_}function pRe(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function Qie(...o){let s,i,u={};o.length===3?(s=o[0],i=o[1],u=o[2]):o.length===2?typeof o[1]=="object"?(s=!0,i=o[0],u=o[1]):(s=o[0],i=o[1]):(s=!0,i=o[0]);const{target:m=Tfe,eventName:h="keydown",passive:b=!1,dedupe:C=!1}=u,x=pRe(s);return Afe(m,h,N=>{N.repeat&&R0(C)||x(N)&&i(N)},b)}function gRe(o){return JSON.parse(JSON.stringify(o))}function rte(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:x=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:B}=u,L=f.getCurrentInstance(),j=i||(L==null?void 0:L.emit)||((m=L==null?void 0:L.$emit)==null?void 0:m.bind(L))||((b=(h=L==null?void 0:L.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(L==null?void 0:L.proxy));let J=_;s||(s="modelValue"),J=J||`update:${s.toString()}`;const Y=W=>C?typeof C=="function"?C(W):gRe(W):W,ne=()=>rRe(o[s])?Y(o[s]):O,K=W=>{B?B(W)&&j(J,W):j(J,W)};if(x){const W=ne(),Se=f.ref(W);let ut=!1;return f.watch(()=>o[s],Le=>{ut||(ut=!0,Se.value=Y(Le),f.nextTick(()=>ut=!1))}),f.watch(Se,Le=>{!ut&&(Le!==o[s]||N)&&K(Le)},{deep:N}),Se}else return f.computed({get(){return ne()},set(W){K(W)}})}var hRe={value:()=>{}};function _U(){for(var o=0,s=arguments.length,i={},u;o<s;++o){if(!(u=arguments[o]+"")||u in i||/[\s.]/.test(u))throw new Error("illegal type: "+u);i[u]=[]}return new YH(i)}function YH(o){this._=o}function vRe(o,s){return o.trim().split(/^|\s+/).map(function(i){var u="",m=i.indexOf(".");if(m>=0&&(u=i.slice(m+1),i=i.slice(0,m)),i&&!s.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:u}})}YH.prototype=_U.prototype={constructor:YH,on:function(o,s){var i=this._,u=vRe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=bRe(i[m],o.name)))return m;return}if(s!=null&&typeof s!="function")throw new Error("invalid callback: "+s);for(;++h<b;)if(m=(o=u[h]).type)i[m]=ele(i[m],o.name,s);else if(s==null)for(m in i)i[m]=ele(i[m],o.name,null);return this},copy:function(){var o={},s=this._;for(var i in s)o[i]=s[i].slice();return new YH(o)},call:function(o,s){if((m=arguments.length-2)>0)for(var i=new Array(m),u=0,m,h;u<m;++u)i[u]=arguments[u+2];if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(h=this._[o],u=0,m=h.length;u<m;++u)h[u].value.apply(s,i)},apply:function(o,s,i){if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(var u=this._[o],m=0,h=u.length;m<h;++m)u[m].value.apply(s,i)}};function bRe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function ele(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=hRe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var fne="http://www.w3.org/1999/xhtml";const tle={svg:"http://www.w3.org/2000/svg",xhtml:fne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function kU(o){var s=o+="",i=s.indexOf(":");return i>=0&&(s=o.slice(0,i))!=="xmlns"&&(o=o.slice(i+1)),tle.hasOwnProperty(s)?{space:tle[s],local:o}:o}function yRe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===fne&&s.documentElement.namespaceURI===fne?s.createElement(o):s.createElementNS(i,o)}}function wRe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Nfe(o){var s=kU(o);return(s.local?wRe:yRe)(s)}function CRe(){}function _oe(o){return o==null?CRe:function(){return this.querySelector(o)}}function SRe(o){typeof o!="function"&&(o=_oe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=new Array(b),x,_,N=0;N<b;++N)(x=h[N])&&(_=o.call(x,x.__data__,N,h))&&("__data__"in x&&(_.__data__=x.__data__),C[N]=_);return new Sp(u,this._parents)}function xRe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function ERe(){return[]}function Ofe(o){return o==null?ERe:function(){return this.querySelectorAll(o)}}function _Re(o){return function(){return xRe(o.apply(this,arguments))}}function kRe(o){typeof o=="function"?o=_Re(o):o=Ofe(o);for(var s=this._groups,i=s.length,u=[],m=[],h=0;h<i;++h)for(var b=s[h],C=b.length,x,_=0;_<C;++_)(x=b[_])&&(u.push(o.call(x,x.__data__,_,b)),m.push(x));return new Sp(u,m)}function $fe(o){return function(){return this.matches(o)}}function Dfe(o){return function(s){return s.matches(o)}}var TRe=Array.prototype.find;function ARe(o){return function(){return TRe.call(this.children,o)}}function NRe(){return this.firstElementChild}function ORe(o){return this.select(o==null?NRe:ARe(typeof o=="function"?o:Dfe(o)))}var $Re=Array.prototype.filter;function DRe(){return Array.from(this.children)}function MRe(o){return function(){return $Re.call(this.children,o)}}function RRe(o){return this.selectAll(o==null?DRe:MRe(typeof o=="function"?o:Dfe(o)))}function BRe(o){typeof o!="function"&&(o=$fe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],x,_=0;_<b;++_)(x=h[_])&&o.call(x,x.__data__,_,h)&&C.push(x);return new Sp(u,this._parents)}function Mfe(o){return new Array(o.length)}function IRe(){return new Sp(this._enter||this._groups.map(Mfe),this._parents)}function xz(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}xz.prototype={constructor:xz,appendChild:function(o){return this._parent.insertBefore(o,this._next)},insertBefore:function(o,s){return this._parent.insertBefore(o,s)},querySelector:function(o){return this._parent.querySelector(o)},querySelectorAll:function(o){return this._parent.querySelectorAll(o)}};function PRe(o){return function(){return o}}function FRe(o,s,i,u,m,h){for(var b=0,C,x=s.length,_=h.length;b<_;++b)(C=s[b])?(C.__data__=h[b],u[b]=C):i[b]=new xz(o,h[b]);for(;b<x;++b)(C=s[b])&&(m[b]=C)}function LRe(o,s,i,u,m,h,b){var C,x,_=new Map,N=s.length,O=h.length,B=new Array(N),L;for(C=0;C<N;++C)(x=s[C])&&(B[C]=L=b.call(x,x.__data__,C,s)+"",_.has(L)?m[C]=x:_.set(L,x));for(C=0;C<O;++C)L=b.call(o,h[C],C,h)+"",(x=_.get(L))?(u[C]=x,x.__data__=h[C],_.delete(L)):i[C]=new xz(o,h[C]);for(C=0;C<N;++C)(x=s[C])&&_.get(B[C])===x&&(m[C]=x)}function VRe(o){return o.__data__}function HRe(o,s){if(!arguments.length)return Array.from(this,VRe);var i=s?LRe:FRe,u=this._parents,m=this._groups;typeof o!="function"&&(o=PRe(o));for(var h=m.length,b=new Array(h),C=new Array(h),x=new Array(h),_=0;_<h;++_){var N=u[_],O=m[_],B=O.length,L=zRe(o.call(N,N&&N.__data__,_,u)),j=L.length,J=C[_]=new Array(j),Y=b[_]=new Array(j),ne=x[_]=new Array(B);i(N,O,J,Y,ne,L,s);for(var K=0,W=0,Se,ut;K<j;++K)if(Se=J[K]){for(K>=W&&(W=K+1);!(ut=Y[W])&&++W<j;);Se._next=ut||null}}return b=new Sp(b,u),b._enter=C,b._exit=x,b}function zRe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function URe(){return new Sp(this._exit||this._groups.map(Mfe),this._parents)}function jRe(o,s,i){var u=this.enter(),m=this,h=this.exit();return typeof o=="function"?(u=o(u),u&&(u=u.selection())):u=u.append(o+""),s!=null&&(m=s(m),m&&(m=m.selection())),i==null?h.remove():i(h),u&&m?u.merge(m).order():m}function WRe(o){for(var s=o.selection?o.selection():o,i=this._groups,u=s._groups,m=i.length,h=u.length,b=Math.min(m,h),C=new Array(m),x=0;x<b;++x)for(var _=i[x],N=u[x],O=_.length,B=C[x]=new Array(O),L,j=0;j<O;++j)(L=_[j]||N[j])&&(B[j]=L);for(;x<m;++x)C[x]=i[x];return new Sp(C,this._parents)}function ZRe(){for(var o=this._groups,s=-1,i=o.length;++s<i;)for(var u=o[s],m=u.length-1,h=u[m],b;--m>=0;)(b=u[m])&&(h&&b.compareDocumentPosition(h)^4&&h.parentNode.insertBefore(b,h),h=b);return this}function GRe(o){o||(o=qRe);function s(O,B){return O&&B?o(O.__data__,B.__data__):!O-!B}for(var i=this._groups,u=i.length,m=new Array(u),h=0;h<u;++h){for(var b=i[h],C=b.length,x=m[h]=new Array(C),_,N=0;N<C;++N)(_=b[N])&&(x[N]=_);x.sort(s)}return new Sp(m,this._parents).order()}function qRe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function YRe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function KRe(){return Array.from(this)}function XRe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length;m<h;++m){var b=u[m];if(b)return b}return null}function JRe(){let o=0;for(const s of this)++o;return o}function QRe(){return!this.node()}function eBe(o){for(var s=this._groups,i=0,u=s.length;i<u;++i)for(var m=s[i],h=0,b=m.length,C;h<b;++h)(C=m[h])&&o.call(C,C.__data__,h,m);return this}function tBe(o){return function(){this.removeAttribute(o)}}function nBe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function oBe(o,s){return function(){this.setAttribute(o,s)}}function sBe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function rBe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function aBe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttributeNS(o.space,o.local):this.setAttributeNS(o.space,o.local,i)}}function iBe(o,s){var i=kU(o);if(arguments.length<2){var u=this.node();return i.local?u.getAttributeNS(i.space,i.local):u.getAttribute(i)}return this.each((s==null?i.local?nBe:tBe:typeof s=="function"?i.local?aBe:rBe:i.local?sBe:oBe)(i,s))}function Rfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function lBe(o){return function(){this.style.removeProperty(o)}}function cBe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function uBe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function dBe(o,s,i){return arguments.length>1?this.each((s==null?lBe:typeof s=="function"?uBe:cBe)(o,s,i??"")):f4(this.node(),o)}function f4(o,s){return o.style.getPropertyValue(s)||Rfe(o).getComputedStyle(o,null).getPropertyValue(s)}function fBe(o){return function(){delete this[o]}}function mBe(o,s){return function(){this[o]=s}}function pBe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function gBe(o,s){return arguments.length>1?this.each((s==null?fBe:typeof s=="function"?pBe:mBe)(o,s)):this.node()[o]}function Bfe(o){return o.trim().split(/^|\s+/)}function koe(o){return o.classList||new Ife(o)}function Ife(o){this._node=o,this._names=Bfe(o.getAttribute("class")||"")}Ife.prototype={add:function(o){var s=this._names.indexOf(o);s<0&&(this._names.push(o),this._node.setAttribute("class",this._names.join(" ")))},remove:function(o){var s=this._names.indexOf(o);s>=0&&(this._names.splice(s,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(o){return this._names.indexOf(o)>=0}};function Pfe(o,s){for(var i=koe(o),u=-1,m=s.length;++u<m;)i.add(s[u])}function Ffe(o,s){for(var i=koe(o),u=-1,m=s.length;++u<m;)i.remove(s[u])}function hBe(o){return function(){Pfe(this,o)}}function vBe(o){return function(){Ffe(this,o)}}function bBe(o,s){return function(){(s.apply(this,arguments)?Pfe:Ffe)(this,o)}}function yBe(o,s){var i=Bfe(o+"");if(arguments.length<2){for(var u=koe(this.node()),m=-1,h=i.length;++m<h;)if(!u.contains(i[m]))return!1;return!0}return this.each((typeof s=="function"?bBe:s?hBe:vBe)(i,s))}function wBe(){this.textContent=""}function CBe(o){return function(){this.textContent=o}}function SBe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function xBe(o){return arguments.length?this.each(o==null?wBe:(typeof o=="function"?SBe:CBe)(o)):this.node().textContent}function EBe(){this.innerHTML=""}function _Be(o){return function(){this.innerHTML=o}}function kBe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function TBe(o){return arguments.length?this.each(o==null?EBe:(typeof o=="function"?kBe:_Be)(o)):this.node().innerHTML}function ABe(){this.nextSibling&&this.parentNode.appendChild(this)}function NBe(){return this.each(ABe)}function OBe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $Be(){return this.each(OBe)}function DBe(o){var s=typeof o=="function"?o:Nfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function MBe(){return null}function RBe(o,s){var i=typeof o=="function"?o:Nfe(o),u=s==null?MBe:typeof s=="function"?s:_oe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function BBe(){var o=this.parentNode;o&&o.removeChild(this)}function IBe(){return this.each(BBe)}function PBe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function FBe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function LBe(o){return this.select(o?FBe:PBe)}function VBe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function HBe(o){return function(s){o.call(this,s,this.__data__)}}function zBe(o){return o.trim().split(/^|\s+/).map(function(s){var i="",u=s.indexOf(".");return u>=0&&(i=s.slice(u+1),s=s.slice(0,u)),{type:s,name:i}})}function UBe(o){return function(){var s=this.__on;if(s){for(var i=0,u=-1,m=s.length,h;i<m;++i)h=s[i],(!o.type||h.type===o.type)&&h.name===o.name?this.removeEventListener(h.type,h.listener,h.options):s[++u]=h;++u?s.length=u:delete this.__on}}}function jBe(o,s,i){return function(){var u=this.__on,m,h=HBe(s);if(u){for(var b=0,C=u.length;b<C;++b)if((m=u[b]).type===o.type&&m.name===o.name){this.removeEventListener(m.type,m.listener,m.options),this.addEventListener(m.type,m.listener=h,m.options=i),m.value=s;return}}this.addEventListener(o.type,h,i),m={type:o.type,name:o.name,value:s,listener:h,options:i},u?u.push(m):this.__on=[m]}}function WBe(o,s,i){var u=zBe(o+""),m,h=u.length,b;if(arguments.length<2){var C=this.node().__on;if(C){for(var x=0,_=C.length,N;x<_;++x)for(m=0,N=C[x];m<h;++m)if((b=u[m]).type===N.type&&b.name===N.name)return N.value}return}for(C=s?jBe:UBe,m=0;m<h;++m)this.each(C(u[m],s,i));return this}function Lfe(o,s,i){var u=Rfe(o),m=u.CustomEvent;typeof m=="function"?m=new m(s,i):(m=u.document.createEvent("Event"),i?(m.initEvent(s,i.bubbles,i.cancelable),m.detail=i.detail):m.initEvent(s,!1,!1)),o.dispatchEvent(m)}function ZBe(o,s){return function(){return Lfe(this,o,s)}}function GBe(o,s){return function(){return Lfe(this,o,s.apply(this,arguments))}}function qBe(o,s){return this.each((typeof s=="function"?GBe:ZBe)(o,s))}function*YBe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length,b;m<h;++m)(b=u[m])&&(yield b)}var Vfe=[null];function Sp(o,s){this._groups=o,this._parents=s}function TR(){return new Sp([[document.documentElement]],Vfe)}function KBe(){return this}Sp.prototype=TR.prototype={constructor:Sp,select:SRe,selectAll:kRe,selectChild:ORe,selectChildren:RRe,filter:BRe,data:HRe,enter:IRe,exit:URe,join:jRe,merge:WRe,selection:KBe,order:ZRe,sort:GRe,call:YRe,nodes:KRe,node:XRe,size:JRe,empty:QRe,each:eBe,attr:iBe,style:dBe,property:gBe,classed:yBe,text:xBe,html:TBe,raise:NBe,lower:$Be,append:DBe,insert:RBe,remove:IBe,clone:LBe,datum:VBe,on:WBe,dispatch:qBe,[Symbol.iterator]:YBe};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],Vfe)}function XBe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Nv(o,s){if(o=XBe(o),s===void 0&&(s=o.currentTarget),s){var i=s.ownerSVGElement||s;if(i.createSVGPoint){var u=i.createSVGPoint();return u.x=o.clientX,u.y=o.clientY,u=u.matrixTransform(s.getScreenCTM().inverse()),[u.x,u.y]}if(s.getBoundingClientRect){var m=s.getBoundingClientRect();return[o.clientX-m.left-s.clientLeft,o.clientY-m.top-s.clientTop]}}return[o.pageX,o.pageY]}const JBe={passive:!1},nR={capture:!0,passive:!1};function ate(o){o.stopImmediatePropagation()}function n4(o){o.preventDefault(),o.stopImmediatePropagation()}function Hfe(o){var s=o.document.documentElement,i=Mh(o).on("dragstart.drag",n4,nR);"onselectstart"in s?i.on("selectstart.drag",n4,nR):(s.__noselect=s.style.MozUserSelect,s.style.MozUserSelect="none")}function zfe(o,s){var i=o.document.documentElement,u=Mh(o).on("dragstart.drag",null);s&&(u.on("click.drag",n4,nR),setTimeout(function(){u.on("click.drag",null)},0)),"onselectstart"in i?u.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const _H=o=>()=>o;function mne(o,{sourceEvent:s,subject:i,target:u,identifier:m,active:h,x:b,y:C,dx:x,dy:_,dispatch:N}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},identifier:{value:m,enumerable:!0,configurable:!0},active:{value:h,enumerable:!0,configurable:!0},x:{value:b,enumerable:!0,configurable:!0},y:{value:C,enumerable:!0,configurable:!0},dx:{value:x,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:N}})}mne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function QBe(o){return!o.ctrlKey&&!o.button}function eIe(){return this.parentNode}function tIe(o,s){return s??{x:o.x,y:o.y}}function nIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function oIe(){var o=QBe,s=eIe,i=tIe,u=nIe,m={},h=_U("start","drag","end"),b=0,C,x,_,N,O=0;function B(Se){Se.on("mousedown.drag",L).filter(u).on("touchstart.drag",Y).on("touchmove.drag",ne,JBe).on("touchend.drag touchcancel.drag",K).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function L(Se,ut){if(!(N||!o.call(this,Se,ut))){var Le=W(this,s.call(this,Se,ut),Se,ut,"mouse");Le&&(Mh(Se.view).on("mousemove.drag",j,nR).on("mouseup.drag",J,nR),Hfe(Se.view),ate(Se),_=!1,C=Se.clientX,x=Se.clientY,Le("start",Se))}}function j(Se){if(n4(Se),!_){var ut=Se.clientX-C,Le=Se.clientY-x;_=ut*ut+Le*Le>O}m.mouse("drag",Se)}function J(Se){Mh(Se.view).on("mousemove.drag mouseup.drag",null),zfe(Se.view,_),n4(Se),m.mouse("end",Se)}function Y(Se,ut){if(o.call(this,Se,ut)){var Le=Se.changedTouches,te=s.call(this,Se,ut),We=Le.length,pt,ft;for(pt=0;pt<We;++pt)(ft=W(this,te,Se,ut,Le[pt].identifier,Le[pt]))&&(ate(Se),ft("start",Se,Le[pt]))}}function ne(Se){var ut=Se.changedTouches,Le=ut.length,te,We;for(te=0;te<Le;++te)(We=m[ut[te].identifier])&&(n4(Se),We("drag",Se,ut[te]))}function K(Se){var ut=Se.changedTouches,Le=ut.length,te,We;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),te=0;te<Le;++te)(We=m[ut[te].identifier])&&(ate(Se),We("end",Se,ut[te]))}function W(Se,ut,Le,te,We,pt){var ft=h.copy(),Oe=Nv(pt||Le,ut),ue,Pt,be;if((be=i.call(Se,new mne("beforestart",{sourceEvent:Le,target:B,identifier:We,active:b,x:Oe[0],y:Oe[1],dx:0,dy:0,dispatch:ft}),te))!=null)return ue=be.x-Oe[0]||0,Pt=be.y-Oe[1]||0,function $e(R,Ue,ve){var nt=Oe,tt;switch(R){case"start":m[We]=$e,tt=b++;break;case"end":delete m[We],--b;case"drag":Oe=Nv(ve||Ue,ut),tt=b;break}ft.call(R,Se,new mne(R,{sourceEvent:Ue,subject:be,target:B,identifier:We,active:tt,x:Oe[0]+ue,y:Oe[1]+Pt,dx:Oe[0]-nt[0],dy:Oe[1]-nt[1],dispatch:ft}),te)}}return B.filter=function(Se){return arguments.length?(o=typeof Se=="function"?Se:_H(!!Se),B):o},B.container=function(Se){return arguments.length?(s=typeof Se=="function"?Se:_H(Se),B):s},B.subject=function(Se){return arguments.length?(i=typeof Se=="function"?Se:_H(Se),B):i},B.touchable=function(Se){return arguments.length?(u=typeof Se=="function"?Se:_H(!!Se),B):u},B.on=function(){var Se=h.on.apply(h,arguments);return Se===h?B:Se},B.clickDistance=function(Se){return arguments.length?(O=(Se=+Se)*Se,B):Math.sqrt(O)},B}function Toe(o,s,i){o.prototype=s.prototype=i,i.constructor=o}function Ufe(o,s){var i=Object.create(o.prototype);for(var u in s)i[u]=s[u];return i}function AR(){}var oR=.7,Ez=1/oR,o4="\\s*([+-]?\\d+)\\s*",sR="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sIe=/^#([0-9a-f]{3,8})$/,rIe=new RegExp(`^rgb\\(${o4},${o4},${o4}\\)$`),aIe=new RegExp(`^rgb\\(${Dv},${Dv},${Dv}\\)$`),iIe=new RegExp(`^rgba\\(${o4},${o4},${o4},${sR}\\)$`),lIe=new RegExp(`^rgba\\(${Dv},${Dv},${Dv},${sR}\\)$`),cIe=new RegExp(`^hsl\\(${sR},${Dv},${Dv}\\)$`),uIe=new RegExp(`^hsla\\(${sR},${Dv},${Dv},${sR}\\)$`),nle={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Toe(AR,rR,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:ole,formatHex:ole,formatHex8:dIe,formatHsl:fIe,formatRgb:sle,toString:sle});function ole(){return this.rgb().formatHex()}function dIe(){return this.rgb().formatHex8()}function fIe(){return jfe(this).formatHsl()}function sle(){return this.rgb().formatRgb()}function rR(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=sIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?rle(s):i===3?new xm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?kH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?kH(s>>12&15|s>>8&240,s>>8&15|s>>4&240,s>>4&15|s&240,((s&15)<<4|s&15)/255):null):(s=rIe.exec(o))?new xm(s[1],s[2],s[3],1):(s=aIe.exec(o))?new xm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=iIe.exec(o))?kH(s[1],s[2],s[3],s[4]):(s=lIe.exec(o))?kH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=cIe.exec(o))?lle(s[1],s[2]/100,s[3]/100,1):(s=uIe.exec(o))?lle(s[1],s[2]/100,s[3]/100,s[4]):nle.hasOwnProperty(o)?rle(nle[o]):o==="transparent"?new xm(NaN,NaN,NaN,0):null}function rle(o){return new xm(o>>16&255,o>>8&255,o&255,1)}function kH(o,s,i,u){return u<=0&&(o=s=i=NaN),new xm(o,s,i,u)}function mIe(o){return o instanceof AR||(o=rR(o)),o?(o=o.rgb(),new xm(o.r,o.g,o.b,o.opacity)):new xm}function pne(o,s,i,u){return arguments.length===1?mIe(o):new xm(o,s,i,u??1)}function xm(o,s,i,u){this.r=+o,this.g=+s,this.b=+i,this.opacity=+u}Toe(xm,pne,Ufe(AR,{brighter(o){return o=o==null?Ez:Math.pow(Ez,o),new xm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?oR:Math.pow(oR,o),new xm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new xm(wE(this.r),wE(this.g),wE(this.b),_z(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ale,formatHex:ale,formatHex8:pIe,formatRgb:ile,toString:ile}));function ale(){return`#${dE(this.r)}${dE(this.g)}${dE(this.b)}`}function pIe(){return`#${dE(this.r)}${dE(this.g)}${dE(this.b)}${dE((isNaN(this.opacity)?1:this.opacity)*255)}`}function ile(){const o=_z(this.opacity);return`${o===1?"rgb(":"rgba("}${wE(this.r)}, ${wE(this.g)}, ${wE(this.b)}${o===1?")":`, ${o})`}`}function _z(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function wE(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function dE(o){return o=wE(o),(o<16?"0":"")+o.toString(16)}function lle(o,s,i,u){return u<=0?o=s=i=NaN:i<=0||i>=1?o=s=NaN:s<=0&&(o=NaN),new Rh(o,s,i,u)}function jfe(o){if(o instanceof Rh)return new Rh(o.h,o.s,o.l,o.opacity);if(o instanceof AR||(o=rR(o)),!o)return new Rh;if(o instanceof Rh)return o;o=o.rgb();var s=o.r/255,i=o.g/255,u=o.b/255,m=Math.min(s,i,u),h=Math.max(s,i,u),b=NaN,C=h-m,x=(h+m)/2;return C?(s===h?b=(i-u)/C+(i<u)*6:i===h?b=(u-s)/C+2:b=(s-i)/C+4,C/=x<.5?h+m:2-h-m,b*=60):C=x>0&&x<1?0:b,new Rh(b,C,x,o.opacity)}function gIe(o,s,i,u){return arguments.length===1?jfe(o):new Rh(o,s,i,u??1)}function Rh(o,s,i,u){this.h=+o,this.s=+s,this.l=+i,this.opacity=+u}Toe(Rh,gIe,Ufe(AR,{brighter(o){return o=o==null?Ez:Math.pow(Ez,o),new Rh(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?oR:Math.pow(oR,o),new Rh(this.h,this.s,this.l*o,this.opacity)},rgb(){var o=this.h%360+(this.h<0)*360,s=isNaN(o)||isNaN(this.s)?0:this.s,i=this.l,u=i+(i<.5?i:1-i)*s,m=2*i-u;return new xm(ite(o>=240?o-240:o+120,m,u),ite(o,m,u),ite(o<120?o+240:o-120,m,u),this.opacity)},clamp(){return new Rh(cle(this.h),TH(this.s),TH(this.l),_z(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const o=_z(this.opacity);return`${o===1?"hsl(":"hsla("}${cle(this.h)}, ${TH(this.s)*100}%, ${TH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function cle(o){return o=(o||0)%360,o<0?o+360:o}function TH(o){return Math.max(0,Math.min(1,o||0))}function ite(o,s,i){return(o<60?s+(i-s)*o/60:o<180?i:o<240?s+(i-s)*(240-o)/60:s)*255}const Wfe=o=>()=>o;function hIe(o,s){return function(i){return o+i*s}}function vIe(o,s,i){return o=Math.pow(o,i),s=Math.pow(s,i)-o,i=1/i,function(u){return Math.pow(o+u*s,i)}}function bIe(o){return(o=+o)==1?Zfe:function(s,i){return i-s?vIe(s,i,o):Wfe(isNaN(s)?i:s)}}function Zfe(o,s){var i=s-o;return i?hIe(o,i):Wfe(isNaN(o)?s:o)}const ule=function o(s){var i=bIe(s);function u(m,h){var b=i((m=pne(m)).r,(h=pne(h)).r),C=i(m.g,h.g),x=i(m.b,h.b),_=Zfe(m.opacity,h.opacity);return function(N){return m.r=b(N),m.g=C(N),m.b=x(N),m.opacity=_(N),m+""}}return u.gamma=o,u}(1);function a2(o,s){return o=+o,s=+s,function(i){return o*(1-i)+s*i}}var gne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,lte=new RegExp(gne.source,"g");function yIe(o){return function(){return o}}function wIe(o){return function(s){return o(s)+""}}function CIe(o,s){var i=gne.lastIndex=lte.lastIndex=0,u,m,h,b=-1,C=[],x=[];for(o=o+"",s=s+"";(u=gne.exec(o))&&(m=lte.exec(s));)(h=m.index)>i&&(h=s.slice(i,h),C[b]?C[b]+=h:C[++b]=h),(u=u[0])===(m=m[0])?C[b]?C[b]+=m:C[++b]=m:(C[++b]=null,x.push({i:b,x:a2(u,m)})),i=lte.lastIndex;return i<s.length&&(h=s.slice(i),C[b]?C[b]+=h:C[++b]=h),C.length<2?x[0]?wIe(x[0].x):yIe(s):(s=x.length,function(_){for(var N=0,O;N<s;++N)C[(O=x[N]).i]=O.x(_);return C.join("")})}var dle=180/Math.PI,hne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Gfe(o,s,i,u,m,h){var b,C,x;return(b=Math.sqrt(o*o+s*s))&&(o/=b,s/=b),(x=o*i+s*u)&&(i-=o*x,u-=s*x),(C=Math.sqrt(i*i+u*u))&&(i/=C,u/=C,x/=C),o*u<s*i&&(o=-o,s=-s,x=-x,b=-b),{translateX:m,translateY:h,rotate:Math.atan2(s,o)*dle,skewX:Math.atan(x)*dle,scaleX:b,scaleY:C}}var AH;function SIe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?hne:Gfe(s.a,s.b,s.c,s.d,s.e,s.f)}function xIe(o){return o==null||(AH||(AH=document.createElementNS("http://www.w3.org/2000/svg","g")),AH.setAttribute("transform",o),!(o=AH.transform.baseVal.consolidate()))?hne:(o=o.matrix,Gfe(o.a,o.b,o.c,o.d,o.e,o.f))}function qfe(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,B,L,j){if(_!==O||N!==B){var J=L.push("translate(",null,s,null,i);j.push({i:J-4,x:a2(_,O)},{i:J-2,x:a2(N,B)})}else(O||B)&&L.push("translate("+O+s+B+i)}function b(_,N,O,B){_!==N?(_-N>180?N+=360:N-_>180&&(_+=360),B.push({i:O.push(m(O)+"rotate(",null,u)-2,x:a2(_,N)})):N&&O.push(m(O)+"rotate("+N+u)}function C(_,N,O,B){_!==N?B.push({i:O.push(m(O)+"skewX(",null,u)-2,x:a2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function x(_,N,O,B,L,j){if(_!==O||N!==B){var J=L.push(m(L)+"scale(",null,",",null,")");j.push({i:J-4,x:a2(_,O)},{i:J-2,x:a2(N,B)})}else(O!==1||B!==1)&&L.push(m(L)+"scale("+O+","+B+")")}return function(_,N){var O=[],B=[];return _=o(_),N=o(N),h(_.translateX,_.translateY,N.translateX,N.translateY,O,B),b(_.rotate,N.rotate,O,B),C(_.skewX,N.skewX,O,B),x(_.scaleX,_.scaleY,N.scaleX,N.scaleY,O,B),_=N=null,function(L){for(var j=-1,J=B.length,Y;++j<J;)O[(Y=B[j]).i]=Y.x(L);return O.join("")}}}var EIe=qfe(SIe,"px, ","px)","deg)"),_Ie=qfe(xIe,", ",")",")"),kIe=1e-12;function fle(o){return((o=Math.exp(o))+1/o)/2}function TIe(o){return((o=Math.exp(o))-1/o)/2}function AIe(o){return((o=Math.exp(2*o))-1)/(o+1)}const NIe=function o(s,i,u){function m(h,b){var C=h[0],x=h[1],_=h[2],N=b[0],O=b[1],B=b[2],L=N-C,j=O-x,J=L*L+j*j,Y,ne;if(J<kIe)ne=Math.log(B/_)/s,Y=function(te){return[C+te*L,x+te*j,_*Math.exp(s*te*ne)]};else{var K=Math.sqrt(J),W=(B*B-_*_+u*J)/(2*_*i*K),Se=(B*B-_*_-u*J)/(2*B*i*K),ut=Math.log(Math.sqrt(W*W+1)-W),Le=Math.log(Math.sqrt(Se*Se+1)-Se);ne=(Le-ut)/s,Y=function(te){var We=te*ne,pt=fle(ut),ft=_/(i*K)*(pt*AIe(s*We+ut)-TIe(ut));return[C+ft*L,x+ft*j,_*pt/fle(s*We+ut)]}}return Y.duration=ne*1e3*s/Math.SQRT2,Y}return m.rho=function(h){var b=Math.max(.001,+h),C=b*b,x=C*C;return o(b,C,x)},m}(Math.SQRT2,2,4);var m4=0,DM=0,OM=0,Yfe=1e3,kz,MM,Tz=0,kE=0,TU=0,aR=typeof performance=="object"&&performance.now?performance:Date,Kfe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function Aoe(){return kE||(Kfe(OIe),kE=aR.now()+TU)}function OIe(){kE=0}function Az(){this._call=this._time=this._next=null}Az.prototype=Xfe.prototype={constructor:Az,restart:function(o,s,i){if(typeof o!="function")throw new TypeError("callback is not a function");i=(i==null?Aoe():+i)+(s==null?0:+s),!this._next&&MM!==this&&(MM?MM._next=this:kz=this,MM=this),this._call=o,this._time=i,vne()},stop:function(){this._call&&(this._call=null,this._time=1/0,vne())}};function Xfe(o,s,i){var u=new Az;return u.restart(o,s,i),u}function $Ie(){Aoe(),++m4;for(var o=kz,s;o;)(s=kE-o._time)>=0&&o._call.call(void 0,s),o=o._next;--m4}function mle(){kE=(Tz=aR.now())+TU,m4=DM=0;try{$Ie()}finally{m4=0,MIe(),kE=0}}function DIe(){var o=aR.now(),s=o-Tz;s>Yfe&&(TU-=s,Tz=o)}function MIe(){for(var o,s=kz,i,u=1/0;s;)s._call?(u>s._time&&(u=s._time),o=s,s=s._next):(i=s._next,s._next=null,s=o?o._next=i:kz=i);MM=o,vne(u)}function vne(o){if(!m4){DM&&(DM=clearTimeout(DM));var s=o-kE;s>24?(o<1/0&&(DM=setTimeout(mle,o-aR.now()-TU)),OM&&(OM=clearInterval(OM))):(OM||(Tz=aR.now(),OM=setInterval(DIe,Yfe)),m4=1,Kfe(mle))}}function ple(o,s,i){var u=new Az;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var RIe=_U("start","end","cancel","interrupt"),BIe=[],Jfe=0,gle=1,bne=2,KH=3,hle=4,yne=5,XH=6;function AU(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;IIe(o,i,{name:s,index:u,group:m,on:RIe,tween:BIe,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:Jfe})}function Noe(o,s){var i=Ph(o,s);if(i.state>Jfe)throw new Error("too late; already scheduled");return i}function Fv(o,s){var i=Ph(o,s);if(i.state>KH)throw new Error("too late; already running");return i}function Ph(o,s){var i=o.__transition;if(!i||!(i=i[s]))throw new Error("transition not found");return i}function IIe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=Xfe(h,0,i.time);function h(_){i.state=gle,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,B,L;if(i.state!==gle)return x();for(N in u)if(L=u[N],L.name===i.name){if(L.state===KH)return ple(b);L.state===hle?(L.state=XH,L.timer.stop(),L.on.call("interrupt",o,o.__data__,L.index,L.group),delete u[N]):+N<s&&(L.state=XH,L.timer.stop(),L.on.call("cancel",o,o.__data__,L.index,L.group),delete u[N])}if(ple(function(){i.state===KH&&(i.state=hle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=bne,i.on.call("start",o,o.__data__,i.index,i.group),i.state===bne){for(i.state=KH,m=new Array(B=i.tween.length),N=0,O=-1;N<B;++N)(L=i.tween[N].value.call(o,o.__data__,i.index,i.group))&&(m[++O]=L);m.length=O+1}}function C(_){for(var N=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(x),i.state=yne,1),O=-1,B=m.length;++O<B;)m[O].call(o,N);i.state===yne&&(i.on.call("end",o,o.__data__,i.index,i.group),x())}function x(){i.state=XH,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function JH(o,s){var i=o.__transition,u,m,h=!0,b;if(i){s=s==null?null:s+"";for(b in i){if((u=i[b]).name!==s){h=!1;continue}m=u.state>bne&&u.state<yne,u.state=XH,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function PIe(o){return this.each(function(){JH(this,o)})}function FIe(o,s){var i,u;return function(){var m=Fv(this,o),h=m.tween;if(h!==i){u=i=h;for(var b=0,C=u.length;b<C;++b)if(u[b].name===s){u=u.slice(),u.splice(b,1);break}}m.tween=u}}function LIe(o,s,i){var u,m;if(typeof i!="function")throw new Error;return function(){var h=Fv(this,o),b=h.tween;if(b!==u){m=(u=b).slice();for(var C={name:s,value:i},x=0,_=m.length;x<_;++x)if(m[x].name===s){m[x]=C;break}x===_&&m.push(C)}h.tween=m}}function VIe(o,s){var i=this._id;if(o+="",arguments.length<2){for(var u=Ph(this.node(),i).tween,m=0,h=u.length,b;m<h;++m)if((b=u[m]).name===o)return b.value;return null}return this.each((s==null?FIe:LIe)(i,o,s))}function Ooe(o,s,i){var u=o._id;return o.each(function(){var m=Fv(this,u);(m.value||(m.value={}))[s]=i.apply(this,arguments)}),function(m){return Ph(m,u).value[s]}}function Qfe(o,s){var i;return(typeof s=="number"?a2:s instanceof rR?ule:(i=rR(s))?(s=i,ule):CIe)(o,s)}function HIe(o){return function(){this.removeAttribute(o)}}function zIe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function UIe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttribute(o);return b===m?null:b===u?h:h=s(u=b,i)}}function jIe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttributeNS(o.space,o.local);return b===m?null:b===u?h:h=s(u=b,i)}}function WIe(o,s,i){var u,m,h;return function(){var b,C=i(this),x;return C==null?void this.removeAttribute(o):(b=this.getAttribute(o),x=C+"",b===x?null:b===u&&x===m?h:(m=x,h=s(u=b,C)))}}function ZIe(o,s,i){var u,m,h;return function(){var b,C=i(this),x;return C==null?void this.removeAttributeNS(o.space,o.local):(b=this.getAttributeNS(o.space,o.local),x=C+"",b===x?null:b===u&&x===m?h:(m=x,h=s(u=b,C)))}}function GIe(o,s){var i=kU(o),u=i==="transform"?_Ie:Qfe;return this.attrTween(o,typeof s=="function"?(i.local?ZIe:WIe)(i,u,Ooe(this,"attr."+o,s)):s==null?(i.local?zIe:HIe)(i):(i.local?jIe:UIe)(i,u,s))}function qIe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function YIe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function KIe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&YIe(o,h)),i}return m._value=s,m}function XIe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&qIe(o,h)),i}return m._value=s,m}function JIe(o,s){var i="attr."+o;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(s==null)return this.tween(i,null);if(typeof s!="function")throw new Error;var u=kU(o);return this.tween(i,(u.local?KIe:XIe)(u,s))}function QIe(o,s){return function(){Noe(this,o).delay=+s.apply(this,arguments)}}function ePe(o,s){return s=+s,function(){Noe(this,o).delay=s}}function tPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?QIe:ePe)(s,o)):Ph(this.node(),s).delay}function nPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function oPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function sPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?nPe:oPe)(s,o)):Ph(this.node(),s).duration}function rPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function aPe(o){var s=this._id;return arguments.length?this.each(rPe(s,o)):Ph(this.node(),s).ease}function iPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function lPe(o){if(typeof o!="function")throw new Error;return this.each(iPe(this._id,o))}function cPe(o){typeof o!="function"&&(o=$fe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],x,_=0;_<b;++_)(x=h[_])&&o.call(x,x.__data__,_,h)&&C.push(x);return new V0(u,this._parents,this._name,this._id)}function uPe(o){if(o._id!==this._id)throw new Error;for(var s=this._groups,i=o._groups,u=s.length,m=i.length,h=Math.min(u,m),b=new Array(u),C=0;C<h;++C)for(var x=s[C],_=i[C],N=x.length,O=b[C]=new Array(N),B,L=0;L<N;++L)(B=x[L]||_[L])&&(O[L]=B);for(;C<u;++C)b[C]=s[C];return new V0(b,this._parents,this._name,this._id)}function dPe(o){return(o+"").trim().split(/^|\s+/).every(function(s){var i=s.indexOf(".");return i>=0&&(s=s.slice(0,i)),!s||s==="start"})}function fPe(o,s,i){var u,m,h=dPe(s)?Noe:Fv;return function(){var b=h(this,o),C=b.on;C!==u&&(m=(u=C).copy()).on(s,i),b.on=m}}function mPe(o,s){var i=this._id;return arguments.length<2?Ph(this.node(),i).on.on(o):this.each(fPe(i,o,s))}function pPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function gPe(){return this.on("end.remove",pPe(this._id))}function hPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=_oe(o));for(var u=this._groups,m=u.length,h=new Array(m),b=0;b<m;++b)for(var C=u[b],x=C.length,_=h[b]=new Array(x),N,O,B=0;B<x;++B)(N=C[B])&&(O=o.call(N,N.__data__,B,C))&&("__data__"in N&&(O.__data__=N.__data__),_[B]=O,AU(_[B],s,i,B,_,Ph(N,i)));return new V0(h,this._parents,s,i)}function vPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Ofe(o));for(var u=this._groups,m=u.length,h=[],b=[],C=0;C<m;++C)for(var x=u[C],_=x.length,N,O=0;O<_;++O)if(N=x[O]){for(var B=o.call(N,N.__data__,O,x),L,j=Ph(N,i),J=0,Y=B.length;J<Y;++J)(L=B[J])&&AU(L,s,i,J,B,j);h.push(B),b.push(N)}return new V0(h,b,s,i)}var bPe=TR.prototype.constructor;function yPe(){return new bPe(this._groups,this._parents)}function wPe(o,s){var i,u,m;return function(){var h=f4(this,o),b=(this.style.removeProperty(o),f4(this,o));return h===b?null:h===i&&b===u?m:m=s(i=h,u=b)}}function eme(o){return function(){this.style.removeProperty(o)}}function CPe(o,s,i){var u,m=i+"",h;return function(){var b=f4(this,o);return b===m?null:b===u?h:h=s(u=b,i)}}function SPe(o,s,i){var u,m,h;return function(){var b=f4(this,o),C=i(this),x=C+"";return C==null&&(x=C=(this.style.removeProperty(o),f4(this,o))),b===x?null:b===u&&x===m?h:(m=x,h=s(u=b,C))}}function xPe(o,s){var i,u,m,h="style."+s,b="end."+h,C;return function(){var x=Fv(this,o),_=x.on,N=x.value[h]==null?C||(C=eme(s)):void 0;(_!==i||m!==N)&&(u=(i=_).copy()).on(b,m=N),x.on=u}}function EPe(o,s,i){var u=(o+="")=="transform"?EIe:Qfe;return s==null?this.styleTween(o,wPe(o,u)).on("end.style."+o,eme(o)):typeof s=="function"?this.styleTween(o,SPe(o,u,Ooe(this,"style."+o,s))).each(xPe(this._id,o)):this.styleTween(o,CPe(o,u,s),i).on("end.style."+o,null)}function _Pe(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function kPe(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&_Pe(o,b,i)),u}return h._value=s,h}function TPe(o,s,i){var u="style."+(o+="");if(arguments.length<2)return(u=this.tween(u))&&u._value;if(s==null)return this.tween(u,null);if(typeof s!="function")throw new Error;return this.tween(u,kPe(o,s,i??""))}function APe(o){return function(){this.textContent=o}}function NPe(o){return function(){var s=o(this);this.textContent=s??""}}function OPe(o){return this.tween("text",typeof o=="function"?NPe(Ooe(this,"text",o)):APe(o==null?"":o+""))}function $Pe(o){return function(s){this.textContent=o.call(this,s)}}function DPe(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&$Pe(m)),s}return u._value=o,u}function MPe(o){var s="text";if(arguments.length<1)return(s=this.tween(s))&&s._value;if(o==null)return this.tween(s,null);if(typeof o!="function")throw new Error;return this.tween(s,DPe(o))}function RPe(){for(var o=this._name,s=this._id,i=tme(),u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,x,_=0;_<C;++_)if(x=b[_]){var N=Ph(x,s);AU(x,o,i,_,b,{time:N.time+N.delay+N.duration,delay:0,duration:N.duration,ease:N.ease})}return new V0(u,this._parents,o,i)}function BPe(){var o,s,i=this,u=i._id,m=i.size();return new Promise(function(h,b){var C={value:b},x={value:function(){--m===0&&h()}};i.each(function(){var _=Fv(this,u),N=_.on;N!==o&&(s=(o=N).copy(),s._.cancel.push(C),s._.interrupt.push(C),s._.end.push(x)),_.on=s}),m===0&&h()})}var IPe=0;function V0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function tme(){return++IPe}var $0=TR.prototype;V0.prototype={constructor:V0,select:hPe,selectAll:vPe,selectChild:$0.selectChild,selectChildren:$0.selectChildren,filter:cPe,merge:uPe,selection:yPe,transition:RPe,call:$0.call,nodes:$0.nodes,node:$0.node,size:$0.size,empty:$0.empty,each:$0.each,on:mPe,attr:GIe,attrTween:JIe,style:EPe,styleTween:TPe,text:OPe,textTween:MPe,remove:gPe,tween:VIe,delay:tPe,duration:sPe,ease:aPe,easeVarying:lPe,end:BPe,[Symbol.iterator]:$0[Symbol.iterator]};function PPe(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var FPe={time:null,delay:0,duration:250,ease:PPe};function LPe(o,s){for(var i;!(i=o.__transition)||!(i=i[s]);)if(!(o=o.parentNode))throw new Error(`transition ${s} not found`);return i}function VPe(o){var s,i;o instanceof V0?(s=o._id,o=o._name):(s=tme(),(i=FPe).time=Aoe(),o=o==null?null:o+"");for(var u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,x,_=0;_<C;++_)(x=b[_])&&AU(x,o,s,_,b,i||LPe(x,s));return new V0(u,this._parents,o,s)}TR.prototype.interrupt=PIe;TR.prototype.transition=VPe;const NH=o=>()=>o;function HPe(o,{sourceEvent:s,target:i,transform:u,dispatch:m}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:m}})}function I0(o,s,i){this.k=o,this.x=s,this.y=i}I0.prototype={constructor:I0,scale:function(o){return o===1?this:new I0(this.k*o,this.x,this.y)},translate:function(o,s){return o===0&s===0?this:new I0(this.k,this.x+this.k*o,this.y+this.k*s)},apply:function(o){return[o[0]*this.k+this.x,o[1]*this.k+this.y]},applyX:function(o){return o*this.k+this.x},applyY:function(o){return o*this.k+this.y},invert:function(o){return[(o[0]-this.x)/this.k,(o[1]-this.y)/this.k]},invertX:function(o){return(o-this.x)/this.k},invertY:function(o){return(o-this.y)/this.k},rescaleX:function(o){return o.copy().domain(o.range().map(this.invertX,this).map(o.invert,o))},rescaleY:function(o){return o.copy().domain(o.range().map(this.invertY,this).map(o.invert,o))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var p4=new I0(1,0,0);I0.prototype;function cte(o){o.stopImmediatePropagation()}function $M(o){o.preventDefault(),o.stopImmediatePropagation()}function zPe(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function UPe(){var o=this;return o instanceof SVGElement?(o=o.ownerSVGElement||o,o.hasAttribute("viewBox")?(o=o.viewBox.baseVal,[[o.x,o.y],[o.x+o.width,o.y+o.height]]):[[0,0],[o.width.baseVal.value,o.height.baseVal.value]]):[[0,0],[o.clientWidth,o.clientHeight]]}function vle(){return this.__zoom||p4}function jPe(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function WPe(){return navigator.maxTouchPoints||"ontouchstart"in this}function ZPe(o,s,i){var u=o.invertX(s[0][0])-i[0][0],m=o.invertX(s[1][0])-i[1][0],h=o.invertY(s[0][1])-i[0][1],b=o.invertY(s[1][1])-i[1][1];return o.translate(m>u?(u+m)/2:Math.min(0,u)||Math.max(0,m),b>h?(h+b)/2:Math.min(0,h)||Math.max(0,b))}function GPe(){var o=zPe,s=UPe,i=ZPe,u=jPe,m=WPe,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,x=NIe,_=_U("start","zoom","end"),N,O,B,L=500,j=150,J=0,Y=10;function ne(be){be.property("__zoom",vle).on("wheel.zoom",We,{passive:!1}).on("mousedown.zoom",pt).on("dblclick.zoom",ft).filter(m).on("touchstart.zoom",Oe).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",Pt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}ne.transform=function(be,$e,R,Ue){var ve=be.selection?be.selection():be;ve.property("__zoom",vle),be!==ve?ut(be,$e,R,Ue):ve.interrupt().each(function(){Le(this,arguments).event(Ue).start().zoom(null,typeof $e=="function"?$e.apply(this,arguments):$e).end()})},ne.scaleBy=function(be,$e,R,Ue){ne.scaleTo(be,function(){var ve=this.__zoom.k,nt=typeof $e=="function"?$e.apply(this,arguments):$e;return ve*nt},R,Ue)},ne.scaleTo=function(be,$e,R,Ue){ne.transform(be,function(){var ve=s.apply(this,arguments),nt=this.__zoom,tt=R==null?Se(ve):typeof R=="function"?R.apply(this,arguments):R,pe=nt.invert(tt),Ze=typeof $e=="function"?$e.apply(this,arguments):$e;return i(W(K(nt,Ze),tt,pe),ve,b)},R,Ue)},ne.translateBy=function(be,$e,R,Ue){ne.transform(be,function(){return i(this.__zoom.translate(typeof $e=="function"?$e.apply(this,arguments):$e,typeof R=="function"?R.apply(this,arguments):R),s.apply(this,arguments),b)},null,Ue)},ne.translateTo=function(be,$e,R,Ue,ve){ne.transform(be,function(){var nt=s.apply(this,arguments),tt=this.__zoom,pe=Ue==null?Se(nt):typeof Ue=="function"?Ue.apply(this,arguments):Ue;return i(p4.translate(pe[0],pe[1]).scale(tt.k).translate(typeof $e=="function"?-$e.apply(this,arguments):-$e,typeof R=="function"?-R.apply(this,arguments):-R),nt,b)},Ue,ve)};function K(be,$e){return $e=Math.max(h[0],Math.min(h[1],$e)),$e===be.k?be:new I0($e,be.x,be.y)}function W(be,$e,R){var Ue=$e[0]-R[0]*be.k,ve=$e[1]-R[1]*be.k;return Ue===be.x&&ve===be.y?be:new I0(be.k,Ue,ve)}function Se(be){return[(+be[0][0]+ +be[1][0])/2,(+be[0][1]+ +be[1][1])/2]}function ut(be,$e,R,Ue){be.on("start.zoom",function(){Le(this,arguments).event(Ue).start()}).on("interrupt.zoom end.zoom",function(){Le(this,arguments).event(Ue).end()}).tween("zoom",function(){var ve=this,nt=arguments,tt=Le(ve,nt).event(Ue),pe=s.apply(ve,nt),Ze=R==null?Se(pe):typeof R=="function"?R.apply(ve,nt):R,Tt=Math.max(pe[1][0]-pe[0][0],pe[1][1]-pe[0][1]),He=ve.__zoom,vt=typeof $e=="function"?$e.apply(ve,nt):$e,Re=x(He.invert(Ze).concat(Tt/He.k),vt.invert(Ze).concat(Tt/vt.k));return function(ct){if(ct===1)ct=vt;else{var oe=Re(ct),pn=Tt/oe[2];ct=new I0(pn,Ze[0]-oe[0]*pn,Ze[1]-oe[1]*pn)}tt.zoom(null,ct)}})}function Le(be,$e,R){return!R&&be.__zooming||new te(be,$e)}function te(be,$e){this.that=be,this.args=$e,this.active=0,this.sourceEvent=null,this.extent=s.apply(be,$e),this.taps=0}te.prototype={event:function(be){return be&&(this.sourceEvent=be),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(be,$e){return this.mouse&&be!=="mouse"&&(this.mouse[1]=$e.invert(this.mouse[0])),this.touch0&&be!=="touch"&&(this.touch0[1]=$e.invert(this.touch0[0])),this.touch1&&be!=="touch"&&(this.touch1[1]=$e.invert(this.touch1[0])),this.that.__zoom=$e,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(be){var $e=Mh(this.that).datum();_.call(be,this.that,new HPe(be,{sourceEvent:this.sourceEvent,target:ne,type:be,transform:this.that.__zoom,dispatch:_}),$e)}};function We(be,...$e){if(!o.apply(this,arguments))return;var R=Le(this,$e).event(be),Ue=this.__zoom,ve=Math.max(h[0],Math.min(h[1],Ue.k*Math.pow(2,u.apply(this,arguments)))),nt=Nv(be);if(R.wheel)(R.mouse[0][0]!==nt[0]||R.mouse[0][1]!==nt[1])&&(R.mouse[1]=Ue.invert(R.mouse[0]=nt)),clearTimeout(R.wheel);else{if(Ue.k===ve)return;R.mouse=[nt,Ue.invert(nt)],JH(this),R.start()}$M(be),R.wheel=setTimeout(tt,j),R.zoom("mouse",i(W(K(Ue,ve),R.mouse[0],R.mouse[1]),R.extent,b));function tt(){R.wheel=null,R.end()}}function pt(be,...$e){if(B||!o.apply(this,arguments))return;var R=be.currentTarget,Ue=Le(this,$e,!0).event(be),ve=Mh(be.view).on("mousemove.zoom",Ze,!0).on("mouseup.zoom",Tt,!0),nt=Nv(be,R),tt=be.clientX,pe=be.clientY;Hfe(be.view),cte(be),Ue.mouse=[nt,this.__zoom.invert(nt)],JH(this),Ue.start();function Ze(He){if($M(He),!Ue.moved){var vt=He.clientX-tt,Re=He.clientY-pe;Ue.moved=vt*vt+Re*Re>J}Ue.event(He).zoom("mouse",i(W(Ue.that.__zoom,Ue.mouse[0]=Nv(He,R),Ue.mouse[1]),Ue.extent,b))}function Tt(He){ve.on("mousemove.zoom mouseup.zoom",null),zfe(He.view,Ue.moved),$M(He),Ue.event(He).end()}}function ft(be,...$e){if(o.apply(this,arguments)){var R=this.__zoom,Ue=Nv(be.changedTouches?be.changedTouches[0]:be,this),ve=R.invert(Ue),nt=R.k*(be.shiftKey?.5:2),tt=i(W(K(R,nt),Ue,ve),s.apply(this,$e),b);$M(be),C>0?Mh(this).transition().duration(C).call(ut,tt,Ue,be):Mh(this).call(ne.transform,tt,Ue,be)}}function Oe(be,...$e){if(o.apply(this,arguments)){var R=be.touches,Ue=R.length,ve=Le(this,$e,be.changedTouches.length===Ue).event(be),nt,tt,pe,Ze;for(cte(be),tt=0;tt<Ue;++tt)pe=R[tt],Ze=Nv(pe,this),Ze=[Ze,this.__zoom.invert(Ze),pe.identifier],ve.touch0?!ve.touch1&&ve.touch0[2]!==Ze[2]&&(ve.touch1=Ze,ve.taps=0):(ve.touch0=Ze,nt=!0,ve.taps=1+!!N);N&&(N=clearTimeout(N)),nt&&(ve.taps<2&&(O=Ze[0],N=setTimeout(function(){N=null},L)),JH(this),ve.start())}}function ue(be,...$e){if(this.__zooming){var R=Le(this,$e).event(be),Ue=be.changedTouches,ve=Ue.length,nt,tt,pe,Ze;for($M(be),nt=0;nt<ve;++nt)tt=Ue[nt],pe=Nv(tt,this),R.touch0&&R.touch0[2]===tt.identifier?R.touch0[0]=pe:R.touch1&&R.touch1[2]===tt.identifier&&(R.touch1[0]=pe);if(tt=R.that.__zoom,R.touch1){var Tt=R.touch0[0],He=R.touch0[1],vt=R.touch1[0],Re=R.touch1[1],ct=(ct=vt[0]-Tt[0])*ct+(ct=vt[1]-Tt[1])*ct,oe=(oe=Re[0]-He[0])*oe+(oe=Re[1]-He[1])*oe;tt=K(tt,Math.sqrt(ct/oe)),pe=[(Tt[0]+vt[0])/2,(Tt[1]+vt[1])/2],Ze=[(He[0]+Re[0])/2,(He[1]+Re[1])/2]}else if(R.touch0)pe=R.touch0[0],Ze=R.touch0[1];else return;R.zoom("touch",i(W(tt,pe,Ze),R.extent,b))}}function Pt(be,...$e){if(this.__zooming){var R=Le(this,$e).event(be),Ue=be.changedTouches,ve=Ue.length,nt,tt;for(cte(be),B&&clearTimeout(B),B=setTimeout(function(){B=null},L),nt=0;nt<ve;++nt)tt=Ue[nt],R.touch0&&R.touch0[2]===tt.identifier?delete R.touch0:R.touch1&&R.touch1[2]===tt.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(tt=Nv(tt,this),Math.hypot(O[0]-tt[0],O[1]-tt[1])<Y)){var pe=Mh(this).on("dblclick.zoom");pe&&pe.apply(this,arguments)}}}return ne.wheelDelta=function(be){return arguments.length?(u=typeof be=="function"?be:NH(+be),ne):u},ne.filter=function(be){return arguments.length?(o=typeof be=="function"?be:NH(!!be),ne):o},ne.touchable=function(be){return arguments.length?(m=typeof be=="function"?be:NH(!!be),ne):m},ne.extent=function(be){return arguments.length?(s=typeof be=="function"?be:NH([[+be[0][0],+be[0][1]],[+be[1][0],+be[1][1]]]),ne):s},ne.scaleExtent=function(be){return arguments.length?(h[0]=+be[0],h[1]=+be[1],ne):[h[0],h[1]]},ne.translateExtent=function(be){return arguments.length?(b[0][0]=+be[0][0],b[1][0]=+be[1][0],b[0][1]=+be[0][1],b[1][1]=+be[1][1],ne):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},ne.constrain=function(be){return arguments.length?(i=be,ne):i},ne.duration=function(be){return arguments.length?(C=+be,ne):C},ne.interpolate=function(be){return arguments.length?(x=be,ne):x},ne.on=function(){var be=_.on.apply(_,arguments);return be===_?ne:be},ne.clickDistance=function(be){return arguments.length?(J=(be=+be)*be,ne):Math.sqrt(J)},ne.tapDistance=function(be){return arguments.length?(Y=+be,ne):Y},ne}var ss=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(ss||{}),$oe=(o=>(o.Partial="partial",o.Full="full",o))($oe||{}),iE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(iE||{}),g2=(o=>(o.Strict="strict",o.Loose="loose",o))(g2||{}),Nz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(Nz||{}),UM=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(UM||{}),nme=(o=>(o.TopLeft="top-left",o.TopCenter="top-center",o.TopRight="top-right",o.BottomLeft="bottom-left",o.BottomCenter="bottom-center",o.BottomRight="bottom-right",o))(nme||{});const qPe=["INPUT","SELECT","TEXTAREA"];function wne(o){var s,i;const u=((i=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:i[0])||o.target,m=typeof(u==null?void 0:u.hasAttribute)=="function"?u.hasAttribute("contenteditable"):!1,h=typeof(u==null?void 0:u.closest)=="function"?u.closest(".nokey"):null;return qPe.includes(u==null?void 0:u.nodeName)||m||!!h}function YPe(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function ble(o,s,i,u){const m=s.replace("+",`
|
|
115
|
+
`));return ue(ce.split(""),u).length},nt=(Q,ie)=>{const ce=$e(Q,ie).join("");return Ue(ce)},tt=(Q,ie)=>{const ce=$e(Q,ie).join("").replace(/\s/g,"");return Ue(ce)},pe=(Q,ie)=>()=>ie(Q.getBody(),Q.schema),Ze=(Q,ie)=>()=>ie(Q.selection.getRng().cloneContents(),Q.schema),Tt=Q=>pe(Q,ve),He=Q=>({body:{getWordCount:Tt(Q),getCharacterCount:pe(Q,nt),getCharacterCountWithoutSpaces:pe(Q,tt)},selection:{getWordCount:Ze(Q,ve),getCharacterCount:Ze(Q,nt),getCharacterCountWithoutSpaces:Ze(Q,tt)},getCount:Tt(Q)}),vt=(Q,ie)=>{Q.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(ie.body.getWordCount()),String(ie.selection.getWordCount())],["Characters (no spaces)",String(ie.body.getCharacterCountWithoutSpaces()),String(ie.selection.getCharacterCountWithoutSpaces())],["Characters",String(ie.body.getCharacterCount()),String(ie.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},Re=(Q,ie)=>{Q.addCommand("mceWordCount",()=>vt(Q,ie))},ct=(Q,ie)=>{let ce=null;return{cancel:()=>{i(ce)||(clearTimeout(ce),ce=null)},throttle:(...De)=>{i(ce)&&(ce=setTimeout(()=>{ce=null,Q.apply(null,De)},ie))}}};var oe=tinymce.util.Tools.resolve("tinymce.util.Delay");const pn=(Q,ie)=>{Q.dispatch("wordCountUpdate",{wordCount:{words:ie.body.getWordCount(),characters:ie.body.getCharacterCount(),charactersWithoutSpaces:ie.body.getCharacterCountWithoutSpaces()}})},gt=(Q,ie)=>{pn(Q,ie)},St=(Q,ie,ce)=>{const G=ct(()=>gt(Q,ie),ce);Q.on("init",()=>{gt(Q,ie),oe.setEditorTimeout(Q,()=>{Q.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",G.throttle)},0),Q.on("remove",G.cancel)})},jt=Q=>{const ie=()=>Q.execCommand("mceWordCount");Q.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:ie,context:"any"}),Q.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:ie,context:"any"})};var Ct=(Q=300)=>{o.add("wordcount",ie=>{const ce=He(ie);return Re(ie,ce),jt(ie),St(ie,ce,Q),ce})};Ct()})();const r6e=o=>/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(o)||/class="OutlineElement/.test(o)||/id="?docs\-internal\-guid\-/.test(o),a6e=(o,s="wps_office")=>{const i=o.split(","),u=i[0].match(/:(.*?);/)[1],m=atob(i[1]);let h=m.length;const b=new Uint8Array(h);for(;h--;)b[h]=m.charCodeAt(h);return new File([b],s,{type:u})},i6e=o=>btoa(o.match(/\w{2}/g).map(s=>String.fromCharCode(parseInt(s,16))).join(""));function l6e(o){if(!o)return[];let s=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp(`(?:(${s.source}))([\\da-fA-F\\s]+)\\}`,"g"),u=o.match(i);console.log("images",u);const m=[];if(u||(s=/{\\pict[\s\S]+?(\\pngblip-?\d+)?(\\wmetafile8-?\d+)?{\\\*\\blipuid\s?[\da-fA-F]+[\s}]*?/,i=new RegExp(`(?:(${s.source}))([\\da-fA-F\\s]+)\\}`,"g"),u=o.match(i)),u)for(const h of u){let b=!1;if(h.includes("\\pngblip")?b="image/png":h.includes("\\jpegblip")&&(b="image/jpeg"),b){const C=h.replace(s,"").replace(/[^\da-fA-F]/g,""),x=`data:${b};base64,${i6e(C)}`;m.push({base64:x,file:a6e(x)})}}return m}const c6e=(o,s)=>{if(!s)return o;try{const u=new DOMParser().parseFromString(o,"text/html"),m=u.querySelectorAll("img"),b=(s.clipboardData||window.Clipboard).getData("text/rtf"),C=l6e(b);return m.forEach((x,_)=>{var O;const N=x.getAttribute("src");if(N&&N.startsWith("file:")&&(O=C==null?void 0:C[_])!=null&&O.base64){const B=C[_].base64;x.setAttribute("src",B)}}),u.body.innerHTML}catch{return o}},u6e=o=>{const s=atob(o.split(",")[1]),i=o.split(",")[0].split(":")[1].split(";")[0],u=new ArrayBuffer(s.length),m=new Uint8Array(u);for(let h=0;h<s.length;h++)m[h]=s.charCodeAt(h);return new Blob([u],{type:i})},d6e=async o=>{try{const s=u6e(o),i=new FormData;i.append("files",s,"image.png");const m=await(await fetch("/api/ajax/uploaddoc",{method:"POST",body:i})).json();if(m.status===1)return m.file_url;throw new Error(m.message)}catch(s){throw s}},f6e=async o=>{const i=new DOMParser().parseFromString(o,"text/html"),u=i.getElementsByTagName("img"),m=[],h=3;for(let b=0;b<u.length;b++){const C=u[b],x=C.getAttribute("src");x&&x.startsWith("data:image")&&(m.push({img:C,src:x,width:C.getAttribute("width"),height:C.getAttribute("height")}),m[m.length-1].width&&C.setAttribute("width",m[m.length-1].width),m[m.length-1].height&&C.setAttribute("height",m[m.length-1].height))}for(let b=0;b<m.length;b+=h){const x=m.slice(b,b+h).map(async _=>{try{const N=await d6e(_.src);_.img.setAttribute("src",N)}catch{_.img.remove()}});await Promise.all(x)}return i.body.innerHTML},m6e=o=>{o.querySelectorAll("td").forEach(i=>{const u=i.getAttribute("width"),m=i.getAttribute("style")||"";u==="0"&&m.includes("border:none")&&i.remove()})},p6e=o=>{o.querySelectorAll("table").forEach(i=>{i.style.maxWidth="100%"})},g6e=o=>{o.querySelectorAll("table").forEach(i=>{const u=i.querySelectorAll("td");let m=!1,h="";for(const b of u){const C=b.getAttribute("style")||"",x=C.match(/border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i)||C.match(/border(?:-(?:right|left|top|bottom))?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i);(x?x[0]:"").includes("double")&&(m=!0,x&&(h=x[0].replace(/^border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*/,""),b.style.borderTop=h,b.style.borderRight=h,b.style.borderBottom=h,b.style.borderLeft=h))}m&&h&&(i.style.borderCollapse="separate",i.style.borderSpacing="2px",i.style.border=h)})},h6e=o=>{o.querySelectorAll("table").forEach(i=>{i.querySelectorAll("td[rowspan]").forEach(m=>{const C=((m.getAttribute("style")||"").match(/border-[^:]+:[^;]+(?:solid|double)[^;]+/g)||[]).find(x=>!x.includes("none"));if(C){const x=C.split(":")[1].trim();m.style.borderBottom=x}})})},v6e=o=>{o.querySelectorAll('[style*="mso-"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/mso-[^:]+:[^;]+;/g,"");i.setAttribute("style",m)})},b6e=o=>{o.querySelectorAll('[style*="tab-stops"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/tab-stops:[^;]+;/g,"");i.setAttribute("style",m)})},y6e=o=>{o=o.replace(/<a(?!.*?href=)[^>]*>([\s\S]*?)<\/a>/gi,"$1");const i=new DOMParser().parseFromString(o,"text/html");return m6e(i),p6e(i),g6e(i),h6e(i),v6e(i),b6e(i),o=i.body.innerHTML,o};Sz.PluginManager.add("pasteprocess",o=>(o.on("paste",s=>{if(s.clipboardData){const i=s.clipboardData.getData("text/html")||s.clipboardData.getData("text");if(r6e(i)){s.preventDefault();const u=o.windowManager.open({title:"处理中",body:{type:"panel",items:[{type:"htmlpanel",html:'<div style="text-align: center; padding: 20px;">正在处理Word内容,请稍候...</div>'}]},buttons:[]}),m=y6e(i),h=c6e(m,s);f6e(h).then(b=>{o.insertContent(b),u.close()})}}}),{}));let xH="A4";const ine={A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},B3:{width:353,height:500},B4:{width:257,height:364},B5:{width:176,height:250}},w6e=Object.keys(ine).map(o=>`pagesize${o}`).join(" ");Sz.PluginManager.add("pagesize",o=>{const s=o.options.register;s("pagesize",{processor:"string",default:"A4"}),xH=(m=>h=>h.options.get(m))("pagesize")(o);const u=m=>{const h=ine[m];if(h){const b=(window.devicePixelRatio||1)*96,C=h.width*b/25.4;o!=null&&o.container&&(o.container.style.minWidth=`${C}px`);const x=o.contentAreaContainer.querySelector("iframe");x&&(x.style.width=`${C}px`),o.fire("pagesizechange",{size:m})}};return Object.keys(ine).forEach(m=>{o.ui.registry.addToggleMenuItem(`pagesize${m}`,{text:m,onAction:()=>{xH=m,u(m)},onSetup:h=>(h.setActive(xH===m),()=>{})})}),o.on("init",()=>{u(xH)}),{}});const C6e=["accordion","advlist","anchor","autolink","autosave","charmap","directionality","importcss","insertdatetime","lists","image","media","pagebreak","preview","save","searchreplace","table","fullscreen","wordcount","pasteprocess","pagesize"],S6e="undo redo | blocks bold italic forecolor removeformat alignleft aligncenter alignright alignjustify outdent indent pagebreakfullscreen preview",x6e={license_key:"gpl",skin:!1,content_css:process.env.NODE_ENV==="development"?[`${location.origin}/css/content.css`,`${location.origin}/css/reset.css`]:["./css/content.css","./css/reset.css"],promotion:!1,menu:{pagesize:{title:"页面大小",items:w6e}},menubar:"file edit insert table tools help pagesize",cleanup:!0,branding:!1,language:"zh_CN",plugins:C6e,toolbar:S6e,fontsize_formats:"12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 48px 56px 72px",font_formats:"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;",lineheight_formats:"0.5 0.8 1 1.2 1.5 1.75 2 2.5 3 4 5",elementpath:!1,paste_data_images:!0,object_resizing:!0,pagesize:"A4",images_upload_handler:o=>new Promise((s,i)=>{const u=new FormData;u.append("files",o.blob(),o.filename()),fetch("/api/ajax/uploaddoc",{method:"POST",body:u}).then(m=>m.json()).then(m=>{m.status===1?s(m.file_url):i(`上传失败: ${m.message}`)}).catch(m=>{i(`上传出错: ${m.message}`)})})},E6e={name:"ProEditor",components:{Editor:o6e},props:{modelValue:{type:String,default:""},pagesize:{type:String,default:"A4"},hasPagesize:{type:Boolean,default:!1},placeholder:{type:String,default:"请输入内容"},width:{type:[Number,String],default:"100%"},height:{type:Number,default:400}},setup(o,{emit:s}){const i=f.reactive({myInit:m(x6e),contentValue:o.modelValue,timeout:null});f.onMounted(()=>{Sz.init({license_key:"gpl"}),Sz.activeEditor.on("pagesizechange",h=>{s("update:pagesize",h.size)})}),f.watch(()=>i.contentValue,()=>{u(()=>{s("update:modelValue",i.contentValue)})}),f.watch(()=>o.modelValue,h=>{h&&h!==i.contentValue&&(i.contentValue=h)});function u(h,b=400){i.timeout!==null&&clearTimeout(i.timeout),i.timeout=setTimeout(h,b)}function m(h){o!=null&&o.height&&(h.height=o.height),o!=null&&o.width&&(h.width=o.width);const{placeholder:b,pagesize:C}=o;return h={...h,placeholder:b,...o.hasPagesize&&{menu:{...h.menu,pagesize:h.menu.pagesize},menubar:h.menubar.includes("pagesize")?h.menubar:`${h.menubar} pagesize`,pagesize:C},...!o.hasPagesize&&{menu:Object.fromEntries(Object.entries(h.menu).filter(([x])=>x!=="pagesize")),menubar:h.menubar.replace(/pagesize/g,"").trim(),pagesize:""}},h}return{...f.toRefs(i),customer:m,debounce:u}}},_6e={class:"my-tinymce"};function k6e(o,s,i,u,m,h){const b=f.resolveComponent("Editor");return f.openBlock(),f.createElementBlock("div",_6e,[f.createVNode(b,{modelValue:o.contentValue,"onUpdate:modelValue":s[0]||(s[0]=C=>o.contentValue=C),init:o.myInit},null,8,["modelValue","init"])])}const ufe=$i(E6e,[["render",k6e]]),T6e={name:"ShadowDomWrap",setup(o,{emit:s,expose:i}){const u=f.ref(null),m=f.ref(),h=f.ref(!1),b=x=>{if(!u.value)return;const _=u.value.contains(x.target);!_&&h.value?(h.value=!1,s("onBlur")):_&&!h.value&&(h.value=!0)},C=x=>{x.stopPropagation(),h.value||(h.value=!0,s("onFocus"))};return f.onMounted(()=>{var N,O,B;m.value=(N=u.value)==null?void 0:N.attachShadow({mode:"open"}),document.addEventListener("click",b);const x=document.createElement("link");x.rel="stylesheet",x.href=`${location==null?void 0:location.origin}/css/index.min.css`,(O=m.value)==null||O.appendChild(x);const _=document.createElement("link");_.rel="stylesheet",_.href=`${location==null?void 0:location.origin}/css/reset.css`,(B=m.value)==null||B.appendChild(_)}),f.onUnmounted(()=>{document.removeEventListener("click",b)}),i({focus:()=>{h.value=!0}}),{shadowHost:u,shadowRoot:m,handleClick:C}}};function A6e(o,s,i,u,m,h){return f.openBlock(),f.createElementBlock("div",{ref:"shadowHost",class:"shadow-host",onClick:s[0]||(s[0]=f.withModifiers((...b)=>u.handleClick&&u.handleClick(...b),["stop"]))},[u.shadowRoot?(f.openBlock(),f.createBlock(f.Teleport,{key:0,to:u.shadowRoot},[f.renderSlot(o.$slots,"default")],8,["to"])):f.createCommentVNode("",!0)],512)}const yoe=$i(T6e,[["render",A6e]]),N6e=["innerHTML"],dfe=f.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue");return(i,u)=>(f.openBlock(),f.createBlock(yoe,null,{default:f.withCtx(()=>[f.createElementVNode("div",{innerHTML:s.value},null,8,N6e)]),_:1}))}}),ffe=Symbol("nodesUI"),Pf=()=>{const o=f.inject(ffe);if(!o)throw new Error("NodesUI context not found");return o};function woe(o){if(!o||!o.ownerDocument)return null;const s=[];for(let i=o;i&&i.nodeType===1;i=i.parentElement){let u=0;for(let b=i.previousSibling;b;b=b.previousSibling)b.nodeType===1&&b.nodeName===i.nodeName&&u++;const m=i.nodeName.toLowerCase(),h=u?`${m}:nth-child(${u+1})`:m;s.unshift(h)}return s.length?s.join(" > "):null}function O6e(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(`#${CSS.escape(o)}`)}catch(i){return console.error("nodePath query error:",i),null}}function mfe(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const VA=o=>o!=null&&o.id?o==null?void 0:o.id:o.nodePath+(o!=null&&o.textNodeIndex?`-${o==null?void 0:o.textNodeIndex}`:"")+(o!=null&&o.startOffset?`-${o==null?void 0:o.startOffset}`:"")+(o!=null&&o.subNodeSort?`-${o==null?void 0:o.subNodeSort}`:""),$6e=(o,s,i)=>{var u,m;if(!Soe(o)){const h=i==null?void 0:i.getRootNode(),b=(u=h==null?void 0:h.getSelection)==null?void 0:u.call(h),C=mfe(o.nodePath,i);if(b&&o.startOffset!==void 0&&s&&C){const x=document.createRange(),_=(o==null?void 0:o.textNodeIndex)||0,N=C.childNodes[_]||C,O=Math.min(o.startOffset,((m=N.textContent)==null?void 0:m.length)||0);x.setStart(N,O),x.setEnd(N,O);const B=document.createElement("span");B.classList.add("empty-text-node"),x.insertNode(B),x.insertNode(s),x.setStartAfter(s),x.collapse(!0),b.removeAllRanges(),b.addRange(x)}}},D6e=(o,s)=>{s!=null&&s.id&&(o.id=s==null?void 0:s.id),(s==null?void 0:s.nodePath)!==void 0&&o.setAttribute("data-nodePath",s.nodePath),(s==null?void 0:s.textNodeIndex)!==void 0&&s.textNodeIndex>=0&&o.setAttribute("data-textNodeIndex",s.textNodeIndex.toString()),s.startOffset!==void 0&&s.startOffset>=0&&o.setAttribute("data-startOffset",s.startOffset.toString()),(s==null?void 0:s.subNodeSort)!==void 0&&s.subNodeSort>=0&&o.setAttribute("data-subNodeSort",s.subNodeSort.toString()),(s==null?void 0:s.groupKey)!==void 0&&o.setAttribute("data-groupKey",s.groupKey)},M6e=o=>{const s=o.parentNode;if(!s)return-1;let i=0;for(let u=0;u<s.childNodes.length;u++){const m=s.childNodes[u];if(m===o)return i;i++,m.nodeType===Node.ELEMENT_NODE&&(m.classList.contains("node-item")&&(i-=2,i<0&&(i=0)),m.classList.contains("empty-text-node")&&(i-=1,i<0&&(i=0)))}return-1},R6e=o=>{let s=o.closest("TD"),i=o.closest(".node-item"),u=null;if(i?u=i:s&&s.classList.contains("node-item-td")&&(u=s),!u)return null;const m=u||o;let h=m==null?void 0:m.getAttribute("data-nodePath");if(h||(h=woe(m)),(m==null?void 0:m.getAttribute("selectable"))==="false")return null;let b={element:m,nodePath:h};const C=m==null?void 0:m.getAttribute("data-textNodeIndex");C&&(b.textNodeIndex=Number(C));const x=m==null?void 0:m.getAttribute("data-startOffset");x&&(b.startOffset=Number(x));const _=m==null?void 0:m.getAttribute("data-subNodeSort");_&&(b.subNodeSort=Number(_));const N=m==null?void 0:m.getAttribute("data-groupKey");N&&(b.groupKey=N);const O=m==null?void 0:m.getAttribute("id");return O&&(b.id=O),b},B6e=o=>JSe(o,s=>f.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),Coe=(o,s)=>{const i=o.startsWith("#")?o.slice(1):o;let u,m,h;if(i.length===3)u=parseInt(i[0]+i[0],16),m=parseInt(i[1]+i[1],16),h=parseInt(i[2]+i[2],16);else if(i.length===6)u=parseInt(i.substring(0,2),16),m=parseInt(i.substring(2,4),16),h=parseInt(i.substring(4,6),16);else return console.warn("Invalid color format:",o),`rgba(0, 0, 0, ${s})`;return`rgba(${u}, ${m}, ${h}, ${s})`},I6e=o=>{const{element:s}=o;if(!s)return null;if(s.tagName.toLowerCase()!=="td")return{showTextType:"input"};const u=s.closest("tr"),m=Array.from(u.parentElement.children).indexOf(u),h=Array.from(u.children).indexOf(s),b=s.closest("table"),C=s.closest("body").querySelectorAll("table");return{showTextType:"cell",tableIndex:Array.from(C).indexOf(b)+1,colIndex:h,rowIndex:m}},P6e=(o,s)=>{var m,h;let i=1;const u=(m=o==null?void 0:o.map(b=>s==null?void 0:s.find(C=>(C==null?void 0:C.id)===(b==null?void 0:b.id))))==null?void 0:m.filter(Boolean);return(u==null?void 0:u.length)>0?(h=u==null?void 0:u.map(C=>{const x=I6e(C);return x?(x==null?void 0:x.showTextType)==="input"?{...C,...x,inputIndex:i++}:{...C,...x}:null}))==null?void 0:h.filter(Boolean):[]};function F6e(o){if(!o||o.length===0)return[];const s=[...o].sort((m,h)=>m.rowIndex!==h.rowIndex?m.rowIndex-h.rowIndex:m.colIndex-h.colIndex),i=[],u=new Set;for(const m of s){if(u.has(m))continue;const h=[];let b=0,C=0;for(let x=m.colIndex;s.find(N=>N.rowIndex===m.rowIndex&&N.colIndex===x&&!u.has(N));x++)C++;if(C!==0){b=C;for(let x=m.rowIndex;;x++){let _=0;const N=[];for(let O=m.colIndex;O<m.colIndex+b;O++){const B=s.find(L=>L.rowIndex===x&&L.colIndex===O&&!u.has(L));if(B)_++,N.push(B);else break}if(_===b)h.push(...N);else break}h.length>0&&(i.push([...h]),h.forEach(x=>u.add(x)))}}return i}function L6e(o){if(!o||o.length===0)return{min:null,max:null};let s=o[0],i=o[0];for(const u of o)(u.colIndex<s.colIndex||u.colIndex===s.colIndex&&u.rowIndex<s.rowIndex)&&(s=u),(u.colIndex>i.colIndex||u.colIndex===i.colIndex&&u.rowIndex>i.rowIndex)&&(i=u);return{min:s,max:i}}const pfe=(o,s)=>{var _;const i=P6e(o,s||[]),u=[],m=[];(_=f.toValue(i))==null||_.forEach(N=>{(N==null?void 0:N.showTextType)==="input"?u.push(N):m.push(N)});const h=txe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=ede(b==null?void 0:b.map(N=>F6e(N==null?void 0:N.nodes))),x=(C==null?void 0:C.map(N=>L6e(N)))||[];return[...u,...x]},t4=o=>{function s(i){let u="";for(;i>=0;)u=String.fromCharCode(65+i%26)+u,i=Math.floor(i/26)-1;return u}return(o==null?void 0:o.colIndex)>=0&&(o==null?void 0:o.rowIndex)>=0?`${s(o==null?void 0:o.colIndex)}${o==null?void 0:o.rowIndex}`:""},V6e=(o,s)=>{const i=pfe(o,s||[]);let u=[];return i==null||i.forEach(m=>{var h,b;(m==null?void 0:m.showTextType)==="input"?u.push(`填写${m==null?void 0:m.inputIndex}`):u.push(((h=m==null?void 0:m.min)==null?void 0:h.id)===((b=m==null?void 0:m.max)==null?void 0:b.id)?t4(m==null?void 0:m.min):`${t4(m==null?void 0:m.min)}:${t4(m==null?void 0:m.max)}`)}),u==null?void 0:u.join(",")},Soe=o=>o.startOffset===void 0&&o.textNodeIndex===void 0,H6e={key:0},z6e={key:1,class:"td-node"},U6e=f.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,i=f.computed(()=>{var u,m;return((m=(u=s==null?void 0:s.node)==null?void 0:u.element)==null?void 0:m.TagName)==="TD"});return(u,m)=>{var h,b;return i.value?(f.openBlock(),f.createElementBlock("span",H6e,f.toDisplayString((h=s==null?void 0:s.node)==null?void 0:h.label),1)):(f.openBlock(),f.createElementBlock("span",z6e,f.toDisplayString((b=s==null?void 0:s.node)==null?void 0:b.label),1))}}}),gfe=Symbol("nodesEditor"),j0=()=>{const o=f.inject(gfe);if(!o)throw new Error("NodesEditor context not found");return o},wU=f.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=Pf(),{nodes:u}=j0(),m=f.computed(()=>{var C;return(C=s.node)!=null&&C.id?u.value.some(x=>x.id===s.node.id):!1}),h=f.computed(()=>{var C;if(!((C=s.node)!=null&&C.element))return!1;try{return s.node.element.parentNode!==null}catch(x){return console.warn("Element validation failed:",x),!1}}),b=f.computed(()=>{var C;return(C=f.toValue(i))==null?void 0:C.find(x=>{var _;return(x==null?void 0:x.id)===((_=s==null?void 0:s.node)==null?void 0:_.id)})});return f.watch(()=>b,()=>{var x,_,N,O;const C=f.toValue(b);(x=s==null?void 0:s.node)!=null&&x.element&&(C?C!=null&&C.activated||(s.node.element.style.setProperty("--node-color",(C==null?void 0:C.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",Coe((C==null?void 0:C.color)||"#409eff",.1)),s.node.element.setAttribute("data-dataGroupKey",C==null?void 0:C.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("activated")):((_=s.node.element)==null||_.removeAttribute("data-dataGroupKey"),(N=s.node.element)==null||N.removeAttribute("selectable"),(O=s.node.element)==null||O.classList.remove("activated")))},{immediate:!0,deep:!0}),(C,x)=>{var _;return(_=C.node)!=null&&_.element&&h.value&&m.value?(f.openBlock(),f.createBlock(f.Teleport,{key:0,to:C.node.element},[f.renderSlot(C.$slots,"default",{node:C.node},()=>[f.createVNode(U6e,{node:C.node},null,8,["node"])])],8,["to"])):f.createCommentVNode("",!0)}}});function j6e(){const o=f.ref(!1),s=u=>{u.key==="Control"&&(o.value=!0)},i=u=>{u.key==="Control"&&(o.value=!1)};return f.onMounted(()=>{window.addEventListener("keydown",s),window.addEventListener("keyup",i)}),f.onUnmounted(()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",i)}),o}function hfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i,currentNodes:u}=Pf(),{editorId:m,nodes:h}=j0(),b=f.ref(!1),C=f.ref({x:0,y:0}),x=f.ref({x:0,y:0}),_=f.ref({left:0,top:0,width:0,height:0}),N=f.ref(null),O=Le=>{const te=Le.closest(".node-item-td")||Le.closest(".node-item");if(te!==null){let We=[];if(te.classList.contains("node-selected"))return;const pt=te.getAttribute("id");if(pt&&h.value){const ft=h.value.find(Oe=>Oe.id===pt);ft&&(We=[ft])}We=K(We),s(We)}},B=Le=>{Le.button===2&&O(Le==null?void 0:Le.target),Le.button===0&&(b.value=!0,N.value&&(C.value={x:Le.pageX,y:Le.pageY},x.value={x:Le.pageX,y:Le.pageY},Y(Le),W(),N.value.style.display="block",window.addEventListener("mousemove",L),window.addEventListener("mouseup",j)))},L=Gae(Le=>{b.value&&(x.value={x:Le.pageX,y:Le.pageY},W())},16),j=Le=>{Le.button===0&&(b.value=!1,N.value&&(W(),N.value.style.display="none",window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",j)))},J=j6e(),Y=Le=>{var We,pt;let te=[];if(Le.button===0&&(Le!=null&&Le.target)){const ft=((We=Le==null?void 0:Le.target)==null?void 0:We.closest(".node-item-td"))||((pt=Le==null?void 0:Le.target)==null?void 0:pt.closest(".node-item"));if(ft!==null){const Oe=ft.getAttribute("id");if(Oe&&h.value){const ue=h.value.find(Pt=>Pt.id===Oe);ue&&(J.value?o.value.some(Pt=>VA(Pt)===VA(ue))?te=o.value.filter(be=>VA(be)!==VA(ue)):te=[...o.value,ue]:ue&&(te=[ue]))}}te=K(te),s(te)}},ne=()=>{if(!i.value||!(_.value.width>3||_.value.height>3))return;let Le=[];const te={left:_.value.left,right:_.value.left+_.value.width,top:_.value.top,bottom:_.value.top+_.value.height};if(i.value.querySelectorAll("*").forEach(pt=>{const ft=pt.getBoundingClientRect(),Oe=window.scrollX||window.pageXOffset,ue=window.scrollY||window.pageYOffset,Pt={left:ft.left+Oe,right:ft.right+Oe,top:ft.top+ue,bottom:ft.bottom+ue};if(Pt.right>te.left&&Pt.left<te.right&&Pt.bottom>te.top&&Pt.top<te.bottom){const be=pt.getAttribute("id");if(be&&h.value){const $e=h.value.find(R=>R.id===be);$e&&(Le=[...Le,$e])}}}),Le=K(Le),J.value){const pt=new Set(o.value.map(Oe=>VA(Oe))),ft=Le.filter(Oe=>!pt.has(VA(Oe)));s([...o.value,...ft])}else s(Le)},K=Le=>{var We;let te=[];if(Le.length>0){const pt=(We=Le.map(be=>be==null?void 0:be.groupKey))==null?void 0:We.filter(Boolean),ft=new Set(pt),Oe=Array.from(ft),ue=h.value.filter(be=>Oe.includes(be.groupKey));te=[...Le,...ue],te=[...yxe(te.filter(be=>be==null?void 0:be.id),"id")||[],...te.filter(be=>!be.id)]}if(u&&u.value&&u.value.length>0){const pt=new Set(u.value.map(ft=>ft.id).filter(Boolean));te=te.filter(ft=>ft.id?!pt.has(ft.id):!0)}return te},W=Gae(()=>{if(!N.value)return;const{x:Le,y:te}=C.value,{x:We,y:pt}=x.value,ft=Math.min(Le,We),Oe=Math.min(te,pt),ue=Math.abs(Le-We),Pt=Math.abs(te-pt);_.value={left:ft,top:Oe,width:ue,height:Pt}},16),Se=Le=>{if(!N.value)return;const{left:te,top:We,width:pt,height:ft}=f.toValue(Le);N.value.style.left=`${te}px`,N.value.style.top=`${We}px`,N.value.style.width=`${pt}px`,N.value.style.height=`${ft}px`},ut=()=>{if(!i.value)return;i.value.addEventListener("mousedown",B);const Le=document.getElementById(`select_area_${m}`);if(Le){N.value=Le;return}const te=document.createElement("div");te.id=`select_area_${m}`,te.style.position="absolute",te.style.border="1px solid #1677ff",te.style.backgroundColor="rgba(22, 119, 255, 0.05)",te.style.pointerEvents="none",te.style.display="none",document.body.appendChild(te),N.value=te};return f.watch(_,(Le,te)=>{di(Le,te)||(Se(Le),b.value&&ne())},{deep:!0}),f.watch(()=>i.value,Le=>{f.toValue(Le)&&ut()},{immediate:!0}),f.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",B)}),{isSelecting:b,selectionBox:N}}function vfe(){const{selectedNodes:o,containerRef:s}=Pf(),i=()=>{var m;(m=f.toValue(s))==null||m.querySelectorAll(".node-selected").forEach(h=>{h.classList.remove("node-selected")})},u=m=>{m.forEach(h=>{h.classList.add("node-selected")})};f.watch(()=>o,()=>{i(),setTimeout(()=>{var h,b;const m=(b=(h=f.toValue(o))==null?void 0:h.map(C=>{var x;return(x=s.value)==null?void 0:x.querySelector(`[id="${C.id}"]`)}))==null?void 0:b.filter(Boolean);u(m)},0)},{deep:!0})}const ud=[];for(let o=0;o<256;++o)ud.push((o+256).toString(16).slice(1));function W6e(o,s=0){return(ud[o[s+0]]+ud[o[s+1]]+ud[o[s+2]]+ud[o[s+3]]+"-"+ud[o[s+4]]+ud[o[s+5]]+"-"+ud[o[s+6]]+ud[o[s+7]]+"-"+ud[o[s+8]]+ud[o[s+9]]+"-"+ud[o[s+10]]+ud[o[s+11]]+ud[o[s+12]]+ud[o[s+13]]+ud[o[s+14]]+ud[o[s+15]]).toLowerCase()}let ste;const Z6e=new Uint8Array(16);function G6e(){if(!ste){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ste=crypto.getRandomValues.bind(crypto)}return ste(Z6e)}const q6e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Gie={randomUUID:q6e};function yE(o,s,i){var m;if(Gie.randomUUID&&!s&&!o)return Gie.randomUUID();o=o||{};const u=o.random??((m=o.rng)==null?void 0:m.call(o))??G6e();if(u.length<16)throw new Error("Random bytes length must be >= 16");return u[6]=u[6]&15|64,u[8]=u[8]&63|128,W6e(u)}const CU=()=>{const{nodes:o,updateNodes:s}=j0();return{nodes:o,addNode:C=>{const _=(Array.isArray(C)?C:[C]).map(O=>({...O,id:O.id||yE()})),N=[...o.value,..._];s(N)},removeNode:C=>{const x=Array.isArray(C)?C:[C],_=[],N=[];x.forEach(B=>{const L=o.value.find(j=>(j==null?void 0:j.id)===B);Soe(L)?_.push(B):N.push(B)});let O=o.value.filter(B=>!N.includes(B==null?void 0:B.id));O=O==null?void 0:O.map(B=>_.includes(B==null?void 0:B.id)?{id:B==null?void 0:B.id,nodePath:B==null?void 0:B.nodePath,label:"文本",nodeType:"text"}:B),s(O)},editNodes:C=>{const x=Array.isArray(C)?C:[C];let _=yE();const N=x.map(B=>{let L={...B},j=B==null?void 0:B.id;return j||(j=yE(),L.id=j),L!=null&&L.groupKey||(L.groupKey=_),L}),O=[...o.value];N.forEach(B=>{const L=O.findIndex(j=>j.id===B.id);L!==-1?O[L]=B:O.push(B)}),s(O)},insertNodeAt:(C,x)=>{const _=[...o.value];_.splice(x,0,C),s(_)},moveNode:(C,x)=>{const _=[...o.value],[N]=_.splice(C,1);_.splice(x,0,N),s(_)}}};function Y6e(){const{removeNode:o}=CU(),{containerRef:s}=Pf(),i=m=>{var j,J;if(m.target instanceof Element&&m.target.classList.contains("node-item"))return;const h=m.target;if(h===s.value)return;const C=((j=s.value)==null?void 0:j.getRootNode()).getSelection(),x=(J=s.value)==null?void 0:J.querySelectorAll('[contenteditable="true"]');x==null||x.forEach(Y=>{Y.setAttribute("contenteditable","false")});const _=h.textContent||"",N=h.innerHTML||"";h.setAttribute("contenteditable","true"),h.focus();const O=new MutationObserver(()=>{h.textContent!==_&&(h.innerHTML=N)});O.observe(h,{characterData:!0,childList:!0,subtree:!0});const B=Y=>{Y.preventDefault()};h.addEventListener("input",B),h.addEventListener("paste",B),h.addEventListener("drop",B),h.addEventListener("keydown",Y=>{var ne,K,W,Se;if(((ne=document.activeElement)==null?void 0:ne.shadowRoot)===((K=s.value)==null?void 0:K.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(Y.key)){if(Y.key==="Backspace"||Y.key==="Delete"){const ut=C==null?void 0:C.getRangeAt(0);if(h.blur(),(ut==null?void 0:ut.startOffset)===0){const Le=ut.startContainer;if(Le.nodeType===Node.TEXT_NODE){const te=Le.previousSibling;if(te&&te.nodeType===Node.ELEMENT_NODE&&te.classList.contains("node-item")){const We=te.getAttribute("id");We&&o(We),(W=Le.parentElement)==null||W.normalize();return}}else if(Le.nodeType===Node.ELEMENT_NODE){const te=Le.previousSibling;if(te&&te.nodeType===Node.ELEMENT_NODE&&te.classList.contains("node-item")){const We=te.getAttribute("id");We&&o(We),(Se=Le.parentElement)==null||Se.normalize();return}}}}Y.preventDefault()}});const L=()=>{O.disconnect(),h.removeEventListener("input",B),h.removeEventListener("paste",B),h.removeEventListener("drop",B),h.removeEventListener("blur",L),h.setAttribute("contenteditable","false")};h.addEventListener("blur",L)},u=()=>{var m;(m=s.value)==null||m.addEventListener("dblclick",i)};return f.watch(s,m=>{m&&u()},{immediate:!0}),f.onUnmounted(()=>{var m;(m=s.value)==null||m.removeEventListener("dblclick",i)}),{}}function K6e(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=Pf(),h=_=>{var O,B;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const L=N.getRangeAt(0);u.value=M6e(L.startContainer);const j=L.startOffset,J=(B=s.value)==null?void 0:B.querySelectorAll(".node-item");let Y=0;return m.value=0,J==null||J.forEach(ne=>{const K=document.createRange();if(K.selectNode(ne),K.comparePoint(L.startContainer,j)>=0){m.value+=1;const W=ne.getAttribute("data-startOffset");Number(W)>Y&&(Y=Number(W))}}),Y+j}}catch{}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var L;const N=_.target;if(N===o.value)return;s.value=N;const O=(L=o.value)==null?void 0:L.getRootNode();i.value=h(O),N.addEventListener("click",b),N.addEventListener("keyup",j=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(j.key)&&b()});const B=()=>{N.removeEventListener("click",b),N.removeEventListener("keyup",b),N.removeEventListener("blur",B),setTimeout(()=>{s.value=null,u.value=0,i.value=-1},300)};N.addEventListener("blur",B)},x=()=>{var _;(_=o.value)==null||_.addEventListener("focus",C,!0)};return f.watch(o,_=>{_&&x()},{immediate:!0}),f.onUnmounted(()=>{var _;(_=o.value)==null||_.removeEventListener("focus",C,!0)}),{focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}}function X6e(o){const s=o.value===null?[]:[JSON.parse(JSON.stringify(o.value))],i=f.ref(s),u=f.ref(0),m=f.ref(!1),h=f.computed(()=>i.value[u.value]),b=()=>{u.value>0&&(m.value=!0,u.value--,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},C=()=>{u.value<i.value.length-1&&(m.value=!0,u.value++,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},x=_=>{(_.ctrlKey||_.metaKey)&&_.key==="z"?(_.preventDefault(),b()):(_.ctrlKey||_.metaKey)&&_.key==="y"&&(_.preventDefault(),C())};return f.onMounted(()=>{window.addEventListener("keydown",x)}),f.onUnmounted(()=>{window.removeEventListener("keydown",x)}),f.watch(o,uE(_=>{_&&!m.value&&(i.value.splice(u.value+1),i.value.push(JSON.parse(JSON.stringify(_))),u.value++),m.value&&(m.value=!1)},300),{deep:!0}),{current:h,undo:b,redo:C}}function J6e(){const{modelValue:o}=j0(),{nodes:s,addNode:i}=CU(),u=b=>{if(!b||typeof b!="string")return[];const x=new DOMParser().parseFromString(b,"text/html");return Array.from(x.querySelectorAll("td")).filter(O=>{var B;return!((B=O.textContent)!=null&&B.trim())})},m=(b,C)=>{const x=C.map(N=>N.nodePath);return b==null?void 0:b.map(N=>({nodePath:woe(N)})).filter(N=>{const O=N==null?void 0:N.nodePath;return!x.includes(O)})},h=b=>{const C=b.map(x=>({nodeType:"Text",label:"文本",...x}));i(C)};f.onMounted(()=>{const b=u(o),C=m(b,f.toValue(s));h(C)})}function Q6e(){const{selectedNodes:o,containerRef:s}=Pf(),{removeNode:i}=CU(),u=f.ref(null),m=C=>{var x;if((x=f.toValue(s))!=null&&x.contains(u.value)&&(C.key==="Delete"||C.key==="Backspace")){let _=[];C.preventDefault(),f.toValue(o).length>0&&(f.toValue(o).forEach(N=>{var O,B,L;if(((O=N==null?void 0:N.element)==null?void 0:O.tagName)==="TD"){const j=(B=N==null?void 0:N.element)==null?void 0:B.getAttribute("id");j&&_.push(j)}else{const j=(L=N==null?void 0:N.element)==null?void 0:L.getAttribute("id");j&&_.push(j)}}),o.value=[],(_==null?void 0:_.length)>0&&i(_))}},h=C=>{var x;(x=f.toValue(s))!=null&&x.contains(C.target)?u.value=C.target:u.value=null},b=()=>{s.value&&(window.addEventListener("keydown",m),s.value.addEventListener("mousedown",h))};f.watch(()=>s.value,C=>{f.toValue(C)&&b()},{immediate:!0}),f.onUnmounted(()=>{s.value&&(window.removeEventListener("keydown",m),s.value.removeEventListener("mousedown",h))})}function SU(){const{nodes:o}=j0(),{containerRef:s,renderNodes:i,uiReady:u}=Pf(),m=()=>{var h;i.value=[...(h=o.value)==null?void 0:h.map(b=>{var x;const C=(x=s.value)==null?void 0:x.querySelector(`[id="${b.id}"]`);return{...b,element:C}})].filter(b=>!!(b!=null&&b.element))};f.watch(()=>[o,s.value,u],()=>{f.toValue(u)&&m()},{immediate:!0,deep:!0})}const lne=f.ref({});function xU(o){return f.computed(()=>{var s;return(s=lne.value)==null?void 0:s[o]})}function bfe(){const o=j0(),s=Pf();f.onMounted(()=>{const{editorId:i}=o;i&&(lne.value[i]=f.ref({...o,...s}))}),f.onUnmounted(()=>{const{editorId:i}=o;i&&(lne.value[i]=null)})}const eMe=f.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{nodes:s}=j0(),{uiReady:i,renderNodes:u}=Pf();return bfe(),X6e(s),hfe(),vfe(),Q6e(),K6e(),Y6e(),J6e(),SU(),(m,h)=>f.unref(i)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(u),b=>(f.openBlock(),f.createBlock(wU,{key:b==null?void 0:b.id,node:b},{default:f.withCtx(C=>[f.renderSlot(m.$slots,"nodeItem",{node:C==null?void 0:C.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),qie=f.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=Pf();return SU(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(wU,{key:h==null?void 0:h.id,node:h},{default:f.withCtx(b=>[f.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),tMe=f.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=Pf();return SU(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(wU,{key:h==null?void 0:h.id,node:h},{default:f.withCtx(b=>[f.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),nMe=f.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=Pf();return bfe(),hfe(),vfe(),SU(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(wU,{key:h==null?void 0:h.id,node:h},{default:f.withCtx(b=>[f.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),oMe=f.defineComponent({__name:"NodesProvider",props:f.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},renderType:{type:String,default:"preview"},inputTypes:{type:Array,default:()=>[]},editorId:{type:String,default:""}},{formData:{},formDataModifiers:{},nodes:{},nodesModifiers:{}}),emits:f.mergeModels(["update:nodes"],["update:formData","update:nodes"]),setup(o,{emit:s}){const i=o,u=f.useModel(o,"formData"),m=f.useModel(o,"nodes");return f.provide(gfe,{modelValue:i.modelValue,renderType:i.renderType,inputTypes:i.inputTypes,editorId:i==null?void 0:i.editorId,nodes:m,updateNodes:h=>m.value=h,formData:u}),(h,b)=>f.renderSlot(h.$slots,"default")}}),c2=f.ref({});function sMe(o){return f.computed(()=>(c2.value[o]||(c2.value[o]=f.ref([])),c2.value[o]))}function rMe(o){const{editorId:s}=o,i=f.ref(!1);f.onMounted(()=>{c2.value[s]||(c2.value[s]=f.ref([]));const u=c2.value[s].findIndex(m=>m.id===o.id);u!==-1&&c2.value[s].splice(u,1),i.value=!0,c2.value[s].push({...o,isMounted:i})}),f.onUnmounted(()=>{i.value=!1})}const aMe=f.defineComponent({__name:"NodesUIProvider",props:{nodes:{type:Array,default:()=>[]},selectedNodes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},editorId:{type:String,default:""}},emits:["onSelectedNodes","update:selectedNodes"],setup(o,{expose:s,emit:i}){const u=o,m=i,h=f.computed({get:()=>(u.selectedNodes||[]).map(ne=>{var Se;let K=(Se=u==null?void 0:u.nodes)==null?void 0:Se.find(ut=>(ut==null?void 0:ut.id)===(ne==null?void 0:ne.id)),W=ne!=null&&ne.element?ne==null?void 0:ne.element:O6e(ne==null?void 0:ne.id,b.value);return{...K||{},...ne,element:W}}),set:ne=>{const K=ne.map(({element:W,...Se})=>{var Le;return{...((Le=u==null?void 0:u.nodes)==null?void 0:Le.find(te=>(te==null?void 0:te.id)===(Se==null?void 0:Se.id)))||{},...Se}});m("update:selectedNodes",K)}}),b=f.ref(null),C=f.ref([]),x=f.ref(null),_=f.ref(-1),N=f.ref(0),O=f.ref(0),B=sMe(u==null?void 0:u.editorId),L=f.ref(!1),j=f.computed(()=>{var K,W;const ne=((W=(K=f.toValue(B))==null?void 0:K.filter(Se=>!f.toValue(Se==null?void 0:Se.activated)))==null?void 0:W.filter(Se=>f.toValue(Se.isMounted)))||[];return B6e([...(u==null?void 0:u.nodesGroups)||[],...ne])}),J=f.ref([]),Y=ne=>{const K=ne.map(({element:W,...Se})=>{var Le;return{...((Le=C.value)==null?void 0:Le.find(te=>(te==null?void 0:te.id)===(Se==null?void 0:Se.id)))||{},...Se}});di(K,h.value)||(h.value=ne,m("onSelectedNodes",K))};return s({setSelectedNodes:Y}),f.provide(ffe,{containerRef:b,focusedElement:x,currentRenderNodes:J,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:j,selectedNodes:h,setSelectedNodes:Y,renderNodes:C,uiReady:L,nodesGroups:u==null?void 0:u.nodesGroups}),(ne,K)=>f.renderSlot(ne.$slots,"default")}}),iMe=["onClick"],lMe={key:0,class:"icon"},cMe={key:1,class:"arrow"},uMe={key:0,class:"submenu"},dMe=["onClick"],fMe={key:0,class:"icon"},mMe=f.defineComponent({__name:"index",props:f.mergeModels({style:{}},{show:{},showModifiers:{}}),emits:f.mergeModels(["select"],["update:show"]),setup(o,{emit:s}){const{selectedNodes:i,focusedElement:u,cursorPosition:m,focusedNodeIndex:h,preNodeNumber:b}=Pf(),{inputTypes:C}=j0(),x=f.useModel(o,"show"),{editNodes:_}=CU(),N=j=>{if(f.toValue(u)&&!rxe(f.toValue(m))){const J=woe(f.toValue(u)),Y=f.toValue(m),ne=(f.toValue(b)||0)+1,K=R6e(f.toValue(u));J&&Y&&Y>=0&&_({...K,label:j==null?void 0:j.label,nodePath:J,startOffset:Y,subNodeSort:ne,textNodeIndex:f.toValue(h)||0,nodeType:j==null?void 0:j.value})}else if(i){const J=f.toValue(i);J!=null&&J.length&&_(J==null?void 0:J.map(Y=>({...Y,label:j==null?void 0:j.label,element:Y==null?void 0:Y.element,nodePath:Y==null?void 0:Y.nodePath,nodeType:j==null?void 0:j.value})))}x.value=!1},O=f.computed(()=>{const j=[],J=[];return f.toValue(C).forEach(Y=>{Y.groupName==="system"?J.push({...Y,handler:()=>{N(Y)}}):j.push({...Y,handler:()=>{N(Y)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:j},{label:"插入记录标识",icon:"i-bi:flag",children:J}].filter(Y=>{var ne;return(ne=Y==null?void 0:Y.children)==null?void 0:ne.length})}),B=s,L=(j,J)=>{j.preventDefault(),J!=null&&J.handler&&J.handler(),J!=null&&J.value&&B("select",J==null?void 0:J.value)};return(j,J)=>f.withDirectives((f.openBlock(),f.createElementBlock("div",{class:"context-menu",style:f.normalizeStyle({...j.style})},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(O.value,Y=>(f.openBlock(),f.createElementBlock("div",{key:Y==null?void 0:Y.label,class:"menu-item"},[f.createElementVNode("div",{class:"menu-item-content",onClick:ne=>L(ne,Y)},[Y!=null&&Y.icon?(f.openBlock(),f.createElementBlock("div",lMe,[f.createElementVNode("div",{class:f.normalizeClass(Y==null?void 0:Y.icon)},null,2)])):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(Y.label)+" ",1),Y!=null&&Y.children?(f.openBlock(),f.createElementBlock("span",cMe,"›")):f.createCommentVNode("",!0)],8,iMe),Y!=null&&Y.children?(f.openBlock(),f.createElementBlock("div",uMe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(Y.children,ne=>(f.openBlock(),f.createElementBlock("div",{key:ne.action,class:"menu-item",onClick:K=>L(K,ne)},[ne!=null&&ne.icon?(f.openBlock(),f.createElementBlock("div",fMe,[f.createElementVNode("div",{class:f.normalizeClass(ne==null?void 0:ne.icon)},null,2)])):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(ne.label),1)],8,dMe))),128))])):f.createCommentVNode("",!0)]))),128))],4)),[[f.vShow,x.value]])}}),pMe=$i(mMe,[["__scopeId","data-v-7f46efc3"]]);function gMe(){const o=f.ref(!1),s=f.ref({left:"0px",top:"0px"}),i=m=>{m.preventDefault(),o.value=!0;const b=m.currentTarget.getBoundingClientRect(),C=m.clientX-b.left,x=m.clientY-b.top,_=118,N=b.width-C<_;s.value={left:N?`${C-_}px`:`${C}px`,top:`${x}px`}},u=m=>{const h=document.querySelector(".context-menu");h&&!h.contains(m.target)&&(o.value=!1)};return f.onMounted(()=>{document.addEventListener("mousedown",u)}),f.onUnmounted(()=>{document.removeEventListener("mousedown",u)}),{showContextMenu:o,contextMenuStyle:s,onContextMenu:i,closeContextMenu:u}}function yfe(o){return{all:o=o||new Map,on:function(s,i){var u=o.get(s);u?u.push(i):o.set(s,[i])},off:function(s,i){var u=o.get(s);u&&(i?u.splice(u.indexOf(i)>>>0,1):o.set(s,[]))},emit:function(s,i){var u=o.get(s);u&&u.slice().map(function(m){m(i)}),(u=o.get("*"))&&u.slice().map(function(m){m(s,i)})}}}const cne=yfe(),wfe=(...o)=>{const s=o[0],i=o[1];f.onMounted(()=>{cne.on(s,i)}),f.onBeforeUnmount(()=>{cne.off(s)})},xoe=()=>(...s)=>{cne.emit(...s)};let O0=null;function hMe(o){const{onSelected:s}=o,{selectedNodes:i,setSelectedNodes:u}=Pf();return f.watch(()=>i,()=>{O0==null||O0({data:i.value}),s==null||s(f.toValue(i))},{deep:!0}),wfe("selectNodes",h=>{const{data:b,callback:C=null,mode:x="multiple"}=h;setTimeout(()=>{u(f.toValue(b)),O0=C},100)}),{onBlur:()=>{O0&&(O0==null||O0({data:i.value,type:"blur"}),O0=null,u([]))}}}const vMe={class:"relative"},bMe=f.defineComponent({__name:"index",props:{hasContextMenu:{type:Boolean,default:!1}},setup(o){const{containerRef:s,uiReady:i}=Pf(),{nodes:u,modelValue:m}=j0(),{showContextMenu:h,contextMenuStyle:b,onContextMenu:C}=gMe(),x=f.ref(null),_=L=>{let j=null;if(Soe(L))j=mfe(L.nodePath,f.toValue(s)),j&&j.classList.add("node-item-td");else{const J=document.createElement("span");J.setAttribute("contenteditable","false"),J.classList.add("node-item"),j=J,$6e(L,j,s.value)}return j&&D6e(j,L),j},N=()=>{const L=fxe(u.value,[j=>j.nodePath,j=>j.textNodeIndex,j=>j.startOffset??-1,j=>j.subNodeSort],["asc","desc","desc","desc"]);L==null||L.forEach(j=>{_(j)})};f.watch(()=>[u,m,x],()=>{x.value&&(i.value=!1,f.nextTick(()=>{x.value&&(x.value.innerHTML=m,N(),i.value=!0)}))},{deep:!0,immediate:!0});const O=f.ref(),{onBlur:B}=hMe({onSelected:()=>{var L;(L=O.value)==null||L.focus()}});return(L,j)=>(f.openBlock(),f.createElementBlock("div",vMe,[f.createVNode(yoe,{onOnBlur:f.unref(B),ref_key:"shadowDomRef",ref:O},{default:f.withCtx(()=>[f.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:s,onContextmenu:j[0]||(j[0]=f.withModifiers((...J)=>f.unref(C)&&f.unref(C)(...J),["prevent"]))},[f.createElementVNode("body",{ref_key:"bodyRef",ref:x},null,512)],544)]),_:1},8,["onOnBlur"]),o.hasContextMenu?(f.openBlock(),f.createBlock(pMe,{key:0,show:f.unref(h),"onUpdate:show":j[1]||(j[1]=J=>f.isRef(h)?h.value=J:null),style:f.normalizeStyle(f.unref(b))},null,8,["show","style"])):f.createCommentVNode("",!0)]))}}),Yie={A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},B3:{width:353,height:500},B4:{width:257,height:364},B5:{width:176,height:250}},yMe={class:"pagesize"},wMe=f.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"}},setup(o){const s=o,i=f.computed(()=>{const u=Yie[s.pagesize]||Yie.A4,m=(window.devicePixelRatio||1)*96;return u.width*m/25.4});return(u,m)=>(f.openBlock(),f.createElementBlock("div",yMe,[f.createElementVNode("div",{style:f.normalizeStyle({width:`${i.value}px`}),class:"pagesize-content"},[f.renderSlot(u.$slots,"default",{},void 0,!0)],4)]))}}),CMe=$i(wMe,[["__scopeId","data-v-46808dfa"]]),Cfe=f.defineComponent({__name:"index",props:f.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},pagesize:{type:String,default:"A4"},renderType:{type:String,default:"preview"},formData:{type:Object,default:()=>({})},inputTypes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},id:{type:String,default:""}},{selectedNodes:{default:[]},selectedNodesModifiers:{}}),emits:f.mergeModels(["update:nodes","update:formData","onSelectedNodes"],["update:selectedNodes"]),setup(o,{expose:s,emit:i}){const u=o,m=i,h=f.useModel(o,"selectedNodes"),b=f.ref(),C=f.ref(),x=f.computed(()=>{switch(u.renderType){case"edit":return eMe;case"select":return nMe;case"preview":return qie;case"enter":return tMe;default:return qie}}),_=B=>{m("update:nodes",B)},N=B=>{m("update:formData",B)},O=B=>{m("onSelectedNodes",B)};return s({formRef:{validate:()=>{var B,L,j;return(j=(L=(B=b.value)==null?void 0:B.formRef)==null?void 0:L.validate)==null?void 0:j.call(L)}},setSelectedNodes:B=>{var L,j;(j=(L=C.value)==null?void 0:L.setSelectedNodes)==null||j.call(L,B)}}),(B,L)=>(f.openBlock(),f.createBlock(CMe,{pagesize:o.pagesize},{default:f.withCtx(()=>[f.createVNode(aMe,{ref_key:"UIRef",ref:C,nodes:o.nodes,"onUpdate:nodes":_,selectedNodes:h.value,"onUpdate:selectedNodes":L[0]||(L[0]=j=>h.value=j),onOnSelectedNodes:O,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id},{default:f.withCtx(()=>[f.createVNode(oMe,{renderType:o.renderType,"model-value":o.modelValue,nodes:o.nodes,"onUpdate:nodes":_,formData:o.formData,"onUpdate:formData":N,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id},{default:f.withCtx(()=>[f.createVNode(bMe,{hasContextMenu:o.renderType==="edit"},null,8,["hasContextMenu"]),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(x.value),{renderType:o.renderType,pagesize:o.pagesize,ref_key:"contentRef",ref:b},{nodeItem:f.withCtx(j=>[f.renderSlot(B.$slots,"nodeItem",{node:j==null?void 0:j.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId"])]),_:3},8,["pagesize"]))}}),SMe={class:"nodes-text"},xMe={key:0,class:"node-text-input"},EMe={key:1,class:"node-text-td"},_Me={key:0,class:"node-text-table-index"},kMe=f.defineComponent({__name:"index",props:f.mergeModels({editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.useModel(o,"modelValue"),u=xU(s==null?void 0:s.editorId),m=f.computed(()=>{var b,C,x,_,N,O;if(((b=f.toValue(h))==null?void 0:b.length)>0)if((x=(C=f.toValue(h))==null?void 0:C[0])!=null&&x.element){const B=(N=(_=f.toValue(h))==null?void 0:_[0])==null?void 0:N.element.closest("body").querySelectorAll("table");return((O=Array.from(B))==null?void 0:O.length)===1}else return!0;else return!0}),h=f.computed(()=>{var b;return pfe(i.value,((b=f.toValue(u))==null?void 0:b.renderNodes)||[])});return(b,C)=>(f.openBlock(),f.createElementBlock("div",SMe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(h.value,(x,_)=>{var N,O,B;return f.openBlock(),f.createElementBlock("div",{key:_,class:"node-text-item"},[(x==null?void 0:x.showTextType)==="input"?(f.openBlock(),f.createElementBlock("span",xMe," 填写"+f.toDisplayString(x==null?void 0:x.inputIndex),1)):(f.openBlock(),f.createElementBlock("span",EMe,[m.value?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("span",_Me,f.toDisplayString(`表${(N=x==null?void 0:x.min)==null?void 0:N.tableIndex}.`),1)),f.createTextVNode(" "+f.toDisplayString(((O=x==null?void 0:x.min)==null?void 0:O.id)===((B=x==null?void 0:x.max)==null?void 0:B.id)?f.unref(t4)(x==null?void 0:x.min):`${f.unref(t4)(x==null?void 0:x.min)}:${f.unref(t4)(x==null?void 0:x.max)}`),1)]))])}),128))]))}}),Kie=$i(kMe,[["__scopeId","data-v-67e3a210"]]);function TMe(o){const{nodes:s,mode:i="multiple"}=o,u=f.ref(!1),m=xoe();return{isSelecting:u,selectNodes:()=>{if(u.value)return!1;u.value=!0,m("selectNodes",{data:f.toValue(s),mode:i,callback:({data:b,type:C})=>{s.value=b,C==="blur"&&(u.value=!1)}})}}}const HA=["#ff9b40","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],EH=f.ref(0),eE=new Map,AMe={key:0,class:"node-select-small gap-x-2"},NMe={key:1,class:"text-[#999]"},OMe={key:1,class:"node-select"},$Me={class:"flex py-2 px-2 justify-between items-center noder-select-header"},DMe={class:"flex gap-2"},MMe={class:"flex gap-1"},RMe=f.defineComponent({__name:"index",props:f.mergeModels({mode:{type:String,default:"multiple"},color:{type:String},id:{type:String,default:""},editorId:{type:String,default:""},size:{type:String,default:"default"},label:{type:String,default:"点击选择"}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.ref((eE==null?void 0:eE[s==null?void 0:s.id])||0),u=f.ref((s==null?void 0:s.id)||yE()),m=f.useModel(o,"modelValue"),{selectNodes:h,isSelecting:b}=TMe({nodes:m,mode:s.mode}),C=()=>{m.value=[]},x=f.computed(()=>s.color||(HA==null?void 0:HA[f.toValue(i)%(HA==null?void 0:HA.length)])||"#409eff");return f.onMounted(()=>{axe(eE==null?void 0:eE[s==null?void 0:s.id])&&(s!=null&&s.id)&&(eE[s==null?void 0:s.id]=EH.value,i.value=EH.value,EH.value=EH.value+1)}),rMe({id:u.value,editorId:s.editorId,nodes:m,activated:b,color:x}),(_,N)=>{var O;return s.size==="small"?(f.openBlock(),f.createElementBlock("div",AMe,[f.createElementVNode("div",{style:f.normalizeStyle({"--node-color":x.value}),class:"node-color cursor-pointer"},null,4),f.createElementVNode("div",null,f.toDisplayString(s.label),1),f.createElementVNode("div",{style:f.normalizeStyle(f.unref(b)?{color:"#409eff"}:{}),onClick:N[0]||(N[0]=(...B)=>f.unref(h)&&f.unref(h)(...B))},N[6]||(N[6]=[f.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer"},null,-1)]),4),f.createElementVNode("div",{class:"flex items-center flex-wrap gap-1 cursor-pointer",onClick:N[2]||(N[2]=(...B)=>f.unref(h)&&f.unref(h)(...B))},[((O=m.value)==null?void 0:O.length)>0?(f.openBlock(),f.createBlock(Kie,{key:0,modelValue:m.value,"onUpdate:modelValue":N[1]||(N[1]=B=>m.value=B),editorId:o.editorId},null,8,["modelValue","editorId"])):(f.openBlock(),f.createElementBlock("div",NMe,"未设置"))])])):(f.openBlock(),f.createElementBlock("div",OMe,[f.createElementVNode("div",$Me,[f.createElementVNode("div",DMe,[f.createElementVNode("div",{style:f.normalizeStyle({"--node-color":x.value}),class:"node-color cursor-pointer"},null,4),f.createElementVNode("div",{style:f.normalizeStyle(f.unref(b)?{color:"#409eff"}:{})},[f.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:N[3]||(N[3]=(...B)=>f.unref(h)&&f.unref(h)(...B))})],4),f.createElementVNode("div",null,[f.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})])]),f.createElementVNode("div",MMe,[N[8]||(N[8]=f.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),f.createElementVNode("div",null,[f.createVNode(f.unref(Bn.ElPopover),{placement:"top-start",width:200,trigger:"hover",content:"this is content, this is content, this is content"},{reference:f.withCtx(()=>N[7]||(N[7]=[f.createElementVNode("div",{class:"flex flex-center"},[f.createElementVNode("div",{class:"i-bi:info-circle-fill mr-2"}),f.createTextVNode(" 使用帮助 ")],-1)])),_:1})])])]),f.createElementVNode("div",{class:"min-h-[42px] px-2 py-1",onClick:N[5]||(N[5]=(...B)=>f.unref(h)&&f.unref(h)(...B))},[f.createVNode(Kie,{modelValue:m.value,"onUpdate:modelValue":N[4]||(N[4]=B=>m.value=B),editorId:o.editorId},null,8,["modelValue","editorId"])])]))}}}),Sfe=$i(RMe,[["__scopeId","data-v-4ab41798"]]);function BMe(o){if(!o.startsWith("="))return[];const s=[];let i=1;for(o.startsWith("=")&&s.push({type:"startOperator",value:"="});i<o.length;){const u=o[i];if(/\s/.test(u)){i++;continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];if(i<o.length&&o[i]===":"){i++;let h="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)h+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)h+=o[i++];s.push({type:"range",value:`${m}:${h}`});continue}else{s.push({type:"cell",value:m});continue}}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(/[A-Za-z]/.test(u)){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];if(["AVERAGE","AVEDEV","SUM","IF","COUNT","MAX","MIN","SQRT"].includes(m.toUpperCase())&&o[i]==="("){s.push({type:"function",value:m});continue}i-=m.length}if(/\d/.test(u)){let m="";for(;i<o.length&&(/\d/.test(o[i])||o[i]===".");)m+=o[i++];s.push({type:"number",value:m});continue}if(u==='"'){let m="";for(m+=u,i++;i<o.length&&o[i]!=='"';)m+=o[i++];m+=u,i++,s.push({type:"string",value:m});continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(u===":"){s.push({type:"operator",value:":"}),i++;continue}if(/[+\-*/=><]/.test(u)){s.push({type:"operator",value:u}),i++;continue}if(/[()]/.test(u)){s.push({type:"paren",value:u}),i++;continue}if(u===","){s.push({type:"separator",value:","}),i++;continue}i++}return s}function IMe(o,s){const i=[];let u=0;for(;u<o.length;){let m=!1;for(const h of s){const b=h.value;if(o.startsWith(b,u)){i.push({type:h.type,value:b,...h.cellValue?{cellValue:h.cellValue}:{}}),u+=b.length,m=!0;break}}m||(i.push({type:"plain",value:o[u]}),u++)}return i}function PMe(o){const s=xU(o.editorId),i=(b,C)=>{let x=[];const _=Math.min(b.colIndex,C.colIndex),N=Math.max(b.colIndex,C.colIndex),O=Math.min(b.rowIndex,C.rowIndex),B=Math.max(b.rowIndex,C.rowIndex);for(let L=O;L<=B;L++)for(let j=_;j<=N;j++)x.push({colIndex:j,rowIndex:L});return x},u=b=>{var N;const C=b.includes(":");let x=[];if(C){const[O,B]=b.split(":").map(L=>h(L));x=i(O,B)}else x=[h(b)];return m(x,f.toValue((N=f.toValue(s))==null?void 0:N.nodes))},m=(b,C)=>C==null?void 0:C.filter(x=>{const _=x.nodePath.split(" > ");let N=1,O=1;return _.forEach(B=>{if(B.startsWith("tr")){const L=B.match(/tr(?::nth-child\((\d+)\))?/);L&&L[1]&&(N=parseInt(L[1]))}else if(B.startsWith("td")){const L=B.match(/td(?::nth-child\((\d+)\))?/);L&&(O=L[1]?parseInt(L[1]):1)}}),b.some(B=>N===B.rowIndex+1&&O===B.colIndex+1)}),h=b=>{if(!b)return{colIndex:-1,rowIndex:-1};const C=b.match(/^([A-Za-z]+)(\d+)$/);if(!C)return{colIndex:-1,rowIndex:-1};const x=C[1].toUpperCase(),_=parseInt(C[2]);let N=0;for(let O=0;O<x.length;O++)N=N*26+(x.charCodeAt(O)-64);return{colIndex:N-1,rowIndex:_}};return{getCellValue:u}}const Xie=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function FMe(o,s,i){const u=f.ref(null),m=f.ref(null);function h(){return o.value&&o.value.textContent||""}f.onMounted(()=>{o.value&&(u.value=()=>{const C=h();s.value=C},m.value=()=>{const C=h();s.value=C},o.value.addEventListener("input",u.value),o.value.addEventListener("blur",m.value))}),f.onUnmounted(()=>{o.value&&(u.value&&o.value.removeEventListener("input",u.value),m.value&&o.value.removeEventListener("blur",m.value))});const b=C=>{var x,_,N,O;if(C>=0){const B=window.getSelection();if(B){const L=B.getRangeAt(0),j=((x=L.startContainer)==null?void 0:x.nodeName)==="#text"?L.startContainer:(N=(_=L.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],J=Math.min(C,((O=j.textContent)==null?void 0:O.length)||0);L.setStart(j,J)}}};return f.watch(()=>[s,o],()=>{var C;o.value&&(di((C=o.value)==null?void 0:C.textContent,f.toValue(s))||(o.value.textContent=f.toValue(s),b(f.toValue(i))))},{deep:!0,immediate:!0}),{getFormulaContent:h}}function Eoe(o){const{element:s,onFocus:i,onBlur:u}=o,m=f.ref(!1),h=()=>{m.value=!0,i==null||i()},b=()=>{m.value=!1,u==null||u()};return f.onMounted(()=>{var C,x;f.toValue(s)&&((C=f.toValue(s))==null||C.addEventListener("focus",h),(x=f.toValue(s))==null||x.addEventListener("blur",b))}),f.onUnmounted(()=>{var C,x;f.toValue(s)&&((C=f.toValue(s))==null||C.removeEventListener("focus",h),(x=f.toValue(s))==null||x.removeEventListener("blur",b))}),m}function LMe(o){const{element:s,showStr:i,editorId:u}=o,m=xU(u),h=Eoe({element:s}),b=f.computed(()=>{var C;return(C=i==null?void 0:i.value)==null?void 0:C.filter(x=>["range","cell"].includes(x.type))});return f.watch(()=>h,()=>{var x,_,N,O,B,L;const C=j=>{var J;j.preventDefault(),(J=f.toValue(s))==null||J.focus()};f.toValue(h)?((x=f.toValue(m))==null||x.containerRef.addEventListener("click",C),(_=f.toValue(m))==null||_.containerRef.addEventListener("mousedown",C),(N=document.querySelectorAll(".select-function"))==null||N.forEach(j=>{j.addEventListener("click",C),j.addEventListener("mousedown",C)})):((O=f.toValue(m))==null||O.containerRef.removeEventListener("click",C),(B=f.toValue(m))==null||B.containerRef.removeEventListener("mousedown",C),(L=document.querySelectorAll(".select-function"))==null||L.forEach(j=>{j.removeEventListener("click",C),j.removeEventListener("mousedown",C)}))},{deep:!0}),f.watch(()=>[h,b],()=>{var C,x,_,N,O;if((C=f.toValue(m))!=null&&C.containerRef&&((N=(_=(x=f.toValue(m))==null?void 0:x.containerRef)==null?void 0:_.querySelectorAll(".node-formula-cell"))==null||N.forEach(B=>{B.classList.remove("node-formula-cell")}),f.toValue(h))){let B=[];(O=b.value)!=null&&O.length&&(b.value.forEach(L=>{var j;B=[...B,...((j=L==null?void 0:L.cellValue)==null?void 0:j.map(J=>({color:L==null?void 0:L.color,backgroundColor:Coe((L==null?void 0:L.color)||"#000",.1),element:J==null?void 0:J.element})))||[]]}),B.forEach(L=>{var j;L!=null&&L.element&&((j=L==null?void 0:L.element)==null||j.classList.add("node-formula-cell"),L==null||L.element.style.setProperty("--formula-node-color",L==null?void 0:L.color),L==null||L.element.style.setProperty("--formula-node-bg-color",L==null?void 0:L.backgroundColor))}))}},{deep:!0}),h}const VMe=o=>{const{element:s}=o,i=f.ref(-1),u=C=>{const x=C==null?void 0:C.getSelection();try{if(x)return x.getRangeAt(0).startOffset}catch{}return 0},m=()=>{var x;const C=(x=s.value)==null?void 0:x.getRootNode();i.value=u(C)},h=C=>{var O;const x=C.target,_=(O=s.value)==null?void 0:O.getRootNode();i.value=u(_),x.addEventListener("click",m),x.addEventListener("keyup",B=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(B.key)&&m()});const N=()=>{x.removeEventListener("click",m),x.removeEventListener("keyup",m),x.removeEventListener("blur",N),setTimeout(()=>{i.value=-1},300)};x.addEventListener("blur",N)},b=()=>{var C;(C=s.value)==null||C.addEventListener("focus",h,!0)};return f.watch(s,C=>{C&&b()},{immediate:!0}),f.onUnmounted(()=>{var C;(C=s.value)==null||C.removeEventListener("focus",h,!0)}),{startOffset:i}};function HMe(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const zMe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},UMe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,x=xU(m),_=f.ref(-1),N=f.ref(0),O=Eoe({element:C}),B=f.ref(!1),L=xoe(),j=J=>{var Y,ne;if(f.toValue(B)&&f.toValue(O)&&!di((Y=f.toValue(b))==null?void 0:Y.cellValue,J)){const K=V6e(J,((ne=f.toValue(x))==null?void 0:ne.nodes)||"");let W=K;K&&(f.toValue(N)===0&&(W+=","),f.toValue(_)>=0&&(u.value=HMe(f.toValue(u),f.toValue(_),f.toValue(N),W),N.value=K.length))}};f.watch(()=>h,()=>{var J,Y,ne,K,W,Se;if((J=x.value)==null||J.setSelectedNodes([]),["range","cell"].includes((Y=f.toValue(b))==null?void 0:Y.type))return _.value=zMe(i.value,h.value),N.value=(K=(ne=f.toValue(b))==null?void 0:ne.value)==null?void 0:K.length,B.value=!0,L("selectNodes",{data:(W=f.toValue(b))==null?void 0:W.cellValue,mode:"multiple",callback:({data:ut})=>{j(ut)}}),!1;if([",","(","="].includes((Se=f.toValue(b))==null?void 0:Se.value))return _.value=f.toValue(s),B.value=!0,N.value=0,L("selectNodes",{data:[],mode:"multiple",callback:({data:ut})=>{j(ut)}}),!1;B.value=!1,_.value=-1},{immediate:!0,deep:!0})},jMe=o=>{const{startOffset:s,showStr:i}=o,u=f.ref(-1);f.watch(()=>s,()=>{var h;if(f.toValue(s)<=0)u.value=-1;else{let b=0;for(let C=0;C<i.value.length;C++){const x=i.value[C];if(b+=(h=x==null?void 0:x.value)==null?void 0:h.length,b>=f.toValue(s)){u.value=C;break}}}},{deep:!0,immediate:!0});const m=f.computed(()=>{var h;return(h=f.toValue(i))==null?void 0:h[f.toValue(u)]});return{currentItemIndex:u,currentItem:m}};function WMe(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const ZMe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},GMe=o=>{const{startOffset:s,showStr:i,value:u,currentItemIndex:m,currentItem:h,element:b}=o,C=f.ref(-1),x=f.ref(0),_=Eoe({element:b}),N=f.ref(!1),O=xoe(),B=L=>{var j;if(f.toValue(N)&&f.toValue(_)&&!di((j=f.toValue(h))==null?void 0:j.value,L)){const J=L,Y=J;J&&f.toValue(C)>=0&&(u.value=WMe(f.toValue(u),f.toValue(C),f.toValue(x),Y),x.value=J.length)}};f.watch(()=>m,()=>{var L,j,J,Y,ne;if(["function"].includes((L=f.toValue(h))==null?void 0:L.type))return C.value=ZMe(i.value,m.value),x.value=(J=(j=f.toValue(h))==null?void 0:j.value)==null?void 0:J.length,N.value=!0,O("selectFunction",{data:(Y=f.toValue(h))==null?void 0:Y.value,callback:({data:K})=>{console.log(K),B(K)}}),!1;if([",","(","="].includes((ne=f.toValue(h))==null?void 0:ne.value))return C.value=f.toValue(s),N.value=!0,x.value=0,O("selectFunction",{data:"",callback:({data:K})=>{console.log(K),B(K)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},qMe={class:"node-formula"},YMe={class:"node-formula-show"},KMe=f.defineComponent({__name:"index",props:f.mergeModels({id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{getCellValue:i}=PMe({editorId:s==null?void 0:s.editorId}),u=f.useModel(o,"modelValue"),m=f.ref(),{startOffset:h}=VMe({element:m});FMe(m,u,h);const b=f.computed(()=>{const N=BMe(u.value);return N==null?void 0:N.map(B=>B.type==="cell"||B.type==="range"?{cellValue:i(B.value),...B}:B)}),C=f.computed(()=>{const N=IMe(u.value,b.value);let O=-1;return N.map(L=>(L==null?void 0:L.type)==="cell"||(L==null?void 0:L.type)==="range"?(O++,{...L,color:Xie[O%Xie.length]}):(L==null?void 0:L.type)==="function"?{...L,color:"#0318ff"}:L)});LMe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:x,currentItem:_}=jMe({element:m,startOffset:h,value:u,showStr:C});return UMe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:x,currentItem:_}),GMe({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:x,currentItem:_}),(N,O)=>(f.openBlock(),f.createElementBlock("div",qMe,[f.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),f.createElementVNode("div",YMe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C.value,(B,L)=>(f.openBlock(),f.createElementBlock("span",{key:L,class:f.normalizeClass(["node-formula-item",`node-formula-item-type-${B==null?void 0:B.type}`,L===f.unref(x)?"node-formula-item-active":""]),style:f.normalizeStyle({"--text-color":(B==null?void 0:B.color)||"#000","--bg-color":f.unref(Coe)((B==null?void 0:B.color)||"#000",.1)})},f.toDisplayString(B.value),7))),128))])]))}}),xfe=$i(KMe,[["__scopeId","data-v-f4b96eb4"]]),XMe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],JMe={class:"select-function"},QMe=["onClick"],eRe={class:"function-item"},tRe={class:"function-item-desc"},nRe=f.defineComponent({__name:"index",props:f.mergeModels({id:{type:String,default:""},functionList:{type:Array,default:()=>[]}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o;let i=null;const u=f.computed(()=>{var b;return((b=s.functionList)==null?void 0:b.length)>0?s.functionList:XMe}),m=f.useModel(o,"modelValue"),h=b=>{m.value=b,i==null||i({data:b})};return wfe("selectFunction",({data:b,callback:C})=>{i=C,m.value=b}),(b,C)=>(f.openBlock(),f.createElementBlock("div",JMe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(u.value,(x,_)=>(f.openBlock(),f.createElementBlock("div",{key:_},[f.createElementVNode("div",{onClick:()=>{h(x.value)},class:f.normalizeClass(["function-item-wrapper",{active:m.value===x.value}])},[f.createElementVNode("div",eRe,f.toDisplayString(x.value),1),f.createElementVNode("div",tRe,f.toDisplayString(x.label),1)],10,QMe)]))),128))]))}}),Efe=$i(nRe,[["__scopeId","data-v-6e079ff0"]]),oRe=["innerHTML"],_fe=f.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue");return(i,u)=>(f.openBlock(),f.createBlock(yoe,null,{default:f.withCtx(()=>[f.createElementVNode("div",{innerHTML:s.value},null,8,oRe)]),_:1}))}});function EU(o){return f.getCurrentScope()?(f.onScopeDispose(o),!0):!1}function R0(o){return typeof o=="function"?o():f.unref(o)}const sRe=typeof window<"u"&&typeof document<"u",rRe=o=>typeof o<"u",aRe=Object.prototype.toString,iRe=o=>aRe.call(o)==="[object Object]",lRe=()=>{};function cRe(o,s){function i(...u){return new Promise((m,h)=>{Promise.resolve(o(()=>s.apply(this,u),{fn:s,thisArg:this,args:u})).then(m).catch(h)})}return i}const kfe=o=>o();function uRe(o=kfe){const s=f.ref(!0);function i(){s.value=!1}function u(){s.value=!0}const m=(...h)=>{s.value&&o(...h)};return{isActive:f.readonly(s),pause:i,resume:u,eventFilter:m}}function Jie(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function dRe(o,s,i={}){const{eventFilter:u=kfe,...m}=i;return f.watch(o,cRe(u,s),m)}function zA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:x}=uRe(u);return{stop:dRe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:x}}function fRe(o,s={}){if(!f.isRef(o))return f.toRefs(o);const i=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const u in o.value)i[u]=f.customRef(()=>({get(){return o.value[u]},set(m){var h;if((h=R0(s.replaceRef))!=null?h:!0)if(Array.isArray(o.value)){const C=[...o.value];C[u]=m,o.value=C}else{const C={...o.value,[u]:m};Object.setPrototypeOf(C,Object.getPrototypeOf(o.value)),o.value=C}else o.value[u]=m}}));return i}function une(o,s=!1){function i(O,{flush:B="sync",deep:L=!1,timeout:j,throwOnTimeout:J}={}){let Y=null;const K=[new Promise(W=>{Y=f.watch(o,Se=>{O(Se)!==s&&(Y==null||Y(),W(Se))},{flush:B,deep:L,immediate:!0})})];return j!=null&&K.push(Jie(j,J).then(()=>R0(o)).finally(()=>Y==null?void 0:Y())),Promise.race(K)}function u(O,B){if(!f.isRef(O))return i(Se=>Se===O,B);const{flush:L="sync",deep:j=!1,timeout:J,throwOnTimeout:Y}=B??{};let ne=null;const W=[new Promise(Se=>{ne=f.watch([o,O],([ut,Le])=>{s!==(ut===Le)&&(ne==null||ne(),Se(ut))},{flush:L,deep:j,immediate:!0})})];return J!=null&&W.push(Jie(J,Y).then(()=>R0(o)).finally(()=>(ne==null||ne(),R0(o)))),Promise.race(W)}function m(O){return i(B=>!!B,O)}function h(O){return u(null,O)}function b(O){return u(void 0,O)}function C(O){return i(Number.isNaN,O)}function x(O,B){return i(L=>{const j=Array.from(L);return j.includes(O)||j.includes(R0(O))},B)}function _(O){return N(1,O)}function N(O=1,B){let L=-1;return i(()=>(L+=1,L>=O),B)}return Array.isArray(R0(o))?{toMatch:i,toContains:x,changed:_,changedTimes:N,get not(){return une(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return une(o,!s)}}}function dne(o){return une(o)}function mRe(o){var s;const i=R0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const Tfe=sRe?window:void 0;function Afe(...o){let s,i,u,m;if(typeof o[0]=="string"||Array.isArray(o[0])?([i,u,m]=o,s=Tfe):[s,i,u,m]=o,!s)return lRe;Array.isArray(i)||(i=[i]),Array.isArray(u)||(u=[u]);const h=[],b=()=>{h.forEach(N=>N()),h.length=0},C=(N,O,B,L)=>(N.addEventListener(O,B,L),()=>N.removeEventListener(O,B,L)),x=f.watch(()=>[mRe(s),R0(m)],([N,O])=>{if(b(),!N)return;const B=iRe(O)?{...O}:O;h.push(...i.flatMap(L=>u.map(j=>C(N,L,j,B))))},{immediate:!0,flush:"post"}),_=()=>{x(),b()};return EU(_),_}function pRe(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function Qie(...o){let s,i,u={};o.length===3?(s=o[0],i=o[1],u=o[2]):o.length===2?typeof o[1]=="object"?(s=!0,i=o[0],u=o[1]):(s=o[0],i=o[1]):(s=!0,i=o[0]);const{target:m=Tfe,eventName:h="keydown",passive:b=!1,dedupe:C=!1}=u,x=pRe(s);return Afe(m,h,N=>{N.repeat&&R0(C)||x(N)&&i(N)},b)}function gRe(o){return JSON.parse(JSON.stringify(o))}function rte(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:x=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:B}=u,L=f.getCurrentInstance(),j=i||(L==null?void 0:L.emit)||((m=L==null?void 0:L.$emit)==null?void 0:m.bind(L))||((b=(h=L==null?void 0:L.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(L==null?void 0:L.proxy));let J=_;s||(s="modelValue"),J=J||`update:${s.toString()}`;const Y=W=>C?typeof C=="function"?C(W):gRe(W):W,ne=()=>rRe(o[s])?Y(o[s]):O,K=W=>{B?B(W)&&j(J,W):j(J,W)};if(x){const W=ne(),Se=f.ref(W);let ut=!1;return f.watch(()=>o[s],Le=>{ut||(ut=!0,Se.value=Y(Le),f.nextTick(()=>ut=!1))}),f.watch(Se,Le=>{!ut&&(Le!==o[s]||N)&&K(Le)},{deep:N}),Se}else return f.computed({get(){return ne()},set(W){K(W)}})}var hRe={value:()=>{}};function _U(){for(var o=0,s=arguments.length,i={},u;o<s;++o){if(!(u=arguments[o]+"")||u in i||/[\s.]/.test(u))throw new Error("illegal type: "+u);i[u]=[]}return new YH(i)}function YH(o){this._=o}function vRe(o,s){return o.trim().split(/^|\s+/).map(function(i){var u="",m=i.indexOf(".");if(m>=0&&(u=i.slice(m+1),i=i.slice(0,m)),i&&!s.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:u}})}YH.prototype=_U.prototype={constructor:YH,on:function(o,s){var i=this._,u=vRe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=bRe(i[m],o.name)))return m;return}if(s!=null&&typeof s!="function")throw new Error("invalid callback: "+s);for(;++h<b;)if(m=(o=u[h]).type)i[m]=ele(i[m],o.name,s);else if(s==null)for(m in i)i[m]=ele(i[m],o.name,null);return this},copy:function(){var o={},s=this._;for(var i in s)o[i]=s[i].slice();return new YH(o)},call:function(o,s){if((m=arguments.length-2)>0)for(var i=new Array(m),u=0,m,h;u<m;++u)i[u]=arguments[u+2];if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(h=this._[o],u=0,m=h.length;u<m;++u)h[u].value.apply(s,i)},apply:function(o,s,i){if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(var u=this._[o],m=0,h=u.length;m<h;++m)u[m].value.apply(s,i)}};function bRe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function ele(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=hRe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var fne="http://www.w3.org/1999/xhtml";const tle={svg:"http://www.w3.org/2000/svg",xhtml:fne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function kU(o){var s=o+="",i=s.indexOf(":");return i>=0&&(s=o.slice(0,i))!=="xmlns"&&(o=o.slice(i+1)),tle.hasOwnProperty(s)?{space:tle[s],local:o}:o}function yRe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===fne&&s.documentElement.namespaceURI===fne?s.createElement(o):s.createElementNS(i,o)}}function wRe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Nfe(o){var s=kU(o);return(s.local?wRe:yRe)(s)}function CRe(){}function _oe(o){return o==null?CRe:function(){return this.querySelector(o)}}function SRe(o){typeof o!="function"&&(o=_oe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=new Array(b),x,_,N=0;N<b;++N)(x=h[N])&&(_=o.call(x,x.__data__,N,h))&&("__data__"in x&&(_.__data__=x.__data__),C[N]=_);return new Sp(u,this._parents)}function xRe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function ERe(){return[]}function Ofe(o){return o==null?ERe:function(){return this.querySelectorAll(o)}}function _Re(o){return function(){return xRe(o.apply(this,arguments))}}function kRe(o){typeof o=="function"?o=_Re(o):o=Ofe(o);for(var s=this._groups,i=s.length,u=[],m=[],h=0;h<i;++h)for(var b=s[h],C=b.length,x,_=0;_<C;++_)(x=b[_])&&(u.push(o.call(x,x.__data__,_,b)),m.push(x));return new Sp(u,m)}function $fe(o){return function(){return this.matches(o)}}function Dfe(o){return function(s){return s.matches(o)}}var TRe=Array.prototype.find;function ARe(o){return function(){return TRe.call(this.children,o)}}function NRe(){return this.firstElementChild}function ORe(o){return this.select(o==null?NRe:ARe(typeof o=="function"?o:Dfe(o)))}var $Re=Array.prototype.filter;function DRe(){return Array.from(this.children)}function MRe(o){return function(){return $Re.call(this.children,o)}}function RRe(o){return this.selectAll(o==null?DRe:MRe(typeof o=="function"?o:Dfe(o)))}function BRe(o){typeof o!="function"&&(o=$fe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],x,_=0;_<b;++_)(x=h[_])&&o.call(x,x.__data__,_,h)&&C.push(x);return new Sp(u,this._parents)}function Mfe(o){return new Array(o.length)}function IRe(){return new Sp(this._enter||this._groups.map(Mfe),this._parents)}function xz(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}xz.prototype={constructor:xz,appendChild:function(o){return this._parent.insertBefore(o,this._next)},insertBefore:function(o,s){return this._parent.insertBefore(o,s)},querySelector:function(o){return this._parent.querySelector(o)},querySelectorAll:function(o){return this._parent.querySelectorAll(o)}};function PRe(o){return function(){return o}}function FRe(o,s,i,u,m,h){for(var b=0,C,x=s.length,_=h.length;b<_;++b)(C=s[b])?(C.__data__=h[b],u[b]=C):i[b]=new xz(o,h[b]);for(;b<x;++b)(C=s[b])&&(m[b]=C)}function LRe(o,s,i,u,m,h,b){var C,x,_=new Map,N=s.length,O=h.length,B=new Array(N),L;for(C=0;C<N;++C)(x=s[C])&&(B[C]=L=b.call(x,x.__data__,C,s)+"",_.has(L)?m[C]=x:_.set(L,x));for(C=0;C<O;++C)L=b.call(o,h[C],C,h)+"",(x=_.get(L))?(u[C]=x,x.__data__=h[C],_.delete(L)):i[C]=new xz(o,h[C]);for(C=0;C<N;++C)(x=s[C])&&_.get(B[C])===x&&(m[C]=x)}function VRe(o){return o.__data__}function HRe(o,s){if(!arguments.length)return Array.from(this,VRe);var i=s?LRe:FRe,u=this._parents,m=this._groups;typeof o!="function"&&(o=PRe(o));for(var h=m.length,b=new Array(h),C=new Array(h),x=new Array(h),_=0;_<h;++_){var N=u[_],O=m[_],B=O.length,L=zRe(o.call(N,N&&N.__data__,_,u)),j=L.length,J=C[_]=new Array(j),Y=b[_]=new Array(j),ne=x[_]=new Array(B);i(N,O,J,Y,ne,L,s);for(var K=0,W=0,Se,ut;K<j;++K)if(Se=J[K]){for(K>=W&&(W=K+1);!(ut=Y[W])&&++W<j;);Se._next=ut||null}}return b=new Sp(b,u),b._enter=C,b._exit=x,b}function zRe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function URe(){return new Sp(this._exit||this._groups.map(Mfe),this._parents)}function jRe(o,s,i){var u=this.enter(),m=this,h=this.exit();return typeof o=="function"?(u=o(u),u&&(u=u.selection())):u=u.append(o+""),s!=null&&(m=s(m),m&&(m=m.selection())),i==null?h.remove():i(h),u&&m?u.merge(m).order():m}function WRe(o){for(var s=o.selection?o.selection():o,i=this._groups,u=s._groups,m=i.length,h=u.length,b=Math.min(m,h),C=new Array(m),x=0;x<b;++x)for(var _=i[x],N=u[x],O=_.length,B=C[x]=new Array(O),L,j=0;j<O;++j)(L=_[j]||N[j])&&(B[j]=L);for(;x<m;++x)C[x]=i[x];return new Sp(C,this._parents)}function ZRe(){for(var o=this._groups,s=-1,i=o.length;++s<i;)for(var u=o[s],m=u.length-1,h=u[m],b;--m>=0;)(b=u[m])&&(h&&b.compareDocumentPosition(h)^4&&h.parentNode.insertBefore(b,h),h=b);return this}function GRe(o){o||(o=qRe);function s(O,B){return O&&B?o(O.__data__,B.__data__):!O-!B}for(var i=this._groups,u=i.length,m=new Array(u),h=0;h<u;++h){for(var b=i[h],C=b.length,x=m[h]=new Array(C),_,N=0;N<C;++N)(_=b[N])&&(x[N]=_);x.sort(s)}return new Sp(m,this._parents).order()}function qRe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function YRe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function KRe(){return Array.from(this)}function XRe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length;m<h;++m){var b=u[m];if(b)return b}return null}function JRe(){let o=0;for(const s of this)++o;return o}function QRe(){return!this.node()}function eBe(o){for(var s=this._groups,i=0,u=s.length;i<u;++i)for(var m=s[i],h=0,b=m.length,C;h<b;++h)(C=m[h])&&o.call(C,C.__data__,h,m);return this}function tBe(o){return function(){this.removeAttribute(o)}}function nBe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function oBe(o,s){return function(){this.setAttribute(o,s)}}function sBe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function rBe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function aBe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttributeNS(o.space,o.local):this.setAttributeNS(o.space,o.local,i)}}function iBe(o,s){var i=kU(o);if(arguments.length<2){var u=this.node();return i.local?u.getAttributeNS(i.space,i.local):u.getAttribute(i)}return this.each((s==null?i.local?nBe:tBe:typeof s=="function"?i.local?aBe:rBe:i.local?sBe:oBe)(i,s))}function Rfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function lBe(o){return function(){this.style.removeProperty(o)}}function cBe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function uBe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function dBe(o,s,i){return arguments.length>1?this.each((s==null?lBe:typeof s=="function"?uBe:cBe)(o,s,i??"")):f4(this.node(),o)}function f4(o,s){return o.style.getPropertyValue(s)||Rfe(o).getComputedStyle(o,null).getPropertyValue(s)}function fBe(o){return function(){delete this[o]}}function mBe(o,s){return function(){this[o]=s}}function pBe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function gBe(o,s){return arguments.length>1?this.each((s==null?fBe:typeof s=="function"?pBe:mBe)(o,s)):this.node()[o]}function Bfe(o){return o.trim().split(/^|\s+/)}function koe(o){return o.classList||new Ife(o)}function Ife(o){this._node=o,this._names=Bfe(o.getAttribute("class")||"")}Ife.prototype={add:function(o){var s=this._names.indexOf(o);s<0&&(this._names.push(o),this._node.setAttribute("class",this._names.join(" ")))},remove:function(o){var s=this._names.indexOf(o);s>=0&&(this._names.splice(s,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(o){return this._names.indexOf(o)>=0}};function Pfe(o,s){for(var i=koe(o),u=-1,m=s.length;++u<m;)i.add(s[u])}function Ffe(o,s){for(var i=koe(o),u=-1,m=s.length;++u<m;)i.remove(s[u])}function hBe(o){return function(){Pfe(this,o)}}function vBe(o){return function(){Ffe(this,o)}}function bBe(o,s){return function(){(s.apply(this,arguments)?Pfe:Ffe)(this,o)}}function yBe(o,s){var i=Bfe(o+"");if(arguments.length<2){for(var u=koe(this.node()),m=-1,h=i.length;++m<h;)if(!u.contains(i[m]))return!1;return!0}return this.each((typeof s=="function"?bBe:s?hBe:vBe)(i,s))}function wBe(){this.textContent=""}function CBe(o){return function(){this.textContent=o}}function SBe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function xBe(o){return arguments.length?this.each(o==null?wBe:(typeof o=="function"?SBe:CBe)(o)):this.node().textContent}function EBe(){this.innerHTML=""}function _Be(o){return function(){this.innerHTML=o}}function kBe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function TBe(o){return arguments.length?this.each(o==null?EBe:(typeof o=="function"?kBe:_Be)(o)):this.node().innerHTML}function ABe(){this.nextSibling&&this.parentNode.appendChild(this)}function NBe(){return this.each(ABe)}function OBe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $Be(){return this.each(OBe)}function DBe(o){var s=typeof o=="function"?o:Nfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function MBe(){return null}function RBe(o,s){var i=typeof o=="function"?o:Nfe(o),u=s==null?MBe:typeof s=="function"?s:_oe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function BBe(){var o=this.parentNode;o&&o.removeChild(this)}function IBe(){return this.each(BBe)}function PBe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function FBe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function LBe(o){return this.select(o?FBe:PBe)}function VBe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function HBe(o){return function(s){o.call(this,s,this.__data__)}}function zBe(o){return o.trim().split(/^|\s+/).map(function(s){var i="",u=s.indexOf(".");return u>=0&&(i=s.slice(u+1),s=s.slice(0,u)),{type:s,name:i}})}function UBe(o){return function(){var s=this.__on;if(s){for(var i=0,u=-1,m=s.length,h;i<m;++i)h=s[i],(!o.type||h.type===o.type)&&h.name===o.name?this.removeEventListener(h.type,h.listener,h.options):s[++u]=h;++u?s.length=u:delete this.__on}}}function jBe(o,s,i){return function(){var u=this.__on,m,h=HBe(s);if(u){for(var b=0,C=u.length;b<C;++b)if((m=u[b]).type===o.type&&m.name===o.name){this.removeEventListener(m.type,m.listener,m.options),this.addEventListener(m.type,m.listener=h,m.options=i),m.value=s;return}}this.addEventListener(o.type,h,i),m={type:o.type,name:o.name,value:s,listener:h,options:i},u?u.push(m):this.__on=[m]}}function WBe(o,s,i){var u=zBe(o+""),m,h=u.length,b;if(arguments.length<2){var C=this.node().__on;if(C){for(var x=0,_=C.length,N;x<_;++x)for(m=0,N=C[x];m<h;++m)if((b=u[m]).type===N.type&&b.name===N.name)return N.value}return}for(C=s?jBe:UBe,m=0;m<h;++m)this.each(C(u[m],s,i));return this}function Lfe(o,s,i){var u=Rfe(o),m=u.CustomEvent;typeof m=="function"?m=new m(s,i):(m=u.document.createEvent("Event"),i?(m.initEvent(s,i.bubbles,i.cancelable),m.detail=i.detail):m.initEvent(s,!1,!1)),o.dispatchEvent(m)}function ZBe(o,s){return function(){return Lfe(this,o,s)}}function GBe(o,s){return function(){return Lfe(this,o,s.apply(this,arguments))}}function qBe(o,s){return this.each((typeof s=="function"?GBe:ZBe)(o,s))}function*YBe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length,b;m<h;++m)(b=u[m])&&(yield b)}var Vfe=[null];function Sp(o,s){this._groups=o,this._parents=s}function TR(){return new Sp([[document.documentElement]],Vfe)}function KBe(){return this}Sp.prototype=TR.prototype={constructor:Sp,select:SRe,selectAll:kRe,selectChild:ORe,selectChildren:RRe,filter:BRe,data:HRe,enter:IRe,exit:URe,join:jRe,merge:WRe,selection:KBe,order:ZRe,sort:GRe,call:YRe,nodes:KRe,node:XRe,size:JRe,empty:QRe,each:eBe,attr:iBe,style:dBe,property:gBe,classed:yBe,text:xBe,html:TBe,raise:NBe,lower:$Be,append:DBe,insert:RBe,remove:IBe,clone:LBe,datum:VBe,on:WBe,dispatch:qBe,[Symbol.iterator]:YBe};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],Vfe)}function XBe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Nv(o,s){if(o=XBe(o),s===void 0&&(s=o.currentTarget),s){var i=s.ownerSVGElement||s;if(i.createSVGPoint){var u=i.createSVGPoint();return u.x=o.clientX,u.y=o.clientY,u=u.matrixTransform(s.getScreenCTM().inverse()),[u.x,u.y]}if(s.getBoundingClientRect){var m=s.getBoundingClientRect();return[o.clientX-m.left-s.clientLeft,o.clientY-m.top-s.clientTop]}}return[o.pageX,o.pageY]}const JBe={passive:!1},nR={capture:!0,passive:!1};function ate(o){o.stopImmediatePropagation()}function n4(o){o.preventDefault(),o.stopImmediatePropagation()}function Hfe(o){var s=o.document.documentElement,i=Mh(o).on("dragstart.drag",n4,nR);"onselectstart"in s?i.on("selectstart.drag",n4,nR):(s.__noselect=s.style.MozUserSelect,s.style.MozUserSelect="none")}function zfe(o,s){var i=o.document.documentElement,u=Mh(o).on("dragstart.drag",null);s&&(u.on("click.drag",n4,nR),setTimeout(function(){u.on("click.drag",null)},0)),"onselectstart"in i?u.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const _H=o=>()=>o;function mne(o,{sourceEvent:s,subject:i,target:u,identifier:m,active:h,x:b,y:C,dx:x,dy:_,dispatch:N}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},identifier:{value:m,enumerable:!0,configurable:!0},active:{value:h,enumerable:!0,configurable:!0},x:{value:b,enumerable:!0,configurable:!0},y:{value:C,enumerable:!0,configurable:!0},dx:{value:x,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:N}})}mne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function QBe(o){return!o.ctrlKey&&!o.button}function eIe(){return this.parentNode}function tIe(o,s){return s??{x:o.x,y:o.y}}function nIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function oIe(){var o=QBe,s=eIe,i=tIe,u=nIe,m={},h=_U("start","drag","end"),b=0,C,x,_,N,O=0;function B(Se){Se.on("mousedown.drag",L).filter(u).on("touchstart.drag",Y).on("touchmove.drag",ne,JBe).on("touchend.drag touchcancel.drag",K).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function L(Se,ut){if(!(N||!o.call(this,Se,ut))){var Le=W(this,s.call(this,Se,ut),Se,ut,"mouse");Le&&(Mh(Se.view).on("mousemove.drag",j,nR).on("mouseup.drag",J,nR),Hfe(Se.view),ate(Se),_=!1,C=Se.clientX,x=Se.clientY,Le("start",Se))}}function j(Se){if(n4(Se),!_){var ut=Se.clientX-C,Le=Se.clientY-x;_=ut*ut+Le*Le>O}m.mouse("drag",Se)}function J(Se){Mh(Se.view).on("mousemove.drag mouseup.drag",null),zfe(Se.view,_),n4(Se),m.mouse("end",Se)}function Y(Se,ut){if(o.call(this,Se,ut)){var Le=Se.changedTouches,te=s.call(this,Se,ut),We=Le.length,pt,ft;for(pt=0;pt<We;++pt)(ft=W(this,te,Se,ut,Le[pt].identifier,Le[pt]))&&(ate(Se),ft("start",Se,Le[pt]))}}function ne(Se){var ut=Se.changedTouches,Le=ut.length,te,We;for(te=0;te<Le;++te)(We=m[ut[te].identifier])&&(n4(Se),We("drag",Se,ut[te]))}function K(Se){var ut=Se.changedTouches,Le=ut.length,te,We;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),te=0;te<Le;++te)(We=m[ut[te].identifier])&&(ate(Se),We("end",Se,ut[te]))}function W(Se,ut,Le,te,We,pt){var ft=h.copy(),Oe=Nv(pt||Le,ut),ue,Pt,be;if((be=i.call(Se,new mne("beforestart",{sourceEvent:Le,target:B,identifier:We,active:b,x:Oe[0],y:Oe[1],dx:0,dy:0,dispatch:ft}),te))!=null)return ue=be.x-Oe[0]||0,Pt=be.y-Oe[1]||0,function $e(R,Ue,ve){var nt=Oe,tt;switch(R){case"start":m[We]=$e,tt=b++;break;case"end":delete m[We],--b;case"drag":Oe=Nv(ve||Ue,ut),tt=b;break}ft.call(R,Se,new mne(R,{sourceEvent:Ue,subject:be,target:B,identifier:We,active:tt,x:Oe[0]+ue,y:Oe[1]+Pt,dx:Oe[0]-nt[0],dy:Oe[1]-nt[1],dispatch:ft}),te)}}return B.filter=function(Se){return arguments.length?(o=typeof Se=="function"?Se:_H(!!Se),B):o},B.container=function(Se){return arguments.length?(s=typeof Se=="function"?Se:_H(Se),B):s},B.subject=function(Se){return arguments.length?(i=typeof Se=="function"?Se:_H(Se),B):i},B.touchable=function(Se){return arguments.length?(u=typeof Se=="function"?Se:_H(!!Se),B):u},B.on=function(){var Se=h.on.apply(h,arguments);return Se===h?B:Se},B.clickDistance=function(Se){return arguments.length?(O=(Se=+Se)*Se,B):Math.sqrt(O)},B}function Toe(o,s,i){o.prototype=s.prototype=i,i.constructor=o}function Ufe(o,s){var i=Object.create(o.prototype);for(var u in s)i[u]=s[u];return i}function AR(){}var oR=.7,Ez=1/oR,o4="\\s*([+-]?\\d+)\\s*",sR="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sIe=/^#([0-9a-f]{3,8})$/,rIe=new RegExp(`^rgb\\(${o4},${o4},${o4}\\)$`),aIe=new RegExp(`^rgb\\(${Dv},${Dv},${Dv}\\)$`),iIe=new RegExp(`^rgba\\(${o4},${o4},${o4},${sR}\\)$`),lIe=new RegExp(`^rgba\\(${Dv},${Dv},${Dv},${sR}\\)$`),cIe=new RegExp(`^hsl\\(${sR},${Dv},${Dv}\\)$`),uIe=new RegExp(`^hsla\\(${sR},${Dv},${Dv},${sR}\\)$`),nle={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Toe(AR,rR,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:ole,formatHex:ole,formatHex8:dIe,formatHsl:fIe,formatRgb:sle,toString:sle});function ole(){return this.rgb().formatHex()}function dIe(){return this.rgb().formatHex8()}function fIe(){return jfe(this).formatHsl()}function sle(){return this.rgb().formatRgb()}function rR(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=sIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?rle(s):i===3?new xm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?kH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?kH(s>>12&15|s>>8&240,s>>8&15|s>>4&240,s>>4&15|s&240,((s&15)<<4|s&15)/255):null):(s=rIe.exec(o))?new xm(s[1],s[2],s[3],1):(s=aIe.exec(o))?new xm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=iIe.exec(o))?kH(s[1],s[2],s[3],s[4]):(s=lIe.exec(o))?kH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=cIe.exec(o))?lle(s[1],s[2]/100,s[3]/100,1):(s=uIe.exec(o))?lle(s[1],s[2]/100,s[3]/100,s[4]):nle.hasOwnProperty(o)?rle(nle[o]):o==="transparent"?new xm(NaN,NaN,NaN,0):null}function rle(o){return new xm(o>>16&255,o>>8&255,o&255,1)}function kH(o,s,i,u){return u<=0&&(o=s=i=NaN),new xm(o,s,i,u)}function mIe(o){return o instanceof AR||(o=rR(o)),o?(o=o.rgb(),new xm(o.r,o.g,o.b,o.opacity)):new xm}function pne(o,s,i,u){return arguments.length===1?mIe(o):new xm(o,s,i,u??1)}function xm(o,s,i,u){this.r=+o,this.g=+s,this.b=+i,this.opacity=+u}Toe(xm,pne,Ufe(AR,{brighter(o){return o=o==null?Ez:Math.pow(Ez,o),new xm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?oR:Math.pow(oR,o),new xm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new xm(wE(this.r),wE(this.g),wE(this.b),_z(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ale,formatHex:ale,formatHex8:pIe,formatRgb:ile,toString:ile}));function ale(){return`#${dE(this.r)}${dE(this.g)}${dE(this.b)}`}function pIe(){return`#${dE(this.r)}${dE(this.g)}${dE(this.b)}${dE((isNaN(this.opacity)?1:this.opacity)*255)}`}function ile(){const o=_z(this.opacity);return`${o===1?"rgb(":"rgba("}${wE(this.r)}, ${wE(this.g)}, ${wE(this.b)}${o===1?")":`, ${o})`}`}function _z(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function wE(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function dE(o){return o=wE(o),(o<16?"0":"")+o.toString(16)}function lle(o,s,i,u){return u<=0?o=s=i=NaN:i<=0||i>=1?o=s=NaN:s<=0&&(o=NaN),new Rh(o,s,i,u)}function jfe(o){if(o instanceof Rh)return new Rh(o.h,o.s,o.l,o.opacity);if(o instanceof AR||(o=rR(o)),!o)return new Rh;if(o instanceof Rh)return o;o=o.rgb();var s=o.r/255,i=o.g/255,u=o.b/255,m=Math.min(s,i,u),h=Math.max(s,i,u),b=NaN,C=h-m,x=(h+m)/2;return C?(s===h?b=(i-u)/C+(i<u)*6:i===h?b=(u-s)/C+2:b=(s-i)/C+4,C/=x<.5?h+m:2-h-m,b*=60):C=x>0&&x<1?0:b,new Rh(b,C,x,o.opacity)}function gIe(o,s,i,u){return arguments.length===1?jfe(o):new Rh(o,s,i,u??1)}function Rh(o,s,i,u){this.h=+o,this.s=+s,this.l=+i,this.opacity=+u}Toe(Rh,gIe,Ufe(AR,{brighter(o){return o=o==null?Ez:Math.pow(Ez,o),new Rh(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?oR:Math.pow(oR,o),new Rh(this.h,this.s,this.l*o,this.opacity)},rgb(){var o=this.h%360+(this.h<0)*360,s=isNaN(o)||isNaN(this.s)?0:this.s,i=this.l,u=i+(i<.5?i:1-i)*s,m=2*i-u;return new xm(ite(o>=240?o-240:o+120,m,u),ite(o,m,u),ite(o<120?o+240:o-120,m,u),this.opacity)},clamp(){return new Rh(cle(this.h),TH(this.s),TH(this.l),_z(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const o=_z(this.opacity);return`${o===1?"hsl(":"hsla("}${cle(this.h)}, ${TH(this.s)*100}%, ${TH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function cle(o){return o=(o||0)%360,o<0?o+360:o}function TH(o){return Math.max(0,Math.min(1,o||0))}function ite(o,s,i){return(o<60?s+(i-s)*o/60:o<180?i:o<240?s+(i-s)*(240-o)/60:s)*255}const Wfe=o=>()=>o;function hIe(o,s){return function(i){return o+i*s}}function vIe(o,s,i){return o=Math.pow(o,i),s=Math.pow(s,i)-o,i=1/i,function(u){return Math.pow(o+u*s,i)}}function bIe(o){return(o=+o)==1?Zfe:function(s,i){return i-s?vIe(s,i,o):Wfe(isNaN(s)?i:s)}}function Zfe(o,s){var i=s-o;return i?hIe(o,i):Wfe(isNaN(o)?s:o)}const ule=function o(s){var i=bIe(s);function u(m,h){var b=i((m=pne(m)).r,(h=pne(h)).r),C=i(m.g,h.g),x=i(m.b,h.b),_=Zfe(m.opacity,h.opacity);return function(N){return m.r=b(N),m.g=C(N),m.b=x(N),m.opacity=_(N),m+""}}return u.gamma=o,u}(1);function a2(o,s){return o=+o,s=+s,function(i){return o*(1-i)+s*i}}var gne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,lte=new RegExp(gne.source,"g");function yIe(o){return function(){return o}}function wIe(o){return function(s){return o(s)+""}}function CIe(o,s){var i=gne.lastIndex=lte.lastIndex=0,u,m,h,b=-1,C=[],x=[];for(o=o+"",s=s+"";(u=gne.exec(o))&&(m=lte.exec(s));)(h=m.index)>i&&(h=s.slice(i,h),C[b]?C[b]+=h:C[++b]=h),(u=u[0])===(m=m[0])?C[b]?C[b]+=m:C[++b]=m:(C[++b]=null,x.push({i:b,x:a2(u,m)})),i=lte.lastIndex;return i<s.length&&(h=s.slice(i),C[b]?C[b]+=h:C[++b]=h),C.length<2?x[0]?wIe(x[0].x):yIe(s):(s=x.length,function(_){for(var N=0,O;N<s;++N)C[(O=x[N]).i]=O.x(_);return C.join("")})}var dle=180/Math.PI,hne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Gfe(o,s,i,u,m,h){var b,C,x;return(b=Math.sqrt(o*o+s*s))&&(o/=b,s/=b),(x=o*i+s*u)&&(i-=o*x,u-=s*x),(C=Math.sqrt(i*i+u*u))&&(i/=C,u/=C,x/=C),o*u<s*i&&(o=-o,s=-s,x=-x,b=-b),{translateX:m,translateY:h,rotate:Math.atan2(s,o)*dle,skewX:Math.atan(x)*dle,scaleX:b,scaleY:C}}var AH;function SIe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?hne:Gfe(s.a,s.b,s.c,s.d,s.e,s.f)}function xIe(o){return o==null||(AH||(AH=document.createElementNS("http://www.w3.org/2000/svg","g")),AH.setAttribute("transform",o),!(o=AH.transform.baseVal.consolidate()))?hne:(o=o.matrix,Gfe(o.a,o.b,o.c,o.d,o.e,o.f))}function qfe(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,B,L,j){if(_!==O||N!==B){var J=L.push("translate(",null,s,null,i);j.push({i:J-4,x:a2(_,O)},{i:J-2,x:a2(N,B)})}else(O||B)&&L.push("translate("+O+s+B+i)}function b(_,N,O,B){_!==N?(_-N>180?N+=360:N-_>180&&(_+=360),B.push({i:O.push(m(O)+"rotate(",null,u)-2,x:a2(_,N)})):N&&O.push(m(O)+"rotate("+N+u)}function C(_,N,O,B){_!==N?B.push({i:O.push(m(O)+"skewX(",null,u)-2,x:a2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function x(_,N,O,B,L,j){if(_!==O||N!==B){var J=L.push(m(L)+"scale(",null,",",null,")");j.push({i:J-4,x:a2(_,O)},{i:J-2,x:a2(N,B)})}else(O!==1||B!==1)&&L.push(m(L)+"scale("+O+","+B+")")}return function(_,N){var O=[],B=[];return _=o(_),N=o(N),h(_.translateX,_.translateY,N.translateX,N.translateY,O,B),b(_.rotate,N.rotate,O,B),C(_.skewX,N.skewX,O,B),x(_.scaleX,_.scaleY,N.scaleX,N.scaleY,O,B),_=N=null,function(L){for(var j=-1,J=B.length,Y;++j<J;)O[(Y=B[j]).i]=Y.x(L);return O.join("")}}}var EIe=qfe(SIe,"px, ","px)","deg)"),_Ie=qfe(xIe,", ",")",")"),kIe=1e-12;function fle(o){return((o=Math.exp(o))+1/o)/2}function TIe(o){return((o=Math.exp(o))-1/o)/2}function AIe(o){return((o=Math.exp(2*o))-1)/(o+1)}const NIe=function o(s,i,u){function m(h,b){var C=h[0],x=h[1],_=h[2],N=b[0],O=b[1],B=b[2],L=N-C,j=O-x,J=L*L+j*j,Y,ne;if(J<kIe)ne=Math.log(B/_)/s,Y=function(te){return[C+te*L,x+te*j,_*Math.exp(s*te*ne)]};else{var K=Math.sqrt(J),W=(B*B-_*_+u*J)/(2*_*i*K),Se=(B*B-_*_-u*J)/(2*B*i*K),ut=Math.log(Math.sqrt(W*W+1)-W),Le=Math.log(Math.sqrt(Se*Se+1)-Se);ne=(Le-ut)/s,Y=function(te){var We=te*ne,pt=fle(ut),ft=_/(i*K)*(pt*AIe(s*We+ut)-TIe(ut));return[C+ft*L,x+ft*j,_*pt/fle(s*We+ut)]}}return Y.duration=ne*1e3*s/Math.SQRT2,Y}return m.rho=function(h){var b=Math.max(.001,+h),C=b*b,x=C*C;return o(b,C,x)},m}(Math.SQRT2,2,4);var m4=0,DM=0,OM=0,Yfe=1e3,kz,MM,Tz=0,kE=0,TU=0,aR=typeof performance=="object"&&performance.now?performance:Date,Kfe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function Aoe(){return kE||(Kfe(OIe),kE=aR.now()+TU)}function OIe(){kE=0}function Az(){this._call=this._time=this._next=null}Az.prototype=Xfe.prototype={constructor:Az,restart:function(o,s,i){if(typeof o!="function")throw new TypeError("callback is not a function");i=(i==null?Aoe():+i)+(s==null?0:+s),!this._next&&MM!==this&&(MM?MM._next=this:kz=this,MM=this),this._call=o,this._time=i,vne()},stop:function(){this._call&&(this._call=null,this._time=1/0,vne())}};function Xfe(o,s,i){var u=new Az;return u.restart(o,s,i),u}function $Ie(){Aoe(),++m4;for(var o=kz,s;o;)(s=kE-o._time)>=0&&o._call.call(void 0,s),o=o._next;--m4}function mle(){kE=(Tz=aR.now())+TU,m4=DM=0;try{$Ie()}finally{m4=0,MIe(),kE=0}}function DIe(){var o=aR.now(),s=o-Tz;s>Yfe&&(TU-=s,Tz=o)}function MIe(){for(var o,s=kz,i,u=1/0;s;)s._call?(u>s._time&&(u=s._time),o=s,s=s._next):(i=s._next,s._next=null,s=o?o._next=i:kz=i);MM=o,vne(u)}function vne(o){if(!m4){DM&&(DM=clearTimeout(DM));var s=o-kE;s>24?(o<1/0&&(DM=setTimeout(mle,o-aR.now()-TU)),OM&&(OM=clearInterval(OM))):(OM||(Tz=aR.now(),OM=setInterval(DIe,Yfe)),m4=1,Kfe(mle))}}function ple(o,s,i){var u=new Az;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var RIe=_U("start","end","cancel","interrupt"),BIe=[],Jfe=0,gle=1,bne=2,KH=3,hle=4,yne=5,XH=6;function AU(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;IIe(o,i,{name:s,index:u,group:m,on:RIe,tween:BIe,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:Jfe})}function Noe(o,s){var i=Ph(o,s);if(i.state>Jfe)throw new Error("too late; already scheduled");return i}function Fv(o,s){var i=Ph(o,s);if(i.state>KH)throw new Error("too late; already running");return i}function Ph(o,s){var i=o.__transition;if(!i||!(i=i[s]))throw new Error("transition not found");return i}function IIe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=Xfe(h,0,i.time);function h(_){i.state=gle,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,B,L;if(i.state!==gle)return x();for(N in u)if(L=u[N],L.name===i.name){if(L.state===KH)return ple(b);L.state===hle?(L.state=XH,L.timer.stop(),L.on.call("interrupt",o,o.__data__,L.index,L.group),delete u[N]):+N<s&&(L.state=XH,L.timer.stop(),L.on.call("cancel",o,o.__data__,L.index,L.group),delete u[N])}if(ple(function(){i.state===KH&&(i.state=hle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=bne,i.on.call("start",o,o.__data__,i.index,i.group),i.state===bne){for(i.state=KH,m=new Array(B=i.tween.length),N=0,O=-1;N<B;++N)(L=i.tween[N].value.call(o,o.__data__,i.index,i.group))&&(m[++O]=L);m.length=O+1}}function C(_){for(var N=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(x),i.state=yne,1),O=-1,B=m.length;++O<B;)m[O].call(o,N);i.state===yne&&(i.on.call("end",o,o.__data__,i.index,i.group),x())}function x(){i.state=XH,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function JH(o,s){var i=o.__transition,u,m,h=!0,b;if(i){s=s==null?null:s+"";for(b in i){if((u=i[b]).name!==s){h=!1;continue}m=u.state>bne&&u.state<yne,u.state=XH,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function PIe(o){return this.each(function(){JH(this,o)})}function FIe(o,s){var i,u;return function(){var m=Fv(this,o),h=m.tween;if(h!==i){u=i=h;for(var b=0,C=u.length;b<C;++b)if(u[b].name===s){u=u.slice(),u.splice(b,1);break}}m.tween=u}}function LIe(o,s,i){var u,m;if(typeof i!="function")throw new Error;return function(){var h=Fv(this,o),b=h.tween;if(b!==u){m=(u=b).slice();for(var C={name:s,value:i},x=0,_=m.length;x<_;++x)if(m[x].name===s){m[x]=C;break}x===_&&m.push(C)}h.tween=m}}function VIe(o,s){var i=this._id;if(o+="",arguments.length<2){for(var u=Ph(this.node(),i).tween,m=0,h=u.length,b;m<h;++m)if((b=u[m]).name===o)return b.value;return null}return this.each((s==null?FIe:LIe)(i,o,s))}function Ooe(o,s,i){var u=o._id;return o.each(function(){var m=Fv(this,u);(m.value||(m.value={}))[s]=i.apply(this,arguments)}),function(m){return Ph(m,u).value[s]}}function Qfe(o,s){var i;return(typeof s=="number"?a2:s instanceof rR?ule:(i=rR(s))?(s=i,ule):CIe)(o,s)}function HIe(o){return function(){this.removeAttribute(o)}}function zIe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function UIe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttribute(o);return b===m?null:b===u?h:h=s(u=b,i)}}function jIe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttributeNS(o.space,o.local);return b===m?null:b===u?h:h=s(u=b,i)}}function WIe(o,s,i){var u,m,h;return function(){var b,C=i(this),x;return C==null?void this.removeAttribute(o):(b=this.getAttribute(o),x=C+"",b===x?null:b===u&&x===m?h:(m=x,h=s(u=b,C)))}}function ZIe(o,s,i){var u,m,h;return function(){var b,C=i(this),x;return C==null?void this.removeAttributeNS(o.space,o.local):(b=this.getAttributeNS(o.space,o.local),x=C+"",b===x?null:b===u&&x===m?h:(m=x,h=s(u=b,C)))}}function GIe(o,s){var i=kU(o),u=i==="transform"?_Ie:Qfe;return this.attrTween(o,typeof s=="function"?(i.local?ZIe:WIe)(i,u,Ooe(this,"attr."+o,s)):s==null?(i.local?zIe:HIe)(i):(i.local?jIe:UIe)(i,u,s))}function qIe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function YIe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function KIe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&YIe(o,h)),i}return m._value=s,m}function XIe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&qIe(o,h)),i}return m._value=s,m}function JIe(o,s){var i="attr."+o;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(s==null)return this.tween(i,null);if(typeof s!="function")throw new Error;var u=kU(o);return this.tween(i,(u.local?KIe:XIe)(u,s))}function QIe(o,s){return function(){Noe(this,o).delay=+s.apply(this,arguments)}}function ePe(o,s){return s=+s,function(){Noe(this,o).delay=s}}function tPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?QIe:ePe)(s,o)):Ph(this.node(),s).delay}function nPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function oPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function sPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?nPe:oPe)(s,o)):Ph(this.node(),s).duration}function rPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function aPe(o){var s=this._id;return arguments.length?this.each(rPe(s,o)):Ph(this.node(),s).ease}function iPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function lPe(o){if(typeof o!="function")throw new Error;return this.each(iPe(this._id,o))}function cPe(o){typeof o!="function"&&(o=$fe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],x,_=0;_<b;++_)(x=h[_])&&o.call(x,x.__data__,_,h)&&C.push(x);return new V0(u,this._parents,this._name,this._id)}function uPe(o){if(o._id!==this._id)throw new Error;for(var s=this._groups,i=o._groups,u=s.length,m=i.length,h=Math.min(u,m),b=new Array(u),C=0;C<h;++C)for(var x=s[C],_=i[C],N=x.length,O=b[C]=new Array(N),B,L=0;L<N;++L)(B=x[L]||_[L])&&(O[L]=B);for(;C<u;++C)b[C]=s[C];return new V0(b,this._parents,this._name,this._id)}function dPe(o){return(o+"").trim().split(/^|\s+/).every(function(s){var i=s.indexOf(".");return i>=0&&(s=s.slice(0,i)),!s||s==="start"})}function fPe(o,s,i){var u,m,h=dPe(s)?Noe:Fv;return function(){var b=h(this,o),C=b.on;C!==u&&(m=(u=C).copy()).on(s,i),b.on=m}}function mPe(o,s){var i=this._id;return arguments.length<2?Ph(this.node(),i).on.on(o):this.each(fPe(i,o,s))}function pPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function gPe(){return this.on("end.remove",pPe(this._id))}function hPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=_oe(o));for(var u=this._groups,m=u.length,h=new Array(m),b=0;b<m;++b)for(var C=u[b],x=C.length,_=h[b]=new Array(x),N,O,B=0;B<x;++B)(N=C[B])&&(O=o.call(N,N.__data__,B,C))&&("__data__"in N&&(O.__data__=N.__data__),_[B]=O,AU(_[B],s,i,B,_,Ph(N,i)));return new V0(h,this._parents,s,i)}function vPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Ofe(o));for(var u=this._groups,m=u.length,h=[],b=[],C=0;C<m;++C)for(var x=u[C],_=x.length,N,O=0;O<_;++O)if(N=x[O]){for(var B=o.call(N,N.__data__,O,x),L,j=Ph(N,i),J=0,Y=B.length;J<Y;++J)(L=B[J])&&AU(L,s,i,J,B,j);h.push(B),b.push(N)}return new V0(h,b,s,i)}var bPe=TR.prototype.constructor;function yPe(){return new bPe(this._groups,this._parents)}function wPe(o,s){var i,u,m;return function(){var h=f4(this,o),b=(this.style.removeProperty(o),f4(this,o));return h===b?null:h===i&&b===u?m:m=s(i=h,u=b)}}function eme(o){return function(){this.style.removeProperty(o)}}function CPe(o,s,i){var u,m=i+"",h;return function(){var b=f4(this,o);return b===m?null:b===u?h:h=s(u=b,i)}}function SPe(o,s,i){var u,m,h;return function(){var b=f4(this,o),C=i(this),x=C+"";return C==null&&(x=C=(this.style.removeProperty(o),f4(this,o))),b===x?null:b===u&&x===m?h:(m=x,h=s(u=b,C))}}function xPe(o,s){var i,u,m,h="style."+s,b="end."+h,C;return function(){var x=Fv(this,o),_=x.on,N=x.value[h]==null?C||(C=eme(s)):void 0;(_!==i||m!==N)&&(u=(i=_).copy()).on(b,m=N),x.on=u}}function EPe(o,s,i){var u=(o+="")=="transform"?EIe:Qfe;return s==null?this.styleTween(o,wPe(o,u)).on("end.style."+o,eme(o)):typeof s=="function"?this.styleTween(o,SPe(o,u,Ooe(this,"style."+o,s))).each(xPe(this._id,o)):this.styleTween(o,CPe(o,u,s),i).on("end.style."+o,null)}function _Pe(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function kPe(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&_Pe(o,b,i)),u}return h._value=s,h}function TPe(o,s,i){var u="style."+(o+="");if(arguments.length<2)return(u=this.tween(u))&&u._value;if(s==null)return this.tween(u,null);if(typeof s!="function")throw new Error;return this.tween(u,kPe(o,s,i??""))}function APe(o){return function(){this.textContent=o}}function NPe(o){return function(){var s=o(this);this.textContent=s??""}}function OPe(o){return this.tween("text",typeof o=="function"?NPe(Ooe(this,"text",o)):APe(o==null?"":o+""))}function $Pe(o){return function(s){this.textContent=o.call(this,s)}}function DPe(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&$Pe(m)),s}return u._value=o,u}function MPe(o){var s="text";if(arguments.length<1)return(s=this.tween(s))&&s._value;if(o==null)return this.tween(s,null);if(typeof o!="function")throw new Error;return this.tween(s,DPe(o))}function RPe(){for(var o=this._name,s=this._id,i=tme(),u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,x,_=0;_<C;++_)if(x=b[_]){var N=Ph(x,s);AU(x,o,i,_,b,{time:N.time+N.delay+N.duration,delay:0,duration:N.duration,ease:N.ease})}return new V0(u,this._parents,o,i)}function BPe(){var o,s,i=this,u=i._id,m=i.size();return new Promise(function(h,b){var C={value:b},x={value:function(){--m===0&&h()}};i.each(function(){var _=Fv(this,u),N=_.on;N!==o&&(s=(o=N).copy(),s._.cancel.push(C),s._.interrupt.push(C),s._.end.push(x)),_.on=s}),m===0&&h()})}var IPe=0;function V0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function tme(){return++IPe}var $0=TR.prototype;V0.prototype={constructor:V0,select:hPe,selectAll:vPe,selectChild:$0.selectChild,selectChildren:$0.selectChildren,filter:cPe,merge:uPe,selection:yPe,transition:RPe,call:$0.call,nodes:$0.nodes,node:$0.node,size:$0.size,empty:$0.empty,each:$0.each,on:mPe,attr:GIe,attrTween:JIe,style:EPe,styleTween:TPe,text:OPe,textTween:MPe,remove:gPe,tween:VIe,delay:tPe,duration:sPe,ease:aPe,easeVarying:lPe,end:BPe,[Symbol.iterator]:$0[Symbol.iterator]};function PPe(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var FPe={time:null,delay:0,duration:250,ease:PPe};function LPe(o,s){for(var i;!(i=o.__transition)||!(i=i[s]);)if(!(o=o.parentNode))throw new Error(`transition ${s} not found`);return i}function VPe(o){var s,i;o instanceof V0?(s=o._id,o=o._name):(s=tme(),(i=FPe).time=Aoe(),o=o==null?null:o+"");for(var u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,x,_=0;_<C;++_)(x=b[_])&&AU(x,o,s,_,b,i||LPe(x,s));return new V0(u,this._parents,o,s)}TR.prototype.interrupt=PIe;TR.prototype.transition=VPe;const NH=o=>()=>o;function HPe(o,{sourceEvent:s,target:i,transform:u,dispatch:m}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:m}})}function I0(o,s,i){this.k=o,this.x=s,this.y=i}I0.prototype={constructor:I0,scale:function(o){return o===1?this:new I0(this.k*o,this.x,this.y)},translate:function(o,s){return o===0&s===0?this:new I0(this.k,this.x+this.k*o,this.y+this.k*s)},apply:function(o){return[o[0]*this.k+this.x,o[1]*this.k+this.y]},applyX:function(o){return o*this.k+this.x},applyY:function(o){return o*this.k+this.y},invert:function(o){return[(o[0]-this.x)/this.k,(o[1]-this.y)/this.k]},invertX:function(o){return(o-this.x)/this.k},invertY:function(o){return(o-this.y)/this.k},rescaleX:function(o){return o.copy().domain(o.range().map(this.invertX,this).map(o.invert,o))},rescaleY:function(o){return o.copy().domain(o.range().map(this.invertY,this).map(o.invert,o))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var p4=new I0(1,0,0);I0.prototype;function cte(o){o.stopImmediatePropagation()}function $M(o){o.preventDefault(),o.stopImmediatePropagation()}function zPe(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function UPe(){var o=this;return o instanceof SVGElement?(o=o.ownerSVGElement||o,o.hasAttribute("viewBox")?(o=o.viewBox.baseVal,[[o.x,o.y],[o.x+o.width,o.y+o.height]]):[[0,0],[o.width.baseVal.value,o.height.baseVal.value]]):[[0,0],[o.clientWidth,o.clientHeight]]}function vle(){return this.__zoom||p4}function jPe(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function WPe(){return navigator.maxTouchPoints||"ontouchstart"in this}function ZPe(o,s,i){var u=o.invertX(s[0][0])-i[0][0],m=o.invertX(s[1][0])-i[1][0],h=o.invertY(s[0][1])-i[0][1],b=o.invertY(s[1][1])-i[1][1];return o.translate(m>u?(u+m)/2:Math.min(0,u)||Math.max(0,m),b>h?(h+b)/2:Math.min(0,h)||Math.max(0,b))}function GPe(){var o=zPe,s=UPe,i=ZPe,u=jPe,m=WPe,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,x=NIe,_=_U("start","zoom","end"),N,O,B,L=500,j=150,J=0,Y=10;function ne(be){be.property("__zoom",vle).on("wheel.zoom",We,{passive:!1}).on("mousedown.zoom",pt).on("dblclick.zoom",ft).filter(m).on("touchstart.zoom",Oe).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",Pt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}ne.transform=function(be,$e,R,Ue){var ve=be.selection?be.selection():be;ve.property("__zoom",vle),be!==ve?ut(be,$e,R,Ue):ve.interrupt().each(function(){Le(this,arguments).event(Ue).start().zoom(null,typeof $e=="function"?$e.apply(this,arguments):$e).end()})},ne.scaleBy=function(be,$e,R,Ue){ne.scaleTo(be,function(){var ve=this.__zoom.k,nt=typeof $e=="function"?$e.apply(this,arguments):$e;return ve*nt},R,Ue)},ne.scaleTo=function(be,$e,R,Ue){ne.transform(be,function(){var ve=s.apply(this,arguments),nt=this.__zoom,tt=R==null?Se(ve):typeof R=="function"?R.apply(this,arguments):R,pe=nt.invert(tt),Ze=typeof $e=="function"?$e.apply(this,arguments):$e;return i(W(K(nt,Ze),tt,pe),ve,b)},R,Ue)},ne.translateBy=function(be,$e,R,Ue){ne.transform(be,function(){return i(this.__zoom.translate(typeof $e=="function"?$e.apply(this,arguments):$e,typeof R=="function"?R.apply(this,arguments):R),s.apply(this,arguments),b)},null,Ue)},ne.translateTo=function(be,$e,R,Ue,ve){ne.transform(be,function(){var nt=s.apply(this,arguments),tt=this.__zoom,pe=Ue==null?Se(nt):typeof Ue=="function"?Ue.apply(this,arguments):Ue;return i(p4.translate(pe[0],pe[1]).scale(tt.k).translate(typeof $e=="function"?-$e.apply(this,arguments):-$e,typeof R=="function"?-R.apply(this,arguments):-R),nt,b)},Ue,ve)};function K(be,$e){return $e=Math.max(h[0],Math.min(h[1],$e)),$e===be.k?be:new I0($e,be.x,be.y)}function W(be,$e,R){var Ue=$e[0]-R[0]*be.k,ve=$e[1]-R[1]*be.k;return Ue===be.x&&ve===be.y?be:new I0(be.k,Ue,ve)}function Se(be){return[(+be[0][0]+ +be[1][0])/2,(+be[0][1]+ +be[1][1])/2]}function ut(be,$e,R,Ue){be.on("start.zoom",function(){Le(this,arguments).event(Ue).start()}).on("interrupt.zoom end.zoom",function(){Le(this,arguments).event(Ue).end()}).tween("zoom",function(){var ve=this,nt=arguments,tt=Le(ve,nt).event(Ue),pe=s.apply(ve,nt),Ze=R==null?Se(pe):typeof R=="function"?R.apply(ve,nt):R,Tt=Math.max(pe[1][0]-pe[0][0],pe[1][1]-pe[0][1]),He=ve.__zoom,vt=typeof $e=="function"?$e.apply(ve,nt):$e,Re=x(He.invert(Ze).concat(Tt/He.k),vt.invert(Ze).concat(Tt/vt.k));return function(ct){if(ct===1)ct=vt;else{var oe=Re(ct),pn=Tt/oe[2];ct=new I0(pn,Ze[0]-oe[0]*pn,Ze[1]-oe[1]*pn)}tt.zoom(null,ct)}})}function Le(be,$e,R){return!R&&be.__zooming||new te(be,$e)}function te(be,$e){this.that=be,this.args=$e,this.active=0,this.sourceEvent=null,this.extent=s.apply(be,$e),this.taps=0}te.prototype={event:function(be){return be&&(this.sourceEvent=be),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(be,$e){return this.mouse&&be!=="mouse"&&(this.mouse[1]=$e.invert(this.mouse[0])),this.touch0&&be!=="touch"&&(this.touch0[1]=$e.invert(this.touch0[0])),this.touch1&&be!=="touch"&&(this.touch1[1]=$e.invert(this.touch1[0])),this.that.__zoom=$e,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(be){var $e=Mh(this.that).datum();_.call(be,this.that,new HPe(be,{sourceEvent:this.sourceEvent,target:ne,type:be,transform:this.that.__zoom,dispatch:_}),$e)}};function We(be,...$e){if(!o.apply(this,arguments))return;var R=Le(this,$e).event(be),Ue=this.__zoom,ve=Math.max(h[0],Math.min(h[1],Ue.k*Math.pow(2,u.apply(this,arguments)))),nt=Nv(be);if(R.wheel)(R.mouse[0][0]!==nt[0]||R.mouse[0][1]!==nt[1])&&(R.mouse[1]=Ue.invert(R.mouse[0]=nt)),clearTimeout(R.wheel);else{if(Ue.k===ve)return;R.mouse=[nt,Ue.invert(nt)],JH(this),R.start()}$M(be),R.wheel=setTimeout(tt,j),R.zoom("mouse",i(W(K(Ue,ve),R.mouse[0],R.mouse[1]),R.extent,b));function tt(){R.wheel=null,R.end()}}function pt(be,...$e){if(B||!o.apply(this,arguments))return;var R=be.currentTarget,Ue=Le(this,$e,!0).event(be),ve=Mh(be.view).on("mousemove.zoom",Ze,!0).on("mouseup.zoom",Tt,!0),nt=Nv(be,R),tt=be.clientX,pe=be.clientY;Hfe(be.view),cte(be),Ue.mouse=[nt,this.__zoom.invert(nt)],JH(this),Ue.start();function Ze(He){if($M(He),!Ue.moved){var vt=He.clientX-tt,Re=He.clientY-pe;Ue.moved=vt*vt+Re*Re>J}Ue.event(He).zoom("mouse",i(W(Ue.that.__zoom,Ue.mouse[0]=Nv(He,R),Ue.mouse[1]),Ue.extent,b))}function Tt(He){ve.on("mousemove.zoom mouseup.zoom",null),zfe(He.view,Ue.moved),$M(He),Ue.event(He).end()}}function ft(be,...$e){if(o.apply(this,arguments)){var R=this.__zoom,Ue=Nv(be.changedTouches?be.changedTouches[0]:be,this),ve=R.invert(Ue),nt=R.k*(be.shiftKey?.5:2),tt=i(W(K(R,nt),Ue,ve),s.apply(this,$e),b);$M(be),C>0?Mh(this).transition().duration(C).call(ut,tt,Ue,be):Mh(this).call(ne.transform,tt,Ue,be)}}function Oe(be,...$e){if(o.apply(this,arguments)){var R=be.touches,Ue=R.length,ve=Le(this,$e,be.changedTouches.length===Ue).event(be),nt,tt,pe,Ze;for(cte(be),tt=0;tt<Ue;++tt)pe=R[tt],Ze=Nv(pe,this),Ze=[Ze,this.__zoom.invert(Ze),pe.identifier],ve.touch0?!ve.touch1&&ve.touch0[2]!==Ze[2]&&(ve.touch1=Ze,ve.taps=0):(ve.touch0=Ze,nt=!0,ve.taps=1+!!N);N&&(N=clearTimeout(N)),nt&&(ve.taps<2&&(O=Ze[0],N=setTimeout(function(){N=null},L)),JH(this),ve.start())}}function ue(be,...$e){if(this.__zooming){var R=Le(this,$e).event(be),Ue=be.changedTouches,ve=Ue.length,nt,tt,pe,Ze;for($M(be),nt=0;nt<ve;++nt)tt=Ue[nt],pe=Nv(tt,this),R.touch0&&R.touch0[2]===tt.identifier?R.touch0[0]=pe:R.touch1&&R.touch1[2]===tt.identifier&&(R.touch1[0]=pe);if(tt=R.that.__zoom,R.touch1){var Tt=R.touch0[0],He=R.touch0[1],vt=R.touch1[0],Re=R.touch1[1],ct=(ct=vt[0]-Tt[0])*ct+(ct=vt[1]-Tt[1])*ct,oe=(oe=Re[0]-He[0])*oe+(oe=Re[1]-He[1])*oe;tt=K(tt,Math.sqrt(ct/oe)),pe=[(Tt[0]+vt[0])/2,(Tt[1]+vt[1])/2],Ze=[(He[0]+Re[0])/2,(He[1]+Re[1])/2]}else if(R.touch0)pe=R.touch0[0],Ze=R.touch0[1];else return;R.zoom("touch",i(W(tt,pe,Ze),R.extent,b))}}function Pt(be,...$e){if(this.__zooming){var R=Le(this,$e).event(be),Ue=be.changedTouches,ve=Ue.length,nt,tt;for(cte(be),B&&clearTimeout(B),B=setTimeout(function(){B=null},L),nt=0;nt<ve;++nt)tt=Ue[nt],R.touch0&&R.touch0[2]===tt.identifier?delete R.touch0:R.touch1&&R.touch1[2]===tt.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(tt=Nv(tt,this),Math.hypot(O[0]-tt[0],O[1]-tt[1])<Y)){var pe=Mh(this).on("dblclick.zoom");pe&&pe.apply(this,arguments)}}}return ne.wheelDelta=function(be){return arguments.length?(u=typeof be=="function"?be:NH(+be),ne):u},ne.filter=function(be){return arguments.length?(o=typeof be=="function"?be:NH(!!be),ne):o},ne.touchable=function(be){return arguments.length?(m=typeof be=="function"?be:NH(!!be),ne):m},ne.extent=function(be){return arguments.length?(s=typeof be=="function"?be:NH([[+be[0][0],+be[0][1]],[+be[1][0],+be[1][1]]]),ne):s},ne.scaleExtent=function(be){return arguments.length?(h[0]=+be[0],h[1]=+be[1],ne):[h[0],h[1]]},ne.translateExtent=function(be){return arguments.length?(b[0][0]=+be[0][0],b[1][0]=+be[1][0],b[0][1]=+be[0][1],b[1][1]=+be[1][1],ne):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},ne.constrain=function(be){return arguments.length?(i=be,ne):i},ne.duration=function(be){return arguments.length?(C=+be,ne):C},ne.interpolate=function(be){return arguments.length?(x=be,ne):x},ne.on=function(){var be=_.on.apply(_,arguments);return be===_?ne:be},ne.clickDistance=function(be){return arguments.length?(J=(be=+be)*be,ne):Math.sqrt(J)},ne.tapDistance=function(be){return arguments.length?(Y=+be,ne):Y},ne}var ss=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(ss||{}),$oe=(o=>(o.Partial="partial",o.Full="full",o))($oe||{}),iE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(iE||{}),g2=(o=>(o.Strict="strict",o.Loose="loose",o))(g2||{}),Nz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(Nz||{}),UM=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(UM||{}),nme=(o=>(o.TopLeft="top-left",o.TopCenter="top-center",o.TopRight="top-right",o.BottomLeft="bottom-left",o.BottomCenter="bottom-center",o.BottomRight="bottom-right",o))(nme||{});const qPe=["INPUT","SELECT","TEXTAREA"];function wne(o){var s,i;const u=((i=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:i[0])||o.target,m=typeof(u==null?void 0:u.hasAttribute)=="function"?u.hasAttribute("contenteditable"):!1,h=typeof(u==null?void 0:u.closest)=="function"?u.closest(".nokey"):null;return qPe.includes(u==null?void 0:u.nodeName)||m||!!h}function YPe(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function ble(o,s,i,u){const m=s.replace("+",`
|
|
116
116
|
`).replace(`
|
|
117
117
|
|
|
118
118
|
`,`
|
package/es/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ var vhe = (o, s, i) => s in o ? hhe(o, s, { enumerable: !0, configurable: !0, wr
|
|
|
3
3
|
var uu = (o, s, i) => vhe(o, typeof s != "symbol" ? s + "" : s, i);
|
|
4
4
|
import { defineComponent as Wo, reactive as QR, provide as Jm, inject as Kg, ref as hn, watch as es, toValue as Bt, computed as jn, openBlock as vt, createElementBlock as un, createElementVNode as Ut, mergeModels as ei, useModel as Rr, Fragment as lr, renderList as va, createVNode as nn, unref as Le, withCtx as An, createCommentVNode as is, toDisplayString as Rs, createTextVNode as Us, createBlock as jo, withDirectives as BU, mergeProps as qg, resolveComponent as L4, isRef as nh, onUnmounted as ld, watchEffect as Eue, getCurrentScope as Noe, onScopeDispose as kR, onMounted as Xi, toRefs as eI, renderSlot as Mr, normalizeStyle as jl, nextTick as lm, onBeforeUnmount as tI, onActivated as bhe, onDeactivated as yhe, h as Wa, withModifiers as J2, Teleport as Moe, normalizeClass as Pd, vShow as whe, resolveDynamicComponent as j_, createPropsRestProxy as Che, toRef as ai, effectScope as Tue, getCurrentInstance as Q2, useSlots as She, onBeforeMount as xhe, useAttrs as _he, isMemoSame as Ehe, customRef as The, markRaw as AR, readonly as khe, createStaticVNode as Ahe, createSlots as kue, normalizeProps as Ohe, guardReactiveProps as $he, withKeys as nI } from "vue";
|
|
5
5
|
import { ElImage as q2, ElIcon as oh, ElPopover as FU, ElForm as eC, ElFormItem as Ym, ElInput as Xg, ElButton as Pu, ElScrollbar as LU, ElLoadingDirective as Roe, ElSelect as iE, ElOption as lE, ElDialog as HU, ElTabs as Aue, ElTabPane as Oue, ElTable as Dhe, ElTableColumn as fz, ElCheckbox as vy, ElMessageBox as Nhe, ElRadioGroup as $ue, ElRadio as Nne, ElRow as Mhe, ElCol as kae, ElTree as Due } from "element-plus";
|
|
6
|
-
const Rhe = "0.0.
|
|
6
|
+
const Rhe = "0.0.42";
|
|
7
7
|
var Ihe = Object.defineProperty, Phe = (o, s, i) => s in o ? Ihe(o, s, { enumerable: !0, configurable: !0, writable: !0, value: i }) : o[s] = i, wte = (o, s, i) => Phe(o, typeof s != "symbol" ? s + "" : s, i);
|
|
8
8
|
function Nue(o, s) {
|
|
9
9
|
return function() {
|
|
@@ -67248,7 +67248,7 @@ const kMe = [
|
|
|
67248
67248
|
], AMe = "undo redo | blocks bold italic forecolor removeformat alignleft aligncenter alignright alignjustify outdent indent pagebreakfullscreen preview", OMe = {
|
|
67249
67249
|
license_key: "gpl",
|
|
67250
67250
|
skin: !1,
|
|
67251
|
-
content_css: ["./content.css", "./reset.css"],
|
|
67251
|
+
content_css: process.env.NODE_ENV === "development" ? [`${location.origin}/css/content.css`, `${location.origin}/css/reset.css`] : ["./css/content.css", "./css/reset.css"],
|
|
67252
67252
|
promotion: !1,
|
|
67253
67253
|
menu: {
|
|
67254
67254
|
pagesize: { title: "页面大小", items: TMe }
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const restCss = "\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n body {\n font-family: Arial, sans-serif;\n line-height: 1.5;\n }\n img {\n max-width: 100%;\n height: auto;\n }\n a {\n text-decoration: none;\n color: inherit;\n }\n ul, ol {\n list-style: none;\n }\n * {\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n }\n td:hover > .td-node {\n display: block;\n }\n .td-node {\n display: none;\n }\n\n .node-item{\n display: inline-block;\n padding: 0 2px;\n background-color: rgba(0, 120, 212, 0.1);\n border-radius: 2px;\n margin: 0 1px;\n cursor: pointer;\n }\n .node-item-td{\n position: relative;\n }\n [contenteditable='true'] {\n outline: 1px dashed #ccc;\n border: none;\n cursor: text;\n background-color: rgba(0, 0, 0, 0.02);\n }\n [contenteditable='true']:focus {\n // outline: 1px solid rgba(0, 120, 212, 0.3);\n // outline: none;\n border: none;\n }\n \n table {\n td {\n &.node-selected {\n background-color: rgba(0, 120, 212, 0.2);\n border: 1px solid #0078d4;\n }\n }\n }\n .node-selected:not(td){\n background-color: rgba(0, 120, 212, 0.2);\n outline: 1px solid #0078d4;\n }\n ";
|
|
2
1
|
export declare const init: {
|
|
3
2
|
license_key: string;
|
|
4
3
|
skin: boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const restCss = "\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n body {\n font-family: Arial, sans-serif;\n line-height: 1.5;\n }\n img {\n max-width: 100%;\n height: auto;\n }\n a {\n text-decoration: none;\n color: inherit;\n }\n ul, ol {\n list-style: none;\n }\n * {\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n }\n td:hover > .td-node {\n display: block;\n }\n .td-node {\n display: none;\n }\n\n .node-item{\n display: inline-block;\n padding: 0 2px;\n background-color: rgba(0, 120, 212, 0.1);\n border-radius: 2px;\n margin: 0 1px;\n cursor: pointer;\n }\n .node-item-td{\n position: relative;\n }\n [contenteditable='true'] {\n outline: 1px dashed #ccc;\n border: none;\n cursor: text;\n background-color: rgba(0, 0, 0, 0.02);\n }\n [contenteditable='true']:focus {\n // outline: 1px solid rgba(0, 120, 212, 0.3);\n // outline: none;\n border: none;\n }\n \n table {\n td {\n &.node-selected {\n background-color: rgba(0, 120, 212, 0.2);\n border: 1px solid #0078d4;\n }\n }\n }\n .node-selected:not(td){\n background-color: rgba(0, 120, 212, 0.2);\n outline: 1px solid #0078d4;\n }\n ";
|
|
2
1
|
export declare const init: {
|
|
3
2
|
license_key: string;
|
|
4
3
|
skin: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zyui/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.42",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.mjs",
|
|
6
6
|
"types": "./es/index.d.ts",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"vue-hooks-plus": "^2.2.1",
|
|
43
43
|
"xmldom": "^0.6.0",
|
|
44
44
|
"xpath": "^0.0.34",
|
|
45
|
-
"@zyui/
|
|
46
|
-
"@zyui/
|
|
45
|
+
"@zyui/hooks": "0.0.5",
|
|
46
|
+
"@zyui/utils": "0.0.8"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/lodash-es": "^4.17.12"
|