@zyui/components 0.0.15 → 0.0.17
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 +2 -2
- package/es/index.mjs +16 -3
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Sfe=Object.defineProperty;var xfe=(o,a,c)=>a in o?Sfe(o,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):o[a]=c;var Bl=(o,a,c)=>xfe(o,typeof a!="symbol"?a+"":a,c);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const w=require("vue"),Ko=require("element-plus"),Efe="0.0.15";var _fe=Object.defineProperty,Tfe=(o,a,c)=>a in o?_fe(o,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):o[a]=c,CQ=(o,a,c)=>Tfe(o,typeof a!="symbol"?a+"":a,c);function bie(o,a){return function(){return o.apply(a,arguments)}}const{toString:kfe}=Object.prototype,{getPrototypeOf:lte}=Object,WH=(o=>a=>{const c=kfe.call(a);return o[c]||(o[c]=c.slice(8,-1).toLowerCase())})(Object.create(null)),Op=o=>(o=o.toLowerCase(),a=>WH(a)===o),ZH=o=>a=>typeof a===o,{isArray:FA}=Array,fM=ZH("undefined");function Afe(o){return o!==null&&!fM(o)&&o.constructor!==null&&!fM(o.constructor)&&gg(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const vie=Op("ArrayBuffer");function Ofe(o){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(o):a=o&&o.buffer&&vie(o.buffer),a}const Nfe=ZH("string"),gg=ZH("function"),yie=ZH("number"),GH=o=>o!==null&&typeof o=="object",$fe=o=>o===!0||o===!1,KV=o=>{if(WH(o)!=="object")return!1;const a=lte(o);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},Dfe=Op("Date"),Mfe=Op("File"),Rfe=Op("Blob"),Pfe=Op("FileList"),Ife=o=>GH(o)&&gg(o.pipe),Bfe=o=>{let a;return o&&(typeof FormData=="function"&&o instanceof FormData||gg(o.append)&&((a=WH(o))==="formdata"||a==="object"&&gg(o.toString)&&o.toString()==="[object FormData]"))},Ffe=Op("URLSearchParams"),[Lfe,Vfe,Hfe,zfe]=["ReadableStream","Request","Response","Headers"].map(Op),Ufe=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function _M(o,a,{allOwnKeys:c=!1}={}){if(o===null||typeof o>"u")return;let d,g;if(typeof o!="object"&&(o=[o]),FA(o))for(d=0,g=o.length;d<g;d++)a.call(null,o[d],d,o);else{const p=c?Object.getOwnPropertyNames(o):Object.keys(o),v=p.length;let x;for(d=0;d<v;d++)x=p[d],a.call(null,o[x],x,o)}}function wie(o,a){a=a.toLowerCase();const c=Object.keys(o);let d=c.length,g;for(;d-- >0;)if(g=c[d],a===g.toLowerCase())return g;return null}const Lx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Cie=o=>!fM(o)&&o!==Lx;function pee(){const{caseless:o}=Cie(this)&&this||{},a={},c=(d,g)=>{const p=o&&wie(a,g)||g;KV(a[p])&&KV(d)?a[p]=pee(a[p],d):KV(d)?a[p]=pee({},d):FA(d)?a[p]=d.slice():a[p]=d};for(let d=0,g=arguments.length;d<g;d++)arguments[d]&&_M(arguments[d],c);return a}const jfe=(o,a,c,{allOwnKeys:d}={})=>(_M(a,(g,p)=>{c&&gg(g)?o[p]=bie(g,c):o[p]=g},{allOwnKeys:d}),o),Wfe=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),Zfe=(o,a,c,d)=>{o.prototype=Object.create(a.prototype,d),o.prototype.constructor=o,Object.defineProperty(o,"super",{value:a.prototype}),c&&Object.assign(o.prototype,c)},Gfe=(o,a,c,d)=>{let g,p,v;const x={};if(a=a||{},o==null)return a;do{for(g=Object.getOwnPropertyNames(o),p=g.length;p-- >0;)v=g[p],(!d||d(v,o,a))&&!x[v]&&(a[v]=o[v],x[v]=!0);o=c!==!1&<e(o)}while(o&&(!c||c(o,a))&&o!==Object.prototype);return a},qfe=(o,a,c)=>{o=String(o),(c===void 0||c>o.length)&&(c=o.length),c-=a.length;const d=o.indexOf(a,c);return d!==-1&&d===c},Yfe=o=>{if(!o)return null;if(FA(o))return o;let a=o.length;if(!yie(a))return null;const c=new Array(a);for(;a-- >0;)c[a]=o[a];return c},Kfe=(o=>a=>o&&a instanceof o)(typeof Uint8Array<"u"&<e(Uint8Array)),Xfe=(o,a)=>{const c=(o&&o[Symbol.iterator]).call(o);let d;for(;(d=c.next())&&!d.done;){const g=d.value;a.call(o,g[0],g[1])}},Jfe=(o,a)=>{let c;const d=[];for(;(c=o.exec(a))!==null;)d.push(c);return d},Qfe=Op("HTMLFormElement"),eme=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,c,d){return c.toUpperCase()+d}),Zoe=(({hasOwnProperty:o})=>(a,c)=>o.call(a,c))(Object.prototype),tme=Op("RegExp"),Sie=(o,a)=>{const c=Object.getOwnPropertyDescriptors(o),d={};_M(c,(g,p)=>{let v;(v=a(g,p,o))!==!1&&(d[p]=v||g)}),Object.defineProperties(o,d)},nme=o=>{Sie(o,(a,c)=>{if(gg(o)&&["arguments","caller","callee"].indexOf(c)!==-1)return!1;const d=o[c];if(gg(d)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+c+"'")})}})},ome=(o,a)=>{const c={},d=g=>{g.forEach(p=>{c[p]=!0})};return FA(o)?d(o):d(String(o).split(a)),c},sme=()=>{},rme=(o,a)=>o!=null&&Number.isFinite(o=+o)?o:a,SQ="abcdefghijklmnopqrstuvwxyz",Goe="0123456789",xie={DIGIT:Goe,ALPHA:SQ,ALPHA_DIGIT:SQ+SQ.toUpperCase()+Goe},ame=(o=16,a=xie.ALPHA_DIGIT)=>{let c="";const{length:d}=a;for(;o--;)c+=a[Math.random()*d|0];return c};function ime(o){return!!(o&&gg(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const cme=o=>{const a=new Array(10),c=(d,g)=>{if(GH(d)){if(a.indexOf(d)>=0)return;if(!("toJSON"in d)){a[g]=d;const p=FA(d)?[]:{};return _M(d,(v,x)=>{const T=c(v,g+1);!fM(T)&&(p[x]=T)}),a[g]=void 0,p}}return d};return c(o,0)},lme=Op("AsyncFunction"),ume=o=>o&&(GH(o)||gg(o))&&gg(o.then)&&gg(o.catch),Eie=((o,a)=>o?setImmediate:a?((c,d)=>(Lx.addEventListener("message",({source:g,data:p})=>{g===Lx&&p===c&&d.length&&d.shift()()},!1),g=>{d.push(g),Lx.postMessage(c,"*")}))(`axios@${Math.random()}`,[]):c=>setTimeout(c))(typeof setImmediate=="function",gg(Lx.postMessage)),dme=typeof queueMicrotask<"u"?queueMicrotask.bind(Lx):typeof process<"u"&&process.nextTick||Eie,Mn={isArray:FA,isArrayBuffer:vie,isBuffer:Afe,isFormData:Bfe,isArrayBufferView:Ofe,isString:Nfe,isNumber:yie,isBoolean:$fe,isObject:GH,isPlainObject:KV,isReadableStream:Lfe,isRequest:Vfe,isResponse:Hfe,isHeaders:zfe,isUndefined:fM,isDate:Dfe,isFile:Mfe,isBlob:Rfe,isRegExp:tme,isFunction:gg,isStream:Ife,isURLSearchParams:Ffe,isTypedArray:Kfe,isFileList:Pfe,forEach:_M,merge:pee,extend:jfe,trim:Ufe,stripBOM:Wfe,inherits:Zfe,toFlatObject:Gfe,kindOf:WH,kindOfTest:Op,endsWith:qfe,toArray:Yfe,forEachEntry:Xfe,matchAll:Jfe,isHTMLForm:Qfe,hasOwnProperty:Zoe,hasOwnProp:Zoe,reduceDescriptors:Sie,freezeMethods:nme,toObjectSet:ome,toCamelCase:eme,noop:sme,toFiniteNumber:rme,findKey:wie,global:Lx,isContextDefined:Cie,ALPHABET:xie,generateString:ame,isSpecCompliantForm:ime,toJSONObject:cme,isAsyncFn:lme,isThenable:ume,setImmediate:Eie,asap:dme};function Er(o,a,c,d,g){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=o,this.name="AxiosError",a&&(this.code=a),c&&(this.config=c),d&&(this.request=d),g&&(this.response=g,this.status=g.status?g.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 _ie=Er.prototype,Tie={};["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=>{Tie[o]={value:o}});Object.defineProperties(Er,Tie);Object.defineProperty(_ie,"isAxiosError",{value:!0});Er.from=(o,a,c,d,g,p)=>{const v=Object.create(_ie);return Mn.toFlatObject(o,v,function(x){return x!==Error.prototype},x=>x!=="isAxiosError"),Er.call(v,o.message,a,c,d,g),v.cause=o,v.name=o.name,p&&Object.assign(v,p),v};const fme=null;function bee(o){return Mn.isPlainObject(o)||Mn.isArray(o)}function kie(o){return Mn.endsWith(o,"[]")?o.slice(0,-2):o}function qoe(o,a,c){return o?o.concat(a).map(function(d,g){return d=kie(d),!c&&g?"["+d+"]":d}).join(c?".":""):a}function mme(o){return Mn.isArray(o)&&!o.some(bee)}const gme=Mn.toFlatObject(Mn,{},null,function(o){return/^is[A-Z]/.test(o)});function qH(o,a,c){if(!Mn.isObject(o))throw new TypeError("target must be an object");a=a||new FormData,c=Mn.toFlatObject(c,{metaTokens:!0,dots:!1,indexes:!1},!1,function(U,K){return!Mn.isUndefined(K[U])});const d=c.metaTokens,g=c.visitor||A,p=c.dots,v=c.indexes,x=(c.Blob||typeof Blob<"u"&&Blob)&&Mn.isSpecCompliantForm(a);if(!Mn.isFunction(g))throw new TypeError("visitor must be a function");function T(U){if(U===null)return"";if(Mn.isDate(U))return U.toISOString();if(!x&&Mn.isBlob(U))throw new Er("Blob is not supported. Use a Buffer instead.");return Mn.isArrayBuffer(U)||Mn.isTypedArray(U)?x&&typeof Blob=="function"?new Blob([U]):Buffer.from(U):U}function A(U,K,X){let Q=U;if(U&&!X&&typeof U=="object"){if(Mn.endsWith(K,"{}"))K=d?K:K.slice(0,-2),U=JSON.stringify(U);else if(Mn.isArray(U)&&mme(U)||(Mn.isFileList(U)||Mn.endsWith(K,"[]"))&&(Q=Mn.toArray(U)))return K=kie(K),Q.forEach(function(le,ae){!(Mn.isUndefined(le)||le===null)&&a.append(v===!0?qoe([K],ae,p):v===null?K:K+"[]",T(le))}),!1}return bee(U)?!0:(a.append(qoe(X,K,p),T(U)),!1)}const M=[],I=Object.assign(gme,{defaultVisitor:A,convertValue:T,isVisitable:bee});function z(U,K){if(!Mn.isUndefined(U)){if(M.indexOf(U)!==-1)throw Error("Circular reference detected in "+K.join("."));M.push(U),Mn.forEach(U,function(X,Q){(!(Mn.isUndefined(X)||X===null)&&g.call(a,X,Mn.isString(Q)?Q.trim():Q,K,I))===!0&&z(X,K?K.concat(Q):[Q])}),M.pop()}}if(!Mn.isObject(o))throw new TypeError("data must be an object");return z(o),a}function Yoe(o){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(c){return a[c]})}function ute(o,a){this._pairs=[],o&&qH(o,this,a)}const Aie=ute.prototype;Aie.append=function(o,a){this._pairs.push([o,a])};Aie.toString=function(o){const a=o?function(c){return o.call(this,c,Yoe)}:Yoe;return this._pairs.map(function(c){return a(c[0])+"="+a(c[1])},"").join("&")};function hme(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Oie(o,a,c){if(!a)return o;const d=c&&c.encode||hme;Mn.isFunction(c)&&(c={serialize:c});const g=c&&c.serialize;let p;if(g?p=g(a,c):p=Mn.isURLSearchParams(a)?a.toString():new ute(a,c).toString(d),p){const v=o.indexOf("#");v!==-1&&(o=o.slice(0,v)),o+=(o.indexOf("?")===-1?"?":"&")+p}return o}let Koe=class{constructor(){this.handlers=[]}use(a,c,d){return this.handlers.push({fulfilled:a,rejected:c,synchronous:d?d.synchronous:!1,runWhen:d?d.runWhen:null}),this.handlers.length-1}eject(a){this.handlers[a]&&(this.handlers[a]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(a){Mn.forEach(this.handlers,function(c){c!==null&&a(c)})}};const Nie={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pme=typeof URLSearchParams<"u"?URLSearchParams:ute,bme=typeof FormData<"u"?FormData:null,vme=typeof Blob<"u"?Blob:null,yme={isBrowser:!0,classes:{URLSearchParams:pme,FormData:bme,Blob:vme},protocols:["http","https","file","blob","url","data"]},dte=typeof window<"u"&&typeof document<"u",vee=typeof navigator=="object"&&navigator||void 0,wme=dte&&(!vee||["ReactNative","NativeScript","NS"].indexOf(vee.product)<0),Cme=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Sme=dte&&window.location.href||"http://localhost",xme=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:dte,hasStandardBrowserEnv:wme,hasStandardBrowserWebWorkerEnv:Cme,navigator:vee,origin:Sme},Symbol.toStringTag,{value:"Module"})),Gd={...xme,...yme};function Eme(o,a){return qH(o,new Gd.classes.URLSearchParams,Object.assign({visitor:function(c,d,g,p){return Gd.isNode&&Mn.isBuffer(c)?(this.append(d,c.toString("base64")),!1):p.defaultVisitor.apply(this,arguments)}},a))}function _me(o){return Mn.matchAll(/\w+|\[(\w*)]/g,o).map(a=>a[0]==="[]"?"":a[1]||a[0])}function Tme(o){const a={},c=Object.keys(o);let d;const g=c.length;let p;for(d=0;d<g;d++)p=c[d],a[p]=o[p];return a}function $ie(o){function a(c,d,g,p){let v=c[p++];if(v==="__proto__")return!0;const x=Number.isFinite(+v),T=p>=c.length;return v=!v&&Mn.isArray(g)?g.length:v,T?(Mn.hasOwnProp(g,v)?g[v]=[g[v],d]:g[v]=d,!x):((!g[v]||!Mn.isObject(g[v]))&&(g[v]=[]),a(c,d,g[v],p)&&Mn.isArray(g[v])&&(g[v]=Tme(g[v])),!x)}if(Mn.isFormData(o)&&Mn.isFunction(o.entries)){const c={};return Mn.forEachEntry(o,(d,g)=>{a(_me(d),g,c,0)}),c}return null}function kme(o,a,c){if(Mn.isString(o))try{return(a||JSON.parse)(o),Mn.trim(o)}catch(d){if(d.name!=="SyntaxError")throw d}return(0,JSON.stringify)(o)}const TM={transitional:Nie,adapter:["xhr","http","fetch"],transformRequest:[function(o,a){const c=a.getContentType()||"",d=c.indexOf("application/json")>-1,g=Mn.isObject(o);if(g&&Mn.isHTMLForm(o)&&(o=new FormData(o)),Mn.isFormData(o))return d?JSON.stringify($ie(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 a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let p;if(g){if(c.indexOf("application/x-www-form-urlencoded")>-1)return Eme(o,this.formSerializer).toString();if((p=Mn.isFileList(o))||c.indexOf("multipart/form-data")>-1){const v=this.env&&this.env.FormData;return qH(p?{"files[]":o}:o,v&&new v,this.formSerializer)}}return g||d?(a.setContentType("application/json",!1),kme(o)):o}],transformResponse:[function(o){const a=this.transitional||TM.transitional,c=a&&a.forcedJSONParsing,d=this.responseType==="json";if(Mn.isResponse(o)||Mn.isReadableStream(o))return o;if(o&&Mn.isString(o)&&(c&&!this.responseType||d)){const g=!(a&&a.silentJSONParsing)&&d;try{return JSON.parse(o)}catch(p){if(g)throw p.name==="SyntaxError"?Er.from(p,Er.ERR_BAD_RESPONSE,this,null,this.response):p}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Gd.classes.FormData,Blob:Gd.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=>{TM.headers[o]={}});const Ame=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"]),Ome=o=>{const a={};let c,d,g;return o&&o.split(`
|
|
1
|
+
"use strict";var Sfe=Object.defineProperty;var xfe=(o,a,c)=>a in o?Sfe(o,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):o[a]=c;var Bl=(o,a,c)=>xfe(o,typeof a!="symbol"?a+"":a,c);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const w=require("vue"),Ko=require("element-plus"),Efe="0.0.17";var _fe=Object.defineProperty,Tfe=(o,a,c)=>a in o?_fe(o,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):o[a]=c,CQ=(o,a,c)=>Tfe(o,typeof a!="symbol"?a+"":a,c);function bie(o,a){return function(){return o.apply(a,arguments)}}const{toString:kfe}=Object.prototype,{getPrototypeOf:lte}=Object,WH=(o=>a=>{const c=kfe.call(a);return o[c]||(o[c]=c.slice(8,-1).toLowerCase())})(Object.create(null)),Op=o=>(o=o.toLowerCase(),a=>WH(a)===o),ZH=o=>a=>typeof a===o,{isArray:FA}=Array,fM=ZH("undefined");function Afe(o){return o!==null&&!fM(o)&&o.constructor!==null&&!fM(o.constructor)&&gg(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const vie=Op("ArrayBuffer");function Ofe(o){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(o):a=o&&o.buffer&&vie(o.buffer),a}const Nfe=ZH("string"),gg=ZH("function"),yie=ZH("number"),GH=o=>o!==null&&typeof o=="object",$fe=o=>o===!0||o===!1,KV=o=>{if(WH(o)!=="object")return!1;const a=lte(o);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},Dfe=Op("Date"),Mfe=Op("File"),Rfe=Op("Blob"),Pfe=Op("FileList"),Ife=o=>GH(o)&&gg(o.pipe),Bfe=o=>{let a;return o&&(typeof FormData=="function"&&o instanceof FormData||gg(o.append)&&((a=WH(o))==="formdata"||a==="object"&&gg(o.toString)&&o.toString()==="[object FormData]"))},Ffe=Op("URLSearchParams"),[Lfe,Vfe,Hfe,zfe]=["ReadableStream","Request","Response","Headers"].map(Op),Ufe=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function _M(o,a,{allOwnKeys:c=!1}={}){if(o===null||typeof o>"u")return;let d,g;if(typeof o!="object"&&(o=[o]),FA(o))for(d=0,g=o.length;d<g;d++)a.call(null,o[d],d,o);else{const p=c?Object.getOwnPropertyNames(o):Object.keys(o),v=p.length;let x;for(d=0;d<v;d++)x=p[d],a.call(null,o[x],x,o)}}function wie(o,a){a=a.toLowerCase();const c=Object.keys(o);let d=c.length,g;for(;d-- >0;)if(g=c[d],a===g.toLowerCase())return g;return null}const Lx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Cie=o=>!fM(o)&&o!==Lx;function pee(){const{caseless:o}=Cie(this)&&this||{},a={},c=(d,g)=>{const p=o&&wie(a,g)||g;KV(a[p])&&KV(d)?a[p]=pee(a[p],d):KV(d)?a[p]=pee({},d):FA(d)?a[p]=d.slice():a[p]=d};for(let d=0,g=arguments.length;d<g;d++)arguments[d]&&_M(arguments[d],c);return a}const jfe=(o,a,c,{allOwnKeys:d}={})=>(_M(a,(g,p)=>{c&&gg(g)?o[p]=bie(g,c):o[p]=g},{allOwnKeys:d}),o),Wfe=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),Zfe=(o,a,c,d)=>{o.prototype=Object.create(a.prototype,d),o.prototype.constructor=o,Object.defineProperty(o,"super",{value:a.prototype}),c&&Object.assign(o.prototype,c)},Gfe=(o,a,c,d)=>{let g,p,v;const x={};if(a=a||{},o==null)return a;do{for(g=Object.getOwnPropertyNames(o),p=g.length;p-- >0;)v=g[p],(!d||d(v,o,a))&&!x[v]&&(a[v]=o[v],x[v]=!0);o=c!==!1&<e(o)}while(o&&(!c||c(o,a))&&o!==Object.prototype);return a},qfe=(o,a,c)=>{o=String(o),(c===void 0||c>o.length)&&(c=o.length),c-=a.length;const d=o.indexOf(a,c);return d!==-1&&d===c},Yfe=o=>{if(!o)return null;if(FA(o))return o;let a=o.length;if(!yie(a))return null;const c=new Array(a);for(;a-- >0;)c[a]=o[a];return c},Kfe=(o=>a=>o&&a instanceof o)(typeof Uint8Array<"u"&<e(Uint8Array)),Xfe=(o,a)=>{const c=(o&&o[Symbol.iterator]).call(o);let d;for(;(d=c.next())&&!d.done;){const g=d.value;a.call(o,g[0],g[1])}},Jfe=(o,a)=>{let c;const d=[];for(;(c=o.exec(a))!==null;)d.push(c);return d},Qfe=Op("HTMLFormElement"),eme=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,c,d){return c.toUpperCase()+d}),Zoe=(({hasOwnProperty:o})=>(a,c)=>o.call(a,c))(Object.prototype),tme=Op("RegExp"),Sie=(o,a)=>{const c=Object.getOwnPropertyDescriptors(o),d={};_M(c,(g,p)=>{let v;(v=a(g,p,o))!==!1&&(d[p]=v||g)}),Object.defineProperties(o,d)},nme=o=>{Sie(o,(a,c)=>{if(gg(o)&&["arguments","caller","callee"].indexOf(c)!==-1)return!1;const d=o[c];if(gg(d)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+c+"'")})}})},ome=(o,a)=>{const c={},d=g=>{g.forEach(p=>{c[p]=!0})};return FA(o)?d(o):d(String(o).split(a)),c},sme=()=>{},rme=(o,a)=>o!=null&&Number.isFinite(o=+o)?o:a,SQ="abcdefghijklmnopqrstuvwxyz",Goe="0123456789",xie={DIGIT:Goe,ALPHA:SQ,ALPHA_DIGIT:SQ+SQ.toUpperCase()+Goe},ame=(o=16,a=xie.ALPHA_DIGIT)=>{let c="";const{length:d}=a;for(;o--;)c+=a[Math.random()*d|0];return c};function ime(o){return!!(o&&gg(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const cme=o=>{const a=new Array(10),c=(d,g)=>{if(GH(d)){if(a.indexOf(d)>=0)return;if(!("toJSON"in d)){a[g]=d;const p=FA(d)?[]:{};return _M(d,(v,x)=>{const T=c(v,g+1);!fM(T)&&(p[x]=T)}),a[g]=void 0,p}}return d};return c(o,0)},lme=Op("AsyncFunction"),ume=o=>o&&(GH(o)||gg(o))&&gg(o.then)&&gg(o.catch),Eie=((o,a)=>o?setImmediate:a?((c,d)=>(Lx.addEventListener("message",({source:g,data:p})=>{g===Lx&&p===c&&d.length&&d.shift()()},!1),g=>{d.push(g),Lx.postMessage(c,"*")}))(`axios@${Math.random()}`,[]):c=>setTimeout(c))(typeof setImmediate=="function",gg(Lx.postMessage)),dme=typeof queueMicrotask<"u"?queueMicrotask.bind(Lx):typeof process<"u"&&process.nextTick||Eie,Mn={isArray:FA,isArrayBuffer:vie,isBuffer:Afe,isFormData:Bfe,isArrayBufferView:Ofe,isString:Nfe,isNumber:yie,isBoolean:$fe,isObject:GH,isPlainObject:KV,isReadableStream:Lfe,isRequest:Vfe,isResponse:Hfe,isHeaders:zfe,isUndefined:fM,isDate:Dfe,isFile:Mfe,isBlob:Rfe,isRegExp:tme,isFunction:gg,isStream:Ife,isURLSearchParams:Ffe,isTypedArray:Kfe,isFileList:Pfe,forEach:_M,merge:pee,extend:jfe,trim:Ufe,stripBOM:Wfe,inherits:Zfe,toFlatObject:Gfe,kindOf:WH,kindOfTest:Op,endsWith:qfe,toArray:Yfe,forEachEntry:Xfe,matchAll:Jfe,isHTMLForm:Qfe,hasOwnProperty:Zoe,hasOwnProp:Zoe,reduceDescriptors:Sie,freezeMethods:nme,toObjectSet:ome,toCamelCase:eme,noop:sme,toFiniteNumber:rme,findKey:wie,global:Lx,isContextDefined:Cie,ALPHABET:xie,generateString:ame,isSpecCompliantForm:ime,toJSONObject:cme,isAsyncFn:lme,isThenable:ume,setImmediate:Eie,asap:dme};function Er(o,a,c,d,g){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=o,this.name="AxiosError",a&&(this.code=a),c&&(this.config=c),d&&(this.request=d),g&&(this.response=g,this.status=g.status?g.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 _ie=Er.prototype,Tie={};["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=>{Tie[o]={value:o}});Object.defineProperties(Er,Tie);Object.defineProperty(_ie,"isAxiosError",{value:!0});Er.from=(o,a,c,d,g,p)=>{const v=Object.create(_ie);return Mn.toFlatObject(o,v,function(x){return x!==Error.prototype},x=>x!=="isAxiosError"),Er.call(v,o.message,a,c,d,g),v.cause=o,v.name=o.name,p&&Object.assign(v,p),v};const fme=null;function bee(o){return Mn.isPlainObject(o)||Mn.isArray(o)}function kie(o){return Mn.endsWith(o,"[]")?o.slice(0,-2):o}function qoe(o,a,c){return o?o.concat(a).map(function(d,g){return d=kie(d),!c&&g?"["+d+"]":d}).join(c?".":""):a}function mme(o){return Mn.isArray(o)&&!o.some(bee)}const gme=Mn.toFlatObject(Mn,{},null,function(o){return/^is[A-Z]/.test(o)});function qH(o,a,c){if(!Mn.isObject(o))throw new TypeError("target must be an object");a=a||new FormData,c=Mn.toFlatObject(c,{metaTokens:!0,dots:!1,indexes:!1},!1,function(U,K){return!Mn.isUndefined(K[U])});const d=c.metaTokens,g=c.visitor||A,p=c.dots,v=c.indexes,x=(c.Blob||typeof Blob<"u"&&Blob)&&Mn.isSpecCompliantForm(a);if(!Mn.isFunction(g))throw new TypeError("visitor must be a function");function T(U){if(U===null)return"";if(Mn.isDate(U))return U.toISOString();if(!x&&Mn.isBlob(U))throw new Er("Blob is not supported. Use a Buffer instead.");return Mn.isArrayBuffer(U)||Mn.isTypedArray(U)?x&&typeof Blob=="function"?new Blob([U]):Buffer.from(U):U}function A(U,K,X){let Q=U;if(U&&!X&&typeof U=="object"){if(Mn.endsWith(K,"{}"))K=d?K:K.slice(0,-2),U=JSON.stringify(U);else if(Mn.isArray(U)&&mme(U)||(Mn.isFileList(U)||Mn.endsWith(K,"[]"))&&(Q=Mn.toArray(U)))return K=kie(K),Q.forEach(function(le,ae){!(Mn.isUndefined(le)||le===null)&&a.append(v===!0?qoe([K],ae,p):v===null?K:K+"[]",T(le))}),!1}return bee(U)?!0:(a.append(qoe(X,K,p),T(U)),!1)}const M=[],I=Object.assign(gme,{defaultVisitor:A,convertValue:T,isVisitable:bee});function z(U,K){if(!Mn.isUndefined(U)){if(M.indexOf(U)!==-1)throw Error("Circular reference detected in "+K.join("."));M.push(U),Mn.forEach(U,function(X,Q){(!(Mn.isUndefined(X)||X===null)&&g.call(a,X,Mn.isString(Q)?Q.trim():Q,K,I))===!0&&z(X,K?K.concat(Q):[Q])}),M.pop()}}if(!Mn.isObject(o))throw new TypeError("data must be an object");return z(o),a}function Yoe(o){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(c){return a[c]})}function ute(o,a){this._pairs=[],o&&qH(o,this,a)}const Aie=ute.prototype;Aie.append=function(o,a){this._pairs.push([o,a])};Aie.toString=function(o){const a=o?function(c){return o.call(this,c,Yoe)}:Yoe;return this._pairs.map(function(c){return a(c[0])+"="+a(c[1])},"").join("&")};function hme(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Oie(o,a,c){if(!a)return o;const d=c&&c.encode||hme;Mn.isFunction(c)&&(c={serialize:c});const g=c&&c.serialize;let p;if(g?p=g(a,c):p=Mn.isURLSearchParams(a)?a.toString():new ute(a,c).toString(d),p){const v=o.indexOf("#");v!==-1&&(o=o.slice(0,v)),o+=(o.indexOf("?")===-1?"?":"&")+p}return o}let Koe=class{constructor(){this.handlers=[]}use(a,c,d){return this.handlers.push({fulfilled:a,rejected:c,synchronous:d?d.synchronous:!1,runWhen:d?d.runWhen:null}),this.handlers.length-1}eject(a){this.handlers[a]&&(this.handlers[a]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(a){Mn.forEach(this.handlers,function(c){c!==null&&a(c)})}};const Nie={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pme=typeof URLSearchParams<"u"?URLSearchParams:ute,bme=typeof FormData<"u"?FormData:null,vme=typeof Blob<"u"?Blob:null,yme={isBrowser:!0,classes:{URLSearchParams:pme,FormData:bme,Blob:vme},protocols:["http","https","file","blob","url","data"]},dte=typeof window<"u"&&typeof document<"u",vee=typeof navigator=="object"&&navigator||void 0,wme=dte&&(!vee||["ReactNative","NativeScript","NS"].indexOf(vee.product)<0),Cme=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Sme=dte&&window.location.href||"http://localhost",xme=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:dte,hasStandardBrowserEnv:wme,hasStandardBrowserWebWorkerEnv:Cme,navigator:vee,origin:Sme},Symbol.toStringTag,{value:"Module"})),Gd={...xme,...yme};function Eme(o,a){return qH(o,new Gd.classes.URLSearchParams,Object.assign({visitor:function(c,d,g,p){return Gd.isNode&&Mn.isBuffer(c)?(this.append(d,c.toString("base64")),!1):p.defaultVisitor.apply(this,arguments)}},a))}function _me(o){return Mn.matchAll(/\w+|\[(\w*)]/g,o).map(a=>a[0]==="[]"?"":a[1]||a[0])}function Tme(o){const a={},c=Object.keys(o);let d;const g=c.length;let p;for(d=0;d<g;d++)p=c[d],a[p]=o[p];return a}function $ie(o){function a(c,d,g,p){let v=c[p++];if(v==="__proto__")return!0;const x=Number.isFinite(+v),T=p>=c.length;return v=!v&&Mn.isArray(g)?g.length:v,T?(Mn.hasOwnProp(g,v)?g[v]=[g[v],d]:g[v]=d,!x):((!g[v]||!Mn.isObject(g[v]))&&(g[v]=[]),a(c,d,g[v],p)&&Mn.isArray(g[v])&&(g[v]=Tme(g[v])),!x)}if(Mn.isFormData(o)&&Mn.isFunction(o.entries)){const c={};return Mn.forEachEntry(o,(d,g)=>{a(_me(d),g,c,0)}),c}return null}function kme(o,a,c){if(Mn.isString(o))try{return(a||JSON.parse)(o),Mn.trim(o)}catch(d){if(d.name!=="SyntaxError")throw d}return(0,JSON.stringify)(o)}const TM={transitional:Nie,adapter:["xhr","http","fetch"],transformRequest:[function(o,a){const c=a.getContentType()||"",d=c.indexOf("application/json")>-1,g=Mn.isObject(o);if(g&&Mn.isHTMLForm(o)&&(o=new FormData(o)),Mn.isFormData(o))return d?JSON.stringify($ie(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 a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let p;if(g){if(c.indexOf("application/x-www-form-urlencoded")>-1)return Eme(o,this.formSerializer).toString();if((p=Mn.isFileList(o))||c.indexOf("multipart/form-data")>-1){const v=this.env&&this.env.FormData;return qH(p?{"files[]":o}:o,v&&new v,this.formSerializer)}}return g||d?(a.setContentType("application/json",!1),kme(o)):o}],transformResponse:[function(o){const a=this.transitional||TM.transitional,c=a&&a.forcedJSONParsing,d=this.responseType==="json";if(Mn.isResponse(o)||Mn.isReadableStream(o))return o;if(o&&Mn.isString(o)&&(c&&!this.responseType||d)){const g=!(a&&a.silentJSONParsing)&&d;try{return JSON.parse(o)}catch(p){if(g)throw p.name==="SyntaxError"?Er.from(p,Er.ERR_BAD_RESPONSE,this,null,this.response):p}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Gd.classes.FormData,Blob:Gd.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=>{TM.headers[o]={}});const Ame=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"]),Ome=o=>{const a={};let c,d,g;return o&&o.split(`
|
|
2
2
|
`).forEach(function(p){g=p.indexOf(":"),c=p.substring(0,g).trim().toLowerCase(),d=p.substring(g+1).trim(),!(!c||a[c]&&Ame[c])&&(c==="set-cookie"?a[c]?a[c].push(d):a[c]=[d]:a[c]=a[c]?a[c]+", "+d:d)}),a},Xoe=Symbol("internals");function Z6(o){return o&&String(o).trim().toLowerCase()}function XV(o){return o===!1||o==null?o:Mn.isArray(o)?o.map(XV):String(o)}function Nme(o){const a=Object.create(null),c=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let d;for(;d=c.exec(o);)a[d[1]]=d[2];return a}const $me=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function xQ(o,a,c,d,g){if(Mn.isFunction(d))return d.call(this,a,c);if(g&&(a=c),!!Mn.isString(a)){if(Mn.isString(d))return a.indexOf(d)!==-1;if(Mn.isRegExp(d))return d.test(a)}}function Dme(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(a,c,d)=>c.toUpperCase()+d)}function Mme(o,a){const c=Mn.toCamelCase(" "+a);["get","set","has"].forEach(d=>{Object.defineProperty(o,d+c,{value:function(g,p,v){return this[d].call(this,a,g,p,v)},configurable:!0})})}let vm=class{constructor(a){a&&this.set(a)}set(a,c,d){const g=this;function p(x,T,A){const M=Z6(T);if(!M)throw new Error("header name must be a non-empty string");const I=Mn.findKey(g,M);(!I||g[I]===void 0||A===!0||A===void 0&&g[I]!==!1)&&(g[I||T]=XV(x))}const v=(x,T)=>Mn.forEach(x,(A,M)=>p(A,M,T));if(Mn.isPlainObject(a)||a instanceof this.constructor)v(a,c);else if(Mn.isString(a)&&(a=a.trim())&&!$me(a))v(Ome(a),c);else if(Mn.isHeaders(a))for(const[x,T]of a.entries())p(T,x,d);else a!=null&&p(c,a,d);return this}get(a,c){if(a=Z6(a),a){const d=Mn.findKey(this,a);if(d){const g=this[d];if(!c)return g;if(c===!0)return Nme(g);if(Mn.isFunction(c))return c.call(this,g,d);if(Mn.isRegExp(c))return c.exec(g);throw new TypeError("parser must be boolean|regexp|function")}}}has(a,c){if(a=Z6(a),a){const d=Mn.findKey(this,a);return!!(d&&this[d]!==void 0&&(!c||xQ(this,this[d],d,c)))}return!1}delete(a,c){const d=this;let g=!1;function p(v){if(v=Z6(v),v){const x=Mn.findKey(d,v);x&&(!c||xQ(d,d[x],x,c))&&(delete d[x],g=!0)}}return Mn.isArray(a)?a.forEach(p):p(a),g}clear(a){const c=Object.keys(this);let d=c.length,g=!1;for(;d--;){const p=c[d];(!a||xQ(this,this[p],p,a,!0))&&(delete this[p],g=!0)}return g}normalize(a){const c=this,d={};return Mn.forEach(this,(g,p)=>{const v=Mn.findKey(d,p);if(v){c[v]=XV(g),delete c[p];return}const x=a?Dme(p):String(p).trim();x!==p&&delete c[p],c[x]=XV(g),d[x]=!0}),this}concat(...a){return this.constructor.concat(this,...a)}toJSON(a){const c=Object.create(null);return Mn.forEach(this,(d,g)=>{d!=null&&d!==!1&&(c[g]=a&&Mn.isArray(d)?d.join(", "):d)}),c}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([a,c])=>a+": "+c).join(`
|
|
3
3
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(a){return a instanceof this?a:new this(a)}static concat(a,...c){const d=new this(a);return c.forEach(g=>d.set(g)),d}static accessor(a){const c=(this[Xoe]=this[Xoe]={accessors:{}}).accessors,d=this.prototype;function g(p){const v=Z6(p);c[v]||(Mme(d,p),c[v]=!0)}return Mn.isArray(a)?a.forEach(g):g(a),this}};vm.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Mn.reduceDescriptors(vm.prototype,({value:o},a)=>{let c=a[0].toUpperCase()+a.slice(1);return{get:()=>o,set(d){this[c]=d}}});Mn.freezeMethods(vm);function EQ(o,a){const c=this||TM,d=a||c,g=vm.from(d.headers);let p=d.data;return Mn.forEach(o,function(v){p=v.call(c,p,g.normalize(),a?a.status:void 0)}),g.normalize(),p}function Die(o){return!!(o&&o.__CANCEL__)}function LA(o,a,c){Er.call(this,o??"canceled",Er.ERR_CANCELED,a,c),this.name="CanceledError"}Mn.inherits(LA,Er,{__CANCEL__:!0});function Mie(o,a,c){const d=c.config.validateStatus;!c.status||!d||d(c.status)?o(c):a(new Er("Request failed with status code "+c.status,[Er.ERR_BAD_REQUEST,Er.ERR_BAD_RESPONSE][Math.floor(c.status/100)-4],c.config,c.request,c))}function Rme(o){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return a&&a[1]||""}function Pme(o,a){o=o||10;const c=new Array(o),d=new Array(o);let g=0,p=0,v;return a=a!==void 0?a:1e3,function(x){const T=Date.now(),A=d[p];v||(v=T),c[g]=x,d[g]=T;let M=p,I=0;for(;M!==g;)I+=c[M++],M=M%o;if(g=(g+1)%o,g===p&&(p=(p+1)%o),T-v<a)return;const z=A&&T-A;return z?Math.round(I*1e3/z):void 0}}function Ime(o,a){let c=0,d=1e3/a,g,p;const v=(x,T=Date.now())=>{c=T,g=null,p&&(clearTimeout(p),p=null),o.apply(null,x)};return[(...x)=>{const T=Date.now(),A=T-c;A>=d?v(x,T):(g=x,p||(p=setTimeout(()=>{p=null,v(g)},d-A)))},()=>g&&v(g)]}const dH=(o,a,c=3)=>{let d=0;const g=Pme(50,250);return Ime(p=>{const v=p.loaded,x=p.lengthComputable?p.total:void 0,T=v-d,A=g(T),M=v<=x;d=v;const I={loaded:v,total:x,progress:x?v/x:void 0,bytes:T,rate:A||void 0,estimated:A&&x&&M?(x-v)/A:void 0,event:p,lengthComputable:x!=null,[a?"download":"upload"]:!0};o(I)},c)},Joe=(o,a)=>{const c=o!=null;return[d=>a[0]({lengthComputable:c,total:o,loaded:d}),a[1]]},Qoe=o=>(...a)=>Mn.asap(()=>o(...a)),Bme=Gd.hasStandardBrowserEnv?((o,a)=>c=>(c=new URL(c,Gd.origin),o.protocol===c.protocol&&o.host===c.host&&(a||o.port===c.port)))(new URL(Gd.origin),Gd.navigator&&/(msie|trident)/i.test(Gd.navigator.userAgent)):()=>!0,Fme=Gd.hasStandardBrowserEnv?{write(o,a,c,d,g,p){const v=[o+"="+encodeURIComponent(a)];Mn.isNumber(c)&&v.push("expires="+new Date(c).toGMTString()),Mn.isString(d)&&v.push("path="+d),Mn.isString(g)&&v.push("domain="+g),p===!0&&v.push("secure"),document.cookie=v.join("; ")},read(o){const a=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove(o){this.write(o,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Lme(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function Vme(o,a){return a?o.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):o}function Rie(o,a){return o&&!Lme(a)?Vme(o,a):a}const ese=o=>o instanceof vm?{...o}:o;function Kx(o,a){a=a||{};const c={};function d(A,M,I,z){return Mn.isPlainObject(A)&&Mn.isPlainObject(M)?Mn.merge.call({caseless:z},A,M):Mn.isPlainObject(M)?Mn.merge({},M):Mn.isArray(M)?M.slice():M}function g(A,M,I,z){if(Mn.isUndefined(M)){if(!Mn.isUndefined(A))return d(void 0,A,I,z)}else return d(A,M,I,z)}function p(A,M){if(!Mn.isUndefined(M))return d(void 0,M)}function v(A,M){if(Mn.isUndefined(M)){if(!Mn.isUndefined(A))return d(void 0,A)}else return d(void 0,M)}function x(A,M,I){if(I in a)return d(A,M);if(I in o)return d(void 0,A)}const T={url:p,method:p,data:p,baseURL:v,transformRequest:v,transformResponse:v,paramsSerializer:v,timeout:v,timeoutMessage:v,withCredentials:v,withXSRFToken:v,adapter:v,responseType:v,xsrfCookieName:v,xsrfHeaderName:v,onUploadProgress:v,onDownloadProgress:v,decompress:v,maxContentLength:v,maxBodyLength:v,beforeRedirect:v,transport:v,httpAgent:v,httpsAgent:v,cancelToken:v,socketPath:v,responseEncoding:v,validateStatus:x,headers:(A,M,I)=>g(ese(A),ese(M),I,!0)};return Mn.forEach(Object.keys(Object.assign({},o,a)),function(A){const M=T[A]||g,I=M(o[A],a[A],A);Mn.isUndefined(I)&&M!==x||(c[A]=I)}),c}const Pie=o=>{const a=Kx({},o);let{data:c,withXSRFToken:d,xsrfHeaderName:g,xsrfCookieName:p,headers:v,auth:x}=a;a.headers=v=vm.from(v),a.url=Oie(Rie(a.baseURL,a.url),o.params,o.paramsSerializer),x&&v.set("Authorization","Basic "+btoa((x.username||"")+":"+(x.password?unescape(encodeURIComponent(x.password)):"")));let T;if(Mn.isFormData(c)){if(Gd.hasStandardBrowserEnv||Gd.hasStandardBrowserWebWorkerEnv)v.setContentType(void 0);else if((T=v.getContentType())!==!1){const[A,...M]=T?T.split(";").map(I=>I.trim()).filter(Boolean):[];v.setContentType([A||"multipart/form-data",...M].join("; "))}}if(Gd.hasStandardBrowserEnv&&(d&&Mn.isFunction(d)&&(d=d(a)),d||d!==!1&&Bme(a.url))){const A=g&&p&&Fme.read(p);A&&v.set(g,A)}return a},Hme=typeof XMLHttpRequest<"u",zme=Hme&&function(o){return new Promise(function(a,c){const d=Pie(o);let g=d.data;const p=vm.from(d.headers).normalize();let{responseType:v,onUploadProgress:x,onDownloadProgress:T}=d,A,M,I,z,U;function K(){z&&z(),U&&U(),d.cancelToken&&d.cancelToken.unsubscribe(A),d.signal&&d.signal.removeEventListener("abort",A)}let X=new XMLHttpRequest;X.open(d.method.toUpperCase(),d.url,!0),X.timeout=d.timeout;function Q(){if(!X)return;const ae=vm.from("getAllResponseHeaders"in X&&X.getAllResponseHeaders()),Z={data:!v||v==="text"||v==="json"?X.responseText:X.response,status:X.status,statusText:X.statusText,headers:ae,config:o,request:X};Mie(function(Ce){a(Ce),K()},function(Ce){c(Ce),K()},Z),X=null}"onloadend"in X?X.onloadend=Q:X.onreadystatechange=function(){!X||X.readyState!==4||X.status===0&&!(X.responseURL&&X.responseURL.indexOf("file:")===0)||setTimeout(Q)},X.onabort=function(){X&&(c(new Er("Request aborted",Er.ECONNABORTED,o,X)),X=null)},X.onerror=function(){c(new Er("Network Error",Er.ERR_NETWORK,o,X)),X=null},X.ontimeout=function(){let ae=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded";const Z=d.transitional||Nie;d.timeoutErrorMessage&&(ae=d.timeoutErrorMessage),c(new Er(ae,Z.clarifyTimeoutError?Er.ETIMEDOUT:Er.ECONNABORTED,o,X)),X=null},g===void 0&&p.setContentType(null),"setRequestHeader"in X&&Mn.forEach(p.toJSON(),function(ae,Z){X.setRequestHeader(Z,ae)}),Mn.isUndefined(d.withCredentials)||(X.withCredentials=!!d.withCredentials),v&&v!=="json"&&(X.responseType=d.responseType),T&&([I,U]=dH(T,!0),X.addEventListener("progress",I)),x&&X.upload&&([M,z]=dH(x),X.upload.addEventListener("progress",M),X.upload.addEventListener("loadend",z)),(d.cancelToken||d.signal)&&(A=ae=>{X&&(c(!ae||ae.type?new LA(null,o,X):ae),X.abort(),X=null)},d.cancelToken&&d.cancelToken.subscribe(A),d.signal&&(d.signal.aborted?A():d.signal.addEventListener("abort",A)));const le=Rme(d.url);if(le&&Gd.protocols.indexOf(le)===-1){c(new Er("Unsupported protocol "+le+":",Er.ERR_BAD_REQUEST,o));return}X.send(g||null)})},Ume=(o,a)=>{const{length:c}=o=o?o.filter(Boolean):[];if(a||c){let d=new AbortController,g;const p=function(A){if(!g){g=!0,x();const M=A instanceof Error?A:this.reason;d.abort(M instanceof Er?M:new LA(M instanceof Error?M.message:M))}};let v=a&&setTimeout(()=>{v=null,p(new Er(`timeout ${a} of ms exceeded`,Er.ETIMEDOUT))},a);const x=()=>{o&&(v&&clearTimeout(v),v=null,o.forEach(A=>{A.unsubscribe?A.unsubscribe(p):A.removeEventListener("abort",p)}),o=null)};o.forEach(A=>A.addEventListener("abort",p));const{signal:T}=d;return T.unsubscribe=()=>Mn.asap(x),T}},jme=function*(o,a){let c=o.byteLength;if(c<a){yield o;return}let d=0,g;for(;d<c;)g=d+a,yield o.slice(d,g),d=g},Wme=async function*(o,a){for await(const c of Zme(o))yield*jme(c,a)},Zme=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}const a=o.getReader();try{for(;;){const{done:c,value:d}=await a.read();if(c)break;yield d}}finally{await a.cancel()}},tse=(o,a,c,d)=>{const g=Wme(o,a);let p=0,v,x=T=>{v||(v=!0,d&&d(T))};return new ReadableStream({async pull(T){try{const{done:A,value:M}=await g.next();if(A){x(),T.close();return}let I=M.byteLength;if(c){let z=p+=I;c(z)}T.enqueue(new Uint8Array(M))}catch(A){throw x(A),A}},cancel(T){return x(T),g.return()}},{highWaterMark:2})},YH=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Iie=YH&&typeof ReadableStream=="function",Gme=YH&&(typeof TextEncoder=="function"?(o=>a=>o.encode(a))(new TextEncoder):async o=>new Uint8Array(await new Response(o).arrayBuffer())),Bie=(o,...a)=>{try{return!!o(...a)}catch{return!1}},qme=Iie&&Bie(()=>{let o=!1;const a=new Request(Gd.origin,{body:new ReadableStream,method:"POST",get duplex(){return o=!0,"half"}}).headers.has("Content-Type");return o&&!a}),nse=64*1024,yee=Iie&&Bie(()=>Mn.isReadableStream(new Response("").body)),fH={stream:yee&&(o=>o.body)};YH&&(o=>{["text","arrayBuffer","blob","formData","stream"].forEach(a=>{!fH[a]&&(fH[a]=Mn.isFunction(o[a])?c=>c[a]():(c,d)=>{throw new Er(`Response type '${a}' is not supported`,Er.ERR_NOT_SUPPORT,d)})})})(new Response);const Yme=async o=>{if(o==null)return 0;if(Mn.isBlob(o))return o.size;if(Mn.isSpecCompliantForm(o))return(await new Request(Gd.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 Gme(o)).byteLength},Kme=async(o,a)=>Mn.toFiniteNumber(o.getContentLength())??Yme(a),Xme=YH&&(async o=>{let{url:a,method:c,data:d,signal:g,cancelToken:p,timeout:v,onDownloadProgress:x,onUploadProgress:T,responseType:A,headers:M,withCredentials:I="same-origin",fetchOptions:z}=Pie(o);A=A?(A+"").toLowerCase():"text";let U=Ume([g,p&&p.toAbortSignal()],v),K;const X=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let Q;try{if(T&&qme&&c!=="get"&&c!=="head"&&(Q=await Kme(M,d))!==0){let ct=new Request(a,{method:"POST",body:d,duplex:"half"}),Ge;if(Mn.isFormData(d)&&(Ge=ct.headers.get("content-type"))&&M.setContentType(Ge),ct.body){const[oe,Ze]=Joe(Q,dH(Qoe(T)));d=tse(ct.body,nse,oe,Ze)}}Mn.isString(I)||(I=I?"include":"omit");const le="credentials"in Request.prototype;K=new Request(a,{...z,signal:U,method:c.toUpperCase(),headers:M.normalize().toJSON(),body:d,duplex:"half",credentials:le?I:void 0});let ae=await fetch(K);const Z=yee&&(A==="stream"||A==="response");if(yee&&(x||Z&&X)){const ct={};["status","statusText","headers"].forEach(yt=>{ct[yt]=ae[yt]});const Ge=Mn.toFiniteNumber(ae.headers.get("content-length")),[oe,Ze]=x&&Joe(Ge,dH(Qoe(x),!0))||[];ae=new Response(tse(ae.body,nse,oe,()=>{Ze&&Ze(),X&&X()}),ct)}A=A||"text";let Ce=await fH[Mn.findKey(fH,A)||"text"](ae,o);return!Z&&X&&X(),await new Promise((ct,Ge)=>{Mie(ct,Ge,{data:Ce,headers:vm.from(ae.headers),status:ae.status,statusText:ae.statusText,config:o,request:K})})}catch(le){throw X&&X(),le&&le.name==="TypeError"&&/fetch/i.test(le.message)?Object.assign(new Er("Network Error",Er.ERR_NETWORK,o,K),{cause:le.cause||le}):Er.from(le,le&&le.code,o,K)}}),wee={http:fme,xhr:zme,fetch:Xme};Mn.forEach(wee,(o,a)=>{if(o){try{Object.defineProperty(o,"name",{value:a})}catch{}Object.defineProperty(o,"adapterName",{value:a})}});const ose=o=>`- ${o}`,Jme=o=>Mn.isFunction(o)||o===null||o===!1,Fie={getAdapter:o=>{o=Mn.isArray(o)?o:[o];const{length:a}=o;let c,d;const g={};for(let p=0;p<a;p++){c=o[p];let v;if(d=c,!Jme(c)&&(d=wee[(v=String(c)).toLowerCase()],d===void 0))throw new Er(`Unknown adapter '${v}'`);if(d)break;g[v||"#"+p]=d}if(!d){const p=Object.entries(g).map(([x,T])=>`adapter ${x} `+(T===!1?"is not supported by the environment":"is not available in the build"));let v=a?p.length>1?`since :
|
|
4
4
|
`+p.map(ose).join(`
|
|
@@ -109,7 +109,7 @@ Required: `+y.join(", "));return vn[fe].apply(null,Ae)},log:vn=>{console.log(vn,
|
|
|
109
109
|
`:"")+"</video>",ve=(Xe,qe)=>{var Bt;const qt=Se.extend({},qe);if(!qt.source&&(Se.extend(qt,nt((Bt=qt.embed)!==null&&Bt!==void 0?Bt:"",Xe.schema)),!qt.source))return"";qt.altsource||(qt.altsource=""),qt.poster||(qt.poster=""),qt.source=Xe.convertURL(qt.source,"source"),qt.altsource=Xe.convertURL(qt.altsource,"source"),qt.sourcemime=ge(qt.source),qt.altsourcemime=ge(qt.altsource),qt.poster=Xe.convertURL(qt.poster,"poster");const fo=wt(qt.source);if(fo&&(qt.source=fo.url,qt.type=fo.type,qt.allowfullscreen=fo.allowFullscreen,qt.width=qt.width||String(fo.w),qt.height=qt.height||String(fo.h)),qt.embed)return gn(qt.embed,qt,!0,Xe.schema);{const No=ct(Xe),Wo=Ge(Xe),js=oe(Xe);return qt.width=qt.width||"300",qt.height=qt.height||"150",Se.each(qt,(cn,jt)=>{qt[jt]=Xe.dom.encode(""+cn)}),qt.type==="iframe"?Y(qt,js):qt.sourcemime==="application/x-shockwave-flash"?re(qt):qt.sourcemime.indexOf("audio")!==-1?ce(qt,No):W(qt,Wo)}},Ne=Xe=>Xe.hasAttribute("data-mce-object")||Xe.hasAttribute("data-ephox-embed-iri"),Pe=Xe=>{Xe.on("mousedown",qe=>{const Bt=Xe.dom.getParent(qe.target,".mce-preview-object");Bt&&Xe.dom.getAttrib(Bt,"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 Bt=qe.target;if(Bt.getAttribute("data-mce-object")){let qt=Bt.getAttribute("data-mce-html");qt&&(qt=unescape(qt),Bt.setAttribute("data-mce-html",escape(gn(qt,{width:String(qe.width),height:String(qe.height)},!1,Xe.schema))))}})},dt={},Ue=(Xe,qe,Bt)=>new Promise((qt,fo)=>{const No=Wo=>(Wo.html&&(dt[Xe.source]=Wo),qt({url:Xe.source,html:Wo.html?Wo.html:qe(Xe)}));dt[Xe.source]?No(dt[Xe.source]):Bt({url:Xe.source}).then(No).catch(fo)}),pt=(Xe,qe)=>Promise.resolve({html:qe(Xe),url:Xe.source}),$t=Xe=>qe=>ve(Xe,qe),hn=(Xe,qe)=>{const Bt=_t(Xe);return Bt?Ue(qe,$t(Xe),Bt):pt(qe,$t(Xe))},xt=Xe=>ae(dt,Xe),Pt=(Xe,qe)=>le(qe,Xe).bind(Bt=>le(Bt,"meta")),dn=(Xe,qe,Bt)=>qt=>{const fo=()=>le(Xe,qt),No=()=>le(qe,qt),Wo=jt=>le(jt,"value").bind(Qe=>Qe.length>0?A.some(Qe):A.none()),js=()=>fo().bind(jt=>p(jt)?Wo(jt).orThunk(No):No().orThunk(()=>A.from(jt))),cn=()=>No().orThunk(()=>fo().bind(jt=>p(jt)?Wo(jt):A.from(jt)));return{[qt]:(qt===Bt?js():cn()).getOr("")}},_n=(Xe,qe)=>{const Bt={};return le(Xe,"dimensions").each(qt=>{I(["width","height"],fo=>{le(qe,fo).orThunk(()=>le(qt,fo)).each(No=>Bt[fo]=No)})}),Bt},So=(Xe,qe)=>{const Bt=qe&&qe!=="dimensions"?Pt(qe,Xe).getOr({}):{},qt=dn(Xe,Bt,qe);return{...qt("source"),...qt("altsource"),...qt("poster"),...qt("embed"),..._n(Xe,Bt)}},Jn=Xe=>{const qe={...Xe,source:{value:le(Xe,"source").getOr("")},altsource:{value:le(Xe,"altsource").getOr("")},poster:{value:le(Xe,"poster").getOr("")}};return I(["width","height"],Bt=>{le(Xe,Bt).each(qt=>{const fo=qe.dimensions||{};fo[Bt]=qt,qe.dimensions=fo})}),qe},Ot=Xe=>qe=>{const Bt=qe&&qe.msg?"Media embed handler error: "+qe.msg:"Media embed handler threw unknown error.";Xe.notificationManager.open({type:"error",text:Bt})},rn=Xe=>{const qe=Xe.selection.getNode(),Bt=Ne(qe)?Xe.serializer.serialize(qe,{selection:!0}):"",qt=nt(Bt,Xe.schema),No=(()=>{if(Mo(qt.source,qt.type)){const Wo=Xe.dom.getRect(qe);return{width:Wo.w.toString().replace(/px$/,""),height:Wo.h.toString().replace(/px$/,"")}}else return{}})();return{embed:Bt,...qt,...No}},an=(Xe,qe)=>Bt=>{if(g(Bt.url)&&Bt.url.trim().length>0){const qt=Bt.html,No={...nt(qt,qe.schema),source:Bt.url,embed:qt};Xe.setData(Jn(No))}},On=(Xe,qe)=>{const Bt=Xe.dom.select("*[data-mce-object]");for(let qt=0;qt<qe.length;qt++)for(let fo=Bt.length-1;fo>=0;fo--)qe[qt]===Bt[fo]&&Bt.splice(fo,1);Xe.selection.select(Bt[0])},_o=(Xe,qe)=>{const Bt=Xe.dom.select("*[data-mce-object]");Xe.insertContent(qe),On(Xe,Bt),Xe.nodeChanged()},Mo=(Xe,qe)=>T(qe)&&qe==="ephox-embed-iri"&&T(wt(Xe)),ws=(Xe,qe)=>((qt,fo)=>qt.width!==fo.width||qt.height!==fo.height)(Xe,qe)&&Mo(qe.source,Xe.type),vo=(Xe,qe,Bt)=>{var qt;qe.embed=ws(Xe,qe)&&Xt(Bt)?ve(Bt,{...qe,embed:""}):gn((qt=qe.embed)!==null&&qt!==void 0?qt:"",qe,!1,Bt.schema),qe.embed&&(Xe.source===qe.source||xt(qe.source))?_o(Bt,qe.embed):hn(Bt,qe).then(fo=>{_o(Bt,fo.html)}).catch(Ot(Bt))},Us=Xe=>{const qe=rn(Xe),Bt=U(qe),qt=Jn(qe),fo=(no,wo)=>{const Po=So(wo.getData(),"source");no.source!==Po.source&&(an(uo,Xe)({url:Po.source,html:""}),hn(Xe,Po).then(an(uo,Xe)).catch(Ot(Xe)))},No=no=>{var wo;const Po=So(no.getData()),cs=nt((wo=Po.embed)!==null&&wo!==void 0?wo:"",Xe.schema);no.setData(Jn(cs))},Wo=(no,wo,Po)=>{const cs=So(no.getData(),wo),Js=ws(Po,cs)&&Xt(Xe)?{...cs,embed:""}:cs,Es=ve(Xe,Js);no.setData(Jn({...Js,embed:Es}))},js=[{name:"source",type:"urlinput",filetype:"media",label:"Source",picker_text:"Browse files"}],cn=Xt(Xe)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],jt={title:"General",name:"general",items:z([js,cn])},st={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},ln=[];Re(Xe)&&ln.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),ue(Xe)&&ln.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const yn={title:"Advanced",name:"advanced",items:ln},Hn=[jt,st];ln.length>0&&Hn.push(yn);const co={type:"tabpanel",tabs:Hn},uo=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:no=>{const wo=So(no.getData());vo(Bt.get(),wo,Xe),no.close()},onChange:(no,wo)=>{switch(wo.name){case"source":fo(Bt.get(),no);break;case"embed":No(no);break;case"dimensions":case"altsource":case"poster":Wo(no,wo.name,Bt.get());break}Bt.set(So(no.getData()))},initialData:qt})},fn=Xe=>({showDialog:()=>{Us(Xe)}}),Vo=Xe=>{const qe=()=>{Us(Xe)};Xe.addCommand("mceMedia",qe)},tr=(Xe,qe,Bt)=>Xe.length>=qe.length&&Xe.substr(Bt,Bt+qe.length)===qe,rr=(Xe,qe)=>tr(Xe,qe,0);var Ir=tinymce.util.Tools.resolve("tinymce.Env");const Br=Xe=>{const qe=Xe.name;return qe==="iframe"||qe==="video"||qe==="audio"},Ts=(Xe,qe,Bt,qt=null)=>{const fo=Xe.attr(Bt);return T(fo)?fo:ae(qe,Bt)?null:qt},Ar=(Xe,qe,Bt)=>{const qt=qe.name==="img"||Xe.name==="video",fo=qt?"300":null,No=Xe.name==="audio"?"30":"150",Wo=qt?No:null;qe.attr({width:Ts(Xe,Bt,"width",fo),height:Ts(Xe,Bt,"height",Wo)})},Xr=(Xe,qe,Bt,qt)=>{const fo=Ve(Xe.schema).parse(qt,{context:qe});for(;fo.firstChild;)Bt.append(fo.firstChild)},xs=(Xe,qe)=>{const Bt=qe.name,qt=new je("img",1);return Bs(Xe,qe,qt),Ar(qe,qt,{}),qt.attr({style:qe.attr("style"),src:Ir.transparentSrc,"data-mce-object":Bt,class:"mce-object mce-object-"+Bt}),qt},lo=(Xe,qe)=>{var Bt;const qt=qe.name,fo=new je("span",1);fo.attr({contentEditable:"false",style:qe.attr("style"),"data-mce-object":qt,class:"mce-preview-object mce-object-"+qt}),Bs(Xe,qe,fo);const No=Xe.dom.parseStyle((Bt=qe.attr("style"))!==null&&Bt!==void 0?Bt:""),Wo=new je(qt,1);if(Ar(qe,Wo,No),Wo.attr({src:qe.attr("src"),style:qe.attr("style"),class:qe.attr("class")}),qt==="iframe")Wo.attr({allowfullscreen:qe.attr("allowfullscreen"),frameborder:"0",sandbox:qe.attr("sandbox"),referrerpolicy:qe.attr("referrerpolicy")});else{I(["controls","crossorigin","currentTime","loop","muted","poster","preload"],Qe=>{Wo.attr(Qe,qe.attr(Qe))});const jt=fo.attr("data-mce-html");T(jt)&&Xr(Xe,qt,Wo,unescape(jt))}const js=new je("span",1);return js.attr("class","mce-shim"),fo.append(Wo),fo.append(js),fo},Bs=(Xe,qe,Bt)=>{var qt;const fo=(qt=qe.attributes)!==null&&qt!==void 0?qt:[];let No=fo.length;for(;No--;){const jt=fo[No].name;let Qe=fo[No].value;jt!=="width"&&jt!=="height"&&jt!=="style"&&!rr(jt,"data-mce-")&&((jt==="data"||jt==="src")&&(Qe=Xe.convertURL(Qe,jt)),Bt.attr("data-mce-p-"+jt,Qe))}const Wo=kt({inner:!0},Xe.schema),js=new je("div",1);I(qe.children(),jt=>js.append(jt));const cn=Wo.serialize(js);cn&&(Bt.attr("data-mce-html",escape(cn)),Bt.empty())},Et=Xe=>{const qe=Xe.attr("class");return g(qe)&&/\btiny-pageembed\b/.test(qe)},Vt=Xe=>{let qe=Xe;for(;qe=qe.parent;)if(qe.attr("data-ephox-embed-iri")||Et(qe))return!0;return!1},Bn=Xe=>qe=>{let Bt=qe.length,qt;for(;Bt--;)qt=qe[Bt],qt.parent&&(qt.parent.attr("data-mce-object")||(Br(qt)&&Ze(Xe)?Vt(qt)||qt.replace(lo(Xe,qt)):Vt(qt)||qt.replace(xs(Xe,qt))))},ro=(Xe,qe,Bt)=>{const qt=Xe.options.get,fo=qt("xss_sanitization"),No=yt(Xe);return Ve(Xe.schema,{sanitize:fo,validate:No}).parse(Bt,{context:qe})},Ro=Xe=>{Xe.on("PreInit",()=>{const{schema:qe,serializer:Bt,parser:qt}=Xe,fo=qe.getBoolAttrs();I("webkitallowfullscreen mozallowfullscreen".split(" "),No=>{fo[No]={}}),Q({embed:["wmode"]},(No,Wo)=>{const js=qe.getElementRule(Wo);js&&I(No,cn=>{js.attributes[cn]={},js.attributesOrder.push(cn)})}),qt.addNodeFilter("iframe,video,audio,object,embed",Bn(Xe)),Bt.addAttributeFilter("data-mce-object",(No,Wo)=>{var js;let cn=No.length;for(;cn--;){const jt=No[cn];if(!jt.parent)continue;const Qe=jt.attr(Wo),st=new je(Qe,1);if(Qe!=="audio"){const co=jt.attr("class");co&&co.indexOf("mce-preview-object")!==-1&&jt.firstChild?st.attr({width:jt.firstChild.attr("width"),height:jt.firstChild.attr("height")}):st.attr({width:jt.attr("width"),height:jt.attr("height")})}st.attr({style:jt.attr("style")});const ln=(js=jt.attributes)!==null&&js!==void 0?js:[];let yn=ln.length;for(;yn--;){const co=ln[yn].name;co.indexOf("data-mce-p-")===0&&st.attr(co.substr(11),ln[yn].value)}const Hn=jt.attr("data-mce-html");if(Hn){const co=ro(Xe,Qe,unescape(Hn));I(co.children(),uo=>st.append(uo))}jt.replace(st)}})}),Xe.on("SetContent",()=>{const qe=Xe.dom;I(qe.select("span.mce-preview-object"),Bt=>{qe.select("span.mce-shim",Bt).length===0&&qe.add(Bt,"span",{class:"mce-shim"})})})},is=Xe=>{Xe.on("ResolveName",qe=>{let Bt;qe.target.nodeType===1&&(Bt=qe.target.getAttribute("data-mce-object"))&&(qe.name=Bt)})},yr=Xe=>qe=>{const Bt=()=>{qe.setEnabled(Xe.selection.isEditable())};return Xe.on("NodeChange",Bt),Bt(),()=>{Xe.off("NodeChange",Bt)}},wr=Xe=>{const qe=()=>Xe.execCommand("mceMedia");Xe.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:qe,onSetup:Bt=>{const qt=Xe.selection;Bt.setActive(Ne(qt.getNode()));const fo=qt.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",Bt.setActive).unbind,No=yr(Xe)(Bt);return()=>{fo(),No()}}}),Xe.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:qe,onSetup:yr(Xe)})};var ar=()=>{o.add("media",Xe=>(Ce(Xe),Vo(Xe),wr(Xe),is(Xe),Ro(Xe),Pe(Xe),fn(Xe)))};ar()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const a=le=>ae=>typeof ae===le,c=a("boolean"),d=a("number"),g=le=>ae=>ae.options.get(le),p=le=>{const ae=le.options.register;ae("nonbreaking_force_tab",{processor:Z=>c(Z)?{value:Z?3:0,valid:!0}:d(Z)?{value:Z,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),ae("nonbreaking_wrap",{processor:"boolean",default:!0})},v=g("nonbreaking_force_tab"),x=g("nonbreaking_wrap"),T=(le,ae)=>{let Z="";for(let Ce=0;Ce<ae;Ce++)Z+=le;return Z},A=le=>le.plugins.visualchars?le.plugins.visualchars.isEnabled():!1,M=(le,ae)=>{const Z=()=>A(le)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap",Ce=()=>`<span class="${Z()}" contenteditable="false">${T(" ",ae)}</span>`,Ge=x(le)||le.plugins.visualchars?Ce():T(" ",ae);le.undoManager.transact(()=>le.insertContent(Ge))},I=le=>{le.addCommand("mceNonBreaking",()=>{M(le,1)})};var z=tinymce.util.Tools.resolve("tinymce.util.VK");const U=le=>{const ae=v(le);ae>0&&le.on("keydown",Z=>{if(Z.keyCode===z.TAB&&!Z.isDefaultPrevented()){if(Z.shiftKey)return;Z.preventDefault(),Z.stopImmediatePropagation(),M(le,ae)}})},K=le=>ae=>{const Z=()=>{ae.setEnabled(le.selection.isEditable())};return le.on("NodeChange",Z),Z(),()=>{le.off("NodeChange",Z)}},X=le=>{const ae=()=>le.execCommand("mceNonBreaking");le.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:ae,onSetup:K(le)}),le.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:ae,onSetup:K(le)})};var Q=()=>{o.add("nonbreaking",le=>{p(le),I(le),X(le),U(le)})};Q()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env");const c=K=>X=>X.options.get(K),d=K=>{const X=K.options.register;X("pagebreak_separator",{processor:"string",default:"<!-- pagebreak -->"}),X("pagebreak_split_block",{processor:"boolean",default:!1})},g=c("pagebreak_separator"),p=c("pagebreak_split_block"),v="mce-pagebreak",x=K=>{const X=`<img src="${a.transparentSrc}" class="${v}" data-mce-resize="false" data-mce-placeholder />`;return K?`<p>${X}</p>`:X},T=K=>{const X=g(K),Q=()=>p(K),le=new RegExp(X.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,ae=>"\\"+ae),"gi");K.on("BeforeSetContent",ae=>{ae.content=ae.content.replace(le,x(Q()))}),K.on("PreInit",()=>{K.serializer.addNodeFilter("img",ae=>{let Z=ae.length,Ce,ct;for(;Z--;)if(Ce=ae[Z],ct=Ce.attr("class"),ct&&ct.indexOf(v)!==-1){const Ge=Ce.parent;if(Ge&&K.schema.getBlockElements()[Ge.name]&&Q()){Ge.type=3,Ge.value=X,Ge.raw=!0,Ce.remove();continue}Ce.type=3,Ce.value=X,Ce.raw=!0}})})},A=K=>{K.addCommand("mcePageBreak",()=>{K.insertContent(x(p(K)))})},M=K=>{K.on("ResolveName",X=>{X.target.nodeName==="IMG"&&K.dom.hasClass(X.target,v)&&(X.name="pagebreak")})},I=K=>X=>{const Q=()=>{X.setEnabled(K.selection.isEditable())};return K.on("NodeChange",Q),Q(),()=>{K.off("NodeChange",Q)}},z=K=>{const X=()=>K.execCommand("mcePageBreak");K.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:X,onSetup:I(K)}),K.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:X,onSetup:I(K)})};var U=()=>{o.add("pagebreak",K=>{d(K),A(K),z(K),T(K),M(K)})};U()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const c=(Ot=>rn=>Ot===rn)(void 0),d=Ot=>Ot==null,g=Ot=>!d(Ot);class p{constructor(rn,an){this.tag=rn,this.value=an}static some(rn){return new p(!0,rn)}static none(){return p.singletonNone}fold(rn,an){return this.tag?an(this.value):rn()}isSome(){return this.tag}isNone(){return!this.tag}map(rn){return this.tag?p.some(rn(this.value)):p.none()}bind(rn){return this.tag?rn(this.value):p.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:p.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 g(rn)?p.some(rn):p.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()"}}p.singletonNone=new p(!1);const v=Ot=>()=>Ot,x=v(!1),T=(Ot,rn,an)=>{for(let On=0,_o=Ot.length;On<_o;On++){const Mo=Ot[On];if(rn(Mo,On))return p.some(Mo);if(an(Mo,On))break}return p.none()},A=(Ot,rn)=>T(Ot,rn,x),M=(Ot,rn)=>{for(let an=0;an<Ot.length;an++){const On=rn(Ot[an],an);if(On.isSome())return On}return p.none()};typeof window<"u"||Function("return this;")();const I=Ot=>{let rn=!1,an;return(...On)=>(rn||(rn=!0,an=Ot.apply(null,On)),an)},z=(Ot,rn,an,On)=>{const _o=Ot.isiOS()&&/ipad/i.test(an)===!0,Mo=Ot.isiOS()&&!_o,ws=Ot.isiOS()||Ot.isAndroid(),vo=ws||On("(pointer:coarse)"),Us=_o||!Mo&&ws&&On("(min-device-width:768px)"),fn=Mo||ws&&!Us,Vo=rn.isSafari()&&Ot.isiOS()&&/safari/i.test(an)===!1,tr=!fn&&!Us&&!Vo;return{isiPad:v(_o),isiPhone:v(Mo),isTablet:v(Us),isPhone:v(fn),isTouch:v(vo),isAndroid:Ot.isAndroid,isiOS:Ot.isiOS,isWebView:v(Vo),isDesktop:v(tr)}},U=(Ot,rn)=>{for(let an=0;an<Ot.length;an++){const On=Ot[an];if(On.test(rn))return On}},K=(Ot,rn)=>{const an=U(Ot,rn);if(!an)return{major:0,minor:0};const On=_o=>Number(rn.replace(an,"$"+_o));return le(On(1),On(2))},X=(Ot,rn)=>{const an=String(rn).toLowerCase();return Ot.length===0?Q():K(Ot,an)},Q=()=>le(0,0),le=(Ot,rn)=>({major:Ot,minor:rn}),ae={nu:le,detect:X,unknown:Q},Z=(Ot,rn)=>M(rn.brands,an=>{const On=an.brand.toLowerCase();return A(Ot,_o=>{var Mo;return On===((Mo=_o.brand)===null||Mo===void 0?void 0:Mo.toLowerCase())}).map(_o=>({current:_o.name,version:ae.nu(parseInt(an.version,10),0)}))}),Ce=(Ot,rn)=>{const an=String(rn).toLowerCase();return A(Ot,On=>On.search(an))},ct=(Ot,rn)=>Ce(Ot,rn).map(an=>{const On=ae.detect(an.versionRegexes,rn);return{current:an.name,version:On}}),Ge=(Ot,rn)=>Ce(Ot,rn).map(an=>{const On=ae.detect(an.versionRegexes,rn);return{current:an.name,version:On}}),oe=(Ot,rn,an=0,On)=>{const _o=Ot.indexOf(rn,an);return _o!==-1?c(On)?!0:_o+rn.length<=On:!1},Ze=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,yt=Ot=>rn=>oe(rn,Ot),_t=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:Ot=>oe(Ot,"edge/")&&oe(Ot,"chrome")&&oe(Ot,"safari")&&oe(Ot,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ze],search:Ot=>oe(Ot,"chrome")&&!oe(Ot,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:Ot=>oe(Ot,"msie")||oe(Ot,"trident")},{name:"Opera",versionRegexes:[Ze,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:yt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:yt("firefox")},{name:"Safari",versionRegexes:[Ze,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:Ot=>(oe(Ot,"safari")||oe(Ot,"mobile/"))&&oe(Ot,"applewebkit")}],Re=[{name:"Windows",search:yt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:Ot=>oe(Ot,"iphone")||oe(Ot,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:yt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:yt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:yt("linux"),versionRegexes:[]},{name:"Solaris",search:yt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:yt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:yt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ue={browsers:v(_t),oses:v(Re)},Xt="Edge",Se="Chromium",Ie="IE",D="Opera",ze="Firefox",be="Safari",tt=()=>nt({current:void 0,version:ae.unknown()}),nt=Ot=>{const rn=Ot.current,an=Ot.version,On=_o=>()=>rn===_o;return{current:rn,version:an,isEdge:On(Xt),isChromium:On(Se),isIE:On(Ie),isOpera:On(D),isFirefox:On(ze),isSafari:On(be)}},ge={unknown:tt,nu:nt,edge:v(Xt),chromium:v(Se),ie:v(Ie),opera:v(D),firefox:v(ze),safari:v(be)},je="Windows",kt="iOS",Ve="Android",ht="Linux",De="macOS",ut="Solaris",ee="FreeBSD",gn="ChromeOS",mt=()=>Ct({current:void 0,version:ae.unknown()}),Ct=Ot=>{const rn=Ot.current,an=Ot.version,On=_o=>()=>rn===_o;return{current:rn,version:an,isWindows:On(je),isiOS:On(kt),isAndroid:On(Ve),isMacOS:On(De),isLinux:On(ht),isSolaris:On(ut),isFreeBSD:On(ee),isChromeOS:On(gn)}},Ut={unknown:mt,nu:Ct,windows:v(je),ios:v(kt),android:v(Ve),linux:v(ht),macos:v(De),solaris:v(ut),freebsd:v(ee),chromeos:v(gn)},Y={detect:(Ot,rn,an)=>{const On=ue.browsers(),_o=ue.oses(),Mo=rn.bind(Us=>Z(On,Us)).orThunk(()=>ct(On,Ot)).fold(ge.unknown,ge.nu),ws=Ge(_o,Ot).fold(Ut.unknown,Ut.nu),vo=z(ws,Mo,Ot,an);return{browser:Mo,os:ws,deviceType:vo}}},re=Ot=>window.matchMedia(Ot).matches;let ce=I(()=>Y.detect(window.navigator.userAgent,p.from(window.navigator.userAgentData),re));const W=()=>ce(),ve=()=>W().os.isMacOS(),Ne=()=>W().os.isiOS(),Pe=()=>{const Ot=ve()||Ne();return`<script>(${(an=>{document.addEventListener("click",On=>{for(let _o=On.target;_o;_o=_o.parentNode)if(_o.nodeName==="A"){const ws=_o.getAttribute("href");if(ws&&ws.startsWith("#")){On.preventDefault();const Us=document.getElementById(ws.substring(1));Us&&Us.scrollIntoView({behavior:"smooth"});return}(an?On.metaKey:On.ctrlKey&&!On.altKey)||On.preventDefault()}},!1)}).toString()})(${Ot})<\/script>`};var dt=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ue=Ot=>rn=>rn.options.get(Ot),pt=Ue("content_style"),$t=Ue("content_css_cors"),hn=Ue("body_class"),xt=Ue("body_id"),Pt=Ot=>{var rn;let an="";const On=Ot.dom.encode,_o=(rn=pt(Ot))!==null&&rn!==void 0?rn:"";an+=`<base href="${On(Ot.documentBaseURI.getURI())}">`;const Mo=$t(Ot)?' crossorigin="anonymous"':"";dt.each(Ot.contentCSS,tr=>{an+='<link type="text/css" rel="stylesheet" href="'+On(Ot.documentBaseURI.toAbsolute(tr))+'"'+Mo+">"}),_o&&(an+='<style type="text/css">'+_o+"</style>");const ws=xt(Ot),vo=hn(Ot),Us=Ot.getBody().dir,fn=Us?' dir="'+On(Us)+'"':"";return"<!DOCTYPE html><html><head>"+an+'</head><body id="'+On(ws)+'" class="mce-content-body '+On(vo)+'"'+fn+">"+Ot.getContent()+Pe()+"</body></html>"},dn=Ot=>{const rn=Pt(Ot);Ot.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=Ot=>{Ot.addCommand("mcePreview",()=>{dn(Ot)})},So=Ot=>{const rn=()=>Ot.execCommand("mcePreview");Ot.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:rn,context:"any"}),Ot.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:rn,context:"any"})};var Jn=()=>{o.add("preview",Ot=>{_n(Ot),So(Ot)})};Jn()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const a=()=>window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295;let c=0;const d=wt=>{const re=new Date().getTime(),ce=Math.floor(a()*1e9);return c++,wt+"_"+ce+c+String(re)},g=(wt,Y,re)=>{wt.execCommand("mceInsertTable",!1,{rows:re,columns:Y})},p=(wt,Y,re)=>{const ce=wt.editorUpload.blobCache,W=ce.create(d("mceu"),re,Y);ce.add(W),wt.insertContent(wt.dom.createHTML("img",{src:W.blobUri()}))},v=wt=>new Promise(Y=>{const re=new FileReader;re.onloadend=()=>{Y(re.result.split(",")[1])},re.readAsDataURL(wt)});var x=tinymce.util.Tools.resolve("tinymce.util.Delay");const T=wt=>new Promise(Y=>{let re=!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 W=Pe=>{var dt;re||((dt=ce.parentNode)===null||dt===void 0||dt.removeChild(ce),re=!0,Y(Pe))},ve=Pe=>{W(Array.prototype.slice.call(Pe.target.files))};ce.addEventListener("input",ve),ce.addEventListener("change",ve);const Ne=Pe=>{const dt=()=>{W([])};re||(Pe.type==="focusin"?x.setEditorTimeout(wt,dt,1e3):dt()),wt.off("focusin remove",Ne)};wt.on("focusin remove",Ne),ce.click()}),A=wt=>{wt.on("PreInit",()=>{wt.queryCommandSupported("QuickbarInsertImage")||wt.addCommand("QuickbarInsertImage",()=>{T(wt).then(Y=>{if(Y.length>0){const re=Y[0];v(re).then(ce=>{p(wt,ce,re)})}})})})},M=(wt,Y,re)=>{var ce;return re(wt,Y.prototype)?!0:((ce=wt.constructor)===null||ce===void 0?void 0:ce.name)===Y.name},I=wt=>{const Y=typeof wt;return wt===null?"null":Y==="object"&&Array.isArray(wt)?"array":Y==="object"&&M(wt,String,(re,ce)=>ce.isPrototypeOf(re))?"string":Y},z=wt=>Y=>I(Y)===wt,U=wt=>Y=>typeof Y===wt,K=z("string"),X=U("boolean"),Q=wt=>wt==null,le=wt=>!Q(wt),ae=U("function"),Z=wt=>Y=>Y.options.get(wt),Ce=wt=>{const Y=wt.options.register,re=Ne=>Pe=>{const dt=X(Pe)||K(Pe);return dt?X(Pe)?{value:Pe?Ne:"",valid:dt}:{value:Pe.trim(),valid:dt}:{valid:!1,message:"Must be a boolean or string."}},ce="bold italic | quicklink h2 h3 blockquote";Y("quickbars_selection_toolbar",{processor:re(ce),default:ce});const W="quickimage quicktable";Y("quickbars_insert_toolbar",{processor:re(W),default:W});const ve="alignleft aligncenter alignright";Y("quickbars_image_toolbar",{processor:re(ve),default:ve})},ct=Z("quickbars_selection_toolbar"),Ge=Z("quickbars_insert_toolbar"),oe=Z("quickbars_image_toolbar"),Ze=wt=>{wt.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:()=>wt.execCommand("QuickbarInsertImage")}),wt.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:()=>{g(wt,2,2)}})},_t=(wt=>()=>wt)(!1);class Re{constructor(Y,re){this.tag=Y,this.value=re}static some(Y){return new Re(!0,Y)}static none(){return Re.singletonNone}fold(Y,re){return this.tag?re(this.value):Y()}isSome(){return this.tag}isNone(){return!this.tag}map(Y){return this.tag?Re.some(Y(this.value)):Re.none()}bind(Y){return this.tag?Y(this.value):Re.none()}exists(Y){return this.tag&&Y(this.value)}forall(Y){return!this.tag||Y(this.value)}filter(Y){return!this.tag||Y(this.value)?this:Re.none()}getOr(Y){return this.tag?this.value:Y}or(Y){return this.tag?this:Y}getOrThunk(Y){return this.tag?this.value:Y()}orThunk(Y){return this.tag?this:Y()}getOrDie(Y){if(this.tag)return this.value;throw new Error(Y??"Called getOrDie on None")}static from(Y){return le(Y)?Re.some(Y):Re.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Y){this.tag&&Y(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Re.singletonNone=new Re(!1),typeof window<"u"||Function("return this;")();const ue=1,Xt=wt=>wt.dom.nodeName.toLowerCase(),Se=(wt,Y)=>{const re=wt.dom;return re&&re.hasAttribute?re.hasAttribute(Y):!1};var Ie=(wt,Y,re,ce,W)=>wt(re,ce)?Re.some(re):ae(W)&&W(re)?Re.none():Y(re,ce,W);const D=(wt,Y)=>{const ce=(Y||document).createElement("div");if(ce.innerHTML=wt,!ce.hasChildNodes()||ce.childNodes.length>1){const W="HTML does not have a single root node";throw console.error(W,wt),new Error(W)}return tt(ce.childNodes[0])},ze=(wt,Y)=>{const ce=(Y||document).createElement(wt);return tt(ce)},be=(wt,Y)=>{const ce=(Y||document).createTextNode(wt);return tt(ce)},tt=wt=>{if(wt==null)throw new Error("Node cannot be null or undefined");return{dom:wt}},ge={fromHtml:D,fromTag:ze,fromText:be,fromDom:tt,fromPoint:(wt,Y,re)=>Re.from(wt.dom.elementFromPoint(Y,re)).map(tt)},je=(wt,Y)=>{const re=wt.dom;if(re.nodeType!==ue)return!1;{const ce=re;if(ce.matches!==void 0)return ce.matches(Y);if(ce.msMatchesSelector!==void 0)return ce.msMatchesSelector(Y);if(ce.webkitMatchesSelector!==void 0)return ce.webkitMatchesSelector(Y);if(ce.mozMatchesSelector!==void 0)return ce.mozMatchesSelector(Y);throw new Error("Browser lacks native selectors")}},kt=(wt,Y,re)=>{let ce=wt.dom;const W=ae(re)?re:_t;for(;ce.parentNode;){ce=ce.parentNode;const ve=ge.fromDom(ce);if(Y(ve))return Re.some(ve);if(W(ve))break}return Re.none()},Ve=(wt,Y,re)=>Ie((W,ve)=>ve(W),kt,wt,Y,re),ht=(wt,Y,re)=>Ve(wt,Y,re).isSome(),De=(wt,Y,re)=>kt(wt,ce=>je(ce,Y),re),ut=(wt,Y,re)=>Ie((W,ve)=>je(W,ve),De,wt,Y,re),ee=wt=>{const Y=Ge(wt);Y.length>0&&wt.ui.registry.addContextToolbar("quickblock",{predicate:re=>{const ce=ge.fromDom(re),W=wt.schema.getTextBlockElements(),ve=Ne=>Ne.dom===wt.getBody();return!Se(ce,"data-mce-bogus")&&ut(ce,'table,[data-mce-bogus="all"]',ve).fold(()=>ht(ce,Ne=>Xt(Ne)in W&&wt.dom.isEmpty(Ne.dom),ve),_t)},items:Y,position:"line",scope:"editor"})},gn=wt=>wt.dom.classList!==void 0,mt=(wt,Y)=>gn(wt)&&wt.dom.classList.contains(Y),Ct=wt=>{const Y=Ne=>wt.dom.isEditable(Ne),re=Ne=>Y(Ne.parentElement),ce=Ne=>{const Pe=Ne.nodeName==="FIGURE"&&/image/i.test(Ne.className),dt=Ne.nodeName==="IMG"||Pe,Ue=mt(ge.fromDom(Ne),"mce-pagebreak");return dt&&re(Ne)&&!Ue},W=oe(wt);W.length>0&&wt.ui.registry.addContextToolbar("imageselection",{predicate:ce,items:W,position:"node"});const ve=ct(wt);ve.length>0&&wt.ui.registry.addContextToolbar("textselection",{predicate:Ne=>!ce(Ne)&&!wt.selection.isCollapsed()&&Y(Ne),items:ve,position:"selection",scope:"editor"})};var Ut=()=>{o.add("quickbars",wt=>{Ce(wt),A(wt),Ze(wt),ee(wt),Ct(wt)})};Ut()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const c=(le=>ae=>typeof ae===le)("function");var d=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),g=tinymce.util.Tools.resolve("tinymce.util.Tools");const p=le=>ae=>ae.options.get(le),v=le=>{const ae=le.options.register;ae("save_enablewhendirty",{processor:"boolean",default:!0}),ae("save_onsavecallback",{processor:"function"}),ae("save_oncancelcallback",{processor:"function"})},x=p("save_enablewhendirty"),T=p("save_onsavecallback"),A=p("save_oncancelcallback"),M=(le,ae)=>{le.notificationManager.open({text:ae,type:"error"})},I=le=>{const ae=d.DOM.getParent(le.id,"form");if(x(le)&&!le.isDirty())return;le.save();const Z=T(le);if(c(Z)){Z.call(le,le),le.nodeChanged();return}ae?(le.setDirty(!1),(!ae.onsubmit||ae.onsubmit())&&(typeof ae.submit=="function"?ae.submit():M(le,"Error: Form submit field collision.")),le.nodeChanged()):M(le,"Error: No form element found.")},z=le=>{const ae=g.trim(le.startContent),Z=A(le);if(c(Z)){Z.call(le,le);return}le.resetContent(ae)},U=le=>{le.addCommand("mceSave",()=>{I(le)}),le.addCommand("mceCancel",()=>{z(le)})},K=le=>ae=>{const Z=()=>{ae.setEnabled(!x(le)||le.isDirty())};return Z(),le.on("NodeChange dirty",Z),()=>le.off("NodeChange dirty",Z)},X=le=>{le.ui.registry.addButton("save",{icon:"save",tooltip:"Save",enabled:!1,onAction:()=>le.execCommand("mceSave"),onSetup:K(le),shortcut:"Meta+S"}),le.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",enabled:!1,onAction:()=>le.execCommand("mceCancel"),onSetup:K(le)}),le.addShortcut("Meta+S","","mceSave")};var Q=()=>{o.add("save",le=>{v(le),X(le),U(le)})};Q()})();(function(){const o=Qe=>{let st=Qe;return{get:()=>st,set:Hn=>{st=Hn}}};var a=tinymce.util.Tools.resolve("tinymce.PluginManager");const c=(Qe,st,ln)=>{var yn;return ln(Qe,st.prototype)?!0:((yn=Qe.constructor)===null||yn===void 0?void 0:yn.name)===st.name},d=Qe=>{const st=typeof Qe;return Qe===null?"null":st==="object"&&Array.isArray(Qe)?"array":st==="object"&&c(Qe,String,(ln,yn)=>yn.isPrototypeOf(ln))?"string":st},g=Qe=>st=>d(st)===Qe,p=Qe=>st=>typeof st===Qe,v=g("string"),x=g("array"),T=p("boolean"),A=Qe=>Qe==null,M=Qe=>!A(Qe),I=p("number"),z=()=>{},U=Qe=>()=>Qe,K=U(!0),Q=U("[~№|!-*+-\\/:;?@\\[-`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]");class le{constructor(st,ln){this.tag=st,this.value=ln}static some(st){return new le(!0,st)}static none(){return le.singletonNone}fold(st,ln){return this.tag?ln(this.value):st()}isSome(){return this.tag}isNone(){return!this.tag}map(st){return this.tag?le.some(st(this.value)):le.none()}bind(st){return this.tag?st(this.value):le.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:le.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 M(st)?le.some(st):le.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()"}}le.singletonNone=new le(!1);const ae=Q;var Z=tinymce.util.Tools.resolve("tinymce.Env"),Ce=tinymce.util.Tools.resolve("tinymce.util.Tools");const ct=Array.prototype.slice,Ge=Array.prototype.push,oe=(Qe,st)=>{const ln=Qe.length,yn=new Array(ln);for(let Hn=0;Hn<ln;Hn++){const co=Qe[Hn];yn[Hn]=st(co,Hn)}return yn},Ze=(Qe,st)=>{for(let ln=0,yn=Qe.length;ln<yn;ln++){const Hn=Qe[ln];st(Hn,ln)}},yt=(Qe,st)=>{for(let ln=Qe.length-1;ln>=0;ln--){const yn=Qe[ln];st(yn,ln)}},_t=(Qe,st)=>{if(Qe.length===0)return[];{let ln=st(Qe[0]);const yn=[];let Hn=[];for(let co=0,uo=Qe.length;co<uo;co++){const no=Qe[co],wo=st(no);wo!==ln&&(yn.push(Hn),Hn=[]),ln=wo,Hn.push(no)}return Hn.length!==0&&yn.push(Hn),yn}},Re=(Qe,st,ln)=>(Ze(Qe,(yn,Hn)=>{ln=st(ln,yn,Hn)}),ln),ue=Qe=>{const st=[];for(let ln=0,yn=Qe.length;ln<yn;++ln){if(!x(Qe[ln]))throw new Error("Arr.flatten item "+ln+" was not an array, input: "+Qe);Ge.apply(st,Qe[ln])}return st},Xt=(Qe,st)=>ue(oe(Qe,st)),Se=(Qe,st)=>{const ln=ct.call(Qe,0);return ln.sort(st),ln},Ie=Object.hasOwnProperty,D=(Qe,st)=>Ie.call(Qe,st);typeof window<"u"||Function("return this;")();const ze=9,be=11,tt=1,nt=3,ge=Qe=>Qe.dom.nodeType,kt=(Qe=>st=>ge(st)===Qe)(nt),Ve=(Qe,st,ln)=>{if(v(ln)||T(ln)||I(ln))Qe.setAttribute(st,ln+"");else throw console.error("Invalid call to Attribute.set. Key ",st,":: Value ",ln,":: Element ",Qe),new Error("Attribute value was not simple")},ht=(Qe,st,ln)=>{Ve(Qe.dom,st,ln)},De=(Qe,st)=>{const yn=(st||document).createElement("div");if(yn.innerHTML=Qe,!yn.hasChildNodes()||yn.childNodes.length>1){const Hn="HTML does not have a single root node";throw console.error(Hn,Qe),new Error(Hn)}return gn(yn.childNodes[0])},ut=(Qe,st)=>{const yn=(st||document).createElement(Qe);return gn(yn)},ee=(Qe,st)=>{const yn=(st||document).createTextNode(Qe);return gn(yn)},gn=Qe=>{if(Qe==null)throw new Error("Node cannot be null or undefined");return{dom:Qe}},Ct={fromHtml:De,fromTag:ut,fromText:ee,fromDom:gn,fromPoint:(Qe,st,ln)=>le.from(Qe.dom.elementFromPoint(st,ln)).map(gn)},Ut=Qe=>Qe.nodeType!==tt&&Qe.nodeType!==ze&&Qe.nodeType!==be||Qe.childElementCount===0,wt=(Qe,st)=>{const ln=st===void 0?document:st.dom;return Ut(ln)?[]:oe(ln.querySelectorAll(Qe),Ct.fromDom)},Y=Qe=>le.from(Qe.dom.parentNode).map(Ct.fromDom),re=Qe=>oe(Qe.dom.childNodes,Ct.fromDom),ce=(Qe,st)=>({element:Qe,offset:st}),W=(Qe,st)=>{const ln=re(Qe);return ln.length>0&&st<ln.length?ce(ln[st],0):ce(Qe,st)},ve=(Qe,st)=>{Y(Qe).each(yn=>{yn.dom.insertBefore(st.dom,Qe.dom)})},Ne=(Qe,st)=>{Qe.dom.appendChild(st.dom)},Pe=(Qe,st)=>{ve(Qe,st),Ne(st,Qe)},Ue=((Qe,st)=>{const ln=co=>{if(!Qe(co))throw new Error("Can only get "+st+" value of a "+st+" node");return yn(co).getOr("")},yn=co=>Qe(co)?le.from(co.dom.nodeValue):le.none();return{get:ln,getOption:yn,set:(co,uo)=>{if(!Qe(co))throw new Error("Can only set raw "+st+" value of a "+st+" node");co.dom.nodeValue=uo}}})(kt,"text"),pt=Qe=>Ue.get(Qe),$t=(Qe,st,ln)=>(Qe.compareDocumentPosition(st)&ln)!==0,hn=(Qe,st)=>$t(Qe,st,Node.DOCUMENT_POSITION_PRECEDING),xt=(Qe,st)=>wt(st,Qe);var Pt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const dn=(Qe,st)=>Qe.isBlock(st)||D(Qe.schema.getVoidElements(),st.nodeName),_n=(Qe,st)=>!Qe.isEditable(st),So=(Qe,st)=>Qe.getContentEditable(st)==="true"&&st.parentNode&&!Qe.isEditable(st.parentNode),Jn=(Qe,st)=>!Qe.isBlock(st)&&D(Qe.schema.getWhitespaceElements(),st.nodeName),Ot=(Qe,st)=>dn(Qe,st)||_n(Qe,st)||Jn(Qe,st)||So(Qe,st),rn=Qe=>Qe.nodeType===3,an=()=>({sOffset:0,fOffset:0,elements:[]}),On=(Qe,st)=>W(Ct.fromDom(Qe),st),_o=(Qe,st,ln,yn,Hn,co=!0)=>{let uo=co?st(!1):ln;for(;uo;){const no=_n(Qe,uo);if(no||Jn(Qe,uo)){if(no?yn.cef(uo):yn.boundary(uo))break;uo=st(!0);continue}else if(dn(Qe,uo)){if(yn.boundary(uo))break}else rn(uo)&&yn.text(uo);if(uo===Hn)break;uo=st(!1)}},Mo=(Qe,st,ln,yn,Hn)=>{var co;if(Ot(Qe,ln))return;const uo=(co=Qe.getParent(yn,Qe.isBlock))!==null&&co!==void 0?co:Qe.getRoot(),no=new Pt(ln,uo),wo=Hn?no.next.bind(no):no.prev.bind(no);_o(Qe,wo,ln,{boundary:K,cef:K,text:Po=>{Hn?st.fOffset+=Po.length:st.sOffset+=Po.length,st.elements.push(Ct.fromDom(Po))}})},ws=(Qe,st,ln,yn,Hn,co=!0)=>{const uo=new Pt(ln,st),no=[];let wo=an();Mo(Qe,wo,ln,st,!1);const Po=()=>(wo.elements.length>0&&(no.push(wo),wo=an()),!1);return _o(Qe,uo.next.bind(uo),ln,{boundary:Po,cef:cs=>(Po(),Hn&&no.push(...Hn.cef(cs)),!1),text:cs=>{wo.elements.push(Ct.fromDom(cs)),Hn&&Hn.text(cs,wo)}},yn,co),yn&&Mo(Qe,wo,yn,st,!0),Po(),no},vo=(Qe,st)=>{const ln=On(st.startContainer,st.startOffset),yn=ln.element.dom,Hn=On(st.endContainer,st.endOffset),co=Hn.element.dom;return ws(Qe,st.commonAncestorContainer,yn,co,{text:(uo,no)=>{uo===co?no.fOffset+=uo.length-Hn.offset:uo===yn&&(no.sOffset+=ln.offset)},cef:uo=>{const no=Xt(xt(Ct.fromDom(uo),"*[contenteditable=true]"),wo=>{const Po=wo.dom;return ws(Qe,Po,Po)});return Se(no,(wo,Po)=>hn(wo.elements[0].dom,Po.elements[0].dom)?1:-1)}},!1)},Us=(Qe,st)=>st.collapsed?[]:vo(Qe,st),fn=(Qe,st)=>{const ln=Qe.createRng();return ln.selectNode(st),Us(Qe,ln)},Vo=(Qe,st)=>Xt(st,ln=>fn(Qe,ln)),tr=(Qe,st,ln=0,yn=Qe.length)=>{const Hn=st.regex;Hn.lastIndex=ln;const co=[];let uo;for(;uo=Hn.exec(Qe);){const no=uo[st.matchIndex],wo=uo.index+uo[0].indexOf(no),Po=wo+no.length;if(Po>yn)break;co.push({start:wo,finish:Po}),Hn.lastIndex=Po}return co},rr=(Qe,st)=>{const ln=Re(Qe,(yn,Hn)=>{const co=pt(Hn),uo=yn.last,no=uo+co.length,wo=Xt(st,(Po,cs)=>Po.start<no&&Po.finish>uo?[{element:Hn,start:Math.max(uo,Po.start)-uo,finish:Math.min(no,Po.finish)-uo,matchId:cs}]:[]);return{results:yn.results.concat(wo),last:no}},{results:[],last:0}).results;return _t(ln,yn=>yn.matchId)},Ir=(Qe,st)=>Xt(st,ln=>{const yn=ln.elements,Hn=oe(yn,pt).join(""),co=tr(Hn,Qe,ln.sOffset,Hn.length-ln.fOffset);return rr(yn,co)}),Br=(Qe,st)=>{yt(Qe,(ln,yn)=>{yt(ln,Hn=>{const co=Ct.fromDom(st.cloneNode(!1));ht(co,"data-mce-index",yn);const uo=Hn.element.dom;if(uo.length===Hn.finish&&Hn.start===0)Pe(Hn.element,co);else{uo.length!==Hn.finish&&uo.splitText(Hn.finish);const no=uo.splitText(Hn.start);Pe(Ct.fromDom(no),co)}})})},Ts=(Qe,st,ln,yn)=>{const Hn=fn(Qe,ln),co=Ir(st,Hn);return Br(co,yn),co.length},Ar=(Qe,st,ln,yn)=>{const Hn=ln.getBookmark(),co=Qe.select("td[data-mce-selected],th[data-mce-selected]"),uo=co.length>0?Vo(Qe,co):Us(Qe,ln.getRng()),no=Ir(st,uo);return Br(no,yn),ln.moveToBookmark(Hn),no.length},Xr=Qe=>Qe.getAttribute("data-mce-index"),xs=(Qe,st,ln,yn)=>{const Hn=Qe.dom.create("span",{"data-mce-bogus":1});Hn.className="mce-match-marker";const co=Qe.getBody();return ar(Qe,st,!1),yn?Ar(Qe.dom,ln,Qe.selection,Hn):Ts(Qe.dom,ln,co,Hn)},lo=Qe=>{var st;const ln=Qe.parentNode;Qe.firstChild&&ln.insertBefore(Qe.firstChild,Qe),(st=Qe.parentNode)===null||st===void 0||st.removeChild(Qe)},Bs=(Qe,st)=>{const ln=[],yn=Ce.toArray(Qe.getBody().getElementsByTagName("span"));if(yn.length)for(let Hn=0;Hn<yn.length;Hn++){const co=Xr(yn[Hn]);co===null||!co.length||co===st.toString()&&ln.push(yn[Hn])}return ln},Et=(Qe,st,ln)=>{const yn=st.get();let Hn=yn.index;const co=Qe.dom;ln?Hn+1===yn.count?Hn=0:Hn++:Hn-1===-1?Hn=yn.count-1:Hn--,co.removeClass(Bs(Qe,yn.index),"mce-match-marker-selected");const uo=Bs(Qe,Hn);return uo.length?(co.addClass(Bs(Qe,Hn),"mce-match-marker-selected"),Qe.selection.scrollIntoView(uo[0]),Hn):-1},Vt=(Qe,st)=>{const ln=st.parentNode;Qe.remove(st),ln&&Qe.isEmpty(ln)&&Qe.remove(ln)},Bn=(Qe,st)=>{const yn="("+Qe.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return st?`(?:^|\\s|${ae()})`+yn+`(?=$|\\s|${ae()})`:yn},ro=(Qe,st,ln,yn,Hn,co)=>{const uo=Qe.selection,no=Bn(ln,Hn),wo=uo.isForward(),Po={regex:new RegExp(no,yn?"g":"gi"),matchIndex:1},cs=xs(Qe,st,Po,co);if(Z.browser.isSafari()&&uo.setRng(uo.getRng(),wo),cs){const Js=Et(Qe,st,!0);st.set({index:Js,count:cs,text:ln,matchCase:yn,wholeWord:Hn,inSelection:co})}return cs},Ro=(Qe,st)=>{const ln=Et(Qe,st,!0);st.set({...st.get(),index:ln})},is=(Qe,st)=>{const ln=Et(Qe,st,!1);st.set({...st.get(),index:ln})},yr=Qe=>{const st=Xr(Qe);return st!==null&&st.length>0},wr=(Qe,st,ln,yn,Hn)=>{const co=st.get(),uo=co.index;let no,wo=uo;yn=yn!==!1;const Po=Qe.getBody(),cs=Ce.grep(Ce.toArray(Po.getElementsByTagName("span")),yr);for(let Js=0;Js<cs.length;Js++){const Es=Xr(cs[Js]);let Ya=no=parseInt(Es,10);if(Hn||Ya===co.index){for(ln.length?(cs[Js].innerText=ln,lo(cs[Js])):Vt(Qe.dom,cs[Js]);cs[++Js];)if(Ya=parseInt(Xr(cs[Js]),10),Ya===no)Vt(Qe.dom,cs[Js]);else{Js--;break}yn&&wo--}else no>uo&&cs[Js].setAttribute("data-mce-index",String(no-1))}return st.set({...co,count:Hn?0:co.count-1,index:wo}),yn?Ro(Qe,st):is(Qe,st),!Hn&&st.get().count>0},ar=(Qe,st,ln)=>{let yn,Hn;const co=st.get(),uo=Ce.toArray(Qe.getBody().getElementsByTagName("span"));for(let no=0;no<uo.length;no++){const wo=Xr(uo[no]);wo!==null&&wo.length&&(wo===co.index.toString()&&(yn||(yn=uo[no].firstChild),Hn=uo[no].firstChild),lo(uo[no]))}if(st.set({...co,index:-1,count:0,text:""}),yn&&Hn){const no=Qe.dom.createRng();return no.setStart(yn,0),no.setEnd(Hn,Hn.data.length),ln!==!1&&Qe.selection.setRng(no),no}else return},Xe=(Qe,st)=>st.get().count>1,qe=(Qe,st)=>st.get().count>1,Bt=(Qe,st)=>({done:no=>ar(Qe,st,no),find:(no,wo,Po,cs=!1)=>ro(Qe,st,no,wo,Po,cs),next:()=>Ro(Qe,st),prev:()=>is(Qe,st),replace:(no,wo,Po)=>wr(Qe,st,no,wo,Po)}),qt=Qe=>{const st=o(le.none()),ln=()=>st.get().each(Qe);return{clear:()=>{ln(),st.set(le.none())},isSet:()=>st.get().isSome(),get:()=>st.get(),set:no=>{ln(),st.set(le.some(no))}}},fo=()=>{const Qe=qt(z);return{...Qe,on:ln=>Qe.get().each(ln)}},No=(Qe,st)=>{const ln=fo();Qe.undoManager.add();const yn=Ce.trim(Qe.selection.getContent({format:"text"})),Hn=Ho=>{Ho.setEnabled("next",Xe(Qe,st)),Ho.setEnabled("prev",qe(Qe,st))},co=Ho=>{const Qo=Ho.getData(),ns=st.get();st.set({...ns,matchCase:Qo.matchcase,wholeWord:Qo.wholewords,inSelection:Qo.inselection})},uo=(Ho,Qo)=>{Ze(["replace","replaceall","prev","next"],na=>Ho.setEnabled(na,!Qo))},no=(Ho,Qo)=>{Qo.redial(ta(Ho,Qo.getData()))},wo=(Ho,Qo)=>{Z.browser.isSafari()&&Z.deviceType.isTouch()&&(Qo==="find"||Qo==="replace"||Qo==="replaceall")&&Ho.focus(Qo)},Po=Ho=>{ar(Qe,st,!1),uo(Ho,!0),Hn(Ho)},cs=Ho=>{const Qo=Ho.getData(),ns=st.get();if(!Qo.findtext.length){Po(Ho);return}if(ns.text===Qo.findtext&&ns.matchCase===Qo.matchcase&&ns.wholeWord===Qo.wholewords)Ro(Qe,st);else{const ca=ro(Qe,st,Qo.findtext,Qo.matchcase,Qo.wholewords,Qo.inselection);ca<=0&&no(!0,Ho),uo(Ho,ca===0)}Hn(Ho)},Js=st.get(),Es={findtext:yn,replacetext:"",wholewords:Js.wholeWord,matchcase:Js.matchCase,inselection:Js.inSelection},Ya=Ho=>{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 Ho&&Qo.push({type:"alertbanner",level:"error",text:"Could not find the specified string.",icon:"warning"}),Qo},ta=(Ho,Qo)=>({title:"Find and Replace",size:"normal",body:{type:"panel",items:Ya(Ho)},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)=>{Ho&&no(!1,ns),ca.name==="findtext"&&st.get().count>0&&Po(ns)},onAction:(ns,ca)=>{const na=ns.getData();switch(ca.name){case"find":cs(ns);break;case"replace":wr(Qe,st,na.replacetext)?Hn(ns):Po(ns);break;case"replaceall":wr(Qe,st,na.replacetext,!0,!0),Po(ns);break;case"prev":is(Qe,st),Hn(ns);break;case"next":Ro(Qe,st),Hn(ns);break;case"matchcase":case"wholewords":case"inselection":no(!1,ns),co(ns),Po(ns);break}wo(ns,ca.name)},onSubmit:ns=>{cs(ns),wo(ns,"find")},onClose:()=>{Qe.focus(),ar(Qe,st),Qe.undoManager.add()}});ln.set(Qe.windowManager.open(ta(!1,Es),{inline:"toolbar"}))},Wo=(Qe,st)=>{Qe.addCommand("SearchReplace",()=>{No(Qe,st)})},js=(Qe,st)=>()=>{No(Qe,st)},cn=(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 jt=()=>{a.add("searchreplace",Qe=>{const st=o({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return Wo(Qe,st),cn(Qe,st),Bt(Qe,st)})};jt()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const a=(R,H,me)=>{var Oe;return me(R,H.prototype)?!0:((Oe=R.constructor)===null||Oe===void 0?void 0:Oe.name)===H.name},c=R=>{const H=typeof R;return R===null?"null":H==="object"&&Array.isArray(R)?"array":H==="object"&&a(R,String,(me,Oe)=>Oe.isPrototypeOf(me))?"string":H},d=R=>H=>c(H)===R,g=R=>H=>typeof H===R,p=R=>H=>R===H,v=d("string"),x=d("array"),T=g("boolean"),A=p(void 0),M=R=>R==null,I=R=>!M(R),z=g("function"),U=g("number"),K=()=>{},X=(R,H)=>me=>R(H(me)),Q=R=>()=>R,le=R=>R,ae=(R,H)=>R===H;function Z(R,...H){return(...me)=>{const Oe=H.concat(me);return R.apply(null,Oe)}}const Ce=R=>{R()},ct=Q(!1),Ge=Q(!0);class oe{constructor(H,me){this.tag=H,this.value=me}static some(H){return new oe(!0,H)}static none(){return oe.singletonNone}fold(H,me){return this.tag?me(this.value):H()}isSome(){return this.tag}isNone(){return!this.tag}map(H){return this.tag?oe.some(H(this.value)):oe.none()}bind(H){return this.tag?H(this.value):oe.none()}exists(H){return this.tag&&H(this.value)}forall(H){return!this.tag||H(this.value)}filter(H){return!this.tag||H(this.value)?this:oe.none()}getOr(H){return this.tag?this.value:H}or(H){return this.tag?this:H}getOrThunk(H){return this.tag?this.value:H()}orThunk(H){return this.tag?this:H()}getOrDie(H){if(this.tag)return this.value;throw new Error(H??"Called getOrDie on None")}static from(H){return I(H)?oe.some(H):oe.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(H){this.tag&&H(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}oe.singletonNone=new oe(!1);const Ze=Object.keys,yt=Object.hasOwnProperty,_t=(R,H)=>{const me=Ze(R);for(let Oe=0,lt=me.length;Oe<lt;Oe++){const on=me[Oe],Nn=R[on];H(Nn,on)}},Re=R=>(H,me)=>{R[me]=H},ue=(R,H,me,Oe)=>{_t(R,(lt,on)=>{(H(lt,on)?me:Oe)(lt,on)})},Xt=(R,H)=>{const me={};return ue(R,H,Re(me),K),me},Se=(R,H)=>{const me=[];return _t(R,(Oe,lt)=>{me.push(H(Oe,lt))}),me},Ie=R=>Se(R,le),D=R=>Ze(R).length,ze=(R,H)=>be(R,H)?oe.from(R[H]):oe.none(),be=(R,H)=>yt.call(R,H),tt=(R,H)=>be(R,H)&&R[H]!==void 0&&R[H]!==null,nt=R=>{for(const H in R)if(yt.call(R,H))return!1;return!0},ge=Array.prototype.indexOf,je=Array.prototype.push,kt=(R,H)=>ge.call(R,H),Ve=(R,H)=>kt(R,H)>-1,ht=(R,H)=>{for(let me=0,Oe=R.length;me<Oe;me++){const lt=R[me];if(H(lt,me))return!0}return!1},De=(R,H)=>{const me=[];for(let Oe=0;Oe<R;Oe++)me.push(H(Oe));return me},ut=(R,H)=>{const me=R.length,Oe=new Array(me);for(let lt=0;lt<me;lt++){const on=R[lt];Oe[lt]=H(on,lt)}return Oe},ee=(R,H)=>{for(let me=0,Oe=R.length;me<Oe;me++){const lt=R[me];H(lt,me)}},gn=(R,H)=>{for(let me=R.length-1;me>=0;me--){const Oe=R[me];H(Oe,me)}},mt=(R,H)=>{const me=[],Oe=[];for(let lt=0,on=R.length;lt<on;lt++){const Nn=R[lt];(H(Nn,lt)?me:Oe).push(Nn)}return{pass:me,fail:Oe}},Ct=(R,H)=>{const me=[];for(let Oe=0,lt=R.length;Oe<lt;Oe++){const on=R[Oe];H(on,Oe)&&me.push(on)}return me},Ut=(R,H,me)=>(gn(R,(Oe,lt)=>{me=H(me,Oe,lt)}),me),wt=(R,H,me)=>(ee(R,(Oe,lt)=>{me=H(me,Oe,lt)}),me),Y=(R,H,me)=>{for(let Oe=0,lt=R.length;Oe<lt;Oe++){const on=R[Oe];if(H(on,Oe))return oe.some(on);if(me(on,Oe))break}return oe.none()},re=(R,H)=>Y(R,H,ct),ce=R=>{const H=[];for(let me=0,Oe=R.length;me<Oe;++me){if(!x(R[me]))throw new Error("Arr.flatten item "+me+" was not an array, input: "+R);je.apply(H,R[me])}return H},W=(R,H)=>ce(ut(R,H)),ve=(R,H)=>{for(let me=0,Oe=R.length;me<Oe;++me){const lt=R[me];if(H(lt,me)!==!0)return!1}return!0},Ne=(R,H)=>{const me={};for(let Oe=0,lt=R.length;Oe<lt;Oe++){const on=R[Oe];me[String(on)]=H(on,Oe)}return me},Pe=(R,H)=>H>=0&&H<R.length?oe.some(R[H]):oe.none(),dt=R=>Pe(R,0),Ue=R=>Pe(R,R.length-1),pt=(R,H)=>{for(let me=0;me<R.length;me++){const Oe=H(R[me],me);if(Oe.isSome())return Oe}return oe.none()},$t=8,hn=9,xt=11,Pt=1,dn=3,_n=(R,H)=>{const Oe=(H||document).createElement("div");if(Oe.innerHTML=R,!Oe.hasChildNodes()||Oe.childNodes.length>1){const lt="HTML does not have a single root node";throw console.error(lt,R),new Error(lt)}return Ot(Oe.childNodes[0])},So=(R,H)=>{const Oe=(H||document).createElement(R);return Ot(Oe)},Jn=(R,H)=>{const Oe=(H||document).createTextNode(R);return Ot(Oe)},Ot=R=>{if(R==null)throw new Error("Node cannot be null or undefined");return{dom:R}},an={fromHtml:_n,fromTag:So,fromText:Jn,fromDom:Ot,fromPoint:(R,H,me)=>oe.from(R.dom.elementFromPoint(H,me)).map(Ot)},On=(R,H)=>{const me=R.dom;if(me.nodeType!==Pt)return!1;{const Oe=me;if(Oe.matches!==void 0)return Oe.matches(H);if(Oe.msMatchesSelector!==void 0)return Oe.msMatchesSelector(H);if(Oe.webkitMatchesSelector!==void 0)return Oe.webkitMatchesSelector(H);if(Oe.mozMatchesSelector!==void 0)return Oe.mozMatchesSelector(H);throw new Error("Browser lacks native selectors")}},_o=R=>R.nodeType!==Pt&&R.nodeType!==hn&&R.nodeType!==xt||R.childElementCount===0,Mo=(R,H)=>{const me=H===void 0?document:H.dom;return _o(me)?[]:ut(me.querySelectorAll(R),an.fromDom)},ws=(R,H)=>{const me=H===void 0?document:H.dom;return _o(me)?oe.none():oe.from(me.querySelector(R)).map(an.fromDom)},vo=(R,H)=>R.dom===H.dom,Us=On;typeof window<"u"||Function("return this;")();const fn=R=>R.dom.nodeName.toLowerCase(),Vo=R=>R.dom.nodeType,tr=R=>H=>Vo(H)===R,rr=R=>Vo(R)===$t||fn(R)==="#comment",Ir=tr(Pt),Br=tr(dn),Ts=tr(hn),Ar=tr(xt),Xr=R=>H=>Ir(H)&&fn(H)===R,xs=R=>an.fromDom(R.dom.ownerDocument),lo=R=>Ts(R)?R:xs(R),Bs=R=>oe.from(R.dom.parentNode).map(an.fromDom),Et=(R,H)=>{const me=z(H)?H:ct;let Oe=R.dom;const lt=[];for(;Oe.parentNode!==null&&Oe.parentNode!==void 0;){const on=Oe.parentNode,Nn=an.fromDom(on);if(lt.push(Nn),me(Nn)===!0)break;Oe=on}return lt},Vt=R=>oe.from(R.dom.previousSibling).map(an.fromDom),Bn=R=>oe.from(R.dom.nextSibling).map(an.fromDom),ro=R=>ut(R.dom.childNodes,an.fromDom),Ro=(R,H)=>{const me=R.dom.childNodes;return oe.from(me[H]).map(an.fromDom)},is=R=>Ro(R,0),yr=R=>Ar(R)&&I(R.dom.host),wr=R=>an.fromDom(R.dom.getRootNode()),ar=R=>{const H=wr(R);return yr(H)?oe.some(H):oe.none()},Xe=R=>an.fromDom(R.dom.host),qe=R=>{const H=Br(R)?R.dom.parentNode:R.dom;if(H==null||H.ownerDocument===null)return!1;const me=H.ownerDocument;return ar(an.fromDom(H)).fold(()=>me.body.contains(H),X(qe,Xe))};var Bt=(R,H,me,Oe,lt)=>R(me,Oe)?oe.some(me):z(lt)&<(me)?oe.none():H(me,Oe,lt);const qt=(R,H,me)=>{let Oe=R.dom;const lt=z(me)?me:ct;for(;Oe.parentNode;){Oe=Oe.parentNode;const on=an.fromDom(Oe);if(H(on))return oe.some(on);if(lt(on))break}return oe.none()},fo=(R,H,me)=>Bt((lt,on)=>on(lt),qt,R,H,me),No=(R,H)=>{const me=lt=>H(an.fromDom(lt));return re(R.dom.childNodes,me).map(an.fromDom)},Wo=(R,H,me)=>qt(R,Oe=>On(Oe,H),me),js=(R,H)=>No(R,me=>On(me,H)),cn=(R,H)=>ws(H,R),jt=(R,H,me)=>Bt((lt,on)=>On(lt,on),Wo,R,H,me),Qe=R=>jt(R,"[contenteditable]"),st=(R,H=!1)=>qe(R)?R.dom.isContentEditable:Qe(R).fold(Q(H),me=>ln(me)==="true"),ln=R=>R.dom.contentEditable,yn=R=>R.nodeName.toLowerCase(),Hn=R=>an.fromDom(R.getBody()),co=R=>H=>vo(H,Hn(R)),uo=R=>R?R.replace(/px$/,""):"",no=R=>/^\d+(\.\d+)?$/.test(R)?R+"px":R,wo=R=>an.fromDom(R.selection.getStart()),Po=R=>an.fromDom(R.selection.getEnd()),cs=R=>fo(R,Xr("table")).forall(st),Js=(R,H)=>Ct(ro(R),H),Es=(R,H)=>{let me=[];return ee(ro(R),Oe=>{H(Oe)&&(me=me.concat([Oe])),me=me.concat(Es(Oe,H))}),me},Ya=(R,H)=>Js(R,me=>On(me,H)),ta=(R,H)=>Mo(H,R),Ho=(R,H,me)=>{if(v(me)||T(me)||U(me))R.setAttribute(H,me+"");else throw console.error("Invalid call to Attribute.set. Key ",H,":: Value ",me,":: Element ",R),new Error("Attribute value was not simple")},Qo=(R,H,me)=>{Ho(R.dom,H,me)},ns=(R,H)=>{const me=R.dom;_t(H,(Oe,lt)=>{Ho(me,lt,Oe)})},ca=(R,H)=>{const me=R.dom.getAttribute(H);return me===null?void 0:me},na=(R,H)=>oe.from(ca(R,H)),la=(R,H)=>{R.dom.removeAttribute(H)},Ys=R=>wt(R.dom.attributes,(H,me)=>(H[me.name]=me.value,H),{}),jl=(R,H,me=ae)=>R.exists(Oe=>me(Oe,H)),ui=R=>{const H=[],me=Oe=>{H.push(Oe)};for(let Oe=0;Oe<R.length;Oe++)R[Oe].each(me);return H},tl=(R,H,me)=>R.isSome()&&H.isSome()?oe.some(me(R.getOrDie(),H.getOrDie())):oe.none(),ls=R=>R.bind(le),Oi=(R,H)=>R?oe.some(H):oe.none(),ir=(R,H)=>R.substring(H),Rc=(R,H,me)=>H===""||R.length>=H.length&&R.substr(me,me+H.length)===H,oi=(R,H)=>qi(R,H)?ir(R,H.length):R,qi=(R,H)=>Rc(R,H,0),Pc=(R=>H=>H.replace(R,""))(/^\s+|\s+$/g),di=R=>R.length>0,Ic=R=>!di(R),wc=(R,H=10)=>{const me=parseInt(R,H);return isNaN(me)?oe.none():oe.some(me)},Bc=R=>{const H=parseFloat(R);return isNaN(H)?oe.none():oe.some(H)},Or=R=>R.style!==void 0&&z(R.style.getPropertyValue),Ni=(R,H,me)=>{if(!v(me))throw console.error("Invalid call to CSS.set. Property ",H,":: Value ",me,":: Element ",R),new Error("CSS value must be a string: "+me);Or(R)&&R.style.setProperty(H,me)},Cc=(R,H)=>{Or(R)&&R.style.removeProperty(H)},Sc=(R,H,me)=>{const Oe=R.dom;Ni(Oe,H,me)},wl=(R,H)=>{const me=R.dom,lt=window.getComputedStyle(me).getPropertyValue(H);return lt===""&&!qe(R)?fi(me,H):lt},fi=(R,H)=>Or(R)?R.style.getPropertyValue(H):"",Fr=(R,H)=>{const me=R.dom,Oe=fi(me,H);return oe.from(Oe).filter(lt=>lt.length>0)},Wr=(R,H)=>{const me=R.dom;Cc(me,H),jl(na(R,"style").map(Pc),"")&&la(R,"style")},Ka=(R,H,me=0)=>na(R,H).map(Oe=>parseInt(Oe,10)).getOr(me),nl=(R,H)=>ol(R,H,Ge),ol=(R,H,me)=>W(ro(R),Oe=>On(Oe,H)?me(Oe)?[Oe]:[]:ol(Oe,H,me)),ka=["tfoot","thead","tbody","colgroup"],xe=R=>Ve(ka,R),We=(R,H)=>({rows:R,columns:H}),ft=(R,H,me)=>({element:R,rowspan:H,colspan:me}),Jt=(R,H,me,Oe,lt,on)=>({element:R,rowspan:H,colspan:me,row:Oe,column:lt,isLocked:on}),de=(R,H,me)=>({element:R,cells:H,section:me}),we=(R,H,me,Oe)=>({startRow:R,startCol:H,finishRow:me,finishCol:Oe}),ot=(R,H,me)=>({element:R,colspan:H,column:me}),Kt=(R,H)=>({element:R,columns:H}),Pn=(R,H,me=ct)=>{if(me(H))return oe.none();if(Ve(R,fn(H)))return oe.some(H);const Oe=lt=>On(lt,"table")||me(lt);return Wo(H,R.join(","),Oe)},se=(R,H)=>Pn(["td","th"],R,H),ye=R=>nl(R,"th,td"),Ke=R=>On(R,"colgroup")?Ya(R,"col"):W(kn(R),H=>Ya(H,"col")),At=(R,H)=>jt(R,"table",H),Tn=R=>nl(R,"tr"),kn=R=>At(R).fold(Q([]),H=>Ya(H,"colgroup")),fs=(R,H)=>ut(R,me=>{if(fn(me)==="colgroup"){const Oe=ut(Ke(me),lt=>{const on=Ka(lt,"span",1);return ft(lt,1,on)});return de(me,Oe,"colgroup")}else{const Oe=ut(ye(me),lt=>{const on=Ka(lt,"rowspan",1),Nn=Ka(lt,"colspan",1);return ft(lt,on,Nn)});return de(me,Oe,H(me))}}),Jr=R=>Bs(R).map(H=>{const me=fn(H);return xe(me)?me:"tbody"}).getOr("tbody"),tn=R=>{const H=Tn(R),Oe=[...kn(R),...H];return fs(Oe,Jr)},ua="data-snooker-locked-cols",Vs=R=>na(R,ua).bind(H=>oe.from(H.match(/\d+/g))).map(H=>Ne(H,Ge)),sl=(R,H)=>R+","+H,Zr=(R,H,me)=>oe.from(R.access[sl(H,me)]),us=(R,H,me)=>{const Oe=mi(R,lt=>me(H,lt.element));return Oe.length>0?oe.some(Oe[0]):oe.none()},mi=(R,H)=>{const me=W(R.all,Oe=>Oe.cells);return Ct(me,H)},Aa=R=>{const H={};let me=0;return ee(R.cells,Oe=>{const lt=Oe.colspan;De(lt,on=>{const Nn=me+on;H[Nn]=ot(Oe.element,lt,Nn)}),me+=lt}),H},gi=R=>{const H={},me=[],lt=dt(R).map(Tc=>Tc.element).bind(At).bind(Vs).getOr({});let on=0,Nn=0,ao=0;const{pass:Zo,fail:ts}=mt(R,Tc=>Tc.section==="colgroup");ee(ts,Tc=>{const ju=[];ee(Tc.cells,zc=>{let hu=0;for(;H[sl(ao,hu)]!==void 0;)hu++;const Ng=tt(lt,hu.toString()),$g=Jt(zc.element,zc.rowspan,zc.colspan,ao,hu,Ng);for(let kc=0;kc<zc.colspan;kc++)for(let Dg=0;Dg<zc.rowspan;Dg++){const Mg=ao+Dg,Wp=hu+kc,Ah=sl(Mg,Wp);H[Ah]=$g,Nn=Math.max(Nn,Wp+1)}ju.push($g)}),on++,me.push(de(Tc.element,ju,Tc.section)),ao++});const{columns:lr,colgroups:sr}=Ue(Zo).map(Tc=>{const ju=Aa(Tc);return{colgroups:[Kt(Tc.element,Ie(ju))],columns:ju}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:We(on,Nn),access:H,all:me,columns:lr,colgroups:sr}},Zl={fromTable:R=>{const H=tn(R);return gi(H)},generate:gi,getAt:Zr,findItem:us,filterItems:mi,justCells:R=>W(R.all,H=>H.cells),justColumns:R=>Ie(R.columns),hasColumns:R=>Ze(R.columns).length>0,getColumnAt:(R,H)=>oe.from(R.columns[H])};var Oa=tinymce.util.Tools.resolve("tinymce.util.Tools");const Va=(R,H,me)=>{const Oe=R.select("td,th",H);let lt;for(let on=0;on<Oe.length;on++){const Nn=R.getStyle(Oe[on],me);if(A(lt)&&(lt=Nn),lt!==Nn)return""}return lt},$i=(R,H,me)=>{Oa.each("left center right".split(" "),Oe=>{Oe!==me&&R.formatter.remove("align"+Oe,{},H)}),me&&R.formatter.apply("align"+me,{},H)},lu=(R,H,me)=>{Oa.each("top middle bottom".split(" "),Oe=>{Oe!==me&&R.formatter.remove("valign"+Oe,{},H)}),me&&R.formatter.apply("valign"+me,{},H)},$e=(R,H,me)=>{R.dispatch("TableModified",{...me,table:H})},Be=(R,H)=>Bc(R).getOr(H),Dt=(R,H,me)=>Be(wl(R,H),me),nn=(R,H,me,Oe)=>{const lt=Dt(R,`padding-${me}`,0),on=Dt(R,`padding-${Oe}`,0),Nn=Dt(R,`border-${me}-width`,0),ao=Dt(R,`border-${Oe}-width`,0);return H-lt-on-Nn-ao},po=(R,H)=>{const me=R.dom,Oe=me.getBoundingClientRect().width||me.offsetWidth;return H==="border-box"?Oe:nn(R,Oe,"left","right")},rs=R=>po(R,"content-box");var cr=tinymce.util.Tools.resolve("tinymce.Env");const ga="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",Yi=De(5,R=>{const H=`${R+1}px`;return{title:H,value:H}}),hi=ut(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],R=>({title:R,value:R.toLowerCase()})),Nr="100%",sa=R=>{var H;const me=R.dom,Oe=(H=me.getParent(R.selection.getStart(),me.isBlock))!==null&&H!==void 0?H:R.getBody();return rs(an.fromDom(Oe))+"px"},Sa=(R,H)=>Jd(R)||!Fc(R)?H:Cm(R)?{...H,width:sa(R)}:{...H,width:Nr},si=(R,H)=>Jd(R)||Fc(R)?H:Cm(R)?{...H,width:sa(R)}:{...H,width:Nr},Qr=R=>H=>H.options.get(R),Ha=R=>{const H=R.options.register;H("table_border_widths",{processor:"object[]",default:Yi}),H("table_border_styles",{processor:"object[]",default:hi}),H("table_cell_advtab",{processor:"boolean",default:!0}),H("table_row_advtab",{processor:"boolean",default:!0}),H("table_advtab",{processor:"boolean",default:!0}),H("table_appearance_options",{processor:"boolean",default:!0}),H("table_grid",{processor:"boolean",default:!cr.deviceType.isTouch()}),H("table_cell_class_list",{processor:"object[]",default:[]}),H("table_row_class_list",{processor:"object[]",default:[]}),H("table_class_list",{processor:"object[]",default:[]}),H("table_toolbar",{processor:"string",default:ga}),H("table_background_color_map",{processor:"object[]",default:[]}),H("table_border_color_map",{processor:"object[]",default:[]})},Ks=Qr("table_sizing_mode"),Gl=Qr("table_border_widths"),wm=Qr("table_border_styles"),Ru=Qr("table_cell_advtab"),Yd=Qr("table_row_advtab"),Kd=Qr("table_advtab"),id=Qr("table_appearance_options"),cd=Qr("table_grid"),Fc=Qr("table_style_by_css"),Di=Qr("table_cell_class_list"),Mp=Qr("table_row_class_list"),uu=Qr("table_class_list"),vg=Qr("table_toolbar"),Xd=Qr("table_background_color_map"),yg=Qr("table_border_color_map"),Cm=R=>Ks(R)==="fixed",Jd=R=>Ks(R)==="responsive",Sm=R=>{const H=R.options,me=H.get("table_default_styles");return H.isSet("table_default_styles")?me:Sa(R,me)},wg=R=>{const H=R.options,me=H.get("table_default_attributes");return H.isSet("table_default_attributes")?me:si(R,me)},ld=(R,H)=>H.column>=R.startCol&&H.column+H.colspan-1<=R.finishCol&&H.row>=R.startRow&&H.row+H.rowspan-1<=R.finishRow,Cg=(R,H)=>{let me=!0;const Oe=Z(ld,H);for(let lt=H.startRow;lt<=H.finishRow;lt++)for(let on=H.startCol;on<=H.finishCol;on++)me=me&&Zl.getAt(R,lt,on).exists(Oe);return me?oe.some(H):oe.none()},et=(R,H)=>we(Math.min(R.row,H.row),Math.min(R.column,H.column),Math.max(R.row+R.rowspan-1,H.row+H.rowspan-1),Math.max(R.column+R.colspan-1,H.column+H.colspan-1)),Qd=(R,H,me)=>{const Oe=Zl.findItem(R,H,vo),lt=Zl.findItem(R,me,vo);return Oe.bind(on=>lt.map(Nn=>et(on,Nn)))},rc=(R,H,me)=>Qd(R,H,me).bind(Oe=>Cg(R,Oe)),Sb=(R,H,me)=>{const Oe=Rp(R);return rc(Oe,H,me)},Rp=Zl.fromTable,ud=(R,H)=>{Bs(R).each(Oe=>{Oe.dom.insertBefore(H.dom,R.dom)})},$s=(R,H)=>{Bn(R).fold(()=>{Bs(R).each(lt=>{pi(lt,H)})},Oe=>{ud(Oe,H)})},ra=(R,H)=>{is(R).fold(()=>{pi(R,H)},Oe=>{R.dom.insertBefore(H.dom,Oe.dom)})},pi=(R,H)=>{R.dom.appendChild(H.dom)},Pu=(R,H)=>{ud(R,H),pi(H,R)},Sh=(R,H)=>{ee(H,(me,Oe)=>{const lt=Oe===0?R:H[Oe-1];$s(lt,me)})},ef=(R,H)=>{ee(H,me=>{pi(R,me)})},Mi=R=>{const H=R.dom;H.parentNode!==null&&H.parentNode.removeChild(H)},xm=R=>{const H=ro(R);H.length>0&&Sh(R,H),Mi(R)},Iu=((R,H)=>{const me=on=>{if(!R(on))throw new Error("Can only get "+H+" value of a "+H+" node");return Oe(on).getOr("")},Oe=on=>R(on)?oe.from(on.dom.nodeValue):oe.none();return{get:me,getOption:Oe,set:(on,Nn)=>{if(!R(on))throw new Error("Can only set raw "+H+" value of a "+H+" node");on.dom.nodeValue=Nn}}})(Br,"text"),Bu=R=>Iu.get(R),Df=(R,H)=>Iu.set(R,H);var rl=["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 R=ts=>an.fromDom(ts.dom.cloneNode(!1)),H=ts=>lo(ts).dom,me=ts=>Ir(ts)?fn(ts)==="body"?!0:Ve(rl,fn(ts)):!1,Oe=ts=>Ir(ts)?Ve(["br","img","hr","input"],fn(ts)):!1,lt=ts=>Ir(ts)&&ca(ts,"contenteditable")==="false",on=(ts,lr)=>ts.dom.compareDocumentPosition(lr.dom),Nn=(ts,lr)=>{const sr=Ys(ts);ns(lr,sr)},ao=ts=>{const lr=fn(ts);return Ve(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],lr)},Zo=ts=>Ir(ts)?na(ts,"lang"):oe.none();return{up:Q({selector:Wo,closest:jt,predicate:qt,all:Et}),down:Q({selector:ta,predicate:Es}),styles:Q({get:wl,getRaw:Fr,set:Sc,remove:Wr}),attrs:Q({get:ca,set:Qo,remove:la,copyTo:Nn}),insert:Q({before:ud,after:$s,afterAll:Sh,append:pi,appendAll:ef,prepend:ra,wrap:Pu}),remove:Q({unwrap:xm,remove:Mi}),create:Q({nu:an.fromTag,clone:R,text:an.fromText}),query:Q({comparePosition:on,prevSibling:Vt,nextSibling:Bn}),property:Q({children:ro,name:fn,parent:Bs,document:H,isText:Br,isComment:rr,isElement:Ir,isSpecial:ao,getLanguage:Zo,getText:Bu,setText:Df,isBoundary:me,isEmptyTag:Oe,isNonEditable:lt}),eq:vo,is:Us}};const ri=(R,H,me,Oe)=>{const lt=me[0],on=me.slice(1);return Oe(R,H,lt,on)},Fu=(R,H,me)=>me.length>0?ri(R,H,me,Cl):oe.none(),Cl=(R,H,me,Oe)=>{const lt=H(R,me);return Ut(Oe,(on,Nn)=>{const ao=H(R,Nn);return Ri(R,on,ao)},lt)},Ri=(R,H,me)=>H.bind(Oe=>me.filter(Z(R.eq,Oe))),dd=Fu,Pp=_m(),Tm=(R,H)=>dd(Pp,(me,Oe)=>R(Oe),H),ql=R=>Wo(R,"table"),tf=(R,H)=>{const me=ta(R,H);return me.length>0?oe.some(me):oe.none()},Ip=(R,H,me)=>cn(R,H).bind(Oe=>cn(R,me).bind(lt=>Tm(ql,[Oe,lt]).map(on=>({first:Oe,last:lt,table:on})))),Sg=(R,H)=>tf(R,H),Bp=(R,H,me)=>Ip(R,H,me).bind(Oe=>{const lt=Zo=>vo(R,Zo),on="thead,tfoot,tbody,table",Nn=Wo(Oe.first,on,lt),ao=Wo(Oe.last,on,lt);return Nn.bind(Zo=>ao.bind(ts=>vo(Zo,ts)?Sb(Oe.table,Oe.first,Oe.last):oe.none()))}),Fp=R=>ut(R,an.fromDom),xg="data-mce-selected",Lu="td["+xg+"],th["+xg+"]",km="data-mce-first-selected",du="td["+km+"],th["+km+"]",Lr="data-mce-last-selected",za="td["+Lr+"],th["+Lr+"]",ac={selected:xg,selectedSelector:Lu,firstSelected:km,firstSelectedSelector:du,lastSelected:Lr,lastSelectedSelector:za},Am=R=>At(R).bind(H=>Sg(H,ac.firstSelectedSelector)).fold(Q(R),H=>H[0]),Mf=R=>(H,me)=>{const Oe=fn(H),lt=Oe==="col"||Oe==="colgroup"?Am(H):H;return jt(lt,R,me)},Ua=Mf("th,td,caption"),ho=Mf("th,td"),Om=R=>Fp(R.model.table.getSelectedCells()),Vu=(R,H)=>{const me=ho(R),Oe=me.bind(lt=>At(lt)).map(lt=>Tn(lt));return tl(me,Oe,(lt,on)=>Ct(on,Nn=>ht(Fp(Nn.dom.cells),ao=>ca(ao,H)==="1"||vo(ao,lt)))).getOr([])},ic=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],Ws=R=>({value:xh(R)}),nf=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Nm=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Eg=R=>nf.test(R)||Nm.test(R),xh=R=>oi(R,"#").toUpperCase(),es=R=>Eg(R)?oe.some({value:xh(R)}):oe.none(),ha=R=>{const H=R.toString(16);return(H.length===1?"0"+H:H).toUpperCase()},fd=R=>{const H=ha(R.red)+ha(R.green)+ha(R.blue);return Ws(H)},xc=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,cc=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,Lc=(R,H,me,Oe)=>({red:R,green:H,blue:me,alpha:Oe}),Xa=(R,H,me,Oe)=>{const lt=parseInt(R,10),on=parseInt(H,10),Nn=parseInt(me,10),ao=parseFloat(Oe);return Lc(lt,on,Nn,ao)},Ki=R=>{const H=xc.exec(R);if(H!==null)return oe.some(Xa(H[1],H[2],H[3],"1"));const me=cc.exec(R);return me!==null?oe.some(Xa(me[1],me[2],me[3],me[4])):oe.none()},al=R=>es(R).orThunk(()=>Ki(R).map(fd)).getOrThunk(()=>{const H=document.createElement("canvas");H.height=1,H.width=1;const me=H.getContext("2d");me.clearRect(0,0,H.width,H.height),me.fillStyle="#FFFFFF",me.fillStyle=R,me.fillRect(0,0,1,1);const Oe=me.getImageData(0,0,1,1).data,lt=Oe[0],on=Oe[1],Nn=Oe[2],ao=Oe[3];return fd(Lc(lt,on,Nn,ao))}),_g=R=>Ki(R).map(fd).map(H=>"#"+H.value).getOr(R),$r=R=>{let H=R;return{get:()=>H,set:lt=>{H=lt}}},Tg=R=>{const H=$r(oe.none()),me=()=>H.get().each(R);return{clear:()=>{me(),H.set(oe.none())},isSet:()=>H.get().isSome(),get:()=>H.get(),set:ao=>{me(),H.set(oe.some(ao))}}},xa=()=>Tg(R=>R.unbind()),md=(R,H,me)=>Oe=>{const lt=xa(),on=Ic(me),Nn=()=>{const ao=Om(R),Zo=ts=>R.formatter.match(H,{value:me},ts.dom,on);on?(Oe.setActive(!ht(ao,Zo)),lt.set(R.formatter.formatChanged(H,ts=>Oe.setActive(!ts),!0))):(Oe.setActive(ve(ao,Zo)),lt.set(R.formatter.formatChanged(H,Oe.setActive,!1,{value:me})))};return R.initialized?Nn():R.on("init",Nn),lt.clear},fu=R=>tt(R,"menu"),ur=R=>ut(R,H=>{const me=H.text||H.title||"";return fu(H)?{text:me,items:ur(H.menu)}:{text:me,value:H.value}}),Yl=R=>R.length?oe.some(ur([{text:"Select...",value:"mce-no-match"},...R])):oe.none(),Rf=(R,H,me,Oe)=>ut(H,lt=>{const on=lt.text||lt.title;return fu(lt)?{type:"nestedmenuitem",text:on,getSubmenuItems:()=>Rf(R,lt.menu,me,Oe)}:{text:on,type:"togglemenuitem",onAction:()=>Oe(lt.value),onSetup:md(R,me,lt.value)}}),gd=(R,H)=>me=>{R.execCommand("mceTableApplyCellStyle",!1,{[H]:me})},Dr=R=>W(R,H=>fu(H)?[{...H,menu:Dr(H.menu)}]:di(H.value)?[H]:[]),Hu=(R,H,me,Oe)=>lt=>lt(Rf(R,H,me,Oe)),il=(R,H,me)=>{const Oe=ut(H,lt=>({text:lt.title,value:"#"+al(lt.value).value,type:"choiceitem"}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:Oe.length>0?Oe:void 0,allowCustomColors:!1},onAction:lt=>{const on=lt.value==="remove"?"":lt.value;R.execCommand("mceTableApplyCellStyle",!1,{[me]:on})}}]},bs=R=>()=>{const me=R.queryCommandValue("mceTableRowType")==="header"?"body":"header";R.execCommand("mceTableRowType",!1,{type:me})},of=R=>()=>{const me=R.queryCommandValue("mceTableColType")==="th"?"td":"th";R.execCommand("mceTableColType",!1,{type:me})},kg=R=>Yl(Di(R)).map(H=>({name:"class",type:"listbox",label:"Class",items:H})),F=[{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:ic}],J=R=>F.concat(kg(R).toArray()),pe=(R,H)=>{const Oe=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(ur(wm(R)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:H==="cell"?[{name:"borderwidth",type:"input",label:"Border width"}].concat(Oe):Oe}},it={normal:(R,H)=>{const me=R.dom;return{setAttrib:(Nn,ao)=>{me.setAttrib(H,Nn,ao)},setStyle:(Nn,ao)=>{me.setStyle(H,Nn,ao)},setFormat:(Nn,ao)=>{ao===""?R.formatter.remove(Nn,{value:null},H,!0):R.formatter.apply(Nn,{value:ao},H)}}}},wn=Xr("th"),$o=(R,H)=>R&&H?"sectionCells":R?"section":"cells",os=R=>{const H=R.section==="thead",me=jl(Xo(R.cells),"th");return R.section==="tfoot"?{type:"footer"}:H||me?{type:"header",subType:$o(H,me)}:{type:"body"}},Xo=R=>{const H=Ct(R,me=>wn(me.element));return H.length===0?oe.some("td"):H.length===R.length?oe.some("th"):oe.none()},mo=R=>{const H=ut(R,lt=>os(lt).type),me=Ve(H,"header"),Oe=Ve(H,"footer");if(!me&&!Oe)return oe.some("body");{const lt=Ve(H,"body");return me&&!lt&&!Oe?oe.some("header"):!me&&!lt&&Oe?oe.some("footer"):oe.none()}},Vr=R=>{let H=!1,me;return(...Oe)=>(H||(H=!0,me=R.apply(null,Oe)),me)},aa=(R,H)=>pt(R.all,me=>re(me.cells,Oe=>vo(H,Oe.element))),cl=(R,H,me)=>{const Oe=ut(H.selection,on=>se(on).bind(Nn=>aa(R,Nn)).filter(me)),lt=ui(Oe);return Oi(lt.length>0,lt)},Vc=(R,H)=>H.mergable,xb=(R,H)=>H.unmergable,Pf=(R,H)=>cl(R,H,Ge),Lp=(R,H)=>aa(R,H).exists(me=>!me.isLocked),Pi=(R,H)=>ve(H,me=>Lp(R,me)),Vp=(R,H)=>Vc(R,H).filter(me=>Pi(R,me.cells)),k0=(R,H)=>xb(R,H).filter(me=>Pi(R,me));({...{generate:R=>{if(!x(R))throw new Error("cases must be an array");if(R.length===0)throw new Error("there must be at least one case");const H=[],me={};return ee(R,(Oe,lt)=>{const on=Ze(Oe);if(on.length!==1)throw new Error("one and only one name per case");const Nn=on[0],ao=Oe[Nn];if(me[Nn]!==void 0)throw new Error("duplicate key detected:"+Nn);if(Nn==="cata")throw new Error("cannot have a case named cata (sorry)");if(!x(ao))throw new Error("case arguments must be an array");H.push(Nn),me[Nn]=(...Zo)=>{const ts=Zo.length;if(ts!==ao.length)throw new Error("Wrong number of arguments to case "+Nn+". Expected "+ao.length+" ("+ao+"), got "+ts);return{fold:(...sr)=>{if(sr.length!==R.length)throw new Error("Wrong number of arguments to fold. Expected "+R.length+", got "+sr.length);return sr[lt].apply(null,Zo)},match:sr=>{const qr=Ze(sr);if(H.length!==qr.length)throw new Error("Wrong number of arguments to match. Expected: "+H.join(",")+`
|
|
110
110
|
Actual: `+qr.join(","));if(!ve(H,ju=>Ve(qr,ju)))throw new Error("Not all branches were specified when using match. Specified: "+qr.join(", ")+`
|
|
111
111
|
Required: `+H.join(", "));return sr[Nn].apply(null,Zo)},log:sr=>{console.log(sr,{constructors:H,constructor:Nn,params:Zo})}}}}),me}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const Eb=(R,H)=>{const me=Zl.fromTable(R);return Pf(me,H).bind(lt=>{const on=lt[lt.length-1],Nn=lt[0].row,ao=on.row+on.rowspan,Zo=me.all.slice(Nn,ao);return mo(Zo)}).getOr("")},Bi=R=>qi(R,"rgb")?_g(R):R,Fo=R=>{const H=an.fromDom(R);return{borderwidth:Fr(H,"border-width").getOr(""),borderstyle:Fr(H,"border-style").getOr(""),bordercolor:Fr(H,"border-color").map(Bi).getOr(""),backgroundcolor:Fr(H,"background-color").map(Bi).getOr("")}},Kl=R=>{const H=R[0],me=R.slice(1);return ee(me,Oe=>{ee(Ze(H),lt=>{_t(Oe,(on,Nn)=>{const ao=H[lt];ao!==""&<===Nn&&ao!==on&&(H[lt]=lt==="class"?"mce-no-match":"")})})}),H},$m=(R,H,me,Oe)=>re(R,lt=>!A(me.formatter.matchNode(Oe,H+lt))).getOr(""),Ag=Z($m,["left","center","right"],"align"),A0=Z($m,["top","middle","bottom"],"valign"),Up=(R,H)=>{const me=Sm(R),Oe=wg(R),lt=()=>({borderstyle:ze(me,"border-style").getOr(""),bordercolor:Bi(ze(me,"border-color").getOr("")),backgroundcolor:Bi(ze(me,"background-color").getOr(""))}),on={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},Nn=()=>{const lr=me["border-width"];return Fc(R)&&lr?{border:lr}:ze(Oe,"border").fold(()=>({}),sr=>({border:sr}))},ao=H?lt():{},Zo=()=>{const lr=ze(me,"border-spacing").or(ze(Oe,"cellspacing")).fold(()=>({}),qr=>({cellspacing:qr})),sr=ze(me,"border-padding").or(ze(Oe,"cellpadding")).fold(()=>({}),qr=>({cellpadding:qr}));return{...lr,...sr}};return{...on,...me,...Oe,...ao,...Nn(),...Zo()}},mu=R=>At(an.fromDom(R)).map(H=>{const me={selection:Fp(R.cells)};return Eb(H,me)}).getOr(""),hd=(R,H,me)=>{const Oe=(ao,Zo)=>{const ts=Fr(an.fromDom(Zo),"border-width");return Fc(R)&&ts.isSome()?ts.getOr(""):ao.getAttrib(Zo,"border")||Va(R.dom,Zo,"border-width")||Va(R.dom,Zo,"border")||""},lt=R.dom,on=Fc(R)?lt.getStyle(H,"border-spacing")||lt.getAttrib(H,"cellspacing"):lt.getAttrib(H,"cellspacing")||lt.getStyle(H,"border-spacing"),Nn=Fc(R)?Va(lt,H,"padding")||lt.getAttrib(H,"cellpadding"):lt.getAttrib(H,"cellpadding")||Va(lt,H,"padding");return{width:lt.getStyle(H,"width")||lt.getAttrib(H,"width"),height:lt.getStyle(H,"height")||lt.getAttrib(H,"height"),cellspacing:on??"",cellpadding:Nn??"",border:Oe(lt,H),caption:!!lt.select("caption",H)[0],class:lt.getAttrib(H,"class",""),align:Ag(R,H),...me?Fo(H):{}}},If=(R,H,me)=>{const Oe=R.dom;return{height:Oe.getStyle(H,"height")||Oe.getAttrib(H,"height"),class:Oe.getAttrib(H,"class",""),type:mu(H),align:Ag(R,H),...me?Fo(H):{}}},Zn=(R,H,me,Oe)=>{const lt=R.dom,on=Oe.getOr(H);return{width:((ao,Zo)=>lt.getStyle(ao,Zo)||lt.getAttrib(ao,Zo))(on,"width"),scope:lt.getAttrib(H,"scope"),celltype:yn(H),class:lt.getAttrib(H,"class",""),halign:Ag(R,H),valign:A0(R,H),...me?Fo(H):{}}},Sl=(R,H)=>{const me=Zl.fromTable(R),Oe=Zl.justCells(me),lt=Ct(Oe,on=>ht(H,Nn=>vo(on.element,Nn)));return ut(lt,on=>({element:on.element.dom,column:Zl.getColumnAt(me,on.column).map(Nn=>Nn.element.dom)}))},_b=(R,H,me,Oe)=>{Oe("scope")&&R.setAttrib("scope",me.scope),Oe("class")&&me.class!=="mce-no-match"&&R.setAttrib("class",me.class),Oe("width")&&H.setStyle("width",no(me.width))},Dm=(R,H,me)=>{me("backgroundcolor")&&R.setFormat("tablecellbackgroundcolor",H.backgroundcolor),me("bordercolor")&&R.setFormat("tablecellbordercolor",H.bordercolor),me("borderstyle")&&R.setFormat("tablecellborderstyle",H.borderstyle),me("borderwidth")&&R.setFormat("tablecellborderwidth",no(H.borderwidth))},gu=(R,H,me,Oe)=>{const lt=H.length===1;ee(H,on=>{const Nn=on.element,ao=lt?Ge:Oe,Zo=it.normal(R,Nn),ts=on.column.map(lr=>it.normal(R,lr)).getOr(Zo);_b(Zo,ts,me,ao),Ru(R)&&Dm(Zo,me,ao),Oe("halign")&&$i(R,Nn,me.halign),Oe("valign")&&lu(R,Nn,me.valign)})},Eh=(R,H)=>{R.execCommand("mceTableCellType",!1,{type:H.celltype,no_events:!0})},Bf=(R,H,me,Oe)=>{const lt=Xt(Oe,(on,Nn)=>me[Nn]!==on);D(lt)>0&&H.length>=1&&At(H[0]).each(on=>{const Nn=Sl(on,H),ao=D(Xt(lt,(ts,lr)=>lr!=="scope"&&lr!=="celltype"))>0,Zo=be(lt,"celltype");(ao||be(lt,"scope"))&&gu(R,Nn,Oe,Z(be,lt)),Zo&&Eh(R,Oe),$e(R,on.dom,{structure:Zo,style:ao})})},Mm=(R,H,me,Oe)=>{const lt=Oe.getData();Oe.close(),R.undoManager.transact(()=>{Bf(R,H,me,lt),R.focus()})},_h=(R,H)=>{const me=At(H[0]).map(Oe=>ut(Sl(Oe,H),lt=>Zn(R,lt.element,Ru(R),lt.column)));return Kl(me.getOrDie())},zu=R=>{const H=Om(R);if(H.length===0)return;const me=_h(R,H),Oe={type:"tabpanel",tabs:[{title:"General",name:"general",items:J(R)},pe(R,"cell")]},lt={type:"panel",items:[{type:"grid",columns:2,items:J(R)}]};R.windowManager.open({title:"Cell Properties",size:"normal",body:Ru(R)?Oe:lt,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:me,onSubmit:Z(Mm,R,H,me)})},O0=R=>Yl(Mp(R)).map(H=>({name:"class",type:"listbox",label:"Class",items:H})),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=R=>ia.concat(O0(R).toArray()),Ec=(R,H,me)=>{me("class")&&H.class!=="mce-no-match"&&R.setAttrib("class",H.class),me("height")&&R.setStyle("height",no(H.height))},Uu=(R,H,me)=>{me("backgroundcolor")&&R.setStyle("background-color",H.backgroundcolor),me("bordercolor")&&R.setStyle("border-color",H.bordercolor),me("borderstyle")&&R.setStyle("border-style",H.borderstyle)},Ja=(R,H,me,Oe)=>{const on=H.length===1?Ge:Oe;ee(H,Nn=>{const ao=Ya(an.fromDom(Nn),"td,th"),Zo=it.normal(R,Nn);Ec(Zo,me,on),Yd(R)&&Uu(Zo,me,on),Oe("height")&&ee(ao,ts=>{R.dom.setStyle(ts.dom,"height",null)}),Oe("align")&&$i(R,Nn,me.align)})},Og=(R,H)=>{R.execCommand("mceTableRowType",!1,{type:H.type,no_events:!0})},Qa=(R,H,me,Oe)=>{const lt=Xt(Oe,(on,Nn)=>me[Nn]!==on);if(D(lt)>0){const on=be(lt,"type"),Nn=on?D(lt)>1:!0;Nn&&Ja(R,H,Oe,Z(be,lt)),on&&Og(R,Oe),At(an.fromDom(H[0])).each(ao=>$e(R,ao.dom,{structure:on,style:Nn}))}},Fs=(R,H,me,Oe)=>{const lt=Oe.getData();Oe.close(),R.undoManager.transact(()=>{Qa(R,H,me,lt),R.focus()})},jp=R=>{const H=Vu(wo(R),ac.selected);if(H.length===0)return;const me=ut(H,Nn=>If(R,Nn.dom,Yd(R))),Oe=Kl(me),lt={type:"tabpanel",tabs:[{title:"General",name:"general",items:Sn(R)},pe(R,"row")]},on={type:"panel",items:[{type:"grid",columns:2,items:Sn(R)}]};R.windowManager.open({title:"Row Properties",size:"normal",body:Yd(R)?lt:on,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Oe,onSubmit:Z(Fs,R,ut(H,Nn=>Nn.dom),Oe)})},sn=(R,H,me)=>{const Oe=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=id(R)?[{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"}]}]:[],Nn=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],ao=H.length>0?[{name:"class",type:"listbox",label:"Class",items:H}]:[];return Oe.concat(lt).concat(on).concat(Nn).concat(ao)},Ls=(R,H,me,Oe)=>{if(H.tagName==="TD"||H.tagName==="TH")v(me)&&I(Oe)?R.setStyle(H,me,Oe):R.setStyles(H,me);else if(H.children)for(let lt=0;lt<H.children.length;lt++)Ls(R,H.children[lt],me,Oe)},Tb=(R,H,me,Oe)=>{const lt=R.dom,on={},Nn={},ao=Fc(R),Zo=Kd(R),ts=parseFloat(me.border)===0;if(!A(me.class)&&me.class!=="mce-no-match"&&(on.class=me.class),Nn.height=no(me.height),ao?Nn.width=no(me.width):lt.getAttrib(H,"width")&&(on.width=uo(me.width)),ao?(ts?(on.border=0,Nn["border-width"]=""):(Nn["border-width"]=no(me.border),on.border=1),Nn["border-spacing"]=no(me.cellspacing)):(on.border=ts?0:me.border,on.cellpadding=me.cellpadding,on.cellspacing=me.cellspacing),ao&&H.children){const lr={};if(ts?lr["border-width"]="":Oe.border&&(lr["border-width"]=no(me.border)),Oe.cellpadding&&(lr.padding=no(me.cellpadding)),Zo&&Oe.bordercolor&&(lr["border-color"]=me.bordercolor),!nt(lr))for(let sr=0;sr<H.children.length;sr++)Ls(lt,H.children[sr],lr)}if(Zo){const lr=me;Nn["background-color"]=lr.backgroundcolor,Nn["border-color"]=lr.bordercolor,Nn["border-style"]=lr.borderstyle}lt.setStyles(H,{...Sm(R),...Nn}),lt.setAttribs(H,{...wg(R),...on})},Na=(R,H,me,Oe)=>{const lt=R.dom,on=Oe.getData(),Nn=Xt(on,(ao,Zo)=>me[Zo]!==ao);Oe.close(),R.undoManager.transact(()=>{if(!H){const ao=wc(on.cols).getOr(1),Zo=wc(on.rows).getOr(1);R.execCommand("mceInsertTable",!1,{rows:Zo,columns:ao}),H=ho(wo(R),co(R)).bind(ts=>At(ts,co(R))).map(ts=>ts.dom).getOrDie()}if(D(Nn)>0){const ao={border:be(Nn,"border"),bordercolor:be(Nn,"bordercolor"),cellpadding:be(Nn,"cellpadding")};Tb(R,H,on,ao);const Zo=lt.select("caption",H)[0];(Zo&&!on.caption||!Zo&&on.caption)&&R.execCommand("mceTableToggleCaption"),$i(R,H,on.align)}if(R.focus(),R.addVisual(),D(Nn)>0){const ao=be(Nn,"caption"),Zo=ao?D(Nn)>1:!0;$e(R,H,{structure:ao,style:Zo})}})},Xl=(R,H)=>{const me=R.dom;let Oe,lt=Up(R,Kd(R));H?(lt.cols="1",lt.rows="1",Kd(R)&&(lt.borderstyle="",lt.bordercolor="",lt.backgroundcolor="")):(Oe=me.getParent(R.selection.getStart(),"table",R.getBody()),Oe?lt=hd(R,Oe,Kd(R)):Kd(R)&&(lt.borderstyle="",lt.bordercolor="",lt.backgroundcolor=""));const on=Yl(uu(R));on.isSome()&<.class&&(lt.class=lt.class.replace(/\s*mce\-item\-table\s*/g,""));const Nn={type:"grid",columns:2,items:sn(R,on.getOr([]),H)},ao=()=>({type:"panel",items:[Nn]}),Zo=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[Nn]},pe(R,"table")]}),ts=Kd(R)?Zo():ao();R.windowManager.open({title:"Table Properties",size:"normal",body:ts,onSubmit:Z(Na,R,Oe,lt),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:lt})},bi=R=>{const H=me=>{cs(wo(R))&&me()};_t({mceTableProps:Z(Xl,R,!1),mceTableRowProps:Z(jp,R),mceTableCellProps:Z(zu,R),mceInsertTableDialog:Z(Xl,R,!0)},(me,Oe)=>R.addCommand(Oe,()=>H(me)))},e2=(R,H)=>js(R,H).isSome(),pd=le,N0=R=>{const H=(Oe,lt)=>na(Oe,lt).exists(on=>parseInt(on,10)>1),me=Oe=>H(Oe,"rowspan")||H(Oe,"colspan");return R.length>0&&ve(R,me)?oe.some(R):oe.none()},Hc=(R,H,me)=>H.length<=1?oe.none():Bp(R,me.firstSelectedSelector,me.lastSelectedSelector).map(Oe=>({bounds:Oe,cells:H})),Hs=R=>({element:R,mergable:oe.none(),unmergable:oe.none(),selection:[R]}),bd=(R,H,me)=>({element:me,mergable:Hc(H,R,ac),unmergable:N0(R),selection:pd(R)}),Th=R=>{const H=$r(oe.none()),me=$r([]);let Oe=oe.none();const lt=Xr("caption"),on=Ds=>Oe.forall(Cr=>!Cr[Ds]),Nn=()=>Ua(wo(R),co(R)),ao=()=>Ua(Po(R),co(R)),Zo=()=>Nn().bind(Ds=>ls(tl(At(Ds),ao().bind(At),(Cr,Uc)=>vo(Cr,Uc)?lt(Ds)?oe.some(Hs(Ds)):oe.some(bd(Om(R),Cr,Ds)):oe.none()))),ts=Ds=>At(Ds.element).map(Uc=>{const Ea=Zl.fromTable(Uc),Zp=Pf(Ea,Ds).getOr([]),Oh=wt(Zp,(Ff,ul)=>(ul.isLocked&&(Ff.onAny=!0,ul.column===0?Ff.onFirst=!0:ul.column+ul.colspan>=Ea.grid.columns&&(Ff.onLast=!0)),Ff),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:Vp(Ea,Ds).isSome(),unmergeable:k0(Ea,Ds).isSome(),locked:Oh}}),lr=()=>{H.set(Vr(Zo)()),Oe=H.get().bind(ts),ee(me.get(),Ce)},sr=Ds=>(Ds(),me.set(me.get().concat([Ds])),()=>{me.set(Ct(me.get(),Cr=>Cr!==Ds))}),qr=(Ds,Cr)=>sr(()=>H.get().fold(()=>{Ds.setEnabled(!1)},Uc=>{Ds.setEnabled(!Cr(Uc)&&R.selection.isEditable())})),Tc=(Ds,Cr,Uc)=>sr(()=>H.get().fold(()=>{Ds.setEnabled(!1),Ds.setActive(!1)},Ea=>{Ds.setEnabled(!Cr(Ea)&&R.selection.isEditable()),Ds.setActive(Uc(Ea))})),ju=Ds=>Oe.exists(Cr=>Cr.locked[Ds]),zc=Ds=>qr(Ds,Cr=>!1),hu=Ds=>qr(Ds,Cr=>lt(Cr.element)),Ng=Ds=>Cr=>qr(Cr,Uc=>lt(Uc.element)||ju(Ds)),$g=Ds=>Cr=>qr(Cr,Uc=>lt(Uc.element)||Ds().isNone()),kc=(Ds,Cr)=>Uc=>qr(Uc,Ea=>lt(Ea.element)||Ds().isNone()||ju(Cr)),Dg=Ds=>qr(Ds,Cr=>on("mergeable")),Mg=Ds=>qr(Ds,Cr=>on("unmergeable")),Wp=Ds=>Tc(Ds,ct,Cr=>At(Cr.element,co(R)).exists(Ea=>e2(Ea,"caption"))),Ah=(Ds,Cr)=>Uc=>Tc(Uc,Ea=>lt(Ea.element),()=>R.queryCommandValue(Ds)===Cr),ai=Ah("mceTableRowType","header"),pu=Ah("mceTableColType","th");return R.on("NodeChange ExecCommand TableSelectorChange",lr),{onSetupTable:zc,onSetupCellOrRow:hu,onSetupColumn:Ng,onSetupPasteable:$g,onSetupPasteableColumn:kc,onSetupMergeable:Dg,onSetupUnmergeable:Mg,resetTargets:lr,onSetupTableWithCaption:Wp,onSetupTableRowHeaders:ai,onSetupTableColumnHeaders:pu,targets:H.get}};var pa=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const kh="x-tinymce/dom-table-",sf=kh+"rows",$0=kh+"columns",_c=R=>{var H;const me=(H=pa.read())!==null&&H!==void 0?H:[];return pt(me,Oe=>oe.from(Oe.getType(R)))},xl=()=>_c(sf),Tt=()=>_c($0),ll=R=>H=>{const me=()=>{H.setEnabled(R.selection.isEditable())};return R.on("NodeChange",me),me(),()=>{R.off("NodeChange",me)}},ei=(R,H)=>{R.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:ll(R),fetch:ao=>ao("inserttable | cell row column | advtablesort | tableprops deletetable")});const me=ao=>()=>R.execCommand(ao),Oe=(ao,Zo)=>{R.queryCommandSupported(Zo.command)&&R.ui.registry.addButton(ao,{...Zo,onAction:z(Zo.onAction)?Zo.onAction:me(Zo.command)})},lt=(ao,Zo)=>{R.queryCommandSupported(Zo.command)&&R.ui.registry.addToggleButton(ao,{...Zo,onAction:z(Zo.onAction)?Zo.onAction:me(Zo.command)})};Oe("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:H.onSetupTable}),Oe("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:H.onSetupTable}),Oe("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:H.onSetupCellOrRow}),Oe("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:H.onSetupMergeable}),Oe("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:H.onSetupUnmergeable}),Oe("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:H.onSetupCellOrRow}),Oe("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:H.onSetupCellOrRow}),Oe("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:H.onSetupCellOrRow}),Oe("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:H.onSetupCellOrRow}),Oe("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:H.onSetupColumn("onFirst")}),Oe("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:H.onSetupColumn("onLast")}),Oe("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:H.onSetupColumn("onAny")}),Oe("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:H.onSetupCellOrRow}),Oe("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:H.onSetupCellOrRow}),Oe("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:H.onSetupPasteable(xl)}),Oe("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:H.onSetupPasteable(xl)}),Oe("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:H.onSetupColumn("onAny")}),Oe("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:H.onSetupColumn("onAny")}),Oe("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:H.onSetupPasteableColumn(Tt,"onFirst")}),Oe("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:H.onSetupPasteableColumn(Tt,"onLast")}),Oe("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:ll(R)});const on=Dr(uu(R));on.length!==0&&R.queryCommandSupported("mceTableToggleClass")&&R.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Hu(R,on,"tableclass",ao=>R.execCommand("mceTableToggleClass",!1,ao)),onSetup:H.onSetupTable});const Nn=Dr(Di(R));Nn.length!==0&&R.queryCommandSupported("mceTableCellToggleClass")&&R.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Hu(R,Nn,"tablecellclass",ao=>R.execCommand("mceTableCellToggleClass",!1,ao)),onSetup:H.onSetupCellOrRow}),R.queryCommandSupported("mceTableApplyCellStyle")&&(R.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Hu(R,ic,"tablecellverticalalign",gd(R,"vertical-align")),onSetup:H.onSetupCellOrRow}),R.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Hu(R,Gl(R),"tablecellborderwidth",gd(R,"border-width")),onSetup:H.onSetupCellOrRow}),R.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Hu(R,wm(R),"tablecellborderstyle",gd(R,"border-style")),onSetup:H.onSetupCellOrRow}),R.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:ao=>ao(il(R,Xd(R),"background-color")),onSetup:H.onSetupCellOrRow}),R.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:ao=>ao(il(R,yg(R),"border-color")),onSetup:H.onSetupCellOrRow})),lt("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:H.onSetupTableWithCaption}),lt("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:bs(R),onSetup:H.onSetupTableRowHeaders}),lt("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:of(R),onSetup:H.onSetupTableColumnHeaders})},Gr=R=>{const H=Oe=>R.dom.is(Oe,"table")&&R.getBody().contains(Oe)&&R.dom.isEditable(Oe.parentNode),me=vg(R);me.length>0&&R.ui.registry.addContextToolbar("table",{predicate:H,items:me,scope:"node",position:"node"})},El=R=>H=>{const me=()=>{H.setEnabled(R.selection.isEditable())};return R.on("NodeChange",me),me(),()=>{R.off("NodeChange",me)}},ba=(R,H)=>{const me=sr=>()=>R.execCommand(sr),Oe=(sr,qr)=>R.queryCommandSupported(qr.command)?(R.ui.registry.addMenuItem(sr,{...qr,onAction:z(qr.onAction)?qr.onAction:me(qr.command)}),!0):!1,lt=(sr,qr)=>{R.queryCommandSupported(qr.command)&&R.ui.registry.addToggleMenuItem(sr,{...qr,onAction:z(qr.onAction)?qr.onAction:me(qr.command)})},on=sr=>{R.execCommand("mceInsertTable",!1,{rows:sr.numRows,columns:sr.numColumns})},Nn=[Oe("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:H.onSetupCellOrRow}),Oe("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:H.onSetupCellOrRow}),Oe("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:H.onSetupCellOrRow}),Oe("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:H.onSetupCellOrRow}),Oe("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:H.onSetupCellOrRow}),Oe("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:H.onSetupCellOrRow}),Oe("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:H.onSetupPasteable(xl)}),Oe("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:H.onSetupPasteable(xl)})],ao=[Oe("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:H.onSetupColumn("onFirst")}),Oe("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:H.onSetupColumn("onLast")}),Oe("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:H.onSetupColumn("onAny")}),Oe("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:H.onSetupColumn("onAny")}),Oe("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:H.onSetupColumn("onAny")}),Oe("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:H.onSetupPasteableColumn(Tt,"onFirst")}),Oe("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:H.onSetupPasteableColumn(Tt,"onLast")})],Zo=[Oe("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:H.onSetupCellOrRow}),Oe("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:H.onSetupMergeable}),Oe("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:H.onSetupUnmergeable})];cd(R)?R.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:on}],onSetup:El(R)}):R.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:me("mceInsertTableDialog"),onSetup:El(R)}),R.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:me("mceInsertTableDialog"),onSetup:El(R)}),Oe("tableprops",{text:"Table properties",onSetup:H.onSetupTable,command:"mceTableProps"}),Oe("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:H.onSetupTable,command:"mceTableDelete"}),Ve(Nn,!0)&&R.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:Q("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),Ve(ao,!0)&&R.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:Q("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),Ve(Zo,!0)&&R.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:Q("tablecellprops tablemergecells tablesplitcells")}),R.ui.registry.addContextMenu("table",{update:()=>(H.resetTargets(),H.targets().fold(Q(""),sr=>fn(sr.element)==="caption"?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"))});const ts=Dr(uu(R));ts.length!==0&&R.queryCommandSupported("mceTableToggleClass")&&R.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>Rf(R,ts,"tableclass",sr=>R.execCommand("mceTableToggleClass",!1,sr)),onSetup:H.onSetupTable});const lr=Dr(Di(R));lr.length!==0&&R.queryCommandSupported("mceTableCellToggleClass")&&R.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Rf(R,lr,"tablecellclass",sr=>R.execCommand("mceTableCellToggleClass",!1,sr)),onSetup:H.onSetupCellOrRow}),R.queryCommandSupported("mceTableApplyCellStyle")&&(R.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>Rf(R,ic,"tablecellverticalalign",gd(R,"vertical-align")),onSetup:H.onSetupCellOrRow}),R.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Rf(R,Gl(R),"tablecellborderwidth",gd(R,"border-width")),onSetup:H.onSetupCellOrRow}),R.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Rf(R,wm(R),"tablecellborderstyle",gd(R,"border-style")),onSetup:H.onSetupCellOrRow}),R.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>il(R,Xd(R),"background-color"),onSetup:H.onSetupCellOrRow}),R.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>il(R,yg(R),"border-color"),onSetup:H.onSetupCellOrRow})),lt("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:H.onSetupTableWithCaption}),lt("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:bs(R),onSetup:H.onSetupTableRowHeaders}),lt("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:of(R),onSetup:H.onSetupTableRowHeaders})},pr=R=>{const H=Th(R);Ha(R),bi(R),ba(R,H),ei(R,H),Gr(R)};var Rm=()=>{o.add("table",pr)};Rm()})();(function(){const o=z=>{let U=z;return{get:()=>U,set:Q=>{U=Q}}};var a=tinymce.util.Tools.resolve("tinymce.PluginManager");const c=(z,U)=>{z.dispatch("VisualBlocks",{state:U})},d=(z,U,K)=>{z.dom.toggleClass(z.getBody(),"mce-visualblocks"),K.set(!K.get()),c(z,K.get())},g=(z,U,K)=>{z.addCommand("mceVisualBlocks",()=>{d(z,U,K)})},p=z=>U=>U.options.get(z),v=z=>{const U=z.options.register;U("visualblocks_default_state",{processor:"boolean",default:!1})},x=p("visualblocks_default_state"),T=(z,U,K)=>{z.on("PreviewFormats AfterPreviewFormats",X=>{K.get()&&z.dom.toggleClass(z.getBody(),"mce-visualblocks",X.type==="afterpreviewformats")}),z.on("init",()=>{x(z)&&d(z,U,K)})},A=(z,U)=>K=>{K.setActive(U.get());const X=Q=>K.setActive(Q.state);return z.on("VisualBlocks",X),()=>z.off("VisualBlocks",X)},M=(z,U)=>{const K=()=>z.execCommand("mceVisualBlocks");z.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:K,onSetup:A(z,U),context:"any"}),z.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:K,onSetup:A(z,U),context:"any"})};var I=()=>{a.add("visualblocks",(z,U)=>{v(z);const K=o(!1);g(z,U,K),M(z,K),T(z,U,K)})};I()})();(function(){const o=Et=>{let Vt=Et;return{get:()=>Vt,set:Ro=>{Vt=Ro}}};var a=tinymce.util.Tools.resolve("tinymce.PluginManager");const c=Et=>({isEnabled:()=>Et.get()}),d=(Et,Vt)=>Et.dispatch("VisualChars",{state:Vt}),g=(Et,Vt,Bn)=>{var ro;return Bn(Et,Vt.prototype)?!0:((ro=Et.constructor)===null||ro===void 0?void 0:ro.name)===Vt.name},p=Et=>{const Vt=typeof Et;return Et===null?"null":Vt==="object"&&Array.isArray(Et)?"array":Vt==="object"&&g(Et,String,(Bn,ro)=>ro.isPrototypeOf(Bn))?"string":Vt},v=Et=>Vt=>p(Vt)===Et,x=Et=>Vt=>typeof Vt===Et,T=Et=>Vt=>Et===Vt,A=v("string"),M=v("object"),I=T(null),z=x("boolean"),U=Et=>Et==null,K=Et=>!U(Et),X=x("number");class Q{constructor(Vt,Bn){this.tag=Vt,this.value=Bn}static some(Vt){return new Q(!0,Vt)}static none(){return Q.singletonNone}fold(Vt,Bn){return this.tag?Bn(this.value):Vt()}isSome(){return this.tag}isNone(){return!this.tag}map(Vt){return this.tag?Q.some(Vt(this.value)):Q.none()}bind(Vt){return this.tag?Vt(this.value):Q.none()}exists(Vt){return this.tag&&Vt(this.value)}forall(Vt){return!this.tag||Vt(this.value)}filter(Vt){return!this.tag||Vt(this.value)?this:Q.none()}getOr(Vt){return this.tag?this.value:Vt}or(Vt){return this.tag?this:Vt}getOrThunk(Vt){return this.tag?this.value:Vt()}orThunk(Vt){return this.tag?this:Vt()}getOrDie(Vt){if(this.tag)return this.value;throw new Error(Vt??"Called getOrDie on None")}static from(Vt){return K(Vt)?Q.some(Vt):Q.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Vt){this.tag&&Vt(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Q.singletonNone=new Q(!1);const le=(Et,Vt)=>{const Bn=Et.length,ro=new Array(Bn);for(let Ro=0;Ro<Bn;Ro++){const is=Et[Ro];ro[Ro]=Vt(is,Ro)}return ro},ae=(Et,Vt)=>{for(let Bn=0,ro=Et.length;Bn<ro;Bn++){const Ro=Et[Bn];Vt(Ro,Bn)}},Z=(Et,Vt)=>{const Bn=[];for(let ro=0,Ro=Et.length;ro<Ro;ro++){const is=Et[ro];Vt(is,ro)&&Bn.push(is)}return Bn},Ce=Object.keys,ct=(Et,Vt)=>{const Bn=Ce(Et);for(let ro=0,Ro=Bn.length;ro<Ro;ro++){const is=Bn[ro],yr=Et[is];Vt(yr,is)}},Ge=typeof window<"u"?window:Function("return this;")(),oe=(Et,Vt)=>{let Bn=Vt??Ge;for(let ro=0;ro<Et.length&&Bn!==void 0&&Bn!==null;++ro)Bn=Bn[Et[ro]];return Bn},Ze=(Et,Vt)=>{const Bn=Et.split(".");return oe(Bn,Vt)},yt=(Et,Vt)=>Ze(Et,Vt),_t=(Et,Vt)=>{const Bn=yt(Et,Vt);if(Bn==null)throw new Error(Et+" not available on this browser");return Bn},Re=Object.getPrototypeOf,ue=Et=>_t("HTMLElement",Et),Xt=Et=>{const Vt=Ze("ownerDocument.defaultView",Et);return M(Et)&&(ue(Vt).prototype.isPrototypeOf(Et)||/^HTML\w*Element$/.test(Re(Et).constructor.name))},Se=1,Ie=3,D=Et=>Et.dom.nodeType,ze=Et=>Et.dom.nodeValue,be=Et=>Vt=>D(Vt)===Et,tt=Et=>nt(Et)&&Xt(Et.dom),nt=be(Se),ge=be(Ie),je=(Et,Vt,Bn)=>{if(A(Bn)||z(Bn)||X(Bn))Et.setAttribute(Vt,Bn+"");else throw console.error("Invalid call to Attribute.set. Key ",Vt,":: Value ",Bn,":: Element ",Et),new Error("Attribute value was not simple")},kt=(Et,Vt,Bn)=>{je(Et.dom,Vt,Bn)},Ve=(Et,Vt)=>{const Bn=Et.dom.getAttribute(Vt);return Bn===null?void 0:Bn},ht=(Et,Vt)=>{Et.dom.removeAttribute(Vt)},De=(Et,Vt)=>{const Bn=Ve(Et,Vt);return Bn===void 0||Bn===""?[]:Bn.split(" ")},ut=(Et,Vt,Bn)=>{const Ro=De(Et,Vt).concat([Bn]);return kt(Et,Vt,Ro.join(" ")),!0},ee=(Et,Vt,Bn)=>{const ro=Z(De(Et,Vt),Ro=>Ro!==Bn);return ro.length>0?kt(Et,Vt,ro.join(" ")):ht(Et,Vt),!1},gn=Et=>Et.dom.classList!==void 0,mt=Et=>De(Et,"class"),Ct=(Et,Vt)=>ut(Et,"class",Vt),Ut=(Et,Vt)=>ee(Et,"class",Vt),wt=(Et,Vt)=>{gn(Et)?Et.dom.classList.add(Vt):Ct(Et,Vt)},Y=Et=>{(gn(Et)?Et.dom.classList:mt(Et)).length===0&&ht(Et,"class")},re=(Et,Vt)=>{gn(Et)?Et.dom.classList.remove(Vt):Ut(Et,Vt),Y(Et)},ce=(Et,Vt)=>{const ro=(Vt||document).createElement("div");if(ro.innerHTML=Et,!ro.hasChildNodes()||ro.childNodes.length>1){const Ro="HTML does not have a single root node";throw console.error(Ro,Et),new Error(Ro)}return Ne(ro.childNodes[0])},W=(Et,Vt)=>{const ro=(Vt||document).createElement(Et);return Ne(ro)},ve=(Et,Vt)=>{const ro=(Vt||document).createTextNode(Et);return Ne(ro)},Ne=Et=>{if(Et==null)throw new Error("Node cannot be null or undefined");return{dom:Et}},dt={fromHtml:ce,fromTag:W,fromText:ve,fromDom:Ne,fromPoint:(Et,Vt,Bn)=>Q.from(Et.dom.elementFromPoint(Vt,Bn)).map(Ne)},Ue={" ":"nbsp","":"shy"},pt=(Et,Vt)=>{let Bn="";return ct(Et,(ro,Ro)=>{Bn+=Ro}),new RegExp("["+Bn+"]",Vt?"g":"")},$t=Et=>{let Vt="";return ct(Et,Bn=>{Vt&&(Vt+=","),Vt+="span.mce-"+Bn}),Vt},hn=pt(Ue),xt=pt(Ue,!0),Pt=$t(Ue),dn="mce-nbsp",_n=Et=>Et.dom.contentEditable,So=Et=>'<span data-mce-bogus="1" class="mce-'+Ue[Et]+'">'+Et+"</span>",Jn=Et=>Et.nodeName.toLowerCase()==="span"&&Et.classList.contains("mce-nbsp-wrap"),Ot=Et=>{const Vt=ze(Et);return ge(Et)&&A(Vt)&&hn.test(Vt)},rn=Et=>tt(Et)&&_n(Et)==="false",an=(Et,Vt)=>{if(tt(Et)&&!Jn(Et.dom)){const Bn=_n(Et);if(Bn==="true")return!0;if(Bn==="false")return!1}return Vt},On=(Et,Vt,Bn)=>{let ro=[];const Ro=Et.dom,is=le(Ro.childNodes,dt.fromDom),yr=wr=>Jn(wr.dom)||!rn(wr);return ae(is,wr=>{Bn&&yr(wr)&&Vt(wr)&&(ro=ro.concat([wr])),ro=ro.concat(On(wr,Vt,an(wr,Bn)))}),ro},_o=(Et,Vt)=>{for(;Et.parentNode;){if(Et.parentNode===Vt)return Vt;Et=Et.parentNode}},Mo=Et=>Et.replace(xt,So),ws=(Et,Vt)=>{const Bn=Et.dom,ro=On(dt.fromDom(Vt),Ot,Et.dom.isEditable(Vt));ae(ro,Ro=>{var is;const yr=Ro.dom.parentNode;if(Jn(yr))wt(dt.fromDom(yr),dn);else{const wr=Mo(Bn.encode((is=ze(Ro))!==null&&is!==void 0?is:"")),ar=Bn.create("div",{},wr);let Xe;for(;Xe=ar.lastChild;)Bn.insertAfter(Xe,Ro.dom);Et.dom.remove(Ro.dom)}})},vo=(Et,Vt)=>{const Bn=Et.dom.select(Pt,Vt);ae(Bn,ro=>{Jn(ro)?re(dt.fromDom(ro),dn):Et.dom.remove(ro,!0)})},Us=Et=>{const Vt=Et.getBody(),Bn=Et.selection.getBookmark();let ro=_o(Et.selection.getNode(),Vt);ro=ro!==void 0?ro:Vt,vo(Et,ro),ws(Et,ro),Et.selection.moveToBookmark(Bn)},fn=(Et,Vt)=>{d(Et,Vt.get());const Bn=Et.getBody();Vt.get()===!0?ws(Et,Bn):vo(Et,Bn)},Vo=(Et,Vt)=>{Vt.set(!Vt.get());const Bn=Et.selection.getBookmark();fn(Et,Vt),Et.selection.moveToBookmark(Bn)},tr=(Et,Vt)=>{Et.addCommand("mceVisualChars",()=>{Vo(Et,Vt)})},rr=Et=>Vt=>Vt.options.get(Et),Ir=Et=>{const Vt=Et.options.register;Vt("visualchars_default_state",{processor:"boolean",default:!1})},Br=rr("visualchars_default_state"),Ts=(Et,Vt)=>{Et.on("init",()=>{fn(Et,Vt)})},Ar=(Et,Vt)=>{let Bn=null;return{cancel:()=>{I(Bn)||(clearTimeout(Bn),Bn=null)},throttle:(...is)=>{I(Bn)&&(Bn=setTimeout(()=>{Bn=null,Et.apply(null,is)},Vt))}}},Xr=(Et,Vt)=>{const Bn=Ar(()=>{Us(Et)},300);Et.on("keydown",ro=>{Vt.get()===!0&&(ro.keyCode===13?Us(Et):Bn.throttle())}),Et.on("remove",Bn.cancel)},xs=(Et,Vt)=>Bn=>{Bn.setActive(Vt.get());const ro=Ro=>Bn.setActive(Ro.state);return Et.on("VisualChars",ro),()=>Et.off("VisualChars",ro)},lo=(Et,Vt)=>{const Bn=()=>Et.execCommand("mceVisualChars");Et.ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:Bn,onSetup:xs(Et,Vt),context:"any"}),Et.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",icon:"visualchars",onAction:Bn,onSetup:xs(Et,Vt),context:"any"})};var Bs=()=>{a.add("visualchars",Et=>{Ir(Et);const Vt=o(Br(Et));return tr(Et,Vt),lo(Et,Vt),Xr(Et,Vt),Ts(Et,Vt),c(Vt)})};Bs()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const c=(Y=>re=>Y===re)(null),d=Y=>Y,g=(Y,re)=>{const ce=Y.length,W=new Array(ce);for(let ve=0;ve<ce;ve++){const Ne=Y[ve];W[ve]=re(Ne,ve)}return W},v={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:"[~№|!-*+-\\/:;?@\\[-`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]"},x={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},T=[new RegExp(v.aletter),new RegExp(v.midnumlet),new RegExp(v.midletter),new RegExp(v.midnum),new RegExp(v.numeric),new RegExp(v.cr),new RegExp(v.lf),new RegExp(v.newline),new RegExp(v.extend),new RegExp(v.format),new RegExp(v.katakana),new RegExp(v.extendnumlet),new RegExp("@")],A="",M=new RegExp("^"+v.punctuation+"$"),I=/^\s+$/,z=T,U=x.OTHER,K=Y=>{let re=U;const ce=z.length;for(let W=0;W<ce;++W){const ve=z[W];if(ve&&ve.test(Y)){re=W;break}}return re},X=Y=>{const re={};return ce=>{if(re[ce])return re[ce];{const W=Y(ce);return re[ce]=W,W}}},Q=Y=>{const re=X(K);return g(Y,re)},le=(Y,re)=>{const ce=Y[re],W=Y[re+1];if(re<0||re>Y.length-1&&re!==0||ce===x.ALETTER&&W===x.ALETTER)return!1;const ve=Y[re+2];if(ce===x.ALETTER&&(W===x.MIDLETTER||W===x.MIDNUMLET||W===x.AT)&&ve===x.ALETTER)return!1;const Ne=Y[re-1];return(ce===x.MIDLETTER||ce===x.MIDNUMLET||W===x.AT)&&W===x.ALETTER&&Ne===x.ALETTER||(ce===x.NUMERIC||ce===x.ALETTER)&&(W===x.NUMERIC||W===x.ALETTER)||(ce===x.MIDNUM||ce===x.MIDNUMLET)&&W===x.NUMERIC&&Ne===x.NUMERIC||ce===x.NUMERIC&&(W===x.MIDNUM||W===x.MIDNUMLET)&&ve===x.NUMERIC||(ce===x.EXTEND||ce===x.FORMAT)&&(W===x.ALETTER||W===x.NUMERIC||W===x.KATAKANA||W===x.EXTEND||W===x.FORMAT)||(W===x.EXTEND||W===x.FORMAT&&(ve===x.ALETTER||ve===x.NUMERIC||ve===x.KATAKANA||ve===x.EXTEND||ve===x.FORMAT))&&(ce===x.ALETTER||ce===x.NUMERIC||ce===x.KATAKANA||ce===x.EXTEND||ce===x.FORMAT)||ce===x.CR&&W===x.LF?!1:ce===x.NEWLINE||ce===x.CR||ce===x.LF||W===x.NEWLINE||W===x.CR||W===x.LF?!0:!(ce===x.KATAKANA&&W===x.KATAKANA||W===x.EXTENDNUMLET&&(ce===x.ALETTER||ce===x.NUMERIC||ce===x.KATAKANA||ce===x.EXTENDNUMLET)||ce===x.EXTENDNUMLET&&(W===x.ALETTER||W===x.NUMERIC||W===x.KATAKANA)||ce===x.AT)},ae=A,Z=I,Ce=M,ct=Y=>Y==="http"||Y==="https",Ge=(Y,re)=>{let ce;for(ce=re;ce<Y.length&&!Z.test(Y[ce]);ce++);return ce},oe=(Y,re)=>{const ce=Ge(Y,re+1);return Y.slice(re+1,ce).join(ae).substr(0,3)==="://"?ce:re},Ze=(Y,re,ce,W)=>{const ve=[],Ne=[];let Pe=[];for(let dt=0;dt<ce.length;++dt)if(Pe.push(Y[dt]),le(ce,dt)){const Ue=re[dt];if((W.includeWhitespace||!Z.test(Ue))&&(W.includePunctuation||!Ce.test(Ue))){const pt=dt-Pe.length+1,$t=dt+1,hn=re.slice(pt,$t).join(ae);if(ct(hn)){const xt=oe(re,dt),Pt=Y.slice($t,xt);Array.prototype.push.apply(Pe,Pt),dt=xt}re[dt+1]==="."&&/^([a-zA-Z]\.)+$/.test(hn+".")?(Pe.push(Y[dt+1]),Ne.push({start:pt,end:$t+1})):Ne.push({start:pt,end:$t}),ve.push(Pe)}Pe=[]}return{words:ve,indices:Ne}},yt=()=>({includeWhitespace:!1,includePunctuation:!1}),_t=(Y,re,ce)=>{ce={...yt(),...ce};const W=g(Y,re),ve=Q(W);return Ze(Y,W,ve,ce)},ue=(Y,re,ce)=>_t(Y,re,ce).words,Xt=Y=>Y.replace(/\uFEFF/g,"");var Se=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const Ie=(Y,re)=>{const ce=re.getBlockElements(),W=re.getVoidElements(),ve=pt=>ce[pt.nodeName]||W[pt.nodeName],Ne=[];let Pe="";const dt=new Se(Y,Y);let Ue;for(;Ue=dt.next();)Ue.nodeType===3?Pe+=Xt(Ue.data):ve(Ue)&&Pe.length&&(Ne.push(Pe),Pe="");return Pe.length&&Ne.push(Pe),Ne},D=Y=>Y.replace(/\u200B/g,""),ze=Y=>Y.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length,be=(Y,re)=>{const ce=D(Ie(Y,re).join(`
|
|
112
|
-
`));return ue(ce.split(""),d).length},tt=(Y,re)=>{const ce=Ie(Y,re).join("");return ze(ce)},nt=(Y,re)=>{const ce=Ie(Y,re).join("").replace(/\s/g,"");return ze(ce)},ge=(Y,re)=>()=>re(Y.getBody(),Y.schema),je=(Y,re)=>()=>re(Y.selection.getRng().cloneContents(),Y.schema),kt=Y=>ge(Y,be),Ve=Y=>({body:{getWordCount:kt(Y),getCharacterCount:ge(Y,tt),getCharacterCountWithoutSpaces:ge(Y,nt)},selection:{getWordCount:je(Y,be),getCharacterCount:je(Y,tt),getCharacterCountWithoutSpaces:je(Y,nt)},getCount:kt(Y)}),ht=(Y,re)=>{Y.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(re.body.getWordCount()),String(re.selection.getWordCount())],["Characters (no spaces)",String(re.body.getCharacterCountWithoutSpaces()),String(re.selection.getCharacterCountWithoutSpaces())],["Characters",String(re.body.getCharacterCount()),String(re.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},De=(Y,re)=>{Y.addCommand("mceWordCount",()=>ht(Y,re))},ut=(Y,re)=>{let ce=null;return{cancel:()=>{c(ce)||(clearTimeout(ce),ce=null)},throttle:(...Ne)=>{c(ce)&&(ce=setTimeout(()=>{ce=null,Y.apply(null,Ne)},re))}}};var ee=tinymce.util.Tools.resolve("tinymce.util.Delay");const gn=(Y,re)=>{Y.dispatch("wordCountUpdate",{wordCount:{words:re.body.getWordCount(),characters:re.body.getCharacterCount(),charactersWithoutSpaces:re.body.getCharacterCountWithoutSpaces()}})},mt=(Y,re)=>{gn(Y,re)},Ct=(Y,re,ce)=>{const W=ut(()=>mt(Y,re),ce);Y.on("init",()=>{mt(Y,re),ee.setEditorTimeout(Y,()=>{Y.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",W.throttle)},0),Y.on("remove",W.cancel)})},Ut=Y=>{const re=()=>Y.execCommand("mceWordCount");Y.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:re,context:"any"}),Y.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:re,context:"any"})};var wt=(Y=300)=>{o.add("wordcount",re=>{const ce=Ve(re);return De(re,ce),Ut(re),Ct(re,ce,Y),ce})};wt()})();const g4e=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),h4e=(o,a="wps_office")=>{const c=o.split(","),d=c[0].match(/:(.*?);/)[1],g=atob(c[1]);let p=g.length;const v=new Uint8Array(p);for(;p--;)v[p]=g.charCodeAt(p);return new File([v],a,{type:d})},p4e=o=>btoa(o.match(/\w{2}/g).map(a=>String.fromCharCode(parseInt(a,16))).join(""));function b4e(o){if(!o)return[];let a=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,c=new RegExp(`(?:(${a.source}))([\\da-fA-F\\s]+)\\}`,"g"),d=o.match(c);console.log("images",d);const g=[];if(d||(a=/{\\pict[\s\S]+?(\\pngblip-?\d+)?(\\wmetafile8-?\d+)?{\\\*\\blipuid\s?[\da-fA-F]+[\s}]*?/,c=new RegExp(`(?:(${a.source}))([\\da-fA-F\\s]+)\\}`,"g"),d=o.match(c)),d)for(const p of d){let v=!1;if(p.includes("\\pngblip")?v="image/png":p.includes("\\jpegblip")&&(v="image/jpeg"),v){const x=p.replace(a,"").replace(/[^\da-fA-F]/g,""),T=`data:${v};base64,${p4e(x)}`;g.push({base64:T,file:h4e(T)})}}return g}const v4e=(o,a)=>{if(!a)return o;try{const d=new DOMParser().parseFromString(o,"text/html"),g=d.querySelectorAll("img"),v=(a.clipboardData||window.Clipboard).getData("text/rtf"),x=b4e(v);return g.forEach((T,A)=>{var I;const M=T.getAttribute("src");if(M&&M.startsWith("file:")&&(I=x==null?void 0:x[A])!=null&&I.base64){const z=x[A].base64;T.setAttribute("src",z)}}),d.body.innerHTML}catch{return o}},y4e=o=>{const a=atob(o.split(",")[1]),c=o.split(",")[0].split(":")[1].split(";")[0],d=new ArrayBuffer(a.length),g=new Uint8Array(d);for(let p=0;p<a.length;p++)g[p]=a.charCodeAt(p);return new Blob([d],{type:c})},w4e=async o=>{try{const a=y4e(o),c=new FormData;c.append("files",a,"image.png");const g=await(await fetch("/api/ajax/uploaddoc",{method:"POST",body:c})).json();if(g.status===1)return g.file_url;throw new Error(g.message)}catch(a){throw a}},C4e=async o=>{const c=new DOMParser().parseFromString(o,"text/html"),d=c.getElementsByTagName("img"),g=[],p=3;for(let v=0;v<d.length;v++){const x=d[v],T=x.getAttribute("src");T&&T.startsWith("data:image")&&(g.push({img:x,src:T,width:x.getAttribute("width"),height:x.getAttribute("height")}),g[g.length-1].width&&x.setAttribute("width",g[g.length-1].width),g[g.length-1].height&&x.setAttribute("height",g[g.length-1].height))}for(let v=0;v<g.length;v+=p){const T=g.slice(v,v+p).map(async A=>{try{const M=await w4e(A.src);A.img.setAttribute("src",M)}catch{A.img.remove()}});await Promise.all(T)}return c.body.innerHTML},S4e=o=>{o.querySelectorAll("td").forEach(c=>{const d=c.getAttribute("width"),g=c.getAttribute("style")||"";d==="0"&&g.includes("border:none")&&c.remove()})},x4e=o=>{o.querySelectorAll("table").forEach(c=>{c.style.maxWidth="100%"})},E4e=o=>{o.querySelectorAll("table").forEach(c=>{const d=c.querySelectorAll("td");let g=!1,p="";for(const v of d){const x=v.getAttribute("style")||"",T=x.match(/border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i)||x.match(/border(?:-(?:right|left|top|bottom))?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i);(T?T[0]:"").includes("double")&&(g=!0,T&&(p=T[0].replace(/^border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*/,""),v.style.borderTop=p,v.style.borderRight=p,v.style.borderBottom=p,v.style.borderLeft=p))}g&&p&&(c.style.borderCollapse="separate",c.style.borderSpacing="2px",c.style.border=p)})},_4e=o=>{o.querySelectorAll("table").forEach(c=>{c.querySelectorAll("td[rowspan]").forEach(g=>{const x=((g.getAttribute("style")||"").match(/border-[^:]+:[^;]+(?:solid|double)[^;]+/g)||[]).find(T=>!T.includes("none"));if(x){const T=x.split(":")[1].trim();g.style.borderBottom=T}})})},T4e=o=>{o.querySelectorAll('[style*="mso-"]').forEach(c=>{const g=(c.getAttribute("style")||"").replace(/mso-[^:]+:[^;]+;/g,"");c.setAttribute("style",g)})},k4e=o=>{o.querySelectorAll('[style*="tab-stops"]').forEach(c=>{const g=(c.getAttribute("style")||"").replace(/tab-stops:[^;]+;/g,"");c.setAttribute("style",g)})},A4e=o=>{o=o.replace(/<a(?!.*?href=)[^>]*>([\s\S]*?)<\/a>/gi,"$1");const c=new DOMParser().parseFromString(o,"text/html");return S4e(c),x4e(c),E4e(c),_4e(c),T4e(c),k4e(c),o=c.body.innerHTML,o};_H.PluginManager.add("pasteprocess",o=>(o.on("paste",a=>{if(a.clipboardData){const c=a.clipboardData.getData("text/html")||a.clipboardData.getData("text");if(g4e(c)){a.preventDefault();const d=o.windowManager.open({title:"处理中",body:{type:"panel",items:[{type:"htmlpanel",html:'<div style="text-align: center; padding: 20px;">正在处理Word内容,请稍候...</div>'}]},buttons:[]}),g=A4e(c),p=v4e(g,a);C4e(p).then(v=>{o.insertContent(v),d.close()})}}}),{}));let RV="A4";const Bee={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}},O4e=Object.keys(Bee).map(o=>`pagesize${o}`).join(" ");_H.PluginManager.add("pagesize",o=>{const a=o.options.register;a("pagesize",{processor:"string",default:"A4"}),RV=(g=>p=>p.options.get(g))("pagesize")(o);const d=g=>{const p=Bee[g];if(p){const v=(window.devicePixelRatio||1)*96,x=p.width*v/25.4;o!=null&&o.container&&(o.container.style.minWidth=`${x}px`);const T=o.contentAreaContainer.querySelector("iframe");T&&(T.style.width=`${x}px`),o.fire("pagesizechange",{size:g})}};return Object.keys(Bee).forEach(g=>{o.ui.registry.addToggleMenuItem(`pagesize${g}`,{text:g,onAction:()=>{RV=g,d(g)},onSetup:p=>(p.setActive(RV===g),()=>{})})}),o.on("init",()=>{d(RV)}),{}});const N4e=["accordion","advlist","anchor","autolink","autosave","charmap","directionality","importcss","insertdatetime","lists","image","media","pagebreak","preview","save","searchreplace","table","fullscreen","wordcount","pasteprocess","pagesize"],$4e="undo redo | blocks bold italic forecolor removeformat alignleft aligncenter alignright alignjustify outdent indent pagebreakfullscreen preview",D4e={license_key:"gpl",skin:!1,content_css:["./content.css","./reset.css"],promotion:!1,menu:{pagesize:{title:"页面大小",items:O4e}},menubar:"file edit insert table tools help pagesize",cleanup:!0,branding:!1,language:"zh_CN",plugins:N4e,toolbar:$4e,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((a,c)=>{const d=new FormData;d.append("files",o.blob(),o.filename()),fetch("/api/ajax/uploaddoc",{method:"POST",body:d}).then(g=>g.json()).then(g=>{g.status===1?a(g.file_url):c(`上传失败: ${g.message}`)}).catch(g=>{c(`上传出错: ${g.message}`)})})},M4e={name:"ProEditor",components:{Editor:f4e},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:a}){const c=w.reactive({myInit:g(D4e),contentValue:o.modelValue,timeout:null});w.onMounted(()=>{_H.init({license_key:"gpl"}),_H.activeEditor.on("pagesizechange",p=>{a("update:pagesize",p.size)})}),w.watch(()=>c.contentValue,()=>{d(()=>{a("update:modelValue",c.contentValue)})}),w.watch(()=>o.modelValue,p=>{p&&p!==c.contentValue&&(c.contentValue=p)});function d(p,v=400){c.timeout!==null&&clearTimeout(c.timeout),c.timeout=setTimeout(p,v)}function g(p){o!=null&&o.height&&(p.height=o.height),o!=null&&o.width&&(p.width=o.width);const{placeholder:v,pagesize:x}=o;return p={...p,placeholder:v,...o.hasPagesize&&{menu:{...p.menu,pagesize:p.menu.pagesize},menubar:p.menubar.includes("pagesize")?p.menubar:`${p.menubar} pagesize`,pagesize:x},...!o.hasPagesize&&{menu:Object.fromEntries(Object.entries(p.menu).filter(([T])=>T!=="pagesize")),menubar:p.menubar.replace(/pagesize/g,"").trim(),pagesize:""}},p}return{...w.toRefs(c),customer:g,debounce:d}}},R4e={class:"my-tinymce"};function P4e(o,a,c,d,g,p){const v=w.resolveComponent("Editor");return w.openBlock(),w.createElementBlock("div",R4e,[w.createVNode(v,{modelValue:o.contentValue,"onUpdate:modelValue":a[0]||(a[0]=x=>o.contentValue=x),init:o.myInit},null,8,["modelValue","init"])])}const Mle=cu(M4e,[["render",P4e]]),I4e={name:"ShadowDomWrap",setup(o,{emit:a,expose:c}){const d=w.ref(null),g=w.ref(),p=w.ref(!1),v=T=>{if(!d.value)return;const A=d.value.contains(T.target);!A&&p.value?(p.value=!1,a("onBlur")):A&&!p.value&&(p.value=!0)},x=T=>{T.stopPropagation(),p.value||(p.value=!0,a("onFocus"))};return w.onMounted(()=>{var M,I,z;g.value=(M=d.value)==null?void 0:M.attachShadow({mode:"open"}),document.addEventListener("click",v);const T=document.createElement("link");T.rel="stylesheet",T.href=`${location==null?void 0:location.origin}/css/index.min.css`,(I=g.value)==null||I.appendChild(T);const A=document.createElement("link");A.rel="stylesheet",A.href=`${location==null?void 0:location.origin}/css/reset.css`,(z=g.value)==null||z.appendChild(A)}),w.onUnmounted(()=>{document.removeEventListener("click",v)}),c({focus:()=>{p.value=!0}}),{shadowHost:d,shadowRoot:g,handleClick:x}}};function B4e(o,a,c,d,g,p){return w.openBlock(),w.createElementBlock("div",{ref:"shadowHost",class:"shadow-host",onClick:a[0]||(a[0]=w.withModifiers((...v)=>d.handleClick&&d.handleClick(...v),["stop"]))},[d.shadowRoot?(w.openBlock(),w.createBlock(w.Teleport,{key:0,to:d.shadowRoot},[w.renderSlot(o.$slots,"default")],8,["to"])):w.createCommentVNode("",!0)],512)}const FM=cu(I4e,[["render",B4e]]),F4e=["innerHTML"],Rle=w.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const a=w.useModel(o,"modelValue");return(c,d)=>(w.openBlock(),w.createBlock(FM,null,{default:w.withCtx(()=>[w.createElementVNode("div",{innerHTML:a.value},null,8,F4e)]),_:1}))}}),Ple=Symbol("nodesUI"),$f=()=>{const o=w.inject(Ple);if(!o)throw new Error("NodesUI context not found");return o},wz=Symbol("nodesEditor"),Jw=()=>{const o=w.inject(wz);if(!o)throw new Error("NodesEditor context not found");return o},rd=[];for(let o=0;o<256;++o)rd.push((o+256).toString(16).slice(1));function L4e(o,a=0){return(rd[o[a+0]]+rd[o[a+1]]+rd[o[a+2]]+rd[o[a+3]]+"-"+rd[o[a+4]]+rd[o[a+5]]+"-"+rd[o[a+6]]+rd[o[a+7]]+"-"+rd[o[a+8]]+rd[o[a+9]]+"-"+rd[o[a+10]]+rd[o[a+11]]+rd[o[a+12]]+rd[o[a+13]]+rd[o[a+14]]+rd[o[a+15]]).toLowerCase()}let LQ;const V4e=new Uint8Array(16);function H4e(){if(!LQ){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");LQ=crypto.getRandomValues.bind(crypto)}return LQ(V4e)}const z4e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Vre={randomUUID:z4e};function xA(o,a,c){var g;if(Vre.randomUUID&&!a&&!o)return Vre.randomUUID();o=o||{};const d=o.random??((g=o.rng)==null?void 0:g.call(o))??H4e();if(d.length<16)throw new Error("Random bytes length must be >= 16");return d[6]=d[6]&15|64,d[8]=d[8]&63|128,L4e(d)}const GA=()=>{const{nodes:o,updateNodes:a}=Jw();return{nodes:o,addNode:x=>{const A=(Array.isArray(x)?x:[x]).map(I=>({...I,id:I.id||xA()})),M=[...o.value,...A];a(M)},removeNode:x=>{const T=Array.isArray(x)?x:[x],A=[],M=[];T.forEach(z=>{var K;const U=o.value.find(X=>(X==null?void 0:X.id)===z);((K=U==null?void 0:U.element)==null?void 0:K.tagName)==="TD"?A.push(z):M.push(z)});let I=o.value.filter(z=>!M.includes(z==null?void 0:z.id));I=I==null?void 0:I.map(z=>A.includes(z==null?void 0:z.id)?{id:z==null?void 0:z.id,nodePath:z==null?void 0:z.nodePath,label:"文本",nodeType:"text"}:z),a(I)},editNodes:x=>{const T=Array.isArray(x)?x:[x];let A=xA();const M=T.map(z=>{let U={...z},K=z==null?void 0:z.id;return K||(K=xA(),U.id=K),U!=null&&U.groupKey||(U.groupKey=A),U}),I=[...o.value];M.forEach(z=>{const U=I.findIndex(K=>K.id===z.id);U!==-1?I[U]=z:I.push(z)}),a(I)},insertNodeAt:(x,T)=>{const A=[...o.value];A.splice(T,0,x),a(A)},moveNode:(x,T)=>{const A=[...o.value],[M]=A.splice(x,1);A.splice(T,0,M),a(A)}}};function bM(o){if(!o||!o.ownerDocument)return null;const a=[];for(let c=o;c&&c.nodeType===1;c=c.parentElement){let d=0;for(let v=c.previousSibling;v;v=v.previousSibling)v.nodeType===1&&v.nodeName===c.nodeName&&d++;const g=c.nodeName.toLowerCase(),p=d?`${g}:nth-child(${d+1})`:g;a.unshift(p)}return a.length?a.join(" > "):null}function U4e(o,a){if(!a)return null;try{return(a.shadowRoot||a).querySelector(`#${CSS.escape(o)}`)}catch(c){return console.error("nodePath query error:",c),null}}function j4e(o,a){if(!a)return null;try{return(a.shadowRoot||a).querySelector(o)}catch(c){return console.error("nodePath query error:",c),null}}const dA=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}`:""),W4e=(o,a,c)=>{var d,g;if(o.element)if(o.element.tagName==="TD")o.element.classList.add("node-item-td"),Hre(o.element,o);else{const p=document.createElement("span");p.setAttribute("contenteditable","false"),Hre(p,o),p.classList.add("node-item");const v=a==null?void 0:a.getRootNode(),x=(d=v==null?void 0:v.getSelection)==null?void 0:d.call(v);if(x&&o.startOffset!==void 0){const T=document.createRange(),A=(o==null?void 0:o.textNodeIndex)||0,M=o.element.childNodes[A]||o.element,I=Math.min(o.startOffset,((g=M.textContent)==null?void 0:g.length)||0);T.setStart(M,I),T.setEnd(M,I);const z=document.createElement("span");z.classList.add("empty-text-node"),T.insertNode(z),T.insertNode(p),T.setStartAfter(p),T.collapse(!0),x.removeAllRanges(),x.addRange(T)}else o.element.appendChild(p)}c==null||c(o)},Hre=(o,a)=>{a!=null&&a.id&&(o.id=a==null?void 0:a.id),(a==null?void 0:a.nodePath)!==void 0&&o.setAttribute("data-nodePath",a.nodePath),(a==null?void 0:a.textNodeIndex)!==void 0&&a.textNodeIndex>=0&&o.setAttribute("data-textNodeIndex",a.textNodeIndex.toString()),a.startOffset!==void 0&&a.startOffset>=0&&o.setAttribute("data-startOffset",a.startOffset.toString()),(a==null?void 0:a.subNodeSort)!==void 0&&a.subNodeSort>=0&&o.setAttribute("data-subNodeSort",a.subNodeSort.toString()),(a==null?void 0:a.groupKey)!==void 0&&o.setAttribute("data-groupKey",a.groupKey)},Z4e=o=>{o&&(o.removeAttribute("id"),o.removeAttribute("data-nodePath"),o.removeAttribute("data-textNodeIndex"),o.removeAttribute("data-startOffset"),o.removeAttribute("data-subNodeSort"),o.removeAttribute("data-groupKey"))},G4e=o=>{const a=o.parentNode;if(!a)return-1;let c=0;for(let d=0;d<a.childNodes.length;d++){const g=a.childNodes[d];if(g===o)return c;c++,g.nodeType===Node.ELEMENT_NODE&&(g.classList.contains("node-item")&&(c-=2,c<0&&(c=0)),g.classList.contains("empty-text-node")&&(c-=1,c<0&&(c=0)))}return-1},EA=o=>{let a=o.closest("TD"),c=o.closest(".node-item"),d=null;if(c?d=c:a&&a.classList.contains("node-item-td")&&(d=a),!d)return null;const g=d||o;let p=g==null?void 0:g.getAttribute("data-nodePath");if(p||(p=bM(g)),(g==null?void 0:g.getAttribute("selectable"))==="false")return null;let v={element:g,nodePath:p};const x=g==null?void 0:g.getAttribute("data-textNodeIndex");x&&(v.textNodeIndex=Number(x));const T=g==null?void 0:g.getAttribute("data-startOffset");T&&(v.startOffset=Number(T));const A=g==null?void 0:g.getAttribute("data-subNodeSort");A&&(v.subNodeSort=Number(A));const M=g==null?void 0:g.getAttribute("data-groupKey");M&&(v.groupKey=M);const I=g==null?void 0:g.getAttribute("id");return I&&(v.id=I),v},q4e=o=>{let a=[];if(o.tagName==="TD"){let p=o.classList.contains("node-item-td");if((o==null?void 0:o.getAttribute("selectable"))==="false")return[];let x=EA(o);if(x){if(p)return[x];{let T=o.closest(".node-item");if(x=EA(T),x)return[x]}}return a}const c=o==null?void 0:o.getAttribute("data-textNodeIndex"),d=o==null?void 0:o.getAttribute("data-startOffset"),g=o==null?void 0:o.getAttribute("data-subNodeSort");if(o.classList.contains("node-item")&&!o.closest("TD")||c||d||g){const p=EA(o);if(p){let v={...p};a.push(v)}return a}return a},Y4e=o=>r0e(o,a=>w.toValue(a.nodes).map(c=>({...c,color:a.color,activated:a==null?void 0:a.activated,dataGroupKey:a.id}))),Ute=(o,a)=>{const c=o.startsWith("#")?o.slice(1):o;let d,g,p;if(c.length===3)d=parseInt(c[0]+c[0],16),g=parseInt(c[1]+c[1],16),p=parseInt(c[2]+c[2],16);else if(c.length===6)d=parseInt(c.substring(0,2),16),g=parseInt(c.substring(2,4),16),p=parseInt(c.substring(4,6),16);else return console.warn("Invalid color format:",o),`rgba(0, 0, 0, ${a})`;return`rgba(${d}, ${g}, ${p}, ${a})`},K4e=o=>{const{element:a}=o;if(!a)return null;if(a.tagName.toLowerCase()!=="td")return{showTextType:"input"};const d=a.closest("tr"),g=Array.from(d.parentElement.children).indexOf(d),p=Array.from(d.children).indexOf(a),v=a.closest("table"),x=a.closest("body").querySelectorAll("table");return{showTextType:"cell",tableIndex:Array.from(x).indexOf(v)+1,colIndex:p,rowIndex:g}},X4e=(o,a)=>{var g,p;let c=1;const d=(g=o==null?void 0:o.map(v=>a==null?void 0:a.find(x=>(x==null?void 0:x.id)===(v==null?void 0:v.id))))==null?void 0:g.filter(Boolean);return(d==null?void 0:d.length)>0?(p=d==null?void 0:d.map(x=>{const T=K4e(x);return T?(T==null?void 0:T.showTextType)==="input"?{...x,...T,inputIndex:c++}:{...x,...T}:null}))==null?void 0:p.filter(Boolean):[]};function J4e(o){if(!o||o.length===0)return[];const a=[...o].sort((g,p)=>g.rowIndex!==p.rowIndex?g.rowIndex-p.rowIndex:g.colIndex-p.colIndex),c=[],d=new Set;for(const g of a){if(d.has(g))continue;const p=[];let v=0,x=0;for(let T=g.colIndex;a.find(M=>M.rowIndex===g.rowIndex&&M.colIndex===T&&!d.has(M));T++)x++;if(x!==0){v=x;for(let T=g.rowIndex;;T++){let A=0;const M=[];for(let I=g.colIndex;I<g.colIndex+v;I++){const z=a.find(U=>U.rowIndex===T&&U.colIndex===I&&!d.has(U));if(z)A++,M.push(z);else break}if(A===v)p.push(...M);else break}p.length>0&&(c.push([...p]),p.forEach(T=>d.add(T)))}}return c}function Q4e(o){if(!o||o.length===0)return{min:null,max:null};let a=o[0],c=o[0];for(const d of o)(d.colIndex<a.colIndex||d.colIndex===a.colIndex&&d.rowIndex<a.rowIndex)&&(a=d),(d.colIndex>c.colIndex||d.colIndex===c.colIndex&&d.rowIndex>c.rowIndex)&&(c=d);return{min:a,max:c}}const Ile=(o,a)=>{var A;const c=X4e(o,a||[]),d=[],g=[];(A=w.toValue(c))==null||A.forEach(M=>{(M==null?void 0:M.showTextType)==="input"?d.push(M):g.push(M)});const p=c0e(g,"tableIndex"),v=Object.entries(p).map(([M,I])=>({tableIndex:Number(M),nodes:I})),x=xce(v==null?void 0:v.map(M=>J4e(M==null?void 0:M.nodes))),T=(x==null?void 0:x.map(M=>Q4e(M)))||[];return[...d,...T]},_A=o=>{function a(c){let d="";for(;c>=0;)d=String.fromCharCode(65+c%26)+d,c=Math.floor(c/26)-1;return d}return(o==null?void 0:o.colIndex)>=0&&(o==null?void 0:o.rowIndex)>=0?`${a(o==null?void 0:o.colIndex)}${o==null?void 0:o.rowIndex}`:""},eOe=(o,a)=>{const c=Ile(o,a||[]);let d=[];return c==null||c.forEach(g=>{var p,v;(g==null?void 0:g.showTextType)==="input"?d.push(`填写${g==null?void 0:g.inputIndex}`):d.push(((p=g==null?void 0:g.min)==null?void 0:p.id)===((v=g==null?void 0:g.max)==null?void 0:v.id)?_A(g==null?void 0:g.min):`${_A(g==null?void 0:g.min)}:${_A(g==null?void 0:g.max)}`)}),d==null?void 0:d.join(",")},tOe=["onClick"],nOe={key:0,class:"icon"},oOe={key:1,class:"arrow"},sOe={key:0,class:"submenu"},rOe=["onClick"],aOe={key:0,class:"icon"},iOe=w.defineComponent({__name:"index",props:w.mergeModels({style:{}},{show:{},showModifiers:{}}),emits:w.mergeModels(["select"],["update:show"]),setup(o,{emit:a}){const{selectedNodes:c,focusedElement:d,cursorPosition:g,focusedNodeIndex:p,preNodeNumber:v}=$f(),{inputTypes:x}=Jw(),T=w.useModel(o,"show"),{editNodes:A}=GA(),M=K=>{if(w.toValue(d)&&!m0e(w.toValue(g))){const X=bM(w.toValue(d)),Q=w.toValue(g),le=(w.toValue(v)||0)+1,ae=EA(w.toValue(d));X&&Q&&Q>=0&&A({...ae,label:K==null?void 0:K.label,element:w.toValue(d),nodePath:X,startOffset:Q,subNodeSort:le,textNodeIndex:w.toValue(p)||0,nodeType:K==null?void 0:K.value})}else if(c){const X=w.toValue(c);X!=null&&X.length&&A(X==null?void 0:X.map(Q=>({...Q,label:K==null?void 0:K.label,element:Q==null?void 0:Q.element,nodePath:Q==null?void 0:Q.nodePath,nodeType:K==null?void 0:K.value})))}T.value=!1},I=w.computed(()=>{const K=[],X=[];return w.toValue(x).forEach(Q=>{Q.groupName==="system"?X.push({...Q,handler:()=>{M(Q)}}):K.push({...Q,handler:()=>{M(Q)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:K},{label:"插入记录标识",icon:"i-bi:flag",children:X}].filter(Q=>{var le;return(le=Q==null?void 0:Q.children)==null?void 0:le.length})}),z=a,U=(K,X)=>{K.preventDefault(),X!=null&&X.handler&&X.handler(),X!=null&&X.value&&z("select",X==null?void 0:X.value)};return(K,X)=>w.withDirectives((w.openBlock(),w.createElementBlock("div",{class:"context-menu",style:w.normalizeStyle({...K.style})},[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(I.value,Q=>(w.openBlock(),w.createElementBlock("div",{key:Q==null?void 0:Q.label,class:"menu-item"},[w.createElementVNode("div",{class:"menu-item-content",onClick:le=>U(le,Q)},[Q!=null&&Q.icon?(w.openBlock(),w.createElementBlock("div",nOe,[w.createElementVNode("div",{class:w.normalizeClass(Q==null?void 0:Q.icon)},null,2)])):w.createCommentVNode("",!0),w.createTextVNode(" "+w.toDisplayString(Q.label)+" ",1),Q!=null&&Q.children?(w.openBlock(),w.createElementBlock("span",oOe,"›")):w.createCommentVNode("",!0)],8,tOe),Q!=null&&Q.children?(w.openBlock(),w.createElementBlock("div",sOe,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(Q.children,le=>(w.openBlock(),w.createElementBlock("div",{key:le.action,class:"menu-item",onClick:ae=>U(ae,le)},[le!=null&&le.icon?(w.openBlock(),w.createElementBlock("div",aOe,[w.createElementVNode("div",{class:w.normalizeClass(le==null?void 0:le.icon)},null,2)])):w.createCommentVNode("",!0),w.createTextVNode(" "+w.toDisplayString(le.label),1)],8,rOe))),128))])):w.createCommentVNode("",!0)]))),128))],4)),[[w.vShow,T.value]])}}),cOe=cu(iOe,[["__scopeId","data-v-8c4e7354"]]),lOe={key:0},uOe={key:1,class:"td-node"},dOe=w.defineComponent({__name:"index",props:{node:{}},setup(o){const a=o,c=w.computed(()=>{var d,g;return((g=(d=a==null?void 0:a.node)==null?void 0:d.element)==null?void 0:g.TagName)==="TD"});return(d,g)=>{var p,v;return c.value?(w.openBlock(),w.createElementBlock("span",lOe,w.toDisplayString((p=a==null?void 0:a.node)==null?void 0:p.label),1)):(w.openBlock(),w.createElementBlock("span",uOe,w.toDisplayString((v=a==null?void 0:a.node)==null?void 0:v.label),1))}}}),Ble=w.defineComponent({__name:"index",props:{node:{}},setup(o){const a=o,{containerRef:c,currentNodes:d}=$f(),g=w.computed(()=>{var v;return(v=w.toValue(d))==null?void 0:v.find(x=>{var T;return(x==null?void 0:x.id)===((T=a==null?void 0:a.node)==null?void 0:T.id)})});function p(){var v,x;return(v=a==null?void 0:a.node)!=null&&v.id?(x=c.value)==null?void 0:x.querySelector(`#${CSS.escape(a.node.id)}`):""}return w.watch(()=>g,()=>{var x,T,A,M;const v=w.toValue(g);(x=a==null?void 0:a.node)!=null&&x.element&&(v?v!=null&&v.activated||(a.node.element.style.setProperty("--node-color",(v==null?void 0:v.color)||"#409eff"),a.node.element.style.setProperty("--node-bg-color",Ute((v==null?void 0:v.color)||"#409eff",.1)),a.node.element.setAttribute("data-dataGroupKey",v==null?void 0:v.dataGroupKey),a.node.element.setAttribute("selectable","false"),a.node.element.classList.add("activated")):((T=a.node.element)==null||T.removeAttribute("data-dataGroupKey"),(A=a.node.element)==null||A.removeAttribute("selectable"),(M=a.node.element)==null||M.classList.remove("activated")))},{immediate:!0,deep:!0}),(v,x)=>(w.openBlock(),w.createBlock(w.Teleport,{to:p()},[w.renderSlot(v.$slots,"nodeItem",{node:v.node},()=>[w.createVNode(dOe,{node:v.node},null,8,["node"])])],8,["to"]))}});function fOe(){const o=w.ref(!1),a=d=>{d.key==="Control"&&(o.value=!0)},c=d=>{d.key==="Control"&&(o.value=!1)};return w.onMounted(()=>{window.addEventListener("keydown",a),window.addEventListener("keyup",c)}),w.onUnmounted(()=>{window.removeEventListener("keydown",a),window.removeEventListener("keyup",c)}),o}function Fle(){const{selectedNodes:o,setSelectedNodes:a,containerRef:c}=$f(),{nodes:d}=GA(),g=w.ref(!1),p=w.ref({x:0,y:0}),v=w.ref({x:0,y:0}),x=w.ref({left:0,top:0,width:0,height:0}),T=w.ref(null),A=Ce=>{if(Ce.closest(".node-selected")===null){const Ge=Ce.closest(".node-item-td");if(Ge!==null){const oe=EA(Ge);if(Ge.querySelector(".node-selected"))return;const Ze=bM(Ge);Ze&&a([{...oe,nodePath:Ze,element:Ge}]);return}if(Ce.classList.contains("node-item")){const oe=bM(Ce);oe&&a([{nodePath:oe,element:Ce}]);return}}},M=Ce=>{Ce.button===2&&A(Ce==null?void 0:Ce.target),Ce.button===0&&(g.value=!0,T.value&&(p.value={x:Ce.pageX,y:Ce.pageY},v.value={x:Ce.pageX,y:Ce.pageY},K(Ce),le(),T.value.style.display="block",window.addEventListener("mousemove",I),window.addEventListener("mouseup",z)))},I=Vse(Ce=>{g.value&&(v.value={x:Ce.pageX,y:Ce.pageY},le())},16),z=Ce=>{Ce.button===0&&(g.value=!1,T.value&&(le(),T.value.style.display="none",window.removeEventListener("mousemove",I),window.removeEventListener("mouseup",z)))},U=fOe(),K=Ce=>{let ct=[];if(Ce.button===0){const Ge=EA(Ce==null?void 0:Ce.target);Ge&&(U.value?o.value.some(oe=>dA(oe)===dA(Ge))?ct=o.value.filter(Ze=>dA(Ze)!==dA(Ge)):ct=[...o.value,Ge]:Ge&&(ct=[Ge])),ct=Q(ct),a(ct)}},X=()=>{if(!c.value||!(x.value.width>3||x.value.height>3))return;let Ce=[];const ct={left:x.value.left,right:x.value.left+x.value.width,top:x.value.top,bottom:x.value.top+x.value.height};if(c.value.querySelectorAll("*").forEach(oe=>{const Ze=oe.getBoundingClientRect(),yt=window.scrollX||window.pageXOffset,_t=window.scrollY||window.pageYOffset,Re={left:Ze.left+yt,right:Ze.right+yt,top:Ze.top+_t,bottom:Ze.bottom+_t};Re.right>ct.left&&Re.left<ct.right&&Re.bottom>ct.top&&Re.top<ct.bottom&&(Ce=[...Ce,...q4e(oe)])}),Ce=Q(Ce),U.value){const oe=new Set(o.value.map(yt=>dA(yt))),Ze=Ce.filter(yt=>!oe.has(dA(yt)));a([...o.value,...Ze])}else a(Ce)},Q=Ce=>{var Ge;let ct=[];if(Ce.length>0){const oe=(Ge=Ce.map(ue=>ue==null?void 0:ue.groupKey))==null?void 0:Ge.filter(Boolean),Ze=new Set(oe),yt=Array.from(Ze),_t=d.value.filter(ue=>yt.includes(ue.groupKey));ct=[...Ce,..._t],ct=[...A0e(ct.filter(ue=>ue==null?void 0:ue.id),"id")||[],...ct.filter(ue=>!ue.id)]}return ct},le=Vse(()=>{if(!T.value)return;const{x:Ce,y:ct}=p.value,{x:Ge,y:oe}=v.value,Ze=Math.min(Ce,Ge),yt=Math.min(ct,oe),_t=Math.abs(Ce-Ge),Re=Math.abs(ct-oe);x.value={left:Ze,top:yt,width:_t,height:Re}},16);w.watch(x,Ce=>{ae(Ce),g.value&&X()},{deep:!0});const ae=Ce=>{if(!T.value)return;const{left:ct,top:Ge,width:oe,height:Ze}=w.toValue(Ce);T.value.style.left=`${ct}px`,T.value.style.top=`${Ge}px`,T.value.style.width=`${oe}px`,T.value.style.height=`${Ze}px`},Z=()=>{if(!c.value)return;c.value.addEventListener("mousedown",M);const Ce=document.createElement("div");Ce.style.position="absolute",Ce.style.border="1px solid #1677ff",Ce.style.backgroundColor="rgba(22, 119, 255, 0.05)",Ce.style.pointerEvents="none",document.body.appendChild(Ce),T.value=Ce};return w.watch(()=>c.value,Ce=>{w.toValue(Ce)&&Z()},{immediate:!0}),w.onUnmounted(()=>{c.value&&c.value.removeEventListener("mousedown",M)}),{isSelecting:g,selectionBox:T}}function Lle(){const{selectedNodes:o,containerRef:a}=$f();w.watch(()=>o,g=>{var v,x;const p=(x=(v=w.toValue(g))==null?void 0:v.map(T=>T.element))==null?void 0:x.filter(Boolean);c(),d(p)},{deep:!0});const c=()=>{var g;(g=w.toValue(a))==null||g.querySelectorAll(".node-selected").forEach(p=>{p.classList.remove("node-selected")})},d=g=>{g.forEach(p=>{p.classList.add("node-selected")})}}function mOe(){const o=w.ref(!1),a=w.ref({left:"0px",top:"0px"}),c=g=>{g.preventDefault(),o.value=!0;const v=g.currentTarget.getBoundingClientRect(),x=g.clientX-v.left,T=g.clientY-v.top,A=118,M=v.width-x<A;a.value={left:M?`${x-A}px`:`${x}px`,top:`${T}px`}},d=g=>{const p=document.querySelector(".context-menu");p&&!p.contains(g.target)&&(o.value=!1)};return w.onMounted(()=>{document.addEventListener("mousedown",d)}),w.onUnmounted(()=>{document.removeEventListener("mousedown",d)}),{showContextMenu:o,contextMenuStyle:a,onContextMenu:c,closeContextMenu:d}}function gOe(){const{removeNode:o}=GA(),{containerRef:a}=$f(),c=g=>{var K,X;if(g.target instanceof Element&&g.target.classList.contains("node-item"))return;const p=g.target;if(p===a.value)return;const x=((K=a.value)==null?void 0:K.getRootNode()).getSelection(),T=(X=a.value)==null?void 0:X.querySelectorAll('[contenteditable="true"]');T==null||T.forEach(Q=>{Q.setAttribute("contenteditable","false")});const A=p.textContent||"",M=p.innerHTML||"";p.setAttribute("contenteditable","true"),p.focus();const I=new MutationObserver(()=>{p.textContent!==A&&(p.innerHTML=M)});I.observe(p,{characterData:!0,childList:!0,subtree:!0});const z=Q=>{Q.preventDefault()};p.addEventListener("input",z),p.addEventListener("paste",z),p.addEventListener("drop",z),p.addEventListener("keydown",Q=>{var le,ae,Z,Ce;if(((le=document.activeElement)==null?void 0:le.shadowRoot)===((ae=a.value)==null?void 0:ae.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(Q.key)){if(Q.key==="Backspace"||Q.key==="Delete"){const ct=x==null?void 0:x.getRangeAt(0);if(p.blur(),(ct==null?void 0:ct.startOffset)===0){const Ge=ct.startContainer;if(Ge.nodeType===Node.TEXT_NODE){const oe=Ge.previousSibling;if(oe&&oe.nodeType===Node.ELEMENT_NODE&&oe.classList.contains("node-item")){const Ze=oe.getAttribute("id");Ze&&o(Ze),(Z=Ge.parentElement)==null||Z.normalize();return}}else if(Ge.nodeType===Node.ELEMENT_NODE){const oe=Ge.previousSibling;if(oe&&oe.nodeType===Node.ELEMENT_NODE&&oe.classList.contains("node-item")){const Ze=oe.getAttribute("id");Ze&&o(Ze),(Ce=Ge.parentElement)==null||Ce.normalize();return}}}}Q.preventDefault()}});const U=()=>{I.disconnect(),p.removeEventListener("input",z),p.removeEventListener("paste",z),p.removeEventListener("drop",z),p.removeEventListener("blur",U),p.setAttribute("contenteditable","false")};p.addEventListener("blur",U)};w.watch(a,g=>{g&&d()},{immediate:!0});const d=()=>{var g;(g=a.value)==null||g.addEventListener("dblclick",c)};return w.onUnmounted(()=>{var g;(g=a.value)==null||g.removeEventListener("dblclick",c)}),{}}function hOe(){const{containerRef:o,focusedElement:a,cursorPosition:c,focusedNodeIndex:d,preNodeNumber:g}=$f(),p=A=>{var I,z;const M=A==null?void 0:A.getSelection();try{if((I=a.value)==null||I.normalize(),M){const U=M.getRangeAt(0);d.value=G4e(U.startContainer);const K=U.startOffset,X=(z=a.value)==null?void 0:z.querySelectorAll(".node-item");let Q=0;return g.value=0,X==null||X.forEach(le=>{const ae=document.createRange();if(ae.selectNode(le),ae.comparePoint(U.startContainer,K)>=0){g.value+=1;const Z=le.getAttribute("data-startOffset");Number(Z)>Q&&(Q=Number(Z))}}),Q+K}}catch{}return 0},v=()=>{var M;const A=(M=o.value)==null?void 0:M.getRootNode();c.value=p(A)},x=A=>{var U;const M=A.target;if(M===o.value)return;a.value=M;const I=(U=o.value)==null?void 0:U.getRootNode();c.value=p(I),M.addEventListener("click",v),M.addEventListener("keyup",K=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(K.key)&&v()});const z=()=>{M.removeEventListener("click",v),M.removeEventListener("keyup",v),M.removeEventListener("blur",z),setTimeout(()=>{a.value=null,d.value=0,c.value=-1},300)};M.addEventListener("blur",z)};w.watch(o,A=>{A&&T()},{immediate:!0});const T=()=>{var A;(A=o.value)==null||A.addEventListener("focus",x,!0)};return w.onUnmounted(()=>{var A;(A=o.value)==null||A.removeEventListener("focus",x,!0)}),{focusedElement:a,cursorPosition:c,focusedNodeIndex:d,preNodeNumber:g}}function Cz(){const{containerRef:o,currentRenderNodes:a}=$f(),{nodes:c}=GA(),d=w.ref([]),g=w.ref([]);w.watch(()=>[c.value,o],()=>{if(o.value===null)return;const v=C0e(c.value,[x=>x.nodePath,x=>x.textNodeIndex,x=>x.startOffset??-1,x=>x.subNodeSort],["asc","desc","desc","desc"]);d.value=v},{immediate:!0,deep:!0});const p=v=>{W4e(v,o.value,x=>{g.value.push(x.id)})};return w.watch(()=>d.value,v=>{var x,T,A,M;o.value&&((x=o.value)==null||x.querySelectorAll(".node-item").forEach(I=>I.remove()),(T=o.value)==null||T.querySelectorAll(".node-item-td").forEach(I=>Z4e(I)),(A=o.value)==null||A.querySelectorAll(".empty-text-node").forEach(I=>I.remove()),g.value=[],(M=o.value)==null||M.normalize(),v.forEach(I=>{p(I)}))},{deep:!0,immediate:!0}),w.watch(()=>g.value,()=>{a.value=d.value.filter(v=>v!=null&&v.id?g.value.includes(v==null?void 0:v.id):!1)},{immediate:!0,deep:!0}),{wrappedNodes:d}}function Vle(o){const a=o.value===null?[]:[JSON.parse(JSON.stringify(o.value))],c=w.ref(a),d=w.ref(0),g=w.ref(!1),p=w.computed(()=>c.value[d.value]),v=()=>{d.value>0&&(g.value=!0,d.value--,o.value=JSON.parse(JSON.stringify(c.value[d.value])))},x=()=>{d.value<c.value.length-1&&(g.value=!0,d.value++,o.value=JSON.parse(JSON.stringify(c.value[d.value])))},T=A=>{(A.ctrlKey||A.metaKey)&&A.key==="z"?(A.preventDefault(),v()):(A.ctrlKey||A.metaKey)&&A.key==="y"&&(A.preventDefault(),x())};return w.onMounted(()=>{window.addEventListener("keydown",T)}),w.onUnmounted(()=>{window.removeEventListener("keydown",T)}),w.watch(o,Vx(A=>{A&&!g.value&&(c.value.splice(d.value+1),c.value.push(JSON.parse(JSON.stringify(A))),d.value++),g.value&&(g.value=!1)},300),{deep:!0}),{current:p,undo:v,redo:x}}function pOe(){const{modelValue:o}=Jw(),{nodes:a,addNode:c}=GA(),d=v=>{if(!v||typeof v!="string")return[];const T=new DOMParser().parseFromString(v,"text/html");return Array.from(T.querySelectorAll("td")).filter(I=>{var z;return!((z=I.textContent)!=null&&z.trim())})},g=(v,x)=>{const T=x.map(M=>M.nodePath);return v==null?void 0:v.map(M=>({nodePath:bM(M)})).filter(M=>{const I=M==null?void 0:M.nodePath;return!T.includes(I)})},p=v=>{const x=v.map(T=>({nodeType:"text",label:"文本",...T}));c(x)};w.onMounted(()=>{const v=d(o),x=g(v,w.toValue(a));p(x)})}function bOe(){const{selectedNodes:o,containerRef:a}=$f(),{removeNode:c}=GA(),d=w.ref(null),g=x=>{var T;if((T=w.toValue(a))!=null&&T.contains(d.value)&&(x.key==="Delete"||x.key==="Backspace")){let A=[];x.preventDefault(),w.toValue(o).length>0&&(w.toValue(o).forEach(M=>{var I,z,U;if(((I=M==null?void 0:M.element)==null?void 0:I.tagName)==="TD"){const K=(z=M==null?void 0:M.element)==null?void 0:z.getAttribute("id");K&&A.push(K)}else{const K=(U=M==null?void 0:M.element)==null?void 0:U.getAttribute("id");K&&A.push(K)}}),o.value=[],(A==null?void 0:A.length)>0&&c(A))}},p=x=>{var T;(T=w.toValue(a))!=null&&T.contains(x.target)?d.value=x.target:d.value=null},v=()=>{a.value&&(window.addEventListener("keydown",g),a.value.addEventListener("mousedown",p))};w.watch(()=>a.value,x=>{w.toValue(x)&&v()},{immediate:!0}),w.onUnmounted(()=>{a.value&&(window.removeEventListener("keydown",g),a.value.removeEventListener("mousedown",p))})}const Fee=w.ref({});function Sz(o){return w.computed(()=>{var a;return(a=Fee.value)==null?void 0:a[o]})}function Hle(){const o=Jw(),a=$f();w.onMounted(()=>{const{editorId:c}=o;c&&(Fee.value[c]=w.ref({...o,...a}))}),w.onUnmounted(()=>{const{editorId:c}=o;c&&(Fee.value[c]=null)})}const vOe={class:"relative"},yOe=["innerHTML"],wOe=w.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{modelValue:a,nodes:c}=Jw(),{containerRef:d,currentRenderNodes:g}=$f();Hle(),Vle(c),Fle();const{showContextMenu:p,contextMenuStyle:v,onContextMenu:x}=mOe();return Lle(),bOe(),hOe(),gOe(),Cz(),pOe(),(T,A)=>(w.openBlock(),w.createElementBlock("div",vOe,[w.createVNode(FM,null,{default:w.withCtx(()=>[w.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:d,onContextmenu:A[0]||(A[0]=w.withModifiers((...M)=>w.unref(x)&&w.unref(x)(...M),["prevent"]))},[w.createElementVNode("body",{innerHTML:w.unref(a)},null,8,yOe)],544)]),_:1}),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(w.unref(g),M=>(w.openBlock(),w.createBlock(Ble,{key:M==null?void 0:M.id,node:M},{nodeItem:w.withCtx(I=>[w.renderSlot(T.$slots,"nodeItem",{node:I==null?void 0:I.node})]),_:2},1032,["node"]))),128)),w.createVNode(cOe,{show:w.unref(p),"onUpdate:show":A[1]||(A[1]=M=>w.isRef(p)?p.value=M:null),style:w.normalizeStyle(w.unref(v))},null,8,["show","style"])]))}}),COe={class:"relative"},SOe=["innerHTML"],zre=w.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const a=o,{containerRef:c,modelValue:d}=w.inject(wz);return Cz({containerRef:c,renderType:a.renderType}),(g,p)=>(w.openBlock(),w.createElementBlock("div",COe,[w.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:c},[w.createElementVNode("body",{innerHTML:w.unref(d)},null,8,SOe)],512)]))}}),xOe=w.defineComponent({__name:"index",props:{options:{}},setup(o){const a=o,{formData:c}=Jw(),{containerRef:d}=$f();c.value||(c.value={});function g(v){var x;return v?(x=d.value)==null?void 0:x.querySelector(`#${CSS.escape(v)}`):""}function p(v){switch(v){case"text":return Ko.ElInput;case"date":return Ko.ElDatePicker;case"file":return Ko.ElUpload;case"image":return Ko.ElUpload;case"select":return Ko.ElSelect;default:return Ko.ElInput}}return(v,x)=>{var T,A,M,I;return w.openBlock(),w.createBlock(w.Teleport,{to:g((T=a==null?void 0:a.options)==null?void 0:T.id)},[w.createVNode(w.unref(Ko.ElFormItem),{label:(A=v.options)==null?void 0:A.label,rules:(M=v.options)==null?void 0:M.rules,prop:(I=a==null?void 0:a.options)==null?void 0:I.id},{default:w.withCtx(()=>{var z,U,K,X;return[(w.openBlock(),w.createBlock(w.resolveDynamicComponent(p((z=v.options)==null?void 0:z.inputType)),{"model-value":w.unref(g0e)(w.unref(c)[(U=a==null?void 0:a.options)==null?void 0:U.id])?void 0:w.unref(c)[(K=a==null?void 0:a.options)==null?void 0:K.id],"onUpdate:modelValue":x[0]||(x[0]=Q=>{var le;return w.unref(c)[(le=a==null?void 0:a.options)==null?void 0:le.id]=Q}),placeholder:((X=v.options)==null?void 0:X.placeholder)||"请输入"},null,8,["model-value","placeholder"]))]}),_:1},8,["label","rules","prop"])],8,["to"])}}}),EOe={class:"relative"},_Oe=["innerHTML"],TOe=w.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o,{expose:a}){const c=w.ref();a({formRef:c});const{containerRef:d,modelValue:g}=w.inject(wz),{formData:p}=Jw(),{currentRenderNodes:v}=$f();return Vle(p),Cz(),(x,T)=>{const A=w.resolveComponent("el-form");return w.openBlock(),w.createElementBlock("div",EOe,[w.createVNode(FM,null,{default:w.withCtx(()=>[w.createVNode(A,{ref_key:"formRef",ref:c,model:w.unref(p)},{default:w.withCtx(()=>[w.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:d},[w.createElementVNode("body",{innerHTML:w.unref(g)},null,8,_Oe)],512),w.createVNode(w.unref(Ko.ElConfigProvider),{namespace:"el"},{default:w.withCtx(()=>[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(w.unref(v),M=>(w.openBlock(),w.createBlock(xOe,{key:M==null?void 0:M.id,options:(M==null?void 0:M.formItemOptions)||{id:M.id,inputType:(M==null?void 0:M.inputType)||"text",label:"请输入",type:"text",placeholder:"请输入",rules:[{required:!0,message:"请输入",trigger:"change"}]}},null,8,["options"]))),128))]),_:1})]),_:1},8,["model"])]),_:1})])}}});function zle(o){return{all:o=o||new Map,on:function(a,c){var d=o.get(a);d?d.push(c):o.set(a,[c])},off:function(a,c){var d=o.get(a);d&&(c?d.splice(d.indexOf(c)>>>0,1):o.set(a,[]))},emit:function(a,c){var d=o.get(a);d&&d.slice().map(function(g){g(c)}),(d=o.get("*"))&&d.slice().map(function(g){g(a,c)})}}}const Lee=zle(),Ule=(...o)=>{const a=o[0],c=o[1];w.onMounted(()=>{Lee.on(a,c)}),w.onBeforeUnmount(()=>{Lee.off(a)})},jte=()=>(...a)=>{Lee.emit(...a)};let m0=null;function kOe(o){const{onSelected:a}=o,{containerRef:c,selectedNodes:d,setSelectedNodes:g,currentNodes:p}=$f();return w.watch(()=>d,()=>{m0==null||m0({data:d.value}),a==null||a(w.toValue(d))},{deep:!0}),Ule("selectNodes",x=>{const{data:T,callback:A=null,mode:M="multiple"}=x;setTimeout(()=>{g(w.toValue(T)),m0=A},100)}),{onBlur:()=>{m0&&(m0==null||m0({data:d.value,type:"blur"}),m0=null,g([]))}}}const AOe={class:"relative"},OOe=["innerHTML"],NOe=w.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const a=w.ref(),{modelValue:c}=Jw(),{containerRef:d,currentRenderNodes:g}=$f();Hle(),Fle(),Lle(),Cz();const{onBlur:p}=kOe({onSelected:()=>{var v;(v=a.value)==null||v.focus()}});return(v,x)=>(w.openBlock(),w.createElementBlock("div",AOe,[w.createVNode(FM,{onOnBlur:w.unref(p),ref_key:"shadowDomRef",ref:a},{default:w.withCtx(()=>[w.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:d},[w.createElementVNode("body",{innerHTML:w.unref(c)},null,8,OOe)],512)]),_:1},8,["onOnBlur"]),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(w.unref(g),T=>(w.openBlock(),w.createBlock(Ble,{key:T==null?void 0:T.id,node:T},{nodeItem:w.withCtx(A=>[w.renderSlot(v.$slots,"nodeItem",{node:A==null?void 0:A.node})]),_:2},1032,["node"]))),128))]))}}),$Oe=w.defineComponent({__name:"NodesProvider",props:w.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},renderType:{type:String,default:"preview"},inputTypes:{type:Array,default:()=>[]},editorId:{type:String,default:""}},{formData:{},formDataModifiers:{}}),emits:w.mergeModels(["update:nodes","update:selectNodes","onSelectedNodes"],["update:formData"]),setup(o,{emit:a}){const c=o,d=a,g=w.useModel(o,"formData"),{containerRef:p}=$f(),v=w.computed({get:()=>(c.nodes||[]).map(x=>({...x,element:p.value?j4e(x.nodePath,p.value):null})),set:x=>{const T=x.map(({element:A,...M})=>M);d("update:nodes",T)}});return w.provide(wz,{modelValue:c.modelValue,renderType:c.renderType,inputTypes:c.inputTypes,editorId:c==null?void 0:c.editorId,nodes:v,updateNodes:x=>v.value=x,formData:g}),(x,T)=>w.renderSlot(x.$slots,"default")}}),Uw=w.ref({});function DOe(o){return Uw.value[o]||(Uw.value[o]=w.ref([])),Uw.value[o]}function MOe(o){const{editorId:a}=o;Uw.value[a]||(Uw.value[a]=w.ref([])),Uw.value[a].push(o),w.onUnmounted(()=>{Uw.value[a]=Uw.value[a].filter(c=>c.id!==o.id)})}const ROe=w.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:a,emit:c}){const d=o,g=c,p=w.computed({get:()=>(d.selectedNodes||[]).map(X=>{var ae;let Q=(ae=d==null?void 0:d.nodes)==null?void 0:ae.find(Z=>(Z==null?void 0:Z.id)===(X==null?void 0:X.id)),le=X!=null&&X.element?X==null?void 0:X.element:U4e(X==null?void 0:X.id,v.value);return{...Q||{},...X,element:le}}),set:X=>{const Q=X.map(({element:le,...ae})=>ae);g("update:selectedNodes",Q)}}),v=w.ref(null),x=w.ref(null),T=w.ref(-1),A=w.ref(0),M=w.ref(0),I=DOe(d==null?void 0:d.editorId),z=w.computed(()=>{var Q;const X=((Q=w.toValue(I))==null?void 0:Q.filter(le=>!w.toValue(le==null?void 0:le.activated)))||[];return Y4e([...(d==null?void 0:d.nodesGroups)||[],...X])}),U=w.ref([]),K=X=>{p.value=X,g("onSelectedNodes",X)};return a({setSelectedNodes:K}),w.provide(Ple,{containerRef:v,focusedElement:x,currentRenderNodes:U,cursorPosition:T,focusedNodeIndex:A,preNodeNumber:M,currentNodes:z,selectedNodes:p,setSelectedNodes:K}),(X,Q)=>w.renderSlot(X.$slots,"default")}}),jle=w.defineComponent({__name:"index",props:w.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:w.mergeModels(["update:nodes","update:formData","onSelectedNodes"],["update:selectedNodes"]),setup(o,{expose:a,emit:c}){const d=o,g=c,p=w.useModel(o,"selectedNodes"),v=w.ref(),x=w.ref(),T=w.computed(()=>{switch(d.renderType){case"edit":return wOe;case"select":return NOe;case"result":return zre;case"enter":return TOe;default:return zre}}),A=z=>{g("update:nodes",z)},M=z=>{g("update:formData",z)},I=z=>{g("onSelectedNodes",z)};return a({formRef:{validate:()=>{var z,U,K;return(K=(U=(z=v.value)==null?void 0:z.formRef)==null?void 0:U.validate)==null?void 0:K.call(U)}},setSelectedNodes:z=>{var U,K;(K=(U=x.value)==null?void 0:U.setSelectedNodes)==null||K.call(U,z)}}),(z,U)=>(w.openBlock(),w.createBlock(ROe,{ref_key:"UIRef",ref:x,nodes:o.nodes,selectedNodes:p.value,"onUpdate:selectedNodes":U[0]||(U[0]=K=>p.value=K),onOnSelectedNodes:I,nodesGroups:o.nodesGroups,editorId:d==null?void 0:d.id},{default:w.withCtx(()=>[w.createVNode($Oe,{renderType:o.renderType,"model-value":o.modelValue,nodes:o.nodes,"onUpdate:nodes":A,formData:o.formData,"onUpdate:formData":M,inputTypes:o.inputTypes,editorId:d==null?void 0:d.id},{default:w.withCtx(()=>[(w.openBlock(),w.createBlock(w.resolveDynamicComponent(T.value),{renderType:o.renderType,pagesize:o.pagesize,ref_key:"contentRef",ref:v},{nodeItem:w.withCtx(K=>[w.renderSlot(z.$slots,"nodeItem",{node:K==null?void 0:K.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId"]))}}),POe={class:"nodes-text"},IOe={key:0,class:"node-text-input"},BOe={key:1,class:"node-text-td"},FOe={key:0,class:"node-text-table-index"},LOe=w.defineComponent({__name:"index",props:w.mergeModels({editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const a=o,c=w.useModel(o,"modelValue"),d=Sz(a==null?void 0:a.editorId),g=w.computed(()=>{var v,x,T,A,M,I;if(((v=w.toValue(p))==null?void 0:v.length)>0)if((T=(x=w.toValue(p))==null?void 0:x[0])!=null&&T.element){const z=(M=(A=w.toValue(p))==null?void 0:A[0])==null?void 0:M.element.closest("body").querySelectorAll("table");return((I=Array.from(z))==null?void 0:I.length)===1}else return!0;else return!0}),p=w.computed(()=>{var v;return Ile(c.value,((v=w.toValue(d))==null?void 0:v.nodes)||[])});return(v,x)=>(w.openBlock(),w.createElementBlock("div",POe,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(p.value,(T,A)=>{var M,I,z;return w.openBlock(),w.createElementBlock("div",{key:A,class:"node-text-item"},[(T==null?void 0:T.showTextType)==="input"?(w.openBlock(),w.createElementBlock("span",IOe," 填写"+w.toDisplayString(T==null?void 0:T.inputIndex),1)):(w.openBlock(),w.createElementBlock("span",BOe,[g.value?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("span",FOe,w.toDisplayString(`表${(M=T==null?void 0:T.min)==null?void 0:M.tableIndex}.`),1)),w.createTextVNode(" "+w.toDisplayString(((I=T==null?void 0:T.min)==null?void 0:I.id)===((z=T==null?void 0:T.max)==null?void 0:z.id)?w.unref(_A)(T==null?void 0:T.min):`${w.unref(_A)(T==null?void 0:T.min)}:${w.unref(_A)(T==null?void 0:T.max)}`),1)]))])}),128))]))}}),VOe=cu(LOe,[["__scopeId","data-v-ba569d68"]]);function HOe(o){const{nodes:a,mode:c="multiple"}=o,d=w.ref(!1),g=jte();return{isSelecting:d,selectNodes:()=>{if(d.value)return!1;d.value=!0,g("selectNodes",{data:w.toValue(a),mode:c,callback:({data:v,type:x})=>{a.value=v,x==="blur"&&(d.value=!1)}})}}}const fA=["#ff9b40","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],VQ=w.ref(0),$x=new Map,zOe={class:"node-select"},UOe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},jOe={class:"flex gap-2"},WOe={class:"flex gap-1"},ZOe=w.defineComponent({__name:"index",props:w.mergeModels({mode:{type:String,default:"multiple"},color:{type:String},id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const a=o;!($x!=null&&$x[a==null?void 0:a.id])&&(a!=null&&a.id)&&($x[a==null?void 0:a.id]=VQ.value,VQ.value=VQ.value+1);const c=w.ref(($x==null?void 0:$x[a==null?void 0:a.id])||0),d=w.useModel(o,"modelValue"),{selectNodes:g,isSelecting:p}=HOe({nodes:d,mode:a.mode}),v=()=>{d.value=[]},x=w.computed(()=>a.color||(fA==null?void 0:fA[w.toValue(c)%(fA==null?void 0:fA.length)])||"#409eff");return MOe({id:a.id,editorId:a.editorId,nodes:d,activated:p,color:x.value}),(T,A)=>(w.openBlock(),w.createElementBlock("div",zOe,[w.createElementVNode("div",UOe,[w.createElementVNode("div",jOe,[w.createElementVNode("div",{style:w.normalizeStyle({"--node-color":x.value}),class:"node-color cursor-pointer"},null,4),w.createElementVNode("div",{style:w.normalizeStyle(w.unref(p)?{color:"#409eff"}:{})},[w.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:A[0]||(A[0]=(...M)=>w.unref(g)&&w.unref(g)(...M))})],4),w.createElementVNode("div",null,[w.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:v})])]),w.createElementVNode("div",WOe,[A[4]||(A[4]=w.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),w.createElementVNode("div",null,[w.createVNode(w.unref(Ko.ElPopover),{placement:"top-start",width:200,trigger:"hover",content:"this is content, this is content, this is content"},{reference:w.withCtx(()=>A[3]||(A[3]=[w.createElementVNode("div",{class:"flex flex-center"},[w.createElementVNode("div",{class:"i-bi:info-circle-fill mr-2"}),w.createTextVNode(" 使用帮助 ")],-1)])),_:1})])])]),w.createElementVNode("div",{class:"min-h-[42px] px-2 py-1",onClick:A[2]||(A[2]=(...M)=>w.unref(g)&&w.unref(g)(...M))},[w.createVNode(VOe,{modelValue:d.value,"onUpdate:modelValue":A[1]||(A[1]=M=>d.value=M),editorId:o.editorId},null,8,["modelValue","editorId"])])]))}}),Wle=cu(ZOe,[["__scopeId","data-v-aa7f5cc8"]]);function GOe(o){if(!o.startsWith("="))return[];const a=[];let c=1;for(o.startsWith("=")&&a.push({type:"startOperator",value:"="});c<o.length;){const d=o[c];if(/\s/.test(d)){c++;continue}if(/[A-Za-z]/.test(d)&&/\d/.test(o[c+1])){let g="";for(;c<o.length&&/[A-Za-z]/.test(o[c]);)g+=o[c++];for(;c<o.length&&/\d/.test(o[c]);)g+=o[c++];if(c<o.length&&o[c]===":"){c++;let p="";for(;c<o.length&&/[A-Za-z]/.test(o[c]);)p+=o[c++];for(;c<o.length&&/\d/.test(o[c]);)p+=o[c++];a.push({type:"range",value:`${g}:${p}`});continue}else{a.push({type:"cell",value:g});continue}}if(/[A-Za-z]/.test(d)&&/\d/.test(o[c+1])){let g="";for(;c<o.length&&/[A-Za-z]/.test(o[c]);)g+=o[c++];for(;c<o.length&&/\d/.test(o[c]);)g+=o[c++];a.push({type:"cell",value:g});continue}if(/[A-Za-z]/.test(d)){let g="";for(;c<o.length&&/[A-Za-z]/.test(o[c]);)g+=o[c++];if(["AVERAGE","AVEDEV","SUM","IF","COUNT","MAX","MIN","SQRT"].includes(g.toUpperCase())&&o[c]==="("){a.push({type:"function",value:g});continue}c-=g.length}if(/\d/.test(d)){let g="";for(;c<o.length&&(/\d/.test(o[c])||o[c]===".");)g+=o[c++];a.push({type:"number",value:g});continue}if(d==='"'){let g="";for(g+=d,c++;c<o.length&&o[c]!=='"';)g+=o[c++];g+=d,c++,a.push({type:"string",value:g});continue}if(/[A-Za-z]/.test(d)&&/\d/.test(o[c+1])){let g="";for(;c<o.length&&/[A-Za-z]/.test(o[c]);)g+=o[c++];for(;c<o.length&&/\d/.test(o[c]);)g+=o[c++];a.push({type:"cell",value:g});continue}if(d===":"){a.push({type:"operator",value:":"}),c++;continue}if(/[+\-*/=><]/.test(d)){a.push({type:"operator",value:d}),c++;continue}if(/[()]/.test(d)){a.push({type:"paren",value:d}),c++;continue}if(d===","){a.push({type:"separator",value:","}),c++;continue}c++}return a}function qOe(o,a){const c=[];let d=0;for(;d<o.length;){let g=!1;for(const p of a){const v=p.value;if(o.startsWith(v,d)){c.push({type:p.type,value:v,...p.cellValue?{cellValue:p.cellValue}:{}}),d+=v.length,g=!0;break}}g||(c.push({type:"plain",value:o[d]}),d++)}return c}function YOe(o){const a=Sz(o.editorId),c=(v,x)=>{let T=[];const A=Math.min(v.colIndex,x.colIndex),M=Math.max(v.colIndex,x.colIndex),I=Math.min(v.rowIndex,x.rowIndex),z=Math.max(v.rowIndex,x.rowIndex);for(let U=I;U<=z;U++)for(let K=A;K<=M;K++)T.push({colIndex:K,rowIndex:U});return T},d=v=>{var M;const x=v.includes(":");let T=[];if(x){const[I,z]=v.split(":").map(U=>p(U));T=c(I,z)}else T=[p(v)];return g(T,w.toValue((M=w.toValue(a))==null?void 0:M.nodes))},g=(v,x)=>x==null?void 0:x.filter(T=>{const A=T.nodePath.split(" > ");let M=1,I=1;return A.forEach(z=>{if(z.startsWith("tr")){const U=z.match(/tr(?::nth-child\((\d+)\))?/);U&&U[1]&&(M=parseInt(U[1]))}else if(z.startsWith("td")){const U=z.match(/td(?::nth-child\((\d+)\))?/);U&&(I=U[1]?parseInt(U[1]):1)}}),v.some(z=>M===z.rowIndex+1&&I===z.colIndex+1)}),p=v=>{if(!v)return{colIndex:-1,rowIndex:-1};const x=v.match(/^([A-Za-z]+)(\d+)$/);if(!x)return{colIndex:-1,rowIndex:-1};const T=x[1].toUpperCase(),A=parseInt(x[2]);let M=0;for(let I=0;I<T.length;I++)M=M*26+(T.charCodeAt(I)-64);return{colIndex:M-1,rowIndex:A}};return{getCellValue:d}}const Ure=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function KOe(o,a,c){const d=w.ref(null),g=w.ref(null);function p(){return o.value&&o.value.textContent||""}w.onMounted(()=>{o.value&&(d.value=()=>{const x=p();a.value=x},g.value=()=>{const x=p();a.value=x},o.value.addEventListener("input",d.value),o.value.addEventListener("blur",g.value))}),w.onUnmounted(()=>{o.value&&(d.value&&o.value.removeEventListener("input",d.value),g.value&&o.value.removeEventListener("blur",g.value))});const v=x=>{var T,A,M,I;if(x>=0){const z=window.getSelection();if(z){const U=z.getRangeAt(0),K=((T=U.startContainer)==null?void 0:T.nodeName)==="#text"?U.startContainer:(M=(A=U.startContainer)==null?void 0:A.childNodes)==null?void 0:M[0],X=Math.min(x,((I=K.textContent)==null?void 0:I.length)||0);U.setStart(K,X)}}};return w.watch(()=>[a,o],()=>{var x;o.value&&(Mu((x=o.value)==null?void 0:x.textContent,w.toValue(a))||(o.value.textContent=w.toValue(a),v(w.toValue(c))))},{deep:!0,immediate:!0}),{getFormulaContent:p}}function Wte(o){const{element:a,onFocus:c,onBlur:d}=o,g=w.ref(!1),p=()=>{g.value=!0,c==null||c()},v=()=>{g.value=!1,d==null||d()};return w.onMounted(()=>{var x,T;w.toValue(a)&&((x=w.toValue(a))==null||x.addEventListener("focus",p),(T=w.toValue(a))==null||T.addEventListener("blur",v))}),w.onUnmounted(()=>{var x,T;w.toValue(a)&&((x=w.toValue(a))==null||x.removeEventListener("focus",p),(T=w.toValue(a))==null||T.removeEventListener("blur",v))}),g}function XOe(o){const{element:a,showStr:c,editorId:d}=o,g=Sz(d),p=Wte({element:a}),v=w.computed(()=>{var x;return(x=c==null?void 0:c.value)==null?void 0:x.filter(T=>["range","cell"].includes(T.type))});return w.watch(()=>p,()=>{var T,A,M,I,z,U;const x=K=>{var X;K.preventDefault(),(X=w.toValue(a))==null||X.focus()};w.toValue(p)?((T=w.toValue(g))==null||T.containerRef.addEventListener("click",x),(A=w.toValue(g))==null||A.containerRef.addEventListener("mousedown",x),(M=document.querySelectorAll(".select-function"))==null||M.forEach(K=>{K.addEventListener("click",x),K.addEventListener("mousedown",x)})):((I=w.toValue(g))==null||I.containerRef.removeEventListener("click",x),(z=w.toValue(g))==null||z.containerRef.removeEventListener("mousedown",x),(U=document.querySelectorAll(".select-function"))==null||U.forEach(K=>{K.removeEventListener("click",x),K.removeEventListener("mousedown",x)}))},{deep:!0}),w.watch(()=>[p,v],()=>{var x,T,A,M,I;if((x=w.toValue(g))!=null&&x.containerRef&&((M=(A=(T=w.toValue(g))==null?void 0:T.containerRef)==null?void 0:A.querySelectorAll(".node-formula-cell"))==null||M.forEach(z=>{z.classList.remove("node-formula-cell")}),w.toValue(p))){let z=[];(I=v.value)!=null&&I.length&&(v.value.forEach(U=>{var K;z=[...z,...((K=U==null?void 0:U.cellValue)==null?void 0:K.map(X=>({color:U==null?void 0:U.color,backgroundColor:Ute((U==null?void 0:U.color)||"#000",.1),element:X==null?void 0:X.element})))||[]]}),z.forEach(U=>{var K;U!=null&&U.element&&((K=U==null?void 0:U.element)==null||K.classList.add("node-formula-cell"),U==null||U.element.style.setProperty("--formula-node-color",U==null?void 0:U.color),U==null||U.element.style.setProperty("--formula-node-bg-color",U==null?void 0:U.backgroundColor))}))}},{deep:!0}),p}const JOe=o=>{const{element:a}=o,c=w.ref(-1),d=x=>{const T=x==null?void 0:x.getSelection();try{if(T)return T.getRangeAt(0).startOffset}catch{}return 0},g=()=>{var T;const x=(T=a.value)==null?void 0:T.getRootNode();c.value=d(x)},p=x=>{var I;const T=x.target,A=(I=a.value)==null?void 0:I.getRootNode();c.value=d(A),T.addEventListener("click",g),T.addEventListener("keyup",z=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(z.key)&&g()});const M=()=>{T.removeEventListener("click",g),T.removeEventListener("keyup",g),T.removeEventListener("blur",M),setTimeout(()=>{c.value=-1},300)};T.addEventListener("blur",M)};w.watch(a,x=>{x&&v()},{immediate:!0});const v=()=>{var x;(x=a.value)==null||x.addEventListener("focus",p,!0)};return w.onUnmounted(()=>{var x;(x=a.value)==null||x.removeEventListener("focus",p,!0)}),{startOffset:c}};function QOe(o,a,c,d){if(a<0||c<0||a>=o.length)throw new Error("Invalid start or length");const g=a+c;return o.slice(0,a)+d+o.slice(g)}const eNe=(o,a)=>{var d;let c=0;for(let g=0;g<a;g++){const p=o[g];c+=(d=p==null?void 0:p.value)==null?void 0:d.length}return c},tNe=o=>{const{startOffset:a,showStr:c,value:d,editorId:g,currentItemIndex:p,currentItem:v,element:x}=o,T=Sz(g),A=w.ref(-1),M=w.ref(0),I=Wte({element:x}),z=w.ref(!1),U=jte(),K=X=>{var Q,le;if(w.toValue(z)&&w.toValue(I)&&!Mu((Q=w.toValue(v))==null?void 0:Q.cellValue,X)){const ae=eOe(X,((le=w.toValue(T))==null?void 0:le.nodes)||"");let Z=ae;ae&&(w.toValue(M)===0&&(Z+=","),w.toValue(A)>=0&&(d.value=QOe(w.toValue(d),w.toValue(A),w.toValue(M),Z),M.value=ae.length))}};w.watch(()=>p,()=>{var X,Q,le,ae,Z,Ce;if((X=T.value)==null||X.setSelectedNodes([]),["range","cell"].includes((Q=w.toValue(v))==null?void 0:Q.type))return A.value=eNe(c.value,p.value),M.value=(ae=(le=w.toValue(v))==null?void 0:le.value)==null?void 0:ae.length,z.value=!0,U("selectNodes",{data:(Z=w.toValue(v))==null?void 0:Z.cellValue,mode:"multiple",callback:({data:ct})=>{K(ct)}}),!1;if([",","(","="].includes((Ce=w.toValue(v))==null?void 0:Ce.value))return A.value=w.toValue(a),z.value=!0,M.value=0,U("selectNodes",{data:[],mode:"multiple",callback:({data:ct})=>{K(ct)}}),!1;z.value=!1,A.value=-1},{immediate:!0,deep:!0})},nNe=o=>{const{startOffset:a,showStr:c}=o,d=w.ref(-1);w.watch(()=>a,()=>{var p;if(w.toValue(a)<=0)d.value=-1;else{let v=0;for(let x=0;x<c.value.length;x++){const T=c.value[x];if(v+=(p=T==null?void 0:T.value)==null?void 0:p.length,v>=w.toValue(a)){d.value=x;break}}}},{deep:!0,immediate:!0});const g=w.computed(()=>{var p;return(p=w.toValue(c))==null?void 0:p[w.toValue(d)]});return{currentItemIndex:d,currentItem:g}};function oNe(o,a,c,d){if(a<0||c<0||a>=o.length)throw new Error("Invalid start or length");const g=a+c;return o.slice(0,a)+d+o.slice(g)}const sNe=(o,a)=>{var d;let c=0;for(let g=0;g<a;g++){const p=o[g];c+=(d=p==null?void 0:p.value)==null?void 0:d.length}return c},rNe=o=>{const{startOffset:a,showStr:c,value:d,currentItemIndex:g,currentItem:p,element:v}=o,x=w.ref(-1),T=w.ref(0),A=Wte({element:v}),M=w.ref(!1),I=jte(),z=U=>{var K;if(w.toValue(M)&&w.toValue(A)&&!Mu((K=w.toValue(p))==null?void 0:K.value,U)){const X=U,Q=X;X&&w.toValue(x)>=0&&(d.value=oNe(w.toValue(d),w.toValue(x),w.toValue(T),Q),T.value=X.length)}};w.watch(()=>g,()=>{var U,K,X,Q,le;if(["function"].includes((U=w.toValue(p))==null?void 0:U.type))return x.value=sNe(c.value,g.value),T.value=(X=(K=w.toValue(p))==null?void 0:K.value)==null?void 0:X.length,M.value=!0,I("selectFunction",{data:(Q=w.toValue(p))==null?void 0:Q.value,callback:({data:ae})=>{console.log(ae),z(ae)}}),!1;if([",","(","="].includes((le=w.toValue(p))==null?void 0:le.value))return x.value=w.toValue(a),M.value=!0,T.value=0,I("selectFunction",{data:"",callback:({data:ae})=>{console.log(ae),z(ae)}}),!1;M.value=!1,x.value=-1},{immediate:!0,deep:!0})},aNe={class:"node-formula"},iNe={class:"node-formula-show"},cNe=w.defineComponent({__name:"index",props:w.mergeModels({id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const a=o,{getCellValue:c}=YOe({editorId:a==null?void 0:a.editorId}),d=w.useModel(o,"modelValue"),g=w.ref(),{startOffset:p}=JOe({element:g});KOe(g,d,p);const v=w.computed(()=>{const M=GOe(d.value);return M==null?void 0:M.map(z=>z.type==="cell"||z.type==="range"?{cellValue:c(z.value),...z}:z)}),x=w.computed(()=>{const M=qOe(d.value,v.value);let I=-1;return M.map(U=>(U==null?void 0:U.type)==="cell"||(U==null?void 0:U.type)==="range"?(I++,{...U,color:Ure[I%Ure.length]}):(U==null?void 0:U.type)==="function"?{...U,color:"#0318ff"}:U)});XOe({element:g,showStr:x,editorId:a==null?void 0:a.editorId});const{currentItemIndex:T,currentItem:A}=nNe({element:g,startOffset:p,value:d,showStr:x});return tNe({element:g,startOffset:p,showStr:x,editorId:a==null?void 0:a.editorId,value:d,currentItemIndex:T,currentItem:A}),rNe({element:g,startOffset:p,showStr:x,value:d,currentItemIndex:T,currentItem:A}),(M,I)=>(w.openBlock(),w.createElementBlock("div",aNe,[w.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:g,class:"node-formula-input"},null,512),w.createElementVNode("div",iNe,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(x.value,(z,U)=>(w.openBlock(),w.createElementBlock("span",{key:U,class:w.normalizeClass(["node-formula-item",`node-formula-item-type-${z==null?void 0:z.type}`,U===w.unref(T)?"node-formula-item-active":""]),style:w.normalizeStyle({"--text-color":(z==null?void 0:z.color)||"#000","--bg-color":w.unref(Ute)((z==null?void 0:z.color)||"#000",.1)})},w.toDisplayString(z.value),7))),128))])]))}}),Zle=cu(cNe,[["__scopeId","data-v-f4b96eb4"]]),lNe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],uNe={class:"select-function"},dNe=["onClick"],fNe={class:"function-item"},mNe={class:"function-item-desc"},gNe=w.defineComponent({__name:"index",props:w.mergeModels({id:{type:String,default:""},functionList:{type:Array,default:()=>[]}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const a=o;let c=null;const d=w.computed(()=>{var v;return((v=a.functionList)==null?void 0:v.length)>0?a.functionList:lNe}),g=w.useModel(o,"modelValue"),p=v=>{g.value=v,c==null||c({data:v})};return Ule("selectFunction",({data:v,callback:x})=>{c=x,g.value=v}),(v,x)=>(w.openBlock(),w.createElementBlock("div",uNe,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(d.value,(T,A)=>(w.openBlock(),w.createElementBlock("div",{key:A},[w.createElementVNode("div",{onClick:()=>{p(T.value)},class:w.normalizeClass(["function-item-wrapper",{active:g.value===T.value}])},[w.createElementVNode("div",fNe,w.toDisplayString(T.value),1),w.createElementVNode("div",mNe,w.toDisplayString(T.label),1)],10,dNe)]))),128))]))}}),Gle=cu(gNe,[["__scopeId","data-v-6e079ff0"]]),hNe=["innerHTML"],qle=w.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const a=w.useModel(o,"modelValue");return(c,d)=>(w.openBlock(),w.createBlock(FM,null,{default:w.withCtx(()=>[w.createElementVNode("div",{innerHTML:a.value},null,8,hNe)]),_:1}))}});function xz(o){return w.getCurrentScope()?(w.onScopeDispose(o),!0):!1}function p0(o){return typeof o=="function"?o():w.unref(o)}const pNe=typeof window<"u"&&typeof document<"u",bNe=o=>typeof o<"u",vNe=Object.prototype.toString,yNe=o=>vNe.call(o)==="[object Object]",wNe=()=>{};function CNe(o,a){function c(...d){return new Promise((g,p)=>{Promise.resolve(o(()=>a.apply(this,d),{fn:a,thisArg:this,args:d})).then(g).catch(p)})}return c}const Yle=o=>o();function SNe(o=Yle){const a=w.ref(!0);function c(){a.value=!1}function d(){a.value=!0}const g=(...p)=>{a.value&&o(...p)};return{isActive:w.readonly(a),pause:c,resume:d,eventFilter:g}}function jre(o,a=!1,c="Timeout"){return new Promise((d,g)=>{setTimeout(a?()=>g(c):d,o)})}function xNe(o,a,c={}){const{eventFilter:d=Yle,...g}=c;return w.watch(o,CNe(d,a),g)}function mA(o,a,c={}){const{eventFilter:d,...g}=c,{eventFilter:p,pause:v,resume:x,isActive:T}=SNe(d);return{stop:xNe(o,a,{...g,eventFilter:p}),pause:v,resume:x,isActive:T}}function ENe(o,a={}){if(!w.isRef(o))return w.toRefs(o);const c=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const d in o.value)c[d]=w.customRef(()=>({get(){return o.value[d]},set(g){var p;if((p=p0(a.replaceRef))!=null?p:!0)if(Array.isArray(o.value)){const x=[...o.value];x[d]=g,o.value=x}else{const x={...o.value,[d]:g};Object.setPrototypeOf(x,Object.getPrototypeOf(o.value)),o.value=x}else o.value[d]=g}}));return c}function Vee(o,a=!1){function c(I,{flush:z="sync",deep:U=!1,timeout:K,throwOnTimeout:X}={}){let Q=null;const ae=[new Promise(Z=>{Q=w.watch(o,Ce=>{I(Ce)!==a&&(Q==null||Q(),Z(Ce))},{flush:z,deep:U,immediate:!0})})];return K!=null&&ae.push(jre(K,X).then(()=>p0(o)).finally(()=>Q==null?void 0:Q())),Promise.race(ae)}function d(I,z){if(!w.isRef(I))return c(Ce=>Ce===I,z);const{flush:U="sync",deep:K=!1,timeout:X,throwOnTimeout:Q}=z??{};let le=null;const Z=[new Promise(Ce=>{le=w.watch([o,I],([ct,Ge])=>{a!==(ct===Ge)&&(le==null||le(),Ce(ct))},{flush:U,deep:K,immediate:!0})})];return X!=null&&Z.push(jre(X,Q).then(()=>p0(o)).finally(()=>(le==null||le(),p0(o)))),Promise.race(Z)}function g(I){return c(z=>!!z,I)}function p(I){return d(null,I)}function v(I){return d(void 0,I)}function x(I){return c(Number.isNaN,I)}function T(I,z){return c(U=>{const K=Array.from(U);return K.includes(I)||K.includes(p0(I))},z)}function A(I){return M(1,I)}function M(I=1,z){let U=-1;return c(()=>(U+=1,U>=I),z)}return Array.isArray(p0(o))?{toMatch:c,toContains:T,changed:A,changedTimes:M,get not(){return Vee(o,!a)}}:{toMatch:c,toBe:d,toBeTruthy:g,toBeNull:p,toBeNaN:x,toBeUndefined:v,changed:A,changedTimes:M,get not(){return Vee(o,!a)}}}function Hee(o){return Vee(o)}function _Ne(o){var a;const c=p0(o);return(a=c==null?void 0:c.$el)!=null?a:c}const Kle=pNe?window:void 0;function Xle(...o){let a,c,d,g;if(typeof o[0]=="string"||Array.isArray(o[0])?([c,d,g]=o,a=Kle):[a,c,d,g]=o,!a)return wNe;Array.isArray(c)||(c=[c]),Array.isArray(d)||(d=[d]);const p=[],v=()=>{p.forEach(M=>M()),p.length=0},x=(M,I,z,U)=>(M.addEventListener(I,z,U),()=>M.removeEventListener(I,z,U)),T=w.watch(()=>[_Ne(a),p0(g)],([M,I])=>{if(v(),!M)return;const z=yNe(I)?{...I}:I;p.push(...c.flatMap(U=>d.map(K=>x(M,U,K,z))))},{immediate:!0,flush:"post"}),A=()=>{T(),v()};return xz(A),A}function TNe(o){return typeof o=="function"?o:typeof o=="string"?a=>a.key===o:Array.isArray(o)?a=>o.includes(a.key):()=>!0}function Wre(...o){let a,c,d={};o.length===3?(a=o[0],c=o[1],d=o[2]):o.length===2?typeof o[1]=="object"?(a=!0,c=o[0],d=o[1]):(a=o[0],c=o[1]):(a=!0,c=o[0]);const{target:g=Kle,eventName:p="keydown",passive:v=!1,dedupe:x=!1}=d,T=TNe(a);return Xle(g,p,M=>{M.repeat&&p0(x)||T(M)&&c(M)},v)}function kNe(o){return JSON.parse(JSON.stringify(o))}function HQ(o,a,c,d={}){var g,p,v;const{clone:x=!1,passive:T=!1,eventName:A,deep:M=!1,defaultValue:I,shouldEmit:z}=d,U=w.getCurrentInstance(),K=c||(U==null?void 0:U.emit)||((g=U==null?void 0:U.$emit)==null?void 0:g.bind(U))||((v=(p=U==null?void 0:U.proxy)==null?void 0:p.$emit)==null?void 0:v.bind(U==null?void 0:U.proxy));let X=A;a||(a="modelValue"),X=X||`update:${a.toString()}`;const Q=Z=>x?typeof x=="function"?x(Z):kNe(Z):Z,le=()=>bNe(o[a])?Q(o[a]):I,ae=Z=>{z?z(Z)&&K(X,Z):K(X,Z)};if(T){const Z=le(),Ce=w.ref(Z);let ct=!1;return w.watch(()=>o[a],Ge=>{ct||(ct=!0,Ce.value=Q(Ge),w.nextTick(()=>ct=!1))}),w.watch(Ce,Ge=>{!ct&&(Ge!==o[a]||M)&&ae(Ge)},{deep:M}),Ce}else return w.computed({get(){return le()},set(Z){ae(Z)}})}var ANe={value:()=>{}};function Ez(){for(var o=0,a=arguments.length,c={},d;o<a;++o){if(!(d=arguments[o]+"")||d in c||/[\s.]/.test(d))throw new Error("illegal type: "+d);c[d]=[]}return new nH(c)}function nH(o){this._=o}function ONe(o,a){return o.trim().split(/^|\s+/).map(function(c){var d="",g=c.indexOf(".");if(g>=0&&(d=c.slice(g+1),c=c.slice(0,g)),c&&!a.hasOwnProperty(c))throw new Error("unknown type: "+c);return{type:c,name:d}})}nH.prototype=Ez.prototype={constructor:nH,on:function(o,a){var c=this._,d=ONe(o+"",c),g,p=-1,v=d.length;if(arguments.length<2){for(;++p<v;)if((g=(o=d[p]).type)&&(g=NNe(c[g],o.name)))return g;return}if(a!=null&&typeof a!="function")throw new Error("invalid callback: "+a);for(;++p<v;)if(g=(o=d[p]).type)c[g]=Zre(c[g],o.name,a);else if(a==null)for(g in c)c[g]=Zre(c[g],o.name,null);return this},copy:function(){var o={},a=this._;for(var c in a)o[c]=a[c].slice();return new nH(o)},call:function(o,a){if((g=arguments.length-2)>0)for(var c=new Array(g),d=0,g,p;d<g;++d)c[d]=arguments[d+2];if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(p=this._[o],d=0,g=p.length;d<g;++d)p[d].value.apply(a,c)},apply:function(o,a,c){if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(var d=this._[o],g=0,p=d.length;g<p;++g)d[g].value.apply(a,c)}};function NNe(o,a){for(var c=0,d=o.length,g;c<d;++c)if((g=o[c]).name===a)return g.value}function Zre(o,a,c){for(var d=0,g=o.length;d<g;++d)if(o[d].name===a){o[d]=ANe,o=o.slice(0,d).concat(o.slice(d+1));break}return c!=null&&o.push({name:a,value:c}),o}var zee="http://www.w3.org/1999/xhtml";const Gre={svg:"http://www.w3.org/2000/svg",xhtml:zee,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _z(o){var a=o+="",c=a.indexOf(":");return c>=0&&(a=o.slice(0,c))!=="xmlns"&&(o=o.slice(c+1)),Gre.hasOwnProperty(a)?{space:Gre[a],local:o}:o}function $Ne(o){return function(){var a=this.ownerDocument,c=this.namespaceURI;return c===zee&&a.documentElement.namespaceURI===zee?a.createElement(o):a.createElementNS(c,o)}}function DNe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Jle(o){var a=_z(o);return(a.local?DNe:$Ne)(a)}function MNe(){}function Zte(o){return o==null?MNe:function(){return this.querySelector(o)}}function RNe(o){typeof o!="function"&&(o=Zte(o));for(var a=this._groups,c=a.length,d=new Array(c),g=0;g<c;++g)for(var p=a[g],v=p.length,x=d[g]=new Array(v),T,A,M=0;M<v;++M)(T=p[M])&&(A=o.call(T,T.__data__,M,p))&&("__data__"in T&&(A.__data__=T.__data__),x[M]=A);return new pg(d,this._parents)}function PNe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function INe(){return[]}function Qle(o){return o==null?INe:function(){return this.querySelectorAll(o)}}function BNe(o){return function(){return PNe(o.apply(this,arguments))}}function FNe(o){typeof o=="function"?o=BNe(o):o=Qle(o);for(var a=this._groups,c=a.length,d=[],g=[],p=0;p<c;++p)for(var v=a[p],x=v.length,T,A=0;A<x;++A)(T=v[A])&&(d.push(o.call(T,T.__data__,A,v)),g.push(T));return new pg(d,g)}function eue(o){return function(){return this.matches(o)}}function tue(o){return function(a){return a.matches(o)}}var LNe=Array.prototype.find;function VNe(o){return function(){return LNe.call(this.children,o)}}function HNe(){return this.firstElementChild}function zNe(o){return this.select(o==null?HNe:VNe(typeof o=="function"?o:tue(o)))}var UNe=Array.prototype.filter;function jNe(){return Array.from(this.children)}function WNe(o){return function(){return UNe.call(this.children,o)}}function ZNe(o){return this.selectAll(o==null?jNe:WNe(typeof o=="function"?o:tue(o)))}function GNe(o){typeof o!="function"&&(o=eue(o));for(var a=this._groups,c=a.length,d=new Array(c),g=0;g<c;++g)for(var p=a[g],v=p.length,x=d[g]=[],T,A=0;A<v;++A)(T=p[A])&&o.call(T,T.__data__,A,p)&&x.push(T);return new pg(d,this._parents)}function nue(o){return new Array(o.length)}function qNe(){return new pg(this._enter||this._groups.map(nue),this._parents)}function TH(o,a){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=a}TH.prototype={constructor:TH,appendChild:function(o){return this._parent.insertBefore(o,this._next)},insertBefore:function(o,a){return this._parent.insertBefore(o,a)},querySelector:function(o){return this._parent.querySelector(o)},querySelectorAll:function(o){return this._parent.querySelectorAll(o)}};function YNe(o){return function(){return o}}function KNe(o,a,c,d,g,p){for(var v=0,x,T=a.length,A=p.length;v<A;++v)(x=a[v])?(x.__data__=p[v],d[v]=x):c[v]=new TH(o,p[v]);for(;v<T;++v)(x=a[v])&&(g[v]=x)}function XNe(o,a,c,d,g,p,v){var x,T,A=new Map,M=a.length,I=p.length,z=new Array(M),U;for(x=0;x<M;++x)(T=a[x])&&(z[x]=U=v.call(T,T.__data__,x,a)+"",A.has(U)?g[x]=T:A.set(U,T));for(x=0;x<I;++x)U=v.call(o,p[x],x,p)+"",(T=A.get(U))?(d[x]=T,T.__data__=p[x],A.delete(U)):c[x]=new TH(o,p[x]);for(x=0;x<M;++x)(T=a[x])&&A.get(z[x])===T&&(g[x]=T)}function JNe(o){return o.__data__}function QNe(o,a){if(!arguments.length)return Array.from(this,JNe);var c=a?XNe:KNe,d=this._parents,g=this._groups;typeof o!="function"&&(o=YNe(o));for(var p=g.length,v=new Array(p),x=new Array(p),T=new Array(p),A=0;A<p;++A){var M=d[A],I=g[A],z=I.length,U=e5e(o.call(M,M&&M.__data__,A,d)),K=U.length,X=x[A]=new Array(K),Q=v[A]=new Array(K),le=T[A]=new Array(z);c(M,I,X,Q,le,U,a);for(var ae=0,Z=0,Ce,ct;ae<K;++ae)if(Ce=X[ae]){for(ae>=Z&&(Z=ae+1);!(ct=Q[Z])&&++Z<K;);Ce._next=ct||null}}return v=new pg(v,d),v._enter=x,v._exit=T,v}function e5e(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function t5e(){return new pg(this._exit||this._groups.map(nue),this._parents)}function n5e(o,a,c){var d=this.enter(),g=this,p=this.exit();return typeof o=="function"?(d=o(d),d&&(d=d.selection())):d=d.append(o+""),a!=null&&(g=a(g),g&&(g=g.selection())),c==null?p.remove():c(p),d&&g?d.merge(g).order():g}function o5e(o){for(var a=o.selection?o.selection():o,c=this._groups,d=a._groups,g=c.length,p=d.length,v=Math.min(g,p),x=new Array(g),T=0;T<v;++T)for(var A=c[T],M=d[T],I=A.length,z=x[T]=new Array(I),U,K=0;K<I;++K)(U=A[K]||M[K])&&(z[K]=U);for(;T<g;++T)x[T]=c[T];return new pg(x,this._parents)}function s5e(){for(var o=this._groups,a=-1,c=o.length;++a<c;)for(var d=o[a],g=d.length-1,p=d[g],v;--g>=0;)(v=d[g])&&(p&&v.compareDocumentPosition(p)^4&&p.parentNode.insertBefore(v,p),p=v);return this}function r5e(o){o||(o=a5e);function a(I,z){return I&&z?o(I.__data__,z.__data__):!I-!z}for(var c=this._groups,d=c.length,g=new Array(d),p=0;p<d;++p){for(var v=c[p],x=v.length,T=g[p]=new Array(x),A,M=0;M<x;++M)(A=v[M])&&(T[M]=A);T.sort(a)}return new pg(g,this._parents).order()}function a5e(o,a){return o<a?-1:o>a?1:o>=a?0:NaN}function i5e(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function c5e(){return Array.from(this)}function l5e(){for(var o=this._groups,a=0,c=o.length;a<c;++a)for(var d=o[a],g=0,p=d.length;g<p;++g){var v=d[g];if(v)return v}return null}function u5e(){let o=0;for(const a of this)++o;return o}function d5e(){return!this.node()}function f5e(o){for(var a=this._groups,c=0,d=a.length;c<d;++c)for(var g=a[c],p=0,v=g.length,x;p<v;++p)(x=g[p])&&o.call(x,x.__data__,p,g);return this}function m5e(o){return function(){this.removeAttribute(o)}}function g5e(o){return function(){this.removeAttributeNS(o.space,o.local)}}function h5e(o,a){return function(){this.setAttribute(o,a)}}function p5e(o,a){return function(){this.setAttributeNS(o.space,o.local,a)}}function b5e(o,a){return function(){var c=a.apply(this,arguments);c==null?this.removeAttribute(o):this.setAttribute(o,c)}}function v5e(o,a){return function(){var c=a.apply(this,arguments);c==null?this.removeAttributeNS(o.space,o.local):this.setAttributeNS(o.space,o.local,c)}}function y5e(o,a){var c=_z(o);if(arguments.length<2){var d=this.node();return c.local?d.getAttributeNS(c.space,c.local):d.getAttribute(c)}return this.each((a==null?c.local?g5e:m5e:typeof a=="function"?c.local?v5e:b5e:c.local?p5e:h5e)(c,a))}function oue(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function w5e(o){return function(){this.style.removeProperty(o)}}function C5e(o,a,c){return function(){this.style.setProperty(o,a,c)}}function S5e(o,a,c){return function(){var d=a.apply(this,arguments);d==null?this.style.removeProperty(o):this.style.setProperty(o,d,c)}}function x5e(o,a,c){return arguments.length>1?this.each((a==null?w5e:typeof a=="function"?S5e:C5e)(o,a,c??"")):MA(this.node(),o)}function MA(o,a){return o.style.getPropertyValue(a)||oue(o).getComputedStyle(o,null).getPropertyValue(a)}function E5e(o){return function(){delete this[o]}}function _5e(o,a){return function(){this[o]=a}}function T5e(o,a){return function(){var c=a.apply(this,arguments);c==null?delete this[o]:this[o]=c}}function k5e(o,a){return arguments.length>1?this.each((a==null?E5e:typeof a=="function"?T5e:_5e)(o,a)):this.node()[o]}function sue(o){return o.trim().split(/^|\s+/)}function Gte(o){return o.classList||new rue(o)}function rue(o){this._node=o,this._names=sue(o.getAttribute("class")||"")}rue.prototype={add:function(o){var a=this._names.indexOf(o);a<0&&(this._names.push(o),this._node.setAttribute("class",this._names.join(" ")))},remove:function(o){var a=this._names.indexOf(o);a>=0&&(this._names.splice(a,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(o){return this._names.indexOf(o)>=0}};function aue(o,a){for(var c=Gte(o),d=-1,g=a.length;++d<g;)c.add(a[d])}function iue(o,a){for(var c=Gte(o),d=-1,g=a.length;++d<g;)c.remove(a[d])}function A5e(o){return function(){aue(this,o)}}function O5e(o){return function(){iue(this,o)}}function N5e(o,a){return function(){(a.apply(this,arguments)?aue:iue)(this,o)}}function $5e(o,a){var c=sue(o+"");if(arguments.length<2){for(var d=Gte(this.node()),g=-1,p=c.length;++g<p;)if(!d.contains(c[g]))return!1;return!0}return this.each((typeof a=="function"?N5e:a?A5e:O5e)(c,a))}function D5e(){this.textContent=""}function M5e(o){return function(){this.textContent=o}}function R5e(o){return function(){var a=o.apply(this,arguments);this.textContent=a??""}}function P5e(o){return arguments.length?this.each(o==null?D5e:(typeof o=="function"?R5e:M5e)(o)):this.node().textContent}function I5e(){this.innerHTML=""}function B5e(o){return function(){this.innerHTML=o}}function F5e(o){return function(){var a=o.apply(this,arguments);this.innerHTML=a??""}}function L5e(o){return arguments.length?this.each(o==null?I5e:(typeof o=="function"?F5e:B5e)(o)):this.node().innerHTML}function V5e(){this.nextSibling&&this.parentNode.appendChild(this)}function H5e(){return this.each(V5e)}function z5e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function U5e(){return this.each(z5e)}function j5e(o){var a=typeof o=="function"?o:Jle(o);return this.select(function(){return this.appendChild(a.apply(this,arguments))})}function W5e(){return null}function Z5e(o,a){var c=typeof o=="function"?o:Jle(o),d=a==null?W5e:typeof a=="function"?a:Zte(a);return this.select(function(){return this.insertBefore(c.apply(this,arguments),d.apply(this,arguments)||null)})}function G5e(){var o=this.parentNode;o&&o.removeChild(this)}function q5e(){return this.each(G5e)}function Y5e(){var o=this.cloneNode(!1),a=this.parentNode;return a?a.insertBefore(o,this.nextSibling):o}function K5e(){var o=this.cloneNode(!0),a=this.parentNode;return a?a.insertBefore(o,this.nextSibling):o}function X5e(o){return this.select(o?K5e:Y5e)}function J5e(o){return arguments.length?this.property("__data__",o):this.node().__data__}function Q5e(o){return function(a){o.call(this,a,this.__data__)}}function e$e(o){return o.trim().split(/^|\s+/).map(function(a){var c="",d=a.indexOf(".");return d>=0&&(c=a.slice(d+1),a=a.slice(0,d)),{type:a,name:c}})}function t$e(o){return function(){var a=this.__on;if(a){for(var c=0,d=-1,g=a.length,p;c<g;++c)p=a[c],(!o.type||p.type===o.type)&&p.name===o.name?this.removeEventListener(p.type,p.listener,p.options):a[++d]=p;++d?a.length=d:delete this.__on}}}function n$e(o,a,c){return function(){var d=this.__on,g,p=Q5e(a);if(d){for(var v=0,x=d.length;v<x;++v)if((g=d[v]).type===o.type&&g.name===o.name){this.removeEventListener(g.type,g.listener,g.options),this.addEventListener(g.type,g.listener=p,g.options=c),g.value=a;return}}this.addEventListener(o.type,p,c),g={type:o.type,name:o.name,value:a,listener:p,options:c},d?d.push(g):this.__on=[g]}}function o$e(o,a,c){var d=e$e(o+""),g,p=d.length,v;if(arguments.length<2){var x=this.node().__on;if(x){for(var T=0,A=x.length,M;T<A;++T)for(g=0,M=x[T];g<p;++g)if((v=d[g]).type===M.type&&v.name===M.name)return M.value}return}for(x=a?n$e:t$e,g=0;g<p;++g)this.each(x(d[g],a,c));return this}function cue(o,a,c){var d=oue(o),g=d.CustomEvent;typeof g=="function"?g=new g(a,c):(g=d.document.createEvent("Event"),c?(g.initEvent(a,c.bubbles,c.cancelable),g.detail=c.detail):g.initEvent(a,!1,!1)),o.dispatchEvent(g)}function s$e(o,a){return function(){return cue(this,o,a)}}function r$e(o,a){return function(){return cue(this,o,a.apply(this,arguments))}}function a$e(o,a){return this.each((typeof a=="function"?r$e:s$e)(o,a))}function*i$e(){for(var o=this._groups,a=0,c=o.length;a<c;++a)for(var d=o[a],g=0,p=d.length,v;g<p;++g)(v=d[g])&&(yield v)}var lue=[null];function pg(o,a){this._groups=o,this._parents=a}function LM(){return new pg([[document.documentElement]],lue)}function c$e(){return this}pg.prototype=LM.prototype={constructor:pg,select:RNe,selectAll:FNe,selectChild:zNe,selectChildren:ZNe,filter:GNe,data:QNe,enter:qNe,exit:t5e,join:n5e,merge:o5e,selection:c$e,order:s5e,sort:r5e,call:i5e,nodes:c5e,node:l5e,size:u5e,empty:d5e,each:f5e,attr:y5e,style:x5e,property:k5e,classed:$5e,text:P5e,html:L5e,raise:H5e,lower:U5e,append:j5e,insert:Z5e,remove:q5e,clone:X5e,datum:J5e,on:o$e,dispatch:a$e,[Symbol.iterator]:i$e};function kp(o){return typeof o=="string"?new pg([[document.querySelector(o)]],[document.documentElement]):new pg([[o]],lue)}function l$e(o){let a;for(;a=o.sourceEvent;)o=a;return o}function gb(o,a){if(o=l$e(o),a===void 0&&(a=o.currentTarget),a){var c=a.ownerSVGElement||a;if(c.createSVGPoint){var d=c.createSVGPoint();return d.x=o.clientX,d.y=o.clientY,d=d.matrixTransform(a.getScreenCTM().inverse()),[d.x,d.y]}if(a.getBoundingClientRect){var g=a.getBoundingClientRect();return[o.clientX-g.left-a.clientLeft,o.clientY-g.top-a.clientTop]}}return[o.pageX,o.pageY]}const u$e={passive:!1},vM={capture:!0,passive:!1};function zQ(o){o.stopImmediatePropagation()}function TA(o){o.preventDefault(),o.stopImmediatePropagation()}function uue(o){var a=o.document.documentElement,c=kp(o).on("dragstart.drag",TA,vM);"onselectstart"in a?c.on("selectstart.drag",TA,vM):(a.__noselect=a.style.MozUserSelect,a.style.MozUserSelect="none")}function due(o,a){var c=o.document.documentElement,d=kp(o).on("dragstart.drag",null);a&&(d.on("click.drag",TA,vM),setTimeout(function(){d.on("click.drag",null)},0)),"onselectstart"in c?d.on("selectstart.drag",null):(c.style.MozUserSelect=c.__noselect,delete c.__noselect)}const PV=o=>()=>o;function Uee(o,{sourceEvent:a,subject:c,target:d,identifier:g,active:p,x:v,y:x,dx:T,dy:A,dispatch:M}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:a,enumerable:!0,configurable:!0},subject:{value:c,enumerable:!0,configurable:!0},target:{value:d,enumerable:!0,configurable:!0},identifier:{value:g,enumerable:!0,configurable:!0},active:{value:p,enumerable:!0,configurable:!0},x:{value:v,enumerable:!0,configurable:!0},y:{value:x,enumerable:!0,configurable:!0},dx:{value:T,enumerable:!0,configurable:!0},dy:{value:A,enumerable:!0,configurable:!0},_:{value:M}})}Uee.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function d$e(o){return!o.ctrlKey&&!o.button}function f$e(){return this.parentNode}function m$e(o,a){return a??{x:o.x,y:o.y}}function g$e(){return navigator.maxTouchPoints||"ontouchstart"in this}function h$e(){var o=d$e,a=f$e,c=m$e,d=g$e,g={},p=Ez("start","drag","end"),v=0,x,T,A,M,I=0;function z(Ce){Ce.on("mousedown.drag",U).filter(d).on("touchstart.drag",Q).on("touchmove.drag",le,u$e).on("touchend.drag touchcancel.drag",ae).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function U(Ce,ct){if(!(M||!o.call(this,Ce,ct))){var Ge=Z(this,a.call(this,Ce,ct),Ce,ct,"mouse");Ge&&(kp(Ce.view).on("mousemove.drag",K,vM).on("mouseup.drag",X,vM),uue(Ce.view),zQ(Ce),A=!1,x=Ce.clientX,T=Ce.clientY,Ge("start",Ce))}}function K(Ce){if(TA(Ce),!A){var ct=Ce.clientX-x,Ge=Ce.clientY-T;A=ct*ct+Ge*Ge>I}g.mouse("drag",Ce)}function X(Ce){kp(Ce.view).on("mousemove.drag mouseup.drag",null),due(Ce.view,A),TA(Ce),g.mouse("end",Ce)}function Q(Ce,ct){if(o.call(this,Ce,ct)){var Ge=Ce.changedTouches,oe=a.call(this,Ce,ct),Ze=Ge.length,yt,_t;for(yt=0;yt<Ze;++yt)(_t=Z(this,oe,Ce,ct,Ge[yt].identifier,Ge[yt]))&&(zQ(Ce),_t("start",Ce,Ge[yt]))}}function le(Ce){var ct=Ce.changedTouches,Ge=ct.length,oe,Ze;for(oe=0;oe<Ge;++oe)(Ze=g[ct[oe].identifier])&&(TA(Ce),Ze("drag",Ce,ct[oe]))}function ae(Ce){var ct=Ce.changedTouches,Ge=ct.length,oe,Ze;for(M&&clearTimeout(M),M=setTimeout(function(){M=null},500),oe=0;oe<Ge;++oe)(Ze=g[ct[oe].identifier])&&(zQ(Ce),Ze("end",Ce,ct[oe]))}function Z(Ce,ct,Ge,oe,Ze,yt){var _t=p.copy(),Re=gb(yt||Ge,ct),ue,Xt,Se;if((Se=c.call(Ce,new Uee("beforestart",{sourceEvent:Ge,target:z,identifier:Ze,active:v,x:Re[0],y:Re[1],dx:0,dy:0,dispatch:_t}),oe))!=null)return ue=Se.x-Re[0]||0,Xt=Se.y-Re[1]||0,function Ie(D,ze,be){var tt=Re,nt;switch(D){case"start":g[Ze]=Ie,nt=v++;break;case"end":delete g[Ze],--v;case"drag":Re=gb(be||ze,ct),nt=v;break}_t.call(D,Ce,new Uee(D,{sourceEvent:ze,subject:Se,target:z,identifier:Ze,active:nt,x:Re[0]+ue,y:Re[1]+Xt,dx:Re[0]-tt[0],dy:Re[1]-tt[1],dispatch:_t}),oe)}}return z.filter=function(Ce){return arguments.length?(o=typeof Ce=="function"?Ce:PV(!!Ce),z):o},z.container=function(Ce){return arguments.length?(a=typeof Ce=="function"?Ce:PV(Ce),z):a},z.subject=function(Ce){return arguments.length?(c=typeof Ce=="function"?Ce:PV(Ce),z):c},z.touchable=function(Ce){return arguments.length?(d=typeof Ce=="function"?Ce:PV(!!Ce),z):d},z.on=function(){var Ce=p.on.apply(p,arguments);return Ce===p?z:Ce},z.clickDistance=function(Ce){return arguments.length?(I=(Ce=+Ce)*Ce,z):Math.sqrt(I)},z}function qte(o,a,c){o.prototype=a.prototype=c,c.constructor=o}function fue(o,a){var c=Object.create(o.prototype);for(var d in a)c[d]=a[d];return c}function VM(){}var yM=.7,kH=1/yM,kA="\\s*([+-]?\\d+)\\s*",wM="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",p$e=/^#([0-9a-f]{3,8})$/,b$e=new RegExp(`^rgb\\(${kA},${kA},${kA}\\)$`),v$e=new RegExp(`^rgb\\(${pb},${pb},${pb}\\)$`),y$e=new RegExp(`^rgba\\(${kA},${kA},${kA},${wM}\\)$`),w$e=new RegExp(`^rgba\\(${pb},${pb},${pb},${wM}\\)$`),C$e=new RegExp(`^hsl\\(${wM},${pb},${pb}\\)$`),S$e=new RegExp(`^hsla\\(${wM},${pb},${pb},${wM}\\)$`),qre={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};qte(VM,CM,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:Yre,formatHex:Yre,formatHex8:x$e,formatHsl:E$e,formatRgb:Kre,toString:Kre});function Yre(){return this.rgb().formatHex()}function x$e(){return this.rgb().formatHex8()}function E$e(){return mue(this).formatHsl()}function Kre(){return this.rgb().formatRgb()}function CM(o){var a,c;return o=(o+"").trim().toLowerCase(),(a=p$e.exec(o))?(c=a[1].length,a=parseInt(a[1],16),c===6?Xre(a):c===3?new bm(a>>8&15|a>>4&240,a>>4&15|a&240,(a&15)<<4|a&15,1):c===8?IV(a>>24&255,a>>16&255,a>>8&255,(a&255)/255):c===4?IV(a>>12&15|a>>8&240,a>>8&15|a>>4&240,a>>4&15|a&240,((a&15)<<4|a&15)/255):null):(a=b$e.exec(o))?new bm(a[1],a[2],a[3],1):(a=v$e.exec(o))?new bm(a[1]*255/100,a[2]*255/100,a[3]*255/100,1):(a=y$e.exec(o))?IV(a[1],a[2],a[3],a[4]):(a=w$e.exec(o))?IV(a[1]*255/100,a[2]*255/100,a[3]*255/100,a[4]):(a=C$e.exec(o))?eae(a[1],a[2]/100,a[3]/100,1):(a=S$e.exec(o))?eae(a[1],a[2]/100,a[3]/100,a[4]):qre.hasOwnProperty(o)?Xre(qre[o]):o==="transparent"?new bm(NaN,NaN,NaN,0):null}function Xre(o){return new bm(o>>16&255,o>>8&255,o&255,1)}function IV(o,a,c,d){return d<=0&&(o=a=c=NaN),new bm(o,a,c,d)}function _$e(o){return o instanceof VM||(o=CM(o)),o?(o=o.rgb(),new bm(o.r,o.g,o.b,o.opacity)):new bm}function jee(o,a,c,d){return arguments.length===1?_$e(o):new bm(o,a,c,d??1)}function bm(o,a,c,d){this.r=+o,this.g=+a,this.b=+c,this.opacity=+d}qte(bm,jee,fue(VM,{brighter(o){return o=o==null?kH:Math.pow(kH,o),new bm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?yM:Math.pow(yM,o),new bm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new bm(qx(this.r),qx(this.g),qx(this.b),AH(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:Jre,formatHex:Jre,formatHex8:T$e,formatRgb:Qre,toString:Qre}));function Jre(){return`#${Hx(this.r)}${Hx(this.g)}${Hx(this.b)}`}function T$e(){return`#${Hx(this.r)}${Hx(this.g)}${Hx(this.b)}${Hx((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qre(){const o=AH(this.opacity);return`${o===1?"rgb(":"rgba("}${qx(this.r)}, ${qx(this.g)}, ${qx(this.b)}${o===1?")":`, ${o})`}`}function AH(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function qx(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function Hx(o){return o=qx(o),(o<16?"0":"")+o.toString(16)}function eae(o,a,c,d){return d<=0?o=a=c=NaN:c<=0||c>=1?o=a=NaN:a<=0&&(o=NaN),new Ap(o,a,c,d)}function mue(o){if(o instanceof Ap)return new Ap(o.h,o.s,o.l,o.opacity);if(o instanceof VM||(o=CM(o)),!o)return new Ap;if(o instanceof Ap)return o;o=o.rgb();var a=o.r/255,c=o.g/255,d=o.b/255,g=Math.min(a,c,d),p=Math.max(a,c,d),v=NaN,x=p-g,T=(p+g)/2;return x?(a===p?v=(c-d)/x+(c<d)*6:c===p?v=(d-a)/x+2:v=(a-c)/x+4,x/=T<.5?p+g:2-p-g,v*=60):x=T>0&&T<1?0:v,new Ap(v,x,T,o.opacity)}function k$e(o,a,c,d){return arguments.length===1?mue(o):new Ap(o,a,c,d??1)}function Ap(o,a,c,d){this.h=+o,this.s=+a,this.l=+c,this.opacity=+d}qte(Ap,k$e,fue(VM,{brighter(o){return o=o==null?kH:Math.pow(kH,o),new Ap(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?yM:Math.pow(yM,o),new Ap(this.h,this.s,this.l*o,this.opacity)},rgb(){var o=this.h%360+(this.h<0)*360,a=isNaN(o)||isNaN(this.s)?0:this.s,c=this.l,d=c+(c<.5?c:1-c)*a,g=2*c-d;return new bm(UQ(o>=240?o-240:o+120,g,d),UQ(o,g,d),UQ(o<120?o+240:o-120,g,d),this.opacity)},clamp(){return new Ap(tae(this.h),BV(this.s),BV(this.l),AH(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=AH(this.opacity);return`${o===1?"hsl(":"hsla("}${tae(this.h)}, ${BV(this.s)*100}%, ${BV(this.l)*100}%${o===1?")":`, ${o})`}`}}));function tae(o){return o=(o||0)%360,o<0?o+360:o}function BV(o){return Math.max(0,Math.min(1,o||0))}function UQ(o,a,c){return(o<60?a+(c-a)*o/60:o<180?c:o<240?a+(c-a)*(240-o)/60:a)*255}const gue=o=>()=>o;function A$e(o,a){return function(c){return o+c*a}}function O$e(o,a,c){return o=Math.pow(o,c),a=Math.pow(a,c)-o,c=1/c,function(d){return Math.pow(o+d*a,c)}}function N$e(o){return(o=+o)==1?hue:function(a,c){return c-a?O$e(a,c,o):gue(isNaN(a)?c:a)}}function hue(o,a){var c=a-o;return c?A$e(o,c):gue(isNaN(o)?a:o)}const nae=function o(a){var c=N$e(a);function d(g,p){var v=c((g=jee(g)).r,(p=jee(p)).r),x=c(g.g,p.g),T=c(g.b,p.b),A=hue(g.opacity,p.opacity);return function(M){return g.r=v(M),g.g=x(M),g.b=T(M),g.opacity=A(M),g+""}}return d.gamma=o,d}(1);function Vw(o,a){return o=+o,a=+a,function(c){return o*(1-c)+a*c}}var Wee=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,jQ=new RegExp(Wee.source,"g");function $$e(o){return function(){return o}}function D$e(o){return function(a){return o(a)+""}}function M$e(o,a){var c=Wee.lastIndex=jQ.lastIndex=0,d,g,p,v=-1,x=[],T=[];for(o=o+"",a=a+"";(d=Wee.exec(o))&&(g=jQ.exec(a));)(p=g.index)>c&&(p=a.slice(c,p),x[v]?x[v]+=p:x[++v]=p),(d=d[0])===(g=g[0])?x[v]?x[v]+=g:x[++v]=g:(x[++v]=null,T.push({i:v,x:Vw(d,g)})),c=jQ.lastIndex;return c<a.length&&(p=a.slice(c),x[v]?x[v]+=p:x[++v]=p),x.length<2?T[0]?D$e(T[0].x):$$e(a):(a=T.length,function(A){for(var M=0,I;M<a;++M)x[(I=T[M]).i]=I.x(A);return x.join("")})}var oae=180/Math.PI,Zee={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pue(o,a,c,d,g,p){var v,x,T;return(v=Math.sqrt(o*o+a*a))&&(o/=v,a/=v),(T=o*c+a*d)&&(c-=o*T,d-=a*T),(x=Math.sqrt(c*c+d*d))&&(c/=x,d/=x,T/=x),o*d<a*c&&(o=-o,a=-a,T=-T,v=-v),{translateX:g,translateY:p,rotate:Math.atan2(a,o)*oae,skewX:Math.atan(T)*oae,scaleX:v,scaleY:x}}var FV;function R$e(o){const a=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return a.isIdentity?Zee:pue(a.a,a.b,a.c,a.d,a.e,a.f)}function P$e(o){return o==null||(FV||(FV=document.createElementNS("http://www.w3.org/2000/svg","g")),FV.setAttribute("transform",o),!(o=FV.transform.baseVal.consolidate()))?Zee:(o=o.matrix,pue(o.a,o.b,o.c,o.d,o.e,o.f))}function bue(o,a,c,d){function g(A){return A.length?A.pop()+" ":""}function p(A,M,I,z,U,K){if(A!==I||M!==z){var X=U.push("translate(",null,a,null,c);K.push({i:X-4,x:Vw(A,I)},{i:X-2,x:Vw(M,z)})}else(I||z)&&U.push("translate("+I+a+z+c)}function v(A,M,I,z){A!==M?(A-M>180?M+=360:M-A>180&&(A+=360),z.push({i:I.push(g(I)+"rotate(",null,d)-2,x:Vw(A,M)})):M&&I.push(g(I)+"rotate("+M+d)}function x(A,M,I,z){A!==M?z.push({i:I.push(g(I)+"skewX(",null,d)-2,x:Vw(A,M)}):M&&I.push(g(I)+"skewX("+M+d)}function T(A,M,I,z,U,K){if(A!==I||M!==z){var X=U.push(g(U)+"scale(",null,",",null,")");K.push({i:X-4,x:Vw(A,I)},{i:X-2,x:Vw(M,z)})}else(I!==1||z!==1)&&U.push(g(U)+"scale("+I+","+z+")")}return function(A,M){var I=[],z=[];return A=o(A),M=o(M),p(A.translateX,A.translateY,M.translateX,M.translateY,I,z),v(A.rotate,M.rotate,I,z),x(A.skewX,M.skewX,I,z),T(A.scaleX,A.scaleY,M.scaleX,M.scaleY,I,z),A=M=null,function(U){for(var K=-1,X=z.length,Q;++K<X;)I[(Q=z[K]).i]=Q.x(U);return I.join("")}}}var I$e=bue(R$e,"px, ","px)","deg)"),B$e=bue(P$e,", ",")",")"),F$e=1e-12;function sae(o){return((o=Math.exp(o))+1/o)/2}function L$e(o){return((o=Math.exp(o))-1/o)/2}function V$e(o){return((o=Math.exp(2*o))-1)/(o+1)}const H$e=function o(a,c,d){function g(p,v){var x=p[0],T=p[1],A=p[2],M=v[0],I=v[1],z=v[2],U=M-x,K=I-T,X=U*U+K*K,Q,le;if(X<F$e)le=Math.log(z/A)/a,Q=function(oe){return[x+oe*U,T+oe*K,A*Math.exp(a*oe*le)]};else{var ae=Math.sqrt(X),Z=(z*z-A*A+d*X)/(2*A*c*ae),Ce=(z*z-A*A-d*X)/(2*z*c*ae),ct=Math.log(Math.sqrt(Z*Z+1)-Z),Ge=Math.log(Math.sqrt(Ce*Ce+1)-Ce);le=(Ge-ct)/a,Q=function(oe){var Ze=oe*le,yt=sae(ct),_t=A/(c*ae)*(yt*V$e(a*Ze+ct)-L$e(ct));return[x+_t*U,T+_t*K,A*yt/sae(a*Ze+ct)]}}return Q.duration=le*1e3*a/Math.SQRT2,Q}return g.rho=function(p){var v=Math.max(.001,+p),x=v*v,T=x*x;return o(v,x,T)},g}(Math.SQRT2,2,4);var RA=0,X6=0,Y6=0,vue=1e3,OH,J6,NH=0,Qx=0,Tz=0,SM=typeof performance=="object"&&performance.now?performance:Date,yue=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function Yte(){return Qx||(yue(z$e),Qx=SM.now()+Tz)}function z$e(){Qx=0}function $H(){this._call=this._time=this._next=null}$H.prototype=wue.prototype={constructor:$H,restart:function(o,a,c){if(typeof o!="function")throw new TypeError("callback is not a function");c=(c==null?Yte():+c)+(a==null?0:+a),!this._next&&J6!==this&&(J6?J6._next=this:OH=this,J6=this),this._call=o,this._time=c,Gee()},stop:function(){this._call&&(this._call=null,this._time=1/0,Gee())}};function wue(o,a,c){var d=new $H;return d.restart(o,a,c),d}function U$e(){Yte(),++RA;for(var o=OH,a;o;)(a=Qx-o._time)>=0&&o._call.call(void 0,a),o=o._next;--RA}function rae(){Qx=(NH=SM.now())+Tz,RA=X6=0;try{U$e()}finally{RA=0,W$e(),Qx=0}}function j$e(){var o=SM.now(),a=o-NH;a>vue&&(Tz-=a,NH=o)}function W$e(){for(var o,a=OH,c,d=1/0;a;)a._call?(d>a._time&&(d=a._time),o=a,a=a._next):(c=a._next,a._next=null,a=o?o._next=c:OH=c);J6=o,Gee(d)}function Gee(o){if(!RA){X6&&(X6=clearTimeout(X6));var a=o-Qx;a>24?(o<1/0&&(X6=setTimeout(rae,o-SM.now()-Tz)),Y6&&(Y6=clearInterval(Y6))):(Y6||(NH=SM.now(),Y6=setInterval(j$e,vue)),RA=1,yue(rae))}}function aae(o,a,c){var d=new $H;return a=a==null?0:+a,d.restart(g=>{d.stop(),o(g+a)},a,c),d}var Z$e=Ez("start","end","cancel","interrupt"),G$e=[],Cue=0,iae=1,qee=2,oH=3,cae=4,Yee=5,sH=6;function kz(o,a,c,d,g,p){var v=o.__transition;if(!v)o.__transition={};else if(c in v)return;q$e(o,c,{name:a,index:d,group:g,on:Z$e,tween:G$e,time:p.time,delay:p.delay,duration:p.duration,ease:p.ease,timer:null,state:Cue})}function Kte(o,a){var c=$p(o,a);if(c.state>Cue)throw new Error("too late; already scheduled");return c}function Cb(o,a){var c=$p(o,a);if(c.state>oH)throw new Error("too late; already running");return c}function $p(o,a){var c=o.__transition;if(!c||!(c=c[a]))throw new Error("transition not found");return c}function q$e(o,a,c){var d=o.__transition,g;d[a]=c,c.timer=wue(p,0,c.time);function p(A){c.state=iae,c.timer.restart(v,c.delay,c.time),c.delay<=A&&v(A-c.delay)}function v(A){var M,I,z,U;if(c.state!==iae)return T();for(M in d)if(U=d[M],U.name===c.name){if(U.state===oH)return aae(v);U.state===cae?(U.state=sH,U.timer.stop(),U.on.call("interrupt",o,o.__data__,U.index,U.group),delete d[M]):+M<a&&(U.state=sH,U.timer.stop(),U.on.call("cancel",o,o.__data__,U.index,U.group),delete d[M])}if(aae(function(){c.state===oH&&(c.state=cae,c.timer.restart(x,c.delay,c.time),x(A))}),c.state=qee,c.on.call("start",o,o.__data__,c.index,c.group),c.state===qee){for(c.state=oH,g=new Array(z=c.tween.length),M=0,I=-1;M<z;++M)(U=c.tween[M].value.call(o,o.__data__,c.index,c.group))&&(g[++I]=U);g.length=I+1}}function x(A){for(var M=A<c.duration?c.ease.call(null,A/c.duration):(c.timer.restart(T),c.state=Yee,1),I=-1,z=g.length;++I<z;)g[I].call(o,M);c.state===Yee&&(c.on.call("end",o,o.__data__,c.index,c.group),T())}function T(){c.state=sH,c.timer.stop(),delete d[a];for(var A in d)return;delete o.__transition}}function rH(o,a){var c=o.__transition,d,g,p=!0,v;if(c){a=a==null?null:a+"";for(v in c){if((d=c[v]).name!==a){p=!1;continue}g=d.state>qee&&d.state<Yee,d.state=sH,d.timer.stop(),d.on.call(g?"interrupt":"cancel",o,o.__data__,d.index,d.group),delete c[v]}p&&delete o.__transition}}function Y$e(o){return this.each(function(){rH(this,o)})}function K$e(o,a){var c,d;return function(){var g=Cb(this,o),p=g.tween;if(p!==c){d=c=p;for(var v=0,x=d.length;v<x;++v)if(d[v].name===a){d=d.slice(),d.splice(v,1);break}}g.tween=d}}function X$e(o,a,c){var d,g;if(typeof c!="function")throw new Error;return function(){var p=Cb(this,o),v=p.tween;if(v!==d){g=(d=v).slice();for(var x={name:a,value:c},T=0,A=g.length;T<A;++T)if(g[T].name===a){g[T]=x;break}T===A&&g.push(x)}p.tween=g}}function J$e(o,a){var c=this._id;if(o+="",arguments.length<2){for(var d=$p(this.node(),c).tween,g=0,p=d.length,v;g<p;++g)if((v=d[g]).name===o)return v.value;return null}return this.each((a==null?K$e:X$e)(c,o,a))}function Xte(o,a,c){var d=o._id;return o.each(function(){var g=Cb(this,d);(g.value||(g.value={}))[a]=c.apply(this,arguments)}),function(g){return $p(g,d).value[a]}}function Sue(o,a){var c;return(typeof a=="number"?Vw:a instanceof CM?nae:(c=CM(a))?(a=c,nae):M$e)(o,a)}function Q$e(o){return function(){this.removeAttribute(o)}}function eDe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function tDe(o,a,c){var d,g=c+"",p;return function(){var v=this.getAttribute(o);return v===g?null:v===d?p:p=a(d=v,c)}}function nDe(o,a,c){var d,g=c+"",p;return function(){var v=this.getAttributeNS(o.space,o.local);return v===g?null:v===d?p:p=a(d=v,c)}}function oDe(o,a,c){var d,g,p;return function(){var v,x=c(this),T;return x==null?void this.removeAttribute(o):(v=this.getAttribute(o),T=x+"",v===T?null:v===d&&T===g?p:(g=T,p=a(d=v,x)))}}function sDe(o,a,c){var d,g,p;return function(){var v,x=c(this),T;return x==null?void this.removeAttributeNS(o.space,o.local):(v=this.getAttributeNS(o.space,o.local),T=x+"",v===T?null:v===d&&T===g?p:(g=T,p=a(d=v,x)))}}function rDe(o,a){var c=_z(o),d=c==="transform"?B$e:Sue;return this.attrTween(o,typeof a=="function"?(c.local?sDe:oDe)(c,d,Xte(this,"attr."+o,a)):a==null?(c.local?eDe:Q$e)(c):(c.local?nDe:tDe)(c,d,a))}function aDe(o,a){return function(c){this.setAttribute(o,a.call(this,c))}}function iDe(o,a){return function(c){this.setAttributeNS(o.space,o.local,a.call(this,c))}}function cDe(o,a){var c,d;function g(){var p=a.apply(this,arguments);return p!==d&&(c=(d=p)&&iDe(o,p)),c}return g._value=a,g}function lDe(o,a){var c,d;function g(){var p=a.apply(this,arguments);return p!==d&&(c=(d=p)&&aDe(o,p)),c}return g._value=a,g}function uDe(o,a){var c="attr."+o;if(arguments.length<2)return(c=this.tween(c))&&c._value;if(a==null)return this.tween(c,null);if(typeof a!="function")throw new Error;var d=_z(o);return this.tween(c,(d.local?cDe:lDe)(d,a))}function dDe(o,a){return function(){Kte(this,o).delay=+a.apply(this,arguments)}}function fDe(o,a){return a=+a,function(){Kte(this,o).delay=a}}function mDe(o){var a=this._id;return arguments.length?this.each((typeof o=="function"?dDe:fDe)(a,o)):$p(this.node(),a).delay}function gDe(o,a){return function(){Cb(this,o).duration=+a.apply(this,arguments)}}function hDe(o,a){return a=+a,function(){Cb(this,o).duration=a}}function pDe(o){var a=this._id;return arguments.length?this.each((typeof o=="function"?gDe:hDe)(a,o)):$p(this.node(),a).duration}function bDe(o,a){if(typeof a!="function")throw new Error;return function(){Cb(this,o).ease=a}}function vDe(o){var a=this._id;return arguments.length?this.each(bDe(a,o)):$p(this.node(),a).ease}function yDe(o,a){return function(){var c=a.apply(this,arguments);if(typeof c!="function")throw new Error;Cb(this,o).ease=c}}function wDe(o){if(typeof o!="function")throw new Error;return this.each(yDe(this._id,o))}function CDe(o){typeof o!="function"&&(o=eue(o));for(var a=this._groups,c=a.length,d=new Array(c),g=0;g<c;++g)for(var p=a[g],v=p.length,x=d[g]=[],T,A=0;A<v;++A)(T=p[A])&&o.call(T,T.__data__,A,p)&&x.push(T);return new S0(d,this._parents,this._name,this._id)}function SDe(o){if(o._id!==this._id)throw new Error;for(var a=this._groups,c=o._groups,d=a.length,g=c.length,p=Math.min(d,g),v=new Array(d),x=0;x<p;++x)for(var T=a[x],A=c[x],M=T.length,I=v[x]=new Array(M),z,U=0;U<M;++U)(z=T[U]||A[U])&&(I[U]=z);for(;x<d;++x)v[x]=a[x];return new S0(v,this._parents,this._name,this._id)}function xDe(o){return(o+"").trim().split(/^|\s+/).every(function(a){var c=a.indexOf(".");return c>=0&&(a=a.slice(0,c)),!a||a==="start"})}function EDe(o,a,c){var d,g,p=xDe(a)?Kte:Cb;return function(){var v=p(this,o),x=v.on;x!==d&&(g=(d=x).copy()).on(a,c),v.on=g}}function _De(o,a){var c=this._id;return arguments.length<2?$p(this.node(),c).on.on(o):this.each(EDe(c,o,a))}function TDe(o){return function(){var a=this.parentNode;for(var c in this.__transition)if(+c!==o)return;a&&a.removeChild(this)}}function kDe(){return this.on("end.remove",TDe(this._id))}function ADe(o){var a=this._name,c=this._id;typeof o!="function"&&(o=Zte(o));for(var d=this._groups,g=d.length,p=new Array(g),v=0;v<g;++v)for(var x=d[v],T=x.length,A=p[v]=new Array(T),M,I,z=0;z<T;++z)(M=x[z])&&(I=o.call(M,M.__data__,z,x))&&("__data__"in M&&(I.__data__=M.__data__),A[z]=I,kz(A[z],a,c,z,A,$p(M,c)));return new S0(p,this._parents,a,c)}function ODe(o){var a=this._name,c=this._id;typeof o!="function"&&(o=Qle(o));for(var d=this._groups,g=d.length,p=[],v=[],x=0;x<g;++x)for(var T=d[x],A=T.length,M,I=0;I<A;++I)if(M=T[I]){for(var z=o.call(M,M.__data__,I,T),U,K=$p(M,c),X=0,Q=z.length;X<Q;++X)(U=z[X])&&kz(U,a,c,X,z,K);p.push(z),v.push(M)}return new S0(p,v,a,c)}var NDe=LM.prototype.constructor;function $De(){return new NDe(this._groups,this._parents)}function DDe(o,a){var c,d,g;return function(){var p=MA(this,o),v=(this.style.removeProperty(o),MA(this,o));return p===v?null:p===c&&v===d?g:g=a(c=p,d=v)}}function xue(o){return function(){this.style.removeProperty(o)}}function MDe(o,a,c){var d,g=c+"",p;return function(){var v=MA(this,o);return v===g?null:v===d?p:p=a(d=v,c)}}function RDe(o,a,c){var d,g,p;return function(){var v=MA(this,o),x=c(this),T=x+"";return x==null&&(T=x=(this.style.removeProperty(o),MA(this,o))),v===T?null:v===d&&T===g?p:(g=T,p=a(d=v,x))}}function PDe(o,a){var c,d,g,p="style."+a,v="end."+p,x;return function(){var T=Cb(this,o),A=T.on,M=T.value[p]==null?x||(x=xue(a)):void 0;(A!==c||g!==M)&&(d=(c=A).copy()).on(v,g=M),T.on=d}}function IDe(o,a,c){var d=(o+="")=="transform"?I$e:Sue;return a==null?this.styleTween(o,DDe(o,d)).on("end.style."+o,xue(o)):typeof a=="function"?this.styleTween(o,RDe(o,d,Xte(this,"style."+o,a))).each(PDe(this._id,o)):this.styleTween(o,MDe(o,d,a),c).on("end.style."+o,null)}function BDe(o,a,c){return function(d){this.style.setProperty(o,a.call(this,d),c)}}function FDe(o,a,c){var d,g;function p(){var v=a.apply(this,arguments);return v!==g&&(d=(g=v)&&BDe(o,v,c)),d}return p._value=a,p}function LDe(o,a,c){var d="style."+(o+="");if(arguments.length<2)return(d=this.tween(d))&&d._value;if(a==null)return this.tween(d,null);if(typeof a!="function")throw new Error;return this.tween(d,FDe(o,a,c??""))}function VDe(o){return function(){this.textContent=o}}function HDe(o){return function(){var a=o(this);this.textContent=a??""}}function zDe(o){return this.tween("text",typeof o=="function"?HDe(Xte(this,"text",o)):VDe(o==null?"":o+""))}function UDe(o){return function(a){this.textContent=o.call(this,a)}}function jDe(o){var a,c;function d(){var g=o.apply(this,arguments);return g!==c&&(a=(c=g)&&UDe(g)),a}return d._value=o,d}function WDe(o){var a="text";if(arguments.length<1)return(a=this.tween(a))&&a._value;if(o==null)return this.tween(a,null);if(typeof o!="function")throw new Error;return this.tween(a,jDe(o))}function ZDe(){for(var o=this._name,a=this._id,c=Eue(),d=this._groups,g=d.length,p=0;p<g;++p)for(var v=d[p],x=v.length,T,A=0;A<x;++A)if(T=v[A]){var M=$p(T,a);kz(T,o,c,A,v,{time:M.time+M.delay+M.duration,delay:0,duration:M.duration,ease:M.ease})}return new S0(d,this._parents,o,c)}function GDe(){var o,a,c=this,d=c._id,g=c.size();return new Promise(function(p,v){var x={value:v},T={value:function(){--g===0&&p()}};c.each(function(){var A=Cb(this,d),M=A.on;M!==o&&(a=(o=M).copy(),a._.cancel.push(x),a._.interrupt.push(x),a._.end.push(T)),A.on=a}),g===0&&p()})}var qDe=0;function S0(o,a,c,d){this._groups=o,this._parents=a,this._name=c,this._id=d}function Eue(){return++qDe}var g0=LM.prototype;S0.prototype={constructor:S0,select:ADe,selectAll:ODe,selectChild:g0.selectChild,selectChildren:g0.selectChildren,filter:CDe,merge:SDe,selection:$De,transition:ZDe,call:g0.call,nodes:g0.nodes,node:g0.node,size:g0.size,empty:g0.empty,each:g0.each,on:_De,attr:rDe,attrTween:uDe,style:IDe,styleTween:LDe,text:zDe,textTween:WDe,remove:kDe,tween:J$e,delay:mDe,duration:pDe,ease:vDe,easeVarying:wDe,end:GDe,[Symbol.iterator]:g0[Symbol.iterator]};function YDe(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var KDe={time:null,delay:0,duration:250,ease:YDe};function XDe(o,a){for(var c;!(c=o.__transition)||!(c=c[a]);)if(!(o=o.parentNode))throw new Error(`transition ${a} not found`);return c}function JDe(o){var a,c;o instanceof S0?(a=o._id,o=o._name):(a=Eue(),(c=KDe).time=Yte(),o=o==null?null:o+"");for(var d=this._groups,g=d.length,p=0;p<g;++p)for(var v=d[p],x=v.length,T,A=0;A<x;++A)(T=v[A])&&kz(T,o,a,A,v,c||XDe(T,a));return new S0(d,this._parents,o,a)}LM.prototype.interrupt=Y$e;LM.prototype.transition=JDe;const LV=o=>()=>o;function QDe(o,{sourceEvent:a,target:c,transform:d,dispatch:g}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:a,enumerable:!0,configurable:!0},target:{value:c,enumerable:!0,configurable:!0},transform:{value:d,enumerable:!0,configurable:!0},_:{value:g}})}function v0(o,a,c){this.k=o,this.x=a,this.y=c}v0.prototype={constructor:v0,scale:function(o){return o===1?this:new v0(this.k*o,this.x,this.y)},translate:function(o,a){return o===0&a===0?this:new v0(this.k,this.x+this.k*o,this.y+this.k*a)},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 PA=new v0(1,0,0);v0.prototype;function WQ(o){o.stopImmediatePropagation()}function K6(o){o.preventDefault(),o.stopImmediatePropagation()}function e6e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function t6e(){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 lae(){return this.__zoom||PA}function n6e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function o6e(){return navigator.maxTouchPoints||"ontouchstart"in this}function s6e(o,a,c){var d=o.invertX(a[0][0])-c[0][0],g=o.invertX(a[1][0])-c[1][0],p=o.invertY(a[0][1])-c[0][1],v=o.invertY(a[1][1])-c[1][1];return o.translate(g>d?(d+g)/2:Math.min(0,d)||Math.max(0,g),v>p?(p+v)/2:Math.min(0,p)||Math.max(0,v))}function r6e(){var o=e6e,a=t6e,c=s6e,d=n6e,g=o6e,p=[0,1/0],v=[[-1/0,-1/0],[1/0,1/0]],x=250,T=H$e,A=Ez("start","zoom","end"),M,I,z,U=500,K=150,X=0,Q=10;function le(Se){Se.property("__zoom",lae).on("wheel.zoom",Ze,{passive:!1}).on("mousedown.zoom",yt).on("dblclick.zoom",_t).filter(g).on("touchstart.zoom",Re).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",Xt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}le.transform=function(Se,Ie,D,ze){var be=Se.selection?Se.selection():Se;be.property("__zoom",lae),Se!==be?ct(Se,Ie,D,ze):be.interrupt().each(function(){Ge(this,arguments).event(ze).start().zoom(null,typeof Ie=="function"?Ie.apply(this,arguments):Ie).end()})},le.scaleBy=function(Se,Ie,D,ze){le.scaleTo(Se,function(){var be=this.__zoom.k,tt=typeof Ie=="function"?Ie.apply(this,arguments):Ie;return be*tt},D,ze)},le.scaleTo=function(Se,Ie,D,ze){le.transform(Se,function(){var be=a.apply(this,arguments),tt=this.__zoom,nt=D==null?Ce(be):typeof D=="function"?D.apply(this,arguments):D,ge=tt.invert(nt),je=typeof Ie=="function"?Ie.apply(this,arguments):Ie;return c(Z(ae(tt,je),nt,ge),be,v)},D,ze)},le.translateBy=function(Se,Ie,D,ze){le.transform(Se,function(){return c(this.__zoom.translate(typeof Ie=="function"?Ie.apply(this,arguments):Ie,typeof D=="function"?D.apply(this,arguments):D),a.apply(this,arguments),v)},null,ze)},le.translateTo=function(Se,Ie,D,ze,be){le.transform(Se,function(){var tt=a.apply(this,arguments),nt=this.__zoom,ge=ze==null?Ce(tt):typeof ze=="function"?ze.apply(this,arguments):ze;return c(PA.translate(ge[0],ge[1]).scale(nt.k).translate(typeof Ie=="function"?-Ie.apply(this,arguments):-Ie,typeof D=="function"?-D.apply(this,arguments):-D),tt,v)},ze,be)};function ae(Se,Ie){return Ie=Math.max(p[0],Math.min(p[1],Ie)),Ie===Se.k?Se:new v0(Ie,Se.x,Se.y)}function Z(Se,Ie,D){var ze=Ie[0]-D[0]*Se.k,be=Ie[1]-D[1]*Se.k;return ze===Se.x&&be===Se.y?Se:new v0(Se.k,ze,be)}function Ce(Se){return[(+Se[0][0]+ +Se[1][0])/2,(+Se[0][1]+ +Se[1][1])/2]}function ct(Se,Ie,D,ze){Se.on("start.zoom",function(){Ge(this,arguments).event(ze).start()}).on("interrupt.zoom end.zoom",function(){Ge(this,arguments).event(ze).end()}).tween("zoom",function(){var be=this,tt=arguments,nt=Ge(be,tt).event(ze),ge=a.apply(be,tt),je=D==null?Ce(ge):typeof D=="function"?D.apply(be,tt):D,kt=Math.max(ge[1][0]-ge[0][0],ge[1][1]-ge[0][1]),Ve=be.__zoom,ht=typeof Ie=="function"?Ie.apply(be,tt):Ie,De=T(Ve.invert(je).concat(kt/Ve.k),ht.invert(je).concat(kt/ht.k));return function(ut){if(ut===1)ut=ht;else{var ee=De(ut),gn=kt/ee[2];ut=new v0(gn,je[0]-ee[0]*gn,je[1]-ee[1]*gn)}nt.zoom(null,ut)}})}function Ge(Se,Ie,D){return!D&&Se.__zooming||new oe(Se,Ie)}function oe(Se,Ie){this.that=Se,this.args=Ie,this.active=0,this.sourceEvent=null,this.extent=a.apply(Se,Ie),this.taps=0}oe.prototype={event:function(Se){return Se&&(this.sourceEvent=Se),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(Se,Ie){return this.mouse&&Se!=="mouse"&&(this.mouse[1]=Ie.invert(this.mouse[0])),this.touch0&&Se!=="touch"&&(this.touch0[1]=Ie.invert(this.touch0[0])),this.touch1&&Se!=="touch"&&(this.touch1[1]=Ie.invert(this.touch1[0])),this.that.__zoom=Ie,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(Se){var Ie=kp(this.that).datum();A.call(Se,this.that,new QDe(Se,{sourceEvent:this.sourceEvent,target:le,type:Se,transform:this.that.__zoom,dispatch:A}),Ie)}};function Ze(Se,...Ie){if(!o.apply(this,arguments))return;var D=Ge(this,Ie).event(Se),ze=this.__zoom,be=Math.max(p[0],Math.min(p[1],ze.k*Math.pow(2,d.apply(this,arguments)))),tt=gb(Se);if(D.wheel)(D.mouse[0][0]!==tt[0]||D.mouse[0][1]!==tt[1])&&(D.mouse[1]=ze.invert(D.mouse[0]=tt)),clearTimeout(D.wheel);else{if(ze.k===be)return;D.mouse=[tt,ze.invert(tt)],rH(this),D.start()}K6(Se),D.wheel=setTimeout(nt,K),D.zoom("mouse",c(Z(ae(ze,be),D.mouse[0],D.mouse[1]),D.extent,v));function nt(){D.wheel=null,D.end()}}function yt(Se,...Ie){if(z||!o.apply(this,arguments))return;var D=Se.currentTarget,ze=Ge(this,Ie,!0).event(Se),be=kp(Se.view).on("mousemove.zoom",je,!0).on("mouseup.zoom",kt,!0),tt=gb(Se,D),nt=Se.clientX,ge=Se.clientY;uue(Se.view),WQ(Se),ze.mouse=[tt,this.__zoom.invert(tt)],rH(this),ze.start();function je(Ve){if(K6(Ve),!ze.moved){var ht=Ve.clientX-nt,De=Ve.clientY-ge;ze.moved=ht*ht+De*De>X}ze.event(Ve).zoom("mouse",c(Z(ze.that.__zoom,ze.mouse[0]=gb(Ve,D),ze.mouse[1]),ze.extent,v))}function kt(Ve){be.on("mousemove.zoom mouseup.zoom",null),due(Ve.view,ze.moved),K6(Ve),ze.event(Ve).end()}}function _t(Se,...Ie){if(o.apply(this,arguments)){var D=this.__zoom,ze=gb(Se.changedTouches?Se.changedTouches[0]:Se,this),be=D.invert(ze),tt=D.k*(Se.shiftKey?.5:2),nt=c(Z(ae(D,tt),ze,be),a.apply(this,Ie),v);K6(Se),x>0?kp(this).transition().duration(x).call(ct,nt,ze,Se):kp(this).call(le.transform,nt,ze,Se)}}function Re(Se,...Ie){if(o.apply(this,arguments)){var D=Se.touches,ze=D.length,be=Ge(this,Ie,Se.changedTouches.length===ze).event(Se),tt,nt,ge,je;for(WQ(Se),nt=0;nt<ze;++nt)ge=D[nt],je=gb(ge,this),je=[je,this.__zoom.invert(je),ge.identifier],be.touch0?!be.touch1&&be.touch0[2]!==je[2]&&(be.touch1=je,be.taps=0):(be.touch0=je,tt=!0,be.taps=1+!!M);M&&(M=clearTimeout(M)),tt&&(be.taps<2&&(I=je[0],M=setTimeout(function(){M=null},U)),rH(this),be.start())}}function ue(Se,...Ie){if(this.__zooming){var D=Ge(this,Ie).event(Se),ze=Se.changedTouches,be=ze.length,tt,nt,ge,je;for(K6(Se),tt=0;tt<be;++tt)nt=ze[tt],ge=gb(nt,this),D.touch0&&D.touch0[2]===nt.identifier?D.touch0[0]=ge:D.touch1&&D.touch1[2]===nt.identifier&&(D.touch1[0]=ge);if(nt=D.that.__zoom,D.touch1){var kt=D.touch0[0],Ve=D.touch0[1],ht=D.touch1[0],De=D.touch1[1],ut=(ut=ht[0]-kt[0])*ut+(ut=ht[1]-kt[1])*ut,ee=(ee=De[0]-Ve[0])*ee+(ee=De[1]-Ve[1])*ee;nt=ae(nt,Math.sqrt(ut/ee)),ge=[(kt[0]+ht[0])/2,(kt[1]+ht[1])/2],je=[(Ve[0]+De[0])/2,(Ve[1]+De[1])/2]}else if(D.touch0)ge=D.touch0[0],je=D.touch0[1];else return;D.zoom("touch",c(Z(nt,ge,je),D.extent,v))}}function Xt(Se,...Ie){if(this.__zooming){var D=Ge(this,Ie).event(Se),ze=Se.changedTouches,be=ze.length,tt,nt;for(WQ(Se),z&&clearTimeout(z),z=setTimeout(function(){z=null},U),tt=0;tt<be;++tt)nt=ze[tt],D.touch0&&D.touch0[2]===nt.identifier?delete D.touch0:D.touch1&&D.touch1[2]===nt.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(nt=gb(nt,this),Math.hypot(I[0]-nt[0],I[1]-nt[1])<Q)){var ge=kp(this).on("dblclick.zoom");ge&&ge.apply(this,arguments)}}}return le.wheelDelta=function(Se){return arguments.length?(d=typeof Se=="function"?Se:LV(+Se),le):d},le.filter=function(Se){return arguments.length?(o=typeof Se=="function"?Se:LV(!!Se),le):o},le.touchable=function(Se){return arguments.length?(g=typeof Se=="function"?Se:LV(!!Se),le):g},le.extent=function(Se){return arguments.length?(a=typeof Se=="function"?Se:LV([[+Se[0][0],+Se[0][1]],[+Se[1][0],+Se[1][1]]]),le):a},le.scaleExtent=function(Se){return arguments.length?(p[0]=+Se[0],p[1]=+Se[1],le):[p[0],p[1]]},le.translateExtent=function(Se){return arguments.length?(v[0][0]=+Se[0][0],v[1][0]=+Se[1][0],v[0][1]=+Se[0][1],v[1][1]=+Se[1][1],le):[[v[0][0],v[0][1]],[v[1][0],v[1][1]]]},le.constrain=function(Se){return arguments.length?(c=Se,le):c},le.duration=function(Se){return arguments.length?(x=+Se,le):x},le.interpolate=function(Se){return arguments.length?(T=Se,le):T},le.on=function(){var Se=A.on.apply(A,arguments);return Se===A?le:Se},le.clickDistance=function(Se){return arguments.length?(X=(Se=+Se)*Se,le):Math.sqrt(X)},le.tapDistance=function(Se){return arguments.length?(Q=+Se,le):Q},le}var ss=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(ss||{}),Jte=(o=>(o.Partial="partial",o.Full="full",o))(Jte||{}),Bx=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(Bx||{}),qw=(o=>(o.Strict="strict",o.Loose="loose",o))(qw||{}),DH=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(DH||{}),rM=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(rM||{}),_ue=(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))(_ue||{});const a6e=["INPUT","SELECT","TEXTAREA"];function Kee(o){var a,c;const d=((c=(a=o.composedPath)==null?void 0:a.call(o))==null?void 0:c[0])||o.target,g=typeof(d==null?void 0:d.hasAttribute)=="function"?d.hasAttribute("contenteditable"):!1,p=typeof(d==null?void 0:d.closest)=="function"?d.closest(".nokey"):null;return a6e.includes(d==null?void 0:d.nodeName)||g||!!p}function i6e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function uae(o,a,c,d){const g=a.replace("+",`
|
|
112
|
+
`));return ue(ce.split(""),d).length},tt=(Y,re)=>{const ce=Ie(Y,re).join("");return ze(ce)},nt=(Y,re)=>{const ce=Ie(Y,re).join("").replace(/\s/g,"");return ze(ce)},ge=(Y,re)=>()=>re(Y.getBody(),Y.schema),je=(Y,re)=>()=>re(Y.selection.getRng().cloneContents(),Y.schema),kt=Y=>ge(Y,be),Ve=Y=>({body:{getWordCount:kt(Y),getCharacterCount:ge(Y,tt),getCharacterCountWithoutSpaces:ge(Y,nt)},selection:{getWordCount:je(Y,be),getCharacterCount:je(Y,tt),getCharacterCountWithoutSpaces:je(Y,nt)},getCount:kt(Y)}),ht=(Y,re)=>{Y.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(re.body.getWordCount()),String(re.selection.getWordCount())],["Characters (no spaces)",String(re.body.getCharacterCountWithoutSpaces()),String(re.selection.getCharacterCountWithoutSpaces())],["Characters",String(re.body.getCharacterCount()),String(re.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},De=(Y,re)=>{Y.addCommand("mceWordCount",()=>ht(Y,re))},ut=(Y,re)=>{let ce=null;return{cancel:()=>{c(ce)||(clearTimeout(ce),ce=null)},throttle:(...Ne)=>{c(ce)&&(ce=setTimeout(()=>{ce=null,Y.apply(null,Ne)},re))}}};var ee=tinymce.util.Tools.resolve("tinymce.util.Delay");const gn=(Y,re)=>{Y.dispatch("wordCountUpdate",{wordCount:{words:re.body.getWordCount(),characters:re.body.getCharacterCount(),charactersWithoutSpaces:re.body.getCharacterCountWithoutSpaces()}})},mt=(Y,re)=>{gn(Y,re)},Ct=(Y,re,ce)=>{const W=ut(()=>mt(Y,re),ce);Y.on("init",()=>{mt(Y,re),ee.setEditorTimeout(Y,()=>{Y.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",W.throttle)},0),Y.on("remove",W.cancel)})},Ut=Y=>{const re=()=>Y.execCommand("mceWordCount");Y.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:re,context:"any"}),Y.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:re,context:"any"})};var wt=(Y=300)=>{o.add("wordcount",re=>{const ce=Ve(re);return De(re,ce),Ut(re),Ct(re,ce,Y),ce})};wt()})();const g4e=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),h4e=(o,a="wps_office")=>{const c=o.split(","),d=c[0].match(/:(.*?);/)[1],g=atob(c[1]);let p=g.length;const v=new Uint8Array(p);for(;p--;)v[p]=g.charCodeAt(p);return new File([v],a,{type:d})},p4e=o=>btoa(o.match(/\w{2}/g).map(a=>String.fromCharCode(parseInt(a,16))).join(""));function b4e(o){if(!o)return[];let a=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,c=new RegExp(`(?:(${a.source}))([\\da-fA-F\\s]+)\\}`,"g"),d=o.match(c);console.log("images",d);const g=[];if(d||(a=/{\\pict[\s\S]+?(\\pngblip-?\d+)?(\\wmetafile8-?\d+)?{\\\*\\blipuid\s?[\da-fA-F]+[\s}]*?/,c=new RegExp(`(?:(${a.source}))([\\da-fA-F\\s]+)\\}`,"g"),d=o.match(c)),d)for(const p of d){let v=!1;if(p.includes("\\pngblip")?v="image/png":p.includes("\\jpegblip")&&(v="image/jpeg"),v){const x=p.replace(a,"").replace(/[^\da-fA-F]/g,""),T=`data:${v};base64,${p4e(x)}`;g.push({base64:T,file:h4e(T)})}}return g}const v4e=(o,a)=>{if(!a)return o;try{const d=new DOMParser().parseFromString(o,"text/html"),g=d.querySelectorAll("img"),v=(a.clipboardData||window.Clipboard).getData("text/rtf"),x=b4e(v);return g.forEach((T,A)=>{var I;const M=T.getAttribute("src");if(M&&M.startsWith("file:")&&(I=x==null?void 0:x[A])!=null&&I.base64){const z=x[A].base64;T.setAttribute("src",z)}}),d.body.innerHTML}catch{return o}},y4e=o=>{const a=atob(o.split(",")[1]),c=o.split(",")[0].split(":")[1].split(";")[0],d=new ArrayBuffer(a.length),g=new Uint8Array(d);for(let p=0;p<a.length;p++)g[p]=a.charCodeAt(p);return new Blob([d],{type:c})},w4e=async o=>{try{const a=y4e(o),c=new FormData;c.append("files",a,"image.png");const g=await(await fetch("/api/ajax/uploaddoc",{method:"POST",body:c})).json();if(g.status===1)return g.file_url;throw new Error(g.message)}catch(a){throw a}},C4e=async o=>{const c=new DOMParser().parseFromString(o,"text/html"),d=c.getElementsByTagName("img"),g=[],p=3;for(let v=0;v<d.length;v++){const x=d[v],T=x.getAttribute("src");T&&T.startsWith("data:image")&&(g.push({img:x,src:T,width:x.getAttribute("width"),height:x.getAttribute("height")}),g[g.length-1].width&&x.setAttribute("width",g[g.length-1].width),g[g.length-1].height&&x.setAttribute("height",g[g.length-1].height))}for(let v=0;v<g.length;v+=p){const T=g.slice(v,v+p).map(async A=>{try{const M=await w4e(A.src);A.img.setAttribute("src",M)}catch{A.img.remove()}});await Promise.all(T)}return c.body.innerHTML},S4e=o=>{o.querySelectorAll("td").forEach(c=>{const d=c.getAttribute("width"),g=c.getAttribute("style")||"";d==="0"&&g.includes("border:none")&&c.remove()})},x4e=o=>{o.querySelectorAll("table").forEach(c=>{c.style.maxWidth="100%"})},E4e=o=>{o.querySelectorAll("table").forEach(c=>{const d=c.querySelectorAll("td");let g=!1,p="";for(const v of d){const x=v.getAttribute("style")||"",T=x.match(/border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i)||x.match(/border(?:-(?:right|left|top|bottom))?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i);(T?T[0]:"").includes("double")&&(g=!0,T&&(p=T[0].replace(/^border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*/,""),v.style.borderTop=p,v.style.borderRight=p,v.style.borderBottom=p,v.style.borderLeft=p))}g&&p&&(c.style.borderCollapse="separate",c.style.borderSpacing="2px",c.style.border=p)})},_4e=o=>{o.querySelectorAll("table").forEach(c=>{c.querySelectorAll("td[rowspan]").forEach(g=>{const x=((g.getAttribute("style")||"").match(/border-[^:]+:[^;]+(?:solid|double)[^;]+/g)||[]).find(T=>!T.includes("none"));if(x){const T=x.split(":")[1].trim();g.style.borderBottom=T}})})},T4e=o=>{o.querySelectorAll('[style*="mso-"]').forEach(c=>{const g=(c.getAttribute("style")||"").replace(/mso-[^:]+:[^;]+;/g,"");c.setAttribute("style",g)})},k4e=o=>{o.querySelectorAll('[style*="tab-stops"]').forEach(c=>{const g=(c.getAttribute("style")||"").replace(/tab-stops:[^;]+;/g,"");c.setAttribute("style",g)})},A4e=o=>{o=o.replace(/<a(?!.*?href=)[^>]*>([\s\S]*?)<\/a>/gi,"$1");const c=new DOMParser().parseFromString(o,"text/html");return S4e(c),x4e(c),E4e(c),_4e(c),T4e(c),k4e(c),o=c.body.innerHTML,o};_H.PluginManager.add("pasteprocess",o=>(o.on("paste",a=>{if(a.clipboardData){const c=a.clipboardData.getData("text/html")||a.clipboardData.getData("text");if(g4e(c)){a.preventDefault();const d=o.windowManager.open({title:"处理中",body:{type:"panel",items:[{type:"htmlpanel",html:'<div style="text-align: center; padding: 20px;">正在处理Word内容,请稍候...</div>'}]},buttons:[]}),g=A4e(c),p=v4e(g,a);C4e(p).then(v=>{o.insertContent(v),d.close()})}}}),{}));let RV="A4";const Bee={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}},O4e=Object.keys(Bee).map(o=>`pagesize${o}`).join(" ");_H.PluginManager.add("pagesize",o=>{const a=o.options.register;a("pagesize",{processor:"string",default:"A4"}),RV=(g=>p=>p.options.get(g))("pagesize")(o);const d=g=>{const p=Bee[g];if(p){const v=(window.devicePixelRatio||1)*96,x=p.width*v/25.4;o!=null&&o.container&&(o.container.style.minWidth=`${x}px`);const T=o.contentAreaContainer.querySelector("iframe");T&&(T.style.width=`${x}px`),o.fire("pagesizechange",{size:g})}};return Object.keys(Bee).forEach(g=>{o.ui.registry.addToggleMenuItem(`pagesize${g}`,{text:g,onAction:()=>{RV=g,d(g)},onSetup:p=>(p.setActive(RV===g),()=>{})})}),o.on("init",()=>{d(RV)}),{}});const N4e=["accordion","advlist","anchor","autolink","autosave","charmap","directionality","importcss","insertdatetime","lists","image","media","pagebreak","preview","save","searchreplace","table","fullscreen","wordcount","pasteprocess","pagesize"],$4e="undo redo | blocks bold italic forecolor removeformat alignleft aligncenter alignright alignjustify outdent indent pagebreakfullscreen preview",D4e={license_key:"gpl",skin:!1,content_css:["./content.css","./reset.css"],promotion:!1,menu:{pagesize:{title:"页面大小",items:O4e}},menubar:"file edit insert table tools help pagesize",cleanup:!0,branding:!1,language:"zh_CN",plugins:N4e,toolbar:$4e,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((a,c)=>{const d=new FormData;d.append("files",o.blob(),o.filename()),fetch("/api/ajax/uploaddoc",{method:"POST",body:d}).then(g=>g.json()).then(g=>{g.status===1?a(g.file_url):c(`上传失败: ${g.message}`)}).catch(g=>{c(`上传出错: ${g.message}`)})})},M4e={name:"ProEditor",components:{Editor:f4e},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:a}){const c=w.reactive({myInit:g(D4e),contentValue:o.modelValue,timeout:null});w.onMounted(()=>{_H.init({license_key:"gpl"}),_H.activeEditor.on("pagesizechange",p=>{a("update:pagesize",p.size)})}),w.watch(()=>c.contentValue,()=>{d(()=>{a("update:modelValue",c.contentValue)})}),w.watch(()=>o.modelValue,p=>{p&&p!==c.contentValue&&(c.contentValue=p)});function d(p,v=400){c.timeout!==null&&clearTimeout(c.timeout),c.timeout=setTimeout(p,v)}function g(p){o!=null&&o.height&&(p.height=o.height),o!=null&&o.width&&(p.width=o.width);const{placeholder:v,pagesize:x}=o;return p={...p,placeholder:v,...o.hasPagesize&&{menu:{...p.menu,pagesize:p.menu.pagesize},menubar:p.menubar.includes("pagesize")?p.menubar:`${p.menubar} pagesize`,pagesize:x},...!o.hasPagesize&&{menu:Object.fromEntries(Object.entries(p.menu).filter(([T])=>T!=="pagesize")),menubar:p.menubar.replace(/pagesize/g,"").trim(),pagesize:""}},p}return{...w.toRefs(c),customer:g,debounce:d}}},R4e={class:"my-tinymce"};function P4e(o,a,c,d,g,p){const v=w.resolveComponent("Editor");return w.openBlock(),w.createElementBlock("div",R4e,[w.createVNode(v,{modelValue:o.contentValue,"onUpdate:modelValue":a[0]||(a[0]=x=>o.contentValue=x),init:o.myInit},null,8,["modelValue","init"])])}const Mle=cu(M4e,[["render",P4e]]),I4e={name:"ShadowDomWrap",setup(o,{emit:a,expose:c}){const d=w.ref(null),g=w.ref(),p=w.ref(!1),v=T=>{if(!d.value)return;const A=d.value.contains(T.target);!A&&p.value?(p.value=!1,a("onBlur")):A&&!p.value&&(p.value=!0)},x=T=>{T.stopPropagation(),p.value||(p.value=!0,a("onFocus"))};return w.onMounted(()=>{var M,I,z;g.value=(M=d.value)==null?void 0:M.attachShadow({mode:"open"}),document.addEventListener("click",v);const T=document.createElement("link");T.rel="stylesheet",T.href=`${location==null?void 0:location.origin}/css/index.min.css`,(I=g.value)==null||I.appendChild(T);const A=document.createElement("link");A.rel="stylesheet",A.href=`${location==null?void 0:location.origin}/css/reset.css`,(z=g.value)==null||z.appendChild(A)}),w.onUnmounted(()=>{document.removeEventListener("click",v)}),c({focus:()=>{p.value=!0}}),{shadowHost:d,shadowRoot:g,handleClick:x}}};function B4e(o,a,c,d,g,p){return w.openBlock(),w.createElementBlock("div",{ref:"shadowHost",class:"shadow-host",onClick:a[0]||(a[0]=w.withModifiers((...v)=>d.handleClick&&d.handleClick(...v),["stop"]))},[d.shadowRoot?(w.openBlock(),w.createBlock(w.Teleport,{key:0,to:d.shadowRoot},[w.renderSlot(o.$slots,"default")],8,["to"])):w.createCommentVNode("",!0)],512)}const FM=cu(I4e,[["render",B4e]]),F4e=["innerHTML"],Rle=w.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const a=w.useModel(o,"modelValue");return(c,d)=>(w.openBlock(),w.createBlock(FM,null,{default:w.withCtx(()=>[w.createElementVNode("div",{innerHTML:a.value},null,8,F4e)]),_:1}))}}),Ple=Symbol("nodesUI"),$f=()=>{const o=w.inject(Ple);if(!o)throw new Error("NodesUI context not found");return o},wz=Symbol("nodesEditor"),Jw=()=>{const o=w.inject(wz);if(!o)throw new Error("NodesEditor context not found");return o},rd=[];for(let o=0;o<256;++o)rd.push((o+256).toString(16).slice(1));function L4e(o,a=0){return(rd[o[a+0]]+rd[o[a+1]]+rd[o[a+2]]+rd[o[a+3]]+"-"+rd[o[a+4]]+rd[o[a+5]]+"-"+rd[o[a+6]]+rd[o[a+7]]+"-"+rd[o[a+8]]+rd[o[a+9]]+"-"+rd[o[a+10]]+rd[o[a+11]]+rd[o[a+12]]+rd[o[a+13]]+rd[o[a+14]]+rd[o[a+15]]).toLowerCase()}let LQ;const V4e=new Uint8Array(16);function H4e(){if(!LQ){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");LQ=crypto.getRandomValues.bind(crypto)}return LQ(V4e)}const z4e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Vre={randomUUID:z4e};function xA(o,a,c){var g;if(Vre.randomUUID&&!a&&!o)return Vre.randomUUID();o=o||{};const d=o.random??((g=o.rng)==null?void 0:g.call(o))??H4e();if(d.length<16)throw new Error("Random bytes length must be >= 16");return d[6]=d[6]&15|64,d[8]=d[8]&63|128,L4e(d)}const GA=()=>{const{nodes:o,updateNodes:a}=Jw();return{nodes:o,addNode:x=>{const A=(Array.isArray(x)?x:[x]).map(I=>({...I,id:I.id||xA()})),M=[...o.value,...A];a(M)},removeNode:x=>{const T=Array.isArray(x)?x:[x],A=[],M=[];T.forEach(z=>{var K;const U=o.value.find(X=>(X==null?void 0:X.id)===z);((K=U==null?void 0:U.element)==null?void 0:K.tagName)==="TD"?A.push(z):M.push(z)});let I=o.value.filter(z=>!M.includes(z==null?void 0:z.id));I=I==null?void 0:I.map(z=>A.includes(z==null?void 0:z.id)?{id:z==null?void 0:z.id,nodePath:z==null?void 0:z.nodePath,label:"文本",nodeType:"text"}:z),a(I)},editNodes:x=>{const T=Array.isArray(x)?x:[x];let A=xA();const M=T.map(z=>{let U={...z},K=z==null?void 0:z.id;return K||(K=xA(),U.id=K),U!=null&&U.groupKey||(U.groupKey=A),U}),I=[...o.value];M.forEach(z=>{const U=I.findIndex(K=>K.id===z.id);U!==-1?I[U]=z:I.push(z)}),a(I)},insertNodeAt:(x,T)=>{const A=[...o.value];A.splice(T,0,x),a(A)},moveNode:(x,T)=>{const A=[...o.value],[M]=A.splice(x,1);A.splice(T,0,M),a(A)}}};function bM(o){if(!o||!o.ownerDocument)return null;const a=[];for(let c=o;c&&c.nodeType===1;c=c.parentElement){let d=0;for(let v=c.previousSibling;v;v=v.previousSibling)v.nodeType===1&&v.nodeName===c.nodeName&&d++;const g=c.nodeName.toLowerCase(),p=d?`${g}:nth-child(${d+1})`:g;a.unshift(p)}return a.length?a.join(" > "):null}function U4e(o,a){if(!a)return null;try{return(a.shadowRoot||a).querySelector(`#${CSS.escape(o)}`)}catch(c){return console.error("nodePath query error:",c),null}}function j4e(o,a){if(!a)return null;try{return(a.shadowRoot||a).querySelector(o)}catch(c){return console.error("nodePath query error:",c),null}}const dA=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}`:""),W4e=(o,a,c)=>{var d,g;if(o.element)if(o.element.tagName==="TD")o.element.classList.add("node-item-td"),Hre(o.element,o);else{const p=document.createElement("span");p.setAttribute("contenteditable","false"),Hre(p,o),p.classList.add("node-item");const v=a==null?void 0:a.getRootNode(),x=(d=v==null?void 0:v.getSelection)==null?void 0:d.call(v);if(x&&o.startOffset!==void 0){const T=document.createRange(),A=(o==null?void 0:o.textNodeIndex)||0,M=o.element.childNodes[A]||o.element,I=Math.min(o.startOffset,((g=M.textContent)==null?void 0:g.length)||0);T.setStart(M,I),T.setEnd(M,I);const z=document.createElement("span");z.classList.add("empty-text-node"),T.insertNode(z),T.insertNode(p),T.setStartAfter(p),T.collapse(!0),x.removeAllRanges(),x.addRange(T)}else o.element.appendChild(p)}c==null||c(o)},Hre=(o,a)=>{a!=null&&a.id&&(o.id=a==null?void 0:a.id),(a==null?void 0:a.nodePath)!==void 0&&o.setAttribute("data-nodePath",a.nodePath),(a==null?void 0:a.textNodeIndex)!==void 0&&a.textNodeIndex>=0&&o.setAttribute("data-textNodeIndex",a.textNodeIndex.toString()),a.startOffset!==void 0&&a.startOffset>=0&&o.setAttribute("data-startOffset",a.startOffset.toString()),(a==null?void 0:a.subNodeSort)!==void 0&&a.subNodeSort>=0&&o.setAttribute("data-subNodeSort",a.subNodeSort.toString()),(a==null?void 0:a.groupKey)!==void 0&&o.setAttribute("data-groupKey",a.groupKey)},Z4e=o=>{o&&(o.removeAttribute("id"),o.removeAttribute("data-nodePath"),o.removeAttribute("data-textNodeIndex"),o.removeAttribute("data-startOffset"),o.removeAttribute("data-subNodeSort"),o.removeAttribute("data-groupKey"))},G4e=o=>{const a=o.parentNode;if(!a)return-1;let c=0;for(let d=0;d<a.childNodes.length;d++){const g=a.childNodes[d];if(g===o)return c;c++,g.nodeType===Node.ELEMENT_NODE&&(g.classList.contains("node-item")&&(c-=2,c<0&&(c=0)),g.classList.contains("empty-text-node")&&(c-=1,c<0&&(c=0)))}return-1},EA=o=>{let a=o.closest("TD"),c=o.closest(".node-item"),d=null;if(c?d=c:a&&a.classList.contains("node-item-td")&&(d=a),!d)return null;const g=d||o;let p=g==null?void 0:g.getAttribute("data-nodePath");if(p||(p=bM(g)),(g==null?void 0:g.getAttribute("selectable"))==="false")return null;let v={element:g,nodePath:p};const x=g==null?void 0:g.getAttribute("data-textNodeIndex");x&&(v.textNodeIndex=Number(x));const T=g==null?void 0:g.getAttribute("data-startOffset");T&&(v.startOffset=Number(T));const A=g==null?void 0:g.getAttribute("data-subNodeSort");A&&(v.subNodeSort=Number(A));const M=g==null?void 0:g.getAttribute("data-groupKey");M&&(v.groupKey=M);const I=g==null?void 0:g.getAttribute("id");return I&&(v.id=I),v},q4e=o=>{let a=[];if(o.tagName==="TD"){let p=o.classList.contains("node-item-td");if((o==null?void 0:o.getAttribute("selectable"))==="false")return[];let x=EA(o);if(x){if(p)return[x];{let T=o.closest(".node-item");if(x=EA(T),x)return[x]}}return a}const c=o==null?void 0:o.getAttribute("data-textNodeIndex"),d=o==null?void 0:o.getAttribute("data-startOffset"),g=o==null?void 0:o.getAttribute("data-subNodeSort");if(o.classList.contains("node-item")&&!o.closest("TD")||c||d||g){const p=EA(o);if(p){let v={...p};a.push(v)}return a}return a},Y4e=o=>r0e(o,a=>w.toValue(a.nodes).map(c=>({...c,color:a.color,activated:a==null?void 0:a.activated,dataGroupKey:a.id}))),Ute=(o,a)=>{const c=o.startsWith("#")?o.slice(1):o;let d,g,p;if(c.length===3)d=parseInt(c[0]+c[0],16),g=parseInt(c[1]+c[1],16),p=parseInt(c[2]+c[2],16);else if(c.length===6)d=parseInt(c.substring(0,2),16),g=parseInt(c.substring(2,4),16),p=parseInt(c.substring(4,6),16);else return console.warn("Invalid color format:",o),`rgba(0, 0, 0, ${a})`;return`rgba(${d}, ${g}, ${p}, ${a})`},K4e=o=>{const{element:a}=o;if(!a)return null;if(a.tagName.toLowerCase()!=="td")return{showTextType:"input"};const d=a.closest("tr"),g=Array.from(d.parentElement.children).indexOf(d),p=Array.from(d.children).indexOf(a),v=a.closest("table"),x=a.closest("body").querySelectorAll("table");return{showTextType:"cell",tableIndex:Array.from(x).indexOf(v)+1,colIndex:p,rowIndex:g}},X4e=(o,a)=>{var g,p;let c=1;const d=(g=o==null?void 0:o.map(v=>a==null?void 0:a.find(x=>(x==null?void 0:x.id)===(v==null?void 0:v.id))))==null?void 0:g.filter(Boolean);return(d==null?void 0:d.length)>0?(p=d==null?void 0:d.map(x=>{const T=K4e(x);return T?(T==null?void 0:T.showTextType)==="input"?{...x,...T,inputIndex:c++}:{...x,...T}:null}))==null?void 0:p.filter(Boolean):[]};function J4e(o){if(!o||o.length===0)return[];const a=[...o].sort((g,p)=>g.rowIndex!==p.rowIndex?g.rowIndex-p.rowIndex:g.colIndex-p.colIndex),c=[],d=new Set;for(const g of a){if(d.has(g))continue;const p=[];let v=0,x=0;for(let T=g.colIndex;a.find(M=>M.rowIndex===g.rowIndex&&M.colIndex===T&&!d.has(M));T++)x++;if(x!==0){v=x;for(let T=g.rowIndex;;T++){let A=0;const M=[];for(let I=g.colIndex;I<g.colIndex+v;I++){const z=a.find(U=>U.rowIndex===T&&U.colIndex===I&&!d.has(U));if(z)A++,M.push(z);else break}if(A===v)p.push(...M);else break}p.length>0&&(c.push([...p]),p.forEach(T=>d.add(T)))}}return c}function Q4e(o){if(!o||o.length===0)return{min:null,max:null};let a=o[0],c=o[0];for(const d of o)(d.colIndex<a.colIndex||d.colIndex===a.colIndex&&d.rowIndex<a.rowIndex)&&(a=d),(d.colIndex>c.colIndex||d.colIndex===c.colIndex&&d.rowIndex>c.rowIndex)&&(c=d);return{min:a,max:c}}const Ile=(o,a)=>{var A;const c=X4e(o,a||[]),d=[],g=[];(A=w.toValue(c))==null||A.forEach(M=>{(M==null?void 0:M.showTextType)==="input"?d.push(M):g.push(M)});const p=c0e(g,"tableIndex"),v=Object.entries(p).map(([M,I])=>({tableIndex:Number(M),nodes:I})),x=xce(v==null?void 0:v.map(M=>J4e(M==null?void 0:M.nodes))),T=(x==null?void 0:x.map(M=>Q4e(M)))||[];return[...d,...T]},_A=o=>{function a(c){let d="";for(;c>=0;)d=String.fromCharCode(65+c%26)+d,c=Math.floor(c/26)-1;return d}return(o==null?void 0:o.colIndex)>=0&&(o==null?void 0:o.rowIndex)>=0?`${a(o==null?void 0:o.colIndex)}${o==null?void 0:o.rowIndex}`:""},eOe=(o,a)=>{const c=Ile(o,a||[]);let d=[];return c==null||c.forEach(g=>{var p,v;(g==null?void 0:g.showTextType)==="input"?d.push(`填写${g==null?void 0:g.inputIndex}`):d.push(((p=g==null?void 0:g.min)==null?void 0:p.id)===((v=g==null?void 0:g.max)==null?void 0:v.id)?_A(g==null?void 0:g.min):`${_A(g==null?void 0:g.min)}:${_A(g==null?void 0:g.max)}`)}),d==null?void 0:d.join(",")},tOe=["onClick"],nOe={key:0,class:"icon"},oOe={key:1,class:"arrow"},sOe={key:0,class:"submenu"},rOe=["onClick"],aOe={key:0,class:"icon"},iOe=w.defineComponent({__name:"index",props:w.mergeModels({style:{}},{show:{},showModifiers:{}}),emits:w.mergeModels(["select"],["update:show"]),setup(o,{emit:a}){const{selectedNodes:c,focusedElement:d,cursorPosition:g,focusedNodeIndex:p,preNodeNumber:v}=$f(),{inputTypes:x}=Jw(),T=w.useModel(o,"show"),{editNodes:A}=GA(),M=K=>{if(w.toValue(d)&&!m0e(w.toValue(g))){const X=bM(w.toValue(d)),Q=w.toValue(g),le=(w.toValue(v)||0)+1,ae=EA(w.toValue(d));X&&Q&&Q>=0&&A({...ae,label:K==null?void 0:K.label,element:w.toValue(d),nodePath:X,startOffset:Q,subNodeSort:le,textNodeIndex:w.toValue(p)||0,nodeType:K==null?void 0:K.value})}else if(c){const X=w.toValue(c);X!=null&&X.length&&A(X==null?void 0:X.map(Q=>({...Q,label:K==null?void 0:K.label,element:Q==null?void 0:Q.element,nodePath:Q==null?void 0:Q.nodePath,nodeType:K==null?void 0:K.value})))}T.value=!1},I=w.computed(()=>{const K=[],X=[];return w.toValue(x).forEach(Q=>{Q.groupName==="system"?X.push({...Q,handler:()=>{M(Q)}}):K.push({...Q,handler:()=>{M(Q)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:K},{label:"插入记录标识",icon:"i-bi:flag",children:X}].filter(Q=>{var le;return(le=Q==null?void 0:Q.children)==null?void 0:le.length})}),z=a,U=(K,X)=>{K.preventDefault(),X!=null&&X.handler&&X.handler(),X!=null&&X.value&&z("select",X==null?void 0:X.value)};return(K,X)=>w.withDirectives((w.openBlock(),w.createElementBlock("div",{class:"context-menu",style:w.normalizeStyle({...K.style})},[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(I.value,Q=>(w.openBlock(),w.createElementBlock("div",{key:Q==null?void 0:Q.label,class:"menu-item"},[w.createElementVNode("div",{class:"menu-item-content",onClick:le=>U(le,Q)},[Q!=null&&Q.icon?(w.openBlock(),w.createElementBlock("div",nOe,[w.createElementVNode("div",{class:w.normalizeClass(Q==null?void 0:Q.icon)},null,2)])):w.createCommentVNode("",!0),w.createTextVNode(" "+w.toDisplayString(Q.label)+" ",1),Q!=null&&Q.children?(w.openBlock(),w.createElementBlock("span",oOe,"›")):w.createCommentVNode("",!0)],8,tOe),Q!=null&&Q.children?(w.openBlock(),w.createElementBlock("div",sOe,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(Q.children,le=>(w.openBlock(),w.createElementBlock("div",{key:le.action,class:"menu-item",onClick:ae=>U(ae,le)},[le!=null&&le.icon?(w.openBlock(),w.createElementBlock("div",aOe,[w.createElementVNode("div",{class:w.normalizeClass(le==null?void 0:le.icon)},null,2)])):w.createCommentVNode("",!0),w.createTextVNode(" "+w.toDisplayString(le.label),1)],8,rOe))),128))])):w.createCommentVNode("",!0)]))),128))],4)),[[w.vShow,T.value]])}}),cOe=cu(iOe,[["__scopeId","data-v-8c4e7354"]]),lOe={key:0},uOe={key:1,class:"td-node"},dOe=w.defineComponent({__name:"index",props:{node:{}},setup(o){const a=o,c=w.computed(()=>{var d,g;return((g=(d=a==null?void 0:a.node)==null?void 0:d.element)==null?void 0:g.TagName)==="TD"});return(d,g)=>{var p,v;return c.value?(w.openBlock(),w.createElementBlock("span",lOe,w.toDisplayString((p=a==null?void 0:a.node)==null?void 0:p.label),1)):(w.openBlock(),w.createElementBlock("span",uOe,w.toDisplayString((v=a==null?void 0:a.node)==null?void 0:v.label),1))}}}),Ble=w.defineComponent({__name:"index",props:{node:{}},setup(o){const a=o,{containerRef:c,currentNodes:d}=$f(),g=w.computed(()=>{var v;return(v=w.toValue(d))==null?void 0:v.find(x=>{var T;return(x==null?void 0:x.id)===((T=a==null?void 0:a.node)==null?void 0:T.id)})});function p(){var v,x;return(v=a==null?void 0:a.node)!=null&&v.id?(x=c.value)==null?void 0:x.querySelector(`#${CSS.escape(a.node.id)}`):""}return w.watch(()=>g,()=>{var x,T,A,M;const v=w.toValue(g);(x=a==null?void 0:a.node)!=null&&x.element&&(v?v!=null&&v.activated||(a.node.element.style.setProperty("--node-color",(v==null?void 0:v.color)||"#409eff"),a.node.element.style.setProperty("--node-bg-color",Ute((v==null?void 0:v.color)||"#409eff",.1)),a.node.element.setAttribute("data-dataGroupKey",v==null?void 0:v.dataGroupKey),a.node.element.setAttribute("selectable","false"),a.node.element.classList.add("activated")):((T=a.node.element)==null||T.removeAttribute("data-dataGroupKey"),(A=a.node.element)==null||A.removeAttribute("selectable"),(M=a.node.element)==null||M.classList.remove("activated")))},{immediate:!0,deep:!0}),(v,x)=>(w.openBlock(),w.createBlock(w.Teleport,{to:p()},[w.renderSlot(v.$slots,"nodeItem",{node:v.node},()=>[w.createVNode(dOe,{node:v.node},null,8,["node"])])],8,["to"]))}});function fOe(){const o=w.ref(!1),a=d=>{d.key==="Control"&&(o.value=!0)},c=d=>{d.key==="Control"&&(o.value=!1)};return w.onMounted(()=>{window.addEventListener("keydown",a),window.addEventListener("keyup",c)}),w.onUnmounted(()=>{window.removeEventListener("keydown",a),window.removeEventListener("keyup",c)}),o}function Fle(){const{selectedNodes:o,setSelectedNodes:a,containerRef:c}=$f(),{nodes:d}=GA(),g=w.ref(!1),p=w.ref({x:0,y:0}),v=w.ref({x:0,y:0}),x=w.ref({left:0,top:0,width:0,height:0}),T=w.ref(null),A=Ce=>{if(Ce.closest(".node-selected")===null){const Ge=Ce.closest(".node-item-td");if(Ge!==null){const oe=EA(Ge);if(Ge.querySelector(".node-selected"))return;const Ze=bM(Ge);Ze&&a([{...oe,nodePath:Ze,element:Ge}]);return}if(Ce.classList.contains("node-item")){const oe=bM(Ce);oe&&a([{nodePath:oe,element:Ce}]);return}}},M=Ce=>{Ce.button===2&&A(Ce==null?void 0:Ce.target),Ce.button===0&&(g.value=!0,T.value&&(p.value={x:Ce.pageX,y:Ce.pageY},v.value={x:Ce.pageX,y:Ce.pageY},K(Ce),le(),T.value.style.display="block",window.addEventListener("mousemove",I),window.addEventListener("mouseup",z)))},I=Vse(Ce=>{g.value&&(v.value={x:Ce.pageX,y:Ce.pageY},le())},16),z=Ce=>{Ce.button===0&&(g.value=!1,T.value&&(le(),T.value.style.display="none",window.removeEventListener("mousemove",I),window.removeEventListener("mouseup",z)))},U=fOe(),K=Ce=>{let ct=[];if(Ce.button===0){const Ge=EA(Ce==null?void 0:Ce.target);Ge&&(U.value?o.value.some(oe=>dA(oe)===dA(Ge))?ct=o.value.filter(Ze=>dA(Ze)!==dA(Ge)):ct=[...o.value,Ge]:Ge&&(ct=[Ge])),ct=Q(ct),a(ct)}},X=()=>{if(!c.value||!(x.value.width>3||x.value.height>3))return;let Ce=[];const ct={left:x.value.left,right:x.value.left+x.value.width,top:x.value.top,bottom:x.value.top+x.value.height};if(c.value.querySelectorAll("*").forEach(oe=>{const Ze=oe.getBoundingClientRect(),yt=window.scrollX||window.pageXOffset,_t=window.scrollY||window.pageYOffset,Re={left:Ze.left+yt,right:Ze.right+yt,top:Ze.top+_t,bottom:Ze.bottom+_t};Re.right>ct.left&&Re.left<ct.right&&Re.bottom>ct.top&&Re.top<ct.bottom&&(Ce=[...Ce,...q4e(oe)])}),Ce=Q(Ce),U.value){const oe=new Set(o.value.map(yt=>dA(yt))),Ze=Ce.filter(yt=>!oe.has(dA(yt)));a([...o.value,...Ze])}else a(Ce)},Q=Ce=>{var Ge;let ct=[];if(Ce.length>0){const oe=(Ge=Ce.map(ue=>ue==null?void 0:ue.groupKey))==null?void 0:Ge.filter(Boolean),Ze=new Set(oe),yt=Array.from(Ze),_t=d.value.filter(ue=>yt.includes(ue.groupKey));ct=[...Ce,..._t],ct=[...A0e(ct.filter(ue=>ue==null?void 0:ue.id),"id")||[],...ct.filter(ue=>!ue.id)]}return ct},le=Vse(()=>{if(!T.value)return;const{x:Ce,y:ct}=p.value,{x:Ge,y:oe}=v.value,Ze=Math.min(Ce,Ge),yt=Math.min(ct,oe),_t=Math.abs(Ce-Ge),Re=Math.abs(ct-oe);x.value={left:Ze,top:yt,width:_t,height:Re}},16);w.watch(x,Ce=>{ae(Ce),g.value&&X()},{deep:!0});const ae=Ce=>{if(!T.value)return;const{left:ct,top:Ge,width:oe,height:Ze}=w.toValue(Ce);T.value.style.left=`${ct}px`,T.value.style.top=`${Ge}px`,T.value.style.width=`${oe}px`,T.value.style.height=`${Ze}px`},Z=()=>{if(!c.value)return;c.value.addEventListener("mousedown",M);const Ce=document.createElement("div");Ce.style.position="absolute",Ce.style.border="1px solid #1677ff",Ce.style.backgroundColor="rgba(22, 119, 255, 0.05)",Ce.style.pointerEvents="none",document.body.appendChild(Ce),T.value=Ce};return w.watch(()=>c.value,Ce=>{w.toValue(Ce)&&Z()},{immediate:!0}),w.onUnmounted(()=>{c.value&&c.value.removeEventListener("mousedown",M)}),{isSelecting:g,selectionBox:T}}function Lle(){const{selectedNodes:o,containerRef:a}=$f();w.watch(()=>o,g=>{var v,x;const p=(x=(v=w.toValue(g))==null?void 0:v.map(T=>T.element))==null?void 0:x.filter(Boolean);c(),d(p)},{deep:!0});const c=()=>{var g;(g=w.toValue(a))==null||g.querySelectorAll(".node-selected").forEach(p=>{p.classList.remove("node-selected")})},d=g=>{g.forEach(p=>{p.classList.add("node-selected")})}}function mOe(){const o=w.ref(!1),a=w.ref({left:"0px",top:"0px"}),c=g=>{g.preventDefault(),o.value=!0;const v=g.currentTarget.getBoundingClientRect(),x=g.clientX-v.left,T=g.clientY-v.top,A=118,M=v.width-x<A;a.value={left:M?`${x-A}px`:`${x}px`,top:`${T}px`}},d=g=>{const p=document.querySelector(".context-menu");p&&!p.contains(g.target)&&(o.value=!1)};return w.onMounted(()=>{document.addEventListener("mousedown",d)}),w.onUnmounted(()=>{document.removeEventListener("mousedown",d)}),{showContextMenu:o,contextMenuStyle:a,onContextMenu:c,closeContextMenu:d}}function gOe(){const{removeNode:o}=GA(),{containerRef:a}=$f(),c=g=>{var K,X;if(g.target instanceof Element&&g.target.classList.contains("node-item"))return;const p=g.target;if(p===a.value)return;const x=((K=a.value)==null?void 0:K.getRootNode()).getSelection(),T=(X=a.value)==null?void 0:X.querySelectorAll('[contenteditable="true"]');T==null||T.forEach(Q=>{Q.setAttribute("contenteditable","false")});const A=p.textContent||"",M=p.innerHTML||"";p.setAttribute("contenteditable","true"),p.focus();const I=new MutationObserver(()=>{p.textContent!==A&&(p.innerHTML=M)});I.observe(p,{characterData:!0,childList:!0,subtree:!0});const z=Q=>{Q.preventDefault()};p.addEventListener("input",z),p.addEventListener("paste",z),p.addEventListener("drop",z),p.addEventListener("keydown",Q=>{var le,ae,Z,Ce;if(((le=document.activeElement)==null?void 0:le.shadowRoot)===((ae=a.value)==null?void 0:ae.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(Q.key)){if(Q.key==="Backspace"||Q.key==="Delete"){const ct=x==null?void 0:x.getRangeAt(0);if(p.blur(),(ct==null?void 0:ct.startOffset)===0){const Ge=ct.startContainer;if(Ge.nodeType===Node.TEXT_NODE){const oe=Ge.previousSibling;if(oe&&oe.nodeType===Node.ELEMENT_NODE&&oe.classList.contains("node-item")){const Ze=oe.getAttribute("id");Ze&&o(Ze),(Z=Ge.parentElement)==null||Z.normalize();return}}else if(Ge.nodeType===Node.ELEMENT_NODE){const oe=Ge.previousSibling;if(oe&&oe.nodeType===Node.ELEMENT_NODE&&oe.classList.contains("node-item")){const Ze=oe.getAttribute("id");Ze&&o(Ze),(Ce=Ge.parentElement)==null||Ce.normalize();return}}}}Q.preventDefault()}});const U=()=>{I.disconnect(),p.removeEventListener("input",z),p.removeEventListener("paste",z),p.removeEventListener("drop",z),p.removeEventListener("blur",U),p.setAttribute("contenteditable","false")};p.addEventListener("blur",U)};w.watch(a,g=>{g&&d()},{immediate:!0});const d=()=>{var g;(g=a.value)==null||g.addEventListener("dblclick",c)};return w.onUnmounted(()=>{var g;(g=a.value)==null||g.removeEventListener("dblclick",c)}),{}}function hOe(){const{containerRef:o,focusedElement:a,cursorPosition:c,focusedNodeIndex:d,preNodeNumber:g}=$f(),p=A=>{var I,z;const M=A==null?void 0:A.getSelection();try{if((I=a.value)==null||I.normalize(),M){const U=M.getRangeAt(0);d.value=G4e(U.startContainer);const K=U.startOffset,X=(z=a.value)==null?void 0:z.querySelectorAll(".node-item");let Q=0;return g.value=0,X==null||X.forEach(le=>{const ae=document.createRange();if(ae.selectNode(le),ae.comparePoint(U.startContainer,K)>=0){g.value+=1;const Z=le.getAttribute("data-startOffset");Number(Z)>Q&&(Q=Number(Z))}}),Q+K}}catch{}return 0},v=()=>{var M;const A=(M=o.value)==null?void 0:M.getRootNode();c.value=p(A)},x=A=>{var U;const M=A.target;if(M===o.value)return;a.value=M;const I=(U=o.value)==null?void 0:U.getRootNode();c.value=p(I),M.addEventListener("click",v),M.addEventListener("keyup",K=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(K.key)&&v()});const z=()=>{M.removeEventListener("click",v),M.removeEventListener("keyup",v),M.removeEventListener("blur",z),setTimeout(()=>{a.value=null,d.value=0,c.value=-1},300)};M.addEventListener("blur",z)};w.watch(o,A=>{A&&T()},{immediate:!0});const T=()=>{var A;(A=o.value)==null||A.addEventListener("focus",x,!0)};return w.onUnmounted(()=>{var A;(A=o.value)==null||A.removeEventListener("focus",x,!0)}),{focusedElement:a,cursorPosition:c,focusedNodeIndex:d,preNodeNumber:g}}function Cz(){const{containerRef:o,currentRenderNodes:a}=$f(),{nodes:c}=GA(),d=w.ref([]),g=w.ref([]);w.watch(()=>[c.value,o],()=>{if(o.value===null)return;const v=C0e(c.value,[x=>x.nodePath,x=>x.textNodeIndex,x=>x.startOffset??-1,x=>x.subNodeSort],["asc","desc","desc","desc"]);d.value=v},{immediate:!0,deep:!0});const p=v=>{W4e(v,o.value,x=>{g.value.push(x.id)})};return w.watch(()=>d.value,v=>{var x,T,A,M;o.value&&((x=o.value)==null||x.querySelectorAll(".node-item").forEach(I=>I.remove()),(T=o.value)==null||T.querySelectorAll(".node-item-td").forEach(I=>Z4e(I)),(A=o.value)==null||A.querySelectorAll(".empty-text-node").forEach(I=>I.remove()),g.value=[],(M=o.value)==null||M.normalize(),v.forEach(I=>{p(I)}))},{deep:!0,immediate:!0}),w.watch(()=>g.value,()=>{a.value=d.value.filter(v=>v!=null&&v.id?g.value.includes(v==null?void 0:v.id):!1)},{immediate:!0,deep:!0}),{wrappedNodes:d}}function Vle(o){const a=o.value===null?[]:[JSON.parse(JSON.stringify(o.value))],c=w.ref(a),d=w.ref(0),g=w.ref(!1),p=w.computed(()=>c.value[d.value]),v=()=>{d.value>0&&(g.value=!0,d.value--,o.value=JSON.parse(JSON.stringify(c.value[d.value])))},x=()=>{d.value<c.value.length-1&&(g.value=!0,d.value++,o.value=JSON.parse(JSON.stringify(c.value[d.value])))},T=A=>{(A.ctrlKey||A.metaKey)&&A.key==="z"?(A.preventDefault(),v()):(A.ctrlKey||A.metaKey)&&A.key==="y"&&(A.preventDefault(),x())};return w.onMounted(()=>{window.addEventListener("keydown",T)}),w.onUnmounted(()=>{window.removeEventListener("keydown",T)}),w.watch(o,Vx(A=>{A&&!g.value&&(c.value.splice(d.value+1),c.value.push(JSON.parse(JSON.stringify(A))),d.value++),g.value&&(g.value=!1)},300),{deep:!0}),{current:p,undo:v,redo:x}}function pOe(){const{modelValue:o}=Jw(),{nodes:a,addNode:c}=GA(),d=v=>{if(!v||typeof v!="string")return[];const T=new DOMParser().parseFromString(v,"text/html");return Array.from(T.querySelectorAll("td")).filter(I=>{var z;return!((z=I.textContent)!=null&&z.trim())})},g=(v,x)=>{const T=x.map(M=>M.nodePath);return v==null?void 0:v.map(M=>({nodePath:bM(M)})).filter(M=>{const I=M==null?void 0:M.nodePath;return!T.includes(I)})},p=v=>{const x=v.map(T=>({nodeType:"text",label:"文本",...T}));c(x)};w.onMounted(()=>{const v=d(o),x=g(v,w.toValue(a));p(x)})}function bOe(){const{selectedNodes:o,containerRef:a}=$f(),{removeNode:c}=GA(),d=w.ref(null),g=x=>{var T;if((T=w.toValue(a))!=null&&T.contains(d.value)&&(x.key==="Delete"||x.key==="Backspace")){let A=[];x.preventDefault(),w.toValue(o).length>0&&(w.toValue(o).forEach(M=>{var I,z,U;if(((I=M==null?void 0:M.element)==null?void 0:I.tagName)==="TD"){const K=(z=M==null?void 0:M.element)==null?void 0:z.getAttribute("id");K&&A.push(K)}else{const K=(U=M==null?void 0:M.element)==null?void 0:U.getAttribute("id");K&&A.push(K)}}),o.value=[],(A==null?void 0:A.length)>0&&c(A))}},p=x=>{var T;(T=w.toValue(a))!=null&&T.contains(x.target)?d.value=x.target:d.value=null},v=()=>{a.value&&(window.addEventListener("keydown",g),a.value.addEventListener("mousedown",p))};w.watch(()=>a.value,x=>{w.toValue(x)&&v()},{immediate:!0}),w.onUnmounted(()=>{a.value&&(window.removeEventListener("keydown",g),a.value.removeEventListener("mousedown",p))})}const Fee=w.ref({});function Sz(o){return w.computed(()=>{var a;return(a=Fee.value)==null?void 0:a[o]})}function Hle(){const o=Jw(),a=$f();w.onMounted(()=>{const{editorId:c}=o;c&&(Fee.value[c]=w.ref({...o,...a}))}),w.onUnmounted(()=>{const{editorId:c}=o;c&&(Fee.value[c]=null)})}const vOe={class:"relative"},yOe=["innerHTML"],wOe=w.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{modelValue:a,nodes:c}=Jw(),{containerRef:d,currentRenderNodes:g}=$f();Hle(),Vle(c),Fle();const{showContextMenu:p,contextMenuStyle:v,onContextMenu:x}=mOe();return Lle(),bOe(),hOe(),gOe(),Cz(),pOe(),(T,A)=>(w.openBlock(),w.createElementBlock("div",vOe,[w.createVNode(FM,null,{default:w.withCtx(()=>[w.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:d,onContextmenu:A[0]||(A[0]=w.withModifiers((...M)=>w.unref(x)&&w.unref(x)(...M),["prevent"]))},[w.createElementVNode("body",{innerHTML:w.unref(a)},null,8,yOe)],544)]),_:1}),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(w.unref(g),M=>(w.openBlock(),w.createBlock(Ble,{key:M==null?void 0:M.id,node:M},{nodeItem:w.withCtx(I=>[w.renderSlot(T.$slots,"nodeItem",{node:I==null?void 0:I.node})]),_:2},1032,["node"]))),128)),w.createVNode(cOe,{show:w.unref(p),"onUpdate:show":A[1]||(A[1]=M=>w.isRef(p)?p.value=M:null),style:w.normalizeStyle(w.unref(v))},null,8,["show","style"])]))}}),COe={class:"relative"},SOe=["innerHTML"],zre=w.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const a=o,{containerRef:c,modelValue:d}=w.inject(wz);return Cz({containerRef:c,renderType:a.renderType}),(g,p)=>(w.openBlock(),w.createElementBlock("div",COe,[w.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:c},[w.createElementVNode("body",{innerHTML:w.unref(d)},null,8,SOe)],512)]))}}),xOe=w.defineComponent({__name:"index",props:{options:{}},setup(o){const a=o,{formData:c}=Jw(),{containerRef:d}=$f();c.value||(c.value={});function g(v){var x;return v?(x=d.value)==null?void 0:x.querySelector(`#${CSS.escape(v)}`):""}function p(v){switch(v){case"text":return Ko.ElInput;case"date":return Ko.ElDatePicker;case"file":return Ko.ElUpload;case"image":return Ko.ElUpload;case"select":return Ko.ElSelect;default:return Ko.ElInput}}return(v,x)=>{var T,A,M,I;return w.openBlock(),w.createBlock(w.Teleport,{to:g((T=a==null?void 0:a.options)==null?void 0:T.id)},[w.createVNode(w.unref(Ko.ElFormItem),{label:(A=v.options)==null?void 0:A.label,rules:(M=v.options)==null?void 0:M.rules,prop:(I=a==null?void 0:a.options)==null?void 0:I.id},{default:w.withCtx(()=>{var z,U,K,X;return[(w.openBlock(),w.createBlock(w.resolveDynamicComponent(p((z=v.options)==null?void 0:z.inputType)),{"model-value":w.unref(g0e)(w.unref(c)[(U=a==null?void 0:a.options)==null?void 0:U.id])?void 0:w.unref(c)[(K=a==null?void 0:a.options)==null?void 0:K.id],"onUpdate:modelValue":x[0]||(x[0]=Q=>{var le;return w.unref(c)[(le=a==null?void 0:a.options)==null?void 0:le.id]=Q}),placeholder:((X=v.options)==null?void 0:X.placeholder)||"请输入"},null,8,["model-value","placeholder"]))]}),_:1},8,["label","rules","prop"])],8,["to"])}}}),EOe={class:"relative"},_Oe=["innerHTML"],TOe=w.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o,{expose:a}){const c=w.ref();a({formRef:c});const{containerRef:d,modelValue:g}=w.inject(wz),{formData:p}=Jw(),{currentRenderNodes:v}=$f();return Vle(p),Cz(),(x,T)=>{const A=w.resolveComponent("el-form");return w.openBlock(),w.createElementBlock("div",EOe,[w.createVNode(FM,null,{default:w.withCtx(()=>[w.createVNode(A,{ref_key:"formRef",ref:c,model:w.unref(p)},{default:w.withCtx(()=>[w.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:d},[w.createElementVNode("body",{innerHTML:w.unref(g)},null,8,_Oe)],512),w.createVNode(w.unref(Ko.ElConfigProvider),{namespace:"el"},{default:w.withCtx(()=>[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(w.unref(v),M=>(w.openBlock(),w.createBlock(xOe,{key:M==null?void 0:M.id,options:(M==null?void 0:M.formItemOptions)||{id:M.id,inputType:(M==null?void 0:M.inputType)||"text",label:"请输入",type:"text",placeholder:"请输入",rules:[{required:!0,message:"请输入",trigger:"change"}]}},null,8,["options"]))),128))]),_:1})]),_:1},8,["model"])]),_:1})])}}});function zle(o){return{all:o=o||new Map,on:function(a,c){var d=o.get(a);d?d.push(c):o.set(a,[c])},off:function(a,c){var d=o.get(a);d&&(c?d.splice(d.indexOf(c)>>>0,1):o.set(a,[]))},emit:function(a,c){var d=o.get(a);d&&d.slice().map(function(g){g(c)}),(d=o.get("*"))&&d.slice().map(function(g){g(a,c)})}}}const Lee=zle(),Ule=(...o)=>{const a=o[0],c=o[1];w.onMounted(()=>{Lee.on(a,c)}),w.onBeforeUnmount(()=>{Lee.off(a)})},jte=()=>(...a)=>{Lee.emit(...a)};let m0=null;function kOe(o){const{onSelected:a}=o,{containerRef:c,selectedNodes:d,setSelectedNodes:g,currentNodes:p}=$f();return w.watch(()=>d,()=>{m0==null||m0({data:d.value}),a==null||a(w.toValue(d))},{deep:!0}),Ule("selectNodes",x=>{const{data:T,callback:A=null,mode:M="multiple"}=x;setTimeout(()=>{g(w.toValue(T)),m0=A},100)}),{onBlur:()=>{m0&&(m0==null||m0({data:d.value,type:"blur"}),m0=null,g([]))}}}const AOe={class:"relative"},OOe=["innerHTML"],NOe=w.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const a=w.ref(),{modelValue:c}=Jw(),{containerRef:d,currentRenderNodes:g}=$f();Hle(),Fle(),Lle(),Cz();const{onBlur:p}=kOe({onSelected:()=>{var v;(v=a.value)==null||v.focus()}});return(v,x)=>(w.openBlock(),w.createElementBlock("div",AOe,[w.createVNode(FM,{onOnBlur:w.unref(p),ref_key:"shadowDomRef",ref:a},{default:w.withCtx(()=>[w.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:d},[w.createElementVNode("body",{innerHTML:w.unref(c)},null,8,OOe)],512)]),_:1},8,["onOnBlur"]),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(w.unref(g),T=>(w.openBlock(),w.createBlock(Ble,{key:T==null?void 0:T.id,node:T},{nodeItem:w.withCtx(A=>[w.renderSlot(v.$slots,"nodeItem",{node:A==null?void 0:A.node})]),_:2},1032,["node"]))),128))]))}}),$Oe=w.defineComponent({__name:"NodesProvider",props:w.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},renderType:{type:String,default:"preview"},inputTypes:{type:Array,default:()=>[]},editorId:{type:String,default:""}},{formData:{},formDataModifiers:{}}),emits:w.mergeModels(["update:nodes","update:selectNodes","onSelectedNodes"],["update:formData"]),setup(o,{emit:a}){const c=o,d=a,g=w.useModel(o,"formData"),{containerRef:p}=$f(),v=w.computed({get:()=>(c.nodes||[]).map(x=>({...x,element:p.value?j4e(x.nodePath,p.value):null})),set:x=>{const T=x.map(({element:A,...M})=>M);d("update:nodes",T)}});return w.provide(wz,{modelValue:c.modelValue,renderType:c.renderType,inputTypes:c.inputTypes,editorId:c==null?void 0:c.editorId,nodes:v,updateNodes:x=>v.value=x,formData:g}),(x,T)=>w.renderSlot(x.$slots,"default")}}),Uw=w.ref({});function DOe(o){return Uw.value[o]||(Uw.value[o]=w.ref([])),Uw.value[o]}function MOe(o){const{editorId:a}=o;Uw.value[a]||(Uw.value[a]=w.ref([])),Uw.value[a].push(o),w.onUnmounted(()=>{Uw.value[a]=Uw.value[a].filter(c=>c.id!==o.id)})}const ROe=w.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:a,emit:c}){const d=o,g=c,p=w.computed({get:()=>(d.selectedNodes||[]).map(X=>{var ae;let Q=(ae=d==null?void 0:d.nodes)==null?void 0:ae.find(Z=>(Z==null?void 0:Z.id)===(X==null?void 0:X.id)),le=X!=null&&X.element?X==null?void 0:X.element:U4e(X==null?void 0:X.id,v.value);return{...Q||{},...X,element:le}}),set:X=>{const Q=X.map(({element:le,...ae})=>{var Ce;return{...((Ce=d==null?void 0:d.nodes)==null?void 0:Ce.find(ct=>(ct==null?void 0:ct.id)===(ae==null?void 0:ae.id)))||{},...ae}});g("update:selectedNodes",Q)}}),v=w.ref(null),x=w.ref(null),T=w.ref(-1),A=w.ref(0),M=w.ref(0),I=DOe(d==null?void 0:d.editorId),z=w.computed(()=>{var Q;const X=((Q=w.toValue(I))==null?void 0:Q.filter(le=>!w.toValue(le==null?void 0:le.activated)))||[];return Y4e([...(d==null?void 0:d.nodesGroups)||[],...X])}),U=w.ref([]),K=X=>{const Q=X.map(({element:le,...ae})=>{var Ce;return{...((Ce=d==null?void 0:d.nodes)==null?void 0:Ce.find(ct=>(ct==null?void 0:ct.id)===(ae==null?void 0:ae.id)))||{},...ae}});p.value=X,g("onSelectedNodes",Q)};return a({setSelectedNodes:K}),w.provide(Ple,{containerRef:v,focusedElement:x,currentRenderNodes:U,cursorPosition:T,focusedNodeIndex:A,preNodeNumber:M,currentNodes:z,selectedNodes:p,setSelectedNodes:K}),(X,Q)=>w.renderSlot(X.$slots,"default")}}),jle=w.defineComponent({__name:"index",props:w.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:w.mergeModels(["update:nodes","update:formData","onSelectedNodes"],["update:selectedNodes"]),setup(o,{expose:a,emit:c}){const d=o,g=c,p=w.useModel(o,"selectedNodes"),v=w.ref(),x=w.ref(),T=w.computed(()=>{switch(d.renderType){case"edit":return wOe;case"select":return NOe;case"result":return zre;case"enter":return TOe;default:return zre}}),A=z=>{g("update:nodes",z)},M=z=>{g("update:formData",z)},I=z=>{g("onSelectedNodes",z)};return a({formRef:{validate:()=>{var z,U,K;return(K=(U=(z=v.value)==null?void 0:z.formRef)==null?void 0:U.validate)==null?void 0:K.call(U)}},setSelectedNodes:z=>{var U,K;(K=(U=x.value)==null?void 0:U.setSelectedNodes)==null||K.call(U,z)}}),(z,U)=>(w.openBlock(),w.createBlock(ROe,{ref_key:"UIRef",ref:x,nodes:o.nodes,selectedNodes:p.value,"onUpdate:selectedNodes":U[0]||(U[0]=K=>p.value=K),onOnSelectedNodes:I,nodesGroups:o.nodesGroups,editorId:d==null?void 0:d.id},{default:w.withCtx(()=>[w.createVNode($Oe,{renderType:o.renderType,"model-value":o.modelValue,nodes:o.nodes,"onUpdate:nodes":A,formData:o.formData,"onUpdate:formData":M,inputTypes:o.inputTypes,editorId:d==null?void 0:d.id},{default:w.withCtx(()=>[(w.openBlock(),w.createBlock(w.resolveDynamicComponent(T.value),{renderType:o.renderType,pagesize:o.pagesize,ref_key:"contentRef",ref:v},{nodeItem:w.withCtx(K=>[w.renderSlot(z.$slots,"nodeItem",{node:K==null?void 0:K.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId"]))}}),POe={class:"nodes-text"},IOe={key:0,class:"node-text-input"},BOe={key:1,class:"node-text-td"},FOe={key:0,class:"node-text-table-index"},LOe=w.defineComponent({__name:"index",props:w.mergeModels({editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const a=o,c=w.useModel(o,"modelValue"),d=Sz(a==null?void 0:a.editorId),g=w.computed(()=>{var v,x,T,A,M,I;if(((v=w.toValue(p))==null?void 0:v.length)>0)if((T=(x=w.toValue(p))==null?void 0:x[0])!=null&&T.element){const z=(M=(A=w.toValue(p))==null?void 0:A[0])==null?void 0:M.element.closest("body").querySelectorAll("table");return((I=Array.from(z))==null?void 0:I.length)===1}else return!0;else return!0}),p=w.computed(()=>{var v;return Ile(c.value,((v=w.toValue(d))==null?void 0:v.nodes)||[])});return(v,x)=>(w.openBlock(),w.createElementBlock("div",POe,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(p.value,(T,A)=>{var M,I,z;return w.openBlock(),w.createElementBlock("div",{key:A,class:"node-text-item"},[(T==null?void 0:T.showTextType)==="input"?(w.openBlock(),w.createElementBlock("span",IOe," 填写"+w.toDisplayString(T==null?void 0:T.inputIndex),1)):(w.openBlock(),w.createElementBlock("span",BOe,[g.value?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("span",FOe,w.toDisplayString(`表${(M=T==null?void 0:T.min)==null?void 0:M.tableIndex}.`),1)),w.createTextVNode(" "+w.toDisplayString(((I=T==null?void 0:T.min)==null?void 0:I.id)===((z=T==null?void 0:T.max)==null?void 0:z.id)?w.unref(_A)(T==null?void 0:T.min):`${w.unref(_A)(T==null?void 0:T.min)}:${w.unref(_A)(T==null?void 0:T.max)}`),1)]))])}),128))]))}}),VOe=cu(LOe,[["__scopeId","data-v-ba569d68"]]);function HOe(o){const{nodes:a,mode:c="multiple"}=o,d=w.ref(!1),g=jte();return{isSelecting:d,selectNodes:()=>{if(d.value)return!1;d.value=!0,g("selectNodes",{data:w.toValue(a),mode:c,callback:({data:v,type:x})=>{a.value=v,x==="blur"&&(d.value=!1)}})}}}const fA=["#ff9b40","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],VQ=w.ref(0),$x=new Map,zOe={class:"node-select"},UOe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},jOe={class:"flex gap-2"},WOe={class:"flex gap-1"},ZOe=w.defineComponent({__name:"index",props:w.mergeModels({mode:{type:String,default:"multiple"},color:{type:String},id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const a=o;!($x!=null&&$x[a==null?void 0:a.id])&&(a!=null&&a.id)&&($x[a==null?void 0:a.id]=VQ.value,VQ.value=VQ.value+1);const c=w.ref(($x==null?void 0:$x[a==null?void 0:a.id])||0),d=w.useModel(o,"modelValue"),{selectNodes:g,isSelecting:p}=HOe({nodes:d,mode:a.mode}),v=()=>{d.value=[]},x=w.computed(()=>a.color||(fA==null?void 0:fA[w.toValue(c)%(fA==null?void 0:fA.length)])||"#409eff");return MOe({id:a.id,editorId:a.editorId,nodes:d,activated:p,color:x.value}),(T,A)=>(w.openBlock(),w.createElementBlock("div",zOe,[w.createElementVNode("div",UOe,[w.createElementVNode("div",jOe,[w.createElementVNode("div",{style:w.normalizeStyle({"--node-color":x.value}),class:"node-color cursor-pointer"},null,4),w.createElementVNode("div",{style:w.normalizeStyle(w.unref(p)?{color:"#409eff"}:{})},[w.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:A[0]||(A[0]=(...M)=>w.unref(g)&&w.unref(g)(...M))})],4),w.createElementVNode("div",null,[w.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:v})])]),w.createElementVNode("div",WOe,[A[4]||(A[4]=w.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),w.createElementVNode("div",null,[w.createVNode(w.unref(Ko.ElPopover),{placement:"top-start",width:200,trigger:"hover",content:"this is content, this is content, this is content"},{reference:w.withCtx(()=>A[3]||(A[3]=[w.createElementVNode("div",{class:"flex flex-center"},[w.createElementVNode("div",{class:"i-bi:info-circle-fill mr-2"}),w.createTextVNode(" 使用帮助 ")],-1)])),_:1})])])]),w.createElementVNode("div",{class:"min-h-[42px] px-2 py-1",onClick:A[2]||(A[2]=(...M)=>w.unref(g)&&w.unref(g)(...M))},[w.createVNode(VOe,{modelValue:d.value,"onUpdate:modelValue":A[1]||(A[1]=M=>d.value=M),editorId:o.editorId},null,8,["modelValue","editorId"])])]))}}),Wle=cu(ZOe,[["__scopeId","data-v-aa7f5cc8"]]);function GOe(o){if(!o.startsWith("="))return[];const a=[];let c=1;for(o.startsWith("=")&&a.push({type:"startOperator",value:"="});c<o.length;){const d=o[c];if(/\s/.test(d)){c++;continue}if(/[A-Za-z]/.test(d)&&/\d/.test(o[c+1])){let g="";for(;c<o.length&&/[A-Za-z]/.test(o[c]);)g+=o[c++];for(;c<o.length&&/\d/.test(o[c]);)g+=o[c++];if(c<o.length&&o[c]===":"){c++;let p="";for(;c<o.length&&/[A-Za-z]/.test(o[c]);)p+=o[c++];for(;c<o.length&&/\d/.test(o[c]);)p+=o[c++];a.push({type:"range",value:`${g}:${p}`});continue}else{a.push({type:"cell",value:g});continue}}if(/[A-Za-z]/.test(d)&&/\d/.test(o[c+1])){let g="";for(;c<o.length&&/[A-Za-z]/.test(o[c]);)g+=o[c++];for(;c<o.length&&/\d/.test(o[c]);)g+=o[c++];a.push({type:"cell",value:g});continue}if(/[A-Za-z]/.test(d)){let g="";for(;c<o.length&&/[A-Za-z]/.test(o[c]);)g+=o[c++];if(["AVERAGE","AVEDEV","SUM","IF","COUNT","MAX","MIN","SQRT"].includes(g.toUpperCase())&&o[c]==="("){a.push({type:"function",value:g});continue}c-=g.length}if(/\d/.test(d)){let g="";for(;c<o.length&&(/\d/.test(o[c])||o[c]===".");)g+=o[c++];a.push({type:"number",value:g});continue}if(d==='"'){let g="";for(g+=d,c++;c<o.length&&o[c]!=='"';)g+=o[c++];g+=d,c++,a.push({type:"string",value:g});continue}if(/[A-Za-z]/.test(d)&&/\d/.test(o[c+1])){let g="";for(;c<o.length&&/[A-Za-z]/.test(o[c]);)g+=o[c++];for(;c<o.length&&/\d/.test(o[c]);)g+=o[c++];a.push({type:"cell",value:g});continue}if(d===":"){a.push({type:"operator",value:":"}),c++;continue}if(/[+\-*/=><]/.test(d)){a.push({type:"operator",value:d}),c++;continue}if(/[()]/.test(d)){a.push({type:"paren",value:d}),c++;continue}if(d===","){a.push({type:"separator",value:","}),c++;continue}c++}return a}function qOe(o,a){const c=[];let d=0;for(;d<o.length;){let g=!1;for(const p of a){const v=p.value;if(o.startsWith(v,d)){c.push({type:p.type,value:v,...p.cellValue?{cellValue:p.cellValue}:{}}),d+=v.length,g=!0;break}}g||(c.push({type:"plain",value:o[d]}),d++)}return c}function YOe(o){const a=Sz(o.editorId),c=(v,x)=>{let T=[];const A=Math.min(v.colIndex,x.colIndex),M=Math.max(v.colIndex,x.colIndex),I=Math.min(v.rowIndex,x.rowIndex),z=Math.max(v.rowIndex,x.rowIndex);for(let U=I;U<=z;U++)for(let K=A;K<=M;K++)T.push({colIndex:K,rowIndex:U});return T},d=v=>{var M;const x=v.includes(":");let T=[];if(x){const[I,z]=v.split(":").map(U=>p(U));T=c(I,z)}else T=[p(v)];return g(T,w.toValue((M=w.toValue(a))==null?void 0:M.nodes))},g=(v,x)=>x==null?void 0:x.filter(T=>{const A=T.nodePath.split(" > ");let M=1,I=1;return A.forEach(z=>{if(z.startsWith("tr")){const U=z.match(/tr(?::nth-child\((\d+)\))?/);U&&U[1]&&(M=parseInt(U[1]))}else if(z.startsWith("td")){const U=z.match(/td(?::nth-child\((\d+)\))?/);U&&(I=U[1]?parseInt(U[1]):1)}}),v.some(z=>M===z.rowIndex+1&&I===z.colIndex+1)}),p=v=>{if(!v)return{colIndex:-1,rowIndex:-1};const x=v.match(/^([A-Za-z]+)(\d+)$/);if(!x)return{colIndex:-1,rowIndex:-1};const T=x[1].toUpperCase(),A=parseInt(x[2]);let M=0;for(let I=0;I<T.length;I++)M=M*26+(T.charCodeAt(I)-64);return{colIndex:M-1,rowIndex:A}};return{getCellValue:d}}const Ure=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function KOe(o,a,c){const d=w.ref(null),g=w.ref(null);function p(){return o.value&&o.value.textContent||""}w.onMounted(()=>{o.value&&(d.value=()=>{const x=p();a.value=x},g.value=()=>{const x=p();a.value=x},o.value.addEventListener("input",d.value),o.value.addEventListener("blur",g.value))}),w.onUnmounted(()=>{o.value&&(d.value&&o.value.removeEventListener("input",d.value),g.value&&o.value.removeEventListener("blur",g.value))});const v=x=>{var T,A,M,I;if(x>=0){const z=window.getSelection();if(z){const U=z.getRangeAt(0),K=((T=U.startContainer)==null?void 0:T.nodeName)==="#text"?U.startContainer:(M=(A=U.startContainer)==null?void 0:A.childNodes)==null?void 0:M[0],X=Math.min(x,((I=K.textContent)==null?void 0:I.length)||0);U.setStart(K,X)}}};return w.watch(()=>[a,o],()=>{var x;o.value&&(Mu((x=o.value)==null?void 0:x.textContent,w.toValue(a))||(o.value.textContent=w.toValue(a),v(w.toValue(c))))},{deep:!0,immediate:!0}),{getFormulaContent:p}}function Wte(o){const{element:a,onFocus:c,onBlur:d}=o,g=w.ref(!1),p=()=>{g.value=!0,c==null||c()},v=()=>{g.value=!1,d==null||d()};return w.onMounted(()=>{var x,T;w.toValue(a)&&((x=w.toValue(a))==null||x.addEventListener("focus",p),(T=w.toValue(a))==null||T.addEventListener("blur",v))}),w.onUnmounted(()=>{var x,T;w.toValue(a)&&((x=w.toValue(a))==null||x.removeEventListener("focus",p),(T=w.toValue(a))==null||T.removeEventListener("blur",v))}),g}function XOe(o){const{element:a,showStr:c,editorId:d}=o,g=Sz(d),p=Wte({element:a}),v=w.computed(()=>{var x;return(x=c==null?void 0:c.value)==null?void 0:x.filter(T=>["range","cell"].includes(T.type))});return w.watch(()=>p,()=>{var T,A,M,I,z,U;const x=K=>{var X;K.preventDefault(),(X=w.toValue(a))==null||X.focus()};w.toValue(p)?((T=w.toValue(g))==null||T.containerRef.addEventListener("click",x),(A=w.toValue(g))==null||A.containerRef.addEventListener("mousedown",x),(M=document.querySelectorAll(".select-function"))==null||M.forEach(K=>{K.addEventListener("click",x),K.addEventListener("mousedown",x)})):((I=w.toValue(g))==null||I.containerRef.removeEventListener("click",x),(z=w.toValue(g))==null||z.containerRef.removeEventListener("mousedown",x),(U=document.querySelectorAll(".select-function"))==null||U.forEach(K=>{K.removeEventListener("click",x),K.removeEventListener("mousedown",x)}))},{deep:!0}),w.watch(()=>[p,v],()=>{var x,T,A,M,I;if((x=w.toValue(g))!=null&&x.containerRef&&((M=(A=(T=w.toValue(g))==null?void 0:T.containerRef)==null?void 0:A.querySelectorAll(".node-formula-cell"))==null||M.forEach(z=>{z.classList.remove("node-formula-cell")}),w.toValue(p))){let z=[];(I=v.value)!=null&&I.length&&(v.value.forEach(U=>{var K;z=[...z,...((K=U==null?void 0:U.cellValue)==null?void 0:K.map(X=>({color:U==null?void 0:U.color,backgroundColor:Ute((U==null?void 0:U.color)||"#000",.1),element:X==null?void 0:X.element})))||[]]}),z.forEach(U=>{var K;U!=null&&U.element&&((K=U==null?void 0:U.element)==null||K.classList.add("node-formula-cell"),U==null||U.element.style.setProperty("--formula-node-color",U==null?void 0:U.color),U==null||U.element.style.setProperty("--formula-node-bg-color",U==null?void 0:U.backgroundColor))}))}},{deep:!0}),p}const JOe=o=>{const{element:a}=o,c=w.ref(-1),d=x=>{const T=x==null?void 0:x.getSelection();try{if(T)return T.getRangeAt(0).startOffset}catch{}return 0},g=()=>{var T;const x=(T=a.value)==null?void 0:T.getRootNode();c.value=d(x)},p=x=>{var I;const T=x.target,A=(I=a.value)==null?void 0:I.getRootNode();c.value=d(A),T.addEventListener("click",g),T.addEventListener("keyup",z=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(z.key)&&g()});const M=()=>{T.removeEventListener("click",g),T.removeEventListener("keyup",g),T.removeEventListener("blur",M),setTimeout(()=>{c.value=-1},300)};T.addEventListener("blur",M)};w.watch(a,x=>{x&&v()},{immediate:!0});const v=()=>{var x;(x=a.value)==null||x.addEventListener("focus",p,!0)};return w.onUnmounted(()=>{var x;(x=a.value)==null||x.removeEventListener("focus",p,!0)}),{startOffset:c}};function QOe(o,a,c,d){if(a<0||c<0||a>=o.length)throw new Error("Invalid start or length");const g=a+c;return o.slice(0,a)+d+o.slice(g)}const eNe=(o,a)=>{var d;let c=0;for(let g=0;g<a;g++){const p=o[g];c+=(d=p==null?void 0:p.value)==null?void 0:d.length}return c},tNe=o=>{const{startOffset:a,showStr:c,value:d,editorId:g,currentItemIndex:p,currentItem:v,element:x}=o,T=Sz(g),A=w.ref(-1),M=w.ref(0),I=Wte({element:x}),z=w.ref(!1),U=jte(),K=X=>{var Q,le;if(w.toValue(z)&&w.toValue(I)&&!Mu((Q=w.toValue(v))==null?void 0:Q.cellValue,X)){const ae=eOe(X,((le=w.toValue(T))==null?void 0:le.nodes)||"");let Z=ae;ae&&(w.toValue(M)===0&&(Z+=","),w.toValue(A)>=0&&(d.value=QOe(w.toValue(d),w.toValue(A),w.toValue(M),Z),M.value=ae.length))}};w.watch(()=>p,()=>{var X,Q,le,ae,Z,Ce;if((X=T.value)==null||X.setSelectedNodes([]),["range","cell"].includes((Q=w.toValue(v))==null?void 0:Q.type))return A.value=eNe(c.value,p.value),M.value=(ae=(le=w.toValue(v))==null?void 0:le.value)==null?void 0:ae.length,z.value=!0,U("selectNodes",{data:(Z=w.toValue(v))==null?void 0:Z.cellValue,mode:"multiple",callback:({data:ct})=>{K(ct)}}),!1;if([",","(","="].includes((Ce=w.toValue(v))==null?void 0:Ce.value))return A.value=w.toValue(a),z.value=!0,M.value=0,U("selectNodes",{data:[],mode:"multiple",callback:({data:ct})=>{K(ct)}}),!1;z.value=!1,A.value=-1},{immediate:!0,deep:!0})},nNe=o=>{const{startOffset:a,showStr:c}=o,d=w.ref(-1);w.watch(()=>a,()=>{var p;if(w.toValue(a)<=0)d.value=-1;else{let v=0;for(let x=0;x<c.value.length;x++){const T=c.value[x];if(v+=(p=T==null?void 0:T.value)==null?void 0:p.length,v>=w.toValue(a)){d.value=x;break}}}},{deep:!0,immediate:!0});const g=w.computed(()=>{var p;return(p=w.toValue(c))==null?void 0:p[w.toValue(d)]});return{currentItemIndex:d,currentItem:g}};function oNe(o,a,c,d){if(a<0||c<0||a>=o.length)throw new Error("Invalid start or length");const g=a+c;return o.slice(0,a)+d+o.slice(g)}const sNe=(o,a)=>{var d;let c=0;for(let g=0;g<a;g++){const p=o[g];c+=(d=p==null?void 0:p.value)==null?void 0:d.length}return c},rNe=o=>{const{startOffset:a,showStr:c,value:d,currentItemIndex:g,currentItem:p,element:v}=o,x=w.ref(-1),T=w.ref(0),A=Wte({element:v}),M=w.ref(!1),I=jte(),z=U=>{var K;if(w.toValue(M)&&w.toValue(A)&&!Mu((K=w.toValue(p))==null?void 0:K.value,U)){const X=U,Q=X;X&&w.toValue(x)>=0&&(d.value=oNe(w.toValue(d),w.toValue(x),w.toValue(T),Q),T.value=X.length)}};w.watch(()=>g,()=>{var U,K,X,Q,le;if(["function"].includes((U=w.toValue(p))==null?void 0:U.type))return x.value=sNe(c.value,g.value),T.value=(X=(K=w.toValue(p))==null?void 0:K.value)==null?void 0:X.length,M.value=!0,I("selectFunction",{data:(Q=w.toValue(p))==null?void 0:Q.value,callback:({data:ae})=>{console.log(ae),z(ae)}}),!1;if([",","(","="].includes((le=w.toValue(p))==null?void 0:le.value))return x.value=w.toValue(a),M.value=!0,T.value=0,I("selectFunction",{data:"",callback:({data:ae})=>{console.log(ae),z(ae)}}),!1;M.value=!1,x.value=-1},{immediate:!0,deep:!0})},aNe={class:"node-formula"},iNe={class:"node-formula-show"},cNe=w.defineComponent({__name:"index",props:w.mergeModels({id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const a=o,{getCellValue:c}=YOe({editorId:a==null?void 0:a.editorId}),d=w.useModel(o,"modelValue"),g=w.ref(),{startOffset:p}=JOe({element:g});KOe(g,d,p);const v=w.computed(()=>{const M=GOe(d.value);return M==null?void 0:M.map(z=>z.type==="cell"||z.type==="range"?{cellValue:c(z.value),...z}:z)}),x=w.computed(()=>{const M=qOe(d.value,v.value);let I=-1;return M.map(U=>(U==null?void 0:U.type)==="cell"||(U==null?void 0:U.type)==="range"?(I++,{...U,color:Ure[I%Ure.length]}):(U==null?void 0:U.type)==="function"?{...U,color:"#0318ff"}:U)});XOe({element:g,showStr:x,editorId:a==null?void 0:a.editorId});const{currentItemIndex:T,currentItem:A}=nNe({element:g,startOffset:p,value:d,showStr:x});return tNe({element:g,startOffset:p,showStr:x,editorId:a==null?void 0:a.editorId,value:d,currentItemIndex:T,currentItem:A}),rNe({element:g,startOffset:p,showStr:x,value:d,currentItemIndex:T,currentItem:A}),(M,I)=>(w.openBlock(),w.createElementBlock("div",aNe,[w.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:g,class:"node-formula-input"},null,512),w.createElementVNode("div",iNe,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(x.value,(z,U)=>(w.openBlock(),w.createElementBlock("span",{key:U,class:w.normalizeClass(["node-formula-item",`node-formula-item-type-${z==null?void 0:z.type}`,U===w.unref(T)?"node-formula-item-active":""]),style:w.normalizeStyle({"--text-color":(z==null?void 0:z.color)||"#000","--bg-color":w.unref(Ute)((z==null?void 0:z.color)||"#000",.1)})},w.toDisplayString(z.value),7))),128))])]))}}),Zle=cu(cNe,[["__scopeId","data-v-f4b96eb4"]]),lNe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],uNe={class:"select-function"},dNe=["onClick"],fNe={class:"function-item"},mNe={class:"function-item-desc"},gNe=w.defineComponent({__name:"index",props:w.mergeModels({id:{type:String,default:""},functionList:{type:Array,default:()=>[]}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const a=o;let c=null;const d=w.computed(()=>{var v;return((v=a.functionList)==null?void 0:v.length)>0?a.functionList:lNe}),g=w.useModel(o,"modelValue"),p=v=>{g.value=v,c==null||c({data:v})};return Ule("selectFunction",({data:v,callback:x})=>{c=x,g.value=v}),(v,x)=>(w.openBlock(),w.createElementBlock("div",uNe,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(d.value,(T,A)=>(w.openBlock(),w.createElementBlock("div",{key:A},[w.createElementVNode("div",{onClick:()=>{p(T.value)},class:w.normalizeClass(["function-item-wrapper",{active:g.value===T.value}])},[w.createElementVNode("div",fNe,w.toDisplayString(T.value),1),w.createElementVNode("div",mNe,w.toDisplayString(T.label),1)],10,dNe)]))),128))]))}}),Gle=cu(gNe,[["__scopeId","data-v-6e079ff0"]]),hNe=["innerHTML"],qle=w.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const a=w.useModel(o,"modelValue");return(c,d)=>(w.openBlock(),w.createBlock(FM,null,{default:w.withCtx(()=>[w.createElementVNode("div",{innerHTML:a.value},null,8,hNe)]),_:1}))}});function xz(o){return w.getCurrentScope()?(w.onScopeDispose(o),!0):!1}function p0(o){return typeof o=="function"?o():w.unref(o)}const pNe=typeof window<"u"&&typeof document<"u",bNe=o=>typeof o<"u",vNe=Object.prototype.toString,yNe=o=>vNe.call(o)==="[object Object]",wNe=()=>{};function CNe(o,a){function c(...d){return new Promise((g,p)=>{Promise.resolve(o(()=>a.apply(this,d),{fn:a,thisArg:this,args:d})).then(g).catch(p)})}return c}const Yle=o=>o();function SNe(o=Yle){const a=w.ref(!0);function c(){a.value=!1}function d(){a.value=!0}const g=(...p)=>{a.value&&o(...p)};return{isActive:w.readonly(a),pause:c,resume:d,eventFilter:g}}function jre(o,a=!1,c="Timeout"){return new Promise((d,g)=>{setTimeout(a?()=>g(c):d,o)})}function xNe(o,a,c={}){const{eventFilter:d=Yle,...g}=c;return w.watch(o,CNe(d,a),g)}function mA(o,a,c={}){const{eventFilter:d,...g}=c,{eventFilter:p,pause:v,resume:x,isActive:T}=SNe(d);return{stop:xNe(o,a,{...g,eventFilter:p}),pause:v,resume:x,isActive:T}}function ENe(o,a={}){if(!w.isRef(o))return w.toRefs(o);const c=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const d in o.value)c[d]=w.customRef(()=>({get(){return o.value[d]},set(g){var p;if((p=p0(a.replaceRef))!=null?p:!0)if(Array.isArray(o.value)){const x=[...o.value];x[d]=g,o.value=x}else{const x={...o.value,[d]:g};Object.setPrototypeOf(x,Object.getPrototypeOf(o.value)),o.value=x}else o.value[d]=g}}));return c}function Vee(o,a=!1){function c(I,{flush:z="sync",deep:U=!1,timeout:K,throwOnTimeout:X}={}){let Q=null;const ae=[new Promise(Z=>{Q=w.watch(o,Ce=>{I(Ce)!==a&&(Q==null||Q(),Z(Ce))},{flush:z,deep:U,immediate:!0})})];return K!=null&&ae.push(jre(K,X).then(()=>p0(o)).finally(()=>Q==null?void 0:Q())),Promise.race(ae)}function d(I,z){if(!w.isRef(I))return c(Ce=>Ce===I,z);const{flush:U="sync",deep:K=!1,timeout:X,throwOnTimeout:Q}=z??{};let le=null;const Z=[new Promise(Ce=>{le=w.watch([o,I],([ct,Ge])=>{a!==(ct===Ge)&&(le==null||le(),Ce(ct))},{flush:U,deep:K,immediate:!0})})];return X!=null&&Z.push(jre(X,Q).then(()=>p0(o)).finally(()=>(le==null||le(),p0(o)))),Promise.race(Z)}function g(I){return c(z=>!!z,I)}function p(I){return d(null,I)}function v(I){return d(void 0,I)}function x(I){return c(Number.isNaN,I)}function T(I,z){return c(U=>{const K=Array.from(U);return K.includes(I)||K.includes(p0(I))},z)}function A(I){return M(1,I)}function M(I=1,z){let U=-1;return c(()=>(U+=1,U>=I),z)}return Array.isArray(p0(o))?{toMatch:c,toContains:T,changed:A,changedTimes:M,get not(){return Vee(o,!a)}}:{toMatch:c,toBe:d,toBeTruthy:g,toBeNull:p,toBeNaN:x,toBeUndefined:v,changed:A,changedTimes:M,get not(){return Vee(o,!a)}}}function Hee(o){return Vee(o)}function _Ne(o){var a;const c=p0(o);return(a=c==null?void 0:c.$el)!=null?a:c}const Kle=pNe?window:void 0;function Xle(...o){let a,c,d,g;if(typeof o[0]=="string"||Array.isArray(o[0])?([c,d,g]=o,a=Kle):[a,c,d,g]=o,!a)return wNe;Array.isArray(c)||(c=[c]),Array.isArray(d)||(d=[d]);const p=[],v=()=>{p.forEach(M=>M()),p.length=0},x=(M,I,z,U)=>(M.addEventListener(I,z,U),()=>M.removeEventListener(I,z,U)),T=w.watch(()=>[_Ne(a),p0(g)],([M,I])=>{if(v(),!M)return;const z=yNe(I)?{...I}:I;p.push(...c.flatMap(U=>d.map(K=>x(M,U,K,z))))},{immediate:!0,flush:"post"}),A=()=>{T(),v()};return xz(A),A}function TNe(o){return typeof o=="function"?o:typeof o=="string"?a=>a.key===o:Array.isArray(o)?a=>o.includes(a.key):()=>!0}function Wre(...o){let a,c,d={};o.length===3?(a=o[0],c=o[1],d=o[2]):o.length===2?typeof o[1]=="object"?(a=!0,c=o[0],d=o[1]):(a=o[0],c=o[1]):(a=!0,c=o[0]);const{target:g=Kle,eventName:p="keydown",passive:v=!1,dedupe:x=!1}=d,T=TNe(a);return Xle(g,p,M=>{M.repeat&&p0(x)||T(M)&&c(M)},v)}function kNe(o){return JSON.parse(JSON.stringify(o))}function HQ(o,a,c,d={}){var g,p,v;const{clone:x=!1,passive:T=!1,eventName:A,deep:M=!1,defaultValue:I,shouldEmit:z}=d,U=w.getCurrentInstance(),K=c||(U==null?void 0:U.emit)||((g=U==null?void 0:U.$emit)==null?void 0:g.bind(U))||((v=(p=U==null?void 0:U.proxy)==null?void 0:p.$emit)==null?void 0:v.bind(U==null?void 0:U.proxy));let X=A;a||(a="modelValue"),X=X||`update:${a.toString()}`;const Q=Z=>x?typeof x=="function"?x(Z):kNe(Z):Z,le=()=>bNe(o[a])?Q(o[a]):I,ae=Z=>{z?z(Z)&&K(X,Z):K(X,Z)};if(T){const Z=le(),Ce=w.ref(Z);let ct=!1;return w.watch(()=>o[a],Ge=>{ct||(ct=!0,Ce.value=Q(Ge),w.nextTick(()=>ct=!1))}),w.watch(Ce,Ge=>{!ct&&(Ge!==o[a]||M)&&ae(Ge)},{deep:M}),Ce}else return w.computed({get(){return le()},set(Z){ae(Z)}})}var ANe={value:()=>{}};function Ez(){for(var o=0,a=arguments.length,c={},d;o<a;++o){if(!(d=arguments[o]+"")||d in c||/[\s.]/.test(d))throw new Error("illegal type: "+d);c[d]=[]}return new nH(c)}function nH(o){this._=o}function ONe(o,a){return o.trim().split(/^|\s+/).map(function(c){var d="",g=c.indexOf(".");if(g>=0&&(d=c.slice(g+1),c=c.slice(0,g)),c&&!a.hasOwnProperty(c))throw new Error("unknown type: "+c);return{type:c,name:d}})}nH.prototype=Ez.prototype={constructor:nH,on:function(o,a){var c=this._,d=ONe(o+"",c),g,p=-1,v=d.length;if(arguments.length<2){for(;++p<v;)if((g=(o=d[p]).type)&&(g=NNe(c[g],o.name)))return g;return}if(a!=null&&typeof a!="function")throw new Error("invalid callback: "+a);for(;++p<v;)if(g=(o=d[p]).type)c[g]=Zre(c[g],o.name,a);else if(a==null)for(g in c)c[g]=Zre(c[g],o.name,null);return this},copy:function(){var o={},a=this._;for(var c in a)o[c]=a[c].slice();return new nH(o)},call:function(o,a){if((g=arguments.length-2)>0)for(var c=new Array(g),d=0,g,p;d<g;++d)c[d]=arguments[d+2];if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(p=this._[o],d=0,g=p.length;d<g;++d)p[d].value.apply(a,c)},apply:function(o,a,c){if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(var d=this._[o],g=0,p=d.length;g<p;++g)d[g].value.apply(a,c)}};function NNe(o,a){for(var c=0,d=o.length,g;c<d;++c)if((g=o[c]).name===a)return g.value}function Zre(o,a,c){for(var d=0,g=o.length;d<g;++d)if(o[d].name===a){o[d]=ANe,o=o.slice(0,d).concat(o.slice(d+1));break}return c!=null&&o.push({name:a,value:c}),o}var zee="http://www.w3.org/1999/xhtml";const Gre={svg:"http://www.w3.org/2000/svg",xhtml:zee,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _z(o){var a=o+="",c=a.indexOf(":");return c>=0&&(a=o.slice(0,c))!=="xmlns"&&(o=o.slice(c+1)),Gre.hasOwnProperty(a)?{space:Gre[a],local:o}:o}function $Ne(o){return function(){var a=this.ownerDocument,c=this.namespaceURI;return c===zee&&a.documentElement.namespaceURI===zee?a.createElement(o):a.createElementNS(c,o)}}function DNe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Jle(o){var a=_z(o);return(a.local?DNe:$Ne)(a)}function MNe(){}function Zte(o){return o==null?MNe:function(){return this.querySelector(o)}}function RNe(o){typeof o!="function"&&(o=Zte(o));for(var a=this._groups,c=a.length,d=new Array(c),g=0;g<c;++g)for(var p=a[g],v=p.length,x=d[g]=new Array(v),T,A,M=0;M<v;++M)(T=p[M])&&(A=o.call(T,T.__data__,M,p))&&("__data__"in T&&(A.__data__=T.__data__),x[M]=A);return new pg(d,this._parents)}function PNe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function INe(){return[]}function Qle(o){return o==null?INe:function(){return this.querySelectorAll(o)}}function BNe(o){return function(){return PNe(o.apply(this,arguments))}}function FNe(o){typeof o=="function"?o=BNe(o):o=Qle(o);for(var a=this._groups,c=a.length,d=[],g=[],p=0;p<c;++p)for(var v=a[p],x=v.length,T,A=0;A<x;++A)(T=v[A])&&(d.push(o.call(T,T.__data__,A,v)),g.push(T));return new pg(d,g)}function eue(o){return function(){return this.matches(o)}}function tue(o){return function(a){return a.matches(o)}}var LNe=Array.prototype.find;function VNe(o){return function(){return LNe.call(this.children,o)}}function HNe(){return this.firstElementChild}function zNe(o){return this.select(o==null?HNe:VNe(typeof o=="function"?o:tue(o)))}var UNe=Array.prototype.filter;function jNe(){return Array.from(this.children)}function WNe(o){return function(){return UNe.call(this.children,o)}}function ZNe(o){return this.selectAll(o==null?jNe:WNe(typeof o=="function"?o:tue(o)))}function GNe(o){typeof o!="function"&&(o=eue(o));for(var a=this._groups,c=a.length,d=new Array(c),g=0;g<c;++g)for(var p=a[g],v=p.length,x=d[g]=[],T,A=0;A<v;++A)(T=p[A])&&o.call(T,T.__data__,A,p)&&x.push(T);return new pg(d,this._parents)}function nue(o){return new Array(o.length)}function qNe(){return new pg(this._enter||this._groups.map(nue),this._parents)}function TH(o,a){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=a}TH.prototype={constructor:TH,appendChild:function(o){return this._parent.insertBefore(o,this._next)},insertBefore:function(o,a){return this._parent.insertBefore(o,a)},querySelector:function(o){return this._parent.querySelector(o)},querySelectorAll:function(o){return this._parent.querySelectorAll(o)}};function YNe(o){return function(){return o}}function KNe(o,a,c,d,g,p){for(var v=0,x,T=a.length,A=p.length;v<A;++v)(x=a[v])?(x.__data__=p[v],d[v]=x):c[v]=new TH(o,p[v]);for(;v<T;++v)(x=a[v])&&(g[v]=x)}function XNe(o,a,c,d,g,p,v){var x,T,A=new Map,M=a.length,I=p.length,z=new Array(M),U;for(x=0;x<M;++x)(T=a[x])&&(z[x]=U=v.call(T,T.__data__,x,a)+"",A.has(U)?g[x]=T:A.set(U,T));for(x=0;x<I;++x)U=v.call(o,p[x],x,p)+"",(T=A.get(U))?(d[x]=T,T.__data__=p[x],A.delete(U)):c[x]=new TH(o,p[x]);for(x=0;x<M;++x)(T=a[x])&&A.get(z[x])===T&&(g[x]=T)}function JNe(o){return o.__data__}function QNe(o,a){if(!arguments.length)return Array.from(this,JNe);var c=a?XNe:KNe,d=this._parents,g=this._groups;typeof o!="function"&&(o=YNe(o));for(var p=g.length,v=new Array(p),x=new Array(p),T=new Array(p),A=0;A<p;++A){var M=d[A],I=g[A],z=I.length,U=e5e(o.call(M,M&&M.__data__,A,d)),K=U.length,X=x[A]=new Array(K),Q=v[A]=new Array(K),le=T[A]=new Array(z);c(M,I,X,Q,le,U,a);for(var ae=0,Z=0,Ce,ct;ae<K;++ae)if(Ce=X[ae]){for(ae>=Z&&(Z=ae+1);!(ct=Q[Z])&&++Z<K;);Ce._next=ct||null}}return v=new pg(v,d),v._enter=x,v._exit=T,v}function e5e(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function t5e(){return new pg(this._exit||this._groups.map(nue),this._parents)}function n5e(o,a,c){var d=this.enter(),g=this,p=this.exit();return typeof o=="function"?(d=o(d),d&&(d=d.selection())):d=d.append(o+""),a!=null&&(g=a(g),g&&(g=g.selection())),c==null?p.remove():c(p),d&&g?d.merge(g).order():g}function o5e(o){for(var a=o.selection?o.selection():o,c=this._groups,d=a._groups,g=c.length,p=d.length,v=Math.min(g,p),x=new Array(g),T=0;T<v;++T)for(var A=c[T],M=d[T],I=A.length,z=x[T]=new Array(I),U,K=0;K<I;++K)(U=A[K]||M[K])&&(z[K]=U);for(;T<g;++T)x[T]=c[T];return new pg(x,this._parents)}function s5e(){for(var o=this._groups,a=-1,c=o.length;++a<c;)for(var d=o[a],g=d.length-1,p=d[g],v;--g>=0;)(v=d[g])&&(p&&v.compareDocumentPosition(p)^4&&p.parentNode.insertBefore(v,p),p=v);return this}function r5e(o){o||(o=a5e);function a(I,z){return I&&z?o(I.__data__,z.__data__):!I-!z}for(var c=this._groups,d=c.length,g=new Array(d),p=0;p<d;++p){for(var v=c[p],x=v.length,T=g[p]=new Array(x),A,M=0;M<x;++M)(A=v[M])&&(T[M]=A);T.sort(a)}return new pg(g,this._parents).order()}function a5e(o,a){return o<a?-1:o>a?1:o>=a?0:NaN}function i5e(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function c5e(){return Array.from(this)}function l5e(){for(var o=this._groups,a=0,c=o.length;a<c;++a)for(var d=o[a],g=0,p=d.length;g<p;++g){var v=d[g];if(v)return v}return null}function u5e(){let o=0;for(const a of this)++o;return o}function d5e(){return!this.node()}function f5e(o){for(var a=this._groups,c=0,d=a.length;c<d;++c)for(var g=a[c],p=0,v=g.length,x;p<v;++p)(x=g[p])&&o.call(x,x.__data__,p,g);return this}function m5e(o){return function(){this.removeAttribute(o)}}function g5e(o){return function(){this.removeAttributeNS(o.space,o.local)}}function h5e(o,a){return function(){this.setAttribute(o,a)}}function p5e(o,a){return function(){this.setAttributeNS(o.space,o.local,a)}}function b5e(o,a){return function(){var c=a.apply(this,arguments);c==null?this.removeAttribute(o):this.setAttribute(o,c)}}function v5e(o,a){return function(){var c=a.apply(this,arguments);c==null?this.removeAttributeNS(o.space,o.local):this.setAttributeNS(o.space,o.local,c)}}function y5e(o,a){var c=_z(o);if(arguments.length<2){var d=this.node();return c.local?d.getAttributeNS(c.space,c.local):d.getAttribute(c)}return this.each((a==null?c.local?g5e:m5e:typeof a=="function"?c.local?v5e:b5e:c.local?p5e:h5e)(c,a))}function oue(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function w5e(o){return function(){this.style.removeProperty(o)}}function C5e(o,a,c){return function(){this.style.setProperty(o,a,c)}}function S5e(o,a,c){return function(){var d=a.apply(this,arguments);d==null?this.style.removeProperty(o):this.style.setProperty(o,d,c)}}function x5e(o,a,c){return arguments.length>1?this.each((a==null?w5e:typeof a=="function"?S5e:C5e)(o,a,c??"")):MA(this.node(),o)}function MA(o,a){return o.style.getPropertyValue(a)||oue(o).getComputedStyle(o,null).getPropertyValue(a)}function E5e(o){return function(){delete this[o]}}function _5e(o,a){return function(){this[o]=a}}function T5e(o,a){return function(){var c=a.apply(this,arguments);c==null?delete this[o]:this[o]=c}}function k5e(o,a){return arguments.length>1?this.each((a==null?E5e:typeof a=="function"?T5e:_5e)(o,a)):this.node()[o]}function sue(o){return o.trim().split(/^|\s+/)}function Gte(o){return o.classList||new rue(o)}function rue(o){this._node=o,this._names=sue(o.getAttribute("class")||"")}rue.prototype={add:function(o){var a=this._names.indexOf(o);a<0&&(this._names.push(o),this._node.setAttribute("class",this._names.join(" ")))},remove:function(o){var a=this._names.indexOf(o);a>=0&&(this._names.splice(a,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(o){return this._names.indexOf(o)>=0}};function aue(o,a){for(var c=Gte(o),d=-1,g=a.length;++d<g;)c.add(a[d])}function iue(o,a){for(var c=Gte(o),d=-1,g=a.length;++d<g;)c.remove(a[d])}function A5e(o){return function(){aue(this,o)}}function O5e(o){return function(){iue(this,o)}}function N5e(o,a){return function(){(a.apply(this,arguments)?aue:iue)(this,o)}}function $5e(o,a){var c=sue(o+"");if(arguments.length<2){for(var d=Gte(this.node()),g=-1,p=c.length;++g<p;)if(!d.contains(c[g]))return!1;return!0}return this.each((typeof a=="function"?N5e:a?A5e:O5e)(c,a))}function D5e(){this.textContent=""}function M5e(o){return function(){this.textContent=o}}function R5e(o){return function(){var a=o.apply(this,arguments);this.textContent=a??""}}function P5e(o){return arguments.length?this.each(o==null?D5e:(typeof o=="function"?R5e:M5e)(o)):this.node().textContent}function I5e(){this.innerHTML=""}function B5e(o){return function(){this.innerHTML=o}}function F5e(o){return function(){var a=o.apply(this,arguments);this.innerHTML=a??""}}function L5e(o){return arguments.length?this.each(o==null?I5e:(typeof o=="function"?F5e:B5e)(o)):this.node().innerHTML}function V5e(){this.nextSibling&&this.parentNode.appendChild(this)}function H5e(){return this.each(V5e)}function z5e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function U5e(){return this.each(z5e)}function j5e(o){var a=typeof o=="function"?o:Jle(o);return this.select(function(){return this.appendChild(a.apply(this,arguments))})}function W5e(){return null}function Z5e(o,a){var c=typeof o=="function"?o:Jle(o),d=a==null?W5e:typeof a=="function"?a:Zte(a);return this.select(function(){return this.insertBefore(c.apply(this,arguments),d.apply(this,arguments)||null)})}function G5e(){var o=this.parentNode;o&&o.removeChild(this)}function q5e(){return this.each(G5e)}function Y5e(){var o=this.cloneNode(!1),a=this.parentNode;return a?a.insertBefore(o,this.nextSibling):o}function K5e(){var o=this.cloneNode(!0),a=this.parentNode;return a?a.insertBefore(o,this.nextSibling):o}function X5e(o){return this.select(o?K5e:Y5e)}function J5e(o){return arguments.length?this.property("__data__",o):this.node().__data__}function Q5e(o){return function(a){o.call(this,a,this.__data__)}}function e$e(o){return o.trim().split(/^|\s+/).map(function(a){var c="",d=a.indexOf(".");return d>=0&&(c=a.slice(d+1),a=a.slice(0,d)),{type:a,name:c}})}function t$e(o){return function(){var a=this.__on;if(a){for(var c=0,d=-1,g=a.length,p;c<g;++c)p=a[c],(!o.type||p.type===o.type)&&p.name===o.name?this.removeEventListener(p.type,p.listener,p.options):a[++d]=p;++d?a.length=d:delete this.__on}}}function n$e(o,a,c){return function(){var d=this.__on,g,p=Q5e(a);if(d){for(var v=0,x=d.length;v<x;++v)if((g=d[v]).type===o.type&&g.name===o.name){this.removeEventListener(g.type,g.listener,g.options),this.addEventListener(g.type,g.listener=p,g.options=c),g.value=a;return}}this.addEventListener(o.type,p,c),g={type:o.type,name:o.name,value:a,listener:p,options:c},d?d.push(g):this.__on=[g]}}function o$e(o,a,c){var d=e$e(o+""),g,p=d.length,v;if(arguments.length<2){var x=this.node().__on;if(x){for(var T=0,A=x.length,M;T<A;++T)for(g=0,M=x[T];g<p;++g)if((v=d[g]).type===M.type&&v.name===M.name)return M.value}return}for(x=a?n$e:t$e,g=0;g<p;++g)this.each(x(d[g],a,c));return this}function cue(o,a,c){var d=oue(o),g=d.CustomEvent;typeof g=="function"?g=new g(a,c):(g=d.document.createEvent("Event"),c?(g.initEvent(a,c.bubbles,c.cancelable),g.detail=c.detail):g.initEvent(a,!1,!1)),o.dispatchEvent(g)}function s$e(o,a){return function(){return cue(this,o,a)}}function r$e(o,a){return function(){return cue(this,o,a.apply(this,arguments))}}function a$e(o,a){return this.each((typeof a=="function"?r$e:s$e)(o,a))}function*i$e(){for(var o=this._groups,a=0,c=o.length;a<c;++a)for(var d=o[a],g=0,p=d.length,v;g<p;++g)(v=d[g])&&(yield v)}var lue=[null];function pg(o,a){this._groups=o,this._parents=a}function LM(){return new pg([[document.documentElement]],lue)}function c$e(){return this}pg.prototype=LM.prototype={constructor:pg,select:RNe,selectAll:FNe,selectChild:zNe,selectChildren:ZNe,filter:GNe,data:QNe,enter:qNe,exit:t5e,join:n5e,merge:o5e,selection:c$e,order:s5e,sort:r5e,call:i5e,nodes:c5e,node:l5e,size:u5e,empty:d5e,each:f5e,attr:y5e,style:x5e,property:k5e,classed:$5e,text:P5e,html:L5e,raise:H5e,lower:U5e,append:j5e,insert:Z5e,remove:q5e,clone:X5e,datum:J5e,on:o$e,dispatch:a$e,[Symbol.iterator]:i$e};function kp(o){return typeof o=="string"?new pg([[document.querySelector(o)]],[document.documentElement]):new pg([[o]],lue)}function l$e(o){let a;for(;a=o.sourceEvent;)o=a;return o}function gb(o,a){if(o=l$e(o),a===void 0&&(a=o.currentTarget),a){var c=a.ownerSVGElement||a;if(c.createSVGPoint){var d=c.createSVGPoint();return d.x=o.clientX,d.y=o.clientY,d=d.matrixTransform(a.getScreenCTM().inverse()),[d.x,d.y]}if(a.getBoundingClientRect){var g=a.getBoundingClientRect();return[o.clientX-g.left-a.clientLeft,o.clientY-g.top-a.clientTop]}}return[o.pageX,o.pageY]}const u$e={passive:!1},vM={capture:!0,passive:!1};function zQ(o){o.stopImmediatePropagation()}function TA(o){o.preventDefault(),o.stopImmediatePropagation()}function uue(o){var a=o.document.documentElement,c=kp(o).on("dragstart.drag",TA,vM);"onselectstart"in a?c.on("selectstart.drag",TA,vM):(a.__noselect=a.style.MozUserSelect,a.style.MozUserSelect="none")}function due(o,a){var c=o.document.documentElement,d=kp(o).on("dragstart.drag",null);a&&(d.on("click.drag",TA,vM),setTimeout(function(){d.on("click.drag",null)},0)),"onselectstart"in c?d.on("selectstart.drag",null):(c.style.MozUserSelect=c.__noselect,delete c.__noselect)}const PV=o=>()=>o;function Uee(o,{sourceEvent:a,subject:c,target:d,identifier:g,active:p,x:v,y:x,dx:T,dy:A,dispatch:M}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:a,enumerable:!0,configurable:!0},subject:{value:c,enumerable:!0,configurable:!0},target:{value:d,enumerable:!0,configurable:!0},identifier:{value:g,enumerable:!0,configurable:!0},active:{value:p,enumerable:!0,configurable:!0},x:{value:v,enumerable:!0,configurable:!0},y:{value:x,enumerable:!0,configurable:!0},dx:{value:T,enumerable:!0,configurable:!0},dy:{value:A,enumerable:!0,configurable:!0},_:{value:M}})}Uee.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function d$e(o){return!o.ctrlKey&&!o.button}function f$e(){return this.parentNode}function m$e(o,a){return a??{x:o.x,y:o.y}}function g$e(){return navigator.maxTouchPoints||"ontouchstart"in this}function h$e(){var o=d$e,a=f$e,c=m$e,d=g$e,g={},p=Ez("start","drag","end"),v=0,x,T,A,M,I=0;function z(Ce){Ce.on("mousedown.drag",U).filter(d).on("touchstart.drag",Q).on("touchmove.drag",le,u$e).on("touchend.drag touchcancel.drag",ae).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function U(Ce,ct){if(!(M||!o.call(this,Ce,ct))){var Ge=Z(this,a.call(this,Ce,ct),Ce,ct,"mouse");Ge&&(kp(Ce.view).on("mousemove.drag",K,vM).on("mouseup.drag",X,vM),uue(Ce.view),zQ(Ce),A=!1,x=Ce.clientX,T=Ce.clientY,Ge("start",Ce))}}function K(Ce){if(TA(Ce),!A){var ct=Ce.clientX-x,Ge=Ce.clientY-T;A=ct*ct+Ge*Ge>I}g.mouse("drag",Ce)}function X(Ce){kp(Ce.view).on("mousemove.drag mouseup.drag",null),due(Ce.view,A),TA(Ce),g.mouse("end",Ce)}function Q(Ce,ct){if(o.call(this,Ce,ct)){var Ge=Ce.changedTouches,oe=a.call(this,Ce,ct),Ze=Ge.length,yt,_t;for(yt=0;yt<Ze;++yt)(_t=Z(this,oe,Ce,ct,Ge[yt].identifier,Ge[yt]))&&(zQ(Ce),_t("start",Ce,Ge[yt]))}}function le(Ce){var ct=Ce.changedTouches,Ge=ct.length,oe,Ze;for(oe=0;oe<Ge;++oe)(Ze=g[ct[oe].identifier])&&(TA(Ce),Ze("drag",Ce,ct[oe]))}function ae(Ce){var ct=Ce.changedTouches,Ge=ct.length,oe,Ze;for(M&&clearTimeout(M),M=setTimeout(function(){M=null},500),oe=0;oe<Ge;++oe)(Ze=g[ct[oe].identifier])&&(zQ(Ce),Ze("end",Ce,ct[oe]))}function Z(Ce,ct,Ge,oe,Ze,yt){var _t=p.copy(),Re=gb(yt||Ge,ct),ue,Xt,Se;if((Se=c.call(Ce,new Uee("beforestart",{sourceEvent:Ge,target:z,identifier:Ze,active:v,x:Re[0],y:Re[1],dx:0,dy:0,dispatch:_t}),oe))!=null)return ue=Se.x-Re[0]||0,Xt=Se.y-Re[1]||0,function Ie(D,ze,be){var tt=Re,nt;switch(D){case"start":g[Ze]=Ie,nt=v++;break;case"end":delete g[Ze],--v;case"drag":Re=gb(be||ze,ct),nt=v;break}_t.call(D,Ce,new Uee(D,{sourceEvent:ze,subject:Se,target:z,identifier:Ze,active:nt,x:Re[0]+ue,y:Re[1]+Xt,dx:Re[0]-tt[0],dy:Re[1]-tt[1],dispatch:_t}),oe)}}return z.filter=function(Ce){return arguments.length?(o=typeof Ce=="function"?Ce:PV(!!Ce),z):o},z.container=function(Ce){return arguments.length?(a=typeof Ce=="function"?Ce:PV(Ce),z):a},z.subject=function(Ce){return arguments.length?(c=typeof Ce=="function"?Ce:PV(Ce),z):c},z.touchable=function(Ce){return arguments.length?(d=typeof Ce=="function"?Ce:PV(!!Ce),z):d},z.on=function(){var Ce=p.on.apply(p,arguments);return Ce===p?z:Ce},z.clickDistance=function(Ce){return arguments.length?(I=(Ce=+Ce)*Ce,z):Math.sqrt(I)},z}function qte(o,a,c){o.prototype=a.prototype=c,c.constructor=o}function fue(o,a){var c=Object.create(o.prototype);for(var d in a)c[d]=a[d];return c}function VM(){}var yM=.7,kH=1/yM,kA="\\s*([+-]?\\d+)\\s*",wM="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",p$e=/^#([0-9a-f]{3,8})$/,b$e=new RegExp(`^rgb\\(${kA},${kA},${kA}\\)$`),v$e=new RegExp(`^rgb\\(${pb},${pb},${pb}\\)$`),y$e=new RegExp(`^rgba\\(${kA},${kA},${kA},${wM}\\)$`),w$e=new RegExp(`^rgba\\(${pb},${pb},${pb},${wM}\\)$`),C$e=new RegExp(`^hsl\\(${wM},${pb},${pb}\\)$`),S$e=new RegExp(`^hsla\\(${wM},${pb},${pb},${wM}\\)$`),qre={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};qte(VM,CM,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:Yre,formatHex:Yre,formatHex8:x$e,formatHsl:E$e,formatRgb:Kre,toString:Kre});function Yre(){return this.rgb().formatHex()}function x$e(){return this.rgb().formatHex8()}function E$e(){return mue(this).formatHsl()}function Kre(){return this.rgb().formatRgb()}function CM(o){var a,c;return o=(o+"").trim().toLowerCase(),(a=p$e.exec(o))?(c=a[1].length,a=parseInt(a[1],16),c===6?Xre(a):c===3?new bm(a>>8&15|a>>4&240,a>>4&15|a&240,(a&15)<<4|a&15,1):c===8?IV(a>>24&255,a>>16&255,a>>8&255,(a&255)/255):c===4?IV(a>>12&15|a>>8&240,a>>8&15|a>>4&240,a>>4&15|a&240,((a&15)<<4|a&15)/255):null):(a=b$e.exec(o))?new bm(a[1],a[2],a[3],1):(a=v$e.exec(o))?new bm(a[1]*255/100,a[2]*255/100,a[3]*255/100,1):(a=y$e.exec(o))?IV(a[1],a[2],a[3],a[4]):(a=w$e.exec(o))?IV(a[1]*255/100,a[2]*255/100,a[3]*255/100,a[4]):(a=C$e.exec(o))?eae(a[1],a[2]/100,a[3]/100,1):(a=S$e.exec(o))?eae(a[1],a[2]/100,a[3]/100,a[4]):qre.hasOwnProperty(o)?Xre(qre[o]):o==="transparent"?new bm(NaN,NaN,NaN,0):null}function Xre(o){return new bm(o>>16&255,o>>8&255,o&255,1)}function IV(o,a,c,d){return d<=0&&(o=a=c=NaN),new bm(o,a,c,d)}function _$e(o){return o instanceof VM||(o=CM(o)),o?(o=o.rgb(),new bm(o.r,o.g,o.b,o.opacity)):new bm}function jee(o,a,c,d){return arguments.length===1?_$e(o):new bm(o,a,c,d??1)}function bm(o,a,c,d){this.r=+o,this.g=+a,this.b=+c,this.opacity=+d}qte(bm,jee,fue(VM,{brighter(o){return o=o==null?kH:Math.pow(kH,o),new bm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?yM:Math.pow(yM,o),new bm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new bm(qx(this.r),qx(this.g),qx(this.b),AH(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:Jre,formatHex:Jre,formatHex8:T$e,formatRgb:Qre,toString:Qre}));function Jre(){return`#${Hx(this.r)}${Hx(this.g)}${Hx(this.b)}`}function T$e(){return`#${Hx(this.r)}${Hx(this.g)}${Hx(this.b)}${Hx((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qre(){const o=AH(this.opacity);return`${o===1?"rgb(":"rgba("}${qx(this.r)}, ${qx(this.g)}, ${qx(this.b)}${o===1?")":`, ${o})`}`}function AH(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function qx(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function Hx(o){return o=qx(o),(o<16?"0":"")+o.toString(16)}function eae(o,a,c,d){return d<=0?o=a=c=NaN:c<=0||c>=1?o=a=NaN:a<=0&&(o=NaN),new Ap(o,a,c,d)}function mue(o){if(o instanceof Ap)return new Ap(o.h,o.s,o.l,o.opacity);if(o instanceof VM||(o=CM(o)),!o)return new Ap;if(o instanceof Ap)return o;o=o.rgb();var a=o.r/255,c=o.g/255,d=o.b/255,g=Math.min(a,c,d),p=Math.max(a,c,d),v=NaN,x=p-g,T=(p+g)/2;return x?(a===p?v=(c-d)/x+(c<d)*6:c===p?v=(d-a)/x+2:v=(a-c)/x+4,x/=T<.5?p+g:2-p-g,v*=60):x=T>0&&T<1?0:v,new Ap(v,x,T,o.opacity)}function k$e(o,a,c,d){return arguments.length===1?mue(o):new Ap(o,a,c,d??1)}function Ap(o,a,c,d){this.h=+o,this.s=+a,this.l=+c,this.opacity=+d}qte(Ap,k$e,fue(VM,{brighter(o){return o=o==null?kH:Math.pow(kH,o),new Ap(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?yM:Math.pow(yM,o),new Ap(this.h,this.s,this.l*o,this.opacity)},rgb(){var o=this.h%360+(this.h<0)*360,a=isNaN(o)||isNaN(this.s)?0:this.s,c=this.l,d=c+(c<.5?c:1-c)*a,g=2*c-d;return new bm(UQ(o>=240?o-240:o+120,g,d),UQ(o,g,d),UQ(o<120?o+240:o-120,g,d),this.opacity)},clamp(){return new Ap(tae(this.h),BV(this.s),BV(this.l),AH(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=AH(this.opacity);return`${o===1?"hsl(":"hsla("}${tae(this.h)}, ${BV(this.s)*100}%, ${BV(this.l)*100}%${o===1?")":`, ${o})`}`}}));function tae(o){return o=(o||0)%360,o<0?o+360:o}function BV(o){return Math.max(0,Math.min(1,o||0))}function UQ(o,a,c){return(o<60?a+(c-a)*o/60:o<180?c:o<240?a+(c-a)*(240-o)/60:a)*255}const gue=o=>()=>o;function A$e(o,a){return function(c){return o+c*a}}function O$e(o,a,c){return o=Math.pow(o,c),a=Math.pow(a,c)-o,c=1/c,function(d){return Math.pow(o+d*a,c)}}function N$e(o){return(o=+o)==1?hue:function(a,c){return c-a?O$e(a,c,o):gue(isNaN(a)?c:a)}}function hue(o,a){var c=a-o;return c?A$e(o,c):gue(isNaN(o)?a:o)}const nae=function o(a){var c=N$e(a);function d(g,p){var v=c((g=jee(g)).r,(p=jee(p)).r),x=c(g.g,p.g),T=c(g.b,p.b),A=hue(g.opacity,p.opacity);return function(M){return g.r=v(M),g.g=x(M),g.b=T(M),g.opacity=A(M),g+""}}return d.gamma=o,d}(1);function Vw(o,a){return o=+o,a=+a,function(c){return o*(1-c)+a*c}}var Wee=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,jQ=new RegExp(Wee.source,"g");function $$e(o){return function(){return o}}function D$e(o){return function(a){return o(a)+""}}function M$e(o,a){var c=Wee.lastIndex=jQ.lastIndex=0,d,g,p,v=-1,x=[],T=[];for(o=o+"",a=a+"";(d=Wee.exec(o))&&(g=jQ.exec(a));)(p=g.index)>c&&(p=a.slice(c,p),x[v]?x[v]+=p:x[++v]=p),(d=d[0])===(g=g[0])?x[v]?x[v]+=g:x[++v]=g:(x[++v]=null,T.push({i:v,x:Vw(d,g)})),c=jQ.lastIndex;return c<a.length&&(p=a.slice(c),x[v]?x[v]+=p:x[++v]=p),x.length<2?T[0]?D$e(T[0].x):$$e(a):(a=T.length,function(A){for(var M=0,I;M<a;++M)x[(I=T[M]).i]=I.x(A);return x.join("")})}var oae=180/Math.PI,Zee={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pue(o,a,c,d,g,p){var v,x,T;return(v=Math.sqrt(o*o+a*a))&&(o/=v,a/=v),(T=o*c+a*d)&&(c-=o*T,d-=a*T),(x=Math.sqrt(c*c+d*d))&&(c/=x,d/=x,T/=x),o*d<a*c&&(o=-o,a=-a,T=-T,v=-v),{translateX:g,translateY:p,rotate:Math.atan2(a,o)*oae,skewX:Math.atan(T)*oae,scaleX:v,scaleY:x}}var FV;function R$e(o){const a=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return a.isIdentity?Zee:pue(a.a,a.b,a.c,a.d,a.e,a.f)}function P$e(o){return o==null||(FV||(FV=document.createElementNS("http://www.w3.org/2000/svg","g")),FV.setAttribute("transform",o),!(o=FV.transform.baseVal.consolidate()))?Zee:(o=o.matrix,pue(o.a,o.b,o.c,o.d,o.e,o.f))}function bue(o,a,c,d){function g(A){return A.length?A.pop()+" ":""}function p(A,M,I,z,U,K){if(A!==I||M!==z){var X=U.push("translate(",null,a,null,c);K.push({i:X-4,x:Vw(A,I)},{i:X-2,x:Vw(M,z)})}else(I||z)&&U.push("translate("+I+a+z+c)}function v(A,M,I,z){A!==M?(A-M>180?M+=360:M-A>180&&(A+=360),z.push({i:I.push(g(I)+"rotate(",null,d)-2,x:Vw(A,M)})):M&&I.push(g(I)+"rotate("+M+d)}function x(A,M,I,z){A!==M?z.push({i:I.push(g(I)+"skewX(",null,d)-2,x:Vw(A,M)}):M&&I.push(g(I)+"skewX("+M+d)}function T(A,M,I,z,U,K){if(A!==I||M!==z){var X=U.push(g(U)+"scale(",null,",",null,")");K.push({i:X-4,x:Vw(A,I)},{i:X-2,x:Vw(M,z)})}else(I!==1||z!==1)&&U.push(g(U)+"scale("+I+","+z+")")}return function(A,M){var I=[],z=[];return A=o(A),M=o(M),p(A.translateX,A.translateY,M.translateX,M.translateY,I,z),v(A.rotate,M.rotate,I,z),x(A.skewX,M.skewX,I,z),T(A.scaleX,A.scaleY,M.scaleX,M.scaleY,I,z),A=M=null,function(U){for(var K=-1,X=z.length,Q;++K<X;)I[(Q=z[K]).i]=Q.x(U);return I.join("")}}}var I$e=bue(R$e,"px, ","px)","deg)"),B$e=bue(P$e,", ",")",")"),F$e=1e-12;function sae(o){return((o=Math.exp(o))+1/o)/2}function L$e(o){return((o=Math.exp(o))-1/o)/2}function V$e(o){return((o=Math.exp(2*o))-1)/(o+1)}const H$e=function o(a,c,d){function g(p,v){var x=p[0],T=p[1],A=p[2],M=v[0],I=v[1],z=v[2],U=M-x,K=I-T,X=U*U+K*K,Q,le;if(X<F$e)le=Math.log(z/A)/a,Q=function(oe){return[x+oe*U,T+oe*K,A*Math.exp(a*oe*le)]};else{var ae=Math.sqrt(X),Z=(z*z-A*A+d*X)/(2*A*c*ae),Ce=(z*z-A*A-d*X)/(2*z*c*ae),ct=Math.log(Math.sqrt(Z*Z+1)-Z),Ge=Math.log(Math.sqrt(Ce*Ce+1)-Ce);le=(Ge-ct)/a,Q=function(oe){var Ze=oe*le,yt=sae(ct),_t=A/(c*ae)*(yt*V$e(a*Ze+ct)-L$e(ct));return[x+_t*U,T+_t*K,A*yt/sae(a*Ze+ct)]}}return Q.duration=le*1e3*a/Math.SQRT2,Q}return g.rho=function(p){var v=Math.max(.001,+p),x=v*v,T=x*x;return o(v,x,T)},g}(Math.SQRT2,2,4);var RA=0,X6=0,Y6=0,vue=1e3,OH,J6,NH=0,Qx=0,Tz=0,SM=typeof performance=="object"&&performance.now?performance:Date,yue=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function Yte(){return Qx||(yue(z$e),Qx=SM.now()+Tz)}function z$e(){Qx=0}function $H(){this._call=this._time=this._next=null}$H.prototype=wue.prototype={constructor:$H,restart:function(o,a,c){if(typeof o!="function")throw new TypeError("callback is not a function");c=(c==null?Yte():+c)+(a==null?0:+a),!this._next&&J6!==this&&(J6?J6._next=this:OH=this,J6=this),this._call=o,this._time=c,Gee()},stop:function(){this._call&&(this._call=null,this._time=1/0,Gee())}};function wue(o,a,c){var d=new $H;return d.restart(o,a,c),d}function U$e(){Yte(),++RA;for(var o=OH,a;o;)(a=Qx-o._time)>=0&&o._call.call(void 0,a),o=o._next;--RA}function rae(){Qx=(NH=SM.now())+Tz,RA=X6=0;try{U$e()}finally{RA=0,W$e(),Qx=0}}function j$e(){var o=SM.now(),a=o-NH;a>vue&&(Tz-=a,NH=o)}function W$e(){for(var o,a=OH,c,d=1/0;a;)a._call?(d>a._time&&(d=a._time),o=a,a=a._next):(c=a._next,a._next=null,a=o?o._next=c:OH=c);J6=o,Gee(d)}function Gee(o){if(!RA){X6&&(X6=clearTimeout(X6));var a=o-Qx;a>24?(o<1/0&&(X6=setTimeout(rae,o-SM.now()-Tz)),Y6&&(Y6=clearInterval(Y6))):(Y6||(NH=SM.now(),Y6=setInterval(j$e,vue)),RA=1,yue(rae))}}function aae(o,a,c){var d=new $H;return a=a==null?0:+a,d.restart(g=>{d.stop(),o(g+a)},a,c),d}var Z$e=Ez("start","end","cancel","interrupt"),G$e=[],Cue=0,iae=1,qee=2,oH=3,cae=4,Yee=5,sH=6;function kz(o,a,c,d,g,p){var v=o.__transition;if(!v)o.__transition={};else if(c in v)return;q$e(o,c,{name:a,index:d,group:g,on:Z$e,tween:G$e,time:p.time,delay:p.delay,duration:p.duration,ease:p.ease,timer:null,state:Cue})}function Kte(o,a){var c=$p(o,a);if(c.state>Cue)throw new Error("too late; already scheduled");return c}function Cb(o,a){var c=$p(o,a);if(c.state>oH)throw new Error("too late; already running");return c}function $p(o,a){var c=o.__transition;if(!c||!(c=c[a]))throw new Error("transition not found");return c}function q$e(o,a,c){var d=o.__transition,g;d[a]=c,c.timer=wue(p,0,c.time);function p(A){c.state=iae,c.timer.restart(v,c.delay,c.time),c.delay<=A&&v(A-c.delay)}function v(A){var M,I,z,U;if(c.state!==iae)return T();for(M in d)if(U=d[M],U.name===c.name){if(U.state===oH)return aae(v);U.state===cae?(U.state=sH,U.timer.stop(),U.on.call("interrupt",o,o.__data__,U.index,U.group),delete d[M]):+M<a&&(U.state=sH,U.timer.stop(),U.on.call("cancel",o,o.__data__,U.index,U.group),delete d[M])}if(aae(function(){c.state===oH&&(c.state=cae,c.timer.restart(x,c.delay,c.time),x(A))}),c.state=qee,c.on.call("start",o,o.__data__,c.index,c.group),c.state===qee){for(c.state=oH,g=new Array(z=c.tween.length),M=0,I=-1;M<z;++M)(U=c.tween[M].value.call(o,o.__data__,c.index,c.group))&&(g[++I]=U);g.length=I+1}}function x(A){for(var M=A<c.duration?c.ease.call(null,A/c.duration):(c.timer.restart(T),c.state=Yee,1),I=-1,z=g.length;++I<z;)g[I].call(o,M);c.state===Yee&&(c.on.call("end",o,o.__data__,c.index,c.group),T())}function T(){c.state=sH,c.timer.stop(),delete d[a];for(var A in d)return;delete o.__transition}}function rH(o,a){var c=o.__transition,d,g,p=!0,v;if(c){a=a==null?null:a+"";for(v in c){if((d=c[v]).name!==a){p=!1;continue}g=d.state>qee&&d.state<Yee,d.state=sH,d.timer.stop(),d.on.call(g?"interrupt":"cancel",o,o.__data__,d.index,d.group),delete c[v]}p&&delete o.__transition}}function Y$e(o){return this.each(function(){rH(this,o)})}function K$e(o,a){var c,d;return function(){var g=Cb(this,o),p=g.tween;if(p!==c){d=c=p;for(var v=0,x=d.length;v<x;++v)if(d[v].name===a){d=d.slice(),d.splice(v,1);break}}g.tween=d}}function X$e(o,a,c){var d,g;if(typeof c!="function")throw new Error;return function(){var p=Cb(this,o),v=p.tween;if(v!==d){g=(d=v).slice();for(var x={name:a,value:c},T=0,A=g.length;T<A;++T)if(g[T].name===a){g[T]=x;break}T===A&&g.push(x)}p.tween=g}}function J$e(o,a){var c=this._id;if(o+="",arguments.length<2){for(var d=$p(this.node(),c).tween,g=0,p=d.length,v;g<p;++g)if((v=d[g]).name===o)return v.value;return null}return this.each((a==null?K$e:X$e)(c,o,a))}function Xte(o,a,c){var d=o._id;return o.each(function(){var g=Cb(this,d);(g.value||(g.value={}))[a]=c.apply(this,arguments)}),function(g){return $p(g,d).value[a]}}function Sue(o,a){var c;return(typeof a=="number"?Vw:a instanceof CM?nae:(c=CM(a))?(a=c,nae):M$e)(o,a)}function Q$e(o){return function(){this.removeAttribute(o)}}function eDe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function tDe(o,a,c){var d,g=c+"",p;return function(){var v=this.getAttribute(o);return v===g?null:v===d?p:p=a(d=v,c)}}function nDe(o,a,c){var d,g=c+"",p;return function(){var v=this.getAttributeNS(o.space,o.local);return v===g?null:v===d?p:p=a(d=v,c)}}function oDe(o,a,c){var d,g,p;return function(){var v,x=c(this),T;return x==null?void this.removeAttribute(o):(v=this.getAttribute(o),T=x+"",v===T?null:v===d&&T===g?p:(g=T,p=a(d=v,x)))}}function sDe(o,a,c){var d,g,p;return function(){var v,x=c(this),T;return x==null?void this.removeAttributeNS(o.space,o.local):(v=this.getAttributeNS(o.space,o.local),T=x+"",v===T?null:v===d&&T===g?p:(g=T,p=a(d=v,x)))}}function rDe(o,a){var c=_z(o),d=c==="transform"?B$e:Sue;return this.attrTween(o,typeof a=="function"?(c.local?sDe:oDe)(c,d,Xte(this,"attr."+o,a)):a==null?(c.local?eDe:Q$e)(c):(c.local?nDe:tDe)(c,d,a))}function aDe(o,a){return function(c){this.setAttribute(o,a.call(this,c))}}function iDe(o,a){return function(c){this.setAttributeNS(o.space,o.local,a.call(this,c))}}function cDe(o,a){var c,d;function g(){var p=a.apply(this,arguments);return p!==d&&(c=(d=p)&&iDe(o,p)),c}return g._value=a,g}function lDe(o,a){var c,d;function g(){var p=a.apply(this,arguments);return p!==d&&(c=(d=p)&&aDe(o,p)),c}return g._value=a,g}function uDe(o,a){var c="attr."+o;if(arguments.length<2)return(c=this.tween(c))&&c._value;if(a==null)return this.tween(c,null);if(typeof a!="function")throw new Error;var d=_z(o);return this.tween(c,(d.local?cDe:lDe)(d,a))}function dDe(o,a){return function(){Kte(this,o).delay=+a.apply(this,arguments)}}function fDe(o,a){return a=+a,function(){Kte(this,o).delay=a}}function mDe(o){var a=this._id;return arguments.length?this.each((typeof o=="function"?dDe:fDe)(a,o)):$p(this.node(),a).delay}function gDe(o,a){return function(){Cb(this,o).duration=+a.apply(this,arguments)}}function hDe(o,a){return a=+a,function(){Cb(this,o).duration=a}}function pDe(o){var a=this._id;return arguments.length?this.each((typeof o=="function"?gDe:hDe)(a,o)):$p(this.node(),a).duration}function bDe(o,a){if(typeof a!="function")throw new Error;return function(){Cb(this,o).ease=a}}function vDe(o){var a=this._id;return arguments.length?this.each(bDe(a,o)):$p(this.node(),a).ease}function yDe(o,a){return function(){var c=a.apply(this,arguments);if(typeof c!="function")throw new Error;Cb(this,o).ease=c}}function wDe(o){if(typeof o!="function")throw new Error;return this.each(yDe(this._id,o))}function CDe(o){typeof o!="function"&&(o=eue(o));for(var a=this._groups,c=a.length,d=new Array(c),g=0;g<c;++g)for(var p=a[g],v=p.length,x=d[g]=[],T,A=0;A<v;++A)(T=p[A])&&o.call(T,T.__data__,A,p)&&x.push(T);return new S0(d,this._parents,this._name,this._id)}function SDe(o){if(o._id!==this._id)throw new Error;for(var a=this._groups,c=o._groups,d=a.length,g=c.length,p=Math.min(d,g),v=new Array(d),x=0;x<p;++x)for(var T=a[x],A=c[x],M=T.length,I=v[x]=new Array(M),z,U=0;U<M;++U)(z=T[U]||A[U])&&(I[U]=z);for(;x<d;++x)v[x]=a[x];return new S0(v,this._parents,this._name,this._id)}function xDe(o){return(o+"").trim().split(/^|\s+/).every(function(a){var c=a.indexOf(".");return c>=0&&(a=a.slice(0,c)),!a||a==="start"})}function EDe(o,a,c){var d,g,p=xDe(a)?Kte:Cb;return function(){var v=p(this,o),x=v.on;x!==d&&(g=(d=x).copy()).on(a,c),v.on=g}}function _De(o,a){var c=this._id;return arguments.length<2?$p(this.node(),c).on.on(o):this.each(EDe(c,o,a))}function TDe(o){return function(){var a=this.parentNode;for(var c in this.__transition)if(+c!==o)return;a&&a.removeChild(this)}}function kDe(){return this.on("end.remove",TDe(this._id))}function ADe(o){var a=this._name,c=this._id;typeof o!="function"&&(o=Zte(o));for(var d=this._groups,g=d.length,p=new Array(g),v=0;v<g;++v)for(var x=d[v],T=x.length,A=p[v]=new Array(T),M,I,z=0;z<T;++z)(M=x[z])&&(I=o.call(M,M.__data__,z,x))&&("__data__"in M&&(I.__data__=M.__data__),A[z]=I,kz(A[z],a,c,z,A,$p(M,c)));return new S0(p,this._parents,a,c)}function ODe(o){var a=this._name,c=this._id;typeof o!="function"&&(o=Qle(o));for(var d=this._groups,g=d.length,p=[],v=[],x=0;x<g;++x)for(var T=d[x],A=T.length,M,I=0;I<A;++I)if(M=T[I]){for(var z=o.call(M,M.__data__,I,T),U,K=$p(M,c),X=0,Q=z.length;X<Q;++X)(U=z[X])&&kz(U,a,c,X,z,K);p.push(z),v.push(M)}return new S0(p,v,a,c)}var NDe=LM.prototype.constructor;function $De(){return new NDe(this._groups,this._parents)}function DDe(o,a){var c,d,g;return function(){var p=MA(this,o),v=(this.style.removeProperty(o),MA(this,o));return p===v?null:p===c&&v===d?g:g=a(c=p,d=v)}}function xue(o){return function(){this.style.removeProperty(o)}}function MDe(o,a,c){var d,g=c+"",p;return function(){var v=MA(this,o);return v===g?null:v===d?p:p=a(d=v,c)}}function RDe(o,a,c){var d,g,p;return function(){var v=MA(this,o),x=c(this),T=x+"";return x==null&&(T=x=(this.style.removeProperty(o),MA(this,o))),v===T?null:v===d&&T===g?p:(g=T,p=a(d=v,x))}}function PDe(o,a){var c,d,g,p="style."+a,v="end."+p,x;return function(){var T=Cb(this,o),A=T.on,M=T.value[p]==null?x||(x=xue(a)):void 0;(A!==c||g!==M)&&(d=(c=A).copy()).on(v,g=M),T.on=d}}function IDe(o,a,c){var d=(o+="")=="transform"?I$e:Sue;return a==null?this.styleTween(o,DDe(o,d)).on("end.style."+o,xue(o)):typeof a=="function"?this.styleTween(o,RDe(o,d,Xte(this,"style."+o,a))).each(PDe(this._id,o)):this.styleTween(o,MDe(o,d,a),c).on("end.style."+o,null)}function BDe(o,a,c){return function(d){this.style.setProperty(o,a.call(this,d),c)}}function FDe(o,a,c){var d,g;function p(){var v=a.apply(this,arguments);return v!==g&&(d=(g=v)&&BDe(o,v,c)),d}return p._value=a,p}function LDe(o,a,c){var d="style."+(o+="");if(arguments.length<2)return(d=this.tween(d))&&d._value;if(a==null)return this.tween(d,null);if(typeof a!="function")throw new Error;return this.tween(d,FDe(o,a,c??""))}function VDe(o){return function(){this.textContent=o}}function HDe(o){return function(){var a=o(this);this.textContent=a??""}}function zDe(o){return this.tween("text",typeof o=="function"?HDe(Xte(this,"text",o)):VDe(o==null?"":o+""))}function UDe(o){return function(a){this.textContent=o.call(this,a)}}function jDe(o){var a,c;function d(){var g=o.apply(this,arguments);return g!==c&&(a=(c=g)&&UDe(g)),a}return d._value=o,d}function WDe(o){var a="text";if(arguments.length<1)return(a=this.tween(a))&&a._value;if(o==null)return this.tween(a,null);if(typeof o!="function")throw new Error;return this.tween(a,jDe(o))}function ZDe(){for(var o=this._name,a=this._id,c=Eue(),d=this._groups,g=d.length,p=0;p<g;++p)for(var v=d[p],x=v.length,T,A=0;A<x;++A)if(T=v[A]){var M=$p(T,a);kz(T,o,c,A,v,{time:M.time+M.delay+M.duration,delay:0,duration:M.duration,ease:M.ease})}return new S0(d,this._parents,o,c)}function GDe(){var o,a,c=this,d=c._id,g=c.size();return new Promise(function(p,v){var x={value:v},T={value:function(){--g===0&&p()}};c.each(function(){var A=Cb(this,d),M=A.on;M!==o&&(a=(o=M).copy(),a._.cancel.push(x),a._.interrupt.push(x),a._.end.push(T)),A.on=a}),g===0&&p()})}var qDe=0;function S0(o,a,c,d){this._groups=o,this._parents=a,this._name=c,this._id=d}function Eue(){return++qDe}var g0=LM.prototype;S0.prototype={constructor:S0,select:ADe,selectAll:ODe,selectChild:g0.selectChild,selectChildren:g0.selectChildren,filter:CDe,merge:SDe,selection:$De,transition:ZDe,call:g0.call,nodes:g0.nodes,node:g0.node,size:g0.size,empty:g0.empty,each:g0.each,on:_De,attr:rDe,attrTween:uDe,style:IDe,styleTween:LDe,text:zDe,textTween:WDe,remove:kDe,tween:J$e,delay:mDe,duration:pDe,ease:vDe,easeVarying:wDe,end:GDe,[Symbol.iterator]:g0[Symbol.iterator]};function YDe(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var KDe={time:null,delay:0,duration:250,ease:YDe};function XDe(o,a){for(var c;!(c=o.__transition)||!(c=c[a]);)if(!(o=o.parentNode))throw new Error(`transition ${a} not found`);return c}function JDe(o){var a,c;o instanceof S0?(a=o._id,o=o._name):(a=Eue(),(c=KDe).time=Yte(),o=o==null?null:o+"");for(var d=this._groups,g=d.length,p=0;p<g;++p)for(var v=d[p],x=v.length,T,A=0;A<x;++A)(T=v[A])&&kz(T,o,a,A,v,c||XDe(T,a));return new S0(d,this._parents,o,a)}LM.prototype.interrupt=Y$e;LM.prototype.transition=JDe;const LV=o=>()=>o;function QDe(o,{sourceEvent:a,target:c,transform:d,dispatch:g}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:a,enumerable:!0,configurable:!0},target:{value:c,enumerable:!0,configurable:!0},transform:{value:d,enumerable:!0,configurable:!0},_:{value:g}})}function v0(o,a,c){this.k=o,this.x=a,this.y=c}v0.prototype={constructor:v0,scale:function(o){return o===1?this:new v0(this.k*o,this.x,this.y)},translate:function(o,a){return o===0&a===0?this:new v0(this.k,this.x+this.k*o,this.y+this.k*a)},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 PA=new v0(1,0,0);v0.prototype;function WQ(o){o.stopImmediatePropagation()}function K6(o){o.preventDefault(),o.stopImmediatePropagation()}function e6e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function t6e(){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 lae(){return this.__zoom||PA}function n6e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function o6e(){return navigator.maxTouchPoints||"ontouchstart"in this}function s6e(o,a,c){var d=o.invertX(a[0][0])-c[0][0],g=o.invertX(a[1][0])-c[1][0],p=o.invertY(a[0][1])-c[0][1],v=o.invertY(a[1][1])-c[1][1];return o.translate(g>d?(d+g)/2:Math.min(0,d)||Math.max(0,g),v>p?(p+v)/2:Math.min(0,p)||Math.max(0,v))}function r6e(){var o=e6e,a=t6e,c=s6e,d=n6e,g=o6e,p=[0,1/0],v=[[-1/0,-1/0],[1/0,1/0]],x=250,T=H$e,A=Ez("start","zoom","end"),M,I,z,U=500,K=150,X=0,Q=10;function le(Se){Se.property("__zoom",lae).on("wheel.zoom",Ze,{passive:!1}).on("mousedown.zoom",yt).on("dblclick.zoom",_t).filter(g).on("touchstart.zoom",Re).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",Xt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}le.transform=function(Se,Ie,D,ze){var be=Se.selection?Se.selection():Se;be.property("__zoom",lae),Se!==be?ct(Se,Ie,D,ze):be.interrupt().each(function(){Ge(this,arguments).event(ze).start().zoom(null,typeof Ie=="function"?Ie.apply(this,arguments):Ie).end()})},le.scaleBy=function(Se,Ie,D,ze){le.scaleTo(Se,function(){var be=this.__zoom.k,tt=typeof Ie=="function"?Ie.apply(this,arguments):Ie;return be*tt},D,ze)},le.scaleTo=function(Se,Ie,D,ze){le.transform(Se,function(){var be=a.apply(this,arguments),tt=this.__zoom,nt=D==null?Ce(be):typeof D=="function"?D.apply(this,arguments):D,ge=tt.invert(nt),je=typeof Ie=="function"?Ie.apply(this,arguments):Ie;return c(Z(ae(tt,je),nt,ge),be,v)},D,ze)},le.translateBy=function(Se,Ie,D,ze){le.transform(Se,function(){return c(this.__zoom.translate(typeof Ie=="function"?Ie.apply(this,arguments):Ie,typeof D=="function"?D.apply(this,arguments):D),a.apply(this,arguments),v)},null,ze)},le.translateTo=function(Se,Ie,D,ze,be){le.transform(Se,function(){var tt=a.apply(this,arguments),nt=this.__zoom,ge=ze==null?Ce(tt):typeof ze=="function"?ze.apply(this,arguments):ze;return c(PA.translate(ge[0],ge[1]).scale(nt.k).translate(typeof Ie=="function"?-Ie.apply(this,arguments):-Ie,typeof D=="function"?-D.apply(this,arguments):-D),tt,v)},ze,be)};function ae(Se,Ie){return Ie=Math.max(p[0],Math.min(p[1],Ie)),Ie===Se.k?Se:new v0(Ie,Se.x,Se.y)}function Z(Se,Ie,D){var ze=Ie[0]-D[0]*Se.k,be=Ie[1]-D[1]*Se.k;return ze===Se.x&&be===Se.y?Se:new v0(Se.k,ze,be)}function Ce(Se){return[(+Se[0][0]+ +Se[1][0])/2,(+Se[0][1]+ +Se[1][1])/2]}function ct(Se,Ie,D,ze){Se.on("start.zoom",function(){Ge(this,arguments).event(ze).start()}).on("interrupt.zoom end.zoom",function(){Ge(this,arguments).event(ze).end()}).tween("zoom",function(){var be=this,tt=arguments,nt=Ge(be,tt).event(ze),ge=a.apply(be,tt),je=D==null?Ce(ge):typeof D=="function"?D.apply(be,tt):D,kt=Math.max(ge[1][0]-ge[0][0],ge[1][1]-ge[0][1]),Ve=be.__zoom,ht=typeof Ie=="function"?Ie.apply(be,tt):Ie,De=T(Ve.invert(je).concat(kt/Ve.k),ht.invert(je).concat(kt/ht.k));return function(ut){if(ut===1)ut=ht;else{var ee=De(ut),gn=kt/ee[2];ut=new v0(gn,je[0]-ee[0]*gn,je[1]-ee[1]*gn)}nt.zoom(null,ut)}})}function Ge(Se,Ie,D){return!D&&Se.__zooming||new oe(Se,Ie)}function oe(Se,Ie){this.that=Se,this.args=Ie,this.active=0,this.sourceEvent=null,this.extent=a.apply(Se,Ie),this.taps=0}oe.prototype={event:function(Se){return Se&&(this.sourceEvent=Se),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(Se,Ie){return this.mouse&&Se!=="mouse"&&(this.mouse[1]=Ie.invert(this.mouse[0])),this.touch0&&Se!=="touch"&&(this.touch0[1]=Ie.invert(this.touch0[0])),this.touch1&&Se!=="touch"&&(this.touch1[1]=Ie.invert(this.touch1[0])),this.that.__zoom=Ie,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(Se){var Ie=kp(this.that).datum();A.call(Se,this.that,new QDe(Se,{sourceEvent:this.sourceEvent,target:le,type:Se,transform:this.that.__zoom,dispatch:A}),Ie)}};function Ze(Se,...Ie){if(!o.apply(this,arguments))return;var D=Ge(this,Ie).event(Se),ze=this.__zoom,be=Math.max(p[0],Math.min(p[1],ze.k*Math.pow(2,d.apply(this,arguments)))),tt=gb(Se);if(D.wheel)(D.mouse[0][0]!==tt[0]||D.mouse[0][1]!==tt[1])&&(D.mouse[1]=ze.invert(D.mouse[0]=tt)),clearTimeout(D.wheel);else{if(ze.k===be)return;D.mouse=[tt,ze.invert(tt)],rH(this),D.start()}K6(Se),D.wheel=setTimeout(nt,K),D.zoom("mouse",c(Z(ae(ze,be),D.mouse[0],D.mouse[1]),D.extent,v));function nt(){D.wheel=null,D.end()}}function yt(Se,...Ie){if(z||!o.apply(this,arguments))return;var D=Se.currentTarget,ze=Ge(this,Ie,!0).event(Se),be=kp(Se.view).on("mousemove.zoom",je,!0).on("mouseup.zoom",kt,!0),tt=gb(Se,D),nt=Se.clientX,ge=Se.clientY;uue(Se.view),WQ(Se),ze.mouse=[tt,this.__zoom.invert(tt)],rH(this),ze.start();function je(Ve){if(K6(Ve),!ze.moved){var ht=Ve.clientX-nt,De=Ve.clientY-ge;ze.moved=ht*ht+De*De>X}ze.event(Ve).zoom("mouse",c(Z(ze.that.__zoom,ze.mouse[0]=gb(Ve,D),ze.mouse[1]),ze.extent,v))}function kt(Ve){be.on("mousemove.zoom mouseup.zoom",null),due(Ve.view,ze.moved),K6(Ve),ze.event(Ve).end()}}function _t(Se,...Ie){if(o.apply(this,arguments)){var D=this.__zoom,ze=gb(Se.changedTouches?Se.changedTouches[0]:Se,this),be=D.invert(ze),tt=D.k*(Se.shiftKey?.5:2),nt=c(Z(ae(D,tt),ze,be),a.apply(this,Ie),v);K6(Se),x>0?kp(this).transition().duration(x).call(ct,nt,ze,Se):kp(this).call(le.transform,nt,ze,Se)}}function Re(Se,...Ie){if(o.apply(this,arguments)){var D=Se.touches,ze=D.length,be=Ge(this,Ie,Se.changedTouches.length===ze).event(Se),tt,nt,ge,je;for(WQ(Se),nt=0;nt<ze;++nt)ge=D[nt],je=gb(ge,this),je=[je,this.__zoom.invert(je),ge.identifier],be.touch0?!be.touch1&&be.touch0[2]!==je[2]&&(be.touch1=je,be.taps=0):(be.touch0=je,tt=!0,be.taps=1+!!M);M&&(M=clearTimeout(M)),tt&&(be.taps<2&&(I=je[0],M=setTimeout(function(){M=null},U)),rH(this),be.start())}}function ue(Se,...Ie){if(this.__zooming){var D=Ge(this,Ie).event(Se),ze=Se.changedTouches,be=ze.length,tt,nt,ge,je;for(K6(Se),tt=0;tt<be;++tt)nt=ze[tt],ge=gb(nt,this),D.touch0&&D.touch0[2]===nt.identifier?D.touch0[0]=ge:D.touch1&&D.touch1[2]===nt.identifier&&(D.touch1[0]=ge);if(nt=D.that.__zoom,D.touch1){var kt=D.touch0[0],Ve=D.touch0[1],ht=D.touch1[0],De=D.touch1[1],ut=(ut=ht[0]-kt[0])*ut+(ut=ht[1]-kt[1])*ut,ee=(ee=De[0]-Ve[0])*ee+(ee=De[1]-Ve[1])*ee;nt=ae(nt,Math.sqrt(ut/ee)),ge=[(kt[0]+ht[0])/2,(kt[1]+ht[1])/2],je=[(Ve[0]+De[0])/2,(Ve[1]+De[1])/2]}else if(D.touch0)ge=D.touch0[0],je=D.touch0[1];else return;D.zoom("touch",c(Z(nt,ge,je),D.extent,v))}}function Xt(Se,...Ie){if(this.__zooming){var D=Ge(this,Ie).event(Se),ze=Se.changedTouches,be=ze.length,tt,nt;for(WQ(Se),z&&clearTimeout(z),z=setTimeout(function(){z=null},U),tt=0;tt<be;++tt)nt=ze[tt],D.touch0&&D.touch0[2]===nt.identifier?delete D.touch0:D.touch1&&D.touch1[2]===nt.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(nt=gb(nt,this),Math.hypot(I[0]-nt[0],I[1]-nt[1])<Q)){var ge=kp(this).on("dblclick.zoom");ge&&ge.apply(this,arguments)}}}return le.wheelDelta=function(Se){return arguments.length?(d=typeof Se=="function"?Se:LV(+Se),le):d},le.filter=function(Se){return arguments.length?(o=typeof Se=="function"?Se:LV(!!Se),le):o},le.touchable=function(Se){return arguments.length?(g=typeof Se=="function"?Se:LV(!!Se),le):g},le.extent=function(Se){return arguments.length?(a=typeof Se=="function"?Se:LV([[+Se[0][0],+Se[0][1]],[+Se[1][0],+Se[1][1]]]),le):a},le.scaleExtent=function(Se){return arguments.length?(p[0]=+Se[0],p[1]=+Se[1],le):[p[0],p[1]]},le.translateExtent=function(Se){return arguments.length?(v[0][0]=+Se[0][0],v[1][0]=+Se[1][0],v[0][1]=+Se[0][1],v[1][1]=+Se[1][1],le):[[v[0][0],v[0][1]],[v[1][0],v[1][1]]]},le.constrain=function(Se){return arguments.length?(c=Se,le):c},le.duration=function(Se){return arguments.length?(x=+Se,le):x},le.interpolate=function(Se){return arguments.length?(T=Se,le):T},le.on=function(){var Se=A.on.apply(A,arguments);return Se===A?le:Se},le.clickDistance=function(Se){return arguments.length?(X=(Se=+Se)*Se,le):Math.sqrt(X)},le.tapDistance=function(Se){return arguments.length?(Q=+Se,le):Q},le}var ss=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(ss||{}),Jte=(o=>(o.Partial="partial",o.Full="full",o))(Jte||{}),Bx=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(Bx||{}),qw=(o=>(o.Strict="strict",o.Loose="loose",o))(qw||{}),DH=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(DH||{}),rM=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(rM||{}),_ue=(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))(_ue||{});const a6e=["INPUT","SELECT","TEXTAREA"];function Kee(o){var a,c;const d=((c=(a=o.composedPath)==null?void 0:a.call(o))==null?void 0:c[0])||o.target,g=typeof(d==null?void 0:d.hasAttribute)=="function"?d.hasAttribute("contenteditable"):!1,p=typeof(d==null?void 0:d.closest)=="function"?d.closest(".nokey"):null;return a6e.includes(d==null?void 0:d.nodeName)||g||!!p}function i6e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function uae(o,a,c,d){const g=a.replace("+",`
|
|
113
113
|
`).replace(`
|
|
114
114
|
|
|
115
115
|
`,`
|
package/es/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ var lme = (o, a, c) => a in o ? cme(o, a, { enumerable: !0, configurable: !0, wr
|
|
|
3
3
|
var ru = (o, a, c) => lme(o, typeof a != "symbol" ? a + "" : a, c);
|
|
4
4
|
import { defineComponent as Bs, reactive as uR, provide as t1, inject as em, ref as Vn, watch as ds, toValue as vn, computed as Ao, openBlock as en, createElementBlock as jn, createElementVNode as Eo, mergeModels as Fl, useModel as Ll, Fragment as ya, renderList as Hl, createVNode as uo, unref as bt, withCtx as Ho, createCommentVNode as hr, toDisplayString as Pa, createTextVNode as Xc, createBlock as Hs, withDirectives as PV, mergeProps as t4, resolveComponent as C_, isRef as Ub, onUnmounted as nd, watchEffect as hce, getCurrentScope as nne, onScopeDispose as LM, onMounted as Cc, toRefs as dR, renderSlot as Ra, normalizeStyle as zl, nextTick as Vm, onBeforeUnmount as fR, onActivated as ume, onDeactivated as dme, h as za, withModifiers as one, Teleport as IV, normalizeClass as jh, vShow as fme, resolveDynamicComponent as v2, createPropsRestProxy as mme, toRef as ti, effectScope as pce, getCurrentInstance as k2, useSlots as gme, onBeforeMount as hme, useAttrs as pme, isMemoSame as bme, customRef as vme, markRaw as HM, readonly as yme, createStaticVNode as wme } from "vue";
|
|
5
5
|
import { ElImage as Cme, ElIcon as zM, ElPopover as sne, ElForm as rne, ElFormItem as Vb, ElInput as x2, ElButton as S_, ElScrollbar as BV, ElLoadingDirective as ane, ElSelect as KM, ElOption as eV, ElDialog as Sme, ElTabs as xme, ElTabPane as _me, ElUpload as Use, ElDatePicker as Eme, ElConfigProvider as Tme, ElTable as kme, ElTableColumn as vz, ElCheckbox as Ame, ElMessageBox as Ome, ElRadioGroup as bce, ElRadio as cte } from "element-plus";
|
|
6
|
-
const $me = "0.0.
|
|
6
|
+
const $me = "0.0.17";
|
|
7
7
|
var Dme = Object.defineProperty, Nme = (o, a, c) => a in o ? Dme(o, a, { enumerable: !0, configurable: !0, writable: !0, value: c }) : o[a] = c, mee = (o, a, c) => Nme(o, typeof a != "symbol" ? a + "" : a, c);
|
|
8
8
|
function vce(o, a) {
|
|
9
9
|
return function() {
|
|
@@ -67415,7 +67415,13 @@ const Z5e = /* @__PURE__ */ Bs({
|
|
|
67415
67415
|
};
|
|
67416
67416
|
}),
|
|
67417
67417
|
set: (K) => {
|
|
67418
|
-
const J = K.map(({ element: ce, ...re }) =>
|
|
67418
|
+
const J = K.map(({ element: ce, ...re }) => {
|
|
67419
|
+
var we;
|
|
67420
|
+
return {
|
|
67421
|
+
...((we = d == null ? void 0 : d.nodes) == null ? void 0 : we.find((it) => (it == null ? void 0 : it.id) === (re == null ? void 0 : re.id))) || {},
|
|
67422
|
+
...re
|
|
67423
|
+
};
|
|
67424
|
+
});
|
|
67419
67425
|
g("update:selectedNodes", J);
|
|
67420
67426
|
}
|
|
67421
67427
|
}), v = Vn(null), S = Vn(null), E = Vn(-1), k = Vn(0), N = Vn(0), P = j5e(d == null ? void 0 : d.editorId), z = Ao(() => {
|
|
@@ -67423,7 +67429,14 @@ const Z5e = /* @__PURE__ */ Bs({
|
|
|
67423
67429
|
const K = ((J = vn(P)) == null ? void 0 : J.filter((ce) => !vn(ce == null ? void 0 : ce.activated))) || [];
|
|
67424
67430
|
return i5e([...(d == null ? void 0 : d.nodesGroups) || [], ...K]);
|
|
67425
67431
|
}), V = Vn([]), Y = (K) => {
|
|
67426
|
-
|
|
67432
|
+
const J = K.map(({ element: ce, ...re }) => {
|
|
67433
|
+
var we;
|
|
67434
|
+
return {
|
|
67435
|
+
...((we = d == null ? void 0 : d.nodes) == null ? void 0 : we.find((it) => (it == null ? void 0 : it.id) === (re == null ? void 0 : re.id))) || {},
|
|
67436
|
+
...re
|
|
67437
|
+
};
|
|
67438
|
+
});
|
|
67439
|
+
p.value = K, g("onSelectedNodes", J);
|
|
67427
67440
|
};
|
|
67428
67441
|
return a({
|
|
67429
67442
|
setSelectedNodes: Y
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zyui/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.mjs",
|
|
6
6
|
"types": "./es/index.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"xmldom": "^0.6.0",
|
|
43
43
|
"xpath": "^0.0.34",
|
|
44
44
|
"@zyui/hooks": "0.0.5",
|
|
45
|
-
"@zyui/utils": "0.0.
|
|
45
|
+
"@zyui/utils": "0.0.8"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/lodash-es": "^4.17.12"
|