@zyui/components 0.0.106 → 0.0.108
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 +484 -474
- package/es/src/components/NodesEditor/PagesizeWrap/index.vue.d.ts +9 -0
- package/es/src/components/NodesEditor/index.vue.d.ts +9 -0
- package/es/style.css +1 -1
- package/lib/src/components/NodesEditor/PagesizeWrap/index.vue.d.ts +9 -0
- package/lib/src/components/NodesEditor/index.vue.d.ts +9 -0
- package/package.json +1 -1
package/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var qge=Object.defineProperty;var Yge=(o,s,i)=>s in o?qge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i;var zc=(o,s,i)=>Yge(o,typeof s!="symbol"?s+"":s,i);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue"),Nn=require("element-plus"),Kge="0.0.106";var Xge=Object.defineProperty,Jge=(o,s,i)=>s in o?Xge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i,Dee=(o,s,i)=>Jge(o,typeof s!="symbol"?s+"":s,i);function Lce(o,s){return function(){return o.apply(s,arguments)}}const{toString:Qge}=Object.prototype,{getPrototypeOf:Une}=Object,eU=(o=>s=>{const i=Qge.call(s);return o[i]||(o[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Bh=o=>(o=o.toLowerCase(),s=>eU(s)===o),tU=o=>s=>typeof s===o,{isArray:w4}=Array,oR=tU("undefined");function ehe(o){return o!==null&&!oR(o)&&o.constructor!==null&&!oR(o.constructor)&&wp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const Vce=Bh("ArrayBuffer");function the(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&Vce(o.buffer),s}const nhe=tU("string"),wp=tU("function"),Hce=tU("number"),nU=o=>o!==null&&typeof o=="object",ohe=o=>o===!0||o===!1,KH=o=>{if(eU(o)!=="object")return!1;const s=Une(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},she=Bh("Date"),rhe=Bh("File"),ahe=Bh("Blob"),ihe=Bh("FileList"),lhe=o=>nU(o)&&wp(o.pipe),che=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||wp(o.append)&&((s=eU(o))==="formdata"||s==="object"&&wp(o.toString)&&o.toString()==="[object FormData]"))},uhe=Bh("URLSearchParams"),[dhe,fhe,mhe,phe]=["ReadableStream","Request","Response","Headers"].map(Bh),ghe=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yR(o,s,{allOwnKeys:i=!1}={}){if(o===null||typeof o>"u")return;let u,m;if(typeof o!="object"&&(o=[o]),w4(o))for(u=0,m=o.length;u<m;u++)s.call(null,o[u],u,o);else{const h=i?Object.getOwnPropertyNames(o):Object.keys(o),b=h.length;let C;for(u=0;u<b;u++)C=h[u],s.call(null,o[C],C,o)}}function zce(o,s){s=s.toLowerCase();const i=Object.keys(o);let u=i.length,m;for(;u-- >0;)if(m=i[u],s===m.toLowerCase())return m;return null}const gE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Uce=o=>!oR(o)&&o!==gE;function jte(){const{caseless:o}=Uce(this)&&this||{},s={},i=(u,m)=>{const h=o&&zce(s,m)||m;KH(s[h])&&KH(u)?s[h]=jte(s[h],u):KH(u)?s[h]=jte({},u):w4(u)?s[h]=u.slice():s[h]=u};for(let u=0,m=arguments.length;u<m;u++)arguments[u]&&yR(arguments[u],i);return s}const hhe=(o,s,i,{allOwnKeys:u}={})=>(yR(s,(m,h)=>{i&&wp(m)?o[h]=Lce(m,i):o[h]=m},{allOwnKeys:u}),o),vhe=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),bhe=(o,s,i,u)=>{o.prototype=Object.create(s.prototype,u),o.prototype.constructor=o,Object.defineProperty(o,"super",{value:s.prototype}),i&&Object.assign(o.prototype,i)},yhe=(o,s,i,u)=>{let m,h,b;const C={};if(s=s||{},o==null)return s;do{for(m=Object.getOwnPropertyNames(o),h=m.length;h-- >0;)b=m[h],(!u||u(b,o,s))&&!C[b]&&(s[b]=o[b],C[b]=!0);o=i!==!1&&Une(o)}while(o&&(!i||i(o,s))&&o!==Object.prototype);return s},whe=(o,s,i)=>{o=String(o),(i===void 0||i>o.length)&&(i=o.length),i-=s.length;const u=o.indexOf(s,i);return u!==-1&&u===i},Che=o=>{if(!o)return null;if(w4(o))return o;let s=o.length;if(!Hce(s))return null;const i=new Array(s);for(;s-- >0;)i[s]=o[s];return i},She=(o=>s=>o&&s instanceof o)(typeof Uint8Array<"u"&&Une(Uint8Array)),xhe=(o,s)=>{const i=(o&&o[Symbol.iterator]).call(o);let u;for(;(u=i.next())&&!u.done;){const m=u.value;s.call(o,m[0],m[1])}},Ehe=(o,s)=>{let i;const u=[];for(;(i=o.exec(s))!==null;)u.push(i);return u},_he=Bh("HTMLFormElement"),khe=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,u){return i.toUpperCase()+u}),Ure=(({hasOwnProperty:o})=>(s,i)=>o.call(s,i))(Object.prototype),The=Bh("RegExp"),jce=(o,s)=>{const i=Object.getOwnPropertyDescriptors(o),u={};yR(i,(m,h)=>{let b;(b=s(m,h,o))!==!1&&(u[h]=b||m)}),Object.defineProperties(o,u)},Ahe=o=>{jce(o,(s,i)=>{if(wp(o)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const u=o[i];if(wp(u)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Nhe=(o,s)=>{const i={},u=m=>{m.forEach(h=>{i[h]=!0})};return w4(o)?u(o):u(String(o).split(s)),i},Ohe=()=>{},$he=(o,s)=>o!=null&&Number.isFinite(o=+o)?o:s,Mee="abcdefghijklmnopqrstuvwxyz",jre="0123456789",Wce={DIGIT:jre,ALPHA:Mee,ALPHA_DIGIT:Mee+Mee.toUpperCase()+jre},Dhe=(o=16,s=Wce.ALPHA_DIGIT)=>{let i="";const{length:u}=s;for(;o--;)i+=s[Math.random()*u|0];return i};function Mhe(o){return!!(o&&wp(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const Rhe=o=>{const s=new Array(10),i=(u,m)=>{if(nU(u)){if(s.indexOf(u)>=0)return;if(!("toJSON"in u)){s[m]=u;const h=w4(u)?[]:{};return yR(u,(b,C)=>{const S=i(b,m+1);!oR(S)&&(h[C]=S)}),s[m]=void 0,h}}return u};return i(o,0)},Bhe=Bh("AsyncFunction"),Ihe=o=>o&&(nU(o)||wp(o))&&wp(o.then)&&wp(o.catch),Zce=((o,s)=>o?setImmediate:s?((i,u)=>(gE.addEventListener("message",({source:m,data:h})=>{m===gE&&h===i&&u.length&&u.shift()()},!1),m=>{u.push(m),gE.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",wp(gE.postMessage)),Phe=typeof queueMicrotask<"u"?queueMicrotask.bind(gE):typeof process<"u"&&process.nextTick||Zce,Rn={isArray:w4,isArrayBuffer:Vce,isBuffer:ehe,isFormData:che,isArrayBufferView:the,isString:nhe,isNumber:Hce,isBoolean:ohe,isObject:nU,isPlainObject:KH,isReadableStream:dhe,isRequest:fhe,isResponse:mhe,isHeaders:phe,isUndefined:oR,isDate:she,isFile:rhe,isBlob:ahe,isRegExp:The,isFunction:wp,isStream:lhe,isURLSearchParams:uhe,isTypedArray:She,isFileList:ihe,forEach:yR,merge:jte,extend:hhe,trim:ghe,stripBOM:vhe,inherits:bhe,toFlatObject:yhe,kindOf:eU,kindOfTest:Bh,endsWith:whe,toArray:Che,forEachEntry:xhe,matchAll:Ehe,isHTMLForm:_he,hasOwnProperty:Ure,hasOwnProp:Ure,reduceDescriptors:jce,freezeMethods:Ahe,toObjectSet:Nhe,toCamelCase:khe,noop:Ohe,toFiniteNumber:$he,findKey:zce,global:gE,isContextDefined:Uce,ALPHABET:Wce,generateString:Dhe,isSpecCompliantForm:Mhe,toJSONObject:Rhe,isAsyncFn:Bhe,isThenable:Ihe,setImmediate:Zce,asap:Phe};function Er(o,s,i,u,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=o,this.name="AxiosError",s&&(this.code=s),i&&(this.config=i),u&&(this.request=u),m&&(this.response=m,this.status=m.status?m.status:null)}Rn.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:Rn.toJSONObject(this.config),code:this.code,status:this.status}}});const Gce=Er.prototype,qce={};["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=>{qce[o]={value:o}});Object.defineProperties(Er,qce);Object.defineProperty(Gce,"isAxiosError",{value:!0});Er.from=(o,s,i,u,m,h)=>{const b=Object.create(Gce);return Rn.toFlatObject(o,b,function(C){return C!==Error.prototype},C=>C!=="isAxiosError"),Er.call(b,o.message,s,i,u,m),b.cause=o,b.name=o.name,h&&Object.assign(b,h),b};const Fhe=null;function Wte(o){return Rn.isPlainObject(o)||Rn.isArray(o)}function Yce(o){return Rn.endsWith(o,"[]")?o.slice(0,-2):o}function Wre(o,s,i){return o?o.concat(s).map(function(u,m){return u=Yce(u),!i&&m?"["+u+"]":u}).join(i?".":""):s}function Lhe(o){return Rn.isArray(o)&&!o.some(Wte)}const Vhe=Rn.toFlatObject(Rn,{},null,function(o){return/^is[A-Z]/.test(o)});function oU(o,s,i){if(!Rn.isObject(o))throw new TypeError("target must be an object");s=s||new FormData,i=Rn.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(F,Z){return!Rn.isUndefined(Z[F])});const u=i.metaTokens,m=i.visitor||_,h=i.dots,b=i.indexes,C=(i.Blob||typeof Blob<"u"&&Blob)&&Rn.isSpecCompliantForm(s);if(!Rn.isFunction(m))throw new TypeError("visitor must be a function");function S(F){if(F===null)return"";if(Rn.isDate(F))return F.toISOString();if(!C&&Rn.isBlob(F))throw new Er("Blob is not supported. Use a Buffer instead.");return Rn.isArrayBuffer(F)||Rn.isTypedArray(F)?C&&typeof Blob=="function"?new Blob([F]):Buffer.from(F):F}function _(F,Z,G){let Y=F;if(F&&!G&&typeof F=="object"){if(Rn.endsWith(Z,"{}"))Z=u?Z:Z.slice(0,-2),F=JSON.stringify(F);else if(Rn.isArray(F)&&Lhe(F)||(Rn.isFileList(F)||Rn.endsWith(Z,"[]"))&&(Y=Rn.toArray(F)))return Z=Yce(Z),Y.forEach(function(q,W){!(Rn.isUndefined(q)||q===null)&&s.append(b===!0?Wre([Z],W,h):b===null?Z:Z+"[]",S(q))}),!1}return Wte(F)?!0:(s.append(Wre(G,Z,h),S(F)),!1)}const N=[],O=Object.assign(Vhe,{defaultVisitor:_,convertValue:S,isVisitable:Wte});function B(F,Z){if(!Rn.isUndefined(F)){if(N.indexOf(F)!==-1)throw Error("Circular reference detected in "+Z.join("."));N.push(F),Rn.forEach(F,function(G,Y){(!(Rn.isUndefined(G)||G===null)&&m.call(s,G,Rn.isString(Y)?Y.trim():Y,Z,O))===!0&&B(G,Z?Z.concat(Y):[Y])}),N.pop()}}if(!Rn.isObject(o))throw new TypeError("data must be an object");return B(o),s}function Zre(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function jne(o,s){this._pairs=[],o&&oU(o,this,s)}const Kce=jne.prototype;Kce.append=function(o,s){this._pairs.push([o,s])};Kce.toString=function(o){const s=o?function(i){return o.call(this,i,Zre)}:Zre;return this._pairs.map(function(i){return s(i[0])+"="+s(i[1])},"").join("&")};function Hhe(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Xce(o,s,i){if(!s)return o;const u=i&&i.encode||Hhe;Rn.isFunction(i)&&(i={serialize:i});const m=i&&i.serialize;let h;if(m?h=m(s,i):h=Rn.isURLSearchParams(s)?s.toString():new jne(s,i).toString(u),h){const b=o.indexOf("#");b!==-1&&(o=o.slice(0,b)),o+=(o.indexOf("?")===-1?"?":"&")+h}return o}let Gre=class{constructor(){this.handlers=[]}use(s,i,u){return this.handlers.push({fulfilled:s,rejected:i,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1}eject(s){this.handlers[s]&&(this.handlers[s]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){Rn.forEach(this.handlers,function(i){i!==null&&s(i)})}};const Jce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zhe=typeof URLSearchParams<"u"?URLSearchParams:jne,Uhe=typeof FormData<"u"?FormData:null,jhe=typeof Blob<"u"?Blob:null,Whe={isBrowser:!0,classes:{URLSearchParams:zhe,FormData:Uhe,Blob:jhe},protocols:["http","https","file","blob","url","data"]},Wne=typeof window<"u"&&typeof document<"u",Zte=typeof navigator=="object"&&navigator||void 0,Zhe=Wne&&(!Zte||["ReactNative","NativeScript","NS"].indexOf(Zte.product)<0),Ghe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",qhe=Wne&&window.location.href||"http://localhost",Yhe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wne,hasStandardBrowserEnv:Zhe,hasStandardBrowserWebWorkerEnv:Ghe,navigator:Zte,origin:qhe},Symbol.toStringTag,{value:"Module"})),Kd={...Yhe,...Whe};function Khe(o,s){return oU(o,new Kd.classes.URLSearchParams,Object.assign({visitor:function(i,u,m,h){return Kd.isNode&&Rn.isBuffer(i)?(this.append(u,i.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},s))}function Xhe(o){return Rn.matchAll(/\w+|\[(\w*)]/g,o).map(s=>s[0]==="[]"?"":s[1]||s[0])}function Jhe(o){const s={},i=Object.keys(o);let u;const m=i.length;let h;for(u=0;u<m;u++)h=i[u],s[h]=o[h];return s}function Qce(o){function s(i,u,m,h){let b=i[h++];if(b==="__proto__")return!0;const C=Number.isFinite(+b),S=h>=i.length;return b=!b&&Rn.isArray(m)?m.length:b,S?(Rn.hasOwnProp(m,b)?m[b]=[m[b],u]:m[b]=u,!C):((!m[b]||!Rn.isObject(m[b]))&&(m[b]=[]),s(i,u,m[b],h)&&Rn.isArray(m[b])&&(m[b]=Jhe(m[b])),!C)}if(Rn.isFormData(o)&&Rn.isFunction(o.entries)){const i={};return Rn.forEachEntry(o,(u,m)=>{s(Xhe(u),m,i,0)}),i}return null}function Qhe(o,s,i){if(Rn.isString(o))try{return(s||JSON.parse)(o),Rn.trim(o)}catch(u){if(u.name!=="SyntaxError")throw u}return(0,JSON.stringify)(o)}const wR={transitional:Jce,adapter:["xhr","http","fetch"],transformRequest:[function(o,s){const i=s.getContentType()||"",u=i.indexOf("application/json")>-1,m=Rn.isObject(o);if(m&&Rn.isHTMLForm(o)&&(o=new FormData(o)),Rn.isFormData(o))return u?JSON.stringify(Qce(o)):o;if(Rn.isArrayBuffer(o)||Rn.isBuffer(o)||Rn.isStream(o)||Rn.isFile(o)||Rn.isBlob(o)||Rn.isReadableStream(o))return o;if(Rn.isArrayBufferView(o))return o.buffer;if(Rn.isURLSearchParams(o))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let h;if(m){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Khe(o,this.formSerializer).toString();if((h=Rn.isFileList(o))||i.indexOf("multipart/form-data")>-1){const b=this.env&&this.env.FormData;return oU(h?{"files[]":o}:o,b&&new b,this.formSerializer)}}return m||u?(s.setContentType("application/json",!1),Qhe(o)):o}],transformResponse:[function(o){const s=this.transitional||wR.transitional,i=s&&s.forcedJSONParsing,u=this.responseType==="json";if(Rn.isResponse(o)||Rn.isReadableStream(o))return o;if(o&&Rn.isString(o)&&(i&&!this.responseType||u)){const m=!(s&&s.silentJSONParsing)&&u;try{return JSON.parse(o)}catch(h){if(m)throw h.name==="SyntaxError"?Er.from(h,Er.ERR_BAD_RESPONSE,this,null,this.response):h}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Kd.classes.FormData,Blob:Kd.classes.Blob},validateStatus:function(o){return o>=200&&o<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Rn.forEach(["delete","get","head","post","put","patch"],o=>{wR.headers[o]={}});const e1e=Rn.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"]),t1e=o=>{const s={};let i,u,m;return o&&o.split(`
|
|
1
|
+
"use strict";var qge=Object.defineProperty;var Yge=(o,s,i)=>s in o?qge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i;var zc=(o,s,i)=>Yge(o,typeof s!="symbol"?s+"":s,i);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue"),Nn=require("element-plus"),Kge="0.0.108";var Xge=Object.defineProperty,Jge=(o,s,i)=>s in o?Xge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i,Dee=(o,s,i)=>Jge(o,typeof s!="symbol"?s+"":s,i);function Lce(o,s){return function(){return o.apply(s,arguments)}}const{toString:Qge}=Object.prototype,{getPrototypeOf:Une}=Object,eU=(o=>s=>{const i=Qge.call(s);return o[i]||(o[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Bh=o=>(o=o.toLowerCase(),s=>eU(s)===o),tU=o=>s=>typeof s===o,{isArray:w4}=Array,oR=tU("undefined");function ehe(o){return o!==null&&!oR(o)&&o.constructor!==null&&!oR(o.constructor)&&wp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const Vce=Bh("ArrayBuffer");function the(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&Vce(o.buffer),s}const nhe=tU("string"),wp=tU("function"),Hce=tU("number"),nU=o=>o!==null&&typeof o=="object",ohe=o=>o===!0||o===!1,KH=o=>{if(eU(o)!=="object")return!1;const s=Une(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},she=Bh("Date"),rhe=Bh("File"),ahe=Bh("Blob"),ihe=Bh("FileList"),lhe=o=>nU(o)&&wp(o.pipe),che=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||wp(o.append)&&((s=eU(o))==="formdata"||s==="object"&&wp(o.toString)&&o.toString()==="[object FormData]"))},uhe=Bh("URLSearchParams"),[dhe,fhe,mhe,phe]=["ReadableStream","Request","Response","Headers"].map(Bh),ghe=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yR(o,s,{allOwnKeys:i=!1}={}){if(o===null||typeof o>"u")return;let u,m;if(typeof o!="object"&&(o=[o]),w4(o))for(u=0,m=o.length;u<m;u++)s.call(null,o[u],u,o);else{const h=i?Object.getOwnPropertyNames(o):Object.keys(o),b=h.length;let C;for(u=0;u<b;u++)C=h[u],s.call(null,o[C],C,o)}}function zce(o,s){s=s.toLowerCase();const i=Object.keys(o);let u=i.length,m;for(;u-- >0;)if(m=i[u],s===m.toLowerCase())return m;return null}const gE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Uce=o=>!oR(o)&&o!==gE;function jte(){const{caseless:o}=Uce(this)&&this||{},s={},i=(u,m)=>{const h=o&&zce(s,m)||m;KH(s[h])&&KH(u)?s[h]=jte(s[h],u):KH(u)?s[h]=jte({},u):w4(u)?s[h]=u.slice():s[h]=u};for(let u=0,m=arguments.length;u<m;u++)arguments[u]&&yR(arguments[u],i);return s}const hhe=(o,s,i,{allOwnKeys:u}={})=>(yR(s,(m,h)=>{i&&wp(m)?o[h]=Lce(m,i):o[h]=m},{allOwnKeys:u}),o),vhe=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),bhe=(o,s,i,u)=>{o.prototype=Object.create(s.prototype,u),o.prototype.constructor=o,Object.defineProperty(o,"super",{value:s.prototype}),i&&Object.assign(o.prototype,i)},yhe=(o,s,i,u)=>{let m,h,b;const C={};if(s=s||{},o==null)return s;do{for(m=Object.getOwnPropertyNames(o),h=m.length;h-- >0;)b=m[h],(!u||u(b,o,s))&&!C[b]&&(s[b]=o[b],C[b]=!0);o=i!==!1&&Une(o)}while(o&&(!i||i(o,s))&&o!==Object.prototype);return s},whe=(o,s,i)=>{o=String(o),(i===void 0||i>o.length)&&(i=o.length),i-=s.length;const u=o.indexOf(s,i);return u!==-1&&u===i},Che=o=>{if(!o)return null;if(w4(o))return o;let s=o.length;if(!Hce(s))return null;const i=new Array(s);for(;s-- >0;)i[s]=o[s];return i},She=(o=>s=>o&&s instanceof o)(typeof Uint8Array<"u"&&Une(Uint8Array)),xhe=(o,s)=>{const i=(o&&o[Symbol.iterator]).call(o);let u;for(;(u=i.next())&&!u.done;){const m=u.value;s.call(o,m[0],m[1])}},Ehe=(o,s)=>{let i;const u=[];for(;(i=o.exec(s))!==null;)u.push(i);return u},_he=Bh("HTMLFormElement"),khe=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,u){return i.toUpperCase()+u}),Ure=(({hasOwnProperty:o})=>(s,i)=>o.call(s,i))(Object.prototype),The=Bh("RegExp"),jce=(o,s)=>{const i=Object.getOwnPropertyDescriptors(o),u={};yR(i,(m,h)=>{let b;(b=s(m,h,o))!==!1&&(u[h]=b||m)}),Object.defineProperties(o,u)},Ahe=o=>{jce(o,(s,i)=>{if(wp(o)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const u=o[i];if(wp(u)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Nhe=(o,s)=>{const i={},u=m=>{m.forEach(h=>{i[h]=!0})};return w4(o)?u(o):u(String(o).split(s)),i},Ohe=()=>{},$he=(o,s)=>o!=null&&Number.isFinite(o=+o)?o:s,Mee="abcdefghijklmnopqrstuvwxyz",jre="0123456789",Wce={DIGIT:jre,ALPHA:Mee,ALPHA_DIGIT:Mee+Mee.toUpperCase()+jre},Dhe=(o=16,s=Wce.ALPHA_DIGIT)=>{let i="";const{length:u}=s;for(;o--;)i+=s[Math.random()*u|0];return i};function Mhe(o){return!!(o&&wp(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const Rhe=o=>{const s=new Array(10),i=(u,m)=>{if(nU(u)){if(s.indexOf(u)>=0)return;if(!("toJSON"in u)){s[m]=u;const h=w4(u)?[]:{};return yR(u,(b,C)=>{const S=i(b,m+1);!oR(S)&&(h[C]=S)}),s[m]=void 0,h}}return u};return i(o,0)},Bhe=Bh("AsyncFunction"),Ihe=o=>o&&(nU(o)||wp(o))&&wp(o.then)&&wp(o.catch),Zce=((o,s)=>o?setImmediate:s?((i,u)=>(gE.addEventListener("message",({source:m,data:h})=>{m===gE&&h===i&&u.length&&u.shift()()},!1),m=>{u.push(m),gE.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",wp(gE.postMessage)),Phe=typeof queueMicrotask<"u"?queueMicrotask.bind(gE):typeof process<"u"&&process.nextTick||Zce,Rn={isArray:w4,isArrayBuffer:Vce,isBuffer:ehe,isFormData:che,isArrayBufferView:the,isString:nhe,isNumber:Hce,isBoolean:ohe,isObject:nU,isPlainObject:KH,isReadableStream:dhe,isRequest:fhe,isResponse:mhe,isHeaders:phe,isUndefined:oR,isDate:she,isFile:rhe,isBlob:ahe,isRegExp:The,isFunction:wp,isStream:lhe,isURLSearchParams:uhe,isTypedArray:She,isFileList:ihe,forEach:yR,merge:jte,extend:hhe,trim:ghe,stripBOM:vhe,inherits:bhe,toFlatObject:yhe,kindOf:eU,kindOfTest:Bh,endsWith:whe,toArray:Che,forEachEntry:xhe,matchAll:Ehe,isHTMLForm:_he,hasOwnProperty:Ure,hasOwnProp:Ure,reduceDescriptors:jce,freezeMethods:Ahe,toObjectSet:Nhe,toCamelCase:khe,noop:Ohe,toFiniteNumber:$he,findKey:zce,global:gE,isContextDefined:Uce,ALPHABET:Wce,generateString:Dhe,isSpecCompliantForm:Mhe,toJSONObject:Rhe,isAsyncFn:Bhe,isThenable:Ihe,setImmediate:Zce,asap:Phe};function Er(o,s,i,u,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=o,this.name="AxiosError",s&&(this.code=s),i&&(this.config=i),u&&(this.request=u),m&&(this.response=m,this.status=m.status?m.status:null)}Rn.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:Rn.toJSONObject(this.config),code:this.code,status:this.status}}});const Gce=Er.prototype,qce={};["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=>{qce[o]={value:o}});Object.defineProperties(Er,qce);Object.defineProperty(Gce,"isAxiosError",{value:!0});Er.from=(o,s,i,u,m,h)=>{const b=Object.create(Gce);return Rn.toFlatObject(o,b,function(C){return C!==Error.prototype},C=>C!=="isAxiosError"),Er.call(b,o.message,s,i,u,m),b.cause=o,b.name=o.name,h&&Object.assign(b,h),b};const Fhe=null;function Wte(o){return Rn.isPlainObject(o)||Rn.isArray(o)}function Yce(o){return Rn.endsWith(o,"[]")?o.slice(0,-2):o}function Wre(o,s,i){return o?o.concat(s).map(function(u,m){return u=Yce(u),!i&&m?"["+u+"]":u}).join(i?".":""):s}function Lhe(o){return Rn.isArray(o)&&!o.some(Wte)}const Vhe=Rn.toFlatObject(Rn,{},null,function(o){return/^is[A-Z]/.test(o)});function oU(o,s,i){if(!Rn.isObject(o))throw new TypeError("target must be an object");s=s||new FormData,i=Rn.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(F,Z){return!Rn.isUndefined(Z[F])});const u=i.metaTokens,m=i.visitor||_,h=i.dots,b=i.indexes,C=(i.Blob||typeof Blob<"u"&&Blob)&&Rn.isSpecCompliantForm(s);if(!Rn.isFunction(m))throw new TypeError("visitor must be a function");function S(F){if(F===null)return"";if(Rn.isDate(F))return F.toISOString();if(!C&&Rn.isBlob(F))throw new Er("Blob is not supported. Use a Buffer instead.");return Rn.isArrayBuffer(F)||Rn.isTypedArray(F)?C&&typeof Blob=="function"?new Blob([F]):Buffer.from(F):F}function _(F,Z,G){let Y=F;if(F&&!G&&typeof F=="object"){if(Rn.endsWith(Z,"{}"))Z=u?Z:Z.slice(0,-2),F=JSON.stringify(F);else if(Rn.isArray(F)&&Lhe(F)||(Rn.isFileList(F)||Rn.endsWith(Z,"[]"))&&(Y=Rn.toArray(F)))return Z=Yce(Z),Y.forEach(function(q,W){!(Rn.isUndefined(q)||q===null)&&s.append(b===!0?Wre([Z],W,h):b===null?Z:Z+"[]",S(q))}),!1}return Wte(F)?!0:(s.append(Wre(G,Z,h),S(F)),!1)}const N=[],O=Object.assign(Vhe,{defaultVisitor:_,convertValue:S,isVisitable:Wte});function B(F,Z){if(!Rn.isUndefined(F)){if(N.indexOf(F)!==-1)throw Error("Circular reference detected in "+Z.join("."));N.push(F),Rn.forEach(F,function(G,Y){(!(Rn.isUndefined(G)||G===null)&&m.call(s,G,Rn.isString(Y)?Y.trim():Y,Z,O))===!0&&B(G,Z?Z.concat(Y):[Y])}),N.pop()}}if(!Rn.isObject(o))throw new TypeError("data must be an object");return B(o),s}function Zre(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function jne(o,s){this._pairs=[],o&&oU(o,this,s)}const Kce=jne.prototype;Kce.append=function(o,s){this._pairs.push([o,s])};Kce.toString=function(o){const s=o?function(i){return o.call(this,i,Zre)}:Zre;return this._pairs.map(function(i){return s(i[0])+"="+s(i[1])},"").join("&")};function Hhe(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Xce(o,s,i){if(!s)return o;const u=i&&i.encode||Hhe;Rn.isFunction(i)&&(i={serialize:i});const m=i&&i.serialize;let h;if(m?h=m(s,i):h=Rn.isURLSearchParams(s)?s.toString():new jne(s,i).toString(u),h){const b=o.indexOf("#");b!==-1&&(o=o.slice(0,b)),o+=(o.indexOf("?")===-1?"?":"&")+h}return o}let Gre=class{constructor(){this.handlers=[]}use(s,i,u){return this.handlers.push({fulfilled:s,rejected:i,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1}eject(s){this.handlers[s]&&(this.handlers[s]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){Rn.forEach(this.handlers,function(i){i!==null&&s(i)})}};const Jce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zhe=typeof URLSearchParams<"u"?URLSearchParams:jne,Uhe=typeof FormData<"u"?FormData:null,jhe=typeof Blob<"u"?Blob:null,Whe={isBrowser:!0,classes:{URLSearchParams:zhe,FormData:Uhe,Blob:jhe},protocols:["http","https","file","blob","url","data"]},Wne=typeof window<"u"&&typeof document<"u",Zte=typeof navigator=="object"&&navigator||void 0,Zhe=Wne&&(!Zte||["ReactNative","NativeScript","NS"].indexOf(Zte.product)<0),Ghe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",qhe=Wne&&window.location.href||"http://localhost",Yhe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wne,hasStandardBrowserEnv:Zhe,hasStandardBrowserWebWorkerEnv:Ghe,navigator:Zte,origin:qhe},Symbol.toStringTag,{value:"Module"})),Kd={...Yhe,...Whe};function Khe(o,s){return oU(o,new Kd.classes.URLSearchParams,Object.assign({visitor:function(i,u,m,h){return Kd.isNode&&Rn.isBuffer(i)?(this.append(u,i.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},s))}function Xhe(o){return Rn.matchAll(/\w+|\[(\w*)]/g,o).map(s=>s[0]==="[]"?"":s[1]||s[0])}function Jhe(o){const s={},i=Object.keys(o);let u;const m=i.length;let h;for(u=0;u<m;u++)h=i[u],s[h]=o[h];return s}function Qce(o){function s(i,u,m,h){let b=i[h++];if(b==="__proto__")return!0;const C=Number.isFinite(+b),S=h>=i.length;return b=!b&&Rn.isArray(m)?m.length:b,S?(Rn.hasOwnProp(m,b)?m[b]=[m[b],u]:m[b]=u,!C):((!m[b]||!Rn.isObject(m[b]))&&(m[b]=[]),s(i,u,m[b],h)&&Rn.isArray(m[b])&&(m[b]=Jhe(m[b])),!C)}if(Rn.isFormData(o)&&Rn.isFunction(o.entries)){const i={};return Rn.forEachEntry(o,(u,m)=>{s(Xhe(u),m,i,0)}),i}return null}function Qhe(o,s,i){if(Rn.isString(o))try{return(s||JSON.parse)(o),Rn.trim(o)}catch(u){if(u.name!=="SyntaxError")throw u}return(0,JSON.stringify)(o)}const wR={transitional:Jce,adapter:["xhr","http","fetch"],transformRequest:[function(o,s){const i=s.getContentType()||"",u=i.indexOf("application/json")>-1,m=Rn.isObject(o);if(m&&Rn.isHTMLForm(o)&&(o=new FormData(o)),Rn.isFormData(o))return u?JSON.stringify(Qce(o)):o;if(Rn.isArrayBuffer(o)||Rn.isBuffer(o)||Rn.isStream(o)||Rn.isFile(o)||Rn.isBlob(o)||Rn.isReadableStream(o))return o;if(Rn.isArrayBufferView(o))return o.buffer;if(Rn.isURLSearchParams(o))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let h;if(m){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Khe(o,this.formSerializer).toString();if((h=Rn.isFileList(o))||i.indexOf("multipart/form-data")>-1){const b=this.env&&this.env.FormData;return oU(h?{"files[]":o}:o,b&&new b,this.formSerializer)}}return m||u?(s.setContentType("application/json",!1),Qhe(o)):o}],transformResponse:[function(o){const s=this.transitional||wR.transitional,i=s&&s.forcedJSONParsing,u=this.responseType==="json";if(Rn.isResponse(o)||Rn.isReadableStream(o))return o;if(o&&Rn.isString(o)&&(i&&!this.responseType||u)){const m=!(s&&s.silentJSONParsing)&&u;try{return JSON.parse(o)}catch(h){if(m)throw h.name==="SyntaxError"?Er.from(h,Er.ERR_BAD_RESPONSE,this,null,this.response):h}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Kd.classes.FormData,Blob:Kd.classes.Blob},validateStatus:function(o){return o>=200&&o<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Rn.forEach(["delete","get","head","post","put","patch"],o=>{wR.headers[o]={}});const e1e=Rn.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"]),t1e=o=>{const s={};let i,u,m;return o&&o.split(`
|
|
2
2
|
`).forEach(function(h){m=h.indexOf(":"),i=h.substring(0,m).trim().toLowerCase(),u=h.substring(m+1).trim(),!(!i||s[i]&&e1e[i])&&(i==="set-cookie"?s[i]?s[i].push(u):s[i]=[u]:s[i]=s[i]?s[i]+", "+u:u)}),s},qre=Symbol("internals");function $6(o){return o&&String(o).trim().toLowerCase()}function XH(o){return o===!1||o==null?o:Rn.isArray(o)?o.map(XH):String(o)}function n1e(o){const s=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let u;for(;u=i.exec(o);)s[u[1]]=u[2];return s}const o1e=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function Ree(o,s,i,u,m){if(Rn.isFunction(u))return u.call(this,s,i);if(m&&(s=i),!!Rn.isString(s)){if(Rn.isString(u))return s.indexOf(u)!==-1;if(Rn.isRegExp(u))return u.test(s)}}function s1e(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,i,u)=>i.toUpperCase()+u)}function r1e(o,s){const i=Rn.toCamelCase(" "+s);["get","set","has"].forEach(u=>{Object.defineProperty(o,u+i,{value:function(m,h,b){return this[u].call(this,s,m,h,b)},configurable:!0})})}let xm=class{constructor(s){s&&this.set(s)}set(s,i,u){const m=this;function h(C,S,_){const N=$6(S);if(!N)throw new Error("header name must be a non-empty string");const O=Rn.findKey(m,N);(!O||m[O]===void 0||_===!0||_===void 0&&m[O]!==!1)&&(m[O||S]=XH(C))}const b=(C,S)=>Rn.forEach(C,(_,N)=>h(_,N,S));if(Rn.isPlainObject(s)||s instanceof this.constructor)b(s,i);else if(Rn.isString(s)&&(s=s.trim())&&!o1e(s))b(t1e(s),i);else if(Rn.isHeaders(s))for(const[C,S]of s.entries())h(S,C,u);else s!=null&&h(i,s,u);return this}get(s,i){if(s=$6(s),s){const u=Rn.findKey(this,s);if(u){const m=this[u];if(!i)return m;if(i===!0)return n1e(m);if(Rn.isFunction(i))return i.call(this,m,u);if(Rn.isRegExp(i))return i.exec(m);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,i){if(s=$6(s),s){const u=Rn.findKey(this,s);return!!(u&&this[u]!==void 0&&(!i||Ree(this,this[u],u,i)))}return!1}delete(s,i){const u=this;let m=!1;function h(b){if(b=$6(b),b){const C=Rn.findKey(u,b);C&&(!i||Ree(u,u[C],C,i))&&(delete u[C],m=!0)}}return Rn.isArray(s)?s.forEach(h):h(s),m}clear(s){const i=Object.keys(this);let u=i.length,m=!1;for(;u--;){const h=i[u];(!s||Ree(this,this[h],h,s,!0))&&(delete this[h],m=!0)}return m}normalize(s){const i=this,u={};return Rn.forEach(this,(m,h)=>{const b=Rn.findKey(u,h);if(b){i[b]=XH(m),delete i[h];return}const C=s?s1e(h):String(h).trim();C!==h&&delete i[h],i[C]=XH(m),u[C]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const i=Object.create(null);return Rn.forEach(this,(u,m)=>{u!=null&&u!==!1&&(i[m]=s&&Rn.isArray(u)?u.join(", "):u)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([s,i])=>s+": "+i).join(`
|
|
3
3
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static concat(s,...i){const u=new this(s);return i.forEach(m=>u.set(m)),u}static accessor(s){const i=(this[qre]=this[qre]={accessors:{}}).accessors,u=this.prototype;function m(h){const b=$6(h);i[b]||(r1e(u,h),i[b]=!0)}return Rn.isArray(s)?s.forEach(m):m(s),this}};xm.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Rn.reduceDescriptors(xm.prototype,({value:o},s)=>{let i=s[0].toUpperCase()+s.slice(1);return{get:()=>o,set(u){this[i]=u}}});Rn.freezeMethods(xm);function Bee(o,s){const i=this||wR,u=s||i,m=xm.from(u.headers);let h=u.data;return Rn.forEach(o,function(b){h=b.call(i,h,m.normalize(),s?s.status:void 0)}),m.normalize(),h}function eue(o){return!!(o&&o.__CANCEL__)}function C4(o,s,i){Er.call(this,o??"canceled",Er.ERR_CANCELED,s,i),this.name="CanceledError"}Rn.inherits(C4,Er,{__CANCEL__:!0});function tue(o,s,i){const u=i.config.validateStatus;!i.status||!u||u(i.status)?o(i):s(new Er("Request failed with status code "+i.status,[Er.ERR_BAD_REQUEST,Er.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function a1e(o){const s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return s&&s[1]||""}function i1e(o,s){o=o||10;const i=new Array(o),u=new Array(o);let m=0,h=0,b;return s=s!==void 0?s:1e3,function(C){const S=Date.now(),_=u[h];b||(b=S),i[m]=C,u[m]=S;let N=h,O=0;for(;N!==m;)O+=i[N++],N=N%o;if(m=(m+1)%o,m===h&&(h=(h+1)%o),S-b<s)return;const B=_&&S-_;return B?Math.round(O*1e3/B):void 0}}function l1e(o,s){let i=0,u=1e3/s,m,h;const b=(C,S=Date.now())=>{i=S,m=null,h&&(clearTimeout(h),h=null),o.apply(null,C)};return[(...C)=>{const S=Date.now(),_=S-i;_>=u?b(C,S):(m=C,h||(h=setTimeout(()=>{h=null,b(m)},u-_)))},()=>m&&b(m)]}const gz=(o,s,i=3)=>{let u=0;const m=i1e(50,250);return l1e(h=>{const b=h.loaded,C=h.lengthComputable?h.total:void 0,S=b-u,_=m(S),N=b<=C;u=b;const O={loaded:b,total:C,progress:C?b/C:void 0,bytes:S,rate:_||void 0,estimated:_&&C&&N?(C-b)/_:void 0,event:h,lengthComputable:C!=null,[s?"download":"upload"]:!0};o(O)},i)},Yre=(o,s)=>{const i=o!=null;return[u=>s[0]({lengthComputable:i,total:o,loaded:u}),s[1]]},Kre=o=>(...s)=>Rn.asap(()=>o(...s)),c1e=Kd.hasStandardBrowserEnv?((o,s)=>i=>(i=new URL(i,Kd.origin),o.protocol===i.protocol&&o.host===i.host&&(s||o.port===i.port)))(new URL(Kd.origin),Kd.navigator&&/(msie|trident)/i.test(Kd.navigator.userAgent)):()=>!0,u1e=Kd.hasStandardBrowserEnv?{write(o,s,i,u,m,h){const b=[o+"="+encodeURIComponent(s)];Rn.isNumber(i)&&b.push("expires="+new Date(i).toGMTString()),Rn.isString(u)&&b.push("path="+u),Rn.isString(m)&&b.push("domain="+m),h===!0&&b.push("secure"),document.cookie=b.join("; ")},read(o){const s=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove(o){this.write(o,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function d1e(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function f1e(o,s){return s?o.replace(/\/?\/$/,"")+"/"+s.replace(/^\/+/,""):o}function nue(o,s){return o&&!d1e(s)?f1e(o,s):s}const Xre=o=>o instanceof xm?{...o}:o;function kE(o,s){s=s||{};const i={};function u(_,N,O,B){return Rn.isPlainObject(_)&&Rn.isPlainObject(N)?Rn.merge.call({caseless:B},_,N):Rn.isPlainObject(N)?Rn.merge({},N):Rn.isArray(N)?N.slice():N}function m(_,N,O,B){if(Rn.isUndefined(N)){if(!Rn.isUndefined(_))return u(void 0,_,O,B)}else return u(_,N,O,B)}function h(_,N){if(!Rn.isUndefined(N))return u(void 0,N)}function b(_,N){if(Rn.isUndefined(N)){if(!Rn.isUndefined(_))return u(void 0,_)}else return u(void 0,N)}function C(_,N,O){if(O in s)return u(_,N);if(O in o)return u(void 0,_)}const S={url:h,method:h,data:h,baseURL:b,transformRequest:b,transformResponse:b,paramsSerializer:b,timeout:b,timeoutMessage:b,withCredentials:b,withXSRFToken:b,adapter:b,responseType:b,xsrfCookieName:b,xsrfHeaderName:b,onUploadProgress:b,onDownloadProgress:b,decompress:b,maxContentLength:b,maxBodyLength:b,beforeRedirect:b,transport:b,httpAgent:b,httpsAgent:b,cancelToken:b,socketPath:b,responseEncoding:b,validateStatus:C,headers:(_,N,O)=>m(Xre(_),Xre(N),O,!0)};return Rn.forEach(Object.keys(Object.assign({},o,s)),function(_){const N=S[_]||m,O=N(o[_],s[_],_);Rn.isUndefined(O)&&N!==C||(i[_]=O)}),i}const oue=o=>{const s=kE({},o);let{data:i,withXSRFToken:u,xsrfHeaderName:m,xsrfCookieName:h,headers:b,auth:C}=s;s.headers=b=xm.from(b),s.url=Xce(nue(s.baseURL,s.url),o.params,o.paramsSerializer),C&&b.set("Authorization","Basic "+btoa((C.username||"")+":"+(C.password?unescape(encodeURIComponent(C.password)):"")));let S;if(Rn.isFormData(i)){if(Kd.hasStandardBrowserEnv||Kd.hasStandardBrowserWebWorkerEnv)b.setContentType(void 0);else if((S=b.getContentType())!==!1){const[_,...N]=S?S.split(";").map(O=>O.trim()).filter(Boolean):[];b.setContentType([_||"multipart/form-data",...N].join("; "))}}if(Kd.hasStandardBrowserEnv&&(u&&Rn.isFunction(u)&&(u=u(s)),u||u!==!1&&c1e(s.url))){const _=m&&h&&u1e.read(h);_&&b.set(m,_)}return s},m1e=typeof XMLHttpRequest<"u",p1e=m1e&&function(o){return new Promise(function(s,i){const u=oue(o);let m=u.data;const h=xm.from(u.headers).normalize();let{responseType:b,onUploadProgress:C,onDownloadProgress:S}=u,_,N,O,B,F;function Z(){B&&B(),F&&F(),u.cancelToken&&u.cancelToken.unsubscribe(_),u.signal&&u.signal.removeEventListener("abort",_)}let G=new XMLHttpRequest;G.open(u.method.toUpperCase(),u.url,!0),G.timeout=u.timeout;function Y(){if(!G)return;const W=xm.from("getAllResponseHeaders"in G&&G.getAllResponseHeaders()),L={data:!b||b==="text"||b==="json"?G.responseText:G.response,status:G.status,statusText:G.statusText,headers:W,config:o,request:G};tue(function(me){s(me),Z()},function(me){i(me),Z()},L),G=null}"onloadend"in G?G.onloadend=Y:G.onreadystatechange=function(){!G||G.readyState!==4||G.status===0&&!(G.responseURL&&G.responseURL.indexOf("file:")===0)||setTimeout(Y)},G.onabort=function(){G&&(i(new Er("Request aborted",Er.ECONNABORTED,o,G)),G=null)},G.onerror=function(){i(new Er("Network Error",Er.ERR_NETWORK,o,G)),G=null},G.ontimeout=function(){let W=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded";const L=u.transitional||Jce;u.timeoutErrorMessage&&(W=u.timeoutErrorMessage),i(new Er(W,L.clarifyTimeoutError?Er.ETIMEDOUT:Er.ECONNABORTED,o,G)),G=null},m===void 0&&h.setContentType(null),"setRequestHeader"in G&&Rn.forEach(h.toJSON(),function(W,L){G.setRequestHeader(L,W)}),Rn.isUndefined(u.withCredentials)||(G.withCredentials=!!u.withCredentials),b&&b!=="json"&&(G.responseType=u.responseType),S&&([O,F]=gz(S,!0),G.addEventListener("progress",O)),C&&G.upload&&([N,B]=gz(C),G.upload.addEventListener("progress",N),G.upload.addEventListener("loadend",B)),(u.cancelToken||u.signal)&&(_=W=>{G&&(i(!W||W.type?new C4(null,o,G):W),G.abort(),G=null)},u.cancelToken&&u.cancelToken.subscribe(_),u.signal&&(u.signal.aborted?_():u.signal.addEventListener("abort",_)));const q=a1e(u.url);if(q&&Kd.protocols.indexOf(q)===-1){i(new Er("Unsupported protocol "+q+":",Er.ERR_BAD_REQUEST,o));return}G.send(m||null)})},g1e=(o,s)=>{const{length:i}=o=o?o.filter(Boolean):[];if(s||i){let u=new AbortController,m;const h=function(_){if(!m){m=!0,C();const N=_ instanceof Error?_:this.reason;u.abort(N instanceof Er?N:new C4(N instanceof Error?N.message:N))}};let b=s&&setTimeout(()=>{b=null,h(new Er(`timeout ${s} of ms exceeded`,Er.ETIMEDOUT))},s);const C=()=>{o&&(b&&clearTimeout(b),b=null,o.forEach(_=>{_.unsubscribe?_.unsubscribe(h):_.removeEventListener("abort",h)}),o=null)};o.forEach(_=>_.addEventListener("abort",h));const{signal:S}=u;return S.unsubscribe=()=>Rn.asap(C),S}},h1e=function*(o,s){let i=o.byteLength;if(i<s){yield o;return}let u=0,m;for(;u<i;)m=u+s,yield o.slice(u,m),u=m},v1e=async function*(o,s){for await(const i of b1e(o))yield*h1e(i,s)},b1e=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}const s=o.getReader();try{for(;;){const{done:i,value:u}=await s.read();if(i)break;yield u}}finally{await s.cancel()}},Jre=(o,s,i,u)=>{const m=v1e(o,s);let h=0,b,C=S=>{b||(b=!0,u&&u(S))};return new ReadableStream({async pull(S){try{const{done:_,value:N}=await m.next();if(_){C(),S.close();return}let O=N.byteLength;if(i){let B=h+=O;i(B)}S.enqueue(new Uint8Array(N))}catch(_){throw C(_),_}},cancel(S){return C(S),m.return()}},{highWaterMark:2})},sU=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",sue=sU&&typeof ReadableStream=="function",y1e=sU&&(typeof TextEncoder=="function"?(o=>s=>o.encode(s))(new TextEncoder):async o=>new Uint8Array(await new Response(o).arrayBuffer())),rue=(o,...s)=>{try{return!!o(...s)}catch{return!1}},w1e=sue&&rue(()=>{let o=!1;const s=new Request(Kd.origin,{body:new ReadableStream,method:"POST",get duplex(){return o=!0,"half"}}).headers.has("Content-Type");return o&&!s}),Qre=64*1024,Gte=sue&&rue(()=>Rn.isReadableStream(new Response("").body)),hz={stream:Gte&&(o=>o.body)};sU&&(o=>{["text","arrayBuffer","blob","formData","stream"].forEach(s=>{!hz[s]&&(hz[s]=Rn.isFunction(o[s])?i=>i[s]():(i,u)=>{throw new Er(`Response type '${s}' is not supported`,Er.ERR_NOT_SUPPORT,u)})})})(new Response);const C1e=async o=>{if(o==null)return 0;if(Rn.isBlob(o))return o.size;if(Rn.isSpecCompliantForm(o))return(await new Request(Kd.origin,{method:"POST",body:o}).arrayBuffer()).byteLength;if(Rn.isArrayBufferView(o)||Rn.isArrayBuffer(o))return o.byteLength;if(Rn.isURLSearchParams(o)&&(o=o+""),Rn.isString(o))return(await y1e(o)).byteLength},S1e=async(o,s)=>Rn.toFiniteNumber(o.getContentLength())??C1e(s),x1e=sU&&(async o=>{let{url:s,method:i,data:u,signal:m,cancelToken:h,timeout:b,onDownloadProgress:C,onUploadProgress:S,responseType:_,headers:N,withCredentials:O="same-origin",fetchOptions:B}=oue(o);_=_?(_+"").toLowerCase():"text";let F=g1e([m,h&&h.toAbortSignal()],b),Z;const G=F&&F.unsubscribe&&(()=>{F.unsubscribe()});let Y;try{if(S&&w1e&&i!=="get"&&i!=="head"&&(Y=await S1e(N,u))!==0){let Ze=new Request(s,{method:"POST",body:u,duplex:"half"}),_e;if(Rn.isFormData(u)&&(_e=Ze.headers.get("content-type"))&&N.setContentType(_e),Ze.body){const[Q,Fe]=Yre(Y,gz(Kre(S)));u=Jre(Ze.body,Qre,Q,Fe)}}Rn.isString(O)||(O=O?"include":"omit");const q="credentials"in Request.prototype;Z=new Request(s,{...B,signal:F,method:i.toUpperCase(),headers:N.normalize().toJSON(),body:u,duplex:"half",credentials:q?O:void 0});let W=await fetch(Z);const L=Gte&&(_==="stream"||_==="response");if(Gte&&(C||L&&G)){const Ze={};["status","statusText","headers"].forEach(lt=>{Ze[lt]=W[lt]});const _e=Rn.toFiniteNumber(W.headers.get("content-length")),[Q,Fe]=C&&Yre(_e,gz(Kre(C),!0))||[];W=new Response(Jre(W.body,Qre,Q,()=>{Fe&&Fe(),G&&G()}),Ze)}_=_||"text";let me=await hz[Rn.findKey(hz,_)||"text"](W,o);return!L&&G&&G(),await new Promise((Ze,_e)=>{tue(Ze,_e,{data:me,headers:xm.from(W.headers),status:W.status,statusText:W.statusText,config:o,request:Z})})}catch(q){throw G&&G(),q&&q.name==="TypeError"&&/fetch/i.test(q.message)?Object.assign(new Er("Network Error",Er.ERR_NETWORK,o,Z),{cause:q.cause||q}):Er.from(q,q&&q.code,o,Z)}}),qte={http:Fhe,xhr:p1e,fetch:x1e};Rn.forEach(qte,(o,s)=>{if(o){try{Object.defineProperty(o,"name",{value:s})}catch{}Object.defineProperty(o,"adapterName",{value:s})}});const eae=o=>`- ${o}`,E1e=o=>Rn.isFunction(o)||o===null||o===!1,aue={getAdapter:o=>{o=Rn.isArray(o)?o:[o];const{length:s}=o;let i,u;const m={};for(let h=0;h<s;h++){i=o[h];let b;if(u=i,!E1e(i)&&(u=qte[(b=String(i)).toLowerCase()],u===void 0))throw new Er(`Unknown adapter '${b}'`);if(u)break;m[b||"#"+h]=u}if(!u){const h=Object.entries(m).map(([C,S])=>`adapter ${C} `+(S===!1?"is not supported by the environment":"is not available in the build"));let b=s?h.length>1?`since :
|
|
4
4
|
`+h.map(eae).join(`
|
|
@@ -116,7 +116,7 @@ Required: `+w.join(", "));return bn[fe].apply(null,Ne)},log:bn=>{console.log(bn,
|
|
|
116
116
|
`:"")+"</video>",we=(Je,Ye)=>{var Ft;const Yt=ge.extend({},Ye);if(!Yt.source&&(ge.extend(Yt,st((Ft=Yt.embed)!==null&&Ft!==void 0?Ft:"",Je.schema)),!Yt.source))return"";Yt.altsource||(Yt.altsource=""),Yt.poster||(Yt.poster=""),Yt.source=Je.convertURL(Yt.source,"source"),Yt.altsource=Je.convertURL(Yt.altsource,"source"),Yt.sourcemime=he(Yt.source),Yt.altsourcemime=he(Yt.altsource),Yt.poster=Je.convertURL(Yt.poster,"poster");const mo=Ct(Yt.source);if(mo&&(Yt.source=mo.url,Yt.type=mo.type,Yt.allowfullscreen=mo.allowFullscreen,Yt.width=Yt.width||String(mo.w),Yt.height=Yt.height||String(mo.h)),Yt.embed)return pn(Yt.embed,Yt,!0,Je.schema);{const $o=Ze(Je),Zo=_e(Je),js=Q(Je);return Yt.width=Yt.width||"300",Yt.height=Yt.height||"150",ge.each(Yt,(ln,Wt)=>{Yt[Wt]=Je.dom.encode(""+ln)}),Yt.type==="iframe"?te(Yt,js):Yt.sourcemime==="application/x-shockwave-flash"?ie(Yt):Yt.sourcemime.indexOf("audio")!==-1?ce(Yt,$o):X(Yt,Zo)}},Me=Je=>Je.hasAttribute("data-mce-object")||Je.hasAttribute("data-ephox-embed-iri"),Pe=Je=>{Je.on("mousedown",Ye=>{const Ft=Je.dom.getParent(Ye.target,".mce-preview-object");Ft&&Je.dom.getAttrib(Ft,"data-mce-selected")==="2"&&Ye.stopImmediatePropagation()}),Je.on("click keyup touchend",()=>{const Ye=Je.selection.getNode();Ye&&Je.dom.hasClass(Ye,"mce-preview-object")&&Je.dom.getAttrib(Ye,"data-mce-selected")&&Ye.setAttribute("data-mce-selected","2")}),Je.on("ObjectResized",Ye=>{const Ft=Ye.target;if(Ft.getAttribute("data-mce-object")){let Yt=Ft.getAttribute("data-mce-html");Yt&&(Yt=unescape(Yt),Ft.setAttribute("data-mce-html",escape(pn(Yt,{width:String(Ye.width),height:String(Ye.height)},!1,Je.schema))))}})},mt={},We=(Je,Ye,Ft)=>new Promise((Yt,mo)=>{const $o=Zo=>(Zo.html&&(mt[Je.source]=Zo),Yt({url:Je.source,html:Zo.html?Zo.html:Ye(Je)}));mt[Je.source]?$o(mt[Je.source]):Ft({url:Je.source}).then($o).catch(mo)}),bt=(Je,Ye)=>Promise.resolve({html:Ye(Je),url:Je.source}),Dt=Je=>Ye=>we(Je,Ye),gn=(Je,Ye)=>{const Ft=nt(Je);return Ft?We(Ye,Dt(Je),Ft):bt(Ye,Dt(Je))},Et=Je=>W(mt,Je),It=(Je,Ye)=>q(Ye,Je).bind(Ft=>q(Ft,"meta")),dn=(Je,Ye,Ft)=>Yt=>{const mo=()=>q(Je,Yt),$o=()=>q(Ye,Yt),Zo=Wt=>q(Wt,"value").bind(et=>et.length>0?_.some(et):_.none()),js=()=>mo().bind(Wt=>h(Wt)?Zo(Wt).orThunk($o):$o().orThunk(()=>_.from(Wt))),ln=()=>$o().orThunk(()=>mo().bind(Wt=>h(Wt)?Zo(Wt):_.from(Wt)));return{[Yt]:(Yt===Ft?js():ln()).getOr("")}},_n=(Je,Ye)=>{const Ft={};return q(Je,"dimensions").each(Yt=>{O(["width","height"],mo=>{q(Ye,mo).orThunk(()=>q(Yt,mo)).each($o=>Ft[mo]=$o)})}),Ft},xo=(Je,Ye)=>{const Ft=Ye&&Ye!=="dimensions"?It(Ye,Je).getOr({}):{},Yt=dn(Je,Ft,Ye);return{...Yt("source"),...Yt("altsource"),...Yt("poster"),...Yt("embed"),..._n(Je,Ft)}},Qn=Je=>{const Ye={...Je,source:{value:q(Je,"source").getOr("")},altsource:{value:q(Je,"altsource").getOr("")},poster:{value:q(Je,"poster").getOr("")}};return O(["width","height"],Ft=>{q(Je,Ft).each(Yt=>{const mo=Ye.dimensions||{};mo[Ft]=Yt,Ye.dimensions=mo})}),Ye},Ot=Je=>Ye=>{const Ft=Ye&&Ye.msg?"Media embed handler error: "+Ye.msg:"Media embed handler threw unknown error.";Je.notificationManager.open({type:"error",text:Ft})},rn=Je=>{const Ye=Je.selection.getNode(),Ft=Me(Ye)?Je.serializer.serialize(Ye,{selection:!0}):"",Yt=st(Ft,Je.schema),$o=(()=>{if(Ro(Yt.source,Yt.type)){const Zo=Je.dom.getRect(Ye);return{width:Zo.w.toString().replace(/px$/,""),height:Zo.h.toString().replace(/px$/,"")}}else return{}})();return{embed:Ft,...Yt,...$o}},an=(Je,Ye)=>Ft=>{if(m(Ft.url)&&Ft.url.trim().length>0){const Yt=Ft.html,$o={...st(Yt,Ye.schema),source:Ft.url,embed:Yt};Je.setData(Qn($o))}},On=(Je,Ye)=>{const Ft=Je.dom.select("*[data-mce-object]");for(let Yt=0;Yt<Ye.length;Yt++)for(let mo=Ft.length-1;mo>=0;mo--)Ye[Yt]===Ft[mo]&&Ft.splice(mo,1);Je.selection.select(Ft[0])},ko=(Je,Ye)=>{const Ft=Je.dom.select("*[data-mce-object]");Je.insertContent(Ye),On(Je,Ft),Je.nodeChanged()},Ro=(Je,Ye)=>S(Ye)&&Ye==="ephox-embed-iri"&&S(Ct(Je)),ws=(Je,Ye)=>((Yt,mo)=>Yt.width!==mo.width||Yt.height!==mo.height)(Je,Ye)&&Ro(Ye.source,Je.type),yo=(Je,Ye,Ft)=>{var Yt;Ye.embed=ws(Je,Ye)&&Nt(Ft)?we(Ft,{...Ye,embed:""}):pn((Yt=Ye.embed)!==null&&Yt!==void 0?Yt:"",Ye,!1,Ft.schema),Ye.embed&&(Je.source===Ye.source||Et(Ye.source))?ko(Ft,Ye.embed):gn(Ft,Ye).then(mo=>{ko(Ft,mo.html)}).catch(Ot(Ft))},Us=Je=>{const Ye=rn(Je),Ft=F(Ye),Yt=Qn(Ye),mo=(oo,Co)=>{const Io=xo(Co.getData(),"source");oo.source!==Io.source&&(an(fo,Je)({url:Io.source,html:""}),gn(Je,Io).then(an(fo,Je)).catch(Ot(Je)))},$o=oo=>{var Co;const Io=xo(oo.getData()),ls=st((Co=Io.embed)!==null&&Co!==void 0?Co:"",Je.schema);oo.setData(Qn(ls))},Zo=(oo,Co,Io)=>{const ls=xo(oo.getData(),Co),Js=ws(Io,ls)&&Nt(Je)?{...ls,embed:""}:ls,Es=we(Je,Js);oo.setData(Qn({...Js,embed:Es}))},js=[{name:"source",type:"urlinput",filetype:"media",label:"Source",picker_text:"Browse files"}],ln=Nt(Je)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],Wt={title:"General",name:"general",items:B([js,ln])},at={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},cn=[];$e(Je)&&cn.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),ue(Je)&&cn.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const yn={title:"Advanced",name:"advanced",items:cn},zn=[Wt,at];cn.length>0&&zn.push(yn);const co={type:"tabpanel",tabs:zn},fo=Je.windowManager.open({title:"Insert/Edit Media",size:"normal",body:co,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:oo=>{const Co=xo(oo.getData());yo(Ft.get(),Co,Je),oo.close()},onChange:(oo,Co)=>{switch(Co.name){case"source":mo(Ft.get(),oo);break;case"embed":$o(oo);break;case"dimensions":case"altsource":case"poster":Zo(oo,Co.name,Ft.get());break}Ft.set(xo(oo.getData()))},initialData:Yt})},fn=Je=>({showDialog:()=>{Us(Je)}}),Ho=Je=>{const Ye=()=>{Us(Je)};Je.addCommand("mceMedia",Ye)},tr=(Je,Ye,Ft)=>Je.length>=Ye.length&&Je.substr(Ft,Ft+Ye.length)===Ye,rr=(Je,Ye)=>tr(Je,Ye,0);var Ir=tinymce.util.Tools.resolve("tinymce.Env");const Pr=Je=>{const Ye=Je.name;return Ye==="iframe"||Ye==="video"||Ye==="audio"},ks=(Je,Ye,Ft,Yt=null)=>{const mo=Je.attr(Ft);return S(mo)?mo:W(Ye,Ft)?null:Yt},Nr=(Je,Ye,Ft)=>{const Yt=Ye.name==="img"||Je.name==="video",mo=Yt?"300":null,$o=Je.name==="audio"?"30":"150",Zo=Yt?$o:null;Ye.attr({width:ks(Je,Ft,"width",mo),height:ks(Je,Ft,"height",Zo)})},Xr=(Je,Ye,Ft,Yt)=>{const mo=ze(Je.schema).parse(Yt,{context:Ye});for(;mo.firstChild;)Ft.append(mo.firstChild)},xs=(Je,Ye)=>{const Ft=Ye.name,Yt=new Ge("img",1);return Ps(Je,Ye,Yt),Nr(Ye,Yt,{}),Yt.attr({style:Ye.attr("style"),src:Ir.transparentSrc,"data-mce-object":Ft,class:"mce-object mce-object-"+Ft}),Yt},uo=(Je,Ye)=>{var Ft;const Yt=Ye.name,mo=new Ge("span",1);mo.attr({contentEditable:"false",style:Ye.attr("style"),"data-mce-object":Yt,class:"mce-preview-object mce-object-"+Yt}),Ps(Je,Ye,mo);const $o=Je.dom.parseStyle((Ft=Ye.attr("style"))!==null&&Ft!==void 0?Ft:""),Zo=new Ge(Yt,1);if(Nr(Ye,Zo,$o),Zo.attr({src:Ye.attr("src"),style:Ye.attr("style"),class:Ye.attr("class")}),Yt==="iframe")Zo.attr({allowfullscreen:Ye.attr("allowfullscreen"),frameborder:"0",sandbox:Ye.attr("sandbox"),referrerpolicy:Ye.attr("referrerpolicy")});else{O(["controls","crossorigin","currentTime","loop","muted","poster","preload"],et=>{Zo.attr(et,Ye.attr(et))});const Wt=mo.attr("data-mce-html");S(Wt)&&Xr(Je,Yt,Zo,unescape(Wt))}const js=new Ge("span",1);return js.attr("class","mce-shim"),mo.append(Zo),mo.append(js),mo},Ps=(Je,Ye,Ft)=>{var Yt;const mo=(Yt=Ye.attributes)!==null&&Yt!==void 0?Yt:[];let $o=mo.length;for(;$o--;){const Wt=mo[$o].name;let et=mo[$o].value;Wt!=="width"&&Wt!=="height"&&Wt!=="style"&&!rr(Wt,"data-mce-")&&((Wt==="data"||Wt==="src")&&(et=Je.convertURL(et,Wt)),Ft.attr("data-mce-p-"+Wt,et))}const Zo=Tt({inner:!0},Je.schema),js=new Ge("div",1);O(Ye.children(),Wt=>js.append(Wt));const ln=Zo.serialize(js);ln&&(Ft.attr("data-mce-html",escape(ln)),Ft.empty())},_t=Je=>{const Ye=Je.attr("class");return m(Ye)&&/\btiny-pageembed\b/.test(Ye)},Ht=Je=>{let Ye=Je;for(;Ye=Ye.parent;)if(Ye.attr("data-ephox-embed-iri")||_t(Ye))return!0;return!1},Fn=Je=>Ye=>{let Ft=Ye.length,Yt;for(;Ft--;)Yt=Ye[Ft],Yt.parent&&(Yt.parent.attr("data-mce-object")||(Pr(Yt)&&Fe(Je)?Ht(Yt)||Yt.replace(uo(Je,Yt)):Ht(Yt)||Yt.replace(xs(Je,Yt))))},ao=(Je,Ye,Ft)=>{const Yt=Je.options.get,mo=Yt("xss_sanitization"),$o=lt(Je);return ze(Je.schema,{sanitize:mo,validate:$o}).parse(Ft,{context:Ye})},Bo=Je=>{Je.on("PreInit",()=>{const{schema:Ye,serializer:Ft,parser:Yt}=Je,mo=Ye.getBoolAttrs();O("webkitallowfullscreen mozallowfullscreen".split(" "),$o=>{mo[$o]={}}),Y({embed:["wmode"]},($o,Zo)=>{const js=Ye.getElementRule(Zo);js&&O($o,ln=>{js.attributes[ln]={},js.attributesOrder.push(ln)})}),Yt.addNodeFilter("iframe,video,audio,object,embed",Fn(Je)),Ft.addAttributeFilter("data-mce-object",($o,Zo)=>{var js;let ln=$o.length;for(;ln--;){const Wt=$o[ln];if(!Wt.parent)continue;const et=Wt.attr(Zo),at=new Ge(et,1);if(et!=="audio"){const co=Wt.attr("class");co&&co.indexOf("mce-preview-object")!==-1&&Wt.firstChild?at.attr({width:Wt.firstChild.attr("width"),height:Wt.firstChild.attr("height")}):at.attr({width:Wt.attr("width"),height:Wt.attr("height")})}at.attr({style:Wt.attr("style")});const cn=(js=Wt.attributes)!==null&&js!==void 0?js:[];let yn=cn.length;for(;yn--;){const co=cn[yn].name;co.indexOf("data-mce-p-")===0&&at.attr(co.substr(11),cn[yn].value)}const zn=Wt.attr("data-mce-html");if(zn){const co=ao(Je,et,unescape(zn));O(co.children(),fo=>at.append(fo))}Wt.replace(at)}})}),Je.on("SetContent",()=>{const Ye=Je.dom;O(Ye.select("span.mce-preview-object"),Ft=>{Ye.select("span.mce-shim",Ft).length===0&&Ye.add(Ft,"span",{class:"mce-shim"})})})},is=Je=>{Je.on("ResolveName",Ye=>{let Ft;Ye.target.nodeType===1&&(Ft=Ye.target.getAttribute("data-mce-object"))&&(Ye.name=Ft)})},yr=Je=>Ye=>{const Ft=()=>{Ye.setEnabled(Je.selection.isEditable())};return Je.on("NodeChange",Ft),Ft(),()=>{Je.off("NodeChange",Ft)}},wr=Je=>{const Ye=()=>Je.execCommand("mceMedia");Je.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:Ye,onSetup:Ft=>{const Yt=Je.selection;Ft.setActive(Me(Yt.getNode()));const mo=Yt.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",Ft.setActive).unbind,$o=yr(Je)(Ft);return()=>{mo(),$o()}}}),Je.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:Ye,onSetup:yr(Je)})};var ar=()=>{o.add("media",Je=>(me(Je),Ho(Je),wr(Je),is(Je),Bo(Je),Pe(Je),fn(Je)))};ar()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=q=>W=>typeof W===q,i=s("boolean"),u=s("number"),m=q=>W=>W.options.get(q),h=q=>{const W=q.options.register;W("nonbreaking_force_tab",{processor:L=>i(L)?{value:L?3:0,valid:!0}:u(L)?{value:L,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),W("nonbreaking_wrap",{processor:"boolean",default:!0})},b=m("nonbreaking_force_tab"),C=m("nonbreaking_wrap"),S=(q,W)=>{let L="";for(let me=0;me<W;me++)L+=q;return L},_=q=>q.plugins.visualchars?q.plugins.visualchars.isEnabled():!1,N=(q,W)=>{const L=()=>_(q)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap",me=()=>`<span class="${L()}" contenteditable="false">${S(" ",W)}</span>`,_e=C(q)||q.plugins.visualchars?me():S(" ",W);q.undoManager.transact(()=>q.insertContent(_e))},O=q=>{q.addCommand("mceNonBreaking",()=>{N(q,1)})};var B=tinymce.util.Tools.resolve("tinymce.util.VK");const F=q=>{const W=b(q);W>0&&q.on("keydown",L=>{if(L.keyCode===B.TAB&&!L.isDefaultPrevented()){if(L.shiftKey)return;L.preventDefault(),L.stopImmediatePropagation(),N(q,W)}})},Z=q=>W=>{const L=()=>{W.setEnabled(q.selection.isEditable())};return q.on("NodeChange",L),L(),()=>{q.off("NodeChange",L)}},G=q=>{const W=()=>q.execCommand("mceNonBreaking");q.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:W,onSetup:Z(q)}),q.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:W,onSetup:Z(q)})};var Y=()=>{o.add("nonbreaking",q=>{h(q),O(q),G(q),F(q)})};Y()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=tinymce.util.Tools.resolve("tinymce.Env");const i=Z=>G=>G.options.get(Z),u=Z=>{const G=Z.options.register;G("pagebreak_separator",{processor:"string",default:"<!-- pagebreak -->"}),G("pagebreak_split_block",{processor:"boolean",default:!1})},m=i("pagebreak_separator"),h=i("pagebreak_split_block"),b="mce-pagebreak",C=Z=>{const G=`<img src="${s.transparentSrc}" class="${b}" data-mce-resize="false" data-mce-placeholder />`;return Z?`<p>${G}</p>`:G},S=Z=>{const G=m(Z),Y=()=>h(Z),q=new RegExp(G.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,W=>"\\"+W),"gi");Z.on("BeforeSetContent",W=>{W.content=W.content.replace(q,C(Y()))}),Z.on("PreInit",()=>{Z.serializer.addNodeFilter("img",W=>{let L=W.length,me,Ze;for(;L--;)if(me=W[L],Ze=me.attr("class"),Ze&&Ze.indexOf(b)!==-1){const _e=me.parent;if(_e&&Z.schema.getBlockElements()[_e.name]&&Y()){_e.type=3,_e.value=G,_e.raw=!0,me.remove();continue}me.type=3,me.value=G,me.raw=!0}})})},_=Z=>{Z.addCommand("mcePageBreak",()=>{Z.insertContent(C(h(Z)))})},N=Z=>{Z.on("ResolveName",G=>{G.target.nodeName==="IMG"&&Z.dom.hasClass(G.target,b)&&(G.name="pagebreak")})},O=Z=>G=>{const Y=()=>{G.setEnabled(Z.selection.isEditable())};return Z.on("NodeChange",Y),Y(),()=>{Z.off("NodeChange",Y)}},B=Z=>{const G=()=>Z.execCommand("mcePageBreak");Z.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:G,onSetup:O(Z)}),Z.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:G,onSetup:O(Z)})};var F=()=>{o.add("pagebreak",Z=>{u(Z),_(Z),B(Z),S(Z),N(Z)})};F()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(Ot=>rn=>Ot===rn)(void 0),u=Ot=>Ot==null,m=Ot=>!u(Ot);class h{constructor(rn,an){this.tag=rn,this.value=an}static some(rn){return new h(!0,rn)}static none(){return h.singletonNone}fold(rn,an){return this.tag?an(this.value):rn()}isSome(){return this.tag}isNone(){return!this.tag}map(rn){return this.tag?h.some(rn(this.value)):h.none()}bind(rn){return this.tag?rn(this.value):h.none()}exists(rn){return this.tag&&rn(this.value)}forall(rn){return!this.tag||rn(this.value)}filter(rn){return!this.tag||rn(this.value)?this:h.none()}getOr(rn){return this.tag?this.value:rn}or(rn){return this.tag?this:rn}getOrThunk(rn){return this.tag?this.value:rn()}orThunk(rn){return this.tag?this:rn()}getOrDie(rn){if(this.tag)return this.value;throw new Error(rn??"Called getOrDie on None")}static from(rn){return m(rn)?h.some(rn):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(rn){this.tag&&rn(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}h.singletonNone=new h(!1);const b=Ot=>()=>Ot,C=b(!1),S=(Ot,rn,an)=>{for(let On=0,ko=Ot.length;On<ko;On++){const Ro=Ot[On];if(rn(Ro,On))return h.some(Ro);if(an(Ro,On))break}return h.none()},_=(Ot,rn)=>S(Ot,rn,C),N=(Ot,rn)=>{for(let an=0;an<Ot.length;an++){const On=rn(Ot[an],an);if(On.isSome())return On}return h.none()};typeof window<"u"||Function("return this;")();const O=Ot=>{let rn=!1,an;return(...On)=>(rn||(rn=!0,an=Ot.apply(null,On)),an)},B=(Ot,rn,an,On)=>{const ko=Ot.isiOS()&&/ipad/i.test(an)===!0,Ro=Ot.isiOS()&&!ko,ws=Ot.isiOS()||Ot.isAndroid(),yo=ws||On("(pointer:coarse)"),Us=ko||!Ro&&ws&&On("(min-device-width:768px)"),fn=Ro||ws&&!Us,Ho=rn.isSafari()&&Ot.isiOS()&&/safari/i.test(an)===!1,tr=!fn&&!Us&&!Ho;return{isiPad:b(ko),isiPhone:b(Ro),isTablet:b(Us),isPhone:b(fn),isTouch:b(yo),isAndroid:Ot.isAndroid,isiOS:Ot.isiOS,isWebView:b(Ho),isDesktop:b(tr)}},F=(Ot,rn)=>{for(let an=0;an<Ot.length;an++){const On=Ot[an];if(On.test(rn))return On}},Z=(Ot,rn)=>{const an=F(Ot,rn);if(!an)return{major:0,minor:0};const On=ko=>Number(rn.replace(an,"$"+ko));return q(On(1),On(2))},G=(Ot,rn)=>{const an=String(rn).toLowerCase();return Ot.length===0?Y():Z(Ot,an)},Y=()=>q(0,0),q=(Ot,rn)=>({major:Ot,minor:rn}),W={nu:q,detect:G,unknown:Y},L=(Ot,rn)=>N(rn.brands,an=>{const On=an.brand.toLowerCase();return _(Ot,ko=>{var Ro;return On===((Ro=ko.brand)===null||Ro===void 0?void 0:Ro.toLowerCase())}).map(ko=>({current:ko.name,version:W.nu(parseInt(an.version,10),0)}))}),me=(Ot,rn)=>{const an=String(rn).toLowerCase();return _(Ot,On=>On.search(an))},Ze=(Ot,rn)=>me(Ot,rn).map(an=>{const On=W.detect(an.versionRegexes,rn);return{current:an.name,version:On}}),_e=(Ot,rn)=>me(Ot,rn).map(an=>{const On=W.detect(an.versionRegexes,rn);return{current:an.name,version:On}}),Q=(Ot,rn,an=0,On)=>{const ko=Ot.indexOf(rn,an);return ko!==-1?i(On)?!0:ko+rn.length<=On:!1},Fe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,lt=Ot=>rn=>Q(rn,Ot),nt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:Ot=>Q(Ot,"edge/")&&Q(Ot,"chrome")&&Q(Ot,"safari")&&Q(Ot,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Fe],search:Ot=>Q(Ot,"chrome")&&!Q(Ot,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:Ot=>Q(Ot,"msie")||Q(Ot,"trident")},{name:"Opera",versionRegexes:[Fe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:lt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:lt("firefox")},{name:"Safari",versionRegexes:[Fe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:Ot=>(Q(Ot,"safari")||Q(Ot,"mobile/"))&&Q(Ot,"applewebkit")}],$e=[{name:"Windows",search:lt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:Ot=>Q(Ot,"iphone")||Q(Ot,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:lt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:lt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:lt("linux"),versionRegexes:[]},{name:"Solaris",search:lt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:lt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:lt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ue={browsers:b(nt),oses:b($e)},Nt="Edge",ge="Chromium",Oe="IE",R="Opera",je="Firefox",ye="Safari",tt=()=>st({current:void 0,version:W.unknown()}),st=Ot=>{const rn=Ot.current,an=Ot.version,On=ko=>()=>rn===ko;return{current:rn,version:an,isEdge:On(Nt),isChromium:On(ge),isIE:On(Oe),isOpera:On(R),isFirefox:On(je),isSafari:On(ye)}},he={unknown:tt,nu:st,edge:b(Nt),chromium:b(ge),ie:b(Oe),opera:b(R),firefox:b(je),safari:b(ye)},Ge="Windows",Tt="iOS",ze="Android",vt="Linux",Be="macOS",ft="Solaris",oe="FreeBSD",pn="ChromeOS",gt=()=>St({current:void 0,version:W.unknown()}),St=Ot=>{const rn=Ot.current,an=Ot.version,On=ko=>()=>rn===ko;return{current:rn,version:an,isWindows:On(Ge),isiOS:On(Tt),isAndroid:On(ze),isMacOS:On(Be),isLinux:On(vt),isSolaris:On(ft),isFreeBSD:On(oe),isChromeOS:On(pn)}},jt={unknown:gt,nu:St,windows:b(Ge),ios:b(Tt),android:b(ze),linux:b(vt),macos:b(Be),solaris:b(ft),freebsd:b(oe),chromeos:b(pn)},te={detect:(Ot,rn,an)=>{const On=ue.browsers(),ko=ue.oses(),Ro=rn.bind(Us=>L(On,Us)).orThunk(()=>Ze(On,Ot)).fold(he.unknown,he.nu),ws=_e(ko,Ot).fold(jt.unknown,jt.nu),yo=B(ws,Ro,Ot,an);return{browser:Ro,os:ws,deviceType:yo}}},ie=Ot=>window.matchMedia(Ot).matches;let ce=O(()=>te.detect(window.navigator.userAgent,h.from(window.navigator.userAgentData),ie));const X=()=>ce(),we=()=>X().os.isMacOS(),Me=()=>X().os.isiOS(),Pe=()=>{const Ot=we()||Me();return`<script>(${(an=>{document.addEventListener("click",On=>{for(let ko=On.target;ko;ko=ko.parentNode)if(ko.nodeName==="A"){const ws=ko.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 mt=tinymce.util.Tools.resolve("tinymce.util.Tools");const We=Ot=>rn=>rn.options.get(Ot),bt=We("content_style"),Dt=We("content_css_cors"),gn=We("body_class"),Et=We("body_id"),It=Ot=>{var rn;let an="";const On=Ot.dom.encode,ko=(rn=bt(Ot))!==null&&rn!==void 0?rn:"";an+=`<base href="${On(Ot.documentBaseURI.getURI())}">`;const Ro=Dt(Ot)?' crossorigin="anonymous"':"";mt.each(Ot.contentCSS,tr=>{an+='<link type="text/css" rel="stylesheet" href="'+On(Ot.documentBaseURI.toAbsolute(tr))+'"'+Ro+">"}),ko&&(an+='<style type="text/css">'+ko+"</style>");const ws=Et(Ot),yo=gn(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(yo)+'"'+fn+">"+Ot.getContent()+Pe()+"</body></html>"},dn=Ot=>{const rn=It(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)})},xo=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 Qn=()=>{o.add("preview",Ot=>{_n(Ot),xo(Ot)})};Qn()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=()=>window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295;let i=0;const u=Ct=>{const ie=new Date().getTime(),ce=Math.floor(s()*1e9);return i++,Ct+"_"+ce+i+String(ie)},m=(Ct,te,ie)=>{Ct.execCommand("mceInsertTable",!1,{rows:ie,columns:te})},h=(Ct,te,ie)=>{const ce=Ct.editorUpload.blobCache,X=ce.create(u("mceu"),ie,te);ce.add(X),Ct.insertContent(Ct.dom.createHTML("img",{src:X.blobUri()}))},b=Ct=>new Promise(te=>{const ie=new FileReader;ie.onloadend=()=>{te(ie.result.split(",")[1])},ie.readAsDataURL(Ct)});var C=tinymce.util.Tools.resolve("tinymce.util.Delay");const S=Ct=>new Promise(te=>{let ie=!1;const ce=document.createElement("input");ce.type="file",ce.accept="image/*",ce.style.position="fixed",ce.style.left="0",ce.style.top="0",ce.style.opacity="0.001",document.body.appendChild(ce);const X=Pe=>{var mt;ie||((mt=ce.parentNode)===null||mt===void 0||mt.removeChild(ce),ie=!0,te(Pe))},we=Pe=>{X(Array.prototype.slice.call(Pe.target.files))};ce.addEventListener("input",we),ce.addEventListener("change",we);const Me=Pe=>{const mt=()=>{X([])};ie||(Pe.type==="focusin"?C.setEditorTimeout(Ct,mt,1e3):mt()),Ct.off("focusin remove",Me)};Ct.on("focusin remove",Me),ce.click()}),_=Ct=>{Ct.on("PreInit",()=>{Ct.queryCommandSupported("QuickbarInsertImage")||Ct.addCommand("QuickbarInsertImage",()=>{S(Ct).then(te=>{if(te.length>0){const ie=te[0];b(ie).then(ce=>{h(Ct,ce,ie)})}})})})},N=(Ct,te,ie)=>{var ce;return ie(Ct,te.prototype)?!0:((ce=Ct.constructor)===null||ce===void 0?void 0:ce.name)===te.name},O=Ct=>{const te=typeof Ct;return Ct===null?"null":te==="object"&&Array.isArray(Ct)?"array":te==="object"&&N(Ct,String,(ie,ce)=>ce.isPrototypeOf(ie))?"string":te},B=Ct=>te=>O(te)===Ct,F=Ct=>te=>typeof te===Ct,Z=B("string"),G=F("boolean"),Y=Ct=>Ct==null,q=Ct=>!Y(Ct),W=F("function"),L=Ct=>te=>te.options.get(Ct),me=Ct=>{const te=Ct.options.register,ie=Me=>Pe=>{const mt=G(Pe)||Z(Pe);return mt?G(Pe)?{value:Pe?Me:"",valid:mt}:{value:Pe.trim(),valid:mt}:{valid:!1,message:"Must be a boolean or string."}},ce="bold italic | quicklink h2 h3 blockquote";te("quickbars_selection_toolbar",{processor:ie(ce),default:ce});const X="quickimage quicktable";te("quickbars_insert_toolbar",{processor:ie(X),default:X});const we="alignleft aligncenter alignright";te("quickbars_image_toolbar",{processor:ie(we),default:we})},Ze=L("quickbars_selection_toolbar"),_e=L("quickbars_insert_toolbar"),Q=L("quickbars_image_toolbar"),Fe=Ct=>{Ct.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:()=>Ct.execCommand("QuickbarInsertImage")}),Ct.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:()=>{m(Ct,2,2)}})},nt=(Ct=>()=>Ct)(!1);class $e{constructor(te,ie){this.tag=te,this.value=ie}static some(te){return new $e(!0,te)}static none(){return $e.singletonNone}fold(te,ie){return this.tag?ie(this.value):te()}isSome(){return this.tag}isNone(){return!this.tag}map(te){return this.tag?$e.some(te(this.value)):$e.none()}bind(te){return this.tag?te(this.value):$e.none()}exists(te){return this.tag&&te(this.value)}forall(te){return!this.tag||te(this.value)}filter(te){return!this.tag||te(this.value)?this:$e.none()}getOr(te){return this.tag?this.value:te}or(te){return this.tag?this:te}getOrThunk(te){return this.tag?this.value:te()}orThunk(te){return this.tag?this:te()}getOrDie(te){if(this.tag)return this.value;throw new Error(te??"Called getOrDie on None")}static from(te){return q(te)?$e.some(te):$e.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(te){this.tag&&te(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}$e.singletonNone=new $e(!1),typeof window<"u"||Function("return this;")();const ue=1,Nt=Ct=>Ct.dom.nodeName.toLowerCase(),ge=(Ct,te)=>{const ie=Ct.dom;return ie&&ie.hasAttribute?ie.hasAttribute(te):!1};var Oe=(Ct,te,ie,ce,X)=>Ct(ie,ce)?$e.some(ie):W(X)&&X(ie)?$e.none():te(ie,ce,X);const R=(Ct,te)=>{const ce=(te||document).createElement("div");if(ce.innerHTML=Ct,!ce.hasChildNodes()||ce.childNodes.length>1){const X="HTML does not have a single root node";throw console.error(X,Ct),new Error(X)}return tt(ce.childNodes[0])},je=(Ct,te)=>{const ce=(te||document).createElement(Ct);return tt(ce)},ye=(Ct,te)=>{const ce=(te||document).createTextNode(Ct);return tt(ce)},tt=Ct=>{if(Ct==null)throw new Error("Node cannot be null or undefined");return{dom:Ct}},he={fromHtml:R,fromTag:je,fromText:ye,fromDom:tt,fromPoint:(Ct,te,ie)=>$e.from(Ct.dom.elementFromPoint(te,ie)).map(tt)},Ge=(Ct,te)=>{const ie=Ct.dom;if(ie.nodeType!==ue)return!1;{const ce=ie;if(ce.matches!==void 0)return ce.matches(te);if(ce.msMatchesSelector!==void 0)return ce.msMatchesSelector(te);if(ce.webkitMatchesSelector!==void 0)return ce.webkitMatchesSelector(te);if(ce.mozMatchesSelector!==void 0)return ce.mozMatchesSelector(te);throw new Error("Browser lacks native selectors")}},Tt=(Ct,te,ie)=>{let ce=Ct.dom;const X=W(ie)?ie:nt;for(;ce.parentNode;){ce=ce.parentNode;const we=he.fromDom(ce);if(te(we))return $e.some(we);if(X(we))break}return $e.none()},ze=(Ct,te,ie)=>Oe((X,we)=>we(X),Tt,Ct,te,ie),vt=(Ct,te,ie)=>ze(Ct,te,ie).isSome(),Be=(Ct,te,ie)=>Tt(Ct,ce=>Ge(ce,te),ie),ft=(Ct,te,ie)=>Oe((X,we)=>Ge(X,we),Be,Ct,te,ie),oe=Ct=>{const te=_e(Ct);te.length>0&&Ct.ui.registry.addContextToolbar("quickblock",{predicate:ie=>{const ce=he.fromDom(ie),X=Ct.schema.getTextBlockElements(),we=Me=>Me.dom===Ct.getBody();return!ge(ce,"data-mce-bogus")&&ft(ce,'table,[data-mce-bogus="all"]',we).fold(()=>vt(ce,Me=>Nt(Me)in X&&Ct.dom.isEmpty(Me.dom),we),nt)},items:te,position:"line",scope:"editor"})},pn=Ct=>Ct.dom.classList!==void 0,gt=(Ct,te)=>pn(Ct)&&Ct.dom.classList.contains(te),St=Ct=>{const te=Me=>Ct.dom.isEditable(Me),ie=Me=>te(Me.parentElement),ce=Me=>{const Pe=Me.nodeName==="FIGURE"&&/image/i.test(Me.className),mt=Me.nodeName==="IMG"||Pe,We=gt(he.fromDom(Me),"mce-pagebreak");return mt&&ie(Me)&&!We},X=Q(Ct);X.length>0&&Ct.ui.registry.addContextToolbar("imageselection",{predicate:ce,items:X,position:"node"});const we=Ze(Ct);we.length>0&&Ct.ui.registry.addContextToolbar("textselection",{predicate:Me=>!ce(Me)&&!Ct.selection.isCollapsed()&&te(Me),items:we,position:"selection",scope:"editor"})};var jt=()=>{o.add("quickbars",Ct=>{me(Ct),_(Ct),Fe(Ct),oe(Ct),St(Ct)})};jt()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(q=>W=>typeof W===q)("function");var u=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=tinymce.util.Tools.resolve("tinymce.util.Tools");const h=q=>W=>W.options.get(q),b=q=>{const W=q.options.register;W("save_enablewhendirty",{processor:"boolean",default:!0}),W("save_onsavecallback",{processor:"function"}),W("save_oncancelcallback",{processor:"function"})},C=h("save_enablewhendirty"),S=h("save_onsavecallback"),_=h("save_oncancelcallback"),N=(q,W)=>{q.notificationManager.open({text:W,type:"error"})},O=q=>{const W=u.DOM.getParent(q.id,"form");if(C(q)&&!q.isDirty())return;q.save();const L=S(q);if(i(L)){L.call(q,q),q.nodeChanged();return}W?(q.setDirty(!1),(!W.onsubmit||W.onsubmit())&&(typeof W.submit=="function"?W.submit():N(q,"Error: Form submit field collision.")),q.nodeChanged()):N(q,"Error: No form element found.")},B=q=>{const W=m.trim(q.startContent),L=_(q);if(i(L)){L.call(q,q);return}q.resetContent(W)},F=q=>{q.addCommand("mceSave",()=>{O(q)}),q.addCommand("mceCancel",()=>{B(q)})},Z=q=>W=>{const L=()=>{W.setEnabled(!C(q)||q.isDirty())};return L(),q.on("NodeChange dirty",L),()=>q.off("NodeChange dirty",L)},G=q=>{q.ui.registry.addButton("save",{icon:"save",tooltip:"Save",enabled:!1,onAction:()=>q.execCommand("mceSave"),onSetup:Z(q),shortcut:"Meta+S"}),q.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",enabled:!1,onAction:()=>q.execCommand("mceCancel"),onSetup:Z(q)}),q.addShortcut("Meta+S","","mceSave")};var Y=()=>{o.add("save",q=>{b(q),G(q),F(q)})};Y()})();(function(){const o=et=>{let at=et;return{get:()=>at,set:zn=>{at=zn}}};var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(et,at,cn)=>{var yn;return cn(et,at.prototype)?!0:((yn=et.constructor)===null||yn===void 0?void 0:yn.name)===at.name},u=et=>{const at=typeof et;return et===null?"null":at==="object"&&Array.isArray(et)?"array":at==="object"&&i(et,String,(cn,yn)=>yn.isPrototypeOf(cn))?"string":at},m=et=>at=>u(at)===et,h=et=>at=>typeof at===et,b=m("string"),C=m("array"),S=h("boolean"),_=et=>et==null,N=et=>!_(et),O=h("number"),B=()=>{},F=et=>()=>et,Z=F(!0),Y=F("[~№|!-*+-\\/:;?@\\[-`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]");class q{constructor(at,cn){this.tag=at,this.value=cn}static some(at){return new q(!0,at)}static none(){return q.singletonNone}fold(at,cn){return this.tag?cn(this.value):at()}isSome(){return this.tag}isNone(){return!this.tag}map(at){return this.tag?q.some(at(this.value)):q.none()}bind(at){return this.tag?at(this.value):q.none()}exists(at){return this.tag&&at(this.value)}forall(at){return!this.tag||at(this.value)}filter(at){return!this.tag||at(this.value)?this:q.none()}getOr(at){return this.tag?this.value:at}or(at){return this.tag?this:at}getOrThunk(at){return this.tag?this.value:at()}orThunk(at){return this.tag?this:at()}getOrDie(at){if(this.tag)return this.value;throw new Error(at??"Called getOrDie on None")}static from(at){return N(at)?q.some(at):q.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(at){this.tag&&at(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}q.singletonNone=new q(!1);const W=Y;var L=tinymce.util.Tools.resolve("tinymce.Env"),me=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ze=Array.prototype.slice,_e=Array.prototype.push,Q=(et,at)=>{const cn=et.length,yn=new Array(cn);for(let zn=0;zn<cn;zn++){const co=et[zn];yn[zn]=at(co,zn)}return yn},Fe=(et,at)=>{for(let cn=0,yn=et.length;cn<yn;cn++){const zn=et[cn];at(zn,cn)}},lt=(et,at)=>{for(let cn=et.length-1;cn>=0;cn--){const yn=et[cn];at(yn,cn)}},nt=(et,at)=>{if(et.length===0)return[];{let cn=at(et[0]);const yn=[];let zn=[];for(let co=0,fo=et.length;co<fo;co++){const oo=et[co],Co=at(oo);Co!==cn&&(yn.push(zn),zn=[]),cn=Co,zn.push(oo)}return zn.length!==0&&yn.push(zn),yn}},$e=(et,at,cn)=>(Fe(et,(yn,zn)=>{cn=at(cn,yn,zn)}),cn),ue=et=>{const at=[];for(let cn=0,yn=et.length;cn<yn;++cn){if(!C(et[cn]))throw new Error("Arr.flatten item "+cn+" was not an array, input: "+et);_e.apply(at,et[cn])}return at},Nt=(et,at)=>ue(Q(et,at)),ge=(et,at)=>{const cn=Ze.call(et,0);return cn.sort(at),cn},Oe=Object.hasOwnProperty,R=(et,at)=>Oe.call(et,at);typeof window<"u"||Function("return this;")();const je=9,ye=11,tt=1,st=3,he=et=>et.dom.nodeType,Tt=(et=>at=>he(at)===et)(st),ze=(et,at,cn)=>{if(b(cn)||S(cn)||O(cn))et.setAttribute(at,cn+"");else throw console.error("Invalid call to Attribute.set. Key ",at,":: Value ",cn,":: Element ",et),new Error("Attribute value was not simple")},vt=(et,at,cn)=>{ze(et.dom,at,cn)},Be=(et,at)=>{const yn=(at||document).createElement("div");if(yn.innerHTML=et,!yn.hasChildNodes()||yn.childNodes.length>1){const zn="HTML does not have a single root node";throw console.error(zn,et),new Error(zn)}return pn(yn.childNodes[0])},ft=(et,at)=>{const yn=(at||document).createElement(et);return pn(yn)},oe=(et,at)=>{const yn=(at||document).createTextNode(et);return pn(yn)},pn=et=>{if(et==null)throw new Error("Node cannot be null or undefined");return{dom:et}},St={fromHtml:Be,fromTag:ft,fromText:oe,fromDom:pn,fromPoint:(et,at,cn)=>q.from(et.dom.elementFromPoint(at,cn)).map(pn)},jt=et=>et.nodeType!==tt&&et.nodeType!==je&&et.nodeType!==ye||et.childElementCount===0,Ct=(et,at)=>{const cn=at===void 0?document:at.dom;return jt(cn)?[]:Q(cn.querySelectorAll(et),St.fromDom)},te=et=>q.from(et.dom.parentNode).map(St.fromDom),ie=et=>Q(et.dom.childNodes,St.fromDom),ce=(et,at)=>({element:et,offset:at}),X=(et,at)=>{const cn=ie(et);return cn.length>0&&at<cn.length?ce(cn[at],0):ce(et,at)},we=(et,at)=>{te(et).each(yn=>{yn.dom.insertBefore(at.dom,et.dom)})},Me=(et,at)=>{et.dom.appendChild(at.dom)},Pe=(et,at)=>{we(et,at),Me(at,et)},We=((et,at)=>{const cn=co=>{if(!et(co))throw new Error("Can only get "+at+" value of a "+at+" node");return yn(co).getOr("")},yn=co=>et(co)?q.from(co.dom.nodeValue):q.none();return{get:cn,getOption:yn,set:(co,fo)=>{if(!et(co))throw new Error("Can only set raw "+at+" value of a "+at+" node");co.dom.nodeValue=fo}}})(Tt,"text"),bt=et=>We.get(et),Dt=(et,at,cn)=>(et.compareDocumentPosition(at)&cn)!==0,gn=(et,at)=>Dt(et,at,Node.DOCUMENT_POSITION_PRECEDING),Et=(et,at)=>Ct(at,et);var It=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const dn=(et,at)=>et.isBlock(at)||R(et.schema.getVoidElements(),at.nodeName),_n=(et,at)=>!et.isEditable(at),xo=(et,at)=>et.getContentEditable(at)==="true"&&at.parentNode&&!et.isEditable(at.parentNode),Qn=(et,at)=>!et.isBlock(at)&&R(et.schema.getWhitespaceElements(),at.nodeName),Ot=(et,at)=>dn(et,at)||_n(et,at)||Qn(et,at)||xo(et,at),rn=et=>et.nodeType===3,an=()=>({sOffset:0,fOffset:0,elements:[]}),On=(et,at)=>X(St.fromDom(et),at),ko=(et,at,cn,yn,zn,co=!0)=>{let fo=co?at(!1):cn;for(;fo;){const oo=_n(et,fo);if(oo||Qn(et,fo)){if(oo?yn.cef(fo):yn.boundary(fo))break;fo=at(!0);continue}else if(dn(et,fo)){if(yn.boundary(fo))break}else rn(fo)&&yn.text(fo);if(fo===zn)break;fo=at(!1)}},Ro=(et,at,cn,yn,zn)=>{var co;if(Ot(et,cn))return;const fo=(co=et.getParent(yn,et.isBlock))!==null&&co!==void 0?co:et.getRoot(),oo=new It(cn,fo),Co=zn?oo.next.bind(oo):oo.prev.bind(oo);ko(et,Co,cn,{boundary:Z,cef:Z,text:Io=>{zn?at.fOffset+=Io.length:at.sOffset+=Io.length,at.elements.push(St.fromDom(Io))}})},ws=(et,at,cn,yn,zn,co=!0)=>{const fo=new It(cn,at),oo=[];let Co=an();Ro(et,Co,cn,at,!1);const Io=()=>(Co.elements.length>0&&(oo.push(Co),Co=an()),!1);return ko(et,fo.next.bind(fo),cn,{boundary:Io,cef:ls=>(Io(),zn&&oo.push(...zn.cef(ls)),!1),text:ls=>{Co.elements.push(St.fromDom(ls)),zn&&zn.text(ls,Co)}},yn,co),yn&&Ro(et,Co,yn,at,!0),Io(),oo},yo=(et,at)=>{const cn=On(at.startContainer,at.startOffset),yn=cn.element.dom,zn=On(at.endContainer,at.endOffset),co=zn.element.dom;return ws(et,at.commonAncestorContainer,yn,co,{text:(fo,oo)=>{fo===co?oo.fOffset+=fo.length-zn.offset:fo===yn&&(oo.sOffset+=cn.offset)},cef:fo=>{const oo=Nt(Et(St.fromDom(fo),"*[contenteditable=true]"),Co=>{const Io=Co.dom;return ws(et,Io,Io)});return ge(oo,(Co,Io)=>gn(Co.elements[0].dom,Io.elements[0].dom)?1:-1)}},!1)},Us=(et,at)=>at.collapsed?[]:yo(et,at),fn=(et,at)=>{const cn=et.createRng();return cn.selectNode(at),Us(et,cn)},Ho=(et,at)=>Nt(at,cn=>fn(et,cn)),tr=(et,at,cn=0,yn=et.length)=>{const zn=at.regex;zn.lastIndex=cn;const co=[];let fo;for(;fo=zn.exec(et);){const oo=fo[at.matchIndex],Co=fo.index+fo[0].indexOf(oo),Io=Co+oo.length;if(Io>yn)break;co.push({start:Co,finish:Io}),zn.lastIndex=Io}return co},rr=(et,at)=>{const cn=$e(et,(yn,zn)=>{const co=bt(zn),fo=yn.last,oo=fo+co.length,Co=Nt(at,(Io,ls)=>Io.start<oo&&Io.finish>fo?[{element:zn,start:Math.max(fo,Io.start)-fo,finish:Math.min(oo,Io.finish)-fo,matchId:ls}]:[]);return{results:yn.results.concat(Co),last:oo}},{results:[],last:0}).results;return nt(cn,yn=>yn.matchId)},Ir=(et,at)=>Nt(at,cn=>{const yn=cn.elements,zn=Q(yn,bt).join(""),co=tr(zn,et,cn.sOffset,zn.length-cn.fOffset);return rr(yn,co)}),Pr=(et,at)=>{lt(et,(cn,yn)=>{lt(cn,zn=>{const co=St.fromDom(at.cloneNode(!1));vt(co,"data-mce-index",yn);const fo=zn.element.dom;if(fo.length===zn.finish&&zn.start===0)Pe(zn.element,co);else{fo.length!==zn.finish&&fo.splitText(zn.finish);const oo=fo.splitText(zn.start);Pe(St.fromDom(oo),co)}})})},ks=(et,at,cn,yn)=>{const zn=fn(et,cn),co=Ir(at,zn);return Pr(co,yn),co.length},Nr=(et,at,cn,yn)=>{const zn=cn.getBookmark(),co=et.select("td[data-mce-selected],th[data-mce-selected]"),fo=co.length>0?Ho(et,co):Us(et,cn.getRng()),oo=Ir(at,fo);return Pr(oo,yn),cn.moveToBookmark(zn),oo.length},Xr=et=>et.getAttribute("data-mce-index"),xs=(et,at,cn,yn)=>{const zn=et.dom.create("span",{"data-mce-bogus":1});zn.className="mce-match-marker";const co=et.getBody();return ar(et,at,!1),yn?Nr(et.dom,cn,et.selection,zn):ks(et.dom,cn,co,zn)},uo=et=>{var at;const cn=et.parentNode;et.firstChild&&cn.insertBefore(et.firstChild,et),(at=et.parentNode)===null||at===void 0||at.removeChild(et)},Ps=(et,at)=>{const cn=[],yn=me.toArray(et.getBody().getElementsByTagName("span"));if(yn.length)for(let zn=0;zn<yn.length;zn++){const co=Xr(yn[zn]);co===null||!co.length||co===at.toString()&&cn.push(yn[zn])}return cn},_t=(et,at,cn)=>{const yn=at.get();let zn=yn.index;const co=et.dom;cn?zn+1===yn.count?zn=0:zn++:zn-1===-1?zn=yn.count-1:zn--,co.removeClass(Ps(et,yn.index),"mce-match-marker-selected");const fo=Ps(et,zn);return fo.length?(co.addClass(Ps(et,zn),"mce-match-marker-selected"),et.selection.scrollIntoView(fo[0]),zn):-1},Ht=(et,at)=>{const cn=at.parentNode;et.remove(at),cn&&et.isEmpty(cn)&&et.remove(cn)},Fn=(et,at)=>{const yn="("+et.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return at?`(?:^|\\s|${W()})`+yn+`(?=$|\\s|${W()})`:yn},ao=(et,at,cn,yn,zn,co)=>{const fo=et.selection,oo=Fn(cn,zn),Co=fo.isForward(),Io={regex:new RegExp(oo,yn?"g":"gi"),matchIndex:1},ls=xs(et,at,Io,co);if(L.browser.isSafari()&&fo.setRng(fo.getRng(),Co),ls){const Js=_t(et,at,!0);at.set({index:Js,count:ls,text:cn,matchCase:yn,wholeWord:zn,inSelection:co})}return ls},Bo=(et,at)=>{const cn=_t(et,at,!0);at.set({...at.get(),index:cn})},is=(et,at)=>{const cn=_t(et,at,!1);at.set({...at.get(),index:cn})},yr=et=>{const at=Xr(et);return at!==null&&at.length>0},wr=(et,at,cn,yn,zn)=>{const co=at.get(),fo=co.index;let oo,Co=fo;yn=yn!==!1;const Io=et.getBody(),ls=me.grep(me.toArray(Io.getElementsByTagName("span")),yr);for(let Js=0;Js<ls.length;Js++){const Es=Xr(ls[Js]);let Ja=oo=parseInt(Es,10);if(zn||Ja===co.index){for(cn.length?(ls[Js].innerText=cn,uo(ls[Js])):Ht(et.dom,ls[Js]);ls[++Js];)if(Ja=parseInt(Xr(ls[Js]),10),Ja===oo)Ht(et.dom,ls[Js]);else{Js--;break}yn&&Co--}else oo>fo&&ls[Js].setAttribute("data-mce-index",String(oo-1))}return at.set({...co,count:zn?0:co.count-1,index:Co}),yn?Bo(et,at):is(et,at),!zn&&at.get().count>0},ar=(et,at,cn)=>{let yn,zn;const co=at.get(),fo=me.toArray(et.getBody().getElementsByTagName("span"));for(let oo=0;oo<fo.length;oo++){const Co=Xr(fo[oo]);Co!==null&&Co.length&&(Co===co.index.toString()&&(yn||(yn=fo[oo].firstChild),zn=fo[oo].firstChild),uo(fo[oo]))}if(at.set({...co,index:-1,count:0,text:""}),yn&&zn){const oo=et.dom.createRng();return oo.setStart(yn,0),oo.setEnd(zn,zn.data.length),cn!==!1&&et.selection.setRng(oo),oo}else return},Je=(et,at)=>at.get().count>1,Ye=(et,at)=>at.get().count>1,Ft=(et,at)=>({done:oo=>ar(et,at,oo),find:(oo,Co,Io,ls=!1)=>ao(et,at,oo,Co,Io,ls),next:()=>Bo(et,at),prev:()=>is(et,at),replace:(oo,Co,Io)=>wr(et,at,oo,Co,Io)}),Yt=et=>{const at=o(q.none()),cn=()=>at.get().each(et);return{clear:()=>{cn(),at.set(q.none())},isSet:()=>at.get().isSome(),get:()=>at.get(),set:oo=>{cn(),at.set(q.some(oo))}}},mo=()=>{const et=Yt(B);return{...et,on:cn=>et.get().each(cn)}},$o=(et,at)=>{const cn=mo();et.undoManager.add();const yn=me.trim(et.selection.getContent({format:"text"})),zn=zo=>{zo.setEnabled("next",Je(et,at)),zo.setEnabled("prev",Ye(et,at))},co=zo=>{const Qo=zo.getData(),ns=at.get();at.set({...ns,matchCase:Qo.matchcase,wholeWord:Qo.wholewords,inSelection:Qo.inselection})},fo=(zo,Qo)=>{Fe(["replace","replaceall","prev","next"],na=>zo.setEnabled(na,!Qo))},oo=(zo,Qo)=>{Qo.redial(ta(zo,Qo.getData()))},Co=(zo,Qo)=>{L.browser.isSafari()&&L.deviceType.isTouch()&&(Qo==="find"||Qo==="replace"||Qo==="replaceall")&&zo.focus(Qo)},Io=zo=>{ar(et,at,!1),fo(zo,!0),zn(zo)},ls=zo=>{const Qo=zo.getData(),ns=at.get();if(!Qo.findtext.length){Io(zo);return}if(ns.text===Qo.findtext&&ns.matchCase===Qo.matchcase&&ns.wholeWord===Qo.wholewords)Bo(et,at);else{const ca=ao(et,at,Qo.findtext,Qo.matchcase,Qo.wholewords,Qo.inselection);ca<=0&&oo(!0,zo),fo(zo,ca===0)}zn(zo)},Js=at.get(),Es={findtext:yn,replacetext:"",wholewords:Js.wholeWord,matchcase:Js.matchCase,inselection:Js.inSelection},Ja=zo=>{const Qo=[{type:"label",label:"Find",for:"findtext",items:[{type:"bar",items:[{type:"input",name:"findtext",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",enabled:!1,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",enabled:!1,borderless:!0}]}]},{type:"input",name:"replacetext",label:"Replace with",inputMode:"search"}];return zo&&Qo.push({type:"alertbanner",level:"error",text:"Could not find the specified string.",icon:"warning"}),Qo},ta=(zo,Qo)=>({title:"Find and Replace",size:"normal",body:{type:"panel",items:Ja(zo)},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",enabled:!1},{type:"custom",name:"replaceall",text:"Replace all",enabled:!1}],initialData:Qo,onChange:(ns,ca)=>{zo&&oo(!1,ns),ca.name==="findtext"&&at.get().count>0&&Io(ns)},onAction:(ns,ca)=>{const na=ns.getData();switch(ca.name){case"find":ls(ns);break;case"replace":wr(et,at,na.replacetext)?zn(ns):Io(ns);break;case"replaceall":wr(et,at,na.replacetext,!0,!0),Io(ns);break;case"prev":is(et,at),zn(ns);break;case"next":Bo(et,at),zn(ns);break;case"matchcase":case"wholewords":case"inselection":oo(!1,ns),co(ns),Io(ns);break}Co(ns,ca.name)},onSubmit:ns=>{ls(ns),Co(ns,"find")},onClose:()=>{et.focus(),ar(et,at),et.undoManager.add()}});cn.set(et.windowManager.open(ta(!1,Es),{inline:"toolbar"}))},Zo=(et,at)=>{et.addCommand("SearchReplace",()=>{$o(et,at)})},js=(et,at)=>()=>{$o(et,at)},ln=(et,at)=>{et.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:js(et,at),icon:"search"}),et.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:js(et,at),icon:"search",shortcut:"Meta+F"}),et.shortcuts.add("Meta+F","",js(et,at))};var Wt=()=>{s.add("searchreplace",et=>{const at=o({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return Zo(et,at),ln(et,at),Ft(et,at)})};Wt()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=(I,j,pe)=>{var De;return pe(I,j.prototype)?!0:((De=I.constructor)===null||De===void 0?void 0:De.name)===j.name},i=I=>{const j=typeof I;return I===null?"null":j==="object"&&Array.isArray(I)?"array":j==="object"&&s(I,String,(pe,De)=>De.isPrototypeOf(pe))?"string":j},u=I=>j=>i(j)===I,m=I=>j=>typeof j===I,h=I=>j=>I===j,b=u("string"),C=u("array"),S=m("boolean"),_=h(void 0),N=I=>I==null,O=I=>!N(I),B=m("function"),F=m("number"),Z=()=>{},G=(I,j)=>pe=>I(j(pe)),Y=I=>()=>I,q=I=>I,W=(I,j)=>I===j;function L(I,...j){return(...pe)=>{const De=j.concat(pe);return I.apply(null,De)}}const me=I=>{I()},Ze=Y(!1),_e=Y(!0);class Q{constructor(j,pe){this.tag=j,this.value=pe}static some(j){return new Q(!0,j)}static none(){return Q.singletonNone}fold(j,pe){return this.tag?pe(this.value):j()}isSome(){return this.tag}isNone(){return!this.tag}map(j){return this.tag?Q.some(j(this.value)):Q.none()}bind(j){return this.tag?j(this.value):Q.none()}exists(j){return this.tag&&j(this.value)}forall(j){return!this.tag||j(this.value)}filter(j){return!this.tag||j(this.value)?this:Q.none()}getOr(j){return this.tag?this.value:j}or(j){return this.tag?this:j}getOrThunk(j){return this.tag?this.value:j()}orThunk(j){return this.tag?this:j()}getOrDie(j){if(this.tag)return this.value;throw new Error(j??"Called getOrDie on None")}static from(j){return O(j)?Q.some(j):Q.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(j){this.tag&&j(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Q.singletonNone=new Q(!1);const Fe=Object.keys,lt=Object.hasOwnProperty,nt=(I,j)=>{const pe=Fe(I);for(let De=0,dt=pe.length;De<dt;De++){const on=pe[De],$n=I[on];j($n,on)}},$e=I=>(j,pe)=>{I[pe]=j},ue=(I,j,pe,De)=>{nt(I,(dt,on)=>{(j(dt,on)?pe:De)(dt,on)})},Nt=(I,j)=>{const pe={};return ue(I,j,$e(pe),Z),pe},ge=(I,j)=>{const pe=[];return nt(I,(De,dt)=>{pe.push(j(De,dt))}),pe},Oe=I=>ge(I,q),R=I=>Fe(I).length,je=(I,j)=>ye(I,j)?Q.from(I[j]):Q.none(),ye=(I,j)=>lt.call(I,j),tt=(I,j)=>ye(I,j)&&I[j]!==void 0&&I[j]!==null,st=I=>{for(const j in I)if(lt.call(I,j))return!1;return!0},he=Array.prototype.indexOf,Ge=Array.prototype.push,Tt=(I,j)=>he.call(I,j),ze=(I,j)=>Tt(I,j)>-1,vt=(I,j)=>{for(let pe=0,De=I.length;pe<De;pe++){const dt=I[pe];if(j(dt,pe))return!0}return!1},Be=(I,j)=>{const pe=[];for(let De=0;De<I;De++)pe.push(j(De));return pe},ft=(I,j)=>{const pe=I.length,De=new Array(pe);for(let dt=0;dt<pe;dt++){const on=I[dt];De[dt]=j(on,dt)}return De},oe=(I,j)=>{for(let pe=0,De=I.length;pe<De;pe++){const dt=I[pe];j(dt,pe)}},pn=(I,j)=>{for(let pe=I.length-1;pe>=0;pe--){const De=I[pe];j(De,pe)}},gt=(I,j)=>{const pe=[],De=[];for(let dt=0,on=I.length;dt<on;dt++){const $n=I[dt];(j($n,dt)?pe:De).push($n)}return{pass:pe,fail:De}},St=(I,j)=>{const pe=[];for(let De=0,dt=I.length;De<dt;De++){const on=I[De];j(on,De)&&pe.push(on)}return pe},jt=(I,j,pe)=>(pn(I,(De,dt)=>{pe=j(pe,De,dt)}),pe),Ct=(I,j,pe)=>(oe(I,(De,dt)=>{pe=j(pe,De,dt)}),pe),te=(I,j,pe)=>{for(let De=0,dt=I.length;De<dt;De++){const on=I[De];if(j(on,De))return Q.some(on);if(pe(on,De))break}return Q.none()},ie=(I,j)=>te(I,j,Ze),ce=I=>{const j=[];for(let pe=0,De=I.length;pe<De;++pe){if(!C(I[pe]))throw new Error("Arr.flatten item "+pe+" was not an array, input: "+I);Ge.apply(j,I[pe])}return j},X=(I,j)=>ce(ft(I,j)),we=(I,j)=>{for(let pe=0,De=I.length;pe<De;++pe){const dt=I[pe];if(j(dt,pe)!==!0)return!1}return!0},Me=(I,j)=>{const pe={};for(let De=0,dt=I.length;De<dt;De++){const on=I[De];pe[String(on)]=j(on,De)}return pe},Pe=(I,j)=>j>=0&&j<I.length?Q.some(I[j]):Q.none(),mt=I=>Pe(I,0),We=I=>Pe(I,I.length-1),bt=(I,j)=>{for(let pe=0;pe<I.length;pe++){const De=j(I[pe],pe);if(De.isSome())return De}return Q.none()},Dt=8,gn=9,Et=11,It=1,dn=3,_n=(I,j)=>{const De=(j||document).createElement("div");if(De.innerHTML=I,!De.hasChildNodes()||De.childNodes.length>1){const dt="HTML does not have a single root node";throw console.error(dt,I),new Error(dt)}return Ot(De.childNodes[0])},xo=(I,j)=>{const De=(j||document).createElement(I);return Ot(De)},Qn=(I,j)=>{const De=(j||document).createTextNode(I);return Ot(De)},Ot=I=>{if(I==null)throw new Error("Node cannot be null or undefined");return{dom:I}},an={fromHtml:_n,fromTag:xo,fromText:Qn,fromDom:Ot,fromPoint:(I,j,pe)=>Q.from(I.dom.elementFromPoint(j,pe)).map(Ot)},On=(I,j)=>{const pe=I.dom;if(pe.nodeType!==It)return!1;{const De=pe;if(De.matches!==void 0)return De.matches(j);if(De.msMatchesSelector!==void 0)return De.msMatchesSelector(j);if(De.webkitMatchesSelector!==void 0)return De.webkitMatchesSelector(j);if(De.mozMatchesSelector!==void 0)return De.mozMatchesSelector(j);throw new Error("Browser lacks native selectors")}},ko=I=>I.nodeType!==It&&I.nodeType!==gn&&I.nodeType!==Et||I.childElementCount===0,Ro=(I,j)=>{const pe=j===void 0?document:j.dom;return ko(pe)?[]:ft(pe.querySelectorAll(I),an.fromDom)},ws=(I,j)=>{const pe=j===void 0?document:j.dom;return ko(pe)?Q.none():Q.from(pe.querySelector(I)).map(an.fromDom)},yo=(I,j)=>I.dom===j.dom,Us=On;typeof window<"u"||Function("return this;")();const fn=I=>I.dom.nodeName.toLowerCase(),Ho=I=>I.dom.nodeType,tr=I=>j=>Ho(j)===I,rr=I=>Ho(I)===Dt||fn(I)==="#comment",Ir=tr(It),Pr=tr(dn),ks=tr(gn),Nr=tr(Et),Xr=I=>j=>Ir(j)&&fn(j)===I,xs=I=>an.fromDom(I.dom.ownerDocument),uo=I=>ks(I)?I:xs(I),Ps=I=>Q.from(I.dom.parentNode).map(an.fromDom),_t=(I,j)=>{const pe=B(j)?j:Ze;let De=I.dom;const dt=[];for(;De.parentNode!==null&&De.parentNode!==void 0;){const on=De.parentNode,$n=an.fromDom(on);if(dt.push($n),pe($n)===!0)break;De=on}return dt},Ht=I=>Q.from(I.dom.previousSibling).map(an.fromDom),Fn=I=>Q.from(I.dom.nextSibling).map(an.fromDom),ao=I=>ft(I.dom.childNodes,an.fromDom),Bo=(I,j)=>{const pe=I.dom.childNodes;return Q.from(pe[j]).map(an.fromDom)},is=I=>Bo(I,0),yr=I=>Nr(I)&&O(I.dom.host),wr=I=>an.fromDom(I.dom.getRootNode()),ar=I=>{const j=wr(I);return yr(j)?Q.some(j):Q.none()},Je=I=>an.fromDom(I.dom.host),Ye=I=>{const j=Pr(I)?I.dom.parentNode:I.dom;if(j==null||j.ownerDocument===null)return!1;const pe=j.ownerDocument;return ar(an.fromDom(j)).fold(()=>pe.body.contains(j),G(Ye,Je))};var Ft=(I,j,pe,De,dt)=>I(pe,De)?Q.some(pe):B(dt)&&dt(pe)?Q.none():j(pe,De,dt);const Yt=(I,j,pe)=>{let De=I.dom;const dt=B(pe)?pe:Ze;for(;De.parentNode;){De=De.parentNode;const on=an.fromDom(De);if(j(on))return Q.some(on);if(dt(on))break}return Q.none()},mo=(I,j,pe)=>Ft((dt,on)=>on(dt),Yt,I,j,pe),$o=(I,j)=>{const pe=dt=>j(an.fromDom(dt));return ie(I.dom.childNodes,pe).map(an.fromDom)},Zo=(I,j,pe)=>Yt(I,De=>On(De,j),pe),js=(I,j)=>$o(I,pe=>On(pe,j)),ln=(I,j)=>ws(j,I),Wt=(I,j,pe)=>Ft((dt,on)=>On(dt,on),Zo,I,j,pe),et=I=>Wt(I,"[contenteditable]"),at=(I,j=!1)=>Ye(I)?I.dom.isContentEditable:et(I).fold(Y(j),pe=>cn(pe)==="true"),cn=I=>I.dom.contentEditable,yn=I=>I.nodeName.toLowerCase(),zn=I=>an.fromDom(I.getBody()),co=I=>j=>yo(j,zn(I)),fo=I=>I?I.replace(/px$/,""):"",oo=I=>/^\d+(\.\d+)?$/.test(I)?I+"px":I,Co=I=>an.fromDom(I.selection.getStart()),Io=I=>an.fromDom(I.selection.getEnd()),ls=I=>mo(I,Xr("table")).forall(at),Js=(I,j)=>St(ao(I),j),Es=(I,j)=>{let pe=[];return oe(ao(I),De=>{j(De)&&(pe=pe.concat([De])),pe=pe.concat(Es(De,j))}),pe},Ja=(I,j)=>Js(I,pe=>On(pe,j)),ta=(I,j)=>Ro(j,I),zo=(I,j,pe)=>{if(b(pe)||S(pe)||F(pe))I.setAttribute(j,pe+"");else throw console.error("Invalid call to Attribute.set. Key ",j,":: Value ",pe,":: Element ",I),new Error("Attribute value was not simple")},Qo=(I,j,pe)=>{zo(I.dom,j,pe)},ns=(I,j)=>{const pe=I.dom;nt(j,(De,dt)=>{zo(pe,dt,De)})},ca=(I,j)=>{const pe=I.dom.getAttribute(j);return pe===null?void 0:pe},na=(I,j)=>Q.from(ca(I,j)),ua=(I,j)=>{I.dom.removeAttribute(j)},Ys=I=>Ct(I.dom.attributes,(j,pe)=>(j[pe.name]=pe.value,j),{}),Yc=(I,j,pe=W)=>I.exists(De=>pe(De,j)),pi=I=>{const j=[],pe=De=>{j.push(De)};for(let De=0;De<I.length;De++)I[De].each(pe);return j},ac=(I,j,pe)=>I.isSome()&&j.isSome()?Q.some(pe(I.getOrDie(),j.getOrDie())):Q.none(),cs=I=>I.bind(q),Mi=(I,j)=>I?Q.some(j):Q.none(),ir=(I,j)=>I.substring(j),Fl=(I,j,pe)=>j===""||I.length>=j.length&&I.substr(pe,pe+j.length)===j,ai=(I,j)=>Ji(I,j)?ir(I,j.length):I,Ji=(I,j)=>Fl(I,j,0),Ll=(I=>j=>j.replace(I,""))(/^\s+|\s+$/g),gi=I=>I.length>0,Vl=I=>!gi(I),El=(I,j=10)=>{const pe=parseInt(I,j);return isNaN(pe)?Q.none():Q.some(pe)},Hl=I=>{const j=parseFloat(I);return isNaN(j)?Q.none():Q.some(j)},Or=I=>I.style!==void 0&&B(I.style.getPropertyValue),Ri=(I,j,pe)=>{if(!b(pe))throw console.error("Invalid call to CSS.set. Property ",j,":: Value ",pe,":: Element ",I),new Error("CSS value must be a string: "+pe);Or(I)&&I.style.setProperty(j,pe)},_l=(I,j)=>{Or(I)&&I.style.removeProperty(j)},kl=(I,j,pe)=>{const De=I.dom;Ri(De,j,pe)},_c=(I,j)=>{const pe=I.dom,dt=window.getComputedStyle(pe).getPropertyValue(j);return dt===""&&!Ye(I)?hi(pe,j):dt},hi=(I,j)=>Or(I)?I.style.getPropertyValue(j):"",Fr=(I,j)=>{const pe=I.dom,De=hi(pe,j);return Q.from(De).filter(dt=>dt.length>0)},Wr=(I,j)=>{const pe=I.dom;_l(pe,j),Yc(na(I,"style").map(Ll),"")&&ua(I,"style")},Qa=(I,j,pe=0)=>na(I,j).map(De=>parseInt(De,10)).getOr(pe),ic=(I,j)=>lc(I,j,_e),lc=(I,j,pe)=>X(ao(I),De=>On(De,j)?pe(De)?[De]:[]:lc(De,j,pe)),Oa=["tfoot","thead","tbody","colgroup"],xe=I=>ze(Oa,I),qe=(I,j)=>({rows:I,columns:j}),pt=(I,j,pe)=>({element:I,rowspan:j,colspan:pe}),Jt=(I,j,pe,De,dt,on)=>({element:I,rowspan:j,colspan:pe,row:De,column:dt,isLocked:on}),de=(I,j,pe)=>({element:I,cells:j,section:pe}),Se=(I,j,pe,De)=>({startRow:I,startCol:j,finishRow:pe,finishCol:De}),rt=(I,j,pe)=>({element:I,colspan:j,column:pe}),Xt=(I,j)=>({element:I,columns:j}),In=(I,j,pe=Ze)=>{if(pe(j))return Q.none();if(ze(I,fn(j)))return Q.some(j);const De=dt=>On(dt,"table")||pe(dt);return Zo(j,I.join(","),De)},ae=(I,j)=>In(["td","th"],I,j),Ce=I=>ic(I,"th,td"),Xe=I=>On(I,"colgroup")?Ja(I,"col"):X(Tn(I),j=>Ja(j,"col")),At=(I,j)=>Wt(I,"table",j),kn=I=>ic(I,"tr"),Tn=I=>At(I).fold(Y([]),j=>Ja(j,"colgroup")),fs=(I,j)=>ft(I,pe=>{if(fn(pe)==="colgroup"){const De=ft(Xe(pe),dt=>{const on=Qa(dt,"span",1);return pt(dt,1,on)});return de(pe,De,"colgroup")}else{const De=ft(Ce(pe),dt=>{const on=Qa(dt,"rowspan",1),$n=Qa(dt,"colspan",1);return pt(dt,on,$n)});return de(pe,De,j(pe))}}),Jr=I=>Ps(I).map(j=>{const pe=fn(j);return xe(pe)?pe:"tbody"}).getOr("tbody"),tn=I=>{const j=kn(I),De=[...Tn(I),...j];return fs(De,Jr)},da="data-snooker-locked-cols",Vs=I=>na(I,da).bind(j=>Q.from(j.match(/\d+/g))).map(j=>Me(j,_e)),cc=(I,j)=>I+","+j,Zr=(I,j,pe)=>Q.from(I.access[cc(j,pe)]),us=(I,j,pe)=>{const De=vi(I,dt=>pe(j,dt.element));return De.length>0?Q.some(De[0]):Q.none()},vi=(I,j)=>{const pe=X(I.all,De=>De.cells);return St(pe,j)},$a=I=>{const j={};let pe=0;return oe(I.cells,De=>{const dt=De.colspan;Be(dt,on=>{const $n=pe+on;j[$n]=rt(De.element,dt,$n)}),pe+=dt}),j},bi=I=>{const j={},pe=[],dt=mt(I).map(Ol=>Ol.element).bind(At).bind(Vs).getOr({});let on=0,$n=0,io=0;const{pass:Go,fail:ts}=gt(I,Ol=>Ol.section==="colgroup");oe(ts,Ol=>{const Yu=[];oe(Ol.cells,Zl=>{let wu=0;for(;j[cc(io,wu)]!==void 0;)wu++;const Ip=tt(dt,wu.toString()),Pp=Jt(Zl.element,Zl.rowspan,Zl.colspan,io,wu,Ip);for(let $l=0;$l<Zl.colspan;$l++)for(let Fp=0;Fp<Zl.rowspan;Fp++){const Lp=io+Fp,Xh=wu+$l,Rg=cc(Lp,Xh);j[Rg]=Pp,$n=Math.max($n,Xh+1)}Yu.push(Pp)}),on++,pe.push(de(Ol.element,Yu,Ol.section)),io++});const{columns:cr,colgroups:sr}=We(Go).map(Ol=>{const Yu=$a(Ol);return{colgroups:[Xt(Ol.element,Oe(Yu))],columns:Yu}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:qe(on,$n),access:j,all:pe,columns:cr,colgroups:sr}},Xc={fromTable:I=>{const j=tn(I);return bi(j)},generate:bi,getAt:Zr,findItem:us,filterItems:vi,justCells:I=>X(I.all,j=>j.cells),justColumns:I=>Oe(I.columns),hasColumns:I=>Fe(I.columns).length>0,getColumnAt:(I,j)=>Q.from(I.columns[j])};var Da=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ua=(I,j,pe)=>{const De=I.select("td,th",j);let dt;for(let on=0;on<De.length;on++){const $n=I.getStyle(De[on],pe);if(_(dt)&&(dt=$n),dt!==$n)return""}return dt},Bi=(I,j,pe)=>{Da.each("left center right".split(" "),De=>{De!==pe&&I.formatter.remove("align"+De,{},j)}),pe&&I.formatter.apply("align"+pe,{},j)},pu=(I,j,pe)=>{Da.each("top middle bottom".split(" "),De=>{De!==pe&&I.formatter.remove("valign"+De,{},j)}),pe&&I.formatter.apply("valign"+pe,{},j)},Re=(I,j,pe)=>{I.dispatch("TableModified",{...pe,table:j})},Le=(I,j)=>Hl(I).getOr(j),Mt=(I,j,pe)=>Le(_c(I,j),pe),nn=(I,j,pe,De)=>{const dt=Mt(I,`padding-${pe}`,0),on=Mt(I,`padding-${De}`,0),$n=Mt(I,`border-${pe}-width`,0),io=Mt(I,`border-${De}-width`,0);return j-dt-on-$n-io},vo=(I,j)=>{const pe=I.dom,De=pe.getBoundingClientRect().width||pe.offsetWidth;return j==="border-box"?De:nn(I,De,"left","right")},rs=I=>vo(I,"content-box");var lr=tinymce.util.Tools.resolve("tinymce.Env");const va="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",Qi=Be(5,I=>{const j=`${I+1}px`;return{title:j,value:j}}),yi=ft(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],I=>({title:I,value:I.toLowerCase()})),$r="100%",sa=I=>{var j;const pe=I.dom,De=(j=pe.getParent(I.selection.getStart(),pe.isBlock))!==null&&j!==void 0?j:I.getBody();return rs(an.fromDom(De))+"px"},_a=(I,j)=>sf(I)||!zl(I)?j:Tm(I)?{...j,width:sa(I)}:{...j,width:$r},ii=(I,j)=>sf(I)||zl(I)?j:Tm(I)?{...j,width:sa(I)}:{...j,width:$r},Qr=I=>j=>j.options.get(I),ja=I=>{const j=I.options.register;j("table_border_widths",{processor:"object[]",default:Qi}),j("table_border_styles",{processor:"object[]",default:yi}),j("table_cell_advtab",{processor:"boolean",default:!0}),j("table_row_advtab",{processor:"boolean",default:!0}),j("table_advtab",{processor:"boolean",default:!0}),j("table_appearance_options",{processor:"boolean",default:!0}),j("table_grid",{processor:"boolean",default:!lr.deviceType.isTouch()}),j("table_cell_class_list",{processor:"object[]",default:[]}),j("table_row_class_list",{processor:"object[]",default:[]}),j("table_class_list",{processor:"object[]",default:[]}),j("table_toolbar",{processor:"string",default:va}),j("table_background_color_map",{processor:"object[]",default:[]}),j("table_border_color_map",{processor:"object[]",default:[]})},Ks=Qr("table_sizing_mode"),Jc=Qr("table_border_widths"),km=Qr("table_border_styles"),Lu=Qr("table_cell_advtab"),tf=Qr("table_row_advtab"),nf=Qr("table_advtab"),dd=Qr("table_appearance_options"),fd=Qr("table_grid"),zl=Qr("table_style_by_css"),Ii=Qr("table_cell_class_list"),Lh=Qr("table_row_class_list"),gu=Qr("table_class_list"),Ep=Qr("table_toolbar"),of=Qr("table_background_color_map"),_p=Qr("table_border_color_map"),Tm=I=>Ks(I)==="fixed",sf=I=>Ks(I)==="responsive",Am=I=>{const j=I.options,pe=j.get("table_default_styles");return j.isSet("table_default_styles")?pe:_a(I,pe)},kp=I=>{const j=I.options,pe=j.get("table_default_attributes");return j.isSet("table_default_attributes")?pe:ii(I,pe)},md=(I,j)=>j.column>=I.startCol&&j.column+j.colspan-1<=I.finishCol&&j.row>=I.startRow&&j.row+j.rowspan-1<=I.finishRow,Tp=(I,j)=>{let pe=!0;const De=L(md,j);for(let dt=j.startRow;dt<=j.finishRow;dt++)for(let on=j.startCol;on<=j.finishCol;on++)pe=pe&&Xc.getAt(I,dt,on).exists(De);return pe?Q.some(j):Q.none()},ot=(I,j)=>Se(Math.min(I.row,j.row),Math.min(I.column,j.column),Math.max(I.row+I.rowspan-1,j.row+j.rowspan-1),Math.max(I.column+I.colspan-1,j.column+j.colspan-1)),rf=(I,j,pe)=>{const De=Xc.findItem(I,j,yo),dt=Xc.findItem(I,pe,yo);return De.bind(on=>dt.map($n=>ot(on,$n)))},cl=(I,j,pe)=>rf(I,j,pe).bind(De=>Tp(I,De)),Lv=(I,j,pe)=>{const De=Vh(I);return cl(De,j,pe)},Vh=Xc.fromTable,pd=(I,j)=>{Ps(I).each(De=>{De.dom.insertBefore(j.dom,I.dom)})},$s=(I,j)=>{Fn(I).fold(()=>{Ps(I).each(dt=>{wi(dt,j)})},De=>{pd(De,j)})},ra=(I,j)=>{is(I).fold(()=>{wi(I,j)},De=>{I.dom.insertBefore(j.dom,De.dom)})},wi=(I,j)=>{I.dom.appendChild(j.dom)},Vu=(I,j)=>{pd(I,j),wi(j,I)},Ag=(I,j)=>{oe(j,(pe,De)=>{const dt=De===0?I:j[De-1];$s(dt,pe)})},af=(I,j)=>{oe(j,pe=>{wi(I,pe)})},Pi=I=>{const j=I.dom;j.parentNode!==null&&j.parentNode.removeChild(j)},Nm=I=>{const j=ao(I);j.length>0&&Ag(I,j),Pi(I)},Hu=((I,j)=>{const pe=on=>{if(!I(on))throw new Error("Can only get "+j+" value of a "+j+" node");return De(on).getOr("")},De=on=>I(on)?Q.from(on.dom.nodeValue):Q.none();return{get:pe,getOption:De,set:(on,$n)=>{if(!I(on))throw new Error("Can only set raw "+j+" value of a "+j+" node");on.dom.nodeValue=$n}}})(Pr,"text"),zu=I=>Hu.get(I),Pf=(I,j)=>Hu.set(I,j);var uc=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],$m=()=>{const I=ts=>an.fromDom(ts.dom.cloneNode(!1)),j=ts=>uo(ts).dom,pe=ts=>Ir(ts)?fn(ts)==="body"?!0:ze(uc,fn(ts)):!1,De=ts=>Ir(ts)?ze(["br","img","hr","input"],fn(ts)):!1,dt=ts=>Ir(ts)&&ca(ts,"contenteditable")==="false",on=(ts,cr)=>ts.dom.compareDocumentPosition(cr.dom),$n=(ts,cr)=>{const sr=Ys(ts);ns(cr,sr)},io=ts=>{const cr=fn(ts);return ze(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],cr)},Go=ts=>Ir(ts)?na(ts,"lang"):Q.none();return{up:Y({selector:Zo,closest:Wt,predicate:Yt,all:_t}),down:Y({selector:ta,predicate:Es}),styles:Y({get:_c,getRaw:Fr,set:kl,remove:Wr}),attrs:Y({get:ca,set:Qo,remove:ua,copyTo:$n}),insert:Y({before:pd,after:$s,afterAll:Ag,append:wi,appendAll:af,prepend:ra,wrap:Vu}),remove:Y({unwrap:Nm,remove:Pi}),create:Y({nu:an.fromTag,clone:I,text:an.fromText}),query:Y({comparePosition:on,prevSibling:Ht,nextSibling:Fn}),property:Y({children:ao,name:fn,parent:Ps,document:j,isText:Pr,isComment:rr,isElement:Ir,isSpecial:io,getLanguage:Go,getText:zu,setText:Pf,isBoundary:pe,isEmptyTag:De,isNonEditable:dt}),eq:yo,is:Us}};const li=(I,j,pe,De)=>{const dt=pe[0],on=pe.slice(1);return De(I,j,dt,on)},Uu=(I,j,pe)=>pe.length>0?li(I,j,pe,kc):Q.none(),kc=(I,j,pe,De)=>{const dt=j(I,pe);return jt(De,(on,$n)=>{const io=j(I,$n);return Fi(I,on,io)},dt)},Fi=(I,j,pe)=>j.bind(De=>pe.filter(L(I.eq,De))),gd=Uu,Hh=$m(),Dm=(I,j)=>gd(Hh,(pe,De)=>I(De),j),Qc=I=>Zo(I,"table"),lf=(I,j)=>{const pe=ta(I,j);return pe.length>0?Q.some(pe):Q.none()},zh=(I,j,pe)=>ln(I,j).bind(De=>ln(I,pe).bind(dt=>Dm(Qc,[De,dt]).map(on=>({first:De,last:dt,table:on})))),Ap=(I,j)=>lf(I,j),Uh=(I,j,pe)=>zh(I,j,pe).bind(De=>{const dt=Go=>yo(I,Go),on="thead,tfoot,tbody,table",$n=Zo(De.first,on,dt),io=Zo(De.last,on,dt);return $n.bind(Go=>io.bind(ts=>yo(Go,ts)?Lv(De.table,De.first,De.last):Q.none()))}),jh=I=>ft(I,an.fromDom),Np="data-mce-selected",ju="td["+Np+"],th["+Np+"]",Mm="data-mce-first-selected",hu="td["+Mm+"],th["+Mm+"]",Lr="data-mce-last-selected",Wa="td["+Lr+"],th["+Lr+"]",ul={selected:Np,selectedSelector:ju,firstSelected:Mm,firstSelectedSelector:hu,lastSelected:Lr,lastSelectedSelector:Wa},Rm=I=>At(I).bind(j=>Ap(j,ul.firstSelectedSelector)).fold(Y(I),j=>j[0]),Ff=I=>(j,pe)=>{const De=fn(j),dt=De==="col"||De==="colgroup"?Rm(j):j;return Wt(dt,I,pe)},Za=Ff("th,td,caption"),ho=Ff("th,td"),Bm=I=>jh(I.model.table.getSelectedCells()),Wu=(I,j)=>{const pe=ho(I),De=pe.bind(dt=>At(dt)).map(dt=>kn(dt));return ac(pe,De,(dt,on)=>St(on,$n=>vt(jh($n.dom.cells),io=>ca(io,j)==="1"||yo(io,dt)))).getOr([])},dl=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],Ws=I=>({value:Ng(I)}),cf=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Im=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Op=I=>cf.test(I)||Im.test(I),Ng=I=>ai(I,"#").toUpperCase(),es=I=>Op(I)?Q.some({value:Ng(I)}):Q.none(),ba=I=>{const j=I.toString(16);return(j.length===1?"0"+j:j).toUpperCase()},hd=I=>{const j=ba(I.red)+ba(I.green)+ba(I.blue);return Ws(j)},Tl=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,fl=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,Ul=(I,j,pe,De)=>({red:I,green:j,blue:pe,alpha:De}),ei=(I,j,pe,De)=>{const dt=parseInt(I,10),on=parseInt(j,10),$n=parseInt(pe,10),io=parseFloat(De);return Ul(dt,on,$n,io)},el=I=>{const j=Tl.exec(I);if(j!==null)return Q.some(ei(j[1],j[2],j[3],"1"));const pe=fl.exec(I);return pe!==null?Q.some(ei(pe[1],pe[2],pe[3],pe[4])):Q.none()},dc=I=>es(I).orThunk(()=>el(I).map(hd)).getOrThunk(()=>{const j=document.createElement("canvas");j.height=1,j.width=1;const pe=j.getContext("2d");pe.clearRect(0,0,j.width,j.height),pe.fillStyle="#FFFFFF",pe.fillStyle=I,pe.fillRect(0,0,1,1);const De=pe.getImageData(0,0,1,1).data,dt=De[0],on=De[1],$n=De[2],io=De[3];return hd(Ul(dt,on,$n,io))}),$p=I=>el(I).map(hd).map(j=>"#"+j.value).getOr(I),Dr=I=>{let j=I;return{get:()=>j,set:dt=>{j=dt}}},Dp=I=>{const j=Dr(Q.none()),pe=()=>j.get().each(I);return{clear:()=>{pe(),j.set(Q.none())},isSet:()=>j.get().isSome(),get:()=>j.get(),set:io=>{pe(),j.set(Q.some(io))}}},ka=()=>Dp(I=>I.unbind()),vd=(I,j,pe)=>De=>{const dt=ka(),on=Vl(pe),$n=()=>{const io=Bm(I),Go=ts=>I.formatter.match(j,{value:pe},ts.dom,on);on?(De.setActive(!vt(io,Go)),dt.set(I.formatter.formatChanged(j,ts=>De.setActive(!ts),!0))):(De.setActive(we(io,Go)),dt.set(I.formatter.formatChanged(j,De.setActive,!1,{value:pe})))};return I.initialized?$n():I.on("init",$n),dt.clear},vu=I=>tt(I,"menu"),ur=I=>ft(I,j=>{const pe=j.text||j.title||"";return vu(j)?{text:pe,items:ur(j.menu)}:{text:pe,value:j.value}}),eu=I=>I.length?Q.some(ur([{text:"Select...",value:"mce-no-match"},...I])):Q.none(),Lf=(I,j,pe,De)=>ft(j,dt=>{const on=dt.text||dt.title;return vu(dt)?{type:"nestedmenuitem",text:on,getSubmenuItems:()=>Lf(I,dt.menu,pe,De)}:{text:on,type:"togglemenuitem",onAction:()=>De(dt.value),onSetup:vd(I,pe,dt.value)}}),bd=(I,j)=>pe=>{I.execCommand("mceTableApplyCellStyle",!1,{[j]:pe})},Mr=I=>X(I,j=>vu(j)?[{...j,menu:Mr(j.menu)}]:gi(j.value)?[j]:[]),Zu=(I,j,pe,De)=>dt=>dt(Lf(I,j,pe,De)),fc=(I,j,pe)=>{const De=ft(j,dt=>({text:dt.title,value:"#"+dc(dt.value).value,type:"choiceitem"}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:De.length>0?De:void 0,allowCustomColors:!1},onAction:dt=>{const on=dt.value==="remove"?"":dt.value;I.execCommand("mceTableApplyCellStyle",!1,{[pe]:on})}}]},vs=I=>()=>{const pe=I.queryCommandValue("mceTableRowType")==="header"?"body":"header";I.execCommand("mceTableRowType",!1,{type:pe})},uf=I=>()=>{const pe=I.queryCommandValue("mceTableColType")==="th"?"td":"th";I.execCommand("mceTableColType",!1,{type:pe})},Mp=I=>eu(Ii(I)).map(j=>({name:"class",type:"listbox",label:"Class",items:j})),H=[{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:dl}],ne=I=>H.concat(Mp(I).toArray()),be=(I,j)=>{const De=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(ur(km(I)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:j==="cell"?[{name:"borderwidth",type:"input",label:"Border width"}].concat(De):De}},ut={normal:(I,j)=>{const pe=I.dom;return{setAttrib:($n,io)=>{pe.setAttrib(j,$n,io)},setStyle:($n,io)=>{pe.setStyle(j,$n,io)},setFormat:($n,io)=>{io===""?I.formatter.remove($n,{value:null},j,!0):I.formatter.apply($n,{value:io},j)}}}},wn=Xr("th"),Do=(I,j)=>I&&j?"sectionCells":I?"section":"cells",os=I=>{const j=I.section==="thead",pe=Yc(Xo(I.cells),"th");return I.section==="tfoot"?{type:"footer"}:j||pe?{type:"header",subType:Do(j,pe)}:{type:"body"}},Xo=I=>{const j=St(I,pe=>wn(pe.element));return j.length===0?Q.some("td"):j.length===I.length?Q.some("th"):Q.none()},po=I=>{const j=ft(I,dt=>os(dt).type),pe=ze(j,"header"),De=ze(j,"footer");if(!pe&&!De)return Q.some("body");{const dt=ze(j,"body");return pe&&!dt&&!De?Q.some("header"):!pe&&!dt&&De?Q.some("footer"):Q.none()}},Vr=I=>{let j=!1,pe;return(...De)=>(j||(j=!0,pe=I.apply(null,De)),pe)},aa=(I,j)=>bt(I.all,pe=>ie(pe.cells,De=>yo(j,De.element))),mc=(I,j,pe)=>{const De=ft(j.selection,on=>ae(on).bind($n=>aa(I,$n)).filter(pe)),dt=pi(De);return Mi(dt.length>0,dt)},jl=(I,j)=>j.mergable,Vv=(I,j)=>j.unmergable,Vf=(I,j)=>mc(I,j,_e),Wh=(I,j)=>aa(I,j).exists(pe=>!pe.isLocked),Li=(I,j)=>we(j,pe=>Wh(I,pe)),Zh=(I,j)=>jl(I,j).filter(pe=>Li(I,pe.cells)),Z0=(I,j)=>Vv(I,j).filter(pe=>Li(I,pe));({...{generate:I=>{if(!C(I))throw new Error("cases must be an array");if(I.length===0)throw new Error("there must be at least one case");const j=[],pe={};return oe(I,(De,dt)=>{const on=Fe(De);if(on.length!==1)throw new Error("one and only one name per case");const $n=on[0],io=De[$n];if(pe[$n]!==void 0)throw new Error("duplicate key detected:"+$n);if($n==="cata")throw new Error("cannot have a case named cata (sorry)");if(!C(io))throw new Error("case arguments must be an array");j.push($n),pe[$n]=(...Go)=>{const ts=Go.length;if(ts!==io.length)throw new Error("Wrong number of arguments to case "+$n+". Expected "+io.length+" ("+io+"), got "+ts);return{fold:(...sr)=>{if(sr.length!==I.length)throw new Error("Wrong number of arguments to fold. Expected "+I.length+", got "+sr.length);return sr[dt].apply(null,Go)},match:sr=>{const qr=Fe(sr);if(j.length!==qr.length)throw new Error("Wrong number of arguments to match. Expected: "+j.join(",")+`
|
|
117
117
|
Actual: `+qr.join(","));if(!we(j,Yu=>ze(qr,Yu)))throw new Error("Not all branches were specified when using match. Specified: "+qr.join(", ")+`
|
|
118
118
|
Required: `+j.join(", "));return sr[$n].apply(null,Go)},log:sr=>{console.log(sr,{constructors:j,constructor:$n,params:Go})}}}}),pe}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const Hv=(I,j)=>{const pe=Xc.fromTable(I);return Vf(pe,j).bind(dt=>{const on=dt[dt.length-1],$n=dt[0].row,io=on.row+on.rowspan,Go=pe.all.slice($n,io);return po(Go)}).getOr("")},Hi=I=>Ji(I,"rgb")?$p(I):I,Lo=I=>{const j=an.fromDom(I);return{borderwidth:Fr(j,"border-width").getOr(""),borderstyle:Fr(j,"border-style").getOr(""),bordercolor:Fr(j,"border-color").map(Hi).getOr(""),backgroundcolor:Fr(j,"background-color").map(Hi).getOr("")}},tu=I=>{const j=I[0],pe=I.slice(1);return oe(pe,De=>{oe(Fe(j),dt=>{nt(De,(on,$n)=>{const io=j[dt];io!==""&&dt===$n&&io!==on&&(j[dt]=dt==="class"?"mce-no-match":"")})})}),j},Pm=(I,j,pe,De)=>ie(I,dt=>!_(pe.formatter.matchNode(De,j+dt))).getOr(""),Rp=L(Pm,["left","center","right"],"align"),G0=L(Pm,["top","middle","bottom"],"valign"),Yh=(I,j)=>{const pe=Am(I),De=kp(I),dt=()=>({borderstyle:je(pe,"border-style").getOr(""),bordercolor:Hi(je(pe,"border-color").getOr("")),backgroundcolor:Hi(je(pe,"background-color").getOr(""))}),on={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},$n=()=>{const cr=pe["border-width"];return zl(I)&&cr?{border:cr}:je(De,"border").fold(()=>({}),sr=>({border:sr}))},io=j?dt():{},Go=()=>{const cr=je(pe,"border-spacing").or(je(De,"cellspacing")).fold(()=>({}),qr=>({cellspacing:qr})),sr=je(pe,"border-padding").or(je(De,"cellpadding")).fold(()=>({}),qr=>({cellpadding:qr}));return{...cr,...sr}};return{...on,...pe,...De,...io,...$n(),...Go()}},bu=I=>At(an.fromDom(I)).map(j=>{const pe={selection:jh(I.cells)};return Hv(j,pe)}).getOr(""),yd=(I,j,pe)=>{const De=(io,Go)=>{const ts=Fr(an.fromDom(Go),"border-width");return zl(I)&&ts.isSome()?ts.getOr(""):io.getAttrib(Go,"border")||Ua(I.dom,Go,"border-width")||Ua(I.dom,Go,"border")||""},dt=I.dom,on=zl(I)?dt.getStyle(j,"border-spacing")||dt.getAttrib(j,"cellspacing"):dt.getAttrib(j,"cellspacing")||dt.getStyle(j,"border-spacing"),$n=zl(I)?Ua(dt,j,"padding")||dt.getAttrib(j,"cellpadding"):dt.getAttrib(j,"cellpadding")||Ua(dt,j,"padding");return{width:dt.getStyle(j,"width")||dt.getAttrib(j,"width"),height:dt.getStyle(j,"height")||dt.getAttrib(j,"height"),cellspacing:on??"",cellpadding:$n??"",border:De(dt,j),caption:!!dt.select("caption",j)[0],class:dt.getAttrib(j,"class",""),align:Rp(I,j),...pe?Lo(j):{}}},Hf=(I,j,pe)=>{const De=I.dom;return{height:De.getStyle(j,"height")||De.getAttrib(j,"height"),class:De.getAttrib(j,"class",""),type:bu(j),align:Rp(I,j),...pe?Lo(j):{}}},Gn=(I,j,pe,De)=>{const dt=I.dom,on=De.getOr(j);return{width:((io,Go)=>dt.getStyle(io,Go)||dt.getAttrib(io,Go))(on,"width"),scope:dt.getAttrib(j,"scope"),celltype:yn(j),class:dt.getAttrib(j,"class",""),halign:Rp(I,j),valign:G0(I,j),...pe?Lo(j):{}}},Tc=(I,j)=>{const pe=Xc.fromTable(I),De=Xc.justCells(pe),dt=St(De,on=>vt(j,$n=>yo(on.element,$n)));return ft(dt,on=>({element:on.element.dom,column:Xc.getColumnAt(pe,on.column).map($n=>$n.element.dom)}))},zv=(I,j,pe,De)=>{De("scope")&&I.setAttrib("scope",pe.scope),De("class")&&pe.class!=="mce-no-match"&&I.setAttrib("class",pe.class),De("width")&&j.setStyle("width",oo(pe.width))},Fm=(I,j,pe)=>{pe("backgroundcolor")&&I.setFormat("tablecellbackgroundcolor",j.backgroundcolor),pe("bordercolor")&&I.setFormat("tablecellbordercolor",j.bordercolor),pe("borderstyle")&&I.setFormat("tablecellborderstyle",j.borderstyle),pe("borderwidth")&&I.setFormat("tablecellborderwidth",oo(j.borderwidth))},yu=(I,j,pe,De)=>{const dt=j.length===1;oe(j,on=>{const $n=on.element,io=dt?_e:De,Go=ut.normal(I,$n),ts=on.column.map(cr=>ut.normal(I,cr)).getOr(Go);zv(Go,ts,pe,io),Lu(I)&&Fm(Go,pe,io),De("halign")&&Bi(I,$n,pe.halign),De("valign")&&pu(I,$n,pe.valign)})},Og=(I,j)=>{I.execCommand("mceTableCellType",!1,{type:j.celltype,no_events:!0})},zf=(I,j,pe,De)=>{const dt=Nt(De,(on,$n)=>pe[$n]!==on);R(dt)>0&&j.length>=1&&At(j[0]).each(on=>{const $n=Tc(on,j),io=R(Nt(dt,(ts,cr)=>cr!=="scope"&&cr!=="celltype"))>0,Go=ye(dt,"celltype");(io||ye(dt,"scope"))&&yu(I,$n,De,L(ye,dt)),Go&&Og(I,De),Re(I,on.dom,{structure:Go,style:io})})},Lm=(I,j,pe,De)=>{const dt=De.getData();De.close(),I.undoManager.transact(()=>{zf(I,j,pe,dt),I.focus()})},$g=(I,j)=>{const pe=At(j[0]).map(De=>ft(Tc(De,j),dt=>Gn(I,dt.element,Lu(I),dt.column)));return tu(pe.getOrDie())},Gu=I=>{const j=Bm(I);if(j.length===0)return;const pe=$g(I,j),De={type:"tabpanel",tabs:[{title:"General",name:"general",items:ne(I)},be(I,"cell")]},dt={type:"panel",items:[{type:"grid",columns:2,items:ne(I)}]};I.windowManager.open({title:"Cell Properties",size:"normal",body:Lu(I)?De:dt,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:pe,onSubmit:L(Lm,I,j,pe)})},q0=I=>eu(Lh(I)).map(j=>({name:"class",type:"listbox",label:"Class",items:j})),ia=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Sn=I=>ia.concat(q0(I).toArray()),Al=(I,j,pe)=>{pe("class")&&j.class!=="mce-no-match"&&I.setAttrib("class",j.class),pe("height")&&I.setStyle("height",oo(j.height))},qu=(I,j,pe)=>{pe("backgroundcolor")&&I.setStyle("background-color",j.backgroundcolor),pe("bordercolor")&&I.setStyle("border-color",j.bordercolor),pe("borderstyle")&&I.setStyle("border-style",j.borderstyle)},ti=(I,j,pe,De)=>{const on=j.length===1?_e:De;oe(j,$n=>{const io=Ja(an.fromDom($n),"td,th"),Go=ut.normal(I,$n);Al(Go,pe,on),tf(I)&&qu(Go,pe,on),De("height")&&oe(io,ts=>{I.dom.setStyle(ts.dom,"height",null)}),De("align")&&Bi(I,$n,pe.align)})},Bp=(I,j)=>{I.execCommand("mceTableRowType",!1,{type:j.type,no_events:!0})},ni=(I,j,pe,De)=>{const dt=Nt(De,(on,$n)=>pe[$n]!==on);if(R(dt)>0){const on=ye(dt,"type"),$n=on?R(dt)>1:!0;$n&&ti(I,j,De,L(ye,dt)),on&&Bp(I,De),At(an.fromDom(j[0])).each(io=>Re(I,io.dom,{structure:on,style:$n}))}},Fs=(I,j,pe,De)=>{const dt=De.getData();De.close(),I.undoManager.transact(()=>{ni(I,j,pe,dt),I.focus()})},Kh=I=>{const j=Wu(Co(I),ul.selected);if(j.length===0)return;const pe=ft(j,$n=>Hf(I,$n.dom,tf(I))),De=tu(pe),dt={type:"tabpanel",tabs:[{title:"General",name:"general",items:Sn(I)},be(I,"row")]},on={type:"panel",items:[{type:"grid",columns:2,items:Sn(I)}]};I.windowManager.open({title:"Row Properties",size:"normal",body:tf(I)?dt:on,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:De,onSubmit:L(Fs,I,ft(j,$n=>$n.dom),De)})},sn=(I,j,pe)=>{const De=pe?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],dt=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],on=dd(I)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],$n=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],io=j.length>0?[{name:"class",type:"listbox",label:"Class",items:j}]:[];return De.concat(dt).concat(on).concat($n).concat(io)},Ls=(I,j,pe,De)=>{if(j.tagName==="TD"||j.tagName==="TH")b(pe)&&O(De)?I.setStyle(j,pe,De):I.setStyles(j,pe);else if(j.children)for(let dt=0;dt<j.children.length;dt++)Ls(I,j.children[dt],pe,De)},Uv=(I,j,pe,De)=>{const dt=I.dom,on={},$n={},io=zl(I),Go=nf(I),ts=parseFloat(pe.border)===0;if(!_(pe.class)&&pe.class!=="mce-no-match"&&(on.class=pe.class),$n.height=oo(pe.height),io?$n.width=oo(pe.width):dt.getAttrib(j,"width")&&(on.width=fo(pe.width)),io?(ts?(on.border=0,$n["border-width"]=""):($n["border-width"]=oo(pe.border),on.border=1),$n["border-spacing"]=oo(pe.cellspacing)):(on.border=ts?0:pe.border,on.cellpadding=pe.cellpadding,on.cellspacing=pe.cellspacing),io&&j.children){const cr={};if(ts?cr["border-width"]="":De.border&&(cr["border-width"]=oo(pe.border)),De.cellpadding&&(cr.padding=oo(pe.cellpadding)),Go&&De.bordercolor&&(cr["border-color"]=pe.bordercolor),!st(cr))for(let sr=0;sr<j.children.length;sr++)Ls(dt,j.children[sr],cr)}if(Go){const cr=pe;$n["background-color"]=cr.backgroundcolor,$n["border-color"]=cr.bordercolor,$n["border-style"]=cr.borderstyle}dt.setStyles(j,{...Am(I),...$n}),dt.setAttribs(j,{...kp(I),...on})},Ma=(I,j,pe,De)=>{const dt=I.dom,on=De.getData(),$n=Nt(on,(io,Go)=>pe[Go]!==io);De.close(),I.undoManager.transact(()=>{if(!j){const io=El(on.cols).getOr(1),Go=El(on.rows).getOr(1);I.execCommand("mceInsertTable",!1,{rows:Go,columns:io}),j=ho(Co(I),co(I)).bind(ts=>At(ts,co(I))).map(ts=>ts.dom).getOrDie()}if(R($n)>0){const io={border:ye($n,"border"),bordercolor:ye($n,"bordercolor"),cellpadding:ye($n,"cellpadding")};Uv(I,j,on,io);const Go=dt.select("caption",j)[0];(Go&&!on.caption||!Go&&on.caption)&&I.execCommand("mceTableToggleCaption"),Bi(I,j,on.align)}if(I.focus(),I.addVisual(),R($n)>0){const io=ye($n,"caption"),Go=io?R($n)>1:!0;Re(I,j,{structure:io,style:Go})}})},nu=(I,j)=>{const pe=I.dom;let De,dt=Yh(I,nf(I));j?(dt.cols="1",dt.rows="1",nf(I)&&(dt.borderstyle="",dt.bordercolor="",dt.backgroundcolor="")):(De=pe.getParent(I.selection.getStart(),"table",I.getBody()),De?dt=yd(I,De,nf(I)):nf(I)&&(dt.borderstyle="",dt.bordercolor="",dt.backgroundcolor=""));const on=eu(gu(I));on.isSome()&&dt.class&&(dt.class=dt.class.replace(/\s*mce\-item\-table\s*/g,""));const $n={type:"grid",columns:2,items:sn(I,on.getOr([]),j)},io=()=>({type:"panel",items:[$n]}),Go=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[$n]},be(I,"table")]}),ts=nf(I)?Go():io();I.windowManager.open({title:"Table Properties",size:"normal",body:ts,onSubmit:L(Ma,I,De,dt),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:dt})},Ci=I=>{const j=pe=>{ls(Co(I))&&pe()};nt({mceTableProps:L(nu,I,!1),mceTableRowProps:L(Kh,I),mceTableCellProps:L(Gu,I),mceInsertTableDialog:L(nu,I,!0)},(pe,De)=>I.addCommand(De,()=>j(pe)))},k2=(I,j)=>js(I,j).isSome(),wd=q,Y0=I=>{const j=(De,dt)=>na(De,dt).exists(on=>parseInt(on,10)>1),pe=De=>j(De,"rowspan")||j(De,"colspan");return I.length>0&&we(I,pe)?Q.some(I):Q.none()},Wl=(I,j,pe)=>j.length<=1?Q.none():Uh(I,pe.firstSelectedSelector,pe.lastSelectedSelector).map(De=>({bounds:De,cells:j})),Hs=I=>({element:I,mergable:Q.none(),unmergable:Q.none(),selection:[I]}),Cd=(I,j,pe)=>({element:pe,mergable:Wl(j,I,ul),unmergable:Y0(I),selection:wd(I)}),Dg=I=>{const j=Dr(Q.none()),pe=Dr([]);let De=Q.none();const dt=Xr("caption"),on=Ds=>De.forall(Cr=>!Cr[Ds]),$n=()=>Za(Co(I),co(I)),io=()=>Za(Io(I),co(I)),Go=()=>$n().bind(Ds=>cs(ac(At(Ds),io().bind(At),(Cr,Gl)=>yo(Cr,Gl)?dt(Ds)?Q.some(Hs(Ds)):Q.some(Cd(Bm(I),Cr,Ds)):Q.none()))),ts=Ds=>At(Ds.element).map(Gl=>{const Ta=Xc.fromTable(Gl),Jh=Vf(Ta,Ds).getOr([]),Bg=Ct(Jh,(Uf,gc)=>(gc.isLocked&&(Uf.onAny=!0,gc.column===0?Uf.onFirst=!0:gc.column+gc.colspan>=Ta.grid.columns&&(Uf.onLast=!0)),Uf),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:Zh(Ta,Ds).isSome(),unmergeable:Z0(Ta,Ds).isSome(),locked:Bg}}),cr=()=>{j.set(Vr(Go)()),De=j.get().bind(ts),oe(pe.get(),me)},sr=Ds=>(Ds(),pe.set(pe.get().concat([Ds])),()=>{pe.set(St(pe.get(),Cr=>Cr!==Ds))}),qr=(Ds,Cr)=>sr(()=>j.get().fold(()=>{Ds.setEnabled(!1)},Gl=>{Ds.setEnabled(!Cr(Gl)&&I.selection.isEditable())})),Ol=(Ds,Cr,Gl)=>sr(()=>j.get().fold(()=>{Ds.setEnabled(!1),Ds.setActive(!1)},Ta=>{Ds.setEnabled(!Cr(Ta)&&I.selection.isEditable()),Ds.setActive(Gl(Ta))})),Yu=Ds=>De.exists(Cr=>Cr.locked[Ds]),Zl=Ds=>qr(Ds,Cr=>!1),wu=Ds=>qr(Ds,Cr=>dt(Cr.element)),Ip=Ds=>Cr=>qr(Cr,Gl=>dt(Gl.element)||Yu(Ds)),Pp=Ds=>Cr=>qr(Cr,Gl=>dt(Gl.element)||Ds().isNone()),$l=(Ds,Cr)=>Gl=>qr(Gl,Ta=>dt(Ta.element)||Ds().isNone()||Yu(Cr)),Fp=Ds=>qr(Ds,Cr=>on("mergeable")),Lp=Ds=>qr(Ds,Cr=>on("unmergeable")),Xh=Ds=>Ol(Ds,Ze,Cr=>At(Cr.element,co(I)).exists(Ta=>k2(Ta,"caption"))),Rg=(Ds,Cr)=>Gl=>Ol(Gl,Ta=>dt(Ta.element),()=>I.queryCommandValue(Ds)===Cr),ci=Rg("mceTableRowType","header"),Cu=Rg("mceTableColType","th");return I.on("NodeChange ExecCommand TableSelectorChange",cr),{onSetupTable:Zl,onSetupCellOrRow:wu,onSetupColumn:Ip,onSetupPasteable:Pp,onSetupPasteableColumn:$l,onSetupMergeable:Fp,onSetupUnmergeable:Lp,resetTargets:cr,onSetupTableWithCaption:Xh,onSetupTableRowHeaders:ci,onSetupTableColumnHeaders:Cu,targets:j.get}};var ya=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const Mg="x-tinymce/dom-table-",df=Mg+"rows",K0=Mg+"columns",Nl=I=>{var j;const pe=(j=ya.read())!==null&&j!==void 0?j:[];return bt(pe,De=>Q.from(De.getType(I)))},Ac=()=>Nl(df),kt=()=>Nl(K0),pc=I=>j=>{const pe=()=>{j.setEnabled(I.selection.isEditable())};return I.on("NodeChange",pe),pe(),()=>{I.off("NodeChange",pe)}},oi=(I,j)=>{I.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:pc(I),fetch:io=>io("inserttable | cell row column | advtablesort | tableprops deletetable")});const pe=io=>()=>I.execCommand(io),De=(io,Go)=>{I.queryCommandSupported(Go.command)&&I.ui.registry.addButton(io,{...Go,onAction:B(Go.onAction)?Go.onAction:pe(Go.command)})},dt=(io,Go)=>{I.queryCommandSupported(Go.command)&&I.ui.registry.addToggleButton(io,{...Go,onAction:B(Go.onAction)?Go.onAction:pe(Go.command)})};De("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:j.onSetupTable}),De("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:j.onSetupTable}),De("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:j.onSetupCellOrRow}),De("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:j.onSetupMergeable}),De("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:j.onSetupUnmergeable}),De("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:j.onSetupCellOrRow}),De("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:j.onSetupCellOrRow}),De("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:j.onSetupCellOrRow}),De("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:j.onSetupCellOrRow}),De("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:j.onSetupColumn("onFirst")}),De("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:j.onSetupColumn("onLast")}),De("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:j.onSetupColumn("onAny")}),De("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:j.onSetupCellOrRow}),De("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:j.onSetupCellOrRow}),De("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:j.onSetupPasteable(Ac)}),De("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:j.onSetupPasteable(Ac)}),De("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:j.onSetupColumn("onAny")}),De("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:j.onSetupColumn("onAny")}),De("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:j.onSetupPasteableColumn(kt,"onFirst")}),De("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:j.onSetupPasteableColumn(kt,"onLast")}),De("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:pc(I)});const on=Mr(gu(I));on.length!==0&&I.queryCommandSupported("mceTableToggleClass")&&I.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Zu(I,on,"tableclass",io=>I.execCommand("mceTableToggleClass",!1,io)),onSetup:j.onSetupTable});const $n=Mr(Ii(I));$n.length!==0&&I.queryCommandSupported("mceTableCellToggleClass")&&I.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Zu(I,$n,"tablecellclass",io=>I.execCommand("mceTableCellToggleClass",!1,io)),onSetup:j.onSetupCellOrRow}),I.queryCommandSupported("mceTableApplyCellStyle")&&(I.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Zu(I,dl,"tablecellverticalalign",bd(I,"vertical-align")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Zu(I,Jc(I),"tablecellborderwidth",bd(I,"border-width")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Zu(I,km(I),"tablecellborderstyle",bd(I,"border-style")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:io=>io(fc(I,of(I),"background-color")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:io=>io(fc(I,_p(I),"border-color")),onSetup:j.onSetupCellOrRow})),dt("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:j.onSetupTableWithCaption}),dt("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:vs(I),onSetup:j.onSetupTableRowHeaders}),dt("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:uf(I),onSetup:j.onSetupTableColumnHeaders})},Gr=I=>{const j=De=>I.dom.is(De,"table")&&I.getBody().contains(De)&&I.dom.isEditable(De.parentNode),pe=Ep(I);pe.length>0&&I.ui.registry.addContextToolbar("table",{predicate:j,items:pe,scope:"node",position:"node"})},Nc=I=>j=>{const pe=()=>{j.setEnabled(I.selection.isEditable())};return I.on("NodeChange",pe),pe(),()=>{I.off("NodeChange",pe)}},wa=(I,j)=>{const pe=sr=>()=>I.execCommand(sr),De=(sr,qr)=>I.queryCommandSupported(qr.command)?(I.ui.registry.addMenuItem(sr,{...qr,onAction:B(qr.onAction)?qr.onAction:pe(qr.command)}),!0):!1,dt=(sr,qr)=>{I.queryCommandSupported(qr.command)&&I.ui.registry.addToggleMenuItem(sr,{...qr,onAction:B(qr.onAction)?qr.onAction:pe(qr.command)})},on=sr=>{I.execCommand("mceInsertTable",!1,{rows:sr.numRows,columns:sr.numColumns})},$n=[De("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:j.onSetupCellOrRow}),De("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:j.onSetupCellOrRow}),De("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:j.onSetupCellOrRow}),De("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:j.onSetupCellOrRow}),De("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:j.onSetupCellOrRow}),De("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:j.onSetupCellOrRow}),De("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:j.onSetupPasteable(Ac)}),De("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:j.onSetupPasteable(Ac)})],io=[De("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:j.onSetupColumn("onFirst")}),De("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:j.onSetupColumn("onLast")}),De("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:j.onSetupColumn("onAny")}),De("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:j.onSetupColumn("onAny")}),De("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:j.onSetupColumn("onAny")}),De("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:j.onSetupPasteableColumn(kt,"onFirst")}),De("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:j.onSetupPasteableColumn(kt,"onLast")})],Go=[De("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:j.onSetupCellOrRow}),De("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:j.onSetupMergeable}),De("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:j.onSetupUnmergeable})];fd(I)?I.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:on}],onSetup:Nc(I)}):I.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:pe("mceInsertTableDialog"),onSetup:Nc(I)}),I.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:pe("mceInsertTableDialog"),onSetup:Nc(I)}),De("tableprops",{text:"Table properties",onSetup:j.onSetupTable,command:"mceTableProps"}),De("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:j.onSetupTable,command:"mceTableDelete"}),ze($n,!0)&&I.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:Y("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),ze(io,!0)&&I.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:Y("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),ze(Go,!0)&&I.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:Y("tablecellprops tablemergecells tablesplitcells")}),I.ui.registry.addContextMenu("table",{update:()=>(j.resetTargets(),j.targets().fold(Y(""),sr=>fn(sr.element)==="caption"?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"))});const ts=Mr(gu(I));ts.length!==0&&I.queryCommandSupported("mceTableToggleClass")&&I.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>Lf(I,ts,"tableclass",sr=>I.execCommand("mceTableToggleClass",!1,sr)),onSetup:j.onSetupTable});const cr=Mr(Ii(I));cr.length!==0&&I.queryCommandSupported("mceTableCellToggleClass")&&I.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Lf(I,cr,"tablecellclass",sr=>I.execCommand("mceTableCellToggleClass",!1,sr)),onSetup:j.onSetupCellOrRow}),I.queryCommandSupported("mceTableApplyCellStyle")&&(I.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>Lf(I,dl,"tablecellverticalalign",bd(I,"vertical-align")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Lf(I,Jc(I),"tablecellborderwidth",bd(I,"border-width")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Lf(I,km(I),"tablecellborderstyle",bd(I,"border-style")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>fc(I,of(I),"background-color"),onSetup:j.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>fc(I,_p(I),"border-color"),onSetup:j.onSetupCellOrRow})),dt("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:j.onSetupTableWithCaption}),dt("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:vs(I),onSetup:j.onSetupTableRowHeaders}),dt("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:uf(I),onSetup:j.onSetupTableRowHeaders})},hr=I=>{const j=Dg(I);ja(I),Ci(I),wa(I,j),oi(I,j),Gr(I)};var Vm=()=>{o.add("table",hr)};Vm()})();(function(){const o=B=>{let F=B;return{get:()=>F,set:Y=>{F=Y}}};var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(B,F)=>{B.dispatch("VisualBlocks",{state:F})},u=(B,F,Z)=>{B.dom.toggleClass(B.getBody(),"mce-visualblocks"),Z.set(!Z.get()),i(B,Z.get())},m=(B,F,Z)=>{B.addCommand("mceVisualBlocks",()=>{u(B,F,Z)})},h=B=>F=>F.options.get(B),b=B=>{const F=B.options.register;F("visualblocks_default_state",{processor:"boolean",default:!1})},C=h("visualblocks_default_state"),S=(B,F,Z)=>{B.on("PreviewFormats AfterPreviewFormats",G=>{Z.get()&&B.dom.toggleClass(B.getBody(),"mce-visualblocks",G.type==="afterpreviewformats")}),B.on("init",()=>{C(B)&&u(B,F,Z)})},_=(B,F)=>Z=>{Z.setActive(F.get());const G=Y=>Z.setActive(Y.state);return B.on("VisualBlocks",G),()=>B.off("VisualBlocks",G)},N=(B,F)=>{const Z=()=>B.execCommand("mceVisualBlocks");B.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:Z,onSetup:_(B,F),context:"any"}),B.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:Z,onSetup:_(B,F),context:"any"})};var O=()=>{s.add("visualblocks",(B,F)=>{b(B);const Z=o(!1);m(B,F,Z),N(B,Z),S(B,F,Z)})};O()})();(function(){const o=_t=>{let Ht=_t;return{get:()=>Ht,set:Bo=>{Ht=Bo}}};var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=_t=>({isEnabled:()=>_t.get()}),u=(_t,Ht)=>_t.dispatch("VisualChars",{state:Ht}),m=(_t,Ht,Fn)=>{var ao;return Fn(_t,Ht.prototype)?!0:((ao=_t.constructor)===null||ao===void 0?void 0:ao.name)===Ht.name},h=_t=>{const Ht=typeof _t;return _t===null?"null":Ht==="object"&&Array.isArray(_t)?"array":Ht==="object"&&m(_t,String,(Fn,ao)=>ao.isPrototypeOf(Fn))?"string":Ht},b=_t=>Ht=>h(Ht)===_t,C=_t=>Ht=>typeof Ht===_t,S=_t=>Ht=>_t===Ht,_=b("string"),N=b("object"),O=S(null),B=C("boolean"),F=_t=>_t==null,Z=_t=>!F(_t),G=C("number");class Y{constructor(Ht,Fn){this.tag=Ht,this.value=Fn}static some(Ht){return new Y(!0,Ht)}static none(){return Y.singletonNone}fold(Ht,Fn){return this.tag?Fn(this.value):Ht()}isSome(){return this.tag}isNone(){return!this.tag}map(Ht){return this.tag?Y.some(Ht(this.value)):Y.none()}bind(Ht){return this.tag?Ht(this.value):Y.none()}exists(Ht){return this.tag&&Ht(this.value)}forall(Ht){return!this.tag||Ht(this.value)}filter(Ht){return!this.tag||Ht(this.value)?this:Y.none()}getOr(Ht){return this.tag?this.value:Ht}or(Ht){return this.tag?this:Ht}getOrThunk(Ht){return this.tag?this.value:Ht()}orThunk(Ht){return this.tag?this:Ht()}getOrDie(Ht){if(this.tag)return this.value;throw new Error(Ht??"Called getOrDie on None")}static from(Ht){return Z(Ht)?Y.some(Ht):Y.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Ht){this.tag&&Ht(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Y.singletonNone=new Y(!1);const q=(_t,Ht)=>{const Fn=_t.length,ao=new Array(Fn);for(let Bo=0;Bo<Fn;Bo++){const is=_t[Bo];ao[Bo]=Ht(is,Bo)}return ao},W=(_t,Ht)=>{for(let Fn=0,ao=_t.length;Fn<ao;Fn++){const Bo=_t[Fn];Ht(Bo,Fn)}},L=(_t,Ht)=>{const Fn=[];for(let ao=0,Bo=_t.length;ao<Bo;ao++){const is=_t[ao];Ht(is,ao)&&Fn.push(is)}return Fn},me=Object.keys,Ze=(_t,Ht)=>{const Fn=me(_t);for(let ao=0,Bo=Fn.length;ao<Bo;ao++){const is=Fn[ao],yr=_t[is];Ht(yr,is)}},_e=typeof window<"u"?window:Function("return this;")(),Q=(_t,Ht)=>{let Fn=Ht??_e;for(let ao=0;ao<_t.length&&Fn!==void 0&&Fn!==null;++ao)Fn=Fn[_t[ao]];return Fn},Fe=(_t,Ht)=>{const Fn=_t.split(".");return Q(Fn,Ht)},lt=(_t,Ht)=>Fe(_t,Ht),nt=(_t,Ht)=>{const Fn=lt(_t,Ht);if(Fn==null)throw new Error(_t+" not available on this browser");return Fn},$e=Object.getPrototypeOf,ue=_t=>nt("HTMLElement",_t),Nt=_t=>{const Ht=Fe("ownerDocument.defaultView",_t);return N(_t)&&(ue(Ht).prototype.isPrototypeOf(_t)||/^HTML\w*Element$/.test($e(_t).constructor.name))},ge=1,Oe=3,R=_t=>_t.dom.nodeType,je=_t=>_t.dom.nodeValue,ye=_t=>Ht=>R(Ht)===_t,tt=_t=>st(_t)&&Nt(_t.dom),st=ye(ge),he=ye(Oe),Ge=(_t,Ht,Fn)=>{if(_(Fn)||B(Fn)||G(Fn))_t.setAttribute(Ht,Fn+"");else throw console.error("Invalid call to Attribute.set. Key ",Ht,":: Value ",Fn,":: Element ",_t),new Error("Attribute value was not simple")},Tt=(_t,Ht,Fn)=>{Ge(_t.dom,Ht,Fn)},ze=(_t,Ht)=>{const Fn=_t.dom.getAttribute(Ht);return Fn===null?void 0:Fn},vt=(_t,Ht)=>{_t.dom.removeAttribute(Ht)},Be=(_t,Ht)=>{const Fn=ze(_t,Ht);return Fn===void 0||Fn===""?[]:Fn.split(" ")},ft=(_t,Ht,Fn)=>{const Bo=Be(_t,Ht).concat([Fn]);return Tt(_t,Ht,Bo.join(" ")),!0},oe=(_t,Ht,Fn)=>{const ao=L(Be(_t,Ht),Bo=>Bo!==Fn);return ao.length>0?Tt(_t,Ht,ao.join(" ")):vt(_t,Ht),!1},pn=_t=>_t.dom.classList!==void 0,gt=_t=>Be(_t,"class"),St=(_t,Ht)=>ft(_t,"class",Ht),jt=(_t,Ht)=>oe(_t,"class",Ht),Ct=(_t,Ht)=>{pn(_t)?_t.dom.classList.add(Ht):St(_t,Ht)},te=_t=>{(pn(_t)?_t.dom.classList:gt(_t)).length===0&&vt(_t,"class")},ie=(_t,Ht)=>{pn(_t)?_t.dom.classList.remove(Ht):jt(_t,Ht),te(_t)},ce=(_t,Ht)=>{const ao=(Ht||document).createElement("div");if(ao.innerHTML=_t,!ao.hasChildNodes()||ao.childNodes.length>1){const Bo="HTML does not have a single root node";throw console.error(Bo,_t),new Error(Bo)}return Me(ao.childNodes[0])},X=(_t,Ht)=>{const ao=(Ht||document).createElement(_t);return Me(ao)},we=(_t,Ht)=>{const ao=(Ht||document).createTextNode(_t);return Me(ao)},Me=_t=>{if(_t==null)throw new Error("Node cannot be null or undefined");return{dom:_t}},mt={fromHtml:ce,fromTag:X,fromText:we,fromDom:Me,fromPoint:(_t,Ht,Fn)=>Y.from(_t.dom.elementFromPoint(Ht,Fn)).map(Me)},We={" ":"nbsp","":"shy"},bt=(_t,Ht)=>{let Fn="";return Ze(_t,(ao,Bo)=>{Fn+=Bo}),new RegExp("["+Fn+"]",Ht?"g":"")},Dt=_t=>{let Ht="";return Ze(_t,Fn=>{Ht&&(Ht+=","),Ht+="span.mce-"+Fn}),Ht},gn=bt(We),Et=bt(We,!0),It=Dt(We),dn="mce-nbsp",_n=_t=>_t.dom.contentEditable,xo=_t=>'<span data-mce-bogus="1" class="mce-'+We[_t]+'">'+_t+"</span>",Qn=_t=>_t.nodeName.toLowerCase()==="span"&&_t.classList.contains("mce-nbsp-wrap"),Ot=_t=>{const Ht=je(_t);return he(_t)&&_(Ht)&&gn.test(Ht)},rn=_t=>tt(_t)&&_n(_t)==="false",an=(_t,Ht)=>{if(tt(_t)&&!Qn(_t.dom)){const Fn=_n(_t);if(Fn==="true")return!0;if(Fn==="false")return!1}return Ht},On=(_t,Ht,Fn)=>{let ao=[];const Bo=_t.dom,is=q(Bo.childNodes,mt.fromDom),yr=wr=>Qn(wr.dom)||!rn(wr);return W(is,wr=>{Fn&&yr(wr)&&Ht(wr)&&(ao=ao.concat([wr])),ao=ao.concat(On(wr,Ht,an(wr,Fn)))}),ao},ko=(_t,Ht)=>{for(;_t.parentNode;){if(_t.parentNode===Ht)return Ht;_t=_t.parentNode}},Ro=_t=>_t.replace(Et,xo),ws=(_t,Ht)=>{const Fn=_t.dom,ao=On(mt.fromDom(Ht),Ot,_t.dom.isEditable(Ht));W(ao,Bo=>{var is;const yr=Bo.dom.parentNode;if(Qn(yr))Ct(mt.fromDom(yr),dn);else{const wr=Ro(Fn.encode((is=je(Bo))!==null&&is!==void 0?is:"")),ar=Fn.create("div",{},wr);let Je;for(;Je=ar.lastChild;)Fn.insertAfter(Je,Bo.dom);_t.dom.remove(Bo.dom)}})},yo=(_t,Ht)=>{const Fn=_t.dom.select(It,Ht);W(Fn,ao=>{Qn(ao)?ie(mt.fromDom(ao),dn):_t.dom.remove(ao,!0)})},Us=_t=>{const Ht=_t.getBody(),Fn=_t.selection.getBookmark();let ao=ko(_t.selection.getNode(),Ht);ao=ao!==void 0?ao:Ht,yo(_t,ao),ws(_t,ao),_t.selection.moveToBookmark(Fn)},fn=(_t,Ht)=>{u(_t,Ht.get());const Fn=_t.getBody();Ht.get()===!0?ws(_t,Fn):yo(_t,Fn)},Ho=(_t,Ht)=>{Ht.set(!Ht.get());const Fn=_t.selection.getBookmark();fn(_t,Ht),_t.selection.moveToBookmark(Fn)},tr=(_t,Ht)=>{_t.addCommand("mceVisualChars",()=>{Ho(_t,Ht)})},rr=_t=>Ht=>Ht.options.get(_t),Ir=_t=>{const Ht=_t.options.register;Ht("visualchars_default_state",{processor:"boolean",default:!1})},Pr=rr("visualchars_default_state"),ks=(_t,Ht)=>{_t.on("init",()=>{fn(_t,Ht)})},Nr=(_t,Ht)=>{let Fn=null;return{cancel:()=>{O(Fn)||(clearTimeout(Fn),Fn=null)},throttle:(...is)=>{O(Fn)&&(Fn=setTimeout(()=>{Fn=null,_t.apply(null,is)},Ht))}}},Xr=(_t,Ht)=>{const Fn=Nr(()=>{Us(_t)},300);_t.on("keydown",ao=>{Ht.get()===!0&&(ao.keyCode===13?Us(_t):Fn.throttle())}),_t.on("remove",Fn.cancel)},xs=(_t,Ht)=>Fn=>{Fn.setActive(Ht.get());const ao=Bo=>Fn.setActive(Bo.state);return _t.on("VisualChars",ao),()=>_t.off("VisualChars",ao)},uo=(_t,Ht)=>{const Fn=()=>_t.execCommand("mceVisualChars");_t.ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:Fn,onSetup:xs(_t,Ht),context:"any"}),_t.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",icon:"visualchars",onAction:Fn,onSetup:xs(_t,Ht),context:"any"})};var Ps=()=>{s.add("visualchars",_t=>{Ir(_t);const Ht=o(Pr(_t));return tr(_t,Ht),uo(_t,Ht),Xr(_t,Ht),ks(_t,Ht),i(Ht)})};Ps()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(te=>ie=>te===ie)(null),u=te=>te,m=(te,ie)=>{const ce=te.length,X=new Array(ce);for(let we=0;we<ce;we++){const Me=te[we];X[we]=ie(Me,we)}return X},b={aletter:"[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]",midnumlet:"[-'\\.‘’․﹒'.]",midletter:"[:··״‧︓﹕:]",midnum:"[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]",numeric:"[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]",cr:"\\r",lf:"\\n",newline:"[\v\f
\u2028\u2029]",extend:"[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]",format:"[-឴឵---\uFEFF-]",katakana:"[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]",extendnumlet:"[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]",punctuation:"[~№|!-*+-\\/:;?@\\[-`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]"},C={ALETTER:0,MIDNUMLET:1,MIDLETTER:2,MIDNUM:3,NUMERIC:4,CR:5,LF:6,NEWLINE:7,EXTEND:8,FORMAT:9,KATAKANA:10,EXTENDNUMLET:11,AT:12,OTHER:13},S=[new RegExp(b.aletter),new RegExp(b.midnumlet),new RegExp(b.midletter),new RegExp(b.midnum),new RegExp(b.numeric),new RegExp(b.cr),new RegExp(b.lf),new RegExp(b.newline),new RegExp(b.extend),new RegExp(b.format),new RegExp(b.katakana),new RegExp(b.extendnumlet),new RegExp("@")],_="",N=new RegExp("^"+b.punctuation+"$"),O=/^\s+$/,B=S,F=C.OTHER,Z=te=>{let ie=F;const ce=B.length;for(let X=0;X<ce;++X){const we=B[X];if(we&&we.test(te)){ie=X;break}}return ie},G=te=>{const ie={};return ce=>{if(ie[ce])return ie[ce];{const X=te(ce);return ie[ce]=X,X}}},Y=te=>{const ie=G(Z);return m(te,ie)},q=(te,ie)=>{const ce=te[ie],X=te[ie+1];if(ie<0||ie>te.length-1&&ie!==0||ce===C.ALETTER&&X===C.ALETTER)return!1;const we=te[ie+2];if(ce===C.ALETTER&&(X===C.MIDLETTER||X===C.MIDNUMLET||X===C.AT)&&we===C.ALETTER)return!1;const Me=te[ie-1];return(ce===C.MIDLETTER||ce===C.MIDNUMLET||X===C.AT)&&X===C.ALETTER&&Me===C.ALETTER||(ce===C.NUMERIC||ce===C.ALETTER)&&(X===C.NUMERIC||X===C.ALETTER)||(ce===C.MIDNUM||ce===C.MIDNUMLET)&&X===C.NUMERIC&&Me===C.NUMERIC||ce===C.NUMERIC&&(X===C.MIDNUM||X===C.MIDNUMLET)&&we===C.NUMERIC||(ce===C.EXTEND||ce===C.FORMAT)&&(X===C.ALETTER||X===C.NUMERIC||X===C.KATAKANA||X===C.EXTEND||X===C.FORMAT)||(X===C.EXTEND||X===C.FORMAT&&(we===C.ALETTER||we===C.NUMERIC||we===C.KATAKANA||we===C.EXTEND||we===C.FORMAT))&&(ce===C.ALETTER||ce===C.NUMERIC||ce===C.KATAKANA||ce===C.EXTEND||ce===C.FORMAT)||ce===C.CR&&X===C.LF?!1:ce===C.NEWLINE||ce===C.CR||ce===C.LF||X===C.NEWLINE||X===C.CR||X===C.LF?!0:!(ce===C.KATAKANA&&X===C.KATAKANA||X===C.EXTENDNUMLET&&(ce===C.ALETTER||ce===C.NUMERIC||ce===C.KATAKANA||ce===C.EXTENDNUMLET)||ce===C.EXTENDNUMLET&&(X===C.ALETTER||X===C.NUMERIC||X===C.KATAKANA)||ce===C.AT)},W=_,L=O,me=N,Ze=te=>te==="http"||te==="https",_e=(te,ie)=>{let ce;for(ce=ie;ce<te.length&&!L.test(te[ce]);ce++);return ce},Q=(te,ie)=>{const ce=_e(te,ie+1);return te.slice(ie+1,ce).join(W).substr(0,3)==="://"?ce:ie},Fe=(te,ie,ce,X)=>{const we=[],Me=[];let Pe=[];for(let mt=0;mt<ce.length;++mt)if(Pe.push(te[mt]),q(ce,mt)){const We=ie[mt];if((X.includeWhitespace||!L.test(We))&&(X.includePunctuation||!me.test(We))){const bt=mt-Pe.length+1,Dt=mt+1,gn=ie.slice(bt,Dt).join(W);if(Ze(gn)){const Et=Q(ie,mt),It=te.slice(Dt,Et);Array.prototype.push.apply(Pe,It),mt=Et}ie[mt+1]==="."&&/^([a-zA-Z]\.)+$/.test(gn+".")?(Pe.push(te[mt+1]),Me.push({start:bt,end:Dt+1})):Me.push({start:bt,end:Dt}),we.push(Pe)}Pe=[]}return{words:we,indices:Me}},lt=()=>({includeWhitespace:!1,includePunctuation:!1}),nt=(te,ie,ce)=>{ce={...lt(),...ce};const X=m(te,ie),we=Y(X);return Fe(te,X,we,ce)},ue=(te,ie,ce)=>nt(te,ie,ce).words,Nt=te=>te.replace(/\uFEFF/g,"");var ge=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const Oe=(te,ie)=>{const ce=ie.getBlockElements(),X=ie.getVoidElements(),we=bt=>ce[bt.nodeName]||X[bt.nodeName],Me=[];let Pe="";const mt=new ge(te,te);let We;for(;We=mt.next();)We.nodeType===3?Pe+=Nt(We.data):we(We)&&Pe.length&&(Me.push(Pe),Pe="");return Pe.length&&Me.push(Pe),Me},R=te=>te.replace(/\u200B/g,""),je=te=>te.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length,ye=(te,ie)=>{const ce=R(Oe(te,ie).join(`
|
|
119
|
-
`));return ue(ce.split(""),u).length},tt=(te,ie)=>{const ce=Oe(te,ie).join("");return je(ce)},st=(te,ie)=>{const ce=Oe(te,ie).join("").replace(/\s/g,"");return je(ce)},he=(te,ie)=>()=>ie(te.getBody(),te.schema),Ge=(te,ie)=>()=>ie(te.selection.getRng().cloneContents(),te.schema),Tt=te=>he(te,ye),ze=te=>({body:{getWordCount:Tt(te),getCharacterCount:he(te,tt),getCharacterCountWithoutSpaces:he(te,st)},selection:{getWordCount:Ge(te,ye),getCharacterCount:Ge(te,tt),getCharacterCountWithoutSpaces:Ge(te,st)},getCount:Tt(te)}),vt=(te,ie)=>{te.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(ie.body.getWordCount()),String(ie.selection.getWordCount())],["Characters (no spaces)",String(ie.body.getCharacterCountWithoutSpaces()),String(ie.selection.getCharacterCountWithoutSpaces())],["Characters",String(ie.body.getCharacterCount()),String(ie.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},Be=(te,ie)=>{te.addCommand("mceWordCount",()=>vt(te,ie))},ft=(te,ie)=>{let ce=null;return{cancel:()=>{i(ce)||(clearTimeout(ce),ce=null)},throttle:(...Me)=>{i(ce)&&(ce=setTimeout(()=>{ce=null,te.apply(null,Me)},ie))}}};var oe=tinymce.util.Tools.resolve("tinymce.util.Delay");const pn=(te,ie)=>{te.dispatch("wordCountUpdate",{wordCount:{words:ie.body.getWordCount(),characters:ie.body.getCharacterCount(),charactersWithoutSpaces:ie.body.getCharacterCountWithoutSpaces()}})},gt=(te,ie)=>{pn(te,ie)},St=(te,ie,ce)=>{const X=ft(()=>gt(te,ie),ce);te.on("init",()=>{gt(te,ie),oe.setEditorTimeout(te,()=>{te.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",X.throttle)},0),te.on("remove",X.cancel)})},jt=te=>{const ie=()=>te.execCommand("mceWordCount");te.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:ie,context:"any"}),te.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:ie,context:"any"})};var Ct=(te=300)=>{o.add("wordcount",ie=>{const ce=ze(ie);return Be(ie,ce),jt(ie),St(ie,ce,te),ce})};Ct()})();const LMe=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),VMe=(o,s="wps_office")=>{const i=o.split(","),u=i[0].match(/:(.*?);/)[1],m=atob(i[1]);let h=m.length;const b=new Uint8Array(h);for(;h--;)b[h]=m.charCodeAt(h);return new File([b],s,{type:u})},HMe=o=>btoa(o.match(/\w{2}/g).map(s=>String.fromCharCode(parseInt(s,16))).join(""));function zMe(o){if(!o)return[];let s=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp(`(?:(${s.source}))([\\da-fA-F\\s]+)\\}`,"g"),u=o.match(i);console.log("images",u);const m=[];if(u||(s=/{\\pict[\s\S]+?(\\pngblip-?\d+)?(\\wmetafile8-?\d+)?{\\\*\\blipuid\s?[\da-fA-F]+[\s}]*?/,i=new RegExp(`(?:(${s.source}))([\\da-fA-F\\s]+)\\}`,"g"),u=o.match(i)),u)for(const h of u){let b=!1;if(h.includes("\\pngblip")?b="image/png":h.includes("\\jpegblip")&&(b="image/jpeg"),b){const C=h.replace(s,"").replace(/[^\da-fA-F]/g,""),S=`data:${b};base64,${HMe(C)}`;m.push({base64:S,file:VMe(S)})}}return m}const UMe=(o,s)=>{if(!s)return o;try{const u=new DOMParser().parseFromString(o,"text/html"),m=u.querySelectorAll("img"),b=(s.clipboardData||window.Clipboard).getData("text/rtf"),C=zMe(b);return m.forEach((S,_)=>{var O;const N=S.getAttribute("src");if(N&&N.startsWith("file:")&&(O=C==null?void 0:C[_])!=null&&O.base64){const B=C[_].base64;S.setAttribute("src",B)}}),u.body.innerHTML}catch{return o}},jMe=o=>{const s=atob(o.split(",")[1]),i=o.split(",")[0].split(":")[1].split(";")[0],u=new ArrayBuffer(s.length),m=new Uint8Array(u);for(let h=0;h<s.length;h++)m[h]=s.charCodeAt(h);return new Blob([u],{type:i})},WMe=async o=>{try{const s=jMe(o),i=new FormData;i.append("files",s,"image.png");const m=await(await fetch(`${process.env.NODE_ENV==="development"?"/api":""}/ajax/uploaddoc`,{method:"POST",body:i})).json();if(m.status===1)return m.file_url;throw new Error(m.message)}catch(s){throw s}},ZMe=async o=>{const i=new DOMParser().parseFromString(o,"text/html"),u=i.getElementsByTagName("img"),m=[],h=3;for(let b=0;b<u.length;b++){const C=u[b],S=C.getAttribute("src");S&&S.startsWith("data:image")&&(m.push({img:C,src:S,width:C.getAttribute("width"),height:C.getAttribute("height")}),m[m.length-1].width&&C.setAttribute("width",m[m.length-1].width),m[m.length-1].height&&C.setAttribute("height",m[m.length-1].height))}for(let b=0;b<m.length;b+=h){const S=m.slice(b,b+h).map(async _=>{try{const N=await WMe(_.src);_.img.setAttribute("src",N)}catch{_.img.remove()}});await Promise.all(S)}return i.body.innerHTML},GMe=o=>{o.querySelectorAll("td").forEach(i=>{const u=i.getAttribute("width"),m=i.getAttribute("style")||"";u==="0"&&m.includes("border:none")&&i.remove()})},qMe=o=>{o.querySelectorAll("table").forEach(i=>{i.style.maxWidth="100%"})},YMe=o=>{o.querySelectorAll("table").forEach(i=>{i.style.tableLayout="fixed";const u=i.getAttribute("style")||"";if(u){const m=u.split(";").filter(b=>b.trim()),h=[];m.forEach(b=>{const[C,S]=b.split(":").map(_=>_.trim());C&&S&&(["margin","margin-right","margin-left"].includes(C.toLowerCase())||h.push(`${C}: ${S}`))}),h.some(b=>b.toLowerCase().startsWith("width"))||h.push("width: 100%"),i.setAttribute("style",h.join("; "))}})},KMe=o=>{o.querySelectorAll("table").forEach(i=>{const u=i.querySelectorAll("tr");if(u.length>0){const b=u[0].querySelectorAll("td, th").length;if(b>0){const C=(100/b).toFixed(2);u.forEach(S=>{S.querySelectorAll("td, th").forEach(N=>{const O=N,B=parseInt(O.getAttribute("colspan")||"1"),F=(parseFloat(C)*B).toFixed(2),G=(O.getAttribute("style")||"").split(";").filter(q=>!q.trim().toLowerCase().startsWith("width")).join(";"),Y=G?`${G}; width: ${F}%`:`width: ${F}%`;O.setAttribute("style",Y)})})}}})},XMe=o=>{o.querySelectorAll("table").forEach(i=>{const u=i.querySelectorAll("td");let m=!1,h="";for(const b of u){const C=b.getAttribute("style")||"",S=C.match(/border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i)||C.match(/border(?:-(?:right|left|top|bottom))?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i);(S?S[0]:"").includes("double")&&(m=!0,S&&(h=S[0].replace(/^border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*/,""),b.style.borderTop=h,b.style.borderRight=h,b.style.borderBottom=h,b.style.borderLeft=h))}m&&h&&(i.style.borderCollapse="separate",i.style.borderSpacing="2px",i.style.border=h)})},JMe=o=>{o.querySelectorAll("table").forEach(i=>{i.querySelectorAll("td[rowspan]").forEach(m=>{const C=((m.getAttribute("style")||"").match(/border-[^:]+:[^;]+(?:solid|double)[^;]+/g)||[]).find(S=>!S.includes("none"));if(C){const S=C.split(":")[1].trim();m.style.borderBottom=S}})})},QMe=o=>{o.querySelectorAll('[style*="mso-"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/mso-[^:]+:[^;]+;/g,"");i.setAttribute("style",m)})},e6e=o=>{o.querySelectorAll('[style*="tab-stops"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/tab-stops:[^;]+;/g,"");i.setAttribute("style",m)})},t6e=o=>{const i=new DOMParser().parseFromString(o,"text/html"),u=i.querySelector("table");if(u){const h=u.style.width||u.getAttribute("width");if(h)return h}const m=i.querySelector("tr");if(m){const h=m.querySelectorAll("td");let b=0,C=!1;if(h.forEach(S=>{const _=S.style.width||S.getAttribute("width");if(_){const N=parseFloat(_.replace(/[^0-9.]/g,""));isNaN(N)||(b+=N,C=!0)}}),C)return`${b}px`}return"0px"},n6e=o=>{o=o.replace(/<a(?!.*?href=)[^>]*>([\s\S]*?)<\/a>/gi,"$1");const i=new DOMParser().parseFromString(o,"text/html");return GMe(i),qMe(i),XMe(i),JMe(i),QMe(i),e6e(i),YMe(i),KMe(i),o=i.body.innerHTML,o};Y6.PluginManager.add("pasteprocess",o=>(o.on("paste",s=>{if(s.clipboardData){const i=s.clipboardData.getData("text/html")||s.clipboardData.getData("text");if(LMe(i)){s.preventDefault();const u=o.windowManager.open({title:"处理中",body:{type:"panel",items:[{type:"htmlpanel",html:'<div style="text-align: center; padding: 20px;">正在处理Word内容,请稍候...</div>'}]},buttons:[]}),m=t6e(i),b=(parseFloat(m.replace(/[^0-9.]/g,""))||0)>600?"landscape":"portrait";o.fire("orientationchange",{orientation:b});const C=n6e(i),S=UMe(C,s);ZMe(S).then(_=>{o.insertContent(_),u.close()})}}}),{}));let oE="A4",sE="portrait";const vne={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}},o6e=Object.keys(vne).map(o=>`pagesize${o}`).join(" "),s6e="orientationPortrait orientationLandscape";Y6.PluginManager.add("pagesize",o=>{const s=o.options.register;s("pagesize",{processor:"string",default:"A4"}),s("orientation",{processor:"string",default:"portrait"});const i=h=>b=>b.options.get(h);oE=i("pagesize")(o),sE=i("orientation")(o);const u=h=>{const b=vne[h];if(b){let{width:C,height:S}=b;sE==="landscape"&&([C,S]=[S,C]);const _=(window.devicePixelRatio||1)*96,N=C*_/25.4;o!=null&&o.container&&(o.container.style.minWidth=`${N}px`);const O=o.contentAreaContainer.querySelector("iframe");O&&(O.style.width=`${N}px`),o.fire("pagesizechange",{size:h,orientation:sE})}},m=h=>{sE=h,u(oE),o.fire("orientationchange",{orientation:h})};return Object.keys(vne).forEach(h=>{o.ui.registry.addToggleMenuItem(`pagesize${h}`,{text:h,onAction:()=>{oE=h,u(h)},onSetup:b=>(b.setActive(oE===h),()=>{})})}),o.ui.registry.addToggleMenuItem("orientationPortrait",{text:"竖屏",onAction:()=>{m("portrait")},onSetup:h=>(h.setActive(sE==="portrait"),()=>{})}),o.ui.registry.addToggleMenuItem("orientationLandscape",{text:"横屏",onAction:()=>{m("landscape")},onSetup:h=>(h.setActive(sE==="landscape"),()=>{})}),o.on("orientationchange",h=>{h.orientation!==sE&&m(h.orientation)}),o.on("pagesizechange",h=>{h.size!==oE&&(oE=h.size,u(h.size))}),o.on("init",()=>{u(oE)}),{}});const Efe=["accordion","advlist","anchor","autolink","autosave","charmap","code","codesample","directionality","importcss","insertdatetime","link","lists","image","media","nonbreaking","pagebreak","preview","quickbars","save","searchreplace","table","visualblocks","fullscreen","visualchars","wordcount","pasteprocess"],r6e="undo redo h1 h2 h3 bold italic underline strikethrough subscript superscript fontsize fontFamily lineheight forecolor backcolor alignleft aligncenter alignright alignjustify pagebreak bullist numlist outdent indent blockquotelink unlink image code removeformat fullscreen preview ",_fe="file edit insert table tools help",a6e={menu:{pagesize:{title:"页面大小",items:o6e},orientation:{title:"页面方向",items:s6e}},menubar:_fe+" pagesize orientation",pagesize:"A4",orientation:"portrait",plugins:[...Efe,"pagesize"]},i6e={license_key:"gpl",skin:!1,content_css:["css/content.css","css/reset.css"],promotion:!1,menubar:_fe,cleanup:!0,branding:!1,language:"zh_CN",plugins:Efe,toolbar:r6e,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,toolbar_mode:"wrap",images_upload_handler:o=>new Promise((s,i)=>{const u=new FormData;u.append("files",o.blob(),o.filename()),fetch(`${process.env.NODE_ENV==="development"?"/api":""}/ajax/uploaddoc`,{method:"POST",body:u}).then(m=>m.json()).then(m=>{m.status===1?s(m.file_url):i(`上传失败: ${m.message}`)}).catch(m=>{i(`上传出错: ${m.message}`)})})},l6e={name:"ProEditor",components:{Editor:PMe},props:{modelValue:{type:String,default:""},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},hasPagesize:{type:Boolean,default:!1},placeholder:{type:String,default:"请输入内容"},width:{type:[Number,String],default:"100%"},height:{type:Number,default:400}},setup(o,{emit:s}){Em(o.modelValue);const i=d.ref(null),u=d.reactive({myInit:h(i6e),contentValue:o.modelValue,timeout:null});d.onMounted(()=>{Y6.init({license_key:"gpl"}),Y6.activeEditor.on("pagesizechange",b=>{(o==null?void 0:o.pagesize)!==b.size&&s("update:pagesize",b.size)}),Y6.activeEditor.on("orientationchange",b=>{(o==null?void 0:o.orientation)!==b.orientation&&s("update:orientation",b.orientation)})}),d.watch(()=>u.contentValue,()=>{m(()=>{s("update:modelValue",u.contentValue)})}),d.watch(()=>o.orientation,()=>{var b,C;i.value&&((C=(b=i.value)==null?void 0:b.getEditor)==null||C.call(b).fire("orientationchange",{orientation:o.orientation}))}),d.watch(()=>o.pagesize,()=>{var b,C;i.value&&((C=(b=i.value)==null?void 0:b.getEditor)==null||C.call(b).fire("pagesizechange",{size:o.pagesize}))}),d.watch(()=>o.modelValue,b=>{!uR(b)&&b!==u.contentValue&&(u.contentValue=b)}),d.watch(()=>o.height,b=>{var C,S,_,N,O,B,F,Z;i.value&&((Z=(N=(_=(S=(C=i.value)==null?void 0:C.getEditor)==null?void 0:S.call(C))==null?void 0:_.dom)==null?void 0:N.setStyle)==null||Z.call(N,(F=(B=(O=i.value)==null?void 0:O.getEditor)==null?void 0:B.call(O))==null?void 0:F.editorContainer,"height",b+"px"))});function m(b,C=400){u.timeout!==null&&clearTimeout(u.timeout),u.timeout=setTimeout(b,C)}function h(b){var N;o!=null&&o.height&&(b.height=o.height),o!=null&&o.width&&(b.width=o.width);const{placeholder:C,pagesize:S}=o,_=`${location==null?void 0:location.origin}/${uR(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath}`;return b={...b,content_css:(N=b==null?void 0:b.content_css)==null?void 0:N.map(O=>O.includes("http")?O:`${_}${O}`),placeholder:C,...o.hasPagesize?{...a6e,pagesize:S}:{}},b}return{...d.toRefs(u),editorRef:i,customer:h,debounce:m}}},c6e={class:"my-tinymce"};function u6e(o,s,i,u,m,h){const b=d.resolveComponent("Editor");return d.openBlock(),d.createElementBlock("div",c6e,[d.createVNode(b,{modelValue:o.contentValue,"onUpdate:modelValue":s[0]||(s[0]=C=>o.contentValue=C),init:o.myInit,ref:"editorRef"},null,8,["modelValue","init"])])}const kfe=mi(l6e,[["render",u6e]]),d6e={name:"ShadowDomWrap",setup(o,{emit:s,expose:i}){const u=d.ref(null),m=d.ref(),h=d.ref(!1),b=S=>{if(S.target.closest(".context-menu")||!u.value)return;const N=u.value.contains(S.target);!N&&h.value?(h.value=!1,s("onBlur")):N&&!h.value&&(h.value=!0,s("onFocus"))},C=S=>{h.value=!0,s("onFocus"),S.stopPropagation()};return d.onMounted(()=>{var O,B,F;m.value=(O=u.value)==null?void 0:O.attachShadow({mode:"open"}),document.addEventListener("click",b);const S=uR(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath,_=document.createElement("link");_.rel="stylesheet",_.href=`${location==null?void 0:location.origin}/${S}css/index.min.css`,(B=m.value)==null||B.appendChild(_);const N=document.createElement("link");N.rel="stylesheet",N.href=`${location==null?void 0:location.origin}/${S}css/reset.css`,(F=m.value)==null||F.appendChild(N)}),d.onUnmounted(()=>{document.removeEventListener("click",b)}),i({focus:()=>{h.value=!0}}),{shadowHost:u,shadowRoot:m,handleClick:C}}};function f6e(o,s,i,u,m,h){return d.openBlock(),d.createElementBlock("div",{ref:"shadowHost",class:"shadow-host",onClick:s[0]||(s[0]=d.withModifiers((...b)=>u.handleClick&&u.handleClick(...b),["stop"]))},[u.shadowRoot?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:u.shadowRoot},[d.renderSlot(o.$slots,"default")],8,["to"])):d.createCommentVNode("",!0)],512)}const $oe=mi(d6e,[["render",f6e]]),m6e=["innerHTML"],Tfe=d.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=d.useModel(o,"modelValue");return(i,u)=>(d.openBlock(),d.createBlock($oe,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,m6e)]),_:1}))}}),Afe=Symbol("nodesUI"),ef=()=>{const o=d.inject(Afe);if(!o)throw new Error("NodesUI context not found");return o};function Doe(o){if(!o||!o.ownerDocument)return null;const s=[];let i=o;for(;i&&i.nodeType===Node.ELEMENT_NODE;){let u=i.nodeName.toLowerCase();if(i.id){u=`#${CSS.escape(i.id)}`,s.unshift(u);break}if(i.className&&typeof i.className=="string"){const m=i.className.trim().split(/\s+/);m.length>0&&m[0]&&(u+=`.${CSS.escape(m[0])}`)}if(i.parentElement){const h=Array.from(i.parentElement.children).filter(b=>b.nodeName.toLowerCase()===i.nodeName.toLowerCase());if(h.length>1){const b=h.indexOf(i)+1;u+=`:nth-of-type(${b})`}}if(s.unshift(u),i=i.parentElement,i&&(i.nodeName.toLowerCase()==="body"||i.nodeName.toLowerCase()==="html"))break}return s.length?s.join(" > "):null}function p6e(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(`#${CSS.escape(o)}`)}catch(i){return console.error("nodePath query error:",i),null}}function Nfe(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const jA=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}`:""),Ofe=o=>{if(o.nodeType===Node.TEXT_NODE)return o;let s=null;for(let i=o.childNodes.length-1;i>=0;i--){const u=o.childNodes[i],m=Ofe(u);if(m){s=m;break}}return s},g6e=(o,s,i)=>{var u,m,h;if(!dR(o)){const b=i==null?void 0:i.getRootNode(),C=(u=b==null?void 0:b.getSelection)==null?void 0:u.call(b),S=Nfe(o.nodePath,i);if(C&&o.startOffset!==void 0&&s&&S){const _=document.createRange(),N=(o==null?void 0:o.textNodeIndex)||0,O=S.childNodes[N]||S;let B,F;if(O.nodeType===Node.TEXT_NODE)B=O,F=Math.min(o.startOffset,((m=O.textContent)==null?void 0:m.length)||0);else{const G=Ofe(O);G?(B=G,F=((h=G.textContent)==null?void 0:h.length)||0):(B=O,F=0)}_.setStart(B,F),_.setEnd(B,F);const Z=document.createElement("span");Z.classList.add("empty-text-node"),_.insertNode(Z),_.insertNode(s),_.setStartAfter(s),_.collapse(!0),C.removeAllRanges(),C.addRange(_)}}},h6e=(o,s)=>{s!=null&&s.id&&(o.id=s==null?void 0:s.id),(s==null?void 0:s.nodePath)!==void 0&&o.setAttribute("data-nodePath",s.nodePath),(s==null?void 0:s.textNodeIndex)!==void 0&&s.textNodeIndex>=0&&o.setAttribute("data-textNodeIndex",s.textNodeIndex.toString()),s.startOffset!==void 0&&s.startOffset>=0&&o.setAttribute("data-startOffset",s.startOffset.toString()),(s==null?void 0:s.subNodeSort)!==void 0&&s.subNodeSort>=0&&o.setAttribute("data-subNodeSort",s.subNodeSort.toString()),(s==null?void 0:s.groupKey)!==void 0&&o.setAttribute("data-groupKey",s.groupKey)},v6e=o=>{const s=o.parentNode;if(!s)return-1;let i=0;for(let u=0;u<s.childNodes.length;u++){const m=s.childNodes[u];if(m===o)return i;i++,m.nodeType===Node.ELEMENT_NODE&&(m.classList.contains("node-item")&&(i-=2,i<0&&(i=0)),m.classList.contains("empty-text-node")&&(i-=1,i<0&&(i=0)))}return-1},b6e=o=>{const s=o.closest("TD"),i=o.closest(".node-item");let u=null;if(i?u=i:s&&s.classList.contains("node-item-td")&&(u=s),!u)return null;const m=u||o;let h=m==null?void 0:m.getAttribute("data-nodePath");if(h||(h=Doe(m)),(m==null?void 0:m.getAttribute("selectable"))==="false")return null;const b={element:m,nodePath:h},C=m==null?void 0:m.getAttribute("data-textNodeIndex");C&&(b.textNodeIndex=Number(C));const S=m==null?void 0:m.getAttribute("data-startOffset");S&&(b.startOffset=Number(S));const _=m==null?void 0:m.getAttribute("data-subNodeSort");_&&(b.subNodeSort=Number(_));const N=m==null?void 0:m.getAttribute("data-groupKey");N&&(b.groupKey=N);const O=m==null?void 0:m.getAttribute("id");return O&&(b.id=O),b},$fe=o=>Axe(o,s=>d.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),Mz=(o,s)=>{const i=o.startsWith("#")?o.slice(1):o;let u,m,h;if(i.length===3)u=parseInt(i[0]+i[0],16),m=parseInt(i[1]+i[1],16),h=parseInt(i[2]+i[2],16);else if(i.length===6)u=parseInt(i.substring(0,2),16),m=parseInt(i.substring(2,4),16),h=parseInt(i.substring(4,6),16);else return console.warn("Invalid color format:",o),`rgba(0, 0, 0, ${s})`;return`rgba(${u}, ${m}, ${h}, ${s})`},y6e=o=>{var _;const{element:s}=o;if(!s)return null;if(s.tagName.toLowerCase()!=="td")return{showTextType:"input"};const u=s.closest("tr"),m=Array.from(u.parentElement.children).indexOf(u),h=Array.from(u.children).indexOf(s),b=s.closest("table"),C=((_=s.closest("body"))==null?void 0:_.querySelectorAll("table"))||[];return{showTextType:"cell",tableIndex:Array.from(C).indexOf(b)+1,colIndex:h,rowIndex:m}},w6e=(o,s)=>{var m,h;let i=1;const u=(m=o==null?void 0:o.map(b=>s==null?void 0:s.find(C=>(C==null?void 0:C.id)===(b==null?void 0:b.id))))==null?void 0:m.filter(Boolean);return(u==null?void 0:u.length)>0?(h=u==null?void 0:u.map(C=>{const S=y6e(C);return S?(S==null?void 0:S.showTextType)==="input"?{...C,...S,inputIndex:i++}:{...C,...S}:null}))==null?void 0:h.filter(Boolean):[]};function C6e(o){if(!o||o.length===0)return[];const s=[...o].sort((m,h)=>m.rowIndex!==h.rowIndex?m.rowIndex-h.rowIndex:m.colIndex-h.colIndex),i=[],u=new Set;for(const m of s){if(u.has(m))continue;const h=[];let b=0,C=0;for(let S=m.colIndex;s.find(N=>N.rowIndex===m.rowIndex&&N.colIndex===S&&!u.has(N));S++)C++;if(C!==0){b=C;for(let S=m.rowIndex;;S++){let _=0;const N=[];for(let O=m.colIndex;O<m.colIndex+b;O++){const B=s.find(F=>F.rowIndex===S&&F.colIndex===O&&!u.has(F));if(B)_++,N.push(B);else break}if(_===b)h.push(...N);else break}h.length>0&&(i.push([...h]),h.forEach(S=>u.add(S)))}}return i}function S6e(o){if(!o||o.length===0)return{min:null,max:null};let s=o[0],i=o[0];for(const u of o)(u.colIndex<s.colIndex||u.colIndex===s.colIndex&&u.rowIndex<s.rowIndex)&&(s=u),(u.colIndex>i.colIndex||u.colIndex===i.colIndex&&u.rowIndex>i.rowIndex)&&(i=u);return{min:s,max:i}}const Dfe=(o,s)=>{var _;const i=w6e(o,s||[]),u=[],m=[];(_=d.toValue(i))==null||_.forEach(N=>{(N==null?void 0:N.showTextType)==="input"?u.push(N):m.push(N)});const h=$xe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=pde(b==null?void 0:b.map(N=>C6e(N==null?void 0:N.nodes))),S=(C==null?void 0:C.map(N=>S6e(N)))||[];return[...u,...S]},r4=o=>{function s(i){let u="";for(;i>=0;)u=String.fromCharCode(65+i%26)+u,i=Math.floor(i/26)-1;return u}return(o==null?void 0:o.colIndex)>=0&&(o==null?void 0:o.rowIndex)>=0?`${s(o==null?void 0:o.colIndex)}${o==null?void 0:o.rowIndex}`:""},x6e=(o,s)=>{const i=Dfe(o,s||[]),u=[];return i==null||i.forEach(m=>{var h,b;(m==null?void 0:m.showTextType)==="input"?u.push(`填写${m==null?void 0:m.inputIndex}`):u.push(((h=m==null?void 0:m.min)==null?void 0:h.id)===((b=m==null?void 0:m.max)==null?void 0:b.id)?r4(m==null?void 0:m.min):`${r4(m==null?void 0:m.min)}:${r4(m==null?void 0:m.max)}`)}),u==null?void 0:u.join(",")},dR=o=>o.startOffset===void 0&&o.textNodeIndex===void 0,E6e=o=>{var s;if(o.innerHTML===" "&&(o.innerHTML=""),((s=o.textContent)==null?void 0:s.trim())===""&&o.querySelector("p")){const i=o.querySelector("p");if(i){const u=O=>{const B={};return O&&O.split(";").forEach(F=>{const[Z,G]=F.split(":").map(Y=>Y.trim());Z&&G&&(B[Z]=G)}),B},m=O=>Object.entries(O).map(([B,F])=>`${B}: ${F}`).join("; "),h=u(o.getAttribute("style")||""),b=u(i.getAttribute("style")||""),C=i.querySelectorAll("span");let S={};C.forEach(O=>{const B=u(O.getAttribute("style")||"");S={...S,...B}});const _={...h,...b,...S},N=m(_);N&&o.setAttribute("style",N),o.removeChild(i)}}},_6e=o=>{var i;return(i=ga(o))==null?void 0:i.map(u=>(u==null||delete u.element,u))},k6e=o=>{o.querySelectorAll("p").forEach(i=>{var u;i.classList.contains("empty")&&i.classList.remove("empty"),((u=i.innerText)==null?void 0:u.trim())===""&&i.classList.add("empty")})},T6e={key:0,class:"td-node"},A6e={key:1},N6e=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,i=d.computed(()=>{var m,h,b,C,S;return(h=(m=s==null?void 0:s.node)==null?void 0:m.props)!=null&&h.alias?(C=(b=s==null?void 0:s.node)==null?void 0:b.props)==null?void 0:C.alias:(S=s==null?void 0:s.node)==null?void 0:S.label}),u=d.computed(()=>{var m,h;return((h=(m=s==null?void 0:s.node)==null?void 0:m.element)==null?void 0:h.tagName)==="TD"});return(m,h)=>u.value?(d.openBlock(),d.createElementBlock("span",T6e,d.toDisplayString(i.value),1)):(d.openBlock(),d.createElementBlock("span",A6e,d.toDisplayString(i.value),1))}}),Mfe=Symbol("nodesEditor"),U0=()=>{const o=d.inject(Mfe);if(!o)throw new Error("NodesEditor context not found");return o},$U=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=ef(),{nodes:u,renderType:m,disabledNodes:h}=U0(),b=d.computed(()=>{var O;return(O=s.node)!=null&&O.id?u.value.some(B=>B.id===s.node.id):!1}),C=d.computed(()=>{var O;if(!((O=s.node)!=null&&O.element))return!1;try{return s.node.element.parentNode!==null}catch(B){return console.warn("Element validation failed:",B),!1}}),S=d.computed(()=>{var F,Z;const O=(F=h==null?void 0:h.value)==null?void 0:F.some(G=>{var Y;return(G==null?void 0:G.id)===((Y=s==null?void 0:s.node)==null?void 0:Y.id)}),B=(Z=d.toValue(i))==null?void 0:Z.find(G=>{var Y;return(G==null?void 0:G.id)===((Y=s==null?void 0:s.node)==null?void 0:Y.id)});return{...s==null?void 0:s.node,...B,disabled:O}}),_=O=>{var F;let B="";if(d.toValue(O==null?void 0:O.activated)&&(B="normal"),O!=null&&O.disabled&&(B="disabled"),(F=s==null?void 0:s.node)!=null&&F.element)switch(B){case"normal":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",Mz((O==null?void 0:O.color)||"#409eff",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("activated");break;case"disabled":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#F56C6C"),s.node.element.style.setProperty("--node-bg-color",Mz((O==null?void 0:O.color)||"#F56C6C",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("disabled");break;default:N();break}},N=()=>{var O,B,F,Z,G;(O=s==null?void 0:s.node)!=null&&O.element&&((B=s.node.element)==null||B.removeAttribute("data-dataGroupKey"),(F=s.node.element)==null||F.removeAttribute("selectable"),(Z=s.node.element)==null||Z.classList.remove("activated"),(G=s.node.element)==null||G.classList.remove("disabled"))};return d.watch(()=>S,()=>{const O=d.toValue(S);O!=null&&O.id?_(O):N()},{immediate:!0,deep:!0}),(O,B)=>{var F;return(F=O.node)!=null&&F.element&&C.value&&b.value?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:O.node.element},[d.createElementVNode("div",{class:d.normalizeClass(["node-item-render",`node-item-${d.unref(m)}`])},[d.renderSlot(O.$slots,"default",{node:O.node},()=>[d.createVNode(N6e,{node:O.node},null,8,["node"])])],2)],8,["to"])):d.createCommentVNode("",!0)}}});function O6e(){const o=d.ref(!1),s=u=>{u.key==="Control"&&(o.value=!0)},i=u=>{u.key==="Control"&&(o.value=!1)};return d.onMounted(()=>{window.addEventListener("keydown",s),window.addEventListener("keyup",i)}),d.onUnmounted(()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",i)}),o}function Rfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i}=ef(),{editorId:u,nodes:m}=U0(),h=d.ref(!1),b=d.ref({x:0,y:0}),C=d.ref({x:0,y:0}),S=d.ref({left:0,top:0,width:0,height:0}),_=d.ref(null),N=_e=>{const Q=_e.closest(".node-item-td")||_e.closest(".node-item");if(Q!==null){let Fe=[];if(Q.classList.contains("node-selected"))return;const lt=Q.getAttribute("id");if(lt&&m.value){const nt=m.value.find($e=>$e.id===lt);nt&&(Fe=[nt])}Fe=W(Fe),s(Fe)}},O=_e=>{var nt;if(_e.button===2&&N(_e==null?void 0:_e.target),_e.button!==0||(h.value=!0,!_.value))return;const Q=(nt=i==null?void 0:i.value)==null?void 0:nt.getBoundingClientRect();if(!Q)return;const Fe=_e.clientX-(Q==null?void 0:Q.left),lt=_e.clientY-(Q==null?void 0:Q.top);b.value={x:Fe,y:lt},C.value={x:Fe,y:lt},Y(_e),L(),_.value.style.display="block",window.addEventListener("mousemove",B),window.addEventListener("wheel",F),window.addEventListener("mouseup",Z)},B=cte(_e=>{var Q;if(h.value){const Fe=(Q=i==null?void 0:i.value)==null?void 0:Q.getBoundingClientRect();if(!Fe)return;const lt=_e.clientX-(Fe==null?void 0:Fe.left),nt=_e.clientY-(Fe==null?void 0:Fe.top);C.value={x:lt,y:nt},L()}},16),F=cte(_e=>{h.value&&setTimeout(()=>{var nt;const Q=(nt=i==null?void 0:i.value)==null?void 0:nt.getBoundingClientRect();if(!Q)return;const Fe=_e.clientX-(Q==null?void 0:Q.left),lt=_e.clientY-(Q==null?void 0:Q.top);C.value={x:Fe,y:lt},L()},0)},16),Z=_e=>{_e.button===0&&(h.value=!1,_.value&&(L(),_.value.style.display="none",window.removeEventListener("mousemove",B),window.removeEventListener("wheel",F),window.removeEventListener("mouseup",Z)))},G=O6e(),Y=_e=>{var Fe,lt;let Q=[];if(_e.button===0&&(_e!=null&&_e.target)){const nt=((Fe=_e==null?void 0:_e.target)==null?void 0:Fe.closest(".node-item-td"))||((lt=_e==null?void 0:_e.target)==null?void 0:lt.closest(".node-item"));if(nt!==null){const $e=nt.getAttribute("id");if($e&&m.value){const ue=m.value.find(Nt=>Nt.id===$e);ue&&(G.value?o.value.some(Nt=>jA(Nt)===jA(ue))?Q=o.value.filter(ge=>jA(ge)!==jA(ue)):Q=[...o.value,ue]:ue&&(Q=[ue]))}}Q=W(Q),s(Q)}},q=()=>{var ue;if(!i.value||!(S.value.width>3||S.value.height>3))return;let _e=[];const Q=(ue=i==null?void 0:i.value)==null?void 0:ue.getBoundingClientRect(),Fe=S.value.left+(Q==null?void 0:Q.left),lt=S.value.top+(Q==null?void 0:Q.top),nt={left:S.value.left+(Q==null?void 0:Q.left),right:Fe+S.value.width,top:S.value.top+(Q==null?void 0:Q.top),bottom:lt+S.value.height};if(i.value.querySelectorAll("*").forEach(Nt=>{const ge=Nt.getBoundingClientRect();if(!nt)return;const Oe={left:ge.left,right:ge.right,top:ge.top,bottom:ge.bottom};if(Oe.right>nt.left&&Oe.left<nt.right&&Oe.bottom>nt.top&&Oe.top<nt.bottom){const R=Nt.getAttribute("id");if(R&&m.value){const je=m.value.find(ye=>ye.id===R);je&&(_e=[..._e,je])}}}),_e=W(_e),G.value){const Nt=new Set(o.value.map(Oe=>jA(Oe))),ge=_e.filter(Oe=>!Nt.has(jA(Oe)));s([...o.value,...ge])}else s(_e)},W=_e=>_e,L=cte(()=>{if(!_.value||!i.value)return;const{x:_e,y:Q}=b.value,{x:Fe,y:lt}=C.value,nt=Math.min(_e,Fe),$e=Math.min(Q,lt),ue=Math.abs(_e-Fe),Nt=Math.abs(Q-lt);S.value={left:nt,top:$e,width:ue,height:Nt}},16),me=_e=>{if(!_.value)return;const{left:Q,top:Fe,width:lt,height:nt}=d.toValue(_e);_.value.style.left=`${Q}px`,_.value.style.top=`${Fe}px`,_.value.style.width=`${lt}px`,_.value.style.height=`${nt}px`},Ze=()=>{if(!i.value)return;i.value.addEventListener("mousedown",O);const _e=document.getElementById(`select_area_${u}`);if(_e){_.value=_e;return}const Q=document.createElement("div");Q.id=`select_area_${u}`,Q.style.position="absolute",Q.style.border="1px solid #1677ff",Q.style.backgroundColor="rgba(22, 119, 255, 0.05)",Q.style.pointerEvents="none",Q.style.display="none",i.value.appendChild(Q),_.value=Q};return d.watch(S,(_e,Q)=>{ha(_e,Q)||(me(_e),h.value&&q())},{deep:!0}),d.watch(()=>i.value,_e=>{d.toValue(_e)&&Ze()},{immediate:!0}),d.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",O)}),{isSelecting:h,selectionBox:_}}function Moe(){const{selectedNodes:o,containerRef:s}=ef(),i=()=>{var m;(m=d.toValue(s))==null||m.querySelectorAll(".node-selected").forEach(h=>{h.classList.remove("node-selected")})},u=m=>{m.forEach(h=>{h.classList.add("node-selected")})};d.watch(()=>o,()=>{i(),setTimeout(()=>{var h,b;const m=(b=(h=d.toValue(o))==null?void 0:h.map(C=>{var S;return(S=s.value)==null?void 0:S.querySelector(`[id="${C.id}"]`)}))==null?void 0:b.filter(Boolean);u(m)},0)},{deep:!0})}const IR=()=>{const{nodes:o,updateNodes:s,inputTypes:i}=U0();return{nodes:o,addNode:S=>{const N=(Array.isArray(S)?S:[S]).map(B=>({...B,id:B.id||m2()})),O=[...o.value,...N];s(O)},removeNode:async S=>{var Z,G;const _=Array.isArray(S)?S:[S],N=[],O=[];_.forEach(Y=>{const q=o.value.find(W=>(W==null?void 0:W.id)===Y);dR(q)?N.push(Y):O.push(Y)});const B=await((G=(Z=i==null?void 0:i.find(Y=>{var q;return((q=Y.value)==null?void 0:q.toLowerCase())==="text"}))==null?void 0:Z.getDefaultProps)==null?void 0:G.call(Z))||{};let F=o.value.filter(Y=>!O.includes(Y==null?void 0:Y.id));F=F==null?void 0:F.map(Y=>N.includes(Y==null?void 0:Y.id)?{id:Y==null?void 0:Y.id,nodePath:Y==null?void 0:Y.nodePath,label:"文本",nodeType:"text",props:{...B}}:Y),s(F)},editNodes:S=>{const _=Array.isArray(S)?S:[S],N=m2(),O=_.map(F=>{const Z={...F};let G=F==null?void 0:F.id;return G||(G=m2(),Z.id=G),Z!=null&&Z.groupKey||(Z.groupKey=N),Z}),B=[...o.value];O.forEach(F=>{const Z=B.findIndex(G=>G.id===F.id);Z!==-1?B[Z]=F:B.push(F)}),s(B)},insertNodeAt:(S,_)=>{const N=[...o.value];N.splice(_,0,S),s(N)},moveNode:(S,_)=>{const N=[...o.value],[O]=N.splice(S,1);N.splice(_,0,O),s(N)},updateNodes:s}};function $6e(){const{removeNode:o}=IR(),{containerRef:s}=ef(),i=d.ref(null),u=h=>{var G,Y;if(h.target instanceof Element&&(h.target.closest(".node-item")||h.target.closest(".node-item-td")||h.target.closest(".disabeld-edit")))return;const b=h.target;if(b===s.value)return;const S=((G=s.value)==null?void 0:G.getRootNode()).getSelection(),_=(Y=s.value)==null?void 0:Y.querySelectorAll('[contenteditable="true"]');_==null||_.forEach(q=>{q.setAttribute("contenteditable","false")});const N=b.textContent||"",O=b.innerHTML||"";i.value=b,b.setAttribute("contenteditable","true"),b.focus();const B=new MutationObserver(()=>{b.textContent!==N&&(b.innerHTML=O)});B.observe(b,{characterData:!0,childList:!0,subtree:!0});const F=q=>{q.preventDefault()};b.addEventListener("input",F),b.addEventListener("paste",F),b.addEventListener("drop",F),b.addEventListener("keydown",q=>{var W,L,me,Ze;if(((W=document.activeElement)==null?void 0:W.shadowRoot)===((L=s.value)==null?void 0:L.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(q.key)){if(q.key==="Backspace"||q.key==="Delete"){const _e=S==null?void 0:S.getRangeAt(0);if(b.blur(),(_e==null?void 0:_e.startOffset)===0){const Q=_e.startContainer;if(Q.nodeType===Node.TEXT_NODE){const Fe=Q.previousSibling;if(Fe&&Fe.nodeType===Node.ELEMENT_NODE&&Fe.classList.contains("node-item")){const lt=Fe.getAttribute("id");lt&&o(lt),(me=Q.parentElement)==null||me.normalize();return}}else if(Q.nodeType===Node.ELEMENT_NODE){const Fe=Q.previousSibling;if(Fe&&Fe.nodeType===Node.ELEMENT_NODE&&Fe.classList.contains("node-item")){const lt=Fe.getAttribute("id");lt&&o(lt),(Ze=Q.parentElement)==null||Ze.normalize();return}}}}q.preventDefault()}});const Z=()=>{b==null||b.normalize(),B.disconnect(),b.removeEventListener("input",F),b.removeEventListener("paste",F),b.removeEventListener("drop",F),b.removeEventListener("blur",Z),b.setAttribute("contenteditable","false")};b.addEventListener("blur",Z)},m=()=>{var h;(h=s.value)==null||h.addEventListener("dblclick",u)};return d.watch(s,h=>{h&&m()},{immediate:!0}),d.onUnmounted(()=>{var h;(h=s.value)==null||h.removeEventListener("dblclick",u)}),{}}function D6e(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=ef(),h=_=>{var O,B;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const F=N.getRangeAt(0);u.value=v6e(F.startContainer);const Z=F.startOffset,G=(B=s.value)==null?void 0:B.querySelectorAll(".node-item");let Y=0;return m.value=0,G==null||G.forEach(q=>{const W=document.createRange();if(W.selectNode(q),W.comparePoint(F.startContainer,Z)>=0){m.value+=1;const L=q.getAttribute("data-startOffset");Number(L)>Y&&(Y=Number(L))}}),Y+Z}}catch{}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var F;const N=_.target;if(N===o.value)return;s.value=N;const O=(F=o.value)==null?void 0:F.getRootNode();i.value=h(O),N.addEventListener("click",b),N.addEventListener("keyup",Z=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(Z.key)&&b()});const B=()=>{N.removeEventListener("click",b),N.removeEventListener("keyup",b),N.removeEventListener("blur",B),setTimeout(()=>{s.value=null,u.value=0,i.value=-1},300)};N.addEventListener("blur",B)},S=()=>{var _;(_=o.value)==null||_.addEventListener("focus",C,!0)};return d.watch(o,_=>{_&&S()},{immediate:!0}),d.onUnmounted(()=>{var _;(_=o.value)==null||_.removeEventListener("focus",C,!0)}),{focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}}function M6e(o){const s=o.value===null?[]:[JSON.parse(JSON.stringify(o.value))],i=d.ref(s),u=d.ref(0),m=d.ref(!1),h=d.computed(()=>i.value[u.value]),b=()=>{u.value>0&&(m.value=!0,u.value--,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},C=()=>{u.value<i.value.length-1&&(m.value=!0,u.value++,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},S=_=>{(_.ctrlKey||_.metaKey)&&_.key==="z"?(_.preventDefault(),b()):(_.ctrlKey||_.metaKey)&&_.key==="y"&&(_.preventDefault(),C())};return d.onMounted(()=>{window.addEventListener("keydown",S)}),d.onUnmounted(()=>{window.removeEventListener("keydown",S)}),d.watch(o,d2(_=>{_&&!m.value&&(i.value.splice(u.value+1),i.value.push(JSON.parse(JSON.stringify(_))),u.value++),m.value&&(m.value=!1)},300),{deep:!0}),{current:h,undo:b,redo:C}}function R6e(){const{modelValue:o,inputTypes:s}=U0(),{nodes:i,updateNodes:u}=IR(),m=b=>{if(!b||typeof b!="string")return[];const S=new DOMParser().parseFromString(b,"text/html");return Array.from(S.querySelectorAll("td")).filter(O=>{var B;return!((B=O.textContent)!=null&&B.trim())})},h=async b=>{var _,N;const C=await((N=(_=s==null?void 0:s.find(O=>{var B;return((B=O.value)==null?void 0:B.toLowerCase())==="text"}))==null?void 0:_.getDefaultProps)==null?void 0:N.call(_))||{},S=b.map(O=>{let B=O==null?void 0:O.id;return B||(B=m2()),{id:B,nodeType:"Text",label:"文本",props:{...C},...O}});u(S)};d.onMounted(()=>{var B;const b=m(d.toValue(o)),C=d.toValue(i),S=C.filter(F=>dR(F)),_=C.filter(F=>!dR(F)),O=[...(B=b.map(F=>({nodePath:Doe(F)})))==null?void 0:B.map(F=>{const Z=S==null?void 0:S.find(G=>G.nodePath===F.nodePath);return{...F,...Z}}),..._];h(O)})}function B6e(){const{selectedNodes:o,containerRef:s,isFocused:i}=ef(),{removeNode:u}=IR(),m=d.ref(null),h=S=>{if(i.value&&(S.key==="Delete"||S.key==="Backspace")){let _=[];S.preventDefault(),d.toValue(o).length>0&&(d.toValue(o).forEach(N=>{var O,B,F;if(((O=N==null?void 0:N.element)==null?void 0:O.tagName)==="TD"){const Z=(B=N==null?void 0:N.element)==null?void 0:B.getAttribute("id");Z&&_.push(Z)}else{const Z=(F=N==null?void 0:N.element)==null?void 0:F.getAttribute("id");Z&&_.push(Z)}}),o.value=[],(_==null?void 0:_.length)>0&&u(_))}},b=S=>{var _;(_=d.toValue(s))!=null&&_.contains(S.target)?m.value=S.target:m.value=null},C=()=>{s.value&&(window.addEventListener("keydown",h),s.value.addEventListener("mousedown",b))};d.watch(()=>s.value,S=>{d.toValue(S)&&C()},{immediate:!0}),d.onUnmounted(()=>{s.value&&(window.removeEventListener("keydown",h),s.value.removeEventListener("mousedown",b))})}function DU(){const{nodes:o}=U0(),{containerRef:s,renderNodes:i,uiReady:u}=ef(),{removeNode:m}=IR(),h=()=>{var C;i.value=[...((C=o.value)==null?void 0:C.map(S=>{var N;const _=(N=s.value)==null?void 0:N.querySelector(`[id="${S.id}"]`);return{...S,element:_}}))||[]].filter(S=>!!(S!=null&&S.element))},b=d2(C=>{d.nextTick(()=>{var S;m((S=C==null?void 0:C.map(_=>_==null?void 0:_.id))==null?void 0:S.filter(Boolean))})},500);d.watch(()=>[i.value,u],()=>{if(d.toValue(u)){const C=kxe(o.value,i.value,"id");b(C)}},{immediate:!0,deep:!0}),d.watch(()=>[o.value,s.value,u],()=>{d.toValue(u)&&d.nextTick(()=>{h()})},{immediate:!0,deep:!0})}const bne=d.ref({});function MU(o){return d.computed(()=>{var s;return(s=bne.value)==null?void 0:s[o]})}function Roe(){const o=U0(),s=ef();d.onMounted(()=>{const{editorId:i}=o;i&&(bne.value[i]=d.ref({...o,...s}))}),d.onUnmounted(()=>{const{editorId:i}=o;i&&(bne.value[i]=null)})}const I6e=d.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"edit"}},setup(o){const{nodes:s}=U0(),{uiReady:i,renderNodes:u}=ef();return Roe(),M6e(s),Rfe(),Moe(),B6e(),D6e(),$6e(),R6e(),DU(),(m,h)=>d.unref(i)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(u),b=>(d.openBlock(),d.createBlock($U,{key:b==null?void 0:b.id,node:b},{default:d.withCtx(C=>[d.renderSlot(m.$slots,"nodeItem",{node:C==null?void 0:C.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),lle=d.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return Roe(),DU(),Moe(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock($U,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),P6e=d.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return DU(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock($U,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),F6e=d.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"select"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return Roe(),Rfe(),Moe(),DU(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock($U,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),l2=d.ref({});function Bfe(o){return d.computed(()=>(l2.value[o]||(l2.value[o]=d.ref([])),l2.value[o]))}function L6e(o){const{editorId:s}=o,i=d.ref(!1);d.onMounted(()=>{l2.value[s]||(l2.value[s]=d.ref([]));const u=l2.value[s].findIndex(m=>m.id===o.id);u!==-1&&l2.value[s].splice(u,1),i.value=!0,l2.value[s].push({...o,isMounted:i})}),d.onUnmounted(()=>{i.value=!1})}const V6e=d.defineComponent({__name:"NodesProvider",props:d.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},renderType:{type:String,default:"preview"},inputTypes:{type:Array,default:()=>[]},editorId:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]}},{formData:{},formDataModifiers:{},nodes:{},nodesModifiers:{}}),emits:["update:formData","update:nodes"],setup(o){const s=o,i=d.useModel(o,"formData"),u=d.useModel(o,"nodes"),m=d.computed(()=>s.modelValue),h=Bfe(s==null?void 0:s.editorId),b=d.computed(()=>{var O,B,F;const N=[...$fe(((F=(B=(O=d.toValue(h))==null?void 0:O.filter(Z=>d.toValue(Z==null?void 0:Z.activated)))==null?void 0:B.filter(Z=>d.toValue(Z.isMounted)))==null?void 0:F.filter(Z=>d.toValue(Z==null?void 0:Z.isOccupy)))||[]),...s.disabledNodes||[]];return qxe(N,"id")}),C=d.computed(()=>d.toValue(s.renderType)),S=_=>{ha(u.value,_)||(u.value=_)};return d.provide(Mfe,{modelValue:m,renderType:C,inputTypes:s.inputTypes,editorId:s==null?void 0:s.editorId,nodes:u,disabledNodes:b,updateNodes:S,formData:i}),(_,N)=>d.renderSlot(_.$slots,"default")}}),H6e=d.defineComponent({__name:"NodesUIProvider",props:{nodes:{type:Array,default:()=>[]},selectedNodes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},editorId:{type:String,default:""},htmlRenderRef:{type:Object,default:()=>{}}},emits:["onSelectedNodes","update:selectedNodes"],setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.ref(null),b=d.ref(null),C=d.ref([]),S=d.ref(null),_=d.ref(-1),N=d.ref(0),O=d.ref(0),B=Bfe(u==null?void 0:u.editorId),F=d.ref(!1),Z=d.ref(!1),G=d.computed(()=>u.htmlRenderRef),Y=d.computed({get:()=>(u.selectedNodes||[]).map(Ze=>{var Fe;let _e=(Fe=u==null?void 0:u.nodes)==null?void 0:Fe.find(lt=>(lt==null?void 0:lt.id)===(Ze==null?void 0:Ze.id)),Q=Ze!=null&&Ze.element?Ze==null?void 0:Ze.element:p6e(Ze==null?void 0:Ze.id,h.value);return{..._e||{},...Ze,element:Q}}),set:Ze=>{const _e=Ze.map(({element:Q,...Fe})=>{var nt;return{...((nt=u==null?void 0:u.nodes)==null?void 0:nt.find($e=>($e==null?void 0:$e.id)===(Fe==null?void 0:Fe.id)))||{},...Fe}});m("update:selectedNodes",_e)}}),q=d.computed(()=>{var Q,Fe,lt;const Ze=(Fe=(Q=d.toValue(B))==null?void 0:Q.filter(nt=>d.toValue(nt==null?void 0:nt.activated)))==null?void 0:Fe.filter(nt=>d.toValue(nt.isMounted)),_e=((lt=d.toValue(u==null?void 0:u.nodesGroups)||[])==null?void 0:lt.map(nt=>({...nt||{},activated:!0})))||[];return $fe([..._e,...Ze])}),W=d.ref([]),L=Ze=>{var Fe;const _e=Ze.map(({...lt})=>{var Nt;let nt=(Nt=C.value)==null?void 0:Nt.find(ge=>(ge==null?void 0:ge.id)===(lt==null?void 0:lt.id));const{element:$e,...ue}={...nt||{},...lt};return ue}),Q=(Fe=Y.value)==null?void 0:Fe.map(({element:lt,...nt})=>nt);ha(_e,Q)||(Y.value=_e,m("onSelectedNodes",_e))},me=d.computed(()=>d.toValue(u==null?void 0:u.nodesGroups));return s({setSelectedNodes:L}),d.provide(Afe,{containerRef:h,htmlRenderRef:G,contextMenuRef:b,focusedElement:S,currentRenderNodes:W,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:q,selectedNodes:Y,setSelectedNodes:L,renderNodes:C,uiReady:F,isFocused:Z,nodesGroups:me}),(Ze,_e)=>d.renderSlot(Ze.$slots,"default")}}),z6e=["onClick"],U6e={key:0,class:"icon"},j6e={key:1,class:"arrow"},W6e=["onClick"],Z6e={key:0,class:"icon"},G6e=d.defineComponent({__name:"index",props:d.mergeModels({style:{},direction:{}},{show:{},showModifiers:{}}),emits:d.mergeModels(["select"],["update:show"]),setup(o,{emit:s}){const{contextMenuRef:i,selectedNodes:u,setSelectedNodes:m,focusedElement:h,cursorPosition:b,focusedNodeIndex:C,preNodeNumber:S}=ef(),{inputTypes:_}=U0(),N=d.useModel(o,"show"),{editNodes:O}=IR(),B=async Y=>{var q,W;if(d.toValue(h)&&!Bxe(d.toValue(b))){const L=Doe(d.toValue(h)),me=d.toValue(b),Ze=(d.toValue(S)||0)+1,_e=b6e(d.toValue(h));if(L&&!uR(me)&&me>=0){const Q=await((q=Y==null?void 0:Y.getDefaultProps)==null?void 0:q.call(Y))||{};O({..._e,label:Y==null?void 0:Y.label,nodePath:L,startOffset:me,subNodeSort:Ze,textNodeIndex:d.toValue(C)||0,nodeType:Y==null?void 0:Y.value,props:Q})}}else if(u){const L=d.toValue(u);if(L!=null&&L.length){const me=await((W=Y==null?void 0:Y.getDefaultProps)==null?void 0:W.call(Y))||{},Ze=L==null?void 0:L.map(_e=>({..._e,label:Y==null?void 0:Y.label,element:_e==null?void 0:_e.element,nodePath:_e==null?void 0:_e.nodePath,nodeType:Y==null?void 0:Y.value,props:me}));O(Ze),m(Ze)}}N.value=!1},F=d.computed(()=>{const Y=[],q=[];return d.toValue(_).forEach(W=>{W.groupName==="system"?q.push({...W,handler:()=>{B(W)}}):Y.push({...W,handler:()=>{B(W)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:Y},{label:"插入记录标识",icon:"i-bi:flag",children:q}].filter(W=>{var L;return(L=W==null?void 0:W.children)==null?void 0:L.length})}),Z=s,G=(Y,q)=>{Y.preventDefault(),q!=null&&q.handler&&q.handler(),q!=null&&q.value&&Z("select",q==null?void 0:q.value)};return(Y,q)=>d.withDirectives((d.openBlock(),d.createElementBlock("div",{class:"context-menu",style:d.normalizeStyle({...Y.style}),ref_key:"contextMenuRef",ref:i},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(F.value,W=>(d.openBlock(),d.createElementBlock("div",{key:W==null?void 0:W.label,class:"menu-item"},[d.createElementVNode("div",{class:"menu-item-content",onClick:L=>G(L,W)},[W!=null&&W.icon?(d.openBlock(),d.createElementBlock("div",U6e,[d.createElementVNode("div",{class:d.normalizeClass(W==null?void 0:W.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(W.label)+" ",1),W!=null&&W.children?(d.openBlock(),d.createElementBlock("span",j6e,"›")):d.createCommentVNode("",!0)],8,z6e),W!=null&&W.children?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["submenu",{"submenu-bottom":Y.direction==="bottom"}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(W.children,L=>(d.openBlock(),d.createElementBlock("div",{key:L.action,class:"menu-item",onClick:me=>G(me,L)},[L!=null&&L.icon?(d.openBlock(),d.createElementBlock("div",Z6e,[d.createElementVNode("div",{class:d.normalizeClass(L==null?void 0:L.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(L.label),1)],8,W6e))),128))],2)):d.createCommentVNode("",!0)]))),128))],4)),[[d.vShow,N.value]])}}),q6e=mi(G6e,[["__scopeId","data-v-36fcd36c"]]);function Y6e(o){const{headerHeight:s}=o,i=d.ref(!1),u=d.ref("top"),{contextMenuRef:m}=ef(),h=d.ref({left:"0px",top:"0px"}),b=S=>{S.preventDefault(),i.value=!0,d.nextTick(()=>{const N=S.currentTarget.getBoundingClientRect(),O=S.clientX-N.left,B=S.clientY-N.top,F=m==null?void 0:m.value,Z=F==null?void 0:F.offsetWidth,G=F==null?void 0:F.offsetHeight,Y=N.width-O<Z,q=N.height-B<G,W=Array.from((F==null?void 0:F.querySelectorAll(".submenu"))||[]).reduce((L,me)=>Math.max(L,me.offsetHeight||0),0);N.height-B<W?u.value="bottom":u.value="top",h.value={left:Y?`${O-Z}px`:`${O}px`,top:q?`${B-G+d.toValue(s)}px`:`${B+d.toValue(s)}px`}})},C=S=>{const _=document.querySelector(".context-menu");_&&!_.contains(S.target)&&(i.value=!1)};return d.onMounted(()=>{document.addEventListener("mousedown",C)}),d.onUnmounted(()=>{document.removeEventListener("mousedown",C)}),{showContextMenu:i,contextMenuStyle:h,contextMenuRef:m,onContextMenu:b,closeContextMenu:C,direction:u}}function Ife(o){return{all:o=o||new Map,on:function(s,i){var u=o.get(s);u?u.push(i):o.set(s,[i])},off:function(s,i){var u=o.get(s);u&&(i?u.splice(u.indexOf(i)>>>0,1):o.set(s,[]))},emit:function(s,i){var u=o.get(s);u&&u.slice().map(function(m){m(i)}),(u=o.get("*"))&&u.slice().map(function(m){m(s,i)})}}}const yne=Ife(),Pfe=(...o)=>{const s=o[0],i=o[1];d.onMounted(()=>{yne.on(s,i)}),d.onBeforeUnmount(()=>{yne.off(s)})},Boe=()=>(...s)=>{yne.emit(...s)};let rE=null;function K6e(o){const{onSelected:s}={},{selectedNodes:i,uiReady:u,setSelectedNodes:m}=ef(),h=d.ref("multiple"),b=(S="select")=>{var N,O;let _=[];h.value==="single"?(N=i.value)!=null&&N[0]&&_.push((O=i.value)==null?void 0:O[0]):_=ga(i.value),rE==null||rE({data:_,type:S}),S==="blur"&&(rE=null,h.value="multiple"),m(_)};return d.watch(()=>i,()=>{u.value&&(b(),s==null||s(d.toValue(i)))},{deep:!0}),Pfe("selectNodes",S=>{const{data:_,callback:N=null,mode:O="multiple"}=S;h.value=O,setTimeout(()=>{m(d.toValue(_)),rE=N},100)}),{onBlur:()=>{rE&&(b("blur"),rE=null,m([]))}}}const Rz={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}},X6e={class:"relative"},J6e={class:"header-container"},Q6e=["innerHTML"],eRe={style:{overflow:"hidden"}},tRe=["innerHTML"],nRe=d.defineComponent({__name:"index",props:{headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesize:{type:String,default:"A4"}},emits:["onUiReady"],setup(o,{expose:s,emit:i}){const u=d.ref(),{containerRef:m,uiReady:h,isFocused:b}=ef(),{nodes:C,modelValue:S,renderType:_}=U0(),N=d.computed(()=>d.toValue(_)==="edit"),O=o,B=i,F=()=>{B("onUiReady",{containerRef:m})},{height:Z}=pMe(u),G=d.computed(()=>O.headerHtml?O.headerHtml.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(Nt,ge,Oe)=>{const R=Oe.replace(/([^{}]+)\{/g,(je,ye)=>{const tt=ye.trim();return tt&&!tt.includes(".header-container")?`.header-container ${tt} {`:je});return`<style${ge}>${R}</style>`}):""),Y=d.computed(()=>{const Nt=Rz[O.pagesize]||Rz.A4,ge=(window.devicePixelRatio||1)*96;return`${Nt.height*ge/25.4-d.toValue(Z)}px`}),{showContextMenu:q,contextMenuStyle:W,onContextMenu:L,direction:me}=Y6e({headerHeight:Z}),Ze=d.ref(null),_e=Nt=>{let ge=null;if(dR(Nt))ge=Nfe(Nt.nodePath,d.toValue(m)),ge&&(ge.classList.add("node-item-td"),ge.setAttribute("contenteditable","false"),E6e(ge));else{const Oe=document.createElement("span");Oe.setAttribute("contenteditable","false"),Oe.classList.add("node-item"),ge=Oe,g6e(Nt,ge,m.value)}return ge&&h6e(ge,Nt),ge},Q=()=>{const Nt=Hxe(C.value,[ge=>ge.nodePath,ge=>ge.textNodeIndex,ge=>ge.startOffset??-1,ge=>ge.subNodeSort],["asc","desc","desc","desc"]);Nt==null||Nt.forEach(ge=>{_e(ge)})},Fe=()=>{Ze.value&&(h.value=!1,d.nextTick(()=>{Ze.value&&(Ze.value.innerHTML=d.toValue(S),Q(),h.value=!0,d.nextTick(()=>{F(),setTimeout(()=>{d.toValue(m)&&k6e(d.toValue(m))},10)}))}))};d.watch(()=>[C,S,Ze],()=>{Fe()},{deep:!0,immediate:!0});const lt=d.ref(),nt=()=>{b.value=!0},{onBlur:$e}=K6e(),ue=()=>{b.value=!1,$e()};return s({renderHtml:Fe}),(Nt,ge)=>(d.openBlock(),d.createElementBlock("div",X6e,[d.createVNode($oe,{onOnBlur:ue,onOnFocus:nt,ref_key:"shadowDomRef",ref:lt},{default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"headerRef",ref:u,style:{overflow:"hidden"}},[d.createElementVNode("div",J6e,[d.createElementVNode("div",{innerHTML:G.value,class:"disabeld-edit docHeaderHtml",onClick:nt},null,8,Q6e)])],512),d.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:m,style:d.normalizeStyle([{position:"relative"},{position:"relative",minHeight:Y.value}]),onContextmenu:ge[0]||(ge[0]=d.withModifiers((...Oe)=>d.unref(L)&&d.unref(L)(...Oe),["prevent"]))},[d.createElementVNode("body",{ref_key:"bodyRef",ref:Ze},null,512),d.createElementVNode("div",eRe,[d.createElementVNode("div",{innerHTML:O==null?void 0:O.footerHtml,class:"disabeld-edit docFooterHtml",onClick:nt},null,8,tRe)])],36)]),_:1},512),N.value?(d.openBlock(),d.createBlock(q6e,{key:0,show:d.unref(q),"onUpdate:show":ge[1]||(ge[1]=Oe=>d.isRef(q)?q.value=Oe:null),style:d.normalizeStyle(d.unref(W)),direction:d.unref(me)},null,8,["show","style","direction"])):d.createCommentVNode("",!0)]))}}),oRe={class:"pagesize"},sRe=d.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"}},setup(o){const s=o,i=d.computed(()=>{const u=Rz[s.pagesize]||Rz.A4;let{width:m,height:h}=u;s.orientation==="landscape"&&([m,h]=[h,m]);const b=(window.devicePixelRatio||1)*96;return m*b/25.4});return(u,m)=>(d.openBlock(),d.createElementBlock("div",oRe,[d.createElementVNode("div",{style:d.normalizeStyle({width:`${i.value}px`}),class:"pagesize-content"},[d.renderSlot(u.$slots,"default",{},void 0,!0)],4)]))}}),rRe=mi(sRe,[["__scopeId","data-v-ff8a835c"]]),Ffe=d.defineComponent({__name:"index",props:d.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},renderType:{type:String,default:"preview"},formData:{type:Object,default:()=>({})},inputTypes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},id:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]},headerHtml:{type:String,default:""},footerHtml:{type:String,default:""}},{selectedNodes:{default:[]},selectedNodesModifiers:{}}),emits:d.mergeModels(["update:nodes","update:formData","onSelectedNodes","onUiReady"],["update:selectedNodes"]),setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.useModel(o,"selectedNodes");Em(u.formData);const b=d.ref(),C=d.ref(null),S=G=>{m("onUiReady",G)},_=d.ref(),N=d.computed(()=>d.toValue(u.renderType)),O=d.computed(()=>{switch(d.toValue(N)){case"edit":return I6e;case"select":return F6e;case"preview":return lle;case"enter":return P6e;default:return lle}}),B=G=>{m("update:nodes",G)},F=G=>{m("update:formData",G)},Z=G=>{m("onSelectedNodes",G)};return s({formRef:{validate:()=>{var G,Y,q;return(q=(Y=(G=b.value)==null?void 0:G.formRef)==null?void 0:Y.validate)==null?void 0:q.call(Y)}},setSelectedNodes:G=>{var Y,q;(q=(Y=_.value)==null?void 0:Y.setSelectedNodes)==null||q.call(Y,G)}}),(G,Y)=>(d.openBlock(),d.createBlock(rRe,{pagesize:o.pagesize,orientation:u==null?void 0:u.orientation},{default:d.withCtx(()=>[d.createVNode(H6e,{ref_key:"UIRef",ref:_,nodes:o.nodes,"onUpdate:nodes":B,selectedNodes:h.value,"onUpdate:selectedNodes":Y[0]||(Y[0]=q=>h.value=q),onOnSelectedNodes:Z,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id,htmlRenderRef:C.value},{default:d.withCtx(()=>[d.createVNode(V6e,{renderType:N.value,"model-value":o.modelValue,nodes:o.nodes,"onUpdate:nodes":B,formData:o.formData,"onUpdate:formData":F,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id,disabledNodes:o.disabledNodes},{default:d.withCtx(()=>[d.createVNode(nRe,{ref_key:"htmlRenderRef",ref:C,headerHtml:o.headerHtml,footerHtml:o.footerHtml,pagesize:u==null?void 0:u.pagesize,onOnUiReady:S},null,8,["headerHtml","footerHtml","pagesize"]),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(O.value),{renderType:N.value,pagesize:o.pagesize,ref_key:"contentRef",ref:b},{nodeItem:d.withCtx(q=>[d.renderSlot(G.$slots,"nodeItem",{node:q==null?void 0:q.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId","disabledNodes"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId","htmlRenderRef"])]),_:3},8,["pagesize","orientation"]))}}),aRe={class:"nodes-text"},iRe={key:0,class:"node-text-input"},lRe={key:1,class:"node-text-td"},cRe={key:0,class:"node-text-table-index"},uRe=d.defineComponent({__name:"index",props:d.mergeModels({editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.useModel(o,"modelValue"),u=MU(s==null?void 0:s.editorId),m=d.computed(()=>{var b;return Dfe(i.value,((b=d.toValue(u))==null?void 0:b.renderNodes)||[])}),h=d.computed(()=>{var b;return((b=d.toValue(m))==null?void 0:b.length)>0?!d.toValue(m).some(S=>{var _,N;return((_=S==null?void 0:S.min)==null?void 0:_.tableIndex)>1||((N=S==null?void 0:S.max)==null?void 0:N.tableIndex)>1}):!0});return(b,C)=>(d.openBlock(),d.createElementBlock("div",aRe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,(S,_)=>{var N,O,B,F,Z,G,Y,q,W;return d.openBlock(),d.createElementBlock("div",{key:_,class:"node-text-item"},[(S==null?void 0:S.showTextType)==="input"?(d.openBlock(),d.createElementBlock("span",iRe,d.toDisplayString((N=S==null?void 0:S.props)!=null&&N.alias?(O=S==null?void 0:S.props)==null?void 0:O.alias:`填写${S==null?void 0:S.inputIndex}`),1)):(d.openBlock(),d.createElementBlock("span",lRe,[h.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",cRe,d.toDisplayString(`表${(B=S==null?void 0:S.min)==null?void 0:B.tableIndex}.`),1)),d.createTextVNode(" "+d.toDisplayString(((F=S==null?void 0:S.min)==null?void 0:F.id)===((Z=S==null?void 0:S.max)==null?void 0:Z.id)?(Y=(G=S==null?void 0:S.min)==null?void 0:G.props)!=null&&Y.alias?(W=(q=S==null?void 0:S.min)==null?void 0:q.props)==null?void 0:W.alias:d.unref(r4)(S==null?void 0:S.min):`${d.unref(r4)(S==null?void 0:S.min)}:${d.unref(r4)(S==null?void 0:S.max)}`),1)]))])}),128))]))}}),cle=mi(uRe,[["__scopeId","data-v-73a2b2dc"]]);function Ioe(o){const{nodes:s,mode:i="multiple"}=o,u=d.ref(!1),m=Boe();return{isSelecting:u,selectNodes:()=>{if(u.value)return!1;u.value=!0,m("selectNodes",{data:ga(d.toValue(s)),mode:i,callback:({data:b,type:C})=>{s.value=_6e(ga(d.toValue(b))),C==="blur"&&(u.value=!1)}})}}}const WA=["#409EFF","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],RH=d.ref(0),aE=new Map,dRe={key:0,class:"node-select-small gap-x-2"},fRe={key:1,class:"text-[#999]"},mRe={key:1,class:"node-select"},pRe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},gRe={class:"flex gap-2"},hRe={key:1},vRe={class:"flex gap-1"},bRe=d.defineComponent({__name:"index",props:d.mergeModels({mode:{type:String,default:"multiple"},color:{type:String},id:{type:String,default:""},editorId:{type:String,default:""},size:{type:String,default:"default"},label:{type:String,default:"点击选择"},isOccupy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.ref((aE==null?void 0:aE[s==null?void 0:s.id])||0),u=d.ref((s==null?void 0:s.id)||m2()),m=d.useModel(o,"modelValue");Em(m);const{selectNodes:h,isSelecting:b}=Ioe({nodes:m,mode:s.mode}),C=()=>{m.value=[]},S=d.computed(()=>s.color||(WA==null?void 0:WA[d.toValue(i)%(WA==null?void 0:WA.length)])||"#409eff");d.onMounted(()=>{uR(aE==null?void 0:aE[s==null?void 0:s.id])&&(s!=null&&s.id)&&(aE[s==null?void 0:s.id]=RH.value,i.value=RH.value,RH.value=RH.value+1)});const _=d.computed(()=>s.isOccupy),N=d.computed(()=>!d.toValue(b));return L6e({id:u.value,editorId:s.editorId,nodes:m,activated:N,color:S,isOccupy:_}),(O,B)=>{var F;return s.size==="small"?(d.openBlock(),d.createElementBlock("div",dRe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),d.createElementVNode("div",null,d.toDisplayString(s.label),1),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{}),onClick:B[0]||(B[0]=(...Z)=>d.unref(h)&&d.unref(h)(...Z))},B[6]||(B[6]=[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer"},null,-1)]),4)),d.createElementVNode("div",{class:"flex items-center flex-wrap gap-1 cursor-pointer",onClick:B[2]||(B[2]=()=>{s!=null&&s.disabled||d.unref(h)()})},[((F=m.value)==null?void 0:F.length)>0?(d.openBlock(),d.createBlock(cle,{key:0,modelValue:m.value,"onUpdate:modelValue":B[1]||(B[1]=Z=>m.value=Z),editorId:o.editorId},null,8,["modelValue","editorId"])):(d.openBlock(),d.createElementBlock("div",fRe,"未设置"))])])):(d.openBlock(),d.createElementBlock("div",mRe,[d.createElementVNode("div",pRe,[d.createElementVNode("div",gRe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{})},[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:B[3]||(B[3]=(...Z)=>d.unref(h)&&d.unref(h)(...Z))})],4)),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",hRe,[d.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})]))]),d.createElementVNode("div",vRe,[B[9]||(B[9]=d.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),d.createElementVNode("div",null,[d.createVNode(d.unref(Nn.ElTooltip),{placement:"right",effect:"dark"},{content:d.withCtx(()=>B[7]||(B[7]=[d.createElementVNode("strong",null,"选择位置",-1),d.createTextVNode(" :点击输入框(选中状态为蓝色),再点击左侧表格可选择填写位置范围。 "),d.createElementVNode("br",null,null,-1),d.createElementVNode("strong",null,"编辑位置",-1),d.createTextVNode(" :使用橡皮擦工具清除后重新选择。 "),d.createElementVNode("br",null,null,-1)])),default:d.withCtx(()=>[B[8]||(B[8]=d.createElementVNode("div",{class:"flex flex-center"},[d.createElementVNode("div",{class:"i-bi:info-circle-fill mr-2"}),d.createTextVNode(" 使用帮助 ")],-1))]),_:1})])])]),d.createElementVNode("div",{class:d.normalizeClass(["min-h-[42px] px-2 py-1",{"shadow-[0_0_0_2px_#409eff]":d.unref(b)}]),onClick:B[5]||(B[5]=()=>{s!=null&&s.disabled||d.unref(h)()})},[d.createVNode(cle,{modelValue:m.value,"onUpdate:modelValue":B[4]||(B[4]=Z=>m.value=Z),editorId:o.editorId},null,8,["modelValue","editorId"])],2)]))}}}),Lfe=mi(bRe,[["__scopeId","data-v-e9e78bcd"]]);function yRe(o){if(!o.startsWith("="))return[];const s=[];let i=1;for(o.startsWith("=")&&s.push({type:"startOperator",value:"="});i<o.length;){const u=o[i];if(/\s/.test(u)){i++;continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];if(i<o.length&&o[i]===":"){i++;let h="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)h+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)h+=o[i++];s.push({type:"range",value:`${m}:${h}`});continue}else{s.push({type:"cell",value:m});continue}}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(/[A-Za-z]/.test(u)){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];if(["AVERAGE","AVEDEV","SUM","IF","COUNT","MAX","MIN","SQRT"].includes(m.toUpperCase())&&o[i]==="("){s.push({type:"function",value:m});continue}i-=m.length}if(/\d/.test(u)){let m="";for(;i<o.length&&(/\d/.test(o[i])||o[i]===".");)m+=o[i++];s.push({type:"number",value:m});continue}if(u==='"'){let m="";for(m+=u,i++;i<o.length&&o[i]!=='"';)m+=o[i++];m+=u,i++,s.push({type:"string",value:m});continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(u===":"){s.push({type:"operator",value:":"}),i++;continue}if(/[+\-*/=><]/.test(u)){s.push({type:"operator",value:u}),i++;continue}if(/[()]/.test(u)){s.push({type:"paren",value:u}),i++;continue}if(u===","){s.push({type:"separator",value:","}),i++;continue}i++}return s}function wRe(o,s){const i=[];let u=0;for(;u<o.length;){let m=!1;for(const h of s){const b=h.value;if(o.startsWith(b,u)){i.push({type:h.type,value:b,...h.cellValue?{cellValue:h.cellValue}:{}}),u+=b.length,m=!0;break}}m||(i.push({type:"plain",value:o[u]}),u++)}return i}function CRe(o){const s=MU(o.editorId),i=(b,C)=>{let S=[];const _=Math.min(b.colIndex,C.colIndex),N=Math.max(b.colIndex,C.colIndex),O=Math.min(b.rowIndex,C.rowIndex),B=Math.max(b.rowIndex,C.rowIndex);for(let F=O;F<=B;F++)for(let Z=_;Z<=N;Z++)S.push({colIndex:Z,rowIndex:F});return S},u=b=>{var N;const C=b.includes(":");let S=[];if(C){const[O,B]=b.split(":").map(F=>h(F));S=i(O,B)}else S=[h(b)];return m(S,d.toValue((N=d.toValue(s))==null?void 0:N.nodes))},m=(b,C)=>C==null?void 0:C.filter(S=>{const _=S.nodePath.split(" > ");let N=1,O=1;return _.forEach(B=>{if(B.startsWith("tr")){const F=B.match(/tr(?::nth-of-type\((\d+)\))?/);F&&F[1]&&(N=parseInt(F[1]))}else if(B.startsWith("td")){const F=B.match(/td(?::nth-of-type\((\d+)\))?/);F&&(O=F[1]?parseInt(F[1]):1)}}),b.some(B=>N===B.rowIndex+1&&O===B.colIndex+1)}),h=b=>{if(!b)return{colIndex:-1,rowIndex:-1};const C=b.match(/^([A-Za-z]+)(\d+)$/);if(!C)return{colIndex:-1,rowIndex:-1};const S=C[1].toUpperCase(),_=parseInt(C[2]);let N=0;for(let O=0;O<S.length;O++)N=N*26+(S.charCodeAt(O)-64);return{colIndex:N-1,rowIndex:_}};return{getCellValue:u}}const ule=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function SRe(o,s,i){const u=d.ref(null),m=d.ref(null);function h(){return o.value&&o.value.textContent||""}d.onMounted(()=>{o.value&&(u.value=()=>{const C=h();s.value=C},m.value=()=>{const C=h();s.value=C},o.value.addEventListener("input",u.value),o.value.addEventListener("blur",m.value))}),d.onUnmounted(()=>{o.value&&(u.value&&o.value.removeEventListener("input",u.value),m.value&&o.value.removeEventListener("blur",m.value))});const b=C=>{var S,_,N,O;if(C>=0){const B=window.getSelection();if(B){const F=B.getRangeAt(0),Z=((S=F.startContainer)==null?void 0:S.nodeName)==="#text"?F.startContainer:(N=(_=F.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],G=Math.min(C,((O=Z.textContent)==null?void 0:O.length)||0);F.setStart(Z,G)}}};return d.watch(()=>[s,o],()=>{var C;o.value&&(ha((C=o.value)==null?void 0:C.textContent,d.toValue(s))||(o.value.textContent=d.toValue(s),b(d.toValue(i))))},{deep:!0,immediate:!0}),{getFormulaContent:h}}function Poe(o){const{element:s,onFocus:i,onBlur:u}=o,m=d.ref(!1),h=()=>{m.value=!0,i==null||i()},b=()=>{m.value=!1,u==null||u()};return d.onMounted(()=>{var C,S;d.toValue(s)&&((C=d.toValue(s))==null||C.addEventListener("focus",h),(S=d.toValue(s))==null||S.addEventListener("blur",b))}),d.onUnmounted(()=>{var C,S;d.toValue(s)&&((C=d.toValue(s))==null||C.removeEventListener("focus",h),(S=d.toValue(s))==null||S.removeEventListener("blur",b))}),m}function xRe(o){const{element:s,showStr:i,editorId:u}=o,m=MU(u),h=Poe({element:s}),b=d.computed(()=>{var C;return(C=i==null?void 0:i.value)==null?void 0:C.filter(S=>["range","cell"].includes(S.type))});return d.watch(()=>h,()=>{var S,_,N,O,B,F;const C=Z=>{var G;Z.preventDefault(),(G=d.toValue(s))==null||G.focus()};d.toValue(h)?((S=d.toValue(m))==null||S.containerRef.addEventListener("click",C),(_=d.toValue(m))==null||_.containerRef.addEventListener("mousedown",C),(N=document.querySelectorAll(".select-function"))==null||N.forEach(Z=>{Z.addEventListener("click",C),Z.addEventListener("mousedown",C)})):((O=d.toValue(m))==null||O.containerRef.removeEventListener("click",C),(B=d.toValue(m))==null||B.containerRef.removeEventListener("mousedown",C),(F=document.querySelectorAll(".select-function"))==null||F.forEach(Z=>{Z.removeEventListener("click",C),Z.removeEventListener("mousedown",C)}))},{deep:!0}),d.watch(()=>[h,b],()=>{var C,S,_,N,O;if((C=d.toValue(m))!=null&&C.containerRef&&((N=(_=(S=d.toValue(m))==null?void 0:S.containerRef)==null?void 0:_.querySelectorAll(".node-formula-cell"))==null||N.forEach(B=>{B.classList.remove("node-formula-cell")}),d.toValue(h))){let B=[];(O=b.value)!=null&&O.length&&(b.value.forEach(F=>{var Z;B=[...B,...((Z=F==null?void 0:F.cellValue)==null?void 0:Z.map(G=>({color:F==null?void 0:F.color,backgroundColor:Mz((F==null?void 0:F.color)||"#000",.1),element:G==null?void 0:G.element})))||[]]}),B.forEach(F=>{var Z;F!=null&&F.element&&((Z=F==null?void 0:F.element)==null||Z.classList.add("node-formula-cell"),F==null||F.element.style.setProperty("--formula-node-color",F==null?void 0:F.color),F==null||F.element.style.setProperty("--formula-node-bg-color",F==null?void 0:F.backgroundColor))}))}},{deep:!0}),h}const ERe=o=>{const{element:s}=o,i=d.ref(-1),u=C=>{const S=C==null?void 0:C.getSelection();try{if(S)return S.getRangeAt(0).startOffset}catch{}return 0},m=()=>{var S;const C=(S=s.value)==null?void 0:S.getRootNode();i.value=u(C)},h=C=>{var O;const S=C.target,_=(O=s.value)==null?void 0:O.getRootNode();i.value=u(_),S.addEventListener("click",m),S.addEventListener("keyup",B=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(B.key)&&m()});const N=()=>{S.removeEventListener("click",m),S.removeEventListener("keyup",m),S.removeEventListener("blur",N),setTimeout(()=>{i.value=-1},300)};S.addEventListener("blur",N)},b=()=>{var C;(C=s.value)==null||C.addEventListener("focus",h,!0)};return d.watch(s,C=>{C&&b()},{immediate:!0}),d.onUnmounted(()=>{var C;(C=s.value)==null||C.removeEventListener("focus",h,!0)}),{startOffset:i}};function _Re(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const kRe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},TRe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,S=MU(m),_=d.ref(-1),N=d.ref(0),O=Poe({element:C}),B=d.ref(!1),F=Boe(),Z=G=>{var Y,q;if(d.toValue(B)&&d.toValue(O)&&!ha((Y=d.toValue(b))==null?void 0:Y.cellValue,G)){const W=x6e(G,((q=d.toValue(S))==null?void 0:q.nodes)||"");let L=W;W&&(d.toValue(N)===0&&(L+=","),d.toValue(_)>=0&&(u.value=_Re(d.toValue(u),d.toValue(_),d.toValue(N),L),N.value=W.length))}};d.watch(()=>h,()=>{var G,Y,q,W,L,me;if((G=S.value)==null||G.setSelectedNodes([]),["range","cell"].includes((Y=d.toValue(b))==null?void 0:Y.type))return _.value=kRe(i.value,h.value),N.value=(W=(q=d.toValue(b))==null?void 0:q.value)==null?void 0:W.length,B.value=!0,F("selectNodes",{data:(L=d.toValue(b))==null?void 0:L.cellValue,mode:"multiple",callback:({data:Ze})=>{Z(Ze)}}),!1;if([",","(","="].includes((me=d.toValue(b))==null?void 0:me.value))return _.value=d.toValue(s),B.value=!0,N.value=0,F("selectNodes",{data:[],mode:"multiple",callback:({data:Ze})=>{Z(Ze)}}),!1;B.value=!1,_.value=-1},{immediate:!0,deep:!0})},ARe=o=>{const{startOffset:s,showStr:i}=o,u=d.ref(-1);d.watch(()=>s,()=>{var h;if(d.toValue(s)<=0)u.value=-1;else{let b=0;for(let C=0;C<i.value.length;C++){const S=i.value[C];if(b+=(h=S==null?void 0:S.value)==null?void 0:h.length,b>=d.toValue(s)){u.value=C;break}}}},{deep:!0,immediate:!0});const m=d.computed(()=>{var h;return(h=d.toValue(i))==null?void 0:h[d.toValue(u)]});return{currentItemIndex:u,currentItem:m}};function NRe(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const ORe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},$Re=o=>{const{startOffset:s,showStr:i,value:u,currentItemIndex:m,currentItem:h,element:b}=o,C=d.ref(-1),S=d.ref(0),_=Poe({element:b}),N=d.ref(!1),O=Boe(),B=F=>{var Z;if(d.toValue(N)&&d.toValue(_)&&!ha((Z=d.toValue(h))==null?void 0:Z.value,F)){const G=F,Y=G;G&&d.toValue(C)>=0&&(u.value=NRe(d.toValue(u),d.toValue(C),d.toValue(S),Y),S.value=G.length)}};d.watch(()=>m,()=>{var F,Z,G,Y,q;if(["function"].includes((F=d.toValue(h))==null?void 0:F.type))return C.value=ORe(i.value,m.value),S.value=(G=(Z=d.toValue(h))==null?void 0:Z.value)==null?void 0:G.length,N.value=!0,O("selectFunction",{data:(Y=d.toValue(h))==null?void 0:Y.value,callback:({data:W})=>{B(W)}}),!1;if([",","(","="].includes((q=d.toValue(h))==null?void 0:q.value))return C.value=d.toValue(s),N.value=!0,S.value=0,O("selectFunction",{data:"",callback:({data:W})=>{B(W)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},DRe={class:"node-formula"},MRe={class:"node-formula-show"},RRe=d.defineComponent({__name:"index",props:d.mergeModels({id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{getCellValue:i}=CRe({editorId:s==null?void 0:s.editorId}),u=d.useModel(o,"modelValue"),m=d.ref(),{startOffset:h}=ERe({element:m});SRe(m,u,h);const b=d.computed(()=>{const N=yRe(u.value);return N==null?void 0:N.map(B=>B.type==="cell"||B.type==="range"?{cellValue:i(B.value),...B}:B)}),C=d.computed(()=>{const N=wRe(u.value,b.value);let O=-1;return N.map(F=>(F==null?void 0:F.type)==="cell"||(F==null?void 0:F.type)==="range"?(O++,{...F,color:ule[O%ule.length]}):(F==null?void 0:F.type)==="function"?{...F,color:"#0318ff"}:F)});xRe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:S,currentItem:_}=ARe({element:m,startOffset:h,value:u,showStr:C});return TRe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:S,currentItem:_}),$Re({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:S,currentItem:_}),(N,O)=>(d.openBlock(),d.createElementBlock("div",DRe,[d.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),d.createElementVNode("div",MRe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(C.value,(B,F)=>(d.openBlock(),d.createElementBlock("span",{key:F,class:d.normalizeClass(["node-formula-item",`node-formula-item-type-${B==null?void 0:B.type}`,F===d.unref(S)?"node-formula-item-active":""]),style:d.normalizeStyle({"--text-color":(B==null?void 0:B.color)||"#000","--bg-color":d.unref(Mz)((B==null?void 0:B.color)||"#000",.1)})},d.toDisplayString(B.value),7))),128))])]))}}),Vfe=mi(RRe,[["__scopeId","data-v-f4b96eb4"]]),BRe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],IRe={class:"select-function"},PRe=["onClick"],FRe={class:"function-item"},LRe={class:"function-item-desc"},VRe=d.defineComponent({__name:"index",props:d.mergeModels({id:{type:String,default:""},functionList:{type:Array,default:()=>[]}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o;let i=null;const u=d.computed(()=>{var b;return((b=s.functionList)==null?void 0:b.length)>0?s.functionList:BRe}),m=d.useModel(o,"modelValue"),h=b=>{m.value=b,i==null||i({data:b})};return Pfe("selectFunction",({data:b,callback:C})=>{i=C,m.value=b}),(b,C)=>(d.openBlock(),d.createElementBlock("div",IRe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(S,_)=>(d.openBlock(),d.createElementBlock("div",{key:_},[d.createElementVNode("div",{onClick:()=>{h(S.value)},class:d.normalizeClass(["function-item-wrapper",{active:m.value===S.value}])},[d.createElementVNode("div",FRe,d.toDisplayString(S.value),1),d.createElementVNode("div",LRe,d.toDisplayString(S.label),1)],10,PRe)]))),128))]))}}),Hfe=mi(VRe,[["__scopeId","data-v-6e079ff0"]]),HRe=["innerHTML"],zfe=d.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=d.useModel(o,"modelValue");return(i,u)=>(d.openBlock(),d.createBlock($oe,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,HRe)]),_:1}))}});function RU(o){return d.getCurrentScope()?(d.onScopeDispose(o),!0):!1}function M0(o){return typeof o=="function"?o():d.unref(o)}const zRe=typeof window<"u"&&typeof document<"u",URe=o=>typeof o<"u",jRe=Object.prototype.toString,WRe=o=>jRe.call(o)==="[object Object]",ZRe=()=>{};function GRe(o,s){function i(...u){return new Promise((m,h)=>{Promise.resolve(o(()=>s.apply(this,u),{fn:s,thisArg:this,args:u})).then(m).catch(h)})}return i}const Ufe=o=>o();function qRe(o=Ufe){const s=d.ref(!0);function i(){s.value=!1}function u(){s.value=!0}const m=(...h)=>{s.value&&o(...h)};return{isActive:d.readonly(s),pause:i,resume:u,eventFilter:m}}function dle(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function YRe(o,s,i={}){const{eventFilter:u=Ufe,...m}=i;return d.watch(o,GRe(u,s),m)}function ZA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:S}=qRe(u);return{stop:YRe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:S}}function KRe(o,s={}){if(!d.isRef(o))return d.toRefs(o);const i=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const u in o.value)i[u]=d.customRef(()=>({get(){return o.value[u]},set(m){var h;if((h=M0(s.replaceRef))!=null?h:!0)if(Array.isArray(o.value)){const C=[...o.value];C[u]=m,o.value=C}else{const C={...o.value,[u]:m};Object.setPrototypeOf(C,Object.getPrototypeOf(o.value)),o.value=C}else o.value[u]=m}}));return i}function wne(o,s=!1){function i(O,{flush:B="sync",deep:F=!1,timeout:Z,throwOnTimeout:G}={}){let Y=null;const W=[new Promise(L=>{Y=d.watch(o,me=>{O(me)!==s&&(Y==null||Y(),L(me))},{flush:B,deep:F,immediate:!0})})];return Z!=null&&W.push(dle(Z,G).then(()=>M0(o)).finally(()=>Y==null?void 0:Y())),Promise.race(W)}function u(O,B){if(!d.isRef(O))return i(me=>me===O,B);const{flush:F="sync",deep:Z=!1,timeout:G,throwOnTimeout:Y}=B??{};let q=null;const L=[new Promise(me=>{q=d.watch([o,O],([Ze,_e])=>{s!==(Ze===_e)&&(q==null||q(),me(Ze))},{flush:F,deep:Z,immediate:!0})})];return G!=null&&L.push(dle(G,Y).then(()=>M0(o)).finally(()=>(q==null||q(),M0(o)))),Promise.race(L)}function m(O){return i(B=>!!B,O)}function h(O){return u(null,O)}function b(O){return u(void 0,O)}function C(O){return i(Number.isNaN,O)}function S(O,B){return i(F=>{const Z=Array.from(F);return Z.includes(O)||Z.includes(M0(O))},B)}function _(O){return N(1,O)}function N(O=1,B){let F=-1;return i(()=>(F+=1,F>=O),B)}return Array.isArray(M0(o))?{toMatch:i,toContains:S,changed:_,changedTimes:N,get not(){return wne(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return wne(o,!s)}}}function Cne(o){return wne(o)}function XRe(o){var s;const i=M0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const jfe=zRe?window:void 0;function Wfe(...o){let s,i,u,m;if(typeof o[0]=="string"||Array.isArray(o[0])?([i,u,m]=o,s=jfe):[s,i,u,m]=o,!s)return ZRe;Array.isArray(i)||(i=[i]),Array.isArray(u)||(u=[u]);const h=[],b=()=>{h.forEach(N=>N()),h.length=0},C=(N,O,B,F)=>(N.addEventListener(O,B,F),()=>N.removeEventListener(O,B,F)),S=d.watch(()=>[XRe(s),M0(m)],([N,O])=>{if(b(),!N)return;const B=WRe(O)?{...O}:O;h.push(...i.flatMap(F=>u.map(Z=>C(N,F,Z,B))))},{immediate:!0,flush:"post"}),_=()=>{S(),b()};return RU(_),_}function JRe(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function fle(...o){let s,i,u={};o.length===3?(s=o[0],i=o[1],u=o[2]):o.length===2?typeof o[1]=="object"?(s=!0,i=o[0],u=o[1]):(s=o[0],i=o[1]):(s=!0,i=o[0]);const{target:m=jfe,eventName:h="keydown",passive:b=!1,dedupe:C=!1}=u,S=JRe(s);return Wfe(m,h,N=>{N.repeat&&M0(C)||S(N)&&i(N)},b)}function QRe(o){return JSON.parse(JSON.stringify(o))}function gte(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:S=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:B}=u,F=d.getCurrentInstance(),Z=i||(F==null?void 0:F.emit)||((m=F==null?void 0:F.$emit)==null?void 0:m.bind(F))||((b=(h=F==null?void 0:F.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(F==null?void 0:F.proxy));let G=_;s||(s="modelValue"),G=G||`update:${s.toString()}`;const Y=L=>C?typeof C=="function"?C(L):QRe(L):L,q=()=>URe(o[s])?Y(o[s]):O,W=L=>{B?B(L)&&Z(G,L):Z(G,L)};if(S){const L=q(),me=d.ref(L);let Ze=!1;return d.watch(()=>o[s],_e=>{Ze||(Ze=!0,me.value=Y(_e),d.nextTick(()=>Ze=!1))}),d.watch(me,_e=>{!Ze&&(_e!==o[s]||N)&&W(_e)},{deep:N}),me}else return d.computed({get(){return q()},set(L){W(L)}})}var eBe={value:()=>{}};function BU(){for(var o=0,s=arguments.length,i={},u;o<s;++o){if(!(u=arguments[o]+"")||u in i||/[\s.]/.test(u))throw new Error("illegal type: "+u);i[u]=[]}return new az(i)}function az(o){this._=o}function tBe(o,s){return o.trim().split(/^|\s+/).map(function(i){var u="",m=i.indexOf(".");if(m>=0&&(u=i.slice(m+1),i=i.slice(0,m)),i&&!s.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:u}})}az.prototype=BU.prototype={constructor:az,on:function(o,s){var i=this._,u=tBe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=nBe(i[m],o.name)))return m;return}if(s!=null&&typeof s!="function")throw new Error("invalid callback: "+s);for(;++h<b;)if(m=(o=u[h]).type)i[m]=mle(i[m],o.name,s);else if(s==null)for(m in i)i[m]=mle(i[m],o.name,null);return this},copy:function(){var o={},s=this._;for(var i in s)o[i]=s[i].slice();return new az(o)},call:function(o,s){if((m=arguments.length-2)>0)for(var i=new Array(m),u=0,m,h;u<m;++u)i[u]=arguments[u+2];if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(h=this._[o],u=0,m=h.length;u<m;++u)h[u].value.apply(s,i)},apply:function(o,s,i){if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(var u=this._[o],m=0,h=u.length;m<h;++m)u[m].value.apply(s,i)}};function nBe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function mle(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=eBe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var Sne="http://www.w3.org/1999/xhtml";const ple={svg:"http://www.w3.org/2000/svg",xhtml:Sne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function IU(o){var s=o+="",i=s.indexOf(":");return i>=0&&(s=o.slice(0,i))!=="xmlns"&&(o=o.slice(i+1)),ple.hasOwnProperty(s)?{space:ple[s],local:o}:o}function oBe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===Sne&&s.documentElement.namespaceURI===Sne?s.createElement(o):s.createElementNS(i,o)}}function sBe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Zfe(o){var s=IU(o);return(s.local?sBe:oBe)(s)}function rBe(){}function Foe(o){return o==null?rBe:function(){return this.querySelector(o)}}function aBe(o){typeof o!="function"&&(o=Foe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=new Array(b),S,_,N=0;N<b;++N)(S=h[N])&&(_=o.call(S,S.__data__,N,h))&&("__data__"in S&&(_.__data__=S.__data__),C[N]=_);return new Sp(u,this._parents)}function iBe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function lBe(){return[]}function Gfe(o){return o==null?lBe:function(){return this.querySelectorAll(o)}}function cBe(o){return function(){return iBe(o.apply(this,arguments))}}function uBe(o){typeof o=="function"?o=cBe(o):o=Gfe(o);for(var s=this._groups,i=s.length,u=[],m=[],h=0;h<i;++h)for(var b=s[h],C=b.length,S,_=0;_<C;++_)(S=b[_])&&(u.push(o.call(S,S.__data__,_,b)),m.push(S));return new Sp(u,m)}function qfe(o){return function(){return this.matches(o)}}function Yfe(o){return function(s){return s.matches(o)}}var dBe=Array.prototype.find;function fBe(o){return function(){return dBe.call(this.children,o)}}function mBe(){return this.firstElementChild}function pBe(o){return this.select(o==null?mBe:fBe(typeof o=="function"?o:Yfe(o)))}var gBe=Array.prototype.filter;function hBe(){return Array.from(this.children)}function vBe(o){return function(){return gBe.call(this.children,o)}}function bBe(o){return this.selectAll(o==null?hBe:vBe(typeof o=="function"?o:Yfe(o)))}function yBe(o){typeof o!="function"&&(o=qfe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],S,_=0;_<b;++_)(S=h[_])&&o.call(S,S.__data__,_,h)&&C.push(S);return new Sp(u,this._parents)}function Kfe(o){return new Array(o.length)}function wBe(){return new Sp(this._enter||this._groups.map(Kfe),this._parents)}function Bz(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}Bz.prototype={constructor:Bz,appendChild:function(o){return this._parent.insertBefore(o,this._next)},insertBefore:function(o,s){return this._parent.insertBefore(o,s)},querySelector:function(o){return this._parent.querySelector(o)},querySelectorAll:function(o){return this._parent.querySelectorAll(o)}};function CBe(o){return function(){return o}}function SBe(o,s,i,u,m,h){for(var b=0,C,S=s.length,_=h.length;b<_;++b)(C=s[b])?(C.__data__=h[b],u[b]=C):i[b]=new Bz(o,h[b]);for(;b<S;++b)(C=s[b])&&(m[b]=C)}function xBe(o,s,i,u,m,h,b){var C,S,_=new Map,N=s.length,O=h.length,B=new Array(N),F;for(C=0;C<N;++C)(S=s[C])&&(B[C]=F=b.call(S,S.__data__,C,s)+"",_.has(F)?m[C]=S:_.set(F,S));for(C=0;C<O;++C)F=b.call(o,h[C],C,h)+"",(S=_.get(F))?(u[C]=S,S.__data__=h[C],_.delete(F)):i[C]=new Bz(o,h[C]);for(C=0;C<N;++C)(S=s[C])&&_.get(B[C])===S&&(m[C]=S)}function EBe(o){return o.__data__}function _Be(o,s){if(!arguments.length)return Array.from(this,EBe);var i=s?xBe:SBe,u=this._parents,m=this._groups;typeof o!="function"&&(o=CBe(o));for(var h=m.length,b=new Array(h),C=new Array(h),S=new Array(h),_=0;_<h;++_){var N=u[_],O=m[_],B=O.length,F=kBe(o.call(N,N&&N.__data__,_,u)),Z=F.length,G=C[_]=new Array(Z),Y=b[_]=new Array(Z),q=S[_]=new Array(B);i(N,O,G,Y,q,F,s);for(var W=0,L=0,me,Ze;W<Z;++W)if(me=G[W]){for(W>=L&&(L=W+1);!(Ze=Y[L])&&++L<Z;);me._next=Ze||null}}return b=new Sp(b,u),b._enter=C,b._exit=S,b}function kBe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function TBe(){return new Sp(this._exit||this._groups.map(Kfe),this._parents)}function ABe(o,s,i){var u=this.enter(),m=this,h=this.exit();return typeof o=="function"?(u=o(u),u&&(u=u.selection())):u=u.append(o+""),s!=null&&(m=s(m),m&&(m=m.selection())),i==null?h.remove():i(h),u&&m?u.merge(m).order():m}function NBe(o){for(var s=o.selection?o.selection():o,i=this._groups,u=s._groups,m=i.length,h=u.length,b=Math.min(m,h),C=new Array(m),S=0;S<b;++S)for(var _=i[S],N=u[S],O=_.length,B=C[S]=new Array(O),F,Z=0;Z<O;++Z)(F=_[Z]||N[Z])&&(B[Z]=F);for(;S<m;++S)C[S]=i[S];return new Sp(C,this._parents)}function OBe(){for(var o=this._groups,s=-1,i=o.length;++s<i;)for(var u=o[s],m=u.length-1,h=u[m],b;--m>=0;)(b=u[m])&&(h&&b.compareDocumentPosition(h)^4&&h.parentNode.insertBefore(b,h),h=b);return this}function $Be(o){o||(o=DBe);function s(O,B){return O&&B?o(O.__data__,B.__data__):!O-!B}for(var i=this._groups,u=i.length,m=new Array(u),h=0;h<u;++h){for(var b=i[h],C=b.length,S=m[h]=new Array(C),_,N=0;N<C;++N)(_=b[N])&&(S[N]=_);S.sort(s)}return new Sp(m,this._parents).order()}function DBe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function MBe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function RBe(){return Array.from(this)}function BBe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length;m<h;++m){var b=u[m];if(b)return b}return null}function IBe(){let o=0;for(const s of this)++o;return o}function PBe(){return!this.node()}function FBe(o){for(var s=this._groups,i=0,u=s.length;i<u;++i)for(var m=s[i],h=0,b=m.length,C;h<b;++h)(C=m[h])&&o.call(C,C.__data__,h,m);return this}function LBe(o){return function(){this.removeAttribute(o)}}function VBe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function HBe(o,s){return function(){this.setAttribute(o,s)}}function zBe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function UBe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function jBe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttributeNS(o.space,o.local):this.setAttributeNS(o.space,o.local,i)}}function WBe(o,s){var i=IU(o);if(arguments.length<2){var u=this.node();return i.local?u.getAttributeNS(i.space,i.local):u.getAttribute(i)}return this.each((s==null?i.local?VBe:LBe:typeof s=="function"?i.local?jBe:UBe:i.local?zBe:HBe)(i,s))}function Xfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function ZBe(o){return function(){this.style.removeProperty(o)}}function GBe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function qBe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function YBe(o,s,i){return arguments.length>1?this.each((s==null?ZBe:typeof s=="function"?qBe:GBe)(o,s,i??"")):g4(this.node(),o)}function g4(o,s){return o.style.getPropertyValue(s)||Xfe(o).getComputedStyle(o,null).getPropertyValue(s)}function KBe(o){return function(){delete this[o]}}function XBe(o,s){return function(){this[o]=s}}function JBe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function QBe(o,s){return arguments.length>1?this.each((s==null?KBe:typeof s=="function"?JBe:XBe)(o,s)):this.node()[o]}function Jfe(o){return o.trim().split(/^|\s+/)}function Loe(o){return o.classList||new Qfe(o)}function Qfe(o){this._node=o,this._names=Jfe(o.getAttribute("class")||"")}Qfe.prototype={add:function(o){var s=this._names.indexOf(o);s<0&&(this._names.push(o),this._node.setAttribute("class",this._names.join(" ")))},remove:function(o){var s=this._names.indexOf(o);s>=0&&(this._names.splice(s,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(o){return this._names.indexOf(o)>=0}};function eme(o,s){for(var i=Loe(o),u=-1,m=s.length;++u<m;)i.add(s[u])}function tme(o,s){for(var i=Loe(o),u=-1,m=s.length;++u<m;)i.remove(s[u])}function eIe(o){return function(){eme(this,o)}}function tIe(o){return function(){tme(this,o)}}function nIe(o,s){return function(){(s.apply(this,arguments)?eme:tme)(this,o)}}function oIe(o,s){var i=Jfe(o+"");if(arguments.length<2){for(var u=Loe(this.node()),m=-1,h=i.length;++m<h;)if(!u.contains(i[m]))return!1;return!0}return this.each((typeof s=="function"?nIe:s?eIe:tIe)(i,s))}function sIe(){this.textContent=""}function rIe(o){return function(){this.textContent=o}}function aIe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function iIe(o){return arguments.length?this.each(o==null?sIe:(typeof o=="function"?aIe:rIe)(o)):this.node().textContent}function lIe(){this.innerHTML=""}function cIe(o){return function(){this.innerHTML=o}}function uIe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function dIe(o){return arguments.length?this.each(o==null?lIe:(typeof o=="function"?uIe:cIe)(o)):this.node().innerHTML}function fIe(){this.nextSibling&&this.parentNode.appendChild(this)}function mIe(){return this.each(fIe)}function pIe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gIe(){return this.each(pIe)}function hIe(o){var s=typeof o=="function"?o:Zfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function vIe(){return null}function bIe(o,s){var i=typeof o=="function"?o:Zfe(o),u=s==null?vIe:typeof s=="function"?s:Foe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function yIe(){var o=this.parentNode;o&&o.removeChild(this)}function wIe(){return this.each(yIe)}function CIe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function SIe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function xIe(o){return this.select(o?SIe:CIe)}function EIe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function _Ie(o){return function(s){o.call(this,s,this.__data__)}}function kIe(o){return o.trim().split(/^|\s+/).map(function(s){var i="",u=s.indexOf(".");return u>=0&&(i=s.slice(u+1),s=s.slice(0,u)),{type:s,name:i}})}function TIe(o){return function(){var s=this.__on;if(s){for(var i=0,u=-1,m=s.length,h;i<m;++i)h=s[i],(!o.type||h.type===o.type)&&h.name===o.name?this.removeEventListener(h.type,h.listener,h.options):s[++u]=h;++u?s.length=u:delete this.__on}}}function AIe(o,s,i){return function(){var u=this.__on,m,h=_Ie(s);if(u){for(var b=0,C=u.length;b<C;++b)if((m=u[b]).type===o.type&&m.name===o.name){this.removeEventListener(m.type,m.listener,m.options),this.addEventListener(m.type,m.listener=h,m.options=i),m.value=s;return}}this.addEventListener(o.type,h,i),m={type:o.type,name:o.name,value:s,listener:h,options:i},u?u.push(m):this.__on=[m]}}function NIe(o,s,i){var u=kIe(o+""),m,h=u.length,b;if(arguments.length<2){var C=this.node().__on;if(C){for(var S=0,_=C.length,N;S<_;++S)for(m=0,N=C[S];m<h;++m)if((b=u[m]).type===N.type&&b.name===N.name)return N.value}return}for(C=s?AIe:TIe,m=0;m<h;++m)this.each(C(u[m],s,i));return this}function nme(o,s,i){var u=Xfe(o),m=u.CustomEvent;typeof m=="function"?m=new m(s,i):(m=u.document.createEvent("Event"),i?(m.initEvent(s,i.bubbles,i.cancelable),m.detail=i.detail):m.initEvent(s,!1,!1)),o.dispatchEvent(m)}function OIe(o,s){return function(){return nme(this,o,s)}}function $Ie(o,s){return function(){return nme(this,o,s.apply(this,arguments))}}function DIe(o,s){return this.each((typeof s=="function"?$Ie:OIe)(o,s))}function*MIe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length,b;m<h;++m)(b=u[m])&&(yield b)}var ome=[null];function Sp(o,s){this._groups=o,this._parents=s}function PR(){return new Sp([[document.documentElement]],ome)}function RIe(){return this}Sp.prototype=PR.prototype={constructor:Sp,select:aBe,selectAll:uBe,selectChild:pBe,selectChildren:bBe,filter:yBe,data:_Be,enter:wBe,exit:TBe,join:ABe,merge:NBe,selection:RIe,order:OBe,sort:$Be,call:MBe,nodes:RBe,node:BBe,size:IBe,empty:PBe,each:FBe,attr:WBe,style:YBe,property:QBe,classed:oIe,text:iIe,html:dIe,raise:mIe,lower:gIe,append:hIe,insert:bIe,remove:wIe,clone:xIe,datum:EIe,on:NIe,dispatch:DIe,[Symbol.iterator]:MIe};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],ome)}function BIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Nv(o,s){if(o=BIe(o),s===void 0&&(s=o.currentTarget),s){var i=s.ownerSVGElement||s;if(i.createSVGPoint){var u=i.createSVGPoint();return u.x=o.clientX,u.y=o.clientY,u=u.matrixTransform(s.getScreenCTM().inverse()),[u.x,u.y]}if(s.getBoundingClientRect){var m=s.getBoundingClientRect();return[o.clientX-m.left-s.clientLeft,o.clientY-m.top-s.clientTop]}}return[o.pageX,o.pageY]}const IIe={passive:!1},fR={capture:!0,passive:!1};function hte(o){o.stopImmediatePropagation()}function a4(o){o.preventDefault(),o.stopImmediatePropagation()}function sme(o){var s=o.document.documentElement,i=Mh(o).on("dragstart.drag",a4,fR);"onselectstart"in s?i.on("selectstart.drag",a4,fR):(s.__noselect=s.style.MozUserSelect,s.style.MozUserSelect="none")}function rme(o,s){var i=o.document.documentElement,u=Mh(o).on("dragstart.drag",null);s&&(u.on("click.drag",a4,fR),setTimeout(function(){u.on("click.drag",null)},0)),"onselectstart"in i?u.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const BH=o=>()=>o;function xne(o,{sourceEvent:s,subject:i,target:u,identifier:m,active:h,x:b,y:C,dx:S,dy:_,dispatch:N}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},identifier:{value:m,enumerable:!0,configurable:!0},active:{value:h,enumerable:!0,configurable:!0},x:{value:b,enumerable:!0,configurable:!0},y:{value:C,enumerable:!0,configurable:!0},dx:{value:S,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:N}})}xne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function PIe(o){return!o.ctrlKey&&!o.button}function FIe(){return this.parentNode}function LIe(o,s){return s??{x:o.x,y:o.y}}function VIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function HIe(){var o=PIe,s=FIe,i=LIe,u=VIe,m={},h=BU("start","drag","end"),b=0,C,S,_,N,O=0;function B(me){me.on("mousedown.drag",F).filter(u).on("touchstart.drag",Y).on("touchmove.drag",q,IIe).on("touchend.drag touchcancel.drag",W).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function F(me,Ze){if(!(N||!o.call(this,me,Ze))){var _e=L(this,s.call(this,me,Ze),me,Ze,"mouse");_e&&(Mh(me.view).on("mousemove.drag",Z,fR).on("mouseup.drag",G,fR),sme(me.view),hte(me),_=!1,C=me.clientX,S=me.clientY,_e("start",me))}}function Z(me){if(a4(me),!_){var Ze=me.clientX-C,_e=me.clientY-S;_=Ze*Ze+_e*_e>O}m.mouse("drag",me)}function G(me){Mh(me.view).on("mousemove.drag mouseup.drag",null),rme(me.view,_),a4(me),m.mouse("end",me)}function Y(me,Ze){if(o.call(this,me,Ze)){var _e=me.changedTouches,Q=s.call(this,me,Ze),Fe=_e.length,lt,nt;for(lt=0;lt<Fe;++lt)(nt=L(this,Q,me,Ze,_e[lt].identifier,_e[lt]))&&(hte(me),nt("start",me,_e[lt]))}}function q(me){var Ze=me.changedTouches,_e=Ze.length,Q,Fe;for(Q=0;Q<_e;++Q)(Fe=m[Ze[Q].identifier])&&(a4(me),Fe("drag",me,Ze[Q]))}function W(me){var Ze=me.changedTouches,_e=Ze.length,Q,Fe;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),Q=0;Q<_e;++Q)(Fe=m[Ze[Q].identifier])&&(hte(me),Fe("end",me,Ze[Q]))}function L(me,Ze,_e,Q,Fe,lt){var nt=h.copy(),$e=Nv(lt||_e,Ze),ue,Nt,ge;if((ge=i.call(me,new xne("beforestart",{sourceEvent:_e,target:B,identifier:Fe,active:b,x:$e[0],y:$e[1],dx:0,dy:0,dispatch:nt}),Q))!=null)return ue=ge.x-$e[0]||0,Nt=ge.y-$e[1]||0,function Oe(R,je,ye){var tt=$e,st;switch(R){case"start":m[Fe]=Oe,st=b++;break;case"end":delete m[Fe],--b;case"drag":$e=Nv(ye||je,Ze),st=b;break}nt.call(R,me,new xne(R,{sourceEvent:je,subject:ge,target:B,identifier:Fe,active:st,x:$e[0]+ue,y:$e[1]+Nt,dx:$e[0]-tt[0],dy:$e[1]-tt[1],dispatch:nt}),Q)}}return B.filter=function(me){return arguments.length?(o=typeof me=="function"?me:BH(!!me),B):o},B.container=function(me){return arguments.length?(s=typeof me=="function"?me:BH(me),B):s},B.subject=function(me){return arguments.length?(i=typeof me=="function"?me:BH(me),B):i},B.touchable=function(me){return arguments.length?(u=typeof me=="function"?me:BH(!!me),B):u},B.on=function(){var me=h.on.apply(h,arguments);return me===h?B:me},B.clickDistance=function(me){return arguments.length?(O=(me=+me)*me,B):Math.sqrt(O)},B}function Voe(o,s,i){o.prototype=s.prototype=i,i.constructor=o}function ame(o,s){var i=Object.create(o.prototype);for(var u in s)i[u]=s[u];return i}function FR(){}var mR=.7,Iz=1/mR,i4="\\s*([+-]?\\d+)\\s*",pR="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zIe=/^#([0-9a-f]{3,8})$/,UIe=new RegExp(`^rgb\\(${i4},${i4},${i4}\\)$`),jIe=new RegExp(`^rgb\\(${Dv},${Dv},${Dv}\\)$`),WIe=new RegExp(`^rgba\\(${i4},${i4},${i4},${pR}\\)$`),ZIe=new RegExp(`^rgba\\(${Dv},${Dv},${Dv},${pR}\\)$`),GIe=new RegExp(`^hsl\\(${pR},${Dv},${Dv}\\)$`),qIe=new RegExp(`^hsla\\(${pR},${Dv},${Dv},${pR}\\)$`),gle={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};Voe(FR,gR,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:hle,formatHex:hle,formatHex8:YIe,formatHsl:KIe,formatRgb:vle,toString:vle});function hle(){return this.rgb().formatHex()}function YIe(){return this.rgb().formatHex8()}function KIe(){return ime(this).formatHsl()}function vle(){return this.rgb().formatRgb()}function gR(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=zIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?ble(s):i===3?new Sm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?IH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?IH(s>>12&15|s>>8&240,s>>8&15|s>>4&240,s>>4&15|s&240,((s&15)<<4|s&15)/255):null):(s=UIe.exec(o))?new Sm(s[1],s[2],s[3],1):(s=jIe.exec(o))?new Sm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=WIe.exec(o))?IH(s[1],s[2],s[3],s[4]):(s=ZIe.exec(o))?IH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=GIe.exec(o))?Cle(s[1],s[2]/100,s[3]/100,1):(s=qIe.exec(o))?Cle(s[1],s[2]/100,s[3]/100,s[4]):gle.hasOwnProperty(o)?ble(gle[o]):o==="transparent"?new Sm(NaN,NaN,NaN,0):null}function ble(o){return new Sm(o>>16&255,o>>8&255,o&255,1)}function IH(o,s,i,u){return u<=0&&(o=s=i=NaN),new Sm(o,s,i,u)}function XIe(o){return o instanceof FR||(o=gR(o)),o?(o=o.rgb(),new Sm(o.r,o.g,o.b,o.opacity)):new Sm}function Ene(o,s,i,u){return arguments.length===1?XIe(o):new Sm(o,s,i,u??1)}function Sm(o,s,i,u){this.r=+o,this.g=+s,this.b=+i,this.opacity=+u}Voe(Sm,Ene,ame(FR,{brighter(o){return o=o==null?Iz:Math.pow(Iz,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?mR:Math.pow(mR,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new Sm(EE(this.r),EE(this.g),EE(this.b),Pz(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:yle,formatHex:yle,formatHex8:JIe,formatRgb:wle,toString:wle}));function yle(){return`#${vE(this.r)}${vE(this.g)}${vE(this.b)}`}function JIe(){return`#${vE(this.r)}${vE(this.g)}${vE(this.b)}${vE((isNaN(this.opacity)?1:this.opacity)*255)}`}function wle(){const o=Pz(this.opacity);return`${o===1?"rgb(":"rgba("}${EE(this.r)}, ${EE(this.g)}, ${EE(this.b)}${o===1?")":`, ${o})`}`}function Pz(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function EE(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function vE(o){return o=EE(o),(o<16?"0":"")+o.toString(16)}function Cle(o,s,i,u){return u<=0?o=s=i=NaN:i<=0||i>=1?o=s=NaN:s<=0&&(o=NaN),new Rh(o,s,i,u)}function ime(o){if(o instanceof Rh)return new Rh(o.h,o.s,o.l,o.opacity);if(o instanceof FR||(o=gR(o)),!o)return new Rh;if(o instanceof Rh)return o;o=o.rgb();var s=o.r/255,i=o.g/255,u=o.b/255,m=Math.min(s,i,u),h=Math.max(s,i,u),b=NaN,C=h-m,S=(h+m)/2;return C?(s===h?b=(i-u)/C+(i<u)*6:i===h?b=(u-s)/C+2:b=(s-i)/C+4,C/=S<.5?h+m:2-h-m,b*=60):C=S>0&&S<1?0:b,new Rh(b,C,S,o.opacity)}function QIe(o,s,i,u){return arguments.length===1?ime(o):new Rh(o,s,i,u??1)}function Rh(o,s,i,u){this.h=+o,this.s=+s,this.l=+i,this.opacity=+u}Voe(Rh,QIe,ame(FR,{brighter(o){return o=o==null?Iz:Math.pow(Iz,o),new Rh(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?mR:Math.pow(mR,o),new Rh(this.h,this.s,this.l*o,this.opacity)},rgb(){var o=this.h%360+(this.h<0)*360,s=isNaN(o)||isNaN(this.s)?0:this.s,i=this.l,u=i+(i<.5?i:1-i)*s,m=2*i-u;return new Sm(vte(o>=240?o-240:o+120,m,u),vte(o,m,u),vte(o<120?o+240:o-120,m,u),this.opacity)},clamp(){return new Rh(Sle(this.h),PH(this.s),PH(this.l),Pz(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=Pz(this.opacity);return`${o===1?"hsl(":"hsla("}${Sle(this.h)}, ${PH(this.s)*100}%, ${PH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function Sle(o){return o=(o||0)%360,o<0?o+360:o}function PH(o){return Math.max(0,Math.min(1,o||0))}function vte(o,s,i){return(o<60?s+(i-s)*o/60:o<180?i:o<240?s+(i-s)*(240-o)/60:s)*255}const lme=o=>()=>o;function ePe(o,s){return function(i){return o+i*s}}function tPe(o,s,i){return o=Math.pow(o,i),s=Math.pow(s,i)-o,i=1/i,function(u){return Math.pow(o+u*s,i)}}function nPe(o){return(o=+o)==1?cme:function(s,i){return i-s?tPe(s,i,o):lme(isNaN(s)?i:s)}}function cme(o,s){var i=s-o;return i?ePe(o,i):lme(isNaN(o)?s:o)}const xle=function o(s){var i=nPe(s);function u(m,h){var b=i((m=Ene(m)).r,(h=Ene(h)).r),C=i(m.g,h.g),S=i(m.b,h.b),_=cme(m.opacity,h.opacity);return function(N){return m.r=b(N),m.g=C(N),m.b=S(N),m.opacity=_(N),m+""}}return u.gamma=o,u}(1);function r2(o,s){return o=+o,s=+s,function(i){return o*(1-i)+s*i}}var _ne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bte=new RegExp(_ne.source,"g");function oPe(o){return function(){return o}}function sPe(o){return function(s){return o(s)+""}}function rPe(o,s){var i=_ne.lastIndex=bte.lastIndex=0,u,m,h,b=-1,C=[],S=[];for(o=o+"",s=s+"";(u=_ne.exec(o))&&(m=bte.exec(s));)(h=m.index)>i&&(h=s.slice(i,h),C[b]?C[b]+=h:C[++b]=h),(u=u[0])===(m=m[0])?C[b]?C[b]+=m:C[++b]=m:(C[++b]=null,S.push({i:b,x:r2(u,m)})),i=bte.lastIndex;return i<s.length&&(h=s.slice(i),C[b]?C[b]+=h:C[++b]=h),C.length<2?S[0]?sPe(S[0].x):oPe(s):(s=S.length,function(_){for(var N=0,O;N<s;++N)C[(O=S[N]).i]=O.x(_);return C.join("")})}var Ele=180/Math.PI,kne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ume(o,s,i,u,m,h){var b,C,S;return(b=Math.sqrt(o*o+s*s))&&(o/=b,s/=b),(S=o*i+s*u)&&(i-=o*S,u-=s*S),(C=Math.sqrt(i*i+u*u))&&(i/=C,u/=C,S/=C),o*u<s*i&&(o=-o,s=-s,S=-S,b=-b),{translateX:m,translateY:h,rotate:Math.atan2(s,o)*Ele,skewX:Math.atan(S)*Ele,scaleX:b,scaleY:C}}var FH;function aPe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?kne:ume(s.a,s.b,s.c,s.d,s.e,s.f)}function iPe(o){return o==null||(FH||(FH=document.createElementNS("http://www.w3.org/2000/svg","g")),FH.setAttribute("transform",o),!(o=FH.transform.baseVal.consolidate()))?kne:(o=o.matrix,ume(o.a,o.b,o.c,o.d,o.e,o.f))}function dme(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,B,F,Z){if(_!==O||N!==B){var G=F.push("translate(",null,s,null,i);Z.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,B)})}else(O||B)&&F.push("translate("+O+s+B+i)}function b(_,N,O,B){_!==N?(_-N>180?N+=360:N-_>180&&(_+=360),B.push({i:O.push(m(O)+"rotate(",null,u)-2,x:r2(_,N)})):N&&O.push(m(O)+"rotate("+N+u)}function C(_,N,O,B){_!==N?B.push({i:O.push(m(O)+"skewX(",null,u)-2,x:r2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function S(_,N,O,B,F,Z){if(_!==O||N!==B){var G=F.push(m(F)+"scale(",null,",",null,")");Z.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,B)})}else(O!==1||B!==1)&&F.push(m(F)+"scale("+O+","+B+")")}return function(_,N){var O=[],B=[];return _=o(_),N=o(N),h(_.translateX,_.translateY,N.translateX,N.translateY,O,B),b(_.rotate,N.rotate,O,B),C(_.skewX,N.skewX,O,B),S(_.scaleX,_.scaleY,N.scaleX,N.scaleY,O,B),_=N=null,function(F){for(var Z=-1,G=B.length,Y;++Z<G;)O[(Y=B[Z]).i]=Y.x(F);return O.join("")}}}var lPe=dme(aPe,"px, ","px)","deg)"),cPe=dme(iPe,", ",")",")"),uPe=1e-12;function _le(o){return((o=Math.exp(o))+1/o)/2}function dPe(o){return((o=Math.exp(o))-1/o)/2}function fPe(o){return((o=Math.exp(2*o))-1)/(o+1)}const mPe=function o(s,i,u){function m(h,b){var C=h[0],S=h[1],_=h[2],N=b[0],O=b[1],B=b[2],F=N-C,Z=O-S,G=F*F+Z*Z,Y,q;if(G<uPe)q=Math.log(B/_)/s,Y=function(Q){return[C+Q*F,S+Q*Z,_*Math.exp(s*Q*q)]};else{var W=Math.sqrt(G),L=(B*B-_*_+u*G)/(2*_*i*W),me=(B*B-_*_-u*G)/(2*B*i*W),Ze=Math.log(Math.sqrt(L*L+1)-L),_e=Math.log(Math.sqrt(me*me+1)-me);q=(_e-Ze)/s,Y=function(Q){var Fe=Q*q,lt=_le(Ze),nt=_/(i*W)*(lt*fPe(s*Fe+Ze)-dPe(Ze));return[C+nt*F,S+nt*Z,_*lt/_le(s*Fe+Ze)]}}return Y.duration=q*1e3*s/Math.SQRT2,Y}return m.rho=function(h){var b=Math.max(.001,+h),C=b*b,S=C*C;return o(b,C,S)},m}(Math.SQRT2,2,4);var h4=0,F6=0,B6=0,fme=1e3,Fz,L6,Lz=0,OE=0,PU=0,hR=typeof performance=="object"&&performance.now?performance:Date,mme=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function Hoe(){return OE||(mme(pPe),OE=hR.now()+PU)}function pPe(){OE=0}function Vz(){this._call=this._time=this._next=null}Vz.prototype=pme.prototype={constructor:Vz,restart:function(o,s,i){if(typeof o!="function")throw new TypeError("callback is not a function");i=(i==null?Hoe():+i)+(s==null?0:+s),!this._next&&L6!==this&&(L6?L6._next=this:Fz=this,L6=this),this._call=o,this._time=i,Tne()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tne())}};function pme(o,s,i){var u=new Vz;return u.restart(o,s,i),u}function gPe(){Hoe(),++h4;for(var o=Fz,s;o;)(s=OE-o._time)>=0&&o._call.call(void 0,s),o=o._next;--h4}function kle(){OE=(Lz=hR.now())+PU,h4=F6=0;try{gPe()}finally{h4=0,vPe(),OE=0}}function hPe(){var o=hR.now(),s=o-Lz;s>fme&&(PU-=s,Lz=o)}function vPe(){for(var o,s=Fz,i,u=1/0;s;)s._call?(u>s._time&&(u=s._time),o=s,s=s._next):(i=s._next,s._next=null,s=o?o._next=i:Fz=i);L6=o,Tne(u)}function Tne(o){if(!h4){F6&&(F6=clearTimeout(F6));var s=o-OE;s>24?(o<1/0&&(F6=setTimeout(kle,o-hR.now()-PU)),B6&&(B6=clearInterval(B6))):(B6||(Lz=hR.now(),B6=setInterval(hPe,fme)),h4=1,mme(kle))}}function Tle(o,s,i){var u=new Vz;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var bPe=BU("start","end","cancel","interrupt"),yPe=[],gme=0,Ale=1,Ane=2,iz=3,Nle=4,Nne=5,lz=6;function FU(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;wPe(o,i,{name:s,index:u,group:m,on:bPe,tween:yPe,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:gme})}function zoe(o,s){var i=Ph(o,s);if(i.state>gme)throw new Error("too late; already scheduled");return i}function Fv(o,s){var i=Ph(o,s);if(i.state>iz)throw new Error("too late; already running");return i}function Ph(o,s){var i=o.__transition;if(!i||!(i=i[s]))throw new Error("transition not found");return i}function wPe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=pme(h,0,i.time);function h(_){i.state=Ale,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,B,F;if(i.state!==Ale)return S();for(N in u)if(F=u[N],F.name===i.name){if(F.state===iz)return Tle(b);F.state===Nle?(F.state=lz,F.timer.stop(),F.on.call("interrupt",o,o.__data__,F.index,F.group),delete u[N]):+N<s&&(F.state=lz,F.timer.stop(),F.on.call("cancel",o,o.__data__,F.index,F.group),delete u[N])}if(Tle(function(){i.state===iz&&(i.state=Nle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=Ane,i.on.call("start",o,o.__data__,i.index,i.group),i.state===Ane){for(i.state=iz,m=new Array(B=i.tween.length),N=0,O=-1;N<B;++N)(F=i.tween[N].value.call(o,o.__data__,i.index,i.group))&&(m[++O]=F);m.length=O+1}}function C(_){for(var N=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(S),i.state=Nne,1),O=-1,B=m.length;++O<B;)m[O].call(o,N);i.state===Nne&&(i.on.call("end",o,o.__data__,i.index,i.group),S())}function S(){i.state=lz,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function cz(o,s){var i=o.__transition,u,m,h=!0,b;if(i){s=s==null?null:s+"";for(b in i){if((u=i[b]).name!==s){h=!1;continue}m=u.state>Ane&&u.state<Nne,u.state=lz,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function CPe(o){return this.each(function(){cz(this,o)})}function SPe(o,s){var i,u;return function(){var m=Fv(this,o),h=m.tween;if(h!==i){u=i=h;for(var b=0,C=u.length;b<C;++b)if(u[b].name===s){u=u.slice(),u.splice(b,1);break}}m.tween=u}}function xPe(o,s,i){var u,m;if(typeof i!="function")throw new Error;return function(){var h=Fv(this,o),b=h.tween;if(b!==u){m=(u=b).slice();for(var C={name:s,value:i},S=0,_=m.length;S<_;++S)if(m[S].name===s){m[S]=C;break}S===_&&m.push(C)}h.tween=m}}function EPe(o,s){var i=this._id;if(o+="",arguments.length<2){for(var u=Ph(this.node(),i).tween,m=0,h=u.length,b;m<h;++m)if((b=u[m]).name===o)return b.value;return null}return this.each((s==null?SPe:xPe)(i,o,s))}function Uoe(o,s,i){var u=o._id;return o.each(function(){var m=Fv(this,u);(m.value||(m.value={}))[s]=i.apply(this,arguments)}),function(m){return Ph(m,u).value[s]}}function hme(o,s){var i;return(typeof s=="number"?r2:s instanceof gR?xle:(i=gR(s))?(s=i,xle):rPe)(o,s)}function _Pe(o){return function(){this.removeAttribute(o)}}function kPe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function TPe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttribute(o);return b===m?null:b===u?h:h=s(u=b,i)}}function APe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttributeNS(o.space,o.local);return b===m?null:b===u?h:h=s(u=b,i)}}function NPe(o,s,i){var u,m,h;return function(){var b,C=i(this),S;return C==null?void this.removeAttribute(o):(b=this.getAttribute(o),S=C+"",b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C)))}}function OPe(o,s,i){var u,m,h;return function(){var b,C=i(this),S;return C==null?void this.removeAttributeNS(o.space,o.local):(b=this.getAttributeNS(o.space,o.local),S=C+"",b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C)))}}function $Pe(o,s){var i=IU(o),u=i==="transform"?cPe:hme;return this.attrTween(o,typeof s=="function"?(i.local?OPe:NPe)(i,u,Uoe(this,"attr."+o,s)):s==null?(i.local?kPe:_Pe)(i):(i.local?APe:TPe)(i,u,s))}function DPe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function MPe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function RPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&MPe(o,h)),i}return m._value=s,m}function BPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&DPe(o,h)),i}return m._value=s,m}function IPe(o,s){var i="attr."+o;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(s==null)return this.tween(i,null);if(typeof s!="function")throw new Error;var u=IU(o);return this.tween(i,(u.local?RPe:BPe)(u,s))}function PPe(o,s){return function(){zoe(this,o).delay=+s.apply(this,arguments)}}function FPe(o,s){return s=+s,function(){zoe(this,o).delay=s}}function LPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?PPe:FPe)(s,o)):Ph(this.node(),s).delay}function VPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function HPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function zPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?VPe:HPe)(s,o)):Ph(this.node(),s).duration}function UPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function jPe(o){var s=this._id;return arguments.length?this.each(UPe(s,o)):Ph(this.node(),s).ease}function WPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function ZPe(o){if(typeof o!="function")throw new Error;return this.each(WPe(this._id,o))}function GPe(o){typeof o!="function"&&(o=qfe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],S,_=0;_<b;++_)(S=h[_])&&o.call(S,S.__data__,_,h)&&C.push(S);return new L0(u,this._parents,this._name,this._id)}function qPe(o){if(o._id!==this._id)throw new Error;for(var s=this._groups,i=o._groups,u=s.length,m=i.length,h=Math.min(u,m),b=new Array(u),C=0;C<h;++C)for(var S=s[C],_=i[C],N=S.length,O=b[C]=new Array(N),B,F=0;F<N;++F)(B=S[F]||_[F])&&(O[F]=B);for(;C<u;++C)b[C]=s[C];return new L0(b,this._parents,this._name,this._id)}function YPe(o){return(o+"").trim().split(/^|\s+/).every(function(s){var i=s.indexOf(".");return i>=0&&(s=s.slice(0,i)),!s||s==="start"})}function KPe(o,s,i){var u,m,h=YPe(s)?zoe:Fv;return function(){var b=h(this,o),C=b.on;C!==u&&(m=(u=C).copy()).on(s,i),b.on=m}}function XPe(o,s){var i=this._id;return arguments.length<2?Ph(this.node(),i).on.on(o):this.each(KPe(i,o,s))}function JPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function QPe(){return this.on("end.remove",JPe(this._id))}function e8e(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Foe(o));for(var u=this._groups,m=u.length,h=new Array(m),b=0;b<m;++b)for(var C=u[b],S=C.length,_=h[b]=new Array(S),N,O,B=0;B<S;++B)(N=C[B])&&(O=o.call(N,N.__data__,B,C))&&("__data__"in N&&(O.__data__=N.__data__),_[B]=O,FU(_[B],s,i,B,_,Ph(N,i)));return new L0(h,this._parents,s,i)}function t8e(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Gfe(o));for(var u=this._groups,m=u.length,h=[],b=[],C=0;C<m;++C)for(var S=u[C],_=S.length,N,O=0;O<_;++O)if(N=S[O]){for(var B=o.call(N,N.__data__,O,S),F,Z=Ph(N,i),G=0,Y=B.length;G<Y;++G)(F=B[G])&&FU(F,s,i,G,B,Z);h.push(B),b.push(N)}return new L0(h,b,s,i)}var n8e=PR.prototype.constructor;function o8e(){return new n8e(this._groups,this._parents)}function s8e(o,s){var i,u,m;return function(){var h=g4(this,o),b=(this.style.removeProperty(o),g4(this,o));return h===b?null:h===i&&b===u?m:m=s(i=h,u=b)}}function vme(o){return function(){this.style.removeProperty(o)}}function r8e(o,s,i){var u,m=i+"",h;return function(){var b=g4(this,o);return b===m?null:b===u?h:h=s(u=b,i)}}function a8e(o,s,i){var u,m,h;return function(){var b=g4(this,o),C=i(this),S=C+"";return C==null&&(S=C=(this.style.removeProperty(o),g4(this,o))),b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C))}}function i8e(o,s){var i,u,m,h="style."+s,b="end."+h,C;return function(){var S=Fv(this,o),_=S.on,N=S.value[h]==null?C||(C=vme(s)):void 0;(_!==i||m!==N)&&(u=(i=_).copy()).on(b,m=N),S.on=u}}function l8e(o,s,i){var u=(o+="")=="transform"?lPe:hme;return s==null?this.styleTween(o,s8e(o,u)).on("end.style."+o,vme(o)):typeof s=="function"?this.styleTween(o,a8e(o,u,Uoe(this,"style."+o,s))).each(i8e(this._id,o)):this.styleTween(o,r8e(o,u,s),i).on("end.style."+o,null)}function c8e(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function u8e(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&c8e(o,b,i)),u}return h._value=s,h}function d8e(o,s,i){var u="style."+(o+="");if(arguments.length<2)return(u=this.tween(u))&&u._value;if(s==null)return this.tween(u,null);if(typeof s!="function")throw new Error;return this.tween(u,u8e(o,s,i??""))}function f8e(o){return function(){this.textContent=o}}function m8e(o){return function(){var s=o(this);this.textContent=s??""}}function p8e(o){return this.tween("text",typeof o=="function"?m8e(Uoe(this,"text",o)):f8e(o==null?"":o+""))}function g8e(o){return function(s){this.textContent=o.call(this,s)}}function h8e(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&g8e(m)),s}return u._value=o,u}function v8e(o){var s="text";if(arguments.length<1)return(s=this.tween(s))&&s._value;if(o==null)return this.tween(s,null);if(typeof o!="function")throw new Error;return this.tween(s,h8e(o))}function b8e(){for(var o=this._name,s=this._id,i=bme(),u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,S,_=0;_<C;++_)if(S=b[_]){var N=Ph(S,s);FU(S,o,i,_,b,{time:N.time+N.delay+N.duration,delay:0,duration:N.duration,ease:N.ease})}return new L0(u,this._parents,o,i)}function y8e(){var o,s,i=this,u=i._id,m=i.size();return new Promise(function(h,b){var C={value:b},S={value:function(){--m===0&&h()}};i.each(function(){var _=Fv(this,u),N=_.on;N!==o&&(s=(o=N).copy(),s._.cancel.push(C),s._.interrupt.push(C),s._.end.push(S)),_.on=s}),m===0&&h()})}var w8e=0;function L0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function bme(){return++w8e}var O0=PR.prototype;L0.prototype={constructor:L0,select:e8e,selectAll:t8e,selectChild:O0.selectChild,selectChildren:O0.selectChildren,filter:GPe,merge:qPe,selection:o8e,transition:b8e,call:O0.call,nodes:O0.nodes,node:O0.node,size:O0.size,empty:O0.empty,each:O0.each,on:XPe,attr:$Pe,attrTween:IPe,style:l8e,styleTween:d8e,text:p8e,textTween:v8e,remove:QPe,tween:EPe,delay:LPe,duration:zPe,ease:jPe,easeVarying:ZPe,end:y8e,[Symbol.iterator]:O0[Symbol.iterator]};function C8e(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var S8e={time:null,delay:0,duration:250,ease:C8e};function x8e(o,s){for(var i;!(i=o.__transition)||!(i=i[s]);)if(!(o=o.parentNode))throw new Error(`transition ${s} not found`);return i}function E8e(o){var s,i;o instanceof L0?(s=o._id,o=o._name):(s=bme(),(i=S8e).time=Hoe(),o=o==null?null:o+"");for(var u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,S,_=0;_<C;++_)(S=b[_])&&FU(S,o,s,_,b,i||x8e(S,s));return new L0(u,this._parents,o,s)}PR.prototype.interrupt=CPe;PR.prototype.transition=E8e;const LH=o=>()=>o;function _8e(o,{sourceEvent:s,target:i,transform:u,dispatch:m}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:m}})}function B0(o,s,i){this.k=o,this.x=s,this.y=i}B0.prototype={constructor:B0,scale:function(o){return o===1?this:new B0(this.k*o,this.x,this.y)},translate:function(o,s){return o===0&s===0?this:new B0(this.k,this.x+this.k*o,this.y+this.k*s)},apply:function(o){return[o[0]*this.k+this.x,o[1]*this.k+this.y]},applyX:function(o){return o*this.k+this.x},applyY:function(o){return o*this.k+this.y},invert:function(o){return[(o[0]-this.x)/this.k,(o[1]-this.y)/this.k]},invertX:function(o){return(o-this.x)/this.k},invertY:function(o){return(o-this.y)/this.k},rescaleX:function(o){return o.copy().domain(o.range().map(this.invertX,this).map(o.invert,o))},rescaleY:function(o){return o.copy().domain(o.range().map(this.invertY,this).map(o.invert,o))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var v4=new B0(1,0,0);B0.prototype;function yte(o){o.stopImmediatePropagation()}function I6(o){o.preventDefault(),o.stopImmediatePropagation()}function k8e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function T8e(){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 Ole(){return this.__zoom||v4}function A8e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function N8e(){return navigator.maxTouchPoints||"ontouchstart"in this}function O8e(o,s,i){var u=o.invertX(s[0][0])-i[0][0],m=o.invertX(s[1][0])-i[1][0],h=o.invertY(s[0][1])-i[0][1],b=o.invertY(s[1][1])-i[1][1];return o.translate(m>u?(u+m)/2:Math.min(0,u)||Math.max(0,m),b>h?(h+b)/2:Math.min(0,h)||Math.max(0,b))}function $8e(){var o=k8e,s=T8e,i=O8e,u=A8e,m=N8e,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,S=mPe,_=BU("start","zoom","end"),N,O,B,F=500,Z=150,G=0,Y=10;function q(ge){ge.property("__zoom",Ole).on("wheel.zoom",Fe,{passive:!1}).on("mousedown.zoom",lt).on("dblclick.zoom",nt).filter(m).on("touchstart.zoom",$e).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",Nt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}q.transform=function(ge,Oe,R,je){var ye=ge.selection?ge.selection():ge;ye.property("__zoom",Ole),ge!==ye?Ze(ge,Oe,R,je):ye.interrupt().each(function(){_e(this,arguments).event(je).start().zoom(null,typeof Oe=="function"?Oe.apply(this,arguments):Oe).end()})},q.scaleBy=function(ge,Oe,R,je){q.scaleTo(ge,function(){var ye=this.__zoom.k,tt=typeof Oe=="function"?Oe.apply(this,arguments):Oe;return ye*tt},R,je)},q.scaleTo=function(ge,Oe,R,je){q.transform(ge,function(){var ye=s.apply(this,arguments),tt=this.__zoom,st=R==null?me(ye):typeof R=="function"?R.apply(this,arguments):R,he=tt.invert(st),Ge=typeof Oe=="function"?Oe.apply(this,arguments):Oe;return i(L(W(tt,Ge),st,he),ye,b)},R,je)},q.translateBy=function(ge,Oe,R,je){q.transform(ge,function(){return i(this.__zoom.translate(typeof Oe=="function"?Oe.apply(this,arguments):Oe,typeof R=="function"?R.apply(this,arguments):R),s.apply(this,arguments),b)},null,je)},q.translateTo=function(ge,Oe,R,je,ye){q.transform(ge,function(){var tt=s.apply(this,arguments),st=this.__zoom,he=je==null?me(tt):typeof je=="function"?je.apply(this,arguments):je;return i(v4.translate(he[0],he[1]).scale(st.k).translate(typeof Oe=="function"?-Oe.apply(this,arguments):-Oe,typeof R=="function"?-R.apply(this,arguments):-R),tt,b)},je,ye)};function W(ge,Oe){return Oe=Math.max(h[0],Math.min(h[1],Oe)),Oe===ge.k?ge:new B0(Oe,ge.x,ge.y)}function L(ge,Oe,R){var je=Oe[0]-R[0]*ge.k,ye=Oe[1]-R[1]*ge.k;return je===ge.x&&ye===ge.y?ge:new B0(ge.k,je,ye)}function me(ge){return[(+ge[0][0]+ +ge[1][0])/2,(+ge[0][1]+ +ge[1][1])/2]}function Ze(ge,Oe,R,je){ge.on("start.zoom",function(){_e(this,arguments).event(je).start()}).on("interrupt.zoom end.zoom",function(){_e(this,arguments).event(je).end()}).tween("zoom",function(){var ye=this,tt=arguments,st=_e(ye,tt).event(je),he=s.apply(ye,tt),Ge=R==null?me(he):typeof R=="function"?R.apply(ye,tt):R,Tt=Math.max(he[1][0]-he[0][0],he[1][1]-he[0][1]),ze=ye.__zoom,vt=typeof Oe=="function"?Oe.apply(ye,tt):Oe,Be=S(ze.invert(Ge).concat(Tt/ze.k),vt.invert(Ge).concat(Tt/vt.k));return function(ft){if(ft===1)ft=vt;else{var oe=Be(ft),pn=Tt/oe[2];ft=new B0(pn,Ge[0]-oe[0]*pn,Ge[1]-oe[1]*pn)}st.zoom(null,ft)}})}function _e(ge,Oe,R){return!R&&ge.__zooming||new Q(ge,Oe)}function Q(ge,Oe){this.that=ge,this.args=Oe,this.active=0,this.sourceEvent=null,this.extent=s.apply(ge,Oe),this.taps=0}Q.prototype={event:function(ge){return ge&&(this.sourceEvent=ge),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(ge,Oe){return this.mouse&&ge!=="mouse"&&(this.mouse[1]=Oe.invert(this.mouse[0])),this.touch0&&ge!=="touch"&&(this.touch0[1]=Oe.invert(this.touch0[0])),this.touch1&&ge!=="touch"&&(this.touch1[1]=Oe.invert(this.touch1[0])),this.that.__zoom=Oe,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(ge){var Oe=Mh(this.that).datum();_.call(ge,this.that,new _8e(ge,{sourceEvent:this.sourceEvent,target:q,type:ge,transform:this.that.__zoom,dispatch:_}),Oe)}};function Fe(ge,...Oe){if(!o.apply(this,arguments))return;var R=_e(this,Oe).event(ge),je=this.__zoom,ye=Math.max(h[0],Math.min(h[1],je.k*Math.pow(2,u.apply(this,arguments)))),tt=Nv(ge);if(R.wheel)(R.mouse[0][0]!==tt[0]||R.mouse[0][1]!==tt[1])&&(R.mouse[1]=je.invert(R.mouse[0]=tt)),clearTimeout(R.wheel);else{if(je.k===ye)return;R.mouse=[tt,je.invert(tt)],cz(this),R.start()}I6(ge),R.wheel=setTimeout(st,Z),R.zoom("mouse",i(L(W(je,ye),R.mouse[0],R.mouse[1]),R.extent,b));function st(){R.wheel=null,R.end()}}function lt(ge,...Oe){if(B||!o.apply(this,arguments))return;var R=ge.currentTarget,je=_e(this,Oe,!0).event(ge),ye=Mh(ge.view).on("mousemove.zoom",Ge,!0).on("mouseup.zoom",Tt,!0),tt=Nv(ge,R),st=ge.clientX,he=ge.clientY;sme(ge.view),yte(ge),je.mouse=[tt,this.__zoom.invert(tt)],cz(this),je.start();function Ge(ze){if(I6(ze),!je.moved){var vt=ze.clientX-st,Be=ze.clientY-he;je.moved=vt*vt+Be*Be>G}je.event(ze).zoom("mouse",i(L(je.that.__zoom,je.mouse[0]=Nv(ze,R),je.mouse[1]),je.extent,b))}function Tt(ze){ye.on("mousemove.zoom mouseup.zoom",null),rme(ze.view,je.moved),I6(ze),je.event(ze).end()}}function nt(ge,...Oe){if(o.apply(this,arguments)){var R=this.__zoom,je=Nv(ge.changedTouches?ge.changedTouches[0]:ge,this),ye=R.invert(je),tt=R.k*(ge.shiftKey?.5:2),st=i(L(W(R,tt),je,ye),s.apply(this,Oe),b);I6(ge),C>0?Mh(this).transition().duration(C).call(Ze,st,je,ge):Mh(this).call(q.transform,st,je,ge)}}function $e(ge,...Oe){if(o.apply(this,arguments)){var R=ge.touches,je=R.length,ye=_e(this,Oe,ge.changedTouches.length===je).event(ge),tt,st,he,Ge;for(yte(ge),st=0;st<je;++st)he=R[st],Ge=Nv(he,this),Ge=[Ge,this.__zoom.invert(Ge),he.identifier],ye.touch0?!ye.touch1&&ye.touch0[2]!==Ge[2]&&(ye.touch1=Ge,ye.taps=0):(ye.touch0=Ge,tt=!0,ye.taps=1+!!N);N&&(N=clearTimeout(N)),tt&&(ye.taps<2&&(O=Ge[0],N=setTimeout(function(){N=null},F)),cz(this),ye.start())}}function ue(ge,...Oe){if(this.__zooming){var R=_e(this,Oe).event(ge),je=ge.changedTouches,ye=je.length,tt,st,he,Ge;for(I6(ge),tt=0;tt<ye;++tt)st=je[tt],he=Nv(st,this),R.touch0&&R.touch0[2]===st.identifier?R.touch0[0]=he:R.touch1&&R.touch1[2]===st.identifier&&(R.touch1[0]=he);if(st=R.that.__zoom,R.touch1){var Tt=R.touch0[0],ze=R.touch0[1],vt=R.touch1[0],Be=R.touch1[1],ft=(ft=vt[0]-Tt[0])*ft+(ft=vt[1]-Tt[1])*ft,oe=(oe=Be[0]-ze[0])*oe+(oe=Be[1]-ze[1])*oe;st=W(st,Math.sqrt(ft/oe)),he=[(Tt[0]+vt[0])/2,(Tt[1]+vt[1])/2],Ge=[(ze[0]+Be[0])/2,(ze[1]+Be[1])/2]}else if(R.touch0)he=R.touch0[0],Ge=R.touch0[1];else return;R.zoom("touch",i(L(st,he,Ge),R.extent,b))}}function Nt(ge,...Oe){if(this.__zooming){var R=_e(this,Oe).event(ge),je=ge.changedTouches,ye=je.length,tt,st;for(yte(ge),B&&clearTimeout(B),B=setTimeout(function(){B=null},F),tt=0;tt<ye;++tt)st=je[tt],R.touch0&&R.touch0[2]===st.identifier?delete R.touch0:R.touch1&&R.touch1[2]===st.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(st=Nv(st,this),Math.hypot(O[0]-st[0],O[1]-st[1])<Y)){var he=Mh(this).on("dblclick.zoom");he&&he.apply(this,arguments)}}}return q.wheelDelta=function(ge){return arguments.length?(u=typeof ge=="function"?ge:LH(+ge),q):u},q.filter=function(ge){return arguments.length?(o=typeof ge=="function"?ge:LH(!!ge),q):o},q.touchable=function(ge){return arguments.length?(m=typeof ge=="function"?ge:LH(!!ge),q):m},q.extent=function(ge){return arguments.length?(s=typeof ge=="function"?ge:LH([[+ge[0][0],+ge[0][1]],[+ge[1][0],+ge[1][1]]]),q):s},q.scaleExtent=function(ge){return arguments.length?(h[0]=+ge[0],h[1]=+ge[1],q):[h[0],h[1]]},q.translateExtent=function(ge){return arguments.length?(b[0][0]=+ge[0][0],b[1][0]=+ge[1][0],b[0][1]=+ge[0][1],b[1][1]=+ge[1][1],q):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},q.constrain=function(ge){return arguments.length?(i=ge,q):i},q.duration=function(ge){return arguments.length?(C=+ge,q):C},q.interpolate=function(ge){return arguments.length?(S=ge,q):S},q.on=function(){var ge=_.on.apply(_,arguments);return ge===_?q:ge},q.clickDistance=function(ge){return arguments.length?(G=(ge=+ge)*ge,q):Math.sqrt(G)},q.tapDistance=function(ge){return arguments.length?(Y=+ge,q):Y},q}var ss=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(ss||{}),joe=(o=>(o.Partial="partial",o.Full="full",o))(joe||{}),mE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(mE||{}),b2=(o=>(o.Strict="strict",o.Loose="loose",o))(b2||{}),Hz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(Hz||{}),K6=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(K6||{}),yme=(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))(yme||{});const D8e=["INPUT","SELECT","TEXTAREA"];function One(o){var s,i;const u=((i=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:i[0])||o.target,m=typeof(u==null?void 0:u.hasAttribute)=="function"?u.hasAttribute("contenteditable"):!1,h=typeof(u==null?void 0:u.closest)=="function"?u.closest(".nokey"):null;return D8e.includes(u==null?void 0:u.nodeName)||m||!!h}function M8e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function $le(o,s,i,u){const m=s.replace("+",`
|
|
119
|
+
`));return ue(ce.split(""),u).length},tt=(te,ie)=>{const ce=Oe(te,ie).join("");return je(ce)},st=(te,ie)=>{const ce=Oe(te,ie).join("").replace(/\s/g,"");return je(ce)},he=(te,ie)=>()=>ie(te.getBody(),te.schema),Ge=(te,ie)=>()=>ie(te.selection.getRng().cloneContents(),te.schema),Tt=te=>he(te,ye),ze=te=>({body:{getWordCount:Tt(te),getCharacterCount:he(te,tt),getCharacterCountWithoutSpaces:he(te,st)},selection:{getWordCount:Ge(te,ye),getCharacterCount:Ge(te,tt),getCharacterCountWithoutSpaces:Ge(te,st)},getCount:Tt(te)}),vt=(te,ie)=>{te.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(ie.body.getWordCount()),String(ie.selection.getWordCount())],["Characters (no spaces)",String(ie.body.getCharacterCountWithoutSpaces()),String(ie.selection.getCharacterCountWithoutSpaces())],["Characters",String(ie.body.getCharacterCount()),String(ie.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},Be=(te,ie)=>{te.addCommand("mceWordCount",()=>vt(te,ie))},ft=(te,ie)=>{let ce=null;return{cancel:()=>{i(ce)||(clearTimeout(ce),ce=null)},throttle:(...Me)=>{i(ce)&&(ce=setTimeout(()=>{ce=null,te.apply(null,Me)},ie))}}};var oe=tinymce.util.Tools.resolve("tinymce.util.Delay");const pn=(te,ie)=>{te.dispatch("wordCountUpdate",{wordCount:{words:ie.body.getWordCount(),characters:ie.body.getCharacterCount(),charactersWithoutSpaces:ie.body.getCharacterCountWithoutSpaces()}})},gt=(te,ie)=>{pn(te,ie)},St=(te,ie,ce)=>{const X=ft(()=>gt(te,ie),ce);te.on("init",()=>{gt(te,ie),oe.setEditorTimeout(te,()=>{te.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",X.throttle)},0),te.on("remove",X.cancel)})},jt=te=>{const ie=()=>te.execCommand("mceWordCount");te.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:ie,context:"any"}),te.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:ie,context:"any"})};var Ct=(te=300)=>{o.add("wordcount",ie=>{const ce=ze(ie);return Be(ie,ce),jt(ie),St(ie,ce,te),ce})};Ct()})();const LMe=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),VMe=(o,s="wps_office")=>{const i=o.split(","),u=i[0].match(/:(.*?);/)[1],m=atob(i[1]);let h=m.length;const b=new Uint8Array(h);for(;h--;)b[h]=m.charCodeAt(h);return new File([b],s,{type:u})},HMe=o=>btoa(o.match(/\w{2}/g).map(s=>String.fromCharCode(parseInt(s,16))).join(""));function zMe(o){if(!o)return[];let s=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp(`(?:(${s.source}))([\\da-fA-F\\s]+)\\}`,"g"),u=o.match(i);console.log("images",u);const m=[];if(u||(s=/{\\pict[\s\S]+?(\\pngblip-?\d+)?(\\wmetafile8-?\d+)?{\\\*\\blipuid\s?[\da-fA-F]+[\s}]*?/,i=new RegExp(`(?:(${s.source}))([\\da-fA-F\\s]+)\\}`,"g"),u=o.match(i)),u)for(const h of u){let b=!1;if(h.includes("\\pngblip")?b="image/png":h.includes("\\jpegblip")&&(b="image/jpeg"),b){const C=h.replace(s,"").replace(/[^\da-fA-F]/g,""),S=`data:${b};base64,${HMe(C)}`;m.push({base64:S,file:VMe(S)})}}return m}const UMe=(o,s)=>{if(!s)return o;try{const u=new DOMParser().parseFromString(o,"text/html"),m=u.querySelectorAll("img"),b=(s.clipboardData||window.Clipboard).getData("text/rtf"),C=zMe(b);return m.forEach((S,_)=>{var O;const N=S.getAttribute("src");if(N&&N.startsWith("file:")&&(O=C==null?void 0:C[_])!=null&&O.base64){const B=C[_].base64;S.setAttribute("src",B)}}),u.body.innerHTML}catch{return o}},jMe=o=>{const s=atob(o.split(",")[1]),i=o.split(",")[0].split(":")[1].split(";")[0],u=new ArrayBuffer(s.length),m=new Uint8Array(u);for(let h=0;h<s.length;h++)m[h]=s.charCodeAt(h);return new Blob([u],{type:i})},WMe=async o=>{try{const s=jMe(o),i=new FormData;i.append("files",s,"image.png");const m=await(await fetch(`${process.env.NODE_ENV==="development"?"/api":""}/ajax/uploaddoc`,{method:"POST",body:i})).json();if(m.status===1)return m.file_url;throw new Error(m.message)}catch(s){throw s}},ZMe=async o=>{const i=new DOMParser().parseFromString(o,"text/html"),u=i.getElementsByTagName("img"),m=[],h=3;for(let b=0;b<u.length;b++){const C=u[b],S=C.getAttribute("src");S&&S.startsWith("data:image")&&(m.push({img:C,src:S,width:C.getAttribute("width"),height:C.getAttribute("height")}),m[m.length-1].width&&C.setAttribute("width",m[m.length-1].width),m[m.length-1].height&&C.setAttribute("height",m[m.length-1].height))}for(let b=0;b<m.length;b+=h){const S=m.slice(b,b+h).map(async _=>{try{const N=await WMe(_.src);_.img.setAttribute("src",N)}catch{_.img.remove()}});await Promise.all(S)}return i.body.innerHTML},GMe=o=>{o.querySelectorAll("td").forEach(i=>{const u=i.getAttribute("width"),m=i.getAttribute("style")||"";u==="0"&&m.includes("border:none")&&i.remove()})},qMe=o=>{o.querySelectorAll("table").forEach(i=>{i.style.maxWidth="100%"})},YMe=o=>{o.querySelectorAll("table").forEach(i=>{i.style.tableLayout="fixed";const u=i.getAttribute("style")||"";if(u){const m=u.split(";").filter(b=>b.trim()),h=[];m.forEach(b=>{const[C,S]=b.split(":").map(_=>_.trim());C&&S&&(["margin","margin-right","margin-left"].includes(C.toLowerCase())||h.push(`${C}: ${S}`))}),h.some(b=>b.toLowerCase().startsWith("width"))||h.push("width: 100%"),i.setAttribute("style",h.join("; "))}})},KMe=o=>{o.querySelectorAll("table").forEach(i=>{const u=i.querySelectorAll("tr");if(u.length>0){const b=u[0].querySelectorAll("td, th").length;if(b>0){const C=(100/b).toFixed(2);u.forEach(S=>{S.querySelectorAll("td, th").forEach(N=>{const O=N,B=parseInt(O.getAttribute("colspan")||"1"),F=(parseFloat(C)*B).toFixed(2),G=(O.getAttribute("style")||"").split(";").filter(q=>!q.trim().toLowerCase().startsWith("width")).join(";"),Y=G?`${G}; width: ${F}%`:`width: ${F}%`;O.setAttribute("style",Y)})})}}})},XMe=o=>{o.querySelectorAll("table").forEach(i=>{const u=i.querySelectorAll("td");let m=!1,h="";for(const b of u){const C=b.getAttribute("style")||"",S=C.match(/border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i)||C.match(/border(?:-(?:right|left|top|bottom))?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i);(S?S[0]:"").includes("double")&&(m=!0,S&&(h=S[0].replace(/^border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*/,""),b.style.borderTop=h,b.style.borderRight=h,b.style.borderBottom=h,b.style.borderLeft=h))}m&&h&&(i.style.borderCollapse="separate",i.style.borderSpacing="2px",i.style.border=h)})},JMe=o=>{o.querySelectorAll("table").forEach(i=>{i.querySelectorAll("td[rowspan]").forEach(m=>{const C=((m.getAttribute("style")||"").match(/border-[^:]+:[^;]+(?:solid|double)[^;]+/g)||[]).find(S=>!S.includes("none"));if(C){const S=C.split(":")[1].trim();m.style.borderBottom=S}})})},QMe=o=>{o.querySelectorAll('[style*="mso-"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/mso-[^:]+:[^;]+;/g,"");i.setAttribute("style",m)})},e6e=o=>{o.querySelectorAll('[style*="tab-stops"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/tab-stops:[^;]+;/g,"");i.setAttribute("style",m)})},t6e=o=>{const i=new DOMParser().parseFromString(o,"text/html"),u=i.querySelector("table");if(u){const h=u.style.width||u.getAttribute("width");if(h)return h}const m=i.querySelector("tr");if(m){const h=m.querySelectorAll("td");let b=0,C=!1;if(h.forEach(S=>{const _=S.style.width||S.getAttribute("width");if(_){const N=parseFloat(_.replace(/[^0-9.]/g,""));isNaN(N)||(b+=N,C=!0)}}),C)return`${b}px`}return"0px"},n6e=o=>{o=o.replace(/<a(?!.*?href=)[^>]*>([\s\S]*?)<\/a>/gi,"$1");const i=new DOMParser().parseFromString(o,"text/html");return GMe(i),qMe(i),XMe(i),JMe(i),QMe(i),e6e(i),YMe(i),KMe(i),o=i.body.innerHTML,o};Y6.PluginManager.add("pasteprocess",o=>(o.on("paste",s=>{if(s.clipboardData){const i=s.clipboardData.getData("text/html")||s.clipboardData.getData("text");if(LMe(i)){s.preventDefault();const u=o.windowManager.open({title:"处理中",body:{type:"panel",items:[{type:"htmlpanel",html:'<div style="text-align: center; padding: 20px;">正在处理Word内容,请稍候...</div>'}]},buttons:[]}),m=t6e(i),b=(parseFloat(m.replace(/[^0-9.]/g,""))||0)>600?"landscape":"portrait";o.fire("orientationchange",{orientation:b});const C=n6e(i),S=UMe(C,s);ZMe(S).then(_=>{o.insertContent(_),u.close()})}}}),{}));let oE="A4",sE="portrait";const vne={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}},o6e=Object.keys(vne).map(o=>`pagesize${o}`).join(" "),s6e="orientationPortrait orientationLandscape";Y6.PluginManager.add("pagesize",o=>{const s=o.options.register;s("pagesize",{processor:"string",default:"A4"}),s("orientation",{processor:"string",default:"portrait"});const i=h=>b=>b.options.get(h);oE=i("pagesize")(o),sE=i("orientation")(o);const u=h=>{const b=vne[h];if(b){let{width:C,height:S}=b;sE==="landscape"&&([C,S]=[S,C]);const _=(window.devicePixelRatio||1)*96,N=C*_/25.4;o!=null&&o.container&&(o.container.style.minWidth=`${N}px`);const O=o.contentAreaContainer.querySelector("iframe");O&&(O.style.width=`${N}px`),o.fire("pagesizechange",{size:h,orientation:sE})}},m=h=>{sE=h,u(oE),o.fire("orientationchange",{orientation:h})};return Object.keys(vne).forEach(h=>{o.ui.registry.addToggleMenuItem(`pagesize${h}`,{text:h,onAction:()=>{oE=h,u(h)},onSetup:b=>(b.setActive(oE===h),()=>{})})}),o.ui.registry.addToggleMenuItem("orientationPortrait",{text:"竖屏",onAction:()=>{m("portrait")},onSetup:h=>(h.setActive(sE==="portrait"),()=>{})}),o.ui.registry.addToggleMenuItem("orientationLandscape",{text:"横屏",onAction:()=>{m("landscape")},onSetup:h=>(h.setActive(sE==="landscape"),()=>{})}),o.on("orientationchange",h=>{h.orientation!==sE&&m(h.orientation)}),o.on("pagesizechange",h=>{h.size!==oE&&(oE=h.size,u(h.size))}),o.on("init",()=>{u(oE)}),{}});const Efe=["accordion","advlist","anchor","autolink","autosave","charmap","code","codesample","directionality","importcss","insertdatetime","link","lists","image","media","nonbreaking","pagebreak","preview","quickbars","save","searchreplace","table","visualblocks","fullscreen","visualchars","wordcount","pasteprocess"],r6e="undo redo h1 h2 h3 bold italic underline strikethrough subscript superscript fontsize fontFamily lineheight forecolor backcolor alignleft aligncenter alignright alignjustify pagebreak bullist numlist outdent indent blockquotelink unlink image code removeformat fullscreen preview ",_fe="file edit insert table tools help",a6e={menu:{pagesize:{title:"页面大小",items:o6e},orientation:{title:"页面方向",items:s6e}},menubar:_fe+" pagesize orientation",pagesize:"A4",orientation:"portrait",plugins:[...Efe,"pagesize"]},i6e={license_key:"gpl",skin:!1,content_css:["css/content.css","css/reset.css"],promotion:!1,menubar:_fe,cleanup:!0,branding:!1,language:"zh_CN",plugins:Efe,toolbar:r6e,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,toolbar_mode:"wrap",images_upload_handler:o=>new Promise((s,i)=>{const u=new FormData;u.append("files",o.blob(),o.filename()),fetch(`${process.env.NODE_ENV==="development"?"/api":""}/ajax/uploaddoc`,{method:"POST",body:u}).then(m=>m.json()).then(m=>{m.status===1?s(m.file_url):i(`上传失败: ${m.message}`)}).catch(m=>{i(`上传出错: ${m.message}`)})})},l6e={name:"ProEditor",components:{Editor:PMe},props:{modelValue:{type:String,default:""},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},hasPagesize:{type:Boolean,default:!1},placeholder:{type:String,default:"请输入内容"},width:{type:[Number,String],default:"100%"},height:{type:Number,default:400}},setup(o,{emit:s}){Em(o.modelValue);const i=d.ref(null),u=d.reactive({myInit:h(i6e),contentValue:o.modelValue,timeout:null});d.onMounted(()=>{Y6.init({license_key:"gpl"}),Y6.activeEditor.on("pagesizechange",b=>{(o==null?void 0:o.pagesize)!==b.size&&s("update:pagesize",b.size)}),Y6.activeEditor.on("orientationchange",b=>{(o==null?void 0:o.orientation)!==b.orientation&&s("update:orientation",b.orientation)})}),d.watch(()=>u.contentValue,()=>{m(()=>{s("update:modelValue",u.contentValue)})}),d.watch(()=>o.orientation,()=>{var b,C;i.value&&((C=(b=i.value)==null?void 0:b.getEditor)==null||C.call(b).fire("orientationchange",{orientation:o.orientation}))}),d.watch(()=>o.pagesize,()=>{var b,C;i.value&&((C=(b=i.value)==null?void 0:b.getEditor)==null||C.call(b).fire("pagesizechange",{size:o.pagesize}))}),d.watch(()=>o.modelValue,b=>{!uR(b)&&b!==u.contentValue&&(u.contentValue=b)}),d.watch(()=>o.height,b=>{var C,S,_,N,O,B,F,Z;i.value&&((Z=(N=(_=(S=(C=i.value)==null?void 0:C.getEditor)==null?void 0:S.call(C))==null?void 0:_.dom)==null?void 0:N.setStyle)==null||Z.call(N,(F=(B=(O=i.value)==null?void 0:O.getEditor)==null?void 0:B.call(O))==null?void 0:F.editorContainer,"height",b+"px"))});function m(b,C=400){u.timeout!==null&&clearTimeout(u.timeout),u.timeout=setTimeout(b,C)}function h(b){var O;o!=null&&o.height&&(b.height=o.height),o!=null&&o.width&&(b.width=o.width);const{placeholder:C,pagesize:S,orientation:_}=o,N=`${location==null?void 0:location.origin}/${uR(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath}`;return b={...b,content_css:(O=b==null?void 0:b.content_css)==null?void 0:O.map(B=>B.includes("http")?B:`${N}${B}`),placeholder:C,...o.hasPagesize?{...a6e,pagesize:S,orientation:_}:{}},b}return{...d.toRefs(u),editorRef:i,customer:h,debounce:m}}},c6e={class:"my-tinymce"};function u6e(o,s,i,u,m,h){const b=d.resolveComponent("Editor");return d.openBlock(),d.createElementBlock("div",c6e,[d.createVNode(b,{modelValue:o.contentValue,"onUpdate:modelValue":s[0]||(s[0]=C=>o.contentValue=C),init:o.myInit,ref:"editorRef"},null,8,["modelValue","init"])])}const kfe=mi(l6e,[["render",u6e]]),d6e={name:"ShadowDomWrap",setup(o,{emit:s,expose:i}){const u=d.ref(null),m=d.ref(),h=d.ref(!1),b=S=>{if(S.target.closest(".context-menu")||!u.value)return;const N=u.value.contains(S.target);!N&&h.value?(h.value=!1,s("onBlur")):N&&!h.value&&(h.value=!0,s("onFocus"))},C=S=>{h.value=!0,s("onFocus"),S.stopPropagation()};return d.onMounted(()=>{var O,B,F;m.value=(O=u.value)==null?void 0:O.attachShadow({mode:"open"}),document.addEventListener("click",b);const S=uR(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath,_=document.createElement("link");_.rel="stylesheet",_.href=`${location==null?void 0:location.origin}/${S}css/index.min.css`,(B=m.value)==null||B.appendChild(_);const N=document.createElement("link");N.rel="stylesheet",N.href=`${location==null?void 0:location.origin}/${S}css/reset.css`,(F=m.value)==null||F.appendChild(N)}),d.onUnmounted(()=>{document.removeEventListener("click",b)}),i({focus:()=>{h.value=!0}}),{shadowHost:u,shadowRoot:m,handleClick:C}}};function f6e(o,s,i,u,m,h){return d.openBlock(),d.createElementBlock("div",{ref:"shadowHost",class:"shadow-host",onClick:s[0]||(s[0]=d.withModifiers((...b)=>u.handleClick&&u.handleClick(...b),["stop"]))},[u.shadowRoot?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:u.shadowRoot},[d.renderSlot(o.$slots,"default")],8,["to"])):d.createCommentVNode("",!0)],512)}const $oe=mi(d6e,[["render",f6e]]),m6e=["innerHTML"],Tfe=d.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=d.useModel(o,"modelValue");return(i,u)=>(d.openBlock(),d.createBlock($oe,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,m6e)]),_:1}))}}),Afe=Symbol("nodesUI"),ef=()=>{const o=d.inject(Afe);if(!o)throw new Error("NodesUI context not found");return o};function Doe(o){if(!o||!o.ownerDocument)return null;const s=[];let i=o;for(;i&&i.nodeType===Node.ELEMENT_NODE;){let u=i.nodeName.toLowerCase();if(i.id){u=`#${CSS.escape(i.id)}`,s.unshift(u);break}if(i.className&&typeof i.className=="string"){const m=i.className.trim().split(/\s+/);m.length>0&&m[0]&&(u+=`.${CSS.escape(m[0])}`)}if(i.parentElement){const h=Array.from(i.parentElement.children).filter(b=>b.nodeName.toLowerCase()===i.nodeName.toLowerCase());if(h.length>1){const b=h.indexOf(i)+1;u+=`:nth-of-type(${b})`}}if(s.unshift(u),i=i.parentElement,i&&(i.nodeName.toLowerCase()==="body"||i.nodeName.toLowerCase()==="html"))break}return s.length?s.join(" > "):null}function p6e(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(`#${CSS.escape(o)}`)}catch(i){return console.error("nodePath query error:",i),null}}function Nfe(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const jA=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}`:""),Ofe=o=>{if(o.nodeType===Node.TEXT_NODE)return o;let s=null;for(let i=o.childNodes.length-1;i>=0;i--){const u=o.childNodes[i],m=Ofe(u);if(m){s=m;break}}return s},g6e=(o,s,i)=>{var u,m,h;if(!dR(o)){const b=i==null?void 0:i.getRootNode(),C=(u=b==null?void 0:b.getSelection)==null?void 0:u.call(b),S=Nfe(o.nodePath,i);if(C&&o.startOffset!==void 0&&s&&S){const _=document.createRange(),N=(o==null?void 0:o.textNodeIndex)||0,O=S.childNodes[N]||S;let B,F;if(O.nodeType===Node.TEXT_NODE)B=O,F=Math.min(o.startOffset,((m=O.textContent)==null?void 0:m.length)||0);else{const G=Ofe(O);G?(B=G,F=((h=G.textContent)==null?void 0:h.length)||0):(B=O,F=0)}_.setStart(B,F),_.setEnd(B,F);const Z=document.createElement("span");Z.classList.add("empty-text-node"),_.insertNode(Z),_.insertNode(s),_.setStartAfter(s),_.collapse(!0),C.removeAllRanges(),C.addRange(_)}}},h6e=(o,s)=>{s!=null&&s.id&&(o.id=s==null?void 0:s.id),(s==null?void 0:s.nodePath)!==void 0&&o.setAttribute("data-nodePath",s.nodePath),(s==null?void 0:s.textNodeIndex)!==void 0&&s.textNodeIndex>=0&&o.setAttribute("data-textNodeIndex",s.textNodeIndex.toString()),s.startOffset!==void 0&&s.startOffset>=0&&o.setAttribute("data-startOffset",s.startOffset.toString()),(s==null?void 0:s.subNodeSort)!==void 0&&s.subNodeSort>=0&&o.setAttribute("data-subNodeSort",s.subNodeSort.toString()),(s==null?void 0:s.groupKey)!==void 0&&o.setAttribute("data-groupKey",s.groupKey)},v6e=o=>{const s=o.parentNode;if(!s)return-1;let i=0;for(let u=0;u<s.childNodes.length;u++){const m=s.childNodes[u];if(m===o)return i;i++,m.nodeType===Node.ELEMENT_NODE&&(m.classList.contains("node-item")&&(i-=2,i<0&&(i=0)),m.classList.contains("empty-text-node")&&(i-=1,i<0&&(i=0)))}return-1},b6e=o=>{const s=o.closest("TD"),i=o.closest(".node-item");let u=null;if(i?u=i:s&&s.classList.contains("node-item-td")&&(u=s),!u)return null;const m=u||o;let h=m==null?void 0:m.getAttribute("data-nodePath");if(h||(h=Doe(m)),(m==null?void 0:m.getAttribute("selectable"))==="false")return null;const b={element:m,nodePath:h},C=m==null?void 0:m.getAttribute("data-textNodeIndex");C&&(b.textNodeIndex=Number(C));const S=m==null?void 0:m.getAttribute("data-startOffset");S&&(b.startOffset=Number(S));const _=m==null?void 0:m.getAttribute("data-subNodeSort");_&&(b.subNodeSort=Number(_));const N=m==null?void 0:m.getAttribute("data-groupKey");N&&(b.groupKey=N);const O=m==null?void 0:m.getAttribute("id");return O&&(b.id=O),b},$fe=o=>Axe(o,s=>d.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),Mz=(o,s)=>{const i=o.startsWith("#")?o.slice(1):o;let u,m,h;if(i.length===3)u=parseInt(i[0]+i[0],16),m=parseInt(i[1]+i[1],16),h=parseInt(i[2]+i[2],16);else if(i.length===6)u=parseInt(i.substring(0,2),16),m=parseInt(i.substring(2,4),16),h=parseInt(i.substring(4,6),16);else return console.warn("Invalid color format:",o),`rgba(0, 0, 0, ${s})`;return`rgba(${u}, ${m}, ${h}, ${s})`},y6e=o=>{var _;const{element:s}=o;if(!s)return null;if(s.tagName.toLowerCase()!=="td")return{showTextType:"input"};const u=s.closest("tr"),m=Array.from(u.parentElement.children).indexOf(u),h=Array.from(u.children).indexOf(s),b=s.closest("table"),C=((_=s.closest("body"))==null?void 0:_.querySelectorAll("table"))||[];return{showTextType:"cell",tableIndex:Array.from(C).indexOf(b)+1,colIndex:h,rowIndex:m}},w6e=(o,s)=>{var m,h;let i=1;const u=(m=o==null?void 0:o.map(b=>s==null?void 0:s.find(C=>(C==null?void 0:C.id)===(b==null?void 0:b.id))))==null?void 0:m.filter(Boolean);return(u==null?void 0:u.length)>0?(h=u==null?void 0:u.map(C=>{const S=y6e(C);return S?(S==null?void 0:S.showTextType)==="input"?{...C,...S,inputIndex:i++}:{...C,...S}:null}))==null?void 0:h.filter(Boolean):[]};function C6e(o){if(!o||o.length===0)return[];const s=[...o].sort((m,h)=>m.rowIndex!==h.rowIndex?m.rowIndex-h.rowIndex:m.colIndex-h.colIndex),i=[],u=new Set;for(const m of s){if(u.has(m))continue;const h=[];let b=0,C=0;for(let S=m.colIndex;s.find(N=>N.rowIndex===m.rowIndex&&N.colIndex===S&&!u.has(N));S++)C++;if(C!==0){b=C;for(let S=m.rowIndex;;S++){let _=0;const N=[];for(let O=m.colIndex;O<m.colIndex+b;O++){const B=s.find(F=>F.rowIndex===S&&F.colIndex===O&&!u.has(F));if(B)_++,N.push(B);else break}if(_===b)h.push(...N);else break}h.length>0&&(i.push([...h]),h.forEach(S=>u.add(S)))}}return i}function S6e(o){if(!o||o.length===0)return{min:null,max:null};let s=o[0],i=o[0];for(const u of o)(u.colIndex<s.colIndex||u.colIndex===s.colIndex&&u.rowIndex<s.rowIndex)&&(s=u),(u.colIndex>i.colIndex||u.colIndex===i.colIndex&&u.rowIndex>i.rowIndex)&&(i=u);return{min:s,max:i}}const Dfe=(o,s)=>{var _;const i=w6e(o,s||[]),u=[],m=[];(_=d.toValue(i))==null||_.forEach(N=>{(N==null?void 0:N.showTextType)==="input"?u.push(N):m.push(N)});const h=$xe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=pde(b==null?void 0:b.map(N=>C6e(N==null?void 0:N.nodes))),S=(C==null?void 0:C.map(N=>S6e(N)))||[];return[...u,...S]},r4=o=>{function s(i){let u="";for(;i>=0;)u=String.fromCharCode(65+i%26)+u,i=Math.floor(i/26)-1;return u}return(o==null?void 0:o.colIndex)>=0&&(o==null?void 0:o.rowIndex)>=0?`${s(o==null?void 0:o.colIndex)}${o==null?void 0:o.rowIndex}`:""},x6e=(o,s)=>{const i=Dfe(o,s||[]),u=[];return i==null||i.forEach(m=>{var h,b;(m==null?void 0:m.showTextType)==="input"?u.push(`填写${m==null?void 0:m.inputIndex}`):u.push(((h=m==null?void 0:m.min)==null?void 0:h.id)===((b=m==null?void 0:m.max)==null?void 0:b.id)?r4(m==null?void 0:m.min):`${r4(m==null?void 0:m.min)}:${r4(m==null?void 0:m.max)}`)}),u==null?void 0:u.join(",")},dR=o=>o.startOffset===void 0&&o.textNodeIndex===void 0,E6e=o=>{var s;if(o.innerHTML===" "&&(o.innerHTML=""),((s=o.textContent)==null?void 0:s.trim())===""&&o.querySelector("p")){const i=o.querySelector("p");if(i){const u=O=>{const B={};return O&&O.split(";").forEach(F=>{const[Z,G]=F.split(":").map(Y=>Y.trim());Z&&G&&(B[Z]=G)}),B},m=O=>Object.entries(O).map(([B,F])=>`${B}: ${F}`).join("; "),h=u(o.getAttribute("style")||""),b=u(i.getAttribute("style")||""),C=i.querySelectorAll("span");let S={};C.forEach(O=>{const B=u(O.getAttribute("style")||"");S={...S,...B}});const _={...h,...b,...S},N=m(_);N&&o.setAttribute("style",N),o.removeChild(i)}}},_6e=o=>{var i;return(i=ga(o))==null?void 0:i.map(u=>(u==null||delete u.element,u))},k6e=o=>{o.querySelectorAll("p").forEach(i=>{var u;i.classList.contains("empty")&&i.classList.remove("empty"),((u=i.innerText)==null?void 0:u.trim())===""&&i.classList.add("empty")})},T6e={key:0,class:"td-node"},A6e={key:1},N6e=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,i=d.computed(()=>{var m,h,b,C,S;return(h=(m=s==null?void 0:s.node)==null?void 0:m.props)!=null&&h.alias?(C=(b=s==null?void 0:s.node)==null?void 0:b.props)==null?void 0:C.alias:(S=s==null?void 0:s.node)==null?void 0:S.label}),u=d.computed(()=>{var m,h;return((h=(m=s==null?void 0:s.node)==null?void 0:m.element)==null?void 0:h.tagName)==="TD"});return(m,h)=>u.value?(d.openBlock(),d.createElementBlock("span",T6e,d.toDisplayString(i.value),1)):(d.openBlock(),d.createElementBlock("span",A6e,d.toDisplayString(i.value),1))}}),Mfe=Symbol("nodesEditor"),U0=()=>{const o=d.inject(Mfe);if(!o)throw new Error("NodesEditor context not found");return o},$U=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=ef(),{nodes:u,renderType:m,disabledNodes:h}=U0(),b=d.computed(()=>{var O;return(O=s.node)!=null&&O.id?u.value.some(B=>B.id===s.node.id):!1}),C=d.computed(()=>{var O;if(!((O=s.node)!=null&&O.element))return!1;try{return s.node.element.parentNode!==null}catch(B){return console.warn("Element validation failed:",B),!1}}),S=d.computed(()=>{var F,Z;const O=(F=h==null?void 0:h.value)==null?void 0:F.some(G=>{var Y;return(G==null?void 0:G.id)===((Y=s==null?void 0:s.node)==null?void 0:Y.id)}),B=(Z=d.toValue(i))==null?void 0:Z.find(G=>{var Y;return(G==null?void 0:G.id)===((Y=s==null?void 0:s.node)==null?void 0:Y.id)});return{...s==null?void 0:s.node,...B,disabled:O}}),_=O=>{var F;let B="";if(d.toValue(O==null?void 0:O.activated)&&(B="normal"),O!=null&&O.disabled&&(B="disabled"),(F=s==null?void 0:s.node)!=null&&F.element)switch(B){case"normal":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",Mz((O==null?void 0:O.color)||"#409eff",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("activated");break;case"disabled":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#F56C6C"),s.node.element.style.setProperty("--node-bg-color",Mz((O==null?void 0:O.color)||"#F56C6C",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("disabled");break;default:N();break}},N=()=>{var O,B,F,Z,G;(O=s==null?void 0:s.node)!=null&&O.element&&((B=s.node.element)==null||B.removeAttribute("data-dataGroupKey"),(F=s.node.element)==null||F.removeAttribute("selectable"),(Z=s.node.element)==null||Z.classList.remove("activated"),(G=s.node.element)==null||G.classList.remove("disabled"))};return d.watch(()=>S,()=>{const O=d.toValue(S);O!=null&&O.id?_(O):N()},{immediate:!0,deep:!0}),(O,B)=>{var F;return(F=O.node)!=null&&F.element&&C.value&&b.value?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:O.node.element},[d.createElementVNode("div",{class:d.normalizeClass(["node-item-render",`node-item-${d.unref(m)}`])},[d.renderSlot(O.$slots,"default",{node:O.node},()=>[d.createVNode(N6e,{node:O.node},null,8,["node"])])],2)],8,["to"])):d.createCommentVNode("",!0)}}});function O6e(){const o=d.ref(!1),s=u=>{u.key==="Control"&&(o.value=!0)},i=u=>{u.key==="Control"&&(o.value=!1)};return d.onMounted(()=>{window.addEventListener("keydown",s),window.addEventListener("keyup",i)}),d.onUnmounted(()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",i)}),o}function Rfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i}=ef(),{editorId:u,nodes:m}=U0(),h=d.ref(!1),b=d.ref({x:0,y:0}),C=d.ref({x:0,y:0}),S=d.ref({left:0,top:0,width:0,height:0}),_=d.ref(null),N=_e=>{const Q=_e.closest(".node-item-td")||_e.closest(".node-item");if(Q!==null){let Fe=[];if(Q.classList.contains("node-selected"))return;const lt=Q.getAttribute("id");if(lt&&m.value){const nt=m.value.find($e=>$e.id===lt);nt&&(Fe=[nt])}Fe=W(Fe),s(Fe)}},O=_e=>{var nt;if(_e.button===2&&N(_e==null?void 0:_e.target),_e.button!==0||(h.value=!0,!_.value))return;const Q=(nt=i==null?void 0:i.value)==null?void 0:nt.getBoundingClientRect();if(!Q)return;const Fe=_e.clientX-(Q==null?void 0:Q.left),lt=_e.clientY-(Q==null?void 0:Q.top);b.value={x:Fe,y:lt},C.value={x:Fe,y:lt},Y(_e),L(),_.value.style.display="block",window.addEventListener("mousemove",B),window.addEventListener("wheel",F),window.addEventListener("mouseup",Z)},B=cte(_e=>{var Q;if(h.value){const Fe=(Q=i==null?void 0:i.value)==null?void 0:Q.getBoundingClientRect();if(!Fe)return;const lt=_e.clientX-(Fe==null?void 0:Fe.left),nt=_e.clientY-(Fe==null?void 0:Fe.top);C.value={x:lt,y:nt},L()}},16),F=cte(_e=>{h.value&&setTimeout(()=>{var nt;const Q=(nt=i==null?void 0:i.value)==null?void 0:nt.getBoundingClientRect();if(!Q)return;const Fe=_e.clientX-(Q==null?void 0:Q.left),lt=_e.clientY-(Q==null?void 0:Q.top);C.value={x:Fe,y:lt},L()},0)},16),Z=_e=>{_e.button===0&&(h.value=!1,_.value&&(L(),_.value.style.display="none",window.removeEventListener("mousemove",B),window.removeEventListener("wheel",F),window.removeEventListener("mouseup",Z)))},G=O6e(),Y=_e=>{var Fe,lt;let Q=[];if(_e.button===0&&(_e!=null&&_e.target)){const nt=((Fe=_e==null?void 0:_e.target)==null?void 0:Fe.closest(".node-item-td"))||((lt=_e==null?void 0:_e.target)==null?void 0:lt.closest(".node-item"));if(nt!==null){const $e=nt.getAttribute("id");if($e&&m.value){const ue=m.value.find(Nt=>Nt.id===$e);ue&&(G.value?o.value.some(Nt=>jA(Nt)===jA(ue))?Q=o.value.filter(ge=>jA(ge)!==jA(ue)):Q=[...o.value,ue]:ue&&(Q=[ue]))}}Q=W(Q),s(Q)}},q=()=>{var ue;if(!i.value||!(S.value.width>3||S.value.height>3))return;let _e=[];const Q=(ue=i==null?void 0:i.value)==null?void 0:ue.getBoundingClientRect(),Fe=S.value.left+(Q==null?void 0:Q.left),lt=S.value.top+(Q==null?void 0:Q.top),nt={left:S.value.left+(Q==null?void 0:Q.left),right:Fe+S.value.width,top:S.value.top+(Q==null?void 0:Q.top),bottom:lt+S.value.height};if(i.value.querySelectorAll("*").forEach(Nt=>{const ge=Nt.getBoundingClientRect();if(!nt)return;const Oe={left:ge.left,right:ge.right,top:ge.top,bottom:ge.bottom};if(Oe.right>nt.left&&Oe.left<nt.right&&Oe.bottom>nt.top&&Oe.top<nt.bottom){const R=Nt.getAttribute("id");if(R&&m.value){const je=m.value.find(ye=>ye.id===R);je&&(_e=[..._e,je])}}}),_e=W(_e),G.value){const Nt=new Set(o.value.map(Oe=>jA(Oe))),ge=_e.filter(Oe=>!Nt.has(jA(Oe)));s([...o.value,...ge])}else s(_e)},W=_e=>_e,L=cte(()=>{if(!_.value||!i.value)return;const{x:_e,y:Q}=b.value,{x:Fe,y:lt}=C.value,nt=Math.min(_e,Fe),$e=Math.min(Q,lt),ue=Math.abs(_e-Fe),Nt=Math.abs(Q-lt);S.value={left:nt,top:$e,width:ue,height:Nt}},16),me=_e=>{if(!_.value)return;const{left:Q,top:Fe,width:lt,height:nt}=d.toValue(_e);_.value.style.left=`${Q}px`,_.value.style.top=`${Fe}px`,_.value.style.width=`${lt}px`,_.value.style.height=`${nt}px`},Ze=()=>{if(!i.value)return;i.value.addEventListener("mousedown",O);const _e=document.getElementById(`select_area_${u}`);if(_e){_.value=_e;return}const Q=document.createElement("div");Q.id=`select_area_${u}`,Q.style.position="absolute",Q.style.border="1px solid #1677ff",Q.style.backgroundColor="rgba(22, 119, 255, 0.05)",Q.style.pointerEvents="none",Q.style.display="none",i.value.appendChild(Q),_.value=Q};return d.watch(S,(_e,Q)=>{ha(_e,Q)||(me(_e),h.value&&q())},{deep:!0}),d.watch(()=>i.value,_e=>{d.toValue(_e)&&Ze()},{immediate:!0}),d.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",O)}),{isSelecting:h,selectionBox:_}}function Moe(){const{selectedNodes:o,containerRef:s}=ef(),i=()=>{var m;(m=d.toValue(s))==null||m.querySelectorAll(".node-selected").forEach(h=>{h.classList.remove("node-selected")})},u=m=>{m.forEach(h=>{h.classList.add("node-selected")})};d.watch(()=>o,()=>{i(),setTimeout(()=>{var h,b;const m=(b=(h=d.toValue(o))==null?void 0:h.map(C=>{var S;return(S=s.value)==null?void 0:S.querySelector(`[id="${C.id}"]`)}))==null?void 0:b.filter(Boolean);u(m)},0)},{deep:!0})}const IR=()=>{const{nodes:o,updateNodes:s,inputTypes:i}=U0();return{nodes:o,addNode:S=>{const N=(Array.isArray(S)?S:[S]).map(B=>({...B,id:B.id||m2()})),O=[...o.value,...N];s(O)},removeNode:async S=>{var Z,G;const _=Array.isArray(S)?S:[S],N=[],O=[];_.forEach(Y=>{const q=o.value.find(W=>(W==null?void 0:W.id)===Y);dR(q)?N.push(Y):O.push(Y)});const B=await((G=(Z=i==null?void 0:i.find(Y=>{var q;return((q=Y.value)==null?void 0:q.toLowerCase())==="text"}))==null?void 0:Z.getDefaultProps)==null?void 0:G.call(Z))||{};let F=o.value.filter(Y=>!O.includes(Y==null?void 0:Y.id));F=F==null?void 0:F.map(Y=>N.includes(Y==null?void 0:Y.id)?{id:Y==null?void 0:Y.id,nodePath:Y==null?void 0:Y.nodePath,label:"文本",nodeType:"text",props:{...B}}:Y),s(F)},editNodes:S=>{const _=Array.isArray(S)?S:[S],N=m2(),O=_.map(F=>{const Z={...F};let G=F==null?void 0:F.id;return G||(G=m2(),Z.id=G),Z!=null&&Z.groupKey||(Z.groupKey=N),Z}),B=[...o.value];O.forEach(F=>{const Z=B.findIndex(G=>G.id===F.id);Z!==-1?B[Z]=F:B.push(F)}),s(B)},insertNodeAt:(S,_)=>{const N=[...o.value];N.splice(_,0,S),s(N)},moveNode:(S,_)=>{const N=[...o.value],[O]=N.splice(S,1);N.splice(_,0,O),s(N)},updateNodes:s}};function $6e(){const{removeNode:o}=IR(),{containerRef:s}=ef(),i=d.ref(null),u=h=>{var G,Y;if(h.target instanceof Element&&(h.target.closest(".node-item")||h.target.closest(".node-item-td")||h.target.closest(".disabeld-edit")))return;const b=h.target;if(b===s.value)return;const S=((G=s.value)==null?void 0:G.getRootNode()).getSelection(),_=(Y=s.value)==null?void 0:Y.querySelectorAll('[contenteditable="true"]');_==null||_.forEach(q=>{q.setAttribute("contenteditable","false")});const N=b.textContent||"",O=b.innerHTML||"";i.value=b,b.setAttribute("contenteditable","true"),b.focus();const B=new MutationObserver(()=>{b.textContent!==N&&(b.innerHTML=O)});B.observe(b,{characterData:!0,childList:!0,subtree:!0});const F=q=>{q.preventDefault()};b.addEventListener("input",F),b.addEventListener("paste",F),b.addEventListener("drop",F),b.addEventListener("keydown",q=>{var W,L,me,Ze;if(((W=document.activeElement)==null?void 0:W.shadowRoot)===((L=s.value)==null?void 0:L.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(q.key)){if(q.key==="Backspace"||q.key==="Delete"){const _e=S==null?void 0:S.getRangeAt(0);if(b.blur(),(_e==null?void 0:_e.startOffset)===0){const Q=_e.startContainer;if(Q.nodeType===Node.TEXT_NODE){const Fe=Q.previousSibling;if(Fe&&Fe.nodeType===Node.ELEMENT_NODE&&Fe.classList.contains("node-item")){const lt=Fe.getAttribute("id");lt&&o(lt),(me=Q.parentElement)==null||me.normalize();return}}else if(Q.nodeType===Node.ELEMENT_NODE){const Fe=Q.previousSibling;if(Fe&&Fe.nodeType===Node.ELEMENT_NODE&&Fe.classList.contains("node-item")){const lt=Fe.getAttribute("id");lt&&o(lt),(Ze=Q.parentElement)==null||Ze.normalize();return}}}}q.preventDefault()}});const Z=()=>{b==null||b.normalize(),B.disconnect(),b.removeEventListener("input",F),b.removeEventListener("paste",F),b.removeEventListener("drop",F),b.removeEventListener("blur",Z),b.setAttribute("contenteditable","false")};b.addEventListener("blur",Z)},m=()=>{var h;(h=s.value)==null||h.addEventListener("dblclick",u)};return d.watch(s,h=>{h&&m()},{immediate:!0}),d.onUnmounted(()=>{var h;(h=s.value)==null||h.removeEventListener("dblclick",u)}),{}}function D6e(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=ef(),h=_=>{var O,B;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const F=N.getRangeAt(0);u.value=v6e(F.startContainer);const Z=F.startOffset,G=(B=s.value)==null?void 0:B.querySelectorAll(".node-item");let Y=0;return m.value=0,G==null||G.forEach(q=>{const W=document.createRange();if(W.selectNode(q),W.comparePoint(F.startContainer,Z)>=0){m.value+=1;const L=q.getAttribute("data-startOffset");Number(L)>Y&&(Y=Number(L))}}),Y+Z}}catch{}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var F;const N=_.target;if(N===o.value)return;s.value=N;const O=(F=o.value)==null?void 0:F.getRootNode();i.value=h(O),N.addEventListener("click",b),N.addEventListener("keyup",Z=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(Z.key)&&b()});const B=()=>{N.removeEventListener("click",b),N.removeEventListener("keyup",b),N.removeEventListener("blur",B),setTimeout(()=>{s.value=null,u.value=0,i.value=-1},300)};N.addEventListener("blur",B)},S=()=>{var _;(_=o.value)==null||_.addEventListener("focus",C,!0)};return d.watch(o,_=>{_&&S()},{immediate:!0}),d.onUnmounted(()=>{var _;(_=o.value)==null||_.removeEventListener("focus",C,!0)}),{focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}}function M6e(o){const s=o.value===null?[]:[JSON.parse(JSON.stringify(o.value))],i=d.ref(s),u=d.ref(0),m=d.ref(!1),h=d.computed(()=>i.value[u.value]),b=()=>{u.value>0&&(m.value=!0,u.value--,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},C=()=>{u.value<i.value.length-1&&(m.value=!0,u.value++,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},S=_=>{(_.ctrlKey||_.metaKey)&&_.key==="z"?(_.preventDefault(),b()):(_.ctrlKey||_.metaKey)&&_.key==="y"&&(_.preventDefault(),C())};return d.onMounted(()=>{window.addEventListener("keydown",S)}),d.onUnmounted(()=>{window.removeEventListener("keydown",S)}),d.watch(o,d2(_=>{_&&!m.value&&(i.value.splice(u.value+1),i.value.push(JSON.parse(JSON.stringify(_))),u.value++),m.value&&(m.value=!1)},300),{deep:!0}),{current:h,undo:b,redo:C}}function R6e(){const{modelValue:o,inputTypes:s}=U0(),{nodes:i,updateNodes:u}=IR(),m=b=>{if(!b||typeof b!="string")return[];const S=new DOMParser().parseFromString(b,"text/html");return Array.from(S.querySelectorAll("td")).filter(O=>{var B;return!((B=O.textContent)!=null&&B.trim())})},h=async b=>{var _,N;const C=await((N=(_=s==null?void 0:s.find(O=>{var B;return((B=O.value)==null?void 0:B.toLowerCase())==="text"}))==null?void 0:_.getDefaultProps)==null?void 0:N.call(_))||{},S=b.map(O=>{let B=O==null?void 0:O.id;return B||(B=m2()),{id:B,nodeType:"Text",label:"文本",props:{...C},...O}});u(S)};d.onMounted(()=>{var B;const b=m(d.toValue(o)),C=d.toValue(i),S=C.filter(F=>dR(F)),_=C.filter(F=>!dR(F)),O=[...(B=b.map(F=>({nodePath:Doe(F)})))==null?void 0:B.map(F=>{const Z=S==null?void 0:S.find(G=>G.nodePath===F.nodePath);return{...F,...Z}}),..._];h(O)})}function B6e(){const{selectedNodes:o,containerRef:s,isFocused:i}=ef(),{removeNode:u}=IR(),m=d.ref(null),h=S=>{if(i.value&&(S.key==="Delete"||S.key==="Backspace")){let _=[];S.preventDefault(),d.toValue(o).length>0&&(d.toValue(o).forEach(N=>{var O,B,F;if(((O=N==null?void 0:N.element)==null?void 0:O.tagName)==="TD"){const Z=(B=N==null?void 0:N.element)==null?void 0:B.getAttribute("id");Z&&_.push(Z)}else{const Z=(F=N==null?void 0:N.element)==null?void 0:F.getAttribute("id");Z&&_.push(Z)}}),o.value=[],(_==null?void 0:_.length)>0&&u(_))}},b=S=>{var _;(_=d.toValue(s))!=null&&_.contains(S.target)?m.value=S.target:m.value=null},C=()=>{s.value&&(window.addEventListener("keydown",h),s.value.addEventListener("mousedown",b))};d.watch(()=>s.value,S=>{d.toValue(S)&&C()},{immediate:!0}),d.onUnmounted(()=>{s.value&&(window.removeEventListener("keydown",h),s.value.removeEventListener("mousedown",b))})}function DU(){const{nodes:o}=U0(),{containerRef:s,renderNodes:i,uiReady:u}=ef(),{removeNode:m}=IR(),h=()=>{var C;i.value=[...((C=o.value)==null?void 0:C.map(S=>{var N;const _=(N=s.value)==null?void 0:N.querySelector(`[id="${S.id}"]`);return{...S,element:_}}))||[]].filter(S=>!!(S!=null&&S.element))},b=d2(C=>{d.nextTick(()=>{var S;m((S=C==null?void 0:C.map(_=>_==null?void 0:_.id))==null?void 0:S.filter(Boolean))})},500);d.watch(()=>[i.value,u],()=>{if(d.toValue(u)){const C=kxe(o.value,i.value,"id");b(C)}},{immediate:!0,deep:!0}),d.watch(()=>[o.value,s.value,u],()=>{d.toValue(u)&&d.nextTick(()=>{h()})},{immediate:!0,deep:!0})}const bne=d.ref({});function MU(o){return d.computed(()=>{var s;return(s=bne.value)==null?void 0:s[o]})}function Roe(){const o=U0(),s=ef();d.onMounted(()=>{const{editorId:i}=o;i&&(bne.value[i]=d.ref({...o,...s}))}),d.onUnmounted(()=>{const{editorId:i}=o;i&&(bne.value[i]=null)})}const I6e=d.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"edit"}},setup(o){const{nodes:s}=U0(),{uiReady:i,renderNodes:u}=ef();return Roe(),M6e(s),Rfe(),Moe(),B6e(),D6e(),$6e(),R6e(),DU(),(m,h)=>d.unref(i)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(u),b=>(d.openBlock(),d.createBlock($U,{key:b==null?void 0:b.id,node:b},{default:d.withCtx(C=>[d.renderSlot(m.$slots,"nodeItem",{node:C==null?void 0:C.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),lle=d.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return Roe(),DU(),Moe(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock($U,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),P6e=d.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return DU(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock($U,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),F6e=d.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"select"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return Roe(),Rfe(),Moe(),DU(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock($U,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),l2=d.ref({});function Bfe(o){return d.computed(()=>(l2.value[o]||(l2.value[o]=d.ref([])),l2.value[o]))}function L6e(o){const{editorId:s}=o,i=d.ref(!1);d.onMounted(()=>{l2.value[s]||(l2.value[s]=d.ref([]));const u=l2.value[s].findIndex(m=>m.id===o.id);u!==-1&&l2.value[s].splice(u,1),i.value=!0,l2.value[s].push({...o,isMounted:i})}),d.onUnmounted(()=>{i.value=!1})}const V6e=d.defineComponent({__name:"NodesProvider",props:d.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},renderType:{type:String,default:"preview"},inputTypes:{type:Array,default:()=>[]},editorId:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]}},{formData:{},formDataModifiers:{},nodes:{},nodesModifiers:{}}),emits:["update:formData","update:nodes"],setup(o){const s=o,i=d.useModel(o,"formData"),u=d.useModel(o,"nodes"),m=d.computed(()=>s.modelValue),h=Bfe(s==null?void 0:s.editorId),b=d.computed(()=>{var O,B,F;const N=[...$fe(((F=(B=(O=d.toValue(h))==null?void 0:O.filter(Z=>d.toValue(Z==null?void 0:Z.activated)))==null?void 0:B.filter(Z=>d.toValue(Z.isMounted)))==null?void 0:F.filter(Z=>d.toValue(Z==null?void 0:Z.isOccupy)))||[]),...s.disabledNodes||[]];return qxe(N,"id")}),C=d.computed(()=>d.toValue(s.renderType)),S=_=>{ha(u.value,_)||(u.value=_)};return d.provide(Mfe,{modelValue:m,renderType:C,inputTypes:s.inputTypes,editorId:s==null?void 0:s.editorId,nodes:u,disabledNodes:b,updateNodes:S,formData:i}),(_,N)=>d.renderSlot(_.$slots,"default")}}),H6e=d.defineComponent({__name:"NodesUIProvider",props:{nodes:{type:Array,default:()=>[]},selectedNodes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},editorId:{type:String,default:""},htmlRenderRef:{type:Object,default:()=>{}}},emits:["onSelectedNodes","update:selectedNodes"],setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.ref(null),b=d.ref(null),C=d.ref([]),S=d.ref(null),_=d.ref(-1),N=d.ref(0),O=d.ref(0),B=Bfe(u==null?void 0:u.editorId),F=d.ref(!1),Z=d.ref(!1),G=d.computed(()=>u.htmlRenderRef),Y=d.computed({get:()=>(u.selectedNodes||[]).map(Ze=>{var Fe;let _e=(Fe=u==null?void 0:u.nodes)==null?void 0:Fe.find(lt=>(lt==null?void 0:lt.id)===(Ze==null?void 0:Ze.id)),Q=Ze!=null&&Ze.element?Ze==null?void 0:Ze.element:p6e(Ze==null?void 0:Ze.id,h.value);return{..._e||{},...Ze,element:Q}}),set:Ze=>{const _e=Ze.map(({element:Q,...Fe})=>{var nt;return{...((nt=u==null?void 0:u.nodes)==null?void 0:nt.find($e=>($e==null?void 0:$e.id)===(Fe==null?void 0:Fe.id)))||{},...Fe}});m("update:selectedNodes",_e)}}),q=d.computed(()=>{var Q,Fe,lt;const Ze=(Fe=(Q=d.toValue(B))==null?void 0:Q.filter(nt=>d.toValue(nt==null?void 0:nt.activated)))==null?void 0:Fe.filter(nt=>d.toValue(nt.isMounted)),_e=((lt=d.toValue(u==null?void 0:u.nodesGroups)||[])==null?void 0:lt.map(nt=>({...nt||{},activated:!0})))||[];return $fe([..._e,...Ze])}),W=d.ref([]),L=Ze=>{var Fe;const _e=Ze.map(({...lt})=>{var Nt;let nt=(Nt=C.value)==null?void 0:Nt.find(ge=>(ge==null?void 0:ge.id)===(lt==null?void 0:lt.id));const{element:$e,...ue}={...nt||{},...lt};return ue}),Q=(Fe=Y.value)==null?void 0:Fe.map(({element:lt,...nt})=>nt);ha(_e,Q)||(Y.value=_e,m("onSelectedNodes",_e))},me=d.computed(()=>d.toValue(u==null?void 0:u.nodesGroups));return s({setSelectedNodes:L}),d.provide(Afe,{containerRef:h,htmlRenderRef:G,contextMenuRef:b,focusedElement:S,currentRenderNodes:W,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:q,selectedNodes:Y,setSelectedNodes:L,renderNodes:C,uiReady:F,isFocused:Z,nodesGroups:me}),(Ze,_e)=>d.renderSlot(Ze.$slots,"default")}}),z6e=["onClick"],U6e={key:0,class:"icon"},j6e={key:1,class:"arrow"},W6e=["onClick"],Z6e={key:0,class:"icon"},G6e=d.defineComponent({__name:"index",props:d.mergeModels({style:{},direction:{}},{show:{},showModifiers:{}}),emits:d.mergeModels(["select"],["update:show"]),setup(o,{emit:s}){const{contextMenuRef:i,selectedNodes:u,setSelectedNodes:m,focusedElement:h,cursorPosition:b,focusedNodeIndex:C,preNodeNumber:S}=ef(),{inputTypes:_}=U0(),N=d.useModel(o,"show"),{editNodes:O}=IR(),B=async Y=>{var q,W;if(d.toValue(h)&&!Bxe(d.toValue(b))){const L=Doe(d.toValue(h)),me=d.toValue(b),Ze=(d.toValue(S)||0)+1,_e=b6e(d.toValue(h));if(L&&!uR(me)&&me>=0){const Q=await((q=Y==null?void 0:Y.getDefaultProps)==null?void 0:q.call(Y))||{};O({..._e,label:Y==null?void 0:Y.label,nodePath:L,startOffset:me,subNodeSort:Ze,textNodeIndex:d.toValue(C)||0,nodeType:Y==null?void 0:Y.value,props:Q})}}else if(u){const L=d.toValue(u);if(L!=null&&L.length){const me=await((W=Y==null?void 0:Y.getDefaultProps)==null?void 0:W.call(Y))||{},Ze=L==null?void 0:L.map(_e=>({..._e,label:Y==null?void 0:Y.label,element:_e==null?void 0:_e.element,nodePath:_e==null?void 0:_e.nodePath,nodeType:Y==null?void 0:Y.value,props:me}));O(Ze),m(Ze)}}N.value=!1},F=d.computed(()=>{const Y=[],q=[];return d.toValue(_).forEach(W=>{W.groupName==="system"?q.push({...W,handler:()=>{B(W)}}):Y.push({...W,handler:()=>{B(W)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:Y},{label:"插入记录标识",icon:"i-bi:flag",children:q}].filter(W=>{var L;return(L=W==null?void 0:W.children)==null?void 0:L.length})}),Z=s,G=(Y,q)=>{Y.preventDefault(),q!=null&&q.handler&&q.handler(),q!=null&&q.value&&Z("select",q==null?void 0:q.value)};return(Y,q)=>d.withDirectives((d.openBlock(),d.createElementBlock("div",{class:"context-menu",style:d.normalizeStyle({...Y.style}),ref_key:"contextMenuRef",ref:i},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(F.value,W=>(d.openBlock(),d.createElementBlock("div",{key:W==null?void 0:W.label,class:"menu-item"},[d.createElementVNode("div",{class:"menu-item-content",onClick:L=>G(L,W)},[W!=null&&W.icon?(d.openBlock(),d.createElementBlock("div",U6e,[d.createElementVNode("div",{class:d.normalizeClass(W==null?void 0:W.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(W.label)+" ",1),W!=null&&W.children?(d.openBlock(),d.createElementBlock("span",j6e,"›")):d.createCommentVNode("",!0)],8,z6e),W!=null&&W.children?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["submenu",{"submenu-bottom":Y.direction==="bottom"}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(W.children,L=>(d.openBlock(),d.createElementBlock("div",{key:L.action,class:"menu-item",onClick:me=>G(me,L)},[L!=null&&L.icon?(d.openBlock(),d.createElementBlock("div",Z6e,[d.createElementVNode("div",{class:d.normalizeClass(L==null?void 0:L.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(L.label),1)],8,W6e))),128))],2)):d.createCommentVNode("",!0)]))),128))],4)),[[d.vShow,N.value]])}}),q6e=mi(G6e,[["__scopeId","data-v-36fcd36c"]]);function Y6e(o){const{headerHeight:s}=o,i=d.ref(!1),u=d.ref("top"),{contextMenuRef:m}=ef(),h=d.ref({left:"0px",top:"0px"}),b=S=>{S.preventDefault(),i.value=!0,d.nextTick(()=>{const N=S.currentTarget.getBoundingClientRect(),O=S.clientX-N.left,B=S.clientY-N.top,F=m==null?void 0:m.value,Z=F==null?void 0:F.offsetWidth,G=F==null?void 0:F.offsetHeight,Y=N.width-O<Z,q=N.height-B<G,W=Array.from((F==null?void 0:F.querySelectorAll(".submenu"))||[]).reduce((L,me)=>Math.max(L,me.offsetHeight||0),0);N.height-B<W?u.value="bottom":u.value="top",h.value={left:Y?`${O-Z}px`:`${O}px`,top:q?`${B-G+d.toValue(s)}px`:`${B+d.toValue(s)}px`}})},C=S=>{const _=document.querySelector(".context-menu");_&&!_.contains(S.target)&&(i.value=!1)};return d.onMounted(()=>{document.addEventListener("mousedown",C)}),d.onUnmounted(()=>{document.removeEventListener("mousedown",C)}),{showContextMenu:i,contextMenuStyle:h,contextMenuRef:m,onContextMenu:b,closeContextMenu:C,direction:u}}function Ife(o){return{all:o=o||new Map,on:function(s,i){var u=o.get(s);u?u.push(i):o.set(s,[i])},off:function(s,i){var u=o.get(s);u&&(i?u.splice(u.indexOf(i)>>>0,1):o.set(s,[]))},emit:function(s,i){var u=o.get(s);u&&u.slice().map(function(m){m(i)}),(u=o.get("*"))&&u.slice().map(function(m){m(s,i)})}}}const yne=Ife(),Pfe=(...o)=>{const s=o[0],i=o[1];d.onMounted(()=>{yne.on(s,i)}),d.onBeforeUnmount(()=>{yne.off(s)})},Boe=()=>(...s)=>{yne.emit(...s)};let rE=null;function K6e(o){const{onSelected:s}={},{selectedNodes:i,uiReady:u,setSelectedNodes:m}=ef(),h=d.ref("multiple"),b=(S="select")=>{var N,O;let _=[];h.value==="single"?(N=i.value)!=null&&N[0]&&_.push((O=i.value)==null?void 0:O[0]):_=ga(i.value),rE==null||rE({data:_,type:S}),S==="blur"&&(rE=null,h.value="multiple"),m(_)};return d.watch(()=>i,()=>{u.value&&(b(),s==null||s(d.toValue(i)))},{deep:!0}),Pfe("selectNodes",S=>{const{data:_,callback:N=null,mode:O="multiple"}=S;h.value=O,setTimeout(()=>{m(d.toValue(_)),rE=N},100)}),{onBlur:()=>{rE&&(b("blur"),rE=null,m([]))}}}const Rz={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}},X6e={class:"relative"},J6e={class:"header-container"},Q6e=["innerHTML"],eRe={style:{overflow:"hidden"}},tRe=["innerHTML"],nRe=d.defineComponent({__name:"index",props:{headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesize:{type:String,default:"A4"}},emits:["onUiReady"],setup(o,{expose:s,emit:i}){const u=d.ref(),{containerRef:m,uiReady:h,isFocused:b}=ef(),{nodes:C,modelValue:S,renderType:_}=U0(),N=d.computed(()=>d.toValue(_)==="edit"),O=o,B=i,F=()=>{B("onUiReady",{containerRef:m})},{height:Z}=pMe(u),G=d.computed(()=>O.headerHtml?O.headerHtml.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(Nt,ge,Oe)=>{const R=Oe.replace(/([^{}]+)\{/g,(je,ye)=>{const tt=ye.trim();return tt&&!tt.includes(".header-container")?`.header-container ${tt} {`:je});return`<style${ge}>${R}</style>`}):""),Y=d.computed(()=>{const Nt=Rz[O.pagesize]||Rz.A4,ge=(window.devicePixelRatio||1)*96;return`${Nt.height*ge/25.4-d.toValue(Z)}px`}),{showContextMenu:q,contextMenuStyle:W,onContextMenu:L,direction:me}=Y6e({headerHeight:Z}),Ze=d.ref(null),_e=Nt=>{let ge=null;if(dR(Nt))ge=Nfe(Nt.nodePath,d.toValue(m)),ge&&(ge.classList.add("node-item-td"),ge.setAttribute("contenteditable","false"),E6e(ge));else{const Oe=document.createElement("span");Oe.setAttribute("contenteditable","false"),Oe.classList.add("node-item"),ge=Oe,g6e(Nt,ge,m.value)}return ge&&h6e(ge,Nt),ge},Q=()=>{const Nt=Hxe(C.value,[ge=>ge.nodePath,ge=>ge.textNodeIndex,ge=>ge.startOffset??-1,ge=>ge.subNodeSort],["asc","desc","desc","desc"]);Nt==null||Nt.forEach(ge=>{_e(ge)})},Fe=()=>{Ze.value&&(h.value=!1,d.nextTick(()=>{Ze.value&&(Ze.value.innerHTML=d.toValue(S),Q(),h.value=!0,d.nextTick(()=>{F(),setTimeout(()=>{d.toValue(m)&&k6e(d.toValue(m))},10)}))}))};d.watch(()=>[C,S,Ze],()=>{Fe()},{deep:!0,immediate:!0});const lt=d.ref(),nt=()=>{b.value=!0},{onBlur:$e}=K6e(),ue=()=>{b.value=!1,$e()};return s({renderHtml:Fe}),(Nt,ge)=>(d.openBlock(),d.createElementBlock("div",X6e,[d.createVNode($oe,{onOnBlur:ue,onOnFocus:nt,ref_key:"shadowDomRef",ref:lt},{default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"headerRef",ref:u,style:{overflow:"hidden"}},[d.createElementVNode("div",J6e,[d.createElementVNode("div",{innerHTML:G.value,class:"disabeld-edit docHeaderHtml",onClick:nt},null,8,Q6e)])],512),d.createElementVNode("html",{class:d.normalizeClass(["nodes-editor",`nodes-editor-${d.unref(_)}`]),ref_key:"containerRef",ref:m,style:d.normalizeStyle([{position:"relative"},{position:"relative",minHeight:Y.value}]),onContextmenu:ge[0]||(ge[0]=d.withModifiers((...Oe)=>d.unref(L)&&d.unref(L)(...Oe),["prevent"]))},[d.createElementVNode("body",{ref_key:"bodyRef",ref:Ze},null,512),d.createElementVNode("div",eRe,[d.createElementVNode("div",{innerHTML:O==null?void 0:O.footerHtml,class:"disabeld-edit docFooterHtml",onClick:nt},null,8,tRe)])],38)]),_:1},512),N.value?(d.openBlock(),d.createBlock(q6e,{key:0,show:d.unref(q),"onUpdate:show":ge[1]||(ge[1]=Oe=>d.isRef(q)?q.value=Oe:null),style:d.normalizeStyle(d.unref(W)),direction:d.unref(me)},null,8,["show","style","direction"])):d.createCommentVNode("",!0)]))}}),oRe={class:"pagesize"},sRe=d.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},style:{type:Object,default:()=>({})}},setup(o){const s=o,i=d.computed(()=>{const u=Rz[s.pagesize]||Rz.A4;let{width:m,height:h}=u;s.orientation==="landscape"&&([m,h]=[h,m]);const b=(window.devicePixelRatio||1)*96;return m*b/25.4});return(u,m)=>(d.openBlock(),d.createElementBlock("div",oRe,[d.createElementVNode("div",{style:d.normalizeStyle({width:`${i.value}px`,...o.style}),class:"pagesize-content"},[d.renderSlot(u.$slots,"default",{},void 0,!0)],4)]))}}),rRe=mi(sRe,[["__scopeId","data-v-44e34db1"]]),Ffe=d.defineComponent({__name:"index",props:d.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},renderType:{type:String,default:"preview"},formData:{type:Object,default:()=>({})},inputTypes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},id:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]},headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesizeStyle:{type:Object,default:()=>({})}},{selectedNodes:{default:[]},selectedNodesModifiers:{}}),emits:d.mergeModels(["update:nodes","update:formData","onSelectedNodes","onUiReady"],["update:selectedNodes"]),setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.useModel(o,"selectedNodes");Em(u.formData);const b=d.ref(),C=d.ref(null),S=G=>{m("onUiReady",G)},_=d.ref(),N=d.computed(()=>d.toValue(u.renderType)),O=d.computed(()=>{switch(d.toValue(N)){case"edit":return I6e;case"select":return F6e;case"preview":return lle;case"enter":return P6e;default:return lle}}),B=G=>{m("update:nodes",G)},F=G=>{m("update:formData",G)},Z=G=>{m("onSelectedNodes",G)};return s({formRef:{validate:()=>{var G,Y,q;return(q=(Y=(G=b.value)==null?void 0:G.formRef)==null?void 0:Y.validate)==null?void 0:q.call(Y)}},setSelectedNodes:G=>{var Y,q;(q=(Y=_.value)==null?void 0:Y.setSelectedNodes)==null||q.call(Y,G)}}),(G,Y)=>(d.openBlock(),d.createBlock(rRe,{pagesize:o.pagesize,orientation:u==null?void 0:u.orientation,style:d.normalizeStyle(o.pagesizeStyle)},{default:d.withCtx(()=>[d.createVNode(H6e,{ref_key:"UIRef",ref:_,nodes:o.nodes,"onUpdate:nodes":B,selectedNodes:h.value,"onUpdate:selectedNodes":Y[0]||(Y[0]=q=>h.value=q),onOnSelectedNodes:Z,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id,htmlRenderRef:C.value},{default:d.withCtx(()=>[d.createVNode(V6e,{renderType:N.value,"model-value":o.modelValue,nodes:o.nodes,"onUpdate:nodes":B,formData:o.formData,"onUpdate:formData":F,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id,disabledNodes:o.disabledNodes},{default:d.withCtx(()=>[d.createVNode(nRe,{ref_key:"htmlRenderRef",ref:C,headerHtml:o.headerHtml,footerHtml:o.footerHtml,pagesize:u==null?void 0:u.pagesize,onOnUiReady:S},null,8,["headerHtml","footerHtml","pagesize"]),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(O.value),{renderType:N.value,pagesize:o.pagesize,ref_key:"contentRef",ref:b},{nodeItem:d.withCtx(q=>[d.renderSlot(G.$slots,"nodeItem",{node:q==null?void 0:q.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId","disabledNodes"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId","htmlRenderRef"])]),_:3},8,["pagesize","orientation","style"]))}}),aRe={class:"nodes-text"},iRe={key:0,class:"node-text-input"},lRe={key:1,class:"node-text-td"},cRe={key:0,class:"node-text-table-index"},uRe=d.defineComponent({__name:"index",props:d.mergeModels({editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.useModel(o,"modelValue"),u=MU(s==null?void 0:s.editorId),m=d.computed(()=>{var b;return Dfe(i.value,((b=d.toValue(u))==null?void 0:b.renderNodes)||[])}),h=d.computed(()=>{var b;return((b=d.toValue(m))==null?void 0:b.length)>0?!d.toValue(m).some(S=>{var _,N;return((_=S==null?void 0:S.min)==null?void 0:_.tableIndex)>1||((N=S==null?void 0:S.max)==null?void 0:N.tableIndex)>1}):!0});return(b,C)=>(d.openBlock(),d.createElementBlock("div",aRe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,(S,_)=>{var N,O,B,F,Z,G,Y,q,W;return d.openBlock(),d.createElementBlock("div",{key:_,class:"node-text-item"},[(S==null?void 0:S.showTextType)==="input"?(d.openBlock(),d.createElementBlock("span",iRe,d.toDisplayString((N=S==null?void 0:S.props)!=null&&N.alias?(O=S==null?void 0:S.props)==null?void 0:O.alias:`填写${S==null?void 0:S.inputIndex}`),1)):(d.openBlock(),d.createElementBlock("span",lRe,[h.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",cRe,d.toDisplayString(`表${(B=S==null?void 0:S.min)==null?void 0:B.tableIndex}.`),1)),d.createTextVNode(" "+d.toDisplayString(((F=S==null?void 0:S.min)==null?void 0:F.id)===((Z=S==null?void 0:S.max)==null?void 0:Z.id)?(Y=(G=S==null?void 0:S.min)==null?void 0:G.props)!=null&&Y.alias?(W=(q=S==null?void 0:S.min)==null?void 0:q.props)==null?void 0:W.alias:d.unref(r4)(S==null?void 0:S.min):`${d.unref(r4)(S==null?void 0:S.min)}:${d.unref(r4)(S==null?void 0:S.max)}`),1)]))])}),128))]))}}),cle=mi(uRe,[["__scopeId","data-v-73a2b2dc"]]);function Ioe(o){const{nodes:s,mode:i="multiple"}=o,u=d.ref(!1),m=Boe();return{isSelecting:u,selectNodes:()=>{if(u.value)return!1;u.value=!0,m("selectNodes",{data:ga(d.toValue(s)),mode:i,callback:({data:b,type:C})=>{s.value=_6e(ga(d.toValue(b))),C==="blur"&&(u.value=!1)}})}}}const WA=["#409EFF","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],RH=d.ref(0),aE=new Map,dRe={key:0,class:"node-select-small gap-x-2"},fRe={key:1,class:"text-[#999]"},mRe={key:1,class:"node-select"},pRe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},gRe={class:"flex gap-2"},hRe={key:1},vRe={class:"flex gap-1"},bRe=d.defineComponent({__name:"index",props:d.mergeModels({mode:{type:String,default:"multiple"},color:{type:String},id:{type:String,default:""},editorId:{type:String,default:""},size:{type:String,default:"default"},label:{type:String,default:"点击选择"},isOccupy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.ref((aE==null?void 0:aE[s==null?void 0:s.id])||0),u=d.ref((s==null?void 0:s.id)||m2()),m=d.useModel(o,"modelValue");Em(m);const{selectNodes:h,isSelecting:b}=Ioe({nodes:m,mode:s.mode}),C=()=>{m.value=[]},S=d.computed(()=>s.color||(WA==null?void 0:WA[d.toValue(i)%(WA==null?void 0:WA.length)])||"#409eff");d.onMounted(()=>{uR(aE==null?void 0:aE[s==null?void 0:s.id])&&(s!=null&&s.id)&&(aE[s==null?void 0:s.id]=RH.value,i.value=RH.value,RH.value=RH.value+1)});const _=d.computed(()=>s.isOccupy),N=d.computed(()=>!d.toValue(b));return L6e({id:u.value,editorId:s.editorId,nodes:m,activated:N,color:S,isOccupy:_}),(O,B)=>{var F;return s.size==="small"?(d.openBlock(),d.createElementBlock("div",dRe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),d.createElementVNode("div",null,d.toDisplayString(s.label),1),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{}),onClick:B[0]||(B[0]=(...Z)=>d.unref(h)&&d.unref(h)(...Z))},B[6]||(B[6]=[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer"},null,-1)]),4)),d.createElementVNode("div",{class:"flex items-center flex-wrap gap-1 cursor-pointer",onClick:B[2]||(B[2]=()=>{s!=null&&s.disabled||d.unref(h)()})},[((F=m.value)==null?void 0:F.length)>0?(d.openBlock(),d.createBlock(cle,{key:0,modelValue:m.value,"onUpdate:modelValue":B[1]||(B[1]=Z=>m.value=Z),editorId:o.editorId},null,8,["modelValue","editorId"])):(d.openBlock(),d.createElementBlock("div",fRe,"未设置"))])])):(d.openBlock(),d.createElementBlock("div",mRe,[d.createElementVNode("div",pRe,[d.createElementVNode("div",gRe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{})},[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:B[3]||(B[3]=(...Z)=>d.unref(h)&&d.unref(h)(...Z))})],4)),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",hRe,[d.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})]))]),d.createElementVNode("div",vRe,[B[9]||(B[9]=d.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),d.createElementVNode("div",null,[d.createVNode(d.unref(Nn.ElTooltip),{placement:"right",effect:"dark"},{content:d.withCtx(()=>B[7]||(B[7]=[d.createElementVNode("strong",null,"选择位置",-1),d.createTextVNode(" :点击输入框(选中状态为蓝色),再点击左侧表格可选择填写位置范围。 "),d.createElementVNode("br",null,null,-1),d.createElementVNode("strong",null,"编辑位置",-1),d.createTextVNode(" :使用橡皮擦工具清除后重新选择。 "),d.createElementVNode("br",null,null,-1)])),default:d.withCtx(()=>[B[8]||(B[8]=d.createElementVNode("div",{class:"flex flex-center"},[d.createElementVNode("div",{class:"i-bi:info-circle-fill mr-2"}),d.createTextVNode(" 使用帮助 ")],-1))]),_:1})])])]),d.createElementVNode("div",{class:d.normalizeClass(["min-h-[42px] px-2 py-1",{"shadow-[0_0_0_2px_#409eff]":d.unref(b)}]),onClick:B[5]||(B[5]=()=>{s!=null&&s.disabled||d.unref(h)()})},[d.createVNode(cle,{modelValue:m.value,"onUpdate:modelValue":B[4]||(B[4]=Z=>m.value=Z),editorId:o.editorId},null,8,["modelValue","editorId"])],2)]))}}}),Lfe=mi(bRe,[["__scopeId","data-v-e9e78bcd"]]);function yRe(o){if(!o.startsWith("="))return[];const s=[];let i=1;for(o.startsWith("=")&&s.push({type:"startOperator",value:"="});i<o.length;){const u=o[i];if(/\s/.test(u)){i++;continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];if(i<o.length&&o[i]===":"){i++;let h="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)h+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)h+=o[i++];s.push({type:"range",value:`${m}:${h}`});continue}else{s.push({type:"cell",value:m});continue}}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(/[A-Za-z]/.test(u)){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];if(["AVERAGE","AVEDEV","SUM","IF","COUNT","MAX","MIN","SQRT"].includes(m.toUpperCase())&&o[i]==="("){s.push({type:"function",value:m});continue}i-=m.length}if(/\d/.test(u)){let m="";for(;i<o.length&&(/\d/.test(o[i])||o[i]===".");)m+=o[i++];s.push({type:"number",value:m});continue}if(u==='"'){let m="";for(m+=u,i++;i<o.length&&o[i]!=='"';)m+=o[i++];m+=u,i++,s.push({type:"string",value:m});continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(u===":"){s.push({type:"operator",value:":"}),i++;continue}if(/[+\-*/=><]/.test(u)){s.push({type:"operator",value:u}),i++;continue}if(/[()]/.test(u)){s.push({type:"paren",value:u}),i++;continue}if(u===","){s.push({type:"separator",value:","}),i++;continue}i++}return s}function wRe(o,s){const i=[];let u=0;for(;u<o.length;){let m=!1;for(const h of s){const b=h.value;if(o.startsWith(b,u)){i.push({type:h.type,value:b,...h.cellValue?{cellValue:h.cellValue}:{}}),u+=b.length,m=!0;break}}m||(i.push({type:"plain",value:o[u]}),u++)}return i}function CRe(o){const s=MU(o.editorId),i=(b,C)=>{let S=[];const _=Math.min(b.colIndex,C.colIndex),N=Math.max(b.colIndex,C.colIndex),O=Math.min(b.rowIndex,C.rowIndex),B=Math.max(b.rowIndex,C.rowIndex);for(let F=O;F<=B;F++)for(let Z=_;Z<=N;Z++)S.push({colIndex:Z,rowIndex:F});return S},u=b=>{var N;const C=b.includes(":");let S=[];if(C){const[O,B]=b.split(":").map(F=>h(F));S=i(O,B)}else S=[h(b)];return m(S,d.toValue((N=d.toValue(s))==null?void 0:N.nodes))},m=(b,C)=>C==null?void 0:C.filter(S=>{const _=S.nodePath.split(" > ");let N=1,O=1;return _.forEach(B=>{if(B.startsWith("tr")){const F=B.match(/tr(?::nth-of-type\((\d+)\))?/);F&&F[1]&&(N=parseInt(F[1]))}else if(B.startsWith("td")){const F=B.match(/td(?::nth-of-type\((\d+)\))?/);F&&(O=F[1]?parseInt(F[1]):1)}}),b.some(B=>N===B.rowIndex+1&&O===B.colIndex+1)}),h=b=>{if(!b)return{colIndex:-1,rowIndex:-1};const C=b.match(/^([A-Za-z]+)(\d+)$/);if(!C)return{colIndex:-1,rowIndex:-1};const S=C[1].toUpperCase(),_=parseInt(C[2]);let N=0;for(let O=0;O<S.length;O++)N=N*26+(S.charCodeAt(O)-64);return{colIndex:N-1,rowIndex:_}};return{getCellValue:u}}const ule=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function SRe(o,s,i){const u=d.ref(null),m=d.ref(null);function h(){return o.value&&o.value.textContent||""}d.onMounted(()=>{o.value&&(u.value=()=>{const C=h();s.value=C},m.value=()=>{const C=h();s.value=C},o.value.addEventListener("input",u.value),o.value.addEventListener("blur",m.value))}),d.onUnmounted(()=>{o.value&&(u.value&&o.value.removeEventListener("input",u.value),m.value&&o.value.removeEventListener("blur",m.value))});const b=C=>{var S,_,N,O;if(C>=0){const B=window.getSelection();if(B){const F=B.getRangeAt(0),Z=((S=F.startContainer)==null?void 0:S.nodeName)==="#text"?F.startContainer:(N=(_=F.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],G=Math.min(C,((O=Z.textContent)==null?void 0:O.length)||0);F.setStart(Z,G)}}};return d.watch(()=>[s,o],()=>{var C;o.value&&(ha((C=o.value)==null?void 0:C.textContent,d.toValue(s))||(o.value.textContent=d.toValue(s),b(d.toValue(i))))},{deep:!0,immediate:!0}),{getFormulaContent:h}}function Poe(o){const{element:s,onFocus:i,onBlur:u}=o,m=d.ref(!1),h=()=>{m.value=!0,i==null||i()},b=()=>{m.value=!1,u==null||u()};return d.onMounted(()=>{var C,S;d.toValue(s)&&((C=d.toValue(s))==null||C.addEventListener("focus",h),(S=d.toValue(s))==null||S.addEventListener("blur",b))}),d.onUnmounted(()=>{var C,S;d.toValue(s)&&((C=d.toValue(s))==null||C.removeEventListener("focus",h),(S=d.toValue(s))==null||S.removeEventListener("blur",b))}),m}function xRe(o){const{element:s,showStr:i,editorId:u}=o,m=MU(u),h=Poe({element:s}),b=d.computed(()=>{var C;return(C=i==null?void 0:i.value)==null?void 0:C.filter(S=>["range","cell"].includes(S.type))});return d.watch(()=>h,()=>{var S,_,N,O,B,F;const C=Z=>{var G;Z.preventDefault(),(G=d.toValue(s))==null||G.focus()};d.toValue(h)?((S=d.toValue(m))==null||S.containerRef.addEventListener("click",C),(_=d.toValue(m))==null||_.containerRef.addEventListener("mousedown",C),(N=document.querySelectorAll(".select-function"))==null||N.forEach(Z=>{Z.addEventListener("click",C),Z.addEventListener("mousedown",C)})):((O=d.toValue(m))==null||O.containerRef.removeEventListener("click",C),(B=d.toValue(m))==null||B.containerRef.removeEventListener("mousedown",C),(F=document.querySelectorAll(".select-function"))==null||F.forEach(Z=>{Z.removeEventListener("click",C),Z.removeEventListener("mousedown",C)}))},{deep:!0}),d.watch(()=>[h,b],()=>{var C,S,_,N,O;if((C=d.toValue(m))!=null&&C.containerRef&&((N=(_=(S=d.toValue(m))==null?void 0:S.containerRef)==null?void 0:_.querySelectorAll(".node-formula-cell"))==null||N.forEach(B=>{B.classList.remove("node-formula-cell")}),d.toValue(h))){let B=[];(O=b.value)!=null&&O.length&&(b.value.forEach(F=>{var Z;B=[...B,...((Z=F==null?void 0:F.cellValue)==null?void 0:Z.map(G=>({color:F==null?void 0:F.color,backgroundColor:Mz((F==null?void 0:F.color)||"#000",.1),element:G==null?void 0:G.element})))||[]]}),B.forEach(F=>{var Z;F!=null&&F.element&&((Z=F==null?void 0:F.element)==null||Z.classList.add("node-formula-cell"),F==null||F.element.style.setProperty("--formula-node-color",F==null?void 0:F.color),F==null||F.element.style.setProperty("--formula-node-bg-color",F==null?void 0:F.backgroundColor))}))}},{deep:!0}),h}const ERe=o=>{const{element:s}=o,i=d.ref(-1),u=C=>{const S=C==null?void 0:C.getSelection();try{if(S)return S.getRangeAt(0).startOffset}catch{}return 0},m=()=>{var S;const C=(S=s.value)==null?void 0:S.getRootNode();i.value=u(C)},h=C=>{var O;const S=C.target,_=(O=s.value)==null?void 0:O.getRootNode();i.value=u(_),S.addEventListener("click",m),S.addEventListener("keyup",B=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(B.key)&&m()});const N=()=>{S.removeEventListener("click",m),S.removeEventListener("keyup",m),S.removeEventListener("blur",N),setTimeout(()=>{i.value=-1},300)};S.addEventListener("blur",N)},b=()=>{var C;(C=s.value)==null||C.addEventListener("focus",h,!0)};return d.watch(s,C=>{C&&b()},{immediate:!0}),d.onUnmounted(()=>{var C;(C=s.value)==null||C.removeEventListener("focus",h,!0)}),{startOffset:i}};function _Re(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const kRe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},TRe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,S=MU(m),_=d.ref(-1),N=d.ref(0),O=Poe({element:C}),B=d.ref(!1),F=Boe(),Z=G=>{var Y,q;if(d.toValue(B)&&d.toValue(O)&&!ha((Y=d.toValue(b))==null?void 0:Y.cellValue,G)){const W=x6e(G,((q=d.toValue(S))==null?void 0:q.nodes)||"");let L=W;W&&(d.toValue(N)===0&&(L+=","),d.toValue(_)>=0&&(u.value=_Re(d.toValue(u),d.toValue(_),d.toValue(N),L),N.value=W.length))}};d.watch(()=>h,()=>{var G,Y,q,W,L,me;if((G=S.value)==null||G.setSelectedNodes([]),["range","cell"].includes((Y=d.toValue(b))==null?void 0:Y.type))return _.value=kRe(i.value,h.value),N.value=(W=(q=d.toValue(b))==null?void 0:q.value)==null?void 0:W.length,B.value=!0,F("selectNodes",{data:(L=d.toValue(b))==null?void 0:L.cellValue,mode:"multiple",callback:({data:Ze})=>{Z(Ze)}}),!1;if([",","(","="].includes((me=d.toValue(b))==null?void 0:me.value))return _.value=d.toValue(s),B.value=!0,N.value=0,F("selectNodes",{data:[],mode:"multiple",callback:({data:Ze})=>{Z(Ze)}}),!1;B.value=!1,_.value=-1},{immediate:!0,deep:!0})},ARe=o=>{const{startOffset:s,showStr:i}=o,u=d.ref(-1);d.watch(()=>s,()=>{var h;if(d.toValue(s)<=0)u.value=-1;else{let b=0;for(let C=0;C<i.value.length;C++){const S=i.value[C];if(b+=(h=S==null?void 0:S.value)==null?void 0:h.length,b>=d.toValue(s)){u.value=C;break}}}},{deep:!0,immediate:!0});const m=d.computed(()=>{var h;return(h=d.toValue(i))==null?void 0:h[d.toValue(u)]});return{currentItemIndex:u,currentItem:m}};function NRe(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const ORe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},$Re=o=>{const{startOffset:s,showStr:i,value:u,currentItemIndex:m,currentItem:h,element:b}=o,C=d.ref(-1),S=d.ref(0),_=Poe({element:b}),N=d.ref(!1),O=Boe(),B=F=>{var Z;if(d.toValue(N)&&d.toValue(_)&&!ha((Z=d.toValue(h))==null?void 0:Z.value,F)){const G=F,Y=G;G&&d.toValue(C)>=0&&(u.value=NRe(d.toValue(u),d.toValue(C),d.toValue(S),Y),S.value=G.length)}};d.watch(()=>m,()=>{var F,Z,G,Y,q;if(["function"].includes((F=d.toValue(h))==null?void 0:F.type))return C.value=ORe(i.value,m.value),S.value=(G=(Z=d.toValue(h))==null?void 0:Z.value)==null?void 0:G.length,N.value=!0,O("selectFunction",{data:(Y=d.toValue(h))==null?void 0:Y.value,callback:({data:W})=>{B(W)}}),!1;if([",","(","="].includes((q=d.toValue(h))==null?void 0:q.value))return C.value=d.toValue(s),N.value=!0,S.value=0,O("selectFunction",{data:"",callback:({data:W})=>{B(W)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},DRe={class:"node-formula"},MRe={class:"node-formula-show"},RRe=d.defineComponent({__name:"index",props:d.mergeModels({id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{getCellValue:i}=CRe({editorId:s==null?void 0:s.editorId}),u=d.useModel(o,"modelValue"),m=d.ref(),{startOffset:h}=ERe({element:m});SRe(m,u,h);const b=d.computed(()=>{const N=yRe(u.value);return N==null?void 0:N.map(B=>B.type==="cell"||B.type==="range"?{cellValue:i(B.value),...B}:B)}),C=d.computed(()=>{const N=wRe(u.value,b.value);let O=-1;return N.map(F=>(F==null?void 0:F.type)==="cell"||(F==null?void 0:F.type)==="range"?(O++,{...F,color:ule[O%ule.length]}):(F==null?void 0:F.type)==="function"?{...F,color:"#0318ff"}:F)});xRe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:S,currentItem:_}=ARe({element:m,startOffset:h,value:u,showStr:C});return TRe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:S,currentItem:_}),$Re({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:S,currentItem:_}),(N,O)=>(d.openBlock(),d.createElementBlock("div",DRe,[d.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),d.createElementVNode("div",MRe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(C.value,(B,F)=>(d.openBlock(),d.createElementBlock("span",{key:F,class:d.normalizeClass(["node-formula-item",`node-formula-item-type-${B==null?void 0:B.type}`,F===d.unref(S)?"node-formula-item-active":""]),style:d.normalizeStyle({"--text-color":(B==null?void 0:B.color)||"#000","--bg-color":d.unref(Mz)((B==null?void 0:B.color)||"#000",.1)})},d.toDisplayString(B.value),7))),128))])]))}}),Vfe=mi(RRe,[["__scopeId","data-v-f4b96eb4"]]),BRe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],IRe={class:"select-function"},PRe=["onClick"],FRe={class:"function-item"},LRe={class:"function-item-desc"},VRe=d.defineComponent({__name:"index",props:d.mergeModels({id:{type:String,default:""},functionList:{type:Array,default:()=>[]}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o;let i=null;const u=d.computed(()=>{var b;return((b=s.functionList)==null?void 0:b.length)>0?s.functionList:BRe}),m=d.useModel(o,"modelValue"),h=b=>{m.value=b,i==null||i({data:b})};return Pfe("selectFunction",({data:b,callback:C})=>{i=C,m.value=b}),(b,C)=>(d.openBlock(),d.createElementBlock("div",IRe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(S,_)=>(d.openBlock(),d.createElementBlock("div",{key:_},[d.createElementVNode("div",{onClick:()=>{h(S.value)},class:d.normalizeClass(["function-item-wrapper",{active:m.value===S.value}])},[d.createElementVNode("div",FRe,d.toDisplayString(S.value),1),d.createElementVNode("div",LRe,d.toDisplayString(S.label),1)],10,PRe)]))),128))]))}}),Hfe=mi(VRe,[["__scopeId","data-v-6e079ff0"]]),HRe=["innerHTML"],zfe=d.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=d.useModel(o,"modelValue");return(i,u)=>(d.openBlock(),d.createBlock($oe,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,HRe)]),_:1}))}});function RU(o){return d.getCurrentScope()?(d.onScopeDispose(o),!0):!1}function M0(o){return typeof o=="function"?o():d.unref(o)}const zRe=typeof window<"u"&&typeof document<"u",URe=o=>typeof o<"u",jRe=Object.prototype.toString,WRe=o=>jRe.call(o)==="[object Object]",ZRe=()=>{};function GRe(o,s){function i(...u){return new Promise((m,h)=>{Promise.resolve(o(()=>s.apply(this,u),{fn:s,thisArg:this,args:u})).then(m).catch(h)})}return i}const Ufe=o=>o();function qRe(o=Ufe){const s=d.ref(!0);function i(){s.value=!1}function u(){s.value=!0}const m=(...h)=>{s.value&&o(...h)};return{isActive:d.readonly(s),pause:i,resume:u,eventFilter:m}}function dle(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function YRe(o,s,i={}){const{eventFilter:u=Ufe,...m}=i;return d.watch(o,GRe(u,s),m)}function ZA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:S}=qRe(u);return{stop:YRe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:S}}function KRe(o,s={}){if(!d.isRef(o))return d.toRefs(o);const i=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const u in o.value)i[u]=d.customRef(()=>({get(){return o.value[u]},set(m){var h;if((h=M0(s.replaceRef))!=null?h:!0)if(Array.isArray(o.value)){const C=[...o.value];C[u]=m,o.value=C}else{const C={...o.value,[u]:m};Object.setPrototypeOf(C,Object.getPrototypeOf(o.value)),o.value=C}else o.value[u]=m}}));return i}function wne(o,s=!1){function i(O,{flush:B="sync",deep:F=!1,timeout:Z,throwOnTimeout:G}={}){let Y=null;const W=[new Promise(L=>{Y=d.watch(o,me=>{O(me)!==s&&(Y==null||Y(),L(me))},{flush:B,deep:F,immediate:!0})})];return Z!=null&&W.push(dle(Z,G).then(()=>M0(o)).finally(()=>Y==null?void 0:Y())),Promise.race(W)}function u(O,B){if(!d.isRef(O))return i(me=>me===O,B);const{flush:F="sync",deep:Z=!1,timeout:G,throwOnTimeout:Y}=B??{};let q=null;const L=[new Promise(me=>{q=d.watch([o,O],([Ze,_e])=>{s!==(Ze===_e)&&(q==null||q(),me(Ze))},{flush:F,deep:Z,immediate:!0})})];return G!=null&&L.push(dle(G,Y).then(()=>M0(o)).finally(()=>(q==null||q(),M0(o)))),Promise.race(L)}function m(O){return i(B=>!!B,O)}function h(O){return u(null,O)}function b(O){return u(void 0,O)}function C(O){return i(Number.isNaN,O)}function S(O,B){return i(F=>{const Z=Array.from(F);return Z.includes(O)||Z.includes(M0(O))},B)}function _(O){return N(1,O)}function N(O=1,B){let F=-1;return i(()=>(F+=1,F>=O),B)}return Array.isArray(M0(o))?{toMatch:i,toContains:S,changed:_,changedTimes:N,get not(){return wne(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return wne(o,!s)}}}function Cne(o){return wne(o)}function XRe(o){var s;const i=M0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const jfe=zRe?window:void 0;function Wfe(...o){let s,i,u,m;if(typeof o[0]=="string"||Array.isArray(o[0])?([i,u,m]=o,s=jfe):[s,i,u,m]=o,!s)return ZRe;Array.isArray(i)||(i=[i]),Array.isArray(u)||(u=[u]);const h=[],b=()=>{h.forEach(N=>N()),h.length=0},C=(N,O,B,F)=>(N.addEventListener(O,B,F),()=>N.removeEventListener(O,B,F)),S=d.watch(()=>[XRe(s),M0(m)],([N,O])=>{if(b(),!N)return;const B=WRe(O)?{...O}:O;h.push(...i.flatMap(F=>u.map(Z=>C(N,F,Z,B))))},{immediate:!0,flush:"post"}),_=()=>{S(),b()};return RU(_),_}function JRe(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function fle(...o){let s,i,u={};o.length===3?(s=o[0],i=o[1],u=o[2]):o.length===2?typeof o[1]=="object"?(s=!0,i=o[0],u=o[1]):(s=o[0],i=o[1]):(s=!0,i=o[0]);const{target:m=jfe,eventName:h="keydown",passive:b=!1,dedupe:C=!1}=u,S=JRe(s);return Wfe(m,h,N=>{N.repeat&&M0(C)||S(N)&&i(N)},b)}function QRe(o){return JSON.parse(JSON.stringify(o))}function gte(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:S=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:B}=u,F=d.getCurrentInstance(),Z=i||(F==null?void 0:F.emit)||((m=F==null?void 0:F.$emit)==null?void 0:m.bind(F))||((b=(h=F==null?void 0:F.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(F==null?void 0:F.proxy));let G=_;s||(s="modelValue"),G=G||`update:${s.toString()}`;const Y=L=>C?typeof C=="function"?C(L):QRe(L):L,q=()=>URe(o[s])?Y(o[s]):O,W=L=>{B?B(L)&&Z(G,L):Z(G,L)};if(S){const L=q(),me=d.ref(L);let Ze=!1;return d.watch(()=>o[s],_e=>{Ze||(Ze=!0,me.value=Y(_e),d.nextTick(()=>Ze=!1))}),d.watch(me,_e=>{!Ze&&(_e!==o[s]||N)&&W(_e)},{deep:N}),me}else return d.computed({get(){return q()},set(L){W(L)}})}var eBe={value:()=>{}};function BU(){for(var o=0,s=arguments.length,i={},u;o<s;++o){if(!(u=arguments[o]+"")||u in i||/[\s.]/.test(u))throw new Error("illegal type: "+u);i[u]=[]}return new az(i)}function az(o){this._=o}function tBe(o,s){return o.trim().split(/^|\s+/).map(function(i){var u="",m=i.indexOf(".");if(m>=0&&(u=i.slice(m+1),i=i.slice(0,m)),i&&!s.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:u}})}az.prototype=BU.prototype={constructor:az,on:function(o,s){var i=this._,u=tBe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=nBe(i[m],o.name)))return m;return}if(s!=null&&typeof s!="function")throw new Error("invalid callback: "+s);for(;++h<b;)if(m=(o=u[h]).type)i[m]=mle(i[m],o.name,s);else if(s==null)for(m in i)i[m]=mle(i[m],o.name,null);return this},copy:function(){var o={},s=this._;for(var i in s)o[i]=s[i].slice();return new az(o)},call:function(o,s){if((m=arguments.length-2)>0)for(var i=new Array(m),u=0,m,h;u<m;++u)i[u]=arguments[u+2];if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(h=this._[o],u=0,m=h.length;u<m;++u)h[u].value.apply(s,i)},apply:function(o,s,i){if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(var u=this._[o],m=0,h=u.length;m<h;++m)u[m].value.apply(s,i)}};function nBe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function mle(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=eBe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var Sne="http://www.w3.org/1999/xhtml";const ple={svg:"http://www.w3.org/2000/svg",xhtml:Sne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function IU(o){var s=o+="",i=s.indexOf(":");return i>=0&&(s=o.slice(0,i))!=="xmlns"&&(o=o.slice(i+1)),ple.hasOwnProperty(s)?{space:ple[s],local:o}:o}function oBe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===Sne&&s.documentElement.namespaceURI===Sne?s.createElement(o):s.createElementNS(i,o)}}function sBe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Zfe(o){var s=IU(o);return(s.local?sBe:oBe)(s)}function rBe(){}function Foe(o){return o==null?rBe:function(){return this.querySelector(o)}}function aBe(o){typeof o!="function"&&(o=Foe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=new Array(b),S,_,N=0;N<b;++N)(S=h[N])&&(_=o.call(S,S.__data__,N,h))&&("__data__"in S&&(_.__data__=S.__data__),C[N]=_);return new Sp(u,this._parents)}function iBe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function lBe(){return[]}function Gfe(o){return o==null?lBe:function(){return this.querySelectorAll(o)}}function cBe(o){return function(){return iBe(o.apply(this,arguments))}}function uBe(o){typeof o=="function"?o=cBe(o):o=Gfe(o);for(var s=this._groups,i=s.length,u=[],m=[],h=0;h<i;++h)for(var b=s[h],C=b.length,S,_=0;_<C;++_)(S=b[_])&&(u.push(o.call(S,S.__data__,_,b)),m.push(S));return new Sp(u,m)}function qfe(o){return function(){return this.matches(o)}}function Yfe(o){return function(s){return s.matches(o)}}var dBe=Array.prototype.find;function fBe(o){return function(){return dBe.call(this.children,o)}}function mBe(){return this.firstElementChild}function pBe(o){return this.select(o==null?mBe:fBe(typeof o=="function"?o:Yfe(o)))}var gBe=Array.prototype.filter;function hBe(){return Array.from(this.children)}function vBe(o){return function(){return gBe.call(this.children,o)}}function bBe(o){return this.selectAll(o==null?hBe:vBe(typeof o=="function"?o:Yfe(o)))}function yBe(o){typeof o!="function"&&(o=qfe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],S,_=0;_<b;++_)(S=h[_])&&o.call(S,S.__data__,_,h)&&C.push(S);return new Sp(u,this._parents)}function Kfe(o){return new Array(o.length)}function wBe(){return new Sp(this._enter||this._groups.map(Kfe),this._parents)}function Bz(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}Bz.prototype={constructor:Bz,appendChild:function(o){return this._parent.insertBefore(o,this._next)},insertBefore:function(o,s){return this._parent.insertBefore(o,s)},querySelector:function(o){return this._parent.querySelector(o)},querySelectorAll:function(o){return this._parent.querySelectorAll(o)}};function CBe(o){return function(){return o}}function SBe(o,s,i,u,m,h){for(var b=0,C,S=s.length,_=h.length;b<_;++b)(C=s[b])?(C.__data__=h[b],u[b]=C):i[b]=new Bz(o,h[b]);for(;b<S;++b)(C=s[b])&&(m[b]=C)}function xBe(o,s,i,u,m,h,b){var C,S,_=new Map,N=s.length,O=h.length,B=new Array(N),F;for(C=0;C<N;++C)(S=s[C])&&(B[C]=F=b.call(S,S.__data__,C,s)+"",_.has(F)?m[C]=S:_.set(F,S));for(C=0;C<O;++C)F=b.call(o,h[C],C,h)+"",(S=_.get(F))?(u[C]=S,S.__data__=h[C],_.delete(F)):i[C]=new Bz(o,h[C]);for(C=0;C<N;++C)(S=s[C])&&_.get(B[C])===S&&(m[C]=S)}function EBe(o){return o.__data__}function _Be(o,s){if(!arguments.length)return Array.from(this,EBe);var i=s?xBe:SBe,u=this._parents,m=this._groups;typeof o!="function"&&(o=CBe(o));for(var h=m.length,b=new Array(h),C=new Array(h),S=new Array(h),_=0;_<h;++_){var N=u[_],O=m[_],B=O.length,F=kBe(o.call(N,N&&N.__data__,_,u)),Z=F.length,G=C[_]=new Array(Z),Y=b[_]=new Array(Z),q=S[_]=new Array(B);i(N,O,G,Y,q,F,s);for(var W=0,L=0,me,Ze;W<Z;++W)if(me=G[W]){for(W>=L&&(L=W+1);!(Ze=Y[L])&&++L<Z;);me._next=Ze||null}}return b=new Sp(b,u),b._enter=C,b._exit=S,b}function kBe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function TBe(){return new Sp(this._exit||this._groups.map(Kfe),this._parents)}function ABe(o,s,i){var u=this.enter(),m=this,h=this.exit();return typeof o=="function"?(u=o(u),u&&(u=u.selection())):u=u.append(o+""),s!=null&&(m=s(m),m&&(m=m.selection())),i==null?h.remove():i(h),u&&m?u.merge(m).order():m}function NBe(o){for(var s=o.selection?o.selection():o,i=this._groups,u=s._groups,m=i.length,h=u.length,b=Math.min(m,h),C=new Array(m),S=0;S<b;++S)for(var _=i[S],N=u[S],O=_.length,B=C[S]=new Array(O),F,Z=0;Z<O;++Z)(F=_[Z]||N[Z])&&(B[Z]=F);for(;S<m;++S)C[S]=i[S];return new Sp(C,this._parents)}function OBe(){for(var o=this._groups,s=-1,i=o.length;++s<i;)for(var u=o[s],m=u.length-1,h=u[m],b;--m>=0;)(b=u[m])&&(h&&b.compareDocumentPosition(h)^4&&h.parentNode.insertBefore(b,h),h=b);return this}function $Be(o){o||(o=DBe);function s(O,B){return O&&B?o(O.__data__,B.__data__):!O-!B}for(var i=this._groups,u=i.length,m=new Array(u),h=0;h<u;++h){for(var b=i[h],C=b.length,S=m[h]=new Array(C),_,N=0;N<C;++N)(_=b[N])&&(S[N]=_);S.sort(s)}return new Sp(m,this._parents).order()}function DBe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function MBe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function RBe(){return Array.from(this)}function BBe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length;m<h;++m){var b=u[m];if(b)return b}return null}function IBe(){let o=0;for(const s of this)++o;return o}function PBe(){return!this.node()}function FBe(o){for(var s=this._groups,i=0,u=s.length;i<u;++i)for(var m=s[i],h=0,b=m.length,C;h<b;++h)(C=m[h])&&o.call(C,C.__data__,h,m);return this}function LBe(o){return function(){this.removeAttribute(o)}}function VBe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function HBe(o,s){return function(){this.setAttribute(o,s)}}function zBe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function UBe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function jBe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttributeNS(o.space,o.local):this.setAttributeNS(o.space,o.local,i)}}function WBe(o,s){var i=IU(o);if(arguments.length<2){var u=this.node();return i.local?u.getAttributeNS(i.space,i.local):u.getAttribute(i)}return this.each((s==null?i.local?VBe:LBe:typeof s=="function"?i.local?jBe:UBe:i.local?zBe:HBe)(i,s))}function Xfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function ZBe(o){return function(){this.style.removeProperty(o)}}function GBe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function qBe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function YBe(o,s,i){return arguments.length>1?this.each((s==null?ZBe:typeof s=="function"?qBe:GBe)(o,s,i??"")):g4(this.node(),o)}function g4(o,s){return o.style.getPropertyValue(s)||Xfe(o).getComputedStyle(o,null).getPropertyValue(s)}function KBe(o){return function(){delete this[o]}}function XBe(o,s){return function(){this[o]=s}}function JBe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function QBe(o,s){return arguments.length>1?this.each((s==null?KBe:typeof s=="function"?JBe:XBe)(o,s)):this.node()[o]}function Jfe(o){return o.trim().split(/^|\s+/)}function Loe(o){return o.classList||new Qfe(o)}function Qfe(o){this._node=o,this._names=Jfe(o.getAttribute("class")||"")}Qfe.prototype={add:function(o){var s=this._names.indexOf(o);s<0&&(this._names.push(o),this._node.setAttribute("class",this._names.join(" ")))},remove:function(o){var s=this._names.indexOf(o);s>=0&&(this._names.splice(s,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(o){return this._names.indexOf(o)>=0}};function eme(o,s){for(var i=Loe(o),u=-1,m=s.length;++u<m;)i.add(s[u])}function tme(o,s){for(var i=Loe(o),u=-1,m=s.length;++u<m;)i.remove(s[u])}function eIe(o){return function(){eme(this,o)}}function tIe(o){return function(){tme(this,o)}}function nIe(o,s){return function(){(s.apply(this,arguments)?eme:tme)(this,o)}}function oIe(o,s){var i=Jfe(o+"");if(arguments.length<2){for(var u=Loe(this.node()),m=-1,h=i.length;++m<h;)if(!u.contains(i[m]))return!1;return!0}return this.each((typeof s=="function"?nIe:s?eIe:tIe)(i,s))}function sIe(){this.textContent=""}function rIe(o){return function(){this.textContent=o}}function aIe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function iIe(o){return arguments.length?this.each(o==null?sIe:(typeof o=="function"?aIe:rIe)(o)):this.node().textContent}function lIe(){this.innerHTML=""}function cIe(o){return function(){this.innerHTML=o}}function uIe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function dIe(o){return arguments.length?this.each(o==null?lIe:(typeof o=="function"?uIe:cIe)(o)):this.node().innerHTML}function fIe(){this.nextSibling&&this.parentNode.appendChild(this)}function mIe(){return this.each(fIe)}function pIe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gIe(){return this.each(pIe)}function hIe(o){var s=typeof o=="function"?o:Zfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function vIe(){return null}function bIe(o,s){var i=typeof o=="function"?o:Zfe(o),u=s==null?vIe:typeof s=="function"?s:Foe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function yIe(){var o=this.parentNode;o&&o.removeChild(this)}function wIe(){return this.each(yIe)}function CIe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function SIe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function xIe(o){return this.select(o?SIe:CIe)}function EIe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function _Ie(o){return function(s){o.call(this,s,this.__data__)}}function kIe(o){return o.trim().split(/^|\s+/).map(function(s){var i="",u=s.indexOf(".");return u>=0&&(i=s.slice(u+1),s=s.slice(0,u)),{type:s,name:i}})}function TIe(o){return function(){var s=this.__on;if(s){for(var i=0,u=-1,m=s.length,h;i<m;++i)h=s[i],(!o.type||h.type===o.type)&&h.name===o.name?this.removeEventListener(h.type,h.listener,h.options):s[++u]=h;++u?s.length=u:delete this.__on}}}function AIe(o,s,i){return function(){var u=this.__on,m,h=_Ie(s);if(u){for(var b=0,C=u.length;b<C;++b)if((m=u[b]).type===o.type&&m.name===o.name){this.removeEventListener(m.type,m.listener,m.options),this.addEventListener(m.type,m.listener=h,m.options=i),m.value=s;return}}this.addEventListener(o.type,h,i),m={type:o.type,name:o.name,value:s,listener:h,options:i},u?u.push(m):this.__on=[m]}}function NIe(o,s,i){var u=kIe(o+""),m,h=u.length,b;if(arguments.length<2){var C=this.node().__on;if(C){for(var S=0,_=C.length,N;S<_;++S)for(m=0,N=C[S];m<h;++m)if((b=u[m]).type===N.type&&b.name===N.name)return N.value}return}for(C=s?AIe:TIe,m=0;m<h;++m)this.each(C(u[m],s,i));return this}function nme(o,s,i){var u=Xfe(o),m=u.CustomEvent;typeof m=="function"?m=new m(s,i):(m=u.document.createEvent("Event"),i?(m.initEvent(s,i.bubbles,i.cancelable),m.detail=i.detail):m.initEvent(s,!1,!1)),o.dispatchEvent(m)}function OIe(o,s){return function(){return nme(this,o,s)}}function $Ie(o,s){return function(){return nme(this,o,s.apply(this,arguments))}}function DIe(o,s){return this.each((typeof s=="function"?$Ie:OIe)(o,s))}function*MIe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length,b;m<h;++m)(b=u[m])&&(yield b)}var ome=[null];function Sp(o,s){this._groups=o,this._parents=s}function PR(){return new Sp([[document.documentElement]],ome)}function RIe(){return this}Sp.prototype=PR.prototype={constructor:Sp,select:aBe,selectAll:uBe,selectChild:pBe,selectChildren:bBe,filter:yBe,data:_Be,enter:wBe,exit:TBe,join:ABe,merge:NBe,selection:RIe,order:OBe,sort:$Be,call:MBe,nodes:RBe,node:BBe,size:IBe,empty:PBe,each:FBe,attr:WBe,style:YBe,property:QBe,classed:oIe,text:iIe,html:dIe,raise:mIe,lower:gIe,append:hIe,insert:bIe,remove:wIe,clone:xIe,datum:EIe,on:NIe,dispatch:DIe,[Symbol.iterator]:MIe};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],ome)}function BIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Nv(o,s){if(o=BIe(o),s===void 0&&(s=o.currentTarget),s){var i=s.ownerSVGElement||s;if(i.createSVGPoint){var u=i.createSVGPoint();return u.x=o.clientX,u.y=o.clientY,u=u.matrixTransform(s.getScreenCTM().inverse()),[u.x,u.y]}if(s.getBoundingClientRect){var m=s.getBoundingClientRect();return[o.clientX-m.left-s.clientLeft,o.clientY-m.top-s.clientTop]}}return[o.pageX,o.pageY]}const IIe={passive:!1},fR={capture:!0,passive:!1};function hte(o){o.stopImmediatePropagation()}function a4(o){o.preventDefault(),o.stopImmediatePropagation()}function sme(o){var s=o.document.documentElement,i=Mh(o).on("dragstart.drag",a4,fR);"onselectstart"in s?i.on("selectstart.drag",a4,fR):(s.__noselect=s.style.MozUserSelect,s.style.MozUserSelect="none")}function rme(o,s){var i=o.document.documentElement,u=Mh(o).on("dragstart.drag",null);s&&(u.on("click.drag",a4,fR),setTimeout(function(){u.on("click.drag",null)},0)),"onselectstart"in i?u.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const BH=o=>()=>o;function xne(o,{sourceEvent:s,subject:i,target:u,identifier:m,active:h,x:b,y:C,dx:S,dy:_,dispatch:N}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},identifier:{value:m,enumerable:!0,configurable:!0},active:{value:h,enumerable:!0,configurable:!0},x:{value:b,enumerable:!0,configurable:!0},y:{value:C,enumerable:!0,configurable:!0},dx:{value:S,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:N}})}xne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function PIe(o){return!o.ctrlKey&&!o.button}function FIe(){return this.parentNode}function LIe(o,s){return s??{x:o.x,y:o.y}}function VIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function HIe(){var o=PIe,s=FIe,i=LIe,u=VIe,m={},h=BU("start","drag","end"),b=0,C,S,_,N,O=0;function B(me){me.on("mousedown.drag",F).filter(u).on("touchstart.drag",Y).on("touchmove.drag",q,IIe).on("touchend.drag touchcancel.drag",W).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function F(me,Ze){if(!(N||!o.call(this,me,Ze))){var _e=L(this,s.call(this,me,Ze),me,Ze,"mouse");_e&&(Mh(me.view).on("mousemove.drag",Z,fR).on("mouseup.drag",G,fR),sme(me.view),hte(me),_=!1,C=me.clientX,S=me.clientY,_e("start",me))}}function Z(me){if(a4(me),!_){var Ze=me.clientX-C,_e=me.clientY-S;_=Ze*Ze+_e*_e>O}m.mouse("drag",me)}function G(me){Mh(me.view).on("mousemove.drag mouseup.drag",null),rme(me.view,_),a4(me),m.mouse("end",me)}function Y(me,Ze){if(o.call(this,me,Ze)){var _e=me.changedTouches,Q=s.call(this,me,Ze),Fe=_e.length,lt,nt;for(lt=0;lt<Fe;++lt)(nt=L(this,Q,me,Ze,_e[lt].identifier,_e[lt]))&&(hte(me),nt("start",me,_e[lt]))}}function q(me){var Ze=me.changedTouches,_e=Ze.length,Q,Fe;for(Q=0;Q<_e;++Q)(Fe=m[Ze[Q].identifier])&&(a4(me),Fe("drag",me,Ze[Q]))}function W(me){var Ze=me.changedTouches,_e=Ze.length,Q,Fe;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),Q=0;Q<_e;++Q)(Fe=m[Ze[Q].identifier])&&(hte(me),Fe("end",me,Ze[Q]))}function L(me,Ze,_e,Q,Fe,lt){var nt=h.copy(),$e=Nv(lt||_e,Ze),ue,Nt,ge;if((ge=i.call(me,new xne("beforestart",{sourceEvent:_e,target:B,identifier:Fe,active:b,x:$e[0],y:$e[1],dx:0,dy:0,dispatch:nt}),Q))!=null)return ue=ge.x-$e[0]||0,Nt=ge.y-$e[1]||0,function Oe(R,je,ye){var tt=$e,st;switch(R){case"start":m[Fe]=Oe,st=b++;break;case"end":delete m[Fe],--b;case"drag":$e=Nv(ye||je,Ze),st=b;break}nt.call(R,me,new xne(R,{sourceEvent:je,subject:ge,target:B,identifier:Fe,active:st,x:$e[0]+ue,y:$e[1]+Nt,dx:$e[0]-tt[0],dy:$e[1]-tt[1],dispatch:nt}),Q)}}return B.filter=function(me){return arguments.length?(o=typeof me=="function"?me:BH(!!me),B):o},B.container=function(me){return arguments.length?(s=typeof me=="function"?me:BH(me),B):s},B.subject=function(me){return arguments.length?(i=typeof me=="function"?me:BH(me),B):i},B.touchable=function(me){return arguments.length?(u=typeof me=="function"?me:BH(!!me),B):u},B.on=function(){var me=h.on.apply(h,arguments);return me===h?B:me},B.clickDistance=function(me){return arguments.length?(O=(me=+me)*me,B):Math.sqrt(O)},B}function Voe(o,s,i){o.prototype=s.prototype=i,i.constructor=o}function ame(o,s){var i=Object.create(o.prototype);for(var u in s)i[u]=s[u];return i}function FR(){}var mR=.7,Iz=1/mR,i4="\\s*([+-]?\\d+)\\s*",pR="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zIe=/^#([0-9a-f]{3,8})$/,UIe=new RegExp(`^rgb\\(${i4},${i4},${i4}\\)$`),jIe=new RegExp(`^rgb\\(${Dv},${Dv},${Dv}\\)$`),WIe=new RegExp(`^rgba\\(${i4},${i4},${i4},${pR}\\)$`),ZIe=new RegExp(`^rgba\\(${Dv},${Dv},${Dv},${pR}\\)$`),GIe=new RegExp(`^hsl\\(${pR},${Dv},${Dv}\\)$`),qIe=new RegExp(`^hsla\\(${pR},${Dv},${Dv},${pR}\\)$`),gle={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};Voe(FR,gR,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:hle,formatHex:hle,formatHex8:YIe,formatHsl:KIe,formatRgb:vle,toString:vle});function hle(){return this.rgb().formatHex()}function YIe(){return this.rgb().formatHex8()}function KIe(){return ime(this).formatHsl()}function vle(){return this.rgb().formatRgb()}function gR(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=zIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?ble(s):i===3?new Sm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?IH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?IH(s>>12&15|s>>8&240,s>>8&15|s>>4&240,s>>4&15|s&240,((s&15)<<4|s&15)/255):null):(s=UIe.exec(o))?new Sm(s[1],s[2],s[3],1):(s=jIe.exec(o))?new Sm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=WIe.exec(o))?IH(s[1],s[2],s[3],s[4]):(s=ZIe.exec(o))?IH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=GIe.exec(o))?Cle(s[1],s[2]/100,s[3]/100,1):(s=qIe.exec(o))?Cle(s[1],s[2]/100,s[3]/100,s[4]):gle.hasOwnProperty(o)?ble(gle[o]):o==="transparent"?new Sm(NaN,NaN,NaN,0):null}function ble(o){return new Sm(o>>16&255,o>>8&255,o&255,1)}function IH(o,s,i,u){return u<=0&&(o=s=i=NaN),new Sm(o,s,i,u)}function XIe(o){return o instanceof FR||(o=gR(o)),o?(o=o.rgb(),new Sm(o.r,o.g,o.b,o.opacity)):new Sm}function Ene(o,s,i,u){return arguments.length===1?XIe(o):new Sm(o,s,i,u??1)}function Sm(o,s,i,u){this.r=+o,this.g=+s,this.b=+i,this.opacity=+u}Voe(Sm,Ene,ame(FR,{brighter(o){return o=o==null?Iz:Math.pow(Iz,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?mR:Math.pow(mR,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new Sm(EE(this.r),EE(this.g),EE(this.b),Pz(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:yle,formatHex:yle,formatHex8:JIe,formatRgb:wle,toString:wle}));function yle(){return`#${vE(this.r)}${vE(this.g)}${vE(this.b)}`}function JIe(){return`#${vE(this.r)}${vE(this.g)}${vE(this.b)}${vE((isNaN(this.opacity)?1:this.opacity)*255)}`}function wle(){const o=Pz(this.opacity);return`${o===1?"rgb(":"rgba("}${EE(this.r)}, ${EE(this.g)}, ${EE(this.b)}${o===1?")":`, ${o})`}`}function Pz(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function EE(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function vE(o){return o=EE(o),(o<16?"0":"")+o.toString(16)}function Cle(o,s,i,u){return u<=0?o=s=i=NaN:i<=0||i>=1?o=s=NaN:s<=0&&(o=NaN),new Rh(o,s,i,u)}function ime(o){if(o instanceof Rh)return new Rh(o.h,o.s,o.l,o.opacity);if(o instanceof FR||(o=gR(o)),!o)return new Rh;if(o instanceof Rh)return o;o=o.rgb();var s=o.r/255,i=o.g/255,u=o.b/255,m=Math.min(s,i,u),h=Math.max(s,i,u),b=NaN,C=h-m,S=(h+m)/2;return C?(s===h?b=(i-u)/C+(i<u)*6:i===h?b=(u-s)/C+2:b=(s-i)/C+4,C/=S<.5?h+m:2-h-m,b*=60):C=S>0&&S<1?0:b,new Rh(b,C,S,o.opacity)}function QIe(o,s,i,u){return arguments.length===1?ime(o):new Rh(o,s,i,u??1)}function Rh(o,s,i,u){this.h=+o,this.s=+s,this.l=+i,this.opacity=+u}Voe(Rh,QIe,ame(FR,{brighter(o){return o=o==null?Iz:Math.pow(Iz,o),new Rh(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?mR:Math.pow(mR,o),new Rh(this.h,this.s,this.l*o,this.opacity)},rgb(){var o=this.h%360+(this.h<0)*360,s=isNaN(o)||isNaN(this.s)?0:this.s,i=this.l,u=i+(i<.5?i:1-i)*s,m=2*i-u;return new Sm(vte(o>=240?o-240:o+120,m,u),vte(o,m,u),vte(o<120?o+240:o-120,m,u),this.opacity)},clamp(){return new Rh(Sle(this.h),PH(this.s),PH(this.l),Pz(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=Pz(this.opacity);return`${o===1?"hsl(":"hsla("}${Sle(this.h)}, ${PH(this.s)*100}%, ${PH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function Sle(o){return o=(o||0)%360,o<0?o+360:o}function PH(o){return Math.max(0,Math.min(1,o||0))}function vte(o,s,i){return(o<60?s+(i-s)*o/60:o<180?i:o<240?s+(i-s)*(240-o)/60:s)*255}const lme=o=>()=>o;function ePe(o,s){return function(i){return o+i*s}}function tPe(o,s,i){return o=Math.pow(o,i),s=Math.pow(s,i)-o,i=1/i,function(u){return Math.pow(o+u*s,i)}}function nPe(o){return(o=+o)==1?cme:function(s,i){return i-s?tPe(s,i,o):lme(isNaN(s)?i:s)}}function cme(o,s){var i=s-o;return i?ePe(o,i):lme(isNaN(o)?s:o)}const xle=function o(s){var i=nPe(s);function u(m,h){var b=i((m=Ene(m)).r,(h=Ene(h)).r),C=i(m.g,h.g),S=i(m.b,h.b),_=cme(m.opacity,h.opacity);return function(N){return m.r=b(N),m.g=C(N),m.b=S(N),m.opacity=_(N),m+""}}return u.gamma=o,u}(1);function r2(o,s){return o=+o,s=+s,function(i){return o*(1-i)+s*i}}var _ne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bte=new RegExp(_ne.source,"g");function oPe(o){return function(){return o}}function sPe(o){return function(s){return o(s)+""}}function rPe(o,s){var i=_ne.lastIndex=bte.lastIndex=0,u,m,h,b=-1,C=[],S=[];for(o=o+"",s=s+"";(u=_ne.exec(o))&&(m=bte.exec(s));)(h=m.index)>i&&(h=s.slice(i,h),C[b]?C[b]+=h:C[++b]=h),(u=u[0])===(m=m[0])?C[b]?C[b]+=m:C[++b]=m:(C[++b]=null,S.push({i:b,x:r2(u,m)})),i=bte.lastIndex;return i<s.length&&(h=s.slice(i),C[b]?C[b]+=h:C[++b]=h),C.length<2?S[0]?sPe(S[0].x):oPe(s):(s=S.length,function(_){for(var N=0,O;N<s;++N)C[(O=S[N]).i]=O.x(_);return C.join("")})}var Ele=180/Math.PI,kne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ume(o,s,i,u,m,h){var b,C,S;return(b=Math.sqrt(o*o+s*s))&&(o/=b,s/=b),(S=o*i+s*u)&&(i-=o*S,u-=s*S),(C=Math.sqrt(i*i+u*u))&&(i/=C,u/=C,S/=C),o*u<s*i&&(o=-o,s=-s,S=-S,b=-b),{translateX:m,translateY:h,rotate:Math.atan2(s,o)*Ele,skewX:Math.atan(S)*Ele,scaleX:b,scaleY:C}}var FH;function aPe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?kne:ume(s.a,s.b,s.c,s.d,s.e,s.f)}function iPe(o){return o==null||(FH||(FH=document.createElementNS("http://www.w3.org/2000/svg","g")),FH.setAttribute("transform",o),!(o=FH.transform.baseVal.consolidate()))?kne:(o=o.matrix,ume(o.a,o.b,o.c,o.d,o.e,o.f))}function dme(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,B,F,Z){if(_!==O||N!==B){var G=F.push("translate(",null,s,null,i);Z.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,B)})}else(O||B)&&F.push("translate("+O+s+B+i)}function b(_,N,O,B){_!==N?(_-N>180?N+=360:N-_>180&&(_+=360),B.push({i:O.push(m(O)+"rotate(",null,u)-2,x:r2(_,N)})):N&&O.push(m(O)+"rotate("+N+u)}function C(_,N,O,B){_!==N?B.push({i:O.push(m(O)+"skewX(",null,u)-2,x:r2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function S(_,N,O,B,F,Z){if(_!==O||N!==B){var G=F.push(m(F)+"scale(",null,",",null,")");Z.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,B)})}else(O!==1||B!==1)&&F.push(m(F)+"scale("+O+","+B+")")}return function(_,N){var O=[],B=[];return _=o(_),N=o(N),h(_.translateX,_.translateY,N.translateX,N.translateY,O,B),b(_.rotate,N.rotate,O,B),C(_.skewX,N.skewX,O,B),S(_.scaleX,_.scaleY,N.scaleX,N.scaleY,O,B),_=N=null,function(F){for(var Z=-1,G=B.length,Y;++Z<G;)O[(Y=B[Z]).i]=Y.x(F);return O.join("")}}}var lPe=dme(aPe,"px, ","px)","deg)"),cPe=dme(iPe,", ",")",")"),uPe=1e-12;function _le(o){return((o=Math.exp(o))+1/o)/2}function dPe(o){return((o=Math.exp(o))-1/o)/2}function fPe(o){return((o=Math.exp(2*o))-1)/(o+1)}const mPe=function o(s,i,u){function m(h,b){var C=h[0],S=h[1],_=h[2],N=b[0],O=b[1],B=b[2],F=N-C,Z=O-S,G=F*F+Z*Z,Y,q;if(G<uPe)q=Math.log(B/_)/s,Y=function(Q){return[C+Q*F,S+Q*Z,_*Math.exp(s*Q*q)]};else{var W=Math.sqrt(G),L=(B*B-_*_+u*G)/(2*_*i*W),me=(B*B-_*_-u*G)/(2*B*i*W),Ze=Math.log(Math.sqrt(L*L+1)-L),_e=Math.log(Math.sqrt(me*me+1)-me);q=(_e-Ze)/s,Y=function(Q){var Fe=Q*q,lt=_le(Ze),nt=_/(i*W)*(lt*fPe(s*Fe+Ze)-dPe(Ze));return[C+nt*F,S+nt*Z,_*lt/_le(s*Fe+Ze)]}}return Y.duration=q*1e3*s/Math.SQRT2,Y}return m.rho=function(h){var b=Math.max(.001,+h),C=b*b,S=C*C;return o(b,C,S)},m}(Math.SQRT2,2,4);var h4=0,F6=0,B6=0,fme=1e3,Fz,L6,Lz=0,OE=0,PU=0,hR=typeof performance=="object"&&performance.now?performance:Date,mme=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function Hoe(){return OE||(mme(pPe),OE=hR.now()+PU)}function pPe(){OE=0}function Vz(){this._call=this._time=this._next=null}Vz.prototype=pme.prototype={constructor:Vz,restart:function(o,s,i){if(typeof o!="function")throw new TypeError("callback is not a function");i=(i==null?Hoe():+i)+(s==null?0:+s),!this._next&&L6!==this&&(L6?L6._next=this:Fz=this,L6=this),this._call=o,this._time=i,Tne()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tne())}};function pme(o,s,i){var u=new Vz;return u.restart(o,s,i),u}function gPe(){Hoe(),++h4;for(var o=Fz,s;o;)(s=OE-o._time)>=0&&o._call.call(void 0,s),o=o._next;--h4}function kle(){OE=(Lz=hR.now())+PU,h4=F6=0;try{gPe()}finally{h4=0,vPe(),OE=0}}function hPe(){var o=hR.now(),s=o-Lz;s>fme&&(PU-=s,Lz=o)}function vPe(){for(var o,s=Fz,i,u=1/0;s;)s._call?(u>s._time&&(u=s._time),o=s,s=s._next):(i=s._next,s._next=null,s=o?o._next=i:Fz=i);L6=o,Tne(u)}function Tne(o){if(!h4){F6&&(F6=clearTimeout(F6));var s=o-OE;s>24?(o<1/0&&(F6=setTimeout(kle,o-hR.now()-PU)),B6&&(B6=clearInterval(B6))):(B6||(Lz=hR.now(),B6=setInterval(hPe,fme)),h4=1,mme(kle))}}function Tle(o,s,i){var u=new Vz;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var bPe=BU("start","end","cancel","interrupt"),yPe=[],gme=0,Ale=1,Ane=2,iz=3,Nle=4,Nne=5,lz=6;function FU(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;wPe(o,i,{name:s,index:u,group:m,on:bPe,tween:yPe,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:gme})}function zoe(o,s){var i=Ph(o,s);if(i.state>gme)throw new Error("too late; already scheduled");return i}function Fv(o,s){var i=Ph(o,s);if(i.state>iz)throw new Error("too late; already running");return i}function Ph(o,s){var i=o.__transition;if(!i||!(i=i[s]))throw new Error("transition not found");return i}function wPe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=pme(h,0,i.time);function h(_){i.state=Ale,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,B,F;if(i.state!==Ale)return S();for(N in u)if(F=u[N],F.name===i.name){if(F.state===iz)return Tle(b);F.state===Nle?(F.state=lz,F.timer.stop(),F.on.call("interrupt",o,o.__data__,F.index,F.group),delete u[N]):+N<s&&(F.state=lz,F.timer.stop(),F.on.call("cancel",o,o.__data__,F.index,F.group),delete u[N])}if(Tle(function(){i.state===iz&&(i.state=Nle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=Ane,i.on.call("start",o,o.__data__,i.index,i.group),i.state===Ane){for(i.state=iz,m=new Array(B=i.tween.length),N=0,O=-1;N<B;++N)(F=i.tween[N].value.call(o,o.__data__,i.index,i.group))&&(m[++O]=F);m.length=O+1}}function C(_){for(var N=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(S),i.state=Nne,1),O=-1,B=m.length;++O<B;)m[O].call(o,N);i.state===Nne&&(i.on.call("end",o,o.__data__,i.index,i.group),S())}function S(){i.state=lz,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function cz(o,s){var i=o.__transition,u,m,h=!0,b;if(i){s=s==null?null:s+"";for(b in i){if((u=i[b]).name!==s){h=!1;continue}m=u.state>Ane&&u.state<Nne,u.state=lz,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function CPe(o){return this.each(function(){cz(this,o)})}function SPe(o,s){var i,u;return function(){var m=Fv(this,o),h=m.tween;if(h!==i){u=i=h;for(var b=0,C=u.length;b<C;++b)if(u[b].name===s){u=u.slice(),u.splice(b,1);break}}m.tween=u}}function xPe(o,s,i){var u,m;if(typeof i!="function")throw new Error;return function(){var h=Fv(this,o),b=h.tween;if(b!==u){m=(u=b).slice();for(var C={name:s,value:i},S=0,_=m.length;S<_;++S)if(m[S].name===s){m[S]=C;break}S===_&&m.push(C)}h.tween=m}}function EPe(o,s){var i=this._id;if(o+="",arguments.length<2){for(var u=Ph(this.node(),i).tween,m=0,h=u.length,b;m<h;++m)if((b=u[m]).name===o)return b.value;return null}return this.each((s==null?SPe:xPe)(i,o,s))}function Uoe(o,s,i){var u=o._id;return o.each(function(){var m=Fv(this,u);(m.value||(m.value={}))[s]=i.apply(this,arguments)}),function(m){return Ph(m,u).value[s]}}function hme(o,s){var i;return(typeof s=="number"?r2:s instanceof gR?xle:(i=gR(s))?(s=i,xle):rPe)(o,s)}function _Pe(o){return function(){this.removeAttribute(o)}}function kPe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function TPe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttribute(o);return b===m?null:b===u?h:h=s(u=b,i)}}function APe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttributeNS(o.space,o.local);return b===m?null:b===u?h:h=s(u=b,i)}}function NPe(o,s,i){var u,m,h;return function(){var b,C=i(this),S;return C==null?void this.removeAttribute(o):(b=this.getAttribute(o),S=C+"",b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C)))}}function OPe(o,s,i){var u,m,h;return function(){var b,C=i(this),S;return C==null?void this.removeAttributeNS(o.space,o.local):(b=this.getAttributeNS(o.space,o.local),S=C+"",b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C)))}}function $Pe(o,s){var i=IU(o),u=i==="transform"?cPe:hme;return this.attrTween(o,typeof s=="function"?(i.local?OPe:NPe)(i,u,Uoe(this,"attr."+o,s)):s==null?(i.local?kPe:_Pe)(i):(i.local?APe:TPe)(i,u,s))}function DPe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function MPe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function RPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&MPe(o,h)),i}return m._value=s,m}function BPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&DPe(o,h)),i}return m._value=s,m}function IPe(o,s){var i="attr."+o;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(s==null)return this.tween(i,null);if(typeof s!="function")throw new Error;var u=IU(o);return this.tween(i,(u.local?RPe:BPe)(u,s))}function PPe(o,s){return function(){zoe(this,o).delay=+s.apply(this,arguments)}}function FPe(o,s){return s=+s,function(){zoe(this,o).delay=s}}function LPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?PPe:FPe)(s,o)):Ph(this.node(),s).delay}function VPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function HPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function zPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?VPe:HPe)(s,o)):Ph(this.node(),s).duration}function UPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function jPe(o){var s=this._id;return arguments.length?this.each(UPe(s,o)):Ph(this.node(),s).ease}function WPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function ZPe(o){if(typeof o!="function")throw new Error;return this.each(WPe(this._id,o))}function GPe(o){typeof o!="function"&&(o=qfe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],S,_=0;_<b;++_)(S=h[_])&&o.call(S,S.__data__,_,h)&&C.push(S);return new L0(u,this._parents,this._name,this._id)}function qPe(o){if(o._id!==this._id)throw new Error;for(var s=this._groups,i=o._groups,u=s.length,m=i.length,h=Math.min(u,m),b=new Array(u),C=0;C<h;++C)for(var S=s[C],_=i[C],N=S.length,O=b[C]=new Array(N),B,F=0;F<N;++F)(B=S[F]||_[F])&&(O[F]=B);for(;C<u;++C)b[C]=s[C];return new L0(b,this._parents,this._name,this._id)}function YPe(o){return(o+"").trim().split(/^|\s+/).every(function(s){var i=s.indexOf(".");return i>=0&&(s=s.slice(0,i)),!s||s==="start"})}function KPe(o,s,i){var u,m,h=YPe(s)?zoe:Fv;return function(){var b=h(this,o),C=b.on;C!==u&&(m=(u=C).copy()).on(s,i),b.on=m}}function XPe(o,s){var i=this._id;return arguments.length<2?Ph(this.node(),i).on.on(o):this.each(KPe(i,o,s))}function JPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function QPe(){return this.on("end.remove",JPe(this._id))}function e8e(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Foe(o));for(var u=this._groups,m=u.length,h=new Array(m),b=0;b<m;++b)for(var C=u[b],S=C.length,_=h[b]=new Array(S),N,O,B=0;B<S;++B)(N=C[B])&&(O=o.call(N,N.__data__,B,C))&&("__data__"in N&&(O.__data__=N.__data__),_[B]=O,FU(_[B],s,i,B,_,Ph(N,i)));return new L0(h,this._parents,s,i)}function t8e(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Gfe(o));for(var u=this._groups,m=u.length,h=[],b=[],C=0;C<m;++C)for(var S=u[C],_=S.length,N,O=0;O<_;++O)if(N=S[O]){for(var B=o.call(N,N.__data__,O,S),F,Z=Ph(N,i),G=0,Y=B.length;G<Y;++G)(F=B[G])&&FU(F,s,i,G,B,Z);h.push(B),b.push(N)}return new L0(h,b,s,i)}var n8e=PR.prototype.constructor;function o8e(){return new n8e(this._groups,this._parents)}function s8e(o,s){var i,u,m;return function(){var h=g4(this,o),b=(this.style.removeProperty(o),g4(this,o));return h===b?null:h===i&&b===u?m:m=s(i=h,u=b)}}function vme(o){return function(){this.style.removeProperty(o)}}function r8e(o,s,i){var u,m=i+"",h;return function(){var b=g4(this,o);return b===m?null:b===u?h:h=s(u=b,i)}}function a8e(o,s,i){var u,m,h;return function(){var b=g4(this,o),C=i(this),S=C+"";return C==null&&(S=C=(this.style.removeProperty(o),g4(this,o))),b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C))}}function i8e(o,s){var i,u,m,h="style."+s,b="end."+h,C;return function(){var S=Fv(this,o),_=S.on,N=S.value[h]==null?C||(C=vme(s)):void 0;(_!==i||m!==N)&&(u=(i=_).copy()).on(b,m=N),S.on=u}}function l8e(o,s,i){var u=(o+="")=="transform"?lPe:hme;return s==null?this.styleTween(o,s8e(o,u)).on("end.style."+o,vme(o)):typeof s=="function"?this.styleTween(o,a8e(o,u,Uoe(this,"style."+o,s))).each(i8e(this._id,o)):this.styleTween(o,r8e(o,u,s),i).on("end.style."+o,null)}function c8e(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function u8e(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&c8e(o,b,i)),u}return h._value=s,h}function d8e(o,s,i){var u="style."+(o+="");if(arguments.length<2)return(u=this.tween(u))&&u._value;if(s==null)return this.tween(u,null);if(typeof s!="function")throw new Error;return this.tween(u,u8e(o,s,i??""))}function f8e(o){return function(){this.textContent=o}}function m8e(o){return function(){var s=o(this);this.textContent=s??""}}function p8e(o){return this.tween("text",typeof o=="function"?m8e(Uoe(this,"text",o)):f8e(o==null?"":o+""))}function g8e(o){return function(s){this.textContent=o.call(this,s)}}function h8e(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&g8e(m)),s}return u._value=o,u}function v8e(o){var s="text";if(arguments.length<1)return(s=this.tween(s))&&s._value;if(o==null)return this.tween(s,null);if(typeof o!="function")throw new Error;return this.tween(s,h8e(o))}function b8e(){for(var o=this._name,s=this._id,i=bme(),u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,S,_=0;_<C;++_)if(S=b[_]){var N=Ph(S,s);FU(S,o,i,_,b,{time:N.time+N.delay+N.duration,delay:0,duration:N.duration,ease:N.ease})}return new L0(u,this._parents,o,i)}function y8e(){var o,s,i=this,u=i._id,m=i.size();return new Promise(function(h,b){var C={value:b},S={value:function(){--m===0&&h()}};i.each(function(){var _=Fv(this,u),N=_.on;N!==o&&(s=(o=N).copy(),s._.cancel.push(C),s._.interrupt.push(C),s._.end.push(S)),_.on=s}),m===0&&h()})}var w8e=0;function L0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function bme(){return++w8e}var O0=PR.prototype;L0.prototype={constructor:L0,select:e8e,selectAll:t8e,selectChild:O0.selectChild,selectChildren:O0.selectChildren,filter:GPe,merge:qPe,selection:o8e,transition:b8e,call:O0.call,nodes:O0.nodes,node:O0.node,size:O0.size,empty:O0.empty,each:O0.each,on:XPe,attr:$Pe,attrTween:IPe,style:l8e,styleTween:d8e,text:p8e,textTween:v8e,remove:QPe,tween:EPe,delay:LPe,duration:zPe,ease:jPe,easeVarying:ZPe,end:y8e,[Symbol.iterator]:O0[Symbol.iterator]};function C8e(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var S8e={time:null,delay:0,duration:250,ease:C8e};function x8e(o,s){for(var i;!(i=o.__transition)||!(i=i[s]);)if(!(o=o.parentNode))throw new Error(`transition ${s} not found`);return i}function E8e(o){var s,i;o instanceof L0?(s=o._id,o=o._name):(s=bme(),(i=S8e).time=Hoe(),o=o==null?null:o+"");for(var u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,S,_=0;_<C;++_)(S=b[_])&&FU(S,o,s,_,b,i||x8e(S,s));return new L0(u,this._parents,o,s)}PR.prototype.interrupt=CPe;PR.prototype.transition=E8e;const LH=o=>()=>o;function _8e(o,{sourceEvent:s,target:i,transform:u,dispatch:m}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:m}})}function B0(o,s,i){this.k=o,this.x=s,this.y=i}B0.prototype={constructor:B0,scale:function(o){return o===1?this:new B0(this.k*o,this.x,this.y)},translate:function(o,s){return o===0&s===0?this:new B0(this.k,this.x+this.k*o,this.y+this.k*s)},apply:function(o){return[o[0]*this.k+this.x,o[1]*this.k+this.y]},applyX:function(o){return o*this.k+this.x},applyY:function(o){return o*this.k+this.y},invert:function(o){return[(o[0]-this.x)/this.k,(o[1]-this.y)/this.k]},invertX:function(o){return(o-this.x)/this.k},invertY:function(o){return(o-this.y)/this.k},rescaleX:function(o){return o.copy().domain(o.range().map(this.invertX,this).map(o.invert,o))},rescaleY:function(o){return o.copy().domain(o.range().map(this.invertY,this).map(o.invert,o))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var v4=new B0(1,0,0);B0.prototype;function yte(o){o.stopImmediatePropagation()}function I6(o){o.preventDefault(),o.stopImmediatePropagation()}function k8e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function T8e(){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 Ole(){return this.__zoom||v4}function A8e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function N8e(){return navigator.maxTouchPoints||"ontouchstart"in this}function O8e(o,s,i){var u=o.invertX(s[0][0])-i[0][0],m=o.invertX(s[1][0])-i[1][0],h=o.invertY(s[0][1])-i[0][1],b=o.invertY(s[1][1])-i[1][1];return o.translate(m>u?(u+m)/2:Math.min(0,u)||Math.max(0,m),b>h?(h+b)/2:Math.min(0,h)||Math.max(0,b))}function $8e(){var o=k8e,s=T8e,i=O8e,u=A8e,m=N8e,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,S=mPe,_=BU("start","zoom","end"),N,O,B,F=500,Z=150,G=0,Y=10;function q(ge){ge.property("__zoom",Ole).on("wheel.zoom",Fe,{passive:!1}).on("mousedown.zoom",lt).on("dblclick.zoom",nt).filter(m).on("touchstart.zoom",$e).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",Nt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}q.transform=function(ge,Oe,R,je){var ye=ge.selection?ge.selection():ge;ye.property("__zoom",Ole),ge!==ye?Ze(ge,Oe,R,je):ye.interrupt().each(function(){_e(this,arguments).event(je).start().zoom(null,typeof Oe=="function"?Oe.apply(this,arguments):Oe).end()})},q.scaleBy=function(ge,Oe,R,je){q.scaleTo(ge,function(){var ye=this.__zoom.k,tt=typeof Oe=="function"?Oe.apply(this,arguments):Oe;return ye*tt},R,je)},q.scaleTo=function(ge,Oe,R,je){q.transform(ge,function(){var ye=s.apply(this,arguments),tt=this.__zoom,st=R==null?me(ye):typeof R=="function"?R.apply(this,arguments):R,he=tt.invert(st),Ge=typeof Oe=="function"?Oe.apply(this,arguments):Oe;return i(L(W(tt,Ge),st,he),ye,b)},R,je)},q.translateBy=function(ge,Oe,R,je){q.transform(ge,function(){return i(this.__zoom.translate(typeof Oe=="function"?Oe.apply(this,arguments):Oe,typeof R=="function"?R.apply(this,arguments):R),s.apply(this,arguments),b)},null,je)},q.translateTo=function(ge,Oe,R,je,ye){q.transform(ge,function(){var tt=s.apply(this,arguments),st=this.__zoom,he=je==null?me(tt):typeof je=="function"?je.apply(this,arguments):je;return i(v4.translate(he[0],he[1]).scale(st.k).translate(typeof Oe=="function"?-Oe.apply(this,arguments):-Oe,typeof R=="function"?-R.apply(this,arguments):-R),tt,b)},je,ye)};function W(ge,Oe){return Oe=Math.max(h[0],Math.min(h[1],Oe)),Oe===ge.k?ge:new B0(Oe,ge.x,ge.y)}function L(ge,Oe,R){var je=Oe[0]-R[0]*ge.k,ye=Oe[1]-R[1]*ge.k;return je===ge.x&&ye===ge.y?ge:new B0(ge.k,je,ye)}function me(ge){return[(+ge[0][0]+ +ge[1][0])/2,(+ge[0][1]+ +ge[1][1])/2]}function Ze(ge,Oe,R,je){ge.on("start.zoom",function(){_e(this,arguments).event(je).start()}).on("interrupt.zoom end.zoom",function(){_e(this,arguments).event(je).end()}).tween("zoom",function(){var ye=this,tt=arguments,st=_e(ye,tt).event(je),he=s.apply(ye,tt),Ge=R==null?me(he):typeof R=="function"?R.apply(ye,tt):R,Tt=Math.max(he[1][0]-he[0][0],he[1][1]-he[0][1]),ze=ye.__zoom,vt=typeof Oe=="function"?Oe.apply(ye,tt):Oe,Be=S(ze.invert(Ge).concat(Tt/ze.k),vt.invert(Ge).concat(Tt/vt.k));return function(ft){if(ft===1)ft=vt;else{var oe=Be(ft),pn=Tt/oe[2];ft=new B0(pn,Ge[0]-oe[0]*pn,Ge[1]-oe[1]*pn)}st.zoom(null,ft)}})}function _e(ge,Oe,R){return!R&&ge.__zooming||new Q(ge,Oe)}function Q(ge,Oe){this.that=ge,this.args=Oe,this.active=0,this.sourceEvent=null,this.extent=s.apply(ge,Oe),this.taps=0}Q.prototype={event:function(ge){return ge&&(this.sourceEvent=ge),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(ge,Oe){return this.mouse&&ge!=="mouse"&&(this.mouse[1]=Oe.invert(this.mouse[0])),this.touch0&&ge!=="touch"&&(this.touch0[1]=Oe.invert(this.touch0[0])),this.touch1&&ge!=="touch"&&(this.touch1[1]=Oe.invert(this.touch1[0])),this.that.__zoom=Oe,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(ge){var Oe=Mh(this.that).datum();_.call(ge,this.that,new _8e(ge,{sourceEvent:this.sourceEvent,target:q,type:ge,transform:this.that.__zoom,dispatch:_}),Oe)}};function Fe(ge,...Oe){if(!o.apply(this,arguments))return;var R=_e(this,Oe).event(ge),je=this.__zoom,ye=Math.max(h[0],Math.min(h[1],je.k*Math.pow(2,u.apply(this,arguments)))),tt=Nv(ge);if(R.wheel)(R.mouse[0][0]!==tt[0]||R.mouse[0][1]!==tt[1])&&(R.mouse[1]=je.invert(R.mouse[0]=tt)),clearTimeout(R.wheel);else{if(je.k===ye)return;R.mouse=[tt,je.invert(tt)],cz(this),R.start()}I6(ge),R.wheel=setTimeout(st,Z),R.zoom("mouse",i(L(W(je,ye),R.mouse[0],R.mouse[1]),R.extent,b));function st(){R.wheel=null,R.end()}}function lt(ge,...Oe){if(B||!o.apply(this,arguments))return;var R=ge.currentTarget,je=_e(this,Oe,!0).event(ge),ye=Mh(ge.view).on("mousemove.zoom",Ge,!0).on("mouseup.zoom",Tt,!0),tt=Nv(ge,R),st=ge.clientX,he=ge.clientY;sme(ge.view),yte(ge),je.mouse=[tt,this.__zoom.invert(tt)],cz(this),je.start();function Ge(ze){if(I6(ze),!je.moved){var vt=ze.clientX-st,Be=ze.clientY-he;je.moved=vt*vt+Be*Be>G}je.event(ze).zoom("mouse",i(L(je.that.__zoom,je.mouse[0]=Nv(ze,R),je.mouse[1]),je.extent,b))}function Tt(ze){ye.on("mousemove.zoom mouseup.zoom",null),rme(ze.view,je.moved),I6(ze),je.event(ze).end()}}function nt(ge,...Oe){if(o.apply(this,arguments)){var R=this.__zoom,je=Nv(ge.changedTouches?ge.changedTouches[0]:ge,this),ye=R.invert(je),tt=R.k*(ge.shiftKey?.5:2),st=i(L(W(R,tt),je,ye),s.apply(this,Oe),b);I6(ge),C>0?Mh(this).transition().duration(C).call(Ze,st,je,ge):Mh(this).call(q.transform,st,je,ge)}}function $e(ge,...Oe){if(o.apply(this,arguments)){var R=ge.touches,je=R.length,ye=_e(this,Oe,ge.changedTouches.length===je).event(ge),tt,st,he,Ge;for(yte(ge),st=0;st<je;++st)he=R[st],Ge=Nv(he,this),Ge=[Ge,this.__zoom.invert(Ge),he.identifier],ye.touch0?!ye.touch1&&ye.touch0[2]!==Ge[2]&&(ye.touch1=Ge,ye.taps=0):(ye.touch0=Ge,tt=!0,ye.taps=1+!!N);N&&(N=clearTimeout(N)),tt&&(ye.taps<2&&(O=Ge[0],N=setTimeout(function(){N=null},F)),cz(this),ye.start())}}function ue(ge,...Oe){if(this.__zooming){var R=_e(this,Oe).event(ge),je=ge.changedTouches,ye=je.length,tt,st,he,Ge;for(I6(ge),tt=0;tt<ye;++tt)st=je[tt],he=Nv(st,this),R.touch0&&R.touch0[2]===st.identifier?R.touch0[0]=he:R.touch1&&R.touch1[2]===st.identifier&&(R.touch1[0]=he);if(st=R.that.__zoom,R.touch1){var Tt=R.touch0[0],ze=R.touch0[1],vt=R.touch1[0],Be=R.touch1[1],ft=(ft=vt[0]-Tt[0])*ft+(ft=vt[1]-Tt[1])*ft,oe=(oe=Be[0]-ze[0])*oe+(oe=Be[1]-ze[1])*oe;st=W(st,Math.sqrt(ft/oe)),he=[(Tt[0]+vt[0])/2,(Tt[1]+vt[1])/2],Ge=[(ze[0]+Be[0])/2,(ze[1]+Be[1])/2]}else if(R.touch0)he=R.touch0[0],Ge=R.touch0[1];else return;R.zoom("touch",i(L(st,he,Ge),R.extent,b))}}function Nt(ge,...Oe){if(this.__zooming){var R=_e(this,Oe).event(ge),je=ge.changedTouches,ye=je.length,tt,st;for(yte(ge),B&&clearTimeout(B),B=setTimeout(function(){B=null},F),tt=0;tt<ye;++tt)st=je[tt],R.touch0&&R.touch0[2]===st.identifier?delete R.touch0:R.touch1&&R.touch1[2]===st.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(st=Nv(st,this),Math.hypot(O[0]-st[0],O[1]-st[1])<Y)){var he=Mh(this).on("dblclick.zoom");he&&he.apply(this,arguments)}}}return q.wheelDelta=function(ge){return arguments.length?(u=typeof ge=="function"?ge:LH(+ge),q):u},q.filter=function(ge){return arguments.length?(o=typeof ge=="function"?ge:LH(!!ge),q):o},q.touchable=function(ge){return arguments.length?(m=typeof ge=="function"?ge:LH(!!ge),q):m},q.extent=function(ge){return arguments.length?(s=typeof ge=="function"?ge:LH([[+ge[0][0],+ge[0][1]],[+ge[1][0],+ge[1][1]]]),q):s},q.scaleExtent=function(ge){return arguments.length?(h[0]=+ge[0],h[1]=+ge[1],q):[h[0],h[1]]},q.translateExtent=function(ge){return arguments.length?(b[0][0]=+ge[0][0],b[1][0]=+ge[1][0],b[0][1]=+ge[0][1],b[1][1]=+ge[1][1],q):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},q.constrain=function(ge){return arguments.length?(i=ge,q):i},q.duration=function(ge){return arguments.length?(C=+ge,q):C},q.interpolate=function(ge){return arguments.length?(S=ge,q):S},q.on=function(){var ge=_.on.apply(_,arguments);return ge===_?q:ge},q.clickDistance=function(ge){return arguments.length?(G=(ge=+ge)*ge,q):Math.sqrt(G)},q.tapDistance=function(ge){return arguments.length?(Y=+ge,q):Y},q}var ss=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(ss||{}),joe=(o=>(o.Partial="partial",o.Full="full",o))(joe||{}),mE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(mE||{}),b2=(o=>(o.Strict="strict",o.Loose="loose",o))(b2||{}),Hz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(Hz||{}),K6=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(K6||{}),yme=(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))(yme||{});const D8e=["INPUT","SELECT","TEXTAREA"];function One(o){var s,i;const u=((i=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:i[0])||o.target,m=typeof(u==null?void 0:u.hasAttribute)=="function"?u.hasAttribute("contenteditable"):!1,h=typeof(u==null?void 0:u.closest)=="function"?u.closest(".nokey"):null;return D8e.includes(u==null?void 0:u.nodeName)||m||!!h}function M8e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function $le(o,s,i,u){const m=s.replace("+",`
|
|
120
120
|
`).replace(`
|
|
121
121
|
|
|
122
122
|
`,`
|